Gui::CommandBase Class Referenceabstract

The CommandBase class This lightweight class is the base class of all commands in FreeCAD. More...

#include <Command.h>

Public Member Functions

ActiongetAction () const
 Returns the Action object of this command, or 0 if it doesn't exist. More...
 
Methods to get the properties of the command
virtual const char * getMenuText () const
 
virtual const char * getToolTipText () const
 
virtual const char * getStatusTip () const
 
virtual const char * getWhatsThis () const
 
virtual const char * getPixmap () const
 
virtual const char * getAccel () const
 
Methods to set the properties of the command
void setWhatsThis (const char *)
 
void setMenuText (const char *)
 
void setToolTipText (const char *)
 
void setStatusTip (const char *)
 
void setPixmap (const char *)
 
void setAccel (const char *)
 

Protected Member Functions

 CommandBase (const char *sMenu, const char *sToolTip=nullptr, const char *sWhat=nullptr, const char *sStatus=nullptr, const char *sPixmap=nullptr, const char *sAccel=nullptr)
 
virtual ~CommandBase ()
 

Protected Attributes

Attributes set by the inherited constructor.

They set up the most important properties of the command.

In the constructor are set default values. The real values should be set in the constructor of the inheriting class.

const char * sMenuText
 
const char * sToolTipText
 
const char * sWhatsThis
 
const char * sStatusTip
 
const char * sPixmap
 
const char * sAccel
 
std::string displayText
 

Methods to override when creating a new command

virtual ActioncreateAction (void)
 Creates the used Action when adding to a widget. The default implementation does nothing. More...
 
virtual void languageChange ()=0
 Reassigns QAction stuff after the language has changed. More...
 
virtual void updateAction (int mode)=0
 Updates the QAction with respect to the passed mode. More...
 
virtual const char * className () const =0
 The C++ class name is needed as context for the translation framework. More...
 

Detailed Description

The CommandBase class This lightweight class is the base class of all commands in FreeCAD.

It represents the link between the FreeCAD command framework and the QAction world of Qt.

Author
Werner Mayer

Constructor & Destructor Documentation

◆ CommandBase()

CommandBase::CommandBase ( const char *  sMenu,
const char *  sToolTip = nullptr,
const char *  sWhat = nullptr,
const char *  sStatus = nullptr,
const char *  sPixmap = nullptr,
const char *  sAccel = nullptr 
)
protected

◆ ~CommandBase()

CommandBase::~CommandBase ( )
protectedvirtual

Member Function Documentation

◆ className()

virtual const char * Gui::CommandBase::className ( ) const
pure virtual

The C++ class name is needed as context for the translation framework.

Implemented in Gui::PythonCommand, Gui::PythonGroupCommand, Gui::MacroCommand, StdCmdOpen, StdCmdImport, StdCmdExport, StdCmdMergeProjects, StdCmdDependencyGraph, StdCmdNew, StdCmdSave, StdCmdSaveAs, StdCmdSaveCopy, StdCmdSaveAll, StdCmdRevert, StdCmdProjectInfo, StdCmdProjectUtil, StdCmdPrint, StdCmdPrintPreview, StdCmdPrintPdf, StdCmdQuit, StdCmdUndo, StdCmdRedo, StdCmdCut, StdCmdCopy, StdCmdPaste, StdCmdDuplicateSelection, StdCmdSelectAll, StdCmdDelete, StdCmdRefresh, StdCmdTransform, StdCmdPlacement, StdCmdTransformManip, StdCmdAlignment, StdCmdEdit, StdCmdExpression, StdCmdLinkMakeGroup, StdCmdLinkMake, StdCmdLinkMakeRelative, StdCmdLinkReplace, StdCmdLinkUnlink, StdCmdLinkImport, StdCmdLinkImportAll, StdCmdLinkSelectLinked, StdCmdLinkSelectLinkedFinal, StdCmdLinkSelectAllLinks, StdCmdLinkSelectActions, StdCmdLinkActions, StdCmdDlgMacroRecord, StdCmdMacroStopRecord, StdCmdDlgMacroExecute, StdCmdDlgMacroExecuteDirect, StdCmdMacroAttachDebugger, StdCmdMacroStartDebug, StdCmdMacroStopDebug, StdCmdMacroStepOver, StdCmdMacroStepInto, StdCmdToggleBreakpoint, StdCmdWorkbench, StdCmdRecentFiles, StdCmdRecentMacros, StdCmdAbout, StdCmdAboutQt, StdCmdWhatsThis, StdCmdDlgParameter, StdCmdDlgPreferences, StdCmdDlgCustomize, StdCmdCommandLine, StdCmdOnlineHelp, StdCmdOnlineHelpWebsite, StdCmdFreeCADDonation, StdCmdFreeCADWebsite, StdCmdFreeCADUserHub, StdCmdFreeCADPowerUserHub, StdCmdFreeCADForum, StdCmdFreeCADFAQ, StdCmdPythonWebsite, StdCmdReportBug, StdCmdMeasurementSimple, StdCmdTextDocument, StdCmdUnitsCalculator, StdCmdUserEditMode, StdCmdPart, StdCmdGroup, Std_TestQM, Std_TestReloadQM, FCCmdTest1, FCCmdTest2, FCCmdTest3, FCCmdTest4, FCCmdTest5, FCCmdTest6, CmdTestCmdFuncs, CmdTestProgress1, CmdTestProgress2, CmdTestProgress3, CmdTestProgress4, CmdTestProgress5, CmdTestMDI1, CmdTestMDI2, CmdTestMDI3, CmdTestConsoleOutput, StdOrthographicCamera, StdPerspectiveCamera, StdCmdViewSaveCamera, StdCmdViewRestoreCamera, StdCmdFreezeViews, StdCmdToggleClipPlane, StdCmdDrawStyle, StdCmdToggleVisibility, StdCmdToggleSelectability, StdCmdShowSelection, StdCmdHideSelection, StdCmdSelectVisibleObjects, StdCmdToggleObjects, StdCmdShowObjects, StdCmdHideObjects, StdCmdSetAppearance, StdCmdViewHome, StdCmdViewBottom, StdCmdViewFront, StdCmdViewLeft, StdCmdViewRear, StdCmdViewRight, StdCmdViewTop, StdCmdViewIsometric, StdCmdViewDimetric, StdCmdViewTrimetric, StdCmdViewRotateLeft, StdCmdViewRotateRight, StdCmdViewFitAll, StdCmdViewFitSelection, StdViewDock, StdViewUndock, StdMainFullscreen, StdViewFullscreen, StdViewDockUndockFullscreen, StdCmdViewVR, StdViewScreenShot, StdCmdViewCreate, StdCmdToggleNavigation, StdCmdAxisCross, StdCmdViewExample1, StdCmdViewExample2, StdCmdViewExample3, StdCmdViewIvStereoOff, StdCmdViewIvStereoRedGreen, StdCmdViewIvStereoQuadBuff, StdCmdViewIvStereoInterleavedRows, StdCmdViewIvStereoInterleavedColumns, StdCmdViewIvIssueCamPos, StdViewZoomIn, StdViewZoomOut, StdViewBoxZoom, StdBoxSelection, StdBoxElementSelection, StdTreeSelection, StdCmdTreeCollapse, StdCmdTreeExpand, StdCmdTreeSelectAllInstances, StdCmdMeasureDistance, StdCmdSceneInspector, StdCmdTextureMapping, StdCmdDemoMode, CmdViewMeasureClearAll, CmdViewMeasureToggleAll, StdCmdSelBack, StdCmdSelForward, StdTreeDrag, StdCmdTreeViewActions, StdCmdSelBoundingBox, StdCmdArrangeIcons, StdCmdTileWindows, StdCmdCascadeWindows, StdCmdCloseActiveWindow, StdCmdCloseAllWindows, StdCmdActivateNextWindow, StdCmdActivatePrevWindow, StdCmdWindows, StdCmdUserInterface, StdCmdDockViewMenu, StdCmdToolBarMenu, StdCmdStatusBar, StdCmdWindowsMenu, ViewIsometricCmd, ViewOrthographicCmd, ViewPerspectiveCmd, ViewZoomToFitCmd, Gui::StdCmdPythonHelp, CmdSandboxEventLoop, CmdSandboxMeshLoader, CmdSketcherConstraint, CmdSketcherConstrainHorizontal, CmdSketcherConstrainVertical, CmdSketcherConstrainLock, CmdSketcherConstrainBlock, CmdSketcherConstrainCoincident, CmdSketcherConstrainDistance, CmdSketcherConstrainPointOnObject, CmdSketcherConstrainDistanceX, CmdSketcherConstrainDistanceY, CmdSketcherConstrainParallel, CmdSketcherConstrainPerpendicular, CmdSketcherConstrainTangent, CmdSketcherConstrainRadius, CmdSketcherConstrainDiameter, CmdSketcherConstrainRadiam, CmdSketcherConstrainAngle, CmdSketcherConstrainEqual, CmdSketcherConstrainSymmetric, CmdSketcherCopy, CmdSketcherClone, and CmdSketcherMove.

Referenced by Gui::StdCmdDownloadOnlineHelp::createAction(), Gui::Command::createAction(), Gui::Dialog::CommandModel::data(), Gui::Command::languageChange(), Gui::PythonGroupCommand::languageChange(), Gui::StdCmdDownloadOnlineHelp::languageChange(), Gui::Dialog::DlgCustomKeyboardImp::on_buttonReset_clicked(), Gui::Dialog::DlgCustomKeyboardImp::setShortcutOfCurrentAction(), Gui::GroupCommand::setup(), and Gui::Command::translatedGroupName().

◆ createAction()

◆ getAccel()

◆ getAction()

◆ getMenuText()

◆ getPixmap()

◆ getStatusTip()

◆ getToolTipText()

◆ getWhatsThis()

◆ languageChange()

virtual void Gui::CommandBase::languageChange ( )
pure virtual

◆ setAccel()

◆ setMenuText()

◆ setPixmap()

◆ setStatusTip()

◆ setToolTipText()

◆ setWhatsThis()

◆ updateAction()

virtual void Gui::CommandBase::updateAction ( int  mode)
pure virtual

Member Data Documentation

◆ displayText

std::string Gui::CommandBase::displayText
protected

Referenced by Gui::Command::invoke().

◆ sAccel

const char* Gui::CommandBase::sAccel
protected

◆ sMenuText

const char* Gui::CommandBase::sMenuText
protected

Referenced by CmdSandboxEventLoop::CmdSandboxEventLoop(), CmdSandboxMeshLoader::CmdSandboxMeshLoader(), CmdSketcherClone::CmdSketcherClone(), CmdSketcherConstrainAngle::CmdSketcherConstrainAngle(), CmdSketcherConstrainBlock::CmdSketcherConstrainBlock(), CmdSketcherConstrainCoincident::CmdSketcherConstrainCoincident(), CmdSketcherConstrainDiameter::CmdSketcherConstrainDiameter(), CmdSketcherConstrainDistance::CmdSketcherConstrainDistance(), CmdSketcherConstrainDistanceX::CmdSketcherConstrainDistanceX(), CmdSketcherConstrainDistanceY::CmdSketcherConstrainDistanceY(), CmdSketcherConstrainEqual::CmdSketcherConstrainEqual(), CmdSketcherConstrainHorizontal::CmdSketcherConstrainHorizontal(), CmdSketcherConstrainLock::CmdSketcherConstrainLock(), CmdSketcherConstrainParallel::CmdSketcherConstrainParallel(), CmdSketcherConstrainPerpendicular::CmdSketcherConstrainPerpendicular(), CmdSketcherConstrainPointOnObject::CmdSketcherConstrainPointOnObject(), CmdSketcherConstrainRadiam::CmdSketcherConstrainRadiam(), CmdSketcherConstrainRadius::CmdSketcherConstrainRadius(), CmdSketcherConstrainSymmetric::CmdSketcherConstrainSymmetric(), CmdSketcherConstrainTangent::CmdSketcherConstrainTangent(), CmdSketcherConstrainVertical::CmdSketcherConstrainVertical(), CmdSketcherCopy::CmdSketcherCopy(), CmdSketcherMove::CmdSketcherMove(), Gui::MacroCommand::createAction(), setMenuText(), StdBoxSelection::StdBoxSelection(), Gui::StdCmdDescription::StdCmdDescription(), Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp(), StdCmdDrawStyle::StdCmdDrawStyle(), StdCmdExpression::StdCmdExpression(), StdCmdFreezeViews::StdCmdFreezeViews(), StdCmdLinkActions::StdCmdLinkActions(), StdCmdLinkMakeGroup::StdCmdLinkMakeGroup(), StdCmdLinkSelectActions::StdCmdLinkSelectActions(), Gui::StdCmdPythonHelp::StdCmdPythonHelp(), StdCmdTreeViewActions::StdCmdTreeViewActions(), and StdCmdUserEditMode::StdCmdUserEditMode().

◆ sPixmap

const char* Gui::CommandBase::sPixmap
protected

Referenced by CmdSandboxEventLoop::CmdSandboxEventLoop(), CmdSandboxMeshLoader::CmdSandboxMeshLoader(), CmdSketcherClone::CmdSketcherClone(), CmdSketcherConstrainAngle::CmdSketcherConstrainAngle(), CmdSketcherConstrainBlock::CmdSketcherConstrainBlock(), CmdSketcherConstrainCoincident::CmdSketcherConstrainCoincident(), CmdSketcherConstrainDiameter::CmdSketcherConstrainDiameter(), CmdSketcherConstrainDistance::CmdSketcherConstrainDistance(), CmdSketcherConstrainDistanceX::CmdSketcherConstrainDistanceX(), CmdSketcherConstrainDistanceY::CmdSketcherConstrainDistanceY(), CmdSketcherConstrainEqual::CmdSketcherConstrainEqual(), CmdSketcherConstrainHorizontal::CmdSketcherConstrainHorizontal(), CmdSketcherConstrainLock::CmdSketcherConstrainLock(), CmdSketcherConstrainParallel::CmdSketcherConstrainParallel(), CmdSketcherConstrainPerpendicular::CmdSketcherConstrainPerpendicular(), CmdSketcherConstrainPointOnObject::CmdSketcherConstrainPointOnObject(), CmdSketcherConstrainRadiam::CmdSketcherConstrainRadiam(), CmdSketcherConstrainRadius::CmdSketcherConstrainRadius(), CmdSketcherConstrainSymmetric::CmdSketcherConstrainSymmetric(), CmdSketcherConstrainTangent::CmdSketcherConstrainTangent(), CmdSketcherConstrainVertical::CmdSketcherConstrainVertical(), CmdSketcherCopy::CmdSketcherCopy(), CmdSketcherMove::CmdSketcherMove(), Gui::Command::createAction(), Gui::MacroCommand::createAction(), setPixmap(), StdBoxSelection::StdBoxSelection(), Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp(), StdCmdDrawStyle::StdCmdDrawStyle(), StdCmdLinkMakeGroup::StdCmdLinkMakeGroup(), Gui::StdCmdPythonHelp::StdCmdPythonHelp(), and StdCmdUserEditMode::StdCmdUserEditMode().

◆ sStatusTip

const char* Gui::CommandBase::sStatusTip
protected

Referenced by CmdSandboxEventLoop::CmdSandboxEventLoop(), CmdSandboxMeshLoader::CmdSandboxMeshLoader(), CmdSketcherClone::CmdSketcherClone(), CmdSketcherConstrainAngle::CmdSketcherConstrainAngle(), CmdSketcherConstrainBlock::CmdSketcherConstrainBlock(), CmdSketcherConstrainCoincident::CmdSketcherConstrainCoincident(), CmdSketcherConstrainDiameter::CmdSketcherConstrainDiameter(), CmdSketcherConstrainDistance::CmdSketcherConstrainDistance(), CmdSketcherConstrainDistanceX::CmdSketcherConstrainDistanceX(), CmdSketcherConstrainDistanceY::CmdSketcherConstrainDistanceY(), CmdSketcherConstrainEqual::CmdSketcherConstrainEqual(), CmdSketcherConstrainHorizontal::CmdSketcherConstrainHorizontal(), CmdSketcherConstrainLock::CmdSketcherConstrainLock(), CmdSketcherConstrainParallel::CmdSketcherConstrainParallel(), CmdSketcherConstrainPerpendicular::CmdSketcherConstrainPerpendicular(), CmdSketcherConstrainPointOnObject::CmdSketcherConstrainPointOnObject(), CmdSketcherConstrainRadiam::CmdSketcherConstrainRadiam(), CmdSketcherConstrainRadius::CmdSketcherConstrainRadius(), CmdSketcherConstrainSymmetric::CmdSketcherConstrainSymmetric(), CmdSketcherConstrainTangent::CmdSketcherConstrainTangent(), CmdSketcherConstrainVertical::CmdSketcherConstrainVertical(), CmdSketcherCopy::CmdSketcherCopy(), CmdSketcherMove::CmdSketcherMove(), Gui::MacroCommand::createAction(), Gui::Command::recreateTooltip(), setStatusTip(), StdBoxSelection::StdBoxSelection(), Gui::StdCmdDescription::StdCmdDescription(), Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp(), StdCmdDrawStyle::StdCmdDrawStyle(), StdCmdExpression::StdCmdExpression(), StdCmdFreezeViews::StdCmdFreezeViews(), StdCmdLinkActions::StdCmdLinkActions(), StdCmdLinkMakeGroup::StdCmdLinkMakeGroup(), StdCmdLinkSelectActions::StdCmdLinkSelectActions(), Gui::StdCmdPythonHelp::StdCmdPythonHelp(), StdCmdTreeViewActions::StdCmdTreeViewActions(), and StdCmdUserEditMode::StdCmdUserEditMode().

◆ sToolTipText

const char* Gui::CommandBase::sToolTipText
protected

Referenced by CmdSandboxEventLoop::CmdSandboxEventLoop(), CmdSandboxMeshLoader::CmdSandboxMeshLoader(), CmdSketcherClone::CmdSketcherClone(), CmdSketcherConstrainAngle::CmdSketcherConstrainAngle(), CmdSketcherConstrainBlock::CmdSketcherConstrainBlock(), CmdSketcherConstrainCoincident::CmdSketcherConstrainCoincident(), CmdSketcherConstrainDiameter::CmdSketcherConstrainDiameter(), CmdSketcherConstrainDistance::CmdSketcherConstrainDistance(), CmdSketcherConstrainDistanceX::CmdSketcherConstrainDistanceX(), CmdSketcherConstrainDistanceY::CmdSketcherConstrainDistanceY(), CmdSketcherConstrainEqual::CmdSketcherConstrainEqual(), CmdSketcherConstrainHorizontal::CmdSketcherConstrainHorizontal(), CmdSketcherConstrainLock::CmdSketcherConstrainLock(), CmdSketcherConstrainParallel::CmdSketcherConstrainParallel(), CmdSketcherConstrainPerpendicular::CmdSketcherConstrainPerpendicular(), CmdSketcherConstrainPointOnObject::CmdSketcherConstrainPointOnObject(), CmdSketcherConstrainRadiam::CmdSketcherConstrainRadiam(), CmdSketcherConstrainRadius::CmdSketcherConstrainRadius(), CmdSketcherConstrainSymmetric::CmdSketcherConstrainSymmetric(), CmdSketcherConstrainTangent::CmdSketcherConstrainTangent(), CmdSketcherConstrainVertical::CmdSketcherConstrainVertical(), CmdSketcherCopy::CmdSketcherCopy(), CmdSketcherMove::CmdSketcherMove(), Gui::MacroCommand::createAction(), setToolTipText(), StdBoxSelection::StdBoxSelection(), Gui::StdCmdDescription::StdCmdDescription(), Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp(), StdCmdDrawStyle::StdCmdDrawStyle(), StdCmdExpression::StdCmdExpression(), StdCmdFreezeViews::StdCmdFreezeViews(), StdCmdLinkActions::StdCmdLinkActions(), StdCmdLinkMakeGroup::StdCmdLinkMakeGroup(), StdCmdLinkSelectActions::StdCmdLinkSelectActions(), Gui::StdCmdPythonHelp::StdCmdPythonHelp(), StdCmdTreeViewActions::StdCmdTreeViewActions(), and StdCmdUserEditMode::StdCmdUserEditMode().

◆ sWhatsThis

const char* Gui::CommandBase::sWhatsThis
protected

Referenced by CmdSandboxEventLoop::CmdSandboxEventLoop(), CmdSandboxMeshLoader::CmdSandboxMeshLoader(), CmdSketcherClone::CmdSketcherClone(), CmdSketcherConstrainAngle::CmdSketcherConstrainAngle(), CmdSketcherConstrainBlock::CmdSketcherConstrainBlock(), CmdSketcherConstrainCoincident::CmdSketcherConstrainCoincident(), CmdSketcherConstrainDiameter::CmdSketcherConstrainDiameter(), CmdSketcherConstrainDistance::CmdSketcherConstrainDistance(), CmdSketcherConstrainDistanceX::CmdSketcherConstrainDistanceX(), CmdSketcherConstrainDistanceY::CmdSketcherConstrainDistanceY(), CmdSketcherConstrainEqual::CmdSketcherConstrainEqual(), CmdSketcherConstrainHorizontal::CmdSketcherConstrainHorizontal(), CmdSketcherConstrainLock::CmdSketcherConstrainLock(), CmdSketcherConstrainParallel::CmdSketcherConstrainParallel(), CmdSketcherConstrainPerpendicular::CmdSketcherConstrainPerpendicular(), CmdSketcherConstrainPointOnObject::CmdSketcherConstrainPointOnObject(), CmdSketcherConstrainRadiam::CmdSketcherConstrainRadiam(), CmdSketcherConstrainRadius::CmdSketcherConstrainRadius(), CmdSketcherConstrainSymmetric::CmdSketcherConstrainSymmetric(), CmdSketcherConstrainTangent::CmdSketcherConstrainTangent(), CmdSketcherConstrainVertical::CmdSketcherConstrainVertical(), CmdSketcherCopy::CmdSketcherCopy(), CmdSketcherMove::CmdSketcherMove(), Gui::GroupCommand::createAction(), Gui::MacroCommand::createAction(), setWhatsThis(), StdBoxSelection::StdBoxSelection(), Gui::StdCmdDescription::StdCmdDescription(), Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp(), StdCmdDrawStyle::StdCmdDrawStyle(), StdCmdExpression::StdCmdExpression(), StdCmdFreezeViews::StdCmdFreezeViews(), StdCmdLinkActions::StdCmdLinkActions(), StdCmdLinkMakeGroup::StdCmdLinkMakeGroup(), StdCmdLinkSelectActions::StdCmdLinkSelectActions(), Gui::StdCmdPythonHelp::StdCmdPythonHelp(), StdCmdTreeViewActions::StdCmdTreeViewActions(), and StdCmdUserEditMode::StdCmdUserEditMode().


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