statbox.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/statbox.h
  3. // Purpose: wxStaticBox class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 01/02/97
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_MSW_STATBOX_H_
  11. #define _WX_MSW_STATBOX_H_
  12. // Group box
  13. class WXDLLIMPEXP_CORE wxStaticBox : public wxStaticBoxBase
  14. {
  15. public:
  16. wxStaticBox() { }
  17. wxStaticBox(wxWindow *parent, wxWindowID id,
  18. const wxString& label,
  19. const wxPoint& pos = wxDefaultPosition,
  20. const wxSize& size = wxDefaultSize,
  21. long style = 0,
  22. const wxString& name = wxStaticBoxNameStr)
  23. {
  24. Create(parent, id, label, pos, size, style, name);
  25. }
  26. bool Create(wxWindow *parent, wxWindowID id,
  27. const wxString& label,
  28. const wxPoint& pos = wxDefaultPosition,
  29. const wxSize& size = wxDefaultSize,
  30. long style = 0,
  31. const wxString& name = wxStaticBoxNameStr);
  32. /// Implementation only
  33. virtual void GetBordersForSizer(int *borderTop, int *borderOther) const;
  34. virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
  35. // returns true if the platform should explicitly apply a theme border
  36. virtual bool CanApplyThemeBorder() const { return false; }
  37. protected:
  38. virtual wxSize DoGetBestSize() const;
  39. #ifndef __WXWINCE__
  40. public:
  41. virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
  42. protected:
  43. // return the region with all the windows inside this static box excluded
  44. virtual WXHRGN MSWGetRegionWithoutChildren();
  45. // remove the parts which are painted by static box itself from the given
  46. // region which is embedded in a rectangle (0, 0)-(w, h)
  47. virtual void MSWGetRegionWithoutSelf(WXHRGN hrgn, int w, int h);
  48. // paint the given rectangle with our background brush/colour
  49. virtual void PaintBackground(wxDC& dc, const struct tagRECT& rc);
  50. // paint the foreground of the static box
  51. virtual void PaintForeground(wxDC& dc, const struct tagRECT& rc);
  52. void OnPaint(wxPaintEvent& event);
  53. #endif // !__WXWINCE__
  54. DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticBox)
  55. };
  56. #endif // _WX_MSW_STATBOX_H_