]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/bmpbuttn.h
Make storing non-trivial data in wxThreadSpecificInfo possible.
[wxWidgets.git] / interface / wx / bmpbuttn.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: bmpbuttn.h
3 // Purpose: interface of wxBitmapButton
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
7
8 /**
9 @class wxBitmapButton
10
11 A bitmap button is a control that contains a bitmap.
12
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.
18
19 @beginStyleTable
20 @style{wxBU_LEFT}
21 Left-justifies the bitmap label.
22 @style{wxBU_TOP}
23 Aligns the bitmap label to the top of the button.
24 @style{wxBU_RIGHT}
25 Right-justifies the bitmap label.
26 @style{wxBU_BOTTOM}
27 Aligns the bitmap label to the bottom of the button.
28 @endStyleTable
29
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
33 @beginEventEmissionTable{wxCommandEvent}
34 @event{EVT_BUTTON(id, func)}
35 Process a @c wxEVT_BUTTON event, when the button is clicked.
36 @endEventTable
37
38 @library{wxcore}
39 @category{ctrl}
40 @appearance{bitmapbutton}
41
42 @see wxButton
43 */
44 class wxBitmapButton : public wxButton
45 {
46 public:
47 /**
48 Default ctor.
49 */
50 wxBitmapButton();
51
52 /**
53 Constructor, creating and showing a button.
54
55 @param parent
56 Parent window. Must not be @NULL.
57 @param id
58 Button identifier. The value wxID_ANY indicates a default value.
59 @param bitmap
60 Bitmap to be displayed.
61 @param pos
62 Button position.
63 If ::wxDefaultPosition is specified then a default position is chosen.
64 @param size
65 Button size.
66 If ::wxDefaultSize is specified then the button is sized appropriately
67 for the bitmap.
68 @param style
69 Window style. See wxBitmapButton.
70 @param validator
71 Window validator.
72 @param name
73 Window name.
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.
77 If you want more control, call any of the functions SetBitmapPressed(),
78 SetBitmapFocus(), SetBitmapDisabled().
79
80 @see Create(), wxValidator
81 */
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);
89
90 /**
91 Button creation function for two-step creation.
92 For more details, see wxBitmapButton().
93 */
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);
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);
117 };
118