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. | |
virtual void | activated () |
Run some actions when the workbench gets activated. | |
void | addTaskWatcher (std::vector< Gui::TaskView::TaskWatcher * > &Watcher) |
helper to add TaskWatcher to the TaskView | |
virtual void | createMainWindowPopupMenu (MenuItem *) const |
Sets up the contextmenu for the main window for this workbench. | |
virtual void | deactivated () |
Run some actions when the workbench gets deactivated. | |
PyObject * | getPyObject () |
The default implementation returns an instance of WorkbenchPy. | |
virtual Base::Type | getTypeId (void) const |
std::string | name () const |
Returns the name of the workbench object. | |
void | removeTaskWatcher (void) |
remove the added TaskWatcher | |
void | retranslate () const |
Translates the window titles of all menus, toolbars and dock windows. | |
void | setName (const std::string &) |
Set the name to the workbench object. | |
virtual void | setupContextMenu (const char *recipient, MenuItem *) const |
Sets up the contextmenu for this workbench. | |
Workbench () | |
Constructs a workbench object. | |
virtual | ~Workbench () |
Static Public Member Functions | |
static void * | create (void) |
static Base::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. | |
virtual DockWindowItems * | setupDockWindows () const =0 |
Returns a DockWindowItems structure of dock windows this workbench. | |
virtual MenuItem * | setupMenuBar () const =0 |
Returns a MenuItem tree structure of menus for this workbench. | |
virtual ToolBarItem * | setupToolBars () const =0 |
Returns a ToolBarItem tree structure of toolbars for this workbench. |
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.
Definition at line 51 of file Gui/Workbench.h.
Workbench::Workbench | ( | ) |
Constructs a workbench object.
Reimplemented in AssemblyGui::Workbench, CamGui::Workbench, CompleteGui::Workbench, DrawingGui::Workbench, FemGui::Workbench, ImageGui::Workbench, ImportGui::Workbench, InspectionGui::Workbench, MeshGui::Workbench, MeshPartGui::Workbench, PartGui::Workbench, PartDesignGui::Workbench, PointsGui::Workbench, RaytracingGui::Workbench, ReverseEngineeringGui::Workbench, RobotGui::Workbench, SandboxGui::Workbench, SketcherGui::Workbench, StartGui::Workbench, and WebGui::Workbench.
Definition at line 203 of file Gui/Workbench.cpp.
Workbench::~Workbench | ( | ) | [virtual] |
Reimplemented in AssemblyGui::Workbench, CamGui::Workbench, CompleteGui::Workbench, DrawingGui::Workbench, FemGui::Workbench, ImageGui::Workbench, ImportGui::Workbench, InspectionGui::Workbench, MeshGui::Workbench, MeshPartGui::Workbench, PartGui::Workbench, PartDesignGui::Workbench, PointsGui::Workbench, RaytracingGui::Workbench, ReverseEngineeringGui::Workbench, RobotGui::Workbench, SandboxGui::Workbench, SketcherGui::Workbench, StartGui::Workbench, and WebGui::Workbench.
Definition at line 208 of file Gui/Workbench.cpp.
bool Workbench::activate | ( | void | ) |
Activates the workbench and adds/removes GUI elements.
Definition at line 306 of file Gui/Workbench.cpp.
References Gui::MenuManager::getInstance(), Gui::ToolBarManager::getInstance(), Gui::DockWindowManager::instance(), Gui::MenuManager::setup(), Gui::DockWindowManager::setup(), Gui::ToolBarManager::setup(), setupCommandBars(), setupDockWindows(), setupMenuBar(), and setupToolBars().
Referenced by Gui::WorkbenchManager::activate().
void Workbench::activated | ( | ) | [virtual] |
Run some actions when the workbench gets activated.
Reimplemented in Gui::BlankWorkbench, PartDesignGui::Workbench, RobotGui::Workbench, and StartGui::Workbench.
Definition at line 298 of file Gui/Workbench.cpp.
Referenced by Gui::Application::activateWorkbench().
void Workbench::addTaskWatcher | ( | std::vector< Gui::TaskView::TaskWatcher * > & | Watcher | ) |
helper to add TaskWatcher to the TaskView
Definition at line 344 of file Gui/Workbench.cpp.
References Gui::TaskView::TaskView::addTaskWatcher(), Gui::Control(), and Gui::ControlSingleton::taskPanel().
Referenced by RobotGui::Workbench::activated(), and PartDesignGui::Workbench::activated().
void * Workbench::create | ( | void | ) | [static] |
Reimplemented from Base::BaseClass.
Reimplemented in Gui::StdWorkbench, Gui::BlankWorkbench, Gui::NoneWorkbench, Gui::TestWorkbench, Gui::PythonWorkbench, AssemblyGui::Workbench, CamGui::Workbench, CompleteGui::Workbench, DrawingGui::Workbench, FemGui::Workbench, ImageGui::Workbench, ImportGui::Workbench, InspectionGui::Workbench, MeshGui::Workbench, MeshPartGui::Workbench, PartGui::Workbench, PartDesignGui::Workbench, PointsGui::Workbench, RaytracingGui::Workbench, ReverseEngineeringGui::Workbench, RobotGui::Workbench, SandboxGui::Workbench, SketcherGui::Workbench, StartGui::Workbench, and WebGui::Workbench.
Definition at line 201 of file Gui/Workbench.cpp.
void Workbench::createMainWindowPopupMenu | ( | MenuItem * | ) | const [virtual] |
Sets up the contextmenu for the main window for this workbench.
The default implementation does nothing.
Reimplemented in Gui::StdWorkbench.
Definition at line 294 of file Gui/Workbench.cpp.
Referenced by Gui::MainWindow::createPopupMenu().
void Workbench::deactivated | ( | ) | [virtual] |
Run some actions when the workbench gets deactivated.
Reimplemented in Gui::BlankWorkbench, PartDesignGui::Workbench, and RobotGui::Workbench.
Definition at line 302 of file Gui/Workbench.cpp.
Referenced by Gui::Application::activateWorkbench().
Base::Type Workbench::getClassTypeId | ( | void | ) | [static] |
Reimplemented from Base::BaseClass.
Reimplemented in Gui::StdWorkbench, Gui::BlankWorkbench, Gui::NoneWorkbench, Gui::TestWorkbench, Gui::PythonWorkbench, AssemblyGui::Workbench, CamGui::Workbench, CompleteGui::Workbench, DrawingGui::Workbench, FemGui::Workbench, ImageGui::Workbench, ImportGui::Workbench, InspectionGui::Workbench, MeshGui::Workbench, MeshPartGui::Workbench, PartGui::Workbench, PartDesignGui::Workbench, PointsGui::Workbench, RaytracingGui::Workbench, ReverseEngineeringGui::Workbench, RobotGui::Workbench, SandboxGui::Workbench, SketcherGui::Workbench, StartGui::Workbench, and WebGui::Workbench.
Definition at line 201 of file Gui/Workbench.cpp.
Referenced by Gui::WorkbenchManager::createWorkbench().
PyObject * Workbench::getPyObject | ( | void | ) | [virtual] |
The default implementation returns an instance of WorkbenchPy.
Reimplemented from Base::BaseClass.
Reimplemented in Gui::PythonWorkbench.
Definition at line 339 of file Gui/Workbench.cpp.
Referenced by Gui::Application::activateWorkbench(), and initCompleteGui().
Base::Type Workbench::getTypeId | ( | void | ) | const [virtual] |
Reimplemented from Base::BaseClass.
Reimplemented in Gui::StdWorkbench, Gui::BlankWorkbench, Gui::NoneWorkbench, Gui::TestWorkbench, Gui::PythonWorkbench, AssemblyGui::Workbench, CamGui::Workbench, CompleteGui::Workbench, DrawingGui::Workbench, FemGui::Workbench, ImageGui::Workbench, ImportGui::Workbench, InspectionGui::Workbench, MeshGui::Workbench, MeshPartGui::Workbench, PartGui::Workbench, PartDesignGui::Workbench, PointsGui::Workbench, RaytracingGui::Workbench, ReverseEngineeringGui::Workbench, RobotGui::Workbench, SandboxGui::Workbench, SketcherGui::Workbench, StartGui::Workbench, and WebGui::Workbench.
Definition at line 201 of file Gui/Workbench.cpp.
Referenced by Gui::Application::setupContextMenu().
void Workbench::init | ( | void | ) | [static] |
Reimplemented from Base::BaseClass.
Reimplemented in Gui::StdWorkbench, Gui::BlankWorkbench, Gui::NoneWorkbench, Gui::TestWorkbench, Gui::PythonWorkbench, AssemblyGui::Workbench, CamGui::Workbench, CompleteGui::Workbench, DrawingGui::Workbench, FemGui::Workbench, ImageGui::Workbench, ImportGui::Workbench, InspectionGui::Workbench, MeshGui::Workbench, MeshPartGui::Workbench, PartGui::Workbench, PartDesignGui::Workbench, PointsGui::Workbench, RaytracingGui::Workbench, ReverseEngineeringGui::Workbench, RobotGui::Workbench, SandboxGui::Workbench, SketcherGui::Workbench, StartGui::Workbench, and WebGui::Workbench.
Definition at line 201 of file Gui/Workbench.cpp.
Referenced by Gui::Application::initTypes().
std::string Workbench::name | ( | ) | const |
Returns the name of the workbench object.
Definition at line 212 of file Gui/Workbench.cpp.
Referenced by Gui::WorkbenchPy::activate(), StdCmdWorkbench::activated(), Gui::Application::activateWorkbench(), Gui::Dialog::DlgCustomToolbarsImp::addCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::addCustomToolbar(), Gui::Dialog::DlgCustomToolbarsImp::moveDownCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::moveUpCustomCommand(), Gui::WorkbenchPy::name(), Gui::Dialog::DlgCustomToolbarsImp::removeCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::removeCustomToolbar(), Gui::Dialog::DlgCustomToolbarsImp::renameCustomToolbar(), Gui::Application::sActiveWorkbenchHandler(), and Gui::Application::setupContextMenu().
void Workbench::removeTaskWatcher | ( | void | ) |
remove the added TaskWatcher
Definition at line 351 of file Gui/Workbench.cpp.
References Gui::TaskView::TaskView::clearTaskWatcher(), Gui::Control(), and Gui::ControlSingleton::taskPanel().
Referenced by RobotGui::Workbench::deactivated(), and PartDesignGui::Workbench::deactivated().
void Workbench::retranslate | ( | ) | const |
Translates the window titles of all menus, toolbars and dock windows.
Definition at line 331 of file Gui/Workbench.cpp.
References Gui::MenuManager::getInstance(), Gui::ToolBarManager::getInstance(), Gui::DockWindowManager::instance(), Gui::MenuManager::retranslate(), Gui::DockWindowManager::retranslate(), and Gui::ToolBarManager::retranslate().
Referenced by Gui::MainWindow::changeEvent().
void Workbench::setName | ( | const std::string & | name | ) |
Set the name to the workbench object.
Definition at line 217 of file Gui/Workbench.cpp.
Referenced by Gui::WorkbenchManager::createWorkbench(), and Gui::WorkbenchFactoryInst::createWorkbench().
virtual ToolBarItem* Gui::Workbench::setupCommandBars | ( | ) | const [protected, pure virtual] |
Returns a ToolBarItem tree structure of command bars for this workbench.
Implemented in Gui::StdWorkbench, Gui::BlankWorkbench, Gui::NoneWorkbench, Gui::TestWorkbench, Gui::PythonWorkbench, AssemblyGui::Workbench, CamGui::Workbench, CompleteGui::Workbench, DrawingGui::Workbench, ImageGui::Workbench, ImportGui::Workbench, MeshGui::Workbench, MeshPartGui::Workbench, PartGui::Workbench, PartDesignGui::Workbench, PointsGui::Workbench, ReverseEngineeringGui::Workbench, SandboxGui::Workbench, SketcherGui::Workbench, StartGui::Workbench, and WebGui::Workbench.
Referenced by activate().
void Workbench::setupContextMenu | ( | const char * | recipient, | |
MenuItem * | item | |||
) | const [virtual] |
Sets up the contextmenu for this workbench.
The default implementation does nothing.
Reimplemented in Gui::StdWorkbench, Gui::BlankWorkbench, Gui::NoneWorkbench, Gui::PythonWorkbench, CompleteGui::Workbench, MeshGui::Workbench, StartGui::Workbench, and WebGui::Workbench.
Definition at line 290 of file Gui/Workbench.cpp.
Referenced by Gui::Application::setupContextMenu().
virtual DockWindowItems* Gui::Workbench::setupDockWindows | ( | ) | const [protected, pure virtual] |
Returns a DockWindowItems structure of dock windows this workbench.
Implemented in Gui::StdWorkbench, Gui::BlankWorkbench, Gui::NoneWorkbench, CompleteGui::Workbench, StartGui::Workbench, and WebGui::Workbench.
Referenced by activate().
virtual MenuItem* Gui::Workbench::setupMenuBar | ( | ) | const [protected, pure virtual] |
Returns a MenuItem tree structure of menus for this workbench.
Implemented in Gui::StdWorkbench, Gui::BlankWorkbench, Gui::NoneWorkbench, Gui::TestWorkbench, Gui::PythonWorkbench, CamGui::Workbench, CompleteGui::Workbench, DrawingGui::Workbench, FemGui::Workbench, InspectionGui::Workbench, MeshGui::Workbench, PartGui::Workbench, PartDesignGui::Workbench, PointsGui::Workbench, RaytracingGui::Workbench, ReverseEngineeringGui::Workbench, RobotGui::Workbench, SandboxGui::Workbench, SketcherGui::Workbench, StartGui::Workbench, and WebGui::Workbench.
Referenced by activate().
virtual ToolBarItem* Gui::Workbench::setupToolBars | ( | ) | const [protected, pure virtual] |
Returns a ToolBarItem tree structure of toolbars for this workbench.
Implemented in Gui::StdWorkbench, Gui::BlankWorkbench, Gui::NoneWorkbench, Gui::TestWorkbench, Gui::PythonWorkbench, AssemblyGui::Workbench, CamGui::Workbench, CompleteGui::Workbench, DrawingGui::Workbench, FemGui::Workbench, ImageGui::Workbench, ImportGui::Workbench, InspectionGui::Workbench, MeshGui::Workbench, MeshPartGui::Workbench, PartGui::Workbench, PartDesignGui::Workbench, PointsGui::Workbench, ReverseEngineeringGui::Workbench, RobotGui::Workbench, SandboxGui::Workbench, SketcherGui::Workbench, StartGui::Workbench, and WebGui::Workbench.
Referenced by activate().