]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: bmpbuttn.h | |
e54c96f1 | 3 | // Purpose: interface of wxBitmapButton |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxBitmapButton | |
7c913512 | 11 | |
23324ae1 | 12 | A bitmap button is a control that contains a bitmap. |
8024723d | 13 | |
2352862a VZ |
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. | |
7c913512 | 19 | |
23324ae1 | 20 | @beginStyleTable |
8c6791e4 | 21 | @style{wxBU_AUTODRAW} |
23324ae1 FM |
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 | |
8024723d | 25 | all provided bitmaps. Has effect only under MS Windows. |
8c6791e4 | 26 | @style{wxBU_LEFT} |
8024723d | 27 | Left-justifies the bitmap label. Has effect only under MS Windows. |
8c6791e4 | 28 | @style{wxBU_TOP} |
8024723d FM |
29 | Aligns the bitmap label to the top of the button. |
30 | Has effect only under MS Windows. | |
8c6791e4 | 31 | @style{wxBU_RIGHT} |
8024723d | 32 | Right-justifies the bitmap label. Has effect only under MS Windows. |
8c6791e4 | 33 | @style{wxBU_BOTTOM} |
8024723d FM |
34 | Aligns the bitmap label to the bottom of the button. |
35 | Has effect only under MS Windows. | |
23324ae1 | 36 | @endStyleTable |
7c913512 | 37 | |
8024723d FM |
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 | ||
3051a44a | 41 | @beginEventEmissionTable{wxCommandEvent} |
8c6791e4 | 42 | @event{EVT_BUTTON(id, func)} |
8024723d | 43 | Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked. |
23324ae1 | 44 | @endEventTable |
7c913512 | 45 | |
23324ae1 FM |
46 | @library{wxcore} |
47 | @category{ctrl} | |
7e59b885 | 48 | @appearance{bitmapbutton.png} |
7c913512 | 49 | |
e54c96f1 | 50 | @see wxButton |
23324ae1 FM |
51 | */ |
52 | class wxBitmapButton : public wxButton | |
53 | { | |
54 | public: | |
8024723d FM |
55 | /** |
56 | Default ctor. | |
57 | */ | |
58 | wxBitmapButton(); | |
59 | ||
23324ae1 FM |
60 | /** |
61 | Constructor, creating and showing a button. | |
8024723d | 62 | |
7c913512 | 63 | @param parent |
4cc4bfaf | 64 | Parent window. Must not be @NULL. |
7c913512 | 65 | @param id |
4cc4bfaf | 66 | Button identifier. The value wxID_ANY indicates a default value. |
7c913512 | 67 | @param bitmap |
4cc4bfaf | 68 | Bitmap to be displayed. |
7c913512 | 69 | @param pos |
4cc4bfaf | 70 | Button position. |
dc1b07fd | 71 | If ::wxDefaultPosition is specified then a default position is chosen. |
7c913512 | 72 | @param size |
dc1b07fd FM |
73 | Button size. |
74 | If ::wxDefaultSize is specified then the button is sized appropriately | |
75 | for the bitmap. | |
7c913512 | 76 | @param style |
4cc4bfaf | 77 | Window style. See wxBitmapButton. |
7c913512 | 78 | @param validator |
4cc4bfaf | 79 | Window validator. |
7c913512 | 80 | @param name |
4cc4bfaf | 81 | Window name. |
8024723d FM |
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. | |
2352862a | 85 | If you want more control, call any of the functions SetBitmapPressed(), |
8024723d FM |
86 | SetBitmapFocus(), SetBitmapDisabled(). |
87 | ||
4cc4bfaf | 88 | @see Create(), wxValidator |
23324ae1 | 89 | */ |
7c913512 FM |
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, | |
a6052817 | 96 | const wxString& name = wxButtonNameStr); |
23324ae1 | 97 | |
23324ae1 | 98 | /** |
8024723d FM |
99 | Button creation function for two-step creation. |
100 | For more details, see wxBitmapButton(). | |
23324ae1 FM |
101 | */ |
102 | bool Create(wxWindow* parent, wxWindowID id, | |
103 | const wxBitmap& bitmap, | |
a6052817 | 104 | const wxPoint& pos = wxDefaultPosition, |
23324ae1 | 105 | const wxSize& size = wxDefaultSize, |
a6052817 FM |
106 | long style = wxBU_AUTODRAW, |
107 | const wxValidator& validator = wxDefaultValidator, | |
108 | const wxString& name = wxButtonNameStr); | |
23324ae1 | 109 | }; |
e54c96f1 | 110 |