Add wxDataViewRendererBase::GetEffectiveAlignment() and use it.

This helper method falls back on the alignment of the column if the renderer
alignment is not specified. This is almost always what should be used instead
of GetAlignment() to determine the alignment that really should be used in the
drawing code.

In particular, using GetEffectiveAlignment() in wxDataViewCustomRenderer fixes
the problem with bitmap columns ignoring column alignment for their bitmaps.

Closes #15498.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-09-17 15:25:47 +00:00
parent b59ada676f
commit 3e33568e0b
2 changed files with 52 additions and 39 deletions

View File

@@ -167,6 +167,15 @@ protected:
// Called from {Cancel,Finish}Editing() to cleanup m_editorCtrl
void DestroyEditControl();
// Return the alignment of this renderer if it's specified (i.e. has value
// different from the default wxDVR_DEFAULT_ALIGNMENT) or the alignment of
// the column it is used for otherwise.
//
// Unlike GetAlignment(), this always returns a valid combination of
// wxALIGN_XXX flags (although possibly wxALIGN_NOT) and never returns
// wxDVR_DEFAULT_ALIGNMENT.
int GetEffectiveAlignment() const;
wxString m_variantType;
wxDataViewColumn *m_owner;
wxWeakRef<wxWindow> m_editorCtrl;