KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_jobs.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 <[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 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_jobs_base.h"
24#include <memory>
25#include <grid_tricks.h>
26
27class wxAuiNotebook;
28class JOBSET;
30class PANEL_JOBS;
32struct JOBSET_OUTPUT;
33
35{
36 enum
37 {
40 };
41
42public:
43 explicit JOBS_GRID_TRICKS( PANEL_JOBS* aParent, WX_GRID* aGrid );
44
45 ~JOBS_GRID_TRICKS() override = default;
46
47protected:
48 void showPopupMenu( wxMenu& menu, wxGridEvent& aEvent ) override;
49 void doPopupSelection( wxCommandEvent& event ) override;
50
51 bool handleDoubleClick( wxGridEvent& aEvent ) override;
52
53protected:
55};
56
57
59{
60public:
61 PANEL_JOBS( wxAuiNotebook* aParent, KICAD_MANAGER_FRAME* aFrame,
62 std::unique_ptr<JOBSET> aJobsFile );
63
65
66 void RemoveOutput( JOBSET_OUTPUT* aOutput );
67
69
70 wxString GetFilePath() const;
71 void UpdateTitle();
72
73 JOBSET* GetJobsFile() { return m_jobsFile.get(); }
74
75 bool OpenJobOptionsForListItem( size_t aItemIndex );
76 void OnJobButtonDelete( wxCommandEvent& aEvent ) override;
77
78protected:
79 virtual void OnSizeGrid( wxSizeEvent& aEvent ) override;
80 virtual void OnAddJobClick( wxCommandEvent& aEvent ) override;
81 virtual void OnAddOutputClick( wxCommandEvent& aEvent ) override;
82 virtual void OnSaveButtonClick( wxCommandEvent& aEvent ) override;
83 virtual void OnJobButtonUp( wxCommandEvent& aEvent ) override;
84 virtual void OnJobButtonDown( wxCommandEvent& aEvent ) override;
85 virtual void OnRunAllJobsClick( wxCommandEvent& event ) override;
86
87 bool GetCanClose() override;
88
89private:
90 void rebuildJobList();
91 void buildOutputList();
92 void addJobOutputPanel( JOBSET_OUTPUT* aOutput );
93
94private:
95 wxAuiNotebook* m_parentBook;
97 std::unique_ptr<JOBSET> m_jobsFile;
98
99 std::unordered_map<JOBSET_OUTPUT*, PANEL_JOB_OUTPUT*> m_outputPanelMap;
100};
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:61
Definition: jobset.h:85
void showPopupMenu(wxMenu &menu, wxGridEvent &aEvent) override
Definition: panel_jobs.cpp:462
void doPopupSelection(wxCommandEvent &event) override
Definition: panel_jobs.cpp:487
bool handleDoubleClick(wxGridEvent &aEvent) override
Definition: panel_jobs.cpp:519
PANEL_JOBS * m_parent
Definition: panel_jobs.h:54
~JOBS_GRID_TRICKS() override=default
The main KiCad project manager frame.
Class PANEL_JOBS_BASE.
wxString GetFilePath() const
Definition: panel_jobs.cpp:898
virtual void OnAddOutputClick(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:786
std::unique_ptr< JOBSET > m_jobsFile
Definition: panel_jobs.h:97
bool OpenJobOptionsForListItem(size_t aItemIndex)
Definition: panel_jobs.cpp:680
virtual void OnSizeGrid(wxSizeEvent &aEvent) override
std::unordered_map< JOBSET_OUTPUT *, PANEL_JOB_OUTPUT * > m_outputPanelMap
Definition: panel_jobs.h:99
JOBSET * GetJobsFile()
Definition: panel_jobs.h:73
wxAuiNotebook * m_parentBook
Definition: panel_jobs.h:95
virtual void OnAddJobClick(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:725
void rebuildJobList()
Definition: panel_jobs.cpp:596
void RemoveOutput(JOBSET_OUTPUT *aOutput)
Definition: panel_jobs.cpp:573
void addJobOutputPanel(JOBSET_OUTPUT *aOutput)
Definition: panel_jobs.cpp:654
virtual void OnJobButtonUp(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:904
void buildOutputList()
Definition: panel_jobs.cpp:666
virtual void OnJobButtonDown(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:926
void UpdateTitle()
Definition: panel_jobs.cpp:642
virtual void OnRunAllJobsClick(wxCommandEvent &event) override
Definition: panel_jobs.cpp:979
void OnJobButtonDelete(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:948
bool GetCanClose() override
Definition: panel_jobs.cpp:833
void EnsurePcbSchFramesOpen()
Definition: panel_jobs.cpp:854
virtual void OnSaveButtonClick(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:718
KICAD_MANAGER_FRAME * m_frame
Definition: panel_jobs.h:96
@ GRIDTRICKS_FIRST_CLIENT_ID
Definition: grid_tricks.h:48