glimmer-dsl-swt 0.6.0 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/bin/girb +1 -1
- data/bin/glimmer +5 -1
- data/icons/scaffold_app.ico +0 -0
- data/icons/scaffold_app.png +0 -0
- data/lib/ext/glimmer/config.rb +5 -1
- data/lib/glimmer/Rakefile +5 -0
- data/lib/glimmer/dsl/swt/cursor_expression.rb +1 -4
- data/lib/glimmer/dsl/swt/dsl.rb +1 -0
- data/lib/glimmer/dsl/swt/font_expression.rb +3 -1
- data/lib/glimmer/dsl/swt/image_expression.rb +21 -0
- data/lib/glimmer/dsl/swt/message_box_expression.rb +9 -1
- data/lib/glimmer/dsl/swt/widget_expression.rb +7 -7
- data/lib/glimmer/launcher.rb +59 -20
- data/lib/glimmer/package.rb +31 -7
- data/lib/glimmer/rake_task.rb +119 -7
- data/lib/glimmer/scaffold.rb +98 -62
- data/lib/glimmer/swt/display_proxy.rb +13 -2
- data/lib/glimmer/swt/image_proxy.rb +16 -23
- data/lib/glimmer/swt/layout_proxy.rb +2 -0
- data/lib/glimmer/swt/message_box_proxy.rb +23 -5
- data/lib/glimmer/swt/scrolled_composite_proxy.rb +6 -11
- data/lib/glimmer/swt/table_proxy.rb +50 -2
- data/lib/glimmer/swt/widget_proxy.rb +70 -18
- data/samples/elaborate/contact_manager.rb +121 -0
- data/samples/elaborate/contact_manager/contact.rb +11 -0
- data/samples/elaborate/contact_manager/contact_manager_presenter.rb +26 -0
- data/samples/elaborate/contact_manager/contact_repository.rb +244 -0
- data/samples/elaborate/login.rb +108 -0
- data/samples/elaborate/tic_tac_toe.rb +55 -0
- data/samples/elaborate/tic_tac_toe/board.rb +124 -0
- data/samples/elaborate/tic_tac_toe/cell.rb +27 -0
- data/samples/hello/hello_browser.rb +8 -0
- data/samples/hello/hello_combo.rb +38 -0
- data/samples/hello/hello_computed.rb +69 -0
- data/samples/hello/hello_computed/contact.rb +21 -0
- data/samples/hello/hello_drag_and_drop.rb +29 -0
- data/samples/hello/hello_list_multi_selection.rb +48 -0
- data/samples/hello/hello_list_single_selection.rb +37 -0
- data/samples/hello/hello_menu_bar.rb +64 -0
- data/samples/hello/hello_message_box.rb +15 -0
- data/samples/hello/hello_pop_up_context_menu.rb +36 -0
- data/samples/hello/hello_tab.rb +24 -0
- data/samples/hello/hello_world.rb +8 -0
- metadata +59 -7
@@ -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
|
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.
|
4
|
+
version: 0.6.5
|
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
|
+
date: 2020-09-07 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.
|
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.
|
26
|
+
version: 0.10.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
60
|
+
version: 0.10.0
|
61
61
|
name: puts_debuggerer
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
@@ -65,7 +65,35 @@ dependencies:
|
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.10.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 0.2.1
|
75
|
+
name: rake-tui
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.2.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - '='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.7.0
|
89
|
+
name: git-glimmer
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.7.0
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
requirement: !ruby/object:Gem::Requirement
|
71
99
|
requirements:
|
@@ -294,9 +322,12 @@ files:
|
|
294
322
|
- bin/girb_runner.rb
|
295
323
|
- bin/glimmer
|
296
324
|
- icons/scaffold_app.icns
|
325
|
+
- icons/scaffold_app.ico
|
326
|
+
- icons/scaffold_app.png
|
297
327
|
- lib/ext/glimmer.rb
|
298
328
|
- lib/ext/glimmer/config.rb
|
299
329
|
- lib/glimmer-dsl-swt.rb
|
330
|
+
- lib/glimmer/Rakefile
|
300
331
|
- lib/glimmer/data_binding/list_selection_binding.rb
|
301
332
|
- lib/glimmer/data_binding/observable_widget.rb
|
302
333
|
- lib/glimmer/data_binding/shine.rb
|
@@ -318,6 +349,7 @@ files:
|
|
318
349
|
- lib/glimmer/dsl/swt/dsl.rb
|
319
350
|
- lib/glimmer/dsl/swt/exec_expression.rb
|
320
351
|
- lib/glimmer/dsl/swt/font_expression.rb
|
352
|
+
- lib/glimmer/dsl/swt/image_expression.rb
|
321
353
|
- lib/glimmer/dsl/swt/layout_data_expression.rb
|
322
354
|
- lib/glimmer/dsl/swt/layout_expression.rb
|
323
355
|
- lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb
|
@@ -366,6 +398,26 @@ files:
|
|
366
398
|
- lib/glimmer/ui/custom_shell.rb
|
367
399
|
- lib/glimmer/ui/custom_widget.rb
|
368
400
|
- lib/glimmer/util/proc_tracker.rb
|
401
|
+
- samples/elaborate/contact_manager.rb
|
402
|
+
- samples/elaborate/contact_manager/contact.rb
|
403
|
+
- samples/elaborate/contact_manager/contact_manager_presenter.rb
|
404
|
+
- samples/elaborate/contact_manager/contact_repository.rb
|
405
|
+
- samples/elaborate/login.rb
|
406
|
+
- samples/elaborate/tic_tac_toe.rb
|
407
|
+
- samples/elaborate/tic_tac_toe/board.rb
|
408
|
+
- samples/elaborate/tic_tac_toe/cell.rb
|
409
|
+
- samples/hello/hello_browser.rb
|
410
|
+
- samples/hello/hello_combo.rb
|
411
|
+
- samples/hello/hello_computed.rb
|
412
|
+
- samples/hello/hello_computed/contact.rb
|
413
|
+
- samples/hello/hello_drag_and_drop.rb
|
414
|
+
- samples/hello/hello_list_multi_selection.rb
|
415
|
+
- samples/hello/hello_list_single_selection.rb
|
416
|
+
- samples/hello/hello_menu_bar.rb
|
417
|
+
- samples/hello/hello_message_box.rb
|
418
|
+
- samples/hello/hello_pop_up_context_menu.rb
|
419
|
+
- samples/hello/hello_tab.rb
|
420
|
+
- samples/hello/hello_world.rb
|
369
421
|
- vendor/swt/linux/swt.jar
|
370
422
|
- vendor/swt/mac/swt.jar
|
371
423
|
- vendor/swt/windows/swt.jar
|
@@ -381,7 +433,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
381
433
|
requirements:
|
382
434
|
- - ">="
|
383
435
|
- !ruby/object:Gem::Version
|
384
|
-
version:
|
436
|
+
version: 2.5.3
|
385
437
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
386
438
|
requirements:
|
387
439
|
- - ">="
|