I have a nice simple program, that has an ExplorerList and ExplorerTree gadget and also a ListView gadget. I fleshed out the UI using PureVision on the PC and ported the code across. The code for the UI is as follows.
pipl_constants.pb
Code: Select all
Global BubbleTipStyle.l:BubbleTipStyle=0
;-Window Constants
Enumeration 1
#Window_Form1
EndEnumeration
#WindowIndex=#PB_Compiler_EnumerationValue
;-Gadget Constants
Enumeration 1
;Window_Form1
#Gadget_Form1_lstDirectory
#Gadget_Form1_lstFiles
#Gadget_Form1_lstPlaylist
#Gadget_Form1_Container5
#Gadget_Form1_Area6
EndEnumeration
#GadgetIndex=#PB_Compiler_EnumerationValue
pipl_windows.pb
Code: Select all
XIncludeFile "pipl_Constants.pb"
Procedure.l Window_Form1()
If OpenWindow(#Window_Form1,154,236,611,449,#PB_Window_SystemMenu|#PB_Window_TitleBar|#PB_Window_ScreenCentered|#PB_Window_Invisible,"Work Form1")
If CreateGadgetList(WindowID(#Window_Form1))
ExplorerTreeGadget(#Gadget_Form1_lstDirectory,10,5,200,385,"/",#PB_Explorer_NoFiles)
ExplorerListGadget(#Gadget_Form1_lstFiles,220,5,385,185,"/",#PB_Explorer_NoFolders|#PB_Explorer_NoParentFolder|#PB_Explorer_NoMyDocuments)
ListViewGadget(#Gadget_Form1_lstPlaylist,220,200,385,190)
ContainerGadget(#Gadget_Form1_Container5,10,400,595,30)
CloseGadgetList()
HideWindow(#Window_Form1,0)
ProcedureReturn WindowID()
EndIf
EndIf
EndProcedure
pipl.pb
Code: Select all
XIncludeFile "pipl_Constants.pb"
XIncludeFile "pipl_Windows.pb"
;Procedure WindowCallback(WindowID,Message,wParam,lParam)
; ReturnValue=#PB_ProcessPureBasicEvents
;
; ProcedureReturn ReturnValue
;EndProcedure
;-Main Loop
If Window_Form1()
;SetWindowCallback(@WindowCallback())
quitForm1=0
Repeat
EventID=WaitWindowEvent()
Select EventID
Case #PB_Event_CloseWindow
If EventWindowID()=#Window_Form1
quitForm1=1
EndIf
Case #PB_Event_Gadget
Select EventGadgetID()
Case #Gadget_Form1_lstDirectory
Result.s=GetGadgetText(#Gadget_Form1_lstDirectory)
Debug result
SetGadgetText(#Gadget_Form1_lstFiles,result)
Case #Gadget_Form1_lstFiles
Case #Gadget_Form1_lstPlaylist
Select EventType()
Case #PB_EventType_LeftDoubleClick
Default
EndSelect
Case #Gadget_Form1_Area6
EndSelect
EndSelect
Until quitForm1
CloseWindow(#Window_Form1)
EndIf
End
Anyway back to my example, which works fine under windows. The basic functionality navigates directories using the ExplorerTree and depending on which directory I select, the files in that directory appear in the ExplorerList.
If I select /Volumes as the starting folder, I can click on the /DATADRIVE which is my removable drive, but I cannot open the drive. If I select the starting directory as / then I can navigate to Volumes and then DATADRIVE, but all the files appear in the ExplorerTree and not the ExplorerList, even though I've selected not to display files in the ExplorerTree.
Also I've commented out the WindowCallBack procedure as it complained about an undefined Constant, is this required under the Mac?
Anyway pardon my lame questions, but we all have to start somewhere. As I said before the basic functionality works fine under Windows.
Many thanks
Colin