]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxDIRCTRL_EDITABLE style so we can choose whether
authorJulian Smart <julian@anthemion.co.uk>
Mon, 8 Apr 2002 11:15:16 +0000 (11:15 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 8 Apr 2002 11:15:16 +0000 (11:15 +0000)
items are editable or not

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/dirctrl.tex
include/wx/generic/dirctrlg.h
src/generic/dirctrlg.cpp
src/generic/dirdlgg.cpp

index 7fab574d2467c168c04e60a83faa300b814df9b7..42d6726c836ba2936d4fdae25cbe8ebf028513b4 100644 (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\_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\_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}.
 \end{twocollist}
 
 See also \helpref{Generic window styles}{windowstyles}.
index 4be293df3e21c03ff85441899432e23684a0a3e6..06899560724777b885df58e6088338268a31e82d 100644 (file)
@@ -45,7 +45,9 @@ enum
     // Show the filter list
     wxDIRCTRL_SHOW_FILTERS   = 0x0040,
     // Use 3D borders on internal controls
     // 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
 };
 
 //-----------------------------------------------------------------------------
 };
 
 //-----------------------------------------------------------------------------
index 6084a44bd23c88958c70ee91de0f4cf906ac6314..70385cff71fe95bac1ba70f38ae8edb1fb88dda2 100644 (file)
@@ -503,13 +503,10 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
     Init();
 
     long treeStyle = wxTR_HAS_BUTTONS;
     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;
 #ifndef __WXMSW__
     // FIXME, doesn't work for some reason
     treeStyle |= wxTR_HIDE_ROOT;
index da8b9a8759b963501eb8d9b204de1599400116fa..94349e3c35b1f089bc9caf11e3e61c4d0f6a4567 100644 (file)
@@ -111,7 +111,7 @@ wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title,
     m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL,
                                      m_path, wxPoint(5, 5),
                                      wxSize(300, 200), 
     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 );
 
 
     topsizer->Add( m_dirCtrl, 1, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 );