Page 1 of 1

Positioning a cursor in a GET behind the last char

Posted: Sat May 29, 2010 9:47 am
by edv-rudrich
Hi

I am looking for a possibility to position the cursor in a get in an eval clause behind the last existing
letter without the need to press xbeK_END first..

Had no success with the XBase methods..
There's a method :Home() in the DC_XbpGet class - but no corresponding :End()

Thks

- MIchael


Sample code:
#include "DCDIALOG.CH"
#include "APPEVENT.CH"

Procedure Main
Local Getlist := {}, Getoptions
Local cTestVar := "Hello "

@ 1,1 DCGET cTestVar PICTURE "XXXXX99999" ;
EVAL {|o|PostAppEvent(xbeP_Keyboard, xbeK_END,,o) }

DCGETOPTIONS NOMINBUTTON NOMAXBUTTON
DCREAD GUI FIT MODAL TITLE "Test" BUTTONS DCGUI_BUTTON_EXIT OPTIONS GetOptions

return

Re: Positioning a cursor in a GET behind the last char

Posted: Sun May 30, 2010 1:39 am
by Tom
Hi, Michl.
@ 1,1 DCGET cTestVar PICTURE "XXXXX99999" OBJECT oGet ;
EVAL {|o|o:SetInputFocus := {||PostAppEvent(xbeP_Keyboard, xbeK_END,,oGet)} }

Re: Positioning a cursor in a GET behind the last char

Posted: Sun May 30, 2010 1:48 am
by edv-rudrich
Hi Tom..

good idea - but no change...

- Michael

Re: Positioning a cursor in a GET behind the last char

Posted: Sun May 30, 2010 2:32 am
by Tom
Hi, Michl.

This positiones the cursor to the end of the get, however it receives focus. Did you notice I named the get? (But this shouldn't make any difference - however, it effected the SetDisplayFocus-codeblock).

Code: Select all

#include "dcdialog.ch"
#include "appevent.ch"

#pragma library("dclipx.lib")

PROCEDURE appsys() ; RETURN

PROCEDURE MAIN()
Local Getlist := {}, Getoptions
Local cTestVar := "Hello ", cTestVar2 := "World", oGet, oGet2

@ 1,1 DCGET cTestVar PICTURE "XXXXX99999" OBJECT oGet ;
EVAL {|o|o:SetInputFocus := {||PostAppEvent(xbeP_Keyboard, xbeK_END,,oGet)} }

@ 3,1 DCGET cTestVar2 PICTURE "XXXXX99999" OBJECT oGet2 ;
EVAL {|o|o:SetInputFocus := {||PostAppEvent(xbeP_Keyboard, xbeK_END,,oGet2)} }


DCGETOPTIONS NOMINBUTTON NOMAXBUTTON
DCREAD GUI FIT MODAL TITLE "Test" BUTTONS DCGUI_BUTTON_EXIT OPTIONS GetOptions ENTEREXIT

return

Re: Positioning a cursor in a GET behind the last char

Posted: Sun May 30, 2010 2:51 am
by edv-rudrich
Tom
thanks - I found my mistake..
I've coded {|o|Set... instead of {|o|o:Set....

;o)

- Michael