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 » Menus&Toolbars » Close context menu from within Execute() handler
Re: Close context menu from within Execute() handler [message #25357 is a reply to message #25356] Thu, 18 February 2010 12:07 Go to previous messageGo to previous message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
A little sample;
class MenuTest : public TopWindow {
public:
	typedef MenuTest CLASSNAME;
	MenuTest()
	{
		menuBar.Set(THISBACK(ThisMenu));
		ef.WhenEnter = THISBACK(EnterPressed);
	}
	void ThisMenu(Bar& bar)
	{
		bar.Gap(10);
		bar.Add(ef.SizePos(), Size(200, 20));
		bar.Gap(10);
		bar.Add("One", THISBACK(Action));
		bar.Add("Two", THISBACK(Action));
	}
	void EnterPressed()
	{
		PromptOK(String(~ef));
	}
	void RightDown(Point p, dword d)
	{
		if (menuBar.IsOpen()) {
			menuBar.Close();
			menuBar.PopUp();
		} else
			menuBar.PopUp();
	}
	void Action() {}
	EditField ef;
	MenuBar menuBar;
};
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Bigger images/icons in menu
Next Topic: Popup menu on button click
Goto Forum:
  


Current Time: Sat Jun 08 02:39:25 CEST 2024

Total time taken to generate the page: 0.02133 seconds