Positioning a cursor in a GET behind the last char

This forum is for eXpress++ general support.
Post Reply
Message
Author
edv-rudrich
Posts: 33
Joined: Wed Jan 27, 2010 10:23 pm

Positioning a cursor in a GET behind the last char

#1 Post 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

User avatar
Tom
Posts: 1172
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

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

#2 Post by Tom »

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

"Did I offend you?"
"No."
"Okay, give me a second chance."

edv-rudrich
Posts: 33
Joined: Wed Jan 27, 2010 10:23 pm

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

#3 Post by edv-rudrich »

Hi Tom..

good idea - but no change...

- Michael

User avatar
Tom
Posts: 1172
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

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

#4 Post 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
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

edv-rudrich
Posts: 33
Joined: Wed Jan 27, 2010 10:23 pm

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

#5 Post by edv-rudrich »

Tom
thanks - I found my mistake..
I've coded {|o|Set... instead of {|o|o:Set....

;o)

- Michael

Post Reply