cyberarm_engine 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +0,0 @@
1
- module CyberarmEngine
2
- class Stack < Container
3
- include Common
4
-
5
- def layout
6
- @children.each do |child|
7
- move_to_next_line(child)
8
- end
9
- end
10
- end
11
- end
@@ -1,49 +0,0 @@
1
- module CyberarmEngine
2
- class ToggleButton < Button
3
- attr_reader :toggled
4
-
5
- def initialize(options, block = nil)
6
- super(options[:checkmark], options, block)
7
- @toggled = options[:toggled] || false
8
- if @toggled
9
- @text.text = @options[:checkmark]
10
- else
11
- @text.text = ""
12
- end
13
-
14
- return self
15
- end
16
-
17
- def toggled=(boolean)
18
- @toggled = !boolean
19
- toggle
20
- end
21
-
22
- def clicked_left_mouse_button(sender, x, y)
23
- toggle
24
-
25
- @block.call(self) if @block
26
- end
27
-
28
- def toggle
29
- if @toggled
30
- @toggled = false
31
- @text.text = ""
32
- else
33
- @toggled = true
34
- @text.text = @options[:checkmark]
35
- end
36
- end
37
-
38
- def recalculate
39
- super
40
-
41
- @style.width = @text.textobject.text_width(@options[:checkmark])
42
- update_background
43
- end
44
-
45
- def value
46
- @toggled
47
- end
48
- end
49
- end