2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: statbmp.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxStaticBitmap
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxStaticBitmap
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-07 12:57:34 -04:00
|
|
|
A static bitmap control displays a bitmap. Native implementations on some
|
|
|
|
platforms are only meant for display of the small icons in the dialog
|
2015-08-31 03:57:53 -04:00
|
|
|
boxes.
|
2008-10-07 12:57:34 -04:00
|
|
|
|
|
|
|
If you want to display larger images portably, you may use generic
|
|
|
|
implementation wxGenericStaticBitmap declared in \<wx/generic/statbmpg.h\>.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2013-02-08 19:35:54 -05:00
|
|
|
Notice that for the best results, the size of the control should be the
|
|
|
|
same as the size of the image displayed in it, as happens by default if
|
2014-05-22 10:35:43 -04:00
|
|
|
it's not resized explicitly. Otherwise, behaviour depends on the
|
2013-02-08 19:35:54 -05:00
|
|
|
platform: under MSW, the bitmap is drawn centred inside the control, while
|
2016-01-19 12:52:50 -05:00
|
|
|
elsewhere it is drawn at the origin of the control. You can use
|
|
|
|
SetScaleMode() to control how the image is scaled inside the control.
|
2013-02-08 19:35:54 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
2012-11-03 14:32:50 -04:00
|
|
|
@appearance{staticbitmap}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2014-05-22 10:35:43 -04:00
|
|
|
@see wxBitmap
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxStaticBitmap : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
2016-01-19 12:52:50 -05:00
|
|
|
/**
|
|
|
|
Specify how the bitmap should be scaled in the control.
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
@see SetScaleMode(), GetScaleMode()
|
|
|
|
*/
|
|
|
|
enum ScaleMode
|
|
|
|
{
|
2019-01-30 11:28:08 -05:00
|
|
|
/**
|
2016-01-19 12:52:50 -05:00
|
|
|
The bitmap is displayed in original size. Portions larger then the
|
|
|
|
control will be cut off.
|
|
|
|
*/
|
|
|
|
Scale_None,
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
/**
|
|
|
|
Scale the bitmap to fit the size of the control by changing the
|
|
|
|
aspect ratio of the bitmap if necessary.
|
|
|
|
*/
|
|
|
|
Scale_Fill,
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
/**
|
|
|
|
Scale the bitmap to fit the size of the control by maintaining the
|
|
|
|
aspect ratio. Any remaining area of the control will use the background.
|
|
|
|
*/
|
|
|
|
Scale_AspectFit,
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
/**
|
|
|
|
Scale the bitmap to fill the size of the control. Some portion of
|
|
|
|
the bitmap may be clipped to fill the control.
|
|
|
|
*/
|
|
|
|
Scale_AspectFill
|
|
|
|
};
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2008-05-29 10:10:52 -04:00
|
|
|
/**
|
|
|
|
Default constructor
|
|
|
|
*/
|
|
|
|
wxStaticBitmap();
|
2008-10-07 12:57:34 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructor, creating and showing a static bitmap control.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
Parent window. Should not be @NULL.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
Control identifier. A value of -1 denotes a default value.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param label
|
2008-03-09 08:33:59 -04:00
|
|
|
Bitmap label.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
Window position.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-03-09 08:33:59 -04:00
|
|
|
Window size.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
Window style. See wxStaticBitmap.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
Window name.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see Create()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxStaticBitmap(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxBitmap& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
2008-11-13 16:32:53 -05:00
|
|
|
const wxString& name = wxStaticBitmapNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creation function, for two-step construction. For details see wxStaticBitmap().
|
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id, const wxBitmap& label,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
2008-10-28 11:36:26 -04:00
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxString& name = wxStaticBitmapNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-07 12:57:34 -04:00
|
|
|
Returns the bitmap currently used in the control.
|
|
|
|
Notice that this method can be called even if SetIcon() had been used.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetBitmap()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxBitmap GetBitmap() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-07 12:57:34 -04:00
|
|
|
Returns the icon currently used in the control.
|
|
|
|
Notice that this method can only be called if SetIcon() had been used: an icon
|
|
|
|
can't be retrieved from the control if a bitmap had been set
|
|
|
|
(using wxStaticBitmap::SetBitmap).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetIcon()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxIcon GetIcon() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the bitmap label.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param label
|
2008-03-09 08:33:59 -04:00
|
|
|
The new bitmap.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetBitmap()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual void SetBitmap(const wxBitmap& label);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the label to the given icon.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param label
|
2008-03-09 08:33:59 -04:00
|
|
|
The new icon.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual void SetIcon(const wxIcon& label);
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
/**
|
|
|
|
Sets the scale mode.
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
@param scaleMode
|
|
|
|
Controls how the bitmap is scaled inside the control.
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
@note Currently only the generic implementation supports all scaling modes.
|
|
|
|
You may use generic implementation wxGenericStaticBitmap declared in
|
|
|
|
\<wx/generic/statbmpg.h\> in all ports.
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
@see GetScaleMode()
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
@since 3.1.0
|
|
|
|
*/
|
|
|
|
virtual void SetScaleMode(ScaleMode scaleMode);
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
/**
|
|
|
|
Returns the scale mode currently used in the control.
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
@see SetScaleMode()
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2016-01-19 12:52:50 -05:00
|
|
|
@since 3.1.0
|
|
|
|
*/
|
|
|
|
virtual ScaleMode GetScaleMode() const;
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|