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 » right-click menu
Re: right-click menu [message #20721 is a reply to message #20715] Wed, 01 April 2009 21:30 Go to previous messageGo to previous message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
use grid's WhenMenuBar callback, connect it to your own menu callback and you have a custom right-click menu.

#include <CtrlLib/CtrlLib.h>
#include <GridCtrl/GridCtrl.h>

using namespace Upp;

class MyApp: public TopWindow {
	GridCtrl gc;
	typedef MyApp CLASSNAME;
public:
	MyApp () { 
		Add(gc.SizePos());
		gc.WhenMenuBar = THISBACK(GridMenu);
	}
	void GridMenu(Bar& bar) {
		bar.Add("My Menu", THISBACK(Nothing));
	}
	void Nothing() {}
};
GUI_APP_MAIN {
	MyApp ma;
	ma.Run();
}
 
Read Message
Read Message
Read Message
Previous Topic: DropList in Toolbar
Next Topic: Only one additional argument for Bar callback?
Goto Forum:
  


Current Time: Tue May 07 23:24:01 CEST 2024

Total time taken to generate the page: 0.02787 seconds