OpendTect-6_4  6.4
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MenuItemHandler Class Reference
Inheritance diagram for MenuItemHandler:
[legend]

Public Member Functions

 MenuItemHandler (MenuHandler &, const uiString &nm, const CallBack &, const char *parenttxt=0, int placement=-1)
 
 ~MenuItemHandler ()
 
void setIcon (const char *fnm)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

Public Attributes

bool doadd_
 
bool isenabled_
 
bool ischecked_
 

Protected Member Functions

virtual void createMenuCB (CallBacker *)
 
virtual void handleMenuCB (CallBacker *)
 
virtual bool shouldAddMenu () const
 
virtual bool shouldBeEnabled () const
 
virtual bool shouldBeChecked () const
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 

Protected Attributes

MenuItem menuitem_
 
MenuHandlermenuhandler_
 
CallBack cb_
 
BufferString parenttext_
 

Detailed Description

handles the MenuItem insertion automaticly. If the menu is selected, a callback is triggered. Default behaviour is that the menu item is added every time the menu is built, and that it's enabled but not checked. That can be changes by setting the doadd_, isenabled_ and ischecked_ or by an inheriting object in the shouldAddMenu(), shouldBeEnabled() and shouldBeChecked() functions.

Constructor & Destructor Documentation

MenuItemHandler::MenuItemHandler ( MenuHandler ,
const uiString nm,
const CallBack ,
const char *  parenttxt = 0,
int  placement = -1 
)
MenuItemHandler::~MenuItemHandler ( )

Member Function Documentation

virtual void MenuItemHandler::createMenuCB ( CallBacker )
protectedvirtual
virtual void MenuItemHandler::handleMenuCB ( CallBacker )
protectedvirtual
void MenuItemHandler::setIcon ( const char *  fnm)
virtual bool MenuItemHandler::shouldAddMenu ( ) const
inlineprotectedvirtual
virtual bool MenuItemHandler::shouldBeChecked ( ) const
inlineprotectedvirtual
virtual bool MenuItemHandler::shouldBeEnabled ( ) const
inlineprotectedvirtual

Member Data Documentation

CallBack MenuItemHandler::cb_
protected
bool MenuItemHandler::doadd_

Item is added if true AND shouldAddMenu() retuns true. Default is true.

bool MenuItemHandler::ischecked_

Item is checked if true OR shouldBeChecked() retuns true. Default is false.

bool MenuItemHandler::isenabled_

Item is enabled if true AND shouldBeEnabled() retuns true. Default is true.

MenuHandler& MenuItemHandler::menuhandler_
protected
MenuItem MenuItemHandler::menuitem_
protected
BufferString MenuItemHandler::parenttext_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019