Implement constrained best size calculation in wxMSW wxListCtrl.
This fixes wxListbook controller size to avoid spurious scrollbars. Closes #13898. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -566,6 +566,7 @@ MSW:
|
|||||||
- Fix coordinate handling in wxDC::Blit() when source DC is a DIB.
|
- Fix coordinate handling in wxDC::Blit() when source DC is a DIB.
|
||||||
- Fix handling of composite windows in wxToolTip (Armel Asselin).
|
- Fix handling of composite windows in wxToolTip (Armel Asselin).
|
||||||
- Add VT_I8 support to wxAutomationObject (PB).
|
- Add VT_I8 support to wxAutomationObject (PB).
|
||||||
|
- Fix wxListbook size calculations to avoid spurious scrollbars.
|
||||||
|
|
||||||
OSX:
|
OSX:
|
||||||
|
|
||||||
|
@@ -384,6 +384,14 @@ protected:
|
|||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
// Implement constrained best size calculation.
|
||||||
|
virtual int DoGetBestClientHeight(int width) const
|
||||||
|
{ return MSWGetBestViewRect(width, -1).y; }
|
||||||
|
virtual int DoGetBestClientWidth(int height) const
|
||||||
|
{ return MSWGetBestViewRect(-1, height).x; }
|
||||||
|
|
||||||
|
wxSize MSWGetBestViewRect(int x, int y) const;
|
||||||
|
|
||||||
// Implement base class pure virtual methods.
|
// Implement base class pure virtual methods.
|
||||||
long DoInsertColumn(long col, const wxListItem& info);
|
long DoInsertColumn(long col, const wxListItem& info);
|
||||||
|
|
||||||
|
@@ -1333,6 +1333,29 @@ void wxListCtrl::AssignImageList(wxImageList *imageList, int which)
|
|||||||
m_ownsImageListState = true;
|
m_ownsImageListState = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Geometry
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
wxSize wxListCtrl::MSWGetBestViewRect(int x, int y) const
|
||||||
|
{
|
||||||
|
const DWORD rc = ListView_ApproximateViewRect(GetHwnd(), x, y, -1);
|
||||||
|
|
||||||
|
wxSize size(LOWORD(rc), HIWORD(rc));
|
||||||
|
|
||||||
|
// We have to add space for the scrollbars ourselves, they're not taken
|
||||||
|
// into account by ListView_ApproximateViewRect(), at least not with
|
||||||
|
// commctrl32.dll v6.
|
||||||
|
const DWORD mswStyle = ::GetWindowLong(GetHwnd(), GWL_STYLE);
|
||||||
|
|
||||||
|
if ( mswStyle & WS_HSCROLL )
|
||||||
|
size.y += wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y);
|
||||||
|
if ( mswStyle & WS_VSCROLL )
|
||||||
|
size.x += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X);
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Operations
|
// Operations
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user