shul 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/shul.rb +76 -24
  5. metadata +1 -1
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7dce5b508edf2122525d766e52b0bd9304e5e5d8
4
- data.tar.gz: 92990ef34ddd4231100c5a615cee370a03ffb8e5
3
+ metadata.gz: 63dddbdfa823fc54011d661b0ebdcc34fec9f997
4
+ data.tar.gz: c7a3f7e25fb983f88e053fb29d0f4d09cf107964
5
5
  SHA512:
6
- metadata.gz: 6b72c58fc30d23510871a6b85df5056afdef9300af9d7b82e5baf685bf16078e797d9959f28117bb074f5c71895e076e4400a8852a1c2568dcae3706483479d7
7
- data.tar.gz: dc893dc40c1be0fdd8c8117ff4f1f2b38189285c4861da93af6932d8420979e17874408a55619df41b8e7f096a8323ac42b7931813b3860fc548dc4d1da7990d
6
+ metadata.gz: 2716793a176acd43b1b597ef1e681231b963f5b2ed5a372979980cbc2d1755e295dba7de24c3848508dd83f3bdd818b46f4faa96fac4d81ab535883cded99134
7
+ data.tar.gz: 26d654568d116dbec3c607538187c649df9679fa4990f12988d99bc1cc768b01c7eb493837ac6b63d39ef9dc24ea9ab551443d75c777322809305fd118339875
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/shul.rb CHANGED
@@ -31,6 +31,19 @@ require 'rexle'
31
31
  require 'rxfhelper'
32
32
 
33
33
 
34
+ class Rexle::Element
35
+
36
+ def obj()
37
+ @obj
38
+ end
39
+
40
+ def obj=(obj)
41
+ @obj = obj
42
+ end
43
+
44
+ end
45
+
46
+
34
47
  class Shul
35
48
 
36
49
  def initialize(shoes, source)
@@ -65,24 +78,30 @@ class Shul
65
78
  label = h[label]
66
79
  command = h[oncommand]
67
80
 
68
- @shoes.button label do
81
+ e.obj = @shoes.button label do
69
82
  eval command if command
70
83
  end
71
84
 
85
+ def e.label=(v)
86
+ self.obj.style[:text] = v
87
+ end
88
+
72
89
  end
73
90
 
74
91
  def checkbox(e)
75
92
 
76
93
  h = e.attributes
77
94
 
78
- c = @shoes.check
79
- c.checked = h[:checked] == 'true'
80
- @shoes.inscription h[:label]
95
+ @shoes.flow do
96
+ c = @shoes.check
97
+ c.checked = h[:checked] == 'true'
98
+ @shoes.para h[:label]
99
+ end
81
100
 
82
101
  end
83
102
 
84
103
  def description(e)
85
- @shoes.para e.attributes[:value]
104
+ e.obj = @shoes.para e.attributes[:value]
86
105
  end
87
106
 
88
107
  def doc()
@@ -90,16 +109,47 @@ class Shul
90
109
  end
91
110
 
92
111
  def editbox(e, name = :edit_line)
93
-
94
- def e.value() self.attributes[:value] end
95
- def e.value=(v) self.attributes[:value] = v end
96
-
112
+
97
113
  obj = @shoes.method(name).call
98
114
  obj.text = e.attributes[:value]
99
- obj.change {|x| e.value = x.text() }
115
+ obj.change {|x| e.value = x.text() if e.value != e.text}
116
+ e.obj = obj
117
+
118
+ def e.value()
119
+ self.attributes[:value]
120
+ end
121
+
122
+ def e.value=(v)
123
+ self.attributes[:value] = v
124
+ self.obj.text = v
125
+ end
100
126
 
101
127
  end
102
128
 
129
+ # This method is under-development
130
+ #
131
+ def grid(e)
132
+
133
+ # get the grid width
134
+ #grid_width = 100
135
+
136
+ # get the columns
137
+ columns = e.element 'columns'
138
+ cols = columns.xpath 'column'
139
+ cols_flex = cols.map {|x| x.attributes[:flex].to_s.to_i}
140
+
141
+ # get the rows
142
+ rows = e.element 'rows'
143
+ rows.each do |row|
144
+ a = row.xpath 'row'
145
+ # resize the width of each item
146
+ a.each do |x|
147
+ #x.width = 400
148
+ #puts "x: %s width: %s" + [x.inspect, x.width]
149
+ end
150
+ end
151
+ end
152
+
103
153
  def hbox(e)
104
154
 
105
155
  @shoes.flow do
@@ -115,7 +165,7 @@ class Shul
115
165
  command = e.attributes[:oncommand]
116
166
 
117
167
  @shoes.para(
118
- @shoes.link(e.text).click do
168
+ e.obj = @shoes.link(e.text).click do
119
169
  eval command if command
120
170
  end
121
171
  )
@@ -123,7 +173,8 @@ class Shul
123
173
  end
124
174
 
125
175
  def html_em(e)
126
- @shoes.para(@shoes.em(e.text))
176
+ e.obj = obj = @shoes.em(e.text)
177
+ @shoes.para()
127
178
  end
128
179
 
129
180
  alias html_i html_em
@@ -139,36 +190,36 @@ class Shul
139
190
  end
140
191
 
141
192
  def html_p(e)
142
- @shoes.para e.text
193
+ e.obj = @shoes.para e.text
143
194
  e.elements.each {|x| method(x.name.sub(':','_').to_sym).call(x) }
144
195
  end
145
196
 
146
197
  def html_span(e)
147
- @shoes.span e.text
198
+ e.obj = @shoes.span e.text
148
199
  end
149
200
 
150
201
  def html_strong(e)
151
- @shoes.strong e.text
202
+ e.obj = @shoes.strong e.text
152
203
  end
153
204
 
154
205
  alias html_b html_strong
155
206
 
156
207
  def image(e)
157
208
  h = e.attributes
158
- @shoes.image h[:src], top: h[:top], left: h[:left]
209
+ e.obj = @shoes.image h[:src], top: h[:top], left: h[:left]
159
210
  end
160
211
 
161
212
  def label(e)
162
- @shoes.para e.attributes[:value]
213
+ e.obj = @shoes.para e.attributes[:value]
163
214
  end
164
215
 
165
216
  def listbox(e)
166
217
  a = e.xpath 'listem/attribute::label'
167
- @shoes.list_box items: a
218
+ e.obj = @shoes.list_box items: a
168
219
  end
169
220
 
170
221
  def progressmeter(e)
171
- @shoes.progress
222
+ e.obj = @shoes.progress
172
223
  end
173
224
 
174
225
  def radiogroup(e)
@@ -181,11 +232,12 @@ class Shul
181
232
 
182
233
  x.value = x.attributes[:value]
183
234
  h = x.attributes
184
-
185
- r = @shoes.radio
186
-
187
- r.checked = h[:checked] == 'true'
188
- @shoes.inscription h[:label]
235
+ @shoes.flow do
236
+ r = @shoes.radio :radiogroup01
237
+
238
+ r.checked = h[:checked] == 'true'
239
+ @shoes.para h[:label]
240
+ end
189
241
 
190
242
  end
191
243
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file