forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help on child dialogs!

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Mon Apr 29, 2002 5:39 pm    Post subject: Help on child dialogs! Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Apr 29, 2002 7:14 pm    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Mon Apr 29, 2002 7:17 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Apr 29, 2002 7:29 pm    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
moke
Contributor
Contributor


Joined: 02 Jan 2002
Posts: 162

PostPosted: Mon Apr 29, 2002 8:07 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message Send e-mail
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Apr 30, 2002 12:26 pm    Post subject: Excellent! Thanks Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group