Gui::PythonWorkbench Class Reference

The PythonWorkbench class allows the manipulation of the workbench from Python. More...

#include <Workbench.h>

Public Member Functions

virtual void createMainWindowPopupMenu (MenuItem *) const
 Sets up the contextmenu for the main window for this workbench. More...
 
 PythonWorkbench ()
 
virtual void setupContextMenu (const char *recipient, MenuItem *) const
 Defines the standard context menu. More...
 
 ~PythonWorkbench ()
 
- Public Member Functions inherited from Gui::PythonBaseWorkbench
PyObjectgetPyObject ()
 Creates and returns immediately the corresponding Python workbench object. More...
 
 PythonBaseWorkbench ()
 
 ~PythonBaseWorkbench ()
 
void appendMenu (const std::list< std::string > &menu, const std::list< std::string > &items) const
 Appends a new menu. More...
 
void removeMenu (const std::string &menu) const
 Removes a menu. More...
 
void appendContextMenu (const std::list< std::string > &menu, const std::list< std::string > &items) const
 Appends new context menu items. More...
 
void removeContextMenu (const std::string &menu) const
 Removes a context menu. More...
 
void clearContextMenu ()
 
void appendToolbar (const std::string &bar, const std::list< std::string > &items) const
 Appends a new toolbar. More...
 
void removeToolbar (const std::string &bar) const
 Removes a toolbar. More...
 
void appendCommandbar (const std::string &bar, const std::list< std::string > &items) const
 Appends a new command bar. More...
 
void removeCommandbar (const std::string &bar) const
 Removes a command bar. More...
 
- Public Member Functions inherited from Gui::Workbench
bool activate ()
 Activates the workbench and adds/removes GUI elements. More...
 
virtual void activated ()
 Run some actions when the workbench gets activated. More...
 
void addTaskWatcher (const std::vector< Gui::TaskView::TaskWatcher * > &Watcher)
 helper to add TaskWatcher to the TaskView More...
 
virtual void createMainWindowPopupMenu (MenuItem *) const
 Sets up the contextmenu for the main window for this workbench. More...
 
virtual void deactivated ()
 Run some actions when the workbench gets deactivated. More...
 
PyObjectgetPyObject ()
 The default implementation returns an instance of WorkbenchPy. More...
 
std::list< std::pair< std::string, std::list< std::string > > > getToolbarItems () const
 Shows a list of all toolbars and their commands. More...
 
std::list< std::string > listCommandbars () const
 
std::list< std::string > listMenus () const
 
std::list< std::string > listToolbars () const
 
std::string name () const
 Returns the name of the workbench object. More...
 
void removeTaskWatcher (void)
 remove the added TaskWatcher More...
 
void retranslate () const
 Translates the window titles of all menus, toolbars and dock windows. More...
 
void setName (const std::string &)
 Set the name to the workbench object. More...
 
virtual void setupContextMenu (const char *recipient, MenuItem *) const
 Sets up the contextmenu for this workbench. More...
 
 Workbench ()
 Constructs a workbench object. More...
 
virtual ~Workbench ()
 
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction. More...
 
 BaseClass (const BaseClass &)=default
 
virtual PyObjectgetPyObject ()
 This method returns the Python wrapper for a C++ object. More...
 
virtual Type getTypeId () const
 
bool isDerivedFrom (const Type type) const
 
BaseClassoperator= (const BaseClass &)=default
 
virtual void setPyObject (PyObject *)
 
virtual ~BaseClass ()
 Destruction. More...
 

Protected Member Functions

ToolBarItemsetupCommandBars () const
 Returns a ToolBarItem tree structure of command bars for this workbench. More...
 
DockWindowItemssetupDockWindows () const
 Returns a DockWindowItems structure of dock windows this workbench. More...
 
MenuItemsetupMenuBar () const
 Returns a MenuItem tree structure of menus for this workbench. More...
 
ToolBarItemsetupToolBars () const
 Returns a ToolBarItem tree structure of toolbars for this workbench. More...
 
- Protected Member Functions inherited from Gui::PythonBaseWorkbench
- Protected Member Functions inherited from Gui::Workbench
void addPermanentMenuItems (MenuItem *) const
 Add permanent menu items to the structure. More...
 
virtual ToolBarItemsetupCommandBars () const =0
 Returns a ToolBarItem tree structure of command bars for this workbench. More...
 
virtual DockWindowItemssetupDockWindows () const =0
 Returns a DockWindowItems structure of dock windows this workbench. More...
 
virtual MenuItemsetupMenuBar () const =0
 Returns a MenuItem tree structure of menus for this workbench. More...
 
virtual ToolBarItemsetupToolBars () const =0
 Returns a ToolBarItem tree structure of toolbars for this workbench. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Gui::Workbench
static void addPermanentMenuItem (const std::string &cmd, const std::string &after)
 Add a permanent menu item cmd after an existing command after. More...
 
static void createLinkMenu (MenuItem *)
 
static void removePermanentMenuItem (const std::string &cmd)
 Removes the command cmd from the permanent menu items. More...
 
- Static Public Member Functions inherited from Base::BaseClass
static void * create ()
 
static Type getClassTypeId ()
 
static void init ()
 
- Static Protected Member Functions inherited from Base::BaseClass
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr)
 

Detailed Description

The PythonWorkbench class allows the manipulation of the workbench from Python.

Therefore PythonWorkbenchPy provides the required Python interface.

Author
Werner Mayer

Constructor & Destructor Documentation

◆ PythonWorkbench()

PythonWorkbench::PythonWorkbench ( )

◆ ~PythonWorkbench()

PythonWorkbench::~PythonWorkbench ( )

Member Function Documentation

◆ createMainWindowPopupMenu()

void PythonWorkbench::createMainWindowPopupMenu ( MenuItem ) const
virtual

Sets up the contextmenu for the main window for this workbench.

The default implementation does nothing.

Reimplemented from Gui::Workbench.

References Gui::StdWorkbench::createMainWindowPopupMenu().

◆ setupCommandBars()

ToolBarItem * PythonWorkbench::setupCommandBars ( ) const
protectedvirtual

Returns a ToolBarItem tree structure of command bars for this workbench.

Reimplemented from Gui::PythonBaseWorkbench.

References Gui::ToolBarItem::copy().

◆ setupContextMenu()

void PythonWorkbench::setupContextMenu ( const char *  recipient,
MenuItem item 
) const
virtual

Defines the standard context menu.

Reimplemented from Gui::PythonBaseWorkbench.

References Gui::StdWorkbench::setupContextMenu(), and Gui::PythonBaseWorkbench::setupContextMenu().

◆ setupDockWindows()

DockWindowItems * PythonWorkbench::setupDockWindows ( ) const
protectedvirtual

Returns a DockWindowItems structure of dock windows this workbench.

Reimplemented from Gui::PythonBaseWorkbench.

References Gui::StdWorkbench::setupDockWindows().

◆ setupMenuBar()

MenuItem * PythonWorkbench::setupMenuBar ( ) const
protectedvirtual

Returns a MenuItem tree structure of menus for this workbench.

Reimplemented from Gui::PythonBaseWorkbench.

References Gui::MenuItem::copy().

◆ setupToolBars()

ToolBarItem * PythonWorkbench::setupToolBars ( ) const
protectedvirtual

Returns a ToolBarItem tree structure of toolbars for this workbench.

Reimplemented from Gui::PythonBaseWorkbench.

References Gui::ToolBarItem::copy().


The documentation for this class was generated from the following files: