2018 Dec 07 1:10 PM
Hi!
Short question: I have a text editor defined with cl_gui_textedit embedded in a custom control. How can I check if the editor has the cursor? In my tests if the cursor stands on the editor, the statement
get cursor field...
doesn't return anything.
What other possibilities do I have?
Thanks
Alexander.
2018 Dec 07 1:48 PM
I've created a text editor using CL_GUI_TEXTEDIT on a custom container (CL_GUI_CUSTOM_CONTAINER) and I need to set the active cursor on it.
I've tried with the method SET_FOCUS but it doesn't work.
CALL METHOD o_textedit->set_focus
EXPORTING
control = o_textedit.
Also I've tried with method GO_TO_LINE by passing the first line but it
doesn't work either. It only selects the first line but the cursor isn't
positioned on it, I mean, I need to click on the text editor to start to write.
CALL METHOD o_textedit->go_to_line
EXPORTING
line = 1.
Anyone knows how to do this?
Thanks in advance.
--------------------------------------------------------------
Hi,
try like this.
Data: editor2 TYPE REF TO cl_gui_textedit.
CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
EXPORTING
CONTROL = editor2.
-----------------
Hope this will be usefull--------------------------------
2018 Dec 10 9:09 AM
Hi Prashant,
thank you, I eventually solved it with the method get_focused.
2018 Dec 10 8:11 AM
Hi Prashant,
thank you, but I don't want to set focus. Rather I would like to find out if the cursor has been set on the editor.
BR
Alexander
2018 Dec 10 1:02 PM
Was get_focused a typo for get_focus, did you try to also flush with CALL METHOD cl_gui_cfw=>flush.?