//
// See http://www.salome-platform.org/
//
-// File : GUI_version.h
-// Author : Vadim SANDLER
-// Module : SALOME
+// File : GUI_version.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
#if !defined(__GUI_VERSION_H__)
#define __GUI_VERSION_H__
#include "GLViewer_Viewer.h"
#include "GLViewer_ViewPort2d.h"
+#include <QtxToolBar.h>
+
#include <SUIT_Desktop.h>
#include <SUIT_Session.h>
#include <SUIT_ToolButton.h>
#include <QHBoxLayout>
#include <QString>
#include <QFrame>
-#include <QToolBar>
#include <QMouseEvent>
#include <QKeyEvent>
#include <QWheelEvent>
setBackgroundColor( Qt::white );
layout->addWidget( vp );
- myToolBar = new QToolBar(this);
- //myToolBar->setCloseMode(QDockWindow::Undocked);
- myToolBar->setWindowTitle(tr("LBL_TOOLBAR_LABEL"));
+ myToolBar = new QtxToolBar( true, tr("LBL_TOOLBAR_LABEL"), this );
+
createActions();
createToolBar();
}
aScaleBtn->AddAction(myActionsMap[FitRectId]);
aScaleBtn->AddAction(myActionsMap[FitSelectId]);
aScaleBtn->AddAction(myActionsMap[ZoomId]);
+ myToolBar->addWidget( aScaleBtn );
SUIT_ToolButton* aPanBtn = new SUIT_ToolButton(myToolBar);
aPanBtn->AddAction(myActionsMap[PanId]);
aPanBtn->AddAction(myActionsMap[GlobalPanId]);
+ myToolBar->addWidget( aPanBtn );
myToolBar->addAction( myActionsMap[ResetId] );
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : LogWindow.cxx
-// Author : Vadim SANDLER, Open CASCADE S.A. (vadim.sandler@opencascade.com)
-// Module : SALOME
+// File : LogWindow.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
#include "LogWindow.h"
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : LogWindow.h
-// Author : Vadim SANDLER, Open CASCADE S.A. (vadim.sandler@opencascade.com)
-// Module : SALOME
+// File : LogWindow.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
#ifndef LOGWINDOW_H
#define LOGWINDOW_H
setBackgroundRole( QPalette::NoRole );//NoBackground );
// set focus policy to threat QContextMenuEvent from keyboard
setFocusPolicy( Qt::StrongFocus );
+ setAttribute( Qt::WA_PaintOnScreen );
+ setAttribute( Qt::WA_NoSystemBackground );
}
/*!
#include "SUIT_ResourceMgr.h"
#include "SUIT_MessageBox.h"
+#include <QtxToolBar.h>
+
#include <QPainter>
#include <QTime>
#include <QImage>
-#include <QToolBar>
#include <QMouseEvent>
#include <QRubberBand>
setTransformRequested ( NOTHING );
setTransformInProcess ( false );
- myToolBar = new QToolBar(this);
- //myToolBar->setCloseMode(QDockWindow::Undocked); // toolbar has "Close" (X) button only if it's undocked, but there is no such functionality in Qt4
- myToolBar->setWindowTitle(tr("LBL_TOOLBAR_LABEL"));
+ myToolBar = new QtxToolBar( true, tr("LBL_TOOLBAR_LABEL"), this );
createActions();
createToolBar();
aScaleBtn->AddAction(myActionsMap[FitAllId]);
aScaleBtn->AddAction(myActionsMap[FitRectId]);
aScaleBtn->AddAction(myActionsMap[ZoomId]);
+ myToolBar->addWidget( aScaleBtn );
SUIT_ToolButton* aPanningBtn = new SUIT_ToolButton(myToolBar, "pan");
aPanningBtn->AddAction(myActionsMap[PanId]);
aPanningBtn->AddAction(myActionsMap[GlobalPanId]);
+ myToolBar->addWidget( aPanningBtn );
myToolBar->addAction( myActionsMap[ChangeRotationPointId] );
aViewsBtn->AddAction(myActionsMap[BottomId]);
aViewsBtn->AddAction(myActionsMap[LeftId]);
aViewsBtn->AddAction(myActionsMap[RightId]);
+ myToolBar->addWidget( aViewsBtn );
myToolBar->addAction( myActionsMap[ResetId] );
SUIT_ToolButton* aMemBtn = new SUIT_ToolButton(myToolBar, "view");
aMemBtn->AddAction(myActionsMap[MemId]);
aMemBtn->AddAction(myActionsMap[RestoreId]);
+ myToolBar->addWidget( aMemBtn );
myToolBar->addSeparator();
myToolBar->addAction( myActionsMap[CloneId] );
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : Plot2d_FitDataDlg.cxx
-// Author : Vadim SANDLER
-// Module : SALOME
-// $Header$
+// File : Plot2d_FitDataDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
#include "Plot2d_FitDataDlg.h"
#include <QLabel>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SALOME Plot2d : implementation of desktop and GUI kernel
+// File : Plot2d_SetupCurveDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
-// File : Plot2d_SetupCurveDlg.cxx
-// Author : Vadim SANDLER
-// Module : SALOME
-// $Header$
#include "Plot2d_SetupCurveDlg.h"
#include "SUIT_Tools.h"
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SALOME Plot2d : implementation of desktop and GUI kernel
+// File : Plot2d_SetupCurveDlg.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
-// File : Plot2d_SetupCurveDlg.h
-// Author : Vadim SANDLER
-// Module : SALOME
#ifndef Plot2d_SetupCurveDlg_H
#define Plot2d_SetupCurveDlg_H
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : Plot2d_SetupViewDlg.cxx
-// Author : Vadim SANDLER
-// Module : SALOME
-// $Header$
+// File : Plot2d_SetupViewDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
#include "Plot2d_SetupViewDlg.h"
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : PyConsole.h
-// Author : Vadim SANDLER
-// Module : SALOME
+// File : PyConsole.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
#if !defined ( PYCONSOLE_H )
#define PYCONSOLE_H
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : PyConsole_Console.cxx
-// Author : Vadim SANDLER
-// Module : SALOME
+// File : PyConsole_Console.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
/*!
\class PyConsole_Console
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : PyConsole_Console.h
-// Author : Vadim SANDLER, Open CASCADE S.A. (vadim.sandler@opencascade.com)
-// Module : SALOME
+// File : PyConsole_Console.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
#ifndef PYCONSOLE_CONSOLE_H
#define PYCONSOLE_CONSOLE_H
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : PyConsole_Editor.cxx
-// Author : Vadim SANDLER
-// Module : SALOME
+// File : PyConsole_Editor.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
/*!
\class PyConsole_Editor
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : PyConsole_Editor.h
-// Author : Vadim SANDLER
-// Module : SALOME
+// File : PyConsole_Editor.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
#ifndef PYCONSOLE_EDITOR_H
#define PYCONSOLE_EDITOR_H
} DumpMode;
//! Color scale flags (bitwise).
typedef enum {
- AtBorder = 0x001,
- Reverse = 0x002,
- Integer = 0x004,
- WrapTitle = 0x008,
- PreciseFormat = 0x010,
- Transparent = 0x020
+ AtBorder = 0x001, //!< diplay values at colors boundaries
+ Reverse = 0x002, //!< display color scale in reverse order
+ Integer = 0x004, //!< round numbers to integer values
+ WrapTitle = 0x008, //!< wrap title to several lines
+ PreciseFormat = 0x010, //!< autodetect decimal point precision for color scale values
+ Transparent = 0x020 //!< transparent background (not implemented yet!)
} Flags;
public:
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: QtxMap.h
-// Author: Vadim SANDLER
+// File : QtxMap.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
#ifndef QTXMAP_H
#define QTXMAP_H
/*!
\class QtxPagePrefToolBoxItem
+ \brief GUI implementation of the tool box container preference item.
*/
+/*!
+ \brief Constructor.
+ \param title preference item title
+ \param parent parent preference item
+ \param sect resource file section associated with the preference item
+ \param param resource file parameter associated with the preference item
+*/
QtxPagePrefToolBoxItem::QtxPagePrefToolBoxItem( const QString& title, QtxPreferenceItem* parent,
const QString& sect, const QString& param )
: QtxPagePrefItem( title, parent, sect, param )
setWidget( myToolBox = new QToolBox( 0 ) );
}
+/*!
+ \brief Destructor.
+*/
QtxPagePrefToolBoxItem::~QtxPagePrefToolBoxItem()
{
}
+/*!
+ \brief Update widget contents.
+*/
void QtxPagePrefToolBoxItem::updateContents()
{
updateToolBox();
}
+/*!
+ \brief Update tool box widget.
+*/
void QtxPagePrefToolBoxItem::updateToolBox()
{
QList<QtxPagePrefItem*> items;
myBox->setOrientation( o );
}
+/*!
+ \brief Check if the frame widget stretching is enabled.
+ \return \c true if the widget is stretchable
+ \sa setStretch()
+*/
bool QtxPagePrefFrameItem::stretch() const
{
QSpacerItem* s = 0;
return s ? s->expandingDirections() & Qt::Vertical : false;
}
+/*!
+ \brief Enable/disable frame widget stretching.
+ \param on new stretchable state
+ \sa stretch()
+*/
void QtxPagePrefFrameItem::setStretch( const bool on )
{
QSpacerItem* s = 0;
}
/*!
- \class QtxPagePrefPathListItem
- \brief GUI implementation of resources directory list item.
+ \class QtxPagePrefPathListItem
+ \brief GUI implementation of the resources files/directories list item.
*/
/*!
\brief GUI implementation of resources date/time item.
*/
+/*!
+ \brief Constructor.
+
+ Creates an item to enter date and time.
+
+ \param title preference item title
+ \param parent parent preference item
+ \param sect resource file section associated with the preference item
+ \param param resource file parameter associated with the preference item
+*/
QtxPagePrefDateTimeItem::QtxPagePrefDateTimeItem( const QString& title, QtxPreferenceItem* parent,
const QString& sect, const QString& param )
: QtxPageNamedPrefItem( title, parent, sect, param ),
-myType( DateTime )
+ myType( DateTime )
{
setControl( myDateTime = new QDateTimeEdit() );
myDateTime->setCalendarPopup( true );
updateDateTime();
}
+/*!
+ \brief Constructor.
+
+ Creates preference item for editing of the date and/or time value:
+ the type is specified by parameter \a type.
+
+ \param type preference item input type (QtxPagePrefDateTimeItem::InputType)
+ \param title preference item title
+ \param parent parent preference item
+ \param sect resource file section associated with the preference item
+ \param param resource file parameter associated with the preference item
+*/
QtxPagePrefDateTimeItem::QtxPagePrefDateTimeItem( const int type, const QString& title, QtxPreferenceItem* parent,
const QString& sect, const QString& param )
: QtxPageNamedPrefItem( title, parent, sect, param ),
-myType( type )
+ myType( type )
{
setControl( myDateTime = new QDateTimeEdit() );
myDateTime->setCalendarPopup( true );
updateDateTime();
}
+/*!
+ \brief Destructor.
+*/
QtxPagePrefDateTimeItem::~QtxPagePrefDateTimeItem()
{
}
+/*!
+ \brief Get date/time box preference item input type.
+ \return preference item input type (QtxPagePrefDateTimeItem::InputType)
+ \sa setInputType()
+*/
int QtxPagePrefDateTimeItem::inputType() const
{
return myType;
}
+/*!
+ \brief Set date/time box preference item input type.
+ \param type new preference item input type (QtxPagePrefDateTimeItem::InputType)
+ \sa inputType()
+*/
void QtxPagePrefDateTimeItem::setInputType( const int type )
{
if ( myType == type )
updateDateTime();
}
+/*!
+ \brief Check if the popup calendar menu is enabled.
+ \return \c true if calendar popup menu is enabled
+*/
bool QtxPagePrefDateTimeItem::calendar() const
{
return myDateTime->calendarPopup();
}
+/*!
+ \brief Enable/disable popup calendar menu.
+ \param on new flag state
+*/
void QtxPagePrefDateTimeItem::setCalendar( const bool on )
{
myDateTime->setCalendarPopup( on );
}
+/*!
+ \brief Get maximum date value.
+ \return maximum date value
+ \sa setMaximumDate(), minimumDate(), maximumTime(), minimumTime()
+*/
QDate QtxPagePrefDateTimeItem::maximumDate() const
{
return myDateTime->maximumDate();
}
+/*!
+ \brief Get maximum time value.
+ \return maximum time value
+ \sa setMaximumTime(), minimumTime(), maximumDate(), minimumDate()
+*/
QTime QtxPagePrefDateTimeItem::maximumTime() const
{
return myDateTime->maximumTime();
}
+/*!
+ \brief Get minimum date value.
+ \return minimum date value
+ \sa setMinimumDate(), maximumDate(), maximumTime(), minimumTime()
+*/
QDate QtxPagePrefDateTimeItem::minimumDate() const
{
return myDateTime->minimumDate();
}
+/*!
+ \brief Get minimum time value.
+ \return maximum time value
+ \sa setMinimumTime(), maximumTime(), maximumDate(), minimumDate()
+*/
QTime QtxPagePrefDateTimeItem::minimumTime() const
{
return myDateTime->minimumTime();
}
+/*!
+ \brief Set maximum date value.
+ \param d new maximum date value
+ \sa maximumDate(), minimumDate(), maximumTime(), minimumTime()
+*/
void QtxPagePrefDateTimeItem::setMaximumDate( const QDate& d )
{
if ( d.isValid() )
myDateTime->clearMaximumDate();
}
+/*!
+ \brief Set maximum time value.
+ \param t new maximum time value
+ \sa maximumTime(), minimumTime(), maximumDate(), minimumDate()
+*/
void QtxPagePrefDateTimeItem::setMaximumTime( const QTime& t )
{
if ( t.isValid() )
myDateTime->clearMaximumTime();
}
+/*!
+ \brief Set minimum date value.
+ \param d new minimum date value
+ \sa minimumDate(), maximumDate(), maximumTime(), minimumTime()
+*/
void QtxPagePrefDateTimeItem::setMinimumDate( const QDate& d )
{
if ( d.isValid() )
myDateTime->clearMinimumDate();
}
+/*!
+ \brief Set minimum time value.
+ \param t new minimum time value
+ \sa minimumTime(), maximumTime(), maximumDate(), minimumDate()
+*/
void QtxPagePrefDateTimeItem::setMinimumTime( const QTime& t )
{
if ( t.isValid() )
myDateTime->clearMinimumTime();
}
+/*!
+ \brief Store preference item to the resource manager.
+ \sa retrieve()
+*/
void QtxPagePrefDateTimeItem::store()
{
QString str;
setString( str );
}
+/*!
+ \brief Retrieve preference item from the resource manager.
+ \sa store()
+*/
void QtxPagePrefDateTimeItem::retrieve()
{
QString str = getString();
}
}
+/*!
+ \brief Get preference item option value.
+ \param name option name
+ \return property value or null QVariant if option is not set
+ \sa setOptionValue()
+*/
QVariant QtxPagePrefDateTimeItem::optionValue( const QString& name ) const
{
if ( name == "input_type" || name == "type" )
return QtxPageNamedPrefItem::optionValue( name );
}
+/*!
+ \brief Set preference item option value.
+ \param name option name
+ \param val new property value
+ \sa optionValue()
+*/
void QtxPagePrefDateTimeItem::setOptionValue( const QString& name, const QVariant& val )
{
if ( name == "input_type" || name == "type" )
QtxPageNamedPrefItem::setOptionValue( name, val );
}
+/*!
+ \brief Update date/time widget.
+*/
void QtxPagePrefDateTimeItem::updateDateTime()
{
QString dispFmt;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: QtxSplash.cxx
-// Author: Vadim SANDLER
+// File : QtxSplash.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
#include "QtxSplash.h"
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: QtxSplash.h
-// Author: Vadim SANDLER
+// File : QtxSplash.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
#ifndef QTXSPLASH_H
#define QTXSPLASH_H
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SalomePyQt.cxx
-// Author : Vadim SANDLER, Open CASCADE SAS, vadim.sandler@opencascade.com
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#include <SALOME_PYQT_Module.h> // this include must be first!!!
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SalomePyQt.h
-// Author : Vadim SANDLER, Open CASCADE SAS, vadim.sandler@opencascade.com
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#ifndef SALOME_PYQT_H
-//=============================================================================
-// File : SalomePyQt.sip
-// Created : 25/04/05
-// Author : Vadim SANDLER
-// Project : SALOME
-// Copyright : 2003-2005 CEA/DEN, EDF R&D
-// $Header : $
-//=============================================================================
+// 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
+//
+// File : SalomePyQt.sip
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
%Module SalomePyQt
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : SALOMEGUI_Swig.cxx
-// Author : Vadim SANDLER
+// File : SALOMEGUI_Swig.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#include "SALOMEGUI_Swig.hxx"
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : SALOMEGUI_Swig.hxx
-// Author : Vadim SANDLER
+// File : SALOMEGUI_Swig.hxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#ifndef SALOMEGUI_SWIG_HXX
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# File : test_big_table.py
-# Author : Vadim SANDLER
-# Module : SALOME
-# $Header$
+# File : test_big_table.py
+# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+#
import salome
import math
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# File : visu_many_objects.py
-# Author : Vadim SANDLER
-# Module : SALOME
-# $Header$
+# File : visu_many_objects.py
+# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+#
import salome
import SALOMEDS
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# File : test_table.py
-# Author : Vadim SANDLER
-# Module : SALOME
-# $Header$
+# File : test_table.py
+# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+#
import salome
import math
return res;
}
-/*! \retval true, if document was loaded successful, else false.*/
-bool STD_Application::onLoadDoc( const QString& aName )
-{
- bool res = true;
- if ( !activeStudy() )
- {
- // if no study - load in current desktop
- res = useStudy( aName );
- }
- else
- {
- // if study exists - load in new desktop. Check: is the same file is loaded?
- SUIT_Session* aSession = SUIT_Session::session();
- QList<SUIT_Application*> aAppList = aSession->applications();
- bool isAlreadyOpen = false;
- SUIT_Application* aApp = 0;
- for ( QList<SUIT_Application*>::iterator it = aAppList.begin(); it != aAppList.end() && !isAlreadyOpen; ++it )
- {
- aApp = *it;
- if ( aApp->activeStudy()->studyName() == aName )
- isAlreadyOpen = true;
- }
- if ( !isAlreadyOpen )
- {
- aApp = startApplication( 0, 0 );
- if ( aApp )
- res = aApp->useStudy( aName );
- }
- else
- aApp->desktop()->activateWindow();
- }
- return res;
-}
-
/*!Virtual function. Not implemented here.*/
void STD_Application::beforeCloseDoc( SUIT_Study* )
{
virtual void onOpenDoc();
virtual bool onOpenDoc( const QString& );
- virtual bool onLoadDoc( const QString& );
-
virtual void onExit();
virtual void onCopy();
return status;
}
-/*!
- Opens other study into active Study. If Study is empty - creates it.
- \param theName - name of study
-*/
-bool SUIT_Application::useStudy( const QString& /*theName*/ )
-{
- return false;
-}
-
/*!
Creates new empty Study if active Study = 0
*/
//! Opens document <theFileName> into active Study. If Study is empty - creates it.
virtual bool useFile( const QString& theFileName);
- //! Loads document <theName> into active Study. If Study is empty - creates it.
- virtual bool useStudy( const QString& theName);
-
//! Creates new empty Study if active Study = 0
virtual void createEmptyStudy();