1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/msw/dcclient.h
|
1998-05-20 10:12:05 -04:00
|
|
|
// Purpose: wxClientDC class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
2003-03-17 05:34:04 -05:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_DCCLIENT_H_
|
|
|
|
#define _WX_DCCLIENT_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
#include "wx/dc.h"
|
2007-11-30 08:48:22 -05:00
|
|
|
#include "wx/msw/dc.h"
|
|
|
|
#include "wx/dcclient.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2012-11-09 19:52:54 -05:00
|
|
|
class wxPaintDCInfo;
|
1999-06-09 07:32:32 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// DC classes
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxMSWDCImpl
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-06-09 07:32:32 -04:00
|
|
|
public:
|
2001-04-08 21:22:48 -04:00
|
|
|
// default ctor
|
2007-11-30 08:48:22 -05:00
|
|
|
wxWindowDCImpl( wxDC *owner );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
// Create a DC corresponding to the whole window
|
2007-11-30 08:48:22 -05:00
|
|
|
wxWindowDCImpl( wxDC *owner, wxWindow *win );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2007-12-06 11:22:00 -05:00
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
|
|
|
|
2001-04-08 21:22:48 -04:00
|
|
|
protected:
|
2005-05-31 05:20:43 -04:00
|
|
|
// initialize the newly created DC
|
2001-04-08 21:22:48 -04:00
|
|
|
void InitDC();
|
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
DECLARE_CLASS(wxWindowDCImpl)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl);
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-06-09 07:32:32 -04:00
|
|
|
public:
|
2001-04-08 21:22:48 -04:00
|
|
|
// default ctor
|
2007-11-30 08:48:22 -05:00
|
|
|
wxClientDCImpl( wxDC *owner );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
// Create a DC corresponding to the client area of the window
|
2007-11-30 08:48:22 -05:00
|
|
|
wxClientDCImpl( wxDC *owner, wxWindow *win );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
virtual ~wxClientDCImpl();
|
2001-06-26 16:59:19 -04:00
|
|
|
|
2007-12-06 11:22:00 -05:00
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
protected:
|
|
|
|
void InitDC();
|
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
DECLARE_CLASS(wxClientDCImpl)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxClientDCImpl);
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-06-09 07:32:32 -04:00
|
|
|
public:
|
2007-11-30 08:48:22 -05:00
|
|
|
wxPaintDCImpl( wxDC *owner );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
// Create a DC corresponding for painting the window in OnPaint()
|
2007-11-30 08:48:22 -05:00
|
|
|
wxPaintDCImpl( wxDC *owner, wxWindow *win );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
virtual ~wxPaintDCImpl();
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2000-08-03 12:11:51 -04:00
|
|
|
// find the entry for this DC in the cache (keyed by the window)
|
|
|
|
static WXHDC FindDCInCache(wxWindow* win);
|
|
|
|
|
2012-11-09 19:52:54 -05:00
|
|
|
// This must be called by the code handling WM_PAINT to remove the DC
|
|
|
|
// cached for this window for the duration of this message processing.
|
|
|
|
static void EndPaint(wxWindow *win);
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2012-11-09 19:52:54 -05:00
|
|
|
protected:
|
|
|
|
// Find the DC for this window in the cache, return NULL if not found.
|
|
|
|
static wxPaintDCInfo *FindInCache(wxWindow* win);
|
2001-04-08 21:22:48 -04:00
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
DECLARE_CLASS(wxPaintDCImpl)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
2003-07-29 10:27:18 -04:00
|
|
|
/*
|
|
|
|
* wxPaintDCEx
|
|
|
|
* This class is used when an application sends an HDC with the WM_PAINT
|
|
|
|
* message. It is used in HandlePaint and need not be used by an application.
|
|
|
|
*/
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPaintDCEx : public wxPaintDC
|
2003-07-29 10:27:18 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPaintDCEx(wxWindow *canvas, WXHDC dc);
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2003-07-29 10:27:18 -04:00
|
|
|
DECLARE_CLASS(wxPaintDCEx)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPaintDCEx);
|
2003-07-29 10:27:18 -04:00
|
|
|
};
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_DCCLIENT_H_
|