]> git.saurik.com Git - wxWidgets.git/commitdiff
Restore the use of correct alignment in wxDVC renderers.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 14 Nov 2009 15:51:50 +0000 (15:51 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 14 Nov 2009 15:51:50 +0000 (15:51 +0000)
The code from old CalculateAlignment() was somehow lost during the
refactoring, restore it in wxDataViewCustomRendererBase::RenderText().

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

src/common/datavcmn.cpp

index af4987ae393b23b603f7e01f198ad2ca2ee30f66..38abe9c159bd1fe0f8020b9441e92f43fef07018 100644 (file)
@@ -797,8 +797,17 @@ wxDataViewCustomRendererBase::RenderText(const wxString& text,
                                     );
     }
 
+    // get the alignment to use
+    int align = GetAlignment();
+    if ( align == wxDVR_DEFAULT_ALIGNMENT )
+    {
+        // if we don't have an explicit alignment ourselves, use that of the
+        // column in horizontal direction and default vertical alignment
+        align = GetOwner()->GetAlignment() | wxALIGN_CENTRE_VERTICAL;
+    }
+
     dc->DrawLabel(ellipsizedText.empty() ? text : ellipsizedText,
-                  rectText, GetAlignment());
+                  rectText, align);
 }
 
 //-----------------------------------------------------------------------------