comparison libgui/src/m-editor/octave-qscintilla.cc @ 18687:99e26cb0f87f gui-release

use the actions from the editor for the context menu * octave-qscintilla.cc (contextMenuEvent): emit new signal for adding the actions from the editor to the edit areas context menu * octave-qscintilla.h: new signal * file-editor-tab.cc (create_context_menu): new slot for the new signal from the edit area, (constructor): connect the edit areas signal for creating the context menu to this new slot * file-edit-tab.h: new slot and new signal for the editor dock widget * file-editor.cc (create_context_menu): new slot for the new signal from the edit tab adding the actions from the editor menu to the context menu, (add_new_edit_tab): connect the edit tabs signal for creating the context menu to this new slot * file-editor.h: new slot
author Torsten <ttl@justmail.de>
date Sun, 27 Apr 2014 18:35:19 +0200
parents 86eca5d178a6
children fac35875f6eb
comparison
equal deleted inserted replaced
18686:74ef7fed8b9a 18687:99e26cb0f87f
153 #ifdef HAVE_QSCI_VERSION_2_6_0 153 #ifdef HAVE_QSCI_VERSION_2_6_0
154 // context menu requested 154 // context menu requested
155 void 155 void
156 octave_qscintilla::contextMenuEvent (QContextMenuEvent *e) 156 octave_qscintilla::contextMenuEvent (QContextMenuEvent *e)
157 { 157 {
158 QPoint global_pos, local_pos; // the menu's position
158 QMenu *context_menu = createStandardContextMenu ( ); // standard menu 159 QMenu *context_menu = createStandardContextMenu ( ); // standard menu
159 160
160 // the menu's position 161 // fill context menu with editor's standard actions
161 QPoint global_pos, local_pos; 162 emit create_context_menu_signal (context_menu);
162 163
164 // determine position depending on mouse or keyboard event
163 if (e->reason () == QContextMenuEvent::Mouse) 165 if (e->reason () == QContextMenuEvent::Mouse)
164 { 166 {
165 // context menu by mouse 167 // context menu by mouse
166 global_pos = e->globalPos (); // global mouse position 168 global_pos = e->globalPos (); // global mouse position
167 local_pos = e->pos (); // local mouse position 169 local_pos = e->pos (); // local mouse position