]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: bmpbuttn.h | |
e54c96f1 | 3 | // Purpose: interface of wxBitmapButton |
23324ae1 | 4 | // Author: wxWidgets team |
526954c5 | 5 | // Licence: wxWindows licence |
23324ae1 FM |
6 | ///////////////////////////////////////////////////////////////////////////// |
7 | ||
8 | /** | |
9 | @class wxBitmapButton | |
7c913512 | 10 | |
23324ae1 | 11 | A bitmap button is a control that contains a bitmap. |
8024723d | 12 | |
2352862a VZ |
13 | Notice that since wxWidgets 2.9.1 bitmap display is supported by the base |
14 | wxButton class itself and the only tiny advantage of using this class is | |
15 | that it allows to specify the bitmap in its constructor, unlike wxButton. | |
16 | Please see the base class documentation for more information about images | |
17 | support in wxButton. | |
7c913512 | 18 | |
23324ae1 | 19 | @beginStyleTable |
8c6791e4 | 20 | @style{wxBU_LEFT} |
0f5fe332 | 21 | Left-justifies the bitmap label. |
8c6791e4 | 22 | @style{wxBU_TOP} |
8024723d | 23 | Aligns the bitmap label to the top of the button. |
8c6791e4 | 24 | @style{wxBU_RIGHT} |
0f5fe332 | 25 | Right-justifies the bitmap label. |
8c6791e4 | 26 | @style{wxBU_BOTTOM} |
8024723d | 27 | Aligns the bitmap label to the bottom of the button. |
23324ae1 | 28 | @endStyleTable |
7c913512 | 29 | |
8024723d FM |
30 | Note that the wxBU_EXACTFIT style supported by wxButton is not used by this |
31 | class as bitmap buttons don't have any minimal standard size by default. | |
32 | ||
3051a44a | 33 | @beginEventEmissionTable{wxCommandEvent} |
8c6791e4 | 34 | @event{EVT_BUTTON(id, func)} |
ce7fe42e | 35 | Process a @c wxEVT_BUTTON event, when the button is clicked. |
23324ae1 | 36 | @endEventTable |
7c913512 | 37 | |
23324ae1 FM |
38 | @library{wxcore} |
39 | @category{ctrl} | |
ce154616 | 40 | @appearance{bitmapbutton} |
7c913512 | 41 | |
e54c96f1 | 42 | @see wxButton |
23324ae1 FM |
43 | */ |
44 | class wxBitmapButton : public wxButton | |
45 | { | |
46 | public: | |
8024723d FM |
47 | /** |
48 | Default ctor. | |
49 | */ | |
50 | wxBitmapButton(); | |
51 | ||
23324ae1 FM |
52 | /** |
53 | Constructor, creating and showing a button. | |
8024723d | 54 | |
7c913512 | 55 | @param parent |
4cc4bfaf | 56 | Parent window. Must not be @NULL. |
7c913512 | 57 | @param id |
4cc4bfaf | 58 | Button identifier. The value wxID_ANY indicates a default value. |
7c913512 | 59 | @param bitmap |
4cc4bfaf | 60 | Bitmap to be displayed. |
7c913512 | 61 | @param pos |
4cc4bfaf | 62 | Button position. |
dc1b07fd | 63 | If ::wxDefaultPosition is specified then a default position is chosen. |
7c913512 | 64 | @param size |
dc1b07fd FM |
65 | Button size. |
66 | If ::wxDefaultSize is specified then the button is sized appropriately | |
67 | for the bitmap. | |
7c913512 | 68 | @param style |
4cc4bfaf | 69 | Window style. See wxBitmapButton. |
7c913512 | 70 | @param validator |
4cc4bfaf | 71 | Window validator. |
7c913512 | 72 | @param name |
4cc4bfaf | 73 | Window name. |
8024723d FM |
74 | |
75 | @remarks The bitmap parameter is normally the only bitmap you need to provide, | |
76 | and wxWidgets will draw the button correctly in its different states. | |
2352862a | 77 | If you want more control, call any of the functions SetBitmapPressed(), |
8024723d FM |
78 | SetBitmapFocus(), SetBitmapDisabled(). |
79 | ||
4cc4bfaf | 80 | @see Create(), wxValidator |
23324ae1 | 81 | */ |
7c913512 FM |
82 | wxBitmapButton(wxWindow* parent, wxWindowID id, |
83 | const wxBitmap& bitmap, | |
84 | const wxPoint& pos = wxDefaultPosition, | |
85 | const wxSize& size = wxDefaultSize, | |
86 | long style = wxBU_AUTODRAW, | |
87 | const wxValidator& validator = wxDefaultValidator, | |
a6052817 | 88 | const wxString& name = wxButtonNameStr); |
23324ae1 | 89 | |
23324ae1 | 90 | /** |
8024723d FM |
91 | Button creation function for two-step creation. |
92 | For more details, see wxBitmapButton(). | |
23324ae1 FM |
93 | */ |
94 | bool Create(wxWindow* parent, wxWindowID id, | |
95 | const wxBitmap& bitmap, | |
a6052817 | 96 | const wxPoint& pos = wxDefaultPosition, |
23324ae1 | 97 | const wxSize& size = wxDefaultSize, |
a6052817 FM |
98 | long style = wxBU_AUTODRAW, |
99 | const wxValidator& validator = wxDefaultValidator, | |
100 | const wxString& name = wxButtonNameStr); | |
be7a086c VZ |
101 | |
102 | /** | |
103 | Helper function creating a standard-looking "Close" button. | |
104 | ||
105 | To get the best results, platform-specific code may need to be used to | |
106 | create a small, title bar-like "Close" button. This function is | |
107 | provided to avoid the need to test for the current platform and creates | |
108 | the button with as native look as possible. | |
109 | ||
110 | @param parent The button parent window, must be non-@NULL. | |
111 | @param winid The identifier for the new button. | |
112 | @return The new button. | |
113 | ||
114 | @since 2.9.5 | |
115 | */ | |
116 | static wxBitmapButton* NewCloseButton(wxWindow* parent, wxWindowID winid); | |
23324ae1 | 117 | }; |
e54c96f1 | 118 |