Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
Zardos is currently offline  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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Refresh(), Paint(Draw& w), or something else nearby?
Next Topic: there is no fontpusher class (just checking)
Goto Forum:
  


Current Time: Wed May 15 07:06:21 CEST 2024

Total time taken to generate the page: 0.03868 seconds