OpendTect  7.0
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 (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
void stopReceivingNotifications () const
 
virtual CallBackertrueCaller ()
 

Public Attributes

bool doadd_
 
bool ischecked_
 
bool isenabled_
 

Protected Member Functions

virtual void createMenuCB (CallBacker *)
 
virtual void handleMenuCB (CallBacker *)
 
virtual bool shouldAddMenu () const
 
virtual bool shouldBeChecked () const
 
virtual bool shouldBeEnabled () const
 

Protected Attributes

CallBack cb_
 
MenuHandlermenuhandler_
 
MenuItem menuitem_
 
BufferString parenttext_
 

Additional Inherited Members

- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

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::MenuItemHandler ( MenuHandler ,
const uiString nm,
const CallBack ,
const char *  parenttxt = 0,
int  placement = -1 
)

◆ ~MenuItemHandler()

MenuItemHandler::~MenuItemHandler ( )

Member Function Documentation

◆ createMenuCB()

virtual void MenuItemHandler::createMenuCB ( CallBacker )
protectedvirtual

◆ handleMenuCB()

virtual void MenuItemHandler::handleMenuCB ( CallBacker )
protectedvirtual

◆ setIcon()

void MenuItemHandler::setIcon ( const char *  fnm)

◆ shouldAddMenu()

virtual bool MenuItemHandler::shouldAddMenu ( ) const
inlineprotectedvirtual

◆ shouldBeChecked()

virtual bool MenuItemHandler::shouldBeChecked ( ) const
inlineprotectedvirtual

◆ shouldBeEnabled()

virtual bool MenuItemHandler::shouldBeEnabled ( ) const
inlineprotectedvirtual

Member Data Documentation

◆ cb_

CallBack MenuItemHandler::cb_
protected

◆ doadd_

bool MenuItemHandler::doadd_

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

◆ ischecked_

bool MenuItemHandler::ischecked_

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

◆ isenabled_

bool MenuItemHandler::isenabled_

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

◆ menuhandler_

MenuHandler& MenuItemHandler::menuhandler_
protected

◆ menuitem_

MenuItem MenuItemHandler::menuitem_
protected

◆ parenttext_

BufferString MenuItemHandler::parenttext_
protected

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