]> git.saurik.com Git - wxWidgets.git/blob - src/gtk/dcmemory.cpp
GTK wxBitmapButton added
[wxWidgets.git] / src / gtk / dcmemory.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dcmemory.cpp
3 // Purpose:
4 // Author: Robert Roebling
5 // Created: 01/02/97
6 // Id:
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifdef __GNUG__
12 #pragma implementation "dcmemory.h"
13 #endif
14
15 #include "wx/dcmemory.h"
16
17 //-----------------------------------------------------------------------------
18 // wxMemoryDC
19 //-----------------------------------------------------------------------------
20
21 IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC)
22
23 wxMemoryDC::wxMemoryDC(void)
24 {
25 m_ok = FALSE;
26 m_cmap = gdk_colormap_get_system();
27 };
28
29 wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
30 {
31 m_ok = FALSE;
32 m_cmap = gdk_colormap_get_system();
33 };
34
35 wxMemoryDC::~wxMemoryDC(void)
36 {
37 };
38
39 void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
40 {
41 m_selected = bitmap;
42 if (m_selected.Ok())
43 {
44 m_window = m_selected.GetPixmap();
45 SetUpDC();
46 }
47 else
48 {
49 m_ok = FALSE;
50 m_window = NULL;
51 };
52 };
53
54 void wxMemoryDC::GetSize( int *width, int *height )
55 {
56 if (m_selected.Ok())
57 {
58 if (width) (*width) = m_selected.GetWidth();
59 if (height) (*height) = m_selected.GetHeight();
60 }
61 else
62 {
63 if (width) (*width) = 0;
64 if (height) (*height) = 0;
65 };
66 };
67
68