summaryrefslogtreecommitdiff
path: root/src/wx/dir_picker_ctrl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-04-09 03:15:19 +0200
committerCarl Hetherington <cth@carlh.net>2024-04-16 00:39:05 +0200
commit1e3e63c16db89f8f8623283d683139587aa139b6 (patch)
tree6c9249d25b8f2bef6b651e63a1efbad22aaf8b35 /src/wx/dir_picker_ctrl.cc
parentec68c0a5aa1ae345e0054548b6f6f70d4cafa106 (diff)
Add leaf parameter to DirPickerCtrl.
Diffstat (limited to 'src/wx/dir_picker_ctrl.cc')
-rw-r--r--src/wx/dir_picker_ctrl.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wx/dir_picker_ctrl.cc b/src/wx/dir_picker_ctrl.cc
index 3371c734b..a8c09e334 100644
--- a/src/wx/dir_picker_ctrl.cc
+++ b/src/wx/dir_picker_ctrl.cc
@@ -36,8 +36,9 @@ using namespace std;
using namespace boost;
-DirPickerCtrl::DirPickerCtrl (wxWindow* parent)
+DirPickerCtrl::DirPickerCtrl(wxWindow* parent, bool leaf)
: wxPanel (parent)
+ , _leaf(leaf)
{
_sizer = new wxBoxSizer (wxHORIZONTAL);
@@ -62,7 +63,11 @@ DirPickerCtrl::SetPath (wxString p)
if (_path == wxStandardPaths::Get().GetDocumentsDir()) {
_folder->SetLabel (_("My Documents"));
} else {
- _folder->SetLabel (_path);
+ if (_leaf) {
+ _folder->SetLabel(std_to_wx(boost::filesystem::path(wx_to_std(_path)).filename().string()));
+ } else {
+ _folder->SetLabel(_path);
+ }
}
wxCommandEvent ev (wxEVT_DIRPICKER_CHANGED, wxID_ANY);