Group Inspect and ShapeInfo into a dropdown button

This commit is contained in:
DeepSOIC 2016-01-25 00:15:23 +03:00
parent c9fc37677b
commit 93e4827198
2 changed files with 18 additions and 2 deletions

View File

@ -78,7 +78,6 @@ class Lattice2Workbench (Workbench):
cmdsGuiTools = ([]
+ Lattice2.GuiTools.Inspect.exportedCommands
+ Lattice2.CompoundFeatures.ShapeInfoFeature.exportedCommands
+ Lattice2.GuiTools.SubstituteObject.exportedCommands
+ Lattice2.GuiTools.ExposeLinkSub.exportedCommands
)

View File

@ -134,5 +134,22 @@ class _CommandInspect:
FreeCADGui.addCommand('Lattice2_Inspect',_CommandInspect())
exportedCommands = ['Lattice2_Inspect']
import lattice2ShapeInfoFeature
class GroupCommandInspect:
def GetCommands(self):
return ('Lattice2_Inspect', lattice2ShapeInfoFeature.exportedCommands[0]) # a tuple of command names that you want to group
def GetDefaultCommand(self): # return the index of the tuple of the default command. This method is optional and when not implemented '0' is used
return 0
def GetResources(self):
return { 'MenuText': 'Inspect:', 'ToolTip': 'Inspect: tools to analyze shape structure.'}
def IsActive(self): # optional
return True
FreeCADGui.addCommand('Lattice2_Inspect_GroupCommand',GroupCommandInspect())
exportedCommands = ['Lattice2_Inspect_GroupCommand']