Back to index

salome-geom  6.5.0
Public Member Functions
GroupGUI Class Reference

#include <GroupGUI.h>

List of all members.

Public Member Functions

 GroupGUI (GeometryGUI *)
 ~GroupGUI ()
bool OnGUIEvent (int, SUIT_Desktop *)

Detailed Description

Definition at line 36 of file GroupGUI.h.


Constructor & Destructor Documentation

GroupGUI::GroupGUI ( GeometryGUI *  parent)

Definition at line 47 of file GroupGUI.cxx.

  : GEOMGUI( parent )
{
}

Definition at line 56 of file GroupGUI.cxx.

{
}

Member Function Documentation

bool GroupGUI::OnGUIEvent ( int  theCommandID,
SUIT_Desktop *  parent 
)

Definition at line 65 of file GroupGUI.cxx.

{
  SalomeApp_Application* app = getGeometryGUI()->getApp();
  if ( !app ) return false;

  getGeometryGUI()->EmitSignalDeactivateDialog();

  QDialog* aDlg = 0;

  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
  if ( !appStudy ) return false;
  _PTR(Study) aStudy = appStudy->studyDS();

  if ( aStudy->GetProperties()->IsLocked() ) {
    SUIT_MessageBox::warning( parent,
                              tr( "WRN_WARNING" ), 
                              tr( "WRN_STUDY_LOCKED" ) );
    return false;
  }

  switch ( theCommandID ) {
  case GEOMOp::OpGroupCreate: 
  case GEOMOp::OpGroupCreatePopup: // CREATE GROUP
    aDlg = new GroupGUI_GroupDlg( GroupGUI_GroupDlg::CreateGroup, getGeometryGUI(), parent ); 
    break;
  case GEOMOp::OpGroupEdit:  // EDIT GROUP
    {
      SALOME_ListIO aList;
      aList.Clear();

      LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
      if ( aSelMgr )
        aSelMgr->selectedObjects( aList );

      if ( aList.Extent() == 1 ) {
        GEOM::GEOM_Object_var anObj =
          GEOMBase::ConvertIOinGEOMObject( aList.First() );

        if ( !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) {
          aDlg = new GroupGUI_GroupDlg( GroupGUI_GroupDlg::EditGroup, getGeometryGUI(), parent ); 
          break;
        }
      }
      SUIT_MessageBox::warning( parent, tr( "WRN_WARNING" ), tr( "NO_GROUP" ) );
      break;
    }
  default: 
    app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); 
    break;
  }

  if ( aDlg ) {
    aDlg->updateGeometry();
    aDlg->resize( aDlg->minimumSizeHint() );
    aDlg->show();
  }

  return true;
}

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