]> git.saurik.com Git - wxWidgets.git/blame - src/qt/bmpbuttn.cpp
Commited updated list of files to compile.
[wxWidgets.git] / src / qt / bmpbuttn.cpp
CommitLineData
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 18IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
7c78e7c7 19
01b2eeec
KB
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);
7c78e7c7 30
01b2eeec
KB
31 m_backgroundColour = parent->GetDefaultBackgroundColour() ;
32 m_foregroundColour = parent->GetDefaultForegroundColour() ;
33 m_windowStyle = style;
34 m_marginX = 0;
35 m_marginY = 0;
7c78e7c7 36
01b2eeec
KB
37 int x = pos.x;
38 int y = pos.y;
39 int width = size.x;
40 int height = size.y;
7c78e7c7 41
01b2eeec
KB
42 if (id == -1)
43 m_windowId = NewControlId();
44 else
45 m_windowId = id;
7c78e7c7 46
01b2eeec
KB
47 if ( width == -1 && bitmap.Ok())
48 width = bitmap.GetWidth() + 2*m_marginX;
7c78e7c7 49
01b2eeec
KB
50 if ( height == -1 && bitmap.Ok())
51 height = bitmap.GetHeight() + 2*m_marginY;
7c78e7c7 52
01b2eeec
KB
53 /* TODO: create bitmap button
54 */
7c78e7c7 55
01b2eeec
KB
56 return FALSE;
57}
7c78e7c7 58
01b2eeec 59void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
7c78e7c7 60{
01b2eeec
KB
61 m_buttonBitmap = bitmap;
62}
7c78e7c7 63