| View previous topic :: View next topic |
| Author |
Message |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Sun Feb 20, 2005 7:35 am Post subject: Multiple Dialogs Example? |
|
|
In the multiple dialogs demo that ships with VDS it reads:
| Code: | REM With a non-modal child dialog any of the buttons and dialog
REM elements can generate events, including those on other dialogs,
REM and so you have to find out which dialog they came from by
REM using @event(D). For most applications, as here, while the
REM child dialog is showing you don't want to respond to events
REM from the main window so the usual response is to sound a warning
REM beep and activate the dialog the user is supposed to be using.
REM It is possible to write scripts in which events can legitimately
REM be received from any dialog that is showing (such as the VDS
REM Dialog Designer) but this is complicated stuff for advanced
REM programmers only.
|
Can anyone give a small example of how to implement what is described in the 2nd paragraph, ie. a script in which events can legitimately be received from any dialog that is showing?
Regards. _________________ John Trappett |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
|
| Back to top |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Sun Feb 20, 2005 11:51 am Post subject: |
|
|
Thanks Mac. I'm assume the Timer event is not necessary but is just used in this instance to show how to send messages to either window and that the main thing to note is the EVLOOP and event handling. It doesn't seem difficult at all... or does the difficulty envisaged in the rem statements of the multi-dialog example apply when you have more than 2 dialogs and have to keep track of them?
Regards. _________________ John Trappett |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Feb 21, 2005 8:25 am Post subject: |
|
|
Actually the most inconvenient aspect of the whole thing
(in my opinion) is the fact that child window ID numbers
don't stay the same when ya close one - all numbers above
the one ya close decrement so there are no gaps in the
numeric sequence.
Other than that, it's pretty much straightforward.
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 |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Feb 21, 2005 2:29 pm Post subject: |
|
|
one little trick i use when i have several child windows is to create them all when the program runs and then hide the ones i don't want seen
and when a user clicks on a window to "open", i just unhide it
this way my numeric sequence stays the same and i know which child has which number
serge _________________
|
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Feb 21, 2005 2:56 pm Post subject: |
|
|
Prolly not a bad idea Serge.
Ya can also store window names in a list - if ya add/delete
names as they are created/closed, the list index number
will always be the matching dialog number for that name.
Just remember to store the main window first, as its number
is always zero.
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 |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Feb 21, 2005 3:04 pm Post subject: |
|
|
excellent idea mac
serge _________________
|
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Mon Feb 21, 2005 3:38 pm Post subject: |
|
|
What would be the best solution to this? Not having the ID change isn't really an option, because the dialogs really are stored in a list, so when you close one from lower down the list, the higher ones all move down one. And changing the behavior would break programs that rely on this.
Perhaps what's needed is a @DLGID() function that returns the current ID of a named child dialog? _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Feb 21, 2005 4:02 pm Post subject: |
|
|
| jules wrote: | What would be the best solution to this? Not having the ID change isn't really an option, because the dialogs really are stored in a list, so when you close one from lower down the list, the higher ones all move down one. And changing the behavior would break programs that rely on this.
Perhaps what's needed is a @DLGID() function that returns the current ID of a named child dialog? |
Adding the @DLGID() function will not only be easier for you to implement
but is really a better idea than reinventing the wheel As they say, if it
ain't broke, don't fix it  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Feb 22, 2005 12:13 am Post subject: |
|
|
that might be a good idea jules
serge _________________
|
|
| Back to top |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Tue Feb 22, 2005 8:08 am Post subject: |
|
|
Serge,
I've tried your idea of creating and hiding the child dialogs initially. It seems to work fine for the most part but I'm having trouble positioning the child windows where I want them to be.
I base the child window position on the main dialog. When it comes time to SHOW the child dialog I'm trying to position the window using the WINDOW POSITION command. However, I can't seem to do it while the window is hidden. Yet, if I unhide the window and then position it with the very next statement I see a visible jump of the window on screen.
Is there any way to position the child window while it is still hidden?
Regards. _________________ John Trappett |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Feb 22, 2005 8:24 am Post subject: |
|
|
hi trapper,
off hand i don't know as i never tried what you are trying to do - what about initally creating the dialogs where you want them prior to hiding them so when you unhide them then they will be where you want them?
serge _________________
|
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Feb 22, 2005 8:34 am Post subject: |
|
|
hi again,
i just tried with one of my programs and i can move the dialog while hidden so i'm not sure what happened at your end
i tried using vds 5 on windows 98se
the code i used was
| Code: |
window position, %%keywords_popup,0,0,
window normal, %%keywords_popup
|
where %%keywords_popup is the name of my dialog - note that i did not create my dialogs with a title but just with DIALOG CREATE...
also i am using WINDOW HIDE and WINDOW NORMAL to hide and show respectively
serge _________________
|
|
| Back to top |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Tue Feb 22, 2005 8:40 am Post subject: |
|
|
Ok.. I'll try again with WINDOW HIDE and WINDOW NORMAL... I was using DIALOG HIDE and DIALOG SHOW.
It's not much use initially creating them where I want them to be as they are based on the position of the main dialog, which the user may reposition by dragging anytime they are using the program.
I've got to go to rush off to work so I'll have to wait till later though
Regards. _________________ John Trappett |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Tue Feb 22, 2005 9:10 am Post subject: |
|
|
| Serge wrote: | that might be a good idea jules
serge |
What about DIALOG SELECT, <window title> or DIALOG SELECT, <window class> ? _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
|