wordwrap

Share your advanced PureBasic knowledge/code with the community.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

wordwrap

Post by thefool »

Code updated For 5.20+ (same As #PB_Editor_WordWrap in EditorGadget)

Hi. I think someone always looks for wordwrap for the editor gadgets and string gadgets.

So i made this little thing and called the topic "Wordwrap", so people would find it. Here is a simple procedure just to have as include etc.

Code: Select all

Procedure WordWrap(gadget,state)
If state=1
SendMessage_(GadgetID(gadget), #EM_SETTARGETDEVICE, #NULL, 0)
Else
SendMessage_(GadgetID(0), #EM_SETTARGETDEVICE, #NULL, $FFFFFF)
endif
EndProcedure
So you just call WordWrap(gadget,state)
if state is 1, wordwrap is on, if not 1, its off again.