Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem In displaying Text in text editor using cl_gui_textedit

Former Member
0 Likes
2,087

Hello Experts,

I have created a customer container and using class cl_gui_textedit to have a text editor on the screen and saving the text as standard text.

Problem is when i save the test say TEST TEST TEST TEST , it get saved properly but when i display it the last word is getting shifted to next line

like TEST TEST TEST

TEST

and vertical scroll bar is getting displayed, but if i go back and come again the scroll bar is no more there and text is displayed properly TEST TEST TEST TEST.

I couldnt find any method to control the scroll bar ,

request for a solution and thanks in advance .

Thanks

Pramod Adhav

Hello Experts,

I have created a customer container and using class cl_gui_textedit to have a text editor on the screen and saving the text as standard text.

Problem is when i save the test say TEST TEST TEST TEST , it get saved properly but when i display it the last word is getting shifted to next line

like TEST TEST TEST

TEST

and vertical scroll bar is getting displayed, but if i go back and come again the scroll bar is no more there and text is displayed properly TEST TEST TEST TEST.

I couldnt find any method to control the scroll bar ,

request for a solution and thanks in advance .

Thanks

Pramod Adhav

3 REPLIES 3
Read only

Former Member
0 Likes
1,177

Hi,

Try by using this method SET_WORDWRAP_BEHAVIOR

(Use this method to set the behavior of the line break. I am not sure which parameter you have to use )

call method textedit set_wordwrap_behavior

exporting

wordwrap_to_linebreak_mode = '0'. " (also Try by '1')

exceptions

error_cntl_call_method = 1.

Hope this will help you

Regrads,

Raghava Channooru

Read only

0 Likes
1,177

Hi Raghava,

I have already tried this but didnt help.

Read only

marcelogb
Participant
0 Likes
1,177

Maybe your container lenght is smaller than 72 chars (stantard for sapscript and SO10).

So when you save it you can see the text on the same line, and then when displaying on smaller line lenght it makes a line return.

Anyway I haven't had any problem with it. Here I show you how I usually define it when used:

CREATE OBJECT GV_TEXT_EDITOR
  EXPORTING
    PARENT = GV_SPLITTER->BOTTOM_RIGHT_CONTAINER
    WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_WINDOWBORDER
    WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>FALSE
  EXCEPTIONS
    ERROR_CNTL_CREATE      = 1
    ERROR_CNTL_INIT        = 2
    ERROR_CNTL_LINK        = 3
    ERROR_DP_CREATE        = 4
    GUI_TYPE_NOT_SUPPORTED = 5.

And some useful options:


*READ ONLY
 call method gv_text_editor->set_readonly_mode
   exporting
     readonly_mode = gv_text_editor->true
   exceptions
     error_cntl_call_method = 1
     invalid_parameter      = 2
     others                 = 3.

*NO TOOLBAR
  call method gv_text_editor->SET_TOOLBAR_MODE
   exporting
     TOOLBAR_MODE = gv_text_editor->false
   exceptions
     error_cntl_call_method = 1
     invalid_parameter      = 2
     others                 = 3.

*NO STATUS BAR (bottom one)
 call method gv_text_editor->SET_STATUSBAR_MODE
   exporting
     STATUSBAR_MODE = gv_text_editor->false
   exceptions
     error_cntl_call_method = 1
     invalid_parameter      = 2
     others                 = 3.

I hope it helps

Regards,

John