]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/property.cpp
add GetValue,GetRange and GetMessage helpers
[wxWidgets.git] / src / propgrid / property.cpp
index 328084687586732832936a0c784d045ae464c334..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;
             }
@@ -796,7 +790,7 @@ void wxPGProperty::DoGenerateComposedValue( wxString& text,
                 childValue = overrideValue;
             else
                 childValue = curChild->GetValue();
-            node++;
+            ++node;
             if ( node != valueOverrides->end() )
                 overrideValue = *node;
             else
@@ -856,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),
@@ -1010,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;
@@ -1057,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;
 
@@ -1065,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(']') )
@@ -1119,7 +1103,7 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
                     if ( a == delimeter )
                     {
                         pos--;
-                        it--;
+                        --it;
                     }
                 }
             }
@@ -1128,7 +1112,7 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
         if ( a == 0 )
             break;
 
-        it++;
+        ++it;
         if ( it != text.end() )
         {
             a = *it;
@@ -1253,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);
@@ -2321,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 )
@@ -2510,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();