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 Previous  1, 2
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

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

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
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: Wed Feb 23, 2005 2:14 am    Post subject: Reply with quote

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


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Feb 23, 2005 8:44 am    Post subject: Reply with quote

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
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: Wed Feb 23, 2005 9:10 am    Post subject: Reply with quote

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


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

PostPosted: Wed Feb 23, 2005 9:43 am    Post subject: Reply with quote

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


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

PostPosted: Wed Feb 23, 2005 10:50 am    Post subject: Reply with quote

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


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

PostPosted: Wed Feb 23, 2005 9:40 pm    Post subject: Reply with quote

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

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

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: Wed Feb 23, 2005 10:11 pm    Post subject: Reply with quote

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
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
Goto page Previous  1, 2
Page 2 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