corrected wxTreeCtrl::GetBestSize() for a control with borders
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -97,6 +97,8 @@ All:
|
|||||||
- New option wxFS_READ | wxFS_SEEKABLE for wxFileSystem::OpenFile() to return
|
- New option wxFS_READ | wxFS_SEEKABLE for wxFileSystem::OpenFile() to return
|
||||||
a stream that is seekable.
|
a stream that is seekable.
|
||||||
- Fixed bug in wxCalendarCtrl::HitTest() when clicking on month change arrows
|
- Fixed bug in wxCalendarCtrl::HitTest() when clicking on month change arrows
|
||||||
|
- Added wxWindow::GetWindowBorderSize() and corrected wxTreeCtrl::GetBestSize()
|
||||||
|
for a control with borders (Tim Kosse)
|
||||||
|
|
||||||
wxMSW:
|
wxMSW:
|
||||||
|
|
||||||
|
@@ -345,6 +345,8 @@ protected:
|
|||||||
|
|
||||||
void DoDirtyProcessing();
|
void DoDirtyProcessing();
|
||||||
|
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
DECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl)
|
DECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl)
|
||||||
|
@@ -163,7 +163,12 @@ wxSize wxTreeCtrlBase::DoGetBestSize() const
|
|||||||
if ( !size.x || !size.y )
|
if ( !size.x || !size.y )
|
||||||
size = wxControl::DoGetBestSize();
|
size = wxControl::DoGetBestSize();
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
// Add border size
|
||||||
|
size += GetWindowBorderSize();
|
||||||
|
|
||||||
CacheBestSize(size);
|
CacheBestSize(size);
|
||||||
|
}
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
@@ -3647,4 +3647,14 @@ void wxGenericTreeCtrl::DoDirtyProcessing()
|
|||||||
AdjustMyScrollbars();
|
AdjustMyScrollbars();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxSize wxGenericTreeCtrl::DoGetBestSize() const
|
||||||
|
{
|
||||||
|
wxSize size = wxTreeCtrlBase::DoGetBestSize();
|
||||||
|
|
||||||
|
// The generic control seems to have an implicit border
|
||||||
|
size.IncBy(4, 4);
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // wxUSE_TREECTRL
|
#endif // wxUSE_TREECTRL
|
||||||
|
Reference in New Issue
Block a user