Files
create/src/Gui/CommandPy.xml
2022-02-14 09:56:24 -06:00

122 lines
4.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
<PythonExport
Father="PyObjectBase"
Name="CommandPy"
Twin="Command"
TwinPointer="Command"
Include="Gui/Command.h"
FatherInclude="Base/PyObjectBase.h"
Namespace="Gui"
FatherNamespace="Base">
<Documentation>
<Author Licence="LGPL" Name="Werner Mayer" EMail="wmayer[at]users.sourceforge.net" />
<UserDocu>FreeCAD Python wrapper of Command functions</UserDocu>
</Documentation>
<Methode Name="get" Static='true'>
<Documentation>
<UserDocu>Get a given command by name or None if it doesn't exist.
get(string) -> Command
</UserDocu>
</Documentation>
</Methode>
<Methode Name="update" Static='true'>
<Documentation>
<UserDocu>Update active status of all commands.
update() -> None
</UserDocu>
</Documentation>
</Methode>
<Methode Name="listAll" Static='true'>
<Documentation>
<UserDocu>Returns the name of all commands.
listAll() -> list of strings
</UserDocu>
</Documentation>
</Methode>
<Methode Name="listByShortcut" Static='true'>
<Documentation>
<UserDocu>Returns a list of all commands, filtered by shortcut.
listByShortcut(string, bool bUseRegExp=False) -> list of strings
--
Shortcuts are converted to uppercase and spaces removed prior to comparison.
</UserDocu>
</Documentation>
</Methode>
<Methode Name="run">
<Documentation>
<UserDocu>Runs the given command.
run() -> None
</UserDocu>
</Documentation>
</Methode>
<Methode Name="isActive" Const="true">
<Documentation>
<UserDocu>Returns True if the command is active, False otherwise.
isActive() -> bool
</UserDocu>
</Documentation>
</Methode>
<Methode Name="getShortcut">
<Documentation>
<UserDocu>Returns string representing shortcut key accelerator for command.
getShortcut() -> string
</UserDocu>
</Documentation>
</Methode>
<Methode Name="setShortcut">
<Documentation>
<UserDocu>Sets shortcut for given command, returns bool True for success.
setShortcut(string) -> bool
</UserDocu>
</Documentation>
</Methode>
<Methode Name="resetShortcut">
<Documentation>
<UserDocu>Resets shortcut for given command back to the default, returns bool True for success.
resetShortcut() -> bool
</UserDocu>
</Documentation>
</Methode>
<Methode Name="getInfo">
<Documentation>
<UserDocu>Return information about this command.
getInfo() -> list of strings
--
Usage: menuText, tooltipText, whatsThisText, statustipText, pixmapText, shortcutText.
</UserDocu>
</Documentation>
</Methode>
<Methode Name="getAction">
<Documentation>
<UserDocu>Return the associated QAction object.
getAction() -> list of QAction</UserDocu>
</Documentation>
</Methode>
<Methode Name="createCustomCommand" Static='true'>
<Documentation>
<UserDocu>Create a custom command for a macro
createCustomCommand(macrofile, menuText, tooltipText, whatsThisText, statustipText, pixmapText, shortcutText) -> str
--
Only the macrofile argument is required, and should be the name of the macro file. All other arguments are
passed on to the command creation routines if they are provided. All arguments except the first accept None.
Returns the name of the created custom command.
</UserDocu>
</Documentation>
</Methode>
<Methode Name="removeCustomCommand" Static='true'>
<Documentation>
<UserDocu>Remove the custom command if it exists
removeCustomCommand(name) -> bool
--
Given the name of a custom command, this removes that command. It is not an error
to remove a non-existent command, the function simply does nothing in that case.
Returns True if something was removed, or False if not.
</UserDocu>
</Documentation>
</Methode>
</PythonExport>
</GenerateModel>