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 


Multiple Dialogs Example?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Sun Feb 20, 2005 7:35 am    Post subject: Multiple Dialogs Example? Reply with quote

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


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

PostPosted: Sun Feb 20, 2005 10:31 am    Post subject: Reply with quote

The last post here is a simple example of sending messages
to two windows:

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
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Sun Feb 20, 2005 11:51 am    Post subject: Reply with quote

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


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

PostPosted: Mon Feb 21, 2005 8:25 am    Post subject: Reply with quote

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. Confused

Other than that, it's pretty much straightforward. Wink

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
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Feb 21, 2005 2:29 pm    Post subject: Reply with quote

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


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

PostPosted: Mon Feb 21, 2005 2:56 pm    Post subject: Reply with quote

Prolly not a bad idea Serge. Wink

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. Wink

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
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Feb 21, 2005 3:04 pm    Post subject: Reply with quote

excellent idea mac Very Happy

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Mon Feb 21, 2005 3:38 pm    Post subject: Reply with quote

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


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Feb 21, 2005 4:02 pm    Post subject: Reply with quote

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 Smile As they say, if it
ain't broke, don't fix it Wink

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Feb 22, 2005 12:13 am    Post subject: Reply with quote

that might be a good idea jules

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Tue Feb 22, 2005 8:08 am    Post subject: Reply with quote

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


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Feb 22, 2005 8:24 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Feb 22, 2005 8:34 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Tue Feb 22, 2005 8:40 am    Post subject: Reply with quote

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
Sad

Regards.

_________________
John Trappett
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue Feb 22, 2005 9:10 am    Post subject: Reply with quote

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

 
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