]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/bmpbuttn.h
8a9588827176574a7cbba9ed0c6fd019dd5ebb2c
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxBitmapButton
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
12 A bitmap button is a control that contains a bitmap.
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
22 Left-justifies the bitmap label.
24 Aligns the bitmap label to the top of the button.
26 Right-justifies the bitmap label.
28 Aligns the bitmap label to the bottom of the button.
31 Note that the wxBU_EXACTFIT style supported by wxButton is not used by this
32 class as bitmap buttons don't have any minimal standard size by default.
34 @beginEventEmissionTable{wxCommandEvent}
35 @event{EVT_BUTTON(id, func)}
36 Process a @c wxEVT_BUTTON event, when the button is clicked.
41 @appearance{bitmapbutton}
45 class wxBitmapButton
: public wxButton
54 Constructor, creating and showing a button.
57 Parent window. Must not be @NULL.
59 Button identifier. The value wxID_ANY indicates a default value.
61 Bitmap to be displayed.
64 If ::wxDefaultPosition is specified then a default position is chosen.
67 If ::wxDefaultSize is specified then the button is sized appropriately
70 Window style. See wxBitmapButton.
76 @remarks The bitmap parameter is normally the only bitmap you need to provide,
77 and wxWidgets will draw the button correctly in its different states.
78 If you want more control, call any of the functions SetBitmapPressed(),
79 SetBitmapFocus(), SetBitmapDisabled().
81 @see Create(), wxValidator
83 wxBitmapButton(wxWindow
* parent
, wxWindowID id
,
84 const wxBitmap
& bitmap
,
85 const wxPoint
& pos
= wxDefaultPosition
,
86 const wxSize
& size
= wxDefaultSize
,
87 long style
= wxBU_AUTODRAW
,
88 const wxValidator
& validator
= wxDefaultValidator
,
89 const wxString
& name
= wxButtonNameStr
);
92 Button creation function for two-step creation.
93 For more details, see wxBitmapButton().
95 bool Create(wxWindow
* parent
, wxWindowID id
,
96 const wxBitmap
& bitmap
,
97 const wxPoint
& pos
= wxDefaultPosition
,
98 const wxSize
& size
= wxDefaultSize
,
99 long style
= wxBU_AUTODRAW
,
100 const wxValidator
& validator
= wxDefaultValidator
,
101 const wxString
& name
= wxButtonNameStr
);
104 Helper function creating a standard-looking "Close" button.
106 To get the best results, platform-specific code may need to be used to
107 create a small, title bar-like "Close" button. This function is
108 provided to avoid the need to test for the current platform and creates
109 the button with as native look as possible.
111 @param parent The button parent window, must be non-@NULL.
112 @param winid The identifier for the new button.
113 @return The new button.
117 static wxBitmapButton
* NewCloseButton(wxWindow
* parent
, wxWindowID winid
);