File: u_explorer_folders.sru
Size: 2676
Date: Mon, 07 Apr 2008 21:32:46 +0200
$PBExportHeader$u_explorer_folders.sru
$PBExportComments$Explorer Folders
forward
global type u_explorer_folders from u_explorer
end type
type st_label from u_st within u_explorer_folders
end type
type lv_1 from u_lv within u_explorer_folders
end type
end forward

global type u_explorer_folders from u_explorer
boolean #staticclass = true
st_label st_label
lv_1 lv_1
end type
global u_explorer_folders u_explorer_folders

on u_explorer_folders.create
int iCurrent
call super::create
this.st_label=create st_label
this.lv_1=create lv_1
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.st_label
this.Control[iCurrent+2]=this.lv_1
end on

on u_explorer_folders.destroy
call super::destroy
destroy(this.st_label)
destroy(this.lv_1)
end on

event ke_explorer_activate;call super::ke_explorer_activate;treeview ltv
treeviewitem ltvi
listviewitem llvi
long ll_current, ll_child

ltv = inv_explorer.of_GetExplorerTreeview()
//clear items
lv_1.DeleteItems()

ll_current = ltv.FindItem(CurrentTreeItem!, 0)
//populate the listview with the treeviewitems
ll_child = ltv.FindItem(ChildTreeItem!, ll_current)
DO WHILE ll_child > 0
   ltv.GetItem(ll_child, ltvi)
   llvi.PictureIndex = ltvi.PictureIndex
   llvi.Label = ltvi.Label
   llvi.Data = ltvi.Itemhandle
   lv_1.AddItem(llvi)
   //next
   ll_child = ltv.FindItem(NextTreeItem!, ll_child)
LOOP

st_label.BringToTop = lv_1.TotalItems() <= 0

lv_1.SetFocus()
end event

event ke_canclose;call super::ke_canclose;RETURN FALSE
end event

event ke_getstatustext;call super::ke_getstatustext;RETURN STRING(lv_1.TotalItems()) + " Item(s)"
end event

event ke_postopen;call super::ke_postopen;//listview
lv_1.AddColumn("Modules", Left!, lv_1.Width - 48)
st_label.BringToTop = FALSE
end event

type st_label from u_st within u_explorer_folders
integer y = 416
integer width = 1696
long backcolor = 1073741824
string text = "No Items"
alignment alignment = center!
boolean #anchorleft = true
boolean #anchorright = true
end type

type lv_1 from u_lv within u_explorer_folders
integer x = 55
integer y = 64
integer taborder = 10
boolean border = false
boolean extendedselect = false
listviewview view = listviewlargeicon!
boolean #standardimages = true
boolean #dock = true
long #docktype = 5
end type

event itemactivate;call super::itemactivate;IF index < 0 THEN RETURN

//fire explorer
treeview ltv
listviewitem llvi

ltv = inv_explorer.of_getexplorertreeview()
this.GetItem(index, llvi)
ltv.SelectItem(LONG(llvi.Data))
end event

event key;call super::key;IF key = KeyBack! THEN
   inv_explorer.of_UpOneFolder()
END IF
end event