]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0004412: External 9984 Add text
authorouv <oleg.uvarov@opencascade.com>
Wed, 14 Nov 2018 10:55:17 +0000 (13:55 +0300)
committerouv <oleg.uvarov@opencascade.com>
Wed, 14 Nov 2018 10:55:17 +0000 (13:55 +0300)
13 files changed:
adm_local/win32/Plot2d.vcproj
src/Plot2d/Plot2d_SetupCommentsDlg.cxx [new file with mode: 0644]
src/Plot2d/Plot2d_SetupCommentsDlg.h [new file with mode: 0644]
src/Plot2d/Plot2d_TextMarker.cxx [new file with mode: 0644]
src/Plot2d/Plot2d_TextMarker.h [new file with mode: 0644]
src/Plot2d/Plot2d_ViewFrame.cxx
src/Plot2d/Plot2d_ViewFrame.h
src/Plot2d/Plot2d_ViewWindow.cxx
src/Plot2d/Plot2d_ViewWindow.h
src/Plot2d/resources/Plot2d_images.ts
src/Plot2d/resources/Plot2d_msg_en.ts
src/Plot2d/resources/Plot2d_msg_fr.ts
src/Plot2d/resources/plot2d_comments_settings.png [new file with mode: 0644]

index 3b3051d5485ab8bb3a7c1175b8438cf71a259799..e7506bbf9139ac36c8de02320e4d4f1c46fef689 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="windows-1251"?>
 <VisualStudioProject
        ProjectType="Visual C++"
-       Version="9.00"
+       Version="9,00"
        Name="Plot2d"
        ProjectGUID="{D5E571BF-0C2E-4513-8BF0-A7A54E4EA973}"
        TargetFrameworkVersion="131072"
                                        />
                                </FileConfiguration>
                        </File>
+                       <File
+                               RelativePath="..\..\src\Plot2d\Plot2d_SetupCommentsDlg.h"
+                               >
+                               <FileConfiguration
+                                       Name="Release|Win32"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Generate moc_$(InputName).cxx..."
+                                               CommandLine="type $(InputPath) &gt; $(GUI_SRC_DIR)\$(ConfigurationName)32\include\$(InputFileName)&#x0D;&#x0A;$(QTDIR)\bin\moc.exe $(InputPath) -o ..\..\moc\moc_$(InputName).cxx&#x0D;&#x0A;"
+                                               Outputs="$(GUI_SRC_DIR)\$(ConfigurationName)32\include\$(InputFileName);..\..\moc\moc_$(InputName).cxx"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release|x64"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Generate moc_$(InputName).cxx..."
+                                               CommandLine="type $(InputPath) &gt; $(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName)&#x0D;&#x0A;$(QTDIR)\bin\moc.exe $(InputPath) -o ..\..\moc\moc_$(InputName).cxx&#x0D;&#x0A;"
+                                               Outputs="$(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName);..\..\moc\moc_$(InputName).cxx"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug|Win32"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Generate moc_$(InputName).cxx..."
+                                               CommandLine="type $(InputPath) &gt; $(GUI_SRC_DIR)\$(ConfigurationName)32\include\$(InputFileName)&#x0D;&#x0A;$(QTDIR)\bin\moc.exe $(InputPath) -o ..\..\moc\moc_$(InputName).cxx&#x0D;&#x0A;"
+                                               Outputs="$(GUI_SRC_DIR)\$(ConfigurationName)32\include\$(InputFileName);..\..\moc\moc_$(InputName).cxx"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug|x64"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Generate moc_$(InputName).cxx..."
+                                               CommandLine="type $(InputPath) &gt; $(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName)&#x0D;&#x0A;$(QTDIR)\bin\moc.exe $(InputPath) -o ..\..\moc\moc_$(InputName).cxx&#x0D;&#x0A;"
+                                               Outputs="$(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName);..\..\moc\moc_$(InputName).cxx"
+                                       />
+                               </FileConfiguration>
+                       </File>
                        <File
                                RelativePath="..\..\src\Plot2d\Plot2d_SetupCurveDlg.h"
                                >
                                        />
                                </FileConfiguration>
                        </File>
+                       <File
+                               RelativePath="..\..\src\Plot2d\Plot2d_TextMarker.h"
+                               >
+                               <FileConfiguration
+                                       Name="Release|Win32"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Update $(InputFileName)..."
+                                               CommandLine="type $(InputPath) &gt; $(GUI_SRC_DIR)\$(ConfigurationName)32\include\$(InputFileName)&#x0D;&#x0A;"
+                                               Outputs="$(GUI_SRC_DIR)\$(ConfigurationName)32\include\$(InputFileName)"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release|x64"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               CommandLine="type $(InputPath) &gt; $(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName)&#x0D;&#x0A;"
+                                               Outputs="$(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName)"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug|Win32"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Update $(InputFileName)..."
+                                               CommandLine="type $(InputPath) &gt; $(GUI_SRC_DIR)\$(ConfigurationName)32\include\$(InputFileName)&#x0D;&#x0A;"
+                                               Outputs="$(GUI_SRC_DIR)\$(ConfigurationName)32\include\$(InputFileName)"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug|x64"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               CommandLine="type $(InputPath) &gt; $(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName)&#x0D;&#x0A;"
+                                               Outputs="$(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName)"
+                                       />
+                               </FileConfiguration>
+                       </File>
                        <File
                                RelativePath="..\..\src\Plot2d\Plot2d_ToolTip.h"
                                >
                                        >
                                        <Tool
                                                Name="VCCustomBuildTool"
-                                               Description="Generate moc_$(InputName).cxx..."
+                                               Description="Update $(InputFileName)..."
                                                CommandLine="type $(InputPath) &gt; $(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName)&#x0D;&#x0A;$(QTDIR)\bin\moc.exe $(InputPath) -o ..\..\moc\moc_$(InputName).cxx&#x0D;&#x0A;"
                                                Outputs="$(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName);..\..\moc\moc_$(InputName).cxx"
                                        />
                                        >
                                        <Tool
                                                Name="VCCustomBuildTool"
-                                               Description="Generate moc_$(InputName).cxx..."
+                                               Description="Update $(InputFileName)..."
                                                CommandLine="type $(InputPath) &gt; $(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName)&#x0D;&#x0A;$(QTDIR)\bin\moc.exe $(InputPath) -o ..\..\moc\moc_$(InputName).cxx&#x0D;&#x0A;"
                                                Outputs="$(GUI_SRC_DIR)\$(ConfigurationName)64\include\$(InputFileName);..\..\moc\moc_$(InputName).cxx"
                                        />
                                RelativePath="..\..\src\Plot2d\Plot2d_Prs.cxx"
                                >
                        </File>
+                       <File
+                               RelativePath="..\..\src\Plot2d\Plot2d_SetupCommentsDlg.cxx"
+                               >
+                       </File>
                        <File
                                RelativePath="..\..\src\Plot2d\Plot2d_SetupCurveDlg.cxx"
                                >
                                RelativePath="..\..\src\Plot2d\Plot2d_SetupViewDlg.cxx"
                                >
                        </File>
+                       <File
+                               RelativePath="..\..\src\Plot2d\Plot2d_TextMarker.cxx"
+                               >
+                       </File>
                        <File
                                RelativePath="..\..\src\Plot2d\Plot2d_ToolTip.cxx"
                                >
                                        />
                                </FileConfiguration>
                        </File>
+                       <File
+                               RelativePath="..\..\src\Plot2d\resources\plot2d_comments_settings.png"
+                               >
+                               <FileConfiguration
+                                       Name="Release|Win32"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Update $(InputFileName)..."
+                                               CommandLine="type $(InputPath) &gt; ..\..\$(ConfigurationName)32\share\salome\resources\gui\$(InputFileName)&#x0D;&#x0A;"
+                                               Outputs="..\..\$(ConfigurationName)32\share\salome\resources\gui\$(InputFileName)"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release|x64"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Update $(InputFileName)..."
+                                               CommandLine="type $(InputPath) &gt; ..\..\$(ConfigurationName)64\share\salome\resources\gui\$(InputFileName)&#x0D;&#x0A;"
+                                               Outputs="..\..\$(ConfigurationName)64\share\salome\resources\gui\$(InputFileName)"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug|Win32"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Update $(InputFileName)..."
+                                               CommandLine="type $(InputPath) &gt; ..\..\$(ConfigurationName)32\share\salome\resources\gui\$(InputFileName)&#x0D;&#x0A;"
+                                               Outputs="..\..\$(ConfigurationName)32\share\salome\resources\gui\$(InputFileName)"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug|x64"
+                                       >
+                                       <Tool
+                                               Name="VCCustomBuildTool"
+                                               Description="Update $(InputFileName)..."
+                                               CommandLine="type $(InputPath) &gt; ..\..\$(ConfigurationName)64\share\salome\resources\gui\$(InputFileName)&#x0D;&#x0A;"
+                                               Outputs="..\..\$(ConfigurationName)64\share\salome\resources\gui\$(InputFileName)"
+                                       />
+                               </FileConfiguration>
+                       </File>
                        <File
                                RelativePath="..\..\src\Plot2d\resources\plot2d_curves_settings.png"
                                >
                                RelativePath="..\..\moc\moc_Plot2d_FitDataDlg.cxx"
                                >
                        </File>
+                       <File
+                               RelativePath="..\..\moc\moc_Plot2d_SetupCommentsDlg.cxx"
+                               >
+                       </File>
                        <File
                                RelativePath="..\..\moc\moc_Plot2d_SetupCurveDlg.cxx"
                                >
diff --git a/src/Plot2d/Plot2d_SetupCommentsDlg.cxx b/src/Plot2d/Plot2d_SetupCommentsDlg.cxx
new file mode 100644 (file)
index 0000000..74d246c
--- /dev/null
@@ -0,0 +1,352 @@
+// 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
+//
+//  SALOME Plot2d : implementation of desktop and GUI kernel
+//
+#include "Plot2d_SetupCommentsDlg.h"
+
+#include <QtxGroupBox.h>
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+#include <QComboBox>
+#include <QHeaderView>
+#include <QItemDelegate>
+#include <QLayout>
+#include <QLineEdit>
+#include <QTableWidget>
+#include <QToolButton>
+
+#define TEXT_COL      0
+#define X_COL         1
+#define Y_COL         2
+#define ALIGNMENT_COL 3
+
+//=============================================================================
+// Class    : Plot2d_SetupCommentsDlg::ItemDelegate
+// Purpose  : 
+//=============================================================================
+class Plot2d_SetupCommentsDlg::ItemDelegate : public QItemDelegate
+{
+public:
+  ItemDelegate( QObject* theParent, QValidator* theValidator )
+    : myValidator( theValidator ) {}
+
+public:
+  virtual QWidget* createEditor( QWidget* theParent,
+                                 const QStyleOptionViewItem& theOption,
+                                 const QModelIndex& ) const
+  {
+    QLineEdit* aLineEdit = new QLineEdit( theParent );
+    aLineEdit->setValidator( myValidator );
+    return aLineEdit;
+  }
+
+private:
+  QValidator* myValidator;
+};
+
+//=============================================================================
+// Function : Plot2d_SetupCommentsDlg
+// Purpose  : Constructor
+//=============================================================================
+Plot2d_SetupCommentsDlg::Plot2d_SetupCommentsDlg( QWidget* theParent )
+: QtxDialog( theParent, true, false, QtxDialog::OKCancel )
+{
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  setWindowTitle( tr( "SETUP_COMMENTS" ) );
+
+  QValidator* aDoubleValidator = new QDoubleValidator( this );
+
+  QFrame* aMainFrame = mainFrame();
+
+  QtxGroupBox* aGrp = new QtxGroupBox( aMainFrame ); 
+  aGrp->setTitle( tr( "PARAMETERS" ) );
+
+  myTable = new QTableWidget( aGrp );
+  myTable->setSelectionMode( QTableWidget::ExtendedSelection );
+
+  myTable->setRowCount( 0 );
+  myTable->setColumnCount( 4 );
+
+  QStringList aLabels = QStringList() << tr( "TEXT" ) << tr( "X" ) << tr( "Y" ) << tr( "ALIGNMENT" );
+  myTable->setHorizontalHeaderLabels( aLabels );
+
+  myTable->horizontalHeader()->setResizeMode( TEXT_COL, QHeaderView::Stretch );
+  myTable->horizontalHeader()->setResizeMode( X_COL, QHeaderView::Fixed );
+  myTable->horizontalHeader()->setResizeMode( Y_COL, QHeaderView::Fixed );
+  myTable->horizontalHeader()->setResizeMode( ALIGNMENT_COL, QHeaderView::Fixed );
+  myTable->horizontalHeader()->setHighlightSections( false );
+
+  myTable->setColumnWidth( X_COL, 80 );
+  myTable->setColumnWidth( Y_COL, 80 );
+  myTable->setColumnWidth( ALIGNMENT_COL, 100 );
+
+  myTable->verticalHeader()->setDefaultSectionSize( 20 );
+  myTable->verticalHeader()->hide();
+
+  myTable->setItemDelegateForColumn( X_COL, new ItemDelegate( myTable, aDoubleValidator ) );
+  myTable->setItemDelegateForColumn( Y_COL, new ItemDelegate( myTable, aDoubleValidator ) );
+
+  QPixmap aRemovePixmap = aResMgr->loadPixmap( "Plot2d", tr( "ICON_MINUS" ) );
+  QToolButton* aRemoveBtn = new QToolButton( aGrp );
+  aRemoveBtn->setIcon( aRemovePixmap );
+  aRemoveBtn->setFixedSize( aRemovePixmap.size() );
+  aGrp->insertTitleWidget( aRemoveBtn );
+
+  QVBoxLayout* aGrpLayout = new QVBoxLayout( aGrp );
+  aGrpLayout->setMargin( 5 );
+  aGrpLayout->setSpacing( 5 );
+  aGrpLayout->addWidget( myTable );
+
+  QVBoxLayout* aMainLayout = new QVBoxLayout( aMainFrame );
+  aMainLayout->setMargin( 0 );
+  aMainLayout->setSpacing( 0 );
+  aMainLayout->addWidget( aGrp );
+
+  connect( myTable, SIGNAL( cellChanged( int, int ) ), SLOT( onValueChanged( int, int ) ) );
+  connect( aRemoveBtn, SIGNAL( clicked() ), SLOT( onRemove() ) );
+
+  setButtonPosition( Right, Cancel );
+
+  setMinimumSize( 500, 300 );
+}
+
+//=============================================================================
+// Function : Plot2d_SetupCommentsDlg
+// Purpose  : Destructor
+//=============================================================================
+Plot2d_SetupCommentsDlg::~Plot2d_SetupCommentsDlg()
+{
+}
+
+//=============================================================================
+// Function : getAlignments
+// Purpose  : 
+//=============================================================================
+void Plot2d_SetupCommentsDlg::getAlignments( QStringList& theStrings,
+                                             QList< Qt::Alignment >& theValues ) const
+{
+  static QStringList aStrings;
+  static QList< Qt::Alignment > aValues;
+  if( aStrings.isEmpty() && aValues.isEmpty() )
+  {
+    aStrings.append( tr( "TOP_LEFT" ) );
+    aValues.append( Qt::AlignTop | Qt::AlignLeft );
+
+    aStrings.append( tr( "TOP_RIGHT" ) );
+    aValues.append( Qt::AlignTop | Qt::AlignRight );
+
+    aStrings.append( tr( "BOTTOM_LEFT" ) );
+    aValues.append( Qt::AlignBottom | Qt::AlignLeft );
+
+    aStrings.append( tr( "BOTTOM_RIGHT" ) );
+    aValues.append( Qt::AlignBottom | Qt::AlignRight );
+
+    aStrings.append( tr( "CENTER" ) );
+    aValues.append( Qt::AlignCenter );
+  }
+  theStrings = aStrings;
+  theValues = aValues;
+}
+
+//=============================================================================
+// Function : setCombo
+// Purpose  : 
+//=============================================================================
+void Plot2d_SetupCommentsDlg::setCombo( const int theRow, 
+                                        const int theCol, 
+                                        const QStringList& theStrings,
+                                        const QList< Qt::Alignment >& theValues,
+                                        const Qt::Alignment theCurrentValue  )
+{
+  QComboBox* aCombo = new QComboBox( myTable );
+
+  int anIndex = 0;
+  QStringListIterator aStringIter( theStrings );
+  QListIterator< Qt::Alignment > aValueIter( theValues );
+  while( aStringIter.hasNext() && aValueIter.hasNext() )
+  {
+    const QString& aString = aStringIter.next();
+    Qt::Alignment aValue = aValueIter.next();
+    aCombo->addItem( aString, int( aValue ) );
+    if( aValue == theCurrentValue )
+      aCombo->setCurrentIndex( anIndex );
+    anIndex++;
+  }
+
+  myTable->setCellWidget( theRow, theCol, aCombo );
+}
+
+//=============================================================================
+// Function : setText
+// Purpose  : 
+//=============================================================================
+void Plot2d_SetupCommentsDlg::setText( const int theRow,
+                                       const int theCol,
+                                       const QString& theText )
+{
+  QTableWidgetItem* anItem = myTable->item( theRow, theCol );
+  if ( !anItem )
+  {
+    anItem = new QTableWidgetItem( theText );
+    myTable->setItem( theRow, theCol, anItem );
+  }
+  else 
+    anItem->setText( theText );
+}
+
+//=============================================================================
+// Function : getText
+// Purpose  : 
+//=============================================================================
+QString Plot2d_SetupCommentsDlg::getText( const int theRow,
+                                          const int theCol ) const
+{
+  if( QTableWidgetItem* anItem = myTable->item( theRow, theCol ) )
+    return anItem->text();
+  return QString();
+}
+
+//=============================================================================
+// Function : SetParameters
+// Purpose  : 
+//=============================================================================
+void Plot2d_SetupCommentsDlg::SetParameters( const QVector< QString >& theTextList,
+                                             const QVector< double >& theXList,
+                                             const QVector< double >& theYList,
+                                             const QVector< Qt::Alignment >& theAlignmentList )
+{
+  int nbRows = qMax( qMax( theTextList.size(), theAlignmentList.size() ), 
+                     qMax( theXList.size(), theYList.size() ) );
+  myTable->setRowCount( nbRows );
+
+  QStringList anAlignmentStrings;
+  QList< Qt::Alignment > anAlignmentValues;
+  getAlignments( anAlignmentStrings, anAlignmentValues );
+
+  for ( int i = 0; i < nbRows; i++ )
+  {
+    setText( i, TEXT_COL, theTextList[ i ] );
+    setText( i, X_COL, QString( "%1" ).arg( theXList[ i ] ) );
+    setText( i, Y_COL, QString( "%1" ).arg( theYList[ i ] ) );
+    setCombo( i, ALIGNMENT_COL, anAlignmentStrings, anAlignmentValues, theAlignmentList[ i ] );
+  }
+
+  myRemovedIndexes.clear();
+}
+
+//=============================================================================
+// Function : GetParameters
+// Purpose  : 
+//=============================================================================
+void Plot2d_SetupCommentsDlg::GetParameters( QVector< QString >& theTextList,
+                                             QVector< double >& theXList,
+                                             QVector< double >& theYList,
+                                             QVector< Qt::Alignment >& theAlignmentList ) const
+{
+  int nbRows = myTable->rowCount();
+
+  theTextList.resize( nbRows );
+  theXList.resize( nbRows );
+  theYList.resize( nbRows );
+  theAlignmentList.resize( nbRows );
+
+  bool anIsOk;
+  for ( int i = 0; i < nbRows; i++ )
+  {
+    theTextList[ i ] = getText( i, TEXT_COL );
+
+    anIsOk = false;
+    double aX = getText( i, X_COL ).toDouble( &anIsOk );
+    theXList[ i ] = anIsOk ? aX : 0;
+
+    anIsOk = false;
+    double aY = getText( i, Y_COL ).toDouble( &anIsOk );
+    theYList[ i ] = anIsOk ? aY : 0;
+
+    anIsOk = false;
+    Qt::Alignment anAlignment = Qt::AlignTop | Qt::AlignLeft;
+    if( QComboBox* aCombo = dynamic_cast<QComboBox*>( myTable->cellWidget( i, ALIGNMENT_COL ) ) )
+    {
+      anAlignment = (Qt::Alignment)aCombo->itemData( aCombo->currentIndex() ).toInt( &anIsOk );
+      if( !anIsOk )
+        anAlignment = Qt::AlignTop | Qt::AlignLeft;
+    }
+    theAlignmentList[ i ] = anAlignment;
+  }
+}
+
+//=============================================================================
+// Function : GetRemovedIndexes
+// Purpose  : 
+//=============================================================================
+const QList< int >& Plot2d_SetupCommentsDlg::GetRemovedIndexes() const
+{
+  return myRemovedIndexes;
+}
+
+//=============================================================================
+// Function : onRemove
+// Purpose  : 
+//=============================================================================
+void Plot2d_SetupCommentsDlg::onRemove()
+{
+  QList< int > toRemove;
+
+  int aCurrRow = myTable->currentRow();
+  int aCurrCol = myTable->currentColumn();
+
+  // get selected rows
+  QSet< int > aSelRows;
+  QList<QTableWidgetSelectionRange> aRegs = myTable->selectedRanges();
+  QList<QTableWidgetSelectionRange>::iterator selIter;
+  for ( selIter = aRegs.begin(); selIter != aRegs.end(); ++selIter )
+  {
+    const QTableWidgetSelectionRange& aReg = *selIter;
+    for ( int i = aReg.topRow(), n = aReg.bottomRow(); i <= n; i++ )
+      aSelRows.insert( i );
+  }
+
+  int i, n;
+  for ( i = 0, n = myTable->rowCount(); i < n; i++ )
+  {
+    if ( aSelRows.contains( i ) || aCurrRow == i )
+      toRemove.append( i );
+  }
+
+  if ( !toRemove.count() )
+    return;
+
+  int nbRemoved = 0;
+  QList< int >::iterator anIter;
+  for ( anIter = toRemove.begin(); anIter != toRemove.end(); ++anIter )
+  {
+    int aRow = *anIter - nbRemoved;
+    myTable->removeRow( aRow );
+    myRemovedIndexes.append( aRow );
+    nbRemoved++;
+  }
+
+  int nbRows = myTable->rowCount();
+  if ( aCurrRow < nbRows && aCurrRow >= 0 && aCurrCol >= 0 )
+    myTable->setCurrentCell( aCurrRow, aCurrCol );
+  else if ( nbRows > 0 && aCurrCol >= 0 )
+    myTable->setCurrentCell( nbRows - 1, aCurrCol );
+}
diff --git a/src/Plot2d/Plot2d_SetupCommentsDlg.h b/src/Plot2d/Plot2d_SetupCommentsDlg.h
new file mode 100644 (file)
index 0000000..c88f844
--- /dev/null
@@ -0,0 +1,83 @@
+// 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
+//
+#ifndef PLOT2D_SETUPCOMMENTSDLG_H
+#define PLOT2D_SETUPCOMMENTSDLG_H
+
+#include "Plot2d.h"
+
+#include <QtxDialog.h>
+
+#include <QVector>
+#include <QList>
+
+class QTableWidget;
+
+/*!
+  \class Plot2d_SetupCommentsDlg
+  Dialog box for setup Plot2d comments parameters 
+*/
+
+class PLOT2D_EXPORT Plot2d_SetupCommentsDlg : public QtxDialog
+{ 
+  Q_OBJECT
+
+  class ItemDelegate;
+
+public:
+  Plot2d_SetupCommentsDlg( QWidget* theParent = 0 );
+  virtual ~Plot2d_SetupCommentsDlg();
+
+  void                      SetParameters( const QVector< QString >& theTextList,
+                                           const QVector< double >& theXList,
+                                           const QVector< double >& theYList,
+                                           const QVector< Qt::Alignment >& theAlignmentList );
+
+  void                      GetParameters( QVector< QString >& theTextList,
+                                           QVector< double >& theXList,
+                                           QVector< double >& theYList,
+                                           QVector< Qt::Alignment >& theAlignmentList ) const;
+
+  const QList< int >&       GetRemovedIndexes() const;
+
+private slots:
+  void                      onRemove();
+
+private:
+  void                      getAlignments( QStringList& theStrings,
+                                           QList< Qt::Alignment >& theValues ) const;
+
+  void                      setCombo( const int theRow, 
+                                      const int theCol, 
+                                      const QStringList& theStrings,
+                                      const QList< Qt::Alignment >& theValues,
+                                      const Qt::Alignment theCurrentValue );
+
+  void                      setText( const int theRow,
+                                     const int theCol,
+                                     const QString& theText );
+
+  QString                   getText( const int theRow,
+                                     const int theCol ) const;
+
+private:
+  QTableWidget*             myTable;
+  QList< int >              myRemovedIndexes;
+};
+
+#endif 
diff --git a/src/Plot2d/Plot2d_TextMarker.cxx b/src/Plot2d/Plot2d_TextMarker.cxx
new file mode 100644 (file)
index 0000000..ec8377b
--- /dev/null
@@ -0,0 +1,78 @@
+// 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 "Plot2d_TextMarker.h"
+
+//=============================================================================
+// Function : Plot2d_TextMarker
+// Purpose  : Constructor
+//=============================================================================
+Plot2d_TextMarker::Plot2d_TextMarker() : QwtPlotMarker()
+{
+}
+
+//=============================================================================
+// Function : Plot2d_TextMarker
+// Purpose  : Destructor
+//=============================================================================
+Plot2d_TextMarker::~Plot2d_TextMarker()
+{
+}
+
+//=============================================================================
+// Function : setData
+// Purpose  : 
+//=============================================================================
+void Plot2d_TextMarker::setData( const QString& theText,
+                                 const double theX,
+                                 const double theY,
+                                 const Qt::Alignment theAlignment )
+{
+  QwtText aLabel = label();
+  aLabel.setText( theText );
+  setLabel( aLabel );
+
+  QwtSymbol aSymbol = symbol();
+  if( theAlignment == Qt::AlignCenter )
+    aSymbol.setStyle( QwtSymbol::NoSymbol );
+  else
+  {
+    aSymbol.setStyle( QwtSymbol::Ellipse );
+    aSymbol.setSize( QSize( 3, 3 ) );
+  }
+  setSymbol( aSymbol );
+
+  setLabelAlignment( theAlignment );
+
+  setValue( theX, theY );
+}
+
+//=============================================================================
+// Function : getData
+// Purpose  : 
+//=============================================================================
+void Plot2d_TextMarker::getData( QString& theText,
+                                 double& theX,
+                                 double& theY,
+                                 Qt::Alignment& theAlignment ) const
+{
+  theText = label().text();
+  theX = xValue();
+  theY = yValue();
+  theAlignment = labelAlignment();
+}
diff --git a/src/Plot2d/Plot2d_TextMarker.h b/src/Plot2d/Plot2d_TextMarker.h
new file mode 100644 (file)
index 0000000..37b01d2
--- /dev/null
@@ -0,0 +1,45 @@
+// 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
+//
+#ifndef PLOT2D_TEXTMARKER_H
+#define PLOT2D_TEXTMARKER_H
+
+#include "Plot2d.h"
+
+#include <qwt_plot_marker.h>
+
+class PLOT2D_EXPORT Plot2d_TextMarker : public QwtPlotMarker
+{
+public:
+  Plot2d_TextMarker();
+  virtual ~Plot2d_TextMarker();
+
+  void setData( const QString& theText,
+                const double theX,
+                const double theY,
+                const Qt::Alignment theAlignment );
+
+  void getData( QString& theText,
+                double& theX,
+                double& theY,
+                Qt::Alignment& theAlignment ) const;
+
+protected:
+};
+
+#endif
index edaf43c3127759766d4de5a9ff009a4285e3a47a..4ffc36b6459895fcf06150c28e65bf488adfaed0 100755 (executable)
@@ -21,6 +21,7 @@
 #include "Plot2d_Prs.h"
 #include "Plot2d_Curve.h"
 #include "Plot2d_SetupCurvesDlg.h"
+#include "Plot2d_SetupCommentsDlg.h"
 #include "Plot2d_FitDataDlg.h"
 #include "Plot2d_ViewWindow.h"
 #include "Plot2d_SetupViewDlg.h"
@@ -788,7 +789,7 @@ void Plot2d_ViewFrame::updateCurve( Plot2d_Curve* curve, bool update )
 }
 
 /*!
-  Gets lsit of displayed curves
+  Gets list of displayed curves
 */
 int Plot2d_ViewFrame::getCurves( curveList& clist )
 {
@@ -800,11 +801,45 @@ int Plot2d_ViewFrame::getCurves( curveList& clist )
   return clist.count();
 }
 
+/*!
+  Gets list of displayed curves
+*/
 const CurveDict& Plot2d_ViewFrame::getCurves()
 {
   return myPlot->getCurves();
 }
 
+/*!
+  Displays comment
+*/
+void Plot2d_ViewFrame::displayComment( Plot2d_TextMarker* comment, bool update )
+{
+  comment->attach( myPlot );
+  myPlot->getComments().append( comment );
+  if( update )
+    myPlot->replot();
+}
+
+/*!
+  Erases comment
+*/
+void Plot2d_ViewFrame::eraseComment( Plot2d_TextMarker* comment, bool update )
+{
+  comment->hide();
+  comment->detach();
+  myPlot->getComments().removeAll( comment );
+  if( update )
+    myPlot->replot();
+}
+
+/*!
+  Gets list of displayed comments
+*/
+const CommentList& Plot2d_ViewFrame::getComments()
+{
+  return myPlot->getComments();
+}
+
 /*!
   Returns true if the curve is visible
 */
@@ -1269,6 +1304,87 @@ void Plot2d_ViewFrame::onCurvesSettings()
   delete aDlg;
 }
 
+/*!
+  "Comments settings" toolbar action slot
+*/
+void Plot2d_ViewFrame::onCommentsSettings()
+{
+  Plot2d_SetupCommentsDlg* aDlg = new Plot2d_SetupCommentsDlg( this );
+
+  int nbComments = myPlot->getComments().count();
+  if ( nbComments == 0 )
+    return;
+
+  QVector< QString > aTextList( nbComments );
+  QVector< double > aXList( nbComments );
+  QVector< double > aYList( nbComments );
+  QVector< Qt::Alignment > anAlignmentList( nbComments );
+
+  CommentList aComments;
+
+  CommentList::Iterator it = myPlot->getComments().begin();
+  int i = 0;
+  for ( i = 0; it != myPlot->getComments().end(); it++, i++ )
+  {
+    Plot2d_TextMarker* aComment = *it;
+    if ( !aComment )
+      return;
+
+    QString aText;
+    double aX = 0, aY = 0;
+    Qt::Alignment anAlignment = Qt::AlignTop | Qt::AlignLeft;
+    aComment->getData( aText, aX, aY, anAlignment );
+
+    aTextList[ i ] = aText;
+    aXList[ i ] = aX;
+    aYList[ i ] = aY;
+    anAlignmentList[ i ] = anAlignment;
+
+    aComments.append( aComment );
+  }
+
+  aDlg->SetParameters( aTextList, aXList, aYList, anAlignmentList );
+
+  if ( aDlg->exec() != QDialog::Accepted ) 
+    return;
+
+  const QList< int >& toRemove = aDlg->GetRemovedIndexes();
+  QList< int >::const_iterator aRemIter;
+  for ( aRemIter = toRemove.begin(); aRemIter != toRemove.end(); ++aRemIter )
+  {
+    int anIndex = *aRemIter;
+    if ( anIndex >= 0 && anIndex < (int)aComments.count() )  
+    {
+      Plot2d_TextMarker* aComment = aComments[ anIndex ];
+      aComments.removeAt( anIndex );
+      eraseComment( aComment );
+    }
+  }
+
+  QMap< int, Plot2d_TextMarker* > anIndexToComment;
+  QList< Plot2d_TextMarker* >::iterator aCurvIter;
+  for ( i = 0, aCurvIter = aComments.begin(); aCurvIter != aComments.end(); ++aCurvIter, ++i )
+    anIndexToComment[ i ] = *aCurvIter;
+
+  aDlg->GetParameters( aTextList, aXList, aYList, anAlignmentList );
+
+  int n;
+  for ( i = 0, n = aTextList.size(); i < n; i++ )
+  {
+    QString aText = aTextList[ i ];
+    double aX = aXList[ i ];
+    double aY = aYList[ i ];
+    Qt::Alignment anAlignment = anAlignmentList[ i ];
+
+    if( Plot2d_TextMarker* aComment = anIndexToComment[ i ] )
+      aComment->setData( aText, aX, aY, anAlignment );
+  }
+
+  Repaint();
+
+  delete aDlg;
+}
+
 /*!
   "Fit Data" command slot
   */
index 4ad6f70573ec134ed7b8f6af4aa97671cd3152d2..20e633cb7d858ecc50eee98339cd8d8ec9b28de0 100755 (executable)
@@ -20,6 +20,7 @@
 #define PLOT2D_VIEWFRAME_H
 
 #include "Plot2d_Curve.h"
+#include "Plot2d_TextMarker.h"
 #include <QtxMap.h>
 
 #include <QWidget>
@@ -38,6 +39,8 @@ typedef QwtPlotCurve* QwtPlotCurvePtr;
 typedef Plot2d_Curve* Plot2d_CurvePtr;
 typedef QtxMap<QwtPlotCurvePtr, Plot2d_CurvePtr> CurveDict;
 
+typedef QList<Plot2d_TextMarker*> CommentList;
+
 class PLOT2D_EXPORT Plot2d_ViewFrame : public QWidget
 { 
   Q_OBJECT
@@ -76,6 +79,9 @@ public:
   void    eraseCurves( const curveList& curves, bool update = false );
   int     getCurves( curveList& clist );
   const   CurveDict& getCurves();
+  void    displayComment( Plot2d_TextMarker* comment, bool update = false );
+  void    eraseComment( Plot2d_TextMarker* comment, bool update = false );
+  const   CommentList& getComments();
   bool    isVisible( Plot2d_Curve* curve );
   void    updateCurve( Plot2d_Curve* curve, bool update = false );
   void    updateLegend( const Plot2d_Prs* prs );
@@ -181,6 +187,7 @@ public slots:
   void    onViewGlobalPan(); 
   void    onSettings();
   void    onCurvesSettings();
+  void    onCommentsSettings();
   void    onFitData();
   void    onChangeBackground();
   void    onPanLeft();
@@ -282,7 +289,8 @@ public:
 
   bool                polished() const { return myIsPolished; }
   QwtPlotGrid*        grid() { return myGrid; };
-  CurveDict& getCurves() { return myCurves; }
+  CurveDict&          getCurves() { return myCurves; }
+  CommentList&        getComments() { return myComments; }
   Plot2d_Curve*       getClosestCurve( QPoint p, double& distance, int& index );
   QList<Plot2d_Curve*> getClosestPoints( QPoint thePoint, double theRadius, QList< QList< int > >& thePntIndex );
 
@@ -310,6 +318,7 @@ signals:
 
 protected:
   CurveDict          myCurves;
+  CommentList        myComments;
   QwtPlotGrid*       myGrid;
   QList<QColor>      myColors;
   bool               myIsPolished;
index fc8680a5c990f5acd3eec294f02477f53005b4cf..a4c8826b1af803580f350913bfbb8b8c0230ed23 100755 (executable)
@@ -145,6 +145,7 @@ void Plot2d_ViewWindow::contextMenuPopup( QMenu* thePopup )
   // settings
   thePopup->addAction( mgr->action( CurvSettingsId ) );
   thePopup->addAction( mgr->action( CurvesSettingsId ) );
+  thePopup->addAction( mgr->action( CommentsSettingsId ) );
 }
 
 /*!
@@ -360,15 +361,23 @@ void Plot2d_ViewWindow::createActions()
   connect( aAction, SIGNAL( triggered( bool ) ), myViewFrame, SLOT( onSettings() ) );
   mgr->registerAction( aAction, CurvSettingsId );
 
-  // 8. Curves Settings
+  // 9.1. Curves Settings
   aAction = new QtxAction( tr( "TOT_CURVES_SETTINGS"),
                 aResMgr->loadPixmap("Plot2d", tr("ICON_CURVES_SETTINGS")),
                 tr("MEN_CURVES_SETTINGS"), 0, this);
   aAction->setStatusTip( tr( "PRP_CURVES_SETTINGS") );
   connect( aAction, SIGNAL( triggered( bool ) ), myViewFrame, SLOT( onCurvesSettings() ) );
   mgr->registerAction( aAction, CurvesSettingsId );
-  
-  // 9. Clone
+
+  // 9.2. Comments Settings
+  aAction = new QtxAction( tr( "TOT_COMMENTS_SETTINGS"),
+                aResMgr->loadPixmap("Plot2d", tr("ICON_COMMENTS_SETTINGS")),
+                tr("MEN_COMMENTS_SETTINGS"), 0, this);
+  aAction->setStatusTip( tr( "PRP_COMMENTS_SETTINGS") );
+  connect( aAction, SIGNAL( triggered( bool ) ), myViewFrame, SLOT( onCommentsSettings() ) );
+  mgr->registerAction( aAction, CommentsSettingsId );
+
+  // 10. Clone
   aAction = new QtxAction( tr( "MNU_CLONE_VIEW" ),
                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CLONE_VIEW" ) ),
                            tr( "MNU_CLONE_VIEW" ),
@@ -414,6 +423,7 @@ void Plot2d_ViewWindow::createToolBar()
   mgr->append( LegendId, myToolBar );
   mgr->append( CurvSettingsId, myToolBar );
   mgr->append( CurvesSettingsId, myToolBar );
+  mgr->append( CommentsSettingsId, myToolBar );
   mgr->append( CloneId, myToolBar );
 }
 
index 2be1a9d4a44cfd3cddd6d394d67accef4f58af35..0e55bc112790dc8893f827db1578e4516c6fdb38 100755 (executable)
@@ -51,7 +51,7 @@ public:
    PModeYLinearId, PModeYLogarithmicId,
         CurvPointsId, CurvLinesId, CurvSplinesId, 
         LegendId,
-        CurvSettingsId, CurvesSettingsId,
+        CurvSettingsId, CurvesSettingsId, CommentsSettingsId,
         CloneId };
 
 public:
index 23101633b216ed4af1e7ced16d254aa575af960a..3c1295013428aefed26b278a617e166484bb373b 100644 (file)
         <source>ICON_CURVES_SETTINGS</source>
         <translation>plot2d_curves_settings.png</translation>
     </message>
+    <message>
+        <source>ICON_COMMENTS_SETTINGS</source>
+        <translation>plot2d_comments_settings.png</translation>
+    </message>
     <message>
         <source>ICON_MINUS</source>
         <translation>plot2d_minus.png</translation>
index ab6fcd6ec453ab96fcc0ca0b8961aba591f07df6..27c27377c2a8472ff59268020d1680bd3fce8aa6 100644 (file)
@@ -457,6 +457,18 @@ to replace the non-positive values with negligible positive values?</translation
         <source>PRP_CURVES_SETTINGS</source>
         <translation>Setups curves properties</translation>
     </message>
+    <message>
+        <source>TOT_COMMENTS_SETTINGS</source>
+        <translation>Comments settings</translation>
+    </message>
+    <message>
+        <source>MEN_COMMENTS_SETTINGS</source>
+        <translation>Comments settings</translation>
+    </message>
+    <message>
+        <source>PRP_COMMENTS_SETTINGS</source>
+        <translation>Setups comments properties</translation>
+    </message>
     <message>
         <source>CIRCLE_MARKER_LBL</source>
         <translation>Circle</translation>
@@ -575,23 +587,51 @@ to replace the non-positive values with negligible positive values?</translation
         <translation>Nb markers</translation>
     </message>
 </context>
+<context>
+    <name>Plot2d_SetupCommentsDlg</name>
+    <message>
+      <source>SETUP_COMMENTS</source>
+      <translation>Setup comments</translation>
+    </message>
+    <message>
+        <source>PARAMETERS</source>
+        <translation>Parameters</translation>
+    </message>
+    <message>
+        <source>TEXT</source>
+        <translation>Text</translation>
+    </message>
+    <message>
+        <source>X</source>
+        <translation>X</translation>
+    </message>
+    <message>
+        <source>Y</source>
+        <translation>Y</translation>
+    </message>
+    <message>
+        <source>ALIGNMENT</source>
+        <translation>Alignment</translation>
+    </message>
+    <message>
+        <source>TOP_LEFT</source>
+        <translation>Top left</translation>
+    </message>
+    <message>
+        <source>TOP_RIGHT</source>
+        <translation>Top right</translation>
+    </message>
+    <message>
+        <source>BOTTOM_LEFT</source>
+        <translation>Bottom left</translation>
+    </message>
+    <message>
+        <source>BOTTOM_RIGHT</source>
+        <translation>Bottom right</translation>
+    </message>
+    <message>
+        <source>CENTER</source>
+        <translation>Center</translation>
+    </message>
+</context>
 </TS>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
index 76436a3b3865270193d2f28a86181107ee788a21..bc4207b76c8c4aa51f0fc12aae955d14dd189a6d 100755 (executable)
@@ -445,6 +445,18 @@ L&apos;échelle logarithmique de l&apos;ordonnée n&apos;est pas permise.</trans
         <source>PRP_CURVES_SETTINGS</source>
         <translation type="unfinished">Définir les paramètres des courbes</translation>
     </message>
+    <message>
+        <source>TOT_COMMENTS_SETTINGS</source>
+        <translation type="unfinished">Paramètres des commentaires</translation>
+    </message>
+    <message>
+        <source>MEN_COMMENTS_SETTINGS</source>
+        <translation type="unfinished">Paramètres des commentaires</translation>
+    </message>
+    <message>
+        <source>PRP_COMMENTS_SETTINGS</source>
+        <translation type="unfinished">Définir les paramètres des commentaires</translation>
+    </message>
     <message>
         <source>CIRCLE_MARKER_LBL</source>
         <translation>Circle</translation>
@@ -555,4 +567,51 @@ L&apos;échelle logarithmique de l&apos;ordonnée n&apos;est pas permise.</trans
         <translation type="unfinished">Numéro de repères</translation>
     </message>
 </context>
+<context>
+    <name>Plot2d_SetupCommentsDlg</name>
+    <message>
+        <source>SETUP_COMMENTS</source>
+        <translation type="unfinished">Setup comments</translation>
+    </message>
+    <message>
+        <source>PARAMETERS</source>
+        <translation type="unfinished">Parameters</translation>
+    </message>
+    <message>
+        <source>TEXT</source>
+        <translation type="unfinished">Text</translation>
+    </message>
+    <message>
+        <source>X</source>
+        <translation type="unfinished">X</translation>
+    </message>
+    <message>
+        <source>Y</source>
+        <translation type="unfinished">Y</translation>
+    </message>
+    <message>
+        <source>ALIGNMENT</source>
+        <translation type="unfinished">Alignment</translation>
+    </message>
+    <message>
+        <source>TOP_LEFT</source>
+        <translation type="unfinished">Top left</translation>
+    </message>
+    <message>
+        <source>TOP_RIGHT</source>
+        <translation type="unfinished">Top right</translation>
+    </message>
+    <message>
+        <source>BOTTOM_LEFT</source>
+        <translation type="unfinished">Bottom left</translation>
+    </message>
+    <message>
+        <source>BOTTOM_RIGHT</source>
+        <translation type="unfinished">Bottom right</translation>
+    </message>
+    <message>
+        <source>CENTER</source>
+        <translation type="unfinished">Center</translation>
+    </message>
+</context>
 </TS>
diff --git a/src/Plot2d/resources/plot2d_comments_settings.png b/src/Plot2d/resources/plot2d_comments_settings.png
new file mode 100644 (file)
index 0000000..13f9037
Binary files /dev/null and b/src/Plot2d/resources/plot2d_comments_settings.png differ