]> git.saurik.com Git - wxWidgets.git/commitdiff
add accessors using wxFileName to wxFile/DirPickerCtrl (patch 1622534)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 4 Feb 2007 00:22:47 +0000 (00:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 4 Feb 2007 00:22:47 +0000 (00:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44353 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
docs/latex/wx/dirpicker.tex
docs/latex/wx/filepicker.tex
include/wx/filepicker.h

index 40eb25ebada995679e934610e47b7166ef9e209f..153d114869bc93dbd45505e409620dcbe64ad3e3 100644 (file)
@@ -23,6 +23,8 @@ Major new features in this release
 
 All:
 
+- Added wxEventBlocker class (Francesco Montorsi)
+- Added wxFile/DirPickerCtrl::Get/SetFile/DirName() (Francesco Montorsi)
 - Added wxSizerFlags::Top() and Bottom()
 
 wxGTK:
index cd5927945a42c84965b48a7b8ee1d0fc31e77ee7..2140ec34ec4835d0e9c42f0f83f1aebce5c650ae 100644 (file)
@@ -117,6 +117,14 @@ all the parameters.
 
 \true if the control was successfully created or \false if creation failed.
 
+\membersection{wxFilePickerCtrl::GetDirName}\label{wxfilepickerctrlgetdirname}
+
+\constfunc{wxFileName}{GetDirName}{\void}
+
+Returns the absolute path of the currently selected directory as a \helpref{wxFileName} object.
+This function is equivalent to \helpref{GetPath}{wxdirpickerctrlgetpath}
+
 
 \membersection{wxDirPickerCtrl::GetPath}\label{wxdirpickerctrlgetpath}
 
@@ -125,6 +133,14 @@ all the parameters.
 Returns the absolute path of the currently selected directory.
 
 
+\membersection{wxFilePickerCtrl::SetDirName}\label{wxfilepickerctrlsetdirname}
+
+\func{void}{SetDirName}{\param{const wxFileName \&}{dirname}}
+
+Just like \helpref{SetPath}{wxdirpickerctrlsetpath} but this function takes a
+\helpref{wxFileName} object.
+
+
 \membersection{wxDirPickerCtrl::SetPath}\label{wxdirpickerctrlsetpath}
 
 \func{void}{SetPath}{\param{const wxString \&}{dirname}}
index 5fca3a8fedf7b38519fd2a4c2573d110a12408e9..af18928183904a6d0b0879093416554f49d6d788 100644 (file)
@@ -128,6 +128,14 @@ all the parameters.
 \true if the control was successfully created or \false if creation failed.
 
 
+\membersection{wxFilePickerCtrl::GetFileName}\label{wxfilepickerctrlgetfilename}
+
+\constfunc{wxFileName}{GetFileName}{\void}
+
+Similar to \helpref{GetPath}{wxfilepickerctrlgetpath} but returns the path of
+the currently selected file as a \helpref{wxFileName} object.
+
+
 \membersection{wxFilePickerCtrl::GetPath}\label{wxfilepickerctrlgetpath}
 
 \constfunc{wxString}{GetPath}{\void}
@@ -135,6 +143,14 @@ all the parameters.
 Returns the absolute path of the currently selected file.
 
 
+\membersection{wxFilePickerCtrl::SetFileName}\label{wxfilepickerctrlsetfilename}
+
+\func{void}{SetFileName}{\param{const wxFileName \&}{filename}}
+
+This method does the same thing as \helpref{SetPath}{wxfilepickerctrlsetpath} but
+takes a \helpref{wxFileName}{wxfilename} object instead of a string.
+
+
 \membersection{wxFilePickerCtrl::SetPath}\label{wxfilepickerctrlsetpath}
 
 \func{void}{SetPath}{\param{const wxString \&}{filename}}
index b4f12513ebef9eb64ad7f59dc1589def4e8f71c1..8423c65f26947971f0d79206c41d42e23663196a 100644 (file)
@@ -17,6 +17,7 @@
 #if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL
 
 #include "wx/pickerbase.h"
+#include "wx/filename.h"
 
 class WXDLLIMPEXP_CORE wxDialog;
 class WXDLLIMPEXP_CORE wxFileDirPickerEvent;
@@ -215,6 +216,11 @@ public:
                                                    validator, name);
     }
 
+    void SetFileName(const wxFileName &filename)
+        { SetPath(filename.GetFullPath()); }
+
+    wxFileName GetFileName() const
+        { return wxFileName(GetPath()); }
 
 public:     // overrides
 
@@ -307,6 +313,11 @@ public:
                );
     }
 
+    void SetDirName(const wxFileName &dirname)
+        { SetPath(dirname.GetPath()); }
+
+    wxFileName GetDirName() const
+        { return wxFileName::DirName(GetPath()); }
 
 public:     // overrides