| 1 | /* SpectrumEditor.cpp |
| 2 | * |
| 3 | * Copyright (C) 1992-2022 Paul Boersma |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | * See the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #include "SpectrumEditor.h" |
| 20 | #include "EditorM.h" |
| 21 | |
| 22 | Thing_implement (SpectrumEditor, FunctionEditor, 0); |
| 23 | |
| 24 | #include "Prefs_define.h" |
| 25 | #include "SpectrumEditor_prefs.h" |
| 26 | #include "Prefs_install.h" |
| 27 | #include "SpectrumEditor_prefs.h" |
| 28 | #include "Prefs_copyToInstance.h" |
| 29 | #include "SpectrumEditor_prefs.h" |
| 30 | |
| 31 | static void menu_cb_help_SpectrumEditor (SpectrumEditor, EDITOR_ARGS) { Melder_help (U"SpectrumEditor"); } |
| 32 | static void menu_cb_help_Spectrum (SpectrumEditor, EDITOR_ARGS) { Melder_help (U"Spectrum"); } |
| 33 | |
| 34 | void structSpectrumEditor :: v_createMenuItems_help (EditorMenu menu) { |
| 35 | SpectrumEditor_Parent :: v_createMenuItems_help (menu); |
| 36 | EditorMenu_addCommand (menu, U"SpectrumEditor help", '?', menu_cb_help_SpectrumEditor); |
| 37 | EditorMenu_addCommand (menu, U"Spectrum help", 0, menu_cb_help_Spectrum); |
| 38 | } |
| 39 | |
| 40 | autoSpectrumEditor SpectrumEditor_create (conststring32 title, Spectrum spectrum) { |
| 41 | try { |
| 42 | autoSpectrumEditor me = Thing_new (SpectrumEditor); |
| 43 | my spectrumArea() = SpectrumArea_create (true, nullptr, me.get()); |
| 44 | FunctionEditor_init (me.get(), title, spectrum); |
| 45 | return me; |
| 46 | } catch (MelderError) { |
| 47 | Melder_throw (U"Spectrum window not created."); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | /* End of file SpectrumEditor.cpp */ |