This function can be used to check if drawing on wxClientDC actually works. This has to be a run-time, rather than compile-time, check because in wxGTK3 this depends on the backend being used: wxClientDC only doesn't work with Wayland, but does work with X11 (and, less importantly, Win32) backend(s). Currently the wxWindow parameter of this function is not used but it could be useful in the future and it will be simpler to allow not specifying it (by defaulting it to nullptr) than to add it later, so it seems better to have it.
64 lines
1.6 KiB
C++
64 lines
1.6 KiB
C++
/////////////////////////////////////////////////////////////////////////////
|
|
// Name: wx/dcclient.h
|
|
// Purpose: wxClientDC base header
|
|
// Author: Julian Smart
|
|
// Copyright: (c) Julian Smart
|
|
// Licence: wxWindows Licence
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _WX_DCCLIENT_H_BASE_
|
|
#define _WX_DCCLIENT_H_BASE_
|
|
|
|
#include "wx/dc.h"
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// wxWindowDC
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class WXDLLIMPEXP_CORE wxWindowDC : public wxDC
|
|
{
|
|
public:
|
|
wxWindowDC(wxWindow *win);
|
|
|
|
protected:
|
|
wxWindowDC(wxDCImpl *impl) : wxDC(impl) { }
|
|
|
|
private:
|
|
wxDECLARE_ABSTRACT_CLASS(wxWindowDC);
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// wxClientDC
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class WXDLLIMPEXP_CORE wxClientDC : public wxWindowDC
|
|
{
|
|
public:
|
|
wxClientDC(wxWindow *win);
|
|
|
|
static bool CanBeUsedForDrawing(const wxWindow* window);
|
|
|
|
protected:
|
|
wxClientDC(wxDCImpl *impl) : wxWindowDC(impl) { }
|
|
|
|
private:
|
|
wxDECLARE_ABSTRACT_CLASS(wxClientDC);
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// wxPaintDC
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class WXDLLIMPEXP_CORE wxPaintDC : public wxClientDC
|
|
{
|
|
public:
|
|
wxPaintDC(wxWindow *win);
|
|
|
|
protected:
|
|
wxPaintDC(wxDCImpl *impl) : wxClientDC(impl) { }
|
|
|
|
private:
|
|
wxDECLARE_ABSTRACT_CLASS(wxPaintDC);
|
|
};
|
|
|
|
#endif // _WX_DCCLIENT_H_BASE_
|