statbmp.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/motif/statbmp.h
  3. // Purpose: wxStaticBitmap class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 17/09/98
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_STATBMP_H_
  11. #define _WX_STATBMP_H_
  12. #include "wx/motif/bmpmotif.h"
  13. #include "wx/icon.h"
  14. class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase
  15. {
  16. DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
  17. public:
  18. wxStaticBitmap() { }
  19. virtual ~wxStaticBitmap();
  20. wxStaticBitmap(wxWindow *parent, wxWindowID id,
  21. const wxBitmap& label,
  22. const wxPoint& pos = wxDefaultPosition,
  23. const wxSize& size = wxDefaultSize,
  24. long style = 0,
  25. const wxString& name = wxStaticBitmapNameStr)
  26. {
  27. Create(parent, id, label, pos, size, style, name);
  28. }
  29. bool Create(wxWindow *parent, wxWindowID id,
  30. const wxBitmap& label,
  31. const wxPoint& pos = wxDefaultPosition,
  32. const wxSize& size = wxDefaultSize,
  33. long style = 0,
  34. const wxString& name = wxStaticBitmapNameStr);
  35. virtual void SetBitmap(const wxBitmap& bitmap);
  36. virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event))
  37. {
  38. return false;
  39. }
  40. wxBitmap GetBitmap() const { return m_messageBitmap; }
  41. // for compatibility with wxMSW
  42. wxIcon GetIcon() const
  43. {
  44. // don't use wxDynamicCast, icons and bitmaps are really the same thing
  45. return *(wxIcon*)&m_messageBitmap;
  46. }
  47. // for compatibility with wxMSW
  48. void SetIcon(const wxIcon& icon)
  49. {
  50. SetBitmap( icon );
  51. }
  52. // Implementation
  53. virtual void ChangeBackgroundColour();
  54. virtual void ChangeForegroundColour();
  55. protected:
  56. void DoSetBitmap();
  57. protected:
  58. wxBitmap m_messageBitmap;
  59. wxBitmap m_messageBitmapOriginal;
  60. wxBitmapCache m_bitmapCache;
  61. };
  62. #endif
  63. // _WX_STATBMP_H_