#include <Command.h>
Classes | |
class | LogDisabler |
Helper class to disable python console log. More... | |
Public Member Functions | |
Helper methods to generate help pages | |
const char * | beginCmdHelp (void) |
returns the begin of a online help page More... | |
const char * | endCmdHelp (void) |
returns the end of a online help page More... | |
virtual const char * | getHelpUrl (void) const |
Get the help URL. More... | |
Helper methods for the Active tests | |
bool | hasActiveDocument (void) const |
true when there is a document More... | |
bool | hasObject (const char *Name) |
true when there is a document and a Feature with Name More... | |
checking of internal state | |
const char * | getAppModuleName (void) const |
returns the name to which the command belongs More... | |
void | setAppModuleName (const char *) |
const char * | getName () const |
Get the command name. More... | |
const char * | getGroupName () const |
Get the name of the grouping of the command. More... | |
void | setGroupName (const char *) |
QString | translatedGroupName () const |
Public Member Functions inherited from Gui::CommandBase | |
Action * | getAction () const |
Returns the Action object of this command, or 0 if it doesn't exist. More... | |
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 |
void | setWhatsThis (const char *) |
void | setMenuText (const char *) |
void | setToolTipText (const char *) |
void | setStatusTip (const char *) |
void | setPixmap (const char *) |
void | setAccel (const char *) |
virtual const char * | className () const =0 |
The C++ class name is needed as context for the translation framework. More... | |
Protected Member Functions | |
Command (const char *name) | |
virtual | ~Command () |
Methods to override when creating a new command | |
virtual void | activated (int iMsg)=0 |
Methods which gets called when activated, needs to be reimplemented! More... | |
virtual Action * | createAction (void) |
Creates the used Action. More... | |
void | applyCommandData (const char *context, Action *) |
Applies the menu text, tool and status tip to the passed action object. More... | |
const char * | keySequenceToAccel (int) const |
void | printConflictingAccelerators () const |
Protected Member Functions inherited from Gui::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) | |
virtual | ~CommandBase () |
interface used by the CommandManager and the Action | |
enum | TriggerSource { TriggerNone , TriggerAction , TriggerChildAction } |
Command trigger source. More... | |
class | CommandManager |
CommandManager is a friend. More... | |
virtual bool | isActive (void) |
Override this method if your Cmd is not always active. More... | |
void | testActive (void) |
Get somtile called to check the state of the command. More... | |
void | setEnabled (bool) |
Enables or disables the command. More... | |
void | recreateTooltip (const char *context, Action *) |
(Re)Create the text for the tooltip (for example, when the shortcut is changed) More... | |
TriggerSource | triggerSource () const |
Return the current command trigger source. More... | |
void | invoke (int index, TriggerSource trigger=TriggerNone) |
Called to invoke the command. More... | |
void | addTo (QWidget *) |
adds this command to arbitrary widgets More... | |
void | addToGroup (ActionGroup *, bool checkable) |
void | addToGroup (ActionGroup *) |
Helper methods for issuing commands to the Python interpreter | |
enum | DoCmd_Type { Doc , App , Gui } |
types of application level actions for DoCommand() More... | |
static void | blockCommand (bool) |
Blocks all command objects. More... | |
static void | printPyCaller () |
Print to Python console the current Python calling source file and line number. More... | |
static void | printCaller (const char *file, int line) |
Print to Python console the current calling source file and line number. More... | |
static void | addModule (DoCmd_Type eType, const char *sModuleName) |
import an external (or own) module only once More... | |
arbitrary helper methods | |
enum | CmdType { AlterDoc = 1 , Alter3DView = 2 , AlterSelection = 4 , ForEdit = 8 , NoTransaction = 16 } |
class | LogDisabler |
void | adjustCameraPosition () |
Attributes | |
Set by the inherited constructor to set up the most important properties of the command. In the Command constructor are set default values! The real values should be set in the constructor of the inhereting class. | |
const char * | sAppModule |
const char * | sGroup |
const char * | sName |
const char * | sHelpUrl |
int | eType |
bool | bCanLog |
Indicate if the command shall log to MacroManager. More... | |
Helper methods to get important classes | |
Gui::Document * | getActiveGuiDocument (void) const |
Get pointer to the active gui document. More... | |
App::Document * | getDocument (const char *Name=nullptr) const |
Get pointer to the named or active App document Returns a pointer to the named document or the active document when no name is given. More... | |
bool | isViewOfType (Base::Type t) const |
checks if the active view is of a special type or derived More... | |
App::DocumentObject * | getObject (const char *Name) const |
returns the named feature or the active one from the active document or NULL More... | |
std::string | getUniqueObjectName (const char *BaseName, const App::DocumentObject *obj=nullptr) const |
Get unique Feature name from the active document. More... | |
static Application * | getGuiApplication (void) |
Get pointer to the Application Window. More... | |
static Gui::SelectionSingleton & | getSelection (void) |
Get a reference to the selection. More... | |
static std::string | getObjectCmd (const char *Name, const App::Document *doc=nullptr, const char *prefix=nullptr, const char *postfix=nullptr, bool gui=false) |
returns a python command string to retrieve an object from a document More... | |
static std::string | getObjectCmd (const App::DocumentObject *obj, const char *prefix=nullptr, const char *postfix=nullptr, bool gui=false) |
returns a python command string to retrieve the given object More... | |
Helper methods for the Undo/Redo and Update handling | |
void | languageChange () |
Translate command. More... | |
void | updateAction (int mode) |
Updates the QAction with respect to the passed mode. More... | |
void | setupCheckable (int iMsg) |
Setup checkable actions based on current TriggerSource. More... | |
static void | openCommand (const char *sName=nullptr) |
Open a new Undo transaction on the active document. More... | |
static void | commitCommand (void) |
Commit the Undo transaction on the active document. More... | |
static void | abortCommand (void) |
Abort the Undo transaction on the active document. More... | |
static bool | hasPendingCommand (void) |
Check if an Undo transaction is open on the active document. More... | |
static void | updateActive (void) |
Updates the (active) document (propagate changes) More... | |
static void | updateAll (std::list< Gui::Document * > cList) |
Updates the (all or listed) documents (propagate changes) More... | |
static bool | isActiveObjectValid (void) |
Checks if the active object of the active document is valid. More... | |
Methods for copying visiual properties | |
const std::string | strToPython (const char *Str) |
translate a string to a python string literal (needed e.g. in file names for windows...) More... | |
const std::string | strToPython (const std::string &Str) |
static std::string | getPythonTuple (const std::string &name, const std::vector< std::string > &subnames) |
Get Python tuple from object and sub-elements. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Gui::CommandBase | |
const char * | sMenuText |
const char * | sToolTipText |
const char * | sWhatsThis |
const char * | sStatusTip |
const char * | sPixmap |
const char * | sAccel |
std::string | displayText |
The Command class.
This class is mostly used for commands implemented directly in C++ (see PythonCommand). It contains also a lot of helper methods to make implementing commands for FreeCAD as easy as possible.
|
protected |
|
protected |
References Alter3DView, AlterDoc, AlterSelection, bCanLog, eType, sAppModule, and sGroup.
|
protectedvirtual |
|
static |
Abort the Undo transaction on the active document.
References App::Application::closeActiveTransaction(), and App::GetApplication().
Referenced by MeshGui::TaskSmoothing::accept(), ReenGui::FitBSplineSurfaceWidget::accept(), ReenGui::PoissonWidget::accept(), SpreadsheetGui::DlgBindSheet::accept(), SpreadsheetGui::DlgSheetConf::accept(), CmdSketcherConstrainBlock::activated(), CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainPointOnObject::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainTangent::activated(), SpreadsheetGui::PropertiesDialog::apply(), CmdSketcherConstrainBlock::applyConstraint(), CmdSketcherConstrainCoincident::applyConstraint(), CmdSketcherConstrainPointOnObject::applyConstraint(), CmdSketcherConstrainPerpendicular::applyConstraint(), CmdSketcherConstrainTangent::applyConstraint(), TechDrawGui::TaskCenterLine::createCenterLine(), PartDesignGui::ViewProviderBase::doubleClicked(), PartDesignGui::ViewProvider::doubleClicked(), SketcherGui::makeTangentToArcOfEllipseviaNewPoint(), SketcherGui::makeTangentToArcOfHyperbolaviaNewPoint(), SketcherGui::makeTangentToArcOfParabolaviaNewPoint(), SketcherGui::makeTangentToEllipseviaNewPoint(), SketcherGui::TaskSketcherConstraints::on_listWidgetConstraints_itemChanged(), SpreadsheetGui::DlgBindSheet::onDiscard(), SpreadsheetGui::DlgSheetConf::onDiscard(), SketcherGui::DrawSketchHandlerCarbonCopy::onSelectionChanged(), SketcherGui::DrawSketchHandlerExternal::onSelectionChanged(), StdCmdExpression::pasteExpressions(), SketcherGui::DrawSketchHandlerBSpline::pressButton(), SketcherGui::DrawSketchHandlerBSpline::quit(), SketcherGui::DrawSketchHandlerBSpline::registerPressedKey(), FemGui::TaskDlgCreateNodeSet::reject(), FemGui::TaskDlgMeshShapeNetgen::reject(), FemGui::TaskDlgFemConstraint::reject(), FemGui::TaskDlgFemConstraintContact::reject(), FemGui::TaskDlgFemConstraintDisplacement::reject(), FemGui::TaskDlgFemConstraintFixed::reject(), FemGui::TaskDlgFemConstraintFluidBoundary::reject(), FemGui::TaskDlgFemConstraintForce::reject(), FemGui::TaskDlgFemConstraintHeatflux::reject(), FemGui::TaskDlgFemConstraintInitialTemperature::reject(), FemGui::TaskDlgFemConstraintPlaneRotation::reject(), FemGui::TaskDlgFemConstraintPressure::reject(), FemGui::TaskDlgFemConstraintSpring::reject(), FemGui::TaskDlgFemConstraintTemperature::reject(), FemGui::TaskDlgFemConstraintTransform::reject(), FemGui::TaskDlgPost::reject(), PartGui::OffsetWidget::reject(), PartGui::ThicknessWidget::reject(), PartDesignGui::TaskDlgBooleanParameters::reject(), PartDesignGui::TaskDlgFeatureParameters::reject(), PartDesignGui::TaskPrimitiveParameters::reject(), PartDesignGui::TaskDlgShapeBinder::reject(), SurfaceGui::TaskFilling::reject(), SurfaceGui::GeomFillSurface::reject(), SurfaceGui::TaskSections::reject(), TechDrawGui::TaskProjGroup::reject(), DrawSketchHandlerCoincident::releaseButton(), DrawSketchHandlerBSplineInsertKnot::releaseButton(), DrawSketchHandlerCopy::releaseButton(), DrawSketchHandlerRectangularArray::releaseButton(), SketcherGui::DrawSketchHandlerArc::releaseButton(), SketcherGui::DrawSketchHandler3PointArc::releaseButton(), SketcherGui::DrawSketchHandlerArcOfEllipse::releaseButton(), SketcherGui::DrawSketchHandlerCircle::releaseButton(), SketcherGui::DrawSketchHandler3PointCircle::releaseButton(), SketcherGui::DrawSketchHandlerExtend::releaseButton(), SketcherGui::DrawSketchHandlerFillet::releaseButton(), SketcherGui::DrawSketchHandlerLine::releaseButton(), SketcherGui::DrawSketchHandlerLineSet::releaseButton(), SketcherGui::DrawSketchHandlerPoint::releaseButton(), SketcherGui::DrawSketchHandlerRegularPolygon::releaseButton(), SketcherGui::DrawSketchHandlerBox::releaseButton(), SketcherGui::DrawSketchHandlerOblong::releaseButton(), SketcherGui::DrawSketchHandlerSlot::releaseButton(), SketcherGui::DrawSketchHandlerSplitting::releaseButton(), SketcherGui::DrawSketchHandlerTrimming::releaseButton(), SketcherGui::DrawSketchHandlerArcOfHyperbola::releaseButton(), and SketcherGui::DrawSketchHandlerArcOfParabola::releaseButton().
|
protectedpure virtual |
Methods which gets called when activated, needs to be reimplemented!
Implemented in Gui::GroupCommand, 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, 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, StdCmdSelBoundingBox, StdCmdArrangeIcons, StdCmdTileWindows, StdCmdCascadeWindows, StdCmdCloseActiveWindow, StdCmdCloseAllWindows, StdCmdActivateNextWindow, StdCmdActivatePrevWindow, StdCmdWindows, StdCmdUserInterface, StdCmdDockViewMenu, StdCmdToolBarMenu, StdCmdStatusBar, StdCmdWindowsMenu, ViewIsometricCmd, ViewOrthographicCmd, ViewPerspectiveCmd, ViewZoomToFitCmd, Gui::StdCmdDownloadOnlineHelp, Gui::StdCmdPythonHelp, Gui::StdCmdDescription, CmdSandboxEventLoop, CmdSandboxMeshLoader, CmdSketcherConstrainHorizontal, CmdSketcherConstrainVertical, CmdSketcherConstrainLock, CmdSketcherConstrainBlock, CmdSketcherConstrainCoincident, CmdSketcherConstrainDistance, CmdSketcherConstrainPointOnObject, CmdSketcherConstrainDistanceX, CmdSketcherConstrainDistanceY, CmdSketcherConstrainParallel, CmdSketcherConstrainPerpendicular, CmdSketcherConstrainTangent, CmdSketcherConstrainRadius, CmdSketcherConstrainDiameter, CmdSketcherConstrainRadiam, CmdSketcherConstrainAngle, CmdSketcherConstrainEqual, CmdSketcherConstrainSymmetric, CmdSketcherCopy, CmdSketcherClone, CmdSketcherMove, and CmdSketcherConstraint.
|
static |
import an external (or own) module only once
References Gui::MacroManager::addLine(), Gui::MacroManager::App, eType, Gui::MacroManager::Gui, Gui::Application::Instance, Base::Interpreter(), Gui::Application::macroManager(), and Base::InterpreterSingleton::runString().
Referenced by DrawingGui::TaskProjection::accept(), ReenGui::FitBSplineSurfaceWidget::accept(), ReenGui::PoissonWidget::accept(), TechDrawGui::TaskProjection::accept(), FemGui::ViewProviderFemAnalysis::doubleClicked(), Gui::Application::sAddModule(), SketcherGui::ViewProviderSketch::setEdit(), and Gui::MainWindow::showDocumentation().
void Command::addTo | ( | QWidget * | pcWidget | ) |
adds this command to arbitrary widgets
References createAction(), and testActive().
Referenced by Gui::CommandManager::addTo(), Gui::MDITabbar::contextMenuEvent(), NaviCubeImplementation::createContextMenu(), Gui::MainWindow::createPopupMenu(), Mod.PartDesign.WizardShaft.Shaft.Shaft::equilibrium(), Gui::TaskView::TaskWatcherCommands::TaskWatcherCommands(), and Gui::TaskView::TaskWatcherPython::TaskWatcherPython().
void Command::addToGroup | ( | ActionGroup * | group | ) |
References createAction(), and testActive().
void Command::addToGroup | ( | ActionGroup * | group, |
bool | checkable | ||
) |
References addToGroup().
Referenced by addToGroup(), and StdViewDockUndockFullscreen::createAction().
void Command::adjustCameraPosition | ( | ) |
|
protected |
Applies the menu text, tool and status tip to the passed action object.
References Gui::CommandBase::getMenuText(), Gui::CommandBase::getWhatsThis(), recreateTooltip(), and draftguitools.gui_setstyle::translate.
Referenced by createAction(), Gui::PythonCommand::createAction(), Gui::PythonGroupCommand::createAction(), StdCmdUndo::createAction(), StdCmdRedo::createAction(), StdCmdExpression::createAction(), StdCmdLinkMakeGroup::createAction(), StdCmdWorkbench::createAction(), StdCmdRecentFiles::createAction(), StdCmdRecentMacros::createAction(), StdCmdUserEditMode::createAction(), StdCmdFreezeViews::createAction(), StdCmdDrawStyle::createAction(), StdCmdDockViewMenu::createAction(), StdCmdToolBarMenu::createAction(), languageChange(), Gui::PythonCommand::languageChange(), and Gui::PythonGroupCommand::languageChange().
const char * Command::beginCmdHelp | ( | void | ) |
returns the begin of a online help page
|
static |
Blocks all command objects.
|
static |
Commit the Undo transaction on the active document.
References App::Application::closeActiveTransaction(), and App::GetApplication().
Referenced by DrawingGui::TaskProjection::accept(), FemGui::TaskDlgMeshShapeNetgen::accept(), FemGui::TaskDlgFemConstraint::accept(), FemGui::TaskDlgFemConstraintInitialTemperature::accept(), MeshGui::TaskDecimating::accept(), MeshGui::TaskSmoothing::accept(), PartGui::OffsetWidget::accept(), PartGui::ThicknessWidget::accept(), PartDesignGui::TaskDlgBooleanParameters::accept(), PartDesignGui::TaskDlgFeatureParameters::accept(), PartDesignGui::TaskPipeParameters::accept(), PartDesignGui::TaskDlgShapeBinder::accept(), ReenGui::FitBSplineSurfaceWidget::accept(), ReenGui::PoissonWidget::accept(), SpreadsheetGui::DlgBindSheet::accept(), SpreadsheetGui::DlgSheetConf::accept(), SurfaceGui::TaskFilling::accept(), SurfaceGui::GeomFillSurface::accept(), SurfaceGui::TaskSections::accept(), TechDrawGui::TaskActiveView::accept(), TechDrawGui::TaskCenterLine::accept(), TechDrawGui::TaskCosmeticLine::accept(), TechDrawGui::TaskCustomizeFormat::accept(), TechDrawGui::TaskProjection::accept(), TechDrawGui::TaskWeldingSymbol::accept(), StdCmdDelete::activated(), StdCmdMeasurementSimple::activated(), StdCmdTextDocument::activated(), StdCmdGroup::activated(), CmdSketcherConstrainHorizontal::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainLock::activated(), CmdSketcherConstrainBlock::activated(), CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainPointOnObject::activated(), CmdSketcherConstrainParallel::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainRadiam::activated(), CmdSketcherConstrainEqual::activated(), CmdSketcherConstrainSymmetric::activated(), TechDrawGui::TaskCosVertex::addCosVertex(), SpreadsheetGui::PropertiesDialog::apply(), CmdSketcherConstrainHorizontal::applyConstraint(), CmdSketcherConstrainVertical::applyConstraint(), CmdSketcherConstrainLock::applyConstraint(), CmdSketcherConstrainBlock::applyConstraint(), CmdSketcherConstrainCoincident::applyConstraint(), CmdSketcherConstrainPointOnObject::applyConstraint(), CmdSketcherConstrainParallel::applyConstraint(), CmdSketcherConstrainPerpendicular::applyConstraint(), CmdSketcherConstrainTangent::applyConstraint(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), CmdSketcherConstrainRadiam::applyConstraint(), CmdSketcherConstrainEqual::applyConstraint(), CmdSketcherConstrainSymmetric::applyConstraint(), TechDrawGui::QGIViewBalloon::balloonLabelDragFinished(), TechDrawGui::TaskRichAnno::createAnnoFeature(), SketcherGui::DrawSketchHandler::createAutoConstraints(), TechDrawGui::QGSPage::createBalloon(), TechDrawGui::TaskCenterLine::createCenterLine(), TechDrawGui::TaskCosmeticLine::createCosmeticLine(), TechDrawGui::TaskDetail::createDetail(), TechDrawGui::TaskLeaderLine::createLeaderFeature(), TechDrawGui::TaskSectionView::createSectionView(), TechDrawGui::QGIViewDimension::datumLabelDragFinished(), SpreadsheetGui::SheetTableView::deleteSelection(), TechDrawGui::execHoleCircle(), SpreadsheetGui::SheetTableView::insertColumns(), SpreadsheetGui::SheetTableView::insertColumnsAfter(), SpreadsheetGui::SheetTableView::insertRows(), SpreadsheetGui::SheetTableView::insertRowsAfter(), SketcherGui::makeTangentToArcOfEllipseviaNewPoint(), SketcherGui::makeTangentToArcOfHyperbolaviaNewPoint(), SketcherGui::makeTangentToArcOfParabolaviaNewPoint(), SketcherGui::makeTangentToEllipseviaNewPoint(), SketcherGui::TaskSketcherConstraints::on_listWidgetConstraints_itemChanged(), SpreadsheetGui::DlgBindSheet::onDiscard(), SpreadsheetGui::DlgSheetConf::onDiscard(), SpreadsheetGui::SheetView::onMsg(), SpreadsheetGui::SheetTableView::onRecompute(), SketcherGui::DrawSketchHandlerCarbonCopy::onSelectionChanged(), SketcherGui::DrawSketchHandlerExternal::onSelectionChanged(), StdCmdExpression::pasteExpressions(), DrawSketchHandlerCoincident::releaseButton(), DrawSketchHandlerBSplineInsertKnot::releaseButton(), DrawSketchHandlerCopy::releaseButton(), DrawSketchHandlerRectangularArray::releaseButton(), SketcherGui::DrawSketchHandlerArc::releaseButton(), SketcherGui::DrawSketchHandler3PointArc::releaseButton(), SketcherGui::DrawSketchHandlerArcOfEllipse::releaseButton(), SketcherGui::DrawSketchHandlerCircle::releaseButton(), SketcherGui::DrawSketchHandler3PointCircle::releaseButton(), SketcherGui::DrawSketchHandlerExtend::releaseButton(), SketcherGui::DrawSketchHandlerFillet::releaseButton(), SketcherGui::DrawSketchHandlerLine::releaseButton(), SketcherGui::DrawSketchHandlerLineSet::releaseButton(), SketcherGui::DrawSketchHandlerPoint::releaseButton(), SketcherGui::DrawSketchHandlerRegularPolygon::releaseButton(), SketcherGui::DrawSketchHandlerBox::releaseButton(), SketcherGui::DrawSketchHandlerOblong::releaseButton(), SketcherGui::DrawSketchHandlerSlot::releaseButton(), SketcherGui::DrawSketchHandlerSplitting::releaseButton(), SketcherGui::DrawSketchHandlerTrimming::releaseButton(), SketcherGui::DrawSketchHandlerArcOfHyperbola::releaseButton(), SketcherGui::DrawSketchHandlerArcOfParabola::releaseButton(), SpreadsheetGui::SheetTableView::removeColumns(), SpreadsheetGui::SheetTableView::removeRows(), TechDrawGui::MDIViewPage::saveDXF(), SpreadsheetGui::WorkbenchHelper::setBackgroundColor(), SpreadsheetGui::WorkbenchHelper::setForegroundColor(), CmdSketcherConstrainTangent::substituteConstraintCombinations(), CmdSketcherConstrainCoincident::substituteConstraintCombinations(), SketcherGui::ConstraintView::swapNamedOfSelectedItems(), TechDrawGui::TaskRichAnno::updateAnnoFeature(), TechDrawGui::TaskDetail::updateDetail(), TechDrawGui::TaskLeaderLine::updateLeaderFeature(), and TechDrawGui::TaskSectionView::updateSectionView().
|
protectedvirtual |
Creates the used Action.
Reimplemented from Gui::CommandBase.
Reimplemented in Gui::StdCmdDownloadOnlineHelp, Gui::GroupCommand, Gui::PythonCommand, Gui::PythonGroupCommand, Gui::MacroCommand, StdCmdUndo, StdCmdRedo, StdCmdExpression, StdCmdLinkMakeGroup, StdCmdWorkbench, StdCmdRecentFiles, StdCmdRecentMacros, StdCmdAbout, StdCmdDlgPreferences, StdCmdUserEditMode, StdOrthographicCamera, StdPerspectiveCamera, StdCmdFreezeViews, StdCmdToggleClipPlane, StdCmdDrawStyle, StdViewDockUndockFullscreen, StdCmdSelBoundingBox, StdCmdDockViewMenu, StdCmdToolBarMenu, StdCmdStatusBar, StdCmdWindowsMenu, and Gui::StdCmdDescription.
References applyCommandData(), Gui::BitmapFactory(), Gui::CommandBase::className(), Gui::getMainWindow(), printConflictingAccelerators(), Gui::CommandBase::sAccel, Gui::Action::setIcon(), Gui::Action::setShortcut(), and Gui::CommandBase::sPixmap.
Referenced by addTo(), addToGroup(), and Gui::StdCmdDescription::createAction().
const char * Command::endCmdHelp | ( | void | ) |
returns the end of a online help page
Gui::Document * Command::getActiveGuiDocument | ( | void | ) | const |
Get pointer to the active gui document.
References Gui::Application::activeDocument(), and getGuiApplication().
Referenced by SketcherCopy::activate(), StdCmdImport::activated(), StdCmdExport::activated(), StdCmdSave::activated(), StdCmdSaveAs::activated(), StdCmdSaveCopy::activated(), StdCmdProjectInfo::activated(), StdCmdRefresh::activated(), StdCmdTransformManip::activated(), StdCmdDrawStyle::activated(), StdCmdViewCreate::activated(), CmdSketcherConstrainHorizontal::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainLock::activated(), CmdSketcherConstrainBlock::activated(), CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainPointOnObject::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainParallel::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainRadiam::activated(), CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainEqual::activated(), CmdSketcherConstrainSymmetric::activated(), CmdSketcherConstraint::activated(), CmdSketcherConstrainHorizontal::applyConstraint(), CmdSketcherConstrainVertical::applyConstraint(), CmdSketcherConstrainLock::applyConstraint(), CmdSketcherConstrainBlock::applyConstraint(), CmdSketcherConstrainCoincident::applyConstraint(), CmdSketcherConstrainDistance::applyConstraint(), CmdSketcherConstrainPointOnObject::applyConstraint(), CmdSketcherConstrainDistanceX::applyConstraint(), CmdSketcherConstrainDistanceY::applyConstraint(), CmdSketcherConstrainParallel::applyConstraint(), CmdSketcherConstrainPerpendicular::applyConstraint(), CmdSketcherConstrainTangent::applyConstraint(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), CmdSketcherConstrainRadiam::applyConstraint(), CmdSketcherConstrainAngle::applyConstraint(), CmdSketcherConstrainEqual::applyConstraint(), CmdSketcherConstrainSymmetric::applyConstraint(), hasActiveDocument(), StdCmdImport::isActive(), StdCmdExport::isActive(), StdCmdDependencyGraph::isActive(), StdCmdSave::isActive(), StdCmdSaveAs::isActive(), StdCmdSaveCopy::isActive(), StdCmdSaveAll::isActive(), StdCmdRevert::isActive(), StdCmdProjectInfo::isActive(), StdCmdViewCreate::isActive(), CmdSketcherConstraint::isActive(), CmdSketcherCopy::isActive(), CmdSketcherClone::isActive(), and CmdSketcherMove::isActive().
const char * Gui::Command::getAppModuleName | ( | void | ) | const |
returns the name to which the command belongs
App::Document * Command::getDocument | ( | const char * | Name = nullptr | ) | const |
Get pointer to the named or active App document Returns a pointer to the named document or the active document when no name is given.
NULL is returned when the name does not exist or no document is active!
References Gui::Application::activeDocument(), App::GetApplication(), App::Application::getDocument(), Gui::Document::getDocument(), and getGuiApplication().
Referenced by StdCmdImport::activated(), StdCmdExport::activated(), StdCmdProjectInfo::activated(), FCCmdTest3::activated(), FCCmdTest4::activated(), FCCmdTest5::activated(), FCCmdTest6::activated(), CmdTestCmdFuncs::activated(), TechDrawGui::DrawGuiUtil::findPage(), getObject(), hasObject(), StdCmdRefresh::isActive(), FCCmdTest2::isActive(), FCCmdTest3::isActive(), FCCmdTest4::isActive(), FCCmdTest5::isActive(), FCCmdTest6::isActive(), CmdTestCmdFuncs::isActive(), TechDrawGui::DrawGuiUtil::needPage(), and TechDrawGui::DrawGuiUtil::needView().
const char * Gui::Command::getGroupName | ( | ) | const |
Get the name of the grouping of the command.
Referenced by Gui::Dialog::CommandModel::data(), and translatedGroupName().
|
static |
Get pointer to the Application Window.
References Gui::Application::Instance.
Referenced by StdCmdOpen::activated(), StdCmdImport::activated(), StdCmdExport::activated(), StdCmdUndo::activated(), StdCmdRedo::activated(), StdCmdCut::activated(), StdCmdCopy::activated(), StdCmdPaste::activated(), StdCmdDelete::activated(), StdCmdMacroStopRecord::activated(), StdCmdFreezeViews::activated(), StdCmdViewIvIssueCamPos::activated(), getActiveGuiDocument(), getDocument(), StdCmdSave::isActive(), StdCmdSaveAs::isActive(), StdCmdPrint::isActive(), StdCmdPrintPreview::isActive(), StdCmdPrintPdf::isActive(), StdCmdUndo::isActive(), StdCmdRedo::isActive(), StdCmdCut::isActive(), StdCmdCopy::isActive(), StdCmdPaste::isActive(), StdCmdDlgMacroRecord::isActive(), StdCmdMacroStopRecord::isActive(), StdCmdDlgMacroExecute::isActive(), StdCmdDlgMacroExecuteDirect::isActive(), StdCmdMacroStartDebug::isActive(), StdCmdToggleBreakpoint::isActive(), StdCmdViewFitAll::isActive(), StdCmdViewFitSelection::isActive(), StdCmdViewVR::isActive(), StdCmdViewExample1::isActive(), StdCmdViewExample2::isActive(), StdCmdViewExample3::isActive(), StdCmdViewIvStereoOff::isActive(), StdCmdViewIvStereoRedGreen::isActive(), StdCmdViewIvStereoQuadBuff::isActive(), StdCmdViewIvStereoInterleavedRows::isActive(), StdCmdViewIvStereoInterleavedColumns::isActive(), StdCmdViewIvIssueCamPos::isActive(), isViewOfType(), StdCmdDrawStyle::StdCmdDrawStyle(), and StdCmdUserEditMode::StdCmdUserEditMode().
|
virtual |
Get the help URL.
Reimplemented in Gui::PythonCommand, and Gui::PythonGroupCommand.
const char * Gui::Command::getName | ( | void | ) | const |
Get the command name.
Referenced by StdCmdImport::activated(), StdCmdExport::activated(), StdCmdDelete::activated(), Gui::CommandManager::addCommand(), Gui::PythonCommand::createAction(), Gui::PythonGroupCommand::createAction(), Gui::Dialog::CommandModel::data(), Gui::PythonCommand::getWhatsThis(), Gui::PythonGroupCommand::getWhatsThis(), invoke(), Gui::PythonCommand::languageChange(), Gui::PythonGroupCommand::languageChange(), Gui::Dialog::DlgCustomKeyboardImp::on_editShortcut_textChanged(), Gui::CommandManager::removeCommand(), Gui::MacroCommand::save(), Gui::Dialog::DlgCustomKeyboardImp::setShortcutOfCurrentAction(), and Gui::GroupCommand::setup().
App::DocumentObject * Command::getObject | ( | const char * | Name | ) | const |
returns the named feature or the active one from the active document or NULL
References getDocument(), and App::Document::getObject().
Referenced by CmdSketcherConstrainHorizontal::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainLock::activated(), CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainPointOnObject::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainParallel::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainEqual::activated(), and CmdSketcherConstrainSymmetric::activated().
|
static |
returns a python command string to retrieve the given object
References getObjectCmd(), and Draft::gui.
|
static |
returns a python command string to retrieve an object from a document
References App::Application::getActiveDocument(), App::GetApplication(), and Draft::gui.
Referenced by PartDesignGui::TaskDlgBooleanParameters::accept(), PartDesignGui::TaskDlgDressUpParameters::accept(), PartDesignGui::TaskDlgMultiTransformParameters::accept(), StdCmdLinkMakeRelative::activated(), Gui::ExpressionBinding::apply(), PartDesignGui::buildLinkListPythonStr(), PartDesignGui::buildLinkSingleSubPythonStr(), PartDesignGui::buildLinkSubListPythonStr(), PartDesignGui::ViewProviderBody::doubleClicked(), PartDesignGui::ViewProviderDatum::doubleClicked(), Gui::TreeWidget::dropEvent(), PartDesignGui::fixSketchSupport(), Gui::SelectionObject::getAsPropertyLinkSubString(), getObjectCmd(), PartDesignGui::makeBodyActive(), Gui::TreeWidget::mouseDoubleClickEvent(), PartDesignGui::ViewProvider::onDelete(), SketcherGui::DrawSketchHandlerRegularPolygon::releaseButton(), SketcherGui::DrawSketchHandlerBox::releaseButton(), SketcherGui::DrawSketchHandlerOblong::releaseButton(), SketcherGui::DrawSketchHandlerSlot::releaseButton(), PartDesignGui::relinkToBody(), PartDesignGui::setEdit(), SketcherGui::ViewProviderSketch::setEdit(), and PartDesignGui::TaskBoxPrimitives::setPrimitive().
|
static |
Get Python tuple from object and sub-elements.
|
static |
Get a reference to the selection.
References Gui::Selection().
Referenced by SketcherCopy::activate(), StdCmdMeasurementSimple::activated(), CmdSketcherConstrainHorizontal::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainLock::activated(), CmdSketcherConstrainBlock::activated(), CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainPointOnObject::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainParallel::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainRadiam::activated(), CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainEqual::activated(), CmdSketcherConstrainSymmetric::activated(), CmdSketcherConstraint::activated(), CmdSketcherConstrainPerpendicular::applyConstraint(), CmdSketcherConstrainTangent::applyConstraint(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), CmdSketcherConstrainRadiam::applyConstraint(), CmdSketcherConstrainSymmetric::applyConstraint(), TechDrawGui::execHoleCircle(), TechDrawGui::DrawGuiUtil::findPage(), femguiutils.selection_widgets._Selector::setHelpText(), CmdSketcherConstrainTangent::substituteConstraintCombinations(), CmdSketcherConstrainPointOnObject::substituteConstraintCombinations(), and CmdSketcherConstrainCoincident::substituteConstraintCombinations().
std::string Command::getUniqueObjectName | ( | const char * | BaseName, |
const App::DocumentObject * | obj = nullptr |
||
) | const |
Get unique Feature name from the active document.
BaseName | the base name |
obj | if not zero, then request the unique name in the document of the given object. |
References App::Application::getActiveDocument(), and App::GetApplication().
Referenced by StdCmdPart::activated(), and StdCmdGroup::activated().
bool Command::hasActiveDocument | ( | void | ) | const |
true when there is a document
References getActiveGuiDocument().
Referenced by StdCmdMergeProjects::isActive(), StdCmdTextDocument::isActive(), StdCmdPart::isActive(), StdCmdGroup::isActive(), CmdSandboxMeshLoader::isActive(), TechDrawGui::DrawGuiUtil::needPage(), and TechDrawGui::DrawGuiUtil::needView().
bool Command::hasObject | ( | const char * | Name | ) |
true when there is a document and a Feature with Name
References getDocument(), and App::Document::getObject().
|
static |
Check if an Undo transaction is open on the active document.
References App::Application::getActiveTransaction(), and App::GetApplication().
Referenced by SurfaceGui::FillingPanel::checkOpenCommand(), SurfaceGui::FillingEdgePanel::checkOpenCommand(), SurfaceGui::FillingVertexPanel::checkOpenCommand(), SurfaceGui::GeomFillSurface::checkOpenCommand(), SurfaceGui::SectionsPanel::checkOpenCommand(), FemGui::TaskDlgMeshShapeNetgen::open(), FemGui::TaskDlgFemConstraintContact::open(), FemGui::TaskDlgFemConstraintDisplacement::open(), FemGui::TaskDlgFemConstraintFixed::open(), FemGui::TaskDlgFemConstraintFluidBoundary::open(), FemGui::TaskDlgFemConstraintForce::open(), FemGui::TaskDlgFemConstraintHeatflux::open(), FemGui::TaskDlgFemConstraintInitialTemperature::open(), FemGui::TaskDlgFemConstraintPlaneRotation::open(), FemGui::TaskDlgFemConstraintPressure::open(), FemGui::TaskDlgFemConstraintPulley::open(), FemGui::TaskDlgFemConstraintSpring::open(), FemGui::TaskDlgFemConstraintTemperature::open(), FemGui::TaskDlgFemConstraintTransform::open(), TechDrawGui::TaskProjGroup::reject(), TechDrawGui::TaskLeaderLine::removeFeature(), and TechDrawGui::TaskRichAnno::removeFeature().
void Command::invoke | ( | int | index, |
TriggerSource | trigger = TriggerNone |
||
) |
Called to invoke the command.
index | in case of group command, this is the index of the child command. For checkable command, this indicates the checkable state. |
trigger | indicate the command triggering source, see TriggerSource. |
References bCanLog, Base::Console(), Gui::CommandBase::displayText, Gui::CommandBase::getMenuText(), getName(), Base::ConsoleSingleton::Log(), and sName.
Referenced by Gui::PythonGroupCommand::activated(), Gui::Dialog::DemoMode::on_fullscreen_toggled(), Gui::CommandManager::runCommandByName(), and Gui::Application::sRunCommand().
|
virtual |
Override this method if your Cmd is not always active.
Reimplemented in StdCmdExpression, Gui::PythonCommand, Gui::PythonGroupCommand, StdCmdImport, StdCmdExport, StdCmdMergeProjects, StdCmdDependencyGraph, StdCmdSave, StdCmdSaveAs, StdCmdSaveCopy, StdCmdSaveAll, StdCmdRevert, StdCmdProjectInfo, StdCmdProjectUtil, StdCmdPrint, StdCmdPrintPreview, StdCmdPrintPdf, StdCmdUndo, StdCmdRedo, StdCmdCut, StdCmdCopy, StdCmdPaste, StdCmdDuplicateSelection, StdCmdSelectAll, StdCmdDelete, StdCmdRefresh, StdCmdTransform, StdCmdPlacement, StdCmdTransformManip, StdCmdAlignment, StdCmdEdit, StdCmdLinkMakeGroup, StdCmdLinkMake, StdCmdLinkMakeRelative, StdCmdLinkReplace, StdCmdLinkUnlink, StdCmdLinkImport, StdCmdLinkImportAll, StdCmdLinkSelectLinked, StdCmdLinkSelectLinkedFinal, StdCmdLinkSelectAllLinks, StdCmdDlgMacroRecord, StdCmdMacroStopRecord, StdCmdDlgMacroExecute, StdCmdDlgMacroExecuteDirect, StdCmdMacroAttachDebugger, StdCmdMacroStartDebug, StdCmdMacroStopDebug, StdCmdMacroStepOver, StdCmdMacroStepInto, StdCmdToggleBreakpoint, StdCmdWorkbench, StdCmdAbout, StdCmdTextDocument, StdCmdUserEditMode, StdCmdPart, StdCmdGroup, FCCmdTest1, FCCmdTest2, FCCmdTest3, FCCmdTest4, FCCmdTest5, FCCmdTest6, CmdTestCmdFuncs, CmdTestProgress1, CmdTestProgress2, CmdTestProgress3, CmdTestProgress4, CmdTestProgress5, CmdTestMDI1, CmdTestMDI2, CmdTestMDI3, 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, StdViewFullscreen, StdViewDockUndockFullscreen, StdCmdViewVR, StdViewScreenShot, StdCmdViewCreate, StdCmdToggleNavigation, StdCmdAxisCross, StdCmdViewExample1, StdCmdViewExample2, StdCmdViewExample3, StdCmdViewIvStereoOff, StdCmdViewIvStereoRedGreen, StdCmdViewIvStereoQuadBuff, StdCmdViewIvStereoInterleavedRows, StdCmdViewIvStereoInterleavedColumns, StdCmdViewIvIssueCamPos, StdViewZoomIn, StdViewZoomOut, StdViewBoxZoom, StdBoxSelection, StdBoxElementSelection, StdCmdTreeSelectAllInstances, StdCmdMeasureDistance, StdCmdSceneInspector, StdCmdTextureMapping, StdCmdSelBack, StdCmdSelForward, StdCmdSelBoundingBox, StdCmdArrangeIcons, StdCmdTileWindows, StdCmdCascadeWindows, StdCmdCloseActiveWindow, StdCmdCloseAllWindows, StdCmdActivateNextWindow, StdCmdActivatePrevWindow, StdCmdDockViewMenu, StdCmdToolBarMenu, StdCmdStatusBar, StdCmdWindowsMenu, ViewIsometricCmd, ViewOrthographicCmd, ViewPerspectiveCmd, ViewZoomToFitCmd, CmdSandboxEventLoop, CmdSandboxMeshLoader, CmdSketcherConstraint, CmdSketcherCopy, CmdSketcherClone, and CmdSketcherMove.
Referenced by Gui::Workbench::createLinkMenu(), and testActive().
|
static |
Checks if the active object of the active document is valid.
References Gui::Application::activeDocument(), App::Document::getActiveObject(), Gui::Document::getDocument(), and Gui::Application::Instance.
bool Command::isViewOfType | ( | Base::Type | t | ) | const |
checks if the active view is of a special type or derived
References Gui::Application::activeDocument(), Gui::Document::getActiveView(), and getGuiApplication().
Referenced by StdViewScreenShot::isActive().
|
protected |
|
virtual |
Translate command.
Implements Gui::CommandBase.
Reimplemented in Gui::GroupCommand, Gui::PythonCommand, Gui::PythonGroupCommand, Gui::MacroCommand, StdCmdLinkMakeGroup, StdCmdAbout, StdCmdUserEditMode, StdCmdFreezeViews, StdCmdDrawStyle, and Gui::StdCmdDownloadOnlineHelp.
References applyCommandData(), and Gui::CommandBase::className().
Referenced by Gui::GroupCommand::languageChange().
|
static |
Open a new Undo transaction on the active document.
Open a new Undo transaction on the active document This method opens a new UNDO transaction on the active document.
This transaction will later appear in the UNDO REDO dialog with the name of the command. If the user recall the transaction everything changed on the document between OpenCommand() and CommitCommand will be undone (or redone). You can use an alternative name for the operation default is the Command name.
References App::GetApplication(), and App::Application::setActiveTransaction().
Referenced by DrawingGui::TaskProjection::accept(), MeshGui::TaskDecimating::accept(), MeshGui::TaskSmoothing::accept(), ReenGui::FitBSplineSurfaceWidget::accept(), ReenGui::PoissonWidget::accept(), SpreadsheetGui::DlgBindSheet::accept(), TechDrawGui::TaskActiveView::accept(), TechDrawGui::TaskCosmeticLine::accept(), TechDrawGui::TaskCustomizeFormat::accept(), TechDrawGui::TaskProjection::accept(), TechDrawGui::TaskWeldingSymbol::accept(), StdCmdDelete::activated(), StdCmdMeasurementSimple::activated(), StdCmdTextDocument::activated(), StdCmdPart::activated(), StdCmdGroup::activated(), CmdSketcherConstrainHorizontal::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainLock::activated(), CmdSketcherConstrainBlock::activated(), CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainPointOnObject::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainParallel::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainRadiam::activated(), CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainEqual::activated(), CmdSketcherConstrainSymmetric::activated(), TechDrawGui::TaskCosVertex::addCosVertex(), SpreadsheetGui::PropertiesDialog::apply(), CmdSketcherConstrainHorizontal::applyConstraint(), CmdSketcherConstrainVertical::applyConstraint(), CmdSketcherConstrainLock::applyConstraint(), CmdSketcherConstrainBlock::applyConstraint(), CmdSketcherConstrainCoincident::applyConstraint(), CmdSketcherConstrainDistance::applyConstraint(), CmdSketcherConstrainPointOnObject::applyConstraint(), CmdSketcherConstrainDistanceX::applyConstraint(), CmdSketcherConstrainDistanceY::applyConstraint(), CmdSketcherConstrainParallel::applyConstraint(), CmdSketcherConstrainPerpendicular::applyConstraint(), CmdSketcherConstrainTangent::applyConstraint(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), CmdSketcherConstrainRadiam::applyConstraint(), CmdSketcherConstrainAngle::applyConstraint(), CmdSketcherConstrainEqual::applyConstraint(), CmdSketcherConstrainSymmetric::applyConstraint(), TechDrawGui::QGIViewBalloon::balloonLabelDragFinished(), SurfaceGui::FillingPanel::checkOpenCommand(), SurfaceGui::FillingEdgePanel::checkOpenCommand(), SurfaceGui::FillingVertexPanel::checkOpenCommand(), SurfaceGui::GeomFillSurface::checkOpenCommand(), SurfaceGui::SectionsPanel::checkOpenCommand(), TechDrawGui::TaskRichAnno::createAnnoFeature(), SketcherGui::DrawSketchHandler::createAutoConstraints(), TechDrawGui::QGSPage::createBalloon(), TechDrawGui::TaskCenterLine::createCenterLine(), TechDrawGui::TaskCosmeticLine::createCosmeticLine(), TechDrawGui::TaskDetail::createDetail(), TechDrawGui::TaskLeaderLine::createLeaderFeature(), TechDrawGui::TaskSectionView::createSectionView(), TechDrawGui::QGIViewDimension::datumLabelDragFinished(), SpreadsheetGui::SheetTableView::deleteSelection(), PartGui::ViewProviderPart::doubleClicked(), PartDesignGui::ViewProviderBase::doubleClicked(), PartDesignGui::ViewProvider::doubleClicked(), PartDesignGui::ViewProviderDatum::doubleClicked(), SketcherGui::ViewProviderSketch::editDoubleClicked(), TechDrawGui::execHoleCircle(), SpreadsheetGui::SheetTableView::insertColumns(), SpreadsheetGui::SheetTableView::insertColumnsAfter(), SpreadsheetGui::SheetTableView::insertRows(), SpreadsheetGui::SheetTableView::insertRowsAfter(), SketcherGui::TaskSketcherConstraints::on_listWidgetConstraints_itemChanged(), SpreadsheetGui::DlgBindSheet::onDiscard(), SpreadsheetGui::SheetView::onMsg(), SpreadsheetGui::SheetTableView::onRecompute(), SketcherGui::DrawSketchHandlerCarbonCopy::onSelectionChanged(), SketcherGui::DrawSketchHandlerExternal::onSelectionChanged(), FemGui::TaskDlgMeshShapeNetgen::open(), FemGui::TaskDlgFemConstraintContact::open(), FemGui::TaskDlgFemConstraintDisplacement::open(), FemGui::TaskDlgFemConstraintFixed::open(), FemGui::TaskDlgFemConstraintFluidBoundary::open(), FemGui::TaskDlgFemConstraintForce::open(), FemGui::TaskDlgFemConstraintHeatflux::open(), FemGui::TaskDlgFemConstraintInitialTemperature::open(), FemGui::TaskDlgFemConstraintPlaneRotation::open(), FemGui::TaskDlgFemConstraintPressure::open(), FemGui::TaskDlgFemConstraintPulley::open(), FemGui::TaskDlgFemConstraintSpring::open(), FemGui::TaskDlgFemConstraintTemperature::open(), FemGui::TaskDlgFemConstraintTransform::open(), FemGui::TaskDlgPost::open(), StdCmdExpression::pasteExpressions(), SketcherGui::DrawSketchHandlerBSpline::pressButton(), DrawSketchHandlerCoincident::releaseButton(), DrawSketchHandlerBSplineInsertKnot::releaseButton(), DrawSketchHandlerCopy::releaseButton(), DrawSketchHandlerRectangularArray::releaseButton(), SketcherGui::DrawSketchHandlerArc::releaseButton(), SketcherGui::DrawSketchHandler3PointArc::releaseButton(), SketcherGui::DrawSketchHandlerArcOfEllipse::releaseButton(), SketcherGui::DrawSketchHandlerCircle::releaseButton(), SketcherGui::DrawSketchHandler3PointCircle::releaseButton(), SketcherGui::DrawSketchHandlerExtend::releaseButton(), SketcherGui::DrawSketchHandlerFillet::releaseButton(), SketcherGui::DrawSketchHandlerLine::releaseButton(), SketcherGui::DrawSketchHandlerLineSet::releaseButton(), SketcherGui::DrawSketchHandlerPoint::releaseButton(), SketcherGui::DrawSketchHandlerRegularPolygon::releaseButton(), SketcherGui::DrawSketchHandlerBox::releaseButton(), SketcherGui::DrawSketchHandlerOblong::releaseButton(), SketcherGui::DrawSketchHandlerSlot::releaseButton(), SketcherGui::DrawSketchHandlerSplitting::releaseButton(), SketcherGui::DrawSketchHandlerTrimming::releaseButton(), SketcherGui::DrawSketchHandlerArcOfHyperbola::releaseButton(), SketcherGui::DrawSketchHandlerArcOfParabola::releaseButton(), SpreadsheetGui::SheetTableView::removeColumns(), SpreadsheetGui::SheetTableView::removeRows(), TechDrawGui::MDIViewPage::saveDXF(), SpreadsheetGui::WorkbenchHelper::setBackgroundColor(), SpreadsheetGui::WorkbenchHelper::setForegroundColor(), PartDesignGui::ViewProviderShapeBinder::setupContextMenu(), Gui::ViewProviderDocumentObject::startDefaultEditMode(), CmdSketcherConstrainTangent::substituteConstraintCombinations(), CmdSketcherConstrainCoincident::substituteConstraintCombinations(), SketcherGui::ConstraintView::swapNamedOfSelectedItems(), TechDrawGui::TaskRichAnno::updateAnnoFeature(), TechDrawGui::TaskDetail::updateDetail(), TechDrawGui::TaskLeaderLine::updateLeaderFeature(), and TechDrawGui::TaskSectionView::updateSectionView().
|
static |
Print to Python console the current calling source file and line number.
References Gui::MacroManager::addLine(), Gui::MacroManager::Cmt, Gui::Application::Instance, and Gui::Application::macroManager().
Referenced by printPyCaller().
|
protected |
References Gui::CommandManager::checkAcceleratorForConflicts(), Gui::Application::commandManager(), Base::Console(), Gui::Application::Instance, Gui::CommandBase::sAccel, sName, and Base::ConsoleSingleton::Warning().
Referenced by createAction(), Gui::PythonCommand::createAction(), and Gui::MacroCommand::createAction().
|
static |
Print to Python console the current Python calling source file and line number.
References printCaller().
Referenced by Gui::Application::sDoCommand(), and Gui::Application::sDoCommandGui().
void Command::recreateTooltip | ( | const char * | context, |
Action * | action | ||
) |
(Re)Create the text for the tooltip (for example, when the shortcut is changed)
References Gui::CommandBase::getMenuText(), Gui::CommandBase::getStatusTip(), Gui::CommandBase::getToolTipText(), Gui::CommandBase::getWhatsThis(), Gui::CommandBase::sStatusTip, and draftguitools.gui_setstyle::translate.
Referenced by applyCommandData(), Gui::Dialog::DlgCustomKeyboardImp::on_buttonReset_clicked(), and Gui::Dialog::DlgCustomKeyboardImp::setShortcutOfCurrentAction().
void Command::setAppModuleName | ( | const char * | s | ) |
References StringCache::New(), and sAppModule.
Referenced by Gui::Application::sAddCommand().
void Command::setEnabled | ( | bool | on | ) |
Enables or disables the command.
Referenced by Gui::TaskCSysDragger::open(), PathScripts.PathDressupTagGui.HoldingTagMarker::setSelected(), and Gui::TaskCSysDragger::~TaskCSysDragger().
void Command::setGroupName | ( | const char * | s | ) |
References StringCache::New(), and sGroup.
Referenced by Gui::Application::sAddCommand().
void Command::setupCheckable | ( | int | iMsg | ) |
Setup checkable actions based on current TriggerSource.
References Gui::ActionGroup::actions(), TriggerAction, TriggerChildAction, TriggerNone, and triggerSource().
Referenced by Gui::PythonGroupCommand::activated().
const std::string Command::strToPython | ( | const char * | Str | ) |
translate a string to a python string literal (needed e.g. in file names for windows...)
References Base::InterpreterSingleton::strToPython().
const std::string Gui::Command::strToPython | ( | const std::string & | Str | ) |
void Command::testActive | ( | void | ) |
Get somtile called to check the state of the command.
References Gui::ActionGroup::actions(), Alter3DView, AlterDoc, AlterSelection, Gui::Application::commandManager(), Gui::Control(), eType, ForEdit, Gui::CommandManager::getCommandByName(), Gui::Application::Instance, and isActive().
Referenced by addTo(), addToGroup(), WebGui::BrowserView::onUpdateBrowserActions(), and Gui::MainWindow::updateEditorActions().
QString Command::translatedGroupName | ( | ) | const |
References Gui::CommandBase::className(), and getGroupName().
Referenced by Gui::Dialog::CommandModel::data().
TriggerSource Gui::Command::triggerSource | ( | ) | const |
Return the current command trigger source.
Referenced by Gui::GroupCommand::activated(), and setupCheckable().
|
virtual |
Updates the QAction with respect to the passed mode.
Implements Gui::CommandBase.
Reimplemented in CmdSketcherConstrainLock, CmdSketcherConstrainDistance, CmdSketcherConstrainDistanceX, CmdSketcherConstrainDistanceY, CmdSketcherConstrainRadius, CmdSketcherConstrainDiameter, CmdSketcherConstrainRadiam, and CmdSketcherConstrainAngle.
Referenced by Gui::CommandManager::updateCommands().
|
static |
Updates the (active) document (propagate changes)
Referenced by DrawingGui::TaskProjection::accept(), ReenGui::FitBSplineSurfaceWidget::accept(), ReenGui::PoissonWidget::accept(), SurfaceGui::TaskFilling::accept(), SurfaceGui::GeomFillSurface::accept(), SurfaceGui::TaskSections::accept(), TechDrawGui::TaskActiveView::accept(), TechDrawGui::TaskCenterLine::accept(), TechDrawGui::TaskCosmeticLine::accept(), TechDrawGui::TaskProjection::accept(), TechDrawGui::TaskSectionView::accept(), TechDrawGui::TaskWeldingSymbol::accept(), StdCmdMeasurementSimple::activated(), StdCmdTextDocument::activated(), StdCmdPart::activated(), PartGui::DlgExtrusion::apply(), CmdSketcherConstrainLock::applyConstraint(), TechDrawGui::TaskRichAnno::createAnnoFeature(), TechDrawGui::TaskCenterLine::createCenterLine(), TechDrawGui::TaskDetail::createDetail(), TechDrawGui::TaskLeaderLine::createLeaderFeature(), SketcherGui::ViewProviderSketch::forceUpdateData(), SketcherGui::ViewProviderSketch::onDelete(), TechDrawGui::MDIViewPage::onMsg(), FemGui::TaskDlgFemConstraintContact::reject(), FemGui::TaskDlgFemConstraintDisplacement::reject(), FemGui::TaskDlgFemConstraintFixed::reject(), FemGui::TaskDlgFemConstraintFluidBoundary::reject(), FemGui::TaskDlgFemConstraintForce::reject(), FemGui::TaskDlgFemConstraintHeatflux::reject(), FemGui::TaskDlgFemConstraintInitialTemperature::reject(), FemGui::TaskDlgFemConstraintPlaneRotation::reject(), FemGui::TaskDlgFemConstraintPressure::reject(), FemGui::TaskDlgFemConstraintSpring::reject(), FemGui::TaskDlgFemConstraintTemperature::reject(), FemGui::TaskDlgFemConstraintTransform::reject(), PartGui::OffsetWidget::reject(), PartGui::ThicknessWidget::reject(), SurfaceGui::TaskFilling::reject(), SurfaceGui::GeomFillSurface::reject(), SurfaceGui::TaskSections::reject(), TechDrawGui::TaskSectionView::reject(), SketcherGui::DrawSketchHandlerExtend::releaseButton(), Gui::ViewProviderLink::setupContextMenu(), SketcherGui::tryAutoRecompute(), SketcherGui::ViewProviderSketch::unsetEdit(), TechDrawGui::TaskDetail::updateDetail(), and TechDrawGui::TaskLeaderLine::updateLeaderFeature().
|
static |
Updates the (all or listed) documents (propagate changes)
References Gui::Application::Instance, and Gui::Application::onUpdate().
|
friend |
CommandManager is a friend.
|
friend |
|
protected |
Indicate if the command shall log to MacroManager.
Referenced by Command(), invoke(), StdCmdLinkActions::StdCmdLinkActions(), StdCmdLinkSelectActions::StdCmdLinkSelectActions(), and StdCmdTreeViewActions::StdCmdTreeViewActions().
|
protected |
Referenced by StdCmdRefresh::activated(), addModule(), 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(), Command(), Gui::MacroCommand::MacroCommand(), Gui::PythonCommand::PythonCommand(), Gui::PythonGroupCommand::PythonGroupCommand(), StdBoxSelection::StdBoxSelection(), StdCmdDrawStyle::StdCmdDrawStyle(), StdCmdExpression::StdCmdExpression(), StdCmdFreezeViews::StdCmdFreezeViews(), StdCmdLinkActions::StdCmdLinkActions(), StdCmdLinkMakeGroup::StdCmdLinkMakeGroup(), StdCmdLinkSelectActions::StdCmdLinkSelectActions(), StdCmdTreeViewActions::StdCmdTreeViewActions(), StdCmdUserEditMode::StdCmdUserEditMode(), and testActive().
|
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(), Command(), and setAppModuleName().
|
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(), Command(), Gui::MacroCommand::MacroCommand(), Gui::PythonCommand::PythonCommand(), Gui::PythonGroupCommand::PythonGroupCommand(), setGroupName(), 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().
|
protected |
|
protected |