Guidance
指路人
g.yi.org
software / rapidq / Examples / File & Directory / QDirListView / DirListView.rqb

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
' An form, that displais contents of folders and
' has special icons for image-files.

     $INCLUDE "rapidq.inc"  'Important!

     $INCLUDE "QDirListView.inc"

' Custom iconResources for ImageFiles
     $RESOURCE ICO_JPEG_SMALL AS "jpeg_small.ico"
     $RESOURCE ICO_JPEG_LARGE AS "jpeg_large.ico"
     $RESOURCE ICO_GIF_SMALL AS "gif_small.ico"
     $RESOURCE ICO_GIF_LARGE AS "gif_large.ico"
     $RESOURCE ICO_BMP_SMALL AS "bmp_small.ico"
     $RESOURCE ICO_BMP_LARGE AS "bmp_large.ico"


     DECLARE SUB DirListChange
     DECLARE SUB DirListFileSelect(Tag AS INTEGER)

     CREATE Form AS QFORM
      Width = 500
      Height = 300
      Center
      CREATE DirList AS QDirListView
       Align = alClient
       ShowRoot = True
       ViewStyle = vsList
       OnChange = DirListChange
       OnFileSelect = DirListFileSelect

      'in lowercase please!
       ExtensionsList.AddItems ("jpg", "jpe", "jpeg", "gif", "bmp")

       SmallImageList.AddIcoHandle(ICO_JPEG_SMALL)
       LargeImageList.AddIcoHandle(ICO_JPEG_LARGE)
       SmallImageList.AddIcoHandle(ICO_JPEG_SMALL)
       LargeImageList.AddIcoHandle(ICO_JPEG_LARGE)
       SmallImageList.AddIcoHandle(ICO_JPEG_SMALL)
       LargeImageList.AddIcoHandle(ICO_JPEG_LARGE)
       SmallImageList.AddIcoHandle(ICO_GIF_SMALL)
       LargeImageList.AddIcoHandle(ICO_GIF_LARGE)
       SmallImageList.AddIcoHandle(ICO_BMP_SMALL)
       LargeImageList.AddIcoHandle(ICO_BMP_LARGE)
      END CREATE
     END CREATE

     Form.SHOWMODAL

'------------------------------------------------------
     SUB DirListChange
      DirList.InheritOnChange 'Important!
      Form.CAPTION = DirList.Directory
     END SUB

     SUB DirListFileSelect(Tag AS INTEGER) 'It Just needs one empty parameter to work
      SHOWMESSAGE("File '" + DirList.FileName + "' was selected.")
     END SUB

掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2023-2-1  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2003-04-13 19:27:02