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 » splitter bounds
splitter bounds [message #8055] Mon, 05 February 2007 22:44 Go to next message
exolon is currently offline  exolon
Messages: 62
Registered: July 2006
Location: 53'21N 6'18W
Member
Is there an easy way to set the limits of a splitter's position?
i.e. I want the minimum to be 50% and maximum to be 70%.

Currently I've got it working by hand like so (in my TopWindow subclass):
	virtual void Paint(Draw& w) {
		int splitterPos = verticalSplitter.GetPos();
		if(splitterPos < 5000)
			verticalSplitter.SetPos(5000);
		else if(splitterPos > 7000)
			verticalSplitter.SetPos(7000);
		TopWindow::Paint(w);
	}


This flickers while trying to drag the splitter out of bounds though. A Splitter::SetBounds(int min, int max) or something method might be nice, but I'm not sure how to go about this most efficiently.

I might be getting it completely wrong, since I'm still very inexperienced in UPP and GUI programming in general.

Oisín
Re: splitter bounds [message #8061 is a reply to message #8055] Mon, 05 February 2007 23:11 Go to previous message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
Hi Oisin,

i am not familiar with splitter but i would go one of these ways:

first- the best, i guess - set the min size of the controls added to splitter, means overwrite the virtual Size GetMinSize() and calculate the 50% for the left and 30 (100-70) for the right control (or however they are placed)

second is to overwrite the Splitter class you would have to check in which function the resizing is done.

Bas
Previous Topic: new behaviour of Splitter 608-dev2
Next Topic: Issue with SplitterFrame
Goto Forum:
  


Current Time: Tue Nov 12 19:49:41 CET 2019

Total time taken to generate the page: 0.01236 seconds