TextEditor.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef _TextEditor_h_
  2. #define _TextEditor_h_
  3. /* TextEditor.h
  4. *
  5. * Copyright (C) 1997-2011,2012,2013,2015,2016 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. #include "Editor.h"
  21. Thing_define (TextEditor, Editor) {
  22. structMelderFile file;
  23. GuiText textWidget;
  24. autoUiForm openDialog, saveDialog;
  25. bool dirty;
  26. GuiDialog dirtyNewDialog, dirtyOpenDialog, dirtyReopenDialog, dirtyCloseDialog;
  27. GuiMenuItem fontSizeButton_10, fontSizeButton_12, fontSizeButton_14, fontSizeButton_18, fontSizeButton_24;
  28. void v_destroy () noexcept
  29. override;
  30. void v_nameChanged ()
  31. override;
  32. void v_goAway ()
  33. override;
  34. void v_createChildren ()
  35. override;
  36. void v_createMenus ()
  37. override;
  38. bool v_hasQueryMenu ()
  39. override { return false; }
  40. virtual bool v_fileBased () { return true; }; // if true, have New, Open..., Save; if false, have Clear
  41. virtual void v_clear () { }
  42. #include "TextEditor_prefs.h"
  43. };
  44. void TextEditor_init (TextEditor me,
  45. conststring32 initialText
  46. );
  47. autoTextEditor TextEditor_create (
  48. conststring32 initialText // may be null
  49. );
  50. void TextEditor_showOpen (TextEditor me);
  51. /* End of file TextEditor.h */
  52. #endif