rdonnay wrote:Here is how I solved the problem with showing the cursor in BLUE.
First, I create a DCSAY object in the target screen:hello RogerCode: Select all
@ 1,0 DCSAY '|' SAYSIZE 0 OBJECT ::getCursor ; FONT '14.Lucida Console Bold' COLOR BD_BLUE, BD_BLUE
I do not place these methods :: getCursor, :: TouchHandler
Then I make the OSK:getCursor point to the target screen ::getCursor:Then I added 3 lines of code to the Accum method of TouchKeyboard:Code: Select all
DCREAD GUI FIT TITLE 'New Driver Application' ; MODAL TO lStatus OPTIONS GetOptions SETAPPWINDOW ; HANDLER ::TouchHandler REFERENCE oOsk ; EVAL {|o|DC_CenterObject(o,AppDeskTop()),; o:setPos({o:currentPos()[1],o:currentPos()[2]-30}), ; o:show(), ; oOsk:targetXbp := oGet1, ; oOsk:getCursor := ::getCursor, ; <<<<<<<<<<<<<< SetAppFocus(oGet1)}
You will need to calculate the positioning of ::getCursor in your DCGET object based on the font used for your gets.Code: Select all
METHOD TouchKeyboard:Accum( cKey, cCapsKey ) LOCAL cBuffer, i, nPos IF ::isCapsLock .AND. !Empty(cCapsKey) cKey := cCapsKey ENDIF ::targetXbp:updated := .T. FOR i := 1 TO Len(cKey) ::targetXbp:keyboard(Asc(cKey[i])) NEXT IF ::targetXbp:isDerivedFrom('DC_XbpGet') cBuffer := Transform ( ::targetXbp:Get:Buffer, IIf(::targetXbp:Picture==NIL, "", ::targetXbp:picture) ) ::targetXbp:Get:_assign( ) ::targetXbp:SetEditBuffer( cBuffer ) ENDIF <<<<<<<<<<<<< ::getCursor:show() ::getCursor:setParent(::targetXbp) ::getCursor:setPos({((::targetXbp:get:pos-1)*16)+2,0}) >>>>>>>>>>>>> IF Asc(cKey) == xbeK_ENTER SetAppFocus(::targetXbp) PostAppEvent(xbeP_Keyboard,xbeK_ENTER,,::targetXbp) ENDIF Sleep(1) RETURN nil
How to activate the Windows Virtual Keyboard from eXpress
Re: How to activate the Windows Virtual Keyboard from eXpres
Nolberto Paulino
Regards
Regards
Re: How to activate the Windows Virtual Keyboard from eXpres
I already understood how he did the trick as you did, thank you
Nolberto Paulino
Regards
Regards
Re: How to activate the Windows Virtual Keyboard from eXpres
hello Roger
Add this to your code to solve a problem with the numeric fields.
if cKey == xbeK_ENTER &&&.OR. cKey == xbeK_DOWN
if ::isNunber()
PostAppEvent(xbeP_Keyboard, ASC("."),,::oGet)
END if
SetAppFocus(::oGet)
PostAppEvent(xbeP_Keyboard, xbeK_ENTER,,::oGet)
sleep(0.1)
END if
Add this to your code to solve a problem with the numeric fields.
if cKey == xbeK_ENTER &&&.OR. cKey == xbeK_DOWN
if ::isNunber()
PostAppEvent(xbeP_Keyboard, ASC("."),,::oGet)
END if
SetAppFocus(::oGet)
PostAppEvent(xbeP_Keyboard, xbeK_ENTER,,::oGet)
sleep(0.1)
END if
Nolberto Paulino
Regards
Regards
Re: How to activate the Windows Virtual Keyboard from eXpres
Thanks for the numeric fix.
Here is some additional code to make the blue cursor show the character under the cursor:
Part of target screen code:
Part of TouchKeyboard:accum() code:
Here is some additional code to make the blue cursor show the character under the cursor:
Part of target screen code:
Code: Select all
@ 1,0 DCSAY ' ' SAYSIZE 0 OBJECT ::getCursor ;
FONT '20.Lucida Console' COLOR BD_WHITE, BD_BLUE
Code: Select all
::getCursor:show()
::getCursor:setParent(::targetXbp)
::getCursor:setPos({((::targetXbp:get:pos-1)*16)+2,0})
::getCursor:setCaption(::targetXbp:get:buffer[::targetXbp:get:pos]) <<<<<<<<<<
The eXpress train is coming - and it has more cars.
Re: How to activate the Windows Virtual Keyboard from eXpres
hello Roger
The position x, and do not match the character in the GET, attached send you an image
The position x, and do not match the character in the GET, attached send you an image
rdonnay wrote:Thanks for the numeric fix.
Here is some additional code to make the blue cursor show the character under the cursor:
Part of target screen code:Part of TouchKeyboard:accum() code:Code: Select all
@ 1,0 DCSAY ' ' SAYSIZE 0 OBJECT ::getCursor ; FONT '20.Lucida Console' COLOR BD_WHITE, BD_BLUE
Code: Select all
::getCursor:show() ::getCursor:setParent(::targetXbp) ::getCursor:setPos({((::targetXbp:get:pos-1)*16)+2,0}) ::getCursor:setCaption(::targetXbp:get:buffer[::targetXbp:get:pos]) <<<<<<<<<<
- Attachments
-
- Captura.JPG (81.34 KiB) Viewed 10212 times
Nolberto Paulino
Regards
Regards
Re: How to activate the Windows Virtual Keyboard from eXpres
You need to make sure that the font of the DCSAY is exactly the same as the font of the DCGETs.do not match the character in the GET
In your case, it is probably the following:
@ 1,0 DCSAY ' ' SAYSIZE 0 OBJECT ::getCursor ;
FONT '10.Courier New' COLOR BD_WHITE, BD_BLUE
The eXpress train is coming - and it has more cars.