statbmp.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: statbmp.h
  3. // Purpose: interface of wxStaticBitmap
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /**
  8. @class wxStaticBitmap
  9. A static bitmap control displays a bitmap. Native implementations on some
  10. platforms are only meant for display of the small icons in the dialog
  11. boxes. In particular, under Windows 9x the size of bitmap is limited
  12. to 64*64 pixels.
  13. If you want to display larger images portably, you may use generic
  14. implementation wxGenericStaticBitmap declared in \<wx/generic/statbmpg.h\>.
  15. Notice that for the best results, the size of the control should be the
  16. same as the size of the image displayed in it, as happens by default if
  17. if it's not resized explicitly. Otherwise, behaviour depends on the
  18. platform: under MSW, the bitmap is drawn centred inside the control, while
  19. elsewhere it is drawn at the origin of the control.
  20. @library{wxcore}
  21. @category{ctrl}
  22. @appearance{staticbitmap}
  23. @see wxStaticBitmap, wxStaticBox
  24. */
  25. class wxStaticBitmap : public wxControl
  26. {
  27. public:
  28. /**
  29. Default constructor
  30. */
  31. wxStaticBitmap();
  32. /**
  33. Constructor, creating and showing a static bitmap control.
  34. @param parent
  35. Parent window. Should not be @NULL.
  36. @param id
  37. Control identifier. A value of -1 denotes a default value.
  38. @param label
  39. Bitmap label.
  40. @param pos
  41. Window position.
  42. @param size
  43. Window size.
  44. @param style
  45. Window style. See wxStaticBitmap.
  46. @param name
  47. Window name.
  48. @see Create()
  49. */
  50. wxStaticBitmap(wxWindow* parent, wxWindowID id,
  51. const wxBitmap& label,
  52. const wxPoint& pos = wxDefaultPosition,
  53. const wxSize& size = wxDefaultSize,
  54. long style = 0,
  55. const wxString& name = wxStaticBitmapNameStr);
  56. /**
  57. Creation function, for two-step construction. For details see wxStaticBitmap().
  58. */
  59. bool Create(wxWindow* parent, wxWindowID id, const wxBitmap& label,
  60. const wxPoint& pos = wxDefaultPosition,
  61. const wxSize& size = wxDefaultSize, long style = 0,
  62. const wxString& name = wxStaticBitmapNameStr);
  63. /**
  64. Returns the bitmap currently used in the control.
  65. Notice that this method can be called even if SetIcon() had been used.
  66. @see SetBitmap()
  67. */
  68. virtual wxBitmap GetBitmap() const;
  69. /**
  70. Returns the icon currently used in the control.
  71. Notice that this method can only be called if SetIcon() had been used: an icon
  72. can't be retrieved from the control if a bitmap had been set
  73. (using wxStaticBitmap::SetBitmap).
  74. @see SetIcon()
  75. */
  76. virtual wxIcon GetIcon() const;
  77. /**
  78. Sets the bitmap label.
  79. @param label
  80. The new bitmap.
  81. @see GetBitmap()
  82. */
  83. virtual void SetBitmap(const wxBitmap& label);
  84. /**
  85. Sets the label to the given icon.
  86. @param label
  87. The new icon.
  88. */
  89. virtual void SetIcon(const wxIcon& label);
  90. };