]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/dcmemory.h
remove warnings of intentionally unreachable code
[wxWidgets.git] / include / wx / gtk / dcmemory.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: dcmemory.h
3// Purpose:
4// Author: Robert Roebling
6f65e337 5// RCS-ID: $Id$
dbf858b5 6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
3498362e
PC
10#ifndef _WX_GTK_DCMEMORY_H_
11#define _WX_GTK_DCMEMORY_H_
c801d85f 12
c801d85f
KB
13#include "wx/dcclient.h"
14
c801d85f
KB
15//-----------------------------------------------------------------------------
16// wxMemoryDC
17//-----------------------------------------------------------------------------
18
fea35690 19class WXDLLIMPEXP_CORE wxMemoryDC : public wxWindowDC, public wxMemoryDCBase
c801d85f 20{
ec758a20 21public:
fea35690
VZ
22 wxMemoryDC() : wxWindowDC() { Init(); }
23 wxMemoryDC(wxBitmap& bitmap) : wxWindowDC() { Init(); SelectObject(bitmap); }
20e05ffb 24 wxMemoryDC( wxDC *dc ); // Create compatible DC
d3c7fc99 25 virtual ~wxMemoryDC();
c801d85f 26
41fbc841
RR
27 // these get reimplemented for mono-bitmaps to behave
28 // more like their Win32 couterparts. They now interpret
29 // wxWHITE, wxWHITE_BRUSH and wxWHITE_PEN as drawing 0
30 // and everything else as drawing 1.
31 virtual void SetPen( const wxPen &pen );
32 virtual void SetBrush( const wxBrush &brush );
8ab40c52 33 virtual void SetBackground( const wxBrush &brush );
41fbc841
RR
34 virtual void SetTextForeground( const wxColour &col );
35 virtual void SetTextBackground( const wxColour &col );
36
20e05ffb 37 // implementation
e19a8aea 38 wxBitmap GetSelectedBitmap() const { return m_selected; }
20e05ffb 39 wxBitmap m_selected;
8bbe427f 40
6f02a879
VZ
41protected:
42 void DoGetSize( int *width, int *height ) const;
fea35690 43 virtual void DoSelect(const wxBitmap& bitmap);
e19a8aea
VZ
44 virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
45 {
46 wxBitmap bmp = GetSelectedBitmap();
47 return subrect ? bmp.GetSubBitmap(*subrect) : bmp;
48 }
fea35690
VZ
49
50private:
51 void Init();
6f02a879 52
20e05ffb 53 DECLARE_DYNAMIC_CLASS(wxMemoryDC)
c801d85f
KB
54};
55
3498362e 56#endif // _WX_GTK_DCMEMORY_H_