first raw revision

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2008-04-01 13:55:38 +00:00
parent 008e999e14
commit 0ce6d6c89a
5 changed files with 209 additions and 106 deletions

View File

@@ -1,17 +1,66 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: fdrepdlg.h // Name: fdrepdlg.h
// Purpose: interface of wxFindDialogEvent // Purpose: interface of wxFindDialogEvent, wxFindReplaceDialog
// Author: wxWidgets team // Author: wxWidgets team
// RCS-ID: $Id$ // RCS-ID: $Id$
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/**
See wxFindDialogEvent::GetFlags().
*/
enum wxFindReplaceFlags
{
/** downward search/replace selected (otherwise - upwards) */
wxFR_DOWN = 1,
/** whole word search/replace selected */
wxFR_WHOLEWORD = 2,
/** case sensitive search/replace selected (otherwise - case insensitive) */
wxFR_MATCHCASE = 4
}
/**
These flags can be specified in wxFindReplaceDialog ctor or Create():
*/
enum wxFindReplaceDialogStyles
{
/** replace dialog (otherwise find dialog) */
wxFR_REPLACEDIALOG = 1,
/** don't allow changing the search direction */
wxFR_NOUPDOWN = 2,
/** don't allow case sensitive searching */
wxFR_NOMATCHCASE = 4,
/** don't allow whole word searching */
wxFR_NOWHOLEWORD = 8
}
/** /**
@class wxFindDialogEvent @class wxFindDialogEvent
@wxheader{fdrepdlg.h} @wxheader{fdrepdlg.h}
wxFindReplaceDialog events wxFindReplaceDialog events
@beginEventTable{wxFindDialogEvent}
@event{EVT_FIND(id, func)}:
Find button was pressed in the dialog.
@event{EVT_FIND_NEXT(id, func)}:
Find next button was pressed in the dialog.
@event{EVT_FIND_REPLACE(id, func)}:
Replace button was pressed in the dialog.
@event{EVT_FIND_REPLACE_ALL(id, func)}:
Replace all button was pressed in the dialog.
@event{EVT_FIND_CLOSE(id, func)}:
The dialog is being destroyed, any pointers to it cannot be used any longer.
@endEventTable
@library{wxcore} @library{wxcore}
@category{events} @category{events}
*/ */
@@ -35,8 +84,8 @@ public:
wxString GetFindString() const; wxString GetFindString() const;
/** /**
Get the currently selected flags: this is the combination of @c wxFR_DOWN, Get the currently selected flags: this is the combination of
@c wxFR_WHOLEWORD and @c wxFR_MATCHCASE flags. the ::wxFindReplaceFlags enumeration values.
*/ */
int GetFlags() const; int GetFlags() const;
@@ -44,7 +93,7 @@ public:
Return the string to replace the search string with (only for replace and Return the string to replace the search string with (only for replace and
replace all events). replace all events).
*/ */
const wxString GetReplaceString() const; const wxString& GetReplaceString() const;
}; };
@@ -53,18 +102,18 @@ public:
@class wxFindReplaceData @class wxFindReplaceData
@wxheader{fdrepdlg.h} @wxheader{fdrepdlg.h}
wxFindReplaceData holds the data for wxFindReplaceData holds the data for wxFindReplaceDialog.
wxFindReplaceDialog. It is used to initialize
the dialog with the default values and will keep the last values from the It is used to initialize the dialog with the default values and will keep the
dialog when it is closed. It is also updated each time a last values from the dialog when it is closed. It is also updated each time a
wxFindDialogEvent is generated so instead of wxFindDialogEvent is generated so instead of using the wxFindDialogEvent
using the wxFindDialogEvent methods you can also directly query this object. methods you can also directly query this object.
Note that all @c SetXXX() methods may only be called before showing the Note that all @c SetXXX() methods may only be called before showing the
dialog and calling them has no effect later. dialog and calling them has no effect later.
@library{wxcore} @library{wxcore}
@category{FIXME} @category{data}
*/ */
class wxFindReplaceData : public wxObject class wxFindReplaceData : public wxObject
{ {
@@ -113,13 +162,14 @@ public:
wxFindReplaceDialog is a standard modeless dialog which is used to allow the wxFindReplaceDialog is a standard modeless dialog which is used to allow the
user to search for some text (and possibly replace it with something else). user to search for some text (and possibly replace it with something else).
The actual searching is supposed to be done in the owner window which is the The actual searching is supposed to be done in the owner window which is the
parent of this dialog. Note that it means that unlike for the other standard parent of this dialog. Note that it means that unlike for the other standard
dialogs this one @b must have a parent window. Also note that there is no dialogs this one @b must have a parent window. Also note that there is no
way to use this dialog in a modal way; it is always, by design and way to use this dialog in a modal way; it is always, by design and
implementation, modeless. implementation, modeless.
Please see the dialogs sample for an example of using it. Please see the @ref page_samples_dialogs sample for an example of using it.
@library{wxcore} @library{wxcore}
@category{cmndlg} @category{cmndlg}
@@ -127,18 +177,17 @@ public:
class wxFindReplaceDialog : public wxDialog class wxFindReplaceDialog : public wxDialog
{ {
public: public:
//@{ wxFindReplaceDialog();
/** /**
After using default constructor Create() After using default constructor Create() must be called.
must be called.
The @a parent and @a data parameters must be non-@NULL. The @a parent and @a data parameters must be non-@NULL.
*/ */
wxFindReplaceDialog();
wxFindReplaceDialog(wxWindow* parent, wxFindReplaceDialog(wxWindow* parent,
wxFindReplaceData* data, wxFindReplaceData* data,
const wxString& title, const wxString& title,
int style = 0); int style = 0);
//@}
/** /**
Destructor. Destructor.
@@ -147,14 +196,14 @@ public:
/** /**
Creates the dialog; use wxWindow::Show to show it on screen. Creates the dialog; use wxWindow::Show to show it on screen.
The @a parent and @a data parameters must be non-@NULL. The @a parent and @a data parameters must be non-@NULL.
*/ */
bool Create(wxWindow* parent, wxFindReplaceData* data, bool Create(wxWindow* parent, wxFindReplaceData* data,
const wxString& title, int style = 0); const wxString& title, int style = 0);
/** /**
Get the wxFindReplaceData object used by this Get the wxFindReplaceData object used by this dialog.
dialog.
*/ */
const wxFindReplaceData* GetData() const; const wxFindReplaceData* GetData() const;
}; };

View File

@@ -21,7 +21,7 @@
Windows. Windows.
@library{wxbase} @library{wxbase}
@category{FIXME} @category{misc}
@see wxFileConfig::Save @see wxFileConfig::Save
*/ */
@@ -29,40 +29,41 @@ class wxFileConfig : public wxConfigBase
{ {
public: public:
/** /**
)
Read the config data from the specified stream instead of the associated file, Read the config data from the specified stream instead of the associated file,
as usual. as usual.
@see Save() @see Save()
*/ */
wxFileConfig(wxInputStream& is); wxFileConfig(wxInputStream& is, const wxMBConv& conv = wxConvAuto());
/** /**
Return the full path to the file which would be used by wxFileConfig as global, Return the full path to the file which would be used by wxFileConfig as global,
system-wide, file if it were constructed with @a basename as "global system-wide, file if it were constructed with @a basename as "global filename"
filename'' parameter in the constructor. Notice that this function cannot be parameter in the constructor.
used if @a basename is already a full path name.
Notice that this function cannot be used if @a basename is already a full path name.
*/ */
static wxFileName GetGlobalFile(const wxString& basename); static wxFileName GetGlobalFile(const wxString& basename);
/** /**
Return the full path to the file which would be used by wxFileConfig as local, Return the full path to the file which would be used by wxFileConfig as local,
user-specific, file if it were constructed with @a basename as "local user-specific, file if it were constructed with @a basename as "local filename"
filename'' parameter in the constructor. parameter in the constructor.
@a style has the same meaning as in @ref wxConfigBase::ctor constructor @a style has the same meaning as in @ref wxConfigBase::ctor constructor
and can contain any combination of styles but only wxCONFIG_USE_SUBDIR bit is and can contain any combination of styles but only wxCONFIG_USE_SUBDIR bit is
examined by this function. examined by this function.
Notice that this function cannot be used if @a basename is already a full
path name. Notice that this function cannot be used if @a basename is already a full path name.
*/ */
static wxFileName GetLocalFile(const wxString& basename, static wxFileName GetLocalFile(const wxString& basename,
int style = 0); int style = 0);
/** /**
)
Saves all config data to the given stream, returns @true if data was saved Saves all config data to the given stream, returns @true if data was saved
successfully or @false on error. successfully or @false on error.
Note the interaction of this function with the internal "dirty flag'': the
Note the interaction of this function with the internal "dirty flag": the
data is saved unconditionally, i.e. even if the object is not dirty. However data is saved unconditionally, i.e. even if the object is not dirty. However
after saving it successfully, the dirty flag is reset so no changes will be after saving it successfully, the dirty flag is reset so no changes will be
written back to the file this object is associated with until you change its written back to the file this object is associated with until you change its
@@ -70,13 +71,13 @@ public:
@see wxConfigBase::Flush @see wxConfigBase::Flush
*/ */
bool Save(wxOutputStream& os); bool Save(wxOutputStream& os, const wxMBConv& conv = wxConvAuto());
/** /**
Allows to set the mode to be used for the config file creation. For example, to Allows to set the mode to be used for the config file creation. For example, to
create a config file which is not readable by other users (useful if it stores create a config file which is not readable by other users (useful if it stores
some sensitive information, such as passwords), you could use some sensitive information, such as passwords), you could use @c SetUmask(0077).
@c SetUmask(0077).
This function doesn't do anything on non-Unix platforms. This function doesn't do anything on non-Unix platforms.
@see wxCHANGE_UMASK() @see wxCHANGE_UMASK()

View File

@@ -10,9 +10,10 @@
@class wxFileCtrl @class wxFileCtrl
@wxheader{filectrl.h} @wxheader{filectrl.h}
This control allows the user to select a file. two implemetations exist, one This control allows the user to select a file.
for Gtk and another generic one for anything other than Gtk.
It is only available if @c wxUSE_FILECTRL is set to 1. Two implemetations exist, one for Gtk and another generic one for anything
other than Gtk. It is only available if @c wxUSE_FILECTRL is set to 1.
@beginStyleTable @beginStyleTable
@style{wxFC_DEFAULT_STYLE}: @style{wxFC_DEFAULT_STYLE}:
@@ -30,16 +31,31 @@
Hides the "Show Hidden Files" checkbox (Generic only) Hides the "Show Hidden Files" checkbox (Generic only)
@endStyleTable @endStyleTable
@beginEventTable{wxFileCtrlEvent}
@event{EVT_FILECTRL_FILEACTIVATED(id, func)}:
The user activated a file(by double-clicking or pressing Enter)
@event{EVT_FILECTRL_SELECTIONCHANGED(id, func)}:
The user changed the current selection(by selecting or deselecting a file)
@event{EVT_FILECTRL_FOLDERCHANGED(id, func)}:
The current folder of the file control has been changed
@endEventTable
@nativeimpl{gtk}
@library{wxbase} @library{wxbase}
@category{FIXME} @category{miscwnd}
@see wxGenericDirCtrl @see wxGenericDirCtrl
*/ */
class wxFileCtrl : public wxWindow class wxFileCtrl : public wxWindow
{ {
public: public:
//@{ wxFileCtrl();
/** /**
Constructs the window.
@param parent @param parent
Parent window, must not be non-@NULL. Parent window, must not be non-@NULL.
@param id @param id
@@ -65,7 +81,7 @@ public:
@returns @true if the control was successfully created or @false if @returns @true if the control was successfully created or @false if
creation failed. creation failed.
*/ */
wxFileCtrl();
wxFileCtrl(wxWindow* parent, wxWindowID id, wxFileCtrl(wxWindow* parent, wxWindowID id,
const wxString& defaultDirectory = wxEmptyString, const wxString& defaultDirectory = wxEmptyString,
const wxString& defaultFilename = wxEmptyString, const wxString& defaultFilename = wxEmptyString,
@@ -74,7 +90,6 @@ public:
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
const wxString& name = "filectrl"); const wxString& name = "filectrl");
//@}
/** /**
Create function for two-step construction. See wxFileCtrl() for details. Create function for two-step construction. See wxFileCtrl() for details.
@@ -89,23 +104,22 @@ public:
const wxString& name = "filectrl"); const wxString& name = "filectrl");
/** /**
Returns the current directory of the file control (i.e. the directory shown by Returns the current directory of the file control (i.e. the directory shown by it).
it).
*/ */
wxString GetDirectory() const; wxString GetDirectory() const;
/** /**
Returns the currently selected filename. Returns the currently selected filename.
For the controls having the @c wxFC_MULTIPLE style, use GetFilenames()
instead For the controls having the @c wxFC_MULTIPLE style, use GetFilenames() instead.
*/ */
wxString GetFilename() const; wxString GetFilename() const;
/** /**
Fills the array @a filenames with the filenames only of selected items. This Fills the array @a filenames with the filenames only of selected items.
function should only be used with the controls having the @c wxFC_MULTIPLE
style, This function should only be used with the controls having the @c wxFC_MULTIPLE
use GetFilename() for the others. style, use GetFilename() for the others.
@remarks filenames is emptied first. @remarks filenames is emptied first.
*/ */
@@ -118,14 +132,14 @@ public:
/** /**
Returns the full path (directory and filename) of the currently selected file. Returns the full path (directory and filename) of the currently selected file.
For the controls having the @c wxFC_MULTIPLE style, use GetPaths() For the controls having the @c wxFC_MULTIPLE style, use GetPaths() instead.
instead
*/ */
wxString GetPath() const; wxString GetPath() const;
/** /**
Fills the array @a paths with the full paths of the files chosen. This Fills the array @a paths with the full paths of the files chosen.
function should be used with the controls having the @c wxFC_MULTIPLE style,
This function should be used with the controls having the @c wxFC_MULTIPLE style,
use GetPath() otherwise. use GetPath() otherwise.
@remarks paths is emptied first. @remarks paths is emptied first.
@@ -177,8 +191,17 @@ public:
A file control event holds information about events associated with A file control event holds information about events associated with
wxFileCtrl objects. wxFileCtrl objects.
@beginEventTable{wxFileCtrlEvent}
@event{EVT_FILECTRL_FILEACTIVATED(id, func)}:
The user activated a file(by double-clicking or pressing Enter)
@event{EVT_FILECTRL_SELECTIONCHANGED(id, func)}:
The user changed the current selection(by selecting or deselecting a file)
@event{EVT_FILECTRL_FOLDERCHANGED(id, func)}:
The current folder of the file control has been changed
@endEventTable
@library{wxbase} @library{wxbase}
@category{FIXME} @category{events}
*/ */
class wxFileCtrlEvent : public wxCommandEvent class wxFileCtrlEvent : public wxCommandEvent
{ {
@@ -190,18 +213,20 @@ public:
/** /**
Returns the current directory. Returns the current directory.
In case of a @b EVT_FILECTRL_FOLDERCHANGED, this method returns the new In case of a @b EVT_FILECTRL_FOLDERCHANGED, this method returns the new
directory. directory.
*/ */
wxString GetDirectory() const; wxString GetDirectory() const;
/** /**
Returns the file selected(assuming it is only one file). Returns the file selected (assuming it is only one file).
*/ */
wxString GetFile() const; wxString GetFile() const;
/** /**
Returns the files selected. Returns the files selected.
In case of a @b EVT_FILECTRL_SELECTIONCHANGED, this method returns the In case of a @b EVT_FILECTRL_SELECTIONCHANGED, this method returns the
files selected after the event. files selected after the event.
*/ */
@@ -210,6 +235,12 @@ public:
/** /**
Sets the files changed by this event. Sets the files changed by this event.
*/ */
wxFileCtrlEvent::SetFiles(const wxArrayString files); void SetFiles(const wxArrayString files);
/**
Sets the directory of this event.
*/
void SetDirectory( const wxString &directory );
}; };

View File

@@ -12,13 +12,32 @@
This class represents the file chooser dialog. This class represents the file chooser dialog.
It pops up a file selector box (native for Windows and GTK2.4+).
The path and filename are distinct elements of a full file pathname.
If path is "", the current directory will be used. If filename is "", no default
filename will be supplied. The wildcard determines what files are displayed in the
file selector, and file extension supplies a type extension for the required filename.
@remarks
All implementations of the wxFileDialog provide a wildcard filter. Typing a filename
containing wildcards (*, ?) in the filename text item, and clicking on Ok, will
result in only those files matching the pattern being displayed.
The wildcard may be a specification for multiple types of file with a description
for each, such as:
"BMP and GIF files (*.bmp;*.gif)|*.bmp;*.gif|PNG files (*.png)|*.png"
It must be noted that wildcard support in the native Motif file dialog is quite
limited: only one alternative is supported, and it is displayed without the
descriptive test; "BMP files (*.bmp)|*.bmp" is displayed as "*.bmp", and both
"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif" and "Image files|*.bmp;*.gif"
are errors.
@beginStyleTable @beginStyleTable
@style{wxFD_DEFAULT_STYLE}: @style{wxFD_DEFAULT_STYLE}:
Equivalent to wxFD_OPEN. Equivalent to wxFD_OPEN.
@style{wxFD_OPEN}: @style{wxFD_OPEN}:
This is an open dialog; usually this means that the default This is an open dialog; usually this means that the default
button's label of the dialog is "Open". Cannot be combined with button's label of the dialog is "Open". Cannot be combined with wxFD_SAVE.
wxFD_SAVE.
@style{wxFD_SAVE}: @style{wxFD_SAVE}:
This is a save dialog; usually this means that the default button's This is a save dialog; usually this means that the default button's
label of the dialog is "Save". Cannot be combined with wxFD_OPEN. label of the dialog is "Save". Cannot be combined with wxFD_OPEN.
@@ -26,8 +45,7 @@
For save dialog only: prompt for a confirmation if a file will be For save dialog only: prompt for a confirmation if a file will be
overwritten. overwritten.
@style{wxFD_FILE_MUST_EXIST}: @style{wxFD_FILE_MUST_EXIST}:
For open dialog only: the user may only select files that actually For open dialog only: the user may only select files that actually exist.
exist.
@style{wxFD_MULTIPLE}: @style{wxFD_MULTIPLE}:
For open dialog only: allows selecting multiple files. For open dialog only: allows selecting multiple files.
@style{wxFD_CHANGE_DIR}: @style{wxFD_CHANGE_DIR}:
@@ -41,8 +59,7 @@
@library{wxcore} @library{wxcore}
@category{cmndlg} @category{cmndlg}
@see @ref overview_wxfiledialogoverview "wxFileDialog overview", @see @ref overview_wxfiledialog, ::wxFileSelector()
wxFileSelector()
*/ */
class wxFileDialog : public wxDialog class wxFileDialog : public wxDialog
{ {
@@ -59,8 +76,7 @@ public:
@param defaultFile @param defaultFile
The default filename, or the empty string. The default filename, or the empty string.
@param wildcard @param wildcard
A wildcard, such as "*.*" or "BMP files (*.bmp)|*.bmp|GIF files A wildcard, such as "*.*" or "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
(*.gif)|*.gif".
Note that the native Motif dialog has some limitations with respect to Note that the native Motif dialog has some limitations with respect to
wildcards; see the Remarks section above. wildcards; see the Remarks section above.
@param style @param style
@@ -93,9 +109,7 @@ public:
wxString GetDirectory() const; wxString GetDirectory() const;
/** /**
If functions If functions SetExtraControlCreator() and ShowModal() were called,
SetExtraControlCreator()
and ShowModal() were called,
returns the extra window. Otherwise returns @NULL. returns the extra window. Otherwise returns @NULL.
*/ */
wxWindow* GetExtraControl() const; wxWindow* GetExtraControl() const;
@@ -106,9 +120,11 @@ public:
wxString GetFilename() const; wxString GetFilename() const;
/** /**
Fills the array @a filenames with the names of the files chosen. This Fills the array @a filenames with the names of the files chosen.
function should only be used with the dialogs which have @c wxFD_MULTIPLE style,
This function should only be used with the dialogs which have @c wxFD_MULTIPLE style,
use GetFilename() for the others. use GetFilename() for the others.
Note that under Windows, if the user selects shortcuts, the filenames Note that under Windows, if the user selects shortcuts, the filenames
include paths, since the application cannot determine the full path include paths, since the application cannot determine the full path
of each referenced file by appending the directory containing the shortcuts of each referenced file by appending the directory containing the shortcuts
@@ -119,8 +135,10 @@ public:
/** /**
Returns the index into the list of filters supplied, optionally, in the Returns the index into the list of filters supplied, optionally, in the
wildcard parameter. wildcard parameter.
Before the dialog is shown, this is the index which will be used when the Before the dialog is shown, this is the index which will be used when the
dialog is first displayed. dialog is first displayed.
After the dialog is shown, this is the index selected by the user. After the dialog is shown, this is the index selected by the user.
*/ */
int GetFilterIndex() const; int GetFilterIndex() const;
@@ -136,8 +154,9 @@ public:
wxString GetPath() const; wxString GetPath() const;
/** /**
Fills the array @a paths with the full paths of the files chosen. This Fills the array @a paths with the full paths of the files chosen.
function should only be used with the dialogs which have @c wxFD_MULTIPLE style,
This function should only be used with the dialogs which have @c wxFD_MULTIPLE style,
use GetPath() for the others. use GetPath() for the others.
*/ */
void GetPaths(wxArrayString& paths) const; void GetPaths(wxArrayString& paths) const;
@@ -155,10 +174,12 @@ public:
/** /**
Customize file dialog by adding extra window, which is typically placed Customize file dialog by adding extra window, which is typically placed
below the list of files and above the buttons. below the list of files and above the buttons.
SetExtraControlCreator can be called only once, before calling
ShowModal(). SetExtraControlCreator() can be called only once, before calling ShowModal().
The @c creator function should take pointer to parent window (file dialog) The @c creator function should take pointer to parent window (file dialog)
and should return a window allocated with operator new. and should return a window allocated with operator new.
Supported platforms: wxGTK, wxUniv. Supported platforms: wxGTK, wxUniv.
*/ */
bool SetExtraControlCreator(t_extraControlCreator creator); bool SetExtraControlCreator(t_extraControlCreator creator);
@@ -186,7 +207,8 @@ public:
/** /**
Sets the wildcard, which can contain multiple file types, for example: Sets the wildcard, which can contain multiple file types, for example:
"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif" "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
Note that the native Motif dialog has some limitations with respect to Note that the native Motif dialog has some limitations with respect to
wildcards; see the Remarks section above. wildcards; see the Remarks section above.
*/ */

View File

@@ -25,70 +25,70 @@
class wxPathList : public wxArrayString class wxPathList : public wxArrayString
{ {
public: public:
//@{ wxPathList();
/** /**
Constructs the object calling the Add() function. Constructs the object calling the Add() function.
*/ */
wxPathList();
wxPathList(const wxArrayString& arr); wxPathList(const wxArrayString& arr);
//@}
//@{
/** /**
The first form adds the given directory to the path list, if the path is not Adds the given directory to the path list, if the @a path is not already in the list.
already in the list.
If the path cannot be normalized for some reason, it returns @false. If the path cannot be normalized for some reason, it returns @false.
The second form just calls the first form on all elements of the given array.
The @a path is always considered a directory but no existence checks will be The @a path is always considered to be a directory but no existence checks will be
done on it done on it (because if it doesn't exist, it could be created later and thus result a
(because if it doesn't exist, it could be created later and thus result a valid valid path when FindValidPath() is called).
path when
FindValidPath() is called). @note if the given path is relative, it won't be made absolute before adding it
@b Note: if the given path is relative, it won't be made absolute before adding (this is why FindValidPath() may return relative paths).
it
(this is why FindValidPath() may return relative paths).
*/ */
bool Add(const wxString& path); bool Add(const wxString& path);
/**
Adds all elements of the given array as paths.
*/
void Add(const wxArrayString& arr); void Add(const wxArrayString& arr);
//@}
/** /**
Finds the value of the given environment variable, and adds all paths Finds the value of the given environment variable, and adds all paths
to the path list. Useful for finding files in the @c PATH variable, for to the path list.
example.
Useful for finding files in the @c PATH variable, for example.
*/ */
void AddEnvList(const wxString& env_variable); void AddEnvList(const wxString& env_variable);
/** /**
Given a full filename (with path), calls Add() with the path Given a full filename (with path), calls Add() with the path of the file.
of the file.
*/ */
bool EnsureFileAccessible(const wxString& filename); bool EnsureFileAccessible(const wxString& filename);
/** /**
Like FindValidPath() but this function always Like FindValidPath() but this function always returns an absolute path
returns an absolute path (eventually prepending the current working directory (eventually prepending the current working directory to the value returned
to the value returned wxPathList::FindValidPath) or an wxPathList::FindValidPath()) or an empty string.
empty string.
*/ */
wxString FindAbsoluteValidPath(const wxString& file) const; wxString FindAbsoluteValidPath(const wxString& file) const;
/** /**
Searches the given file in all paths stored in this class. Searches the given file in all paths stored in this class.
The first path which concatenated to the given string points to an existing The first path which concatenated to the given string points to an existing
file (see wxFileExists()) is returned. file (see wxFileExists()) is returned.
If the file wasn't found in any of the stored paths, an empty string is
returned. If the file wasn't found in any of the stored paths, an empty string is returned.
The given string must be a file name, eventually with a path prefix (if the path The given string must be a file name, eventually with a path prefix (if the path
prefix is absolute, only its name will be searched); i.e. it must not end with prefix is absolute, only its name will be searched); i.e. it must not end with
a directory separator (see wxFileName::GetPathSeparator) a directory separator (see wxFileName::GetPathSeparator) otherwise an assertion
otherwise an assertion will fail. will fail.
The returned path may be relative to the current working directory. The returned path may be relative to the current working directory.
Note in fact that wxPathList can be used to store both relative and absolute Note in fact that wxPathList can be used to store both relative and absolute
paths so that paths so that if you added relative paths, then the current working directory
if you Added() relative paths, then the current working directory (see wxGetCwd() and wxSetWorkingDirectory()) may affect the value returned
(see wxGetCwd() and wxSetWorkingDirectory()) by this function!
may affect the value returned by this function!
*/ */
wxString FindValidPath(const wxString& file) const; wxString FindValidPath(const wxString& file) const;
}; };