// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// $Header$
#include "MeasureGUI_Skeleton.h"
-#include "QAD_Desktop.h"
-#include "QAD_WaitCursor.h"
#include "GEOMBase.h"
#include "GEOM_Displayer.h"
#include "GeometryGUI.h"
-#include "SALOMEGUI_QtCatchCorbaException.hxx"
+
+#include "LightApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+#include "SalomeApp_Application.h"
+#include "SalomeApp_Tools.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_Session.h"
+#include "SUIT_OverrideCursor.h"
#include <qlineedit.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qbuttongroup.h>
+#include <qapplication.h>
//=================================================================================
// class : MeasureGUI_Skeleton()
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-MeasureGUI_Skeleton::MeasureGUI_Skeleton( QWidget* parent,
- const char* name,
- SALOME_Selection* Sel )
+MeasureGUI_Skeleton::MeasureGUI_Skeleton( GeometryGUI* GUI,
+ QWidget* parent,
+ const char* name )
: MeasureGUI_Skeleton_QTD( parent, name, false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
+ GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
+ myGeomGUI( GUI )
{
mySelBtn = 0;
mySelEdit = 0;
myDisplayer = 0;
+ myHelpFileName = "";
if ( !name )
setName( "MeasureGUI_Skeleton" );
buttonClose->setText( tr( "GEOM_BUT_CLOSE" ) );
+ buttonHelp->setText(tr("GEOM_BUT_HELP"));
buttonClose->setAutoDefault( false );
// function : Init()
// purpose :
//=================================================================================
-void MeasureGUI_Skeleton::Init( SALOME_Selection* Sel )
+void MeasureGUI_Skeleton::Init()
{
- myGeomGUI = GeometryGUI::GetGeomGUI();
-
/* init variables */
- mySelection = Sel;
-
myGeomGUI->SetActiveDialogBox((QDialog*)this);
/* signals and slots connections */
connect( buttonClose, SIGNAL( clicked() ),
this, SLOT( ClickOnCancel() ) );
+
+ connect( buttonHelp, SIGNAL( clicked() ),
+ this, SLOT( ClickOnHelp() ) );
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ),
this, SLOT ( DeactivateActiveDialog() ) );
connect( mySelBtn, SIGNAL( clicked() ),
this, SLOT ( SetEditCurrentArgument() ) );
- if ( mySelection )
- connect( mySelection, SIGNAL( currentSelectionChanged() ),
- this, SLOT ( SelectionIntoArgument() ) );
+ LightApp_SelectionMgr* aSel = ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr();
+ if ( aSel )
+ connect( aSel, SIGNAL( currentSelectionChanged() ),
+ this, SLOT ( SelectionIntoArgument() ) ) ;
/* displays Dialog */
RadioButton1->setChecked( TRUE );
close();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void MeasureGUI_Skeleton::ClickOnHelp()
+{
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(myGeomGUI ? app->moduleName(myGeomGUI->moduleName()) : QString(""), myHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
//=================================================================================
// function : LineEditReturnPressed()
const QString objectUserName = mySelEdit->text();
QWidget* thisWidget = ( QWidget* )this;
- if ( GEOMBase::SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) )
+ if ( GEOMBase::SelectionByNameInDialogs( thisWidget, objectUserName, selectedIO() ) )
mySelEdit->setText( objectUserName );
}
{
setEnabled( false );
- if ( mySelection )
- disconnect( mySelection, 0, this, 0 );
-
+ LightApp_SelectionMgr* aSel = ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr();
+ if ( aSel )
+ disconnect( aSel, 0, this, 0 );
+
myGeomGUI->SetActiveDialogBox( 0 );
globalSelection();
myGeomGUI->SetActiveDialogBox( ( QDialog* )this );
- if ( mySelection )
- connect( mySelection, SIGNAL( currentSelectionChanged() ),
- this, SLOT ( SelectionIntoArgument() ) );
+ LightApp_SelectionMgr* aSel = ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr();
+ if ( aSel )
+ connect( aSel, SIGNAL( currentSelectionChanged() ),
+ this, SLOT ( SelectionIntoArgument() ) ) ;
redisplayPreview();
activateSelection();
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
if( !testResult || aSelectedObject->_is_nil() )
{
//=================================================================================
void MeasureGUI_Skeleton::closeEvent( QCloseEvent* e )
{
- disconnect( mySelection, 0, this, 0 );
+ LightApp_SelectionMgr* aSel = ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr();
+ if ( aSel )
+ disconnect( aSel, 0, this, 0 );
QDialog::closeEvent( e );
}
try
{
- QAD_WaitCursor wc;
+ SUIT_OverrideCursor();
getDisplayer()->SetColor( Quantity_NOC_VIOLET );
getDisplayer()->SetToActivate( false );
}
catch( const SALOME::SALOME_Exception& e )
{
- QtCatchCorbaException( e );
+ SalomeApp_Tools::QtCatchCorbaException( e );
}
}
GEOM_Displayer* MeasureGUI_Skeleton::getDisplayer()
{
if ( !myDisplayer )
- myDisplayer = new GEOM_Displayer();
+ myDisplayer = new GEOM_Displayer( getStudy() );
return myDisplayer;
}
return getGeomEngine()->GetIMeasureOperations( getStudyId() );
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-