Documentation component by D.Glodt (c)2003

Appendix A: QFileListView


QFileListView Component

QFileListView is a component inherited from component QListView.
This component has columns for name , size, file type and date with
associated icon for each file type.

QFileListView Properties

Field

Type

R/W

Default






Filename

STRING

R

File name selected.

ColumnCaption

ARRAY(4) OF STRING

R/W

Column label
index 1=label file name
index 2=label size
index 3=label type
index 4=label date 

Directory

STRING

R/W




Directory name.

Mask

STRING

R/W

*.*

File type to view.

QFileListView Methods

Method

Type

Description

Params






Refresh

SUB

Refresh file list

0

SetFocus

SUB

Set focus on file list

0

QFileListView Event

Event

Type

Occurs when...

Params






OnFileSelect

(FileName as string)

On enter keypress or double click, parameter FileName
is the file name selected.

1

OnFileChange

(FileName as string)

On selected change in the list, parameter FileName
is the file name selected.

1

QFileListView Example
$TYPECHECK ON
$INCLUDE "RAPIDQ.INC"
$INCLUDE "Object\QFileListView.inc"

declare sub DirListFileSelect(file as string)
declare
sub ChangeDirectory

CREATE Form AS QFORM
    Width=500
    Height=300
    Center
    Caption="Exploreur"
    CREATE Splitter1 AS QSPLITTER
      Align=alLeft
      width=5
    END CREATE
    CREATE DirTree AS QDirTree
      InitialDir=CURDIR$
      Align=alLeft
      Width=200
      OnChange=ChangeDirectory
    END CREATE
    create DirList as QFileListView
      Align=alClient
      width=200
      ViewStyle=vsReport
      OnFileSelect= DirListFileSelect
      ColumnCaption(1)="Name" 'Label column
      ColumnCaption(2)="Size"
      ColumnCaption(3)="Type"
      ColumnCaption(4)="Modified"
      Mask="*.*"
    end create
end
create

Form.ShowModal

sub DirListFileSelect(file as string)  
  ShowMessage("File"+File+" was selected.")
end
sub

SUB
ChangeDirectory
  DirList.Directory =DirTree.Directory
END SUB

Hosted by uCoz