Mercurial > octave
annotate libgui/src/variable-editor.h @ 25220:07bddddc5856 stable
Restore Variable Editor focusWidget lost in dock/undock transition (bug #53410)
* variable-editor.cc (variable_editor::variable_editor): Initialize new member
variable m_variable_focus_widget to nullptr.
(variable_editor::focusInEvent): If the m_main window's focusWidget() is
nullptr, check if the recorded m_variable_focus_widget is still valid within
the m_main container. If so, use it as a valid pointer and restore its
focus.
(variable_editor::focusOutEvent): Record m_main's focusWidget() just prior
to transition to/from docked state.
* variable-editor.h (variable_editor:octave_dock_widget): A class member
variable m_variable_focus_widget to keep track of focusWidget().
author | Daniel J Sebald <daniel.sebald@ieee.org> |
---|---|
date | Tue, 10 Apr 2018 23:22:03 -0500 |
parents | 8cff7eceee87 |
children | 05a690606fd5 |
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 |
25054
6652d3823428
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
24865
diff
changeset
|
3 Copyright (C) 2013-2018 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> |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
30 #include <QStackedWidget> |
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
31 #include <QTableView> |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
32 |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
33 #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
|
34 #include "tab-bar.h" |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
35 |
24641
7d177be54c37
pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents:
24633
diff
changeset
|
36 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
|
37 |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
38 class QModelIndex; |
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
39 class QTextEdit; |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
40 class QToolBar; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
41 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
42 namespace octave |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
43 { |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
44 class variable_editor_model; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
45 class variable_editor_view; |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
46 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
47 // The individual variable subwindow class |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
48 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
49 class variable_dock_widget : public label_dock_widget |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
50 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
51 Q_OBJECT |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
52 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
53 public: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
54 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
55 variable_dock_widget (QWidget *p = nullptr); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
56 |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
57 signals: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
58 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
59 void variable_focused_signal (const QString& name); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
60 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
61 protected: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
62 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
63 virtual void closeEvent (QCloseEvent *e); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
64 |
24865
5f7b9ee5b878
Add a QFrame to the variable editor panels and adjust tooltips (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24858
diff
changeset
|
65 void resizeEvent (QResizeEvent *event); |
5f7b9ee5b878
Add a QFrame to the variable editor panels and adjust tooltips (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24858
diff
changeset
|
66 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
67 public slots: |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
68 |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
69 void handle_focus_change (QWidget *old, QWidget *now); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
70 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
71 private slots: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
72 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
73 void change_floating (bool); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
74 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
75 void change_existence (bool); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
76 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
77 void toplevel_change (bool); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
78 |
24858
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24828
diff
changeset
|
79 void change_fullscreen (void); |
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24828
diff
changeset
|
80 |
24865
5f7b9ee5b878
Add a QFrame to the variable editor panels and adjust tooltips (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24858
diff
changeset
|
81 protected: |
5f7b9ee5b878
Add a QFrame to the variable editor panels and adjust tooltips (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24858
diff
changeset
|
82 |
5f7b9ee5b878
Add a QFrame to the variable editor panels and adjust tooltips (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24858
diff
changeset
|
83 QFrame *m_frame; |
5f7b9ee5b878
Add a QFrame to the variable editor panels and adjust tooltips (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24858
diff
changeset
|
84 |
24858
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24828
diff
changeset
|
85 #if defined (HAVE_QGUIAPPLICATION) |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
86 |
24858
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24828
diff
changeset
|
87 QAction *m_fullscreen_action; |
24865
5f7b9ee5b878
Add a QFrame to the variable editor panels and adjust tooltips (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24858
diff
changeset
|
88 |
24858
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24828
diff
changeset
|
89 bool m_full_screen; |
24865
5f7b9ee5b878
Add a QFrame to the variable editor panels and adjust tooltips (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24858
diff
changeset
|
90 |
24858
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24828
diff
changeset
|
91 bool m_prev_floating; |
24865
5f7b9ee5b878
Add a QFrame to the variable editor panels and adjust tooltips (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24858
diff
changeset
|
92 |
24858
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24828
diff
changeset
|
93 QRect m_prev_geom; |
24865
5f7b9ee5b878
Add a QFrame to the variable editor panels and adjust tooltips (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24858
diff
changeset
|
94 |
24858
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24828
diff
changeset
|
95 #endif |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
96 }; |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
97 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
98 class variable_editor_stack : public QStackedWidget |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
99 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
100 Q_OBJECT |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
101 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
102 public: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
103 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
104 variable_editor_stack (QWidget *p = nullptr); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
105 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
106 variable_editor_view *edit_view (void) {return m_edit_view;}; |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
107 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
108 QTextEdit *disp_view (void) {return m_disp_view;}; |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
109 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
110 signals: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
111 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
112 void command_signal (const QString& cmd); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
113 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
114 void edit_variable_signal (const QString& name, const octave_value& val); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
115 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
116 public slots: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
117 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
118 void set_editable (bool editable); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
119 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
120 void levelUp (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
121 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
122 void save (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
123 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
124 private: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
125 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
126 QTextEdit *make_disp_view (QWidget *parent); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
127 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
128 variable_editor_view *m_edit_view; |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
129 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
130 QTextEdit *m_disp_view; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
131 }; |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
132 |
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
133 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
134 class variable_editor_view : public QTableView |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
135 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
136 Q_OBJECT |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
137 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
138 public: |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
139 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
140 variable_editor_view (QWidget *p = nullptr); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
141 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
142 void setModel (QAbstractItemModel *model); |
24708
75090f34ffb1
style fixes for varaible editor
John W. Eaton <jwe@octave.org>
parents:
24703
diff
changeset
|
143 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
144 signals: |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
145 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
146 void command_signal (const QString& cmd); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
147 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
148 void add_edit_actions_signal (QMenu *menu, const QString& qualifier_string); |
24758
09364b41ddb6
allow dynamic resizing of display rows and columns in variable editor
John W. Eaton <jwe@octave.org>
parents:
24708
diff
changeset
|
149 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
150 public slots: |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
151 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
152 void createVariable (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
153 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
154 void transposeContent (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
155 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
156 QList<int> range_selected (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
157 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
158 void delete_selected (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
159 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
160 void clearContent (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
161 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
162 void cutClipboard (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
163 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
164 void copyClipboard (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
165 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
166 void pasteClipboard (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
167 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
168 void pasteTableClipboard (void); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
169 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
170 void handle_horizontal_scroll_action (int action); |
24762
ed2d9ef336a7
resize varible editor model on scrollbar actions
John W. Eaton <jwe@octave.org>
parents:
24758
diff
changeset
|
171 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
172 void handle_vertical_scroll_action (int action); |
24762
ed2d9ef336a7
resize varible editor model on scrollbar actions
John W. Eaton <jwe@octave.org>
parents:
24758
diff
changeset
|
173 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
174 void createContextMenu (const QPoint& pt); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
175 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
176 void createColumnMenu (const QPoint& pt); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
177 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
178 void createRowMenu (const QPoint& pt); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
179 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
180 // Convert selection to an Octave expression. |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
181 QString selected_to_octave (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
182 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
183 void selected_command_requested (const QString& cmd); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
184 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
185 private: |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
186 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
187 void add_edit_actions (QMenu *menu, const QString& qualifier_string); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
188 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
189 variable_editor_model *m_var_model; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
190 }; |
24694
9b4edcc62936
add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents:
24693
diff
changeset
|
191 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
192 // Gadgets to keep track and restore what variable window |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
193 // was in focus just prior to selecting something on the |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
194 // menu bar |
24694
9b4edcc62936
add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents:
24693
diff
changeset
|
195 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
196 class HoverToolButton : public QToolButton |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
197 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
198 Q_OBJECT |
24694
9b4edcc62936
add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents:
24693
diff
changeset
|
199 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
200 public: |
24694
9b4edcc62936
add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents:
24693
diff
changeset
|
201 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
202 HoverToolButton (QWidget *parent = nullptr); |
24694
9b4edcc62936
add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents:
24693
diff
changeset
|
203 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
204 signals: |
24708
75090f34ffb1
style fixes for varaible editor
John W. Eaton <jwe@octave.org>
parents:
24703
diff
changeset
|
205 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
206 void hovered_signal (void); |
24708
75090f34ffb1
style fixes for varaible editor
John W. Eaton <jwe@octave.org>
parents:
24703
diff
changeset
|
207 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
208 void popup_shown_signal (void); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
209 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
210 protected: |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
211 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
212 bool eventFilter (QObject *obj, QEvent *ev); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
213 }; |
24694
9b4edcc62936
add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents:
24693
diff
changeset
|
214 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
215 class ReturnFocusToolButton : public HoverToolButton |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
216 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
217 Q_OBJECT |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
218 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
219 public: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
220 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
221 ReturnFocusToolButton (QWidget *parent = nullptr); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
222 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
223 signals: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
224 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
225 void about_to_activate (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
226 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
227 protected: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
228 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
229 bool eventFilter (QObject *obj, QEvent *ev); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
230 }; |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
231 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
232 class ReturnFocusMenu : public QMenu |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
233 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
234 Q_OBJECT |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
235 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
236 public: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
237 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
238 ReturnFocusMenu (QWidget *parent = nullptr); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
239 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
240 signals: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
241 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
242 void about_to_activate (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
243 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
244 protected: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
245 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
246 bool eventFilter (QObject *obj, QEvent *ev); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
247 }; |
24694
9b4edcc62936
add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents:
24693
diff
changeset
|
248 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
249 // The variable editor class |
24694
9b4edcc62936
add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents:
24693
diff
changeset
|
250 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
251 class variable_editor : public octave_dock_widget |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
252 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
253 Q_OBJECT |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
254 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
255 public: |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
256 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
257 variable_editor (QWidget *parent = nullptr); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
258 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
259 ~variable_editor (void) = default; |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
260 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
261 // No copying! |
24621
2bb3f3de0b4e
more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24585
diff
changeset
|
262 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
263 variable_editor (const variable_editor&) = delete; |
24621
2bb3f3de0b4e
more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24585
diff
changeset
|
264 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
265 variable_editor& operator = (const variable_editor&) = delete; |
24621
2bb3f3de0b4e
more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24585
diff
changeset
|
266 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
267 void refresh (void); |
24633
428780eec08a
improve behavior of variable editor
John W. Eaton <jwe@octave.org>
parents:
24621
diff
changeset
|
268 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
269 static QList<QColor> default_colors (void); |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
270 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
271 static QStringList color_names (void); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
272 |
25168
8c38361718a9
When Variable Editor is tabbed, activate that tab via openvar (bug #53443).
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
273 void tab_to_front (void); |
8c38361718a9
When Variable Editor is tabbed, activate that tab via openvar (bug #53443).
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
274 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
275 public slots: |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
276 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
277 void callUpdate (const QModelIndex&, const QModelIndex&); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
278 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
279 void notice_settings (const QSettings *); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
280 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
281 void edit_variable (const QString& name, const octave_value& val); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
282 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
283 void variable_destroyed (QObject *obj); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
284 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
285 void variable_focused (const QString& name); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
286 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
287 void record_hovered_focus_variable (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
288 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
289 void restore_hovered_focus_variable (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
290 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
291 protected slots: |
24694
9b4edcc62936
add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents:
24693
diff
changeset
|
292 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
293 void closeEvent (QCloseEvent *); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
294 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
295 void save (void); |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
296 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
297 void cutClipboard (void); |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
298 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
299 void copyClipboard (void); |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
300 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
301 void pasteClipboard (void); |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
302 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
303 void pasteTableClipboard (void); |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
304 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
305 void levelUp (void); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
306 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
307 // Send command to Octave interpreter. |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
308 // %1 in CMD is replaced with the value of selected_to_octave. |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
309 void relay_selected_command (const QString& cmd); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
310 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
311 signals: |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
312 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
313 void updated (void); |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
314 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
315 void finished (void); |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
316 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
317 void command_signal (const QString& cmd); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
318 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
319 void refresh_signal (void); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24694
diff
changeset
|
320 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
321 void clear_content_signal (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
322 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
323 void copy_clipboard_signal (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
324 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
325 void paste_clipboard_signal (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
326 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
327 void paste_table_clipboard_signal (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
328 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
329 void level_up_signal (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
330 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
331 void save_signal (void); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
332 |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
333 void delete_selected_signal (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
334 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
335 void selected_command_signal (const QString& cmd); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
336 |
25199
8cff7eceee87
Do Variable Editor focus retention and titlebar highlight properly (bug #53410).
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25168
diff
changeset
|
337 protected: |
8cff7eceee87
Do Variable Editor focus retention and titlebar highlight properly (bug #53410).
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25168
diff
changeset
|
338 |
8cff7eceee87
Do Variable Editor focus retention and titlebar highlight properly (bug #53410).
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25168
diff
changeset
|
339 void focusInEvent (QFocusEvent *ev); |
8cff7eceee87
Do Variable Editor focus retention and titlebar highlight properly (bug #53410).
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25168
diff
changeset
|
340 |
25220
07bddddc5856
Restore Variable Editor focusWidget lost in dock/undock transition (bug #53410)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25199
diff
changeset
|
341 void focusOutEvent (QFocusEvent *ev); |
07bddddc5856
Restore Variable Editor focusWidget lost in dock/undock transition (bug #53410)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25199
diff
changeset
|
342 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
343 private: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
344 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
345 QAction * add_action (QMenu *menu, const QIcon& icon, const QString& text, |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
346 const char *member); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
347 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
348 QMainWindow *m_main; |
24694
9b4edcc62936
add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents:
24693
diff
changeset
|
349 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
350 QToolBar *m_tool_bar; |
24694
9b4edcc62936
add contextmenu to the tab bar of the variable editor (part bug #53002)
Torsten <mttl@mailbox.org>
parents:
24693
diff
changeset
|
351 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
352 int m_default_width; |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
353 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
354 int m_default_height; |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
355 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
356 int m_add_font_height; |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
357 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
358 bool m_use_terminal_font; |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
359 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
360 bool m_alternate_rows; |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
361 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
362 QString m_stylesheet; |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
363 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
364 QFont m_font; |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
365 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
366 // If use_terminal_font is true then this will be different since |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
367 // "font" will contain the terminal font. |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
368 QFont m_sel_font; |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
369 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
370 QList<QColor> m_table_colors; |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
371 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
372 void update_colors (void); |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23978
diff
changeset
|
373 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
374 QAction *add_tool_bar_button (const QIcon &icon, const QString &text, |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
375 const QObject *receiver, const char *member); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
376 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
377 void construct_tool_bar (void); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
378 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
379 QString m_current_focus_vname; |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24762
diff
changeset
|
380 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
381 QString m_hovered_focus_vname; |
25220
07bddddc5856
Restore Variable Editor focusWidget lost in dock/undock transition (bug #53410)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25199
diff
changeset
|
382 |
07bddddc5856
Restore Variable Editor focusWidget lost in dock/undock transition (bug #53410)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25199
diff
changeset
|
383 QWidget *m_variable_focus_widget; |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
384 }; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
385 } |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
386 |
23978
665507c3c29d
Use Octave coding conventions for Variable Editor code.
Rik <rik@octave.org>
parents:
23927
diff
changeset
|
387 #endif |