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 +4 -4
- data/lib/rgw/single-box.rb +89 -0
- data/lib/rgw/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25999c38e235258c5486626dfe7ebddae3844176
|
4
|
+
data.tar.gz: ed184bb9f0e46b8c4c7c78b33c3f59564c8f90b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/rgw/version.rb
CHANGED
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.
|
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-
|
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
|