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 » Community » Newbie corner » Alignment of two (or more) toolbars at the same "level"
Re: Alignment of two (or more) toolbars at the same "level" [message #28406 is a reply to message #28392] Tue, 31 August 2010 20:35 Go to previous messageGo to previous message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
Hi Javier,

There are many ways how to have multiple toolbars and after that only one. Here is one way.
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

class ToolBars : public TopWindow {
public:
	typedef ToolBars CLASSNAME;
	ToolBars();
	ToolBar tb;
	Button btn;
	bool one;
	void Act() {}
	void TBar(Bar& bar)
	{
		bar.Add(CtrlImg::exclamation(), THISBACK(Act)).Label("Exclamation");
		if (!one)
			bar.Break();
		bar.Add(CtrlImg::information(), THISBACK(Act)).Label("Information");
	}
	void OneTB()
	{
		one = !one;
		tb.Set(THISBACK(TBar));
		if (one)
			btn.SetLabel("Two Toolbars");
		else
			btn.SetLabel("One Toolbar");
	}
};

ToolBars::ToolBars()
{
	one = false;
	Title("Window title");
	tb.Set(THISBACK(TBar));
	AddFrame(tb);
	Add(btn.LeftPos(10, 80).TopPos(10, 30));
	btn.SetLabel("One toolbar");
	btn.WhenAction = THISBACK(OneTB);
}

GUI_APP_MAIN
{
	ToolBars().Run();
}


Andrei
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Query regarding PopUpTable
Next Topic: Assorted queries regarding ArrayCtrl.
Goto Forum:
  


Current Time: Mon Apr 28 23:25:45 CEST 2025

Total time taken to generate the page: 0.00834 seconds