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 


Child Dialog Focus

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Thu Oct 12, 2006 3:31 pm    Post subject: Child Dialog Focus Reply with quote

Hi All

I'm having trouble shifting the input focus to a child dialog that I
create. The list item is moved to the child OK but I can't focus
on it. Here is the fragment...

Code:

:renameDialog
    DIALOG CREATE,Rename,-1,0,284,72,NOMIN
    DIALOG ADD,BUTTON,OK,8,206
    DIALOG ADD,BUTTON,Cancel,38,206
    DIALOG ADD,EDIT,CEDIT1,10,10
    dialog select,0
    %i = @index(list101)
    %t = @item(list101,%i)
    dialog select,1
    dialog set,cedit1,%t
    dialog focus,cedit1
    DIALOG SHOWMODAL


When I try to shift the focus to cedit1 I get an error.

Any idea's

Thanks

David...
Back to top
View user's profile Send private message
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Thu Oct 12, 2006 3:58 pm    Post subject: Reply with quote

It's a paradox apparently you cannot focus on an element of a non-visible window, which is the case until "DIALOG SHOWMODAL" is executed and then code execution halts at SHOWMODAL not allowing a focus command to follow. I would recommend replacing SHOWMODAL with SHOW and moving "dialog focus,cedit1" to follow DIALOG SHOW. Obviously you'll need to add a child window event handler loop.
Back to top
View user's profile Send private message Send e-mail
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Thu Oct 12, 2006 4:10 pm    Post subject: Reply with quote

hah, you beat me to it... and said exactly what I was going to say.
_________________
cheers

Dave
Back to top
View user's profile Send private message
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Thu Oct 12, 2006 4:13 pm    Post subject: Reply with quote

Oops I forgot about TAB Order just move the edit element up to the first position this should give it focus...

Code:

:renameDialog
    DIALOG CREATE,Rename,-1,0,284,72,NOMIN
    DIALOG ADD,EDIT,CEDIT1,10,10
    DIALOG ADD,BUTTON,OK,8,206
    DIALOG ADD,BUTTON,Cancel,38,206 
    dialog select,0
    %i = @index(list101)
    %t = @item(list101,%i)
    dialog select,1
    dialog set,cedit1,%t 
    DIALOG SHOWMODAL


BTW: remove the focus command as well
Back to top
View user's profile Send private message Send e-mail
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Thu Oct 12, 2006 4:24 pm    Post subject: Reply with quote

Thanks WidgetCoder

I can't believe it was all down to tab order!!!! Spent an hour last
night shouting at my PC.....

Thanks to you DaveR also.

Cheers

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