glimmer-dsl-swt 4.17.10.5 → 4.17.10.6
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 +5 -0
- data/README.md +56 -39
- data/VERSION +1 -1
- data/glimmer-dsl-swt.gemspec +4 -3
- data/lib/glimmer/swt/widget_proxy.rb +1 -0
- data/samples/elaborate/login.rb +10 -13
- data/samples/hello/hello_link.rb +82 -0
- data/samples/hello/hello_list_multi_selection.rb +22 -17
- data/samples/hello/hello_list_single_selection.rb +5 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 527278f09cf48caee9d3cdcc5c5ed1c5a066ff822ea1828c17605aeb7e6f07a9
|
4
|
+
data.tar.gz: cd4ae35f2a0e7312c57eb3d998579793687d9240b51c70a76be07e50f5e700dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 799ed5391c3d1e0a658d9f11a94b705bc96889648993a287560355daa0bd567fee8dade2118e2f232115938e5775a17a4500944cc4f1c693a19cfd3e2e452063
|
7
|
+
data.tar.gz: 1ca39bc3fa61931c2cf2b1b39caaca18938b2014ec73b0d8bcd47291f40895df0abe3b5d23158126ca457d2e9b27fce382c6216361d798fa928476d5625f7a97
|
data/CHANGELOG.md
CHANGED
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.10.
|
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.10.6
|
2
2
|
|
3
3
|
## JRuby Desktop Development GUI Framework
|
4
4
|
[](http://badge.fury.io/rb/glimmer-dsl-swt)
|
@@ -33,7 +33,7 @@ Glimmer DSL gems:
|
|
33
33
|
|
34
34
|
### Hello, World!
|
35
35
|
|
36
|
-
Glimmer code (from [samples/hello/hello_world.rb](
|
36
|
+
Glimmer code (from [samples/hello/hello_world.rb](samples/hello/hello_world.rb)):
|
37
37
|
```ruby
|
38
38
|
include Glimmer
|
39
39
|
|
@@ -57,7 +57,7 @@ Glimmer app:
|
|
57
57
|
|
58
58
|
### Tic Tac Toe
|
59
59
|
|
60
|
-
Glimmer code (from [samples/elaborate/tic_tac_toe.rb](
|
60
|
+
Glimmer code (from [samples/elaborate/tic_tac_toe.rb](samples/elaborate/tic_tac_toe.rb)):
|
61
61
|
|
62
62
|
```ruby
|
63
63
|
# ...
|
@@ -96,7 +96,7 @@ Glimmer app:
|
|
96
96
|
|
97
97
|
### Contact Manager
|
98
98
|
|
99
|
-
Glimmer code (from [samples/elaborate/contact_manager.rb](
|
99
|
+
Glimmer code (from [samples/elaborate/contact_manager.rb](samples/elaborate/contact_manager.rb)):
|
100
100
|
|
101
101
|
```ruby
|
102
102
|
# ...
|
@@ -355,6 +355,7 @@ Glimmer App:
|
|
355
355
|
- [Hello, Spinner!](#hello-spinner)
|
356
356
|
- [Hello, Table!](#hello-table)
|
357
357
|
- [Hello, Button!](#hello-button)
|
358
|
+
- [Hello, Link!](#hello-link)
|
358
359
|
- [Elaborate Samples](#elaborate-samples)
|
359
360
|
- [User Profile](#user-profile)
|
360
361
|
- [Login](#login)
|
@@ -448,7 +449,7 @@ jgem install glimmer-dsl-swt
|
|
448
449
|
|
449
450
|
Or this command if you want a specific version:
|
450
451
|
```
|
451
|
-
jgem install glimmer-dsl-swt -v 4.17.10.
|
452
|
+
jgem install glimmer-dsl-swt -v 4.17.10.6
|
452
453
|
|
453
454
|
```
|
454
455
|
|
@@ -525,7 +526,7 @@ bin/glimmer samples
|
|
525
526
|
Below are the full usage instructions that come up when running `glimmer` without args.
|
526
527
|
|
527
528
|
```
|
528
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.17.10.
|
529
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.17.10.6
|
529
530
|
|
530
531
|
|
531
532
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
@@ -1003,7 +1004,7 @@ Output:
|
|
1003
1004
|
|
1004
1005
|
Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
|
1005
1006
|
Opal glimmer-dsl-opal 0.4.0 AndyMaleh Glimmer DSL for Opal
|
1006
|
-
Swt glimmer-dsl-swt 4.17.10.
|
1007
|
+
Swt glimmer-dsl-swt 4.17.10.6
|
1007
1008
|
AndyMaleh Glimmer DSL for SWT
|
1008
1009
|
Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
|
1009
1010
|
Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
|
@@ -3644,7 +3645,7 @@ For hello-type simple samples, check the following.
|
|
3644
3645
|
|
3645
3646
|
Code:
|
3646
3647
|
|
3647
|
-
[samples/hello/hello_world.rb](
|
3648
|
+
[samples/hello/hello_world.rb](samples/hello/hello_world.rb)
|
3648
3649
|
|
3649
3650
|

|
3650
3651
|
|
@@ -3652,7 +3653,7 @@ Code:
|
|
3652
3653
|
|
3653
3654
|
Code:
|
3654
3655
|
|
3655
|
-
[samples/hello/hello_tab.rb](
|
3656
|
+
[samples/hello/hello_tab.rb](samples/hello/hello_tab.rb)
|
3656
3657
|
|
3657
3658
|

|
3658
3659
|

|
@@ -3663,7 +3664,7 @@ This sample demonstrates combo data-binding.
|
|
3663
3664
|
|
3664
3665
|
Code:
|
3665
3666
|
|
3666
|
-
[samples/hello/hello_combo.rb](
|
3667
|
+
[samples/hello/hello_combo.rb](samples/hello/hello_combo.rb)
|
3667
3668
|
|
3668
3669
|

|
3669
3670
|

|
@@ -3674,7 +3675,7 @@ This sample demonstrates list single-selection data-binding.
|
|
3674
3675
|
|
3675
3676
|
Code:
|
3676
3677
|
|
3677
|
-
[samples/hello/hello_list_single_selection.rb](
|
3678
|
+
[samples/hello/hello_list_single_selection.rb](samples/hello/hello_list_single_selection.rb)
|
3678
3679
|
|
3679
3680
|

|
3680
3681
|
|
@@ -3684,7 +3685,7 @@ This sample demonstrates list multi-selection data-binding.
|
|
3684
3685
|
|
3685
3686
|
Code:
|
3686
3687
|
|
3687
|
-
[samples/hello/hello_list_multi_selection.rb](
|
3688
|
+
[samples/hello/hello_list_multi_selection.rb](samples/hello/hello_list_multi_selection.rb)
|
3688
3689
|
|
3689
3690
|

|
3690
3691
|
|
@@ -3694,7 +3695,7 @@ This sample demonstrates computed data-binding.
|
|
3694
3695
|
|
3695
3696
|
Code:
|
3696
3697
|
|
3697
|
-
[samples/hello/hello_computed.rb](
|
3698
|
+
[samples/hello/hello_computed.rb](samples/hello/hello_computed.rb)
|
3698
3699
|
|
3699
3700
|

|
3700
3701
|
|
@@ -3704,7 +3705,7 @@ This sample demonstrates a `message_box` dialog.
|
|
3704
3705
|
|
3705
3706
|
Code:
|
3706
3707
|
|
3707
|
-
[samples/hello/hello_message_box.rb](
|
3708
|
+
[samples/hello/hello_message_box.rb](samples/hello/hello_message_box.rb)
|
3708
3709
|
|
3709
3710
|

|
3710
3711
|

|
@@ -3715,7 +3716,7 @@ This sample demonstrates the `browser` widget.
|
|
3715
3716
|
|
3716
3717
|
Code:
|
3717
3718
|
|
3718
|
-
[samples/hello/hello_browser.rb](
|
3719
|
+
[samples/hello/hello_browser.rb](samples/hello/hello_browser.rb)
|
3719
3720
|
|
3720
3721
|

|
3721
3722
|
|
@@ -3725,7 +3726,7 @@ This sample demonstrates drag and drop in Glimmer.
|
|
3725
3726
|
|
3726
3727
|
Code:
|
3727
3728
|
|
3728
|
-
[samples/hello/hello_drag_and_drop.rb](
|
3729
|
+
[samples/hello/hello_drag_and_drop.rb](samples/hello/hello_drag_and_drop.rb)
|
3729
3730
|
|
3730
3731
|

|
3731
3732
|
|
@@ -3735,7 +3736,7 @@ This sample demonstrates menus in Glimmer.
|
|
3735
3736
|
|
3736
3737
|
Code:
|
3737
3738
|
|
3738
|
-
[samples/hello/hello_menu_bar.rb](
|
3739
|
+
[samples/hello/hello_menu_bar.rb](samples/hello/hello_menu_bar.rb)
|
3739
3740
|
|
3740
3741
|

|
3741
3742
|

|
@@ -3747,7 +3748,7 @@ This sample demonstrates pop up context menus in Glimmer.
|
|
3747
3748
|
|
3748
3749
|
Code:
|
3749
3750
|
|
3750
|
-
[samples/hello/hello_pop_up_context_menu.rb](
|
3751
|
+
[samples/hello/hello_pop_up_context_menu.rb](samples/hello/hello_pop_up_context_menu.rb)
|
3751
3752
|
|
3752
3753
|

|
3753
3754
|

|
@@ -3758,7 +3759,7 @@ This sample demonstrates the use of a custom widget in Glimmer.
|
|
3758
3759
|
|
3759
3760
|
Code:
|
3760
3761
|
|
3761
|
-
[samples/hello/hello_custom_widget.rb](
|
3762
|
+
[samples/hello/hello_custom_widget.rb](samples/hello/hello_custom_widget.rb)
|
3762
3763
|
|
3763
3764
|

|
3764
3765
|
|
@@ -3768,7 +3769,7 @@ This sample demonstrates the use of a custom shell (aka custom window) in Glimme
|
|
3768
3769
|
|
3769
3770
|
Code:
|
3770
3771
|
|
3771
|
-
[samples/hello/hello_custom_shell.rb](
|
3772
|
+
[samples/hello/hello_custom_shell.rb](samples/hello/hello_custom_shell.rb)
|
3772
3773
|
|
3773
3774
|

|
3774
3775
|

|
@@ -3781,7 +3782,7 @@ This sample demonstrates the use of a `sash_form` in Glimmer.
|
|
3781
3782
|
|
3782
3783
|
Code:
|
3783
3784
|
|
3784
|
-
[samples/hello/hello_sash_form.rb](
|
3785
|
+
[samples/hello/hello_sash_form.rb](samples/hello/hello_sash_form.rb)
|
3785
3786
|
|
3786
3787
|
Hello, Sash Form! Horizontal Orientation
|
3787
3788
|
|
@@ -3813,7 +3814,7 @@ This sample demonstrates the use of a `styled_text` in Glimmer.
|
|
3813
3814
|
|
3814
3815
|
Code:
|
3815
3816
|
|
3816
|
-
[samples/hello/hello_styled_text.rb](
|
3817
|
+
[samples/hello/hello_styled_text.rb](samples/hello/hello_styled_text.rb)
|
3817
3818
|
|
3818
3819
|
Hello, Styled Text!
|
3819
3820
|
|
@@ -3825,7 +3826,7 @@ This sample demonstrates the use of a `expand_bar` and `expand_item` in Glimmer.
|
|
3825
3826
|
|
3826
3827
|
Code:
|
3827
3828
|
|
3828
|
-
[samples/hello/hello_expand_bar.rb](
|
3829
|
+
[samples/hello/hello_expand_bar.rb](samples/hello/hello_expand_bar.rb)
|
3829
3830
|
|
3830
3831
|
Hello, Expand Bar! All Expanded
|
3831
3832
|
|
@@ -3849,7 +3850,7 @@ This sample demonstrates the use of a `radio` (aka `button(:radio)`) in Glimmer.
|
|
3849
3850
|
|
3850
3851
|
Code:
|
3851
3852
|
|
3852
|
-
[samples/hello/hello_radio.rb](
|
3853
|
+
[samples/hello/hello_radio.rb](samples/hello/hello_radio.rb)
|
3853
3854
|
|
3854
3855
|
Hello, Radio!
|
3855
3856
|
|
@@ -3861,7 +3862,7 @@ This sample demonstrates the use of a `radio_group` in Glimmer, which provides t
|
|
3861
3862
|
|
3862
3863
|
Code:
|
3863
3864
|
|
3864
|
-
[samples/hello/hello_radio_group.rb](
|
3865
|
+
[samples/hello/hello_radio_group.rb](samples/hello/hello_radio_group.rb)
|
3865
3866
|
|
3866
3867
|
Hello, Radio Group!
|
3867
3868
|
|
@@ -3873,7 +3874,7 @@ This sample demonstrates the use of a `group` in Glimmer (not to be confused wit
|
|
3873
3874
|
|
3874
3875
|
Code:
|
3875
3876
|
|
3876
|
-
[samples/hello/hello_group.rb](
|
3877
|
+
[samples/hello/hello_group.rb](samples/hello/hello_group.rb)
|
3877
3878
|
|
3878
3879
|
Hello, Group!
|
3879
3880
|
|
@@ -3885,7 +3886,7 @@ This sample demonstrates the use of a `checkbox` (aka `check` or `button(:check)
|
|
3885
3886
|
|
3886
3887
|
Code:
|
3887
3888
|
|
3888
|
-
[samples/hello/hello_checkbox.rb](
|
3889
|
+
[samples/hello/hello_checkbox.rb](samples/hello/hello_checkbox.rb)
|
3889
3890
|
|
3890
3891
|
Hello, Checkbox!
|
3891
3892
|
|
@@ -3897,7 +3898,7 @@ This sample demonstrates the use of a `checkbox_group` (aka `check_group`) in Gl
|
|
3897
3898
|
|
3898
3899
|
Code:
|
3899
3900
|
|
3900
|
-
[samples/hello/hello_checkbox_group.rb](
|
3901
|
+
[samples/hello/hello_checkbox_group.rb](samples/hello/hello_checkbox_group.rb)
|
3901
3902
|
|
3902
3903
|
Hello, Checkbox Group!
|
3903
3904
|
|
@@ -3909,7 +3910,7 @@ This sample demonstrates the use of a `directory_dialog` in Glimmer.
|
|
3909
3910
|
|
3910
3911
|
Code:
|
3911
3912
|
|
3912
|
-
[samples/hello/hello_directory_dialog.rb](
|
3913
|
+
[samples/hello/hello_directory_dialog.rb](samples/hello/hello_directory_dialog.rb)
|
3913
3914
|
|
3914
3915
|
Hello, Directory Dialog!
|
3915
3916
|
|
@@ -3929,7 +3930,7 @@ This sample demonstrates the use of a `file_dialog` in Glimmer.
|
|
3929
3930
|
|
3930
3931
|
Code:
|
3931
3932
|
|
3932
|
-
[samples/hello/hello_file_dialog.rb](
|
3933
|
+
[samples/hello/hello_file_dialog.rb](samples/hello/hello_file_dialog.rb)
|
3933
3934
|
|
3934
3935
|
Hello, File Dialog!
|
3935
3936
|
|
@@ -3949,7 +3950,7 @@ This sample demonstrates the use of [date_time](#datetime) widget keywords in Gl
|
|
3949
3950
|
|
3950
3951
|
Code:
|
3951
3952
|
|
3952
|
-
[samples/hello/hello_date_time.rb](
|
3953
|
+
[samples/hello/hello_date_time.rb](samples/hello/hello_date_time.rb)
|
3953
3954
|
|
3954
3955
|
Hello, Date Time!
|
3955
3956
|
|
@@ -3961,7 +3962,7 @@ This sample demonstrates the use of `spinner` widget in Glimmer
|
|
3961
3962
|
|
3962
3963
|
Code:
|
3963
3964
|
|
3964
|
-
[samples/hello/hello_spinner.rb](
|
3965
|
+
[samples/hello/hello_spinner.rb](samples/hello/hello_spinner.rb)
|
3965
3966
|
|
3966
3967
|
Hello, Spinner!
|
3967
3968
|
|
@@ -3973,7 +3974,7 @@ This sample demonstrates the use of [table](#table) widget in Glimmer, including
|
|
3973
3974
|
|
3974
3975
|
Code:
|
3975
3976
|
|
3976
|
-
[samples/hello/hello_table.rb](
|
3977
|
+
[samples/hello/hello_table.rb](samples/hello/hello_table.rb)
|
3977
3978
|
|
3978
3979
|
Hello, Table!
|
3979
3980
|
|
@@ -4017,11 +4018,11 @@ Hello, Table! Context Menu
|
|
4017
4018
|
|
4018
4019
|
#### Hello, Button!
|
4019
4020
|
|
4020
|
-
This sample demonstrates the use of `button` widget in Glimmer, including data-binding and click event triggering via `on_widget_selected`.
|
4021
|
+
This sample demonstrates the use of the `button` widget in Glimmer, including data-binding and click event triggering via `on_widget_selected`.
|
4021
4022
|
|
4022
4023
|
Code:
|
4023
4024
|
|
4024
|
-
[samples/hello/hello_button.rb](
|
4025
|
+
[samples/hello/hello_button.rb](samples/hello/hello_button.rb)
|
4025
4026
|
|
4026
4027
|
Hello, Button!
|
4027
4028
|
|
@@ -4031,6 +4032,22 @@ Hello, Button! Incremented 7 times!
|
|
4031
4032
|
|
4032
4033
|

|
4033
4034
|
|
4035
|
+
#### Hello, Link!
|
4036
|
+
|
4037
|
+
This sample demonstrates the use of the `link` widget in Glimmer, including identifying which link was clicked and performing an action (displaying help) based on its location.
|
4038
|
+
|
4039
|
+
Code:
|
4040
|
+
|
4041
|
+
[samples/hello/hello_link.rb](samples/hello/hello_link.rb)
|
4042
|
+
|
4043
|
+
Hello, Link!
|
4044
|
+
|
4045
|
+

|
4046
|
+
|
4047
|
+
Hello, Link! Clicked
|
4048
|
+
|
4049
|
+

|
4050
|
+
|
4034
4051
|
### Elaborate Samples
|
4035
4052
|
|
4036
4053
|
For more elaborate samples, check the following:
|
@@ -4043,7 +4060,7 @@ Please note that the code has changed since that article was written (the GUI DS
|
|
4043
4060
|
|
4044
4061
|
Code:
|
4045
4062
|
|
4046
|
-
[samples/elaborate/user_profile.rb](
|
4063
|
+
[samples/elaborate/user_profile.rb](samples/elaborate/user_profile.rb)
|
4047
4064
|
|
4048
4065
|

|
4049
4066
|
|
@@ -4053,7 +4070,7 @@ This sample demonstrates basic data-binding, password and text fields, and field
|
|
4053
4070
|
|
4054
4071
|
Code:
|
4055
4072
|
|
4056
|
-
[samples/elaborate/login.rb](
|
4073
|
+
[samples/elaborate/login.rb](samples/elaborate/login.rb)
|
4057
4074
|
|
4058
4075
|

|
4059
4076
|

|
@@ -4067,7 +4084,7 @@ Code:
|
|
4067
4084
|
|
4068
4085
|
(Please note that on some Linux instances where the display x-axis is set to double-scale, you need to set the `shell` `minimum_size` to `300, 178` instead of `150, 178`)
|
4069
4086
|
|
4070
|
-
[samples/elaborate/tic_tac_toe.rb](
|
4087
|
+
[samples/elaborate/tic_tac_toe.rb](samples/elaborate/tic_tac_toe.rb)
|
4071
4088
|
|
4072
4089
|

|
4073
4090
|

|
@@ -4079,7 +4096,7 @@ This sample demonstrates table data-binding, sorting, filtering, GUI layout, MVP
|
|
4079
4096
|
|
4080
4097
|
Code:
|
4081
4098
|
|
4082
|
-
[samples/elaborate/contact_manager.rb](
|
4099
|
+
[samples/elaborate/contact_manager.rb](samples/elaborate/contact_manager.rb)
|
4083
4100
|
|
4084
4101
|
Contact Manager
|
4085
4102
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.17.10.
|
1
|
+
4.17.10.6
|
data/glimmer-dsl-swt.gemspec
CHANGED
@@ -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.10.
|
5
|
+
# stub: glimmer-dsl-swt 4.17.10.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "glimmer-dsl-swt".freeze
|
9
|
-
s.version = "4.17.10.
|
9
|
+
s.version = "4.17.10.6"
|
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-12-
|
14
|
+
s.date = "2020-12-11"
|
15
15
|
s.description = "Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)".freeze
|
16
16
|
s.email = "andy.am@gmail.com".freeze
|
17
17
|
s.executables = ["glimmer".freeze, "girb".freeze]
|
@@ -145,6 +145,7 @@ Gem::Specification.new do |s|
|
|
145
145
|
"samples/hello/hello_expand_bar.rb",
|
146
146
|
"samples/hello/hello_file_dialog.rb",
|
147
147
|
"samples/hello/hello_group.rb",
|
148
|
+
"samples/hello/hello_link.rb",
|
148
149
|
"samples/hello/hello_list_multi_selection.rb",
|
149
150
|
"samples/hello/hello_list_single_selection.rb",
|
150
151
|
"samples/hello/hello_menu_bar.rb",
|
data/samples/elaborate/login.rb
CHANGED
@@ -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,6 @@
|
|
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
|
-
#Presents login screen data
|
23
22
|
class LoginPresenter
|
24
23
|
|
25
24
|
attr_accessor :user_name
|
@@ -35,7 +34,6 @@ class LoginPresenter
|
|
35
34
|
def status=(status)
|
36
35
|
@status = status
|
37
36
|
|
38
|
-
#TODO add feature to bind dependent properties to master property (2017-07-25 nested data binding)
|
39
37
|
notify_observers("logged_in")
|
40
38
|
notify_observers("logged_out")
|
41
39
|
end
|
@@ -65,7 +63,6 @@ class LoginPresenter
|
|
65
63
|
|
66
64
|
end
|
67
65
|
|
68
|
-
#Login screen
|
69
66
|
class Login
|
70
67
|
include Glimmer
|
71
68
|
|
@@ -77,10 +74,10 @@ class Login
|
|
77
74
|
grid_layout 2, false #two columns with differing widths
|
78
75
|
|
79
76
|
label { text "Username:" } # goes in column 1
|
80
|
-
@user_name_text = text {
|
77
|
+
@user_name_text = text { # goes in column 2
|
81
78
|
text bind(presenter, :user_name)
|
82
79
|
enabled bind(presenter, :logged_out)
|
83
|
-
on_key_pressed { |event|
|
80
|
+
on_key_pressed { |event|
|
84
81
|
@password_text.set_focus if event.keyCode == swt(:cr)
|
85
82
|
}
|
86
83
|
}
|
@@ -89,7 +86,7 @@ class Login
|
|
89
86
|
@password_text = text(:password, :border) {
|
90
87
|
text bind(presenter, :password)
|
91
88
|
enabled bind(presenter, :logged_out)
|
92
|
-
on_key_pressed { |event|
|
89
|
+
on_key_pressed { |event|
|
93
90
|
presenter.login if event.keyCode == swt(:cr)
|
94
91
|
}
|
95
92
|
}
|
@@ -101,21 +98,21 @@ class Login
|
|
101
98
|
text "Login"
|
102
99
|
enabled bind(presenter, :logged_out)
|
103
100
|
on_widget_selected { presenter.login }
|
104
|
-
on_key_pressed { |event|
|
101
|
+
on_key_pressed { |event|
|
105
102
|
presenter.login if event.keyCode == swt(:cr)
|
106
|
-
}
|
103
|
+
}
|
107
104
|
}
|
108
105
|
|
109
106
|
button {
|
110
107
|
text "Logout"
|
111
108
|
enabled bind(presenter, :logged_in)
|
112
109
|
on_widget_selected { presenter.logout }
|
113
|
-
on_key_pressed { |event|
|
110
|
+
on_key_pressed { |event|
|
114
111
|
if event.keyCode == swt(:cr)
|
115
112
|
presenter.logout
|
116
113
|
@user_name_text.set_focus
|
117
114
|
end
|
118
|
-
}
|
115
|
+
}
|
119
116
|
}
|
120
117
|
}
|
121
118
|
}
|
@@ -0,0 +1,82 @@
|
|
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="href">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
|
+
@help_shell.close
|
73
|
+
}
|
74
|
+
on_shell_closed {
|
75
|
+
@selected_link = nil
|
76
|
+
}
|
77
|
+
}
|
78
|
+
@help_shell.open
|
79
|
+
end
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}.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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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
|
-
|
43
|
+
reset_provinces
|
39
44
|
end
|
40
45
|
|
41
46
|
def reset_provinces
|
42
|
-
self.provinces = [
|
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
|
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=[
|
28
|
-
|
27
|
+
self.country_options = ['', 'Canada', 'US', 'Mexico']
|
28
|
+
reset_country
|
29
29
|
end
|
30
30
|
|
31
31
|
def reset_country
|
32
|
-
self.country =
|
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
|
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
|
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.10.
|
4
|
+
version: 4.17.10.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -445,6 +445,7 @@ files:
|
|
445
445
|
- samples/hello/hello_expand_bar.rb
|
446
446
|
- samples/hello/hello_file_dialog.rb
|
447
447
|
- samples/hello/hello_group.rb
|
448
|
+
- samples/hello/hello_link.rb
|
448
449
|
- samples/hello/hello_list_multi_selection.rb
|
449
450
|
- samples/hello/hello_list_single_selection.rb
|
450
451
|
- samples/hello/hello_menu_bar.rb
|