Advanced StringGadget Question

Windows specific forum
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Advanced StringGadget Question

Post 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...
Windows 7 & PureBasic 4.4
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post 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
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

I realized it won't fit my needs, thank you anyway... :)
Windows 7 & PureBasic 4.4
User avatar
graves
Enthusiast
Enthusiast
Posts: 160
Joined: Wed Oct 03, 2007 2:38 pm
Location: To the deal with a pepper

Post 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)
Post Reply