Add wxStaticBitmap::SetScaleMode() to control bitmap display size

This allows a bitmap to scale with the size of the wxStaticBitmap control.
Scaling can be controlled to fill the control with or without changing the
bitmaps aspect ratio.
This commit is contained in:
Tobias Taschner
2016-01-19 18:52:50 +01:00
committed by Vadim Zeitlin
parent 9c95b398c8
commit 58c7e6d54f
5 changed files with 157 additions and 3 deletions

View File

@@ -25,6 +25,14 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticBitmapNameStr[];
class WXDLLIMPEXP_CORE wxStaticBitmapBase : public wxControl
{
public:
enum ScaleMode
{
Scale_None,
Scale_Fill,
Scale_AspectFit,
Scale_AspectFill
};
wxStaticBitmapBase() { }
virtual ~wxStaticBitmapBase();
@@ -38,6 +46,8 @@ public:
// should)
return wxIcon();
}
virtual void SetScaleMode(ScaleMode WXUNUSED(scaleMode)) { }
virtual ScaleMode GetScaleMode() const { return Scale_None; }
// overridden base class virtuals
virtual bool AcceptsFocus() const wxOVERRIDE { return false; }