Back to index

salome-smesh  6.5.0
Public Member Functions | Protected Slots | Private Attributes
SMESHGUI_HypothesisDlg Class Reference

#include <SMESHGUI_Hypotheses.h>

List of all members.

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_GenericHypothesisCreator * myCreator
QLabel * myIconLabel
QLabel * myTypeLabel
QString myHelpFileName

Detailed Description

Definition at line 139 of file SMESHGUI_Hypotheses.h.


Constructor & Destructor Documentation

SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg ( SMESHGUI_GenericHypothesisCreator *  creator,
QWidget *  parent 
)

Definition at line 580 of file SMESHGUI_Hypotheses.cxx.

: 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() ) );
}

Here is the call graph for this function:

Definition at line 614 of file SMESHGUI_Hypotheses.cxx.

{
  delete myCreator;
}

Member Function Documentation

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

Definition at line 628 of file SMESHGUI_Hypotheses.cxx.

{
  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 648 of file SMESHGUI_Hypotheses.cxx.

{
  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
  if (app) {
    QString name = "SMESH";
    if(myCreator) {
      QVariant pluginName = myCreator->property( PLUGIN_NAME );
      if( pluginName.isValid() ) {
       QString rootDir = pluginName.toString() + "PLUGIN_ROOT_DIR";
       QString varValue = QString( getenv(rootDir.toLatin1().constData()));
       if(!varValue.isEmpty())
         name = pluginName.toString() + "PLUGIN";
      }
    }    
    app->onHelpContextModule(name, 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));
  }
}

Here is the caller graph for this function:

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

Definition at line 642 of file SMESHGUI_Hypotheses.cxx.

{
  if ( myCreator ) myCreator->onReject();
  QtxDialog::reject();
}

Definition at line 619 of file SMESHGUI_Hypotheses.cxx.

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

Definition at line 679 of file SMESHGUI_Hypotheses.cxx.

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

Definition at line 684 of file SMESHGUI_Hypotheses.cxx.

{
  myTypeLabel->setText( t );
}

Member Data Documentation

SMESHGUI_GenericHypothesisCreator* SMESHGUI_HypothesisDlg::myCreator [private]

Definition at line 157 of file SMESHGUI_Hypotheses.h.

Definition at line 159 of file SMESHGUI_Hypotheses.h.

Definition at line 158 of file SMESHGUI_Hypotheses.h.

Definition at line 158 of file SMESHGUI_Hypotheses.h.


The documentation for this class was generated from the following files: