home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / IDE / SOURCE / ICONS.PRG < prev    next >
Text File  |  1994-06-11  |  2KB  |  58 lines

  1. #include "FiveWin.ch"
  2.  
  3. //----------------------------------------------------------------------------//
  4.  
  5. function IconOpen( cFileName )
  6.  
  7.    local oWnd, oIco, oBar
  8.  
  9.    DEFAULT cFileName := cGetFile( "Executable EXE (*.exe) | *.exe |" + ;
  10.                                   "Dynamic Library DLL (*.dll) | *.dll |" + ;
  11.                                   "Driver (*.drv) | *.drv |" + ;
  12.                                   "Any file (*.exe) | *.exe", "Select any file" )
  13.  
  14.    if ! File( cFileName )
  15.       MsgAlert( "I don't find that file!" )
  16.       return nil
  17.    endif
  18.  
  19.    DEFINE ICON oIco RESOURCE "Icons"
  20.  
  21.    DEFINE WINDOW oWnd FROM 1, 1 TO 23, 33 TITLE "Icons:" MDICHILD ;
  22.       VSCROLL ICON oIco COLOR "N/W"
  23.  
  24.    DEFINE BUTTONBAR oBar OF oWnd
  25.  
  26.    DEFINE BUTTON RESOURCE "Report" OF oBar ;
  27.       ACTION oWnd:HardCopy( 4 ) ;
  28.       MESSAGE "Generates a printout of this icons"
  29.  
  30.    ACTIVATE WINDOW oWnd ;
  31.       ON PAINT SayIcons( oWnd, cFileName )
  32.  
  33. return nil
  34.  
  35. //----------------------------------------------------------------------------//
  36.  
  37. static function SayIcons( oWnd, cFileName )
  38.  
  39.    local nIcons  := nIcons( cFileName )
  40.    local n := 0, nRow := 30, nCol := 10
  41.    local nWidth
  42.  
  43.    oWnd:CoorsUpdate()
  44.    nWidth = oWnd:nRight - oWnd:nLeft + 1
  45.  
  46.    while n < nIcons
  47.       DrawIcon( oWnd:hDC, nRow, nCol, ExtractIcon( cFileName, n++ ) )
  48.       nCol += 45
  49.       if nCol + 50 >= nWidth
  50.          nCol = 10
  51.          nRow += 50
  52.       endif
  53.    end
  54.  
  55. return nil
  56.  
  57. //----------------------------------------------------------------------------//
  58.