annotate libgui/src/variable-editor.h @ 24703:28211444585e

style fixes for variable editor * variable-editor.h, variable-editor.cc: Where possible, create new objects in constructor initializer lists and perform setup inside constructor functions. (tab_bar::get_tab_bar): Rename from tabBar. Perform cast here.
author John W. Eaton <jwe@octave.org>
date Wed, 07 Feb 2018 17:16:55 -0500
parents 21d6d80ed427
children 75090f34ffb1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
1 /*
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
2
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
3 Copyright (C) 2013-2017 John W. Eaton
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
4 Copyright (C) 2015 Michael Barnes
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
5 Copyright (C) 2013 RĂ¼diger Sonderfeld
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
6
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
7 This file is part of Octave.
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
8
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24029
diff changeset
9 Octave is free software: you can redistribute it and/or modify it
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
10 under the terms of the GNU General Public License as published by the
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24029
diff changeset
11 Free Software Foundation, either version 3 of the License, or (at your
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
12 option) any later version.
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
13
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
14 Octave is distributed in the hope that it will be useful, but WITHOUT
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
17 for more details.
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
18
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
20 along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24029
diff changeset
21 <https://www.gnu.org/licenses/>.
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
22
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
23 */
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
24
23978
665507c3c29d Use Octave coding conventions for Variable Editor code.
Rik <rik@octave.org>
parents: 23927
diff changeset
25 #if ! defined (variable_editor_h)
665507c3c29d Use Octave coding conventions for Variable Editor code.
Rik <rik@octave.org>
parents: 23927
diff changeset
26 #define variable_editor_h 1
665507c3c29d Use Octave coding conventions for Variable Editor code.
Rik <rik@octave.org>
parents: 23927
diff changeset
27
665507c3c29d Use Octave coding conventions for Variable Editor code.
Rik <rik@octave.org>
parents: 23927
diff changeset
28 #include <QHeaderView>
665507c3c29d Use Octave coding conventions for Variable Editor code.
Rik <rik@octave.org>
parents: 23927
diff changeset
29 #include <QSettings>
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
30
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
31 #include "octave-dock-widget.h"
24694
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
32 #include "tab-bar.h"
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
33
24641
7d177be54c37 pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents: 24633
diff changeset
34 class octave_value;
7d177be54c37 pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents: 24633
diff changeset
35
24697
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
36 class QModelIndex;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
37 class QStackedWidget;
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
38 class QTabWidget;
24697
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
39 class QTableView;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
40 class QTextEdit;
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
41 class QToolBar;
24697
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
42
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
43 class variable_editor_model;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
44
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
45 class var_editor_tab : public QWidget
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
46 {
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
47 Q_OBJECT
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
48
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
49 public:
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
50
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
51 var_editor_tab (QStackedWidget *widget_stack, QWidget *p = nullptr)
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
52 : QWidget (p), m_widget_stack (widget_stack)
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
53 { }
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
54
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
55 ~var_editor_tab (void) = default;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
56
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
57 QTableView * get_edit_view (void) const;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
58 QTextEdit * get_disp_view (void) const;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
59
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
60 void set_edit_view (QTableView *);
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
61 void set_disp_view (QTextEdit *);
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
62
24697
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
63 void set_model (variable_editor_model *model)
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
64 {
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
65 m_model = model;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
66 }
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
67
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
68 bool has_focus (void) const;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
69
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
70 public slots:
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
71
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
72 void set_editable (bool);
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
73
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
74 private:
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
75
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
76 variable_editor_model *m_model;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
77
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
78 QStackedWidget *m_widget_stack;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
79
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
80 int m_edit_view_idx;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
81 int m_disp_view_idx;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
82 };
24694
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
83
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
84 // Subclassed QTabWidget for using custom tabbar
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
85
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
86 class var_editor_tab_widget : public QTabWidget
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
87 {
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
88 Q_OBJECT
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
89
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
90 public:
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
91
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
92 var_editor_tab_widget (QWidget *p);
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
93
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
94 ~var_editor_tab_widget (void) = default;
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
95
24703
28211444585e style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24697
diff changeset
96 tab_bar * get_tab_bar (void) const;
24697
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
97
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
98 bool current_tab_has_focus (void) const;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
99
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
100 QTextEdit *get_disp_view (void) const;
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
101 QTableView *get_edit_view (void) const;
24694
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
102 };
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
103
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
104
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
105 // The variable editor class
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
106
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
107 class variable_editor : public octave_dock_widget
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
108 {
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
109 Q_OBJECT
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
110
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
111 public:
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
112
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
113 variable_editor (QWidget *parent = nullptr);
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
114
24693
fe9bc1129922 replace main window in variable editor by normal widget with layout
Torsten <mttl@mailbox.org>
parents: 24669
diff changeset
115 ~variable_editor (void) = default;
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
116
24621
2bb3f3de0b4e more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24585
diff changeset
117 // No copying!
2bb3f3de0b4e more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24585
diff changeset
118
2bb3f3de0b4e more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24585
diff changeset
119 variable_editor (const variable_editor&) = delete;
2bb3f3de0b4e more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24585
diff changeset
120
2bb3f3de0b4e more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24585
diff changeset
121 variable_editor& operator = (const variable_editor&) = delete;
2bb3f3de0b4e more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24585
diff changeset
122
24641
7d177be54c37 pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents: 24633
diff changeset
123 void edit_variable (const QString& name, const octave_value& val);
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
124
24697
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
125 QTableView *make_edit_view (var_editor_tab *page,
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
126 variable_editor_model *model);
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
127
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
128 QTextEdit *make_disp_view (var_editor_tab *page,
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
129 variable_editor_model *model);
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
130
24633
428780eec08a improve behavior of variable editor
John W. Eaton <jwe@octave.org>
parents: 24621
diff changeset
131 void refresh (void);
428780eec08a improve behavior of variable editor
John W. Eaton <jwe@octave.org>
parents: 24621
diff changeset
132
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
133 bool has_focus (void);
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
134
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
135 static QList<QColor> default_colors (void);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
136
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
137 static QStringList color_names (void);
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
138
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
139 public slots:
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
140
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
141 void callUpdate (const QModelIndex&,const QModelIndex&);
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
142
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
143 void notice_settings (const QSettings *);
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
144
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
145 protected slots:
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
146
24694
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
147 void request_close_tab (bool);
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
148 void request_close_other_tabs (bool);
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
149 void request_close_all_tabs (bool);
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
150
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
151 void closeEvent (QCloseEvent *);
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
152
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
153 void closeTab (int idx);
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
154
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
155 void contextmenu_requested (const QPoint& pt);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
156
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
157 void columnmenu_requested (const QPoint& pt);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
158
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
159 void rowmenu_requested (const QPoint& pt);
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
160
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
161 void double_click (const QModelIndex& idx);
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
162
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
163 void save (void);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
164
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
165 void clearContent (void);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
166
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
167 void cutClipboard (void);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
168
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
169 void copyClipboard (void);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
170
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
171 void pasteClipboard (void);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
172
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
173 void pasteTableClipboard (void);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
174
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
175 void createVariable (void);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
176
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
177 void transposeContent (void);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
178
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
179 void up (void);
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
180
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
181 void delete_selected (void);
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
182
24029
1d184b55416a Use Octave conventions in variable editor code.
Rik <rik@octave.org>
parents: 24028
diff changeset
183 // Send command to Octave interpreter.
1d184b55416a Use Octave conventions in variable editor code.
Rik <rik@octave.org>
parents: 24028
diff changeset
184 // %1 in CMD is replaced with the value of selected_to_octave.
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
185 void relay_command (const QString& cmd);
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
186
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
187 signals:
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
188
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
189 void updated (void);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
190
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
191 void finished (void);
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
192
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
193 void command_requested (const QString& cmd);
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
194
24697
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
195 void refresh_signal (void);
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
196
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
197 private:
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
198
24694
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
199 QAction * add_action (QMenu *menu, const QIcon& icon, const QString& text,
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
200 const char *member);
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
201
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
202 void enable_actions (void);
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
203
24703
28211444585e style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24697
diff changeset
204 QWidget *m_container;
24694
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
205
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
206 QToolBar *m_tool_bar;
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
207
24697
21d6d80ed427 refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents: 24694
diff changeset
208 var_editor_tab_widget *m_tab_widget;
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
209
24703
28211444585e style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24697
diff changeset
210 tab_bar *m_tab_bar;
28211444585e style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24697
diff changeset
211
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
212 int m_default_width;
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
213
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
214 int m_default_height;
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
215
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
216 int m_add_font_height;
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
217
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
218 bool m_use_terminal_font;
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
219
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
220 bool m_alternate_rows;
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
221
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
222 QString m_stylesheet;
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
223
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
224 QFont m_font;
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
225
23978
665507c3c29d Use Octave coding conventions for Variable Editor code.
Rik <rik@octave.org>
parents: 23927
diff changeset
226 // If use_terminal_font is true then this will be different since
665507c3c29d Use Octave coding conventions for Variable Editor code.
Rik <rik@octave.org>
parents: 23927
diff changeset
227 // "font" will contain the terminal font.
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
228 QFont m_sel_font;
24585
8a4aedbb3e5a style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
229
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
230 QList<QColor> m_table_colors;
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
231
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
232 QList<int> octave_to_coords (QString&);
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
233
24028
ca4ab27152a9 variable editor: remove & when reading names from tabs (bugs #51851, #51905)
Torsten <mttl@mailbox.org>
parents: 24014
diff changeset
234 // Get the real variable name from the tab text
ca4ab27152a9 variable editor: remove & when reading names from tabs (bugs #51851, #51905)
Torsten <mttl@mailbox.org>
parents: 24014
diff changeset
235 QString real_var_name (int index);
ca4ab27152a9 variable editor: remove & when reading names from tabs (bugs #51851, #51905)
Torsten <mttl@mailbox.org>
parents: 24014
diff changeset
236
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
237 // Convert selection to an Octave expression.
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
238 QString selected_to_octave (void);
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
239
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
240 void update_colors (void);
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
241
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23978
diff changeset
242 void construct_tool_bar (void);
24694
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
243
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
244 QAction *m_close_action;
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
245 QAction *m_close_others_action;
9b4edcc62936 add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents: 24693
diff changeset
246 QAction *m_close_all_action;
23927
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
247 };
e3a36f84d01d provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff changeset
248
23978
665507c3c29d Use Octave coding conventions for Variable Editor code.
Rik <rik@octave.org>
parents: 23927
diff changeset
249 #endif