kicad-source/kicad/dialogs/panel_jobset.h

111 lines
3.1 KiB
C
Raw Normal View History

/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 Mark Roszko <mark.roszko@gmail.com>
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
2025-01-12 20:24:20 +00:00
#include "panel_jobset_base.h"
#include <memory>
#include <grid_tricks.h>
class wxAuiNotebook;
class JOBSET;
class KICAD_MANAGER_FRAME;
2025-01-12 20:24:20 +00:00
class PANEL_JOBSET;
2025-03-03 18:34:20 +00:00
class PANEL_DESTINATION;
struct JOBSET_DESTINATION;
enum COL_ORDER
{
COL_NUMBER,
COL_SOURCE,
COL_DESCR,
COL_COUNT // keep as last
};
class JOBS_GRID_TRICKS : public GRID_TRICKS
{
enum
{
JOB_DESCRIPTION = GRIDTRICKS_FIRST_CLIENT_ID,
JOB_PROPERTIES
};
public:
2025-01-12 20:24:20 +00:00
explicit JOBS_GRID_TRICKS( PANEL_JOBSET* aParent, WX_GRID* aGrid );
~JOBS_GRID_TRICKS() override = default;
protected:
void showPopupMenu( wxMenu& menu, wxGridEvent& aEvent ) override;
void doPopupSelection( wxCommandEvent& event ) override;
bool handleDoubleClick( wxGridEvent& aEvent ) override;
protected:
2025-01-12 20:24:20 +00:00
PANEL_JOBSET* m_parent;
int m_doubleClickRow;
};
2025-01-12 20:24:20 +00:00
class PANEL_JOBSET : public PANEL_JOBSET_BASE
{
public:
2025-01-12 20:24:20 +00:00
PANEL_JOBSET( wxAuiNotebook* aParent, KICAD_MANAGER_FRAME* aFrame,
std::unique_ptr<JOBSET> aJobsFile );
2025-01-12 20:24:20 +00:00
~PANEL_JOBSET();
2024-10-03 08:02:21 -04:00
2025-03-03 18:34:20 +00:00
void RemoveDestination( PANEL_DESTINATION* aPanel );
void EnsurePcbSchFramesOpen();
2024-12-21 12:02:21 -05:00
wxString GetFilePath() const;
2024-12-29 07:16:38 -05:00
void UpdateTitle();
2024-12-21 12:02:21 -05:00
JOBSET* GetJobsFile() { return m_jobsFile.get(); }
bool OpenJobOptionsForListItem( size_t aItemIndex );
void OnJobButtonDelete( wxCommandEvent& aEvent ) override;
2025-03-03 18:34:20 +00:00
std::vector<PANEL_DESTINATION*> GetDestinationPanels();
protected:
virtual void OnSizeGrid( wxSizeEvent& aEvent ) override;
virtual void OnAddJobClick( wxCommandEvent& aEvent ) override;
2025-03-03 18:34:20 +00:00
virtual void OnAddDestinationClick( wxCommandEvent& aEvent ) override;
virtual void OnSaveButtonClick( wxCommandEvent& aEvent ) override;
2024-10-02 22:53:43 -04:00
virtual void OnJobButtonUp( wxCommandEvent& aEvent ) override;
virtual void OnJobButtonDown( wxCommandEvent& aEvent ) override;
2025-03-03 18:34:20 +00:00
virtual void OnGenerateAllDestinationsClick( wxCommandEvent& event ) override;
virtual void OnGridCellChange( wxGridEvent& aEvent ) override;
bool GetCanClose() override;
private:
void rebuildJobList();
2025-03-03 18:34:20 +00:00
void buildDestinationList();
void addDestinationPanel( JOBSET_DESTINATION* aDestination );
private:
2024-12-31 10:37:44 +00:00
wxAuiNotebook* m_parentBook;
KICAD_MANAGER_FRAME* m_frame;
std::unique_ptr<JOBSET> m_jobsFile;
};