]> SALOME platform Git repositories - modules/gui.git/blobdiff - src/PythonConsole/PythonConsole_PyConsole.cxx
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/gui.git] / src / PythonConsole / PythonConsole_PyConsole.cxx
index fed5b9bd47ca71d58f166147ab8e511c554dcd68..9c8f852377101f51f431e6cc293d4acc2f0f905d 100755 (executable)
@@ -1,3 +1,23 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library 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 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <Python.h>
 #include "PythonConsole_PyConsole.h"
 #include "PythonConsole_PyEditor.h"
 #include "PyInterp_base.h"
@@ -8,7 +28,9 @@
 
 using namespace std;
 
-//****************************************************************
+/*!
+  Constructor
+*/
 PythonConsole::PythonConsole(QWidget* parent, PyInterp_base* interp)
 : QWidget(parent), myEditor( 0 )
 {
@@ -26,14 +48,50 @@ PythonConsole::PythonConsole(QWidget* parent, PyInterp_base* interp)
   lay->addWidget( myEditor );
 }
 
-//****************************************************************
+/*!
+  Destructor
+*/
 PythonConsole::~PythonConsole()
 {
 }
 
-//****************************************************************
+/*!
+  Executes command
+  \param command - string with command and arguments
+*/
 void PythonConsole::exec( const QString& command )
 {
   if ( myEditor )
     myEditor->exec( command );
 }
+
+/*!
+  Blocks execution of main application until command is executed
+  \param command - string with command and arguments
+*/
+void PythonConsole::execAndWait( const QString& command )
+{
+  if ( myEditor )
+    myEditor->execAndWait( command );
+}
+
+/*!
+  Changes font of python console
+  \param f - new font
+*/
+void PythonConsole::setFont( const QFont& f )
+{
+  if( myEditor )
+    myEditor->setFont( f );
+}
+
+/*!
+  \return font of python console
+*/
+QFont PythonConsole::font() const
+{
+  QFont res;
+  if( myEditor )
+    res = myEditor->font();
+  return res;
+}