checklst.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/motif/checklst.h
  3. // Purpose: wxCheckListBox class - a listbox with checkable items
  4. // Note: this is an optional class.
  5. // Author: Julian Smart
  6. // Modified by:
  7. // Created: 17/09/98
  8. // Copyright: (c) Julian Smart
  9. // Licence: wxWindows licence
  10. ///////////////////////////////////////////////////////////////////////////////
  11. #ifndef _WX_CHECKLST_H_
  12. #define _WX_CHECKLST_H_
  13. #include "wx/listbox.h"
  14. class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase
  15. {
  16. DECLARE_DYNAMIC_CLASS(wxCheckListBox)
  17. public:
  18. // ctors
  19. wxCheckListBox();
  20. wxCheckListBox(wxWindow *parent, wxWindowID id,
  21. const wxPoint& pos = wxDefaultPosition,
  22. const wxSize& size = wxDefaultSize,
  23. int nStrings = 0,
  24. const wxString choices[] = NULL,
  25. long style = 0,
  26. const wxValidator& validator = wxDefaultValidator,
  27. const wxString& name = wxListBoxNameStr);
  28. wxCheckListBox(wxWindow *parent, wxWindowID id,
  29. const wxPoint& pos,
  30. const wxSize& size,
  31. const wxArrayString& choices,
  32. long style = 0,
  33. const wxValidator& validator = wxDefaultValidator,
  34. const wxString& name = wxListBoxNameStr);
  35. bool Create(wxWindow *parent, wxWindowID id,
  36. const wxPoint& pos = wxDefaultPosition,
  37. const wxSize& size = wxDefaultSize,
  38. int n = 0, const wxString choices[] = NULL,
  39. long style = 0,
  40. const wxValidator& validator = wxDefaultValidator,
  41. const wxString& name = wxListBoxNameStr);
  42. bool Create(wxWindow *parent, wxWindowID id,
  43. const wxPoint& pos,
  44. const wxSize& size,
  45. const wxArrayString& choices,
  46. long style = 0,
  47. const wxValidator& validator = wxDefaultValidator,
  48. const wxString& name = wxListBoxNameStr);
  49. // items may be checked
  50. bool IsChecked(unsigned int uiIndex) const;
  51. void Check(unsigned int uiIndex, bool bCheck = true);
  52. // override base class functions
  53. virtual int DoInsertItems(const wxArrayStringsAdapter& items,
  54. unsigned int pos,
  55. void **clientData, wxClientDataType type);
  56. virtual int FindString(const wxString& s, bool bCase = false) const;
  57. virtual void SetString(unsigned int n, const wxString& s);
  58. virtual wxString GetString(unsigned int n) const;
  59. private:
  60. void DoToggleItem( int item, int x );
  61. private:
  62. DECLARE_EVENT_TABLE()
  63. };
  64. #endif
  65. // _WX_CHECKLST_H_