Mercurial > octave-nkf
annotate libgui/src/m-editor/octave-qscintilla.h @ 19640:3156773fcc80 gui-release
open a doc page from editor directly without command window
* file-editor.cc (add_file_editor_tab): connect new signal from edit area
requesting showing the documentation
* octave-qscintilla.cc (contextmenu_help_doc): emit new signal for documentation
* octave-qscintilla.h: new signal for documentation
author | Torsten <ttl@justmail.de> |
---|---|
date | Thu, 22 Jan 2015 19:02:24 +0100 |
parents | f90bb1e30de2 |
children | 4197fc428c7d |
rev | line source |
---|---|
16731
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
1 /* |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
2 |
16768 | 3 Copyright (C) 2013 Torsten |
16731
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
4 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
5 This file is part of Octave. |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
6 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
10 option) any later version. |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
11 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
15 for more details. |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
16 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
20 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
21 */ |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
22 |
16768 | 23 // Author: Torsten <ttl@justmail.de> |
24 | |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17635
diff
changeset
|
25 #if !defined (octave_octave_qscintilla_h) |
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17635
diff
changeset
|
26 #define octave_octave_qscintilla_h 1 |
16731
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
27 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
28 #include <Qsci/qsciscintilla.h> |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
29 #include <QMenu> |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
30 #include <QContextMenuEvent> |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
31 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
32 class octave_qscintilla : public QsciScintilla |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
33 { |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
34 Q_OBJECT |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
35 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
36 public: |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
37 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
38 octave_qscintilla (QWidget *p); |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
39 ~octave_qscintilla (); |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
40 |
16733
2723d1144f11
added test for qscintilla version 2.6.0
Torsten <ttl@justmail.de>
parents:
16731
diff
changeset
|
41 #ifdef HAVE_QSCI_VERSION_2_6_0 |
16731
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
42 virtual void contextMenuEvent (QContextMenuEvent *e); |
16733
2723d1144f11
added test for qscintilla version 2.6.0
Torsten <ttl@justmail.de>
parents:
16731
diff
changeset
|
43 #endif |
17627
811019b9ef57
Add help and documentation on actual keyword to the editor menu
Torsten <ttl@justmail.de>
parents:
16768
diff
changeset
|
44 void context_help_doc (bool); |
17628
99ffa521ecec
Add possibility to edit the function related to the actual keyword in editor
Torsten <ttl@justmail.de>
parents:
17627
diff
changeset
|
45 void context_edit (); |
17635
7945344506ae
Add possibility to run selected text of the editor in the terminal
Torsten <ttl@justmail.de>
parents:
17628
diff
changeset
|
46 void context_run (); |
17628
99ffa521ecec
Add possibility to edit the function related to the actual keyword in editor
Torsten <ttl@justmail.de>
parents:
17627
diff
changeset
|
47 void get_global_textcursor_pos (QPoint *global_pos, QPoint *local_pos); |
99ffa521ecec
Add possibility to edit the function related to the actual keyword in editor
Torsten <ttl@justmail.de>
parents:
17627
diff
changeset
|
48 bool get_actual_word (); |
16731
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
49 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
50 signals: |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
51 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
52 void execute_command_in_terminal_signal (const QString&); |
18721
99e26cb0f87f
use the actions from the editor for the context menu
Torsten <ttl@justmail.de>
parents:
18718
diff
changeset
|
53 void create_context_menu_signal (QMenu*); |
19038
e87e65bc71ae
improved finding a function file for editing in gui (bug #41509)
Torsten <ttl@justmail.de>
parents:
18723
diff
changeset
|
54 void context_menu_edit_signal (const QString&); |
18718
86eca5d178a6
disable some global shortcuts when editor gets focus to prevent conflicts
Torsten <ttl@justmail.de>
parents:
18460
diff
changeset
|
55 void qsci_has_focus_signal (bool); |
18723
fac35875f6eb
update enabled status of undo/redo actions in the editor
Torsten <ttl@justmail.de>
parents:
18721
diff
changeset
|
56 void status_update (bool,bool); |
19640
3156773fcc80
open a doc page from editor directly without command window
Torsten <ttl@justmail.de>
parents:
19460
diff
changeset
|
57 void show_doc_signal (const QString&); |
16731
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
58 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
59 private slots: |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
60 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
61 void contextmenu_help (bool); |
17627
811019b9ef57
Add help and documentation on actual keyword to the editor menu
Torsten <ttl@justmail.de>
parents:
16768
diff
changeset
|
62 void contextmenu_doc (bool); |
811019b9ef57
Add help and documentation on actual keyword to the editor menu
Torsten <ttl@justmail.de>
parents:
16768
diff
changeset
|
63 void contextmenu_help_doc (bool); |
17628
99ffa521ecec
Add possibility to edit the function related to the actual keyword in editor
Torsten <ttl@justmail.de>
parents:
17627
diff
changeset
|
64 void contextmenu_edit (bool); |
17635
7945344506ae
Add possibility to run selected text of the editor in the terminal
Torsten <ttl@justmail.de>
parents:
17628
diff
changeset
|
65 void contextmenu_run (bool); |
16731
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
66 |
18723
fac35875f6eb
update enabled status of undo/redo actions in the editor
Torsten <ttl@justmail.de>
parents:
18721
diff
changeset
|
67 void text_changed (void); |
fac35875f6eb
update enabled status of undo/redo actions in the editor
Torsten <ttl@justmail.de>
parents:
18721
diff
changeset
|
68 |
18718
86eca5d178a6
disable some global shortcuts when editor gets focus to prevent conflicts
Torsten <ttl@justmail.de>
parents:
18460
diff
changeset
|
69 protected: |
86eca5d178a6
disable some global shortcuts when editor gets focus to prevent conflicts
Torsten <ttl@justmail.de>
parents:
18460
diff
changeset
|
70 |
16731
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
71 private: |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
72 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
73 QString _word_at_cursor; |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
74 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
75 }; |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
76 |
01d523d5f796
add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
77 #endif |