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 The 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, see <https://www.gnu.org/licenses/>.
20 */
21
22#ifndef DIALOG_FIELD_PROPERTIES_H
23#define DIALOG_FIELD_PROPERTIES_H
24
26#include <widgets/unit_binder.h>
27
28class SCH_BASE_FRAME;
29class SCH_FIELD;
30class EDA_TEXT;
32class SCH_COMMIT;
33
34
40{
41public:
42 DIALOG_FIELD_PROPERTIES( SCH_BASE_FRAME* aParent, const wxString& aTitle,
43 const SCH_FIELD* aField );
44
45 ~DIALOG_FIELD_PROPERTIES() override;
46
47 bool TransferDataToWindow() override;
48 bool TransferDataFromWindow() override;
49
50 SCH_BASE_FRAME* GetParent() { return dynamic_cast<SCH_BASE_FRAME*>( wxDialog::GetParent() ); }
51
52 const wxString& GetText() const { return m_text; }
53
54 void UpdateField( SCH_FIELD* aField );
55
56 void UpdateField( SCH_COMMIT* aCommit, SCH_FIELD* aField, SCH_SHEET_PATH* aSheetPath );
57
58protected:
59 void init();
60
61 void updateText( SCH_FIELD* aField );
62
63 void onScintillaCharAdded( wxStyledTextEvent &aEvent );
64
73 void OnTextValueSelectButtonClick( wxCommandEvent& aEvent ) override;
74
79 void OnSetFocusText( wxFocusEvent& event ) override;
80
81 void onOrientButton( wxCommandEvent &aEvent );
82 void onHAlignButton( wxCommandEvent &aEvent );
83 void onVAlignButton( wxCommandEvent &aEvent );
84
85protected:
89
91 wxString m_text;
97 int m_size;
104
106
108 std::string m_netlist;
109
112};
113
114#endif // DIALOG_FIELD_PROPERTIES_H
DIALOG_FIELD_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Text Item Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void onOrientButton(wxCommandEvent &aEvent)
void OnTextValueSelectButtonClick(wxCommandEvent &aEvent) override
Handle the select button next to the text value field.
DIALOG_FIELD_PROPERTIES(SCH_BASE_FRAME *aParent, const wxString &aTitle, const SCH_FIELD *aField)
GR_TEXT_H_ALIGN_T m_horizontalJustification
void updateText(SCH_FIELD *aField)
void onVAlignButton(wxCommandEvent &aEvent)
void UpdateField(SCH_FIELD *aField)
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
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 onHAlignButton(wxCommandEvent &aEvent)
GR_TEXT_V_ALIGN_T m_verticalJustification
const wxString & GetText() const
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition eda_text.h:89
FONT is an abstract base class for both outline and stroke fonts.
Definition font.h:94
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
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.
FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
GR_TEXT_V_ALIGN_T
This is API surface mapped to common.types.VertialAlignment.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683