wFileDialog

This class represents the file chooser dialog. Only modal dialog is supported.

Superclass:wDialog
Styles:
StylesDescription
wFdOpenThis is an open dialog.
wFdSaveThis is a save dialog.
wFdOverwritePromptPprompt for a confirmation if a file will be overwritten.
wFdCreatePromptPprompt for a confirmation if a file will be create.
wFdNoFollowDirects the dialog to return the path and file name of the selected shortcut file, not its target as it does by default.
wFdFileMustExistThe user may only select files that actually exist.
wFdMultipleAllows selecting multiple files.

Consts

wFdOpen = 0
wFdSave = 4294967296
wFdOverwritePrompt = 0x00000002
wFdCreatePrompt = 0x00002000
wFdNoFollow = 0x00100000
wFdFileMustExist = 0x00001000
wFdMultiple = 0x00000200

Procs

proc final(self: wFileDialog) {...}{.raises: [], tags: [].}
Default finalizer for wFileDialog.
proc init(self: wFileDialog; owner: wWindow = nil; message = ""; defaultDir = "";
         defaultFile = ""; wildcard = "*.*"; style: wStyle = wFdOpen) {...}{.
    raises: [Exception, wCursorError, IndexError, wFontError], tags: [RootEffect].}
Initializer.
proc FileDialog(owner: wWindow = nil; message = ""; defaultDir = ""; defaultFile = "";
               wildcard = "*.*"; style: wStyle = wFdOpen): wFileDialog {...}{.inline,
    discardable, raises: [Exception, wCursorError, IndexError, wFontError],
    tags: [RootEffect].}
Constructor.
proc getMessage(self: wFileDialog): string {...}{.inline, raises: [], tags: [].}
Returns the message that will be displayed on the dialog.
proc getDirectory(self: wFileDialog): string {...}{.inline, raises: [], tags: [].}
Returns the default directory.
proc getFilename(self: wFileDialog): string {...}{.inline, raises: [], tags: [].}
Returns the default filename.
proc getWildcard(self: wFileDialog): string {...}{.inline, raises: [], tags: [].}
Returns the file dialog wildcard.
proc getFilterIndex(self: wFileDialog): int {...}{.inline, raises: [], tags: [].}
Returns the index into the list of filters supplied. Before the dialog is shown, this is the index which will be used. After the dialog is shown, this is the index selected by the user.
proc getPath(self: wFileDialog): string {...}{.inline, raises: [], tags: [].}
Returns the full path (directory and filename) of the selected file. If the user selects multiple files, this only return the directory. If the dialog is cancelled, the return value is nil.
proc getPaths(self: wFileDialog): seq[string] {...}{.inline, raises: [], tags: [].}
Returns a seq to full paths of the files chosen. If the dialog is cancelled, the return value is empty seq (@[]).
proc setMessage(self: wFileDialog; message: string) {...}{.inline, raises: [], tags: [].}
Sets the message that will be displayed on the dialog.
proc setDirectory(self: wFileDialog; defaultDir: string) {...}{.inline, raises: [], tags: [].}
Sets the default directory.
proc setFilename(self: wFileDialog; defaultFile: string) {...}{.inline, raises: [], tags: [].}
Sets the default filename.
proc setWildcard(self: wFileDialog; wildcard: string) {...}{.inline, raises: [], tags: [].}
Sets the wildcard, which can contain multiple file types, for example: "BMP files (*.bmp)|*.bmp|JPEG files (*.jpg, *.jpeg)|*.jpg;*.jpeg".
proc setFilterIndex(self: wFileDialog; index: int) {...}{.inline, raises: [], tags: [].}
Sets the default filter index, starting from one.
proc showModal(self: wFileDialog): wId {...}{.discardable, raises: [], tags: [].}
Shows the dialog, returning wIdOk if the user pressed OK, and wIdCancel otherwise.
proc display(self: wFileDialog): seq[string] {...}{.inline, discardable, raises: [], tags: [].}
Shows the dialog in modal mode, returning the selected files or @[].