| View previous topic :: View next topic |
| Author |
Message |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Feb 22, 2005 9:20 am Post subject: |
|
|
jules,
is there a problem with creating child dialogs using TITLE? i remember having to avoid it but can't remember why
otherwise, the first idea sounds good (or both to be consistent with the main dialog options)
serge _________________
|
|
| Back to top |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Wed Feb 23, 2005 2:14 am Post subject: |
|
|
| Serge wrote: | | also i am using WINDOW HIDE and WINDOW NORMAL to hide and show respectively |
Serge,
I find I can't just use WINDOW HIDE and WINDOW NORMAL. It seems unless there is an initial DIALOG SHOW that all WINDOW NORMAL does is display an empty window... no dialog elements are visible. Yet, if I use an initial DIALOG SHOW before a WINDOW HIDE I'm still seeing the child window very briefly flash on screen.
Could you perhaps include some example code or outline the steps to firstly create and hide the child window, then how to unhide and hide it in normal use?
Regards. _________________ John Trappett |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Feb 23, 2005 8:44 am Post subject: |
|
|
hi trapper,
you are absolutely right in your observation and the program that i have that has a child dialog poping on and off does flash ever so briefly before disappearing
i'm sorry but i can't help you in the case of not using DIALOG SHOW and being able to reposition the dialog before showing it as i have mine working jsut fine but it does show briefly
serge _________________
|
|
| Back to top |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Wed Feb 23, 2005 9:10 am Post subject: |
|
|
Ok... thanks anyway Serge.
I was wondering then whether anyone has some example code of how they use a LIST to keep track of window IDs in a multi-dialog program?
Regards. _________________ John Trappett |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Wed Feb 23, 2005 9:43 am Post subject: |
|
|
| Serge wrote: | jules,
is there a problem with creating child dialogs using TITLE? i remember having to avoid it but can't remember why
otherwise, the first idea sounds good (or both to be consistent with the main dialog options)
serge |
I don't understand the connection. The TITLE command setts the application title for use on message boxes and so on. It has nothing to do with the title bar of windows and dialogs, which is set using DIALOG TITLE. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Wed Feb 23, 2005 10:50 am Post subject: |
|
|
| trapper wrote: | | I was wondering then whether anyone has some example code of how they use a LIST to keep track of window IDs in a multi-dialog program?Regards. |
To answer my own question I was thinking something simple like this might suffice:
| Code: | #DEFINE COMMAND, DialogID
#DEFINE FUNCTION, DialogID
:DialogID
if @equal(%1,Add)
list add, %%WinList, %2
elsif @equal(%1,Delete)
list seek, %%WinList, 0
%R = @match(%%WinList,%2)
list delete, %%WinList
elsif @numeric(%1)
%R = @item(%%WinList,%1)
else
list seek, %%WinList, 0
%R = @match(%%WinList,%1)
%R = @index(%%WinList)
end
exit %R
|
At the beginning of my program I declare and create the list %%WinList.
As soon as I DIALOG SHOW the main dialog I issue the command:
| Code: | | DialogID Add, <MainDialogName> |
.. so it will be in index position 0 in the list which of course corresponds to its position in the internal list maintained by VDS.
From then on as I SHOW and CLOSE child dialogs I follow with these commands as appropriate:
| Code: | DialogID Add, <ChildDlgName>
DialogID Delete, <ChildDlgName> |
.. and this will keep the list properly updated.
If I want to know the ID of a particular child dialog I use the function:
| Code: | | @DialogID(<ChildDlgName>) |
If I have a child dialog's ID from @event() and want to pass control to the correct event I can use the DialogID function in a Goto call as follows:
| Code: | | goto @DialogID(%D)_EventName |
(Child Dialog events are named ChildDlgName_EventName)
I'm not at home and unavailable to test this till later today but does this look like it will work ok?
Any help appreciated.
Regards. _________________ John Trappett |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Feb 23, 2005 9:40 pm Post subject: |
|
|
Actually keeping the window is a list is pretty much so you know
which ones are open and won't open them again or try to close
them if already closed.
You could also add all control event names for that window (field
separated such as: "Windowname|TestBUTTON|List1CLICK|etc.")
on the same line, then use @match() to find the event, and use
that index number for the dialog number.
But this is pretty much what parsing @event(d) does...
Or did I misunderstand the question?
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 |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Wed Feb 23, 2005 10:11 pm Post subject: |
|
|
Thanks Mac. The code in my previous post is working fine and helping me to keep track of multiple child dialogs. I use it in conjunction with the following Event loop:
| Code: | :Evloop
wait event,0.1
parse "%E;%D", @event(D)
if @zero(%D)
dialog select, 0
goto %E
else
dialog select, %D
goto @DialogID(%D)_%E
end
|
Regards. _________________ John Trappett |
|
| Back to top |
|
 |
|