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
}.
35 \helpref{wxButton
}{wxbutton
}
37 \latexignore{\rtfignore{\wxheading{Members
}}}
39 \membersection{wxBitmapButton::wxBitmapButton
}\label{wxbitmapbuttonconstr
}
41 \func{}{wxBitmapButton
}{\void}
45 \func{}{wxBitmapButton
}{\param{wxWindow*
}{parent
},
\param{const wxWindowID
}{ id
},
\param{const wxBitmap\&
}{bitmap
},
\rtfsp
46 \param{const wxPoint\&
}{pos
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
47 \param{const long
}{ style = wxBU
\_AUTODRAW},
\param{const wxValidator\&
}{validator
},
\param{const wxString\&
}{name = ``button"
}}
49 Constructor, creating and showing a button.
51 \wxheading{Parameters
}
53 \docparam{parent
}{Parent window. Must not be NULL.
}
55 \docparam{id
}{Button identifier. A value of -
1 indicates a default value.
}
57 \docparam{bitmap
}{Bitmap to be displayed.
}
59 \docparam{pos
}{Button position.
}
61 \docparam{size
}{Button size. If the default size (-
1, -
1) is specified then the button is sized
62 appropriately for the bitmap.
}
64 \docparam{style
}{Window style. See
\helpref{wxBitmapButton
}{wxbitmapbutton
}.
}
66 \docparam{validator
}{Window validator.
}
68 \docparam{name
}{Window name.
}
72 The
{\it bitmap
} parameter is normally the only bitmap you need to provide, and wxWindows will
73 draw the button correctly in its different states. If you want more control, call
74 any of the functions
\helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
75 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
76 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}.
78 Note that the bitmap passed is smaller than the actual button created.
82 \helpref{wxBitmapButton::Create
}{wxbitmapbuttoncreate
},
\helpref{wxValidator
}{wxvalidator
}
84 \membersection{wxBitmapButton::
\destruct{wxBitmapButton
}}
86 \func{}{\destruct{wxBitmapButton
}}{\void}
88 Destructor, destroying the button.
90 \membersection{wxBitmapButton::Create
}\label{wxbitmapbuttoncreate
}
92 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{const wxWindowID
}{ id
},
\param{const wxBitmap\&
}{bitmap
},
\rtfsp
93 \param{const wxPoint\&
}{pos
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
94 \param{const long
}{ style =
0},
\param{const wxValidator\&
}{validator
},
\param{const wxString\&
}{name = ``button"
}}
96 Button creation function for two-step creation. For more details, see
\helpref{wxBitmapButton::wxBitmapButton
}{wxbitmapbuttonconstr
}.
98 \membersection{wxBitmapButton::GetBitmapDisabled
}\label{wxbitmapbuttongetbitmapdisabled
}
100 \constfunc{wxBitmap\&
}{GetBitmapLabel
}{\void}
102 Returns the bitmap for the disabled state.
104 \wxheading{Return value
}
106 A reference to the disabled state bitmap.
110 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
112 \membersection{wxBitmapButton::GetBitmapFocus
}\label{wxbitmapbuttongetbitmapfocus
}
114 \constfunc{wxBitmap\&
}{GetBitmapFocus
}{\void}
116 Returns the bitmap for the focussed state.
118 \wxheading{Return value
}
120 A reference to the focussed state bitmap.
124 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
126 \membersection{wxBitmapButton::GetBitmapLabel
}\label{wxbitmapbuttongetbitmaplabel
}
128 \constfunc{wxBitmap\&
}{GetBitmapLabel
}{\void}
130 Returns the label bitmap (the one passed to the constructor).
132 \wxheading{Return value
}
134 A reference to the button's label bitmap.
138 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
}
140 \membersection{wxBitmapButton::GetBitmapSelected
}\label{wxbitmapbuttongetbitmapselected
}
142 \constfunc{wxBitmap\&
}{GetBitmapSelected
}{\void}
144 Returns the bitmap for the selected state.
146 \wxheading{Return value
}
148 A reference to the selected state bitmap.
152 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
}
154 \membersection{wxBitmapButton::SetBitmapDisabled
}\label{wxbitmapbuttonsetbitmapdisabled
}
156 \func{void
}{SetBitmapDisabled
}{\param{const wxBitmap\&
}{bitmap
}}
158 Sets the bitmap for the disabled button appearance.
160 \wxheading{Parameters
}
162 \docparam{bitmap
}{The bitmap to set.
}
166 \helpref{wxBitmapButton::GetBitmapDisabled
}{wxbitmapbuttongetbitmapdisabled
},
\rtfsp
167 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
168 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
169 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
}
171 \membersection{wxBitmapButton::SetBitmapFocus
}\label{wxbitmapbuttonsetbitmapfocus
}
173 \func{void
}{SetBitmapFocus
}{\param{const wxBitmap\&
}{bitmap
}}
175 Sets the bitmap for the button appearance when it has the keyboard focus.
177 \wxheading{Parameters
}
179 \docparam{bitmap
}{The bitmap to set.
}
183 \helpref{wxBitmapButton::GetBitmapFocus
}{wxbitmapbuttongetbitmapfocus
},
\rtfsp
184 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
185 \helpref{wxBitmapButton::SetBitmapSelected
}{wxbitmapbuttonsetbitmapselected
},
\rtfsp
186 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}
188 \membersection{wxBitmapButton::SetBitmapLabel
}\label{wxbitmapbuttonsetbitmaplabel
}
190 \func{void
}{SetBitmapLabel
}{\param{const wxBitmap\&
}{bitmap
}}
192 Sets the bitmap label for the button.
194 \wxheading{Parameters
}
196 \docparam{bitmap
}{The bitmap label to set.
}
200 This is the bitmap used for the unselected state, and for all other states
201 if no other bitmaps are provided.
205 \helpref{wxBitmapButton::GetBitmapLabel
}{wxbitmapbuttongetbitmaplabel
}
207 \membersection{wxBitmapButton::SetBitmapSelected
}\label{wxbitmapbuttonsetbitmapselected
}
209 \func{void
}{SetBitmapSelected
}{\param{const wxBitmap\&
}{bitmap
}}
211 Sets the bitmap for the selected (depressed) button appearance.
213 \wxheading{Parameters
}
215 \docparam{bitmap
}{The bitmap to set.
}
219 \helpref{wxBitmapButton::GetBitmapSelected
}{wxbitmapbuttongetbitmapselected
},
\rtfsp
220 \helpref{wxBitmapButton::SetBitmapLabel
}{wxbitmapbuttonsetbitmaplabel
},
\rtfsp
221 \helpref{wxBitmapButton::SetBitmapFocus
}{wxbitmapbuttonsetbitmapfocus
},
\rtfsp
222 \helpref{wxBitmapButton::SetBitmapDisabled
}{wxbitmapbuttonsetbitmapdisabled
}