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 » multiple controls on a splitter side
multiple controls on a splitter side [message #38208] Thu, 06 December 2012 11:33 Go to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
I have a splitter which contains an arrayctrl on the left side. Now I would like to place a custom ctrl with a fixed height(not resizable) above the arrayctrl. Say the custom ctrl has a height of 100, and the arrayctrl takes the rest. When I resize the window, the arrayctrl should be resized, and the custom ctrl should remain its height. In .NET this is the standard control docking. However, I looked over the U++ docking component, but this clearly is not what I am looking for. I also took a look at SetMin function of Splitter, but there is no SetMax equivalent that could suit my needs.

How chould I solve this?
Re: multiple controls on a splitter side [message #38209 is a reply to message #38208] Thu, 06 December 2012 12:12 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1780
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

crydev wrote on Thu, 06 December 2012 11:33

I have a splitter which contains an arrayctrl on the left side. Now I would like to place a custom ctrl with a fixed height(not resizable) above the arrayctrl. Say the custom ctrl has a height of 100, and the arrayctrl takes the rest. When I resize the window, the arrayctrl should be resized, and the custom ctrl should remain its height. In .NET this is the standard control docking. However, I looked over the U++ docking component, but this clearly is not what I am looking for. I also took a look at SetMin function of Splitter, but there is no SetMax equivalent that could suit my needs.

How chould I solve this?

Hi crydev,

You can use ParentCtrl to achieve both having multiple Ctrls in one splitter cell and having them independently sized. Here is a simple example:
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct App : TopWindow {
	Splitter s;
	Button b;
	LineEdit e;
	ParentCtrl p;
	
	App() {
		b.SetLabel("some button");
		p.Add(b.HSizePos().TopPosZ(0,30));
		s.Vert(p, e);
		Add(s.SizePos());
	}
};

GUI_APP_MAIN {
	App().Run();	
}


Best regards,
Honza
Re: multiple controls on a splitter side [message #38220 is a reply to message #38209] Fri, 07 December 2012 08:57 Go to previous message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Thanks a lot Honza, I got this working now. I used the following code:

Custom Ctrl:

*this
	<< mDesc.SetLabel("Press ENTER to Search...").LeftPosZ(5, 120).TopPosZ(5, 30)
	<< mSearchQuery.HSizePosZ(130, 10).TopPosZ(10, 20)
;


Main form code file:

ParentCtrl mMovieCtrlHolder;
mMovieCtrlHolder
	<< mSearchCtrl.HSizePos().TopPosZ(0, 35)  // custom ctrl
	<< mMovieList.HSizePos().VSizePosZ(35, 0) // ArrayCtrl
;

// splitter.horz( add parentctrl to splitter with other ctrls... );

[Updated on: Fri, 07 December 2012 08:57]

Report message to a moderator

Previous Topic: Added One more example of reference/SplitterFrame
Next Topic: Uninitialised value in SplitterFrame
Goto Forum:
  


Current Time: Wed May 12 07:30:10 CEST 2021

Total time taken to generate the page: 0.02294 seconds