rgw 0.7.0 → 0.7.1

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
  SHA1:
3
- metadata.gz: 9118189dc4ce9ce2a94a207d887f91bac3d91081
4
- data.tar.gz: f7510de9b69a1ecdc3533ba7b0d7d072116c7c56
3
+ metadata.gz: 25999c38e235258c5486626dfe7ebddae3844176
4
+ data.tar.gz: ed184bb9f0e46b8c4c7c78b33c3f59564c8f90b6
5
5
  SHA512:
6
- metadata.gz: 9c5e96a833082cda3f8706cda478be825e2b5a888f69132402ac245326fbdeb14b627ff0e8ee9d8bddfec458e6d710c86e2339e07b70786e0bf919503776b6d1
7
- data.tar.gz: 85348ebadd21807a733ec0d45c01cb33c259d331d25efa1b0011fc8c4d755e5eba9b17dd2566b625670fdbaf7000668db0eb28c423a8e61fef40768ad45dd739
6
+ metadata.gz: 8fde0a128afdf6f2f33b97b0717cf9a71aefaa8883ca5ee53b8da48bcd28482819470da7cda7a2369e23e12c117fb45a0e95912b74e69411dfa9a0ad87a3fb6b
7
+ data.tar.gz: d62805bea062989014986f93873c17883590239d44c15f8e74200e1afc685276f490ca24d5558d7f02c79041e5961a1375e3e243cc5c84c26eaf16f5e95577c5
@@ -0,0 +1,89 @@
1
+ # encoding: UTF-8
2
+
3
+ =begin
4
+ SingleBox is free software; you can redistribute it and/or
5
+ modify it under the terms of the GNU Lesser General Public
6
+ License as published by the Free Software Foundation; either
7
+ version 2.1 of the License, or (at your option) any later version.
8
+
9
+ SingleBox is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ Lesser General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Lesser General Public
15
+ License along with SingleBox; if not, write to the Free Software
16
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+
18
+ Copyright 2014 Detlef Reichl detlef!reichl()gmx!org
19
+ =end
20
+
21
+
22
+ # prepare the Gtk::Widget class that it can contain the single box id
23
+ class Gtk::Widget
24
+ attr_accessor :rgw_single_box_id
25
+ end
26
+
27
+
28
+ module Rgw
29
+ class SingleBox < Gtk::Box
30
+ def initialize dir
31
+ super dir
32
+
33
+ # only show the first child on first show
34
+ show_id = signal_connect_after(:map) do
35
+ signal_handler_disconnect show_id
36
+ self.children[1..-1].each {|child| child.hide}
37
+ end
38
+ end
39
+
40
+
41
+ # The user should not be able to add already shown widgets.
42
+ def pack_start widget, *args
43
+ widget.hide
44
+ super
45
+ end
46
+
47
+
48
+ def pack_end widget, *args
49
+ widget.hide
50
+ super
51
+ end
52
+
53
+
54
+ def add widget
55
+ print "Warning: Do not use Container::add on a Rgw::SingleBox; Use pack_start instead\n"
56
+ end
57
+
58
+
59
+ def show_by_id id
60
+ cd = self.children
61
+ found = false
62
+ cd.each do |child|
63
+ raise RuntimeError, 'SingleBox contains children without id' if child.rgw_single_box_id.nil?
64
+ found = true if id == child.rgw_single_box_id
65
+ end
66
+ raise RuntimeError, 'invalid id' unless found
67
+ cd.each do |child|
68
+ unless id == child.rgw_single_box_id
69
+ child.hide
70
+ else
71
+ child.show
72
+ end
73
+ end
74
+ end
75
+
76
+
77
+ def show_by_index i
78
+ cd = self.children
79
+ raise ArgumentError, 'invalid child index' if i < 0 or i >= cd.length
80
+ ch.each_with_index do |child, idx|
81
+ unless idx == i
82
+ child.hide
83
+ else
84
+ child.show
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
@@ -1,3 +1,3 @@
1
1
  module Rgw
2
- VERSION = [0, 7, 0]
2
+ VERSION = [0, 7, 1]
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Detlef Reichl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-10 00:00:00.000000000 Z
11
+ date: 2014-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n-toolbox
@@ -54,6 +54,7 @@ files:
54
54
  - lib/rgw/property-editor.rb
55
55
  - lib/rgw/radio-revealer.rb
56
56
  - lib/rgw/restricted-entry.rb
57
+ - lib/rgw/single-box.rb
57
58
  - lib/rgw/synced-spin-button.rb
58
59
  - lib/rgw/types.rb
59
60
  - lib/rgw/version.rb