]> git.saurik.com Git - wxWidgets.git/blob - src/qt/bmpbuttn.cpp
Added wxDC:DrawPolygone
[wxWidgets.git] / src / qt / bmpbuttn.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: bmpbuttn.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 "bmpbuttn.h"
13 #endif
14
15 #include "wx/bmpbuttn.h"
16
17 //-----------------------------------------------------------------------------
18 // classes
19 //-----------------------------------------------------------------------------
20
21 class wxBitmapButton;
22
23 //-----------------------------------------------------------------------------
24 // wxBitmapButton
25 //-----------------------------------------------------------------------------
26
27 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl)
28
29 wxBitmapButton::wxBitmapButton(void)
30 {
31 };
32
33 wxBitmapButton::wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
34 const wxPoint &pos, const wxSize &size,
35 long style, const wxString &name )
36 {
37 Create( parent, id, bitmap, pos, size, style, name );
38 };
39
40 bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
41 const wxPoint &pos, const wxSize &size,
42 long style, const wxString &name )
43 {
44 m_needParent = TRUE;
45
46 wxSize newSize = size;
47
48 PreCreation( parent, id, pos, newSize, style, name );
49
50 m_bitmap = bitmap;
51 m_label = "";
52
53
54 if (newSize.x == -1) newSize.x = m_bitmap.GetHeight()+10;
55 if (newSize.y == -1) newSize.y = m_bitmap.GetWidth()+10;
56 SetSize( newSize.x, newSize.y );
57
58
59 PostCreation();
60
61 Show( TRUE );
62
63 return TRUE;
64 };
65
66 void wxBitmapButton::SetDefault(void)
67 {
68 };
69
70 void wxBitmapButton::SetLabel( const wxString &label )
71 {
72 wxControl::SetLabel( label );
73 };
74
75 wxString wxBitmapButton::GetLabel(void) const
76 {
77 return wxControl::GetLabel();
78 };