Animate workbench class according to the PythonWorkbench template. More...
Public Member Functions | |
def | __init__ (self) |
Initialization method for Animate workbench. More... | |
def | Initialize (self) |
Method used to setup workbench upon being selected on the workbench toolbar. More... | |
def | Activated (self) |
This function is executed when the workbench is activated. More... | |
def | Deactivated (self) |
This function is executed when the workbench is deactivated. More... | |
def | ContextMenu (self, recipient) |
Method to add custom commands to a context menu with respect to a recipient. More... | |
def | GetClassName (self) |
Mandatory method for full python workbenches. More... | |
Public Attributes | |
list | |
A list of str which are the names of imported commands. More... | |
Animate workbench class according to the PythonWorkbench template.
This class represents the workbench in the FreeCAD Gui i.e. it imports commands, shows them on a toolbar and in a menu when workbench is activated. It contains information to make and item in the workbench toolbar listbox.
Definition at line 49 of file InitGui.py.
def InitGui.Animate.__init__ | ( | self | ) |
Initialization method for Animate
workbench.
A class instance is created, an static attributes Icon
, MenuText
and ToolTip
are added to the class. The Icon
is a path to an image to be shown on the workbench toolbar. The MenuText
is a str text to be shown in the listbox on the workbench toolbar. The ToolTip
is a str tooltip for the Animate
workbench.
Definition at line 72 of file InitGui.py.
def InitGui.Animate.Activated | ( | self | ) |
This function is executed when the workbench is activated.
For now it's used just to inform a user about the fact via console message.
Definition at line 114 of file InitGui.py.
def InitGui.Animate.ContextMenu | ( | self, | |
recipient | |||
) |
Method to add custom commands to a context menu with respect to a recipient.
This method is executed whenever the user right-clicks in a Tree View or the View box. It's possible to only add commands via self.appendContextMenu()
.
recipient | A str equal to "Tree" or "View" according to where user clicked. |
Definition at line 134 of file InitGui.py.
def InitGui.Animate.Deactivated | ( | self | ) |
This function is executed when the workbench is deactivated.
For now it's used just to inform a user about the fact via console message.
Definition at line 122 of file InitGui.py.
def InitGui.Animate.GetClassName | ( | self | ) |
Mandatory method for full python workbenches.
Definition at line 148 of file InitGui.py.
def InitGui.Animate.Initialize | ( | self | ) |
Method used to setup workbench upon being selected on the workbench toolbar.
This function is executed when user clicks on Animate
workbench in the workbench listbox situated on the workbench toolbar. After that commands are added to the FreeCAD Gui by importing their modules. The names of imported commands are then saved in the list
attribute. Afterwards a toolbar and a menu with some of those commands are created.
Definition at line 89 of file InitGui.py.
InitGui.Animate.list |
A list of str which are the names of imported commands.
Definition at line 99 of file InitGui.py.