]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/bmpbuttn.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxBitmapButton
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
11 A bitmap button is a control that contains a bitmap.
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
21 Left-justifies the bitmap label.
23 Aligns the bitmap label to the top of the button.
25 Right-justifies the bitmap label.
27 Aligns the bitmap label to the bottom of the button.
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.
33 @beginEventEmissionTable{wxCommandEvent}
34 @event{EVT_BUTTON(id, func)}
35 Process a @c wxEVT_BUTTON event, when the button is clicked.
40 @appearance{bitmapbutton}
44 class wxBitmapButton
: public wxButton
53 Constructor, creating and showing a button.
56 Parent window. Must not be @NULL.
58 Button identifier. The value wxID_ANY indicates a default value.
60 Bitmap to be displayed.
63 If ::wxDefaultPosition is specified then a default position is chosen.
66 If ::wxDefaultSize is specified then the button is sized appropriately
69 Window style. See wxBitmapButton.
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.
77 If you want more control, call any of the functions SetBitmapPressed(),
78 SetBitmapFocus(), SetBitmapDisabled().
80 @see Create(), wxValidator
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
,
88 const wxString
& name
= wxButtonNameStr
);
91 Button creation function for two-step creation.
92 For more details, see wxBitmapButton().
94 bool Create(wxWindow
* parent
, wxWindowID id
,
95 const wxBitmap
& bitmap
,
96 const wxPoint
& pos
= wxDefaultPosition
,
97 const wxSize
& size
= wxDefaultSize
,
98 long style
= wxBU_AUTODRAW
,
99 const wxValidator
& validator
= wxDefaultValidator
,
100 const wxString
& name
= wxButtonNameStr
);
103 Helper function creating a standard-looking "Close" button.
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.
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.
116 static wxBitmapButton
* NewCloseButton(wxWindow
* parent
, wxWindowID winid
);