ruby-iup 0.0.1-i386-mswin32 → 0.0.2-i386-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/examples/ctrl/degrade.rb +5 -2
  2. data/examples/ctrl/iupgauge.rb +5 -5
  3. data/examples/ctrl/iupplot2.rb +2 -5
  4. data/examples/dlg/iupalarm.rb +3 -1
  5. data/examples/elem/iupbutton.rb +42 -59
  6. data/examples/elem/iupcanvas.rb +4 -2
  7. data/examples/elem/iupcanvas2.rb +9 -8
  8. data/examples/elem/iupcanvas3.rb +19 -29
  9. data/examples/elem/iupdialog.rb +3 -7
  10. data/examples/elem/progressbar.rb +104 -118
  11. data/ext/iup-win32/cd.dll +0 -0
  12. data/ext/iup-win32/cd.lib +0 -0
  13. data/ext/iup-win32/cdcontextplus.dll +0 -0
  14. data/ext/iup-win32/cdcontextplus.lib +0 -0
  15. data/ext/iup-win32/cdpdf.dll +0 -0
  16. data/ext/iup-win32/cdpdf.lib +0 -0
  17. data/ext/iup-win32/freetype6.dll +0 -0
  18. data/ext/iup-win32/freetype6.lib +0 -0
  19. data/ext/iup-win32/im.dll +0 -0
  20. data/ext/iup-win32/im.lib +0 -0
  21. data/ext/iup-win32/im_avi.dll +0 -0
  22. data/ext/iup-win32/im_avi.lib +0 -0
  23. data/ext/iup-win32/im_capture.dll +0 -0
  24. data/ext/iup-win32/im_capture.lib +0 -0
  25. data/ext/iup-win32/im_fftw.dll +0 -0
  26. data/ext/iup-win32/im_fftw.lib +0 -0
  27. data/ext/iup-win32/im_jp2.dll +0 -0
  28. data/ext/iup-win32/im_jp2.lib +0 -0
  29. data/ext/iup-win32/im_process.dll +0 -0
  30. data/ext/iup-win32/im_process.lib +0 -0
  31. data/ext/iup-win32/im_wmv.dll +0 -0
  32. data/ext/iup-win32/im_wmv.lib +0 -0
  33. data/ext/iup-win32/imlua_capture51.dll +0 -0
  34. data/ext/iup-win32/imlua_capture51.lib +0 -0
  35. data/ext/iup-win32/imlua_wmv51.dll +0 -0
  36. data/ext/iup-win32/imlua_wmv51.lib +0 -0
  37. data/ext/iup-win32/iup.dll +0 -0
  38. data/ext/iup-win32/iup.lib +0 -0
  39. data/ext/iup-win32/iup_pplot.dll +0 -0
  40. data/ext/iup-win32/iup_pplot.lib +0 -0
  41. data/ext/iup-win32/iupcd.dll +0 -0
  42. data/ext/iup-win32/iupcd.lib +0 -0
  43. data/ext/iup-win32/iupcontrols.dll +0 -0
  44. data/ext/iup-win32/iupcontrols.lib +0 -0
  45. data/ext/iup-win32/iupgl.dll +0 -0
  46. data/ext/iup-win32/iupgl.lib +0 -0
  47. data/ext/iup-win32/iupgtk.dll +0 -0
  48. data/ext/iup-win32/iupgtk.lib +0 -0
  49. data/ext/iup-win32/iupim.dll +0 -0
  50. data/ext/iup-win32/iupim.lib +0 -0
  51. data/ext/iup-win32/iupimglib.dll +0 -0
  52. data/ext/iup-win32/iupimglib.lib +0 -0
  53. data/ext/iup-win32/iupole.dll +0 -0
  54. data/ext/iup-win32/iupole.lib +0 -0
  55. data/ext/iup-win32/iupstub.lib +0 -0
  56. data/ext/iup-win32/pdflib.dll +0 -0
  57. data/ext/iup-win32/pdflib.lib +0 -0
  58. data/ext/iup.c +3 -351
  59. data/ext/rb_iup.h +48 -15
  60. data/ext/rb_iupcb.h +1 -0
  61. data/ext/rb_iupcells.h +1 -0
  62. data/ext/rb_iupcolorbar.h +1 -4
  63. data/ext/rb_iupcontrols.h +0 -5
  64. data/ext/rb_iupdial.h +1 -0
  65. data/ext/rb_iupgauge.h +1 -0
  66. data/ext/rb_iupgc.h +0 -1
  67. data/ext/rb_iupmatrix.h +1 -0
  68. data/ext/rb_iupsbox.h +0 -1
  69. data/ext/rb_iuptabs.h +1 -0
  70. data/ext/rb_iuptree.h +1 -0
  71. data/ext/rb_iupval.h +1 -0
  72. data/lib/iup.so +0 -0
  73. metadata +15 -16
  74. data/ext/iup-win32/cdlua51.lib +0 -0
  75. data/ext/iup-win32/cdluacontextplus51.lib +0 -0
  76. data/ext/iup-win32/cdluaim51.lib +0 -0
  77. data/ext/iup-win32/cdluapdf51.lib +0 -0
  78. data/ext/iup-win32/iuplua51.lib +0 -0
  79. data/ext/iup-win32/iuplua_pplot51.lib +0 -0
  80. data/ext/iup-win32/iupluacd51.lib +0 -0
  81. data/ext/iup-win32/iupluacontrols51.lib +0 -0
  82. data/ext/iup-win32/iupluagl51.lib +0 -0
  83. data/ext/iup-win32/iupluaim51.lib +0 -0
  84. data/ext/iup-win32/iupluaimglib51.lib +0 -0
  85. data/ext/iup-win32/iupluaole51.lib +0 -0
  86. data/ext/rb_iupcbox.h +0 -40
  87. data/ext/rb_iupspeech.h +0 -25
@@ -1,11 +1,9 @@
1
1
  require 'rubygems'
2
- require 'iupruby'
2
+ require 'iup'
3
3
 
4
- exit
4
+ @increment = 0.01
5
5
 
6
- $increment = 0.01
7
-
8
- $pixmap_play = [
6
+ @pixmap_play = [
9
7
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
10
8
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
11
9
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
@@ -29,7 +27,7 @@ $pixmap_play = [
29
27
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
30
28
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
31
29
 
32
- $pixmap_restart = [
30
+ @pixmap_restart = [
33
31
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
34
32
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
35
33
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
@@ -53,7 +51,7 @@ $pixmap_restart = [
53
51
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
54
52
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
55
53
 
56
- $pixmap_rewind = [
54
+ @pixmap_rewind = [
57
55
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
58
56
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
59
57
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
@@ -77,7 +75,7 @@ $pixmap_rewind = [
77
75
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
78
76
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
79
77
 
80
- $pixmap_forward = [
78
+ @pixmap_forward = [
81
79
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
82
80
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
83
81
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
@@ -101,7 +99,7 @@ $pixmap_forward = [
101
99
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
102
100
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
103
101
 
104
- $pixmap_pause = [
102
+ @pixmap_pause = [
105
103
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
106
104
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
107
105
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
@@ -126,169 +124,157 @@ $pixmap_pause = [
126
124
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
127
125
 
128
126
  def createimg_s()
129
- img_restart = Iup.Image(22,22, $pixmap_restart)
130
- img_play = Iup.Image(22,22, $pixmap_play)
131
- img_forward = Iup.Image(22,22, $pixmap_forward)
132
- img_rewind = Iup.Image(22,22, $pixmap_rewind)
133
- img_pause = Iup.Image(22,22, $pixmap_pause)
134
-
135
- Iup.SetHandle("img_restart", img_restart)
136
- Iup.SetHandle("img_play", img_play)
137
- Iup.SetHandle("img_forward", img_forward)
138
- Iup.SetHandle("img_rewind", img_rewind)
139
- Iup.SetHandle("img_pause", img_pause)
140
-
141
- Iup.SetAttribute(img_restart, "1", "0 0 0")
142
- Iup.SetAttribute(img_restart, "2", "BGCOLOR")
143
- Iup.SetAttribute(img_play, "1", "0 0 0")
144
- Iup.SetAttribute(img_play, "2", "BGCOLOR")
145
- Iup.SetAttribute(img_forward, "1", "0 0 0")
146
- Iup.SetAttribute(img_forward, "2", "BGCOLOR")
147
- Iup.SetAttribute(img_rewind, "1", "0 0 0")
148
- Iup.SetAttribute(img_rewind, "2", "BGCOLOR")
149
- Iup.SetAttribute(img_pause, "1", "0 0 0")
150
- Iup.SetAttribute(img_pause, "2", "BGCOLOR")
127
+ @img_restart = Iup.Image(22,22, @pixmap_restart)
128
+ @img_play = Iup.Image(22,22, @pixmap_play)
129
+ @img_forward = Iup.Image(22,22, @pixmap_forward)
130
+ @img_rewind = Iup.Image(22,22, @pixmap_rewind)
131
+ @img_pause = Iup.Image(22,22, @pixmap_pause)
132
+
133
+ @img_restart["1"]= "0 0 0"
134
+ @img_restart["2"]= "BGCOLOR"
135
+ @img_play["1"]= "0 0 0"
136
+ @img_play["2"]= "BGCOLOR"
137
+ @img_forward["1"]= "0 0 0"
138
+ @img_forward["2"]= "BGCOLOR"
139
+ @img_rewind["1"]= "0 0 0"
140
+ @img_rewind["2"]= "BGCOLOR"
141
+ @img_pause["1"]= "0 0 0"
142
+ @img_pause["2"]= "BGCOLOR"
151
143
  end
152
144
 
153
- def time_cb(ih)
154
- value = Iup.GetFloat($progressbar1, "VALUE")
155
- value += $increment
145
+ @time_cb = lambda do |ih|
146
+ value = @progressbar1.value.to_f
147
+ value += @increment
156
148
  if(value > 1)
157
149
  value = 0 # start over */
158
150
  end
159
- Iup.SetAttribute($progressbar1, "VALUE", "%f" % value)
151
+ @progressbar1.value = value
160
152
 
161
- value = Iup.GetFloat($progressbar2, "VALUE")
162
- value += $increment*50
153
+ value = @progressbar2.value.to_f
154
+ value += @increment*50
163
155
  if(value > 50)
164
156
  value = 0 # start over */
165
157
  end
166
- Iup.SetAttribute($progressbar2, "VALUE", "%f" % value)
158
+ @progressbar2.value = value
167
159
  return Iup::DEFAULT
168
160
  end
169
161
 
170
- def btn_pause_cb(ih)
171
- if(Iup.GetInt($timer, "RUN")==0)
172
- Iup.SetAttribute($timer, "RUN", "YES")
173
- Iup.SetAttribute($btn_pause, "IMAGE", "img_pause")
162
+ @btn_pause_cb = lambda do |ih|
163
+ if(@timer.run == "NO")
164
+ @timer.run = "YES"
165
+ @btn_pause.image = @img_pause
174
166
  else
175
- Iup.SetAttribute($timer, "RUN", "NO")
176
- Iup.SetAttribute($btn_pause, "IMAGE", "img_play")
167
+ @timer.run = "NO"
168
+ @btn_pause.image = @img_play
177
169
  end
178
170
 
179
171
  return Iup::DEFAULT
180
172
  end
181
173
 
182
- def btn_restart_cb(ih)
183
- Iup.SetAttribute($progressbar1, "VALUE", "0")
184
- Iup.SetAttribute($progressbar2, "VALUE", "0")
174
+ @btn_restart_cb = lambda do |ih|
175
+ @progressbar1.value = 0
176
+ @progressbar2.value = 0
185
177
  return Iup::DEFAULT
186
178
  end
187
179
 
188
- def btn_accelerate_cb(ih)
189
- $increment *= 2
180
+ @btn_accelerate_cb = lambda do |ih|
181
+ @increment *= 2
190
182
  return Iup::DEFAULT
191
183
  end
192
184
 
193
- def btn_decelerate_cb(ih)
194
- $increment /= 2
185
+ @btn_decelerate_cb = lambda do |ih|
186
+ @increment /= 2
195
187
  return Iup::DEFAULT
196
188
  end
197
189
 
198
- def btn_show1_cb(ih)
199
- if(Iup.GetInt($progressbar1, "DASHED")==0)
200
- Iup.SetAttribute($progressbar1, "DASHED", "YES")
190
+ @btn_show1_cb = lambda do |ih|
191
+ if(@progressbar1.dashed=="NO")
192
+ @progressbar1.dashed = "YES"
201
193
  else
202
- Iup.SetAttribute($progressbar1, "DASHED", "NO")
194
+ @progressbar1.dashed = "NO"
203
195
  end
204
196
  return Iup::DEFAULT
205
197
  end
206
198
 
207
- def btn_show2_cb(ih)
208
- if(Iup.GetInt($progressbar1, "MARQUEE")==0)
209
- Iup.SetAttribute($progressbar1, "MARQUEE", "YES")
199
+ @btn_show2_cb = lambda do |ih|
200
+ if(@progressbar1.marquee=="NO")
201
+ @progressbar1.marquee = "YES"
210
202
  else
211
- Iup.SetAttribute($progressbar1, "MARQUEE", "NO")
203
+ @progressbar1.marquee = "NO"
212
204
  end
213
205
  return Iup::DEFAULT
214
206
  end
215
207
 
216
- Iup.Open # IUP initialization */
217
208
 
218
- $timer = Iup.Timer()
219
- Iup.SetCallback($timer, "ACTION_CB",'time_cb')
220
- Iup.SetAttribute($timer, "TIME", "100")
209
+ @timer = Iup.Timer()
210
+ @timer.action_cb = @time_cb
211
+ @timer.time = 100
221
212
 
222
- $progressbar1 = Iup.ProgressBar()
223
- $progressbar2 = Iup.ProgressBar()
213
+ @progressbar1 = Iup.ProgressBar()
214
+ @progressbar2 = Iup.ProgressBar()
224
215
 
225
- Iup.SetAttribute($progressbar1, "EXPAND", "YES")
226
- Iup.SetAttribute($progressbar1, "DASHED", "YES")
216
+ @progressbar1.expand = "YES"
217
+ @progressbar1.dashed = "YES"
218
+
219
+ @progressbar2.orientation = "VERTICAL"
220
+ @progressbar2.bgcolor = "255 0 128"
221
+ @progressbar2.fgcolor = "0 128 0"
222
+ @progressbar2.rastersize = "30x100"
223
+ @progressbar2.max = 50
224
+ @progressbar2.value = 25
227
225
 
228
- Iup.SetAttribute($progressbar2, "ORIENTATION", "VERTICAL")
229
- Iup.SetAttribute($progressbar2, "BGCOLOR", "255 0 128")
230
- Iup.SetAttribute($progressbar2, "FGCOLOR", "0 128 0")
231
- Iup.SetAttribute($progressbar2, "RASTERSIZE", "30x100")
232
- Iup.SetAttribute($progressbar2, "MAX", "50")
233
- Iup.SetAttribute($progressbar2, "VALUE", "25")
234
-
235
- btn_restart = Iup.Button(NULL, NULL)
236
- $btn_pause = Iup.Button(NULL, NULL)
237
- btn_accelerate = Iup.Button(NULL, NULL)
238
- btn_decelerate = Iup.Button(NULL, NULL)
239
- btn_show1 = Iup.Button("Dashed", NULL)
240
- btn_show2 = Iup.Button("Marquee", NULL)
226
+ @btn_restart = Iup.Button('')
227
+ @btn_pause = Iup.Button('')
228
+ @btn_accelerate = Iup.Button('')
229
+ @btn_decelerate = Iup.Button('')
230
+ @btn_show1 = Iup.Button("Dashed")
231
+ @btn_show2 = Iup.Button("Marquee")
241
232
 
242
233
  createimg_s()
243
234
 
244
- Iup.SetAttribute(btn_restart, "IMAGE", "img_restart")
245
- Iup.SetAttribute(btn_restart, "TIP", "Restart" )
246
- Iup.SetAttribute($btn_pause, "IMAGE", "img_pause")
247
- Iup.SetAttribute($btn_pause, "TIP", "Play/Pause")
248
- Iup.SetAttribute(btn_accelerate, "IMAGE", "img_forward")
249
- Iup.SetAttribute(btn_accelerate, "TIP", "Accelerate")
250
- Iup.SetAttribute(btn_decelerate, "IMAGE", "img_rewind")
251
- Iup.SetAttribute(btn_decelerate, "TIP", "Decelerate")
252
- Iup.SetAttribute(btn_show1, "TIP", "Dashed or Continuous")
253
- Iup.SetAttribute(btn_show2, "TIP", "Marquee or Defined")
235
+ @btn_restart.image = @img_restart
236
+ @btn_restart.tip = "Restart"
237
+ @btn_pause.image = @img_pause
238
+ @btn_pause.tip = "Play/Pause"
239
+ @btn_accelerate.image = @img_forward
240
+ @btn_accelerate.tip = "Accelerate"
241
+ @btn_decelerate.image = @img_rewind
242
+ @btn_decelerate.tip = "Decelerate"
243
+ @btn_show1.tip = "Dashed or Continuous"
244
+ @btn_show2.tip = "Marquee or Defined"
245
+
246
+ @progressbar1.dashed = "NO"
254
247
 
255
- hbox = Iup.Hbox([
248
+ @hbox = Iup.Hbox([
256
249
  Iup.Fill(),
257
- $btn_pause,
258
- btn_restart,
259
- btn_decelerate,
260
- btn_accelerate,
261
- btn_show1,
262
- btn_show2,
250
+ @btn_pause,
251
+ @btn_restart,
252
+ @btn_decelerate,
253
+ @btn_accelerate,
254
+ @btn_show1,
255
+ @btn_show2,
263
256
  Iup.Fill()])
264
257
 
265
- vbox = Iup.Hbox([Iup.Vbox([$progressbar1, hbox]), $progressbar2])
266
- Iup.SetAttribute(vbox, "MARGIN", "10x10")
267
- Iup.SetAttribute(vbox, "GAP", "5")
258
+ vbox = Iup.Hbox([Iup.Vbox([@progressbar1, @hbox]), @progressbar2])
259
+ vbox.margin = "10x10"
260
+ vbox.gap = "5"
268
261
 
269
262
  dlg = Iup.Dialog(vbox)
270
263
 
271
- Iup.SetAttribute(dlg, "TITLE", "Iup.ProgressBar Test")
264
+ dlg.title = "IupProgressBar Test"
272
265
 
273
- Iup.SetCallback($btn_pause, "ACTION",'$btn_pause_cb')
274
- Iup.SetCallback(btn_restart, "ACTION",'btn_restart_cb')
275
- Iup.SetCallback(btn_accelerate, "ACTION",'btn_accelerate_cb')
276
- Iup.SetCallback(btn_decelerate, "ACTION",'btn_decelerate_cb')
277
- Iup.SetCallback(btn_show1, "ACTION",'btn_show1_cb')
278
- Iup.SetCallback(btn_show2, "ACTION",'btn_show2_cb')
266
+ @btn_pause.action = @btn_pause_cb
267
+ @btn_restart.action = @btn_restart_cb
268
+ @btn_accelerate.action = @btn_accelerate_cb
269
+ @btn_decelerate.action = @btn_decelerate_cb
270
+ @btn_show1.action = @btn_show1_cb
271
+ @btn_show2.action = @btn_show2_cb
279
272
 
280
- Iup.ShowXY(dlg, Iup::CENTER, Iup::CENTER)
273
+ dlg.ShowXY(Iup::CENTER, Iup::CENTER)
281
274
 
282
- Iup.SetAttribute($timer, "RUN", "YES")
275
+ @timer.run = "YES"
283
276
 
284
- Iup.MainLoop()
277
+ Iup.MainLoop
285
278
 
286
- Iup.Destroy(dlg)
287
- Iup.Destroy(Iup.GetHandle("img_restart"))
288
- Iup.Destroy(Iup.GetHandle("img_play"))
289
- Iup.Destroy(Iup.GetHandle("img_forward"))
290
- Iup.Destroy(Iup.GetHandle("img_rewind"))
291
- Iup.Destroy(Iup.GetHandle("img_pause"))
292
-
293
- Iup.Close()
279
+ dlg.Destroy
294
280
 
data/ext/iup-win32/cd.dll CHANGED
Binary file
data/ext/iup-win32/cd.lib CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/ext/iup-win32/im.dll CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file