KiCad PCB EDA Suite
dialog_edit_label.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 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_LABEL_EDITOR_H_
25 #define DIALOG_LABEL_EDITOR_H_
26 
27 #include <widgets/unit_binder.h>
28 #include <sch_text.h>
29 #include <sch_validators.h>
30 #include <dialog_edit_label_base.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:
42  DIALOG_LABEL_EDITOR( SCH_EDIT_FRAME* parent, SCH_TEXT* aTextItem );
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 
56  bool TransferDataToWindow() override;
57  bool TransferDataFromWindow() override;
58 
61  wxWindow* m_activeTextCtrl;
62  wxTextEntry* m_activeTextEntry;
66 
68 };
69 
70 
71 
72 #endif // DIALOG_LABEL_EDITOR_H_
void SetTitle(const wxString &aTitle) override
wxTextEntry * m_activeTextEntry
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
Add cut/copy/paste, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
void OnEnterKey(wxCommandEvent &aEvent) override
bool TransferDataToWindow() override
Schematic editor (Eeschema) main window.
Class DIALOG_LABEL_EDITOR_BASE.
SCH_EDIT_FRAME * m_Parent
DIALOG_LABEL_EDITOR(SCH_EDIT_FRAME *parent, SCH_TEXT *aTextItem)
void OnFormattingHelp(wxHyperlinkEvent &aEvent) override
SCH_NETNAME_VALIDATOR m_netNameValidator
Definitions of control validators for schematic dialogs.
SCINTILLA_TRICKS * m_scintillaTricks
HTML_MESSAGE_BOX.
bool TransferDataFromWindow() override
HTML_MESSAGE_BOX * m_helpWindow