| View previous topic :: View next topic |
| Author |
Message |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Mon Apr 29, 2002 5:39 pm Post subject: Help on child dialogs! |
|
|
I am writing a program that I am having trouble with. Any help is much appreciated.
Here is a typical use of the program:
1.) A dialog (dialog 0) is created, with a progress bar as data is loaded. It is then closed.
2.) The main menu dialog (dialog 1) is created and shown.
3.) The user chooses "View accounts". A search dialog is created (dialog 2) and the user selects an account to view. This dialog is closed (because it is modal.)
4.) The account screen is shown (dialog 3.) On this dialog, the user may choose "Take payment" which opens a child dialog (dialog 4)where the payment information is taken.
Here is where the problem comes in. I can take all the data, and then close this dialog(#4), but that sets the active dialog to 0 (when I debug it.) Then, I can SELECT DIALOG, 3 to get back to the previous dialog (the account dialog). This works fine if the user uses the program in that order.
BUT - if the user goes to another part of the program first, then instead of dialog 3, the account screen might be dialog 5 (or some other number.)
SO - to sum up this very long post - how can I either get the program to default to the last used dialog when one is closed, OR get the dialog number of a particular dialog?
Thanks for any help - |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Apr 29, 2002 7:14 pm Post subject: |
|
|
Child dialogs remain in numbered sequence, and no
matter which one is opened/closed, the remaining
dialogs will be re-numbered in order (0, 1, 2, 3, etc.).
Your main program dialog is always 0.
So if you have dialogs 0-3 open and close dialog 1,
dialog 3 becomes dialog 2, and dialog 2 becomes
dialog 1.
You can monitor the dialog numbers using a list
with the dialog titles. Simply add the title name to
the list when it's opened, then find and delete it
when it closes. The dialog number will always be
the @index() number of the title in the list.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361

Last edited by Mac on Mon Apr 29, 2002 7:17 pm; edited 1 time in total |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Mon Apr 29, 2002 7:17 pm Post subject: |
|
|
You can store the last dialog used in a variable and the set
that current after a dialog is closed. All you need to do is
in your :evloop statement use Parse "%e;%d", @event(D).
%e will be the event and %D will be the dialog number.
Hope that helps! _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Apr 29, 2002 7:29 pm Post subject: |
|
|
BTW, there's a simple child dialog example in the
VDS 3 source code section that demonstrates parsing
the event (as LiquidCode mentioned) and how to close
the appropriate dialog:
http://www.vdsworld.com/forum/viewtopic.php?t=98
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
moke Contributor

Joined: 02 Jan 2002 Posts: 162
|
Posted: Mon Apr 29, 2002 8:07 pm Post subject: |
|
|
You may also want to try hiding certain dialogs so the user can't open something until it is appropriate for them to do so. It sounds like you want to make sure the user follws a certain procedure so you could also disable certain elemtents until the criteria for your app is met.
moke  |
|
| Back to top |
|
 |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Tue Apr 30, 2002 12:26 pm Post subject: Excellent! Thanks |
|
|
Wow - thanks for the quick, helpful replies.
Using the optional {D} parameter for the @event() function will work best in my case. I implemented it and it works like a charm. I completely missed that in the help file.
Believe it or not, I'm rewriting a 15000-line clipper app my small finance company uses and I'm using VDS to do it. (A lot of the old program was data entry and screen manipulation anyway - much easier in VDS, of course.) I continue to be impressed with VDS and the helpfulness of this forum.
Thanks again. |
|
| Back to top |
|
 |
|