Version: 0.6.0
checklist.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: List View with check box
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2010 Dmitry Baryshnikov
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 #pragma once
22 
23 #include "wxgis/framework/framework.h"
24 #include <wx/listctrl.h>
25 #include <wx/imaglist.h>
26 
33 class WXDLLIMPEXP_GIS_FRW wxGISCheckList : public wxListView
34 {
35 public:
36  wxGISCheckList(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLC_NO_HEADER | wxLC_LIST /*wxLC_REPORT | wxLC_ALIGN_LEFT*/ | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("GISCheckList"));
37  ~wxGISCheckList(void);
38  long InsertItem(const wxString& label, int nChecked);
39  bool SetItemData(long item, long data);
40  long GetItemData(long item) const;
41  bool IsItemChanged(long item);
42  int GetItemCheckState(long item);
43  void SetItemCheckState(long item, int nState);
44  void CheckAll();
45  void UnCheckAll();
46  void InvertCheck();
47  //events
48  void OnLeftDown(wxMouseEvent& event);
49 
50  typedef struct _item_data
51  {
52  int nCheckState;
53  bool bChanged;
54  long pUserData;
56 protected:
57  wxImageList m_CheckImageList;
58 private:
59  DECLARE_EVENT_TABLE()
60 };
61 
Definition: checklist.h:50
Definition: checklist.h:33