]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/bmpbuttn.h
replaced wxStream::GetSize() with GetLength() (still keep the former but it will...
[wxWidgets.git] / include / wx / motif / bmpbuttn.h
CommitLineData
9b6dbb09
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: bmpbuttn.h
3// Purpose: wxBitmapButton class
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
65571936 9// Licence: wxWindows licence
9b6dbb09
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_BMPBUTTN_H_
13#define _WX_BMPBUTTN_H_
14
12028905 15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
9b6dbb09
JS
16#pragma interface "bmpbuttn.h"
17#endif
18
aae91497
MB
19#include "wx/motif/bmpmotif.h"
20
9b6dbb09
JS
21#define wxDEFAULT_BUTTON_MARGIN 4
22
ea9868e8 23class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase
9b6dbb09 24{
83df96d6
JS
25 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
26public:
27 wxBitmapButton();
28 ~wxBitmapButton();
ea9868e8 29 wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
83df96d6
JS
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
32 const wxValidator& validator = wxDefaultValidator,
33 const wxString& name = wxButtonNameStr)
34 {
35 Create(parent, id, bitmap, pos, size, style, validator, name);
36 }
37
38 bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
39 const wxPoint& pos = wxDefaultPosition,
40 const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxButtonNameStr);
43
44 virtual void SetLabel(const wxBitmap& bitmap)
45 {
46 SetBitmapLabel(bitmap);
47 }
48 virtual void SetLabel(const wxString& label)
49 {
50 wxControl::SetLabel(label);
51 }
52
53 virtual void SetBitmapLabel(const wxBitmap& bitmap);
54
83df96d6
JS
55 void SetBitmapSelected(const wxBitmap& sel);
56 void SetBitmapFocus(const wxBitmap& focus);
57 void SetBitmapDisabled(const wxBitmap& disabled);
58
83df96d6
JS
59 // Implementation
60 void DoSetBitmap();
61 virtual void ChangeBackgroundColour();
401eb3de 62 virtual wxSize DoGetBestSize() const;
83df96d6
JS
63
64protected:
ea9868e8 65 wxBitmap m_bmpNormalOriginal; // May be different from m_buttonBitmap
83df96d6
JS
66 // if m_buttonBitmap has been changed
67 // to reflect button background colour
ea9868e8
MB
68 wxBitmap m_bmpSelectedOriginal;
69 wxBitmap m_bmpDisabledOriginal;
aae91497
MB
70
71 wxBitmapCache m_bitmapCache;
72
83df96d6 73 WXPixmap m_insensPixmap;
9b6dbb09
JS
74};
75
76#endif
83df96d6 77// _WX_BMPBUTTN_H_