Sub btn_folders_Click
Utilities.LogM(0,"open folders dialog")
Dim nd As CustomDialog
Dim ret As Int
Dim p As Panel
Dim l As List : l = DBHandler.getFolders
' build table
p.Initialize("")
tbl_folders.Initialize(Me,"cb",1)
tbl_folders.AddToActivity(p,0,10,100%x,100%y-50)
tbl_folders.SetHeader(Array As String("Folders"))
For i = 0 To l.Size -1
tbl_folders.AddRow(Array As String(l.Get(i)))
Next
addFile
nd.AddView(p,0,0,100%x,100%y)
ret = DialogResponse.CANCEL
ret = nd.Show("You have " & l.Size & " Folders", "Ok", "", "", Null)
End Sub
Sub cb_CellClick (Col As Int, Row As Int)
Utilities.LogM(0,"Folders CellClick: " & Col & " , " & Row)
Utilities.LogM(0,"cell value:" & tbl_folders.GetValue(Col, Row))
End Sub
Sub cb_HeaderClick (Col As Int)
Utilities.LogM(0,"HeaderClick: " & Col)
addFile
End Sub
Sub addFile
Utilities.LogM(0,"AddFile: ")
Dim nd As ClsExplorer
nd.Initialize(Activity, File.DirRootExternal,"",True,True,"Ok")
nd.DialogRect.Left = 5dip
nd.DialogRect.Right = 100%x - 5dip
nd.DialogRect.Top = 25dip
nd.DialogRect.Bottom = 100%y-25dip
nd.BackgroundColor = Colors.LightGray
nd.BorderColor = Colors.RGB(128, 128, 128)
nd.FolderTextColor = Colors.Black
nd.FileTextColor1 = Colors.Blue
nd.FileTextColor2 = Colors.White
nd.DividerColor = Colors.Gray
nd.Explorer2(False)
If Not(nd.Selection.Canceled OR nd.Selection.ChosenPath = "") Then
Utilities.LogM(0,"User press ok:" & nd.Selection.ChosenPath)
tbl_folders.AddRow(Array As String(nd.Selection.ChosenPath))
Else
Utilities.LogM(0,"User press cancel")
End If
End Sub