2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: bmpbuttn.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxBitmapButton
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 13:29:13 +00:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxBitmapButton
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
A bitmap button is a control that contains a bitmap.
|
2008-03-17 00:47:38 +00:00
|
|
|
|
2009-06-14 22:55:24 +00: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 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginStyleTable
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxBU_LEFT}
|
2009-06-15 23:18:06 +00:00
|
|
|
Left-justifies the bitmap label.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxBU_TOP}
|
2008-03-17 00:47:38 +00:00
|
|
|
Aligns the bitmap label to the top of the button.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxBU_RIGHT}
|
2009-06-15 23:18:06 +00:00
|
|
|
Right-justifies the bitmap label.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxBU_BOTTOM}
|
2008-03-17 00:47:38 +00:00
|
|
|
Aligns the bitmap label to the bottom of the button.
|
2008-03-08 13:52:38 +00:00
|
|
|
@endStyleTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-17 00:47:38 +00: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 17:58:51 +00:00
|
|
|
@beginEventEmissionTable{wxCommandEvent}
|
2008-04-06 14:43:04 +00:00
|
|
|
@event{EVT_BUTTON(id, func)}
|
2011-01-06 19:52:14 +00:00
|
|
|
Process a @c wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.
|
2008-03-08 13:52:38 +00:00
|
|
|
@endEventTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
2012-11-03 18:32:50 +00:00
|
|
|
@appearance{bitmapbutton}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxButton
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxBitmapButton : public wxButton
|
|
|
|
{
|
|
|
|
public:
|
2008-03-17 00:47:38 +00:00
|
|
|
/**
|
|
|
|
Default ctor.
|
|
|
|
*/
|
|
|
|
wxBitmapButton();
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
Constructor, creating and showing a button.
|
2008-03-17 00:47:38 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-09 12:33:59 +00:00
|
|
|
Parent window. Must not be @NULL.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-09 12:33:59 +00:00
|
|
|
Button identifier. The value wxID_ANY indicates a default value.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param bitmap
|
2008-03-09 12:33:59 +00:00
|
|
|
Bitmap to be displayed.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-03-09 12:33:59 +00:00
|
|
|
Button position.
|
2009-04-21 11:21:36 +00:00
|
|
|
If ::wxDefaultPosition is specified then a default position is chosen.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2009-04-21 11:21:36 +00:00
|
|
|
Button size.
|
|
|
|
If ::wxDefaultSize is specified then the button is sized appropriately
|
|
|
|
for the bitmap.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
Window style. See wxBitmapButton.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param validator
|
2008-03-09 12:33:59 +00:00
|
|
|
Window validator.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
Window name.
|
2008-03-17 00:47:38 +00: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 22:55:24 +00:00
|
|
|
If you want more control, call any of the functions SetBitmapPressed(),
|
2008-03-17 00:47:38 +00:00
|
|
|
SetBitmapFocus(), SetBitmapDisabled().
|
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see Create(), wxValidator
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00: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 12:22:08 +00:00
|
|
|
const wxString& name = wxButtonNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-03-17 00:47:38 +00:00
|
|
|
Button creation function for two-step creation.
|
|
|
|
For more details, see wxBitmapButton().
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxBitmap& bitmap,
|
2008-03-25 12:22:08 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxSize& size = wxDefaultSize,
|
2008-03-25 12:22:08 +00:00
|
|
|
long style = wxBU_AUTODRAW,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr);
|
2012-09-13 17:14:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Helper function creating a standard-looking "Close" button.
|
|
|
|
|
|
|
|
To get the best results, platform-specific code may need to be used to
|
|
|
|
create a small, title bar-like "Close" button. This function is
|
|
|
|
provided to avoid the need to test for the current platform and creates
|
|
|
|
the button with as native look as possible.
|
|
|
|
|
|
|
|
@param parent The button parent window, must be non-@NULL.
|
|
|
|
@param winid The identifier for the new button.
|
|
|
|
@return The new button.
|
|
|
|
|
|
|
|
@since 2.9.5
|
|
|
|
*/
|
|
|
|
static wxBitmapButton* NewCloseButton(wxWindow* parent, wxWindowID winid);
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|