glimmer-dsl-swt 4.17.10.6 → 4.18.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/LICENSE.txt +1 -1
- data/README.md +369 -60
- data/RUBY_VERSION +1 -1
- data/VERSION +1 -1
- data/bin/girb +1 -1
- data/bin/girb_runner.rb +1 -1
- data/bin/glimmer +1 -1
- data/glimmer-dsl-swt.gemspec +54 -34
- data/lib/ext/glimmer.rb +1 -1
- data/lib/ext/glimmer/config.rb +1 -1
- data/lib/glimmer-dsl-swt.rb +2 -1
- data/lib/glimmer/Rakefile +1 -1
- data/lib/glimmer/data_binding/list_selection_binding.rb +1 -1
- data/lib/glimmer/data_binding/observable_widget.rb +1 -1
- data/lib/glimmer/data_binding/shine.rb +1 -1
- data/lib/glimmer/data_binding/table_items_binding.rb +1 -1
- data/lib/glimmer/data_binding/tree_items_binding.rb +1 -1
- data/lib/glimmer/data_binding/widget_binding.rb +1 -1
- data/lib/glimmer/dsl/swt/async_exec_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/bind_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/block_property_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/color_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/column_properties_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/cursor_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/custom_widget_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/dialog_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/directory_dialog_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/display_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/dnd_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/dsl.rb +1 -1
- data/lib/glimmer/dsl/swt/exec_expression.rb +5 -5
- data/lib/glimmer/dsl/swt/expand_item_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/file_dialog_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/font_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/image_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/layout_data_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/layout_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/menu_bar_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/menu_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/message_box_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/observe_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/property_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/rgb_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/rgba_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/shell_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/swt_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/sync_exec_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/tab_item_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/table_items_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/tree_items_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/tree_properties_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/widget_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/widget_listener_expression.rb +1 -1
- data/lib/glimmer/launcher.rb +1 -1
- data/lib/glimmer/rake_task.rb +1 -1
- data/lib/glimmer/rake_task/list.rb +1 -1
- data/lib/glimmer/rake_task/package.rb +1 -1
- data/lib/glimmer/rake_task/scaffold.rb +1 -1
- data/lib/glimmer/swt/color_proxy.rb +1 -1
- data/lib/glimmer/swt/cursor_proxy.rb +1 -1
- data/lib/glimmer/swt/custom/checkbox_group.rb +1 -1
- data/lib/glimmer/swt/custom/radio_group.rb +1 -1
- data/lib/glimmer/swt/date_time_proxy.rb +1 -1
- data/lib/glimmer/swt/directory_dialog_proxy.rb +1 -1
- data/lib/glimmer/swt/display_proxy.rb +1 -1
- data/lib/glimmer/swt/dnd_proxy.rb +1 -1
- data/lib/glimmer/swt/expand_item_proxy.rb +1 -1
- data/lib/glimmer/swt/file_dialog_proxy.rb +1 -1
- data/lib/glimmer/swt/font_proxy.rb +1 -1
- data/lib/glimmer/swt/image_proxy.rb +12 -11
- data/lib/glimmer/swt/layout_data_proxy.rb +1 -1
- data/lib/glimmer/swt/layout_proxy.rb +8 -4
- data/lib/glimmer/swt/menu_proxy.rb +10 -6
- data/lib/glimmer/swt/message_box_proxy.rb +1 -1
- data/lib/glimmer/swt/packages.rb +1 -1
- data/lib/glimmer/swt/sash_form_proxy.rb +2 -2
- data/lib/glimmer/swt/scrolled_composite_proxy.rb +1 -1
- data/lib/glimmer/swt/shell_proxy.rb +1 -1
- data/lib/glimmer/swt/style_constantizable.rb +9 -5
- data/lib/glimmer/swt/styled_text_proxy.rb +1 -1
- data/lib/glimmer/swt/swt_proxy.rb +1 -1
- data/lib/glimmer/swt/tab_item_proxy.rb +1 -1
- data/lib/glimmer/swt/table_column_proxy.rb +1 -1
- data/lib/glimmer/swt/table_proxy.rb +1 -1
- data/lib/glimmer/swt/tree_proxy.rb +26 -22
- data/lib/glimmer/swt/widget_listener_proxy.rb +1 -1
- data/lib/glimmer/swt/widget_proxy.rb +70 -25
- data/lib/glimmer/ui/custom_shell.rb +1 -1
- data/lib/glimmer/ui/custom_widget.rb +1 -1
- data/lib/glimmer/util/proc_tracker.rb +1 -1
- data/samples/elaborate/contact_manager.rb +1 -1
- data/samples/elaborate/contact_manager/contact.rb +1 -1
- data/samples/elaborate/contact_manager/contact_manager_presenter.rb +1 -1
- data/samples/elaborate/contact_manager/contact_repository.rb +1 -1
- data/samples/elaborate/login.rb +1 -1
- data/samples/elaborate/meta_sample.rb +80 -20
- data/samples/elaborate/tic_tac_toe.rb +2 -2
- data/samples/elaborate/tic_tac_toe/board.rb +1 -1
- data/samples/elaborate/tic_tac_toe/cell.rb +1 -1
- data/samples/elaborate/user_profile.rb +1 -1
- data/samples/hello/hello_browser.rb +3 -1
- data/samples/hello/hello_button.rb +1 -1
- data/samples/hello/hello_checkbox.rb +1 -1
- data/samples/hello/hello_checkbox_group.rb +1 -1
- data/samples/hello/hello_combo.rb +1 -1
- data/samples/hello/hello_computed.rb +10 -4
- data/samples/hello/hello_computed/contact.rb +1 -1
- data/samples/hello/hello_custom_shell.rb +1 -1
- data/samples/hello/hello_custom_widget.rb +1 -1
- data/samples/hello/hello_date_time.rb +1 -1
- data/samples/hello/hello_dialog.rb +78 -0
- data/samples/hello/hello_directory_dialog.rb +1 -1
- data/samples/hello/hello_drag_and_drop.rb +1 -1
- data/samples/hello/hello_expand_bar.rb +1 -1
- data/samples/hello/hello_file_dialog.rb +1 -1
- data/samples/hello/hello_group.rb +1 -1
- data/samples/hello/hello_link.rb +4 -6
- data/samples/hello/hello_list_multi_selection.rb +1 -1
- data/samples/hello/hello_list_single_selection.rb +1 -1
- data/samples/hello/hello_menu_bar.rb +185 -29
- data/samples/hello/hello_message_box.rb +10 -9
- data/samples/hello/hello_pop_up_context_menu.rb +34 -7
- data/samples/hello/hello_radio.rb +1 -1
- data/samples/hello/hello_radio_group.rb +1 -1
- data/samples/hello/hello_sash_form.rb +1 -1
- data/samples/hello/hello_spinner.rb +1 -1
- data/samples/hello/hello_styled_text.rb +1 -1
- data/samples/hello/hello_tab.rb +1 -1
- data/samples/hello/hello_table.rb +1 -1
- data/samples/hello/hello_world.rb +1 -1
- data/vendor/swt/linux/swt.jar +0 -0
- data/vendor/swt/mac/swt.jar +0 -0
- data/vendor/swt/windows/swt.jar +0 -0
- metadata +74 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7aaf0dca4f250ba15d538f31b0d127fa1f49187208dde61e11fb7d59ce54b33b
|
4
|
+
data.tar.gz: 2fc8e9ea4778467e9f29c90c1e5eaa908eb73fa2df0fea2680141f2c89492174
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5babde26d2b5440917f5b30ba2409701f11fa7210e190922ab3d4873d2db03113b5a3b68adfe1a97767cff2ed931259728dc4735cee596aec09c0f21cc9ed3d6
|
7
|
+
data.tar.gz: 198238910b291593d4249716b29e7ce52fce909d3f1b4e8606d1451c9c22b19a74cc0f19fdda2f6f7a3f4182cc0fc595770bc5359ca82890db5b4892204e54bb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,44 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 4.18.0.2
|
4
|
+
|
5
|
+
- Minor update on Hello, Dialog! Sample
|
6
|
+
- Upgrade to glimmer v1.0.7
|
7
|
+
|
8
|
+
### 4.18.0.1
|
9
|
+
|
10
|
+
- Hello, Dialog! Sample
|
11
|
+
- Added Glimmer icon to Glimmer Meta-Sample (Sample of Samples)
|
12
|
+
- Upgrade Scaffolded projects to JRuby v9.2.14.0
|
13
|
+
- Switch back to official git gem v1.8.1 now that glimmer-git gem branch is merged into it
|
14
|
+
- Fix issue with not reporting exception encountered in editing a tree item if consumer code had a bug
|
15
|
+
|
16
|
+
### 4.18.0.0
|
17
|
+
|
18
|
+
- Upgrade to SWT v4.18
|
19
|
+
- Upgrade to JRuby v9.2.14.0
|
20
|
+
- Apply all WidgetProxy property converters upon normal setting of properties too (not just in DSL) (like `some_widget.background = color_symbol`)
|
21
|
+
- Update Hello, Menu Bar! sample to show accelerators on menu items
|
22
|
+
- Have the `swt` keyword (SWTProxy) support accepting a string character (to build an accelerator style)
|
23
|
+
- Make accelerator property accept symbols and character directly (without swt)
|
24
|
+
- Write meta-sample changes to user directory to avoid permission issues
|
25
|
+
- Zero margin_left, margin_right, margin_top, margin_bottom in layouts given that margin_width and margin_height are set by default
|
26
|
+
- Prevent editing/launching meta-sample from Glimmer Meta-Sample
|
27
|
+
- Fix enablement on `menu` (as opposed to menu_item, where it works)
|
28
|
+
- Fix issue relating to background image scaling on resize of widget
|
29
|
+
|
30
|
+
### 4.17.10.8
|
31
|
+
|
32
|
+
- Support editing sample code in the Glimmer Meta-Sample to enable experimentation and learning
|
33
|
+
- Add a "Reset" button to the Glimmer Meta-Sample to allow resetting sample code changes
|
34
|
+
- Refactor/revise hello_message_box.rb and hello_pop_up_context_menu.rb samples
|
35
|
+
- Upgrade to glimmer 1.0.6
|
36
|
+
|
37
|
+
### 4.17.10.7
|
38
|
+
|
39
|
+
- Loosened dependencies on most Glimmer author-owned gems
|
40
|
+
- Refactored/Simplified/Fixed Hello, Link! Sample
|
41
|
+
|
3
42
|
### 4.17.10.6
|
4
43
|
|
5
44
|
- Hello, Link! Sample
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
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.
|
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.18.0.2
|
2
|
+
|
2
3
|
|
3
4
|
## JRuby Desktop Development GUI Framework
|
4
5
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
|
@@ -11,23 +12,23 @@
|
|
11
12
|
|
12
13
|
(The Original Glimmer Library Since 2007. Beware of Imitators!)
|
13
14
|
|
14
|
-
[Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer) is a native-GUI cross-platform desktop development library written in [JRuby](https://www.jruby.org/), an OS-threaded faster version of [Ruby](https://www.ruby-lang.org/en/). [Glimmer](https://github.com/AndyObtiva/glimmer)'s main innovation is a declarative [Ruby DSL](#glimmer-dsl-syntax) that enables productive and efficient authoring of desktop application user-interfaces while relying on the robust [Eclipse SWT library](https://www.eclipse.org/swt/). [Glimmer](https://rubygems.org/gems/glimmer) additionally innovates by having built-in [data-binding](#data-binding) support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns. To get started quickly, [Glimmer](https://rubygems.org/gems/glimmer) offers [scaffolding](#scaffolding) options for [Apps](#in-production), [Gems](#custom-shell-gem), and [Custom Widgets](#custom-widgets). [Glimmer](https://rubygems.org/gems/glimmer) also includes native-executable [packaging](#packaging--distribution) support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in [Ruby](https://www.ruby-lang.org/en/) as truly native DMG/PKG/APP files on the [Mac](https://www.apple.com/ca/macos) + [App Store](https://developer.apple.com/macos/distribution/), MSI/EXE files on [Windows](https://www.microsoft.com/en-ca/windows), and [Gem Packaged Shell Scripts](#custom-shell-gem) on [Linux](https://www.linux.org/).
|
15
|
+
[Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer) is a native-GUI cross-platform desktop development library written in [JRuby](https://www.jruby.org/), an OS-threaded faster version of [Ruby](https://www.ruby-lang.org/en/). [Glimmer](https://github.com/AndyObtiva/glimmer)'s main innovation is a declarative [Ruby DSL](#glimmer-dsl-syntax) that enables productive and efficient authoring of desktop application user-interfaces while relying on the robust [Eclipse SWT library](https://www.eclipse.org/swt/). [Glimmer](https://rubygems.org/gems/glimmer) additionally innovates by having built-in [data-binding](#data-binding) support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns, or alternatively drive development GUI-first, and then write clean business models (test-first) afterwards. To get started quickly, [Glimmer](https://rubygems.org/gems/glimmer) offers [scaffolding](#scaffolding) options for [Apps](#in-production), [Gems](#custom-shell-gem), and [Custom Widgets](#custom-widgets). [Glimmer](https://rubygems.org/gems/glimmer) also includes native-executable [packaging](#packaging--distribution) support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in [Ruby](https://www.ruby-lang.org/en/) as truly native DMG/PKG/APP files on the [Mac](https://www.apple.com/ca/macos) + [App Store](https://developer.apple.com/macos/distribution/), MSI/EXE files on [Windows](https://www.microsoft.com/en-ca/windows), and [Gem Packaged Shell Scripts](#custom-shell-gem) on [Linux](https://www.linux.org/).
|
15
16
|
|
16
17
|
[Glimmer receives two updates per month](https://rubygems.org/gems/glimmer-dsl-swt/versions). You can trust [Glimmer](https://rubygems.org/gems/glimmer) with your Ruby desktop GUI development needs. Please make [Glimmer](https://rubygems.org/gems/glimmer) even better by providing feedback and [contributing](#contributing) when possible.
|
17
18
|
|
18
19
|
Gem version numbers are in sync with the SWT library versions. The first two digits represent the SWT version number. The last two digits represent the minor and patch versions of Glimmer DSL for SWT.
|
19
20
|
|
20
|
-
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) versions 4.
|
21
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) versions 4.18.x.y come with [SWT 4.18](https://download.eclipse.org/eclipse/downloads/drops4/R-4.18-202012021800/), which was released on December 2, 2020.
|
21
22
|
|
22
23
|
[<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
|
23
|
-
Featured in
|
24
|
+
Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) and [Chalmers/Gothenburg University Software Engineering Master's Lecture Material](http://www.cse.chalmers.se/~bergert/slides/guest_lecture_DSLs.pdf)
|
24
25
|
|
25
26
|
Glimmer DSL gems:
|
26
|
-
- [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop GUI)
|
27
|
-
- [glimmer-dsl-
|
28
|
-
- [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Web GUI Adapter for Desktop Apps)
|
27
|
+
- [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
|
28
|
+
- [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)
|
29
29
|
- [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
|
30
30
|
- [glimmer-dsl-css](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS
|
31
|
+
- [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (Ruby Desktop Development GUI Library)
|
31
32
|
|
32
33
|
## Examples
|
33
34
|
|
@@ -266,6 +267,7 @@ Glimmer App:
|
|
266
267
|
- [Glimmer GUI DSL Syntax](#glimmer-gui-dsl-syntax)
|
267
268
|
- [DSL Auto-Expansion](#dsl-auto-expansion)
|
268
269
|
- [Widgets](#widgets)
|
270
|
+
- [Glimmer GUI DSL Keywords](#glimmer-gui-dsl-keywords)
|
269
271
|
- [SWT Proxies](#swt-proxies)
|
270
272
|
- [Dialog](#dialog)
|
271
273
|
- [Display](#display)
|
@@ -356,6 +358,7 @@ Glimmer App:
|
|
356
358
|
- [Hello, Table!](#hello-table)
|
357
359
|
- [Hello, Button!](#hello-button)
|
358
360
|
- [Hello, Link!](#hello-link)
|
361
|
+
- [Hello, Dialog!](#hello-dialog)
|
359
362
|
- [Elaborate Samples](#elaborate-samples)
|
360
363
|
- [User Profile](#user-profile)
|
361
364
|
- [Login](#login)
|
@@ -416,13 +419,13 @@ https://www.eclipse.org/swt/faq.php
|
|
416
419
|
## Pre-requisites
|
417
420
|
|
418
421
|
- JDK 8u241 (1.8.0_241) (find at https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html)
|
419
|
-
- JRuby 9.2.
|
420
|
-
- SWT 4.
|
422
|
+
- JRuby 9.2.14.0 (supporting Ruby 2.5.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux or find at [https://www.jruby.org/download](https://www.jruby.org/download) for Windows)
|
423
|
+
- SWT 4.18 (already included in the [glimmer-dsl-swt](https://rubygems.org/gems/glimmer-dsl-swt) gem)
|
421
424
|
|
422
425
|
To obtain JRuby through [RVM](http://rvm.io), you may run:
|
423
426
|
|
424
427
|
```bash
|
425
|
-
rvm install jruby-9.2.
|
428
|
+
rvm install jruby-9.2.14.0
|
426
429
|
```
|
427
430
|
|
428
431
|
Glimmer might still work on other versions of Java, JRuby and SWT, but there are no guarantees, so it is best to stick to the pre-requisites outlined above.
|
@@ -449,7 +452,8 @@ jgem install glimmer-dsl-swt
|
|
449
452
|
|
450
453
|
Or this command if you want a specific version:
|
451
454
|
```
|
452
|
-
jgem install glimmer-dsl-swt -v 4.
|
455
|
+
jgem install glimmer-dsl-swt -v 4.18.0.2
|
456
|
+
|
453
457
|
|
454
458
|
```
|
455
459
|
|
@@ -468,7 +472,8 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
468
472
|
|
469
473
|
Add the following to `Gemfile`:
|
470
474
|
```
|
471
|
-
gem 'glimmer-dsl-swt', '~> 4.
|
475
|
+
gem 'glimmer-dsl-swt', '~> 4.18.0.2
|
476
|
+
'
|
472
477
|
```
|
473
478
|
|
474
479
|
And, then run:
|
@@ -526,7 +531,8 @@ bin/glimmer samples
|
|
526
531
|
Below are the full usage instructions that come up when running `glimmer` without args.
|
527
532
|
|
528
533
|
```
|
529
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.
|
534
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.18.0.2
|
535
|
+
|
530
536
|
|
531
537
|
|
532
538
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
@@ -1003,8 +1009,9 @@ Output:
|
|
1003
1009
|
Name Gem Version Author Description
|
1004
1010
|
|
1005
1011
|
Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
|
1006
|
-
Opal glimmer-dsl-opal 0.
|
1007
|
-
Swt glimmer-dsl-swt 4.
|
1012
|
+
Opal glimmer-dsl-opal 0.8.0 AndyMaleh Glimmer DSL for Opal
|
1013
|
+
Swt glimmer-dsl-swt 4.18.0.2
|
1014
|
+
|
1008
1015
|
AndyMaleh Glimmer DSL for SWT
|
1009
1016
|
Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
|
1010
1017
|
Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
|
@@ -1085,7 +1092,7 @@ Keep in mind that all samples live under [https://github.com/AndyObtiva/glimmer-
|
|
1085
1092
|
|
1086
1093
|
Glimmer's core is a GUI DSL with a lightweight visual syntax that makes it easy to visualize the nesting of widgets in the GUI hierarchy tree.
|
1087
1094
|
|
1088
|
-
It is available through mixing in the `Glimmer` module, which makes Glimmer GUI DSL keywords available to both the instance scope and class scope:
|
1095
|
+
It is available through mixing in the `Glimmer` module, which makes [Glimmer GUI DSL Keywords](#glimmer-gui-dsl-keywords) available to both the instance scope and class scope:
|
1089
1096
|
|
1090
1097
|
```ruby
|
1091
1098
|
include Glimmer
|
@@ -1271,12 +1278,73 @@ shell {
|
|
1271
1278
|
}.open
|
1272
1279
|
```
|
1273
1280
|
|
1274
|
-
If you are new to Glimmer, you have learned enough to start running some [samples](#samples). Go ahead and run all Glimmer [samples](#samples), and come back to read the rest in any order you like since this material is more organized like a reference.
|
1281
|
+
If you are new to Glimmer, you have learned enough to start running some [samples](#samples) directly or by reading through [Glimmer GUI DSL Keywords](#glimmer-gui-dsl-keywords) (which list each keyword's samples). Go ahead and run all Glimmer [samples](#samples), and come back to read the rest in any order you like since this material is more organized like a reference.
|
1275
1282
|
|
1276
1283
|
If you are advanced and need more widgets, check out the [Nebula Project](https://www.eclipse.org/nebula/) for an extensive list of high quality custom widgets:
|
1277
1284
|
|
1278
1285
|
https://www.eclipse.org/nebula/
|
1279
1286
|
|
1287
|
+
#### Glimmer GUI DSL Keywords
|
1288
|
+
|
1289
|
+
This is not an exaustive list, but should give you a good start in learning Glimmer GUI DSL keywords, keeping in mind that the full list can be derived from the [SWT documentation](https://www.eclipse.org/swt/widgets/). More will be explained in the following sections.
|
1290
|
+
|
1291
|
+
**Widgets:**
|
1292
|
+
- `button`: featured in [Hello, Checkbox!](#hello-checkbox) / [Hello, Button!](#hello-button) / [Hello, Table!](#hello-table) / [Hello, Radio Group!](#hello-radio-group) / [Hello, Radio!](#hello-radio) / [Hello, Message Box!](#hello-message-box) / [Hello, List Single Selection!](#hello-list-single-selection) / [Hello, List Multi Selection!](#hello-list-multi-selection) / [Hello, Group!](#hello-group) / [Hello, Combo!](#hello-combo) / [Hello, Checkbox Group!](#hello-checkbox-group) / [Contact Manager](#contact-manager) / [Tic Tac Toe](#tic-tac-toe) / [Login](#login)
|
1293
|
+
- `browser`: featured in [Hello, Browser!](#hello-browser)
|
1294
|
+
- `calendar`: featured in [Hello, Date Time!](#hello-date-time)
|
1295
|
+
- `checkbox`: featured in [Hello, Checkbox Group!](#hello-checkbox-group) / [Hello, Checkbox!](#hello-checkbox)
|
1296
|
+
- `checkbox_group`: featured in [Hello, Checkbox Group!](#hello-checkbox-group)
|
1297
|
+
- `combo`: featured in [Hello, Table!](#hello-table) / [Hello, Combo!](#hello-combo)
|
1298
|
+
- `composite`: featured in [Hello, Radio!](#hello-radio) / [Hello, Computed!](#hello-computed) / [Hello, Checkbox!](#hello-checkbox) / [Tic Tac Toe](#tic-tac-toe) / [Login](#login) / [Contact Manager](#contact-manager)
|
1299
|
+
- `date`: featured in [Hello, Table!](#hello-table) / [Hello, Date Time!](#hello-date-time) / [Hello, Custom Shell!](#hello-custom-shell) / [Tic Tac Toe](#tic-tac-toe)
|
1300
|
+
- `date_drop_down`: featured in [Hello, Table!](#hello-table) / [Hello, Date Time!](#hello-date-time)
|
1301
|
+
- `group`: featured in [Hello, Group!](#hello-group) / [Contact Manager](#contact-manager)
|
1302
|
+
- `label`: featured in [Hello, Computed!](#hello-computed) / [Hello, Checkbox Group!](#hello-checkbox-group) / [Hello, Checkbox!](#hello-checkbox) / [Hello, World!](#hello-world) / [Hello, Table!](#hello-table) / [Hello, Tab!](#hello-tab) / [Hello, Radio Group!](#hello-radio-group) / [Hello, Radio!](#hello-radio) / [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu) / [Hello, Menu Bar!](#hello-menu-bar) / [Hello, Date Time!](#hello-date-time) / [Hello, Custom Widget!](#hello-custom-widget) / [Hello, Custom Shell!](#hello-custom-shell) / [Contact Manager](#contact-manager) / [Login](#login)
|
1303
|
+
- `list` (w/ optional `:multi` SWT style): featured in [Hello, List Single Selection!](#hello-list-single-selection) / [Hello, List Multi Selection!](#hello-list-multi-selection) / [Contact Manager](#contact-manager)
|
1304
|
+
- `menu`: featured in [Hello, Menu Bar!](#hello-menu-bar) / [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu) / [Hello, Table!](#hello-table)
|
1305
|
+
- `menu_bar`: featured in [Hello, Menu Bar!](#hello-menu-bar)
|
1306
|
+
- `menu_item`: featured in [Hello, Table!](#hello-table) / [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu) / [Hello, Menu Bar!](#hello-menu-bar)
|
1307
|
+
- `message_box`: featured in [Hello, Table!](#hello-table) / [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu) / [Hello, Message Box!](#hello-message-box) / [Hello, Menu Bar!](#hello-menu-bar)
|
1308
|
+
- `radio`: featured in [Hello, Radio!](#hello-radio) / [Hello, Group!](#hello-group)
|
1309
|
+
- `radio_group`: featured in [Hello, Radio Group!](#hello-radio-group)
|
1310
|
+
- `scrolled_composite`
|
1311
|
+
- `shell`: featured in [Hello, Checkbox!](#hello-checkbox) / [Hello, Button!](#hello-button) / [Hello, Table!](#hello-table) / [Hello, Tab!](#hello-tab) / [Hello, Radio Group!](#hello-radio-group) / [Hello, Radio!](#hello-radio) / [Hello, List Single Selection!](#hello-list-single-selection) / [Hello, List Multi Selection!](#hello-list-multi-selection) / [Hello, Group!](#hello-group) / [Hello, Date Time!](#hello-date-time) / [Hello, Custom Shell!](#hello-custom-shell) / [Hello, Computed!](#hello-computed) / [Hello, Combo!](#hello-combo) / [Hello, Checkbox Group!](#hello-checkbox-group) / [Contact Manager](#contact-manager) / [Tic Tac Toe](#tic-tac-toe) / [Login](#login)
|
1312
|
+
- `tab_folder`: featured in [Hello, Tab!](#hello-tab)
|
1313
|
+
- `tab_item`: featured in [Hello, Tab!](#hello-tab)
|
1314
|
+
- `table`: featured in [Hello, Custom Shell!](#hello-custom-shell) / [Hello, Table!](#hello-table) / [Contact Manager](#contact-manager)
|
1315
|
+
- `table_column`: featured in [Hello, Table!](#hello-table) / [Hello, Custom Shell!](#hello-custom-shell) / [Contact Manager](#contact-manager)
|
1316
|
+
- `text`: featured in [Hello, Computed!](#hello-computed) / [Login](#login) / [Contact Manager](#contact-manager)
|
1317
|
+
- `time`: featured in [Hello, Table!](#hello-table) / [Hello, Date Time!](#hello-date-time)
|
1318
|
+
- Glimmer::UI::CustomWidget: ability to define any keyword as a custom widget - featured in [Hello, Custom Widget!](#hello-custom-widget)
|
1319
|
+
- Glimmer::UI::CustomShell: ability to define any keyword as a custom shell (aka custom window) that opens in a new browser window (tab) automatically unless there is no shell open in the current browser window (tab) - featured in [Hello, Custom Shell!](#hello-custom-shell)
|
1320
|
+
|
1321
|
+
**Layouts:**
|
1322
|
+
- `grid_layout`: featured in [Hello, Custom Shell!](#hello-custom-shell) / [Hello, Computed!](#hello-computed) / [Hello, Table!](#hello-table) / [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu) / [Hello, Menu Bar!](#hello-menu-bar) / [Hello, List Single Selection!](#hello-list-single-selection) / [Hello, List Multi Selection!](#hello-list-multi-selection) / [Contact Manager](#contact-manager) / [Login](#login) / [Tic Tac Toe](#tic-tac-toe)
|
1323
|
+
- `row_layout`: featured in [Hello, Radio Group!](#hello-radio-group) / [Hello, Radio!](#hello-radio) / [Hello, Group!](#hello-group) / [Hello, Date Time!](#hello-date-time) / [Hello, Combo!](#hello-combo) / [Hello, Checkbox Group!](#hello-checkbox-group) / [Hello, Checkbox!](#hello-checkbox) / [Contact Manager](#contact-manager)
|
1324
|
+
- `fill_layout`: featured in [Hello, Custom Widget!](#hello-custom-widget)
|
1325
|
+
- `layout_data`: featured in [Hello, Table!](#hello-table) / [Hello, Custom Shell!](#hello-custom-shell) / [Hello, Computed!](#hello-computed) / [Tic Tac Toe](#tic-tac-toe) / [Contact Manager](#contact-manager)
|
1326
|
+
|
1327
|
+
**Graphics/Style:**
|
1328
|
+
- `color`: featured in [Hello, Custom Widget!](#hello-custom-widget) / [Hello, Menu Bar!](#hello-menu-bar)
|
1329
|
+
- `font`: featured in [Hello, Checkbox Group!](#hello-checkbox-group) / [Hello, Checkbox!](#hello-checkbox) / [Hello, Table!](#hello-table) / [Hello, Radio Group!](#hello-radio-group) / [Hello, Radio!](#hello-radio) / [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu) / [Hello, Menu Bar!](#hello-menu-bar) / [Hello, Group!](#hello-group) / [Hello, Date Time!](#hello-date-time) / [Hello, Custom Widget!](#hello-custom-widget) / [Hello, Custom Shell!](#hello-custom-shell) / [Contact Manager](#contact-manager) / [Tic Tac Toe](#tic-tac-toe)
|
1330
|
+
- `Point` class used in setting location on widgets
|
1331
|
+
- `swt` and `SWT` class to set SWT styles on widgets - featured in [Hello, Custom Shell!](#hello-custom-shell) / [Login](#login) / [Contact Manager](#contact-manager)
|
1332
|
+
|
1333
|
+
**Data-Binding/Observers:**
|
1334
|
+
- `bind`: featured in [Hello, Computed!](#hello-computed) / [Hello, Combo!](#hello-combo) / [Hello, Checkbox Group!](#hello-checkbox-group) / [Hello, Checkbox!](#hello-checkbox) / [Hello, Button!](#hello-button) / [Hello, Table!](#hello-table) / [Hello, Radio Group!](#hello-radio-group) / [Hello, Radio!](#hello-radio) / [Hello, List Single Selection!](#hello-list-single-selection) / [Hello, List Multi Selection!](#hello-list-multi-selection) / [Hello, Group!](#hello-group) / [Hello, Date Time!](#hello-date-time) / [Hello, Custom Widget!](#hello-custom-widget) / [Hello, Custom Shell!](#hello-custom-shell) / [Login](#login) / [Contact Manager](#contact-manager) / [Tic Tac Toe](#tic-tac-toe)
|
1335
|
+
- `observe`: featured in [Hello, Table!](#hello-table) / [Tic Tac Toe](#tic-tac-toe)
|
1336
|
+
- `on_widget_selected`: featured in [Hello, Combo!](#hello-combo) / [Hello, Checkbox Group!](#hello-checkbox-group) / [Hello, Checkbox!](#hello-checkbox) / [Hello, Button!](#hello-button) / [Hello, Table!](#hello-table) / [Hello, Radio Group!](#hello-radio-group) / [Hello, Radio!](#hello-radio) / [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu) / [Hello, Message Box!](#hello-message-box) / [Hello, Menu Bar!](#hello-menu-bar) / [Hello, List Single Selection!](#hello-list-single-selection) / [Hello, List Multi Selection!](#hello-list-multi-selection) / [Hello, Group!](#hello-group) / [Contact Manager](#contact-manager) / [Login](#login) / [Tic Tac Toe](#tic-tac-toe)
|
1337
|
+
- `on_modify_text`
|
1338
|
+
- `on_key_pressed` (and SWT alias `on_swt_keydown`) - featured in [Login](#login) / [Contact Manager](#contact-manager)
|
1339
|
+
- `on_key_released` (and SWT alias `on_swt_keyup`)
|
1340
|
+
- `on_mouse_down` (and SWT alias `on_swt_mousedown`)
|
1341
|
+
- `on_mouse_up` (and SWT alias `on_swt_mouseup`) - featured in [Hello, Custom Shell!](#hello-custom-shell) / [Contact Manager](#contact-manager)
|
1342
|
+
|
1343
|
+
**Event loop:**
|
1344
|
+
- `display`: featured in [Tic Tac Toe](#tic-tac-toe)
|
1345
|
+
- `async_exec`: featured in [Hello, Custom Widget!](#hello-custom-widget) / [Hello, Custom Shell!](#hello-custom-shell)
|
1346
|
+
|
1347
|
+
|
1280
1348
|
#### SWT Proxies
|
1281
1349
|
|
1282
1350
|
Glimmer follows Proxy Design Pattern by having Ruby proxy wrappers for all SWT objects:
|
@@ -1361,9 +1429,11 @@ Dialog is a variation on Shell. It is basically a shell that is modal (blocks wh
|
|
1361
1429
|
|
1362
1430
|
Glimmer facilitates building dialogs by using the `dialog` keyword, which automatically adds the SWT.DIALOG_TRIM and SWT.APPLICATION_MODAL [widget styles](#widget-styles) needed for a dialog.
|
1363
1431
|
|
1432
|
+
Check out [Hello, Dialog!](#hello-dialog) sample to learn more.
|
1433
|
+
|
1364
1434
|
##### message_box
|
1365
1435
|
|
1366
|
-
The Glimmer DSL `message_box` keyword is similar to `shell`, but renders a modal dialog with a title `text` property
|
1436
|
+
The Glimmer DSL `message_box` keyword is similar to `shell` and `dialog`, but renders a modal dialog with a title `text` property, main body `message` property, and dismissal button(s) only (OK button by default or [more options](https://www.eclipse.org/swt/javadoc.php)). It may also be opened via the `#open` method.
|
1367
1437
|
|
1368
1438
|
Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
1369
1439
|
|
@@ -1477,47 +1547,54 @@ The ampersand symbol indicates the keyboard shortcut key for the menu item (e.g.
|
|
1477
1547
|
Example of a Menu Bar (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
1478
1548
|
|
1479
1549
|
```ruby
|
1480
|
-
|
1550
|
+
include Glimmer
|
1551
|
+
|
1552
|
+
COLORS = [:white, :red, :yellow, :green, :blue, :magenta, :gray, :black]
|
1553
|
+
|
1554
|
+
shell {
|
1555
|
+
grid_layout {
|
1556
|
+
margin_width 0
|
1557
|
+
margin_height 0
|
1558
|
+
}
|
1559
|
+
|
1481
1560
|
text 'Hello, Menu Bar!'
|
1482
|
-
|
1483
|
-
label(:center) {
|
1484
|
-
font height:
|
1485
|
-
text 'Check Out The
|
1561
|
+
|
1562
|
+
@label = label(:center) {
|
1563
|
+
font height: 50
|
1564
|
+
text 'Check Out The Menu Bar Above!'
|
1486
1565
|
}
|
1566
|
+
|
1487
1567
|
menu_bar {
|
1488
1568
|
menu {
|
1489
1569
|
text '&File'
|
1490
1570
|
menu_item {
|
1491
|
-
text 'E&xit'
|
1492
|
-
}
|
1493
|
-
menu_item(0) {
|
1494
1571
|
text '&New'
|
1572
|
+
accelerator :command, :N
|
1573
|
+
|
1495
1574
|
on_widget_selected {
|
1496
|
-
message_box
|
1497
|
-
text 'New
|
1498
|
-
message 'New
|
1575
|
+
message_box {
|
1576
|
+
text 'New'
|
1577
|
+
message 'New file created.'
|
1499
1578
|
}.open
|
1500
1579
|
}
|
1501
1580
|
}
|
1502
|
-
|
1503
|
-
text '&
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1581
|
+
menu_item {
|
1582
|
+
text '&Open...'
|
1583
|
+
accelerator :command, :O
|
1584
|
+
|
1585
|
+
on_widget_selected {
|
1586
|
+
message_box {
|
1587
|
+
text 'Open'
|
1588
|
+
message 'Opening File...'
|
1589
|
+
}.open
|
1510
1590
|
}
|
1511
1591
|
}
|
1512
|
-
}
|
1513
|
-
menu {
|
1514
|
-
text '&History'
|
1515
1592
|
menu {
|
1516
|
-
text '&Recent'
|
1593
|
+
text 'Open &Recent'
|
1517
1594
|
menu_item {
|
1518
1595
|
text 'File 1'
|
1519
1596
|
on_widget_selected {
|
1520
|
-
message_box
|
1597
|
+
message_box {
|
1521
1598
|
text 'File 1'
|
1522
1599
|
message 'File 1 Contents'
|
1523
1600
|
}.open
|
@@ -1526,13 +1603,167 @@ shell { |shell_proxy|
|
|
1526
1603
|
menu_item {
|
1527
1604
|
text 'File 2'
|
1528
1605
|
on_widget_selected {
|
1529
|
-
message_box
|
1606
|
+
message_box {
|
1530
1607
|
text 'File 2'
|
1531
1608
|
message 'File 2 Contents'
|
1532
1609
|
}.open
|
1533
1610
|
}
|
1534
1611
|
}
|
1535
1612
|
}
|
1613
|
+
menu_item(:separator)
|
1614
|
+
menu_item {
|
1615
|
+
text 'E&xit'
|
1616
|
+
|
1617
|
+
on_widget_selected {
|
1618
|
+
exit(0)
|
1619
|
+
}
|
1620
|
+
}
|
1621
|
+
}
|
1622
|
+
menu {
|
1623
|
+
text '&Edit'
|
1624
|
+
menu_item {
|
1625
|
+
text 'Cut'
|
1626
|
+
accelerator :command, :X
|
1627
|
+
}
|
1628
|
+
menu_item {
|
1629
|
+
text 'Copy'
|
1630
|
+
accelerator :command, :C
|
1631
|
+
}
|
1632
|
+
menu_item {
|
1633
|
+
text 'Paste'
|
1634
|
+
accelerator :command, :V
|
1635
|
+
}
|
1636
|
+
}
|
1637
|
+
menu {
|
1638
|
+
text '&Options'
|
1639
|
+
|
1640
|
+
menu_item(:radio) {
|
1641
|
+
text '&Enabled'
|
1642
|
+
|
1643
|
+
on_widget_selected {
|
1644
|
+
@select_one_menu.enabled = true
|
1645
|
+
@select_multiple_menu.enabled = true
|
1646
|
+
}
|
1647
|
+
}
|
1648
|
+
@select_one_menu = menu {
|
1649
|
+
text '&Select One'
|
1650
|
+
enabled false
|
1651
|
+
|
1652
|
+
menu_item(:radio) {
|
1653
|
+
text 'Option 1'
|
1654
|
+
}
|
1655
|
+
menu_item(:radio) {
|
1656
|
+
text 'Option 2'
|
1657
|
+
}
|
1658
|
+
menu_item(:radio) {
|
1659
|
+
text 'Option 3'
|
1660
|
+
}
|
1661
|
+
}
|
1662
|
+
@select_multiple_menu = menu {
|
1663
|
+
text '&Select Multiple'
|
1664
|
+
enabled false
|
1665
|
+
|
1666
|
+
menu_item(:check) {
|
1667
|
+
text 'Option 4'
|
1668
|
+
}
|
1669
|
+
menu_item(:check) {
|
1670
|
+
text 'Option 5'
|
1671
|
+
}
|
1672
|
+
menu_item(:check) {
|
1673
|
+
text 'Option 6'
|
1674
|
+
}
|
1675
|
+
}
|
1676
|
+
}
|
1677
|
+
menu {
|
1678
|
+
text '&Format'
|
1679
|
+
menu {
|
1680
|
+
text '&Background Color'
|
1681
|
+
COLORS.each { |color_style|
|
1682
|
+
menu_item(:radio) {
|
1683
|
+
text color_style.to_s.split('_').map(&:capitalize).join(' ')
|
1684
|
+
|
1685
|
+
on_widget_selected {
|
1686
|
+
@label.background = color_style
|
1687
|
+
}
|
1688
|
+
}
|
1689
|
+
}
|
1690
|
+
}
|
1691
|
+
menu {
|
1692
|
+
text 'Foreground &Color'
|
1693
|
+
COLORS.each { |color_style|
|
1694
|
+
menu_item(:radio) {
|
1695
|
+
text color_style.to_s.split('_').map(&:capitalize).join(' ')
|
1696
|
+
|
1697
|
+
on_widget_selected {
|
1698
|
+
@label.foreground = color_style
|
1699
|
+
}
|
1700
|
+
}
|
1701
|
+
}
|
1702
|
+
}
|
1703
|
+
}
|
1704
|
+
menu {
|
1705
|
+
text '&View'
|
1706
|
+
menu_item(:radio) {
|
1707
|
+
text 'Small'
|
1708
|
+
|
1709
|
+
on_widget_selected {
|
1710
|
+
@label.font = {height: 25}
|
1711
|
+
@label.parent.pack
|
1712
|
+
}
|
1713
|
+
}
|
1714
|
+
menu_item(:radio) {
|
1715
|
+
text 'Medium'
|
1716
|
+
selection true
|
1717
|
+
|
1718
|
+
on_widget_selected {
|
1719
|
+
@label.font = {height: 50}
|
1720
|
+
@label.parent.pack
|
1721
|
+
}
|
1722
|
+
}
|
1723
|
+
menu_item(:radio) {
|
1724
|
+
text 'Large'
|
1725
|
+
|
1726
|
+
on_widget_selected {
|
1727
|
+
@label.font = {height: 75}
|
1728
|
+
@label.parent.pack
|
1729
|
+
}
|
1730
|
+
}
|
1731
|
+
}
|
1732
|
+
menu {
|
1733
|
+
text '&Help'
|
1734
|
+
menu_item {
|
1735
|
+
text '&Manual'
|
1736
|
+
accelerator :command, :shift, :M
|
1737
|
+
|
1738
|
+
on_widget_selected {
|
1739
|
+
message_box {
|
1740
|
+
text 'Manual'
|
1741
|
+
message 'Manual Contents'
|
1742
|
+
}.open
|
1743
|
+
}
|
1744
|
+
}
|
1745
|
+
menu_item {
|
1746
|
+
text '&Tutorial'
|
1747
|
+
accelerator :command, :shift, :T
|
1748
|
+
|
1749
|
+
on_widget_selected {
|
1750
|
+
message_box {
|
1751
|
+
text 'Tutorial'
|
1752
|
+
message 'Tutorial Contents'
|
1753
|
+
}.open
|
1754
|
+
}
|
1755
|
+
}
|
1756
|
+
menu_item(:separator)
|
1757
|
+
menu_item {
|
1758
|
+
text '&Report an Issue...'
|
1759
|
+
|
1760
|
+
on_widget_selected {
|
1761
|
+
message_box {
|
1762
|
+
text 'Report an Issue'
|
1763
|
+
message 'Reporting an issue...'
|
1764
|
+
}.open
|
1765
|
+
}
|
1766
|
+
}
|
1536
1767
|
}
|
1537
1768
|
}
|
1538
1769
|
}.open
|
@@ -1541,12 +1772,20 @@ shell { |shell_proxy|
|
|
1541
1772
|
Example of a Pop Up Context Menu (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
1542
1773
|
|
1543
1774
|
```ruby
|
1544
|
-
|
1775
|
+
include Glimmer
|
1776
|
+
|
1777
|
+
shell {
|
1778
|
+
grid_layout {
|
1779
|
+
margin_width 0
|
1780
|
+
margin_height 0
|
1781
|
+
}
|
1782
|
+
|
1545
1783
|
text 'Hello, Pop Up Context Menu!'
|
1546
|
-
|
1784
|
+
|
1547
1785
|
label {
|
1548
|
-
|
1549
|
-
|
1786
|
+
text "Right-Click on the Text to\nPop Up a Context Menu"
|
1787
|
+
font height: 50
|
1788
|
+
|
1550
1789
|
menu {
|
1551
1790
|
menu {
|
1552
1791
|
text '&History'
|
@@ -1555,7 +1794,7 @@ shell { |shell_proxy|
|
|
1555
1794
|
menu_item {
|
1556
1795
|
text 'File 1'
|
1557
1796
|
on_widget_selected {
|
1558
|
-
message_box
|
1797
|
+
message_box {
|
1559
1798
|
text 'File 1'
|
1560
1799
|
message 'File 1 Contents'
|
1561
1800
|
}.open
|
@@ -1564,13 +1803,34 @@ shell { |shell_proxy|
|
|
1564
1803
|
menu_item {
|
1565
1804
|
text 'File 2'
|
1566
1805
|
on_widget_selected {
|
1567
|
-
message_box
|
1806
|
+
message_box {
|
1568
1807
|
text 'File 2'
|
1569
1808
|
message 'File 2 Contents'
|
1570
1809
|
}.open
|
1571
1810
|
}
|
1572
1811
|
}
|
1573
1812
|
}
|
1813
|
+
menu {
|
1814
|
+
text '&Archived'
|
1815
|
+
menu_item {
|
1816
|
+
text 'File 3'
|
1817
|
+
on_widget_selected {
|
1818
|
+
message_box {
|
1819
|
+
text 'File 3'
|
1820
|
+
message 'File 3 Contents'
|
1821
|
+
}.open
|
1822
|
+
}
|
1823
|
+
}
|
1824
|
+
menu_item {
|
1825
|
+
text 'File 4'
|
1826
|
+
on_widget_selected {
|
1827
|
+
message_box {
|
1828
|
+
text 'File 4'
|
1829
|
+
message 'File 4 Contents'
|
1830
|
+
}.open
|
1831
|
+
}
|
1832
|
+
}
|
1833
|
+
}
|
1574
1834
|
}
|
1575
1835
|
}
|
1576
1836
|
}
|
@@ -2374,7 +2634,7 @@ shell {
|
|
2374
2634
|
|
2375
2635
|
Check out [Hello, Table!](#hello-table) for an actual example including table editors.
|
2376
2636
|
|
2377
|
-
[Are We There Yet?](#are-we-there-yet) is an actual production Glimmer application that takes full advantage of table capabilities.
|
2637
|
+
[Are We There Yet?](#are-we-there-yet) is an actual production Glimmer application that takes full advantage of table capabilities, storing model data in a database via ActiveRecord. As such, it's an excellent demonstration of how to use Glimmer DSL for SWT with a database.
|
2378
2638
|
|
2379
2639
|
##### Table Sorting
|
2380
2640
|
|
@@ -3286,15 +3546,14 @@ Glimmer Meta-Sample Code Example:
|
|
3286
3546
|
|
3287
3547
|
```ruby
|
3288
3548
|
# ...
|
3289
|
-
code_text {
|
3290
|
-
text bind(SampleDirectory, 'selected_sample.
|
3291
|
-
editable
|
3292
|
-
caret nil
|
3549
|
+
@code_text = code_text {
|
3550
|
+
text bind(SampleDirectory, 'selected_sample.code', read_only: true)
|
3551
|
+
editable bind(SampleDirectory, 'selected_sample.editable')
|
3293
3552
|
}
|
3294
3553
|
# ...
|
3295
3554
|
```
|
3296
3555
|
|
3297
|
-
To use, simply use `code_text` in place of `text` or `styled_text` widget. If you set its `text` value to Ruby code, it automatically styles it with syntax highlighting.
|
3556
|
+
To use, simply use `code_text` in place of the `text` or `styled_text` widget. If you set its `text` value to Ruby code, it automatically styles it with syntax highlighting.
|
3298
3557
|
|
3299
3558
|
#### Video Widget
|
3300
3559
|
|
@@ -3625,7 +3884,7 @@ https://www.eclipse.org/nebula/
|
|
3625
3884
|
|
3626
3885
|
## Samples
|
3627
3886
|
|
3628
|
-
Check the [samples](samples) directory in [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) for examples on how to write Glimmer applications. To run a sample, make sure to install the `glimmer` gem first and then use the `glimmer` command to run it (alternatively, you may clone the repo, follow [CONTRIBUTING.md](CONTRIBUTING.md) instructions, and run samples locally with development glimmer command: `bin/glimmer`).
|
3887
|
+
Check the [samples](samples) directory in [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) for examples on how to write Glimmer applications. To run a sample, make sure to install the `glimmer` gem first and then use the `glimmer samples` command to run it (alternatively, you may clone the repo, follow [CONTRIBUTING.md](CONTRIBUTING.md) instructions, and run samples locally with development glimmer command: `bin/glimmer`).
|
3629
3888
|
|
3630
3889
|
You may run any sample via this command:
|
3631
3890
|
|
@@ -3637,6 +3896,8 @@ This brings up the [Glimmer Meta-Sample (The Sample of Samples)](samples/elabora
|
|
3637
3896
|
|
3638
3897
|
![Glimmer Meta-Sample](images/glimmer-meta-sample.png)
|
3639
3898
|
|
3899
|
+
You may edit the code of any sample before launching it by clicking on the "Launch" button. This helps you learn by experimenting with Glimmer GUI DSL syntax. To go back to original code, simply hit the "Reset" button.
|
3900
|
+
|
3640
3901
|
### Hello Samples
|
3641
3902
|
|
3642
3903
|
For hello-type simple samples, check the following.
|
@@ -3732,15 +3993,47 @@ Code:
|
|
3732
3993
|
|
3733
3994
|
#### Hello, Menu Bar!
|
3734
3995
|
|
3735
|
-
This sample demonstrates menus in Glimmer.
|
3996
|
+
This sample demonstrates menus in Glimmer, including accelerators on the Mac.
|
3736
3997
|
|
3737
3998
|
Code:
|
3738
3999
|
|
3739
4000
|
[samples/hello/hello_menu_bar.rb](samples/hello/hello_menu_bar.rb)
|
3740
4001
|
|
3741
4002
|
![Hello Menu Bar](images/glimmer-hello-menu-bar.png)
|
4003
|
+
|
3742
4004
|
![Hello Menu Bar File Menu](images/glimmer-hello-menu-bar-file-menu.png)
|
3743
|
-
|
4005
|
+
|
4006
|
+
The Mac Menu includes Accelerator Keys (keyboard shortcuts).
|
4007
|
+
|
4008
|
+
![Hello Menu Bar File Menu Mac Accelerators](images/glimmer-hello-menu-bar-file-menu-mac-accelerators.png)
|
4009
|
+
|
4010
|
+
![Hello Menu Bar Edit Menu](images/glimmer-hello-menu-bar-edit-menu.png)
|
4011
|
+
|
4012
|
+
The Mac Menu includes Accelerator Keys (keyboard shortcuts).
|
4013
|
+
|
4014
|
+
![Hello Menu Bar Edit Menu Mac Accelerators](images/glimmer-hello-menu-bar-edit-menu-mac-accelerators.png)
|
4015
|
+
|
4016
|
+
![Hello Menu Bar Options Menu Disabled](images/glimmer-hello-menu-bar-options-menu-disabled.png)
|
4017
|
+
|
4018
|
+
![Hello Menu Bar Options Menu Select One](images/glimmer-hello-menu-bar-options-menu-select-one.png)
|
4019
|
+
|
4020
|
+
![Hello Menu Bar Options Menu Select Multiple](images/glimmer-hello-menu-bar-options-menu-select-multiple.png)
|
4021
|
+
|
4022
|
+
![Hello Menu Bar Format Menu Background Color](images/glimmer-hello-menu-bar-format-menu-background-color.png)
|
4023
|
+
|
4024
|
+
![Hello Menu Bar Format Menu Foreground Color](images/glimmer-hello-menu-bar-format-menu-foreground-color.png)
|
4025
|
+
|
4026
|
+
![Hello Menu Bar View Menu](images/glimmer-hello-menu-bar-view-menu.png)
|
4027
|
+
|
4028
|
+
![Hello Menu Bar View Small](images/glimmer-hello-menu-bar-view-small.png)
|
4029
|
+
|
4030
|
+
![Hello Menu Bar View Large](images/glimmer-hello-menu-bar-view-large.png)
|
4031
|
+
|
4032
|
+
![Hello Menu Bar Help Menu](images/glimmer-hello-menu-bar-help-menu.png)
|
4033
|
+
|
4034
|
+
The Mac Menu includes Accelerator Keys (keyboard shortcuts) and Mac built-in Search.
|
4035
|
+
|
4036
|
+
![Hello Menu Bar Help Menu Mac Accelerators](images/glimmer-hello-menu-bar-help-menu-mac-accelerators.png)
|
3744
4037
|
|
3745
4038
|
#### Hello, Pop Up Context Menu!
|
3746
4039
|
|
@@ -4048,6 +4341,22 @@ Hello, Link! Clicked
|
|
4048
4341
|
|
4049
4342
|
![Hello Link Clicked](images/glimmer-hello-link-clicked.png)
|
4050
4343
|
|
4344
|
+
#### Hello, Dialog!
|
4345
|
+
|
4346
|
+
This sample demonstrates the use of the `dialog` widget in Glimmer, which provides a modal `shell` that blocks shells beneath it until closed. And unlike `message_box`, it can contain arbitrary widgets (not just a message).
|
4347
|
+
|
4348
|
+
Code:
|
4349
|
+
|
4350
|
+
[samples/hello/hello_dialog.rb](samples/hello/hello_dialog.rb)
|
4351
|
+
|
4352
|
+
Hello, Dialog!
|
4353
|
+
|
4354
|
+
![Hello Dialog](images/glimmer-hello-dialog.png)
|
4355
|
+
|
4356
|
+
Hello, Dialog! Open Dialog
|
4357
|
+
|
4358
|
+
![Hello Dialog Open Dialog](images/glimmer-hello-dialog-open-dialog.png)
|
4359
|
+
|
4051
4360
|
### Elaborate Samples
|
4052
4361
|
|
4053
4362
|
For more elaborate samples, check the following:
|
@@ -4367,7 +4676,7 @@ Here is a list of notable 3rd party gems used by Glimmer:
|
|
4367
4676
|
|
4368
4677
|
## Glimmer Process
|
4369
4678
|
|
4370
|
-
[Glimmer Process](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md) is the lightweight software development process used for building Glimmer libraries and Glimmer apps, which goes beyond Agile, rendering all Agile processes obsolete. [Glimmer Process](PROCESS.md) is simply made up of 7 guidelines to pick and choose as necessary until software development needs are satisfied.
|
4679
|
+
[Glimmer Process](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md) is the lightweight software development process used for building Glimmer libraries and Glimmer apps, which goes beyond Agile, rendering all Agile processes obsolete. [Glimmer Process](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md) is simply made up of 7 guidelines to pick and choose as necessary until software development needs are satisfied.
|
4371
4680
|
|
4372
4681
|
Learn more by reading the [GPG](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md) (Glimmer Process Guidelines)
|
4373
4682
|
|
@@ -4437,7 +4746,7 @@ If your company would like to invest fulltime in further development of the Glim
|
|
4437
4746
|
|
4438
4747
|
[MIT](LICENSE.txt)
|
4439
4748
|
|
4440
|
-
Copyright (c) 2007-
|
4749
|
+
Copyright (c) 2007-2021 - Andy Maleh.
|
4441
4750
|
|
4442
4751
|
--
|
4443
4752
|
|