Fix strange problems with spin entries on macOS (#1944).
[dcpomatic.git] / src / wx / text_panel.h
1 /*
2     Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic 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 DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21
22 #include "content_sub_panel.h"
23
24
25 class wxCheckBox;
26 class TextView;
27 class FontsDialog;
28 class SpinCtrl;
29 class SubtitleAnalysis;
30
31
32 class TextPanel : public ContentSubPanel
33 {
34 public:
35         TextPanel (ContentPanel *, TextType t);
36
37         void film_changed (Film::Property);
38         void film_content_changed (int);
39         void content_selection_changed ();
40
41 private:
42         void use_toggled ();
43         void type_changed ();
44         void burn_toggled ();
45         void x_offset_changed ();
46         void y_offset_changed ();
47         void x_scale_changed ();
48         void y_scale_changed ();
49         void line_spacing_changed ();
50         void dcp_track_changed ();
51         void stream_changed ();
52         void text_view_clicked ();
53         void fonts_dialog_clicked ();
54         void reference_clicked ();
55         void appearance_dialog_clicked ();
56         void outline_subtitles_changed ();
57         TextType current_type () const;
58         void update_dcp_tracks ();
59         void update_dcp_track_selection ();
60         void add_to_grid ();
61         void try_to_load_analysis ();
62         void analysis_finished ();
63
64         void setup_sensitivity ();
65         void setup_visibility ();
66
67         void update_outline_subtitles_in_viewer ();
68         void clear_outline_subtitles ();
69
70         wxCheckBox* _reference;
71         wxStaticText* _reference_note;
72         wxCheckBox* _outline_subtitles;
73         wxCheckBox* _use;
74         wxChoice* _type;
75         wxCheckBox* _burn;
76         wxStaticText* _offset_label;
77         wxStaticText* _x_offset_label;
78         wxStaticText* _x_offset_pc_label;
79         wxStaticText* _y_offset_label;
80         wxStaticText* _y_offset_pc_label;
81         SpinCtrl* _x_offset;
82         SpinCtrl* _y_offset;
83         wxStaticText* _scale_label;
84         wxStaticText* _x_scale_label;
85         wxStaticText* _x_scale_pc_label;
86         wxStaticText* _y_scale_label;
87         wxStaticText* _y_scale_pc_label;
88         SpinCtrl* _x_scale;
89         SpinCtrl* _y_scale;
90         wxStaticText* _line_spacing_label;
91         wxStaticText* _line_spacing_pc_label;
92         SpinCtrl* _line_spacing;
93         wxStaticText* _dcp_track_label;
94         wxChoice* _dcp_track;
95         wxStaticText* _stream_label;
96         wxChoice* _stream;
97         wxButton* _text_view_button;
98         TextView* _text_view;
99         wxButton* _fonts_dialog_button;
100         FontsDialog* _fonts_dialog;
101         wxButton* _appearance_dialog_button;
102         TextType _original_type;
103
104         int _outline_subtitles_row;
105         int _ccap_track_row;
106
107         std::weak_ptr<Content> _analysis_content;
108         boost::signals2::scoped_connection _analysis_finished_connection;
109         std::shared_ptr<SubtitleAnalysis> _analysis;
110         bool _loading_analysis;
111 };