KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <[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_jobset_base.h"
24#include <memory>
25#include <grid_tricks.h>
26
27class wxAuiNotebook;
28class JOBSET;
30class PANEL_JOBSET;
33
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};
GRID_TRICKS(WX_GRID *aGrid)
PANEL_JOBSET * m_parent
void showPopupMenu(wxMenu &menu, wxGridEvent &aEvent) override
void doPopupSelection(wxCommandEvent &event) override
bool handleDoubleClick(wxGridEvent &aEvent) override
~JOBS_GRID_TRICKS() override=default
JOBS_GRID_TRICKS(PANEL_JOBSET *aParent, WX_GRID *aGrid)
The main KiCad project manager frame.
PANEL_JOBSET_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(600, 400), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
wxString GetFilePath() const
JOBSET * GetJobsFile()
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
void addDestinationPanel(JOBSET_DESTINATION *aDestination)
virtual void OnGenerateAllDestinationsClick(wxCommandEvent &event) override
bool OpenJobOptionsForListItem(size_t aItemIndex)
std::vector< PANEL_DESTINATION * > GetDestinationPanels()
void buildDestinationList()
KICAD_MANAGER_FRAME * m_frame
PANEL_JOBSET(wxAuiNotebook *aParent, KICAD_MANAGER_FRAME *aFrame, std::unique_ptr< JOBSET > aJobsFile)
virtual void OnAddDestinationClick(wxCommandEvent &aEvent) override
virtual void OnAddJobClick(wxCommandEvent &aEvent) override
std::unique_ptr< JOBSET > m_jobsFile
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_DESCR
@ COL_SOURCE