Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Missing Functions for Layouter
Missing Functions for Layouter [message #10722] |
Wed, 25 July 2007 10:34  |
Zardos
Messages: 62 Registered: April 2007
|
Member |
|
|
Hello,
because I'm more productive if I use layout manager and automatic gui layouting functions instead of moving widgets on the screen I started to programm some simple layouting stuff.
But soon I ran into problems. What I would need is a "GetOptSize()" functions for controls. This function should return the "optimum size" of a control. For example for a button it should take into account:
the used font
the label
the image
default margin
... Because there is nothing like a GetOptSize() for Ctrls I started to make my own outside of the class like this:
Size GetOptSize(Ctrl &c) {
Button *b = dynamic_cast<Button *>(&c);
if(b) {
Size s;
s = GetTLTextSize(WString(b->GetDesc()), StdFont());
s.cx += GUI_MARGIN * 2;
return s;
} else
return c.GetStdSize();
}
... well not nice, but it should work.
What I'm really missing are a function to get the used font for ctrls and for buttons a GetImage:
If I would start adding the following functions to button (and other controls):
GetFont();
GetImage();
...and create a patch would you accept it?
Or even better would you like to have a "virtual GetOptSize()" for Ctrls?
Or do you have any other suggestions?
- Ralf
|
|
|
Goto Forum:
Current Time: Mon Apr 28 19:17:57 CEST 2025
Total time taken to generate the page: 0.01019 seconds
|