ExplorerComboGadget()
Syntax
Result = ExplorerComboGadget(#Gadget, x, y, Width, Height, Directory$, [, Flags])Description
Creates a ComboBox that lets you display a path and all its parent folders, so the user can choose one of them. If #PB_Any is used as '#Gadget' parameter, the new gadget number will be returned as 'Result'. You can find such a ComboBox, for example, in the OpenFileRequester(). This can be a nice addition to the ExplorerListGadget().
Directory$ is the initial displayed directory (must be set as full path), an empty string specifies the root folder. If the #PB_Explorer_DrivesOnly flag is set, Directory$ may only be a drive letter. Everything that follows the drive letter in this case will be ignored.
'Flags' can be a combination of the following values:#PB_Explorer_DrivesOnly : The gadget will only display drives to choose from. #PB_Explorer_Editable : The gadget will be editable with an autocomplete feature. With this flag set, it acts exactly like the one in Windows Explorer. #PB_Explorer_NoMyDocuments: The 'My Documents' Folder will not be displayed as a separate item.The following functions can be used to control the gadget:
- GetGadgetText(): Get the currently displayed directory. Use this to ckeck what the user has selected after you get an event for this Gadget.
- SetGadgetText(): Changes the currently displayed directory.
Example:If OpenWindow(0, 0, 0, 400, 100, "ExplorerListGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0)) ExplorerComboGadget(0, 10, 40, 380, 200, "C:\", #PB_Explorer_Editable) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf
Supported OS
All