checkbox.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/os2/checkbox.h
  3. // Purpose: wxCheckBox class
  4. // Author: David Webster
  5. // Modified by:
  6. // Created: 10/13/99
  7. // Copyright: (c) David Webster
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_CHECKBOX_H_
  11. #define _WX_CHECKBOX_H_
  12. #include "wx/control.h"
  13. // Checkbox item (single checkbox)
  14. class WXDLLIMPEXP_FWD_CORE wxBitmap;
  15. class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
  16. {
  17. public:
  18. inline wxCheckBox() { }
  19. inline wxCheckBox( wxWindow* pParent
  20. ,wxWindowID vId
  21. ,const wxString& rsLabel
  22. ,const wxPoint& rPos = wxDefaultPosition
  23. ,const wxSize& rSize = wxDefaultSize
  24. ,long lStyle = 0
  25. ,const wxValidator& rValidator = wxDefaultValidator
  26. ,const wxString& rsName = wxCheckBoxNameStr
  27. )
  28. {
  29. Create( pParent
  30. ,vId
  31. ,rsLabel
  32. ,rPos
  33. ,rSize
  34. ,lStyle
  35. ,rValidator
  36. ,rsName
  37. );
  38. }
  39. bool Create( wxWindow* pParent
  40. ,wxWindowID vId
  41. ,const wxString& rsLabel
  42. ,const wxPoint& rPos = wxDefaultPosition
  43. ,const wxSize& rSize = wxDefaultSize
  44. ,long lStyle = 0
  45. ,const wxValidator& rValidator = wxDefaultValidator
  46. ,const wxString& rsName = wxCheckBoxNameStr
  47. );
  48. virtual void SetValue(bool bValue);
  49. virtual bool GetValue(void) const ;
  50. virtual bool OS2Command( WXUINT uParam
  51. ,WXWORD wId
  52. );
  53. virtual void SetLabel(const wxString& rsLabel);
  54. virtual void Command(wxCommandEvent& rEvent);
  55. protected:
  56. virtual wxSize DoGetBestSize(void) const;
  57. private:
  58. DECLARE_DYNAMIC_CLASS(wxCheckBox)
  59. };
  60. class WXDLLIMPEXP_CORE wxBitmapCheckBox: public wxCheckBox
  61. {
  62. public:
  63. inline wxBitmapCheckBox() { m_nCheckWidth = -1; m_nCheckHeight = -1; }
  64. inline wxBitmapCheckBox( wxWindow* pParent
  65. ,wxWindowID vId
  66. ,const wxBitmap* pLabel
  67. ,const wxPoint& rPos = wxDefaultPosition
  68. ,const wxSize& rSize = wxDefaultSize
  69. ,long lStyle = 0
  70. ,const wxValidator& rValidator = wxDefaultValidator
  71. ,const wxString& rsName = wxCheckBoxNameStr
  72. )
  73. {
  74. Create( pParent
  75. ,vId
  76. ,pLabel
  77. ,rPos
  78. ,rSize
  79. ,lStyle
  80. ,rValidator
  81. ,rsName
  82. );
  83. }
  84. bool Create( wxWindow* pParent
  85. ,wxWindowID vId
  86. ,const wxBitmap* pLabel
  87. ,const wxPoint& rPos = wxDefaultPosition
  88. ,const wxSize& rSize = wxDefaultSize
  89. ,long lStyle = 0
  90. ,const wxValidator& rValidator = wxDefaultValidator
  91. ,const wxString& rsName = wxCheckBoxNameStr
  92. );
  93. virtual void SetLabel(const wxBitmap& rBitmap);
  94. int m_nCheckWidth;
  95. int m_nCheckHeight;
  96. private:
  97. virtual void SetLabel(const wxString& rsString)
  98. { wxCheckBox::SetLabel(rsString); }
  99. DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
  100. };
  101. #endif
  102. // _WX_CHECKBOX_H_