2017-04-02 12:09:01 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2017 Oliver Walters
|
|
|
|
* Copyright (C) 2017 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 2
|
|
|
|
* 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, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file eeschema/dialogs/dialog_bom.cpp
|
|
|
|
* @brief Dialog box for creating bom and other documents from generic netlist.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EESCHEMA_DIALOGS_DIALOG_BOM_EDITOR_H_
|
|
|
|
#define EESCHEMA_DIALOGS_DIALOG_BOM_EDITOR_H_
|
|
|
|
|
|
|
|
#include <wx/dataview.h>
|
|
|
|
|
|
|
|
#include <schframe.h>
|
|
|
|
#include <sch_sheet.h>
|
|
|
|
#include <sch_sheet_path.h>
|
|
|
|
#include <sch_component.h>
|
|
|
|
#include <invoke_sch_dialog.h>
|
|
|
|
#include <dialog_bom_editor_base.h>
|
|
|
|
#include <class_netlist_object.h>
|
|
|
|
#include <sch_reference_list.h>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <bom_table_model.h>
|
|
|
|
|
|
|
|
class DIALOG_BOM_EDITOR : public DIALOG_BOM_EDITOR_BASE
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
DIALOG_BOM_EDITOR( SCH_EDIT_FRAME* parent );
|
|
|
|
virtual ~DIALOG_BOM_EDITOR();
|
|
|
|
|
|
|
|
private:
|
|
|
|
//! Parent object (Schematic)
|
|
|
|
SCH_EDIT_FRAME* m_parent;
|
|
|
|
|
|
|
|
BOM_TABLE_MODEL::MODEL_PTR m_bom;
|
|
|
|
|
2017-05-08 10:41:46 +00:00
|
|
|
void LoadComponents();
|
2017-04-02 12:09:01 +00:00
|
|
|
|
2017-05-08 10:41:46 +00:00
|
|
|
void LoadColumnNames();
|
|
|
|
void ReloadColumns();
|
2017-04-02 12:09:01 +00:00
|
|
|
|
2017-05-08 10:41:46 +00:00
|
|
|
void ApplyAllChanges();
|
2017-04-18 09:25:02 +00:00
|
|
|
|
2017-04-02 12:09:01 +00:00
|
|
|
// Checkbox event callbacks
|
|
|
|
virtual void OnColumnItemToggled( wxDataViewEvent& event ) override;
|
|
|
|
virtual void OnGroupComponentsToggled( wxCommandEvent& event ) override;
|
|
|
|
|
|
|
|
virtual void OnRevertFieldChanges( wxCommandEvent& event ) override;
|
|
|
|
|
2017-05-08 10:41:46 +00:00
|
|
|
virtual void OnApplyFieldChanges( wxCommandEvent& event ) override;
|
|
|
|
|
2017-04-02 12:09:01 +00:00
|
|
|
virtual void OnRegroupComponents( wxCommandEvent& event ) override;
|
|
|
|
|
|
|
|
// Called after a value in the table has changed
|
|
|
|
virtual void OnTableValueChanged( wxDataViewEvent& event ) override;
|
|
|
|
|
2017-04-25 02:55:49 +00:00
|
|
|
// Called when a cell is left-clicked
|
|
|
|
virtual void OnTableItemActivated( wxDataViewEvent& event ) override;
|
|
|
|
|
|
|
|
// Called when a cell is right-clicked
|
|
|
|
virtual void OnTableItemContextMenu( wxDataViewEvent& event ) override;
|
|
|
|
|
2017-05-08 10:41:46 +00:00
|
|
|
// Called when the dialog is closed
|
|
|
|
virtual void OnDialogClosed( wxCloseEvent& event ) override;
|
|
|
|
virtual void OnCloseButton( wxCommandEvent& event ) override;
|
|
|
|
|
2017-06-07 16:43:28 +00:00
|
|
|
bool CanCloseDialog();
|
2017-05-08 10:41:46 +00:00
|
|
|
|
2017-04-02 12:09:01 +00:00
|
|
|
void UpdateTitle( void );
|
2017-04-18 09:25:02 +00:00
|
|
|
|
|
|
|
virtual void OnUpdateUI( wxUpdateUIEvent& event ) override;
|
|
|
|
|
2017-04-02 12:09:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* EESCHEMA_DIALOGS_DIALOG_BOM_EDITOR_H_ */
|