Proxy class for Gui.ViewProviderDocumentObject
Control.ViewObject.
More...
Public Member Functions | |
def | __init__ (self, vp) |
Initialization method for ViewProviderControlProxy. More... | |
def | attach (self, vp) |
Method called by FreeCAD after initialization. More... | |
def | claimChildren (self) |
Method called by FreeCAD to retrieve assigned children. More... | |
def | canDropObject (self, obj) |
Method called by FreeCAD to ask if an object obj can be dropped into a Group. More... | |
def | getIcon (self) |
Method called by FreeCAD to supply an icon for the Tree View. More... | |
def | setProperties (self, vp) |
Method to hide unused properties. More... | |
def | doubleClicked (self, vp) |
Method called by FreeCAD when Control is double-clicked in the Tree View. More... | |
def | setupContextMenu (self, vp, menu) |
Method called by the FreeCAD to customize a context menu for a Control. More... | |
def | __getstate__ (self) |
Necessary method to avoid errors when trying to save unserializable objects. More... | |
def | __setstate__ (self, state) |
Necessary method to avoid errors when trying to restore unserializable objects. More... | |
Static Public Attributes | |
panel = None | |
A ControlPanel if one is active or None. More... | |
fp = None | |
A Control object. More... | |
Proxy class for Gui.ViewProviderDocumentObject
Control.ViewObject.
A ViewProviderControlProxy instance provides a Control's icon, double-click response and context menu with "Show control panel".
To connect this Proxy
object to a Gui.ViewProviderDocumentObject
Control.ViewObject do:
Definition at line 1238 of file Control.py.
def Control.ViewProviderControlProxy.__init__ | ( | self, | |
vp | |||
) |
Initialization method for ViewProviderControlProxy.
A class instance is created and made a Proxy
for a generic Gui.ViewProviderDocumentObject
Control.ViewObject. During initialization number of properties are specified and preset.
vp | A barebone Gui.ViewProviderDocumentObject Control.ViewObject. |
Definition at line 1258 of file Control.py.
def Control.ViewProviderControlProxy.__getstate__ | ( | self | ) |
Necessary method to avoid errors when trying to save unserializable objects.
This method is used by JSON to serialize unserializable objects during autosave. Without this an Error would rise when JSON would try to do that itself.
We need this for unserializable fp
attribute, but we don't serialize it, because it's enough to reset it when object is restored.
Definition at line 1401 of file Control.py.
def Control.ViewProviderControlProxy.__setstate__ | ( | self, | |
state | |||
) |
Necessary method to avoid errors when trying to restore unserializable objects.
This method is used during a document restoration. We need this for unserializable fp
attribute, but we do not restore it, because it's enough to reset it.
Definition at line 1411 of file Control.py.
def Control.ViewProviderControlProxy.attach | ( | self, | |
vp | |||
) |
Method called by FreeCAD after initialization.
This method adds Control as the fp
attribute.
vp | A Control.ViewObject after initialization. |
Definition at line 1270 of file Control.py.
def Control.ViewProviderControlProxy.canDropObject | ( | self, | |
obj | |||
) |
Method called by FreeCAD to ask if an object obj
can be dropped into a Group.
FreeCAD objects of a Server, Trajectory and CollisionDetector type are allowed to drop inside a Control group.
obj | A FreeCAD object hovering above a Control item in the Tree View. |
Definition at line 1298 of file Control.py.
def Control.ViewProviderControlProxy.claimChildren | ( | self | ) |
Method called by FreeCAD to retrieve assigned children.
When a property of a Control is touched the Control and the FreeCAD ActiveDocument are notified. The FreeCAD ActiveDocument then emits a signal to inform all its observers e.g. the FreeCADGui ActiveDocument. The FreeCADGui document then emits a new signal to inform e.g. the tree view. The tree view then invokes claimChildren()
.
Definition at line 1283 of file Control.py.
def Control.ViewProviderControlProxy.doubleClicked | ( | self, | |
vp | |||
) |
Method called by FreeCAD when Control is double-clicked in the Tree View.
If no dialog is opened in the Task View, a new ControlPanel
is opened. If a ControlPanel
is already opened, the Model tab on the Combo View is swapped for the Tasks tab so that the panel becomes visible. If another dialog is opened a warning is shown.
vp | A Gui.ViewProviderDocumentObject Control.ViewObject. |
Definition at line 1345 of file Control.py.
def Control.ViewProviderControlProxy.getIcon | ( | self | ) |
Method called by FreeCAD to supply an icon for the Tree View.
A full path to an icon is supplied for the FreeCADGui.
Definition at line 1318 of file Control.py.
def Control.ViewProviderControlProxy.setProperties | ( | self, | |
vp | |||
) |
Method to hide unused properties.
Properties Display Mode, Visibility are set to be invisible as they are unused.
vp | A Gui.ViewProviderDocumentObject Control.ViewObject. |
Definition at line 1329 of file Control.py.
def Control.ViewProviderControlProxy.setupContextMenu | ( | self, | |
vp, | |||
menu | |||
) |
Method called by the FreeCAD to customize a context menu for a Control.
The Transform and Set colors... items are removed from the context menu shown upon right click on DocumentObjectGroupPython
Control in the Tree View. The option to Show control panel is added instead.
vp | A right-clicked Gui.ViewProviderDocumentObject Control.ViewObject. |
menu | A Qt's QMenu to be edited. |
Definition at line 1382 of file Control.py.
|
static |
A Control object.
Definition at line 1246 of file Control.py.
|
static |
A ControlPanel if one is active or None.
Definition at line 1245 of file Control.py.