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, see <https://www.gnu.org/licenses/>.
21 */
22
23#pragma once
24
25#include <base_units.h>
26#include <board.h>
28#include <origin_viewitem.h>
29#include <pcb_base_frame.h>
30#include <pcb_draw_panel_gal.h>
32#include <widgets/unit_binder.h>
33#include <wx/valnum.h>
34
35class PCB_BARCODE;
36
42{
43public:
46
47 bool TransferDataFromWindow() override;
48 bool TransferDataToWindow() override;
49
50private:
52 PCB_BARCODE* m_currentBarcode; // barcode currently being edited
53 PCB_BARCODE* m_dummyBarcode; // a working copy used to show changes
54 BOARD* m_board; // the main board: this is the board handled by the PCB
55
64
65private:
66 void prepareCanvas(); // Initialize the canvases (legacy or gal) to display the barcode
67 void initValues();
68 void refreshPreview();
69
71 bool transferDataToBarcode( PCB_BARCODE* aBarcode );
72
73 // event handlers:
74 void OnResize( wxSizeEvent& event );
75 void OnCancel( wxCommandEvent& event ) override;
76 void OnUpdateUI( wxUpdateUIEvent& event ) override;
77
79 void OnValuesChanged( wxCommandEvent& event ) override;
80 void OnTextValueChanged( wxKeyEvent& event ) override;
81};
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
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 OnTextValueChanged(wxKeyEvent &event) override
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.