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
}
17 A bitmap button can be supplied with a single bitmap, and wxWindows will draw
18 all button states using this bitmap. If the application needs more control, additional bitmaps for
19 the selected state, unpressed focussed state, and greyed-out state may be supplied.
21 \wxheading{Window styles
}
24 \begin{twocollist
}\itemsep=
0pt
25 \twocolitem{\windowstyle{wxBU
\_AUTODRAW}}{If
26 this is specified, the button will be drawn automatically using the label bitmap only, providing
27 a
3D-look border. If this style is not specified, the button will be drawn without borders and using all
31 See also
\helpref{window styles overview
}{windowstyles
}.
33 \wxheading{Event handling
}
36 \begin{twocollist
}\itemsep=
0pt
37 \twocolitem{{\bf EVT
\_BUTTON(id, func)
}}{Process a wxEVT
\_COMMAND\_BUTTON\_CLICKED event,
38 when the button is clicked.
}
43 \helpref{wxButton
}{wxbutton
}
45 \latexignore{\rtfignore{\wxheading{Members
}}}
47 \membersection{wxBitmapButton::wxBitmapButton
}\label{wxbitmapbuttonconstr
}
49 \func{}{wxBitmapButton
}{\void}
53 \func{}{wxBitmapButton
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{ id
},
\param{const wxBitmap\&
}{bitmap
},
\rtfsp
54 \param{const wxPoint\&
}{pos
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
55 \param{long
}{ style = wxBU
\_AUTODRAW},
\param{const wxValidator\&
}{validator
},
\param{const wxString\&
}{name = ``button"
}}
57 Constructor, creating and showing a button.
59 \wxheading{Parameters
}
61 \docparam{parent
}{Parent window. Must not be NULL.
}
63 \docparam{id
}{Button identifier. A value of -
1 indicates a default value.
}
65 \docparam{bitmap
}{Bitmap to be displayed.
}
67 \docparam{pos
}{Button position.
}
69 \docparam{size
}{Button size. If the default size (-
1, -
1) is specified then the button is sized
70 appropriately for the bitmap.
}
72 \docparam{style
}{Window style. See
\helpref{wxBitmapButton
}{wxbitmapbutton
}.
}
74 \docparam{validator
}{Window validator.
}
76 \docparam{name
}{Window name.
}
80 The
{\it bitmap
} parameter is normally the only bitmap you need to provide, and wxWindows will
81 draw the button correctly in its different states. If you want more control, call
82 any of the functions
\helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
83 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
84 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}.
86 Note that the bitmap passed is smaller than the actual button created.
90 \helpref{wxBitmapButton::Create
}{wxbitmapbuttoncreate
},
\helpref{wxValidator
}{wxvalidator
}
92 \membersection{wxBitmapButton::
\destruct{wxBitmapButton
}}
94 \func{}{\destruct{wxBitmapButton
}}{\void}
96 Destructor, destroying the button.
98 \membersection{wxBitmapButton::Create
}\label{wxbitmapbuttoncreate
}
100 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{ id
},
\param{const wxBitmap\&
}{bitmap
},
\rtfsp
101 \param{const wxPoint\&
}{pos
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
102 \param{long
}{ style =
0},
\param{const wxValidator\&
}{validator
},
\param{const wxString\&
}{name = ``button"
}}
104 Button creation function for two-step creation. For more details, see
\helpref{wxBitmapButton::wxBitmapButton
}{wxbitmapbuttonconstr
}.
106 \membersection{wxBitmapButton::GetBitmapDisabled
}\label{wxbitmapbuttongetbitmapdisabled
}
108 \constfunc{wxBitmap\&
}{GetBitmapLabel
}{\void}
110 Returns the bitmap for the disabled state.
112 \wxheading{Return value
}
114 A reference to the disabled state bitmap.
118 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
120 \membersection{wxBitmapButton::GetBitmapFocus
}\label{wxbitmapbuttongetbitmapfocus
}
122 \constfunc{wxBitmap\&
}{GetBitmapFocus
}{\void}
124 Returns the bitmap for the focussed state.
126 \wxheading{Return value
}
128 A reference to the focussed state bitmap.
132 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
134 \membersection{wxBitmapButton::GetBitmapLabel
}\label{wxbitmapbuttongetbitmaplabel
}
136 \constfunc{wxBitmap\&
}{GetBitmapLabel
}{\void}
138 Returns the label bitmap (the one passed to the constructor).
140 \wxheading{Return value
}
142 A reference to the button's label bitmap.
146 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
}
148 \membersection{wxBitmapButton::GetBitmapSelected
}\label{wxbitmapbuttongetbitmapselected
}
150 \constfunc{wxBitmap\&
}{GetBitmapSelected
}{\void}
152 Returns the bitmap for the selected state.
154 \wxheading{Return value
}
156 A reference to the selected state bitmap.
160 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
}
162 \membersection{wxBitmapButton::SetBitmapDisabled
}\label{wxbitmapbuttonsetbitmapdisabled
}
164 \func{void
}{SetBitmapDisabled
}{\param{const wxBitmap\&
}{bitmap
}}
166 Sets the bitmap for the disabled button appearance.
168 \wxheading{Parameters
}
170 \docparam{bitmap
}{The bitmap to set.
}
174 \helpref{wxBitmapButton::GetBitmapDisabled
}{wxbitmapbuttongetbitmapdisabled
},
\rtfsp
175 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
176 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
177 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
179 \membersection{wxBitmapButton::SetBitmapFocus
}\label{wxbitmapbuttonsetbitmapfocus
}
181 \func{void
}{SetBitmapFocus
}{\param{const wxBitmap\&
}{bitmap
}}
183 Sets the bitmap for the button appearance when it has the keyboard focus.
185 \wxheading{Parameters
}
187 \docparam{bitmap
}{The bitmap to set.
}
191 \helpref{wxBitmapButton::GetBitmapFocus
}{wxbitmapbuttongetbitmapfocus
},
\rtfsp
192 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
193 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
194 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
196 \membersection{wxBitmapButton::SetBitmapLabel
}\label{wxbitmapbuttonsetbitmaplabel
}
198 \func{void
}{SetBitmapLabel
}{\param{const wxBitmap\&
}{bitmap
}}
200 Sets the bitmap label for the button.
202 \wxheading{Parameters
}
204 \docparam{bitmap
}{The bitmap label to set.
}
208 This is the bitmap used for the unselected state, and for all other states
209 if no other bitmaps are provided.
213 \helpref{wxBitmapButton::GetBitmapLabel
}{wxbitmapbuttongetbitmaplabel
}
215 \membersection{wxBitmapButton::SetBitmapSelected
}\label{wxbitmapbuttonsetbitmapselected
}
217 \func{void
}{SetBitmapSelected
}{\param{const wxBitmap\&
}{bitmap
}}
219 Sets the bitmap for the selected (depressed) button appearance.
221 \wxheading{Parameters
}
223 \docparam{bitmap
}{The bitmap to set.
}
227 \helpref{wxBitmapButton::GetBitmapSelected
}{wxbitmapbuttongetbitmapselected
},
\rtfsp
228 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
229 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
230 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}