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 » Splitter » Issue with SplitterFrame
Re: Issue with SplitterFrame [message #8662 is a reply to message #8656] Thu, 22 March 2007 22:53 Go to previous messageGo to previous message
victorb is currently offline  victorb
Messages: 78
Registered: December 2005
Location: Nice, France
Member
Mirek,

In fact minmax should be added before the switch{}.

The function below seems to be finally working fine:


void SplitterFrame::FrameLayout(Rect& r)
{
	Rect rr = r;
	maxsize = max(0, (type == LEFT || type == RIGHT?r.GetWidth():r.GetHeight()) - sizemin);
	size = minmax(size, minsize, maxsize);
	switch(type) {
	case LEFT:
		r.left += size;
		rr.right = r.left;
		break;
	case RIGHT:
		r.right -= size;
		rr.left = r.right;
		break;
	case TOP:
		r.top += size;
		rr.bottom = r.top;
		break;
	case BOTTOM:
		r.bottom -= size;
		rr.top = r.bottom;
		break;
	}	
	SetFrameRect(rr);
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: splitter bounds
Next Topic: splitter and WhenAction
Goto Forum:
  


Current Time: Mon May 13 14:40:26 CEST 2024

Total time taken to generate the page: 0.02467 seconds