1 \section{\class{wxBitmapButton
}}\label{wxbitmapbutton
}
3 A bitmap button is a control that contains a bitmap.
4 It may be placed on a
\helpref{dialog box
}{wxdialog
} or
\helpref{panel
}{wxpanel
}, or indeed
5 almost any other window.
7 \wxheading{Derived from
}
9 \helpref{wxButton
}{wxbutton
}\\
10 \helpref{wxControl
}{wxcontrol
}\\
11 \helpref{wxWindow
}{wxwindow
}\\
12 \helpref{wxEvtHandler
}{wxevthandler
}\\
13 \helpref{wxObject
}{wxobject
}
15 \wxheading{Include files
}
21 A bitmap button can be supplied with a single bitmap, and wxWindows will draw
22 all button states using this bitmap. If the application needs more control, additional bitmaps for
23 the selected state, unpressed focused state, and greyed-out state may be supplied.
25 \wxheading{Window styles
}
28 \begin{twocollist
}\itemsep=
0pt
29 \twocolitem{\windowstyle{wxBU
\_AUTODRAW}}{If
30 this is specified, the button will be drawn automatically using the label bitmap only, providing
31 a
3D-look border. If this style is not specified, the button will be drawn without borders and using all
32 provided bitmaps. WIN32 only.
}
33 \twocolitem{\windowstyle{wxBU
\_LEFT}}{Left-justifies the bitmap label. WIN32 only.
}
34 \twocolitem{\windowstyle{wxBU
\_TOP}}{Aligns the bitmap label to the top of the button. WIN32 only.
}
35 \twocolitem{\windowstyle{wxBU
\_RIGHT}}{Right-justifies the bitmap label. WIN32 only.
}
36 \twocolitem{\windowstyle{wxBU
\_BOTTOM}}{Aligns the bitmap label to the bottom of the button. WIN32 only.
}
39 See also
\helpref{window styles overview
}{windowstyles
}.
41 \wxheading{Event handling
}
44 \begin{twocollist
}\itemsep=
0pt
45 \twocolitem{{\bf EVT
\_BUTTON(id, func)
}}{Process a wxEVT
\_COMMAND\_BUTTON\_CLICKED event,
46 when the button is clicked.
}
51 \helpref{wxButton
}{wxbutton
}
53 \latexignore{\rtfignore{\wxheading{Members
}}}
55 \membersection{wxBitmapButton::wxBitmapButton
}\label{wxbitmapbuttonconstr
}
57 \func{}{wxBitmapButton
}{\void}
61 \func{}{wxBitmapButton
}{
62 \param{wxWindow*
}{parent
},
63 \param{wxWindowID
}{id
},
64 \param{const wxBitmap\&
}{bitmap
},
\rtfsp
65 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
66 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
67 \param{long
}{style = wxBU
\_AUTODRAW},
68 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
69 \param{const wxString\&
}{name = ``button"
}}
71 Constructor, creating and showing a button.
73 \wxheading{Parameters
}
75 \docparam{parent
}{Parent window. Must not be NULL.
}
77 \docparam{id
}{Button identifier. A value of -
1 indicates a default value.
}
79 \docparam{bitmap
}{Bitmap to be displayed.
}
81 \docparam{pos
}{Button position.
}
83 \docparam{size
}{Button size. If the default size (-
1, -
1) is specified then the button is sized
84 appropriately for the bitmap.
}
86 \docparam{style
}{Window style. See
\helpref{wxBitmapButton
}{wxbitmapbutton
}.
}
88 \docparam{validator
}{Window validator.
}
90 \docparam{name
}{Window name.
}
94 The
{\it bitmap
} parameter is normally the only bitmap you need to provide, and wxWindows will
95 draw the button correctly in its different states. If you want more control, call
96 any of the functions
\helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
97 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
98 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}.
100 Note that the bitmap passed is smaller than the actual button created.
104 \helpref{wxBitmapButton::Create
}{wxbitmapbuttoncreate
},
\helpref{wxValidator
}{wxvalidator
}
106 \membersection{wxBitmapButton::
\destruct{wxBitmapButton
}}
108 \func{}{\destruct{wxBitmapButton
}}{\void}
110 Destructor, destroying the button.
112 \membersection{wxBitmapButton::Create
}\label{wxbitmapbuttoncreate
}
114 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{ id
},
\param{const wxBitmap\&
}{bitmap
},
\rtfsp
115 \param{const wxPoint\&
}{pos
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
116 \param{long
}{ style =
0},
\param{const wxValidator\&
}{validator
},
\param{const wxString\&
}{name = ``button"
}}
118 Button creation function for two-step creation. For more details, see
\helpref{wxBitmapButton::wxBitmapButton
}{wxbitmapbuttonconstr
}.
120 \membersection{wxBitmapButton::GetBitmapDisabled
}\label{wxbitmapbuttongetbitmapdisabled
}
122 \constfunc{wxBitmap\&
}{GetBitmapDisabled
}{\void}
124 Returns the bitmap for the disabled state.
126 \wxheading{Return value
}
128 A reference to the disabled state bitmap.
132 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
134 \membersection{wxBitmapButton::GetBitmapFocus
}\label{wxbitmapbuttongetbitmapfocus
}
136 \constfunc{wxBitmap\&
}{GetBitmapFocus
}{\void}
138 Returns the bitmap for the focused state.
140 \wxheading{Return value
}
142 A reference to the focused state bitmap.
146 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
148 \membersection{wxBitmapButton::GetBitmapLabel
}\label{wxbitmapbuttongetbitmaplabel
}
150 \constfunc{wxBitmap\&
}{GetBitmapLabel
}{\void}
152 Returns the label bitmap (the one passed to the constructor).
154 \wxheading{Return value
}
156 A reference to the button's label bitmap.
160 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
}
162 \membersection{wxBitmapButton::GetBitmapSelected
}\label{wxbitmapbuttongetbitmapselected
}
164 \constfunc{wxBitmap\&
}{GetBitmapSelected
}{\void}
166 Returns the bitmap for the selected state.
168 \wxheading{Return value
}
170 A reference to the selected state bitmap.
174 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
}
176 \membersection{wxBitmapButton::SetBitmapDisabled
}\label{wxbitmapbuttonsetbitmapdisabled
}
178 \func{void
}{SetBitmapDisabled
}{\param{const wxBitmap\&
}{bitmap
}}
180 Sets the bitmap for the disabled button appearance.
182 \wxheading{Parameters
}
184 \docparam{bitmap
}{The bitmap to set.
}
188 \helpref{wxBitmapButton::GetBitmapDisabled
}{wxbitmapbuttongetbitmapdisabled
},
\rtfsp
189 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
190 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
191 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
193 \membersection{wxBitmapButton::SetBitmapFocus
}\label{wxbitmapbuttonsetbitmapfocus
}
195 \func{void
}{SetBitmapFocus
}{\param{const wxBitmap\&
}{bitmap
}}
197 Sets the bitmap for the button appearance when it has the keyboard focus.
199 \wxheading{Parameters
}
201 \docparam{bitmap
}{The bitmap to set.
}
205 \helpref{wxBitmapButton::GetBitmapFocus
}{wxbitmapbuttongetbitmapfocus
},
\rtfsp
206 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
207 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
208 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
210 \membersection{wxBitmapButton::SetBitmapLabel
}\label{wxbitmapbuttonsetbitmaplabel
}
212 \func{void
}{SetBitmapLabel
}{\param{const wxBitmap\&
}{bitmap
}}
214 Sets the bitmap label for the button.
216 \wxheading{Parameters
}
218 \docparam{bitmap
}{The bitmap label to set.
}
222 This is the bitmap used for the unselected state, and for all other states
223 if no other bitmaps are provided.
227 \helpref{wxBitmapButton::GetBitmapLabel
}{wxbitmapbuttongetbitmaplabel
}
229 \membersection{wxBitmapButton::SetBitmapSelected
}\label{wxbitmapbuttonsetbitmapselected
}
231 \func{void
}{SetBitmapSelected
}{\param{const wxBitmap\&
}{bitmap
}}
233 Sets the bitmap for the selected (depressed) button appearance.
235 \wxheading{Parameters
}
237 \docparam{bitmap
}{The bitmap to set.
}
241 \helpref{wxBitmapButton::GetBitmapSelected
}{wxbitmapbuttongetbitmapselected
},
\rtfsp
242 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
243 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
244 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}