Guidance
指路人
g.yi.org
software / RapidQ / RQ Doc / html / qfilelistbox.html

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

  
Appendix A: QFILELISTBOX
Rapid-Q Documentation by William Yu (c)1999-2000 Appendix A: QFILELISTBOX


QFILELISTBOX Component

Use QFileListBox when you want to maintain a listbox with all the files in a specific directory. It can also list directories as well.

QFileListBox Properties
FieldTypeR/WDefault




AlignINTEGERRWalNone
Align determines how the control aligns within its parent control.
ColorINTEGERRW
CursorINTEGERRWcrDefault
DirectorySTRINGRW
Directory is the directory that contains all the files listed in the file listbox.
DriveSTRINGRW
EnabledINTEGERRWTrue
ExtendedSelectINTEGERRWTrue
ExtendedSelect determines if the user can select a sequential range of items in the file listbox.
FilenameSTRINGRW
FileName is the name of the selected file in the listbox, including the pathname.
FontQFONTW
HeightINTEGERRW
HintSTRINGRW
ItemARRAY of STRINGRW
ItemCountINTEGERR
ItemHeightINTEGERRW
ItemIndexINTEGERRW
ItemIndex specifies the index of the selected item in the file listbox. If no item is selected, ItemIndex equals -1.
LeftINTEGERRW0
MaskSTRINGRW*.*
MultiSelectINTEGERRWFalse
ParentQFORM/QPANEL/QTABCONTROLW
PopupMenuQPOPUPMENUW
SelCountINTEGERR
SelectedARRAY of INTEGERRW
ShowHintINTEGERRWFalse
ShowIconsINTEGERRWFalse
ShowIcons determines whether images should appear next to the file names.
TabOrderINTEGERRW
TagINTEGERRW
TopIndexINTEGERRW
TopIndex specifies the index number of the item that appears at the top of the file listbox.
TopINTEGERRW0
WidthINTEGERRW
VisibleINTEGERRWTrue


QFileListBox Methods
MethodTypeDescriptionParams




AddFileTypesSUBIAdd certain file types to list boxINTEGER, Infinite
FileTypes determine which files are displayed in the file listbox according to their attributes.
0 = ftReadOnly -- Display files with read-only attribute.
1 = ftHidden -- Display files with hidden attribute.
2 = ftSystem -- Displays system files.
3 = ftVolumeID -- Displays volume name.
4 = ftDirectory -- Displays directories.
5 = ftArchive -- Display files with archive attribute.
6 = ftNormal -- Display files with no special attributes.
Example:
$INCLUDE "RAPIDQ.INC"
DIM FileListBox AS QFILELISTBOX
FileListBox.AddFileTypes(ftDirectory, ftHidden)
DelFileTypesSUBIRemove certain file types from listINTEGER, Infinite
UpdateSUBUpdates/refreshes file list0

QFileListBox Events
EventTypeOccurs when...Params




OnChangeVOIDDirectory changes0
OnClickVOIDFile was clicked on0
OnDblClickVOIDSelection was double clicked on0


QFileListBox Examples
'' Simple Application Launcher
'' How to use the File List Box as a Directory List Box in Rapid-Q by William Yu

$INCLUDE "RAPIDQ.INC"

DECLARE SUB ChangeDirectories
DECLARE SUB ExecuteApplication
DECLARE SUB ResizeForm

CREATE Form AS QForm
  Height = 300
  Width = 450
  CREATE DirList AS QFileListBox     '' Can double as a Directory list box
   ShowIcons = True
   Mask = "*.*"
   AddFileTypes(ftDirectory)          '' Add Directories
   DelFileTypes(ftNormal)             '' Remove files (see RAPIDQ.INC for values)
   OnDblClick = ChangeDirectories
   Height = Form.ClientHeight
   Width = 200
  END CREATE
  CREATE EXEList AS QFileListBox
   ShowIcons = True
   Mask = "*.EXE"
   OnDblClick = ExecuteApplication
   Left = 215
   Height = Form.ClientHeight
   Width = 225
  END CREATE
  Center
  Caption = DirList.Directory
  OnResize = ResizeForm
  ShowModal
END CREATE


SUB ChangeDirectories
  ChDir(DirList.Item(DirList.ItemIndex) - "[" - "]")
  DirList.Directory = CurDir$:  EXEList.Directory = CurDir$
  Form.Caption = CurDir$
END SUB

SUB ExecuteApplication
  RUN EXEList.FileName    ' Non-Blocking
'  SHELL EXEList.FileName  ' Blocks, until program terminates
                           ' Becareful running 16-bit applications
END SUB

SUB ResizeForm
  DirList.Height = Form.ClientHeight
  EXEList.Height = Form.ClientHeight
  EXEList.Width = Form.ClientWidth - 215
END SUB

Prev Component Contents Next Component
掌柜推荐
 
 
¥738.00 ·
 
 
¥1,480.00 ·
 
 
¥397.00 ·
 
 
¥950.00 ·
 
 
¥264.00 ·
 
 
¥1,005.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2015-12-25 19:42:35