glimmer-dsl-swt 4.18.0.0 → 4.18.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +52 -0
- data/LICENSE.txt +1 -1
- data/README.md +571 -55
- 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 +26 -17
- data/lib/ext/glimmer.rb +1 -1
- data/lib/ext/glimmer/config.rb +7 -7
- 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/animation_expression.rb +43 -0
- 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 +5 -4
- 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 +8 -6
- 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 +4 -4
- 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/shape_expression.rb +56 -0
- 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 +7 -3
- 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 +6 -6
- data/lib/glimmer/rake_task/package.rb +1 -1
- data/lib/glimmer/rake_task/scaffold.rb +33 -34
- data/lib/glimmer/swt/color_proxy.rb +1 -1
- data/lib/glimmer/swt/cursor_proxy.rb +1 -1
- data/lib/glimmer/swt/custom/animation.rb +243 -0
- data/lib/glimmer/swt/custom/checkbox_group.rb +1 -1
- data/lib/glimmer/swt/custom/code_text.rb +2 -1
- data/lib/glimmer/swt/custom/drawable.rb +43 -0
- data/lib/glimmer/swt/custom/radio_group.rb +1 -1
- data/lib/glimmer/swt/custom/shape.rb +193 -0
- 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 +17 -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 +4 -4
- data/lib/glimmer/swt/image_proxy.rb +1 -1
- data/lib/glimmer/swt/layout_data_proxy.rb +1 -1
- data/lib/glimmer/swt/layout_proxy.rb +1 -1
- data/lib/glimmer/swt/menu_proxy.rb +1 -1
- data/lib/glimmer/swt/message_box_proxy.rb +1 -1
- data/lib/glimmer/swt/packages.rb +1 -1
- data/lib/glimmer/swt/properties.rb +49 -0
- data/lib/glimmer/swt/sash_form_proxy.rb +1 -1
- data/lib/glimmer/swt/scrolled_composite_proxy.rb +1 -1
- data/lib/glimmer/swt/shell_proxy.rb +3 -2
- data/lib/glimmer/swt/style_constantizable.rb +1 -1
- 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 +5 -23
- 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 +3 -1
- 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 +1 -1
- data/samples/hello/hello_button.rb +1 -1
- data/samples/hello/hello_canvas.rb +63 -0
- data/samples/hello/hello_canvas_animation.rb +66 -0
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- data/samples/hello/hello_message_box.rb +1 -1
- data/samples/hello/hello_pop_up_context_menu.rb +1 -1
- 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
- metadata +37 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beefdf4e3985d47de8a553ea073466812c89a738a1efa691bac62a9d375bb5b9
|
4
|
+
data.tar.gz: ed6373191af3b73886ae171313d0fbcd279205c883f887e2c940cbc0318275a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52eaa3d36b54333a9c457233a00de3975c3e932f99ef7b9b484fdff20c6f96ea2b7465a63f6e2cc46b91b86a3631edef913643b2303103fc2901920402459bea
|
7
|
+
data.tar.gz: 84273ec05bc34a8a233d403edba5ad372a631560252cfec36d3d5bd200410a1a0f9184e07ebb77d0241ae3ea723d6c7575f7441575a61115f53d9c302fb54fb5
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,57 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 4.18.2.0
|
4
|
+
|
5
|
+
- Canvas animation start method (useful if animation had a frame count limit or cycle count limit and needed to be started again after it stopped)
|
6
|
+
- Canvas animation stop method
|
7
|
+
- Canvas animation restart method (restarts from frame 1)
|
8
|
+
- Canvas animation started? # meaning it is animating
|
9
|
+
- Canvas animation stopped? # meaning it has stopped animating
|
10
|
+
- Canvas animation duration_limit option
|
11
|
+
- Make gradient/round rectangles in Shape DSL receive an option of `gradient: true` and `round: true` instead of prefix
|
12
|
+
- Canvas Shape DSL support for Background/Foreground Pattern (NOTE: not extensively tested yet)
|
13
|
+
- Canvas Shape DSL smart defaults for background/foreground depending on shape being drawn
|
14
|
+
- Canvas Shape DSL smart defaults for fill option depending on shape being drawn
|
15
|
+
- Added fallback font "Courier" for `code_text` widget when "Consolas" is not available.
|
16
|
+
|
17
|
+
### 4.18.1.1
|
18
|
+
|
19
|
+
- Add smart defaults for round rectangle angles (defaults to 60 degrees angles)
|
20
|
+
- Add smart default for gradient rectangle vertical option
|
21
|
+
- Small update to Hello, Canvas! Sample
|
22
|
+
- Convert SWT style symbol to SWT style integer if method takes integer but receives a symbol (or string)
|
23
|
+
- Make polygon not require [] for its array args
|
24
|
+
- Allow cycle to receive splatted array as varargs
|
25
|
+
- Change references to `Display.setAppName` and `Display.setAppVersion` to `Display.app_name =` and `Display.app_version =`
|
26
|
+
- Default Glimmer app name to "Glimmer" (instead of previous "SWT") unless `Display.app_name = "Somename"` is set by consumer before instantiating first display
|
27
|
+
- Set default background to system widget background default for fill shapes
|
28
|
+
- Set default foreground to black for draw shapes
|
29
|
+
- Fix issue with shapes always requiring a block (even an empty one) to render
|
30
|
+
- Fix issue with animation requiring changes to canvas directly in addition to shapes
|
31
|
+
- Fix issue with `glimmer list:gems:dsl` command
|
32
|
+
- Fix issue with scaffolding still depending on git-glimmer despite being merged back to git gem
|
33
|
+
|
34
|
+
### 4.18.1.0
|
35
|
+
|
36
|
+
- Canvas Shape DSL
|
37
|
+
- Hello, Canvas! Sample
|
38
|
+
- Animation DSL
|
39
|
+
- Hello, Canvas Animation! Sample
|
40
|
+
- Fixed issue with async_exec not working in ShellProxy when delegate widget is nil
|
41
|
+
|
42
|
+
### 4.18.0.2
|
43
|
+
|
44
|
+
- Minor update on Hello, Dialog! Sample
|
45
|
+
- Upgrade to glimmer v1.0.7
|
46
|
+
|
47
|
+
### 4.18.0.1
|
48
|
+
|
49
|
+
- Hello, Dialog! Sample
|
50
|
+
- Added Glimmer icon to Glimmer Meta-Sample (Sample of Samples)
|
51
|
+
- Upgrade Scaffolded projects to JRuby v9.2.14.0
|
52
|
+
- Switch back to official git gem v1.8.1 now that glimmer-git gem branch is merged into it
|
53
|
+
- Fix issue with not reporting exception encountered in editing a tree item if consumer code had a bug
|
54
|
+
|
3
55
|
### 4.18.0.0
|
4
56
|
|
5
57
|
- Upgrade to SWT v4.18
|
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.18.
|
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.2.0
|
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,7 +12,7 @@
|
|
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
|
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 by 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. Not only does Glimmer provide a large set of GUI [widgets](#widgets), but also supports drawing Canvas Graphics like [Shapes](#canvas-shape-dsl) and [Animations](#canvas-animation-dsl). 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
|
|
@@ -20,14 +21,14 @@ Gem version numbers are in sync with the SWT library versions. The first two dig
|
|
20
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)
|
@@ -284,6 +286,8 @@ Glimmer App:
|
|
284
286
|
- [Cursor](#cursor)
|
285
287
|
- [Layouts](#layouts)
|
286
288
|
- [Layout Data](#layout-data)
|
289
|
+
- [Canvas Shape DSL](#canvas-shape-dsl)
|
290
|
+
- [Canvas Animation DSL](#canvas-animation-dsl)
|
287
291
|
- [Data-Binding](#data-binding)
|
288
292
|
- [General Examples](#general-examples)
|
289
293
|
- [Combo](#combo)
|
@@ -356,6 +360,9 @@ Glimmer App:
|
|
356
360
|
- [Hello, Table!](#hello-table)
|
357
361
|
- [Hello, Button!](#hello-button)
|
358
362
|
- [Hello, Link!](#hello-link)
|
363
|
+
- [Hello, Dialog!](#hello-dialog)
|
364
|
+
- [Hello, Canvas!](#hello-canvas)
|
365
|
+
- [Hello, Canvas Animation!](#hello-canvas-animation)
|
359
366
|
- [Elaborate Samples](#elaborate-samples)
|
360
367
|
- [User Profile](#user-profile)
|
361
368
|
- [Login](#login)
|
@@ -449,7 +456,8 @@ jgem install glimmer-dsl-swt
|
|
449
456
|
|
450
457
|
Or this command if you want a specific version:
|
451
458
|
```
|
452
|
-
jgem install glimmer-dsl-swt -v 4.18.
|
459
|
+
jgem install glimmer-dsl-swt -v 4.18.2.0
|
460
|
+
|
453
461
|
|
454
462
|
```
|
455
463
|
|
@@ -468,7 +476,8 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
468
476
|
|
469
477
|
Add the following to `Gemfile`:
|
470
478
|
```
|
471
|
-
gem 'glimmer-dsl-swt', '~> 4.18.
|
479
|
+
gem 'glimmer-dsl-swt', '~> 4.18.2.0
|
480
|
+
'
|
472
481
|
```
|
473
482
|
|
474
483
|
And, then run:
|
@@ -526,7 +535,8 @@ bin/glimmer samples
|
|
526
535
|
Below are the full usage instructions that come up when running `glimmer` without args.
|
527
536
|
|
528
537
|
```
|
529
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.18.
|
538
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.18.2.0
|
539
|
+
|
530
540
|
|
531
541
|
|
532
542
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
@@ -583,6 +593,8 @@ glimmer samples/hello/hello_world.rb samples/hello/hello_tab.rb
|
|
583
593
|
|
584
594
|
Launches samples/hello/hello_world.rb and samples/hello_tab.rb at the same time, each in a separate JRuby thread.
|
585
595
|
|
596
|
+
Note: under Zsh (Z Shell), glimmer can only be used in its advanced TUI mode (e.g. `glimmer` and then selecting a task) not the primitive rake task mode (e.g. `glimmer scaffold[app]`)
|
597
|
+
|
586
598
|
### Glimmer Samples
|
587
599
|
|
588
600
|
You can list available Glimmer samples by running:
|
@@ -1003,8 +1015,9 @@ Output:
|
|
1003
1015
|
Name Gem Version Author Description
|
1004
1016
|
|
1005
1017
|
Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
|
1006
|
-
Opal glimmer-dsl-opal 0.
|
1007
|
-
Swt glimmer-dsl-swt 4.18.
|
1018
|
+
Opal glimmer-dsl-opal 0.10.2 AndyMaleh Glimmer DSL for Opal
|
1019
|
+
Swt glimmer-dsl-swt 4.18.2.0
|
1020
|
+
|
1008
1021
|
AndyMaleh Glimmer DSL for SWT
|
1009
1022
|
Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
|
1010
1023
|
Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
|
@@ -1085,7 +1098,7 @@ Keep in mind that all samples live under [https://github.com/AndyObtiva/glimmer-
|
|
1085
1098
|
|
1086
1099
|
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
1100
|
|
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:
|
1101
|
+
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
1102
|
|
1090
1103
|
```ruby
|
1091
1104
|
include Glimmer
|
@@ -1271,12 +1284,73 @@ shell {
|
|
1271
1284
|
}.open
|
1272
1285
|
```
|
1273
1286
|
|
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.
|
1287
|
+
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
1288
|
|
1276
1289
|
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
1290
|
|
1278
1291
|
https://www.eclipse.org/nebula/
|
1279
1292
|
|
1293
|
+
#### Glimmer GUI DSL Keywords
|
1294
|
+
|
1295
|
+
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.
|
1296
|
+
|
1297
|
+
**Widgets:**
|
1298
|
+
- `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)
|
1299
|
+
- `browser`: featured in [Hello, Browser!](#hello-browser)
|
1300
|
+
- `calendar`: featured in [Hello, Date Time!](#hello-date-time)
|
1301
|
+
- `checkbox`: featured in [Hello, Checkbox Group!](#hello-checkbox-group) / [Hello, Checkbox!](#hello-checkbox)
|
1302
|
+
- `checkbox_group`: featured in [Hello, Checkbox Group!](#hello-checkbox-group)
|
1303
|
+
- `combo`: featured in [Hello, Table!](#hello-table) / [Hello, Combo!](#hello-combo)
|
1304
|
+
- `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)
|
1305
|
+
- `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)
|
1306
|
+
- `date_drop_down`: featured in [Hello, Table!](#hello-table) / [Hello, Date Time!](#hello-date-time)
|
1307
|
+
- `group`: featured in [Hello, Group!](#hello-group) / [Contact Manager](#contact-manager)
|
1308
|
+
- `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)
|
1309
|
+
- `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)
|
1310
|
+
- `menu`: featured in [Hello, Menu Bar!](#hello-menu-bar) / [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu) / [Hello, Table!](#hello-table)
|
1311
|
+
- `menu_bar`: featured in [Hello, Menu Bar!](#hello-menu-bar)
|
1312
|
+
- `menu_item`: featured in [Hello, Table!](#hello-table) / [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu) / [Hello, Menu Bar!](#hello-menu-bar)
|
1313
|
+
- `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)
|
1314
|
+
- `radio`: featured in [Hello, Radio!](#hello-radio) / [Hello, Group!](#hello-group)
|
1315
|
+
- `radio_group`: featured in [Hello, Radio Group!](#hello-radio-group)
|
1316
|
+
- `scrolled_composite`
|
1317
|
+
- `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)
|
1318
|
+
- `tab_folder`: featured in [Hello, Tab!](#hello-tab)
|
1319
|
+
- `tab_item`: featured in [Hello, Tab!](#hello-tab)
|
1320
|
+
- `table`: featured in [Hello, Custom Shell!](#hello-custom-shell) / [Hello, Table!](#hello-table) / [Contact Manager](#contact-manager)
|
1321
|
+
- `table_column`: featured in [Hello, Table!](#hello-table) / [Hello, Custom Shell!](#hello-custom-shell) / [Contact Manager](#contact-manager)
|
1322
|
+
- `text`: featured in [Hello, Computed!](#hello-computed) / [Login](#login) / [Contact Manager](#contact-manager)
|
1323
|
+
- `time`: featured in [Hello, Table!](#hello-table) / [Hello, Date Time!](#hello-date-time)
|
1324
|
+
- Glimmer::UI::CustomWidget: ability to define any keyword as a custom widget - featured in [Hello, Custom Widget!](#hello-custom-widget)
|
1325
|
+
- 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)
|
1326
|
+
|
1327
|
+
**Layouts:**
|
1328
|
+
- `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)
|
1329
|
+
- `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)
|
1330
|
+
- `fill_layout`: featured in [Hello, Custom Widget!](#hello-custom-widget)
|
1331
|
+
- `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)
|
1332
|
+
|
1333
|
+
**Graphics/Style:**
|
1334
|
+
- `color`: featured in [Hello, Custom Widget!](#hello-custom-widget) / [Hello, Menu Bar!](#hello-menu-bar)
|
1335
|
+
- `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)
|
1336
|
+
- `Point` class used in setting location on widgets
|
1337
|
+
- `swt` and `SWT` class to set SWT styles on widgets - featured in [Hello, Custom Shell!](#hello-custom-shell) / [Login](#login) / [Contact Manager](#contact-manager)
|
1338
|
+
|
1339
|
+
**Data-Binding/Observers:**
|
1340
|
+
- `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)
|
1341
|
+
- `observe`: featured in [Hello, Table!](#hello-table) / [Tic Tac Toe](#tic-tac-toe)
|
1342
|
+
- `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)
|
1343
|
+
- `on_modify_text`
|
1344
|
+
- `on_key_pressed` (and SWT alias `on_swt_keydown`) - featured in [Login](#login) / [Contact Manager](#contact-manager)
|
1345
|
+
- `on_key_released` (and SWT alias `on_swt_keyup`)
|
1346
|
+
- `on_mouse_down` (and SWT alias `on_swt_mousedown`)
|
1347
|
+
- `on_mouse_up` (and SWT alias `on_swt_mouseup`) - featured in [Hello, Custom Shell!](#hello-custom-shell) / [Contact Manager](#contact-manager)
|
1348
|
+
|
1349
|
+
**Event loop:**
|
1350
|
+
- `display`: featured in [Tic Tac Toe](#tic-tac-toe)
|
1351
|
+
- `async_exec`: featured in [Hello, Custom Widget!](#hello-custom-widget) / [Hello, Custom Shell!](#hello-custom-shell)
|
1352
|
+
|
1353
|
+
|
1280
1354
|
#### SWT Proxies
|
1281
1355
|
|
1282
1356
|
Glimmer follows Proxy Design Pattern by having Ruby proxy wrappers for all SWT objects:
|
@@ -1361,9 +1435,11 @@ Dialog is a variation on Shell. It is basically a shell that is modal (blocks wh
|
|
1361
1435
|
|
1362
1436
|
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
1437
|
|
1438
|
+
Check out [Hello, Dialog!](#hello-dialog) sample to learn more.
|
1439
|
+
|
1364
1440
|
##### message_box
|
1365
1441
|
|
1366
|
-
The Glimmer DSL `message_box` keyword is similar to `shell`, but renders a modal dialog with a title `text` property
|
1442
|
+
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
1443
|
|
1368
1444
|
Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
1369
1445
|
|
@@ -1477,47 +1553,54 @@ The ampersand symbol indicates the keyboard shortcut key for the menu item (e.g.
|
|
1477
1553
|
Example of a Menu Bar (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
1478
1554
|
|
1479
1555
|
```ruby
|
1480
|
-
|
1556
|
+
include Glimmer
|
1557
|
+
|
1558
|
+
COLORS = [:white, :red, :yellow, :green, :blue, :magenta, :gray, :black]
|
1559
|
+
|
1560
|
+
shell {
|
1561
|
+
grid_layout {
|
1562
|
+
margin_width 0
|
1563
|
+
margin_height 0
|
1564
|
+
}
|
1565
|
+
|
1481
1566
|
text 'Hello, Menu Bar!'
|
1482
|
-
|
1483
|
-
label(:center) {
|
1484
|
-
font height:
|
1485
|
-
text 'Check Out The
|
1567
|
+
|
1568
|
+
@label = label(:center) {
|
1569
|
+
font height: 50
|
1570
|
+
text 'Check Out The Menu Bar Above!'
|
1486
1571
|
}
|
1572
|
+
|
1487
1573
|
menu_bar {
|
1488
1574
|
menu {
|
1489
1575
|
text '&File'
|
1490
1576
|
menu_item {
|
1491
|
-
text 'E&xit'
|
1492
|
-
}
|
1493
|
-
menu_item(0) {
|
1494
1577
|
text '&New'
|
1578
|
+
accelerator :command, :N
|
1579
|
+
|
1495
1580
|
on_widget_selected {
|
1496
|
-
message_box
|
1497
|
-
text 'New
|
1498
|
-
message 'New
|
1581
|
+
message_box {
|
1582
|
+
text 'New'
|
1583
|
+
message 'New file created.'
|
1499
1584
|
}.open
|
1500
1585
|
}
|
1501
1586
|
}
|
1502
|
-
|
1503
|
-
text '&
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1587
|
+
menu_item {
|
1588
|
+
text '&Open...'
|
1589
|
+
accelerator :command, :O
|
1590
|
+
|
1591
|
+
on_widget_selected {
|
1592
|
+
message_box {
|
1593
|
+
text 'Open'
|
1594
|
+
message 'Opening File...'
|
1595
|
+
}.open
|
1510
1596
|
}
|
1511
1597
|
}
|
1512
|
-
}
|
1513
|
-
menu {
|
1514
|
-
text '&History'
|
1515
1598
|
menu {
|
1516
|
-
text '&Recent'
|
1599
|
+
text 'Open &Recent'
|
1517
1600
|
menu_item {
|
1518
1601
|
text 'File 1'
|
1519
1602
|
on_widget_selected {
|
1520
|
-
message_box
|
1603
|
+
message_box {
|
1521
1604
|
text 'File 1'
|
1522
1605
|
message 'File 1 Contents'
|
1523
1606
|
}.open
|
@@ -1526,13 +1609,167 @@ shell { |shell_proxy|
|
|
1526
1609
|
menu_item {
|
1527
1610
|
text 'File 2'
|
1528
1611
|
on_widget_selected {
|
1529
|
-
message_box
|
1612
|
+
message_box {
|
1530
1613
|
text 'File 2'
|
1531
1614
|
message 'File 2 Contents'
|
1532
1615
|
}.open
|
1533
1616
|
}
|
1534
1617
|
}
|
1535
1618
|
}
|
1619
|
+
menu_item(:separator)
|
1620
|
+
menu_item {
|
1621
|
+
text 'E&xit'
|
1622
|
+
|
1623
|
+
on_widget_selected {
|
1624
|
+
exit(0)
|
1625
|
+
}
|
1626
|
+
}
|
1627
|
+
}
|
1628
|
+
menu {
|
1629
|
+
text '&Edit'
|
1630
|
+
menu_item {
|
1631
|
+
text 'Cut'
|
1632
|
+
accelerator :command, :X
|
1633
|
+
}
|
1634
|
+
menu_item {
|
1635
|
+
text 'Copy'
|
1636
|
+
accelerator :command, :C
|
1637
|
+
}
|
1638
|
+
menu_item {
|
1639
|
+
text 'Paste'
|
1640
|
+
accelerator :command, :V
|
1641
|
+
}
|
1642
|
+
}
|
1643
|
+
menu {
|
1644
|
+
text '&Options'
|
1645
|
+
|
1646
|
+
menu_item(:radio) {
|
1647
|
+
text '&Enabled'
|
1648
|
+
|
1649
|
+
on_widget_selected {
|
1650
|
+
@select_one_menu.enabled = true
|
1651
|
+
@select_multiple_menu.enabled = true
|
1652
|
+
}
|
1653
|
+
}
|
1654
|
+
@select_one_menu = menu {
|
1655
|
+
text '&Select One'
|
1656
|
+
enabled false
|
1657
|
+
|
1658
|
+
menu_item(:radio) {
|
1659
|
+
text 'Option 1'
|
1660
|
+
}
|
1661
|
+
menu_item(:radio) {
|
1662
|
+
text 'Option 2'
|
1663
|
+
}
|
1664
|
+
menu_item(:radio) {
|
1665
|
+
text 'Option 3'
|
1666
|
+
}
|
1667
|
+
}
|
1668
|
+
@select_multiple_menu = menu {
|
1669
|
+
text '&Select Multiple'
|
1670
|
+
enabled false
|
1671
|
+
|
1672
|
+
menu_item(:check) {
|
1673
|
+
text 'Option 4'
|
1674
|
+
}
|
1675
|
+
menu_item(:check) {
|
1676
|
+
text 'Option 5'
|
1677
|
+
}
|
1678
|
+
menu_item(:check) {
|
1679
|
+
text 'Option 6'
|
1680
|
+
}
|
1681
|
+
}
|
1682
|
+
}
|
1683
|
+
menu {
|
1684
|
+
text '&Format'
|
1685
|
+
menu {
|
1686
|
+
text '&Background Color'
|
1687
|
+
COLORS.each { |color_style|
|
1688
|
+
menu_item(:radio) {
|
1689
|
+
text color_style.to_s.split('_').map(&:capitalize).join(' ')
|
1690
|
+
|
1691
|
+
on_widget_selected {
|
1692
|
+
@label.background = color_style
|
1693
|
+
}
|
1694
|
+
}
|
1695
|
+
}
|
1696
|
+
}
|
1697
|
+
menu {
|
1698
|
+
text 'Foreground &Color'
|
1699
|
+
COLORS.each { |color_style|
|
1700
|
+
menu_item(:radio) {
|
1701
|
+
text color_style.to_s.split('_').map(&:capitalize).join(' ')
|
1702
|
+
|
1703
|
+
on_widget_selected {
|
1704
|
+
@label.foreground = color_style
|
1705
|
+
}
|
1706
|
+
}
|
1707
|
+
}
|
1708
|
+
}
|
1709
|
+
}
|
1710
|
+
menu {
|
1711
|
+
text '&View'
|
1712
|
+
menu_item(:radio) {
|
1713
|
+
text 'Small'
|
1714
|
+
|
1715
|
+
on_widget_selected {
|
1716
|
+
@label.font = {height: 25}
|
1717
|
+
@label.parent.pack
|
1718
|
+
}
|
1719
|
+
}
|
1720
|
+
menu_item(:radio) {
|
1721
|
+
text 'Medium'
|
1722
|
+
selection true
|
1723
|
+
|
1724
|
+
on_widget_selected {
|
1725
|
+
@label.font = {height: 50}
|
1726
|
+
@label.parent.pack
|
1727
|
+
}
|
1728
|
+
}
|
1729
|
+
menu_item(:radio) {
|
1730
|
+
text 'Large'
|
1731
|
+
|
1732
|
+
on_widget_selected {
|
1733
|
+
@label.font = {height: 75}
|
1734
|
+
@label.parent.pack
|
1735
|
+
}
|
1736
|
+
}
|
1737
|
+
}
|
1738
|
+
menu {
|
1739
|
+
text '&Help'
|
1740
|
+
menu_item {
|
1741
|
+
text '&Manual'
|
1742
|
+
accelerator :command, :shift, :M
|
1743
|
+
|
1744
|
+
on_widget_selected {
|
1745
|
+
message_box {
|
1746
|
+
text 'Manual'
|
1747
|
+
message 'Manual Contents'
|
1748
|
+
}.open
|
1749
|
+
}
|
1750
|
+
}
|
1751
|
+
menu_item {
|
1752
|
+
text '&Tutorial'
|
1753
|
+
accelerator :command, :shift, :T
|
1754
|
+
|
1755
|
+
on_widget_selected {
|
1756
|
+
message_box {
|
1757
|
+
text 'Tutorial'
|
1758
|
+
message 'Tutorial Contents'
|
1759
|
+
}.open
|
1760
|
+
}
|
1761
|
+
}
|
1762
|
+
menu_item(:separator)
|
1763
|
+
menu_item {
|
1764
|
+
text '&Report an Issue...'
|
1765
|
+
|
1766
|
+
on_widget_selected {
|
1767
|
+
message_box {
|
1768
|
+
text 'Report an Issue'
|
1769
|
+
message 'Reporting an issue...'
|
1770
|
+
}.open
|
1771
|
+
}
|
1772
|
+
}
|
1536
1773
|
}
|
1537
1774
|
}
|
1538
1775
|
}.open
|
@@ -1541,12 +1778,20 @@ shell { |shell_proxy|
|
|
1541
1778
|
Example of a Pop Up Context Menu (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
1542
1779
|
|
1543
1780
|
```ruby
|
1544
|
-
|
1781
|
+
include Glimmer
|
1782
|
+
|
1783
|
+
shell {
|
1784
|
+
grid_layout {
|
1785
|
+
margin_width 0
|
1786
|
+
margin_height 0
|
1787
|
+
}
|
1788
|
+
|
1545
1789
|
text 'Hello, Pop Up Context Menu!'
|
1546
|
-
|
1790
|
+
|
1547
1791
|
label {
|
1548
|
-
|
1549
|
-
|
1792
|
+
text "Right-Click on the Text to\nPop Up a Context Menu"
|
1793
|
+
font height: 50
|
1794
|
+
|
1550
1795
|
menu {
|
1551
1796
|
menu {
|
1552
1797
|
text '&History'
|
@@ -1555,7 +1800,7 @@ shell { |shell_proxy|
|
|
1555
1800
|
menu_item {
|
1556
1801
|
text 'File 1'
|
1557
1802
|
on_widget_selected {
|
1558
|
-
message_box
|
1803
|
+
message_box {
|
1559
1804
|
text 'File 1'
|
1560
1805
|
message 'File 1 Contents'
|
1561
1806
|
}.open
|
@@ -1564,13 +1809,34 @@ shell { |shell_proxy|
|
|
1564
1809
|
menu_item {
|
1565
1810
|
text 'File 2'
|
1566
1811
|
on_widget_selected {
|
1567
|
-
message_box
|
1812
|
+
message_box {
|
1568
1813
|
text 'File 2'
|
1569
1814
|
message 'File 2 Contents'
|
1570
1815
|
}.open
|
1571
1816
|
}
|
1572
1817
|
}
|
1573
1818
|
}
|
1819
|
+
menu {
|
1820
|
+
text '&Archived'
|
1821
|
+
menu_item {
|
1822
|
+
text 'File 3'
|
1823
|
+
on_widget_selected {
|
1824
|
+
message_box {
|
1825
|
+
text 'File 3'
|
1826
|
+
message 'File 3 Contents'
|
1827
|
+
}.open
|
1828
|
+
}
|
1829
|
+
}
|
1830
|
+
menu_item {
|
1831
|
+
text 'File 4'
|
1832
|
+
on_widget_selected {
|
1833
|
+
message_box {
|
1834
|
+
text 'File 4'
|
1835
|
+
message 'File 4 Contents'
|
1836
|
+
}.open
|
1837
|
+
}
|
1838
|
+
}
|
1839
|
+
}
|
1574
1840
|
}
|
1575
1841
|
}
|
1576
1842
|
}
|
@@ -2025,6 +2291,179 @@ Also, for a reference, check the SWT API:
|
|
2025
2291
|
|
2026
2292
|
https://help.eclipse.org/2019-12/nftopic/org.eclipse.platform.doc.isv/reference/api/index.html
|
2027
2293
|
|
2294
|
+
|
2295
|
+
### Canvas Shape DSL
|
2296
|
+
|
2297
|
+
Glimmer supports drawing graphics directly on a `canvas` widget via SWT (or any widget for that matter though `canvas` is recommended for drawing).
|
2298
|
+
|
2299
|
+
This is accomplished via the Shape DSL a sub-DSL of the Glimmer GUI DSL, which makes it possible to draw graphics declaratively with very understandable and maintainable syntax.
|
2300
|
+
|
2301
|
+
Shape keywords and their args (including defaults) are listed below (they basically match method names and arguments on [org.eclipse.swt.graphics.GC](https://help.eclipse.org/2020-12/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/graphics/GC.html) minus the `draw` or `fill` prefix in downcase):
|
2302
|
+
- `arc(x, y, width, height, startAngle, arcAngle, fill: false)` arc is part of a circle within an oval area, denoted by start angle (degrees) and end angle (degrees)
|
2303
|
+
- `focus(x, y, width, height)` this is just like rectangle but its foreground color is always that of the OS widget focus color (useful when capturing user interaction via a shape)
|
2304
|
+
- `image(image, x, y)` [image](#image)
|
2305
|
+
- `line(x1, y1, x2, y2)` line
|
2306
|
+
- `oval(x, y, width, height, fill: false)` oval if width does not match heigh and circle if width matches height. Can be optionally filled.
|
2307
|
+
- `point(x, y)` point
|
2308
|
+
- `polygon(pointArray, fill: false)` polygon consisting of points, which close automatically to form a shape that can be optionally filled (when points only form a line, it does not show up as filled)
|
2309
|
+
- `polyline(pointArray)` polyline is just like a polygon, but it does not close up to form a shape, remaining open (unless the points close themselves by having the last point or an intermediate point match the first)
|
2310
|
+
- `rectangle(x, y, width, height, fill: false)` standard rectangle, which can be optionally filled
|
2311
|
+
- `rectangle(x, y, width, height, arcWidth = 60, arcHeight = 60, fill: false, round: true)` round rectangle, which can be optionally filled, and takes optional extra round angle arguments
|
2312
|
+
- `rectangle(x, y, width, height, vertical = true, fill: true, gradient: true)` gradient rectangle, which is always filled, and takes an optional extra argument to specify true for vertical gradient (default) and false for horizontal gradient
|
2313
|
+
- `text(string, x, y, flags = nil)` text with optional flags (flag format is `swt(comma_separated_flags)` where flags can be :draw_delimiter (i.e. new lines), :draw_tab, :draw_mnemonic, and :draw_transparent as explained in [GC API](https://help.eclipse.org/2020-12/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/graphics/GC.html))
|
2314
|
+
|
2315
|
+
Shape keywords that can be filled with color can take an keyword argument `fill: true` (defaults to false when not specified)
|
2316
|
+
|
2317
|
+
Optionally, a shape keyword takes a block that can set any attributes from [org.eclipse.swt.graphics.GC](https://help.eclipse.org/2020-12/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/graphics/GC.html) (methods starting with `set`), which enable setting the `background` for filling and `foreground` for drawing.
|
2318
|
+
|
2319
|
+
Here is a list of supported attributes nestable within a block under shapes:
|
2320
|
+
- `advanced` enables advanced graphics subsystem (boolean value). Typically gets enabled automatically when setting alpha, antialias, patterns, interpolation, clipping. Rendering sometimes differs between advanced and non-advanced mode for basic graphics too, so you could enable manually if you prefer its look even for basic graphics.
|
2321
|
+
- `alpha` sets transparency (integer between `0` and `255`)
|
2322
|
+
- `antialias` enables antialiasing (SWT style value of `:default`, `:off`, `:on` whereby `:default` applies OS default, which varies per OS)
|
2323
|
+
- `background` sets fill color for fillable shapes (standard color symbol (e.g. `:red`), `rgb(red_integer, green_integer, blue_integer)` color, or Color/ColorProxy object directly)
|
2324
|
+
- `background_pattern` sets fill gradient/image pattern for fillable shape background (takes the same arguments as the SWT [Pattern](https://help.eclipse.org/2020-12/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/graphics/Pattern.html) class [e.g. `background_pattern 2.3, 4.2, 5.4, 7.2, :red, :blue`] / note: this feature isn't extensively tested yet)
|
2325
|
+
- `clipping` clips area of painting (numeric values for `(x, y, width, height)`)
|
2326
|
+
- `fill_rule` sets filling rule (SWT style value of `:fill_even_odd` or `:fill_winding`)
|
2327
|
+
- `font` sets font (Hash of `:name`, `:height`, and `:style` just like standard widget font property, or Font/FontProxy object directly)
|
2328
|
+
- `foreground` sets draw color for drawable shapes (standard color symbol (e.g. `:red`), `rgb(red_integer, green_integer, blue_integer)` color, or Color/ColorProxy object directly)
|
2329
|
+
- `foreground_pattern` sets foreground gradient/image pattern for drawable shape lines (takes the same arguments as the SWT [Pattern](https://help.eclipse.org/2020-12/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/graphics/Pattern.html) class [e.g. `foreground_pattern 2.3, 4.2, 5.4, 7.2, :red, :blue`] / note: this feature isn't extensively tested yet)
|
2330
|
+
- `interpolation` sets the interpolation value (SWT style value of `:default`, `:none`, `:low`, `:high`)
|
2331
|
+
- `line_cap` sets line cap (SWT style value of `:cap_flat`, `:cap_round`, or `:cap_square`)
|
2332
|
+
- `line_dash` line dash float values (automatically sets `line_style` to SWT style value of `:line_custom`)
|
2333
|
+
- `line_join` line join style (SWT style value of `:join_miter`, `:join_round`, or `:join_bevel`)
|
2334
|
+
- `line_style` line join style (SWT style value of `:line_solid`, `:line_dash`, `:line_dot`, `:line_dashdot`, or `:line_dashdotdot`)
|
2335
|
+
- `line_width` line width in integer (used in draw operations)
|
2336
|
+
- `text_anti_alias` enables text antialiasing (SWT style value of `:default`, `:off`, `:on` whereby `:default` applies OS default, which varies per OS)
|
2337
|
+
|
2338
|
+
Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
2339
|
+
|
2340
|
+
```ruby
|
2341
|
+
include Glimmer
|
2342
|
+
|
2343
|
+
shell {
|
2344
|
+
text 'Canvas Example'
|
2345
|
+
minimum_size 320, 400
|
2346
|
+
|
2347
|
+
canvas {
|
2348
|
+
background :yellow
|
2349
|
+
rectangle(0, 0, 220, 400, fill: true) {
|
2350
|
+
background :red
|
2351
|
+
}
|
2352
|
+
rectangle(50, 20, 300, 150, 30, 50, round: true, fill: true) {
|
2353
|
+
background :magenta
|
2354
|
+
}
|
2355
|
+
rectangle(150, 200, 100, 70, true, gradient: true) {
|
2356
|
+
background :dark_magenta
|
2357
|
+
foreground :yellow
|
2358
|
+
}
|
2359
|
+
rectangle(200, 80, 108, 36) {
|
2360
|
+
foreground color(:dark_blue)
|
2361
|
+
}
|
2362
|
+
}
|
2363
|
+
}.open
|
2364
|
+
```
|
2365
|
+
|
2366
|
+
Screenshot:
|
2367
|
+
|
2368
|
+
![Canvas Animation Example](images/glimmer-example-canvas.png)
|
2369
|
+
|
2370
|
+
Learn more at the [Hello, Canvas! Sample](#hello-canvas).
|
2371
|
+
|
2372
|
+
If you get extremely stuck, remember that you could always default to direct [SWT GC usage]([org.eclipse.swt.graphics.GC](https://help.eclipse.org/2020-12/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/graphics/GC.html) and learn more at the [SWT Graphics Guide](https://www.eclipse.org/articles/Article-SWT-graphics/SWT_graphics.html) and [SWT Image Guide](https://www.eclipse.org/articles/Article-SWT-images/graphics-resources.html#Saving%20Images).
|
2373
|
+
|
2374
|
+
Example of manually doing the same things as in the above example without relying on the declarative Glimmer Shape DSL:
|
2375
|
+
|
2376
|
+
```ruby
|
2377
|
+
include Glimmer
|
2378
|
+
|
2379
|
+
shell {
|
2380
|
+
text 'Canvas Manual Example'
|
2381
|
+
minimum_size 320, 400
|
2382
|
+
|
2383
|
+
canvas {
|
2384
|
+
background :yellow
|
2385
|
+
|
2386
|
+
on_paint_control { |event|
|
2387
|
+
event.gc.setBackground(color(:red).swt_color)
|
2388
|
+
event.gc.fillRectangle(0, 0, 220, 400)
|
2389
|
+
|
2390
|
+
event.gc.setBackground(color(:magenta).swt_color)
|
2391
|
+
event.gc.fillRoundRectangle(50, 20, 300, 150, 30, 50)
|
2392
|
+
|
2393
|
+
event.gc.setBackground(color(:dark_magenta).swt_color)
|
2394
|
+
event.gc.fillGradientRectangle(150, 200, 100, 70, true)
|
2395
|
+
|
2396
|
+
event.gc.setForeground(color(:dark_blue).swt_color)
|
2397
|
+
event.gc.drawRectangle(200, 80, 108, 36)
|
2398
|
+
}
|
2399
|
+
}
|
2400
|
+
}.open
|
2401
|
+
```
|
2402
|
+
|
2403
|
+
In any case, if there is anything you would like added to the Glimmer Shape DSL that you saw available in the SWT APIs, you may [report and issue](https://github.com/AndyObtiva/glimmer-dsl-swt/issues) or implement yourself and [contribute](#contributing) via a Pull Request.
|
2404
|
+
|
2405
|
+
### Canvas Animation DSL
|
2406
|
+
|
2407
|
+
(note: this is a very new feature of Glimmer. It may change a bit while getting battle tested. As always, you could default to basic SWT usage if needed.)
|
2408
|
+
|
2409
|
+
Glimmer additionally provides built-in support for animations via a declarative Animation DSL, another sub-DSL of the Glimmer GUI DSL.
|
2410
|
+
|
2411
|
+
Animations take advantage of multi-threading, each animation runs in its own independent thread of execution while updating the GUI asynchronously.
|
2412
|
+
|
2413
|
+
This example says it all (it moves a tiny red square across a blue background) (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
2414
|
+
|
2415
|
+
```ruby
|
2416
|
+
include Glimmer
|
2417
|
+
|
2418
|
+
shell {
|
2419
|
+
text 'Canvas Animation Example'
|
2420
|
+
minimum_size 400, 400
|
2421
|
+
|
2422
|
+
canvas {
|
2423
|
+
animation {
|
2424
|
+
every 0.1
|
2425
|
+
|
2426
|
+
frame { |index|
|
2427
|
+
background rgb(index%100, index%100 + 100, index%55 + 200)
|
2428
|
+
rectangle(index, index, 20, 20, fill: true) {
|
2429
|
+
background :red
|
2430
|
+
}
|
2431
|
+
}
|
2432
|
+
}
|
2433
|
+
}
|
2434
|
+
}.open
|
2435
|
+
```
|
2436
|
+
|
2437
|
+
Screenshot:
|
2438
|
+
|
2439
|
+
![Canvas Animation Example](images/glimmer-example-canvas-animation.png)
|
2440
|
+
|
2441
|
+
Keywords:
|
2442
|
+
- `animation` declares an animation under a canvas, which renders frames using a frame block indefinitely or finitely depending on (cycle_count/frame_count) properties
|
2443
|
+
- `every` specifies delay in seconds between every two frame renders
|
2444
|
+
- `frame` a block that can contain Shape DSL syntax that is rendered dynamically with variables calculated on the fly
|
2445
|
+
- `cycle` a property that takes an array to cycle into a second variable for the `frame` block
|
2446
|
+
- `cycle_count` an optional cycle count limit after which the animation stops
|
2447
|
+
- `frame_count` an optional frame count limit after which the animation stops
|
2448
|
+
- `started` a boolean indicating if the animation is started right away or stopped waiting for manual startup via `#start` method
|
2449
|
+
|
2450
|
+
API of Animation Object (returned from `animation` keyword):
|
2451
|
+
- `#start` starts an animation that is indefinite or has never been started before (i.e. having `started: false` option). Otherwise, resumes a stopped animation that has not been completed.
|
2452
|
+
- `#stop` stops animation. Maintains progress when `frame_count`, `cycle_count`, or `duration_limit` are set and haven't finished. That way, if `#start` is called, animation resumes from where it stopped exactly to completion.
|
2453
|
+
- `#restart` restarts animation, restarting progress of `frame_count`, `cycle_count`, and `duration_limit` if set.
|
2454
|
+
- `#started?` returns whether animation started
|
2455
|
+
- `#stopped?` returns whether animation stopped
|
2456
|
+
- `#indefinite?` (alias `infinite?`) returns true if animation does not have `frame_count`, `cycle_count`, or `duration_limit`
|
2457
|
+
- `#finite?` returns true if animation has `frame_count`, `cycle_count` (with `cycle`), or `duration_limit`
|
2458
|
+
- `#frame_count_limited?` returns true if `frame_count` is specified
|
2459
|
+
- `#cycle_enabled?` returns true if `cycle` is specified
|
2460
|
+
- `#cycle_limited?` returns true if `cycle_count` is specified
|
2461
|
+
- `#duration_limited?` returns true if `duration_limit` is specified
|
2462
|
+
|
2463
|
+
Learn more at the [Hello, Canvas Animation! Sample](#hello-canvas-animation).
|
2464
|
+
|
2465
|
+
If there is anything you would like added to the Glimmer Animation DSL that you saw available in the SWT APIs, you may [report and issue](https://github.com/AndyObtiva/glimmer-dsl-swt/issues) or implement yourself and [contribute](#contributing) via a Pull Request.
|
2466
|
+
|
2028
2467
|
### Data-Binding
|
2029
2468
|
|
2030
2469
|
Data-binding is done with `bind` command following widget property to bind and taking model and bindable attribute as arguments.
|
@@ -2374,7 +2813,7 @@ shell {
|
|
2374
2813
|
|
2375
2814
|
Check out [Hello, Table!](#hello-table) for an actual example including table editors.
|
2376
2815
|
|
2377
|
-
[Are We There Yet?](#are-we-there-yet) is an actual production Glimmer application that takes full advantage of table capabilities.
|
2816
|
+
[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
2817
|
|
2379
2818
|
##### Table Sorting
|
2380
2819
|
|
@@ -3208,12 +3647,12 @@ Example.new
|
|
3208
3647
|
|
3209
3648
|
Application name (shows up on the Mac in top menu bar) and version may be specified upon [packaging](#packaging--distribution) by specifying "-Bmac.CFBundleName" and "-Bmac.CFBundleVersion" options.
|
3210
3649
|
|
3211
|
-
Still, if you would like proper application name to show up on the Mac top menu bar during development, you may do so by invoking the SWT Display.
|
3650
|
+
Still, if you would like proper application name to show up on the Mac top menu bar during development, you may do so by invoking the SWT `Display.app_name=` method before any Display object has been instantiated (i.e. before any Glimmer widget like shell has been declared).
|
3212
3651
|
|
3213
3652
|
Example (you may copy/paste in [`girb`](#girb-glimmer-irb-command)):
|
3214
3653
|
|
3215
3654
|
```ruby
|
3216
|
-
Display.
|
3655
|
+
Display.app_name = 'Glimmer Demo'
|
3217
3656
|
|
3218
3657
|
shell(:no_resize) {
|
3219
3658
|
text "Glimmer"
|
@@ -3223,7 +3662,7 @@ shell(:no_resize) {
|
|
3223
3662
|
}.open
|
3224
3663
|
```
|
3225
3664
|
|
3226
|
-
Also, you may invoke `Display.
|
3665
|
+
Also, you may invoke `Display.app_version = '1.0.0'` if needed for OS app version identification reasons during development, replacing `'1.0.0'` with your application version.
|
3227
3666
|
|
3228
3667
|
#### Checkbox Group Widget
|
3229
3668
|
|
@@ -3287,12 +3726,13 @@ Glimmer Meta-Sample Code Example:
|
|
3287
3726
|
```ruby
|
3288
3727
|
# ...
|
3289
3728
|
@code_text = code_text {
|
3290
|
-
text bind(SampleDirectory, 'selected_sample.
|
3729
|
+
text bind(SampleDirectory, 'selected_sample.code', read_only: true)
|
3730
|
+
editable bind(SampleDirectory, 'selected_sample.editable')
|
3291
3731
|
}
|
3292
3732
|
# ...
|
3293
3733
|
```
|
3294
3734
|
|
3295
|
-
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.
|
3735
|
+
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.
|
3296
3736
|
|
3297
3737
|
#### Video Widget
|
3298
3738
|
|
@@ -3732,15 +4172,47 @@ Code:
|
|
3732
4172
|
|
3733
4173
|
#### Hello, Menu Bar!
|
3734
4174
|
|
3735
|
-
This sample demonstrates menus in Glimmer.
|
4175
|
+
This sample demonstrates menus in Glimmer, including accelerators on the Mac.
|
3736
4176
|
|
3737
4177
|
Code:
|
3738
4178
|
|
3739
4179
|
[samples/hello/hello_menu_bar.rb](samples/hello/hello_menu_bar.rb)
|
3740
4180
|
|
3741
4181
|
![Hello Menu Bar](images/glimmer-hello-menu-bar.png)
|
4182
|
+
|
3742
4183
|
![Hello Menu Bar File Menu](images/glimmer-hello-menu-bar-file-menu.png)
|
3743
|
-
|
4184
|
+
|
4185
|
+
The Mac Menu includes Accelerator Keys (keyboard shortcuts).
|
4186
|
+
|
4187
|
+
![Hello Menu Bar File Menu Mac Accelerators](images/glimmer-hello-menu-bar-file-menu-mac-accelerators.png)
|
4188
|
+
|
4189
|
+
![Hello Menu Bar Edit Menu](images/glimmer-hello-menu-bar-edit-menu.png)
|
4190
|
+
|
4191
|
+
The Mac Menu includes Accelerator Keys (keyboard shortcuts).
|
4192
|
+
|
4193
|
+
![Hello Menu Bar Edit Menu Mac Accelerators](images/glimmer-hello-menu-bar-edit-menu-mac-accelerators.png)
|
4194
|
+
|
4195
|
+
![Hello Menu Bar Options Menu Disabled](images/glimmer-hello-menu-bar-options-menu-disabled.png)
|
4196
|
+
|
4197
|
+
![Hello Menu Bar Options Menu Select One](images/glimmer-hello-menu-bar-options-menu-select-one.png)
|
4198
|
+
|
4199
|
+
![Hello Menu Bar Options Menu Select Multiple](images/glimmer-hello-menu-bar-options-menu-select-multiple.png)
|
4200
|
+
|
4201
|
+
![Hello Menu Bar Format Menu Background Color](images/glimmer-hello-menu-bar-format-menu-background-color.png)
|
4202
|
+
|
4203
|
+
![Hello Menu Bar Format Menu Foreground Color](images/glimmer-hello-menu-bar-format-menu-foreground-color.png)
|
4204
|
+
|
4205
|
+
![Hello Menu Bar View Menu](images/glimmer-hello-menu-bar-view-menu.png)
|
4206
|
+
|
4207
|
+
![Hello Menu Bar View Small](images/glimmer-hello-menu-bar-view-small.png)
|
4208
|
+
|
4209
|
+
![Hello Menu Bar View Large](images/glimmer-hello-menu-bar-view-large.png)
|
4210
|
+
|
4211
|
+
![Hello Menu Bar Help Menu](images/glimmer-hello-menu-bar-help-menu.png)
|
4212
|
+
|
4213
|
+
The Mac Menu includes Accelerator Keys (keyboard shortcuts) and Mac built-in Search.
|
4214
|
+
|
4215
|
+
![Hello Menu Bar Help Menu Mac Accelerators](images/glimmer-hello-menu-bar-help-menu-mac-accelerators.png)
|
3744
4216
|
|
3745
4217
|
#### Hello, Pop Up Context Menu!
|
3746
4218
|
|
@@ -4048,6 +4520,50 @@ Hello, Link! Clicked
|
|
4048
4520
|
|
4049
4521
|
![Hello Link Clicked](images/glimmer-hello-link-clicked.png)
|
4050
4522
|
|
4523
|
+
#### Hello, Dialog!
|
4524
|
+
|
4525
|
+
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).
|
4526
|
+
|
4527
|
+
Code:
|
4528
|
+
|
4529
|
+
[samples/hello/hello_dialog.rb](samples/hello/hello_dialog.rb)
|
4530
|
+
|
4531
|
+
Hello, Dialog!
|
4532
|
+
|
4533
|
+
![Hello Dialog](images/glimmer-hello-dialog.png)
|
4534
|
+
|
4535
|
+
Hello, Dialog! Open Dialog
|
4536
|
+
|
4537
|
+
![Hello Dialog Open Dialog](images/glimmer-hello-dialog-open-dialog.png)
|
4538
|
+
|
4539
|
+
#### Hello, Canvas!
|
4540
|
+
|
4541
|
+
This sample demonstrates the use of the `canvas` widget and [Shape DSL](#canvas-shape-dsl) in Glimmer.
|
4542
|
+
|
4543
|
+
Code:
|
4544
|
+
|
4545
|
+
[samples/hello/hello_canvas.rb](samples/hello/hello_canvas.rb)
|
4546
|
+
|
4547
|
+
Hello, Canvas!
|
4548
|
+
|
4549
|
+
![Hello Canvas](images/glimmer-hello-canvas.png)
|
4550
|
+
|
4551
|
+
#### Hello, Canvas Animation!
|
4552
|
+
|
4553
|
+
This sample demonstrates the use of the `canvas` widget and [Animation DSL](#canvas-animation-dsl) in Glimmer.
|
4554
|
+
|
4555
|
+
Code:
|
4556
|
+
|
4557
|
+
[samples/hello/hello_canvas_animation.rb](samples/hello/hello_canvas_animation.rb)
|
4558
|
+
|
4559
|
+
Hello, Canvas Animation!
|
4560
|
+
|
4561
|
+
![Hello Canvas Animation](images/glimmer-hello-canvas-animation.png)
|
4562
|
+
|
4563
|
+
Hello, Canvas Animation Another Frame!
|
4564
|
+
|
4565
|
+
![Hello Canvas Animation Frame 2](images/glimmer-hello-canvas-animation-frame2.png)
|
4566
|
+
|
4051
4567
|
### Elaborate Samples
|
4052
4568
|
|
4053
4569
|
For more elaborate samples, check the following:
|
@@ -4367,7 +4883,7 @@ Here is a list of notable 3rd party gems used by Glimmer:
|
|
4367
4883
|
|
4368
4884
|
## Glimmer Process
|
4369
4885
|
|
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.
|
4886
|
+
[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
4887
|
|
4372
4888
|
Learn more by reading the [GPG](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md) (Glimmer Process Guidelines)
|
4373
4889
|
|
@@ -4437,7 +4953,7 @@ If your company would like to invest fulltime in further development of the Glim
|
|
4437
4953
|
|
4438
4954
|
[MIT](LICENSE.txt)
|
4439
4955
|
|
4440
|
-
Copyright (c) 2007-
|
4956
|
+
Copyright (c) 2007-2021 - Andy Maleh.
|
4441
4957
|
|
4442
4958
|
--
|
4443
4959
|
|