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 SetPos bug ?
Splitter SetPos bug ? [message #24350] Mon, 11 January 2010 22:57 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Before upgrading to current 1879 svn (I was in 1801 svn) this worked, now the splitter sets always about on middle.

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

class TestSplitter : public TopWindow
{
	private:
		// pages column list
		ColumnList pageList;
		
		// page container
		StaticRect pagePane;

		// the splitter
		Splitter splitter;
		
	public:
		TestSplitter();
};

TestSplitter::TestSplitter()
{
	// adds the splitter
	SizePos();
	Add(splitter);
	
	// setup pagelist appearance
	pageList.Columns(1).SizePos();
	
	// adds the columnlist on left
	splitter.Horz().SetPos(100).Set(pageList, pagePane);
}
	
GUI_APP_MAIN
{
	TestSplitter().Run();
}

[Updated on: Mon, 11 January 2010 22:59]

Report message to a moderator

Re: Splitter SetPos bug ? [message #24460 is a reply to message #24350] Mon, 18 January 2010 10:21 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

I noticed your trouble with splitter and as I tinkered with it recently I thought I should take a look at it.

Re-order:

splitter.Horz().SetPos(100).Set(pageList, pagePane);


to:

splitter.Horz().Set(pageList, pagePane);
splitter.SetPos(100);


..and your code works. The reason is that in Splitter::Layout, newly added panels cause a re-initialization of splitter position array. I do not think that I did that change... I hope.

// Tom
Re: Splitter SetPos bug ? [message #24470 is a reply to message #24460] Mon, 18 January 2010 14:41 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
I already figured out this with Mirek's help, thanks Smile

Anyways, I guess that some previous (working) code will have to be changed in order to avoid this "bug".

Ciao

Max
Previous Topic: Splitter transparent background
Next Topic: Colored drag margin for Splitter
Goto Forum:
  


Current Time: Thu Mar 28 20:15:17 CET 2024

Total time taken to generate the page: 0.01617 seconds