KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_barcode_properties.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) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2013 Dick Hollenbeck, [email protected]
6 * Copyright (C) 2008-2013 Wayne Stambaugh <[email protected]>
7 * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#pragma once
28
29#include <base_units.h>
30#include <board.h>
32#include <origin_viewitem.h>
33#include <pcb_base_frame.h>
34#include <pcb_draw_panel_gal.h>
36#include <widgets/unit_binder.h>
37#include <wx/valnum.h>
38
39class PCB_BARCODE;
40
46{
47public:
50
51 bool TransferDataFromWindow() override;
52 bool TransferDataToWindow() override;
53
54private:
56 PCB_BARCODE* m_currentBarcode; // barcode currently being edited
57 PCB_BARCODE* m_dummyBarcode; // a working copy used to show changes
58 BOARD* m_board; // the main board: this is the board handled by the PCB
59
68
69private:
70 void prepareCanvas(); // Initialize the canvases (legacy or gal) to display the barcode
71 void initValues();
72 void refreshPreview();
73
75 bool transferDataToBarcode( PCB_BARCODE* aBarcode );
76
77 // event handlers:
78 void OnResize( wxSizeEvent& event );
79 void OnCancel( wxCommandEvent& event ) override;
80 void OnUpdateUI( wxUpdateUIEvent& event ) override;
81
83 void OnValuesChanged( wxCommandEvent& event ) override;
84};
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
DIALOG_BARCODE_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_DIALOG_EDIT_PAD, const wxString &title=_("Barcode Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void OnUpdateUI(wxUpdateUIEvent &event) override
bool transferDataToBarcode(PCB_BARCODE *aBarcode)
Copy values from dialog field to aBarcode's members.
DIALOG_BARCODE_PROPERTIES(PCB_BASE_FRAME *aParent, PCB_BARCODE *aBarcode)
void OnValuesChanged(wxCommandEvent &event) override
Update the graphical barcode shown in the panel.
void OnCancel(wxCommandEvent &event) override
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.