#pragma hdrstop
#endif
-#include "wx/frame.h"
-#include "wx/msw/private.h"
-
#ifndef WX_PRECOMP
+ #include "wx/window.h"
#include "wx/dc.h"
#include "wx/utils.h"
#include "wx/dialog.h"
#include "wx/bitmap.h"
#include "wx/dcmemory.h"
#include "wx/log.h"
+ #include "wx/icon.h"
#endif
#include "wx/dcprint.h"
#include <print.h>
#endif
+#include "wx/msw/private.h"
+
#if !USE_SHARED_LIBRARY
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
#endif
void wxDC::Clear()
{
RECT rect;
- if (m_canvas)
+ if ( m_canvas )
+ {
GetClientRect((HWND) m_canvas->GetHWND(), &rect);
- else if (m_selectedBitmap.Ok())
+ }
+ else
{
+ wxCHECK_RET( m_selectedBitmap.Ok(), _T("this DC can't be cleared") );
+
rect.left = 0; rect.top = 0;
rect.right = m_selectedBitmap.GetWidth();
rect.bottom = m_selectedBitmap.GetHeight();
}
+
(void) ::SetMapMode(GetHdc(), MM_TEXT);
DWORD colour = GetBkColor(GetHdc());
long y2 = (y+height);
(void)RoundRect(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2),
- YLOG2DEV(y2), 2*XLOG2DEV(radius), 2*YLOG2DEV(radius));
+ YLOG2DEV(y2), (int) (2*XLOG2DEV(radius)), (int)( 2*YLOG2DEV(radius)));
CalcBoundingBox(x, y);
CalcBoundingBox(x2, y2);
HBITMAP hbitmap = (HBITMAP) bmp.GetHBITMAP( );
::SelectObject( memdc, hbitmap );
::BitBlt( cdc, x, y, bmp.GetWidth(), bmp.GetHeight(), memdc, 0, 0, SRCCOPY);
- ::SelectObject( memdc, 0 );
::DeleteDC( memdc );
}
else
else
SetBkMode(GetHdc(), OPAQUE);
- (void)TextOut(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), (char *) (const char *)text, strlen((const char *)text));
+ (void)TextOut(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), WXSTRINGCAST text, wxStrlen(WXSTRINGCAST text));
if (m_textBackgroundColour.Ok())
(void)SetBkColor(GetHdc(), old_background);
HFONT f = (HFONT) ::SelectObject(GetHdc(), (HFONT) m_font.GetResourceHandle());
if (f == (HFONT) NULL)
{
- wxLogDebug("::SelectObject failed in wxDC::SetFont.");
+ wxLogDebug(_T("::SelectObject failed in wxDC::SetFont."));
}
if (!m_oldFont)
m_oldFont = (WXHFONT) f;
SIZE sizeRect;
TEXTMETRIC tm;
- GetTextExtentPoint(GetHdc(), (char *)(const char *) string, strlen((char *)(const char *) string), &sizeRect);
+ GetTextExtentPoint(GetHdc(), WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect);
GetTextMetrics(GetHdc(), &tm);
if (x) *x = XDEV2LOGREL(sizeRect.cx);