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

@@ -56,6 +56,13 @@ public:
wxIcon GetIcon() const wxOVERRIDE { return (const wxIcon &)m_bitmap; }
#endif
virtual void SetScaleMode(ScaleMode scaleMode) wxOVERRIDE
{
m_scaleMode = scaleMode;
Refresh();
}
virtual ScaleMode GetScaleMode() const wxOVERRIDE { return m_scaleMode; }
private:
wxSize GetBitmapSize()
@@ -67,6 +74,7 @@ private:
void OnPaint(wxPaintEvent& event);
wxBitmap m_bitmap;
ScaleMode m_scaleMode;
wxDECLARE_DYNAMIC_CLASS(wxGenericStaticBitmap);
};