#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   DEFINE WINDOW oWnd FROM 1, 1 TO 29, 63 TITLE "Our loved Spain"

   SET MESSAGE OF oWnd TO "FiveWin 1.0 - Dynamic Bitmaps Loading"

   ACTIVATE WINDOW oWnd ;
      ON INIT  AddSomeButtons() ;
      ON PAINT Draw( oWnd, "Spain.bmp" )

return

//----------------------------------------------------------------------------//

function AddSomeButtons()

   USE Buttons

   while ! EoF()
      @ nRow, nCol BUTTON AllTrim( cButton ) OF oWnd SIZE nWidth, nHeight ;
         ACTION MsgInfo( "FiveWin 1.0" )

      SKIP
   end

   USE

return

//----------------------------------------------------------------------------//

function Draw( oWnd, cBitmap )

   local hBitmap

   oWnd:GetDC()

   hBitmap = ReadBitmap( oWnd:hDC, cBitmap )
   DrawBitmap( oWnd:hDC, hBitmap, 0, 0 )

   oWnd:ReleaseDC()

   DeleteObject( hBitmap )

return

//----------------------------------------------------------------------------//
