1998-05-20 10:25:30 -04:00
|
|
|
\section{\class{wxBitmapButton}}\label{wxbitmapbutton}
|
|
|
|
|
|
|
|
A bitmap button is a control that contains a bitmap.
|
|
|
|
It may be placed on a \helpref{dialog box}{wxdialog} or \helpref{panel}{wxpanel}, or indeed
|
|
|
|
almost any other window.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxButton}{wxbutton}\\
|
|
|
|
\helpref{wxControl}{wxcontrol}\\
|
|
|
|
\helpref{wxWindow}{wxwindow}\\
|
|
|
|
\helpref{wxEvtHandler}{wxevthandler}\\
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/bmpbuttn.h>
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{Remarks}
|
|
|
|
|
2004-05-04 04:27:20 -04:00
|
|
|
A bitmap button can be supplied with a single bitmap, and wxWidgets will draw
|
1998-05-20 10:25:30 -04:00
|
|
|
all button states using this bitmap. If the application needs more control, additional bitmaps for
|
2000-07-15 15:51:35 -04:00
|
|
|
the selected state, unpressed focused state, and greyed-out state may be supplied.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\wxheading{Window styles}
|
|
|
|
|
|
|
|
\twocolwidtha{5cm}
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{\windowstyle{wxBU\_AUTODRAW}}{If
|
|
|
|
this is specified, the button will be drawn automatically using the label bitmap only, providing
|
|
|
|
a 3D-look border. If this style is not specified, the button will be drawn without borders and using all
|
2000-07-15 15:51:35 -04:00
|
|
|
provided bitmaps. WIN32 only.}
|
|
|
|
\twocolitem{\windowstyle{wxBU\_LEFT}}{Left-justifies the bitmap label. WIN32 only.}
|
|
|
|
\twocolitem{\windowstyle{wxBU\_TOP}}{Aligns the bitmap label to the top of the button. WIN32 only.}
|
|
|
|
\twocolitem{\windowstyle{wxBU\_RIGHT}}{Right-justifies the bitmap label. WIN32 only.}
|
|
|
|
\twocolitem{\windowstyle{wxBU\_BOTTOM}}{Aligns the bitmap label to the bottom of the button. WIN32 only.}
|
1998-05-20 10:25:30 -04:00
|
|
|
\end{twocollist}
|
|
|
|
|
2004-10-28 18:43:14 -04:00
|
|
|
Note that \windowstyle{wxBU\_EXACTFIT} supported by
|
|
|
|
\helpref{wxButton}{wxbutton} is \emph{not} used by this class as bitmap buttons
|
|
|
|
don't have any minimal standard size by default.
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
See also \helpref{window styles overview}{windowstyles}.
|
|
|
|
|
1998-08-06 15:42:06 -04:00
|
|
|
\wxheading{Event handling}
|
|
|
|
|
|
|
|
\twocolwidtha{7cm}
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{{\bf EVT\_BUTTON(id, func)}}{Process a wxEVT\_COMMAND\_BUTTON\_CLICKED event,
|
|
|
|
when the button is clicked.}
|
|
|
|
\end{twocollist}
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxButton}{wxbutton}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxBitmapButton::wxBitmapButton}\label{wxbitmapbuttonctor}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{}{wxBitmapButton}{\void}
|
|
|
|
|
|
|
|
Default constructor.
|
|
|
|
|
1999-08-24 12:17:22 -04:00
|
|
|
\func{}{wxBitmapButton}{
|
|
|
|
\param{wxWindow* }{parent},
|
|
|
|
\param{wxWindowID }{id},
|
|
|
|
\param{const wxBitmap\& }{bitmap},\rtfsp
|
|
|
|
\param{const wxPoint\& }{pos = wxDefaultPosition},
|
|
|
|
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
|
|
|
\param{long }{style = wxBU\_AUTODRAW},
|
|
|
|
\param{const wxValidator\& }{validator = wxDefaultValidator},
|
|
|
|
\param{const wxString\& }{name = ``button"}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Constructor, creating and showing a button.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{parent}{Parent window. Must not be NULL.}
|
|
|
|
|
|
|
|
\docparam{id}{Button identifier. A value of -1 indicates a default value.}
|
|
|
|
|
|
|
|
\docparam{bitmap}{Bitmap to be displayed.}
|
|
|
|
|
|
|
|
\docparam{pos}{Button position.}
|
|
|
|
|
|
|
|
\docparam{size}{Button size. If the default size (-1, -1) is specified then the button is sized
|
|
|
|
appropriately for the bitmap.}
|
|
|
|
|
|
|
|
\docparam{style}{Window style. See \helpref{wxBitmapButton}{wxbitmapbutton}.}
|
|
|
|
|
|
|
|
\docparam{validator}{Window validator.}
|
|
|
|
|
|
|
|
\docparam{name}{Window name.}
|
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
2004-05-04 04:27:20 -04:00
|
|
|
The {\it bitmap} parameter is normally the only bitmap you need to provide, and wxWidgets will
|
1998-05-20 10:25:30 -04:00
|
|
|
draw the button correctly in its different states. If you want more control, call
|
|
|
|
any of the functions \helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected},\rtfsp
|
|
|
|
\helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus},\rtfsp
|
|
|
|
\helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled}.
|
|
|
|
|
|
|
|
Note that the bitmap passed is smaller than the actual button created.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxBitmapButton::Create}{wxbitmapbuttoncreate}, \helpref{wxValidator}{wxvalidator}
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxBitmapButton::\destruct{wxBitmapButton}}\label{wxbitmapbuttondtor}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{}{\destruct{wxBitmapButton}}{\void}
|
|
|
|
|
|
|
|
Destructor, destroying the button.
|
|
|
|
|
|
|
|
\membersection{wxBitmapButton::Create}\label{wxbitmapbuttoncreate}
|
|
|
|
|
1998-06-14 08:11:50 -04:00
|
|
|
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id}, \param{const wxBitmap\& }{bitmap},\rtfsp
|
1998-05-20 10:25:30 -04:00
|
|
|
\param{const wxPoint\& }{pos}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
1998-06-14 08:11:50 -04:00
|
|
|
\param{long}{ style = 0}, \param{const wxValidator\& }{validator}, \param{const wxString\& }{name = ``button"}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
Button creation function for two-step creation. For more details, see \helpref{wxBitmapButton::wxBitmapButton}{wxbitmapbuttonctor}.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxBitmapButton::GetBitmapDisabled}\label{wxbitmapbuttongetbitmapdisabled}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
\constfunc{wxBitmap\&}{GetBitmapDisabled}{\void}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Returns the bitmap for the disabled state.
|
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
|
|
|
A reference to the disabled state bitmap.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled}
|
|
|
|
|
|
|
|
\membersection{wxBitmapButton::GetBitmapFocus}\label{wxbitmapbuttongetbitmapfocus}
|
|
|
|
|
|
|
|
\constfunc{wxBitmap\&}{GetBitmapFocus}{\void}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Returns the bitmap for the focused state.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
A reference to the focused state bitmap.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus}
|
|
|
|
|
|
|
|
\membersection{wxBitmapButton::GetBitmapLabel}\label{wxbitmapbuttongetbitmaplabel}
|
|
|
|
|
|
|
|
\constfunc{wxBitmap\&}{GetBitmapLabel}{\void}
|
|
|
|
|
|
|
|
Returns the label bitmap (the one passed to the constructor).
|
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
|
|
|
A reference to the button's label bitmap.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel}
|
|
|
|
|
|
|
|
\membersection{wxBitmapButton::GetBitmapSelected}\label{wxbitmapbuttongetbitmapselected}
|
|
|
|
|
|
|
|
\constfunc{wxBitmap\&}{GetBitmapSelected}{\void}
|
|
|
|
|
|
|
|
Returns the bitmap for the selected state.
|
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
|
|
|
A reference to the selected state bitmap.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected}
|
|
|
|
|
|
|
|
\membersection{wxBitmapButton::SetBitmapDisabled}\label{wxbitmapbuttonsetbitmapdisabled}
|
|
|
|
|
|
|
|
\func{void}{SetBitmapDisabled}{\param{const wxBitmap\& }{bitmap}}
|
|
|
|
|
|
|
|
Sets the bitmap for the disabled button appearance.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{bitmap}{The bitmap to set.}
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxBitmapButton::GetBitmapDisabled}{wxbitmapbuttongetbitmapdisabled},\rtfsp
|
|
|
|
\helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel},\rtfsp
|
|
|
|
\helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected},\rtfsp
|
|
|
|
\helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus}
|
|
|
|
|
|
|
|
\membersection{wxBitmapButton::SetBitmapFocus}\label{wxbitmapbuttonsetbitmapfocus}
|
|
|
|
|
|
|
|
\func{void}{SetBitmapFocus}{\param{const wxBitmap\& }{bitmap}}
|
|
|
|
|
|
|
|
Sets the bitmap for the button appearance when it has the keyboard focus.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{bitmap}{The bitmap to set.}
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxBitmapButton::GetBitmapFocus}{wxbitmapbuttongetbitmapfocus},\rtfsp
|
|
|
|
\helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel},\rtfsp
|
|
|
|
\helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected},\rtfsp
|
|
|
|
\helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled}
|
|
|
|
|
|
|
|
\membersection{wxBitmapButton::SetBitmapLabel}\label{wxbitmapbuttonsetbitmaplabel}
|
|
|
|
|
|
|
|
\func{void}{SetBitmapLabel}{\param{const wxBitmap\& }{bitmap}}
|
|
|
|
|
|
|
|
Sets the bitmap label for the button.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{bitmap}{The bitmap label to set.}
|
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
This is the bitmap used for the unselected state, and for all other states
|
|
|
|
if no other bitmaps are provided.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxBitmapButton::GetBitmapLabel}{wxbitmapbuttongetbitmaplabel}
|
|
|
|
|
|
|
|
\membersection{wxBitmapButton::SetBitmapSelected}\label{wxbitmapbuttonsetbitmapselected}
|
|
|
|
|
|
|
|
\func{void}{SetBitmapSelected}{\param{const wxBitmap\& }{bitmap}}
|
|
|
|
|
|
|
|
Sets the bitmap for the selected (depressed) button appearance.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{bitmap}{The bitmap to set.}
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxBitmapButton::GetBitmapSelected}{wxbitmapbuttongetbitmapselected},\rtfsp
|
|
|
|
\helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel},\rtfsp
|
|
|
|
\helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus},\rtfsp
|
|
|
|
\helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled}
|
|
|
|
|