Fix link errors with older MinGW due to use of GetLayout()

This function is not present in older MinGW import libraries, up to at least
MinGW 4.8.1, so we can't use it directly as it was done in
22f0801378 and we need to load it dynamically.

This was already done in wxDC code, so just reuse the same wrapper function
after extracting it (and a few others, for consistency) into a new header.
This commit is contained in:
Vadim Zeitlin
2016-05-26 23:34:58 +02:00
parent 5e500de7e8
commit 78bfde8ac0
3 changed files with 41 additions and 12 deletions

View File

@@ -47,6 +47,7 @@
#include "wx/renderer.h"
#include "wx/msw/private.h"
#include "wx/msw/dc.h"
#include "wx/msw/private/dcdynwrap.h"
// ----------------------------------------------------------------------------
// private functions
@@ -159,7 +160,7 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc,
UINT uState = stat & wxOwnerDrawn::wxODSelected ? wxDSB_SELECTED : wxDSB_NORMAL;
// checkmarks should not be mirrored in RTL layout
DWORD oldLayout = ::GetLayout(hdc);
DWORD oldLayout = wxDynLoadWrappers::GetLayout(hdc);
if ( oldLayout & LAYOUT_RTL )
::SetLayout(hdc, oldLayout | LAYOUT_BITMAPORIENTATIONPRESERVED);
wxDrawStateBitmap(hdc, hBmpCheck, x, y, uState);