This is the base class for the workbench facility. More...
#include <Workbench.h>
Public Member Functions | |
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... | |
PyObject * | getPyObject () |
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... | |
virtual Type | getTypeId (void) const |
bool | isDerivedFrom (const Type type) const |
virtual void | setPyObject (PyObject *) |
virtual | ~BaseClass () |
Destruction. More... | |
Static Public Member Functions | |
static void | createLinkMenu (MenuItem *) |
Static Public Member Functions inherited from Base::BaseClass | |
static void * | create (void) |
static Type | getClassTypeId (void) |
static void | init (void) |
Protected Member Functions | |
virtual ToolBarItem * | setupCommandBars () const =0 |
Returns a ToolBarItem tree structure of command bars for this workbench. More... | |
virtual DockWindowItems * | setupDockWindows () const =0 |
Returns a DockWindowItems structure of dock windows this workbench. More... | |
virtual MenuItem * | setupMenuBar () const =0 |
Returns a MenuItem tree structure of menus for this workbench. More... | |
virtual ToolBarItem * | setupToolBars () const =0 |
Returns a ToolBarItem tree structure of toolbars for this workbench. More... | |
Additional Inherited Members | |
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
This is the base class for the workbench facility.
Each FreeCAD module can provide its own workbench implementation. The workbench defines which GUI elements (such as toolbars, menus, dockable windows, ...) are added to the mainwindow and which gets removed or hidden. When a workbench object gets activated the first time the module - it stands for - gets loaded into RAM.
Constructor & Destructor Documentation
◆ Workbench()
Workbench::Workbench | ( | ) |
Constructs a workbench object.
◆ ~Workbench()
|
virtual |
Reimplemented in SketcherGui::Workbench, RobotGui::Workbench, DrawingGui::Workbench, FemGui::Workbench, ImageGui::Workbench, ImportGui::Workbench, MeshGui::Workbench, MeshPartGui::Workbench, PartGui::Workbench, PointsGui::Workbench, RaytracingGui::Workbench, ReverseEngineeringGui::Workbench, SandboxGui::Workbench, StartGui::Workbench, TechDrawGui::Workbench, WebGui::Workbench, CloudGui::Workbench, InspectionGui::Workbench, SurfaceGui::Workbench, PartDesignGui::Workbench, and SpreadsheetGui::Workbench.
Member Function Documentation
◆ activate()
bool Workbench::activate | ( | ) |
Activates the workbench and adds/removes GUI elements.
References Gui::ToolBarManager::getInstance(), Gui::MenuManager::getInstance(), Gui::DockWindowManager::instance(), Gui::DockWindowManager::setup(), Gui::MenuManager::setup(), Gui::ToolBarManager::setup(), setupDockWindows(), setupMenuBar(), and setupToolBars().
Referenced by Gui::WorkbenchManager::activate(), ArchBuildingPart.ViewProviderBuildingPart::doubleClicked(), and DraftLayer.ViewProviderLayer::setupContextMenu().
◆ activated()
|
virtual |
Run some actions when the workbench gets activated.
Reimplemented in Gui::BlankWorkbench, StartGui::Workbench, RobotGui::Workbench, MeshGui::Workbench, PartDesignGui::Workbench, and SpreadsheetGui::Workbench.
Referenced by PartDesignGui::Workbench::activated(), MeshGui::Workbench::activated(), RobotGui::Workbench::activated(), and Gui::Application::activateWorkbench().
◆ addTaskWatcher()
void Workbench::addTaskWatcher | ( | const std::vector< Gui::TaskView::TaskWatcher * > & | Watcher | ) |
helper to add TaskWatcher to the TaskView
References Gui::TaskView::TaskView::addTaskWatcher(), Gui::Control(), and Gui::ControlSingleton::taskPanel().
Referenced by PartDesignGui::Workbench::activated(), MeshGui::Workbench::activated(), and RobotGui::Workbench::activated().
◆ createLinkMenu()
|
static |
◆ createMainWindowPopupMenu()
|
virtual |
Sets up the contextmenu for the main window for this workbench.
The default implementation does nothing.
Reimplemented in Gui::PythonWorkbench, and Gui::StdWorkbench.
Referenced by Gui::MainWindow::createPopupMenu().
◆ deactivated()
|
virtual |
Run some actions when the workbench gets deactivated.
Reimplemented in Gui::BlankWorkbench, RobotGui::Workbench, MeshGui::Workbench, and PartDesignGui::Workbench.
Referenced by Gui::Application::activateWorkbench(), PartDesignGui::Workbench::deactivated(), MeshGui::Workbench::deactivated(), and RobotGui::Workbench::deactivated().
◆ getPyObject()
|
virtual |
The default implementation returns an instance of WorkbenchPy.
Reimplemented from Base::BaseClass.
Reimplemented in Gui::PythonBaseWorkbench.
Referenced by Gui::Application::activateWorkbench().
◆ getToolbarItems()
std::list< std::pair< std::string, std::list< std::string > > > Workbench::getToolbarItems | ( | ) | const |
Shows a list of all toolbars and their commands.
References Gui::ToolBarItem::getItems(), and setupToolBars().
◆ listCommandbars()
std::list< std::string > Workbench::listCommandbars | ( | ) | const |
References Gui::ToolBarItem::getItems(), and setupCommandBars().
◆ listMenus()
std::list< std::string > Workbench::listMenus | ( | ) | const |
References Gui::MenuItem::getItems(), and setupMenuBar().
◆ listToolbars()
std::list< std::string > Workbench::listToolbars | ( | ) | const |
References Gui::ToolBarItem::getItems(), and setupToolBars().
◆ name()
std::string Workbench::name | ( | ) | const |
Returns the name of the workbench object.
Referenced by Gui::WorkbenchPy::activate(), Gui::Application::activateWorkbench(), Gui::Application::sActiveWorkbenchHandler(), setName(), and Gui::Application::setupContextMenu().
◆ removeTaskWatcher()
void Workbench::removeTaskWatcher | ( | void | ) |
remove the added TaskWatcher
References Gui::TaskView::TaskView::clearTaskWatcher(), Gui::Control(), and Gui::ControlSingleton::taskPanel().
Referenced by PartDesignGui::Workbench::deactivated(), MeshGui::Workbench::deactivated(), and RobotGui::Workbench::deactivated().
◆ retranslate()
void Workbench::retranslate | ( | ) | const |
Translates the window titles of all menus, toolbars and dock windows.
References Gui::ToolBarManager::getInstance(), Gui::MenuManager::getInstance(), Gui::DockWindowManager::instance(), Gui::MenuManager::retranslate(), Gui::ToolBarManager::retranslate(), and Gui::DockWindowManager::retranslate().
Referenced by Gui::MainWindow::changeEvent().
◆ setName()
void Workbench::setName | ( | const std::string & | name | ) |
Set the name to the workbench object.
References name().
Referenced by Gui::WorkbenchManager::createWorkbench(), and Gui::WorkbenchFactoryInst::createWorkbench().
◆ setupCommandBars()
|
protectedpure virtual |
Returns a ToolBarItem tree structure of command bars for this workbench.
Implemented in Gui::PythonWorkbench, Gui::PythonBaseWorkbench, Gui::TestWorkbench, Gui::NoneWorkbench, Gui::BlankWorkbench, Gui::StdWorkbench, StartGui::Workbench, WebGui::Workbench, MeshGui::Workbench, SketcherGui::Workbench, DrawingGui::Workbench, PartGui::Workbench, ReverseEngineeringGui::Workbench, SandboxGui::Workbench, TechDrawGui::Workbench, ImageGui::Workbench, ImportGui::Workbench, MeshPartGui::Workbench, PointsGui::Workbench, PartDesignGui::Workbench, and SpreadsheetGui::Workbench.
Referenced by listCommandbars().
◆ setupContextMenu()
|
virtual |
Sets up the contextmenu for this workbench.
The default implementation does nothing.
Reimplemented in Gui::PythonWorkbench, Gui::PythonBaseWorkbench, Gui::NoneWorkbench, Gui::BlankWorkbench, Gui::StdWorkbench, MeshGui::Workbench, StartGui::Workbench, WebGui::Workbench, FemGui::Workbench, and PartDesignGui::Workbench.
Referenced by Gui::Application::setupContextMenu().
◆ setupDockWindows()
|
protectedpure virtual |
Returns a DockWindowItems structure of dock windows this workbench.
Implemented in Gui::PythonWorkbench, Gui::PythonBaseWorkbench, Gui::NoneWorkbench, Gui::BlankWorkbench, Gui::StdWorkbench, StartGui::Workbench, WebGui::Workbench, and SandboxGui::Workbench.
Referenced by activate().
◆ setupMenuBar()
|
protectedpure virtual |
Returns a MenuItem tree structure of menus for this workbench.
Implemented in Gui::PythonWorkbench, Gui::PythonBaseWorkbench, Gui::TestWorkbench, Gui::NoneWorkbench, Gui::BlankWorkbench, Gui::StdWorkbench, RobotGui::Workbench, StartGui::Workbench, MeshGui::Workbench, WebGui::Workbench, FemGui::Workbench, PointsGui::Workbench, SketcherGui::Workbench, DrawingGui::Workbench, PartGui::Workbench, RaytracingGui::Workbench, ReverseEngineeringGui::Workbench, SandboxGui::Workbench, TechDrawGui::Workbench, InspectionGui::Workbench, SurfaceGui::Workbench, PartDesignGui::Workbench, and SpreadsheetGui::Workbench.
Referenced by activate(), and listMenus().
◆ setupToolBars()
|
protectedpure virtual |
Returns a ToolBarItem tree structure of toolbars for this workbench.
Implemented in Gui::PythonWorkbench, Gui::PythonBaseWorkbench, Gui::TestWorkbench, Gui::NoneWorkbench, Gui::BlankWorkbench, Gui::StdWorkbench, StartGui::Workbench, RobotGui::Workbench, WebGui::Workbench, MeshGui::Workbench, SketcherGui::Workbench, DrawingGui::Workbench, FemGui::Workbench, PartGui::Workbench, RaytracingGui::Workbench, ReverseEngineeringGui::Workbench, SandboxGui::Workbench, TechDrawGui::Workbench, ImageGui::Workbench, ImportGui::Workbench, MeshPartGui::Workbench, PointsGui::Workbench, InspectionGui::Workbench, SurfaceGui::Workbench, PartDesignGui::Workbench, and SpreadsheetGui::Workbench.
Referenced by activate(), getToolbarItems(), and listToolbars().
The documentation for this class was generated from the following files:
- src/Gui/Workbench.h
- src/Gui/Workbench.cpp