* projection paint options in the toolbar
[blender.git] / release / ui / buttons_data_text.py
1
2 import bpy
3
4 class DataButtonsPanel(bpy.types.Panel):
5         __space_type__ = "BUTTONS_WINDOW"
6         __region_type__ = "WINDOW"
7         __context__ = "data"
8         
9         def poll(self, context):
10                 return (context.object and context.object.type == 'TEXT' and context.curve)
11
12 class DATA_PT_context_text(DataButtonsPanel):
13         __idname__ = "DATA_PT_context_text"
14         __show_header__ = False
15
16         def draw(self, context):
17                 layout = self.layout
18                 
19                 ob = context.object
20                 curve = context.curve
21                 space = context.space_data
22
23                 split = layout.split(percentage=0.65)
24
25                 if ob:
26                         split.template_ID(ob, "data")
27                         split.itemS()
28                 elif curve:
29                         split.template_ID(space, "pin_id")
30                         split.itemS()
31
32 class DATA_PT_shape_text(DataButtonsPanel):
33         __idname__ = "DATA_PT_shape_text"
34         __label__ = "Shape Text"
35
36         def draw(self, context):
37                 layout = self.layout
38                 
39                 ob = context.object
40                 curve = context.curve
41                 space = context.space_data
42
43                 if curve:
44                         layout.itemR(curve, "curve_2d")                 
45                                                         
46                         split = layout.split()
47                 
48                         sub = split.column()
49                         sub.itemL(text="Caps:")
50                         sub.itemR(curve, "front")
51                         sub.itemR(curve, "back")
52                         
53                         sub.itemL(text="Textures:")
54                         sub.itemR(curve, "uv_orco")
55                         sub.itemR(curve, "auto_texspace")
56                         
57                         sub = split.column()    
58                         sub.itemL(text="Resolution:")
59                         sub.itemR(curve, "resolution_u", text="Preview U")
60                         sub.itemR(curve, "resolution_v", text="Preview V")
61                         sub.itemR(curve, "render_resolution_u", text="Render U")
62                         sub.itemR(curve, "render_resolution_v", text="Render V")
63
64                         sub.itemL(text="Display:")
65                         sub.itemR(curve, "fast")
66
67 class DATA_PT_geometry_text(DataButtonsPanel):
68         __idname__ = "DATA_PT_geometry_text"
69         __label__ = "Geometry"
70
71         def draw(self, context):
72                 layout = self.layout
73                 curve = context.curve
74
75                 split = layout.split()
76         
77                 sub = split.column()
78                 sub.itemL(text="Modification:")
79                 sub.itemR(curve, "width")
80                 sub.itemR(curve, "extrude")
81                 sub.itemR(curve, "taper_object")
82                 
83                 sub = split.column()
84                 sub.itemL(text="Bevel:")
85                 sub.itemR(curve, "bevel_depth", text="Depth")
86                 sub.itemR(curve, "bevel_resolution", text="Resolution")
87                 sub.itemR(curve, "bevel_object")
88
89 class DATA_PT_font(DataButtonsPanel):
90         __idname__ = "DATA_PT_font"
91         __label__ = "Font"
92
93         def draw(self, context):
94                 layout = self.layout
95                 text = context.curve
96
97                 layout.row()
98                 layout.itemR(text, "font")
99                 
100                 split = layout.split()
101                 
102                 sub = split.column()    
103         #       sub.itemR(text, "style")
104         #       sub.itemR(text, "bold")
105         #       sub.itemR(text, "italic")
106         #       sub.itemR(text, "underline")
107         #       ToDo: These settings are in a sub struct (Edit Format). 
108                 sub.itemR(text, "text_size")            
109                 sub.itemR(text, "shear")
110
111                 sub = split.column()
112                 sub.itemR(text, "text_on_curve")
113                 sub.itemR(text, "family")
114                 sub.itemL(text="Underline:")
115                 sub.itemR(text, "ul_position", text="Position")
116                 sub.itemR(text, "ul_height", text="Height")
117
118         #       sub.itemR(text, "edit_format")
119
120 class DATA_PT_paragraph(DataButtonsPanel):
121         __idname__ = "DATA_PT_paragraph"
122         __label__ = "Paragraph"
123
124         def draw(self, context):
125                 layout = self.layout
126                 text = context.curve
127
128                 layout.itemL(text="Align:")
129                 layout.itemR(text, "spacemode", expand=True)
130
131                 split = layout.split()
132                 
133                 sub = split.column()    
134                 sub.itemL(text="Spacing:")
135                 sub.itemR(text, "spacing", text="Character")
136                 sub.itemR(text, "word_spacing", text="Word")
137                 sub.itemR(text, "line_dist", text="Line")
138
139                 sub = split.column()
140                 sub.itemL(text="Offset:")
141                 sub.itemR(text, "x_offset", text="X")
142                 sub.itemR(text, "y_offset", text="Y")
143                 #sub.itemR(text, "wrap")
144
145 """             
146 class DATA_PT_textboxes(DataButtonsPanel):
147                 __idname__ = "DATA_PT_textboxes"
148                 __label__ = "Text Boxes"
149
150                 def draw(self, context):
151                         layout = self.layout
152                         text = context.curve
153 """
154
155 bpy.types.register(DATA_PT_context_text)        
156 bpy.types.register(DATA_PT_shape_text)  
157 bpy.types.register(DATA_PT_geometry_text)
158 bpy.types.register(DATA_PT_font)
159 bpy.types.register(DATA_PT_paragraph)
160 #bpy.types.register(DATA_PT_textboxes)
161