X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f60d0f944a6ce86bce59901e7ea3811f0992bce7..20e85460c40ebc4dcc9577928771adb264cc998f:/src/msw/dc.cpp diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index d14d10afb1..970a074492 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -26,6 +26,8 @@ #include "wx/utils.h" #include "wx/dialog.h" #include "wx/app.h" +#include "wx/bitmap.h" +#include "wx/dcmemory.h" #endif #include "wx/dcprint.h" @@ -90,7 +92,7 @@ wxDC::wxDC(void) m_signY = 1; m_systemScaleX = 1.0; m_systemScaleY = 1.0; - m_mappingMode = MM_TEXT; + m_mappingMode = wxMM_TEXT; m_bOwnsDC = FALSE; m_hDC = 0; m_clipping = FALSE; @@ -253,7 +255,7 @@ void wxDC::SetPalette(const wxPalette& palette) m_oldPalette = 0; } - m_palette = m_palette; + m_palette = palette; if (!m_palette.Ok()) { @@ -378,7 +380,7 @@ void wxDC::DrawArc(long x1,long y1,long x2,long y2, long xc, long yc) double radius = (double)sqrt(dx*dx+dy*dy) ;; if (x1==x2 && x2==y2) { - DrawEllipse(xc,yc,(double)(radius*2.0),(double)(radius*2)) ; + DrawEllipse(xc,yc,(long)(radius*2.0),(long)(radius*2.0)) ; return ; } @@ -603,7 +605,7 @@ void wxDC::DrawEllipticArc(long x,long y,long w,long h,double sa,double ea) void wxDC::DrawIcon(const wxIcon& icon, long x, long y) { -#if defined(__WIN32__) +#if defined(__WIN32__) && !defined(__SC__) && !defined(__TWIN32__) ::DrawIconEx((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), (HICON) icon.GetHICON(), icon.GetWidth(), icon.GetHeight(), 0, 0, DI_NORMAL); #else @@ -675,7 +677,7 @@ void wxDC::SetFont(const wxFont& the_font) if (m_font.Ok() && m_font.GetResourceHandle()) { HFONT f = (HFONT) ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle()); - if (f == NULL) + if (f == (HFONT) NULL) { wxDebugMsg("::SelectObject failed in wxDC::SetFont."); } @@ -806,7 +808,14 @@ void wxDC::SetBackground(const wxBrush& brush) } else { - m_canvas->SetBackgroundColour(m_backgroundBrush.GetColour()); + // New behaviour, 10/2/99: setting the background brush of a DC + // doesn't affect the window background colour. However, + // I'm leaving in the transparency setting because it's needed by + // various controls (e.g. wxStaticText) to determine whether to draw + // transparently or not. TODO: maybe this should be a new function + // wxWindow::SetTransparency(). Should that apply to the child itself, or the + // parent? +// m_canvas->SetBackgroundColour(m_backgroundBrush.GetColour()); m_canvas->m_backgroundTransparent = FALSE; } } @@ -892,10 +901,14 @@ bool wxDC::StartDoc(const wxString& message) #else #ifdef UNICODE ::StartDocW((HDC) m_hDC, &docinfo); +#else +#ifdef __TWIN32__ + ::StartDoc((HDC) m_hDC, &docinfo); #else ::StartDocA((HDC) m_hDC, &docinfo); #endif #endif +#endif #ifndef __WIN16__ if (ret <= 0) @@ -992,32 +1005,32 @@ void wxDC::SetMapMode(int mode) switch (mode) { - case MM_TWIPS: + case wxMM_TWIPS: { m_logicalScaleX = (twips2mm * mm2pixelsX); m_logicalScaleY = (twips2mm * mm2pixelsY); break; } - case MM_POINTS: + case wxMM_POINTS: { m_logicalScaleX = (pt2mm * mm2pixelsX); m_logicalScaleY = (pt2mm * mm2pixelsY); break; } - case MM_METRIC: + case wxMM_METRIC: { m_logicalScaleX = mm2pixelsX; m_logicalScaleY = mm2pixelsY; break; } - case MM_LOMETRIC: + case wxMM_LOMETRIC: { m_logicalScaleX = (mm2pixelsX/10.0); m_logicalScaleY = (mm2pixelsY/10.0); break; } default: - case MM_TEXT: + case wxMM_TEXT: { m_logicalScaleX = 1.0; m_logicalScaleY = 1.0; @@ -1678,7 +1691,7 @@ static bool wx_spline_add_point(double x, double y) static void wx_spline_draw_point_array(wxDC *dc) { - dc->DrawLines(&wx_spline_point_list, (double)0.0, (double)0.0); + dc->DrawLines(&wx_spline_point_list, 0, 0); wxNode *node = wx_spline_point_list.First(); while (node) {