]> SALOME platform Git repositories - samples/light.git/blobdiff - src/LIGHTGUI/LIGHTGUI_Selection.cxx
Salome HOME
Preparation of 3.1.0a2 - come back old implementation
[samples/light.git] / src / LIGHTGUI / LIGHTGUI_Selection.cxx
index ccc8a749b899740b2af1b93539f25ed92a028efc..82db12c09a2f18ac6c1ebc8ac8cce7a1a651dbd3 100644 (file)
 //  $Header$
 
 #include "LIGHTGUI_Selection.h"
-#include "LightApp_DataOwner.h"
+#include "LIGHTGUI_DataOwner.h"
 
-#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_SelectionMgr.h>
 
 //=================================================================================
 // function : LIGHTGUI_Selection()
 // purpose  : constructor
 //=================================================================================
-LIGHTGUI_Selection::LIGHTGUI_Selection ()
-: LightApp_Selection()
+LIGHTGUI_Selection::LIGHTGUI_Selection ( const QString&          client,
+                                        SalomeApp_SelectionMgr* mgr )
 {
-}
-
-//=================================================================================
-// function : ~LIGHTGUI_Selection()
-// purpose  : destructor
-//=================================================================================
-LIGHTGUI_Selection::~LIGHTGUI_Selection()
-{
-}
+  myPopupClient = client;
 
-//=================================================================================
-// function : init()
-// purpose  : initialization
-//=================================================================================
-void LIGHTGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr)
-{
   if ( mgr ) {
     SUIT_DataOwnerPtrList sel;
     mgr->selected( sel);
@@ -58,17 +44,21 @@ void LIGHTGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr
                                           aLast = sel.end();
     for ( ; anIt != aLast; anIt++ ) {
       SUIT_DataOwner* owner = (SUIT_DataOwner*)( (*anIt).get() );
-      LightApp_DataOwner* sowner = dynamic_cast<LightApp_DataOwner*>( owner );
-      QString anEntry = sowner->entry();
-      int anIndex = anEntry.find("_");
-      int aPosition = (anEntry.mid(anIndex+1, anEntry.length() - anIndex)).toInt();//lineNb();
-      if ( sowner && aPosition > 0 )
+      LIGHTGUI_DataOwner* sowner = dynamic_cast<LIGHTGUI_DataOwner*>( owner );
+      if ( sowner && sowner->lineNb() > 0 )
         myTypes.append( "TextLine" );
       else
         myTypes.append( "Unknown" );
     }
   }
-  LightApp_Selection::init(client, mgr);
+}
+
+//=================================================================================
+// function : ~LIGHTGUI_Selection()
+// purpose  : destructor
+//=================================================================================
+LIGHTGUI_Selection::~LIGHTGUI_Selection()
+{
 }
 
 //=================================================================================