| 1 |
#ifndef _TextEditor_h_ |
| 2 |
#define _TextEditor_h_ |
| 3 |
/* TextEditor.h |
| 4 |
* |
| 5 |
* Copyright (C) 1997-2011,2012,2013,2015,2016,2018,2022 Paul Boersma |
| 6 |
* |
| 7 |
* This code is free software; you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation; either version 2 of the License, or (at |
| 10 |
* your option) any later version. |
| 11 |
* |
| 12 |
* This code is distributed in the hope that it will be useful, but |
| 13 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 15 |
* See the GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
#include "Editor.h" |
| 22 |
|
| 23 |
Thing_define (TextEditor, Editor) { |
| 24 |
structMelderFile file; |
| 25 |
GuiText textWidget; |
| 26 |
autoUiForm openDialog, saveDialog; |
| 27 |
bool dirty; |
| 28 |
GuiDialog dirtyNewDialog, dirtyOpenDialog, dirtyReopenDialog, dirtyCloseDialog; |
| 29 |
GuiMenuItem fontSizeButton_10, fontSizeButton_12, fontSizeButton_14, fontSizeButton_18, fontSizeButton_24; |
| 30 |
|
| 31 |
void v9_destroy () noexcept |
| 32 |
override; |
| 33 |
void v_nameChanged () |
| 34 |
override; |
| 35 |
void v_goAway () |
| 36 |
override; |
| 37 |
void v_createChildren () |
| 38 |
override; |
| 39 |
void v_createMenus () |
| 40 |
override; |
| 41 |
bool v_canReportSettings () |
| 42 |
override { return false; } |
| 43 |
|
| 44 |
virtual bool v_fileBased () const { return true; }; // if true, have New, Open..., Save; if false, have Clear |
| 45 |
virtual conststring32 v_extension () const { return U".txt"; } |
| 46 |
virtual void v_clear () { } |
| 47 |
|
| 48 |
#include "TextEditor_prefs.h" |
| 49 |
}; |
| 50 |
|
| 51 |
void TextEditor_init (TextEditor me, |
| 52 |
conststring32 initialText |
| 53 |
); |
| 54 |
autoTextEditor TextEditor_create ( |
| 55 |
conststring32 initialText // may be null |
| 56 |
); |
| 57 |
|
| 58 |
void TextEditor_showOpen (TextEditor me); |
| 59 |
|
| 60 |
/* End of file TextEditor.h */ |
| 61 |
#endif |