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...
 
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...
 
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 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 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.

Author
Werner Mayer

Constructor & Destructor Documentation

◆ Workbench()

Workbench::Workbench ( )

Constructs a workbench object.

◆ ~Workbench()

Member Function Documentation

◆ activate()

◆ activated()

◆ addTaskWatcher()

void Workbench::addTaskWatcher ( const std::vector< Gui::TaskView::TaskWatcher * > &  Watcher)

◆ createLinkMenu()

◆ createMainWindowPopupMenu()

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::PythonWorkbench, and Gui::StdWorkbench.

Referenced by Gui::MainWindow::createPopupMenu().

◆ deactivated()

void Workbench::deactivated ( )
virtual

◆ getPyObject()

PyObject * Workbench::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

◆ listMenus()

std::list< std::string > Workbench::listMenus ( ) const

◆ listToolbars()

std::list< std::string > Workbench::listToolbars ( ) const

◆ name()

std::string Workbench::name ( ) const

◆ removeTaskWatcher()

◆ retranslate()

◆ 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()

◆ setupContextMenu()

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

◆ setupDockWindows()

virtual DockWindowItems* Gui::Workbench::setupDockWindows ( ) const
protectedpure virtual

◆ setupMenuBar()

◆ setupToolBars()


The documentation for this class was generated from the following files:
  • src/Gui/Workbench.h
  • src/Gui/Workbench.cpp