PureBasic Forum https://www.purebasic.fr/english/ |
|
"Word wrap" in multi-line StringGadgets? https://www.purebasic.fr/english/viewtopic.php?f=13&t=6507 |
Page 1 of 1 |
Author: | Jones1969 [ Wed Jun 11, 2003 11:58 pm ] |
Post subject: | "Word wrap" in multi-line StringGadgets? |
I can't seem to find a way to auto word wrap user input in a multi-line StringGadget. I found this old thread and some others, but none of them give a solution that works. It would seem a natural thing, as right-justified StingGadgets can be tricked into wrapping just fine!! No user can be expected to enter text in a field that scrolls sideways! Come on, please tell me this has been worked out for v. 3.70! Anyone? /Jones |
Author: | Jones1969 [ Thu Jun 12, 2003 12:06 am ] |
Post subject: | |
Sorry, I have to use the EditorGadget of course. Here's the code from El_Choni. /Jones |
Author: | PB [ Thu Jun 12, 2003 5:25 am ] |
Post subject: | Re: "Word wrap" in multi-line StringGadgets? |
> I can't seem to find a way to auto word wrap user input in a > multi-line StringGadget. Here ya go (thanks to FangBeast for the disable flags): Code: If OpenWindow(0,200,200,300,200,#PB_Window_SystemMenu,"test")
CreateGadgetList(WindowID()) t$="This text goes inside a multiline StringGadget."+Chr(13)+Chr(10) For r=1 To 10 : t$+Str(r)+Chr(13)+Chr(10) : Next StringGadget(0,10,10,200,100,t$,#PB_String_Multiline|#ES_AUTOVSCROLL|#WS_VSCROLL|#WS_HSCROLL|#ESB_DISABLE_LEFT|#ESB_DISABLE_RIGHT) Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow EndIf |
Author: | Fangbeast [ Thu Jun 12, 2003 6:44 am ] |
Post subject: | Aww shucks. |
Can't take credit for this, found this on the forum last year (the old forum) ![]() |
Author: | Banaticus [ Wed Oct 29, 2003 9:42 pm ] |
Post subject: | Re: "Word wrap" in multi-line StringGadgets? |
PB wrote: #ES_AUTOVSCROLL #WS_VSCROLL #WS_HSCROLL #ESB_DISABLE_LEFT #ESB_DISABLE_RIGHT Where do these come from? I tried searching in the help menu for them, but haven't been able to find them yet. Where can I find more information on them?It seems that autovscroll sets it to automatically scroll vertically. I don't really see why hscroll is needed. Disable_left and disable_right must stop the code from scolling past the edge of the box to the left and the right. But why do these codes turn the string box into a right-justified box? Perhaps it's hscroll that makes the box become right-justified? |
Author: | Banaticus [ Wed Oct 29, 2003 9:55 pm ] |
Post subject: | Re: "Word wrap" in multi-line StringGadgets? |
Why does this work? Comments inline Code: If OpenWindow(0,200,200,300,200,#PB_Window_SystemMenu,"test") CreateGadgetList(WindowID()) t$="This text goes inside a multiline StringGadget."+Chr(13)+Chr(10) ;a string variable was created -- t$ is equal to the text plus some control characters ;t$ is displayed when the StringGadget is created later on For r=1 To 10 : t$+Str(r)+Chr(13)+Chr(10) : Next ;text has been created -- but this information shouldn't be displayed ;see further comments after the code StringGadget(0,10,10,200,100,t$) ;we display t$ at this point when we create the stringgadget Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow EndIf That text, t$+Str(r)+Chr(13)+Chr(10), shouldn't be displayed from what I can tell. It's not saved to a variable, so it has to be displayed right then. But, SetGadgetText() isn't used, Print() isn't used . . . from what I can tell, this text shouldn't be displaying. And yet, somehow, it displays. Why? What am I missing? Thanks. ![]() |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |