]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datavcmn.cpp
Make wxPORTRAIT and wxLANDSCAPE elements of wxPrintOrientation enum.
[wxWidgets.git] / 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);
 }
 
 //-----------------------------------------------------------------------------