1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-20 00:14:35 +00:00
|
|
|
// Name: wx/msw/dcclient.h
|
1998-05-20 14:12:05 +00:00
|
|
|
// Purpose: wxClientDC class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
2003-03-17 10:34:04 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_DCCLIENT_H_
|
|
|
|
#define _WX_DCCLIENT_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-06-09 11:32:32 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
#include "wx/dc.h"
|
2007-11-30 13:48:22 +00:00
|
|
|
#include "wx/msw/dc.h"
|
|
|
|
#include "wx/dcclient.h"
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2012-11-10 00:52:54 +00:00
|
|
|
class wxPaintDCInfo;
|
1999-06-09 11:32:32 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// DC classes
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxMSWDCImpl
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
1999-06-09 11:32:32 +00:00
|
|
|
public:
|
2001-04-09 01:22:48 +00:00
|
|
|
// default ctor
|
2007-11-30 13:48:22 +00:00
|
|
|
wxWindowDCImpl( wxDC *owner );
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-06-09 11:32:32 +00:00
|
|
|
// Create a DC corresponding to the whole window
|
2007-11-30 13:48:22 +00:00
|
|
|
wxWindowDCImpl( wxDC *owner, wxWindow *win );
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2016-09-23 14:59:11 +00:00
|
|
|
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
|
2007-12-06 16:22:00 +00:00
|
|
|
|
2001-04-09 01:22:48 +00:00
|
|
|
protected:
|
2005-05-31 09:20:43 +00:00
|
|
|
// initialize the newly created DC
|
2001-04-09 01:22:48 +00:00
|
|
|
void InitDC();
|
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_CLASS(wxWindowDCImpl);
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl);
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
1999-06-09 11:32:32 +00:00
|
|
|
public:
|
2001-04-09 01:22:48 +00:00
|
|
|
// default ctor
|
2007-11-30 13:48:22 +00:00
|
|
|
wxClientDCImpl( wxDC *owner );
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-06-09 11:32:32 +00:00
|
|
|
// Create a DC corresponding to the client area of the window
|
2007-11-30 13:48:22 +00:00
|
|
|
wxClientDCImpl( wxDC *owner, wxWindow *win );
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
virtual ~wxClientDCImpl();
|
2001-06-26 20:59:19 +00:00
|
|
|
|
2016-09-23 14:59:11 +00:00
|
|
|
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
|
2007-12-06 16:22:00 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
protected:
|
|
|
|
void InitDC();
|
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_CLASS(wxClientDCImpl);
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxClientDCImpl);
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
1999-06-09 11:32:32 +00:00
|
|
|
public:
|
2007-11-30 13:48:22 +00:00
|
|
|
wxPaintDCImpl( wxDC *owner );
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-06-09 11:32:32 +00:00
|
|
|
// Create a DC corresponding for painting the window in OnPaint()
|
2007-11-30 13:48:22 +00:00
|
|
|
wxPaintDCImpl( wxDC *owner, wxWindow *win );
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
virtual ~wxPaintDCImpl();
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2000-08-03 16:11:51 +00:00
|
|
|
// find the entry for this DC in the cache (keyed by the window)
|
|
|
|
static WXHDC FindDCInCache(wxWindow* win);
|
|
|
|
|
2012-11-10 00:52:54 +00: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 14:12:05 +00:00
|
|
|
|
2012-11-10 00:52:54 +00:00
|
|
|
protected:
|
|
|
|
// Find the DC for this window in the cache, return NULL if not found.
|
|
|
|
static wxPaintDCInfo *FindInCache(wxWindow* win);
|
2001-04-09 01:22:48 +00:00
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_CLASS(wxPaintDCImpl);
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
2003-07-29 14:27:18 +00: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 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxPaintDCEx : public wxPaintDC
|
2003-07-29 14:27:18 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPaintDCEx(wxWindow *canvas, WXHDC dc);
|
2009-08-21 10:41:26 +00:00
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_CLASS(wxPaintDCEx);
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPaintDCEx);
|
2003-07-29 14:27:18 +00:00
|
|
|
};
|
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
1998-08-07 23:52:45 +00:00
|
|
|
// _WX_DCCLIENT_H_
|