1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include "HYDROGUI_PolylineStyleDlg.h"
27 HYDROGUI_PolylineStyleDlg::HYDROGUI_PolylineStyleDlg( HYDROGUI_Module* theModule )
28 : HYDROGUI_InputPanel( theModule, tr( "POLYLINE_STYLE" ) )
30 QGroupBox* group = new QGroupBox( tr( "POLYLINE_STYLE" ), mainFrame() );
32 QGridLayout* lay = new QGridLayout( group );
34 myShape = new QComboBox( mainFrame() );
35 myShape->addItem( "???" );
36 myShape->addItem( tr( "No" ) );
37 myShape->addItem( tr( "Triangle" ) );
38 myShape->addItem( tr( "Cone" ) );
40 mySize = new QSpinBox( mainFrame() );
41 mySize->setRange( -1, 50 );
42 mySize->setSpecialValueText( " " );
44 lay->addWidget( new QLabel( tr( "PREF_POLYLINE_ARROW" ) ), 0, 0 );
45 lay->addWidget( myShape, 0, 1 );
46 lay->addWidget( new QLabel( tr( "PREF_POLYLINE_ARROW_SIZE" ) ), 1, 0 );
47 lay->addWidget( mySize, 1, 1 );
48 lay->setRowStretch( 2, 1 );
53 HYDROGUI_PolylineStyleDlg::~HYDROGUI_PolylineStyleDlg()
57 void HYDROGUI_PolylineStyleDlg::getStyle( int& theShape, int& theSize ) const
59 theShape = myShape->currentIndex();
60 theSize = mySize->value();
63 void HYDROGUI_PolylineStyleDlg::setStyle( int theShape, int theSize )
65 myShape->setCurrentIndex( theShape );
66 mySize->setValue( theSize );