EditorGadget, Wordwrap

Just starting out? Need help? Post your questions and find answers here.
horst
Enthusiast
Enthusiast
Posts: 197
Joined: Wed May 28, 2003 6:57 am
Location: Munich
Contact:

EditorGadget, Wordwrap

Post by horst »

How can I set wordwrap mode in an EditorGadget
(instead of horizontal scrolling)?
Horst.
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post 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
Last edited by El_Choni on Sun Jun 08, 2003 7:04 pm, edited 1 time in total.
El_Choni
horst
Enthusiast
Enthusiast
Posts: 197
Joined: Wed May 28, 2003 6:57 am
Location: Munich
Contact:

Post by horst »

Thanks, El_Choni :D
Works perfectly.
Horst.
pvmichael
New User
New User
Posts: 4
Joined: Sat May 15, 2004 12:52 pm

Post by pvmichael »

Thanks from me, too. I was searching for something like that also :D
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: EditorGadget, Wordwrap

Post by PB »

(Just adding the phrase "word wrap" here so it comes up in searches). ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post 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?)
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Post Reply