]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/property.cpp
Fixed inability to select no superscript and no subscript in wxRichTextCtrl's
[wxWidgets.git] / src / propgrid / property.cpp
index 31f6f9dd9afcfb334b5d79e8b68aa320f0c413d4..53a26de39ffa726c53f994b3517d90bda3b28d03 100644 (file)
@@ -149,8 +149,10 @@ int wxPGCellRenderer::PreDrawCell( wxDC& dc, const wxRect& rect, const wxPGCell&
         dc.SetTextForeground(cell.GetFgCol());
     }
 
-    // Draw Background
-    dc.DrawRectangle(rect);
+    // Draw Background, but only if not rendering in control
+    // (as control already has rendered correct background).
+    if ( !(flags & (Control|ChoicePopup)) )
+        dc.DrawRectangle(rect);
 
     const wxBitmap& bmp = cell.GetBitmap();
     if ( bmp.Ok() &&
@@ -227,15 +229,7 @@ void wxPGDefaultRenderer::Render( wxDC& dc, const wxRect& rect,
                 paintdata.m_drawnWidth = imageSize.x;
                 paintdata.m_drawnHeight = imageSize.y;
 
-                if ( !isUnspecified )
-                {
-                    property->OnCustomPaint( dc, imageRect, paintdata );
-                }
-                else
-                {
-                    dc.SetBrush(*wxWHITE_BRUSH);
-                    dc.DrawRectangle(imageRect);
-                }
+                property->OnCustomPaint( dc, imageRect, paintdata );
 
                 imageOffset = paintdata.m_drawnWidth;
             }
@@ -544,10 +538,8 @@ void wxPGProperty::InitAfterAdded( wxPropertyGridPageState* pageState,
     // Has initial children
     if ( GetChildCount() )
     {
-        FlagType parentalFlags = m_flags & wxPG_PROP_PARENTAL_FLAGS;
-
         // Check parental flags
-        wxASSERT_MSG( parentalFlags,
+        wxASSERT_MSG( (m_flags & wxPG_PROP_PARENTAL_FLAGS),
                       "Call SetFlag(wxPG_PROP_MISC_PARENT) or"
                       "SetFlag(wxPG_PROP_AGGREGATE) before calling"
                       "wxPGProperty::AddChild()." );
@@ -798,7 +790,7 @@ void wxPGProperty::DoGenerateComposedValue( wxString& text,
                 childValue = overrideValue;
             else
                 childValue = curChild->GetValue();
-            node++;
+            ++node;
             if ( node != valueOverrides->end() )
                 overrideValue = *node;
             else
@@ -858,13 +850,13 @@ void wxPGProperty::DoGenerateComposedValue( wxString& text,
         }
     }
 
-    // Remove superfluous semicolon and space
-    wxString rest;
-    if ( text.EndsWith(wxS("; "), &rest) )
-        text = rest;
-
     if ( (unsigned int)i < m_children.size() )
-        text += wxS("; ...");
+    {
+        if ( !text.EndsWith(wxS("; ")) )
+            text += wxS("; ...");
+        else
+            text += wxS("...");
+    }
 }
 
 wxString wxPGProperty::ValueToString( wxVariant& WXUNUSED(value),
@@ -1012,18 +1004,8 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
                     {
                         if ( len > 0 )
                         {
-                            bool wasUnspecified = child->IsValueUnspecified();
-
                             if ( child->StringToValue(variant, token, propagatedFlags|wxPG_COMPOSITE_FRAGMENT) )
                             {
-                                // Clear unspecified flag only if OnSetValue() didn't
-                                // affect it.
-                                if ( child->IsValueUnspecified() &&
-                                     (wasUnspecified || !UsesAutoUnspecified()) )
-                                {
-                                    variant = child->GetDefaultValue();
-                                }
-
                                 list.Append(variant);
 
                                 changed = true;
@@ -1059,7 +1041,7 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
                 {
                     int depth = 1;
 
-                    if ( it != text.end() ) it++;
+                    if ( it != text.end() ) ++it;
                     pos++;
                     size_t startPos = pos;
 
@@ -1067,7 +1049,7 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
                     while ( it != text.end() && depth > 0 )
                     {
                         a = *it;
-                        it++;
+                        ++it;
                         pos++;
 
                         if ( a == wxS(']') )
@@ -1121,7 +1103,7 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
                     if ( a == delimeter )
                     {
                         pos--;
-                        it--;
+                        --it;
                     }
                 }
             }
@@ -1130,7 +1112,7 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
         if ( a == 0 )
             break;
 
-        it++;
+        ++it;
         if ( it != text.end() )
         {
             a = *it;
@@ -1255,7 +1237,7 @@ void wxPGProperty::SetValue( wxVariant value, wxVariant* pList, int flags )
 
             // Children in list can be in any order, but we will give hint to
             // GetPropertyByNameWH(). This optimizes for full list parsing.
-            for ( node = list.begin(); node != list.end(); node++ )
+            for ( node = list.begin(); node != list.end(); ++node )
             {
                 wxVariant& childValue = *((wxVariant*)*node);
                 wxPGProperty* child = GetPropertyByNameWH(childValue.GetName(), i);
@@ -2323,7 +2305,7 @@ bool wxPGProperty::AreAllChildrenSpecified( wxVariant* pendingList ) const
         {
             const wxString& childName = child->GetBaseName();
 
-            for ( ; node != pList->end(); node++ )
+            for ( ; node != pList->end(); ++node )
             {
                 const wxVariant& item = *((const wxVariant*)*node);
                 if ( item.GetName() == childName )
@@ -2512,7 +2494,7 @@ wxPGAttributeStorage::~wxPGAttributeStorage()
 {
     wxPGHashMapS2P::iterator it;
 
-    for ( it = m_map.begin(); it != m_map.end(); it++ )
+    for ( it = m_map.begin(); it != m_map.end(); ++it )
     {
         wxVariantData* data = (wxVariantData*) it->second;
         data->DecRef();