Horizon
Member in Training
Posts: 31
|
Post by Horizon on Nov 30, 2018 12:09:20 GMT
Hello,
I'm handling long blocks of text by copying and pasting into a "textbox" (this is fine but, the line of text extends outside the visible area) which is OK as I'm grabbing this as a string anyway. However I thought "texteditor" would be the solution to wrap text round but, this does not seem to wrap the text either? Is there a way of doing this, or am I overlooking something?
Any advice is greatly appreciated.
|
|
|
Post by tsh73 on Nov 30, 2018 12:26:48 GMT
If you make big statictext, text will be wrapped automagically. Other solution is to insert CRLF programmatically (there are old codes I could search) - but this will change source text.
EDIT so text Editor or Textbox does not allow for automatic text wrap - only programmatic (that is, by your own code)
EDIT you can use texteditor (it can be placed off-screen) to get text from clipboard and put it to statictext to wrap & show Check this nomainwin
WindowWidth = 550 WindowHeight = 410
statictext #main.statictext2, "StaticText Caption", 174, 46, 224, 290 groupbox #main.groupbox3, "Big static text", 150, 16, 304, 340 button #main.button4, "text", [button4Click], UL, 22, 56, 42, 25 button #main.button5, "from clipboard", [button5Click], UL, 22, 96, 122, 25 texteditor #main.textedit6, 22, 141, 100, 100 open "untitled" for window as #main print #main, "font ms_sans_serif 0 16"
[main.inputLoop] 'wait here for input event wait
[button4Click] 'Perform action for the button named 'button4' 'Insert your own code here print #main.statictext2, "I'm handling long blocks of text by copying and pasting into a 'textbox' (this is fine but, the line of text extends outside the visible area) which is OK as I'm grabbing this as a string anyway. However I thought 'texteditor' would be the solution to wrap text round but, this does not seem to wrap the text either? Is there a way of doing this, or am I overlooking something?" wait
[button5Click] 'Perform action for the button named 'button5' 'Insert your own code here print #main.textedit6, "!paste" ; print #main.textedit6, "!contents? string$"; print #main.statictext2, string$; wait
|
|
Horizon
Member in Training
Posts: 31
|
Post by Horizon on Nov 30, 2018 12:50:25 GMT
Thanks tsh37 As I need to keep the text formatting, I'll continue with the texteditor so that I can use the scroll bars to navigate the text. Thanks for the advice
|
|
Horizon
Member in Training
Posts: 31
|
Post by Horizon on Nov 30, 2018 12:54:50 GMT
Thanks tsh37 As I need to keep the text formatting, I'll continue with the texteditor so that I can use the scroll bars to navigate the text. Thanks for the advice That technique has given me an excellent method of creating a "preview window". Thanks again
|
|
|
Post by B+ on Nov 30, 2018 14:12:34 GMT
This could come in handy, thanks!
I think I have some word wrap code somewhere too, if you like text and want to use it, you could reset format for different widths while you are looking at it here.
|
|