diff options
author | William Reynish <william@reynish.com> | 2009-09-08 15:31:15 +0400 |
---|---|---|
committer | William Reynish <william@reynish.com> | 2009-09-08 15:31:15 +0400 |
commit | ee78c63beea4e68a4211f218c67357610003e488 (patch) | |
tree | 68ccb88c84487f9ab0fe44588afebc9d06ee6cd3 | |
parent | 31fec003a1ff611433992c4c7ebc03867afb8d0b (diff) |
Text UI
*Added Text Boxes panel, currently only shows the first textbox. Needs operators for adding/removing
*Added Bold/Italic/Underline items
*Cleaned up some font UI layout.
-rw-r--r-- | release/ui/buttons_data_text.py | 74 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 6 |
2 files changed, 52 insertions, 28 deletions
diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py index aabf218122f..4db5803c4eb 100644 --- a/release/ui/buttons_data_text.py +++ b/release/ui/buttons_data_text.py @@ -38,7 +38,6 @@ class DATA_PT_shape_text(DataButtonsPanel): curve = context.curve space = context.space_data - layout.itemR(curve, "curve_2d") split = layout.split() @@ -76,13 +75,15 @@ class DATA_PT_geometry_text(DataButtonsPanel): col.itemL(text="Modification:") col.itemR(curve, "width") col.itemR(curve, "extrude") - col.itemR(curve, "taper_object") + col.itemL(text="Taper Object:") + col.itemR(curve, "taper_object", text="") col = split.column() col.itemL(text="Bevel:") col.itemR(curve, "bevel_depth", text="Depth") col.itemR(curve, "bevel_resolution", text="Resolution") - col.itemR(curve, "bevel_object") + col.itemL(text="Bevel Object:") + col.itemR(curve, "bevel_object", text="") class DATA_PT_font(DataButtonsPanel): __label__ = "Font" @@ -91,27 +92,39 @@ class DATA_PT_font(DataButtonsPanel): layout = self.layout text = context.curve - + char = context.curve.edit_format + layout.itemR(text, "font") + row = layout.row() + row.itemR(text, "text_size", text="Size") + row.itemR(text, "shear") + split = layout.split() - col = split.column() - # col.itemR(text, "style") - # col.itemR(text, "bold") - # col.itemR(text, "italic") - # col.itemR(text, "underline") - # ToDo: These settings are in a sub struct (Edit Format). - col.itemR(text, "text_size") - col.itemR(text, "shear") - col = split.column() - col.itemR(text, "text_on_curve") - col.itemR(text, "family") + col.itemL(text="Object Font:") + col.itemR(text, "family", text="") + + col = split.column() + col.itemL(text="Text on Curve:") + col.itemR(text, "text_on_curve", text="") + + split = layout.split() + + col = split.column() + col.itemL(text="Character:") + col.itemR(char, "bold") + col.itemR(char, "italic") + col.itemR(char, "underline") +# col.itemR(char, "style") +# col.itemR(char, "wrap") + + col = split.column(align=True) col.itemL(text="Underline:") col.itemR(text, "ul_position", text="Position") - col.itemR(text, "ul_height", text="Height") - # col.itemR(text, "edit_format") + col.itemR(text, "ul_height", text="Thickness") + class DATA_PT_paragraph(DataButtonsPanel): __label__ = "Paragraph" @@ -136,21 +149,32 @@ class DATA_PT_paragraph(DataButtonsPanel): col.itemL(text="Offset:") col.itemR(text, "offset_x", text="X") col.itemR(text, "offset_y", text="Y") - #col.itemR(text, "wrap") -""" + class DATA_PT_textboxes(DataButtonsPanel): - __label__ = "Text Boxes" + __label__ = "Text Boxes" - def draw(self, context): - layout = self.layout + def draw(self, context): + layout = self.layout - text = context.curve -""" + text = context.curve + box = context.curve.textbox + + split = layout.box().split() + + col = split.column(align=True) + col.itemL(text="Dimensions:") + col.itemR(box, "width", text="Width") + col.itemR(box, "height", text="Height") + + col = split.column(align=True) + col.itemL(text="Offset:") + col.itemR(box, "x", text="X") + col.itemR(box, "y", text="Y") bpy.types.register(DATA_PT_context_text) bpy.types.register(DATA_PT_shape_text) bpy.types.register(DATA_PT_geometry_text) bpy.types.register(DATA_PT_font) bpy.types.register(DATA_PT_paragraph) -#bpy.types.register(DATA_PT_textboxes) +bpy.types.register(DATA_PT_textboxes) diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 3fbdf7aaf7d..0a796bd431d 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -500,13 +500,13 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) prop= RNA_def_property(srna, "ul_position", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ulpos"); RNA_def_property_range(prop, -0.2f, 0.8f); - RNA_def_property_ui_text(prop, "Underline position", "Vertical position of underline"); + RNA_def_property_ui_text(prop, "Underline Position", "Vertical position of underline"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "ul_height", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ulheight"); RNA_def_property_range(prop, -0.2f, 0.8f); - RNA_def_property_ui_text(prop, "Underline thickness", ""); + RNA_def_property_ui_text(prop, "Underline Thickness", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "active_textbox", PROP_INT, PROP_NONE); @@ -518,7 +518,7 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) /* strings */ prop= RNA_def_property(srna, "family", PROP_STRING, PROP_NONE); RNA_def_property_string_maxlength(prop, 21); - RNA_def_property_ui_text(prop, "Family", "Blender uses font from selfmade objects."); + RNA_def_property_ui_text(prop, "Object Font", "Use Blender Objects as font characters. Give font objects a common name followed by the character it represents, eg. familya, familyb etc, and turn on Verts Duplication"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "str", PROP_STRING, PROP_NONE); |