Control.ControlCommand Class Reference

ControlCommand class specifying Animate workbench's Control button/command. More...

Inheritance diagram for Control.ControlCommand:

Public Member Functions

def GetResources (self)
 Method used by FreeCAD to retrieve resources to use for this command. More...
 
def Activated (self)
 Method used as a callback when the toolbar button or the menu item is clicked. More...
 
def IsActive (self)
 Method to specify when the toolbar button and the menu item are enabled. More...
 

Detailed Description

ControlCommand class specifying Animate workbench's Control button/command.

This class provides resources for a toolbar button and a menu button. It controls their behaivor(Active/Inactive) and responds to callbacks after either of them was clicked(Activated).

Definition at line 1422 of file Control.py.

Member Function Documentation

◆ Activated()

def Control.ControlCommand.Activated (   self)

Method used as a callback when the toolbar button or the menu item is clicked.

This method creates a Control instance in currently active document. Afterwards it adds a ControlProxy as a Proxy to this instance as well as ViewProviderControlProxy to its ViewObject.Proxy, if FreeCAD runs in the Graphic mode.

Definition at line 1445 of file Control.py.

1445  def Activated(self):
1446  doc = FreeCAD.ActiveDocument
1447  a = doc.addObject("App::DocumentObjectGroupPython", "Control")
1448  ControlProxy(a)
1449  if FreeCAD.GuiUp:
1450  ViewProviderControlProxy(a.ViewObject)
1451  doc.recompute()
1452  return
1453 
def Activated(self)
Method used as a callback when the toolbar button or the menu item is clicked.
Definition: Trajectory.py:1575

◆ GetResources()

def Control.ControlCommand.GetResources (   self)

Method used by FreeCAD to retrieve resources to use for this command.

Returns
A dict with items PixMap, MenuText and ToolTip which contain a path to a command icon, a text to be shown in a menu and a tooltip message.

Definition at line 1432 of file Control.py.

1432  def GetResources(self):
1433  return {'Pixmap': path.join(PATH_TO_ICONS, "ControlCmd.png"),
1434  'MenuText': "Control",
1435  'ToolTip': "Create Control instance."}
1436 
def GetResources(self)
Method used by FreeCAD to retrieve resources to use for this command.
Definition: Trajectory.py:1562

◆ IsActive()

def Control.ControlCommand.IsActive (   self)

Method to specify when the toolbar button and the menu item are enabled.

The toolbar button Control and menu item Control are set to be active only when there is an active document in which a Control instance can be created.

Returns
True if buttons shall be enabled and False otherwise.

Definition at line 1463 of file Control.py.

1463  def IsActive(self):
1464  if FreeCAD.ActiveDocument is None:
1465  return False
1466  else:
1467  return True
1468 
1469 
def IsActive(self)
Method to specify when the toolbar button and the menu item are enabled.
Definition: Trajectory.py:1594

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