# Include "FiveWin.ch"
FUNCTION Main()
ExploDsk()
RETURN Nil
FUNCTION ExploDsk()
LOCAL oLogo,oCur,oSel,oIco,oDlg,oBtn1,oBtn2,oTree,oFont1,oFont2,oImageList
DEFINE FONT oFont1 NAME "TAHOMA" BOLD SIZE 00, 16
DEFINE FONT oFont2 NAME "TAHOMA" SIZE 00, 16
DEFINE CURSOR oCur RESOURCE "FLECHA"
DEFINE CURSOR oSel RESOURCE "MANO"
DEFINE ICON oIco RESOURCE "00"
DEFINE DIALOG oDlg RESOURCE "LISTADO" TITLE "Listado de Discos" ICON oIco
oImageList := TImageList():New(24,24)
oImageList:Add(TBitmap():DEFINE("VIR1",,oDlg), TBitmap():DEFINE("VIR2",,oDlg))
oImageList:Add(TBitmap():DEFINE("FLO1",,oDlg), TBitmap():DEFINE("FLO2",,oDlg))
oImageList:Add(TBitmap():DEFINE("PAR1",,oDlg), TBitmap():DEFINE("PAR2",,oDlg))
oImageList:Add(TBitmap():DEFINE("HDD1",,oDlg), TBitmap():DEFINE("HDD2",,oDlg))
oImageList:Add(TBitmap():DEFINE("INT1",,oDlg), TBitmap():DEFINE("INT2",,oDlg))
oImageList:Add(TBitmap():DEFINE("DVD1",,oDlg), TBitmap():DEFINE("DVD2",,oDlg))
oImageList:Add(TBitmap():DEFINE("RAM1",,oDlg), TBitmap():DEFINE("RAM2",,oDlg))
oImageList:Add(TBitmap():DEFINE("NET1",,oDlg), TBitmap():DEFINE("NET2",,oDlg))
oImageList:Add(TBitmap():DEFINE("USB1",,oDlg), TBitmap():DEFINE("USB2",,oDlg))
oTree:= TTreeView():REDEFINE(100, oDlg, 0, , .F. ,"" )
oTree:oFont:= oFont1
oTree:OnClick:= {| nRow, nCol | oTree:Refresh() }
oTree:bChanged:= {| oTree, oItem| oItem:= oTree:GetSelected(), ;
MsgInfo( oItem:cargo ) }
oDlg:lHelpIcon:= .F.
ACTIVATE DIALOG oDlg CENTERED ON INIT(Self, Carga(oTree,oImageList,oFont2))
RETURN Nil
STATIC FUNCTION Carga(oTree,oImageList,oFont2)
LOCAL oRaiz, oNivel1, oItem, item
LOCAL aData:= {{"Unidades Virtuales", 0, 0, Nil},;
{"Disco 3 1.44 Mb", 1, 1, Nil},;
{"Volumen 15151441", 2, 2, "uno"},;
{"Volumen 84515158", 2, 2, "dos"},;
{"Volumen 77722582", 2, 2, "tres"},;
{"Volumen 15151441", 2, 2, "cuatro"},;
{"Volumen 84515158", 2, 2, "cinco"},;
{"Volumen 77722582", 2, 2, "seis"},;
{"Discos Duros", 1, 3, Nil},;
{"Volumen 1", 2, 4, Nil},;
{"Particion 1", 3, 2, "siete"},;
{"Particion 2", 3, 2, "ocho"},;
{"Particion 3", 3, 2, "nueve"},;
{"Volumen 2", 2, 4, Nil},;
{"Particion 1", 3, 2, "diez"},;
{"Particion 2", 3, 2, "once"},;
{"Disco CD-DVD RAM", 1, 5, Nil},;
{"Volumen 15151441", 2, 2, "doce"},;
{"Volumen 45481278", 2, 2, "trece"},;
{"Volumen 89612255", 2, 2, "catorce"},;
{"Unidades Virtuales RAM",1, 6, Nil},;
{"Volumen 15151441", 2, 2, "quince"},;
{"Volumen 45481278 Haber si funciona el Scroll", 2, 2, "diesiseis"},;
{"Volumen 89612255", 2, 2, "diesisiete"},;
{"Unidades de Red", 1, 7, Nil},;
{"Volumen 45481278", 2, 2, "diesiocho"},;
{"Discos USB", 1, 8, Nil},;
{"Volumen 1", 2, 2, "diesinueve"},;
{"Volumen 2", 2, 2, "veinte"}}
FOR Each Item In aData
do case
case Item[ 2 ] == 0
oRaiz = oTree:Add( Item[ 1 ], Item[ 3 ] )
case Item[ 2 ] == 1
oNivel1 = oRaiz:Add( Item[ 1 ], Item[ 3 ] )
otherwise
oItem = oNivel1:Add( Item[ 1 ], Item[ 3 ] )
oItem:Cargo = Item[ 4 ]
endcase
next
oTree:SetImageList(oImageList)
oTree:Expand()
oTree:GoTop()
RETURN Nil
STATIC FUNCTION LeeSerie(cSerie)
MSGInfo(cSerie)
RETURN Nil