Draft: Draft_Label fix label type list

This commit is contained in:
Roy
2021-12-10 18:40:43 +01:00
parent 306dc171f4
commit 418ca4a235
4 changed files with 31 additions and 20 deletions

View File

@@ -217,12 +217,7 @@ class Label(DraftAnnotation):
"LabelType",
"Label",
_tip)
obj.LabelType = ["Custom", "Name", "Label", "Position",
"Length", "Area", "Volume",
"Tag", "Material",
"Label + Position", "Label + Length",
"Label + Area", "Label + Volume",
"Label + Material"]
obj.LabelType = get_label_types()
def onDocumentRestored(self, obj):
"""Execute code when the document is restored.
@@ -298,6 +293,23 @@ class Label(DraftAnnotation):
DraftLabel = Label
def get_label_types():
return ["Custom",
"Name",
"Label",
"Position",
"Length",
"Area",
"Volume",
"Tag",
"Material",
"Label + Position",
"Label + Length",
"Label + Area",
"Label + Volume",
"Label + Material"]
def return_info(target, typ, subelement=None):
"""Return the text list from the target and the given type.