Recent

Author Topic: good style: is there a way to make a message dialog NOT "ShowModal"?  (Read 540 times)

Nicole

  • Hero Member
  • *****
  • Posts: 1271
There is a tricky idea, which is solvable, but shall not be ugly or work fuzzy.

This is the setup:
A method receives an array of records.
This array is itereated by for i:=0 to high...
The values are written (each!) into edit fields or a form like this
myedit.text:=array.myword;
myedit2.text:=array.myword2;

It would be easy to make a message-dialog asking, if the values shall be written into the database. Then the loop is fine, the values are written to the database or they are not.

BUT it would be great, if the user would be able to modify the edit fields additinally.

How to do this without doing really strange things?

a)
I can put a button onto my form saying "write the values to the database".
The user would not be able to click it, because the methods' loop enforces the dialog-"do you want to write it to the DB" runs to its end.

b)
I can interrupt the loop-dialog and allow to edit the edits on the form and click a button for writing them into the database.
But how to find the digit of the array having been used and which not?

To put it differently: The user will want to have a mix of autofill from the array and edit items of edit-inputs by hand.

Any ideas?
Thanks.

jamie

  • Hero Member
  • *****
  • Posts: 7330
Re: good style: is there a way to make a message dialog NOT "ShowModal"?
« Reply #1 on: October 04, 2025, 09:27:30 pm »
You must be referring to a Stay on Top Form?

Create a form with all your needed fields and set the style as fsstayonTop, that will allow you to still interact with other parts of the application while that is showing.
The only true wisdom is knowing you know nothing

d2010

  • Full Member
  • ***
  • Posts: 230
Re: good style: is there a way to make a message dialog NOT "ShowModal"?
« Reply #2 on: October 05, 2025, 02:50:17 pm »
There is a tricky idea, which is solvable, but shall not be ugly or work fuzzy.
This is the setup:
A method receives an array of records.
This array is itereated by for i:=0 to high...
The values are written (each!) into edit fields or a form like this
myedit.text:=array.myword;
myedit2.text:=array.myword2;

It would be easy to make a message-dialog asking, if the values shall be written into the database. Then the loop is fine, the values are written to the database or they are not.

BUT it would be great, if the user would be able to modify the edit fields additinally.

How to do this without doing really strange things?

a)
I can put a button onto my form saying "write the values to the database".
The user would not be able to click it, because the methods' loop enforces the dialog-"do you want to write it to the DB" runs to its end.

b)
I can interrupt the loop-dialog and allow to edit the edits on the form and click a button for writing them into the database.
But how to find the digit of the array having been used and which not?

To put it differently: The user will want to have a mix of autofill from the array and edit items of edit-inputs by hand.

Any ideas?
Thanks.

Please you watch this video
My application ,devcinfo.exe display  many birds and eggs love lover, but in second
screeen, ; the same devcinfo.exe and him -inside, He call other .dll
 with  --  Your your-question  , but He work continue, He  do not stop working
my task He  do not stop work, until the user click on Yes or No.
https://sourceforge.net/projects/vlxc-codoclisp/files/Source4Lazarus/popa_lazarus12arsenie2025boca.mp4/download
Please downloading , you see both,
https://sourceforge.net/projects/vlxc-codoclisp/files/Source4Lazarus/
Doamne ajuta, Parintele Cleopa roaga-te pentru pacatosi. ;D

If you have the question?, then , you send PM. to me.
Ps:  I need work team, or online collaborate for upgrade together as new questions from you, or new-forms (edit, labels, edit, caption, memo.txt)
« Last Edit: October 05, 2025, 03:02:30 pm by d2010 »

Thaddy

  • Hero Member
  • *****
  • Posts: 18376
  • Here stood a man who saw the Elbe and jumped it.
Re: good style: is there a way to make a message dialog NOT "ShowModal"?
« Reply #3 on: October 05, 2025, 03:57:19 pm »
Toolwindow. These are floating style and stay on top, but not modal.
At least on Windows that should work, but it is much easier to do that in Delphi.
« Last Edit: October 05, 2025, 04:30:37 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Nicole

  • Hero Member
  • *****
  • Posts: 1271
Re: good style: is there a way to make a message dialog NOT "ShowModal"?
« Reply #4 on: October 06, 2025, 09:02:15 am »
Thank you for the replies.
The trouble is: I do not work with forms, but with frames.

My app is huge and has nearly 30 frames. Those frames get parents in form create.
And those parents live on tabsheets of TPageControls wich have other PageControls as base.

To find the ancestors of any part in my app is rather tricky and takes some code lines in the meanwhile. The form is done already, and it interacts with my database. So it is not flexible any more.

I would love to set one parameter like "do not stay on top", but wonder, if it would work in my case, I bet not.

This video with the bird, thank you for posting it.
I feel overwhelmed. I watched it and all I understood is: hoopoe.

What I thought and did not do it, because of "that ugly":
Somewhere an additional edit field, where the iteration number is stored. The user can click ok and got on with the loop from this setting. This is terrible style, because I interact visually with the code which shall run for itsself.

A second idea was to sort it by date and to have a DateTimePicker, which does the same for me. A little bit less ugly, because the user cannot destroy the format of the needed value.


 

TinyPortal © 2005-2018