home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SAMPLES / O2.PRG < prev    next >
Text File  |  1994-06-02  |  2KB  |  76 lines

  1.  
  2. #include "FiveWin.ch"
  3.  
  4. //----------------------------------------------------------------------------//
  5.  
  6. function O2()
  7.  
  8.    local oDlg, oBmp1, oBmp2, oBmp3
  9.  
  10.    DEFINE DIALOG oDlg FROM 1, 1 TO 10, 44 TITLE "PROBANDO EL CONTADOR"
  11.  
  12.    // @  1, 3 SAY "Contador :" OF oDlg SIZE 120, 25
  13.  
  14.    @  0, 0 BITMAP oBmp1 FILE "..\bitmaps\o2.bmp" OF oDlg
  15.    @  0, 0 BITMAP oBmp2 FILE "..\bitmaps\o2.bmp" OF oDlg
  16.    @  0, 0 BITMAP oBmp3 FILE "..\bitmaps\o2.bmp" OF oDlg
  17.  
  18.    oBmp1:nTop    := 28
  19.    oBmp1:nLeft   := 80
  20.    oBmp1:nBottom := 34
  21.    oBmp1:nRight  := 84
  22.  
  23.    oBmp2:nTop    := 28
  24.    oBmp2:nLeft   := 85
  25.    oBmp2:nBottom := 34
  26.    oBmp2:nRight  := 89
  27.  
  28.    oBmp3:nTop    := 28
  29.    oBmp3:nLeft   := 90
  30.    oBmp3:nBottom := 34
  31.    oBmp3:nRight  := 94
  32.  
  33.    @ 4, 02 BUTTON "&Aumenta"   OF oDlg SIZE 40, 12 ;
  34.       ACTION Cambia( oBmp1, oBmp2, oBmp3, .T. )
  35.  
  36.    @ 4, 10 BUTTON "&Disminuye" OF oDlg SIZE 40, 12 ;
  37.       ACTION Cambia( oBmp1, oBmp2, oBmp3, .F. )
  38.  
  39.    ACTIVATE DIALOG oDlg CENTERED
  40.  
  41. return
  42.  
  43. //----------------------------------------------------------------------------//
  44. function Cambia( oBmp1, oBmp2, oBmp3, lSigno )
  45. STATIC nCont := 0
  46. LOCAL n, cCOnt
  47.  
  48. if ! lSigno .and. nCont == 0
  49.  
  50.    return
  51.  
  52. endif
  53.  
  54. nCont := iif( nCont > 999, 0, nCont )
  55.  
  56. if lSigno
  57.  
  58.    nCont ++
  59.  
  60. else
  61.  
  62.    nCont --
  63.  
  64. endif
  65.  
  66. oBmp3:nX := val( right( str( nCont, 3 ), 1 ) ) * -11
  67. oBmp2:nX := val( substr( str( nCont, 3 ), 2, 1 ) ) * -11
  68. oBmp1:nX := val( left( str( nCont, 3 ), 1 ) ) * -11
  69.  
  70. oBmp3:Refresh( .F. )
  71. oBmp2:Refresh( .F. )
  72. oBmp1:Refresh( .F. )
  73.  
  74. return
  75. //---------------------------------------------------------------------------//
  76.