glimmer-dsl-swt 4.18.5.2 → 4.18.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +3 -3
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +35 -3
- data/glimmer-dsl-swt.gemspec +3 -3
- data/lib/glimmer/swt/custom/drawable.rb +8 -7
- data/lib/glimmer/swt/custom/shape.rb +153 -13
- data/lib/glimmer/swt/custom/shape/arc.rb +3 -3
- data/lib/glimmer/swt/custom/shape/image.rb +19 -6
- data/lib/glimmer/swt/custom/shape/line.rb +47 -1
- data/lib/glimmer/swt/custom/shape/oval.rb +3 -3
- data/lib/glimmer/swt/custom/shape/point.rb +1 -6
- data/lib/glimmer/swt/custom/shape/polygon.rb +42 -1
- data/lib/glimmer/swt/custom/shape/polyline.rb +45 -4
- data/lib/glimmer/swt/custom/shape/rectangle.rb +5 -1
- data/lib/glimmer/swt/widget_proxy.rb +16 -0
- data/samples/elaborate/contact_manager.rb +2 -0
- data/samples/elaborate/login.rb +2 -0
- data/samples/elaborate/mandelbrot_fractal.rb +1 -0
- data/samples/elaborate/meta_sample.rb +1 -0
- data/samples/elaborate/tetris.rb +2 -1
- data/samples/elaborate/tic_tac_toe.rb +2 -0
- data/samples/elaborate/user_profile.rb +10 -8
- data/samples/hello/hello_browser.rb +2 -0
- data/samples/hello/hello_button.rb +2 -0
- data/samples/hello/hello_canvas.rb +14 -12
- data/samples/hello/hello_canvas_animation.rb +2 -0
- data/samples/hello/hello_canvas_transform.rb +2 -0
- data/samples/hello/hello_checkbox.rb +2 -0
- data/samples/hello/hello_checkbox_group.rb +2 -0
- data/samples/hello/hello_code_text.rb +2 -0
- data/samples/hello/hello_color_dialog.rb +2 -0
- data/samples/hello/hello_combo.rb +2 -0
- data/samples/hello/hello_computed.rb +2 -0
- data/samples/hello/hello_cursor.rb +2 -0
- data/samples/hello/hello_custom_shell.rb +1 -0
- data/samples/hello/hello_custom_widget.rb +2 -0
- data/samples/hello/hello_date_time.rb +2 -0
- data/samples/hello/hello_dialog.rb +2 -0
- data/samples/hello/hello_directory_dialog.rb +2 -0
- data/samples/hello/hello_drag_and_drop.rb +5 -3
- data/samples/hello/hello_expand_bar.rb +2 -0
- data/samples/hello/hello_file_dialog.rb +2 -0
- data/samples/hello/hello_font_dialog.rb +2 -0
- data/samples/hello/hello_group.rb +2 -0
- data/samples/hello/hello_link.rb +2 -0
- data/samples/hello/hello_list_multi_selection.rb +2 -0
- data/samples/hello/hello_list_single_selection.rb +2 -0
- data/samples/hello/hello_menu_bar.rb +2 -0
- data/samples/hello/hello_message_box.rb +2 -0
- data/samples/hello/hello_pop_up_context_menu.rb +2 -0
- data/samples/hello/hello_progress_bar.rb +2 -0
- data/samples/hello/hello_radio.rb +2 -0
- data/samples/hello/hello_radio_group.rb +2 -0
- data/samples/hello/hello_sash_form.rb +2 -0
- data/samples/hello/hello_spinner.rb +2 -0
- data/samples/hello/hello_styled_text.rb +19 -17
- data/samples/hello/hello_tab.rb +2 -0
- data/samples/hello/hello_table.rb +2 -0
- data/samples/hello/hello_world.rb +2 -0
- metadata +2 -2
@@ -19,6 +19,8 @@
|
|
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
|
+
require 'glimmer-dsl-swt'
|
23
|
+
|
22
24
|
class HelloCheckbox
|
23
25
|
class Person
|
24
26
|
attr_accessor :skiing, :snowboarding, :snowmobiling, :snowshoeing
|
@@ -19,6 +19,8 @@
|
|
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
|
+
require 'glimmer-dsl-swt'
|
23
|
+
|
22
24
|
# This sample demonstrates the use of a `checkbox_group` (aka `check_group`) in Glimmer, which provides terser syntax
|
23
25
|
# than HelloCheckbox for representing multiple checkbox buttons (`button(:check)`) by relying on data-binding to
|
24
26
|
# automatically spawn the `checkbox` widgets (`button(:check)`) based on available options on the model.
|
@@ -19,6 +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
|
+
require 'glimmer-dsl-swt'
|
22
23
|
require 'date'
|
23
24
|
|
24
25
|
# This class declares an `email_shell` custom shell, aka custom window (by convention)
|
@@ -19,6 +19,8 @@
|
|
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
|
+
require 'glimmer-dsl-swt'
|
23
|
+
|
22
24
|
# This class declares a `greeting_label` custom widget (by convention)
|
23
25
|
class GreetingLabel
|
24
26
|
include Glimmer::UI::CustomWidget
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (c) 2007-2021 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,6 +19,8 @@
|
|
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
|
+
require 'glimmer-dsl-swt'
|
23
|
+
|
22
24
|
class Location
|
23
25
|
attr_accessor :country
|
24
26
|
|
@@ -19,6 +19,8 @@
|
|
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
|
+
require 'glimmer-dsl-swt'
|
23
|
+
|
22
24
|
class HelloGroup
|
23
25
|
class Person
|
24
26
|
attr_accessor :male, :female, :child, :teen, :adult, :senior
|
data/samples/hello/hello_link.rb
CHANGED
@@ -19,6 +19,8 @@
|
|
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
|
+
require 'glimmer-dsl-swt'
|
23
|
+
|
22
24
|
class HelloListMultiSelection
|
23
25
|
class Person
|
24
26
|
attr_accessor :provinces, :provinces_options
|
@@ -19,6 +19,8 @@
|
|
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
|
+
require 'glimmer-dsl-swt'
|
23
|
+
|
22
24
|
class HelloListSingleSelection
|
23
25
|
class Person
|
24
26
|
attr_accessor :country, :country_options
|
@@ -19,6 +19,8 @@
|
|
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
|
+
require 'glimmer-dsl-swt'
|
23
|
+
|
22
24
|
include Glimmer
|
23
25
|
|
24
26
|
COLORS = [:white, :red, :yellow, :green, :blue, :magenta, :gray, :black]
|
@@ -19,6 +19,8 @@
|
|
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
|
+
require 'glimmer-dsl-swt'
|
23
|
+
|
22
24
|
class HelloRadio
|
23
25
|
class Person
|
24
26
|
attr_accessor :male, :female, :child, :teen, :adult, :senior
|
@@ -19,6 +19,8 @@
|
|
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
|
+
require 'glimmer-dsl-swt'
|
23
|
+
|
22
24
|
# This sample demonstrates the use of a `radio_group` in Glimmer, which provides terser syntax
|
23
25
|
# than HelloRadio for representing multiple radio buttons by relying on data-binding to
|
24
26
|
# automatically spawn the `radio` widgets based on available options on the model.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (c) 2007-2021 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,18 +19,20 @@
|
|
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
|
+
require 'glimmer-dsl-swt'
|
23
|
+
|
22
24
|
verbiage = <<-MULTI_LINE_STRING
|
23
25
|
|
24
|
-
Glimmer DSL for SWT is a native-GUI cross-platform desktop development library written in JRuby,
|
25
|
-
an OS-threaded faster version of Ruby.
|
26
|
-
Glimmer's main innovation is a declarative Ruby DSL that enables productive and efficient authoring
|
27
|
-
of desktop application user-interfaces while relying on the robust Eclipse SWT library.
|
28
|
-
Glimmer additionally innovates by having built-in data-binding support, which greatly facilitates
|
29
|
-
synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components
|
30
|
-
and enabling developers to solve business problems (test-first) without worrying about GUI concerns.
|
31
|
-
To get started quickly, Glimmer offers scaffolding options for Apps, Gems, and Custom Widgets.
|
32
|
-
Glimmer also includes native-executable packaging support, sorely lacking in other libraries,
|
33
|
-
thus enabling the delivery of desktop apps written in Ruby as truly native DMG/PKG/APP files on
|
26
|
+
Glimmer DSL for SWT is a native-GUI cross-platform desktop development library written in JRuby,
|
27
|
+
an OS-threaded faster version of Ruby.
|
28
|
+
Glimmer's main innovation is a declarative Ruby DSL that enables productive and efficient authoring
|
29
|
+
of desktop application user-interfaces while relying on the robust Eclipse SWT library.
|
30
|
+
Glimmer additionally innovates by having built-in data-binding support, which greatly facilitates
|
31
|
+
synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components
|
32
|
+
and enabling developers to solve business problems (test-first) without worrying about GUI concerns.
|
33
|
+
To get started quickly, Glimmer offers scaffolding options for Apps, Gems, and Custom Widgets.
|
34
|
+
Glimmer also includes native-executable packaging support, sorely lacking in other libraries,
|
35
|
+
thus enabling the delivery of desktop apps written in Ruby as truly native DMG/PKG/APP files on
|
34
36
|
the Mac + App Store, MSI/EXE files on Windows, and Gem Packaged Shell Scripts on Linux.
|
35
37
|
|
36
38
|
MULTI_LINE_STRING
|
@@ -74,7 +76,7 @@ shell {
|
|
74
76
|
top_pixel bind(@presenter, :top_pixel)
|
75
77
|
|
76
78
|
# This demonstrates how to set styles via a listener
|
77
|
-
on_line_get_style { |line_style_event|
|
79
|
+
on_line_get_style { |line_style_event|
|
78
80
|
line_offset = line_style_event.lineOffset
|
79
81
|
if @presenter.line_index_for_offset(line_offset) % 52 < 13
|
80
82
|
line_size = line_style_event.lineText.size
|
@@ -95,7 +97,7 @@ shell {
|
|
95
97
|
line_size = line_style_event.lineText.size
|
96
98
|
style_range = StyleRange.new(line_offset, line_size, color(:dark_magenta).swt_color, color(:cyan).swt_color, swt(:normal))
|
97
99
|
style_range.strikeout = true
|
98
|
-
line_style_event.styles = [style_range].to_java(StyleRange)
|
100
|
+
line_style_event.styles = [style_range].to_java(StyleRange)
|
99
101
|
end
|
100
102
|
}
|
101
103
|
}
|
@@ -132,7 +134,7 @@ shell {
|
|
132
134
|
}
|
133
135
|
text {
|
134
136
|
text bind(@presenter, :top_pixel, on_read: ->(o) {"%04d" % [o] })
|
135
|
-
}
|
136
|
-
}
|
137
|
+
}
|
138
|
+
}
|
137
139
|
}
|
138
140
|
}.open
|
data/samples/hello/hello_tab.rb
CHANGED
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.18.5.
|
4
|
+
version: 4.18.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|