glimmer-dsl-libui 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef6b80413ffc1933a0e36dd536f06d67538002ef7777aa682ef19f7ef01f7b28
4
- data.tar.gz: fb188b7bb041bdaf0a95aee368f339268459d41de7aa76947fa1504b56d465d2
3
+ metadata.gz: 3a22a20e6928aba5a45b52a05d55c4b6fc8fe33ff4e39c71701e4f3675c8c118
4
+ data.tar.gz: 13549e3b443fcc717a8ebee91694568a868bb7f3a6a6028f063b063d79af2e79
5
5
  SHA512:
6
- metadata.gz: 1530e1e986263701efebab10a2eff549bcadb7bc23c8e67cdde4c622822b9c6a54d74d9b2ccffb700f48021d1f34b6b10b683d85d0062202055b4d7b20acfb2f
7
- data.tar.gz: 89df7b4eab9bdd449ead5ac40a92fa1f7e5b56a72191dc649bc53df96994a733d048eb99f1710149a1e26a87123e45413f2d4d973704ca0e16406a43764ce0c2
6
+ metadata.gz: ce691f8f98fcae7063245d9a8cd14b61ed64f6207236a7b111de8a35c6e84225634faaf1968218567827b06cd2f4b1b20a664c013c85b1b761bcecd6fd87e095
7
+ data.tar.gz: 662d181cac9f3d86996b85d0aa8b725e99c154502867cdb8e1814dfc452956864772e31e6cac1127acf5966c29fd5aa017aea1cb4a3ad11c8331b7e42b49d756
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.26
4
+
5
+ - New examples/basic_table_progress_bar.rb
6
+ - Support table `progress_bar_column`
7
+
3
8
  ## 0.0.25
4
9
 
5
10
  - New examples/basic_table_checkbox_text.rb
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 LibUI 0.0.25
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 LibUI 0.0.26
2
2
  ## Prerequisite-Free Ruby Desktop Development GUI Library
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-libui.svg)](http://badge.fury.io/rb/glimmer-dsl-libui)
4
4
  [![Maintainability](https://api.codeclimate.com/v1/badges/ce2853efdbecf6ebdc73/maintainability)](https://codeclimate.com/github/AndyObtiva/glimmer-dsl-libui/maintainability)
@@ -43,7 +43,7 @@ Other [Glimmer](https://rubygems.org/gems/glimmer) DSL gems you might be interes
43
43
 
44
44
  ## Table of Contents
45
45
 
46
- - [Glimmer DSL for LibUI 0.0.25](#-glimmer-dsl-for-libui-0025)
46
+ - [Glimmer DSL for LibUI 0.0.26](#-glimmer-dsl-for-libui-0026)
47
47
  - [Glimmer GUI DSL Concepts](#glimmer-gui-dsl-concepts)
48
48
  - [Usage](#usage)
49
49
  - [API](#api)
@@ -77,6 +77,7 @@ Other [Glimmer](https://rubygems.org/gems/glimmer) DSL gems you might be interes
77
77
  - [Basic Table Button](#basic-table-button)
78
78
  - [Basic Table Checkbox](#basic-table-checkbox)
79
79
  - [Basic Table Checkbox Text](#basic-table-checkbox-text)
80
+ - [Basic Table Progress Bar](#basic-table-progress-bar)
80
81
  - [Contributing to glimmer-dsl-libui](#contributing-to-glimmer-dsl-libui)
81
82
  - [Help](#help)
82
83
  - [Issues](#issues)
@@ -164,7 +165,7 @@ gem install glimmer-dsl-libui
164
165
  Or install via Bundler `Gemfile`:
165
166
 
166
167
  ```ruby
167
- gem 'glimmer-dsl-libui', '~> 0.0.25'
168
+ gem 'glimmer-dsl-libui', '~> 0.0.26'
168
169
  ```
169
170
 
170
171
  Add `require 'glimmer-dsl-libui'` at the top, and then `include Glimmer` into the top-level main object for testing or into an actual class for serious usage.
@@ -250,6 +251,7 @@ Control(Args) | Properties | Listeners
250
251
  `non_wrapping_multiline_entry` | `read_only` (Boolean), `text` (`String`) | `on_changed`
251
252
  `preferences_menu_item` | None | `on_clicked`
252
253
  `progress_bar` | `value` (`Numeric`) | None
254
+ `progress_bar_column(name as String)` | None | None
253
255
  `quit_menu_item` | None | `on_clicked`
254
256
  `radio_buttons` | `selected` (`Integer`) | `on_selected`
255
257
  `slider(min as Numeric, max as Numeric)` | `value` (`Numeric`) | `on_changed`
@@ -2411,6 +2413,57 @@ window('Animal sounds', 400, 200) {
2411
2413
  }.show
2412
2414
  ```
2413
2415
 
2416
+ ### Basic Table Progress Bar
2417
+
2418
+ [examples/basic_table_progress_bar.rb](examples/basic_table_progress_bar.rb)
2419
+
2420
+ Run with this command from the root of the project if you cloned the project:
2421
+
2422
+ ```
2423
+ ruby -r './lib/glimmer-dsl-libui' examples/basic_table_progress_bar.rb
2424
+ ```
2425
+
2426
+ Run with this command if you installed the [Ruby gem](https://rubygems.org/gems/glimmer-dsl-libui):
2427
+
2428
+ ```
2429
+ ruby -r glimmer-dsl-libui -e "require 'examples/basic_table_progress_bar'"
2430
+ ```
2431
+
2432
+ Mac
2433
+
2434
+ ![glimmer-dsl-libui-mac-basic-table-progress-bar.png](images/glimmer-dsl-libui-mac-basic-table-progress-bar.png)
2435
+
2436
+ Linux
2437
+
2438
+ ![glimmer-dsl-libui-linux-basic-table-progress-bar.png](images/glimmer-dsl-libui-linux-basic-table-progress-bar.png)
2439
+
2440
+ New [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) Version:
2441
+
2442
+ ```ruby
2443
+ require 'glimmer-dsl-libui'
2444
+
2445
+ include Glimmer
2446
+
2447
+ data = [
2448
+ ['task 1', 0],
2449
+ ['task 2', 15],
2450
+ ['task 3', 100],
2451
+ ['task 4', 75],
2452
+ ['task 5', -1],
2453
+ ]
2454
+
2455
+ window('Task progress', 300, 200) {
2456
+ horizontal_box {
2457
+ table {
2458
+ text_column('Task')
2459
+ progress_bar_column('Progress')
2460
+
2461
+ cell_rows data
2462
+ }
2463
+ }
2464
+ }.show
2465
+ ```
2466
+
2414
2467
  ## Contributing to glimmer-dsl-libui
2415
2468
 
2416
2469
  - Check out the latest master to make sure the feature hasn't been
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.25
1
+ 0.0.26
@@ -17,7 +17,9 @@ window('Animal sounds', 400, 200) {
17
17
  table {
18
18
  text_column('Animal')
19
19
  text_column('Sound')
20
- checkbox_text_column('Description')
20
+ checkbox_text_column('Description') {
21
+ editable true
22
+ }
21
23
 
22
24
  cell_rows data
23
25
  }
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'glimmer-dsl-libui'
4
+
5
+ include Glimmer
6
+
7
+ data = [
8
+ ['task 1', 0],
9
+ ['task 2', 15],
10
+ ['task 3', 100],
11
+ ['task 4', 75],
12
+ ['task 5', -1],
13
+ ]
14
+
15
+ window('Task progress', 300, 200) {
16
+ horizontal_box {
17
+ table {
18
+ text_column('Task')
19
+ progress_bar_column('Progress')
20
+
21
+ cell_rows data
22
+ }
23
+ }
24
+ }.show
Binary file
@@ -0,0 +1,40 @@
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/control_proxy'
23
+ require 'glimmer/libui/column'
24
+
25
+ module Glimmer
26
+ module LibUI
27
+ # Proxy for LibUI progress bar column objects
28
+ #
29
+ # Follows the Proxy Design Pattern
30
+ class ProgressBarColumnProxy < ControlProxy
31
+ include Column
32
+
33
+ private
34
+
35
+ def build_control
36
+ @parent_proxy.append_progress_bar_column(name, column_index)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -111,10 +111,8 @@ module Glimmer
111
111
  0
112
112
  when ImageColumnProxy, ImageTextColumnProxy
113
113
  1
114
- when CheckboxColumnProxy, CheckboxTextColumnProxy
114
+ when CheckboxColumnProxy, CheckboxTextColumnProxy, ProgressBarColumnProxy
115
115
  2
116
- # when ProgressBarColumnProxy
117
- # 2
118
116
  end
119
117
  end
120
118
  @model_handler.NumRows = rbcallback(4) { cell_rows.count }
@@ -127,6 +125,8 @@ module Glimmer
127
125
  ::LibUI.new_table_value_image((expanded_cell_rows[row] && (expanded_cell_rows[row][column].respond_to?(:libui) ? expanded_cell_rows[row][column].libui : expanded_cell_rows[row][column])))
128
126
  when CheckboxColumnProxy, CheckboxTextColumnProxy
129
127
  ::LibUI.new_table_value_int((expanded_cell_rows[row] && (expanded_cell_rows[row][column] == 1 || expanded_cell_rows[row][column].to_s.strip.downcase == 'true' ? 1 : 0)))
128
+ when ProgressBarColumnProxy
129
+ ::LibUI.new_table_value_int((expanded_cell_rows[row] && (expanded_cell_rows[row][column].to_i)))
130
130
  end
131
131
  end
132
132
  @model_handler.SetCellValue = rbcallback(0, [1, 1, 4, 4, 1]) do |_, _, row, column, val|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-libui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
@@ -202,6 +202,7 @@ files:
202
202
  - examples/basic_table_checkbox_text.rb
203
203
  - examples/basic_table_image.rb
204
204
  - examples/basic_table_image_text.rb
205
+ - examples/basic_table_progress_bar.rb
205
206
  - examples/basic_window.rb
206
207
  - examples/basic_window2.rb
207
208
  - examples/color_button.rb
@@ -258,6 +259,7 @@ files:
258
259
  - lib/glimmer/libui/multiline_entry_proxy.rb
259
260
  - lib/glimmer/libui/non_wrapping_multiline_entry_proxy.rb
260
261
  - lib/glimmer/libui/preferences_menu_item_proxy.rb
262
+ - lib/glimmer/libui/progress_bar_column_proxy.rb
261
263
  - lib/glimmer/libui/quit_menu_item_proxy.rb
262
264
  - lib/glimmer/libui/radio_buttons_proxy.rb
263
265
  - lib/glimmer/libui/separator_menu_item_proxy.rb