]> git.saurik.com Git - wxWidgets.git/blame - include/wx/univ/bmpbuttn.h
Applied patch [ 827399 ] sqltypes.h included without windows.h under Borland
[wxWidgets.git] / include / wx / univ / bmpbuttn.h
CommitLineData
1e6feb95
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/univ/bmpbuttn.h
3// Purpose: wxBitmapButton class for wxUniversal
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 25.08.00
7// RCS-ID: $Id$
8// Copyright: (c) Vadim Zeitlin
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_UNIV_BMPBUTTN_H_
13#define _WX_UNIV_BMPBUTTN_H_
14
12028905 15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
a3870b2f 16 #pragma interface "univbmpbuttn.h"
1e6feb95
VZ
17#endif
18
19class WXDLLEXPORT wxBitmapButton : public wxBitmapButtonBase
20{
21public:
1169a919 22 wxBitmapButton();
1e6feb95
VZ
23
24 wxBitmapButton(wxWindow *parent,
25 wxWindowID id,
26 const wxBitmap& bitmap,
27 const wxPoint& pos = wxDefaultPosition,
28 const wxSize& size = wxDefaultSize,
29 long style = 0,
30 const wxValidator& validator = wxDefaultValidator,
1169a919 31 const wxString& name = wxButtonNameStr);
1e6feb95
VZ
32
33 bool Create(wxWindow *parent,
34 wxWindowID id,
35 const wxBitmap& bitmap,
36 const wxPoint& pos = wxDefaultPosition,
37 const wxSize& size = wxDefaultSize,
38 long style = 0,
39 const wxValidator& validator = wxDefaultValidator,
40 const wxString& name = wxButtonNameStr);
41
42 virtual void SetMargins(int x, int y)
43 {
44 SetImageMargins(x, y);
45
46 wxBitmapButtonBase::SetMargins(x, y);
47 }
48
49 virtual bool Enable(bool enable = TRUE);
50
51 virtual bool SetCurrent(bool doit = TRUE);
52
53 virtual void Press();
54 virtual void Release();
55
56protected:
57 void OnSetFocus(wxFocusEvent& event);
58 void OnKillFocus(wxFocusEvent& event);
59
60 // called when one of the bitmap is changed by user
61 virtual void OnSetBitmap();
62
63 // set bitmap to the given one if it's ok or to m_bmpNormal and return
64 // TRUE if the bitmap really changed
65 bool ChangeBitmap(const wxBitmap& bmp);
66
67private:
68 DECLARE_EVENT_TABLE()
69 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
70};
71
72#endif // _WX_UNIV_BMPBUTTN_H_
73