]> git.saurik.com Git - wxWidgets.git/commitdiff
Added nominal wxPG_PROP_READONLY support for editor controls other than wxTextCtrl...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 31 Jan 2010 18:15:17 +0000 (18:15 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 31 Jan 2010 18:15:17 +0000 (18:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63337 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/property.h
interface/wx/propgrid/propgridiface.h
src/propgrid/editors.cpp

index 99027163b7457bab95cd3e9a6e800f049d12cdb6..f6373b517be5ecc360be6271d35cdbf6a757b621 100644 (file)
@@ -451,7 +451,9 @@ wxPG_PROP_CATEGORY                  = 0x2000,
 */
 wxPG_PROP_MISC_PARENT               = 0x4000,
 
-/** Property is read-only. Editor is still created.
+/** Property is read-only. Editor is still created for wxTextCtrl-based
+    property editors. For others, editor is not usually created because
+    they do implement wxTE_READONLY style or equivalent.
 */
 wxPG_PROP_READONLY                  = 0x8000,
 
index 2b1cb12d27e3039ed234f03e65cd92a8f91bc477..35b7debea37b400f8d435b22a015c7b8b5183688 100644 (file)
@@ -794,9 +794,6 @@ public:
         In other words, user cannot change the value in the editor, but they can
         still copy it.
 
-        @remarks This is mainly for use with textctrl editor. Only some other
-                editors fully support it.
-
         @param id
             Property name or pointer.
 
@@ -806,6 +803,9 @@ public:
         @param flags
             By default changes are applied recursively. Set this parameter
             wxPG_DONT_RECURSE to prevent this.
+
+        @remarks This is mainly for use with textctrl editor. Only some other
+                 editors fully support it.
     */
     void SetPropertyReadOnly( wxPGPropArg id, bool set = true,
                               int flags = wxPG_RECURSE );
index 140e0ff5963178d376490fba8e6b6cf9cf9c5eec..9ac08888ab2861f5c04d16af603508ec6a4067b8 100644 (file)
@@ -983,6 +983,12 @@ wxWindow* wxPGChoiceEditor::CreateControlsBase( wxPropertyGrid* propGrid,
                                                 const wxSize& sz,
                                                 long extraStyle ) const
 {
+    // Since it is not possible (yet) to create a read-only combo box in
+    // the same sense that wxTextCtrl is read-only, simply do not create
+    // the control in this case.
+    if ( property->HasFlag(wxPG_PROP_READONLY) )
+        return NULL;
+
     const wxPGChoices& choices = property->GetChoices();
     wxString defString;
     int index = property->GetChoiceSelection();
@@ -1577,6 +1583,9 @@ wxPGWindowList wxPGCheckBoxEditor::CreateControls( wxPropertyGrid* propGrid,
                                                    const wxPoint& pos,
                                                    const wxSize& size ) const
 {
+    if ( property->HasFlag(wxPG_PROP_READONLY) )
+        return NULL;
+
     wxPoint pt = pos;
     pt.x -= wxPG_XBEFOREWIDGET;
     wxSize sz = size;