Platforms to show: All Mac Windows Linux Cross-Platform
WinFileDialogMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Navigation | MBS WinFrameworks Plugin | 20.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
All methods may raise WinFileDialogExceptionMBS in case of errors.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.
- 11 events
- event ButtonClicked(ControlID as Integer)
- event CheckButtonToggled(ControlID as Integer, Checked as Boolean)
- event ControlActivating(ControlID as Integer)
- event FileOk as Boolean
- event FileTypeChanged
- event FolderChanged
- event FolderChanging(Folder as WinShellItemMBS) as boolean
- event ItemSelected(ControlID as Integer, ItemID as Integer)
- event Overwrite(item as WinShellItemMBS) as Integer
- event SelectionChange
- event ShareViolation(item as WinShellItemMBS) as Integer
- 45 properties
- property ClientGuid as String
- property CurrentSelection as WinShellItemMBS
- property DefaultExtension as String
- property DefaultFolder as WinShellItemMBS
- property FileName as String
- property FileNameLabel as String
- property FileTypeIndex as Integer
- property Folder as WinShellItemMBS
- property Handle as Integer
- property OkButtonLabel as String
- property OptionAllNonStorageItems as Boolean
- property OptionAllowMultiSelect as Boolean
- property OptionCreatePrompt as Boolean
- property OptionDefaultNoMiniMode as Boolean
- property OptionDontAaddToRecent as Boolean
- property OptionFileMustExist as Boolean
- property OptionForceFileSystem as Boolean
- property OptionForcePreviewPaneOn as Boolean
- property OptionForceShowHidden as Boolean
- property OptionHideMRUPlaces as Boolean
- property OptionHidePinnedPlaces as Boolean
- property OptionNoChangeDir as Boolean
- property OptionNoDereferenceLinks as Boolean
- property OptionNoReadOnlyReturn as Boolean
- property OptionNoTestFileCreate as Boolean
- property OptionNoValidate as Boolean
- property OptionOKButtonNeedsInteraction as Boolean
- property OptionOverwritePrompt as Boolean
- property OptionPathMustExist as Boolean
- property OptionPickFolders as Boolean
- property Options as Integer
- property OptionShareaware as Boolean
- property OptionStrictFileTypes as Boolean
- property OptionSupportsStreamableItems as Boolean
- property ProminentControlID as Integer
- property Result as WinShellItemMBS
- property Title as String
- property WindowHandle as Integer
- property CheckButtonState(ControlID as Integer) as Boolean
- property ControlItemState(ControlID as Integer, ItemID as Integer) as Integer
- property ControlItemText(ControlID as Integer, ItemID as Integer) as String
- property ControlLabel(ControlID as Integer) as String
- property ControlState(ControlID as Integer) as Integer
- property EditBoxText(ControlID as Integer) as String
- property SelectedControlItem(ControlID as Integer) as Integer
- 22 methods
- method AddCheckButton(ControlID as Integer, label as String, Checked as boolean = false)
- method AddComboBox(ControlID as Integer)
- method AddControlItem(ControlID as Integer, ItemID as Integer, Label as String)
- method AddEditBox(ControlID as Integer, Text as String = "")
- method AddMenu(ControlID as Integer, Label as String)
- method AddPlace(Item as WinShellItemMBS, top as boolean = false)
- method AddPushButton(ControlID as Integer, Label as String)
- method AddRadioButtonList(ControlID as Integer)
- method AddSeparator(ControlID as Integer)
- method AddText(ControlID as Integer, Text as String = "")
- method ClearClientData
- method Close(cancel as boolean = false)
- method Constructor Private
- method EnableOpenDropDown(ControlID as Integer)
- method EndVisualGroup
- method RemoveAllControlItems(ControlID as Integer)
- method RemoveControlItem(ControlID as Integer, ItemID as Integer)
- method SetFileTypes(FileTypes() as WinFileTypeMBS)
- method Show as Boolean
- method Show(parent as DesktopWindow) as Boolean
- method Show(parent as window) as Boolean
- method StartVisualGroup(ControlID as Integer, label as String)
- 33 constants
Control States
Constant | Value | Description |
---|---|---|
kControlStateEnabled | 1 |
The control is active. |
kControlStateEnableVisible | 3 |
The control is visible and enabled. |
kControlStateInactive | 0 |
The control is inactive and cannot be accessed by the user. |
kControlStateVisible | 2 |
The control is visible. The absence of this value indicates that the control is hidden. |
Option Flags
Constant | Value | Description |
---|---|---|
kOptionsAllNonStorageItems | &h80 |
Enables the user to choose any item in the Shell namespace, not just those with SFGAO_STREAM or SFAGO_FILESYSTEM attributes. This flag cannot be combined with kOptionsForceFileSystem. |
kOptionsAllowMultiSelect | &h200 |
Enables the user to select multiple items in the open dialog. Note that when this flag is set, the WinFileOpenDialogMBS class must be used to retrieve those items. |
kOptionsCreatePrompt | &h2000 |
Prompt for creation if the item returned in the save dialog does not exist. Note that this does not actually create the item. |
kOptionsDefaultNoMiniMode | &h20000000 |
Indicates to the Save As dialog box that it should open in expanded mode. Expanded mode is the mode that is set and unset by clicking the button in the lower-left corner of the Save As dialog box that switches between Browse Folders and Hide Folders when clicked. This value is not supported as of Windows 7. |
kOptionsDontAaddToRecent | &h2000000 |
Do not add the item being opened or saved to the recent documents list. |
kOptionsFileMustExist | &h1000 |
The item returned must exist. This is a default value for the Open dialog. |
kOptionsForceFileSystem | &h40 |
Ensures that returned items are file system items. Note that this does not apply to items returned by CurrentSelection. |
kOptionsForcePreviewPaneOn | &h40000000 |
Indicates to the Open dialog box that the preview pane should always be displayed. |
kOptionsForceShowHidden | &h10000000 |
Include hidden and system items. |
kOptionsHideMRUPlaces | &h20000 |
Hide the list of places from which the user has recently opened or saved items. This value is not supported as of Windows 7. |
kOptionsHidePinnedPlaces | &h40000 | Hide items shown by default in the view's navigation pane. This flag is often used in conjunction with the AddPlace method, to hide standard locations and replace them with custom locations. more |
kOptionsNoChangeDir | 8 |
Don't change the current working directory. |
kOptionsNoDereferenceLinks | &h100000 |
Shortcuts should not be treated as their target items. This allows an application to open a .lnk file rather than what that file is a shortcut to. |
kOptionsNoReadOnlyReturn | &h8000 |
Do not return read-only items. This is a default value for the Save dialog. |
kOptionsNoTestFileCreate | &h10000 |
Do not test whether creation of the item as specified in the Save dialog will be successful. If this flag is not set, the calling application must handle errors, such as denial of access, discovered when the item is created. |
kOptionsNoValidate | &h100 |
Do not check for situations that would prevent an application from opening the selected file, such as sharing violations or access denied errors. |
kOptionsOKButtonNeedsInteraction | &h200000 |
OKButton needs interaction? |
kOptionsOverwritePrompt | 2 |
When saving a file, prompt before overwriting an existing file of the same name. This is a default value for the Save dialog. |
kOptionsPathMustExist | &h800 |
The item returned must be in an existing folder. This is a default value. |
kOptionsPickFolders | &h20 |
Present an Open dialog that offers a choice of folders rather than files. |
kOptionsShareaware | &h4000 |
In the case of a sharing violation when an application is opening a file, call the application back through ShareViolation event for guidance. This flag is overridden by kOptionsNoValidate. |
kOptionsStrictFileTypes | 4 |
In the Save dialog, only allow the user to choose a file that has one of the file name extensions specified through SetFileTypes. |
kOptionsSupportsStreamableItems | &h80000000 |
Indicates that the caller is opening a file as a stream (BHID_Stream), so there is no need to download that file. |
Overwrite Responses
Constant | Value | Description |
---|---|---|
kOverwriteAccept | 1 |
The application has determined that the file should be returned from the dialog. |
kOverwriteDefault | 0 |
The application has not handled the event. The dialog displays a UI asking the user whether the file should be overwritten and returned from the dialog. |
kOverwriteRefuse | 2 |
The application has determined that the file should not be returned from the dialog. |
Share Violation Responds
Constant | Value | Description |
---|---|---|
kShareViolationAccept | 1 |
The application has determined that the file should be returned from the dialog. |
kShareViolationDefault | 0 |
The application has not handled the event. The dialog displays a UI that indicates that the file is in use and a different file must be chosen. |
kShareViolationRefuse | 2 |
The application has determined that the file should not be returned from the dialog. |
Sub classes:
Some events using this class:
- WinFileDialogObserverMBS.DidShowDialog(dialog as WinFileDialogMBS, Result as Integer)
- WinFileDialogObserverMBS.WillShowDialog(dialog as WinFileDialogMBS)
Some examples using this class:
Blog Entries
- News from the MBS Xojo Plugins Version 20.1
- MonkeyBread Software Releases the MBS Xojo Plugins in version 20.1
- MBS Xojo Plugins, version 20.1pr3
- Customized File Open and Save Dialogs for Windows
Xojo Developer Magazine
Release notes
- Version 20.1
- Added Windows file dialog classes: WinFileDialogMBS, WinFileDialogExceptionMBS, WinFileTypeMBS, WinShellItemMBS, WinFileSaveDialogMBS, WinFileOpenDialogMBS, WinShellItemArrayMBS.
The items on this page are in the following plugins: MBS WinFrameworks Plugin.
WinFileDialogExceptionMBS - WinFileDialogObserverMBS