]> git.saurik.com Git - wxWidgets.git/blame - src/motif/dcmemory.cpp
Dialog unit mods; wxProp tidying
[wxWidgets.git] / src / motif / dcmemory.cpp
CommitLineData
4bb6408c
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: dcmemory.cpp
3// Purpose: wxMemoryDC class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "dcmemory.h"
14#endif
15
16#include "wx/dcmemory.h"
17
18//-----------------------------------------------------------------------------
19// wxMemoryDC
20//-----------------------------------------------------------------------------
21
16c1f7f3 22IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxWindowDC)
4bb6408c
JS
23
24wxMemoryDC::wxMemoryDC(void)
25{
26 m_ok = FALSE;
27};
28
29wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
30{
31 m_ok = FALSE;
32};
33
34wxMemoryDC::~wxMemoryDC(void)
35{
36};
37
38void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
39{
16c1f7f3
JS
40 m_bitmap = bitmap;
41 if (m_bitmap.Ok())
4bb6408c 42 {
16c1f7f3 43 m_pixmap = m_bitmap.GetPixmap();
4bb6408c
JS
44 }
45 else
46 {
47 m_ok = FALSE;
48 };
49};
50
51void wxMemoryDC::GetSize( int *width, int *height ) const
52{
16c1f7f3 53 if (m_bitmap.Ok())
4bb6408c 54 {
16c1f7f3
JS
55 if (width) (*width) = m_bitmap.GetWidth();
56 if (height) (*height) = m_bitmap.GetHeight();
4bb6408c
JS
57 }
58 else
59 {
60 if (width) (*width) = 0;
61 if (height) (*height) = 0;
62 };
63};
64
65