ruby-iup 0.1.0-x86-mswin32-60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +3 -0
 - data/MANIFEST +8 -0
 - data/MIT-LICENSE +18 -0
 - data/README +12 -0
 - data/Rakefile +85 -0
 - data/doc/README +10 -0
 - data/doc/build_install.txt +74 -0
 - data/examples/README +16 -0
 - data/examples/ctrl/cbox.rb +220 -0
 - data/examples/ctrl/checkboard.rb +33 -0
 - data/examples/ctrl/degrade.rb +76 -0
 - data/examples/ctrl/example1.rb +53 -0
 - data/examples/ctrl/example2.rb +39 -0
 - data/examples/ctrl/iupcolorbar.rb +95 -0
 - data/examples/ctrl/iupcolorbrowser.rb +45 -0
 - data/examples/ctrl/iupdial.rb +117 -0
 - data/examples/ctrl/iupgauge.rb +242 -0
 - data/examples/ctrl/iupgetcolor.rb +8 -0
 - data/examples/ctrl/iupgetparam.rb +62 -0
 - data/examples/ctrl/iupglcanvas.rb +172 -0
 - data/examples/ctrl/iupmask.rb +13 -0
 - data/examples/ctrl/iupmatrix.rb +39 -0
 - data/examples/ctrl/iupplot2.rb +601 -0
 - data/examples/ctrl/iuptabs.rb +22 -0
 - data/examples/ctrl/iuptree.rb +190 -0
 - data/examples/ctrl/iupval.rb +71 -0
 - data/examples/ctrl/numbering.rb +46 -0
 - data/examples/ctrl/sample.rb +166 -0
 - data/examples/dlg/iupalarm.rb +16 -0
 - data/examples/dlg/iupfiledlg.rb +19 -0
 - data/examples/dlg/iupgetfile.rb +19 -0
 - data/examples/dlg/iuplistdialog.rb +26 -0
 - data/examples/dlg/iupmessage.rb +5 -0
 - data/examples/dlg/iupscanf.rb +17 -0
 - data/examples/elem/iupbutton.rb +180 -0
 - data/examples/elem/iupcanvas.rb +29 -0
 - data/examples/elem/iupcanvas2.rb +114 -0
 - data/examples/elem/iupcanvas3.rb +52 -0
 - data/examples/elem/iupdialog.rb +67 -0
 - data/examples/elem/iupdialog2.rb +25 -0
 - data/examples/elem/iupfill.rb +51 -0
 - data/examples/elem/iupframe.rb +25 -0
 - data/examples/elem/iuphbox.rb +68 -0
 - data/examples/elem/iupimage.rb +113 -0
 - data/examples/elem/iupitem.rb +60 -0
 - data/examples/elem/iuplabel.rb +57 -0
 - data/examples/elem/iuplist.rb +41 -0
 - data/examples/elem/iuplist2.rb +125 -0
 - data/examples/elem/iupmenu.rb +32 -0
 - data/examples/elem/iupmultiline.rb +24 -0
 - data/examples/elem/iupmultiline2.rb +156 -0
 - data/examples/elem/iupradio.rb +32 -0
 - data/examples/elem/iupseparator.rb +81 -0
 - data/examples/elem/iupsubmenu.rb +85 -0
 - data/examples/elem/iuptimer.rb +36 -0
 - data/examples/elem/iuptoggle.rb +110 -0
 - data/examples/elem/iupvbox.rb +87 -0
 - data/examples/elem/iupzbox.rb +60 -0
 - data/examples/elem/mdisample.rb +377 -0
 - data/examples/elem/progressbar.rb +280 -0
 - data/examples/elem/scrollbar.rb +66 -0
 - data/examples/elem/tray.rb +90 -0
 - data/examples/func/iupgetattribute.rb +32 -0
 - data/examples/func/iupidle.rb +48 -0
 - data/lib/iup.so +0 -0
 - data/ruby-iup.gemspec +26 -0
 - data/test/test_ruby_iup.rb +25 -0
 - metadata +132 -0
 
| 
         @@ -0,0 +1,280 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'rubygems'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'iup'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            @increment = 0.01
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            @pixmap_play = [
         
     | 
| 
      
 7 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 8 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 9 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 10 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 11 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 12 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 13 
     | 
    
         
            +
             2,2,2,2,2,2,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 14 
     | 
    
         
            +
             2,2,2,2,2,2,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 15 
     | 
    
         
            +
             2,2,2,2,2,2,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 16 
     | 
    
         
            +
             2,2,2,2,2,2,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 17 
     | 
    
         
            +
             2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 18 
     | 
    
         
            +
             2,2,2,2,2,2,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 19 
     | 
    
         
            +
             2,2,2,2,2,2,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 20 
     | 
    
         
            +
             2,2,2,2,2,2,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 21 
     | 
    
         
            +
             2,2,2,2,2,2,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 22 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 23 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 24 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 25 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 26 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 27 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 28 
     | 
    
         
            +
             2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
            @pixmap_restart = [
         
     | 
| 
      
 31 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 32 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 33 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 34 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 35 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 36 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 37 
     | 
    
         
            +
            2,2,2,2,1,1,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 38 
     | 
    
         
            +
            2,2,2,2,1,1,2,2,2,2,2,2,1,1,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 39 
     | 
    
         
            +
            2,2,2,2,1,1,2,2,2,2,1,1,1,1,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 40 
     | 
    
         
            +
            2,2,2,2,1,1,2,2,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 41 
     | 
    
         
            +
            2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 42 
     | 
    
         
            +
            2,2,2,2,1,1,2,2,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 43 
     | 
    
         
            +
            2,2,2,2,1,1,2,2,2,2,1,1,1,1,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 44 
     | 
    
         
            +
            2,2,2,2,1,1,2,2,2,2,2,2,1,1,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 45 
     | 
    
         
            +
            2,2,2,2,1,1,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 46 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 47 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 48 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 49 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 50 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 51 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 52 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
            @pixmap_rewind = [
         
     | 
| 
      
 55 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 56 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 57 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 58 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 59 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 60 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 61 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,1,2,2,2,2,1,2,2,2,2,2,2,2,
         
     | 
| 
      
 62 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,1,1,2,2,2,1,1,2,2,2,2,2,2,2,
         
     | 
| 
      
 63 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,1,2,2,1,1,1,2,2,2,2,2,2,2,
         
     | 
| 
      
 64 
     | 
    
         
            +
            2,2,2,2,2,2,1,1,1,1,2,1,1,1,1,2,2,2,2,2,2,2,
         
     | 
| 
      
 65 
     | 
    
         
            +
            2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,
         
     | 
| 
      
 66 
     | 
    
         
            +
            2,2,2,2,2,2,1,1,1,1,2,1,1,1,1,2,2,2,2,2,2,2,
         
     | 
| 
      
 67 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,1,2,2,1,1,1,2,2,2,2,2,2,2,
         
     | 
| 
      
 68 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,1,1,2,2,2,1,1,2,2,2,2,2,2,2,
         
     | 
| 
      
 69 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,1,2,2,2,2,1,2,2,2,2,2,2,2,
         
     | 
| 
      
 70 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 71 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 72 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 73 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 74 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 75 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 76 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
            @pixmap_forward = [
         
     | 
| 
      
 79 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 80 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 81 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 82 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 83 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 84 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 85 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,2,2,2,2,1,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 86 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,2,2,2,1,1,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 87 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,1,2,2,1,1,1,2,2,2,2,2,2,2,
         
     | 
| 
      
 88 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,1,1,2,1,1,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 89 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,
         
     | 
| 
      
 90 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,1,1,2,1,1,1,1,2,2,2,2,2,2,
         
     | 
| 
      
 91 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,1,2,2,1,1,1,2,2,2,2,2,2,2,
         
     | 
| 
      
 92 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,2,2,2,1,1,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 93 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,2,2,2,2,1,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 94 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 95 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 96 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 97 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 98 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 99 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 100 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
            @pixmap_pause = [
         
     | 
| 
      
 103 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 104 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 105 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 106 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 107 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 108 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 109 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,2,2,1,1,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 110 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,2,2,1,1,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 111 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,2,2,1,1,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 112 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,2,2,1,1,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 113 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,2,2,1,1,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 114 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,2,2,1,1,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 115 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,2,2,1,1,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 116 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,2,2,1,1,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 117 
     | 
    
         
            +
            2,2,2,2,2,2,2,1,1,2,2,1,1,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 118 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 119 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 120 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 121 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 122 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 123 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
         
     | 
| 
      
 124 
     | 
    
         
            +
            2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
         
     | 
| 
      
 125 
     | 
    
         
            +
             
     | 
| 
      
 126 
     | 
    
         
            +
            def createimg_s()
         
     | 
| 
      
 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"
         
     | 
| 
      
 143 
     | 
    
         
            +
            end
         
     | 
| 
      
 144 
     | 
    
         
            +
             
     | 
| 
      
 145 
     | 
    
         
            +
            @time_cb = lambda do |ih|
         
     | 
| 
      
 146 
     | 
    
         
            +
              value = @progressbar1.value.to_f
         
     | 
| 
      
 147 
     | 
    
         
            +
              value += @increment
         
     | 
| 
      
 148 
     | 
    
         
            +
              if(value > 1) 
         
     | 
| 
      
 149 
     | 
    
         
            +
              	value = 0 # start over */
         
     | 
| 
      
 150 
     | 
    
         
            +
              end
         
     | 
| 
      
 151 
     | 
    
         
            +
              @progressbar1.value = value
         
     | 
| 
      
 152 
     | 
    
         
            +
             
     | 
| 
      
 153 
     | 
    
         
            +
              value = @progressbar2.value.to_f
         
     | 
| 
      
 154 
     | 
    
         
            +
              value += @increment*50
         
     | 
| 
      
 155 
     | 
    
         
            +
              if(value > 50) 
         
     | 
| 
      
 156 
     | 
    
         
            +
              	value = 0 # start over */
         
     | 
| 
      
 157 
     | 
    
         
            +
              end
         
     | 
| 
      
 158 
     | 
    
         
            +
              @progressbar2.value = value
         
     | 
| 
      
 159 
     | 
    
         
            +
              return Iup::DEFAULT
         
     | 
| 
      
 160 
     | 
    
         
            +
            end
         
     | 
| 
      
 161 
     | 
    
         
            +
             
     | 
| 
      
 162 
     | 
    
         
            +
            @btn_pause_cb = lambda do |ih|
         
     | 
| 
      
 163 
     | 
    
         
            +
              if(@timer.run == "NO")
         
     | 
| 
      
 164 
     | 
    
         
            +
                @timer.run = "YES"
         
     | 
| 
      
 165 
     | 
    
         
            +
                @btn_pause.image = @img_pause
         
     | 
| 
      
 166 
     | 
    
         
            +
              else
         
     | 
| 
      
 167 
     | 
    
         
            +
                @timer.run = "NO"
         
     | 
| 
      
 168 
     | 
    
         
            +
                @btn_pause.image = @img_play
         
     | 
| 
      
 169 
     | 
    
         
            +
              end
         
     | 
| 
      
 170 
     | 
    
         
            +
              
         
     | 
| 
      
 171 
     | 
    
         
            +
              return Iup::DEFAULT
         
     | 
| 
      
 172 
     | 
    
         
            +
            end
         
     | 
| 
      
 173 
     | 
    
         
            +
             
     | 
| 
      
 174 
     | 
    
         
            +
            @btn_restart_cb = lambda do |ih|
         
     | 
| 
      
 175 
     | 
    
         
            +
              @progressbar1.value = 0
         
     | 
| 
      
 176 
     | 
    
         
            +
              @progressbar2.value = 0
         
     | 
| 
      
 177 
     | 
    
         
            +
              return Iup::DEFAULT
         
     | 
| 
      
 178 
     | 
    
         
            +
            end
         
     | 
| 
      
 179 
     | 
    
         
            +
             
     | 
| 
      
 180 
     | 
    
         
            +
            @btn_accelerate_cb = lambda do |ih|
         
     | 
| 
      
 181 
     | 
    
         
            +
              @increment *= 2
         
     | 
| 
      
 182 
     | 
    
         
            +
              return Iup::DEFAULT
         
     | 
| 
      
 183 
     | 
    
         
            +
            end
         
     | 
| 
      
 184 
     | 
    
         
            +
             
     | 
| 
      
 185 
     | 
    
         
            +
            @btn_decelerate_cb = lambda do |ih|
         
     | 
| 
      
 186 
     | 
    
         
            +
              @increment /= 2
         
     | 
| 
      
 187 
     | 
    
         
            +
              return Iup::DEFAULT
         
     | 
| 
      
 188 
     | 
    
         
            +
            end
         
     | 
| 
      
 189 
     | 
    
         
            +
             
     | 
| 
      
 190 
     | 
    
         
            +
            @btn_show1_cb = lambda do |ih|
         
     | 
| 
      
 191 
     | 
    
         
            +
              if(@progressbar1.dashed=="NO")
         
     | 
| 
      
 192 
     | 
    
         
            +
                @progressbar1.dashed = "YES"
         
     | 
| 
      
 193 
     | 
    
         
            +
              else
         
     | 
| 
      
 194 
     | 
    
         
            +
                @progressbar1.dashed = "NO"
         
     | 
| 
      
 195 
     | 
    
         
            +
              end
         
     | 
| 
      
 196 
     | 
    
         
            +
              return Iup::DEFAULT
         
     | 
| 
      
 197 
     | 
    
         
            +
            end
         
     | 
| 
      
 198 
     | 
    
         
            +
             
     | 
| 
      
 199 
     | 
    
         
            +
            @btn_show2_cb = lambda do |ih|
         
     | 
| 
      
 200 
     | 
    
         
            +
              if(@progressbar1.marquee=="NO")
         
     | 
| 
      
 201 
     | 
    
         
            +
                @progressbar1.marquee = "YES"
         
     | 
| 
      
 202 
     | 
    
         
            +
              else
         
     | 
| 
      
 203 
     | 
    
         
            +
                @progressbar1.marquee = "NO"
         
     | 
| 
      
 204 
     | 
    
         
            +
              end
         
     | 
| 
      
 205 
     | 
    
         
            +
              return Iup::DEFAULT
         
     | 
| 
      
 206 
     | 
    
         
            +
            end
         
     | 
| 
      
 207 
     | 
    
         
            +
             
     | 
| 
      
 208 
     | 
    
         
            +
             
     | 
| 
      
 209 
     | 
    
         
            +
              @timer = Iup.Timer()
         
     | 
| 
      
 210 
     | 
    
         
            +
              @timer.action_cb = @time_cb
         
     | 
| 
      
 211 
     | 
    
         
            +
              @timer.time = 100
         
     | 
| 
      
 212 
     | 
    
         
            +
              
         
     | 
| 
      
 213 
     | 
    
         
            +
              @progressbar1 = Iup.ProgressBar()
         
     | 
| 
      
 214 
     | 
    
         
            +
              @progressbar2 = Iup.ProgressBar()
         
     | 
| 
      
 215 
     | 
    
         
            +
             
         
     | 
| 
      
 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
         
     | 
| 
      
 225 
     | 
    
         
            +
             
     | 
| 
      
 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")
         
     | 
| 
      
 232 
     | 
    
         
            +
             
     | 
| 
      
 233 
     | 
    
         
            +
              createimg_s()
         
     | 
| 
      
 234 
     | 
    
         
            +
             
     | 
| 
      
 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"
         
     | 
| 
      
 247 
     | 
    
         
            +
             
     | 
| 
      
 248 
     | 
    
         
            +
              @hbox = Iup.Hbox([
         
     | 
| 
      
 249 
     | 
    
         
            +
                       Iup.Fill(), 
         
     | 
| 
      
 250 
     | 
    
         
            +
                       @btn_pause,
         
     | 
| 
      
 251 
     | 
    
         
            +
                       @btn_restart,
         
     | 
| 
      
 252 
     | 
    
         
            +
                       @btn_decelerate,
         
     | 
| 
      
 253 
     | 
    
         
            +
                       @btn_accelerate,
         
     | 
| 
      
 254 
     | 
    
         
            +
                       @btn_show1,
         
     | 
| 
      
 255 
     | 
    
         
            +
                       @btn_show2,
         
     | 
| 
      
 256 
     | 
    
         
            +
                       Iup.Fill()])
         
     | 
| 
      
 257 
     | 
    
         
            +
             
     | 
| 
      
 258 
     | 
    
         
            +
              vbox = Iup.Hbox([Iup.Vbox([@progressbar1, @hbox]), @progressbar2])
         
     | 
| 
      
 259 
     | 
    
         
            +
              vbox.margin = "10x10"
         
     | 
| 
      
 260 
     | 
    
         
            +
              vbox.gap = "5"
         
     | 
| 
      
 261 
     | 
    
         
            +
             
     | 
| 
      
 262 
     | 
    
         
            +
              dlg = Iup.Dialog(vbox)
         
     | 
| 
      
 263 
     | 
    
         
            +
              
         
     | 
| 
      
 264 
     | 
    
         
            +
              dlg.title = "IupProgressBar Test"
         
     | 
| 
      
 265 
     | 
    
         
            +
             
     | 
| 
      
 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
         
     | 
| 
      
 272 
     | 
    
         
            +
              
         
     | 
| 
      
 273 
     | 
    
         
            +
              dlg.ShowXY(Iup::CENTER, Iup::CENTER)
         
     | 
| 
      
 274 
     | 
    
         
            +
             
     | 
| 
      
 275 
     | 
    
         
            +
              @timer.run = "YES"
         
     | 
| 
      
 276 
     | 
    
         
            +
             
     | 
| 
      
 277 
     | 
    
         
            +
              Iup.MainLoop
         
     | 
| 
      
 278 
     | 
    
         
            +
              
         
     | 
| 
      
 279 
     | 
    
         
            +
              dlg.Destroy
         
     | 
| 
      
 280 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,66 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'rubygems'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'iup'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            cdcanvas = nil
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            action = lambda do |ih,  posx,  posy|
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
              iposx = posx.to_i
         
     | 
| 
      
 10 
     | 
    
         
            +
              iposy = posy.to_i
         
     | 
| 
      
 11 
     | 
    
         
            +
              # invert scroll reference (YMAX - DY - POSY) 
         
     | 
| 
      
 12 
     | 
    
         
            +
              iposy = 399 - ih.dy.to_i - iposy
         
     | 
| 
      
 13 
     | 
    
         
            +
              
         
     | 
| 
      
 14 
     | 
    
         
            +
              cdcanvas.CanvasClear()
         
     | 
| 
      
 15 
     | 
    
         
            +
              
         
     | 
| 
      
 16 
     | 
    
         
            +
              cdcanvas.CanvasForeground(Cd::RED)
         
     | 
| 
      
 17 
     | 
    
         
            +
              cdcanvas.CanvasLine(0-iposx, 0-iposy, 599-iposx, 399-iposy)
         
     | 
| 
      
 18 
     | 
    
         
            +
              cdcanvas.CanvasLine(0-iposx, 399-iposy, 599-iposx, 0-iposy)
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
              Iup::DEFAULT
         
     | 
| 
      
 21 
     | 
    
         
            +
            end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            scroll_cb = lambda do |ih,  op,  posx,  posy|
         
     | 
| 
      
 24 
     | 
    
         
            +
              action.call(ih, posx, posy)
         
     | 
| 
      
 25 
     | 
    
         
            +
              Iup::DEFAULT
         
     | 
| 
      
 26 
     | 
    
         
            +
            end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            resize_cb = lambda do |ih,  w,  h|
         
     | 
| 
      
 29 
     | 
    
         
            +
              return Iup::DEFAULT if cdcanvas==nil
         
     | 
| 
      
 30 
     | 
    
         
            +
              # update CD canvas size 
         
     | 
| 
      
 31 
     | 
    
         
            +
              cdcanvas.CanvasActivate()
         
     | 
| 
      
 32 
     | 
    
         
            +
             
         
     | 
| 
      
 33 
     | 
    
         
            +
              # update page size, it is always the client size of the canvas 
         
     | 
| 
      
 34 
     | 
    
         
            +
              ih.dx = w
         
     | 
| 
      
 35 
     | 
    
         
            +
              ih.dy = h
         
     | 
| 
      
 36 
     | 
    
         
            +
              
         
     | 
| 
      
 37 
     | 
    
         
            +
              # refresh scroolbar in IUP 2.x 
         
     | 
| 
      
 38 
     | 
    
         
            +
              ih.posx = ih.posx
         
     | 
| 
      
 39 
     | 
    
         
            +
              ih.posy = ih.posy
         
     | 
| 
      
 40 
     | 
    
         
            +
              return Iup::DEFAULT
         
     | 
| 
      
 41 
     | 
    
         
            +
            end
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
              canvas = Iup.Canvas()
         
     | 
| 
      
 44 
     | 
    
         
            +
              canvas.rastersize = "300x200" # initial size 
         
     | 
| 
      
 45 
     | 
    
         
            +
              canvas.scrollbar = "YES"
         
     | 
| 
      
 46 
     | 
    
         
            +
              canvas.xmax = 599
         
     | 
| 
      
 47 
     | 
    
         
            +
              canvas.ymax = 399
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
              canvas.scroll_cb =  scroll_cb
         
     | 
| 
      
 50 
     | 
    
         
            +
              canvas.resize_cb =  resize_cb
         
     | 
| 
      
 51 
     | 
    
         
            +
              canvas.action =  action
         
     | 
| 
      
 52 
     | 
    
         
            +
                               
         
     | 
| 
      
 53 
     | 
    
         
            +
              dialog = Iup.Dialog(canvas)
         
     | 
| 
      
 54 
     | 
    
         
            +
              dialog.title = "Scrollbar Test"
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
              dialog.Map()
         
     | 
| 
      
 57 
     | 
    
         
            +
              cdcanvas = Cd.CreateCanvas(Cd.CD_IUP, canvas)
         
     | 
| 
      
 58 
     | 
    
         
            +
              canvas.rastersize = nil  # release the minimum limitation 
         
     | 
| 
      
 59 
     | 
    
         
            +
              
         
     | 
| 
      
 60 
     | 
    
         
            +
              dialog.ShowXY(Iup::CENTER,Iup::CENTER)
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
              Iup.MainLoop()
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
              cdcanvas.KillCanvas()
         
     | 
| 
      
 65 
     | 
    
         
            +
              dialog.Destroy()
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,90 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'rubygems'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'iup'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            img = [
         
     | 
| 
      
 5 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 6 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 7 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 8 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,11, 5, 5, 5, 5,12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 9 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,10, 6, 5, 3, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 10 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 5, 1, 1, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 11 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 5, 1, 1, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 12 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 9, 9, 1, 1, 3, 7, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 13 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 1, 1, 1, 1, 2, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 14 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 1, 1, 1, 1, 4, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 15 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 1, 1, 1, 1, 4, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 16 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,11, 2, 7, 5, 4, 4, 4, 4, 4, 4,11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 17 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 7, 4, 4, 4, 6, 3, 3, 7, 5, 5, 7, 7, 4, 4, 4, 4,10,10,10,10,10, 1, 1, 1, 1, 1,
         
     | 
| 
      
 18 
     | 
    
         
            +
                 1, 1, 1, 1, 4, 4, 4, 9, 9, 6, 5, 4, 8, 7, 5, 1, 1, 1, 1, 7, 5, 6, 3, 3, 3, 3, 4,10, 7, 9, 1, 1,
         
     | 
| 
      
 19 
     | 
    
         
            +
                 1, 1, 1, 4, 4, 6, 6, 8, 1, 1, 1, 1, 1,10, 5, 1, 1, 1, 1,10, 6, 1, 1, 1, 1, 1, 3, 3, 7, 7, 7, 1,
         
     | 
| 
      
 20 
     | 
    
         
            +
                 1, 1, 2, 4, 4, 5, 1, 1, 1, 1, 1, 1, 1, 4, 5, 1, 1, 1, 1, 7, 9, 1, 1, 1, 1, 1, 1, 1, 7, 7, 5, 1,
         
     | 
| 
      
 21 
     | 
    
         
            +
                 1, 1, 1, 3, 4, 4, 4, 1, 1, 1, 1, 1, 1, 4, 5, 1, 1, 1, 1, 7, 6, 1, 1, 1, 1, 1, 7, 7, 7, 9, 7, 1,
         
     | 
| 
      
 22 
     | 
    
         
            +
                 1, 1, 1, 1, 3, 3, 3, 4,10,10,10,11, 1, 4, 5, 1, 1, 1, 1, 5, 6,15, 5, 7, 7, 7, 9, 6, 5, 5, 1, 1,
         
     | 
| 
      
 23 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 2, 4, 7, 5, 5, 5, 5, 6, 9,14,14, 6, 5, 5, 5, 7,12, 1, 1, 1, 1,
         
     | 
| 
      
 24 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 3, 3, 2, 2, 2, 4, 4, 2, 2,10,16, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 25 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 1, 1, 1, 1, 6, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 26 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 1, 1, 1, 1, 6, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 27 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 1, 1, 1, 1, 6, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 28 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 7, 9, 1, 1, 4, 9, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 29 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,12, 3, 5, 1, 1, 5, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 30 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 1, 1, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 31 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 5, 4, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 32 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 3, 5, 7, 7,13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 33 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 34 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 35 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         
     | 
| 
      
 36 
     | 
    
         
            +
                 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
            tecgraf = Iup.Image(32,32,img)
         
     | 
| 
      
 42 
     | 
    
         
            +
            tecgraf["1"] = "BGCOLOR" 
         
     | 
| 
      
 43 
     | 
    
         
            +
            tecgraf["2"] = "079 086 099"
         
     | 
| 
      
 44 
     | 
    
         
            +
            tecgraf["3"] = "040 045 053"
         
     | 
| 
      
 45 
     | 
    
         
            +
            tecgraf["4"] = "104 113 129"
         
     | 
| 
      
 46 
     | 
    
         
            +
            tecgraf["5"] = "136 147 170"
         
     | 
| 
      
 47 
     | 
    
         
            +
            tecgraf["6"] = "155 164 179"
         
     | 
| 
      
 48 
     | 
    
         
            +
            tecgraf["7"] = "121 136 167"
         
     | 
| 
      
 49 
     | 
    
         
            +
            tecgraf["8"] = "239 239 243"
         
     | 
| 
      
 50 
     | 
    
         
            +
            tecgraf["9"] = "176 190 214"
         
     | 
| 
      
 51 
     | 
    
         
            +
            tecgraf["10"] = "127 133 143"
         
     | 
| 
      
 52 
     | 
    
         
            +
            tecgraf["11"] = "207 209 214"
         
     | 
| 
      
 53 
     | 
    
         
            +
            tecgraf["12"] = "247 255 255"
         
     | 
| 
      
 54 
     | 
    
         
            +
            tecgraf["13"] = "244 247 249"
         
     | 
| 
      
 55 
     | 
    
         
            +
            tecgraf["14"] = "212 217 225"
         
     | 
| 
      
 56 
     | 
    
         
            +
            tecgraf["15"] = "215 226 241"
         
     | 
| 
      
 57 
     | 
    
         
            +
            tecgraf["16"] = "231 237 245"
         
     | 
| 
      
 58 
     | 
    
         
            +
              
         
     | 
| 
      
 59 
     | 
    
         
            +
            dg = Iup.Dialog(Iup.Label("Tray example"))      
         
     | 
| 
      
 60 
     | 
    
         
            +
            dg.title = "Tray"
         
     | 
| 
      
 61 
     | 
    
         
            +
            dg.tray = "YES"
         
     | 
| 
      
 62 
     | 
    
         
            +
            dg.traytip = "This is a tip at tray"
         
     | 
| 
      
 63 
     | 
    
         
            +
            dg.trayimage = tecgraf
         
     | 
| 
      
 64 
     | 
    
         
            +
            dg.Show()
         
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
      
 66 
     | 
    
         
            +
            action1 = lambda do |ih|
         
     | 
| 
      
 67 
     | 
    
         
            +
              dg.Show()
         
     | 
| 
      
 68 
     | 
    
         
            +
            end
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
            action2 = lambda do |ih|
         
     | 
| 
      
 71 
     | 
    
         
            +
              dg.tray = "NO" 
         
     | 
| 
      
 72 
     | 
    
         
            +
              dg.Hide()
         
     | 
| 
      
 73 
     | 
    
         
            +
              Iup::CLOSE
         
     | 
| 
      
 74 
     | 
    
         
            +
            end
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
            trayclick_cb = lambda do |ih, b, press, dclick|
         
     | 
| 
      
 77 
     | 
    
         
            +
              if b == 1 && press!=0  
         
     | 
| 
      
 78 
     | 
    
         
            +
                item_show = Iup.Item(:title=>"Show",:action=>action1)
         
     | 
| 
      
 79 
     | 
    
         
            +
                item_exit = Iup.Item(:title=>"Exit",:action=>action2)
         
     | 
| 
      
 80 
     | 
    
         
            +
                menu = Iup.Menu([item_show, item_exit])
         
     | 
| 
      
 81 
     | 
    
         
            +
                menu.Popup(Iup::MOUSEPOS, Iup::MOUSEPOS)
         
     | 
| 
      
 82 
     | 
    
         
            +
              end
         
     | 
| 
      
 83 
     | 
    
         
            +
              Iup::DEFAULT
         
     | 
| 
      
 84 
     | 
    
         
            +
            end
         
     | 
| 
      
 85 
     | 
    
         
            +
             
     | 
| 
      
 86 
     | 
    
         
            +
            dg.hidetaskbar = "YES"
         
     | 
| 
      
 87 
     | 
    
         
            +
            dg.trayclick_cb = trayclick_cb
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
            Iup.MainLoop() 
         
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,32 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'rubygems'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'iup'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            	acao_numero = lambda do |ih, c, new_value|
         
     | 
| 
      
 5 
     | 
    
         
            +
            	  valid_character = "0123456789.+-Ee"
         
     | 
| 
      
 6 
     | 
    
         
            +
            	  
         
     | 
| 
      
 7 
     | 
    
         
            +
            	  if(c == Iup::K_CR)  # replaces TAB for ENTER */
         
     | 
| 
      
 8 
     | 
    
         
            +
            	    return Iup::K_TAB
         
     | 
| 
      
 9 
     | 
    
         
            +
            	  elsif(c<256 && valid_character[c.chr])  # c is a valid character */
         
     | 
| 
      
 10 
     | 
    
         
            +
            	    return Iup::DEFAULT
         
     | 
| 
      
 11 
     | 
    
         
            +
            	  elsif(c<20 || c>=256)  # c is a control character(TAB, BACKSPACE, ...) */
         
     | 
| 
      
 12 
     | 
    
         
            +
            	    return Iup::DEFAULT
         
     | 
| 
      
 13 
     | 
    
         
            +
            	  end
         
     | 
| 
      
 14 
     | 
    
         
            +
            	  return Iup::IGNORE
         
     | 
| 
      
 15 
     | 
    
         
            +
            	end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              campo = Iup.Text("acao_numero")                           # creates TEXT field */
         
     | 
| 
      
 18 
     | 
    
         
            +
              campo.action = acao_numero 				    # registers callback */
         
     | 
| 
      
 19 
     | 
    
         
            +
              campo.value = 1.0                                         # defines initial value */
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              mensagem = Iup.Label("Entre a Number: ") # creates message */
         
     | 
| 
      
 22 
     | 
    
         
            +
              prompt = Iup.Hbox([mensagem, campo])  # creates prompt */
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              dlg = Iup.Dialog(prompt)
         
     | 
| 
      
 25 
     | 
    
         
            +
              dlg.Show()                   # displays and creates dialog */
         
     | 
| 
      
 26 
     | 
    
         
            +
              Iup.MainLoop()               # interacts with user */
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
              puts("Integer Number: %d" % campo.GetInt("VALUE"))   # prints the integer number entered by the user */
         
     | 
| 
      
 29 
     | 
    
         
            +
              puts("Real Number: %g" % campo.GetFloat("VALUE"))    # prints the real number entered by the user */
         
     | 
| 
      
 30 
     | 
    
         
            +
              puts("Text: %s" % campo.value)  		       # prints the text entered by the user */
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
              dlg.Destroy()
         
     |