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 focussed 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
35 See also
\helpref{window styles overview
}{windowstyles
}.
37 \wxheading{Event handling
}
40 \begin{twocollist
}\itemsep=
0pt
41 \twocolitem{{\bf EVT
\_BUTTON(id, func)
}}{Process a wxEVT
\_COMMAND\_BUTTON\_CLICKED event,
42 when the button is clicked.
}
47 \helpref{wxButton
}{wxbutton
}
49 \latexignore{\rtfignore{\wxheading{Members
}}}
51 \membersection{wxBitmapButton::wxBitmapButton
}\label{wxbitmapbuttonconstr
}
53 \func{}{wxBitmapButton
}{\void}
57 \func{}{wxBitmapButton
}{
58 \param{wxWindow*
}{parent
},
59 \param{wxWindowID
}{id
},
60 \param{const wxBitmap\&
}{bitmap
},
\rtfsp
61 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
62 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
63 \param{long
}{style = wxBU
\_AUTODRAW},
64 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
65 \param{const wxString\&
}{name = ``button"
}}
67 Constructor, creating and showing a button.
69 \wxheading{Parameters
}
71 \docparam{parent
}{Parent window. Must not be NULL.
}
73 \docparam{id
}{Button identifier. A value of -
1 indicates a default value.
}
75 \docparam{bitmap
}{Bitmap to be displayed.
}
77 \docparam{pos
}{Button position.
}
79 \docparam{size
}{Button size. If the default size (-
1, -
1) is specified then the button is sized
80 appropriately for the bitmap.
}
82 \docparam{style
}{Window style. See
\helpref{wxBitmapButton
}{wxbitmapbutton
}.
}
84 \docparam{validator
}{Window validator.
}
86 \docparam{name
}{Window name.
}
90 The
{\it bitmap
} parameter is normally the only bitmap you need to provide, and wxWindows will
91 draw the button correctly in its different states. If you want more control, call
92 any of the functions
\helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
93 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
94 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}.
96 Note that the bitmap passed is smaller than the actual button created.
100 \helpref{wxBitmapButton::Create
}{wxbitmapbuttoncreate
},
\helpref{wxValidator
}{wxvalidator
}
102 \membersection{wxBitmapButton::
\destruct{wxBitmapButton
}}
104 \func{}{\destruct{wxBitmapButton
}}{\void}
106 Destructor, destroying the button.
108 \membersection{wxBitmapButton::Create
}\label{wxbitmapbuttoncreate
}
110 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{ id
},
\param{const wxBitmap\&
}{bitmap
},
\rtfsp
111 \param{const wxPoint\&
}{pos
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
112 \param{long
}{ style =
0},
\param{const wxValidator\&
}{validator
},
\param{const wxString\&
}{name = ``button"
}}
114 Button creation function for two-step creation. For more details, see
\helpref{wxBitmapButton::wxBitmapButton
}{wxbitmapbuttonconstr
}.
116 \membersection{wxBitmapButton::GetBitmapDisabled
}\label{wxbitmapbuttongetbitmapdisabled
}
118 \constfunc{wxBitmap\&
}{GetBitmapLabel
}{\void}
120 Returns the bitmap for the disabled state.
122 \wxheading{Return value
}
124 A reference to the disabled state bitmap.
128 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
130 \membersection{wxBitmapButton::GetBitmapFocus
}\label{wxbitmapbuttongetbitmapfocus
}
132 \constfunc{wxBitmap\&
}{GetBitmapFocus
}{\void}
134 Returns the bitmap for the focussed state.
136 \wxheading{Return value
}
138 A reference to the focussed state bitmap.
142 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
144 \membersection{wxBitmapButton::GetBitmapLabel
}\label{wxbitmapbuttongetbitmaplabel
}
146 \constfunc{wxBitmap\&
}{GetBitmapLabel
}{\void}
148 Returns the label bitmap (the one passed to the constructor).
150 \wxheading{Return value
}
152 A reference to the button's label bitmap.
156 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
}
158 \membersection{wxBitmapButton::GetBitmapSelected
}\label{wxbitmapbuttongetbitmapselected
}
160 \constfunc{wxBitmap\&
}{GetBitmapSelected
}{\void}
162 Returns the bitmap for the selected state.
164 \wxheading{Return value
}
166 A reference to the selected state bitmap.
170 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
}
172 \membersection{wxBitmapButton::SetBitmapDisabled
}\label{wxbitmapbuttonsetbitmapdisabled
}
174 \func{void
}{SetBitmapDisabled
}{\param{const wxBitmap\&
}{bitmap
}}
176 Sets the bitmap for the disabled button appearance.
178 \wxheading{Parameters
}
180 \docparam{bitmap
}{The bitmap to set.
}
184 \helpref{wxBitmapButton::GetBitmapDisabled
}{wxbitmapbuttongetbitmapdisabled
},
\rtfsp
185 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
186 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
187 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
189 \membersection{wxBitmapButton::SetBitmapFocus
}\label{wxbitmapbuttonsetbitmapfocus
}
191 \func{void
}{SetBitmapFocus
}{\param{const wxBitmap\&
}{bitmap
}}
193 Sets the bitmap for the button appearance when it has the keyboard focus.
195 \wxheading{Parameters
}
197 \docparam{bitmap
}{The bitmap to set.
}
201 \helpref{wxBitmapButton::GetBitmapFocus
}{wxbitmapbuttongetbitmapfocus
},
\rtfsp
202 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
203 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
204 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
206 \membersection{wxBitmapButton::SetBitmapLabel
}\label{wxbitmapbuttonsetbitmaplabel
}
208 \func{void
}{SetBitmapLabel
}{\param{const wxBitmap\&
}{bitmap
}}
210 Sets the bitmap label for the button.
212 \wxheading{Parameters
}
214 \docparam{bitmap
}{The bitmap label to set.
}
218 This is the bitmap used for the unselected state, and for all other states
219 if no other bitmaps are provided.
223 \helpref{wxBitmapButton::GetBitmapLabel
}{wxbitmapbuttongetbitmaplabel
}
225 \membersection{wxBitmapButton::SetBitmapSelected
}\label{wxbitmapbuttonsetbitmapselected
}
227 \func{void
}{SetBitmapSelected
}{\param{const wxBitmap\&
}{bitmap
}}
229 Sets the bitmap for the selected (depressed) button appearance.
231 \wxheading{Parameters
}
233 \docparam{bitmap
}{The bitmap to set.
}
237 \helpref{wxBitmapButton::GetBitmapSelected
}{wxbitmapbuttongetbitmapselected
},
\rtfsp
238 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
239 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
240 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}