Version: 6.3.1
Public Member Functions | Protected Slots | Private Attributes

SMESHGUI_HypothesisDlg Class Reference

#include <SMESHGUI_Hypotheses.h>

Inheritance diagram for SMESHGUI_HypothesisDlg:
Inheritance graph
[legend]

Public Member Functions

 SMESHGUI_HypothesisDlg (SMESHGUI_GenericHypothesisCreator *, QWidget *)
virtual ~SMESHGUI_HypothesisDlg ()
void setHIcon (const QPixmap &)
void setCustomFrame (QFrame *)
void setType (const QString &)

Protected Slots

virtual void accept ()
virtual void reject ()
void onHelp ()

Private Attributes

SMESHGUI_GenericHypothesisCreatormyCreator
QLabel * myIconLabel
QLabel * myTypeLabel
QString myHelpFileName

Detailed Description

Definition at line 136 of file SMESHGUI_Hypotheses.h.


Constructor & Destructor Documentation

SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg ( SMESHGUI_GenericHypothesisCreator creator,
QWidget parent 
)

Definition at line 566 of file SMESHGUI_Hypotheses.cxx.

References SMESHGUI_GenericHypothesisCreator.helpPage(), SMESHGUI_GenericHypothesisCreator.hypType(), myHelpFileName, myIconLabel, myTypeLabel, onHelp(), and SPACING.

: QtxDialog( parent, false, true ),
  myCreator( creator )
{
  setAttribute(Qt::WA_DeleteOnClose, true);
 // setMinimumSize( 300, height() );
//  setFixedSize( 300, height() );
  QVBoxLayout* topLayout = new QVBoxLayout( mainFrame() );
  topLayout->setMargin( 0 );
  topLayout->setSpacing( 0 );

  QFrame* titFrame = new QFrame( mainFrame() );
  QHBoxLayout* titLay = new QHBoxLayout( titFrame );
  titLay->setMargin( 0 );
  titLay->setSpacing( SPACING );

  myIconLabel = new QLabel( titFrame );
  myIconLabel->setScaledContents( false );
  myIconLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
  myTypeLabel = new QLabel( titFrame );
  if( creator )
    myTypeLabel->setText( creator->hypType() );

  titLay->addWidget( myIconLabel, 0 );
  titLay->addWidget( myTypeLabel, 0 );
  titLay->addStretch( 1 );

  topLayout->addWidget( titFrame, 0 );

  myHelpFileName = creator->helpPage();

  connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
}
SMESHGUI_HypothesisDlg::~SMESHGUI_HypothesisDlg ( ) [virtual]

Definition at line 600 of file SMESHGUI_Hypotheses.cxx.

References myCreator.

{
  delete myCreator;
}

Member Function Documentation

void SMESHGUI_HypothesisDlg::accept ( ) [protected, virtual, slot]

Definition at line 614 of file SMESHGUI_Hypotheses.cxx.

References SMESHGUI_GenericHypothesisCreator.checkParams(), and myCreator.

{
  QString msg;
  if ( myCreator && !myCreator->checkParams( msg ) )
  {
    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
    if ( !msg.isEmpty() )
      str += "\n" + msg;
    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
    return;
  }
  QtxDialog::accept();
}
void SMESHGUI_HypothesisDlg::onHelp ( ) [protected, slot]

Definition at line 634 of file SMESHGUI_Hypotheses.cxx.

References myHelpFileName.

Referenced by SMESHGUI_HypothesisDlg().

{
  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
  if (app) {
    SMESHGUI* aSMESHGUI = dynamic_cast<SMESHGUI*>( app->activeModule() );
    app->onHelpContextModule(aSMESHGUI ? app->moduleName(aSMESHGUI->moduleName()) : QString(""), myHelpFileName);
  }
  else {
    QString platform;
#ifdef WIN32
    platform = "winapplication";
#else
    platform = "application";
#endif
    SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
                                                                 platform)).
                             arg(myHelpFileName));
  }
}
void SMESHGUI_HypothesisDlg::reject ( ) [protected, virtual, slot]
void SMESHGUI_HypothesisDlg::setCustomFrame ( QFrame f)

Definition at line 605 of file SMESHGUI_Hypotheses.cxx.

Referenced by SMESHGUI_GenericHypothesisCreator.editHypothesis().

{
  if( f )
  {
    f->setParent( mainFrame() );
    qobject_cast<QVBoxLayout*>( mainFrame()->layout() )->insertWidget( 1, f, 1 );
  }
}
void SMESHGUI_HypothesisDlg::setHIcon ( const QPixmap &  p)

Definition at line 656 of file SMESHGUI_Hypotheses.cxx.

References myIconLabel.

Referenced by SMESHGUI_GenericHypothesisCreator.editHypothesis().

{
  myIconLabel->setPixmap( p );
}
void SMESHGUI_HypothesisDlg::setType ( const QString &  t)

Definition at line 661 of file SMESHGUI_Hypotheses.cxx.

References myTypeLabel.

Referenced by SMESHGUI_GenericHypothesisCreator.editHypothesis().

{
  myTypeLabel->setText( t );
}

Field Documentation

Definition at line 154 of file SMESHGUI_Hypotheses.h.

Referenced by accept(), reject(), and ~SMESHGUI_HypothesisDlg().

Definition at line 156 of file SMESHGUI_Hypotheses.h.

Referenced by onHelp(), and SMESHGUI_HypothesisDlg().

Definition at line 155 of file SMESHGUI_Hypotheses.h.

Referenced by setHIcon(), and SMESHGUI_HypothesisDlg().

Definition at line 155 of file SMESHGUI_Hypotheses.h.

Referenced by setType(), and SMESHGUI_HypothesisDlg().

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS