SHAPER  9.12.0
XGUI_MenuMgr Class Reference

A class for management of menu actions (features). More...

Inheritance diagram for XGUI_MenuMgr:
Inheritance graph

Public Member Functions

 XGUI_MenuMgr (XGUI_Workshop *theWorkshop)
 Constructor. More...
 
void createFeatureActions ()
 Creates feature actions. More...
 
virtual void processEvent (const std::shared_ptr< Events_Message > &theMessage)
 Redefinition of Events_Listener method. More...
 
virtual EVENTS_EXPORT bool groupMessages ()
 Listener that needs mostly grouped messages received returns true in this method. More...
 

Protected Member Functions

void addFeature (const std::shared_ptr< Config_FeatureMessage > &theMessage)
 Process event "Add a feature". More...
 
std::shared_ptr< XGUI_MenuWorkbenchfindWorkbench (const std::string &theWorkbenchName)
 Finds or creates a workbench for the given name. More...
 
QAction * buildAction (const std::shared_ptr< Config_FeatureMessage > &theMessage, const std::string &theWchName, const bool aUseSeparator) const
 Creates a new action by the message. More...
 
void groupWhileFlush (const std::shared_ptr< Events_Message > &theMessage)
 Allows to group messages while they are flushed (for flush for groupMessages=true listeners) More...
 
EVENTS_EXPORT void flushGrouped (const Events_ID &theID)
 Sends myGroups on flush finish. More...
 

Detailed Description

A class for management of menu actions (features).

The actions should be arranged like they are in XML file. It listens the read feature of XML and fills internal structure of menu workbenches and groups of feature. After, it creates menues and tools in the module.

Constructor & Destructor Documentation

◆ XGUI_MenuMgr()

XGUI_MenuMgr::XGUI_MenuMgr ( XGUI_Workshop theWorkshop)

Constructor.

Parameters
theWorkshopthe current workshop

Member Function Documentation

◆ createFeatureActions()

void XGUI_MenuMgr::createFeatureActions ( )

Creates feature actions.

◆ processEvent()

void XGUI_MenuMgr::processEvent ( const std::shared_ptr< Events_Message > &  theMessage)
virtual

Redefinition of Events_Listener method.

Parameters
theMessagea message

Implements Events_Listener.

◆ addFeature()

void XGUI_MenuMgr::addFeature ( const std::shared_ptr< Config_FeatureMessage > &  theMessage)
protected

Process event "Add a feature".

◆ findWorkbench()

std::shared_ptr< XGUI_MenuWorkbench > XGUI_MenuMgr::findWorkbench ( const std::string &  theWorkbenchName)
protected

Finds or creates a workbench for the given name.

Parameters
theWorkbenchNamea name defined in XML
Returns
an instance of workbench

◆ buildAction()

QAction * XGUI_MenuMgr::buildAction ( const std::shared_ptr< Config_FeatureMessage > &  theMessage,
const std::string &  theWchName,
const bool  aUseSeparator 
) const
protected

Creates a new action by the message.

Parameters
theMessagean XML information of the feature
theWchNamea workbench name, will be used as menu/tool bar name
aUseSeparatorboolean value if a separator should be added after the action
Returns
an action

◆ groupMessages()

virtual EVENTS_EXPORT bool Events_Listener::groupMessages ( )
inlinevirtualinherited

Listener that needs mostly grouped messages received returns true in this method.

In this case during the message is flushed, all the new messages are grouped, not sended immideately and then sent in the end of flush.

Reimplemented in SketchSolver_Manager, and SketchPlugin_OverConstraintsResolver.

◆ groupWhileFlush()

void Events_Listener::groupWhileFlush ( const std::shared_ptr< Events_Message > &  theMessage)
protectedinherited

Allows to group messages while they are flushed (for flush for groupMessages=true listeners)

◆ flushGrouped()

void Events_Listener::flushGrouped ( const Events_ID theID)
protectedinherited

Sends myGroups on flush finish.