|
|
Home » Community » Newbie corner » How do I get parameters for GetTextSize ( Get parameters for GetTextSize)
How do I get parameters for GetTextSize [message #43275] |
Sat, 21 June 2014 16:32  |
awksed
Messages: 68 Registered: April 2012
|
Member |
|
|
I need to resize a DropList according to the longest string in the list.
How do I get the parameters for GetTextSize() (presumably something like Draw object and font)?
Thanks.
|
|
|
|
|
Re: How do I get parameters for GetTextSize [message #43331 is a reply to message #43316] |
Mon, 30 June 2014 22:02   |
 |
BioBytes
Messages: 310 Registered: October 2008 Location: France
|
Senior Member |
|
|
Hi Awksed,
Ok that is somewhat clearer now. Perhaps you could try the code below:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
DropList dl;
TopWindow win;
win.SetRect(0, 0, 400, 50);
win.Add(dl.HSizePos(4, 4).TopPos(10, Ctrl::STDSIZE));
dl.Add(0, AttrText("This is bold")SetFont(Courier(25)).Bold());
dl.Add(1, AttrText("This is red").SetFont(Arial(25)).Ink(Red()));
dl.Add(2, AttrText("This is centered").SetFont(Tahoma(25)).Center());
dl.SetLineCy(30);
dl <<= 0;
win.Run();
}
Hope this could help you
Good coding
Biobytes
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri May 09 22:03:58 CEST 2025
Total time taken to generate the page: 0.03177 seconds
|
|
|