KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_field_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) 2012 Jean-Pierre Charras, [email protected]
5 * Copyright (C) 2016 Wayne Stambaugh, [email protected]
6 * Copyright (C) 2004-2022 KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#ifndef DIALOG_FIELD_PROPERTIES_H
27#define DIALOG_FIELD_PROPERTIES_H
28
30#include <widgets/unit_binder.h>
31#include <lib_field.h>
32#include <template_fieldnames.h>
33
34class SCH_BASE_FRAME;
35class SCH_FIELD;
36class EDA_TEXT;
38
39
47{
48public:
49 DIALOG_FIELD_PROPERTIES( SCH_BASE_FRAME* aParent, const wxString& aTitle,
50 const EDA_TEXT* aTextItem );
51
52 ~DIALOG_FIELD_PROPERTIES() override;
53
54 bool TransferDataToWindow() override;
55 bool TransferDataFromWindow() override;
56
57 SCH_BASE_FRAME* GetParent() { return dynamic_cast< SCH_BASE_FRAME* >( wxDialog::GetParent() ); }
58
59 const wxString& GetText() const { return m_text; }
60
61protected:
62 void init();
63
64 void updateText( EDA_TEXT* aText );
65
74 void OnTextValueSelectButtonClick( wxCommandEvent& aEvent ) override;
75
80 virtual void OnSetFocusText( wxFocusEvent& event ) override;
81
82 void onOrientButton( wxCommandEvent &aEvent );
83 void onHAlignButton( wxCommandEvent &aEvent );
84 void onVAlignButton( wxCommandEvent &aEvent );
85
86protected:
90
92 wxString m_text;
98 int m_size;
105
107
109};
110
111
118{
119public:
120 DIALOG_LIB_FIELD_PROPERTIES( SCH_BASE_FRAME* aParent, const wxString& aTitle,
121 const LIB_FIELD* aField );
122
124
125 void UpdateField( LIB_FIELD* aField );
126};
127
128
135{
136public:
137 DIALOG_SCH_FIELD_PROPERTIES( SCH_BASE_FRAME* aParent, const wxString& aTitle,
138 const SCH_FIELD* aField );
139
141
142 void onScintillaCharAdded( wxStyledTextEvent &aEvent );
143
144 void UpdateField( SCH_FIELD* aField, SCH_SHEET_PATH* aSheetPath );
145
146private:
149};
150
151#endif // DIALOG_FIELD_PROPERTIES_H
Class DIALOG_FIELD_PROPERTIES_BASE.
A base class to edit schematic and symbol library fields.
void onOrientButton(wxCommandEvent &aEvent)
void OnTextValueSelectButtonClick(wxCommandEvent &aEvent) override
Handle the select button next to the text value field.
GR_TEXT_H_ALIGN_T m_horizontalJustification
void onVAlignButton(wxCommandEvent &aEvent)
SCINTILLA_TRICKS * m_scintillaTricks
virtual void OnSetFocusText(wxFocusEvent &event) override
Used to select the variant part of some text fields (for instance, the question mark or number in a r...
void updateText(EDA_TEXT *aText)
void onHAlignButton(wxCommandEvent &aEvent)
GR_TEXT_V_ALIGN_T m_verticalJustification
const wxString & GetText() const
Handle editing a single symbol field in the symbol editor.
Handle editing a single symbol field in the schematic editor.
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
void UpdateField(SCH_FIELD *aField, SCH_SHEET_PATH *aSheetPath)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:72
FONT is an abstract base class for both outline and stroke fonts.
Definition: font.h:105
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103
Field object used in symbol libraries.
Definition: lib_field.h:61
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:51
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
GR_TEXT_H_ALIGN_T
GR_TEXT_V_ALIGN_T