glimmer-dsl-swt 4.18.4.8 → 4.18.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +70 -0
- data/README.md +24 -11
- data/VERSION +1 -1
- data/bin/glimmer +3 -3
- data/docs/reference/GLIMMER_CONFIGURATION.md +7 -3
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +353 -145
- data/docs/reference/GLIMMER_SAMPLES.md +207 -41
- data/glimmer-dsl-swt.gemspec +33 -15
- data/lib/ext/glimmer/config.rb +3 -7
- data/lib/glimmer/data_binding/list_selection_binding.rb +13 -7
- data/lib/glimmer/data_binding/table_items_binding.rb +22 -17
- data/lib/glimmer/data_binding/tree_items_binding.rb +19 -15
- data/lib/glimmer/data_binding/widget_binding.rb +13 -15
- data/lib/glimmer/dsl/swt/{file_dialog_expression.rb → auto_exec_expression.rb} +6 -18
- data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +9 -6
- data/lib/glimmer/dsl/swt/color_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb +16 -14
- data/lib/glimmer/dsl/swt/custom_widget_expression.rb +4 -1
- data/lib/glimmer/dsl/swt/data_binding_expression.rb +2 -2
- data/lib/glimmer/dsl/swt/dialog_expression.rb +18 -9
- data/lib/glimmer/dsl/swt/dsl.rb +1 -0
- data/lib/glimmer/dsl/swt/exec_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/font_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/image_expression.rb +18 -3
- data/lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb +11 -8
- data/lib/glimmer/dsl/swt/pixel_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +9 -5
- data/lib/glimmer/dsl/swt/shape_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/shell_expression.rb +5 -2
- data/lib/glimmer/dsl/swt/widget_expression.rb +8 -4
- data/lib/glimmer/launcher.rb +3 -0
- data/lib/glimmer/rake_task/scaffold.rb +3 -0
- data/lib/glimmer/swt/color_proxy.rb +1 -1
- data/lib/glimmer/swt/custom/code_text.rb +33 -11
- data/lib/glimmer/swt/custom/drawable.rb +50 -2
- data/lib/glimmer/swt/custom/radio_group.rb +2 -1
- data/lib/glimmer/swt/custom/shape.rb +166 -34
- data/lib/glimmer/{dsl/swt/directory_dialog_expression.rb → swt/custom/shape/arc.rb} +15 -20
- data/lib/glimmer/swt/custom/shape/focus.rb +43 -0
- data/lib/glimmer/swt/custom/shape/image.rb +86 -0
- data/lib/glimmer/swt/custom/shape/line.rb +58 -0
- data/lib/glimmer/swt/custom/shape/oval.rb +43 -0
- data/lib/glimmer/swt/custom/shape/point.rb +52 -0
- data/lib/glimmer/swt/custom/shape/polygon.rb +73 -0
- data/lib/glimmer/swt/custom/shape/polyline.rb +73 -0
- data/lib/glimmer/swt/custom/shape/rectangle.rb +87 -0
- data/lib/glimmer/swt/custom/shape/text.rb +73 -0
- data/lib/glimmer/swt/date_time_proxy.rb +9 -3
- data/lib/glimmer/swt/dialog_proxy.rb +92 -0
- data/lib/glimmer/swt/display_proxy.rb +62 -2
- data/lib/glimmer/swt/expand_item_proxy.rb +18 -12
- data/lib/glimmer/swt/font_proxy.rb +13 -7
- data/lib/glimmer/swt/image_proxy.rb +16 -5
- data/lib/glimmer/swt/layout_data_proxy.rb +21 -15
- data/lib/glimmer/swt/layout_proxy.rb +19 -15
- data/lib/glimmer/swt/menu_proxy.rb +2 -2
- data/lib/glimmer/swt/message_box_proxy.rb +21 -7
- data/lib/glimmer/swt/properties.rb +3 -0
- data/lib/glimmer/swt/proxy_properties.rb +145 -0
- data/lib/glimmer/swt/scrolled_composite_proxy.rb +20 -7
- data/lib/glimmer/swt/shell_proxy.rb +96 -80
- data/lib/glimmer/swt/swt_proxy.rb +17 -0
- data/lib/glimmer/swt/tab_item_proxy.rb +6 -3
- data/lib/glimmer/swt/table_proxy.rb +32 -11
- data/lib/glimmer/swt/transform_proxy.rb +26 -38
- data/lib/glimmer/swt/tree_proxy.rb +11 -16
- data/lib/glimmer/swt/widget_listener_proxy.rb +6 -2
- data/lib/glimmer/swt/widget_proxy.rb +194 -137
- data/lib/glimmer/ui.rb +5 -0
- data/lib/glimmer/ui/custom_shell.rb +13 -7
- data/lib/glimmer/ui/custom_widget.rb +4 -5
- data/samples/elaborate/contact_manager.rb +7 -7
- data/samples/elaborate/login.rb +25 -21
- data/samples/elaborate/mandelbrot_fractal.rb +346 -39
- data/samples/elaborate/meta_sample.rb +1 -1
- data/samples/elaborate/tetris.rb +1 -0
- data/samples/elaborate/tic_tac_toe.rb +16 -14
- data/samples/elaborate/tic_tac_toe/board.rb +5 -5
- data/samples/elaborate/tic_tac_toe/cell.rb +5 -5
- data/samples/hello/hello_button.rb +7 -7
- data/samples/hello/hello_canvas.rb +145 -41
- data/samples/hello/hello_checkbox.rb +16 -14
- data/samples/hello/hello_checkbox_group.rb +11 -9
- data/samples/hello/hello_color_dialog.rb +66 -0
- data/samples/hello/hello_combo.rb +14 -12
- data/samples/hello/hello_computed.rb +7 -7
- data/samples/hello/hello_cursor.rb +58 -0
- data/samples/hello/hello_custom_shell.rb +17 -21
- data/samples/hello/hello_custom_widget.rb +4 -6
- data/samples/hello/hello_date_time.rb +14 -12
- data/samples/hello/hello_directory_dialog.rb +7 -7
- data/samples/hello/hello_expand_bar.rb +8 -8
- data/samples/hello/hello_file_dialog.rb +7 -7
- data/samples/hello/hello_font_dialog.rb +82 -0
- data/samples/hello/hello_group.rb +18 -16
- data/samples/hello/hello_list_multi_selection.rb +13 -11
- data/samples/hello/hello_list_single_selection.rb +13 -11
- data/samples/hello/hello_progress_bar.rb +125 -0
- data/samples/hello/hello_radio.rb +18 -16
- data/samples/hello/hello_radio_group.rb +14 -12
- data/samples/hello/hello_spinner.rb +7 -7
- data/samples/hello/hello_tab.rb +5 -5
- data/samples/hello/hello_table.rb +10 -5
- data/samples/hello/hello_tree.rb +485 -0
- metadata +30 -23
- data/lib/glimmer/swt/directory_dialog_proxy.rb +0 -65
- data/lib/glimmer/swt/file_dialog_proxy.rb +0 -66
@@ -0,0 +1,66 @@
|
|
1
|
+
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
class HelloColorDialog
|
23
|
+
include Glimmer::UI::CustomShell
|
24
|
+
|
25
|
+
attr_accessor :selected_color
|
26
|
+
|
27
|
+
before_body {
|
28
|
+
self.selected_color = :black
|
29
|
+
}
|
30
|
+
|
31
|
+
body {
|
32
|
+
shell {
|
33
|
+
minimum_size 220, 0
|
34
|
+
grid_layout
|
35
|
+
|
36
|
+
text 'Hello, Color Dialog!'
|
37
|
+
|
38
|
+
label {
|
39
|
+
layout_data :center, :center, true, false
|
40
|
+
text 'Selected Color:'
|
41
|
+
font height: 14, style: :bold
|
42
|
+
}
|
43
|
+
|
44
|
+
canvas(:border) {
|
45
|
+
layout_data :center, :center, true, false
|
46
|
+
background bind(self, :selected_color)
|
47
|
+
|
48
|
+
on_mouse_up {
|
49
|
+
self.selected_color = color_dialog.open
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
button {
|
54
|
+
layout_data :center, :center, true, false
|
55
|
+
text "Choose Color..."
|
56
|
+
|
57
|
+
on_widget_selected {
|
58
|
+
self.selected_color = color_dialog.open
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
}
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
HelloColorDialog.launch
|
@@ -25,39 +25,41 @@ class HelloCombo
|
|
25
25
|
|
26
26
|
def initialize
|
27
27
|
self.country_options = ['', 'Canada', 'US', 'Mexico']
|
28
|
-
reset_country
|
28
|
+
reset_country!
|
29
29
|
end
|
30
30
|
|
31
|
-
def reset_country
|
31
|
+
def reset_country!
|
32
32
|
self.country = 'Canada'
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
include Glimmer
|
36
|
+
include Glimmer::UI::CustomShell
|
37
37
|
|
38
|
-
|
39
|
-
person = Person.new
|
40
|
-
|
38
|
+
before_body {
|
39
|
+
@person = Person.new
|
40
|
+
}
|
41
|
+
|
42
|
+
body {
|
41
43
|
shell {
|
42
44
|
row_layout(:vertical) {
|
43
|
-
|
45
|
+
fill true
|
44
46
|
}
|
45
47
|
|
46
48
|
text 'Hello, Combo!'
|
47
49
|
|
48
50
|
combo(:read_only) {
|
49
|
-
selection bind(person, :country)
|
51
|
+
selection bind(@person, :country) # also binds to country_options by convention
|
50
52
|
}
|
51
53
|
|
52
54
|
button {
|
53
55
|
text 'Reset Selection'
|
54
56
|
|
55
57
|
on_widget_selected do
|
56
|
-
person.reset_country
|
58
|
+
@person.reset_country!
|
57
59
|
end
|
58
60
|
}
|
59
|
-
}
|
60
|
-
|
61
|
+
}
|
62
|
+
}
|
61
63
|
end
|
62
64
|
|
63
|
-
HelloCombo.
|
65
|
+
HelloCombo.launch
|
@@ -22,17 +22,17 @@
|
|
22
22
|
require_relative 'hello_computed/contact'
|
23
23
|
|
24
24
|
class HelloComputed
|
25
|
-
include Glimmer
|
25
|
+
include Glimmer::UI::CustomShell
|
26
26
|
|
27
|
-
|
27
|
+
before_body {
|
28
28
|
@contact = Contact.new(
|
29
29
|
first_name: 'Barry',
|
30
30
|
last_name: 'McKibbin',
|
31
31
|
year_of_birth: 1985
|
32
32
|
)
|
33
|
-
|
33
|
+
}
|
34
34
|
|
35
|
-
|
35
|
+
body {
|
36
36
|
shell {
|
37
37
|
text 'Hello, Computed!'
|
38
38
|
|
@@ -89,8 +89,8 @@ class HelloComputed
|
|
89
89
|
}
|
90
90
|
}
|
91
91
|
}
|
92
|
-
}
|
93
|
-
|
92
|
+
}
|
93
|
+
}
|
94
94
|
end
|
95
95
|
|
96
|
-
HelloComputed.
|
96
|
+
HelloComputed.launch
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
class HelloCursor
|
23
|
+
include Glimmer::UI::CustomShell
|
24
|
+
|
25
|
+
attr_accessor :selected_cursor
|
26
|
+
|
27
|
+
# This method matches the name of the :selected_cursor property by convention
|
28
|
+
def selected_cursor_options
|
29
|
+
Glimmer::SWT::SWTProxy.cursor_options
|
30
|
+
end
|
31
|
+
|
32
|
+
after_body {
|
33
|
+
observe(self, :selected_cursor) {
|
34
|
+
body_root.cursor = selected_cursor
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
body {
|
39
|
+
shell {
|
40
|
+
grid_layout
|
41
|
+
|
42
|
+
text 'Hello, Cursor!'
|
43
|
+
cursor :wait
|
44
|
+
|
45
|
+
label {
|
46
|
+
text 'Please select a cursor style and see it change the mouse cursor (varies per platform):'
|
47
|
+
font style: :bold
|
48
|
+
cursor :no
|
49
|
+
}
|
50
|
+
radio_group {
|
51
|
+
grid_layout 5, true
|
52
|
+
selection bind(self, :selected_cursor)
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
58
|
+
HelloCursor.launch
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
# a copy of this software and associated documentation files (the
|
5
5
|
# "Software"), to deal in the Software without restriction, including
|
@@ -7,10 +7,10 @@
|
|
7
7
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
8
|
# permit persons to whom the Software is furnished to do so, subject to
|
9
9
|
# the following conditions:
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# The above copyright notice and this permission notice shall be
|
12
12
|
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
15
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
16
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
@@ -24,10 +24,11 @@ require 'date'
|
|
24
24
|
# This class declares an `email_shell` custom shell, aka custom window (by convention)
|
25
25
|
# Used to view an email message
|
26
26
|
class EmailShell
|
27
|
+
# including Glimmer::UI::CustomShell enables declaring as an `email_shell` custom widget Glimmer GUI DSL keyword
|
27
28
|
include Glimmer::UI::CustomShell
|
28
29
|
|
29
|
-
# multiple options without default values
|
30
|
-
options :date, :subject, :from, :message
|
30
|
+
# multiple options without default values
|
31
|
+
options :parent_shell, :date, :subject, :from, :message
|
31
32
|
|
32
33
|
# single option with default value
|
33
34
|
option :to, default: '"John Irwin" <john.irwin@example.com>'
|
@@ -38,10 +39,10 @@ class EmailShell
|
|
38
39
|
|
39
40
|
body {
|
40
41
|
# pass received swt_style through to shell to customize it (e.g. :dialog_trim for a blocking shell)
|
41
|
-
shell(swt_style) {
|
42
|
+
shell(parent_shell, swt_style) {
|
42
43
|
grid_layout(2, false)
|
43
44
|
|
44
|
-
text subject
|
45
|
+
text subject
|
45
46
|
|
46
47
|
label {
|
47
48
|
text 'Date:'
|
@@ -78,7 +79,7 @@ class EmailShell
|
|
78
79
|
}
|
79
80
|
|
80
81
|
background :white
|
81
|
-
text message
|
82
|
+
text message
|
82
83
|
}
|
83
84
|
}
|
84
85
|
}
|
@@ -86,13 +87,12 @@ class EmailShell
|
|
86
87
|
end
|
87
88
|
|
88
89
|
class HelloCustomShell
|
89
|
-
|
90
|
-
include Glimmer
|
90
|
+
include Glimmer::UI::CustomShell
|
91
91
|
|
92
92
|
Email = Struct.new(:date, :subject, :from, :message, keyword_init: true)
|
93
93
|
EmailSystem = Struct.new(:emails, keyword_init: true)
|
94
94
|
|
95
|
-
|
95
|
+
before_body {
|
96
96
|
@email_system = EmailSystem.new(
|
97
97
|
emails: [
|
98
98
|
Email.new(date: DateTime.new(2029, 10, 22, 11, 3, 0).strftime('%F %I:%M %p'), subject: '3rd Week Report', from: '"Dianne Tux" <dianne.tux@example.com>', message: "Hello,\n\nI was wondering if you'd like to go over the weekly report sometime this afternoon.\n\nDianne"),
|
@@ -103,9 +103,9 @@ class HelloCustomShell
|
|
103
103
|
Email.new(date: DateTime.new(2029, 10, 2, 10, 34, 0).strftime('%F %I:%M %p'), subject: 'Glimmer Upgrade v98.0', from: '"Robert McGabbins" <robert.mcgabbins@example.com>', message: "Team,\n\nWe are upgrading to Glimmer version 98.0.\n\nEveryone pull the latest code!\n\nRegards,\n\nRobert McGabbins"),
|
104
104
|
]
|
105
105
|
)
|
106
|
-
|
106
|
+
}
|
107
107
|
|
108
|
-
|
108
|
+
body {
|
109
109
|
shell {
|
110
110
|
grid_layout
|
111
111
|
|
@@ -141,15 +141,11 @@ class HelloCustomShell
|
|
141
141
|
|
142
142
|
on_mouse_up { |event|
|
143
143
|
email = event.table_item.get_data
|
144
|
-
|
145
|
-
async_exec {
|
146
|
-
email_shell(date: email.date, subject: email.subject, from: email.from, message: email.message).open
|
147
|
-
}
|
148
|
-
end
|
144
|
+
email_shell(parent_shell: self, date: email.date, subject: email.subject, from: email.from, message: email.message).open
|
149
145
|
}
|
150
146
|
}
|
151
|
-
}
|
152
|
-
|
147
|
+
}
|
148
|
+
}
|
153
149
|
end
|
154
150
|
|
155
|
-
HelloCustomShell.
|
151
|
+
HelloCustomShell.launch
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
# a copy of this software and associated documentation files (the
|
5
5
|
# "Software"), to deal in the Software without restriction, including
|
@@ -7,10 +7,10 @@
|
|
7
7
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
8
|
# permit persons to whom the Software is furnished to do so, subject to
|
9
9
|
# the following conditions:
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# The above copyright notice and this permission notice shall be
|
12
12
|
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
15
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
16
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
@@ -42,9 +42,7 @@ class GreetingLabel
|
|
42
42
|
|
43
43
|
Thread.new {
|
44
44
|
colors.cycle { |color|
|
45
|
-
|
46
|
-
self.color = color
|
47
|
-
}
|
45
|
+
self.color = color
|
48
46
|
sleep(1)
|
49
47
|
}
|
50
48
|
}
|
@@ -24,12 +24,14 @@ class HelloDateTime
|
|
24
24
|
attr_accessor :date_of_birth
|
25
25
|
end
|
26
26
|
|
27
|
-
include Glimmer
|
27
|
+
include Glimmer::UI::CustomShell
|
28
28
|
|
29
|
-
|
30
|
-
person = Person.new
|
31
|
-
person.date_of_birth = DateTime.new(2013, 7, 12, 18, 37, 23)
|
32
|
-
|
29
|
+
before_body {
|
30
|
+
@person = Person.new
|
31
|
+
@person.date_of_birth = DateTime.new(2013, 7, 12, 18, 37, 23)
|
32
|
+
}
|
33
|
+
|
34
|
+
body {
|
33
35
|
shell {
|
34
36
|
row_layout :vertical
|
35
37
|
|
@@ -42,22 +44,22 @@ class HelloDateTime
|
|
42
44
|
}
|
43
45
|
|
44
46
|
date { # alias for date_time(:date)
|
45
|
-
date_time bind(person, :date_of_birth)
|
47
|
+
date_time bind(@person, :date_of_birth)
|
46
48
|
}
|
47
49
|
|
48
50
|
date_drop_down { # alias for date_time(:date, :drop_down)
|
49
|
-
date_time bind(person, :date_of_birth)
|
51
|
+
date_time bind(@person, :date_of_birth)
|
50
52
|
}
|
51
53
|
|
52
54
|
time { # alias for date_time(:time)
|
53
|
-
date_time bind(person, :date_of_birth)
|
55
|
+
date_time bind(@person, :date_of_birth)
|
54
56
|
}
|
55
57
|
|
56
58
|
calendar { # alias for date_time(:calendar)
|
57
|
-
date_time bind(person, :date_of_birth)
|
59
|
+
date_time bind(@person, :date_of_birth)
|
58
60
|
}
|
59
|
-
}
|
60
|
-
|
61
|
+
}
|
62
|
+
}
|
61
63
|
end
|
62
64
|
|
63
|
-
HelloDateTime.
|
65
|
+
HelloDateTime.launch
|
@@ -20,15 +20,15 @@
|
|
20
20
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
21
|
|
22
22
|
class HelloDirectoryDialog
|
23
|
-
include Glimmer
|
23
|
+
include Glimmer::UI::CustomShell
|
24
24
|
|
25
25
|
attr_accessor :selected_directory
|
26
26
|
|
27
|
-
|
27
|
+
before_body {
|
28
28
|
@selected_directory = 'Please select a directory.'
|
29
|
-
|
29
|
+
}
|
30
30
|
|
31
|
-
|
31
|
+
body {
|
32
32
|
shell {
|
33
33
|
minimum_size 400, 0
|
34
34
|
grid_layout
|
@@ -53,8 +53,8 @@ class HelloDirectoryDialog
|
|
53
53
|
self.selected_directory = directory_dialog.open
|
54
54
|
}
|
55
55
|
}
|
56
|
-
}
|
57
|
-
|
56
|
+
}
|
57
|
+
}
|
58
58
|
end
|
59
59
|
|
60
|
-
HelloDirectoryDialog.
|
60
|
+
HelloDirectoryDialog.launch
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
# a copy of this software and associated documentation files (the
|
5
5
|
# "Software"), to deal in the Software without restriction, including
|
@@ -7,10 +7,10 @@
|
|
7
7
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
8
|
# permit persons to whom the Software is furnished to do so, subject to
|
9
9
|
# the following conditions:
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# The above copyright notice and this permission notice shall be
|
12
12
|
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
15
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
16
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
@@ -20,9 +20,9 @@
|
|
20
20
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
21
|
|
22
22
|
class HelloExpandBar
|
23
|
-
include Glimmer
|
23
|
+
include Glimmer::UI::CustomShell
|
24
24
|
|
25
|
-
|
25
|
+
body {
|
26
26
|
shell {
|
27
27
|
grid_layout(1, false) {
|
28
28
|
margin_width 0
|
@@ -103,8 +103,8 @@ class HelloExpandBar
|
|
103
103
|
}
|
104
104
|
|
105
105
|
}
|
106
|
-
}
|
107
|
-
|
106
|
+
}
|
107
|
+
}
|
108
108
|
end
|
109
109
|
|
110
|
-
HelloExpandBar.
|
110
|
+
HelloExpandBar.launch
|