String Gadget

Windows specific forum
Large
User
User
Posts: 56
Joined: Tue Apr 29, 2003 8:24 pm

String Gadget

Post by Large »

I'm using the code below to create a multi string gadget.

Code: Select all

StringGadget(7,8,205,306,60,"",PB_String_Multiline)
Just two things i'm stuck with are . . .

How do you determine the end of the gadget because at the moment you can type and type and carry on typing in my gadget, what I want is when the user types and gets to the end of the gadget it automatically drops down a line.

and also . . .

Using the code below.

Code: Select all

message$   = GetGadgetText(0)
Locate(625, 2450) : DrawText(message$)
which I use to print to my printer, now if the user presses return in the multi string gadget its not recognised, message$ is printed all on one line, how do I make the gadget print out its contents in the way the user has typed it in.

Any help would be greatly appreciated.

Kind regards

Andy ( aka Large )
Andy
User
User
Posts: 18
Joined: Wed Jun 18, 2003 8:32 pm
Location: Switzerland

RE: String Gadget

Post by Andy »

I have also search for a wordwrap solution, but at this time, I have nothing found (I believe it, should exist a solution). But for me I have now an other way, possibly this is good for you too:

Code: Select all

If OpenWindow(0, 200, 200, 100, 100, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget,"Test")=0:End:EndIf 
  If CreateGadgetList(WindowID())=0:End:EndIf 
  EditorGadget(0,0,0,WindowWidth(), WindowHeight())
  SendMessage_(GadgetID(0),#EM_SETTARGETDEVICE, #NULL, 0);Wordwrap
  SetGadgetText(0, "How do you determine the end of the gadget because at the moment you can type and type and carry on ") 
  Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow 
End
... EditorGadget() is new in PB Version 3.70...

Good night
Andy
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: RE: String Gadget

Post by PB »

> I have also search for a wordwrap solution, but at this time, I have
> nothing found (I believe it, should exist a solution).

Doesn't anyone read the FAQ for these forums anymore? :evil:

viewtopic.php?t=4876

This particular issue has been answered in there for months...
Post Reply