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 


Dialog Select

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


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

PostPosted: Wed Jun 01, 2005 7:49 pm    Post subject: Dialog Select Reply with quote

I know that I have seen this discussion before, but I couldn't find it and couldn't remember what was said.

I have problems still with tracking the various dialogs my programs create. I have parsed the events that they produce and then have assigned those numbers to variables:

Code:
wait event
  %I = @event(D)
  parse "%I;%%introdialog", %I


I quickly use up lots of variables, so it isn't ideal. Also, some events (like timers) don't produce the active dialog number. Is it possible to include in VDS the ability to use a class name to select dialog, like selecting a window?

For instance:

Code:
Dialog Select, #introdialog


Anyway, just really wanted to get it boosted back up on the wish list. Wink

_________________
Joe Floyd
Back to top
View user's profile Send private message
trapper
Contributor
Contributor


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

PostPosted: Wed Jun 01, 2005 10:26 pm    Post subject: Reply with quote

I wrote a small function sometime ago which really serves me well.....

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

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

At the beginning of my programs 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)

This is all working very well here and has eliminated any problems I used to have controlling multiple dialogs.

Cheers.

_________________
John Trappett
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


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

PostPosted: Thu Jun 02, 2005 12:40 am    Post subject: Reply with quote

Thanks - looks like a good system. For my current project it would take quite a bit of retro-engineering. But for future programs, I would consider implementing something like that.

Sure would be nice if it were built into VDS though ...

_________________
Joe Floyd
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 -> Wish List 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