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 wxWidgets 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 Note that
\windowstyle{wxBU
\_EXACTFIT} supported by
40 \helpref{wxButton
}{wxbutton
} is
\emph{not
} used by this class as bitmap buttons
41 don't have any minimal standard size by default.
43 See also
\helpref{window styles overview
}{windowstyles
}.
45 \wxheading{Event handling
}
48 \begin{twocollist
}\itemsep=
0pt
49 \twocolitem{{\bf EVT
\_BUTTON(id, func)
}}{Process a wxEVT
\_COMMAND\_BUTTON\_CLICKED event,
50 when the button is clicked.
}
55 \helpref{wxButton
}{wxbutton
}
57 \latexignore{\rtfignore{\wxheading{Members
}}}
59 \membersection{wxBitmapButton::wxBitmapButton
}\label{wxbitmapbuttonctor
}
61 \func{}{wxBitmapButton
}{\void}
65 \func{}{wxBitmapButton
}{
66 \param{wxWindow*
}{parent
},
67 \param{wxWindowID
}{id
},
68 \param{const wxBitmap\&
}{bitmap
},
\rtfsp
69 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
70 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
71 \param{long
}{style = wxBU
\_AUTODRAW},
72 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
73 \param{const wxString\&
}{name = ``button"
}}
75 Constructor, creating and showing a button.
77 \wxheading{Parameters
}
79 \docparam{parent
}{Parent window. Must not be NULL.
}
81 \docparam{id
}{Button identifier. A value of -
1 indicates a default value.
}
83 \docparam{bitmap
}{Bitmap to be displayed.
}
85 \docparam{pos
}{Button position.
}
87 \docparam{size
}{Button size. If the default size (-
1, -
1) is specified then the button is sized
88 appropriately for the bitmap.
}
90 \docparam{style
}{Window style. See
\helpref{wxBitmapButton
}{wxbitmapbutton
}.
}
92 \docparam{validator
}{Window validator.
}
94 \docparam{name
}{Window name.
}
98 The
{\it bitmap
} parameter is normally the only bitmap you need to provide, and wxWidgets will
99 draw the button correctly in its different states. If you want more control, call
100 any of the functions
\helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
101 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
102 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}.
104 Note that the bitmap passed is smaller than the actual button created.
108 \helpref{wxBitmapButton::Create
}{wxbitmapbuttoncreate
},
\helpref{wxValidator
}{wxvalidator
}
110 \membersection{wxBitmapButton::
\destruct{wxBitmapButton
}}\label{wxbitmapbuttondtor
}
112 \func{}{\destruct{wxBitmapButton
}}{\void}
114 Destructor, destroying the button.
116 \membersection{wxBitmapButton::Create
}\label{wxbitmapbuttoncreate
}
118 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{ id
},
\param{const wxBitmap\&
}{bitmap
},
\rtfsp
119 \param{const wxPoint\&
}{pos
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
120 \param{long
}{ style =
0},
\param{const wxValidator\&
}{validator
},
\param{const wxString\&
}{name = ``button"
}}
122 Button creation function for two-step creation. For more details, see
\helpref{wxBitmapButton::wxBitmapButton
}{wxbitmapbuttonctor
}.
124 \membersection{wxBitmapButton::GetBitmapDisabled
}\label{wxbitmapbuttongetbitmapdisabled
}
126 \constfunc{wxBitmap\&
}{GetBitmapDisabled
}{\void}
128 Returns the bitmap for the disabled state.
130 \wxheading{Return value
}
132 A reference to the disabled state bitmap.
136 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
138 \membersection{wxBitmapButton::GetBitmapFocus
}\label{wxbitmapbuttongetbitmapfocus
}
140 \constfunc{wxBitmap\&
}{GetBitmapFocus
}{\void}
142 Returns the bitmap for the focused state.
144 \wxheading{Return value
}
146 A reference to the focused state bitmap.
150 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
152 \membersection{wxBitmapButton::GetBitmapLabel
}\label{wxbitmapbuttongetbitmaplabel
}
154 \constfunc{wxBitmap\&
}{GetBitmapLabel
}{\void}
156 Returns the label bitmap (the one passed to the constructor).
158 \wxheading{Return value
}
160 A reference to the button's label bitmap.
164 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
}
166 \membersection{wxBitmapButton::GetBitmapSelected
}\label{wxbitmapbuttongetbitmapselected
}
168 \constfunc{wxBitmap\&
}{GetBitmapSelected
}{\void}
170 Returns the bitmap for the selected state.
172 \wxheading{Return value
}
174 A reference to the selected state bitmap.
178 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
}
180 \membersection{wxBitmapButton::SetBitmapDisabled
}\label{wxbitmapbuttonsetbitmapdisabled
}
182 \func{void
}{SetBitmapDisabled
}{\param{const wxBitmap\&
}{bitmap
}}
184 Sets the bitmap for the disabled button appearance.
186 \wxheading{Parameters
}
188 \docparam{bitmap
}{The bitmap to set.
}
192 \helpref{wxBitmapButton::GetBitmapDisabled
}{wxbitmapbuttongetbitmapdisabled
},
\rtfsp
193 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
194 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
195 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
197 \membersection{wxBitmapButton::SetBitmapFocus
}\label{wxbitmapbuttonsetbitmapfocus
}
199 \func{void
}{SetBitmapFocus
}{\param{const wxBitmap\&
}{bitmap
}}
201 Sets the bitmap for the button appearance when it has the keyboard focus.
203 \wxheading{Parameters
}
205 \docparam{bitmap
}{The bitmap to set.
}
209 \helpref{wxBitmapButton::GetBitmapFocus
}{wxbitmapbuttongetbitmapfocus
},
\rtfsp
210 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
211 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
212 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
214 \membersection{wxBitmapButton::SetBitmapLabel
}\label{wxbitmapbuttonsetbitmaplabel
}
216 \func{void
}{SetBitmapLabel
}{\param{const wxBitmap\&
}{bitmap
}}
218 Sets the bitmap label for the button.
220 \wxheading{Parameters
}
222 \docparam{bitmap
}{The bitmap label to set.
}
226 This is the bitmap used for the unselected state, and for all other states
227 if no other bitmaps are provided.
231 \helpref{wxBitmapButton::GetBitmapLabel
}{wxbitmapbuttongetbitmaplabel
}
233 \membersection{wxBitmapButton::SetBitmapSelected
}\label{wxbitmapbuttonsetbitmapselected
}
235 \func{void
}{SetBitmapSelected
}{\param{const wxBitmap\&
}{bitmap
}}
237 Sets the bitmap for the selected (depressed) button appearance.
239 \wxheading{Parameters
}
241 \docparam{bitmap
}{The bitmap to set.
}
245 \helpref{wxBitmapButton::GetBitmapSelected
}{wxbitmapbuttongetbitmapselected
},
\rtfsp
246 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
247 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
248 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}