statbox.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/statbox.h
  3. // Purpose: wxStaticBox base header
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created:
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_STATBOX_H_BASE_
  11. #define _WX_STATBOX_H_BASE_
  12. #include "wx/defs.h"
  13. #if wxUSE_STATBOX
  14. #include "wx/control.h"
  15. #include "wx/containr.h"
  16. extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticBoxNameStr[];
  17. // ----------------------------------------------------------------------------
  18. // wxStaticBox: a grouping box with a label
  19. // ----------------------------------------------------------------------------
  20. class WXDLLIMPEXP_CORE wxStaticBoxBase : public wxNavigationEnabled<wxControl>
  21. {
  22. public:
  23. wxStaticBoxBase();
  24. // overridden base class virtuals
  25. virtual bool HasTransparentBackground() { return true; }
  26. // implementation only: this is used by wxStaticBoxSizer to account for the
  27. // need for extra space taken by the static box
  28. //
  29. // the top border is the margin at the top (where the title is),
  30. // borderOther is the margin on all other sides
  31. virtual void GetBordersForSizer(int *borderTop, int *borderOther) const
  32. {
  33. const int BORDER = 5; // FIXME: hardcoded value
  34. *borderTop = GetLabel().empty() ? BORDER : GetCharHeight();
  35. *borderOther = BORDER;
  36. }
  37. protected:
  38. // choose the default border for this window
  39. virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
  40. wxDECLARE_NO_COPY_CLASS(wxStaticBoxBase);
  41. };
  42. #if defined(__WXUNIVERSAL__)
  43. #include "wx/univ/statbox.h"
  44. #elif defined(__WXMSW__)
  45. #include "wx/msw/statbox.h"
  46. #elif defined(__WXMOTIF__)
  47. #include "wx/motif/statbox.h"
  48. #elif defined(__WXGTK20__)
  49. #include "wx/gtk/statbox.h"
  50. #elif defined(__WXGTK__)
  51. #include "wx/gtk1/statbox.h"
  52. #elif defined(__WXMAC__)
  53. #include "wx/osx/statbox.h"
  54. #elif defined(__WXCOCOA__)
  55. #include "wx/cocoa/statbox.h"
  56. #elif defined(__WXPM__)
  57. #include "wx/os2/statbox.h"
  58. #endif
  59. #endif // wxUSE_STATBOX
  60. #endif
  61. // _WX_STATBOX_H_BASE_