G4C

; Shows the simple use of Attributes with the ATTR and SETATTR
; commands.
; ---------------------------------------------------------------

WINBIG 97 38 278 162 FileFilter.gc
WinType 11110001

xOnLoad
	GuiOpen #This

xOnClose
	GuiQuit #This

; ---------------------------------------------------------------
; The Listview
; ---------------------------------------------------------------

XLISTVIEW 0 14 276 147 "" filename "" 0 DIR
	gadid 1
	gadfont #mono 8 000          ; dir lvs look better lined up..

	Attr LVFilter   ~(#?.info)   ; set default filter - no icons
   Attr LVStyle    2031         ; set a flashy letter style 
   Attr LVLineDist 3            ; increase the distance between lines

; ---------------------------------------------------------------
; Buttons to control the above Listview
; ---------------------------------------------------------------

XBUTTON 170 0 53 14 "Par"
	lvuse #this 1
	lvdir parent

XBUTTON 224 0 53 14 "Vol"
	lvuse #this 1
	lvdir Disks

; ---------------------------------------------------------------
; Cycler which will set/reset the file filter
; ---------------------------------------------------------------

XCYCLER 0 0 169 14 "" mode
	CSTR "No .info"      ~(#?.info)    ; no icons
   CSTR "Only JPG/GIF"  #?.(jpg|gif)  ; jpg or gif files only
   CSTR "Only Guis"     #?.gc         ; gui files only
	CSTR "All files"     ""            ; show all files
	
	SetAttr #this/1 LVFILTER $mode     ; set the mode in above LV
	lvuse #this 1                      ; and refresh it, so that
	lvdir refresh                      ; the change takes place

