Added wxDIRCTRL_EDITABLE style so we can choose whether

items are editable or not


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2002-04-08 11:15:16 +00:00
parent 992295c493
commit fd775aae7b
4 changed files with 9 additions and 9 deletions

View File

@ -24,6 +24,7 @@ hierarchy, and optionally, a \helpref{wxChoice}{wxchoice} window containing a li
\twocolitem{\indexit{wxDIRCTRL\_3D\_INTERNAL}}{Use 3D borders for internal controls.} \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\_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\_SHOW\_FILTERS}}{Show the drop-down filter list.}
\twocolitem{\indexit{wxDIRCTRL\_EDITABLE}}{Allow the folder and file items to be editable.}
\end{twocollist} \end{twocollist}
See also \helpref{Generic window styles}{windowstyles}. See also \helpref{Generic window styles}{windowstyles}.

View File

@ -45,7 +45,9 @@ enum
// Show the filter list // Show the filter list
wxDIRCTRL_SHOW_FILTERS = 0x0040, wxDIRCTRL_SHOW_FILTERS = 0x0040,
// Use 3D borders on internal controls // Use 3D borders on internal controls
wxDIRCTRL_3D_INTERNAL = 0x0080 wxDIRCTRL_3D_INTERNAL = 0x0080,
// Editable labels
wxDIRCTRL_EDITABLE = 0x0100
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -503,13 +503,10 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
Init(); Init();
long treeStyle = wxTR_HAS_BUTTONS; long treeStyle = wxTR_HAS_BUTTONS;
#ifdef __WXMSW__
// VS: Do **NOT** remove this style, ever. MSW native wxTreeCtrl::EditLabel doesn't if (style & wxDIRCTRL_EDITABLE)
// work without this style and we need it to be able to create new directories. treeStyle |= wxTR_EDIT_LABELS;
// 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
#ifndef __WXMSW__ #ifndef __WXMSW__
// FIXME, doesn't work for some reason // FIXME, doesn't work for some reason
treeStyle |= wxTR_HIDE_ROOT; treeStyle |= wxTR_HIDE_ROOT;

View File

@ -111,7 +111,7 @@ wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title,
m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL, m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL,
m_path, wxPoint(5, 5), m_path, wxPoint(5, 5),
wxSize(300, 200), 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 ); topsizer->Add( m_dirCtrl, 1, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 );