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
@@ -8,6 +8,7 @@ def create()
8
8
  puts("CLICK: #{b}: (#{i}, #{j})")
9
9
  Iup::DEFAULT
10
10
  }
11
+
11
12
  cells.draw_cb = lambda {|h,i,j,xmin,xmax,ymin,ymax,cnv|
12
13
  xm = (xmax + xmin) / 2
13
14
  ym = (ymax + ymin) / 2
@@ -34,6 +35,7 @@ def create()
34
35
 
35
36
  Iup::DEFAULT
36
37
  }
38
+
37
39
  cells.width_cb = lambda {|h,j| (50+j*1.5).to_i }
38
40
  cells.height_cb = lambda {|h,i| (30+i*1.5).to_i }
39
41
  cells.nlines_cb = lambda {|h| 7 }
@@ -47,8 +49,8 @@ def create()
47
49
  return 2 if (i == 1 && j == 1)
48
50
  return 2 if (i == 5 && j == 5)
49
51
  1
50
- }
51
- cells.scroll_cb = lambda {|h,i,j|
52
+ }
53
+ cells.scrolling_cb = lambda {|h,i,j|
52
54
  puts("SCROLL: (#{i}, #{j})");
53
55
  Iup::DEFAULT
54
56
  }
@@ -64,6 +66,7 @@ end
64
66
 
65
67
  dlg = Iup.Dialog(box)
66
68
  dlg.title = "IupCells"
69
+ dlg.rastersize = "350x250"
67
70
  dlg.ShowXY(Iup::CENTER,Iup::CENTER)
68
71
  Iup.MainLoop
69
72
  dlg.Destroy
@@ -136,15 +136,15 @@ pixmap_show = [
136
136
  img_show = Iup.Image(22,22, pixmap_show)
137
137
 
138
138
  img_start["1"]= "0 0 0"
139
- img_start["2"]= Iup::BGCOLOR
139
+ img_start["2"]= "BGCOLOR"
140
140
  img_play["1"]= "0 0 0"
141
- img_play["2"]= Iup::BGCOLOR
141
+ img_play["2"]= "BGCOLOR"
142
142
  img_forward["1"]= "0 0 0"
143
- img_forward["2"]= Iup::BGCOLOR
143
+ img_forward["2"]= "BGCOLOR"
144
144
  img_rewind["1"]= "0 0 0"
145
- img_rewind["2"]= Iup::BGCOLOR
145
+ img_rewind["2"]= "BGCOLOR"
146
146
  img_show["1"]= "0 0 0"
147
- img_show["2"]= Iup::BGCOLOR
147
+ img_show["2"]= "BGCOLOR"
148
148
 
149
149
  btn_start = Iup.Button(:title=>"start",:image => img_start,:tip => "Start")
150
150
  btn_pause = Iup.Button(:title=>"pause",:image => img_play,:tip => "Pause")
@@ -235,10 +235,7 @@ class IupPlotTest
235
235
  end
236
236
 
237
237
  def tabs_get_index()
238
- curr_tab = @tabs.value
239
- ss = curr_tab.tabtitle
240
- ss = ss[5..-1] # Skip "Plot "
241
- ss.to_i
238
+ @tabs.valuepos.to_i
242
239
  end
243
240
 
244
241
  def initialize
@@ -246,7 +243,7 @@ class IupPlotTest
246
243
  # will be updated according to current @plot props
247
244
  tabs_tabchange_cb = lambda do |ih, new_tab, old_tab|
248
245
  ii=0
249
-
246
+
250
247
  ss = new_tab.tabtitle
251
248
  ss = ss[5..-1] # Skip "Plot "
252
249
  ii = ss.to_i
@@ -1,3 +1,5 @@
1
+ # Shows a dialog similar to the one shown when you exit a program without saving.
2
+
1
3
  require 'rubygems'
2
4
  require 'iup'
3
5
 
@@ -10,5 +12,5 @@ case(Iup.Alarm("IupAlarm Example","File not saved! Save it now?", "Yes", "No", "
10
12
  Iup.Message("Save file", "Operation canceled")
11
13
  end
12
14
 
13
- Iup.MainLoop()
15
+
14
16
 
@@ -1,14 +1,14 @@
1
+ #
2
+ # IupButton example
3
+ # Description : Creates four buttons. The first uses images, the second
4
+ # turns the first on and off, the third exits the
5
+ # application and the last does nothing
6
+ #
7
+
1
8
  require 'rubygems'
2
- #*****************************************************************************
3
- #* Iup.Button example *
4
- #* Author : Claudio Coutinho de Biasi *
5
- #* Description : Creates four buttons. The first uses images, the second *
6
- #* turns the first on and off, the third exits the *
7
- #* application and the last does nothing *
8
- #*****************************************************************************/
9
9
  require 'iup'
10
10
 
11
- #* Defines released button's image */
11
+ #* Defines released button's image
12
12
 
13
13
  pixmap_release = [
14
14
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
@@ -30,7 +30,7 @@ pixmap_release = [
30
30
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
31
31
  ]
32
32
 
33
- #* Defines pressed button's image */
33
+ #* Defines pressed button's image
34
34
  pixmap_press = [
35
35
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
36
36
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
@@ -51,7 +51,7 @@ pixmap_press = [
51
51
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
52
52
  ]
53
53
 
54
- #* Defines inactive button's image */
54
+ #* Defines inactive button's image
55
55
  pixmap_inactive = [
56
56
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
57
57
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
@@ -72,126 +72,109 @@ pixmap_inactive = [
72
72
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
73
73
  ]
74
74
 
75
- # Creates a text */
75
+ # Creates a text
76
76
  text = Iup.Text(:readonly=>"YES")
77
77
 
78
- # Defines released button's image size */
78
+ # Defines released button's image size
79
79
  img_release = Iup.Image(16, 16, pixmap_release)
80
80
 
81
- # Defines released button's image colors */
81
+ # Defines released button's image colors
82
82
  img_release["1"] = "215 215 215"
83
83
  img_release["2"] = "40 40 40"
84
84
  img_release["3"] = "30 50 210"
85
85
  img_release["4"] = "240 0 0"
86
86
 
87
- # Associates img_release with handle "img_release" */
88
- Iup.SetHandle( "img_release", img_release )
89
-
90
- # Defines pressed button's image size */
87
+ # Defines pressed button's image size
91
88
  img_press = Iup.Image( 16, 16, pixmap_press )
92
89
 
93
- # Defines pressed button's image colors */
90
+ # Defines pressed button's image colors
94
91
  img_press["1"] = "40 40 40"
95
92
  img_press["2"] = "215 215 215"
96
93
  img_press["3"] = "0 20 180"
97
94
  img_press["4"] = "210 0 0"
98
95
 
99
- # Associates img_press with handle "img_press" */
100
- Iup.SetHandle( "img_press", img_press )
101
-
102
- # Defines inactive button's image size */
96
+ # Defines inactive button's image size
103
97
  img_inactive = Iup.Image( 16, 16, pixmap_inactive )
104
98
 
105
- # Defines inactive button's image colors */
99
+ # Defines inactive button's image colors
106
100
  img_inactive["1"] = "215 215 215"
107
101
  img_inactive["2"] = "40 40 40"
108
102
  img_inactive["3"] = "100 100 100"
109
103
  img_inactive["4"] = "200 200 200"
110
104
 
111
- # Associates img_inactive with handle "img_inactive" */
112
- Iup.SetHandle("img_inactive", img_inactive )
105
+ # Creates a button
106
+ btn_image = Iup.Button(:title=>"Button with image",:image=>img_release,:impress=>img_press,:iminactive=>img_inactive)
113
107
 
114
- # Creates a button */
115
- btn_image = Iup.Button(:title=>"Button with image",:image=>"img_release",:impress=>"img_press",:iminactive=>"img_inactive")
116
-
117
- # Creates a button */
108
+ # Creates a button
118
109
  btn_big = Iup.Button(:title=>"Big useless button",:size=>"EIGHTHxEIGHTH")
119
110
 
120
- # Creates a button entitled Exit associated with action exit_act */
111
+ # Creates a button entitled Exit associated with action exit_act
121
112
  btn_exit = Iup.Button("Exit")
122
113
 
123
- # Creates a button entitled on/off associated with action onoff_act */
114
+ # Creates a button entitled on/off associated with action onoff_act
124
115
  btn_on_off = Iup.Button("on/off")
125
116
 
126
- # Creates dialog with the four buttons and the text*/
117
+ # Creates dialog with the four buttons and the text
127
118
  dlg = Iup.Dialog(
128
119
  Iup.Vbox([
129
120
  Iup.Hbox([
130
- Iup.Fill(),
131
121
  btn_image,
132
122
  btn_on_off,
133
- btn_exit,
134
- Iup.Fill()]
135
- ),
123
+ btn_exit]),
136
124
  text,
137
- btn_big]
138
- ),
125
+ btn_big]),
139
126
  :expand=>"YES",:title=>"IupButton",:resize=>"NO",
140
127
  :menubox=>"NO",:maxbox=>"NO",:minbox=>"NO")
141
128
 
142
129
 
143
130
  btn_on_off_cb = lambda do |ih|
144
- # If the button with with image is active...*/
131
+ # If the button with with image is active...
145
132
  if(btn_image.active=="YES")
146
- # Deactivates the button with image */
133
+ # Deactivates the button with image
147
134
  btn_image.active = "NO"
148
- # else it is inactive */
135
+ # else it is inactive
149
136
  else
150
- # Activates the button with image */
137
+ # Activates the button with image
151
138
  btn_image.active = "YES"
152
139
  end
153
140
 
154
- # Executed function sucessfully */
141
+ # Executed function sucessfully
155
142
  Iup::DEFAULT
156
143
  end
157
144
 
158
145
  btn_image_button_cb = lambda do |ih,b,e,x,y,status|
159
- # If the left button changed its state... */
160
- if( b == Iup::BUTTON1 )
161
- # If the button was pressed... */
162
- if(e == 1)
163
- # Sets text's value */
146
+ # If the left button changed its state...
147
+ if b == Iup::BUTTON1
148
+ # If the button was pressed...
149
+ if e == 1
150
+ # Sets text's value
164
151
  text.value = "Red button pressed"
165
- # else the button was released */
152
+ # else the button was released
166
153
  else
167
- # Sets text's value */
154
+ # Sets text's value
168
155
  text.value = "Red button released"
169
156
  end
170
157
  end
171
158
 
172
- # Executed function sucessfully */
159
+ # Executed function sucessfully
173
160
  Iup::DEFAULT
174
161
  end
175
162
 
176
163
  btn_exit_cb = lambda do |ih|
177
- # Exits the program */
164
+ # Exits the program
178
165
  Iup::CLOSE
179
166
  end
180
167
 
181
168
 
182
- # Registers callbacks */
169
+ # Registers callbacks
183
170
  btn_exit.action = btn_exit_cb
184
171
  btn_on_off.action = btn_on_off_cb
185
172
  btn_image.button_cb = btn_image_button_cb
186
173
 
187
- # Shows dialog on the center of the screen */
174
+ # Shows dialog on the center of the screen
188
175
  dlg.ShowXY(Iup::CENTER, Iup::CENTER )
189
176
 
190
- # Initializes IUP main loop */
177
+ # Initializes IUP main loop
191
178
  Iup.MainLoop()
192
179
 
193
180
  dlg.Destroy()
194
- img_release.Destroy()
195
- img_inactive.Destroy()
196
- img_press.Destroy()
197
-
@@ -1,3 +1,7 @@
1
+ # IupCanvas example
2
+ # Description : Creates a IUP canvas and uses CD to draw on it
3
+ # Remark : IUP must be linked to the CD library
4
+
1
5
  require 'rubygems'
2
6
  require 'iup'
3
7
 
@@ -19,9 +23,7 @@ end
19
23
 
20
24
  cdcanvas = Cd.CreateCanvas( Cd.CD_IUP, cnvs )
21
25
 
22
- # Shows dialog on the center of the screen */
23
26
  dlg.ShowXY(Iup::CENTER, Iup::CENTER )
24
27
 
25
- # Initializes IUP main loop */
26
28
  Iup.MainLoop()
27
29
  dlg.Destroy()
@@ -1,3 +1,7 @@
1
+ # Advanced IupCanvas example
2
+ # Description : This example shows how several canvas callbacks are used and how the scrollbar works.
3
+ # Remark : IUP must be linked to the CD library
4
+
1
5
  require 'rubygems'
2
6
  require 'iup'
3
7
 
@@ -93,21 +97,18 @@ end
93
97
  dlg.ShowXY(Iup::CENTER,Iup::CENTER)
94
98
 
95
99
  cdcanvas = Cd.CreateCanvas(Cd.CD_IUP, iupcanvas)
96
-
97
100
  if(cdcanvas==nil)
98
101
  Iup.Message("IupCanvas","Error creating canvas")
99
- dlg.Destroy()
102
+ dlg.Destroy
100
103
  exit
101
104
  end
102
105
 
103
106
  if(cdcanvas.Activate() == Cd::ERROR)
104
107
  Iup.Message("IupCanvas","Error creating canvas")
105
- dlg.Destroy()
108
+ dlg.Destroy
106
109
  exit
107
110
  end
108
111
 
109
- cdcanvas.CanvasClear()
110
-
111
- # Initializes IUP main loop */
112
- Iup.MainLoop()
113
- dlg.Destroy()
112
+ cdcanvas.CanvasClear
113
+ Iup.MainLoop
114
+ dlg.Destroy
@@ -1,49 +1,38 @@
1
+ # IupCanvas Redraw example
2
+
1
3
  require 'rubygems'
2
4
  require 'iup'
3
5
 
4
- need_redraw = nil
6
+ need_redraw = 0
7
+ redraw_count = 0
5
8
  cdcanvas = nil
6
9
 
7
10
 
8
- gauge = Iup.Gauge()
11
+ gauge = Iup.ProgressBar()
9
12
  cv = Iup.Canvas()
10
- bt = Iup.Button("Restart")
13
+ bt = Iup.Button("Start/Stop")
11
14
  bt.size = "50x50"
12
- bt.fgcolor = "255 255 255"
13
15
  gauge.size = "200x15"
14
16
  cv.size = "200x200"
15
17
  dlg = Iup.Dialog(Iup.Vbox([cv, Iup.Hbox([gauge, bt])]),:title=>"Redraw test")
16
18
 
17
19
  toggle_redraw = lambda do |ih|
20
+ cdcanvas.CanvasActivate() if cdcanvas
18
21
  need_redraw = 1 - need_redraw
19
22
  Iup::DEFAULT
20
23
  end
21
24
 
22
- fake_redraw = lambda do |ih,posx,posy|
23
- need_redraw = 1
24
- Iup::DEFAULT
25
- end
26
-
27
25
  redraw = lambda do
28
26
  if(need_redraw == 1)
29
- need_redraw = 0
30
- bt.fgcolor = "255 0 0"
31
- Iup.Flush()
32
-
33
- cdcanvas.CanvasActivate()
34
- cdcanvas.CanvasForeground(Cd::BLUE)
35
- cdcanvas.CanvasClear()
36
-
37
- for i in 0 ... 300000
38
- cdcanvas.CanvasBox(0, 300, 0, i/1000)
39
- gauge.value = "%f" % (i/300000.0)
40
-
41
- Iup.LoopStep()
42
- end
43
-
44
- bt.fgcolor = "255 255 255"
45
- Iup.Flush()
46
- end
27
+ cdcanvas.CanvasBox(0, 300, 0, redraw_count/100)
28
+ gauge.value = redraw_count/30000.0
29
+ redraw_count += 1
30
+ if(redraw_count==30000)
31
+ cdcanvas.CanvasClear()
32
+ redraw_count = 0
33
+ need_redraw = 0
34
+ end
35
+ end
47
36
  Iup::DEFAULT
48
37
  end
49
38
 
@@ -53,8 +42,9 @@ end
53
42
  dlg.Map()
54
43
 
55
44
  cdcanvas = Cd.CreateCanvas(Cd.CD_IUP, cv)
56
-
57
- cv.action = fake_redraw
45
+ cdcanvas.CanvasForeground(Cd::BLUE)
46
+ cdcanvas.CanvasClear()
47
+
58
48
  bt.action = toggle_redraw
59
49
 
60
50
  dlg.ShowXY(Iup::CENTER, Iup::CENTER)
@@ -50,22 +50,18 @@ end
50
50
  icon["4"] = "128 128 128"
51
51
  icon["5"] = "192 192 192"
52
52
  icon["6"] = "000 000 255"
53
- Iup.SetHandle("icon", icon)
54
53
 
55
54
  # Creating dialog's content */
56
55
  quit_bt = Iup.Button(:title=>"Quit",:action=>quit_cb)
57
- Iup.SetHandle("quit", quit_bt)
58
56
 
59
57
  # Creating dialog's menu */
60
58
  options = Iup.Menu([Iup.Item(:title=>"Exit",:action=>quit_cb)])
61
59
  submenu = Iup.Submenu("File", options)
62
60
  menu = Iup.Menu([submenu])
63
- Iup.SetHandle("menu", menu)
64
61
 
65
62
  # Creating main dialog */
66
- dialog = Iup.Dialog(Iup.Vbox([quit_bt]),:title=>"IupDialog",:menu=>"menu",:cursor=>"CROSS",:icon=>"icon",:defaultesc=>"quit")
63
+ dialog = Iup.Dialog(Iup.Vbox([quit_bt]),:title=>"IupDialog",:menu=>menu,:cursor=>"CROSS",:icon=>icon,:defaultesc=>quit_bt)
67
64
 
68
65
  dialog.ShowXY(Iup::CENTER, Iup::CENTER)
69
- Iup.MainLoop()
70
- dialog.Destroy()
71
- icon.Destroy()
66
+ Iup.MainLoop
67
+ dialog.Destroy