KiCad PCB EDA Suite
Loading...
Searching...
No Matches
file_checklist_ctrl.h
Go to the documentation of this file.
1
/*
2
* This program source code file is part of KiCad, a free EDA CAD application.
3
*
4
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 3
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef FILE_CHECKLIST_CTRL_H
21
#define FILE_CHECKLIST_CTRL_H
22
23
#include <map>
24
#include <vector>
25
26
#include <wx/string.h>
27
28
#include <
bitmaps/bitmaps_list.h
>
29
#include <
widgets/wx_dataviewctrl.h
>
30
#include <wx/colour.h>
31
#include <wx/event.h>
32
#include <
kicommon.h
>
33
34
39
struct
KICOMMON_API
FILE_CHECKLIST_ENTRY
40
{
41
wxString
section
;
42
wxString
path
;
43
wxString
status
;
44
wxColour
statusColour
;
45
BITMAPS
icon
=
BITMAPS::INVALID_BITMAP
;
46
bool
checked
=
false
;
47
};
48
49
56
class
KICOMMON_API
FILE_CHECKLIST_DATA
57
{
58
public
:
59
void
SetEntries
(
const
std::vector<FILE_CHECKLIST_ENTRY>& aEntries );
60
62
const
std::vector<wxString>&
Sections
()
const
{
return
m_sections
; }
63
65
const
std::vector<FILE_CHECKLIST_ENTRY>& Rows(
const
wxString& aSection )
const
;
66
67
void
SetChecked(
const
wxString& aPath,
bool
aChecked );
68
void
SetSectionChecked(
const
wxString& aSection,
bool
aChecked );
69
72
bool
IsSectionChecked(
const
wxString& aSection )
const
;
73
75
std::vector<wxString> CheckedPaths()
const
;
76
77
private
:
78
std::vector<wxString>
m_sections
;
79
std::map<wxString, std::vector<FILE_CHECKLIST_ENTRY>>
m_rowsBySection
;
80
};
81
82
83
class
FILE_CHECKLIST_MODEL
;
84
85
94
class
KICOMMON_API
FILE_CHECKLIST_CTRL
:
public
WX_DATAVIEWCTRL
95
{
96
public
:
97
FILE_CHECKLIST_CTRL
( wxWindow* aParent, wxWindowID aId = wxID_ANY );
98
~FILE_CHECKLIST_CTRL
()
override
;
99
100
void
SetEntries
(
const
std::vector<FILE_CHECKLIST_ENTRY>& aEntries );
101
102
void
SetAllChecked
(
bool
aChecked );
103
104
std::vector<wxString>
GetCheckedPaths
()
const
;
105
107
wxString
GetItemPath
(
const
wxDataViewItem& aItem )
const
;
108
109
private
:
110
wxObjectDataPtr<FILE_CHECKLIST_MODEL>
m_model
;
111
};
112
113
#endif
// FILE_CHECKLIST_CTRL_H
bitmaps_list.h
BITMAPS
BITMAPS
A list of all bitmap identifiers.
Definition
bitmaps_list.h:35
BITMAPS::INVALID_BITMAP
@ INVALID_BITMAP
Definition
bitmaps_list.h:41
FILE_CHECKLIST_CTRL::FILE_CHECKLIST_CTRL
FILE_CHECKLIST_CTRL(wxWindow *aParent, wxWindowID aId=wxID_ANY)
Definition
file_checklist_ctrl.cpp:320
FILE_CHECKLIST_CTRL::SetAllChecked
void SetAllChecked(bool aChecked)
Definition
file_checklist_ctrl.cpp:347
FILE_CHECKLIST_CTRL::GetCheckedPaths
std::vector< wxString > GetCheckedPaths() const
Definition
file_checklist_ctrl.cpp:353
FILE_CHECKLIST_CTRL::GetItemPath
wxString GetItemPath(const wxDataViewItem &aItem) const
Path of the file row for aItem, or empty for a section header or invalid item.
Definition
file_checklist_ctrl.cpp:359
FILE_CHECKLIST_CTRL::m_model
wxObjectDataPtr< FILE_CHECKLIST_MODEL > m_model
Definition
file_checklist_ctrl.h:110
FILE_CHECKLIST_CTRL::SetEntries
void SetEntries(const std::vector< FILE_CHECKLIST_ENTRY > &aEntries)
Definition
file_checklist_ctrl.cpp:340
FILE_CHECKLIST_DATA
The rows and tick states behind FILE_CHECKLIST_CTRL.
Definition
file_checklist_ctrl.h:57
FILE_CHECKLIST_DATA::Sections
const std::vector< wxString > & Sections() const
Section headings in the order they were added.
Definition
file_checklist_ctrl.h:62
FILE_CHECKLIST_DATA::m_sections
std::vector< wxString > m_sections
Definition
file_checklist_ctrl.h:78
FILE_CHECKLIST_DATA::SetEntries
void SetEntries(const std::vector< FILE_CHECKLIST_ENTRY > &aEntries)
Definition
file_checklist_ctrl.cpp:29
FILE_CHECKLIST_DATA::m_rowsBySection
std::map< wxString, std::vector< FILE_CHECKLIST_ENTRY > > m_rowsBySection
Definition
file_checklist_ctrl.h:79
FILE_CHECKLIST_MODEL
Definition
file_checklist_ctrl.cpp:129
WX_DATAVIEWCTRL
Extension of the wxDataViewCtrl to include some helper functions for working with items.
Definition
wx_dataviewctrl.h:86
kicommon.h
KICOMMON_API
#define KICOMMON_API
Definition
kicommon.h:27
FILE_CHECKLIST_ENTRY
One file row in a FILE_CHECKLIST_CTRL.
Definition
file_checklist_ctrl.h:40
FILE_CHECKLIST_ENTRY::icon
BITMAPS icon
Definition
file_checklist_ctrl.h:45
FILE_CHECKLIST_ENTRY::path
wxString path
Row identity, and what the row shows.
Definition
file_checklist_ctrl.h:42
FILE_CHECKLIST_ENTRY::statusColour
wxColour statusColour
Text colour for the status, or the default when not set.
Definition
file_checklist_ctrl.h:44
FILE_CHECKLIST_ENTRY::section
wxString section
Definition
file_checklist_ctrl.h:41
FILE_CHECKLIST_ENTRY::status
wxString status
Free text, e.g. "Modified".
Definition
file_checklist_ctrl.h:43
FILE_CHECKLIST_ENTRY::checked
bool checked
Definition
file_checklist_ctrl.h:46
wx_dataviewctrl.h
src
include
widgets
file_checklist_ctrl.h
Generated on Tue Nov 17 2026 00:06:17 for KiCad PCB EDA Suite by
1.13.2