implemented GetBestSize() (TODO: make this available in generic version as well)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c358ea4147
commit
96d8f9207f
@ -429,6 +429,9 @@ public:
|
||||
int GetState(const wxTreeItemId& node);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
|
||||
// SetImageList helper
|
||||
void SetAnyImageList(wxImageList *imageList, int which);
|
||||
|
||||
|
@ -2137,6 +2137,26 @@ bool wxTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
|
||||
}
|
||||
}
|
||||
|
||||
wxSize wxTreeCtrl::DoGetBestSize() const
|
||||
{
|
||||
wxSize size;
|
||||
wxRect rect;
|
||||
for ( wxTreeItemId node = GetFirstVisibleItem();
|
||||
node.IsOk();
|
||||
node = GetNextVisible(node) )
|
||||
{
|
||||
if ( GetBoundingRect(node, rect) )
|
||||
{
|
||||
if ( size.x < rect.x + rect.width )
|
||||
size.x = rect.x + rect.width;
|
||||
if ( size.y < rect.y + rect.height )
|
||||
size.y = rect.y + rect.height;
|
||||
}
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// sorting stuff
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user