KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_generators.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 (C) 2023 Alex Shvartzkop <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef DIALOG_GENERATORS_H_
22#define DIALOG_GENERATORS_H_
23
26#include <board.h>
27
28class PCB_EDIT_FRAME;
29
30#define DIALOG_GENERATORS_WINDOW_NAME wxT( "DialogGeneratorsWindowName" )
31
32
34{
35public:
36 DIALOG_GENERATORS( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
38
39 void RebuildModels();
40
41private:
42 void OnItemSelected( wxDataViewEvent& aEvent );
43
44 void OnRebuildSelectedClick( wxCommandEvent& event ) override;
45 void OnRebuildTypeClick( wxCommandEvent& event ) override;
46 void OnRebuildAllClick( wxCommandEvent& event ) override;
47
48 void OnCancelClick( wxCommandEvent& aEvent ) override;
49
50 wxDataViewListStore* getCurrentModel();
51 void clearModels();
52
53 void clearModel( const wxString& aName );
54
55 void deleteModel( const wxString& aName );
56
57 wxDataViewCtrl* addPage( const wxString& aName, const wxString& aTitle );
58
59 void onUnitsChanged( wxCommandEvent& event );
60 void onBoardChanged( wxCommandEvent& event );
61
62 virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override;
63 virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) override;
64 virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override;
65 virtual void OnBoardItemsRemoved( BOARD& aBoard,
66 std::vector<BOARD_ITEM*>& aBoardItems ) override;
67 virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override;
68 virtual void OnBoardItemsChanged( BOARD& aBoard,
69 std::vector<BOARD_ITEM*>& aBoardItems ) override;
70 virtual void OnBoardCompositeUpdate( BOARD& aBoard, std::vector<BOARD_ITEM*>& aAddedItems,
71 std::vector<BOARD_ITEM*>& aRemovedItems,
72 std::vector<BOARD_ITEM*>& aChangedItems ) override;
73
74 std::map<wxString, std::vector<std::pair<wxString, wxString>>> m_columnNameTypes;
75 std::map<wxString, wxDataViewListStore*> m_dataModels;
76 std::map<wxString, wxDataViewCtrl*> m_dataViews;
77
80};
81
82
83#endif // DIALOG_GENERATORS_H_
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:81
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
DIALOG_GENERATORS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Generator Objects"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
PCB_EDIT_FRAME * m_frame
void OnRebuildTypeClick(wxCommandEvent &event) override
virtual void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems) override
DIALOG_GENERATORS(PCB_EDIT_FRAME *aEditorFrame, wxWindow *aParent)
void OnRebuildSelectedClick(wxCommandEvent &event) override
wxDataViewCtrl * addPage(const wxString &aName, const wxString &aTitle)
virtual void OnBoardCompositeUpdate(BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aChangedItems) override
void OnItemSelected(wxDataViewEvent &aEvent)
void deleteModel(const wxString &aName)
std::map< wxString, wxDataViewListStore * > m_dataModels
void OnCancelClick(wxCommandEvent &aEvent) override
void clearModel(const wxString &aName)
void OnRebuildAllClick(wxCommandEvent &event) override
virtual void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aBoardItem) override
virtual void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aBoardItem) override
wxDataViewListStore * getCurrentModel()
std::map< wxString, wxDataViewCtrl * > m_dataViews
void onUnitsChanged(wxCommandEvent &event)
std::map< wxString, std::vector< std::pair< wxString, wxString > > > m_columnNameTypes
virtual void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems) override
virtual void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aBoardItems) override
virtual void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aBoardItem) override
void onBoardChanged(wxCommandEvent &event)
The main frame for Pcbnew.