glimmer-dsl-swt 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,29 @@
1
+ class Location
2
+ attr_accessor :country
3
+
4
+ def country_options
5
+ %w[USA Canada Mexico Columbia UK Australia Germany Italy Spain]
6
+ end
7
+ end
8
+
9
+ @location = Location.new
10
+
11
+ include Glimmer
12
+
13
+ shell {
14
+ text 'Hello, Drag and Drop!'
15
+ list {
16
+ selection bind(@location, :country)
17
+ on_drag_set_data { |event|
18
+ list = event.widget.getControl
19
+ event.data = list.getSelection.first
20
+ }
21
+ }
22
+ label(:center) {
23
+ text 'Drag a country here!'
24
+ font height: 20
25
+ on_drop { |event|
26
+ event.widget.getControl.setText(event.data)
27
+ }
28
+ }
29
+ }.open
@@ -0,0 +1,48 @@
1
+ class Person
2
+ attr_accessor :provinces, :provinces_options
3
+
4
+ def initialize
5
+ self.provinces_options=[
6
+ "",
7
+ "Quebec",
8
+ "Ontario",
9
+ "Manitoba",
10
+ "Saskatchewan",
11
+ "Alberta",
12
+ "British Columbia",
13
+ "Nova Skotia",
14
+ "Newfoundland"
15
+ ]
16
+ self.provinces = ["Quebec", "Manitoba", "Alberta"]
17
+ end
18
+
19
+ def reset_provinces
20
+ self.provinces = ["Quebec", "Manitoba", "Alberta"]
21
+ end
22
+ end
23
+
24
+ class HelloListMultiSelection
25
+ include Glimmer
26
+
27
+ def launch
28
+ person = Person.new
29
+
30
+ shell {
31
+ grid_layout
32
+
33
+ text 'Hello, List Multi Selection!'
34
+
35
+ list(:multi) {
36
+ selection bind(person, :provinces)
37
+ }
38
+
39
+ button {
40
+ text "Reset Selection To Defaults"
41
+
42
+ on_widget_selected { person.reset_provinces }
43
+ }
44
+ }.open
45
+ end
46
+ end
47
+
48
+ HelloListMultiSelection.new.launch
@@ -0,0 +1,37 @@
1
+ class Person
2
+ attr_accessor :country, :country_options
3
+
4
+ def initialize
5
+ self.country_options=["", "Canada", "US", "Mexico"]
6
+ self.country = "Canada"
7
+ end
8
+
9
+ def reset_country
10
+ self.country = "Canada"
11
+ end
12
+ end
13
+
14
+ class HelloListSingleSelection
15
+ include Glimmer
16
+ def launch
17
+ person = Person.new
18
+
19
+ shell {
20
+ grid_layout
21
+
22
+ text 'Hello, List Single Selection!'
23
+
24
+ list {
25
+ selection bind(person, :country)
26
+ }
27
+
28
+ button {
29
+ text "Reset Selection To Default Value"
30
+
31
+ on_widget_selected { person.reset_country }
32
+ }
33
+ }.open
34
+ end
35
+ end
36
+
37
+ HelloListSingleSelection.new.launch
@@ -0,0 +1,64 @@
1
+ include Glimmer
2
+
3
+ shell { |shell_proxy|
4
+ text 'Hello, Menu Bar!'
5
+ grid_layout
6
+ label(:center) {
7
+ font height: 16
8
+ text 'Check Out The File Menu and History Menu in The Menu Bar Above!'
9
+ }
10
+ menu_bar {
11
+ menu {
12
+ text '&File'
13
+ menu_item {
14
+ text 'E&xit'
15
+ on_widget_selected {
16
+ exit(0)
17
+ }
18
+ }
19
+ menu_item(0) {
20
+ text '&New'
21
+ on_widget_selected {
22
+ message_box(shell_proxy) {
23
+ text 'New File'
24
+ message 'New File Contents'
25
+ }.open
26
+ }
27
+ }
28
+ menu(1) {
29
+ text '&Options'
30
+ menu_item(:radio) {
31
+ text 'Option 1'
32
+ }
33
+ menu_item(:separator)
34
+ menu_item(:check) {
35
+ text 'Option 3'
36
+ }
37
+ }
38
+ }
39
+ menu {
40
+ text '&History'
41
+ menu {
42
+ text '&Recent'
43
+ menu_item {
44
+ text 'File 1'
45
+ on_widget_selected {
46
+ message_box(shell_proxy) {
47
+ text 'File 1'
48
+ message 'File 1 Contents'
49
+ }.open
50
+ }
51
+ }
52
+ menu_item {
53
+ text 'File 2'
54
+ on_widget_selected {
55
+ message_box(shell_proxy) {
56
+ text 'File 2'
57
+ message 'File 2 Contents'
58
+ }.open
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }.open
@@ -0,0 +1,15 @@
1
+ include Glimmer
2
+
3
+ @shell = shell {
4
+ text 'Hello, Message Box!'
5
+ button {
6
+ text 'Please Click To Win a Surprise'
7
+ on_widget_selected {
8
+ message_box(@shell) {
9
+ text 'Surprise'
10
+ message "Congratulations!\n\nYou have won $1,000,000!"
11
+ }.open
12
+ }
13
+ }
14
+ }
15
+ @shell.open
@@ -0,0 +1,36 @@
1
+ include Glimmer
2
+
3
+ shell { |shell_proxy|
4
+ text 'Hello, Pop Up Context Menu!'
5
+ grid_layout
6
+ label {
7
+ font height: 16
8
+ text 'Right-Click To Pop Up a Context Menu'
9
+ menu {
10
+ menu {
11
+ text '&History'
12
+ menu {
13
+ text '&Recent'
14
+ menu_item {
15
+ text 'File 1'
16
+ on_widget_selected {
17
+ message_box(shell_proxy) {
18
+ text 'File 1'
19
+ message 'File 1 Contents'
20
+ }.open
21
+ }
22
+ }
23
+ menu_item {
24
+ text 'File 2'
25
+ on_widget_selected {
26
+ message_box(shell_proxy) {
27
+ text 'File 2'
28
+ message 'File 2 Contents'
29
+ }.open
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }.open
@@ -0,0 +1,24 @@
1
+ class HelloTab
2
+ include Glimmer
3
+ def launch
4
+ shell {
5
+ text "Hello, Tab!"
6
+ tab_folder {
7
+ tab_item {
8
+ text "English"
9
+ label {
10
+ text "Hello, World!"
11
+ }
12
+ }
13
+ tab_item {
14
+ text "French"
15
+ label {
16
+ text "Bonjour, Univers!"
17
+ }
18
+ }
19
+ }
20
+ }.open
21
+ end
22
+ end
23
+
24
+ HelloTab.new.launch
@@ -0,0 +1,8 @@
1
+ include Glimmer
2
+
3
+ shell {
4
+ text "Glimmer"
5
+ label {
6
+ text "Hello, World!"
7
+ }
8
+ }.open
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: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-01 00:00:00.000000000 Z
11
+ date: 2020-09-02 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: 0.10.2
18
+ version: 0.10.3
19
19
  name: glimmer
20
20
  type: :runtime
21
21
  prerelease: false
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.10.2
26
+ version: 0.10.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -313,6 +313,7 @@ files:
313
313
  - lib/ext/glimmer.rb
314
314
  - lib/ext/glimmer/config.rb
315
315
  - lib/glimmer-dsl-swt.rb
316
+ - lib/glimmer/Rakefile
316
317
  - lib/glimmer/data_binding/list_selection_binding.rb
317
318
  - lib/glimmer/data_binding/observable_widget.rb
318
319
  - lib/glimmer/data_binding/shine.rb
@@ -383,6 +384,26 @@ files:
383
384
  - lib/glimmer/ui/custom_shell.rb
384
385
  - lib/glimmer/ui/custom_widget.rb
385
386
  - lib/glimmer/util/proc_tracker.rb
387
+ - samples/elaborate/contact_manager.rb
388
+ - samples/elaborate/contact_manager/contact.rb
389
+ - samples/elaborate/contact_manager/contact_manager_presenter.rb
390
+ - samples/elaborate/contact_manager/contact_repository.rb
391
+ - samples/elaborate/login.rb
392
+ - samples/elaborate/tic_tac_toe.rb
393
+ - samples/elaborate/tic_tac_toe/board.rb
394
+ - samples/elaborate/tic_tac_toe/cell.rb
395
+ - samples/hello/hello_browser.rb
396
+ - samples/hello/hello_combo.rb
397
+ - samples/hello/hello_computed.rb
398
+ - samples/hello/hello_computed/contact.rb
399
+ - samples/hello/hello_drag_and_drop.rb
400
+ - samples/hello/hello_list_multi_selection.rb
401
+ - samples/hello/hello_list_single_selection.rb
402
+ - samples/hello/hello_menu_bar.rb
403
+ - samples/hello/hello_message_box.rb
404
+ - samples/hello/hello_pop_up_context_menu.rb
405
+ - samples/hello/hello_tab.rb
406
+ - samples/hello/hello_world.rb
386
407
  - vendor/swt/linux/swt.jar
387
408
  - vendor/swt/mac/swt.jar
388
409
  - vendor/swt/windows/swt.jar
@@ -398,7 +419,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
398
419
  requirements:
399
420
  - - ">="
400
421
  - !ruby/object:Gem::Version
401
- version: '0'
422
+ version: 2.5.3
402
423
  required_rubygems_version: !ruby/object:Gem::Requirement
403
424
  requirements:
404
425
  - - ">="