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 » menu Tree
Re: menu Tree [message #32379 is a reply to message #32378] Sat, 14 May 2011 14:57 Go to previous messageGo to previous message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
nlneilson wrote on Sat, 14 May 2011 10:41


Just informative lines of text with no action, THISBACK, or Callback.


Hello, Neil.

You can add Ctrl(s) to Bar with using Add(Ctrl& ctrl) or AddNC(Ctrl& ctrl) functions. For "informative" text, you can use Label Ctrl, for example:
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

class App : public TopWindow {
public:
	typedef App CLASSNAME;
	App();

	MenuBar menu;
	Label label;

	void MainBar(Bar& bar);
	void FileBar(Bar& bar);
};

App::App()
{
	Title("MenuBar test application");
	CenterScreen().Sizeable().MinimizeBox().MaximizeBox();
	SetRect(Size(320, 240));
	AddFrame(menu);
	AddFrame(TopSeparatorFrame());
	menu.Set(THISBACK(MainBar));

	label.SetLabel("Some informative text");
}

void App::MainBar(Bar& bar)
{
	bar.Add("File", THISBACK(FileBar));
}

void App::FileBar(Bar& bar)
{
	bar.AddNC(label);
	bar.Separator();
	bar.Add("Exit", THISBACK(Close)).Key(K_CTRL_Q);
}

GUI_APP_MAIN
{
	App app;
	app.Run();
}

[Updated on: Sat, 14 May 2011 15:18]

Report message to a moderator

 
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
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [Printing] How to retrieve DPI, page size, etc
Next Topic: dll example errors when trying
Goto Forum:
  


Current Time: Sun May 05 21:40:48 CEST 2024

Total time taken to generate the page: 0.02507 seconds