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
right-click menu [message #20715] Wed, 01 April 2009 15:59 Go to next message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
Is there a class ready for do a right-click menu on a gridctrl? many thanks to all Smile

Sam
Re: right-click menu [message #20721 is a reply to message #20715] Wed, 01 April 2009 21:30 Go to previous messageGo to next 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();
}
Re: right-click menu [message #20732 is a reply to message #20715] Thu, 02 April 2009 12:13 Go to previous message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
Thanks! you're great! Very Happy
Previous Topic: DropList in Toolbar
Next Topic: Only one additional argument for Bar callback?
Goto Forum:
  


Current Time: Fri Nov 01 01:35:47 CET 2024

Total time taken to generate the page: 0.03714 seconds