#include "wx/msw/wrapcdlg.h"
#include "wx/image.h"
#include "wx/window.h"
- #include "wx/dc.h"
#include "wx/utils.h"
#include "wx/dialog.h"
#include "wx/app.h"
#include "wx/module.h"
#endif
+#include "wx/msw/dc.h"
#include "wx/sysopt.h"
#include "wx/dynlib.h"
static const int VIEWPORT_EXTENT = 1000;
-static const int MM_POINTS = 9;
-static const int MM_METRIC = 10;
-
// ROPs which don't have standard names (see "Ternary Raster Operations" in the
// MSDN docs for how this and other numbers in wxDC::Blit() are obtained)
#define DSTCOPY 0x00AA0029 // a.k.a. NOP operation
wxColourChanger::wxColourChanger(wxMSWDCImpl& dc) : m_dc(dc)
{
const wxBrush& brush = dc.GetBrush();
- if ( brush.IsOk() && brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE )
+ if ( brush.IsOk() && brush.GetStyle() == wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE )
{
HDC hdc = GetHdcOf(dc);
m_colFgOld = ::GetTextColor(hdc);
}
SetBkMode(hdc,
- dc.GetBackgroundMode() == wxTRANSPARENT ? TRANSPARENT
- : OPAQUE);
+ dc.GetBackgroundMode() == wxBRUSHSTYLE_TRANSPARENT
+ ? TRANSPARENT : OPAQUE);
// flag which telsl us to undo changes in the dtor
m_changed = true;
wxCoord xxx2 = (wxCoord) (xxc+ray);
wxCoord yyy2 = (wxCoord) (yyc+ray);
- if ( m_brush.IsOk() && m_brush.GetStyle() != wxTRANSPARENT )
+ if ( m_brush.IsOk() && m_brush.GetStyle() != wxBRUSHSTYLE_TRANSPARENT )
{
// Have to add 1 to bottom-right corner of rectangle
// to make semi-circles look right (crooked line otherwise).
rect.bottom = y2;
#ifdef __WXWINCE__
- DrawFrameControl(GetHdc(), &rect, DFC_BUTTON, DFCS_BUTTONCHECK);
+ DrawFrameControl(GetHdc(), &rect, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED);
#else
DrawFrameControl(GetHdc(), &rect, DFC_MENU, DFCS_MENUCHECK);
#endif
int fillStyle)
{
#ifdef __WXWINCE__
- wxDCBase::DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle);
+ wxDCImpl::DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle);
#else
WXMICROWIN_CHECK_HDC
// (i.e. drawn with a transparent pen) one pixel smaller in both directions
// and we want them to have the same size regardless of which pen is used
#ifndef __WXWINCE__
- if ( m_pen.GetStyle() == wxTRANSPARENT )
+ if ( m_pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
{
x2dev++;
y2dev++;
// Windows draws the filled rectangles without outline (i.e. drawn with a
// transparent pen) one pixel smaller in both directions and we want them
// to have the same size regardless of which pen is used - adjust
- if ( m_pen.GetStyle() == wxTRANSPARENT )
+ if ( m_pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
{
x2++;
y2++;
{
#ifdef __WXWINCE__
// WinCE does not support ::PolyBezier so use generic version
- wxDCBase::DoDrawSpline(points);
+ wxDCImpl::DoDrawSpline(points);
#else
// quadratic b-spline to cubic bezier spline conversion
//
// Swap start and end positions if the end angle is less than the start angle.
if (ea < sa) {
- int temp;
- temp = rx2;
- rx2 = rx1;
- rx1 = temp;
- temp = ry2;
- ry2 = ry1;
- ry1 = temp;
+ int temp;
+ temp = rx2;
+ rx2 = rx1;
+ rx1 = temp;
+ temp = ry2;
+ ry2 = ry1;
+ ry1 = temp;
}
// draw pie with NULL_PEN first and then outline otherwise a line is
old_background = SetBkColor(GetHdc(), m_textBackgroundColour.GetPixel() );
}
- SetBkMode(GetHdc(), m_backgroundMode == wxTRANSPARENT ? TRANSPARENT
+ SetBkMode(GetHdc(), m_backgroundMode == wxBRUSHSTYLE_TRANSPARENT ? TRANSPARENT
: OPAQUE);
#ifdef __WXWINCE__
::SetViewportOrgEx(GetHdc(), m_deviceOriginX, m_deviceOriginY, NULL);
::SetWindowOrgEx(GetHdc(), m_logicalOriginX, m_logicalOriginY, NULL);
#endif
-
}
void wxMSWDCImpl::SetMapMode(int mode)
WXMICROWIN_CHECK_HDC_RET(false)
- wxDCImpl *impl = source->GetImpl();
- wxMSWDCImpl *msw_impl = wxDynamicCast( impl, wxMSWDCImpl );
- if (!msw_impl)
+ wxMSWDCImpl *implSrc = wxDynamicCast( source->GetImpl(), wxMSWDCImpl );
+ if ( !implSrc )
{
- // TODO: Do we want to be able to blit
- // from other DCs too?
+ // TODO: Do we want to be able to blit from other DCs too?
return false;
}
+ const HDC hdcSrc = GetHdcOf(*implSrc);
+
// if either the source or destination has alpha channel, we must use
// AlphaBlt() as other function don't handle it correctly
- const wxBitmap& bmpSrc = msw_impl->GetSelectedBitmap();
+ const wxBitmap& bmpSrc = implSrc->GetSelectedBitmap();
if ( bmpSrc.IsOk() && (bmpSrc.HasAlpha() ||
(m_selectedBitmap.IsOk() && m_selectedBitmap.HasAlpha())) )
{
if ( AlphaBlt(GetHdc(), xdest, ydest, dstWidth, dstHeight,
- xsrc, ysrc, srcWidth, srcHeight, GetHdcOf(*msw_impl), bmpSrc) )
+ xsrc, ysrc, srcWidth, srcHeight, hdcSrc, bmpSrc) )
return true;
}
(
GetHdc(),
xdest, ydest, dstWidth, dstHeight,
- GetHdcOf(*msw_impl),
+ hdcSrc,
xsrc, ysrc,
(HBITMAP)mask->GetMaskBitmap(),
xsrcMask, ysrcMask,
#if wxUSE_DC_CACHEING
// create a temp buffer bitmap and DCs to access it and the mask
- wxDCCacheEntry* dcCacheEntry1 = FindDCInCache(NULL, msw_impl->GetHDC());
+ wxDCCacheEntry* dcCacheEntry1 = FindDCInCache(NULL, hdcSrc);
dc_mask = (HDC) dcCacheEntry1->m_dc;
wxDCCacheEntry* dcCacheEntry2 = FindDCInCache(dcCacheEntry1, GetHDC());
buffer_bmap = (HBITMAP) bitmapCacheEntry->m_bitmap;
#else // !wxUSE_DC_CACHEING
// create a temp buffer bitmap and DCs to access it and the mask
- dc_mask = ::CreateCompatibleDC(GetHdcOf(*source));
+ dc_mask = ::CreateCompatibleDC(hdcSrc);
dc_buffer = ::CreateCompatibleDC(GetHdc());
buffer_bmap = ::CreateCompatibleBitmap(GetHdc(), dstWidth, dstHeight);
#endif // wxUSE_DC_CACHEING/!wxUSE_DC_CACHEING
// copy src to buffer using selected raster op
if ( !::StretchBlt(dc_buffer, 0, 0, (int)dstWidth, (int)dstHeight,
- GetHdcOf(*msw_impl), xsrc, ysrc, srcWidth, srcHeight, dwRop) )
+ hdcSrc, xsrc, ysrc, srcWidth, srcHeight, dwRop) )
{
wxLogLastError(wxT("StretchBlt"));
}
(
GetHdc(),
xdest, ydest, dstWidth, dstHeight,
- GetHdcOf(*msw_impl),
+ hdcSrc,
xsrc, ysrc, srcWidth, srcHeight,
dwRop
) )
GetHdc(),
xdest, ydest,
(int)dstWidth, (int)dstHeight,
- GetHdcOf(*msw_impl),
+ hdcSrc,
xsrc, ysrc,
dwRop
) )