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 » Selected option, show which is active
Re: Selected option, show which is active [message #28329 is a reply to message #28328] Fri, 27 August 2010 22:43 Go to previous messageGo to previous message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Hello, Neil.

Here, the full example:
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

class App : public TopWindow {
private:
	bool checkBox;
public:
	typedef App CLASSNAME;
	App();

	MenuBar menu;

	void MenuBar(Bar& bar);
	void FileBar(Bar& bar);

	void OnCheck();
};

App::App() : checkBox(false)
{
	Title("CheckBox test application");
	CenterScreen().Sizeable().MinimizeBox().MaximizeBox();
	SetRect(Size(320, 240));

	AddFrame(menu);
	AddFrame(TopSeparatorFrame());
	menu.Set(THISBACK(MenuBar));
}

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

void App::FileBar(Bar& bar)
{
	bar.Add(t_("Check"), THISBACK(OnCheck)).Check(checkBox).Key(K_CTRL_W);
	bar.Separator();
	bar.Add(t_("Exit"), THISBACK(Close)).Key(K_CTRL_Q);
}

void App::OnCheck()
{
	checkBox = !checkBox;
}

GUI_APP_MAIN
{
	App app;
	app.Run();
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Making applications more fancy
Next Topic: Query regarding PopUpTable
Goto Forum:
  


Current Time: Sun Jun 22 15:39:41 CEST 2025

Total time taken to generate the page: 0.03859 seconds