Input on one dialog to display on different dialog
Posted: Thu Mar 16, 2006 9:37 pm
Hi.
Me again asking for help.
I need to allow input into gets from another dialog that simply displays the numeric keypad. Here is that image:
[/img]
http://www.structuredsystems.com/pictur ... screen.jpg
[/img]
Here is my code:
It almost works.
The problem is in method Insert. By setting focus to ::odlg (main dialog), the cursor goes to the very first get on the dialog. If not setting focus to ::odlg, then nothing gets inputed into the gets.
Help please?
Reinaldo.[/url]
Me again asking for help.
I need to allow input into gets from another dialog that simply displays the numeric keypad. Here is that image:
[/img]
http://www.structuredsystems.com/pictur ... screen.jpg
[/img]
Here is my code:
Code: Select all
... in ::odlg definition (main dialog)
REDEFINE GET aGet[ 3] VAR ::oTrg:VarBP ID 103 OF ::ofld:aDialogs[ 1 ] Picture "999/999" VALID( ColorIfEmpty( aget[ 3 ] ) )
aget[ 3 ]:bGotFocus := {|| ::oActive := aGet[ 3 ] }
...
... now inside NumKeyPad Dlg definition
local oSelf := Self
DEFINE DIALOG oSelf:oKeyPadDlg RESOURCE "NUM_KEYPAD" OF oSelf:oDlg BRUSH oBrush
...
REDEFINE BTNBMP oBtn[12] ID 112 RESOURCE "NUM_RIGHT" OF oSelf:oKeyPadDlg ACTION oSelf:Insert( VK_RIGHT ) NOBORDER
REDEFINE BTNBMP oBtn[13] ID 113 RESOURCE "NUM_ENTER" OF oSelf:oKeyPadDlg ACTION oSelf:Insert( VK_TAB ) NOBORDER
aEval( obtn, { |e|e:lTransparent := .t. } )
ACTIVATE DIALOG oSelf:oKeyPadDlg NOWAIT ON INIT oSelf:oDlg:SetFocus()
...
*-------------------------------------------------------------------------------------------------------------------------------
METHOD Insert( xKey ) CLASS TTriage
Local nFocus := ::oDlg:oCtlFocus:nOption
if nFocus == 1 .and. ValType( ::oActive ) <> "U"
::odlg:SetFocus()
FwKeyboard( ::oActive, xKey ) //thanks J.Bott
Endif
RETURN NIL
The problem is in method Insert. By setting focus to ::odlg (main dialog), the cursor goes to the very first get on the dialog. If not setting focus to ::odlg, then nothing gets inputed into the gets.
Help please?
Reinaldo.[/url]