glimmer-dsl-swt 4.23.0.1 → 4.23.1.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 +18 -0
- data/README.md +9 -9
- data/RUBY_VERSION +1 -1
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +4 -2
- data/docs/reference/GLIMMER_SAMPLES.md +1 -1
- data/glimmer-dsl-swt.gemspec +0 -0
- data/lib/glimmer/swt/custom/code_text.rb +13 -19
- data/samples/elaborate/meta_sample/tutorials.yml +16 -0
- data/samples/elaborate/meta_sample.rb +59 -3
- data/samples/hello/hello_code_text.rb +11 -0
- data/samples/hello/hello_menu_bar.rb +75 -0
- data/samples/hello/hello_styled_text.rb +4 -4
- data/samples/hello/hello_tree.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c9f704c72e3667bd413ba1209b17a6edfb110daaacba4b6ed17106afc3b9712
|
4
|
+
data.tar.gz: c9c68f2a0dce76782ea222753a9a18fb29dc5c7c8fd3fe0b31f65f1fd8ddd71e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fccd43c31d1afa0dfb783ead575b62b36f47d5431d078c018393995315290ee63092ad348fe710a2b04aca8112e25d3d26324cd44126702747eb875009dcc052
|
7
|
+
data.tar.gz: 2cebe2ef5735e9d55c9c49909e3ce02ea914b56a8dd49df134863b4feea5fec2f069a4997133e85f6bc77a89428ae178357bae9a95a9cb864a46183d5eac0103
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 4.23.1.2
|
4
|
+
|
5
|
+
- Add Hello, Pop Up Context Menu! video tutorial to Glimmer Meta-Sample
|
6
|
+
- Add Hello, Menu Bar! video tutorial to Glimmer Meta-Sample
|
7
|
+
- Add Language & Country menus to Hello, Menu Bar!
|
8
|
+
- Fix "Last Name" label in Hello, Tree! (was a duplicate "First Name" by mistake)
|
9
|
+
|
10
|
+
## 4.23.1.1
|
11
|
+
|
12
|
+
- Switch order of buttons in Glimmer Meta-Sample to put Tutorial first
|
13
|
+
- Make Glimmer Meta-Sample pull list of tutorials from GitHub to avoid needing to update gem when adding new tutorials
|
14
|
+
|
15
|
+
## 4.23.1.0
|
16
|
+
|
17
|
+
- Upgrade to JRuby 9.3.4.0
|
18
|
+
- Upgrade to glimmer 2.7.3
|
19
|
+
- Add "Tutorial" button to Glimmer Meta-Sample to show Youtube Video Tutorial
|
20
|
+
|
3
21
|
## 4.23.0.1
|
4
22
|
|
5
23
|
- Add "Speed" menu to the Tetris sample
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.23.
|
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.23.1.2
|
2
2
|
## JRuby Desktop Development GUI Framework
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
|
4
4
|
[![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
|
@@ -19,7 +19,7 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
|
|
19
19
|
|
20
20
|
![Eclipse SWT RCP NASA Mars Rover](/images/glimmer-eclipse-swt-rcp-nasa-mars-rover.png)
|
21
21
|
|
22
|
-
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.23.
|
22
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.23.1.2 includes [SWT 4.23](https://download.eclipse.org/eclipse/downloads/drops4/R-4.23-202203080310/), which was released on March 8, 2022. 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.
|
23
23
|
|
24
24
|
**Starting in version 4.20.0.0, [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) comes with the new [***Shine***](/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#shine) syntax** for highly intuitive and visually expressive View/Model Attribute Mapping, relying on `<=>` for bidirectional (two-way) data-binding and `<=` for unidirectional (one-way) data-binding, providing an alternative to the `bind` keyword.
|
25
25
|
|
@@ -203,7 +203,7 @@ Glimmer app:
|
|
203
203
|
|
204
204
|
### Desktop Apps Built with Glimmer DSL for SWT
|
205
205
|
|
206
|
-
[<img alt="Are We There Yet Logo" src="https://raw.githubusercontent.com/AndyObtiva/are-we-there-yet/master/are-we-there-yet-logo.svg" width="40" />Are We There Yet?](https://github.com/AndyObtiva/are-we-there-yet) - Small Project Tracking App
|
206
|
+
[<img alt="Are We There Yet Logo" src="https://raw.githubusercontent.com/AndyObtiva/are-we-there-yet/master/are-we-there-yet-logo.svg" width="40" />Are We There Yet?](https://github.com/AndyObtiva/are-we-there-yet) - Small Project Tracking App (leveraging [ActiveRecord](https://rubygems.org/gems/activerecord) and [SQLite](https://www.sqlite.org/index.html))
|
207
207
|
|
208
208
|
[![Are We There Yet? App Screenshot](https://raw.githubusercontent.com/AndyObtiva/are-we-there-yet/master/are-we-there-yet-screenshot-windows.png)](https://github.com/AndyObtiva/are-we-there-yet)
|
209
209
|
|
@@ -303,7 +303,7 @@ https://www.eclipse.org/swt/faq.php
|
|
303
303
|
|
304
304
|
- JDK 18 (find at https://www.oracle.com/java/technologies/downloads / Ensure `PATH` env var includes Java bin directory for `jpackage` command to work when packaging Glimmer applications / Preferably setup `JAVA_HOME` env var too to point to JDK home directory before installing JRuby)
|
305
305
|
- [RVM](http://rvm.io) on Mac & Linux (not needed on Windows)
|
306
|
-
- JRuby 9.3.
|
306
|
+
- JRuby 9.3.4.0 (supporting Ruby 2.6.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux by running `rvm install jruby-9.3.4.0`; On Windows, find at [https://www.jruby.org/download](https://www.jruby.org/download))
|
307
307
|
- SWT 4.23 (already included in the [glimmer-dsl-swt](https://rubygems.org/gems/glimmer-dsl-swt) gem). Note that SWT supports ARM64/AARCH64 on Mac and Linux since version 4.20
|
308
308
|
- Git (comes with Mac and Linux. Install on Windows: https://git-scm.com/download/win )
|
309
309
|
|
@@ -333,7 +333,7 @@ jgem install glimmer-dsl-swt
|
|
333
333
|
|
334
334
|
Or this command if you want a specific version:
|
335
335
|
```
|
336
|
-
jgem install glimmer-dsl-swt -v 4.23.
|
336
|
+
jgem install glimmer-dsl-swt -v 4.23.1.2
|
337
337
|
```
|
338
338
|
|
339
339
|
`jgem` is JRuby's version of `gem` command.
|
@@ -361,7 +361,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
361
361
|
|
362
362
|
Add the following to `Gemfile`:
|
363
363
|
```
|
364
|
-
gem 'glimmer-dsl-swt', '~> 4.23.
|
364
|
+
gem 'glimmer-dsl-swt', '~> 4.23.1.2'
|
365
365
|
```
|
366
366
|
|
367
367
|
And, then run:
|
@@ -384,7 +384,7 @@ glimmer
|
|
384
384
|
```
|
385
385
|
|
386
386
|
```
|
387
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.23.
|
387
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.23.1.2
|
388
388
|
|
389
389
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
390
390
|
|
@@ -567,13 +567,13 @@ If you have a Glimmer app you would like referenced here, please mention in a Pu
|
|
567
567
|
|
568
568
|
### Are We There Yet?
|
569
569
|
|
570
|
-
This [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) application connects to a database using [ActiveRecord](https://rubygems.org/gems/activerecord).
|
570
|
+
This [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) application connects to a [SQLite](https://www.sqlite.org/index.html) database using [ActiveRecord](https://rubygems.org/gems/activerecord).
|
571
571
|
|
572
572
|
[<img alt="Are We There Yet Logo" src="https://raw.githubusercontent.com/AndyObtiva/are-we-there-yet/master/are-we-there-yet-logo.svg" width="40" />Are We There Yet?](https://github.com/AndyObtiva/are-we-there-yet): A tool that helps you learn when your small projects will finish
|
573
573
|
|
574
574
|
### Garderie Rainbow Daily Agenda
|
575
575
|
|
576
|
-
This [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) application connects to a [Rails](https://rubyonrails.org/) server to submit
|
576
|
+
This [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) application connects to a [Rails](https://rubyonrails.org/) server to submit a nursery child daily agenda via a REST API, storing data in [PostgreSQL](https://www.postgresql.org/).
|
577
577
|
|
578
578
|
[<img alt="Garderie Rainbow Daily Agenda Logo" src="https://github.com/AndyObtiva/garderie_rainbow_daily_agenda/raw/master/images/garderie_rainbow_daily_agenda_logo.png" width="40" />Garderie Rainbow Daily Agenda](https://github.com/AndyObtiva/garderie_rainbow_daily_agenda): A child nursery daily agenda reporting desktop app
|
579
579
|
|
data/RUBY_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
jruby-9.3.
|
1
|
+
jruby-9.3.4.0
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.23.
|
1
|
+
4.23.1.2
|
@@ -940,6 +940,8 @@ The system tray allows showing icons for various apps that need to stay on for e
|
|
940
940
|
|
941
941
|
In Glimmer DSL for SWT, generating tray items is automated via the `tray_item` keyword, which can be nested under `shell` and then have a child `menu` underneath that pops up when the user clicks on its icon in the system tray.
|
942
942
|
|
943
|
+
Note that if you would like to display notifications, you can use the [Nebula Notifier custom widget](https://github.com/AndyObtiva/glimmer-cw-nebula#notifier). Alternatively, you can look into the [Two Slices](https://github.com/sshtools/two-slices) Java library.
|
944
|
+
|
943
945
|
Note how the shell was declared with the `:on_top` style (in addition to the default, which is `:shell_trim`) to ensure it opens above all apps when the "Show Application" menu item is selected.
|
944
946
|
|
945
947
|
Example code:
|
@@ -3574,8 +3576,8 @@ Example:
|
|
3574
3576
|
```ruby
|
3575
3577
|
shell {
|
3576
3578
|
@tree = tree {
|
3577
|
-
items
|
3578
|
-
selection
|
3579
|
+
items <= [company, :owner, tree_properties: {children: :coworkers, text: :name}]
|
3580
|
+
selection <=> [company, :selected_coworker]
|
3579
3581
|
}
|
3580
3582
|
}
|
3581
3583
|
```
|
@@ -1082,7 +1082,7 @@ Hello, Cool Bar!
|
|
1082
1082
|
|
1083
1083
|
#### Hello, Tray Item!
|
1084
1084
|
|
1085
|
-
This sample demonstrates the use of `tray_item
|
1085
|
+
This sample demonstrates the use of [`tray_item`](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#tray-item), which enables hiding an app (sending to background) and showing again on top of all other apps. It can also show an About Message Box and exit completely if needed.
|
1086
1086
|
|
1087
1087
|
Code:
|
1088
1088
|
|
data/glimmer-dsl-swt.gemspec
CHANGED
Binary file
|
@@ -146,17 +146,11 @@ module Glimmer
|
|
146
146
|
@line_numbers_styled_text_proxy = styled_text(swt(swt(swt_style), :h_scroll!, :v_scroll!)) {
|
147
147
|
layout_data(:right, :fill, false, true)
|
148
148
|
|
149
|
-
text
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
},
|
155
|
-
after_read: lambda {
|
156
|
-
@line_numbers_styled_text_proxy&.top_pixel = styled_text_proxy_top_pixel unless styled_text_proxy_top_pixel.nil?
|
157
|
-
}
|
158
|
-
)
|
159
|
-
top_pixel bind(self, :styled_text_proxy_top_pixel, read_only: true)
|
149
|
+
text <= [self, :styled_text_proxy_text,
|
150
|
+
on_read: lambda { |text_value| line_numbers_text_from(text_value) },
|
151
|
+
after_read: lambda { @line_numbers_styled_text_proxy&.top_pixel = styled_text_proxy_top_pixel unless styled_text_proxy_top_pixel.nil? }
|
152
|
+
]
|
153
|
+
top_pixel <= [self, :styled_text_proxy_top_pixel]
|
160
154
|
font name: @font_name, height: OS.mac? ? 15 : 12
|
161
155
|
background color(:widget_background)
|
162
156
|
foreground :dark_blue
|
@@ -190,8 +184,8 @@ module Glimmer
|
|
190
184
|
# custom_widget_property_owner # TODO implement to route properties here without declaring method_missing
|
191
185
|
layout_data :fill, :fill, true, true if lines
|
192
186
|
|
193
|
-
text
|
194
|
-
top_pixel
|
187
|
+
text <=> [self, :styled_text_proxy_text] if lines
|
188
|
+
top_pixel <=> [self, :styled_text_proxy_top_pixel] if lines
|
195
189
|
font name: @font_name, height: OS.mac? ? 15 : 12
|
196
190
|
foreground rgb(75, 75, 75)
|
197
191
|
left_margin 5
|
@@ -223,10 +217,10 @@ module Glimmer
|
|
223
217
|
}
|
224
218
|
end
|
225
219
|
|
226
|
-
on_modify_text
|
220
|
+
on_modify_text do |event|
|
227
221
|
# clear unnecessary syntax highlighting cache on text updates, and do it async to avoid affecting performance
|
228
222
|
new_text = event.data
|
229
|
-
async_exec
|
223
|
+
async_exec do
|
230
224
|
unless @syntax_highlighting.nil?
|
231
225
|
lines = new_text.to_s.split("\n")
|
232
226
|
line_diff = @syntax_highlighting.keys - lines
|
@@ -234,10 +228,10 @@ module Glimmer
|
|
234
228
|
@syntax_highlighting.delete(line)
|
235
229
|
end
|
236
230
|
end
|
237
|
-
|
238
|
-
|
231
|
+
end
|
232
|
+
end
|
239
233
|
|
240
|
-
on_line_get_style
|
234
|
+
on_line_get_style do |line_style_event|
|
241
235
|
begin
|
242
236
|
styles = []
|
243
237
|
style_data = nil
|
@@ -259,7 +253,7 @@ module Glimmer
|
|
259
253
|
Glimmer::Config.logger.error {e.message}
|
260
254
|
Glimmer::Config.logger.error {e.full_message}
|
261
255
|
end
|
262
|
-
|
256
|
+
end
|
263
257
|
}
|
264
258
|
end
|
265
259
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
Hello, World!: Mi5phsSdNAA
|
3
|
+
Hello, Message Box!: N0sDcr0xp40
|
4
|
+
Hello, Tab!: cMwlYZ78uaQ
|
5
|
+
Hello, Layout!: dAVFR9Y_thY
|
6
|
+
Hello, File Dialog!: HwZRgdvKIDo
|
7
|
+
Hello, Label!: i1PFHr-F8fQ
|
8
|
+
Hello, Text!: pOaYB43G2pg
|
9
|
+
Login: C_vSvXH9ISw
|
10
|
+
Hello, Canvas Shape Listeners!: PV13YE-43M4
|
11
|
+
Hello, Styled Text!: ahs54DPmmso
|
12
|
+
Hello, Code Text!: y0rNzMURnHY
|
13
|
+
Hello, Tree!: M-ZOFyzbEKo
|
14
|
+
Hello, Table!: 3zyyXq7WJwc
|
15
|
+
Hello, Pop Up Context Menu!: kupwWSZdsQE
|
16
|
+
Hello, Menu Bar!: 3RRVFIfA_UM
|
@@ -21,8 +21,15 @@
|
|
21
21
|
|
22
22
|
require 'glimmer-dsl-swt'
|
23
23
|
require 'fileutils'
|
24
|
+
require 'yaml'
|
25
|
+
require 'net/http'
|
24
26
|
|
25
27
|
class Sample
|
28
|
+
UNEDITABLE = ['meta_sample.rb'] + (OS.windows? ? ['calculator.rb', 'weather.rb'] : []) # Windows StyledText does not support unicode characters found in certain samples
|
29
|
+
URL_TUTORIALS = 'https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-swt/master/samples/elaborate/meta_sample/tutorials.yml'
|
30
|
+
FILE_TUTORIALS = File.expand_path(File.join('meta_sample', 'tutorials.yml'), __dir__)
|
31
|
+
TUTORIALS = YAML.load_file(FILE_TUTORIALS)
|
32
|
+
|
26
33
|
class << self
|
27
34
|
def glimmer_directory
|
28
35
|
File.expand_path('../../..', __FILE__)
|
@@ -39,12 +46,35 @@ class Sample
|
|
39
46
|
@ensured_glimmer_directory = true
|
40
47
|
end
|
41
48
|
end
|
49
|
+
|
50
|
+
def tutorials
|
51
|
+
if remote_tutorials && !remote_tutorials.empty? && remote_tutorials != local_tutorials
|
52
|
+
remote_tutorials
|
53
|
+
else
|
54
|
+
local_tutorials
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def remote_tutorials
|
59
|
+
if @remote_tutorials.nil?
|
60
|
+
remote_tutorials_response = Net::HTTP.get_response(URI(URL_TUTORIALS))
|
61
|
+
raise "Error downloading remote tutorial list from #{URL_TUTORIALS} (defaulting to local list): HTTP status #{remote_tutorials_response.code} #{remote_tutorials_response.message}!" unless remote_tutorials_response.code.to_i.between?(200, 299)
|
62
|
+
remote_tutorials_yaml = remote_tutorials_response.body
|
63
|
+
@remote_tutorials = YAML.load(remote_tutorials_yaml)
|
64
|
+
end
|
65
|
+
@remote_tutorials
|
66
|
+
rescue => e
|
67
|
+
Glimmer::Config.logger.error e.full_message
|
68
|
+
nil
|
69
|
+
end
|
70
|
+
|
71
|
+
def local_tutorials
|
72
|
+
TUTORIALS
|
73
|
+
end
|
42
74
|
end
|
43
75
|
|
44
76
|
include Glimmer::DataBinding::ObservableModel
|
45
|
-
|
46
|
-
UNEDITABLE = ['meta_sample.rb'] + (OS.windows? ? ['calculator.rb', 'weather.rb'] : []) # Windows StyledText does not support unicode characters found in certain samples
|
47
|
-
|
77
|
+
|
48
78
|
attr_accessor :sample_directory, :file, :selected
|
49
79
|
|
50
80
|
def initialize(file, sample_directory: )
|
@@ -84,6 +114,14 @@ class Sample
|
|
84
114
|
File.basename(file) != 'meta_sample.rb'
|
85
115
|
end
|
86
116
|
|
117
|
+
def teachable
|
118
|
+
!!tutorial
|
119
|
+
end
|
120
|
+
|
121
|
+
def tutorial
|
122
|
+
Sample.tutorials[name]
|
123
|
+
end
|
124
|
+
|
87
125
|
def file_relative_path
|
88
126
|
file.sub(self.class.glimmer_directory, '')
|
89
127
|
end
|
@@ -244,10 +282,27 @@ class MetaSampleApplication
|
|
244
282
|
|
245
283
|
composite {
|
246
284
|
fill_layout
|
285
|
+
|
247
286
|
layout_data(:fill, :center, true, false) {
|
248
287
|
height_hint 96
|
249
288
|
}
|
250
289
|
|
290
|
+
button {
|
291
|
+
text 'Tutorial'
|
292
|
+
font height: 25
|
293
|
+
enabled <= [SampleDirectory, 'selected_sample.teachable']
|
294
|
+
|
295
|
+
on_widget_selected do
|
296
|
+
shell(:fill_screen) {
|
297
|
+
text "Glimmer DSL for SWT Video Tutorial - #{SampleDirectory.selected_sample.name}"
|
298
|
+
|
299
|
+
browser {
|
300
|
+
text "<iframe src='https://www.youtube.com/embed/#{SampleDirectory.selected_sample.tutorial}?autoplay=1' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen style='width: 100%; height: 100%;'></iframe>"
|
301
|
+
}
|
302
|
+
}.open
|
303
|
+
end
|
304
|
+
}
|
305
|
+
|
251
306
|
button {
|
252
307
|
text 'Launch'
|
253
308
|
font height: 25
|
@@ -261,6 +316,7 @@ class MetaSampleApplication
|
|
261
316
|
end
|
262
317
|
end
|
263
318
|
}
|
319
|
+
|
264
320
|
button {
|
265
321
|
text 'Reset'
|
266
322
|
font height: 25
|
@@ -83,30 +83,41 @@ class HelloCodeText
|
|
83
83
|
tab_folder {
|
84
84
|
tab_item {
|
85
85
|
fill_layout
|
86
|
+
|
86
87
|
text 'Ruby (glimmer theme)'
|
88
|
+
|
87
89
|
code_text(language: 'ruby', theme: 'glimmer', lines: true) {
|
88
90
|
text <=> [self, :ruby_code]
|
89
91
|
}
|
90
92
|
}
|
93
|
+
|
91
94
|
tab_item {
|
92
95
|
fill_layout
|
96
|
+
|
93
97
|
text 'JavaScript (pastie theme)'
|
98
|
+
|
94
99
|
code_text(:multi, :h_scroll, :v_scroll, language: 'javascript', theme: 'pastie', lines: {width: 2}) {
|
95
100
|
root {
|
96
101
|
grid_layout(2, false) {
|
97
102
|
margin_width 2
|
98
103
|
}
|
104
|
+
|
99
105
|
background :white
|
100
106
|
}
|
107
|
+
|
101
108
|
line_numbers {
|
102
109
|
background :white
|
103
110
|
}
|
111
|
+
|
104
112
|
text <=> [self, :js_code]
|
105
113
|
}
|
106
114
|
}
|
115
|
+
|
107
116
|
tab_item {
|
108
117
|
fill_layout
|
118
|
+
|
109
119
|
text 'HTML (github theme)'
|
120
|
+
|
110
121
|
code_text(language: 'html', theme: 'github') { # default is lines: false
|
111
122
|
text <=> [self, :html_code]
|
112
123
|
}
|
@@ -41,6 +41,7 @@ shell {
|
|
41
41
|
menu_bar {
|
42
42
|
menu {
|
43
43
|
text '&File'
|
44
|
+
|
44
45
|
menu_item {
|
45
46
|
text '&New'
|
46
47
|
accelerator :command, :N
|
@@ -52,6 +53,7 @@ shell {
|
|
52
53
|
}.open
|
53
54
|
end
|
54
55
|
}
|
56
|
+
|
55
57
|
menu_item {
|
56
58
|
text '&Open...'
|
57
59
|
accelerator :command, :O
|
@@ -63,10 +65,13 @@ shell {
|
|
63
65
|
}.open
|
64
66
|
end
|
65
67
|
}
|
68
|
+
|
66
69
|
menu {
|
67
70
|
text 'Open &Recent'
|
71
|
+
|
68
72
|
menu_item {
|
69
73
|
text 'File 1'
|
74
|
+
|
70
75
|
on_widget_selected do
|
71
76
|
message_box {
|
72
77
|
text 'File 1'
|
@@ -74,8 +79,10 @@ shell {
|
|
74
79
|
}.open
|
75
80
|
end
|
76
81
|
}
|
82
|
+
|
77
83
|
menu_item {
|
78
84
|
text 'File 2'
|
85
|
+
|
79
86
|
on_widget_selected do
|
80
87
|
message_box {
|
81
88
|
text 'File 2'
|
@@ -84,7 +91,9 @@ shell {
|
|
84
91
|
end
|
85
92
|
}
|
86
93
|
}
|
94
|
+
|
87
95
|
menu_item(:separator)
|
96
|
+
|
88
97
|
menu_item {
|
89
98
|
text 'E&xit'
|
90
99
|
|
@@ -93,21 +102,26 @@ shell {
|
|
93
102
|
end
|
94
103
|
}
|
95
104
|
}
|
105
|
+
|
96
106
|
menu {
|
97
107
|
text '&Edit'
|
108
|
+
|
98
109
|
menu_item {
|
99
110
|
text 'Cut'
|
100
111
|
accelerator :command, :X
|
101
112
|
}
|
113
|
+
|
102
114
|
menu_item {
|
103
115
|
text 'Copy'
|
104
116
|
accelerator :command, :C
|
105
117
|
}
|
118
|
+
|
106
119
|
menu_item {
|
107
120
|
text 'Paste'
|
108
121
|
accelerator :command, :V
|
109
122
|
}
|
110
123
|
}
|
124
|
+
|
111
125
|
menu {
|
112
126
|
text '&Options'
|
113
127
|
|
@@ -119,6 +133,7 @@ shell {
|
|
119
133
|
@select_multiple_menu.enabled = true
|
120
134
|
end
|
121
135
|
}
|
136
|
+
|
122
137
|
@select_one_menu = menu {
|
123
138
|
text '&Select One'
|
124
139
|
enabled false
|
@@ -126,13 +141,16 @@ shell {
|
|
126
141
|
menu_item(:radio) {
|
127
142
|
text 'Option 1'
|
128
143
|
}
|
144
|
+
|
129
145
|
menu_item(:radio) {
|
130
146
|
text 'Option 2'
|
131
147
|
}
|
148
|
+
|
132
149
|
menu_item(:radio) {
|
133
150
|
text 'Option 3'
|
134
151
|
}
|
135
152
|
}
|
153
|
+
|
136
154
|
@select_multiple_menu = menu {
|
137
155
|
text '&Select Multiple'
|
138
156
|
enabled false
|
@@ -140,18 +158,64 @@ shell {
|
|
140
158
|
menu_item(:check) {
|
141
159
|
text 'Option 4'
|
142
160
|
}
|
161
|
+
|
143
162
|
menu_item(:check) {
|
144
163
|
text 'Option 5'
|
145
164
|
}
|
165
|
+
|
146
166
|
menu_item(:check) {
|
147
167
|
text 'Option 6'
|
148
168
|
}
|
149
169
|
}
|
150
170
|
}
|
171
|
+
|
172
|
+
menu {
|
173
|
+
text '&Language'
|
174
|
+
|
175
|
+
['denmark', 'finland', 'france', 'germany', 'italy', 'mexico', 'netherlands', 'norway', 'usa'].each do |image_name|
|
176
|
+
menu_item(:radio) { |a_menu_item|
|
177
|
+
image File.expand_path("images/#{image_name}.png", __dir__)
|
178
|
+
selection image_name == 'usa'
|
179
|
+
|
180
|
+
on_widget_selected do
|
181
|
+
if a_menu_item.selection
|
182
|
+
message_box {
|
183
|
+
text 'Language Selection'
|
184
|
+
message "You selected the language of #{image_name.capitalize}!"
|
185
|
+
}.open
|
186
|
+
end
|
187
|
+
end
|
188
|
+
}
|
189
|
+
end
|
190
|
+
}
|
191
|
+
|
192
|
+
menu {
|
193
|
+
text '&Country'
|
194
|
+
|
195
|
+
['denmark', 'finland', 'france', 'germany', 'italy', 'mexico', 'netherlands', 'norway', 'usa'].each do |image_name|
|
196
|
+
menu_item(:radio) { |a_menu_item|
|
197
|
+
text image_name.capitalize
|
198
|
+
image File.expand_path("images/#{image_name}.png", __dir__)
|
199
|
+
selection image_name == 'usa'
|
200
|
+
|
201
|
+
on_widget_selected do
|
202
|
+
if a_menu_item.selection
|
203
|
+
message_box {
|
204
|
+
text 'Country Selection'
|
205
|
+
message "You selected the country of #{image_name.capitalize}!"
|
206
|
+
}.open
|
207
|
+
end
|
208
|
+
end
|
209
|
+
}
|
210
|
+
end
|
211
|
+
}
|
212
|
+
|
151
213
|
menu {
|
152
214
|
text '&Format'
|
215
|
+
|
153
216
|
menu {
|
154
217
|
text '&Background Color'
|
218
|
+
|
155
219
|
COLORS.each { |color_style|
|
156
220
|
menu_item(:radio) {
|
157
221
|
text color_style.to_s.split('_').map(&:capitalize).join(' ')
|
@@ -162,8 +226,10 @@ shell {
|
|
162
226
|
}
|
163
227
|
}
|
164
228
|
}
|
229
|
+
|
165
230
|
menu {
|
166
231
|
text 'Foreground &Color'
|
232
|
+
|
167
233
|
COLORS.each { |color_style|
|
168
234
|
menu_item(:radio) {
|
169
235
|
text color_style.to_s.split('_').map(&:capitalize).join(' ')
|
@@ -175,8 +241,10 @@ shell {
|
|
175
241
|
}
|
176
242
|
}
|
177
243
|
}
|
244
|
+
|
178
245
|
menu {
|
179
246
|
text '&View'
|
247
|
+
|
180
248
|
menu_item(:radio) {
|
181
249
|
text 'Small'
|
182
250
|
|
@@ -185,6 +253,7 @@ shell {
|
|
185
253
|
@label.parent.pack
|
186
254
|
end
|
187
255
|
}
|
256
|
+
|
188
257
|
menu_item(:radio) {
|
189
258
|
text 'Medium'
|
190
259
|
selection true
|
@@ -194,6 +263,7 @@ shell {
|
|
194
263
|
@label.parent.pack
|
195
264
|
end
|
196
265
|
}
|
266
|
+
|
197
267
|
menu_item(:radio) {
|
198
268
|
text 'Large'
|
199
269
|
|
@@ -203,8 +273,10 @@ shell {
|
|
203
273
|
end
|
204
274
|
}
|
205
275
|
}
|
276
|
+
|
206
277
|
menu {
|
207
278
|
text '&Help'
|
279
|
+
|
208
280
|
menu_item {
|
209
281
|
text '&Manual'
|
210
282
|
accelerator :command, :shift, :M
|
@@ -216,6 +288,7 @@ shell {
|
|
216
288
|
}.open
|
217
289
|
end
|
218
290
|
}
|
291
|
+
|
219
292
|
menu_item {
|
220
293
|
text '&Tutorial'
|
221
294
|
accelerator :command, :shift, :T
|
@@ -227,7 +300,9 @@ shell {
|
|
227
300
|
}.open
|
228
301
|
end
|
229
302
|
}
|
303
|
+
|
230
304
|
menu_item(:separator)
|
305
|
+
|
231
306
|
menu_item {
|
232
307
|
text '&Report an Issue...'
|
233
308
|
|
@@ -82,22 +82,22 @@ shell {
|
|
82
82
|
line_size = line_style_event.lineText.size
|
83
83
|
style_range = StyleRange.new(line_offset, line_size, color(:blue).swt_color, nil, swt(:italic))
|
84
84
|
style_range.font = Font.new(display.swt_display, 'Times New Roman', 18, swt(:normal))
|
85
|
-
line_style_event.styles = [style_range]
|
85
|
+
line_style_event.styles = [style_range]
|
86
86
|
elsif @presenter.line_index_for_offset(line_offset) % 52 < 26
|
87
87
|
line_size = line_style_event.lineText.size
|
88
88
|
style_range = StyleRange.new(line_offset, line_size, color(:dark_green).swt_color, color(:yellow).swt_color, swt(:bold))
|
89
|
-
line_style_event.styles = [style_range]
|
89
|
+
line_style_event.styles = [style_range]
|
90
90
|
elsif @presenter.line_index_for_offset(line_offset) % 52 < 39
|
91
91
|
line_size = line_style_event.lineText.size
|
92
92
|
style_range = StyleRange.new(line_offset, line_size, color(:red).swt_color, nil, swt(:normal))
|
93
93
|
style_range.underline = true
|
94
94
|
style_range.font = Font.new(display.swt_display, 'Arial', 16, swt(:normal))
|
95
|
-
line_style_event.styles = [style_range]
|
95
|
+
line_style_event.styles = [style_range]
|
96
96
|
else
|
97
97
|
line_size = line_style_event.lineText.size
|
98
98
|
style_range = StyleRange.new(line_offset, line_size, color(:dark_magenta).swt_color, color(:cyan).swt_color, swt(:normal))
|
99
99
|
style_range.strikeout = true
|
100
|
-
line_style_event.styles = [style_range]
|
100
|
+
line_style_event.styles = [style_range]
|
101
101
|
end
|
102
102
|
end
|
103
103
|
}
|
data/samples/hello/hello_tree.rb
CHANGED
metadata
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-swt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.23.
|
4
|
+
version: 4.23.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 2.
|
18
|
+
version: 2.7.3
|
19
19
|
name: glimmer
|
20
20
|
prerelease: false
|
21
21
|
type: :runtime
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.7.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
@@ -564,6 +564,7 @@ files:
|
|
564
564
|
- samples/elaborate/login.rb
|
565
565
|
- samples/elaborate/mandelbrot_fractal.rb
|
566
566
|
- samples/elaborate/meta_sample.rb
|
567
|
+
- samples/elaborate/meta_sample/tutorials.yml
|
567
568
|
- samples/elaborate/metronome.rb
|
568
569
|
- samples/elaborate/parking.rb
|
569
570
|
- samples/elaborate/parking/model/parking_floor.rb
|