]>
Commit | Line | Data |
---|---|---|
7c78e7c7 RR |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: bmpbuttn.cpp | |
01b2eeec KB |
3 | // Purpose: wxBitmapButton |
4 | // Author: AUTHOR | |
5 | // Modified by: | |
6 | // Created: ??/??/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) AUTHOR | |
7c78e7c7 RR |
9 | // Licence: wxWindows licence |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifdef __GNUG__ | |
13 | #pragma implementation "bmpbuttn.h" | |
14 | #endif | |
15 | ||
16 | #include "wx/bmpbuttn.h" | |
17 | ||
01b2eeec KB |
18 | #if !USE_SHARED_LIBRARY |
19 | IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton) | |
20 | #endif | |
7c78e7c7 | 21 | |
01b2eeec KB |
22 | bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, |
23 | const wxPoint& pos, | |
24 | const wxSize& size, long style, | |
25 | const wxValidator& validator, | |
26 | const wxString& name) | |
27 | { | |
28 | m_buttonBitmap = bitmap; | |
29 | SetName(name); | |
30 | SetValidator(validator); | |
31 | parent->AddChild(this); | |
7c78e7c7 | 32 | |
01b2eeec KB |
33 | m_backgroundColour = parent->GetDefaultBackgroundColour() ; |
34 | m_foregroundColour = parent->GetDefaultForegroundColour() ; | |
35 | m_windowStyle = style; | |
36 | m_marginX = 0; | |
37 | m_marginY = 0; | |
7c78e7c7 | 38 | |
01b2eeec KB |
39 | int x = pos.x; |
40 | int y = pos.y; | |
41 | int width = size.x; | |
42 | int height = size.y; | |
7c78e7c7 | 43 | |
01b2eeec KB |
44 | if (id == -1) |
45 | m_windowId = NewControlId(); | |
46 | else | |
47 | m_windowId = id; | |
7c78e7c7 | 48 | |
01b2eeec KB |
49 | if ( width == -1 && bitmap.Ok()) |
50 | width = bitmap.GetWidth() + 2*m_marginX; | |
7c78e7c7 | 51 | |
01b2eeec KB |
52 | if ( height == -1 && bitmap.Ok()) |
53 | height = bitmap.GetHeight() + 2*m_marginY; | |
7c78e7c7 | 54 | |
01b2eeec KB |
55 | /* TODO: create bitmap button |
56 | */ | |
7c78e7c7 | 57 | |
01b2eeec KB |
58 | return FALSE; |
59 | } | |
7c78e7c7 | 60 | |
01b2eeec | 61 | void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap) |
7c78e7c7 | 62 | { |
01b2eeec KB |
63 | m_buttonBitmap = bitmap; |
64 | } | |
7c78e7c7 | 65 |