mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-17 17:02:51 +08:00
Do offset wxClientDC and wxPaintDC by client area origin in wxMSW
We didn't use GetClientAreaOrigin() in wxMSW, unlike in all the other ports, meaning that for the frames with a toolbar the origin of wxPaintDC was hidden behind the toolbar itself. Fix this and ensure that the origin is the point just below (or to the right of) the toolbar instead.
This commit is contained in:
@@ -108,6 +108,11 @@ Changes in behaviour not resulting in compilation errors
|
||||
platforms with RTF support. If you need to save/load plain text even for the
|
||||
files with the .rtf extension, specify wxTEXT_TYPE_PLAIN explicitly.
|
||||
|
||||
- wxClientDC and wxPaintDC now correctly offset their origin by wxFrame
|
||||
toolbar, if any. This is consistent with the behaviour of the other ports
|
||||
but may require removing any compensation for not doing this before that may
|
||||
be present in the application code.
|
||||
|
||||
|
||||
Changes in behaviour which may result in build errors
|
||||
-----------------------------------------------------
|
||||
|
||||
@@ -188,9 +188,8 @@ void wxClientDCImpl::InitDC()
|
||||
{
|
||||
wxWindowDCImpl::InitDC();
|
||||
|
||||
// in wxUniv build we must manually do some DC adjustments usually
|
||||
// performed by Windows for us
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
// Account for the origin of the client area which is non-zero only for
|
||||
// TLWs with (left or top) toolbar: we shouldn't draw over the toolbar.
|
||||
wxPoint ptOrigin = m_window->GetClientAreaOrigin();
|
||||
if ( ptOrigin.x || ptOrigin.y )
|
||||
{
|
||||
@@ -198,6 +197,9 @@ void wxClientDCImpl::InitDC()
|
||||
SetDeviceOrigin(ptOrigin.x, ptOrigin.y);
|
||||
}
|
||||
|
||||
// in wxUniv build we must manually do some DC adjustments usually
|
||||
// performed by Windows for us
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
// clip the DC to avoid overwriting the non client area
|
||||
wxSize size = m_window->GetClientSize();
|
||||
DoSetClippingRegion(0, 0, size.x, size.y);
|
||||
|
||||
Reference in New Issue
Block a user