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
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{ id
},
\param{const wxBitmap\&
}{bitmap
},
\rtfsp
58 \param{const wxPoint\&
}{pos
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
59 \param{long
}{ style = wxBU
\_AUTODRAW},
\param{const wxValidator\&
}{validator
},
\param{const wxString\&
}{name = ``button"
}}
61 Constructor, creating and showing a button.
63 \wxheading{Parameters
}
65 \docparam{parent
}{Parent window. Must not be NULL.
}
67 \docparam{id
}{Button identifier. A value of -
1 indicates a default value.
}
69 \docparam{bitmap
}{Bitmap to be displayed.
}
71 \docparam{pos
}{Button position.
}
73 \docparam{size
}{Button size. If the default size (-
1, -
1) is specified then the button is sized
74 appropriately for the bitmap.
}
76 \docparam{style
}{Window style. See
\helpref{wxBitmapButton
}{wxbitmapbutton
}.
}
78 \docparam{validator
}{Window validator.
}
80 \docparam{name
}{Window name.
}
84 The
{\it bitmap
} parameter is normally the only bitmap you need to provide, and wxWindows will
85 draw the button correctly in its different states. If you want more control, call
86 any of the functions
\helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
87 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
88 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}.
90 Note that the bitmap passed is smaller than the actual button created.
94 \helpref{wxBitmapButton::Create
}{wxbitmapbuttoncreate
},
\helpref{wxValidator
}{wxvalidator
}
96 \membersection{wxBitmapButton::
\destruct{wxBitmapButton
}}
98 \func{}{\destruct{wxBitmapButton
}}{\void}
100 Destructor, destroying the button.
102 \membersection{wxBitmapButton::Create
}\label{wxbitmapbuttoncreate
}
104 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{ id
},
\param{const wxBitmap\&
}{bitmap
},
\rtfsp
105 \param{const wxPoint\&
}{pos
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
106 \param{long
}{ style =
0},
\param{const wxValidator\&
}{validator
},
\param{const wxString\&
}{name = ``button"
}}
108 Button creation function for two-step creation. For more details, see
\helpref{wxBitmapButton::wxBitmapButton
}{wxbitmapbuttonconstr
}.
110 \membersection{wxBitmapButton::GetBitmapDisabled
}\label{wxbitmapbuttongetbitmapdisabled
}
112 \constfunc{wxBitmap\&
}{GetBitmapLabel
}{\void}
114 Returns the bitmap for the disabled state.
116 \wxheading{Return value
}
118 A reference to the disabled state bitmap.
122 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
124 \membersection{wxBitmapButton::GetBitmapFocus
}\label{wxbitmapbuttongetbitmapfocus
}
126 \constfunc{wxBitmap\&
}{GetBitmapFocus
}{\void}
128 Returns the bitmap for the focussed state.
130 \wxheading{Return value
}
132 A reference to the focussed state bitmap.
136 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
138 \membersection{wxBitmapButton::GetBitmapLabel
}\label{wxbitmapbuttongetbitmaplabel
}
140 \constfunc{wxBitmap\&
}{GetBitmapLabel
}{\void}
142 Returns the label bitmap (the one passed to the constructor).
144 \wxheading{Return value
}
146 A reference to the button's label bitmap.
150 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
}
152 \membersection{wxBitmapButton::GetBitmapSelected
}\label{wxbitmapbuttongetbitmapselected
}
154 \constfunc{wxBitmap\&
}{GetBitmapSelected
}{\void}
156 Returns the bitmap for the selected state.
158 \wxheading{Return value
}
160 A reference to the selected state bitmap.
164 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
}
166 \membersection{wxBitmapButton::SetBitmapDisabled
}\label{wxbitmapbuttonsetbitmapdisabled
}
168 \func{void
}{SetBitmapDisabled
}{\param{const wxBitmap\&
}{bitmap
}}
170 Sets the bitmap for the disabled button appearance.
172 \wxheading{Parameters
}
174 \docparam{bitmap
}{The bitmap to set.
}
178 \helpref{wxBitmapButton::GetBitmapDisabled
}{wxbitmapbuttongetbitmapdisabled
},
\rtfsp
179 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
180 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
181 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
183 \membersection{wxBitmapButton::SetBitmapFocus
}\label{wxbitmapbuttonsetbitmapfocus
}
185 \func{void
}{SetBitmapFocus
}{\param{const wxBitmap\&
}{bitmap
}}
187 Sets the bitmap for the button appearance when it has the keyboard focus.
189 \wxheading{Parameters
}
191 \docparam{bitmap
}{The bitmap to set.
}
195 \helpref{wxBitmapButton::GetBitmapFocus
}{wxbitmapbuttongetbitmapfocus
},
\rtfsp
196 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
197 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
198 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
200 \membersection{wxBitmapButton::SetBitmapLabel
}\label{wxbitmapbuttonsetbitmaplabel
}
202 \func{void
}{SetBitmapLabel
}{\param{const wxBitmap\&
}{bitmap
}}
204 Sets the bitmap label for the button.
206 \wxheading{Parameters
}
208 \docparam{bitmap
}{The bitmap label to set.
}
212 This is the bitmap used for the unselected state, and for all other states
213 if no other bitmaps are provided.
217 \helpref{wxBitmapButton::GetBitmapLabel
}{wxbitmapbuttongetbitmaplabel
}
219 \membersection{wxBitmapButton::SetBitmapSelected
}\label{wxbitmapbuttonsetbitmapselected
}
221 \func{void
}{SetBitmapSelected
}{\param{const wxBitmap\&
}{bitmap
}}
223 Sets the bitmap for the selected (depressed) button appearance.
225 \wxheading{Parameters
}
227 \docparam{bitmap
}{The bitmap to set.
}
231 \helpref{wxBitmapButton::GetBitmapSelected
}{wxbitmapbuttongetbitmapselected
},
\rtfsp
232 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
233 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
234 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}