statbmp.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/univ/statbmp.h
  3. // Purpose: wxStaticBitmap class for wxUniversal
  4. // Author: Vadim Zeitlin
  5. // Modified by:
  6. // Created: 25.08.00
  7. // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_UNIV_STATBMP_H_
  11. #define _WX_UNIV_STATBMP_H_
  12. #include "wx/bitmap.h"
  13. // ----------------------------------------------------------------------------
  14. // wxStaticBitmap
  15. // ----------------------------------------------------------------------------
  16. class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase
  17. {
  18. public:
  19. wxStaticBitmap()
  20. {
  21. }
  22. wxStaticBitmap(wxWindow *parent,
  23. const wxBitmap& label,
  24. const wxPoint& pos = wxDefaultPosition,
  25. const wxSize& size = wxDefaultSize,
  26. long style = 0)
  27. {
  28. Create(parent, wxID_ANY, label, pos, size, style);
  29. }
  30. wxStaticBitmap(wxWindow *parent,
  31. wxWindowID id,
  32. const wxBitmap& label,
  33. const wxPoint& pos = wxDefaultPosition,
  34. const wxSize& size = wxDefaultSize,
  35. long style = 0,
  36. const wxString& name = wxStaticBitmapNameStr)
  37. {
  38. Create(parent, id, label, pos, size, style, name);
  39. }
  40. bool Create(wxWindow *parent,
  41. wxWindowID id,
  42. const wxBitmap& label,
  43. const wxPoint& pos = wxDefaultPosition,
  44. const wxSize& size = wxDefaultSize,
  45. long style = 0,
  46. const wxString& name = wxStaticBitmapNameStr);
  47. virtual void SetBitmap(const wxBitmap& bitmap);
  48. virtual void SetIcon(const wxIcon& icon);
  49. virtual wxBitmap GetBitmap() const { return m_bitmap; }
  50. wxIcon GetIcon() const;
  51. virtual bool HasTransparentBackground() { return true; }
  52. protected:
  53. virtual void DoDraw(wxControlRenderer *renderer);
  54. private:
  55. // the bitmap which we show
  56. wxBitmap m_bitmap;
  57. DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
  58. };
  59. #endif // _WX_UNIV_STATBMP_H_