X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FVISUGUI%2FVisuGUI_SetupPlot2dDlg.cxx;h=f0e11c12613bab4310a4dc009034bb7602ef50bb;hb=e967b0415406f4f86ca2c9489abc8554b4c15dae;hp=120785fa09892ef8966a928289aab865ab64a675;hpb=bd4ee425f7277724791058beae4115e6262eb6d2;p=modules%2Fvisu.git diff --git a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx index 120785fa..f0e11c12 100644 --- a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx +++ b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx @@ -1,6 +1,21 @@ -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 : VisuGUI_SetupPlot2dDlg.cxx // Author : Vadim SANDLER @@ -8,10 +23,15 @@ // $Header$ #include "VisuGUI_SetupPlot2dDlg.h" +#include "VisuGUI.h" #include "SPlot2d_Curve.h" #include "SUIT_Tools.h" #include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" + +#include "LightApp_Application.h" #include #include @@ -183,20 +203,24 @@ VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* p myView->setMinimumWidth( frame->sizeHint().width() + MARGIN_SIZE * 2 ); - /* OK/Cancel buttons */ + /* OK/Cancel/Help buttons */ myOkBtn = new QPushButton( tr( "BUT_OK" ), this, "buttonOk" ); myOkBtn->setAutoDefault( TRUE ); myOkBtn->setDefault( TRUE ); myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this, "buttonCancel" ); myCancelBtn->setAutoDefault( TRUE ); + myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this, "buttonHelp" ); + myHelpBtn->setAutoDefault( TRUE ); - topLayout->addMultiCellWidget( myView, 0, 0, 0, 2 ); + topLayout->addMultiCellWidget( myView, 0, 0, 0, 3 ); topLayout->addWidget( myOkBtn, 1, 0 ); topLayout->setColStretch( 1, 5 ); topLayout->addWidget( myCancelBtn, 1, 2 ); + topLayout->addWidget( myHelpBtn, 1, 3 ); connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); enableControls(); @@ -426,6 +450,24 @@ void VisuGUI_SetupPlot2dDlg::onVBtnToggled( bool on ) } enableControls(); } +/*! + Slot, called when button is clicked +*/ +void VisuGUI_SetupPlot2dDlg::onHelp() +{ + QString aHelpFileName = "/files/creating_curves.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} /*! Enables/disables buttons */