glimmer-dsl-wx 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +208 -101
- data/VERSION +1 -1
- data/glimmer-dsl-wx.gemspec +0 -0
- data/lib/glimmer/dsl/wx/dsl.rb +1 -0
- data/lib/glimmer/dsl/wx/sizer_addable_expression.rb +42 -0
- data/lib/glimmer/dsl/wx/sizer_args_expression.rb +4 -1
- data/lib/glimmer/wx/sizer_proxy.rb +16 -0
- data/samples/hello/hello_sizer.rb +88 -33
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d67fb5f483b55ca655215bf87926ae501dd680b4ffeebbfe02756b257398d4f3
|
4
|
+
data.tar.gz: fffd53b54fba50092ea146df9bb90b268f333cc903a29b6178e9cc80217b9d3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e1544b9b4dedfc9f99b31833982642bba382e69b857957a6647aecc8e93ae8d7a7d60af5a6c7f0cdff858ef555c3d7a5b12536a61ce3ba49322051f39ed17fe
|
7
|
+
data.tar.gz: 402553fc0c1462d0f7e20d9931d894347739f9d9229bb1616731ec42897ba45a5e2a37f7ca54f8c06514a726e48cc4f1e4a1e9e2cd641aa810b5b0d793e12046
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.0.7
|
4
|
+
|
5
|
+
- Sizer addable support (e.g. supporting `growable_col(1, 1)`, using `add_growable_col(1, 1)` method in wxruby3 API)
|
6
|
+
- Ability to nest sizers within sizers
|
7
|
+
- Update samples/hello/hello_sizer.rb to use a `spacer` addable and nest `v_box_sizer` under `h_box_sizer`
|
8
|
+
|
3
9
|
## 0.0.6
|
4
10
|
|
5
11
|
- Sizer (layout) support
|
6
|
-
- samples/
|
12
|
+
- samples/hello/hello_sizer.rb
|
7
13
|
- Refactor/move `glimmer_new` samples to `hello` directory
|
8
14
|
- Fix `ControlProxy#frame_proxy` method, which grabs the parent frame (going all the way to the top of the hierarchy)
|
9
15
|
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
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 WX 0.0.
|
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 WX 0.0.7
|
2
2
|
## wxWidgets Ruby Desktop Development GUI Library
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-wx.svg)](
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-wx.svg)](https://badge.fury.io/rb/glimmer-dsl-wx)
|
4
4
|
[![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
5
5
|
|
6
6
|
[Glimmer](https://github.com/AndyObtiva/glimmer) DSL for [WX](https://www.wxwidgets.org/) is an [MRI Ruby](https://www.ruby-lang.org) desktop development GUI (Graphical User Interface) library for the cross-platform native widget [wxWidgets](https://www.wxwidgets.org/) GUI toolkit. It provides a Glimmer GUI DSL on top of the [wxruby3](https://github.com/mcorino/wxRuby3) binding.
|
@@ -16,8 +16,6 @@
|
|
16
16
|
|
17
17
|
**Hello, World!**
|
18
18
|
|
19
|
-
![Hello, World!](https://github.com/AndyObtiva/glimmer-dsl-wx/blob/master/screenshots/glimmer-dsl-wx-sample-hello-world.png?raw=true)
|
20
|
-
|
21
19
|
```ruby
|
22
20
|
require 'glimmer-dsl-wx'
|
23
21
|
|
@@ -26,51 +24,10 @@ include Glimmer
|
|
26
24
|
frame(title: 'Hello, World!')
|
27
25
|
```
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
```ruby
|
32
|
-
require 'glimmer-dsl-wx'
|
33
|
-
|
34
|
-
include Glimmer
|
35
|
-
|
36
|
-
frame {
|
37
|
-
title 'Hello, World!'
|
38
|
-
}
|
39
|
-
```
|
27
|
+
![Hello, World!](https://github.com/AndyObtiva/glimmer-dsl-wx/blob/master/screenshots/glimmer-dsl-wx-sample-hello-world.png?raw=true)
|
40
28
|
|
41
29
|
**Hello Button!**
|
42
30
|
|
43
|
-
|
44
|
-
![Hello, Button!](https://github.com/AndyObtiva/glimmer-dsl-wx/blob/master/screenshots/glimmer-dsl-wx-sample-hello-button.png?raw=true)
|
45
|
-
|
46
|
-
![Hello, Button! Clicked](https://github.com/AndyObtiva/glimmer-dsl-wx/blob/master/screenshots/glimmer-dsl-wx-sample-hello-button-clicked.png?raw=true)
|
47
|
-
|
48
|
-
|
49
|
-
```ruby
|
50
|
-
require 'glimmer-dsl-wx'
|
51
|
-
|
52
|
-
include Glimmer
|
53
|
-
|
54
|
-
frame(title: 'Hello, Button!') { |main_frame|
|
55
|
-
h_box_sizer {
|
56
|
-
button(label: 'Click To Find Who Built This!') {
|
57
|
-
sizer_args 0, Wx::RIGHT, 10
|
58
|
-
|
59
|
-
on_button do
|
60
|
-
about_box(
|
61
|
-
name: main_frame.title,
|
62
|
-
version: Wx::WXRUBY_VERSION,
|
63
|
-
description: "This is the Hello, Button! sample",
|
64
|
-
developers: ['The Glimmer DSL for WX Development Team']
|
65
|
-
)
|
66
|
-
end
|
67
|
-
}
|
68
|
-
}
|
69
|
-
}
|
70
|
-
```
|
71
|
-
|
72
|
-
Alternate Syntax:
|
73
|
-
|
74
31
|
```ruby
|
75
32
|
require 'glimmer-dsl-wx'
|
76
33
|
|
@@ -97,58 +54,9 @@ frame { |main_frame|
|
|
97
54
|
}
|
98
55
|
```
|
99
56
|
|
100
|
-
|
101
|
-
|
102
|
-
```ruby
|
103
|
-
require 'glimmer-dsl-wx'
|
104
|
-
|
105
|
-
include Glimmer
|
57
|
+
![Hello, Button!](https://github.com/AndyObtiva/glimmer-dsl-wx/blob/master/screenshots/glimmer-dsl-wx-sample-hello-button.png?raw=true)
|
106
58
|
|
107
|
-
|
108
|
-
title 'Hello, Sizer!'
|
109
|
-
|
110
|
-
v_box_sizer {
|
111
|
-
button {
|
112
|
-
sizer_args 0, Wx::DOWN, 10
|
113
|
-
label 'Greeting 1'
|
114
|
-
|
115
|
-
on_button do
|
116
|
-
message_dialog(
|
117
|
-
"Hello",
|
118
|
-
"Greeting",
|
119
|
-
Wx::OK | Wx::ICON_INFORMATION
|
120
|
-
).show_modal
|
121
|
-
end
|
122
|
-
}
|
123
|
-
|
124
|
-
button {
|
125
|
-
sizer_args 0, Wx::DOWN, 10
|
126
|
-
label 'Greeting 2'
|
127
|
-
|
128
|
-
on_button do
|
129
|
-
message_dialog(
|
130
|
-
"Howdy",
|
131
|
-
"Greeting",
|
132
|
-
Wx::OK | Wx::ICON_INFORMATION
|
133
|
-
).show_modal
|
134
|
-
end
|
135
|
-
}
|
136
|
-
|
137
|
-
button {
|
138
|
-
sizer_args 0, Wx::DOWN, 10
|
139
|
-
label 'Greeting 3'
|
140
|
-
|
141
|
-
on_button do
|
142
|
-
message_dialog(
|
143
|
-
"Aloha",
|
144
|
-
"Greeting",
|
145
|
-
Wx::OK | Wx::ICON_INFORMATION
|
146
|
-
).show_modal
|
147
|
-
end
|
148
|
-
}
|
149
|
-
}
|
150
|
-
}
|
151
|
-
```
|
59
|
+
![Hello, Button! Clicked](https://github.com/AndyObtiva/glimmer-dsl-wx/blob/master/screenshots/glimmer-dsl-wx-sample-hello-button-clicked.png?raw=true)
|
152
60
|
|
153
61
|
**[Glimmer](https://rubygems.org/gems/glimmer) DSL Comparison Table:**
|
154
62
|
DSL | Platforms | Native? | Vector Graphics? | Pros | Cons | Prereqs
|
@@ -168,9 +76,13 @@ DSL | Platforms | Native? | Vector Graphics? | Pros | Cons | Prereqs
|
|
168
76
|
## Table of Contents
|
169
77
|
|
170
78
|
- [Glimmer DSL for WX](#)
|
171
|
-
- [
|
79
|
+
- [Setup](#setup)
|
172
80
|
- [GIRB (Glimmer IRB)](#girb-glimmer-irb)
|
173
81
|
- [Smart Defaults and Conventions](#smart-defaults-and-conventions)
|
82
|
+
- [Samples](#samples)
|
83
|
+
- [Hello, World!](#hello-world)
|
84
|
+
- [Hello, Button!](#hello-button)
|
85
|
+
- [Hello, Sizer!](#hello-sizer)
|
174
86
|
- [Process](#process)
|
175
87
|
- [Resources](#resources)
|
176
88
|
- [Help](#help)
|
@@ -182,7 +94,7 @@ DSL | Platforms | Native? | Vector Graphics? | Pros | Cons | Prereqs
|
|
182
94
|
- [Contributors](#contributors)
|
183
95
|
- [License](#license)
|
184
96
|
|
185
|
-
##
|
97
|
+
## Setup
|
186
98
|
|
187
99
|
Follow instructions for installing [wxruby3](https://github.com/mcorino/wxRuby3) on a supported platform (Linux or Windows):
|
188
100
|
https://github.com/mcorino/wxRuby3/blob/master/INSTALL.md
|
@@ -196,7 +108,7 @@ gem install glimmer-dsl-wx
|
|
196
108
|
Or install via Bundler `Gemfile`:
|
197
109
|
|
198
110
|
```ruby
|
199
|
-
gem 'glimmer-dsl-wx', '~> 0.0.
|
111
|
+
gem 'glimmer-dsl-wx', '~> 0.0.7'
|
200
112
|
```
|
201
113
|
|
202
114
|
Test that installation worked by running a sample:
|
@@ -223,9 +135,204 @@ This gives you `irb` with the `glimmer-dsl-wx` gem loaded and the `Glimmer` modu
|
|
223
135
|
|
224
136
|
## Smart Defaults and Conventions
|
225
137
|
|
226
|
-
- Instantiate any wxWidgets control by using its underscored name (e.g. `Button` becomes `button`)
|
138
|
+
- Instantiate any wxWidgets control or sizer by using its underscored name (e.g. `Button` becomes `button`)
|
227
139
|
- `frame` will automatically execute within a `Wx::App.run` block and `show` the Frame
|
228
140
|
|
141
|
+
## Samples
|
142
|
+
|
143
|
+
### Hello, World!
|
144
|
+
|
145
|
+
![Hello, World!](https://github.com/AndyObtiva/glimmer-dsl-wx/blob/master/screenshots/glimmer-dsl-wx-sample-hello-world.png?raw=true)
|
146
|
+
|
147
|
+
```ruby
|
148
|
+
require 'glimmer-dsl-wx'
|
149
|
+
|
150
|
+
include Glimmer
|
151
|
+
|
152
|
+
frame(title: 'Hello, World!')
|
153
|
+
```
|
154
|
+
|
155
|
+
Alternate Syntax:
|
156
|
+
|
157
|
+
```ruby
|
158
|
+
require 'glimmer-dsl-wx'
|
159
|
+
|
160
|
+
include Glimmer
|
161
|
+
|
162
|
+
frame {
|
163
|
+
title 'Hello, World!'
|
164
|
+
}
|
165
|
+
```
|
166
|
+
|
167
|
+
### Hello Button!
|
168
|
+
|
169
|
+
![Hello, Button!](https://github.com/AndyObtiva/glimmer-dsl-wx/blob/master/screenshots/glimmer-dsl-wx-sample-hello-button.png?raw=true)
|
170
|
+
|
171
|
+
![Hello, Button! Clicked](https://github.com/AndyObtiva/glimmer-dsl-wx/blob/master/screenshots/glimmer-dsl-wx-sample-hello-button-clicked.png?raw=true)
|
172
|
+
|
173
|
+
```ruby
|
174
|
+
require 'glimmer-dsl-wx'
|
175
|
+
|
176
|
+
include Glimmer
|
177
|
+
|
178
|
+
frame(title: 'Hello, Button!') { |main_frame|
|
179
|
+
h_box_sizer {
|
180
|
+
button(label: 'Click To Find Who Built This!') {
|
181
|
+
sizer_args 0, Wx::RIGHT, 10
|
182
|
+
|
183
|
+
on_button do
|
184
|
+
about_box(
|
185
|
+
name: main_frame.title,
|
186
|
+
version: Wx::WXRUBY_VERSION,
|
187
|
+
description: "This is the Hello, Button! sample",
|
188
|
+
developers: ['The Glimmer DSL for WX Development Team']
|
189
|
+
)
|
190
|
+
end
|
191
|
+
}
|
192
|
+
}
|
193
|
+
}
|
194
|
+
```
|
195
|
+
|
196
|
+
Alternate Syntax:
|
197
|
+
|
198
|
+
```ruby
|
199
|
+
require 'glimmer-dsl-wx'
|
200
|
+
|
201
|
+
include Glimmer
|
202
|
+
|
203
|
+
frame { |main_frame|
|
204
|
+
title 'Hello, Button!'
|
205
|
+
|
206
|
+
h_box_sizer {
|
207
|
+
button {
|
208
|
+
sizer_args 0, Wx::RIGHT, 10
|
209
|
+
label 'Click To Find Who Built This!'
|
210
|
+
|
211
|
+
on_button do
|
212
|
+
about_box(
|
213
|
+
name: main_frame.title,
|
214
|
+
version: Wx::WXRUBY_VERSION,
|
215
|
+
description: "This is the Hello, Button! sample",
|
216
|
+
developers: ['The Glimmer DSL for WX Development Team']
|
217
|
+
)
|
218
|
+
end
|
219
|
+
}
|
220
|
+
}
|
221
|
+
}
|
222
|
+
```
|
223
|
+
|
224
|
+
### Hello Sizer!
|
225
|
+
|
226
|
+
![Hello, Sizer!](https://github.com/AndyObtiva/glimmer-dsl-wx/blob/master/screenshots/glimmer-dsl-wx-sample-sizer-button.png?raw=true)
|
227
|
+
|
228
|
+
![Hello, Sizer! Clicked](https://github.com/AndyObtiva/glimmer-dsl-wx/blob/master/screenshots/glimmer-dsl-wx-sample-hello-sizer-clicked.png?raw=true)
|
229
|
+
|
230
|
+
```ruby
|
231
|
+
require 'glimmer-dsl-wx'
|
232
|
+
|
233
|
+
include Glimmer
|
234
|
+
|
235
|
+
frame { |main_frame|
|
236
|
+
title 'Hello, Sizer!'
|
237
|
+
|
238
|
+
h_box_sizer {
|
239
|
+
v_box_sizer {
|
240
|
+
sizer_args 0, Wx::RIGHT, 10
|
241
|
+
|
242
|
+
button {
|
243
|
+
sizer_args 0, Wx::DOWN, 10
|
244
|
+
label 'Greeting 1'
|
245
|
+
|
246
|
+
on_button do
|
247
|
+
message_dialog(
|
248
|
+
"Hello",
|
249
|
+
"Greeting",
|
250
|
+
Wx::OK | Wx::ICON_INFORMATION
|
251
|
+
).show_modal
|
252
|
+
end
|
253
|
+
}
|
254
|
+
|
255
|
+
spacer(10)
|
256
|
+
|
257
|
+
button {
|
258
|
+
sizer_args 0, Wx::DOWN, 10
|
259
|
+
label 'Greeting 2'
|
260
|
+
|
261
|
+
on_button do
|
262
|
+
message_dialog(
|
263
|
+
"Howdy",
|
264
|
+
"Greeting",
|
265
|
+
Wx::OK | Wx::ICON_INFORMATION
|
266
|
+
).show_modal
|
267
|
+
end
|
268
|
+
}
|
269
|
+
|
270
|
+
spacer(10)
|
271
|
+
|
272
|
+
button {
|
273
|
+
sizer_args 0, Wx::DOWN, 10
|
274
|
+
label 'Greeting 3'
|
275
|
+
|
276
|
+
on_button do
|
277
|
+
message_dialog(
|
278
|
+
"Hi",
|
279
|
+
"Greeting",
|
280
|
+
Wx::OK | Wx::ICON_INFORMATION
|
281
|
+
).show_modal
|
282
|
+
end
|
283
|
+
}
|
284
|
+
}
|
285
|
+
|
286
|
+
v_box_sizer {
|
287
|
+
sizer_args 0, Wx::RIGHT, 10
|
288
|
+
|
289
|
+
button {
|
290
|
+
sizer_args 0, Wx::DOWN, 10
|
291
|
+
label 'Greeting 4'
|
292
|
+
|
293
|
+
on_button do
|
294
|
+
message_dialog(
|
295
|
+
"Ciao",
|
296
|
+
"Greeting",
|
297
|
+
Wx::OK | Wx::ICON_INFORMATION
|
298
|
+
).show_modal
|
299
|
+
end
|
300
|
+
}
|
301
|
+
|
302
|
+
spacer(10)
|
303
|
+
|
304
|
+
button {
|
305
|
+
sizer_args 0, Wx::DOWN, 10
|
306
|
+
label 'Greeting 5'
|
307
|
+
|
308
|
+
on_button do
|
309
|
+
message_dialog(
|
310
|
+
"Aloha",
|
311
|
+
"Greeting",
|
312
|
+
Wx::OK | Wx::ICON_INFORMATION
|
313
|
+
).show_modal
|
314
|
+
end
|
315
|
+
}
|
316
|
+
|
317
|
+
spacer(10)
|
318
|
+
|
319
|
+
button {
|
320
|
+
sizer_args 0, Wx::DOWN, 10
|
321
|
+
label 'Greeting 6'
|
322
|
+
|
323
|
+
on_button do
|
324
|
+
message_dialog(
|
325
|
+
"Salut",
|
326
|
+
"Greeting",
|
327
|
+
Wx::OK | Wx::ICON_INFORMATION
|
328
|
+
).show_modal
|
329
|
+
end
|
330
|
+
}
|
331
|
+
}
|
332
|
+
}
|
333
|
+
}
|
334
|
+
```
|
335
|
+
|
229
336
|
## Process
|
230
337
|
|
231
338
|
[Glimmer Process](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/glimmer-dsl-wx.gemspec
CHANGED
Binary file
|
data/lib/glimmer/dsl/wx/dsl.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
# Copyright (c) 2023 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
require 'glimmer/dsl/expression'
|
23
|
+
require 'glimmer/wx/control_proxy'
|
24
|
+
require 'glimmer/wx/sizer_proxy'
|
25
|
+
|
26
|
+
module Glimmer
|
27
|
+
module DSL
|
28
|
+
module Wx
|
29
|
+
class SizerAddableExpression < Expression
|
30
|
+
def can_interpret?(parent, keyword, *args, &block)
|
31
|
+
parent.is_a?(Glimmer::Wx::SizerProxy) and
|
32
|
+
block.nil? and
|
33
|
+
parent.can_add_sizer_addable?(keyword)
|
34
|
+
end
|
35
|
+
|
36
|
+
def interpret(parent, keyword, *args, &block)
|
37
|
+
parent.add_sizer_addable(keyword, *args)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -29,7 +29,10 @@ module Glimmer
|
|
29
29
|
class SizerArgsExpression < StaticExpression
|
30
30
|
def can_interpret?(parent, keyword, *args, &block)
|
31
31
|
keyword == 'sizer_args' and
|
32
|
-
|
32
|
+
(
|
33
|
+
parent.is_a?(Glimmer::Wx::ControlProxy) or
|
34
|
+
parent.is_a?(Glimmer::Wx::SizerProxy)
|
35
|
+
) and
|
33
36
|
parent&.parent_proxy&.is_a?(Glimmer::Wx::SizerProxy)
|
34
37
|
end
|
35
38
|
|
@@ -61,6 +61,10 @@ module Glimmer
|
|
61
61
|
"#{keyword.to_s.camelcase(:upper)}Proxy".to_sym
|
62
62
|
end
|
63
63
|
|
64
|
+
def sizer_addable_method(keyword)
|
65
|
+
"add_#{keyword}"
|
66
|
+
end
|
67
|
+
|
64
68
|
def keyword(constant_symbol)
|
65
69
|
constant_symbol.to_s.underscore.sub(/_proxy$/, '')
|
66
70
|
end
|
@@ -136,6 +140,18 @@ module Glimmer
|
|
136
140
|
@wx.add(control_proxy.wx, *args)
|
137
141
|
end
|
138
142
|
|
143
|
+
# Checks if it can add a sizer addable (visual things other than controls)
|
144
|
+
# Example: for keyword `growable_col`, sizer addable method is `add_growable_col`
|
145
|
+
def can_add_sizer_addable?(keyword)
|
146
|
+
@wx.respond_to?(SizerProxy.sizer_addable_method(keyword))
|
147
|
+
end
|
148
|
+
|
149
|
+
# Adds a sizer addable (visual things other than controls)
|
150
|
+
# Example: for keyword `growable_col`, sizer addable method is `add_growable_col`
|
151
|
+
def add_sizer_addable(keyword, *args)
|
152
|
+
@wx.send(SizerProxy.sizer_addable_method(keyword), *args)
|
153
|
+
end
|
154
|
+
|
139
155
|
private
|
140
156
|
|
141
157
|
def build_sizer
|
@@ -26,44 +26,99 @@ include Glimmer
|
|
26
26
|
frame { |main_frame|
|
27
27
|
title 'Hello, Sizer!'
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
sizer_args 0, Wx::
|
32
|
-
label 'Greeting 1'
|
29
|
+
h_box_sizer {
|
30
|
+
v_box_sizer {
|
31
|
+
sizer_args 0, Wx::RIGHT, 10
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
33
|
+
button {
|
34
|
+
sizer_args 0, Wx::DOWN, 10
|
35
|
+
label 'Greeting 1'
|
36
|
+
|
37
|
+
on_button do
|
38
|
+
message_dialog(
|
39
|
+
"Hello",
|
40
|
+
"Greeting",
|
41
|
+
Wx::OK | Wx::ICON_INFORMATION
|
42
|
+
).show_modal
|
43
|
+
end
|
44
|
+
}
|
45
|
+
|
46
|
+
spacer(10)
|
47
|
+
|
48
|
+
button {
|
49
|
+
sizer_args 0, Wx::DOWN, 10
|
50
|
+
label 'Greeting 2'
|
51
|
+
|
52
|
+
on_button do
|
53
|
+
message_dialog(
|
54
|
+
"Howdy",
|
55
|
+
"Greeting",
|
56
|
+
Wx::OK | Wx::ICON_INFORMATION
|
57
|
+
).show_modal
|
58
|
+
end
|
59
|
+
}
|
60
|
+
|
61
|
+
spacer(10)
|
46
62
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
63
|
+
button {
|
64
|
+
sizer_args 0, Wx::DOWN, 10
|
65
|
+
label 'Greeting 3'
|
66
|
+
|
67
|
+
on_button do
|
68
|
+
message_dialog(
|
69
|
+
"Hi",
|
70
|
+
"Greeting",
|
71
|
+
Wx::OK | Wx::ICON_INFORMATION
|
72
|
+
).show_modal
|
73
|
+
end
|
74
|
+
}
|
54
75
|
}
|
55
76
|
|
56
|
-
|
57
|
-
sizer_args 0, Wx::
|
58
|
-
|
77
|
+
v_box_sizer {
|
78
|
+
sizer_args 0, Wx::RIGHT, 10
|
79
|
+
|
80
|
+
button {
|
81
|
+
sizer_args 0, Wx::DOWN, 10
|
82
|
+
label 'Greeting 4'
|
83
|
+
|
84
|
+
on_button do
|
85
|
+
message_dialog(
|
86
|
+
"Ciao",
|
87
|
+
"Greeting",
|
88
|
+
Wx::OK | Wx::ICON_INFORMATION
|
89
|
+
).show_modal
|
90
|
+
end
|
91
|
+
}
|
92
|
+
|
93
|
+
spacer(10)
|
94
|
+
|
95
|
+
button {
|
96
|
+
sizer_args 0, Wx::DOWN, 10
|
97
|
+
label 'Greeting 5'
|
98
|
+
|
99
|
+
on_button do
|
100
|
+
message_dialog(
|
101
|
+
"Aloha",
|
102
|
+
"Greeting",
|
103
|
+
Wx::OK | Wx::ICON_INFORMATION
|
104
|
+
).show_modal
|
105
|
+
end
|
106
|
+
}
|
107
|
+
|
108
|
+
spacer(10)
|
59
109
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
110
|
+
button {
|
111
|
+
sizer_args 0, Wx::DOWN, 10
|
112
|
+
label 'Greeting 6'
|
113
|
+
|
114
|
+
on_button do
|
115
|
+
message_dialog(
|
116
|
+
"Salut",
|
117
|
+
"Greeting",
|
118
|
+
Wx::OK | Wx::ICON_INFORMATION
|
119
|
+
).show_modal
|
120
|
+
end
|
121
|
+
}
|
67
122
|
}
|
68
123
|
}
|
69
124
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-wx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -240,6 +240,7 @@ files:
|
|
240
240
|
- lib/glimmer/dsl/wx/operation_expression.rb
|
241
241
|
- lib/glimmer/dsl/wx/property_expression.rb
|
242
242
|
- lib/glimmer/dsl/wx/shine_data_binding_expression.rb
|
243
|
+
- lib/glimmer/dsl/wx/sizer_addable_expression.rb
|
243
244
|
- lib/glimmer/dsl/wx/sizer_args_expression.rb
|
244
245
|
- lib/glimmer/dsl/wx/sizer_expression.rb
|
245
246
|
- lib/glimmer/proc_tracker.rb
|