| View previous topic :: View next topic |
| Author |
Message |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Thu Oct 12, 2006 3:31 pm Post subject: Child Dialog Focus |
|
|
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 |
|
 |
WidgetCoder Contributor


Joined: 28 May 2002 Posts: 126 Location: CO, USA
|
Posted: Thu Oct 12, 2006 3:58 pm Post subject: |
|
|
| 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 |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Thu Oct 12, 2006 4:10 pm Post subject: |
|
|
hah, you beat me to it... and said exactly what I was going to say. _________________ cheers
Dave |
|
| Back to top |
|
 |
WidgetCoder Contributor


Joined: 28 May 2002 Posts: 126 Location: CO, USA
|
Posted: Thu Oct 12, 2006 4:13 pm Post subject: |
|
|
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 |
|
 |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Thu Oct 12, 2006 4:24 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|
|