Page 1 of 1

EditorGadget, Wordwrap

Posted: Sun Jun 08, 2003 3:15 pm
by horst
How can I set wordwrap mode in an EditorGadget
(instead of horizontal scrolling)?

Posted: Sun Jun 08, 2003 4:51 pm
by El_Choni

Code: Select all

If OpenWindow(0, 100, 200, 195, 260, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget, "PureBasic Window")=0:End:EndIf
If CreateGadgetList(WindowID())=0:End:EndIf
EditorGadget(0, 0, 0, WindowWidth(), WindowHeight())
SendMessage_(GadgetID(0), #EM_SETTARGETDEVICE, #NULL, 0)
;SendMessage_(GadgetID(0), #EM_SETTARGETDEVICE, #NULL, $FFFFFF) ; to turn word-wrap off again (use just a huge value, stands for line width)
SetGadgetText(0, "This text gets wrapped, but I think line numbers won't be properly handled now, so be careful.")
Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
End

Posted: Sun Jun 08, 2003 6:48 pm
by horst
Thanks, El_Choni :D
Works perfectly.

Posted: Sat May 15, 2004 12:53 pm
by pvmichael
Thanks from me, too. I was searching for something like that also :D

Re: EditorGadget, Wordwrap

Posted: Sun Sep 04, 2005 6:22 am
by PB
(Just adding the phrase "word wrap" here so it comes up in searches). ;)

Posted: Sun Sep 04, 2005 8:07 am
by dagcrack
Editor Gadget Word Wrap - auto wrapping - editor wrap - auto wrap - editor word wrap

Nice! Should be on the codearchiv (or is it already?)