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
Issue with SplitterFrame [message #8597] Tue, 20 March 2007 16:39 Go to next message
victorb is currently offline  victorb
Messages: 78
Registered: December 2005
Location: Nice, France
Member
It seems that there is an issue with SplitterFrame.

It can be observed with the SplitterFrame reference code.

If you move the splitter to the right most position of the window, the window becomes all black.

If you you the splitter to the left most position there is also an issue with the ScrollBar of the list.

Would it be possible to implement minimum sizes for both sides of the splitterFrame ?

>>EDIT
I mean is it technically possible ?
If yes I can try.
>>EDIT


Thanks,
Victor

[Updated on: Tue, 20 March 2007 18:59]

Report message to a moderator

Re: Issue with SplitterFrame [message #8603 is a reply to message #8597] Tue, 20 March 2007 23:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12096
Registered: November 2005
Ultimate Member
Well:

Black screen was a problem in Paint system. Now fixed.

I have added two methods to SplitterFrame: MinSize and SizeMin.

(Second one is the minimal size of the "non-splitter" area).

Mirek
Re: Issue with SplitterFrame [message #8629 is a reply to message #8603] Wed, 21 March 2007 23:12 Go to previous messageGo to next message
victorb is currently offline  victorb
Messages: 78
Registered: December 2005
Location: Nice, France
Member
Mirek,

I have just sync'ed with uvs and it seems that the MinSize / SizeMin does not fully work as expected.

The issue is when the window is resized. There sizemin in not taken into account and you can still reduce to a lower value. Now when you press the splitter again... it jumps to where it should be.

The fix is as simple as adding one line:
void SplitterFrame::FrameLayout(Rect& r) {
..
..
..
    size = minmax(size, minsize, maxsize);
}


Note that you still have to set the parent size to something > minsize+sizemin if you don't want to go below minsize when resizing the parent.

[Updated on: Wed, 21 March 2007 23:13]

Report message to a moderator

Re: Issue with SplitterFrame [message #8656 is a reply to message #8629] Thu, 22 March 2007 19:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12096
Registered: November 2005
Ultimate Member
Thanks, patch applied.

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

The version in uvs is still not ok (in this version maxsize is valid for left & right only).

You should use the function from my previous message.

Thanks,
Victor
Re: Issue with SplitterFrame [message #8683 is a reply to message #8675] Sat, 24 March 2007 16:05 Go to previous message
mirek is currently offline  mirek
Messages: 12096
Registered: November 2005
Ultimate Member
Sorry, sometimes I am a little bit dumb Smile

Mirek
Previous Topic: splitter bounds
Next Topic: splitter and WhenAction
Goto Forum:
  


Current Time: Tue Nov 12 19:36:44 CET 2019

Total time taken to generate the page: 0.01728 seconds