]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/bmpbuttn.h
implement wxBitmapButton as just a wrapper for wxButton under MSW
[wxWidgets.git] / interface / wx / bmpbuttn.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: bmpbuttn.h
3 // Purpose: interface of wxBitmapButton
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxBitmapButton
11
12 A bitmap button is a control that contains a bitmap.
13
14 Notice that since wxWidgets 2.9.1 bitmap display is supported by the base
15 wxButton class itself and the only tiny advantage of using this class is
16 that it allows to specify the bitmap in its constructor, unlike wxButton.
17 Please see the base class documentation for more information about images
18 support in wxButton.
19
20 @beginStyleTable
21 @style{wxBU_AUTODRAW}
22 If this is specified, the button will be drawn automatically using
23 the label bitmap only, providing a 3D-look border. If this style is
24 not specified, the button will be drawn without borders and using
25 all provided bitmaps. Has effect only under MS Windows.
26 @style{wxBU_LEFT}
27 Left-justifies the bitmap label. Has effect only under MS Windows.
28 @style{wxBU_TOP}
29 Aligns the bitmap label to the top of the button.
30 Has effect only under MS Windows.
31 @style{wxBU_RIGHT}
32 Right-justifies the bitmap label. Has effect only under MS Windows.
33 @style{wxBU_BOTTOM}
34 Aligns the bitmap label to the bottom of the button.
35 Has effect only under MS Windows.
36 @endStyleTable
37
38 Note that the wxBU_EXACTFIT style supported by wxButton is not used by this
39 class as bitmap buttons don't have any minimal standard size by default.
40
41 @beginEventEmissionTable{wxCommandEvent}
42 @event{EVT_BUTTON(id, func)}
43 Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.
44 @endEventTable
45
46 @library{wxcore}
47 @category{ctrl}
48 @appearance{bitmapbutton.png}
49
50 @see wxButton
51 */
52 class wxBitmapButton : public wxButton
53 {
54 public:
55 /**
56 Default ctor.
57 */
58 wxBitmapButton();
59
60 /**
61 Constructor, creating and showing a button.
62
63 @param parent
64 Parent window. Must not be @NULL.
65 @param id
66 Button identifier. The value wxID_ANY indicates a default value.
67 @param bitmap
68 Bitmap to be displayed.
69 @param pos
70 Button position.
71 If ::wxDefaultPosition is specified then a default position is chosen.
72 @param size
73 Button size.
74 If ::wxDefaultSize is specified then the button is sized appropriately
75 for the bitmap.
76 @param style
77 Window style. See wxBitmapButton.
78 @param validator
79 Window validator.
80 @param name
81 Window name.
82
83 @remarks The bitmap parameter is normally the only bitmap you need to provide,
84 and wxWidgets will draw the button correctly in its different states.
85 If you want more control, call any of the functions SetBitmapPressed(),
86 SetBitmapFocus(), SetBitmapDisabled().
87
88 @see Create(), wxValidator
89 */
90 wxBitmapButton(wxWindow* parent, wxWindowID id,
91 const wxBitmap& bitmap,
92 const wxPoint& pos = wxDefaultPosition,
93 const wxSize& size = wxDefaultSize,
94 long style = wxBU_AUTODRAW,
95 const wxValidator& validator = wxDefaultValidator,
96 const wxString& name = wxButtonNameStr);
97
98 /**
99 Button creation function for two-step creation.
100 For more details, see wxBitmapButton().
101 */
102 bool Create(wxWindow* parent, wxWindowID id,
103 const wxBitmap& bitmap,
104 const wxPoint& pos = wxDefaultPosition,
105 const wxSize& size = wxDefaultSize,
106 long style = wxBU_AUTODRAW,
107 const wxValidator& validator = wxDefaultValidator,
108 const wxString& name = wxButtonNameStr);
109 };
110