-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockMaker.kv
More file actions
185 lines (176 loc) · 4.33 KB
/
Copy pathBlockMaker.kv
File metadata and controls
185 lines (176 loc) · 4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#:kivy 1.9.0
<BlockMaker>:
textinput: textinput
limittext: limittext
colorbutton: colorbutton
cols: 1
size_hint_y: None
height: self.minimum_height
MyInput:
id: textinput
on_text: makebutton.disabled = (textinput.text == '' or (limittext.text != '' and int(limittext.text) == 0))
on_text_validate: root.makeBlock()
GridLayout:
rows:1
size_hint: (1,None)
height: self.minimum_height
Button:
canvas:
Color:
rgba: [x*.5 for x in self.background_color[0:3]] + self.background_color[3:4]
Line:
width: 1
points: self.x + 1,self.y + 1,self.right - 1, self.y + 1,self.right - 1,self.top - 1
Color:
rgba: [ .5 + x*.5 for x in self.background_color[0:3]] + self.background_color[3:4]
Line:
width:1
points: self.x + 1,self.y + 1,self.x + 1, self.top -1,self.right - 1,self.top - 1
id: colorbutton
text: 'Color'
color: [0,0,0,1]
background_normal: ''
background_color: [.4,.4,.4,1]
size_hint: (None, None)
height: self.texture_size[1]
width: self.texture_size[0] *1.5
on_release: root.toggle_colorset()
Label:
text: 'Limit:'
size_hint: (None, None)
height: self.texture_size[1]
width: self.texture_size[0] *1.5
IntegerInput:
id: limittext
on_text: makebutton.disabled = (textinput.text == '' or (limittext.text != '' and int(limittext.text) == 0))
Button:
id: makebutton
text: "Make"
size_hint: (None, None)
height: self.texture_size[1]
width: self.texture_size[0] *1.5
on_press: root.makeBlock(); textinput.focus = True
Widget:
size_hint_y: None
height: 10
<MyInput>:
multiline: False
write_tab: False
size_hint_y: None
height: self.minimum_height
<ColorSet>:
cols:5
spacing: [0,0]
size_hint: (1,None)
height: self.minimum_height
ColorSetButton:
text: 'White'
color: [1,1,1,1]
ColorSetButton:
text: 'Silver'
color: [.75,.75,.75,1]
ColorSetButton:
text: 'Grey' #dim gray
color: [.4,.4,.4,1]
ColorSetButton:
text: 'Black'
color: [0,0,0,1]
ColorSetButton:
text: 'Red' #crimson
color: [.8,.08,.24,1]
ColorSetButton:
text: 'Orange' #orange
color: [1,.55,0,1]
ColorSetButton:
text: 'Yellow'
color: [1,1,0,1]
ColorSetButton:
text: 'Green' #lime
color: [0,1,0,1]
ColorSetButton:
text: 'Blue' #Deep Sky Blue
color: [0,.8,1,1]
ColorSetButton:
text: 'Purple' #dark orchid
color: [.6,0,.8,1]
<BkgdColorSet>:
cols:5
spacing: [2,2]
size_hint: (1,None)
height: self.minimum_height
BkgdColorSetButton:
text: 'None'
background_color: [0,0,0,0]
BkgdColorSetButton:
text: 'White'
color: [0,0,0,1]
background_color: [.98,.98,.98,1]
BkgdColorSetButton:
text: 'Grey'
background_color: [.4,.4,.4,1]
BkgdColorSetButton:
text: 'Black'
background_color: [.1,.1,.1,1]
BkgdColorSetButton:
text: 'Red'
background_color: [.9,.08,.24,1]
BkgdColorSetButton:
text: 'Blue'
background_color: [.25,.4,.88,1]
BkgdColorSetButton:
text: 'Green' #lime green
color: [0,0,0,1]
background_color: [.2,.8,.2,1]
BkgdColorSetButton:
text: 'Yellow'
color: [0,0,0,1]
background_color: [1,1,0,1]
BkgdColorSetButton:
text: 'Cyan'
color: [0,0,0,1]
background_color: [0,1,1,1]
BkgdColorSetButton:
text: 'Purple' #magenta
color: [0,0,0,1]
background_color: [1,0,1,1]
<ColorSetButton>:
canvas:
Color:
rgba: 0, 0, 0, 1
Line:
rectangle: self.x,self.y,self.width,self.height
Color:
rgba: [x*.5 for x in self.background_color]
Line:
width: 1
points: self.x + 1,self.y + 1,self.right - 1, self.y + 1,self.right - 1,self.top - 1
Color:
rgba: [ .5 + x*.5 for x in self.background_color]
Line:
width:1
points: self.x + 1,self.y + 1,self.x + 1, self.top -1,self.right - 1,self.top - 1
size_hint_y: None
height: self.texture_size[1] * 1.5
on_press: self.updateButton()
background_color: [.4,.4,.4,1]
background_normal: ''
<BkgdColorSetButton>:
canvas:
Color:
rgba: 0, 0, 0, 1
Line:
rectangle: self.x,self.y,self.width,self.height
Color:
rgba: [x*.5 for x in self.background_color]
Line:
width: 1
points: self.x + 1,self.y + 1,self.right - 1, self.y + 1,self.right - 1,self.top - 1
Color:
rgba: [ .5 + x*.5 for x in self.background_color]
Line:
width:1
points: self.x + 1,self.y + 1,self.x + 1, self.top -1,self.right - 1,self.top - 1
size_hint_y: None
background_normal: ''
height: self.texture_size[1] * 1.5
on_press: self.updateButton()