Page 1 of 1

Advanced StringGadget Question

Posted: Sat Aug 25, 2007 6:48 pm
by milan1612
Hey guys,
hard to explain, where to start? :?

I have a StringGadget and I want it to limit it's client size where it draws
its text. Here's an image, maybe then it's more clear:
Image
I don't want to limit the character size, it may scroll if the text width exceeds its (new client-) width...

Maybe by setting the client area?
Thanks in advance...

Posted: Sat Aug 25, 2007 7:06 pm
by Fluid Byte
#EM_SETRECT / #EM_SETRECTNP

Code: Select all

OpenWindow(0,0,0,320,240,"void",#PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CreateGadgetList(WindowID(0))
StringGadget(0,10,10,200,20,"",#ES_MULTILINE)

frc.RECT
frc\top = 0
frc\left = 0
frc\right = 150
frc\bottom = 20
SendMessage_(GadgetID(0),#EM_SETRECTNP,0,frc)

While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend

Posted: Sat Aug 25, 2007 7:20 pm
by milan1612
I realized it won't fit my needs, thank you anyway... :)

Posted: Wed Oct 03, 2007 2:50 pm
by graves
Hi,
you can set right margin with

Code: Select all

#EC_LEFTMARGIN = 1
#EC_RIGHTMARGIN = 2

SendMessage_(GadgetID(#Gadget), #EM_SETMARGINS, #EC_RIGHTMARGIN, margin)