1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dcclient.h
|
|
|
|
// Purpose: wxClientDC class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
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"
|
1999-06-09 18:09:47 +00:00
|
|
|
#include "wx/dynarray.h"
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-06-09 11:32:32 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// array types
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// this one if used by wxPaintDC only
|
|
|
|
struct WXDLLEXPORT wxPaintDCInfo;
|
1999-06-10 23:00:03 +00:00
|
|
|
|
1999-10-12 23:57:40 +00:00
|
|
|
WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
|
1999-06-09 11:32:32 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// DC classes
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxWindowDC : public wxDC
|
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
|
1999-06-09 11:32:32 +00:00
|
|
|
wxWindowDC();
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-06-09 11:32:32 +00:00
|
|
|
// Create a DC corresponding to the whole window
|
|
|
|
wxWindowDC(wxWindow *win);
|
1998-05-20 14:12:05 +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();
|
|
|
|
|
2002-02-23 21:32:45 +00:00
|
|
|
// override some base class virtuals
|
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
|
|
|
|
2001-04-09 01:22:48 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowDC)
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
1999-06-09 11:32:32 +00:00
|
|
|
class WXDLLEXPORT wxClientDC : public wxWindowDC
|
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
|
1999-06-09 11:32:32 +00:00
|
|
|
wxClientDC();
|
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
|
|
|
|
wxClientDC(wxWindow *win);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
virtual ~wxClientDC();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void InitDC();
|
|
|
|
|
2002-02-23 21:32:45 +00:00
|
|
|
// override some base class virtuals
|
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
|
|
|
|
2001-04-09 01:22:48 +00:00
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxClientDC)
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
class WXDLLEXPORT wxPaintDC : public wxClientDC
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
1999-06-09 11:32:32 +00:00
|
|
|
public:
|
|
|
|
wxPaintDC();
|
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()
|
|
|
|
wxPaintDC(wxWindow *win);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-06-09 11:32:32 +00:00
|
|
|
virtual ~wxPaintDC();
|
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);
|
|
|
|
|
1999-06-09 11:32:32 +00:00
|
|
|
protected:
|
|
|
|
static wxArrayDCInfo ms_cache;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-06-09 11:32:32 +00:00
|
|
|
// find the entry for this DC in the cache (keyed by the window)
|
|
|
|
wxPaintDCInfo *FindInCache(size_t *index = NULL) const;
|
2001-04-09 01:22:48 +00:00
|
|
|
|
|
|
|
private:
|
2003-07-22 00:24:07 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxPaintDC)
|
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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxPaintDCEx : public wxPaintDC
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPaintDCEx(wxWindow *canvas, WXHDC dc);
|
|
|
|
virtual ~wxPaintDCEx();
|
|
|
|
private:
|
|
|
|
int saveState;
|
|
|
|
|
|
|
|
DECLARE_CLASS(wxPaintDCEx)
|
|
|
|
DECLARE_NO_COPY_CLASS(wxPaintDCEx)
|
|
|
|
};
|
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
1998-08-07 23:52:45 +00:00
|
|
|
// _WX_DCCLIENT_H_
|