glimmer-dsl-swt 4.17.10.3 → 4.17.10.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,9 @@
22
22
  include Glimmer
23
23
 
24
24
  shell {
25
+ text 'Hello, Browser!'
25
26
  minimum_size 1024, 860
27
+
26
28
  browser {
27
29
  url 'https://brightonresort.com/about'
28
30
  }
@@ -0,0 +1,46 @@
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 HelloButton
23
+ include Glimmer
24
+
25
+ attr_accessor :count
26
+
27
+ def initialize
28
+ @count = 0
29
+ end
30
+
31
+ def launch
32
+ shell {
33
+ text 'Hello, Button!'
34
+
35
+ button {
36
+ text bind(self, :count) {|value| "Click To Increment: #{value} "}
37
+
38
+ on_widget_selected {
39
+ self.count += 1
40
+ }
41
+ }
42
+ }.open
43
+ end
44
+ end
45
+
46
+ HelloButton.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
@@ -35,6 +35,7 @@ class HelloComputed
35
35
  def launch
36
36
  shell {
37
37
  text 'Hello, Computed!'
38
+
38
39
  composite {
39
40
  grid_layout {
40
41
  num_columns 2
@@ -42,6 +43,7 @@ class HelloComputed
42
43
  horizontal_spacing 20
43
44
  vertical_spacing 10
44
45
  }
46
+
45
47
  label {text 'First &Name: '}
46
48
  text {
47
49
  text bind(@contact, :first_name)
@@ -50,6 +52,7 @@ class HelloComputed
50
52
  grab_excess_horizontal_space true
51
53
  }
52
54
  }
55
+
53
56
  label {text '&Last Name: '}
54
57
  text {
55
58
  text bind(@contact, :last_name)
@@ -58,6 +61,7 @@ class HelloComputed
58
61
  grab_excess_horizontal_space true
59
62
  }
60
63
  }
64
+
61
65
  label {text '&Year of Birth: '}
62
66
  text {
63
67
  text bind(@contact, :year_of_birth)
@@ -66,6 +70,7 @@ class HelloComputed
66
70
  grab_excess_horizontal_space true
67
71
  }
68
72
  }
73
+
69
74
  label {text 'Name: '}
70
75
  label {
71
76
  text bind(@contact, :name, computed_by: [:first_name, :last_name])
@@ -74,6 +79,7 @@ class HelloComputed
74
79
  grab_excess_horizontal_space true
75
80
  }
76
81
  }
82
+
77
83
  label {text 'Age: '}
78
84
  label {
79
85
  text bind(@contact, :age, on_write: :to_i, computed_by: [:year_of_birth])
@@ -0,0 +1,80 @@
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
+ include Glimmer
23
+
24
+ shell { |main_shell|
25
+ grid_layout {
26
+ margin_width 20
27
+ margin_height 10
28
+ }
29
+
30
+ background :white
31
+ text 'Hello, Link!'
32
+
33
+ @link = link {
34
+ background :white
35
+ link_foreground :dark_green
36
+ font height: 16
37
+ text <<~MULTI_LINE_STRING
38
+
39
+ You may click on any <a>link</a> to get help.
40
+
41
+ How do you know <a href="which-link-href-value">which link</a> you clicked?
42
+
43
+ Just keep clicking <a href="all links">links</a> to find out!
44
+ MULTI_LINE_STRING
45
+
46
+ on_widget_selected { |selection_event|
47
+ # This retrieves the clicked link href (or contained text if no href is set)
48
+ @selected_link = selection_event.text
49
+ }
50
+ on_mouse_up { |mouse_event|
51
+ unless @selected_link.nil?
52
+ @help_shell.close unless @help_shell.nil? || @help_shell.is_disposed
53
+ @help_shell = shell(:no_trim) {
54
+ grid_layout {
55
+ margin_width 10
56
+ margin_height 10
57
+ }
58
+
59
+ background :yellow
60
+
61
+ label {
62
+ background :yellow
63
+ text "Did someone ask for help about \"#{@selected_link}\"?\nYou don't really need help. You did it!"
64
+ }
65
+
66
+ on_swt_show {
67
+ x = main_shell.location.x + @link.location.x + mouse_event.x
68
+ y = main_shell.location.y + @link.location.y + mouse_event.y + 20
69
+ @help_shell.location = Point.new(x, y)
70
+ }
71
+ on_focus_lost {
72
+ @selected_link = nil
73
+ @help_shell.close
74
+ }
75
+ }
76
+ @help_shell.open
77
+ end
78
+ }
79
+ }
80
+ }.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
@@ -24,22 +24,27 @@ class HelloListMultiSelection
24
24
  attr_accessor :provinces, :provinces_options
25
25
 
26
26
  def initialize
27
- self.provinces_options=[
28
- "",
29
- "Quebec",
30
- "Ontario",
31
- "Manitoba",
32
- "Saskatchewan",
33
- "Alberta",
34
- "British Columbia",
35
- "Nova Skotia",
36
- "Newfoundland"
27
+ self.provinces_options = [
28
+ '',
29
+ 'Alberta',
30
+ 'British Columbia',
31
+ 'Manitoba',
32
+ 'New Brunswick',
33
+ 'Newfoundland and Labrador',
34
+ 'Northwest Territories',
35
+ 'Nova Scotia',
36
+ 'Nunavut',
37
+ 'Ontario',
38
+ 'Prince Edward Island',
39
+ 'Quebec',
40
+ 'Saskatchewan',
41
+ 'Yukon'
37
42
  ]
38
- self.provinces = ["Quebec", "Manitoba", "Alberta"]
43
+ reset_provinces
39
44
  end
40
45
 
41
46
  def reset_provinces
42
- self.provinces = ["Quebec", "Manitoba", "Alberta"]
47
+ self.provinces = ['Quebec', 'Manitoba', 'Alberta']
43
48
  end
44
49
  end
45
50
 
@@ -49,7 +54,7 @@ class HelloListMultiSelection
49
54
  person = Person.new
50
55
 
51
56
  shell {
52
- grid_layout
57
+ grid_layout
53
58
 
54
59
  text 'Hello, List Multi Selection!'
55
60
 
@@ -58,7 +63,7 @@ class HelloListMultiSelection
58
63
  }
59
64
 
60
65
  button {
61
- text "Reset Selection To Defaults"
66
+ text 'Reset Selections To Default Values'
62
67
 
63
68
  on_widget_selected { person.reset_provinces }
64
69
  }
@@ -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
@@ -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
  }
@@ -100,10 +100,6 @@ class HelloTable
100
100
  def schedule=(new_schedule)
101
101
  @schedule = new_schedule
102
102
  end
103
-
104
- def selected_game=(new_game)
105
- @selected_game = new_game
106
- end
107
103
  end
108
104
 
109
105
  include Glimmer
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.17.10.3
4
+ version: 4.17.10.8
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-24 00:00:00.000000000 Z
11
+ date: 2020-12-17 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.4
18
+ version: 1.0.6
19
19
  name: glimmer
20
20
  prerelease: false
21
21
  type: :runtime
@@ -23,49 +23,67 @@ dependencies:
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.4
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
37
  prerelease: false
35
38
  type: :runtime
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
57
  prerelease: false
49
58
  type: :runtime
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
+ - - ">="
59
71
  - !ruby/object:Gem::Version
60
- version: 0.10.2
72
+ version: 0.11.0
73
+ - - "<"
74
+ - !ruby/object:Gem::Version
75
+ version: 2.0.0
61
76
  name: puts_debuggerer
62
77
  prerelease: false
63
78
  type: :runtime
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:
@@ -185,7 +203,7 @@ 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
@@ -196,7 +214,7 @@ dependencies:
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
@@ -310,7 +328,7 @@ dependencies:
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