checklst.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/wince/checklst.h
  3. // Purpose: wxCheckListBox class - a listbox with checkable items
  4. // Author: Wlodzimierz ABX Skiba
  5. // Modified by:
  6. // Created: 30.10.2005
  7. // Copyright: (c) Wlodzimierz Skiba
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef __CHECKLSTCE__H_
  11. #define __CHECKLSTCE__H_
  12. class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase
  13. {
  14. public:
  15. // ctors
  16. wxCheckListBox();
  17. wxCheckListBox(wxWindow *parent, wxWindowID id,
  18. const wxPoint& pos = wxDefaultPosition,
  19. const wxSize& size = wxDefaultSize,
  20. int nStrings = 0,
  21. const wxString choices[] = NULL,
  22. long style = 0,
  23. const wxValidator& validator = wxDefaultValidator,
  24. const wxString& name = wxListBoxNameStr);
  25. wxCheckListBox(wxWindow *parent, wxWindowID id,
  26. const wxPoint& pos,
  27. const wxSize& size,
  28. const wxArrayString& choices,
  29. long style = 0,
  30. const wxValidator& validator = wxDefaultValidator,
  31. const wxString& name = wxListBoxNameStr);
  32. virtual ~wxCheckListBox();
  33. bool Create(wxWindow *parent, wxWindowID id,
  34. const wxPoint& pos = wxDefaultPosition,
  35. const wxSize& size = wxDefaultSize,
  36. int n = 0, const wxString choices[] = NULL,
  37. long style = 0,
  38. const wxValidator& validator = wxDefaultValidator,
  39. const wxString& name = wxListBoxNameStr);
  40. bool Create(wxWindow *parent, wxWindowID id,
  41. const wxPoint& pos,
  42. const wxSize& size,
  43. const wxArrayString& choices,
  44. long style = 0,
  45. const wxValidator& validator = wxDefaultValidator,
  46. const wxString& name = wxListBoxNameStr);
  47. // items may be checked
  48. virtual bool IsChecked(unsigned int uiIndex) const;
  49. virtual void Check(unsigned int uiIndex, bool bCheck = true);
  50. // public interface derived from wxListBox and lower classes
  51. virtual void DoClear();
  52. virtual void DoDeleteOneItem(unsigned int n);
  53. virtual unsigned int GetCount() const;
  54. virtual int GetSelection() const;
  55. virtual int GetSelections(wxArrayInt& aSelections) const;
  56. virtual wxString GetString(unsigned int n) const;
  57. virtual bool IsSelected(int n) const;
  58. virtual void SetString(unsigned int n, const wxString& s);
  59. // Implementation
  60. virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
  61. protected:
  62. void OnSize(wxSizeEvent& event);
  63. // protected interface derived from wxListBox and lower classes
  64. virtual int DoInsertItems(const wxArrayStringsAdapter& items,
  65. unsigned int pos,
  66. void **clientData, wxClientDataType type);
  67. virtual void* DoGetItemClientData(unsigned int n) const;
  68. virtual void DoSetItemClientData(unsigned int n, void* clientData);
  69. virtual void DoSetFirstItem(int n);
  70. virtual void DoSetSelection(int n, bool select);
  71. // convert our styles to Windows
  72. virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
  73. private:
  74. wxArrayPtrVoid m_itemsClientData;
  75. DECLARE_EVENT_TABLE()
  76. DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckListBox)
  77. };
  78. #endif //_CHECKLSTCE_H