1 // GEOM GEOMGUI : GUI for Geometry component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : MeasureGUI_WhatisDlg.cxx
23 // Author : Nicolas REJNERI, Open CASCADE S.A.S.
26 #include "MeasureGUI_WhatisDlg.h"
27 #include "MeasureGUI_Widgets.h"
31 #include <SUIT_Session.h>
32 #include <SUIT_ResourceMgr.h>
33 #include <SalomeApp_Tools.h>
35 //=================================================================================
36 // class : MeasureGUI_WhatisDlg( )
37 // purpose : Constructs a MeasureGUI_WhatisDlg which is a child of 'parent', with the
38 // name 'name' and widget flags set to 'f'.
39 // The dialog will by default be modeless, unless you set 'modal' to
40 // true to construct a modal dialog.
41 //=================================================================================
42 MeasureGUI_WhatisDlg::MeasureGUI_WhatisDlg( GeometryGUI* GUI, QWidget* parent )
43 : MeasureGUI_Skeleton( GUI, parent )
45 QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap(
46 "GEOM", tr( "ICON_DLG_WHATIS" ) ) );
47 QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap(
48 "GEOM", tr( "ICON_SELECT" ) ) );
50 setWindowTitle( tr( "GEOM_WHATIS_TITLE" ) );
52 /***************************************************************/
54 mainFrame()->GroupConstructors->setTitle( tr( "GEOM_WHATIS" ) );
55 mainFrame()->RadioButton1->setIcon( image0 );
57 myGrp = new MeasureGUI_1Sel1TextView( centralWidget() );
58 myGrp->GroupBox1->setTitle( tr( "GEOM_WHATIS_OBJECT" ) );
59 myGrp->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
60 myGrp->TextView1->setReadOnly( true );
61 myGrp->PushButton1->setIcon( image1 );
62 myGrp->LineEdit1->setReadOnly( true );
64 QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
65 layout->setMargin( 0 ); layout->setSpacing( 6 );
66 layout->addWidget( myGrp );
68 /***************************************************************/
70 myHelpFileName = "files/salome2_sp3_measuregui_functions.htm#Whatis";
77 //=================================================================================
78 // function : ~MeasureGUI_WhatisDlg()
79 // purpose : Destroys the object and frees any allocated resources
80 //=================================================================================
81 MeasureGUI_WhatisDlg::~MeasureGUI_WhatisDlg()
86 //=================================================================================
89 //=================================================================================
90 void MeasureGUI_WhatisDlg::Init()
92 mySelBtn = myGrp->PushButton1;
93 mySelEdit = myGrp->LineEdit1;
94 MeasureGUI_Skeleton::Init();
97 //=================================================================================
98 // function : processObject
100 //=================================================================================
101 void MeasureGUI_WhatisDlg::processObject()
104 myGrp->TextView1->setText( getParameters( aText ) ? aText : QString( "" ) );
108 //=================================================================================
109 // function : getParameters
111 //=================================================================================
112 bool MeasureGUI_WhatisDlg::getParameters( QString& theText )
114 if ( myObj->_is_nil() )
118 theText = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() )->WhatIs( myObj );
120 catch( const SALOME::SALOME_Exception& e ) {
121 SalomeApp_Tools::QtCatchCorbaException( e );
125 return getOperation()->IsDone();