glimmer-dsl-swt 4.17.8.1 → 4.17.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfdd8588cde714f33759f86c2141471c31271fa89e2cf859faabd160117f4b0a
4
- data.tar.gz: 20bd807fc37fa19ef0c2fd37d8c1f84af6119258084a5167fbb6758cd3d69a39
3
+ metadata.gz: 517e5bcedc06e71150e504d4c8ad484adb383e839df9b09e9683d9ebcce72ce8
4
+ data.tar.gz: b9792dd4d60cdb642b187848f9cc07d2d33c5bb1801bf2cb961a59f1247d9713
5
5
  SHA512:
6
- metadata.gz: c74a0ef3615ee39a387505afe13e5fddecb49ff1ec9fc46384ddd19323f58116f30239efe66a0ec49774aa1d7a8b880173609169dd3052b62798d34c5015657b
7
- data.tar.gz: 138dd0a89bf23c998a590c10f81ff2f463ebefe307361bfcade21b6681d40c8869e495fde66cc72e66d6ed0051c5dccf61eacc76c7853d6f4d737dea7c9044ee
6
+ metadata.gz: 74eae56731cba0eba1092b9a926cd995cc23190b78126436d5dff8454dc0b0a75e5a70ecc4c5a864d3580bb8f2ad4d003a3ef18bba4d7bb5b0a4f4a44eb5afe3
7
+ data.tar.gz: 41b95e7e364eab995e026fec0c442162fefa138b504a48a95ba0e93f39e460b676e635a64228a8c51559ea4c0468afa09695fa1be63f375d6788c7914c6609fc
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.17.8.1
1
+ # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.17.8.2
2
2
  ## JRuby Desktop Development GUI Library
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
4
4
  [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
@@ -349,6 +349,7 @@ Glimmer App:
349
349
  - [Hello, Expand Bar!](#hello-expand-bar)
350
350
  - [Hello, Radio!](#hello-radio)
351
351
  - [Hello, Radio Group!](#hello-radio-group)
352
+ - [Hello, Group!](#hello-group)
352
353
  - [Hello, Checkbox!](#hello-checkbox)
353
354
  - [Hello, Checkbox Group!](#hello-checkbox-group)
354
355
  - [Hello, Directory Dialog!](#hello-directory-dialog)
@@ -446,7 +447,7 @@ jgem install glimmer-dsl-swt
446
447
 
447
448
  Or this command if you want a specific version:
448
449
  ```
449
- jgem install glimmer-dsl-swt -v 4.17.8.1
450
+ jgem install glimmer-dsl-swt -v 4.17.8.2
450
451
  ```
451
452
 
452
453
  `jgem` is JRuby's version of `gem` command.
@@ -522,7 +523,7 @@ bin/glimmer samples
522
523
  Below are the full usage instructions that come up when running `glimmer` without args.
523
524
 
524
525
  ```
525
- Glimmer (Ruby Desktop Development GUI Library) - JRuby Gem: glimmer-dsl-swt v4.17.8.1
526
+ Glimmer (Ruby Desktop Development GUI Library) - JRuby Gem: glimmer-dsl-swt v4.17.8.2
526
527
 
527
528
  Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
528
529
 
@@ -999,7 +1000,7 @@ Output:
999
1000
 
1000
1001
  Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
1001
1002
  Opal glimmer-dsl-opal 0.4.0 AndyMaleh Glimmer DSL for Opal
1002
- Swt glimmer-dsl-swt 4.17.8.1 AndyMaleh Glimmer DSL for SWT
1003
+ Swt glimmer-dsl-swt 4.17.8.2 AndyMaleh Glimmer DSL for SWT
1003
1004
  Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
1004
1005
  Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
1005
1006
  ```
@@ -3732,6 +3733,26 @@ Code:
3732
3733
 
3733
3734
  [samples/hello/hello_checkbox.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_checkbox.rb)
3734
3735
 
3736
+ #### Hello, Group!
3737
+
3738
+ This sample demonstrates the use of a `group` in Glimmer (not to be confused with the logical radio group custom widget, this is just an alternative to `composite` that provides a border around content).
3739
+
3740
+ Code:
3741
+
3742
+ [samples/hello/hello_group.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_group.rb)
3743
+
3744
+ Hello, Group!
3745
+
3746
+ ![Hello Group](images/glimmer-hello-group.png)
3747
+
3748
+ #### Hello, Checkbox!
3749
+
3750
+ This sample demonstrates the use of a `checkbox` (aka `check` or `button(:check)`) in Glimmer.
3751
+
3752
+ Code:
3753
+
3754
+ [samples/hello/hello_checkbox.rb](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_checkbox.rb)
3755
+
3735
3756
  Hello, Checkbox!
3736
3757
 
3737
3758
  ![Hello Checkbox](images/glimmer-hello-checkbox.png)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.17.8.1
1
+ 4.17.8.2
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: glimmer-dsl-swt 4.17.8.1 ruby lib
5
+ # stub: glimmer-dsl-swt 4.17.8.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer-dsl-swt".freeze
9
- s.version = "4.17.8.1"
9
+ s.version = "4.17.8.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["AndyMaleh".freeze]
14
- s.date = "2020-11-01"
14
+ s.date = "2020-11-03"
15
15
  s.description = "Glimmer DSL for SWT (JRuby Desktop Development GUI Library)".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["glimmer".freeze, "girb".freeze]
@@ -141,6 +141,7 @@ Gem::Specification.new do |s|
141
141
  "samples/hello/hello_drag_and_drop.rb",
142
142
  "samples/hello/hello_expand_bar.rb",
143
143
  "samples/hello/hello_file_dialog.rb",
144
+ "samples/hello/hello_group.rb",
144
145
  "samples/hello/hello_list_multi_selection.rb",
145
146
  "samples/hello/hello_list_single_selection.rb",
146
147
  "samples/hello/hello_menu_bar.rb",
@@ -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
@@ -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
@@ -1,9 +1,30 @@
1
+ # Copyright (c) 2007-2020 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
+
1
22
  require 'glimmer/ui/custom_widget'
2
23
 
3
24
  module Glimmer
4
25
  module SWT
5
26
  module Custom
6
- # CodeText is a customization of StyledText with support for Ruby Syntax Highlighting
27
+ # A custom widget rendering a group of checkboxes generated via data-binding
7
28
  class CheckboxGroup
8
29
  include Glimmer::UI::CustomWidget
9
30
 
@@ -71,7 +92,7 @@ module Glimmer
71
92
  if observation_request != 'on_widget_disposed'
72
93
  checkboxes.count.times do |index|
73
94
  checkbox = checkboxes[index]
74
- label = labels[index]
95
+ label = labels[index]
75
96
  listener_block = lambda do |event|
76
97
  event.widget = self.swt_widget
77
98
  block.call(event)
@@ -81,7 +102,7 @@ module Glimmer
81
102
  label.handle_observation_request('on_mouse_up', &listener_block)
82
103
  else
83
104
  checkbox.handle_observation_request(observation_request, &listener_block) if checkbox.can_handle_observation_request?(observation_request)
84
- label.handle_observation_request(observation_request, &listener_block) if label.can_handle_observation_request?(observation_request)
105
+ label.handle_observation_request(observation_request, &listener_block) if label.can_handle_observation_request?(observation_request)
85
106
  end
86
107
  end
87
108
  end
@@ -93,7 +114,7 @@ module Glimmer
93
114
 
94
115
  def has_attribute?(attribute_name, *args)
95
116
  (@composites.to_a + @checkboxes.to_a + @labels.to_a).map do |widget_proxy|
96
- return true if widget_proxy.has_attribute?(attribute_name, *args)
117
+ return true if widget_proxy.has_attribute?(attribute_name, *args)
97
118
  end
98
119
  super
99
120
  end
@@ -124,16 +145,16 @@ module Glimmer
124
145
  margin_height 0
125
146
  horizontal_spacing 0
126
147
  vertical_spacing 0
127
- }
148
+ }
128
149
  checkboxes << checkbox { |checkbox_proxy|
129
- on_widget_selected {
150
+ on_widget_selected {
130
151
  self.selection_indices = checkboxes.each_with_index.map {|cb, i| i if cb.selection}.to_a.compact
131
152
  }
132
153
  }
133
154
  labels << label { |label_proxy|
134
155
  layout_data :fill, :center, true, false
135
156
  text item
136
- on_mouse_up { |event|
157
+ on_mouse_up { |event|
137
158
  found_text = labels.each_with_index.detect {|l, i| event.widget == l.swt_widget}[0]&.text
138
159
  selection_values = self.selection
139
160
  if selection_values.include?(found_text)
@@ -148,7 +169,7 @@ module Glimmer
148
169
  }
149
170
  end
150
171
  observation_requests.to_a.each do |observation_request, block|
151
- delegate_observation_request_to_checkboxes(observation_request, &block)
172
+ delegate_observation_request_to_checkboxes(observation_request, &block)
152
173
  end
153
174
  self.selection = current_selection
154
175
  end
@@ -1,9 +1,30 @@
1
+ # Copyright (c) 2007-2020 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
+
1
22
  require 'glimmer/ui/custom_widget'
2
23
 
3
24
  module Glimmer
4
25
  module SWT
5
26
  module Custom
6
- # CodeText is a customization of StyledText with support for Ruby Syntax Highlighting
27
+ # A custom widget rendering a group of radios generated via data-binding
7
28
  class RadioGroup
8
29
  include Glimmer::UI::CustomWidget
9
30
 
@@ -65,7 +86,7 @@ module Glimmer
65
86
  if observation_request != 'on_widget_disposed'
66
87
  radios.count.times do |index|
67
88
  radio = radios[index]
68
- label = labels[index]
89
+ label = labels[index]
69
90
  if observation_request == 'on_widget_selected'
70
91
  radio_block = lambda do |event|
71
92
  if event.widget.selection || selection_index == -1
@@ -76,7 +97,7 @@ module Glimmer
76
97
  label_block = lambda do |event|
77
98
  self.selection_index = index
78
99
  block.call(event)
79
- end
100
+ end
80
101
  radio.handle_observation_request(observation_request, &radio_block) if radio.can_handle_observation_request?(observation_request)
81
102
  label.handle_observation_request('on_mouse_up', &label_block)
82
103
  else
@@ -85,7 +106,7 @@ module Glimmer
85
106
  block.call(event)
86
107
  end
87
108
  radio.handle_observation_request(observation_request, &listener_block) if radio.can_handle_observation_request?(observation_request)
88
- label.handle_observation_request(observation_request, &listener_block) if label.can_handle_observation_request?(observation_request)
109
+ label.handle_observation_request(observation_request, &listener_block) if label.can_handle_observation_request?(observation_request)
89
110
  end
90
111
  end
91
112
  end
@@ -97,7 +118,7 @@ module Glimmer
97
118
 
98
119
  def has_attribute?(attribute_name, *args)
99
120
  (@composites.to_a + @radios.to_a + @labels.to_a).map do |widget_proxy|
100
- return true if widget_proxy.has_attribute?(attribute_name, *args)
121
+ return true if widget_proxy.has_attribute?(attribute_name, *args)
101
122
  end
102
123
  super
103
124
  end
@@ -145,7 +166,7 @@ module Glimmer
145
166
  }
146
167
  end
147
168
  observation_requests.to_a.each do |observation_request, block|
148
- delegate_observation_request_to_radios(observation_request, &block)
169
+ delegate_observation_request_to_radios(observation_request, &block)
149
170
  end
150
171
  self.selection = current_selection
151
172
  end
@@ -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
@@ -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
@@ -41,7 +41,7 @@ class HelloCheckbox
41
41
  person = Person.new
42
42
 
43
43
  shell {
44
- text 'Hello, Checkbox!'
44
+ text 'Hello, Checkbox!'
45
45
  row_layout :vertical
46
46
 
47
47
  label {
@@ -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
@@ -0,0 +1,104 @@
1
+ # Copyright (c) 2007-2020 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 HelloGroup
23
+ class Person
24
+ attr_accessor :male, :female, :child, :teen, :adult, :senior
25
+
26
+ def initialize
27
+ reset
28
+ end
29
+
30
+ def reset
31
+ self.male = nil
32
+ self.female = nil
33
+ self.child = nil
34
+ self.teen = nil
35
+ self.adult = true
36
+ self.senior = nil
37
+ end
38
+ end
39
+
40
+ include Glimmer
41
+
42
+ def launch
43
+ person = Person.new
44
+
45
+ shell {
46
+ text 'Hello, Radio!'
47
+ row_layout :vertical
48
+
49
+ group {
50
+ row_layout
51
+
52
+ text 'Gender'
53
+ font style: :bold
54
+
55
+ radio {
56
+ text 'Male'
57
+ selection bind(person, :male)
58
+ }
59
+
60
+ radio {
61
+ text 'Female'
62
+ selection bind(person, :female)
63
+ }
64
+ }
65
+
66
+ group {
67
+ row_layout
68
+
69
+ text 'Age Group'
70
+ font style: :bold
71
+
72
+ radio {
73
+ text 'Child'
74
+ selection bind(person, :child)
75
+ }
76
+
77
+ radio {
78
+ text 'Teen'
79
+ selection bind(person, :teen)
80
+ }
81
+
82
+ radio {
83
+ text 'Adult'
84
+ selection bind(person, :adult)
85
+ }
86
+
87
+ radio {
88
+ text 'Senior'
89
+ selection bind(person, :senior)
90
+ }
91
+ }
92
+
93
+ button {
94
+ text 'Reset'
95
+
96
+ on_widget_selected do
97
+ person.reset
98
+ end
99
+ }
100
+ }.open
101
+ end
102
+ end
103
+
104
+ HelloGroup.new.launch
@@ -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
@@ -19,7 +19,7 @@
19
19
  # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
20
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
- class HelloRadio
22
+ class HelloRadio
23
23
  class Person
24
24
  attr_accessor :male, :female, :child, :teen, :adult, :senior
25
25
 
@@ -37,13 +37,13 @@ class HelloRadio
37
37
  end
38
38
  end
39
39
 
40
- include Glimmer
40
+ include Glimmer
41
41
 
42
42
  def launch
43
43
  person = Person.new
44
44
 
45
45
  shell {
46
- text 'Hello, Radio!'
46
+ text 'Hello, Radio!'
47
47
  row_layout :vertical
48
48
 
49
49
  label {
@@ -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
@@ -32,7 +32,7 @@ class HelloRadioGroup
32
32
  end
33
33
 
34
34
  def age_group_options
35
- ['Child', 'Teen', 'Adult', 'Senior']
35
+ ['Child', 'Teen', 'Adult', 'Senior']
36
36
  end
37
37
 
38
38
  def reset
@@ -47,8 +47,8 @@ class HelloRadioGroup
47
47
  person = Person.new
48
48
 
49
49
  shell {
50
- text 'Hello, Radio Group!'
51
- row_layout :vertical
50
+ text 'Hello, Radio Group!'
51
+ row_layout :vertical
52
52
 
53
53
  label {
54
54
  text 'Gender:'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.17.8.1
4
+ version: 4.17.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-01 00:00:00.000000000 Z
11
+ date: 2020-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -441,6 +441,7 @@ files:
441
441
  - samples/hello/hello_drag_and_drop.rb
442
442
  - samples/hello/hello_expand_bar.rb
443
443
  - samples/hello/hello_file_dialog.rb
444
+ - samples/hello/hello_group.rb
444
445
  - samples/hello/hello_list_multi_selection.rb
445
446
  - samples/hello/hello_list_single_selection.rb
446
447
  - samples/hello/hello_menu_bar.rb