\twocolitem{\indexit{wxDIRCTRL\_3D\_INTERNAL}}{Use 3D borders for internal controls.}
\twocolitem{\indexit{wxDIRCTRL\_SELECT\_FIRST}}{When setting the default path, select the first file in the directory.}
\twocolitem{\indexit{wxDIRCTRL\_SHOW\_FILTERS}}{Show the drop-down filter list.}
+\twocolitem{\indexit{wxDIRCTRL\_EDITABLE}}{Allow the folder and file items to be editable.}
\end{twocollist}
See also \helpref{Generic window styles}{windowstyles}.
// Show the filter list
wxDIRCTRL_SHOW_FILTERS = 0x0040,
// Use 3D borders on internal controls
- wxDIRCTRL_3D_INTERNAL = 0x0080
+ wxDIRCTRL_3D_INTERNAL = 0x0080,
+ // Editable labels
+ wxDIRCTRL_EDITABLE = 0x0100
};
//-----------------------------------------------------------------------------
Init();
long treeStyle = wxTR_HAS_BUTTONS;
-#ifdef __WXMSW__
- // VS: Do **NOT** remove this style, ever. MSW native wxTreeCtrl::EditLabel doesn't
- // work without this style and we need it to be able to create new directories.
- // Generic wxTreeCtrl can do it even w/o wxTR_EDIT_LABELS, so we only add it
- // in case of wxMSW (as it is arguably better to not have the style enabled)
- treeStyle |= wxTR_EDIT_LABELS;
-#endif
+
+ if (style & wxDIRCTRL_EDITABLE)
+ treeStyle |= wxTR_EDIT_LABELS;
+
#ifndef __WXMSW__
// FIXME, doesn't work for some reason
treeStyle |= wxTR_HIDE_ROOT;
m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL,
m_path, wxPoint(5, 5),
wxSize(300, 200),
- wxDIRCTRL_DIR_ONLY|wxSUNKEN_BORDER);
+ wxDIRCTRL_DIR_ONLY|wxDIRCTRL_EDITABLE|wxSUNKEN_BORDER);
topsizer->Add( m_dirCtrl, 1, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 );