2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: bmpbuttn.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxBitmapButton
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxBitmapButton
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
A bitmap button is a control that contains a bitmap.
|
2008-03-16 20:47:38 -04:00
|
|
|
|
2009-06-14 18:55:24 -04:00
|
|
|
Notice that since wxWidgets 2.9.1 bitmap display is supported by the base
|
|
|
|
wxButton class itself and the only tiny advantage of using this class is
|
|
|
|
that it allows to specify the bitmap in its constructor, unlike wxButton.
|
|
|
|
Please see the base class documentation for more information about images
|
|
|
|
support in wxButton.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@beginStyleTable
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxBU_LEFT}
|
2009-06-15 19:18:06 -04:00
|
|
|
Left-justifies the bitmap label.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxBU_TOP}
|
2008-03-16 20:47:38 -04:00
|
|
|
Aligns the bitmap label to the top of the button.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxBU_RIGHT}
|
2009-06-15 19:18:06 -04:00
|
|
|
Right-justifies the bitmap label.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxBU_BOTTOM}
|
2008-03-16 20:47:38 -04:00
|
|
|
Aligns the bitmap label to the bottom of the button.
|
2008-03-08 08:52:38 -05:00
|
|
|
@endStyleTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-16 20:47:38 -04:00
|
|
|
Note that the wxBU_EXACTFIT style supported by wxButton is not used by this
|
|
|
|
class as bitmap buttons don't have any minimal standard size by default.
|
|
|
|
|
2009-02-18 12:58:51 -05:00
|
|
|
@beginEventEmissionTable{wxCommandEvent}
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_BUTTON(id, func)}
|
2011-01-06 14:52:14 -05:00
|
|
|
Process a @c wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.
|
2008-03-08 08:52:38 -05:00
|
|
|
@endEventTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
2008-10-13 04:05:18 -04:00
|
|
|
@appearance{bitmapbutton.png}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxButton
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxBitmapButton : public wxButton
|
|
|
|
{
|
|
|
|
public:
|
2008-03-16 20:47:38 -04:00
|
|
|
/**
|
|
|
|
Default ctor.
|
|
|
|
*/
|
|
|
|
wxBitmapButton();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructor, creating and showing a button.
|
2008-03-16 20:47:38 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
Parent window. Must not be @NULL.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
Button identifier. The value wxID_ANY indicates a default value.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param bitmap
|
2008-03-09 08:33:59 -04:00
|
|
|
Bitmap to be displayed.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
Button position.
|
2009-04-21 07:21:36 -04:00
|
|
|
If ::wxDefaultPosition is specified then a default position is chosen.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2009-04-21 07:21:36 -04:00
|
|
|
Button size.
|
|
|
|
If ::wxDefaultSize is specified then the button is sized appropriately
|
|
|
|
for the bitmap.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
Window style. See wxBitmapButton.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param validator
|
2008-03-09 08:33:59 -04:00
|
|
|
Window validator.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
Window name.
|
2008-03-16 20:47:38 -04:00
|
|
|
|
|
|
|
@remarks The bitmap parameter is normally the only bitmap you need to provide,
|
|
|
|
and wxWidgets will draw the button correctly in its different states.
|
2009-06-14 18:55:24 -04:00
|
|
|
If you want more control, call any of the functions SetBitmapPressed(),
|
2008-03-16 20:47:38 -04:00
|
|
|
SetBitmapFocus(), SetBitmapDisabled().
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see Create(), wxValidator
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxBitmapButton(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxBitmap& bitmap,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxBU_AUTODRAW,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2008-03-25 08:22:08 -04:00
|
|
|
const wxString& name = wxButtonNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-16 20:47:38 -04:00
|
|
|
Button creation function for two-step creation.
|
|
|
|
For more details, see wxBitmapButton().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxBitmap& bitmap,
|
2008-03-25 08:22:08 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxSize& size = wxDefaultSize,
|
2008-03-25 08:22:08 -04:00
|
|
|
long style = wxBU_AUTODRAW,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|