1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
8
Include="Gui/Command.h"
9
FatherInclude="Base/PyObjectBase.h"
11
FatherNamespace="Base">
13
<Author Licence="LGPL" Name="Werner Mayer" EMail="wmayer[at]users.sourceforge.net" />
14
<UserDocu>FreeCAD Python wrapper of Command functions</UserDocu>
16
<Methode Name="get" Static='true'>
18
<UserDocu>get(name) -> Gui.Command or None
20
Get a given command by name or None if it doesn't exist.
23
Command name.</UserDocu>
26
<Methode Name="update" Static='true'>
28
<UserDocu>update() -> None
30
Update active status of all commands.</UserDocu>
33
<Methode Name="listAll" Static='true'>
35
<UserDocu>listAll() -> list of str
37
Returns the name of all commands.</UserDocu>
40
<Methode Name="listByShortcut" Static='true'>
42
<UserDocu>listByShortcut(string, useRegExp=False) -> list of str
44
Returns a list of all commands, filtered by shortcut.
45
Shortcuts are converted to uppercase and spaces removed
49
Shortcut to be searched.
51
Filter using regular expression.</UserDocu>
56
<UserDocu>run(item=0) -> None
58
Runs the given command.
61
Item to be run.</UserDocu>
64
<Methode Name="isActive" Const="true">
66
<UserDocu>isActive() -> bool
68
Returns True if the command is active, False otherwise.</UserDocu>
71
<Methode Name="getShortcut">
73
<UserDocu>getShortcut() -> str
75
Returns string representing shortcut key accelerator for command.</UserDocu>
78
<Methode Name="setShortcut">
80
<UserDocu>setShortcut(string) -> bool
82
Sets shortcut for given command, returns True for success.
85
Shortcut to be set.</UserDocu>
88
<Methode Name="resetShortcut">
90
<UserDocu>resetShortcut() -> bool
92
Resets shortcut for given command back to the default, returns True for success.</UserDocu>
95
<Methode Name="getInfo">
97
<UserDocu>getInfo() -> dict
99
Return information about this command.</UserDocu>
102
<Methode Name="getAction">
104
<UserDocu>getAction() -> list of QAction
106
Return the associated QAction object.</UserDocu>
109
<Methode Name="createCustomCommand" Static='true' Keyword='true'>
111
<UserDocu>createCustomCommand(macroFile, menuText, toolTip, whatsThis, statusTip, pixmap, shortcut) -> str
113
Create a custom command for a macro. Returns name of the created command.
120
Tool tip text. Optional.
122
`What's this?` text. Optional.
124
Status tip text. Optional.
126
Pixmap name. Optional.
128
Shortcut key sequence. Optional.</UserDocu>
131
<Methode Name="removeCustomCommand" Static='true'>
133
<UserDocu>removeCustomCommand(name) -> bool
135
Remove the custom command if it exists.
136
Given the name of a custom command, this removes that command.
137
It is not an error to remove a non-existent command, the function
138
simply does nothing in that case.
139
Returns True if something was removed, or False if not.
142
Command name.</UserDocu>
145
<Methode Name="findCustomCommand" Static='true'>
147
<UserDocu>findCustomCommand(name) -> str or None
149
Given the name of a macro, return the name of the custom command for that macro
150
or None if there is no command matching that macro script name.
153
Macro name.</UserDocu>