KiCad PCB EDA Suite
Loading...
Searching...
No Matches
lib_table_notebook_panel.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 modify it
7
* under the terms of the GNU General Public License as published by the
8
* Free Software Foundation, either version 3 of the License, or (at your
9
* option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#include <
widgets/panel_notebook_base.h
>
21
#include <
lib_table_grid_data_model.h
>
22
23
24
class
wxAuiNotebook;
25
26
27
class
LIB_TABLE_NOTEBOOK_PANEL
:
public
PANEL_NOTEBOOK_BASE
28
{
29
public
:
30
LIB_TABLE_NOTEBOOK_PANEL
( wxWindow* parent, wxWindowID
id
= wxID_ANY ) :
31
PANEL_NOTEBOOK_BASE
( parent, id )
32
{ }
33
34
~LIB_TABLE_NOTEBOOK_PANEL
()
override
;
35
36
bool
GetCanClose
()
override
;
37
38
WX_GRID
*
GetGrid
()
39
{
40
std::function<
WX_GRID
*( wxWindow* )> findGrid =
41
[&]( wxWindow* win ) ->
WX_GRID
*
42
{
43
if
(
WX_GRID
*
grid
=
dynamic_cast<
WX_GRID
*
>
( win ) )
44
return
grid
;
45
46
for
( wxWindow* child : win->GetChildren() )
47
{
48
if
(
WX_GRID
*
grid
= findGrid( child ) )
49
return
grid
;
50
}
51
52
return
nullptr
;
53
};
54
55
return
findGrid(
this
);
56
}
57
58
LIB_TABLE_GRID_DATA_MODEL
*
GetModel
()
59
{
60
return
static_cast<
LIB_TABLE_GRID_DATA_MODEL
*
>
(
GetGrid
()->GetTable() );
61
}
62
63
bool
TableModified
();
64
bool
SaveTable
();
65
66
static
void
AddTable
( wxAuiNotebook* aNotebook,
const
wxString& aTitle,
bool
aClosable );
67
};
BITMAPS::grid
@ grid
Definition
bitmaps_list.h:245
LIB_TABLE_GRID_DATA_MODEL
This abstract base class mixes any object derived from #LIB_TABLE into wxGridTableBase so the result ...
Definition
lib_table_grid_data_model.h:49
LIB_TABLE_NOTEBOOK_PANEL::GetGrid
WX_GRID * GetGrid()
Definition
lib_table_notebook_panel.h:38
LIB_TABLE_NOTEBOOK_PANEL::AddTable
static void AddTable(wxAuiNotebook *aNotebook, const wxString &aTitle, bool aClosable)
Definition
lib_table_notebook_panel.cpp:35
LIB_TABLE_NOTEBOOK_PANEL::GetCanClose
bool GetCanClose() override
Definition
lib_table_notebook_panel.cpp:110
LIB_TABLE_NOTEBOOK_PANEL::SaveTable
bool SaveTable()
Definition
lib_table_notebook_panel.cpp:93
LIB_TABLE_NOTEBOOK_PANEL::LIB_TABLE_NOTEBOOK_PANEL
LIB_TABLE_NOTEBOOK_PANEL(wxWindow *parent, wxWindowID id=wxID_ANY)
Definition
lib_table_notebook_panel.h:30
LIB_TABLE_NOTEBOOK_PANEL::~LIB_TABLE_NOTEBOOK_PANEL
~LIB_TABLE_NOTEBOOK_PANEL() override
Definition
lib_table_notebook_panel.cpp:28
LIB_TABLE_NOTEBOOK_PANEL::GetModel
LIB_TABLE_GRID_DATA_MODEL * GetModel()
Definition
lib_table_notebook_panel.h:58
LIB_TABLE_NOTEBOOK_PANEL::TableModified
bool TableModified()
Definition
lib_table_notebook_panel.cpp:84
PANEL_NOTEBOOK_BASE::PANEL_NOTEBOOK_BASE
PANEL_NOTEBOOK_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1, -1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
Definition
panel_notebook_base.h:30
WX_GRID
Definition
wx_grid.h:92
lib_table_grid_data_model.h
panel_notebook_base.h
src
include
lib_table_notebook_panel.h
Generated on Tue Nov 11 2025 00:06:15 for KiCad PCB EDA Suite by
1.13.2