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