1 ///////////////////////////////////////////////////////////////////////////// 2 // Name: wx/statbmp.h 3 // Purpose: wxStaticBitmap class interface 4 // Author: Vadim Zeitlin 5 // Modified by: 6 // Created: 25.08.00 7 // Copyright: (c) 2000 Vadim Zeitlin 8 // Licence: wxWindows licence 9 ///////////////////////////////////////////////////////////////////////////// 10 11 #ifndef _WX_STATBMP_H_BASE_ 12 #define _WX_STATBMP_H_BASE_ 13 14 #include "wx/defs.h" 15 16 #if wxUSE_STATBMP 17 18 #include "wx/control.h" 19 #include "wx/bitmap.h" 20 #include "wx/icon.h" 21 22 extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticBitmapNameStr[]; 23 24 // a control showing an icon or a bitmap 25 class WXDLLIMPEXP_CORE wxStaticBitmapBase : public wxControl 26 { 27 public: 28 enum ScaleMode 29 { 30 Scale_None, 31 Scale_Fill, 32 Scale_AspectFit, 33 Scale_AspectFill 34 }; 35 wxStaticBitmapBase()36 wxStaticBitmapBase() { } 37 virtual ~wxStaticBitmapBase(); 38 39 // our interface 40 virtual void SetIcon(const wxIcon& icon) = 0; 41 virtual void SetBitmap(const wxBitmap& bitmap) = 0; 42 virtual wxBitmap GetBitmap() const = 0; GetIcon()43 virtual wxIcon GetIcon() const /* = 0 -- should be pure virtual */ 44 { 45 // stub it out here for now as not all ports implement it (but they 46 // should) 47 return wxIcon(); 48 } SetScaleMode(ScaleMode WXUNUSED (scaleMode))49 virtual void SetScaleMode(ScaleMode WXUNUSED(scaleMode)) { } GetScaleMode()50 virtual ScaleMode GetScaleMode() const { return Scale_None; } 51 52 // overridden base class virtuals AcceptsFocus()53 virtual bool AcceptsFocus() const wxOVERRIDE { return false; } HasTransparentBackground()54 virtual bool HasTransparentBackground() wxOVERRIDE { return true; } 55 56 protected: 57 // choose the default border for this window GetDefaultBorder()58 virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } 59 60 virtual wxSize DoGetBestSize() const wxOVERRIDE; 61 62 wxDECLARE_NO_COPY_CLASS(wxStaticBitmapBase); 63 }; 64 65 #if defined(__WXUNIVERSAL__) 66 #include "wx/univ/statbmp.h" 67 #elif defined(__WXMSW__) 68 #include "wx/msw/statbmp.h" 69 #elif defined(__WXMOTIF__) 70 #include "wx/motif/statbmp.h" 71 #elif defined(__WXGTK20__) 72 #include "wx/gtk/statbmp.h" 73 #elif defined(__WXGTK__) 74 #include "wx/gtk1/statbmp.h" 75 #elif defined(__WXMAC__) 76 #include "wx/osx/statbmp.h" 77 #elif defined(__WXQT__) 78 #include "wx/qt/statbmp.h" 79 #endif 80 81 #endif // wxUSE_STATBMP 82 83 #endif 84 // _WX_STATBMP_H_BASE_ 85