Inherits AspectFileFilter.
Inherited by WidgetLoadFile, and WidgetSaveFile.
Public Member Functions | |
void | activeFilter (unsigned filterNo) |
Sets the active filter to the specified index. | |
void | addFilter (const SmartUtil::tstring &filterName, const SmartUtil::tstring &filter) |
Adds a filter to the object. | |
void | backslashToForwardSlashForUnix (SmartUtil::tstring &filename) |
Ensure filename meets OS expectations for path separators. | |
unsigned | getActiveFilter () const |
Returns the active filter of the object. | |
void | setStartDirectory (SmartUtil::tstring startDir) |
Sets the starting directory of the WidgetLoadFile or WidgetSaveFile Widget. |
void activeFilter | ( | unsigned | filterNo | ) | [inherited] |
Sets the active filter to the specified index.
If you have added five filters and set the active filter to 3 then the fourth filter you added will be the active filter. Active filter means the default filter used when first showing the dialog.
void addFilter | ( | const SmartUtil::tstring & | filterName, | |
const SmartUtil::tstring & | filter | |||
) | [inherited] |
Adds a filter to the object.
filterName is the friendly name of the filter, normally this would be e.g. "HTML Files" etc. filter is the actual filter to filter in files to show normally this would be e.g. "*.html".
void backslashToForwardSlashForUnix | ( | SmartUtil::tstring & | filename | ) |
Ensure filename meets OS expectations for path separators.
We want WidgetSaveFile and WidgetLoadFile to always return a pathname that meets the OS expectations.
Windows wants: C:.ext
and UnixLinux: /dir/dir/file.ext
Wine produces z:.exe from GetLoadFileName(&ofn) )and GetSaveFileName(&ofn).
So if we are building for wine, we need to convert from the wine output to the Linux format.
IE: convert z:.txt to /home/awebb/file.txt
The assumption is that the C++ standard library is Linux native, and thus needs / pathnames.
unsigned getActiveFilter | ( | ) | const [inherited] |
Returns the active filter of the object.
The active filter is the "currently selected" filter of the filter class
void setStartDirectory | ( | SmartUtil::tstring | startDir | ) |
Sets the starting directory of the WidgetLoadFile or WidgetSaveFile Widget.
If given your dialog will try to start in the given directory, otherwise it will use the working directory of the process.