statbmp.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk/statbmp.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef __GTKSTATICBITMAPH__
  9. #define __GTKSTATICBITMAPH__
  10. #include "wx/icon.h"
  11. //-----------------------------------------------------------------------------
  12. // wxStaticBitmap
  13. //-----------------------------------------------------------------------------
  14. class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase
  15. {
  16. public:
  17. wxStaticBitmap();
  18. wxStaticBitmap( wxWindow *parent,
  19. wxWindowID id,
  20. const wxBitmap& label,
  21. const wxPoint& pos = wxDefaultPosition,
  22. const wxSize& size = wxDefaultSize,
  23. long style = 0,
  24. const wxString& name = wxStaticBitmapNameStr );
  25. bool Create( wxWindow *parent,
  26. wxWindowID id,
  27. const wxBitmap& label,
  28. const wxPoint& pos = wxDefaultPosition,
  29. const wxSize& size = wxDefaultSize,
  30. long style = 0,
  31. const wxString& name = wxStaticBitmapNameStr);
  32. virtual void SetIcon(const wxIcon& icon) { SetBitmap( icon ); }
  33. virtual void SetBitmap( const wxBitmap& bitmap );
  34. virtual wxBitmap GetBitmap() const { return m_bitmap; }
  35. // for compatibility with wxMSW
  36. wxIcon GetIcon() const
  37. {
  38. // don't use wxDynamicCast, icons and bitmaps are really the same thing
  39. // in wxGTK
  40. return (const wxIcon &)m_bitmap;
  41. }
  42. static wxVisualAttributes
  43. GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
  44. private:
  45. wxBitmap m_bitmap;
  46. DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
  47. };
  48. #endif // __GTKSTATICBITMAPH__