KiCad PCB EDA Suite
dialog_text_and_label_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) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #ifndef DIALOG_TEXT_AND_LABEL_PROPERTIES_H
25 #define DIALOG_TEXT_AND_LABEL_PROPERTIES_H
26 
27 #include <widgets/unit_binder.h>
28 #include <sch_text.h>
29 #include <sch_validators.h>
31 
32 
33 class SCH_EDIT_FRAME;
34 class SCH_TEXT;
35 class SCINTILLA_TRICKS;
36 class HTML_MESSAGE_BOX;
37 
38 
40 {
41 public:
44 
45  // This class is shared for numerous tasks: a couple of single line labels and
46  // multi-line text fields. Since the desired size of the multi-line text field editor
47  // is often larger, we retain separate sizes based on the dialog titles.
48  void SetTitle( const wxString& aTitle ) override;
49 
50 private:
51  void onScintillaCharAdded( wxStyledTextEvent &aEvent );
52 
53  void OnEnterKey( wxCommandEvent& aEvent ) override;
54  void OnFormattingHelp( wxHyperlinkEvent& aEvent ) override;
55  void onLostFocus( wxFocusEvent& event ) override;
56 
57  bool TransferDataToWindow() override;
58  bool TransferDataFromWindow() override;
59 
62  wxWindow* m_activeTextCtrl;
63  wxTextEntry* m_activeTextEntry;
67 
69 };
70 
71 
72 
73 #endif // DIALOG_TEXT_AND_LABEL_PROPERTIES_H
Class DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE.
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
Add cut/copy/paste, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
Schematic editor (Eeschema) main window.
void OnEnterKey(wxCommandEvent &aEvent) override
Definitions of control validators for schematic dialogs.
DIALOG_TEXT_AND_LABEL_PROPERTIES(SCH_EDIT_FRAME *parent, SCH_TEXT *aTextItem)
void onLostFocus(wxFocusEvent &event) override
void OnFormattingHelp(wxHyperlinkEvent &aEvent) override
void SetTitle(const wxString &aTitle) override