glimmer-dsl-swt 4.17.10.4 → 4.18.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,12 +24,12 @@ class HelloListSingleSelection
24
24
  attr_accessor :country, :country_options
25
25
 
26
26
  def initialize
27
- self.country_options=["", "Canada", "US", "Mexico"]
28
- self.country = "Canada"
27
+ self.country_options = ['', 'Canada', 'US', 'Mexico']
28
+ reset_country
29
29
  end
30
30
 
31
31
  def reset_country
32
- self.country = "Canada"
32
+ self.country = 'Canada'
33
33
  end
34
34
  end
35
35
 
@@ -48,7 +48,7 @@ class HelloListSingleSelection
48
48
  }
49
49
 
50
50
  button {
51
- text "Reset Selection To Default Value"
51
+ text 'Reset Selection To Default Value'
52
52
 
53
53
  on_widget_selected { person.reset_country }
54
54
  }
@@ -56,4 +56,4 @@ class HelloListSingleSelection
56
56
  end
57
57
  end
58
58
 
59
- HelloListSingleSelection.new.launch
59
+ HelloListSingleSelection.new.launch
@@ -21,50 +21,52 @@
21
21
 
22
22
  include Glimmer
23
23
 
24
- shell { |shell_proxy|
24
+ COLORS = [:white, :red, :yellow, :green, :blue, :magenta, :gray, :black]
25
+
26
+ shell {
27
+ grid_layout {
28
+ margin_width 0
29
+ margin_height 0
30
+ }
31
+
25
32
  text 'Hello, Menu Bar!'
26
- grid_layout
27
- label(:center) {
28
- font height: 16
29
- text 'Check Out The File Menu and History Menu in The Menu Bar Above!'
33
+
34
+ @label = label(:center) {
35
+ font height: 50
36
+ text 'Check Out The Menu Bar Above!'
30
37
  }
38
+
31
39
  menu_bar {
32
40
  menu {
33
41
  text '&File'
34
42
  menu_item {
35
- text 'E&xit'
36
- on_widget_selected {
37
- exit(0)
38
- }
39
- }
40
- menu_item(0) {
41
43
  text '&New'
44
+ accelerator :command, :N
45
+
42
46
  on_widget_selected {
43
- message_box(shell_proxy) {
44
- text 'New File'
45
- message 'New File Contents'
47
+ message_box {
48
+ text 'New'
49
+ message 'New file created.'
46
50
  }.open
47
51
  }
48
52
  }
49
- menu(1) {
50
- text '&Options'
51
- menu_item(:radio) {
52
- text 'Option 1'
53
- }
54
- menu_item(:separator)
55
- menu_item(:check) {
56
- text 'Option 3'
53
+ menu_item {
54
+ text '&Open...'
55
+ accelerator :command, :O
56
+
57
+ on_widget_selected {
58
+ message_box {
59
+ text 'Open'
60
+ message 'Opening File...'
61
+ }.open
57
62
  }
58
63
  }
59
- }
60
- menu {
61
- text '&History'
62
64
  menu {
63
- text '&Recent'
65
+ text 'Open &Recent'
64
66
  menu_item {
65
67
  text 'File 1'
66
68
  on_widget_selected {
67
- message_box(shell_proxy) {
69
+ message_box {
68
70
  text 'File 1'
69
71
  message 'File 1 Contents'
70
72
  }.open
@@ -73,13 +75,167 @@ shell { |shell_proxy|
73
75
  menu_item {
74
76
  text 'File 2'
75
77
  on_widget_selected {
76
- message_box(shell_proxy) {
78
+ message_box {
77
79
  text 'File 2'
78
80
  message 'File 2 Contents'
79
81
  }.open
80
82
  }
81
83
  }
82
84
  }
85
+ menu_item(:separator)
86
+ menu_item {
87
+ text 'E&xit'
88
+
89
+ on_widget_selected {
90
+ exit(0)
91
+ }
92
+ }
93
+ }
94
+ menu {
95
+ text '&Edit'
96
+ menu_item {
97
+ text 'Cut'
98
+ accelerator :command, :X
99
+ }
100
+ menu_item {
101
+ text 'Copy'
102
+ accelerator :command, :C
103
+ }
104
+ menu_item {
105
+ text 'Paste'
106
+ accelerator :command, :V
107
+ }
108
+ }
109
+ menu {
110
+ text '&Options'
111
+
112
+ menu_item(:radio) {
113
+ text '&Enabled'
114
+
115
+ on_widget_selected {
116
+ @select_one_menu.enabled = true
117
+ @select_multiple_menu.enabled = true
118
+ }
119
+ }
120
+ @select_one_menu = menu {
121
+ text '&Select One'
122
+ enabled false
123
+
124
+ menu_item(:radio) {
125
+ text 'Option 1'
126
+ }
127
+ menu_item(:radio) {
128
+ text 'Option 2'
129
+ }
130
+ menu_item(:radio) {
131
+ text 'Option 3'
132
+ }
133
+ }
134
+ @select_multiple_menu = menu {
135
+ text '&Select Multiple'
136
+ enabled false
137
+
138
+ menu_item(:check) {
139
+ text 'Option 4'
140
+ }
141
+ menu_item(:check) {
142
+ text 'Option 5'
143
+ }
144
+ menu_item(:check) {
145
+ text 'Option 6'
146
+ }
147
+ }
148
+ }
149
+ menu {
150
+ text '&Format'
151
+ menu {
152
+ text '&Background Color'
153
+ COLORS.each { |color_style|
154
+ menu_item(:radio) {
155
+ text color_style.to_s.split('_').map(&:capitalize).join(' ')
156
+
157
+ on_widget_selected {
158
+ @label.background = color_style
159
+ }
160
+ }
161
+ }
162
+ }
163
+ menu {
164
+ text 'Foreground &Color'
165
+ COLORS.each { |color_style|
166
+ menu_item(:radio) {
167
+ text color_style.to_s.split('_').map(&:capitalize).join(' ')
168
+
169
+ on_widget_selected {
170
+ @label.foreground = color_style
171
+ }
172
+ }
173
+ }
174
+ }
175
+ }
176
+ menu {
177
+ text '&View'
178
+ menu_item(:radio) {
179
+ text 'Small'
180
+
181
+ on_widget_selected {
182
+ @label.font = {height: 25}
183
+ @label.parent.pack
184
+ }
185
+ }
186
+ menu_item(:radio) {
187
+ text 'Medium'
188
+ selection true
189
+
190
+ on_widget_selected {
191
+ @label.font = {height: 50}
192
+ @label.parent.pack
193
+ }
194
+ }
195
+ menu_item(:radio) {
196
+ text 'Large'
197
+
198
+ on_widget_selected {
199
+ @label.font = {height: 75}
200
+ @label.parent.pack
201
+ }
202
+ }
203
+ }
204
+ menu {
205
+ text '&Help'
206
+ menu_item {
207
+ text '&Manual'
208
+ accelerator :command, :shift, :M
209
+
210
+ on_widget_selected {
211
+ message_box {
212
+ text 'Manual'
213
+ message 'Manual Contents'
214
+ }.open
215
+ }
216
+ }
217
+ menu_item {
218
+ text '&Tutorial'
219
+ accelerator :command, :shift, :T
220
+
221
+ on_widget_selected {
222
+ message_box {
223
+ text 'Tutorial'
224
+ message 'Tutorial Contents'
225
+ }.open
226
+ }
227
+ }
228
+ menu_item(:separator)
229
+ menu_item {
230
+ text '&Report an Issue...'
231
+
232
+ on_widget_selected {
233
+ message_box {
234
+ text 'Report an Issue'
235
+ message 'Reporting an issue...'
236
+ }.open
237
+ }
238
+ }
83
239
  }
84
240
  }
85
241
  }.open
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2020 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
@@ -21,16 +21,17 @@
21
21
 
22
22
  include Glimmer
23
23
 
24
- @shell = shell {
24
+ shell {
25
25
  text 'Hello, Message Box!'
26
+
26
27
  button {
27
28
  text 'Please Click To Win a Surprise'
29
+
28
30
  on_widget_selected {
29
- message_box(@shell) {
31
+ message_box {
30
32
  text 'Surprise'
31
- message "Congratulations!\n\nYou have won $1,000,000!"
33
+ message "Congratulations!\n\nYou won $1,000,000!"
32
34
  }.open
33
35
  }
34
36
  }
35
- }
36
- @shell.open
37
+ }.open
@@ -21,12 +21,18 @@
21
21
 
22
22
  include Glimmer
23
23
 
24
- shell { |shell_proxy|
24
+ shell {
25
+ grid_layout {
26
+ margin_width 0
27
+ margin_height 0
28
+ }
29
+
25
30
  text 'Hello, Pop Up Context Menu!'
26
- grid_layout
31
+
27
32
  label {
28
- font height: 16
29
- text 'Right-Click To Pop Up a Context Menu'
33
+ text "Right-Click on the Text to\nPop Up a Context Menu"
34
+ font height: 50
35
+
30
36
  menu {
31
37
  menu {
32
38
  text '&History'
@@ -35,7 +41,7 @@ shell { |shell_proxy|
35
41
  menu_item {
36
42
  text 'File 1'
37
43
  on_widget_selected {
38
- message_box(shell_proxy) {
44
+ message_box {
39
45
  text 'File 1'
40
46
  message 'File 1 Contents'
41
47
  }.open
@@ -44,13 +50,34 @@ shell { |shell_proxy|
44
50
  menu_item {
45
51
  text 'File 2'
46
52
  on_widget_selected {
47
- message_box(shell_proxy) {
53
+ message_box {
48
54
  text 'File 2'
49
55
  message 'File 2 Contents'
50
56
  }.open
51
57
  }
52
58
  }
53
59
  }
60
+ menu {
61
+ text '&Archived'
62
+ menu_item {
63
+ text 'File 3'
64
+ on_widget_selected {
65
+ message_box {
66
+ text 'File 3'
67
+ message 'File 3 Contents'
68
+ }.open
69
+ }
70
+ }
71
+ menu_item {
72
+ text 'File 4'
73
+ on_widget_selected {
74
+ message_box {
75
+ text 'File 4'
76
+ message 'File 4 Contents'
77
+ }.open
78
+ }
79
+ }
80
+ }
54
81
  }
55
82
  }
56
83
  }
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,71 +1,89 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.17.10.4
4
+ version: 4.18.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-02 00:00:00.000000000 Z
11
+ date: 2020-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 1.0.5
18
+ version: 1.0.6
19
19
  name: glimmer
20
- prerelease: false
21
20
  type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.5
26
+ version: 1.0.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - "~>"
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.4.1
33
+ - - "<"
34
+ - !ruby/object:Gem::Version
35
+ version: 2.0.0
33
36
  name: super_module
34
- prerelease: false
35
37
  type: :runtime
38
+ prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: 1.4.1
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: 2.0.0
41
47
  - !ruby/object:Gem::Dependency
42
48
  requirement: !ruby/object:Gem::Requirement
43
49
  requirements:
44
- - - "~>"
50
+ - - ">="
45
51
  - !ruby/object:Gem::Version
46
52
  version: 0.3.0
53
+ - - "<"
54
+ - !ruby/object:Gem::Version
55
+ version: 2.0.0
47
56
  name: nested_inherited_jruby_include_package
48
- prerelease: false
49
57
  type: :runtime
58
+ prerelease: false
50
59
  version_requirements: !ruby/object:Gem::Requirement
51
60
  requirements:
52
- - - "~>"
61
+ - - ">="
53
62
  - !ruby/object:Gem::Version
54
63
  version: 0.3.0
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: 2.0.0
55
67
  - !ruby/object:Gem::Dependency
56
68
  requirement: !ruby/object:Gem::Requirement
57
69
  requirements:
58
- - - "~>"
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 0.11.0
73
+ - - "<"
59
74
  - !ruby/object:Gem::Version
60
- version: 0.10.2
75
+ version: 2.0.0
61
76
  name: puts_debuggerer
62
- prerelease: false
63
77
  type: :runtime
78
+ prerelease: false
64
79
  version_requirements: !ruby/object:Gem::Requirement
65
80
  requirements:
66
- - - "~>"
81
+ - - ">="
67
82
  - !ruby/object:Gem::Version
68
- version: 0.10.2
83
+ version: 0.11.0
84
+ - - "<"
85
+ - !ruby/object:Gem::Version
86
+ version: 2.0.0
69
87
  - !ruby/object:Gem::Dependency
70
88
  requirement: !ruby/object:Gem::Requirement
71
89
  requirements:
@@ -76,8 +94,8 @@ dependencies:
76
94
  - !ruby/object:Gem::Version
77
95
  version: 2.0.0
78
96
  name: rake-tui
79
- prerelease: false
80
97
  type: :runtime
98
+ prerelease: false
81
99
  version_requirements: !ruby/object:Gem::Requirement
82
100
  requirements:
83
101
  - - ">="
@@ -93,8 +111,8 @@ dependencies:
93
111
  - !ruby/object:Gem::Version
94
112
  version: 1.7.0
95
113
  name: git-glimmer
96
- prerelease: false
97
114
  type: :runtime
115
+ prerelease: false
98
116
  version_requirements: !ruby/object:Gem::Requirement
99
117
  requirements:
100
118
  - - '='
@@ -110,8 +128,8 @@ dependencies:
110
128
  - !ruby/object:Gem::Version
111
129
  version: 3.0.0
112
130
  name: logging
113
- prerelease: false
114
131
  type: :runtime
132
+ prerelease: false
115
133
  version_requirements: !ruby/object:Gem::Requirement
116
134
  requirements:
117
135
  - - ">="
@@ -130,8 +148,8 @@ dependencies:
130
148
  - !ruby/object:Gem::Version
131
149
  version: 2.0.0
132
150
  name: os
133
- prerelease: false
134
151
  type: :runtime
152
+ prerelease: false
135
153
  version_requirements: !ruby/object:Gem::Requirement
136
154
  requirements:
137
155
  - - ">="
@@ -150,8 +168,8 @@ dependencies:
150
168
  - !ruby/object:Gem::Version
151
169
  version: 14.0.0
152
170
  name: rake
153
- prerelease: false
154
171
  type: :runtime
172
+ prerelease: false
155
173
  version_requirements: !ruby/object:Gem::Requirement
156
174
  requirements:
157
175
  - - ">="
@@ -170,8 +188,8 @@ dependencies:
170
188
  - !ruby/object:Gem::Version
171
189
  version: 2.0.0
172
190
  name: text-table
173
- prerelease: false
174
191
  type: :runtime
192
+ prerelease: false
175
193
  version_requirements: !ruby/object:Gem::Requirement
176
194
  requirements:
177
195
  - - ">="
@@ -185,18 +203,18 @@ dependencies:
185
203
  requirements:
186
204
  - - ">="
187
205
  - !ruby/object:Gem::Version
188
- version: 3.25.0
206
+ version: 3.26.0
189
207
  - - "<"
190
208
  - !ruby/object:Gem::Version
191
209
  version: 4.0.0
192
210
  name: rouge
193
- prerelease: false
194
211
  type: :runtime
212
+ prerelease: false
195
213
  version_requirements: !ruby/object:Gem::Requirement
196
214
  requirements:
197
215
  - - ">="
198
216
  - !ruby/object:Gem::Version
199
- version: 3.25.0
217
+ version: 3.26.0
200
218
  - - "<"
201
219
  - !ruby/object:Gem::Version
202
220
  version: 4.0.0
@@ -210,8 +228,8 @@ dependencies:
210
228
  - !ruby/object:Gem::Version
211
229
  version: 3.0.0
212
230
  name: juwelier
213
- prerelease: false
214
231
  type: :development
232
+ prerelease: false
215
233
  version_requirements: !ruby/object:Gem::Requirement
216
234
  requirements:
217
235
  - - ">="
@@ -230,8 +248,8 @@ dependencies:
230
248
  - !ruby/object:Gem::Version
231
249
  version: 3.0.0
232
250
  name: warbler
233
- prerelease: false
234
251
  type: :development
252
+ prerelease: false
235
253
  version_requirements: !ruby/object:Gem::Requirement
236
254
  requirements:
237
255
  - - ">="
@@ -247,8 +265,8 @@ dependencies:
247
265
  - !ruby/object:Gem::Version
248
266
  version: 3.5.0
249
267
  name: rspec-mocks
250
- prerelease: false
251
268
  type: :development
269
+ prerelease: false
252
270
  version_requirements: !ruby/object:Gem::Requirement
253
271
  requirements:
254
272
  - - "~>"
@@ -261,8 +279,8 @@ dependencies:
261
279
  - !ruby/object:Gem::Version
262
280
  version: 3.5.0
263
281
  name: rspec
264
- prerelease: false
265
282
  type: :development
283
+ prerelease: false
266
284
  version_requirements: !ruby/object:Gem::Requirement
267
285
  requirements:
268
286
  - - "~>"
@@ -275,8 +293,8 @@ dependencies:
275
293
  - !ruby/object:Gem::Version
276
294
  version: 0.8.23
277
295
  name: coveralls
278
- prerelease: false
279
296
  type: :development
297
+ prerelease: false
280
298
  version_requirements: !ruby/object:Gem::Requirement
281
299
  requirements:
282
300
  - - '='
@@ -289,8 +307,8 @@ dependencies:
289
307
  - !ruby/object:Gem::Version
290
308
  version: 0.16.1
291
309
  name: simplecov
292
- prerelease: false
293
310
  type: :development
311
+ prerelease: false
294
312
  version_requirements: !ruby/object:Gem::Requirement
295
313
  requirements:
296
314
  - - "~>"
@@ -303,14 +321,14 @@ dependencies:
303
321
  - !ruby/object:Gem::Version
304
322
  version: 0.7.0
305
323
  name: simplecov-lcov
306
- prerelease: false
307
324
  type: :development
325
+ prerelease: false
308
326
  version_requirements: !ruby/object:Gem::Requirement
309
327
  requirements:
310
328
  - - "~>"
311
329
  - !ruby/object:Gem::Version
312
330
  version: 0.7.0
313
- description: Glimmer DSL for SWT (JRuby Desktop Development GUI Library)
331
+ description: Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
314
332
  email: andy.am@gmail.com
315
333
  executables:
316
334
  - glimmer
@@ -431,6 +449,7 @@ files:
431
449
  - samples/elaborate/tic_tac_toe/cell.rb
432
450
  - samples/elaborate/user_profile.rb
433
451
  - samples/hello/hello_browser.rb
452
+ - samples/hello/hello_button.rb
434
453
  - samples/hello/hello_checkbox.rb
435
454
  - samples/hello/hello_checkbox_group.rb
436
455
  - samples/hello/hello_combo.rb
@@ -444,6 +463,7 @@ files:
444
463
  - samples/hello/hello_expand_bar.rb
445
464
  - samples/hello/hello_file_dialog.rb
446
465
  - samples/hello/hello_group.rb
466
+ - samples/hello/hello_link.rb
447
467
  - samples/hello/hello_list_multi_selection.rb
448
468
  - samples/hello/hello_list_single_selection.rb
449
469
  - samples/hello/hello_menu_bar.rb
@@ -479,7 +499,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
479
499
  - !ruby/object:Gem::Version
480
500
  version: '0'
481
501
  requirements: []
482
- rubygems_version: 3.1.4
502
+ rubygems_version: 3.0.6
483
503
  signing_key:
484
504
  specification_version: 4
485
505
  summary: Glimmer DSL for SWT