KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
panel_jobset.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) 2024 Mark Roszko <mark.roszko@gmail.com>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include "panel_jobset_base.h"
24#include <memory>
25#include <grid_tricks.h>
26
27class wxAuiNotebook;
28class JOBSET;
30class PANEL_JOBSET;
33
35{
39
40 COL_COUNT // keep as last
41};
42
44{
45 enum
46 {
49 };
50
51public:
52 explicit JOBS_GRID_TRICKS( PANEL_JOBSET* aParent, WX_GRID* aGrid );
53
54 ~JOBS_GRID_TRICKS() override = default;
55
56protected:
57 void showPopupMenu( wxMenu& menu, wxGridEvent& aEvent ) override;
58 void doPopupSelection( wxCommandEvent& event ) override;
59
60 bool handleDoubleClick( wxGridEvent& aEvent ) override;
61
62protected:
65};
66
67
69{
70public:
71 PANEL_JOBSET( wxAuiNotebook* aParent, KICAD_MANAGER_FRAME* aFrame,
72 std::unique_ptr<JOBSET> aJobsFile );
73
75
77
79
80 wxString GetFilePath() const;
81 void UpdateTitle();
82
83 JOBSET* GetJobsFile() { return m_jobsFile.get(); }
84
85 bool OpenJobOptionsForListItem( size_t aItemIndex );
86 void OnJobButtonDelete( wxCommandEvent& aEvent ) override;
87
88 std::vector<PANEL_DESTINATION*> GetDestinationPanels();
89
90protected:
91 virtual void OnSizeGrid( wxSizeEvent& aEvent ) override;
92 virtual void OnAddJobClick( wxCommandEvent& aEvent ) override;
93 virtual void OnAddDestinationClick( wxCommandEvent& aEvent ) override;
94 virtual void OnSaveButtonClick( wxCommandEvent& aEvent ) override;
95 virtual void OnJobButtonUp( wxCommandEvent& aEvent ) override;
96 virtual void OnJobButtonDown( wxCommandEvent& aEvent ) override;
97 virtual void OnGenerateAllDestinationsClick( wxCommandEvent& event ) override;
98 virtual void OnGridCellChange( wxGridEvent& aEvent ) override;
99
100 bool GetCanClose() override;
101
102private:
103 void rebuildJobList();
105 void addDestinationPanel( JOBSET_DESTINATION* aDestination );
106
107private:
108 wxAuiNotebook* m_parentBook;
110 std::unique_ptr<JOBSET> m_jobsFile;
111};
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:61
Definition: jobset.h:106
PANEL_JOBSET * m_parent
Definition: panel_jobset.h:63
void showPopupMenu(wxMenu &menu, wxGridEvent &aEvent) override
void doPopupSelection(wxCommandEvent &event) override
bool handleDoubleClick(wxGridEvent &aEvent) override
~JOBS_GRID_TRICKS() override=default
The main KiCad project manager frame.
Class PANEL_JOBSET_BASE.
wxString GetFilePath() const
JOBSET * GetJobsFile()
Definition: panel_jobset.h:83
virtual void OnSaveButtonClick(wxCommandEvent &aEvent) override
void OnJobButtonDelete(wxCommandEvent &aEvent) override
virtual void OnJobButtonDown(wxCommandEvent &aEvent) override
void EnsurePcbSchFramesOpen()
bool GetCanClose() override
void rebuildJobList()
wxAuiNotebook * m_parentBook
Definition: panel_jobset.h:108
void addDestinationPanel(JOBSET_DESTINATION *aDestination)
void UpdateTitle()
virtual void OnGenerateAllDestinationsClick(wxCommandEvent &event) override
bool OpenJobOptionsForListItem(size_t aItemIndex)
std::vector< PANEL_DESTINATION * > GetDestinationPanels()
void buildDestinationList()
KICAD_MANAGER_FRAME * m_frame
Definition: panel_jobset.h:109
virtual void OnAddDestinationClick(wxCommandEvent &aEvent) override
virtual void OnAddJobClick(wxCommandEvent &aEvent) override
std::unique_ptr< JOBSET > m_jobsFile
Definition: panel_jobset.h:110
virtual void OnGridCellChange(wxGridEvent &aEvent) override
void RemoveDestination(PANEL_DESTINATION *aPanel)
virtual void OnJobButtonUp(wxCommandEvent &aEvent) override
virtual void OnSizeGrid(wxSizeEvent &aEvent) override
@ GRIDTRICKS_FIRST_CLIENT_ID
Definition: grid_tricks.h:48
@ COL_NUMBER
Definition: panel_jobset.h:36
@ COL_DESCR
Definition: panel_jobset.h:38
@ COL_COUNT
Definition: panel_jobset.h:40
@ COL_SOURCE
Definition: panel_jobset.h:37