// File : PythonConsole_PyEditor.cxx
// Author : Nicolas REJNERI
// Module : SALOME
-// $Header$
#include <PythonConsole_PyEditor.h> // this include must be first (see PyInterp_base.h)!
+
#include <PyInterp_Dispatcher.h>
+
#include <SUIT_Tools.h>
-#include <qapplication.h>
#include <qmap.h>
#include <qclipboard.h>
#include <qdragobject.h>
+#include <qapplication.h>
-//#include "utilities.h"
using namespace std;
-
//#ifdef _DEBUG_
//static int MYDEBUG = 1;
//#else
QFont aFont = SUIT_Tools::stringToFont( fntSet );
setFont(aFont);
setTextFormat(QTextEdit::PlainText);
+ setUndoRedoEnabled( false );
_currentPrompt = READY_PROMPT;
setWordWrap(NoWrap);
bool ctrlPressed = e->state() & ControlButton;
// check if <Shift> is pressed
bool shftPressed = e->state() & ShiftButton;
- // check if <Alt> is pressed
- bool altPressed = e->state() & AltButton;
// process <Ctrl>+<C> key-bindings
if ( aKey == Key_C && ctrlPressed ) {
}
}
}
+
+QPopupMenu* PythonConsole_PyEditor::createPopupMenu( const QPoint& pos )
+{
+ QPopupMenu* popup = QTextEdit::createPopupMenu( pos );
+
+ QValueList<int> ids;
+ for ( int i = 0; popup && i < popup->count(); i++ )
+ {
+ if ( !popup->isItemEnabled( popup->idAt( i ) ) )
+ ids.append( popup->idAt( i ) );
+ }
+
+ for ( QValueList<int>::const_iterator it = ids.begin(); it != ids.end(); ++it )
+ popup->removeItem( *it );
+
+ SUIT_Tools::simplifySeparators( popup );
+
+ return popup;
+}
// File : PythonConsole_PyEditor.h
// Author : Nicolas REJNERI
// Module : SALOME
-// $Header$
#ifndef PythonConsole_PyEditor_H
#define PythonConsole_PyEditor_H
public slots:
void handleReturn();
void onPyInterpChanged( PyInterp_base* );
+
+ virtual QPopupMenu* createPopupMenu( const QPoint& );
private:
QString _buf;