This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
array.kv
145 lines (131 loc) · 3.61 KB
/
array.kv
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
<ArrayElementWidget>:
val: val
address: address
index: index
#size_hint_y: .3
orientation: 'vertical'
canvas.before:
Color:
rgb: 0.3, 0.4, 0.6
Rectangle:
size: self.width*8/10, self.height*.1
pos: self.x+self.width/10, self.y + self.height*.5
BoxLayout:
size_hint_y: .3
Label:
size_hint_y: .1
id: address
color: 0,0,0,1
Label:
size_hint_y: .1
id: val
Label:
size_hint_y: .1
id: index
color: 0,0,0,1
BoxLayout:
size_hint_y: .4
<ArrayCreationWidget>:
array_size: _array_size
BoxLayout:
Label:
canvas.before:
Color:
rgb: 0.4, 0.5, .3
Rectangle:
pos: self.pos
size: self.size
text: 'data type'
TextInput:
id: data_type
Label:
canvas.before:
Color:
rgb: 0.4, 0.5, 0.3
Rectangle:
pos: self.pos
size: self.size
text: 'size'
TextInput:
id: _array_size
font_size: self.height/2
focus: True
multiline: False
write_tab: False
on_text_validate:
self.parent.parent.create_array(_array_size.text,data_type.text)
Button:
id: create_btn
text: 'enter'
on_press:
self.parent.parent.create_array(_array_size.text, data_type.text)
<ArrayInsertionWidget>:
BoxLayout:
size_hint_x: .5
Label:
canvas.before:
Color:
rgb: 0.4, 0.5, .3
Rectangle:
pos: self.pos
size: self.size
text: 'position'
TextInput:
focus: True
id: pos
font_size: self.height/2
text: ''
multiline: False
write_tab: False
on_text_validate: data_to_insert.focus = True
BoxLayout:
size_hint_x: .5
Label:
canvas.before:
Color:
rgb: 0.4, 0.5, .3
Rectangle:
pos: self.pos
size: self.size
text: 'data'
TextInput:
id: data_to_insert
font_size: self.height/2
text: ''
multiline: False
write_tab: False
on_text_validate: self.parent.parent.insert_data(data_to_insert.text, pos.text)
Button:
text: 'enter'
on_press: self.parent.parent.insert_data(data_to_insert.text, pos.text)
<ArrayDeletionWidget>:
delete_button: delete_button
pos_or_data_val: pos_or_data_val
BoxLayout:
size_hint_x: .3
ToggleButton:
text: 'data'
group: 'oprtn_type'
ToggleButton:
text: 'addr'
group: 'oprtn_type'
state: 'down'
BoxLayout:
size_hint_x: .7
Label:
canvas.before:
Color:
rgb: 0.4, 0.5, .3
Rectangle:
pos: self.pos
size: self.size
text: 'data / addr'
TextInput:
id: pos_or_data_val
font_size: self.height/2
text:'5'
write_tab: False
multiline: False
Button:
id: delete_button
text: 'enter'