glimmer-dsl-libui 0.0.6 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +298 -84
- data/VERSION +1 -1
- data/examples/basic_button.rb +1 -1
- data/examples/basic_entry.rb +3 -3
- data/examples/basic_window.rb +1 -1
- data/examples/basic_window2.rb +14 -0
- data/examples/control_gallery.rb +20 -36
- data/examples/font_button.rb +18 -0
- data/examples/meta_example.rb +61 -0
- data/examples/midi_player.rb +2 -2
- data/examples/simple_notepad.rb +1 -1
- data/glimmer-dsl-libui.gemspec +0 -0
- data/lib/glimmer/libui/box.rb +12 -2
- data/lib/glimmer/libui/control_proxy.rb +82 -25
- data/lib/glimmer/libui/date_picker_proxy.rb +32 -0
- data/lib/glimmer/libui/date_time_picker_proxy.rb +35 -0
- data/lib/glimmer/libui/font_button_proxy.rb +48 -0
- data/lib/glimmer/libui/group_proxy.rb +8 -0
- data/lib/glimmer/libui/quit_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/tab_item_proxy.rb +1 -0
- data/lib/glimmer/libui/time_picker_proxy.rb +32 -0
- data/lib/glimmer/libui/window_proxy.rb +13 -1
- metadata +12 -5
@@ -0,0 +1,32 @@
|
|
1
|
+
# Copyright (c) 2021 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/libui/date_time_picker_proxy'
|
23
|
+
|
24
|
+
module Glimmer
|
25
|
+
module LibUI
|
26
|
+
# Proxy for LibUI time picker objects
|
27
|
+
#
|
28
|
+
# Follows the Proxy Design Pattern
|
29
|
+
class TimePickerProxy < DateTimePickerProxy
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -27,6 +27,11 @@ module Glimmer
|
|
27
27
|
#
|
28
28
|
# Follows the Proxy Design Pattern
|
29
29
|
class WindowProxy < ControlProxy
|
30
|
+
DEFAULT_TITLE = 'Glimmer'
|
31
|
+
DEFAULT_WIDTH = 150
|
32
|
+
DEFAULT_HEIGHT = 150
|
33
|
+
DEFAULT_HAS_MENUBAR = 1
|
34
|
+
|
30
35
|
def post_initialize_child(child)
|
31
36
|
::LibUI.window_set_child(@libui, child.libui)
|
32
37
|
end
|
@@ -59,7 +64,14 @@ module Glimmer
|
|
59
64
|
private
|
60
65
|
|
61
66
|
def build_control
|
62
|
-
|
67
|
+
construction_args = @args.dup
|
68
|
+
construction_args[0] = DEFAULT_TITLE if construction_args.size == 0
|
69
|
+
construction_args[1] = DEFAULT_WIDTH if construction_args.size == 1
|
70
|
+
construction_args[2] = DEFAULT_HEIGHT if construction_args.size == 2
|
71
|
+
construction_args[3] = DEFAULT_HAS_MENUBAR if construction_args.size == 3
|
72
|
+
construction_args[3] = ControlProxy.boolean_to_integer(construction_args[3]) if construction_args.size == 4 && (construction_args[3].is_a?(TrueClass) || construction_args[3].is_a?(FalseClass))
|
73
|
+
@libui = ::LibUI.send("new_window", *construction_args)
|
74
|
+
@libui.tap do
|
63
75
|
handle_listener('on_closing') do
|
64
76
|
destroy
|
65
77
|
::LibUI.quit
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-libui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -142,9 +142,9 @@ dependencies:
|
|
142
142
|
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: 0.7.0
|
145
|
-
description: Prerequisite-Free Ruby Desktop Development GUI
|
146
|
-
any prerequisites. Just install the gem and have
|
147
|
-
that just works!)
|
145
|
+
description: Glimmer DSL for LibUI - Prerequisite-Free Ruby Desktop Development GUI
|
146
|
+
Library (no need to pre-install any prerequisites. Just install the gem and have
|
147
|
+
platform-independent native GUI that just works!)
|
148
148
|
email: andy.am@gmail.com
|
149
149
|
executables:
|
150
150
|
- girb
|
@@ -163,7 +163,10 @@ files:
|
|
163
163
|
- examples/basic_button.rb
|
164
164
|
- examples/basic_entry.rb
|
165
165
|
- examples/basic_window.rb
|
166
|
+
- examples/basic_window2.rb
|
166
167
|
- examples/control_gallery.rb
|
168
|
+
- examples/font_button.rb
|
169
|
+
- examples/meta_example.rb
|
167
170
|
- examples/midi_player.rb
|
168
171
|
- examples/simple_notepad.rb
|
169
172
|
- glimmer-dsl-libui.gemspec
|
@@ -181,7 +184,10 @@ files:
|
|
181
184
|
- lib/glimmer/libui/check_menu_item_proxy.rb
|
182
185
|
- lib/glimmer/libui/combobox_proxy.rb
|
183
186
|
- lib/glimmer/libui/control_proxy.rb
|
187
|
+
- lib/glimmer/libui/date_picker_proxy.rb
|
188
|
+
- lib/glimmer/libui/date_time_picker_proxy.rb
|
184
189
|
- lib/glimmer/libui/editable_combobox_proxy.rb
|
190
|
+
- lib/glimmer/libui/font_button_proxy.rb
|
185
191
|
- lib/glimmer/libui/group_proxy.rb
|
186
192
|
- lib/glimmer/libui/horizontal_box_proxy.rb
|
187
193
|
- lib/glimmer/libui/menu_item_proxy.rb
|
@@ -192,6 +198,7 @@ files:
|
|
192
198
|
- lib/glimmer/libui/radio_buttons_proxy.rb
|
193
199
|
- lib/glimmer/libui/separator_menu_item_proxy.rb
|
194
200
|
- lib/glimmer/libui/tab_item_proxy.rb
|
201
|
+
- lib/glimmer/libui/time_picker_proxy.rb
|
195
202
|
- lib/glimmer/libui/vertical_box_proxy.rb
|
196
203
|
- lib/glimmer/libui/window_proxy.rb
|
197
204
|
homepage: http://github.com/AndyObtiva/glimmer-dsl-libui
|