statbmp.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/carbon/statbmp.h
  3. // Purpose: wxStaticBitmap class
  4. // Author: Stefan Csomor
  5. // Modified by:
  6. // Created: 1998-01-01
  7. // Copyright: (c) Stefan Csomor
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_STATBMP_H_
  11. #define _WX_STATBMP_H_
  12. #include "wx/icon.h"
  13. class WXDLLIMPEXP_CORE wxStaticBitmap: public wxStaticBitmapBase
  14. {
  15. DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
  16. public:
  17. wxStaticBitmap() { }
  18. wxStaticBitmap(wxWindow *parent, wxWindowID id,
  19. const wxBitmap& label,
  20. const wxPoint& pos = wxDefaultPosition,
  21. const wxSize& size = wxDefaultSize,
  22. long style = 0,
  23. const wxString& name = wxStaticBitmapNameStr)
  24. {
  25. Create(parent, id, label, pos, size, style, name);
  26. }
  27. bool Create(wxWindow *parent, wxWindowID id,
  28. const wxBitmap& label,
  29. const wxPoint& pos = wxDefaultPosition,
  30. const wxSize& size = wxDefaultSize,
  31. long style = 0,
  32. const wxString& name = wxStaticBitmapNameStr);
  33. virtual void SetBitmap(const wxBitmap& bitmap);
  34. virtual void Command(wxCommandEvent& WXUNUSED(event)) {}
  35. virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}
  36. void OnPaint( wxPaintEvent &event ) ;
  37. wxBitmap GetBitmap() const { return m_bitmap; }
  38. wxIcon GetIcon() const
  39. {
  40. // icons and bitmaps are really the same thing in wxMac
  41. return (const wxIcon &)m_bitmap;
  42. }
  43. void SetIcon(const wxIcon& icon) { SetBitmap( (const wxBitmap &)icon ) ; }
  44. // overridden base class virtuals
  45. virtual bool AcceptsFocus() const { return false; }
  46. protected:
  47. virtual wxSize DoGetBestSize() const;
  48. wxBitmap m_bitmap;
  49. DECLARE_EVENT_TABLE()
  50. };
  51. #endif
  52. // _WX_STATBMP_H_