The PythonBaseWorkbench class allows the manipulation of the workbench from Python. More...
#include <Workbench.h>
Public Member Functions | |
| PyObject * | getPyObject () |
| Creates and returns immediately the corresponding Python workbench object. More... | |
| PythonBaseWorkbench () | |
| ~PythonBaseWorkbench () | |
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... | |
| 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... | |
| Workbench () | |
| Constructs a workbench object. More... | |
| virtual | ~Workbench () |
Public Member Functions inherited from Base::BaseClass | |
| BaseClass () | |
| Construction. More... | |
| virtual Type | getTypeId (void) const |
| bool | isDerivedFrom (const Type type) const |
| virtual void | setPyObject (PyObject *) |
| virtual | ~BaseClass () |
| Destruction. More... | |
Manipulation methods | |
| 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 | setupContextMenu (const char *recipient, MenuItem *) const |
| Sets up the contextmenu for this workbench. 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... | |
| MenuItem * | setupMenuBar () const |
| Returns a MenuItem tree structure of menus for this workbench. More... | |
| ToolBarItem * | setupToolBars () const |
| Returns a ToolBarItem tree structure of toolbars for this workbench. More... | |
| ToolBarItem * | setupCommandBars () const |
| Returns a ToolBarItem tree structure of command bars for this workbench. More... | |
| DockWindowItems * | setupDockWindows () const |
| Returns a DockWindowItems structure of dock windows this workbench. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Gui::Workbench | |
| static void | createLinkMenu (MenuItem *) |
Static Public Member Functions inherited from Base::BaseClass | |
| static void * | create (void) |
| static Type | getClassTypeId (void) |
| static void | init (void) |
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 PythonBaseWorkbench class allows the manipulation of the workbench from Python.
Therefore PythonWorkbenchPy provides the required Python interface.
Constructor & Destructor Documentation
◆ PythonBaseWorkbench()
| PythonBaseWorkbench::PythonBaseWorkbench | ( | ) |
◆ ~PythonBaseWorkbench()
| PythonBaseWorkbench::~PythonBaseWorkbench | ( | ) |
Member Function Documentation
◆ appendCommandbar()
| void PythonBaseWorkbench::appendCommandbar | ( | const std::string & | bar, |
| const std::list< std::string > & | items | ||
| ) | const |
Appends a new command bar.
References Gui::ToolBarItem::findItem(), and Gui::ToolBarItem::setCommand().
Referenced by Gui::PythonWorkbenchPy::appendCommandbar(), InitGui.TemplatePyModWorkbench::Initialize(), and Mod.Test.InitGui.TestWorkbench::Initialize().
◆ appendContextMenu()
| void PythonBaseWorkbench::appendContextMenu | ( | const std::list< std::string > & | menu, |
| const std::list< std::string > & | items | ||
| ) | const |
Appends new context menu items.
References Gui::MenuItem::findItem(), and Gui::MenuItem::setCommand().
Referenced by Gui::PythonWorkbenchPy::appendContextMenu(), InitGui.DraftWorkbench::ContextMenu(), InitGui.PathWorkbench::ContextMenu(), and InitGui.ArchWorkbench::ContextMenu().
◆ appendMenu()
| void PythonBaseWorkbench::appendMenu | ( | const std::list< std::string > & | menu, |
| const std::list< std::string > & | items | ||
| ) | const |
Appends a new menu.
References Gui::MenuItem::findItem(), Gui::MenuItem::insertItem(), and Gui::MenuItem::setCommand().
Referenced by Gui::PythonWorkbenchPy::appendMenu(), InitGui.TemplatePyModWorkbench::Initialize(), InitGui.ShipWorkbench::Initialize(), InitGui.PlotWorkbench::Initialize(), Mod.Test.InitGui.TestWorkbench::Initialize(), and InitGui.OpenSCADWorkbench::Initialize().
◆ appendToolbar()
| void PythonBaseWorkbench::appendToolbar | ( | const std::string & | bar, |
| const std::list< std::string > & | items | ||
| ) | const |
Appends a new toolbar.
References Gui::ToolBarItem::findItem(), and Gui::ToolBarItem::setCommand().
Referenced by Gui::PythonWorkbenchPy::appendToolbar(), InitGui.TemplatePyModWorkbench::Initialize(), InitGui.ShipWorkbench::Initialize(), InitGui.PlotWorkbench::Initialize(), Mod.Test.InitGui.TestWorkbench::Initialize(), InitGui.OpenSCADWorkbench::Initialize(), and Mod.Test.Workbench.WorkbenchTestCase::testHandler().
◆ clearContextMenu()
| void PythonBaseWorkbench::clearContextMenu | ( | ) |
◆ getPyObject()
|
virtual |
Creates and returns immediately the corresponding Python workbench object.
Reimplemented from Gui::Workbench.
◆ removeCommandbar()
| void PythonBaseWorkbench::removeCommandbar | ( | const std::string & | bar | ) | const |
Removes a command bar.
References Gui::ToolBarItem::findItem(), and Gui::ToolBarItem::removeItem().
Referenced by Gui::PythonWorkbenchPy::removeCommandbar().
◆ removeContextMenu()
| void PythonBaseWorkbench::removeContextMenu | ( | const std::string & | menu | ) | const |
Removes a context menu.
References Gui::MenuItem::findItem(), and Gui::MenuItem::removeItem().
Referenced by Gui::PythonWorkbenchPy::removeContextMenu().
◆ removeMenu()
| void PythonBaseWorkbench::removeMenu | ( | const std::string & | menu | ) | const |
Removes a menu.
References Gui::MenuItem::findItem(), and Gui::MenuItem::removeItem().
Referenced by Gui::PythonWorkbenchPy::removeMenu().
◆ removeToolbar()
| void PythonBaseWorkbench::removeToolbar | ( | const std::string & | bar | ) | const |
Removes a toolbar.
References Gui::ToolBarItem::findItem(), and Gui::ToolBarItem::removeItem().
Referenced by Gui::PythonWorkbenchPy::removeToolbar().
◆ setupCommandBars()
|
protectedvirtual |
Returns a ToolBarItem tree structure of command bars for this workbench.
Implements Gui::Workbench.
Reimplemented in Gui::PythonWorkbench.
References Gui::ToolBarItem::copy().
◆ setupContextMenu()
|
virtual |
Sets up the contextmenu for this workbench.
The default implementation does nothing.
Reimplemented from Gui::Workbench.
Reimplemented in Gui::PythonWorkbench.
References Gui::MenuItem::appendItem().
Referenced by Gui::PythonWorkbench::setupContextMenu().
◆ setupDockWindows()
|
protectedvirtual |
Returns a DockWindowItems structure of dock windows this workbench.
Implements Gui::Workbench.
Reimplemented in Gui::PythonWorkbench.
◆ setupMenuBar()
|
protectedvirtual |
Returns a MenuItem tree structure of menus for this workbench.
Implements Gui::Workbench.
Reimplemented in Gui::PythonWorkbench.
References Gui::MenuItem::copy().
◆ setupToolBars()
|
protectedvirtual |
Returns a ToolBarItem tree structure of toolbars for this workbench.
Implements Gui::Workbench.
Reimplemented in Gui::PythonWorkbench.
References Gui::ToolBarItem::copy().
The documentation for this class was generated from the following files:
- src/Gui/Workbench.h
- src/Gui/Workbench.cpp
Public Member Functions inherited from
1.8.17