diff libgui/src/m-editor/octave-qscintilla.h @ 16731:01d523d5f796

add help for word at mouse or text cursor to the editors context menu * octave-qscintilla.h: new class derived from qsciscintilla to get acces to the editors context menu * octave-qscxintilla.cc(contextMenuEvent): create standard context menu and add entry for calling help on current word at cursor (contextmenu_help): handler for the new menu entry * libgui/src/module.mk: add new files octave_qscintilla.cc/.h * file-editor-tab.cc(constructor): _edit_area is of class octave_qscintilla, connect the signal of this class for command execution (execute_command_in_terminal): slot for signal connected in contructor * file-editor-tab.h: new slot for executing a command in terminal, _edit_area is of new class octave_qscintilla
author Torsten <ttl@justmail.de>
date Fri, 07 Jun 2013 23:13:48 +0200
parents
children 2723d1144f11
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgui/src/m-editor/octave-qscintilla.h	Fri Jun 07 23:13:48 2013 +0200
@@ -0,0 +1,55 @@
+/*
+
+Copyright (C) 2013 Torsten <ttl@justmail.de>
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+#if !defined (octave_qscintilla_h)
+#define octave_qscintilla_h 1
+
+#include <Qsci/qsciscintilla.h>
+#include <QMenu>
+#include <QContextMenuEvent>
+
+class octave_qscintilla : public QsciScintilla
+{
+  Q_OBJECT
+
+public:
+
+  octave_qscintilla (QWidget *p);
+  ~octave_qscintilla ();
+
+  virtual void contextMenuEvent (QContextMenuEvent *e);
+
+signals:
+
+  void execute_command_in_terminal_signal (const QString&);
+
+private slots:
+
+  void contextmenu_help (bool);
+
+private:
+
+  QString _word_at_cursor;
+
+};
+
+#endif