X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c20523110b6601abd001eb6316c563ff1b53af0..cbe067603829728da8852282e895f25b2bccf732:/src/common/datavcmn.cpp?ds=sidebyside diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index bb258cd33b..99449244bb 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -792,13 +792,22 @@ wxDataViewCustomRendererBase::RenderText(const wxString& text, text, *dc, GetEllipsizeMode(), - rect.width, + rectText.width, wxELLIPSIZE_FLAGS_NONE ); } + // 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); } //----------------------------------------------------------------------------- @@ -1790,6 +1799,14 @@ wxDataViewTreeStore::InsertContainer(const wxDataViewItem& parent, return node->GetItem(); } +bool wxDataViewTreeStore::IsContainer( const wxDataViewItem& item ) const +{ + wxDataViewTreeStoreNode *node = FindNode( item ); + if (!node) return false; + + return node->IsContainer(); +} + wxDataViewItem wxDataViewTreeStore::GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const { wxDataViewTreeStoreContainerNode *parent_node = FindContainerNode( parent ); @@ -1963,14 +1980,6 @@ wxDataViewItem wxDataViewTreeStore::GetParent( const wxDataViewItem &item ) cons return parent->GetItem(); } -bool wxDataViewTreeStore::IsContainer( const wxDataViewItem &item ) const -{ - wxDataViewTreeStoreNode *node = FindNode( item ); - if (!node) return false; - - return node->IsContainer(); -} - unsigned int wxDataViewTreeStore::GetChildren( const wxDataViewItem &item, wxDataViewItemArray &children ) const { wxDataViewTreeStoreContainerNode *node = FindContainerNode( item );