+//=======================================================================
+//function : onTextChange
+//purpose :
+//=======================================================================
+
+void SMESHGUI_RemoveElementsDlg::onTextChange(const QString& theNewText)
+{
+ if ( myBusy ) return;
+ myBusy = true;
+
+ myNbOkElements = 0;
+
+ buttonOk->setEnabled( false );
+ buttonApply->setEnabled( false );
+
+ // hilight entered elements
+ SMDS_Mesh* aMesh = 0;
+ if ( myActor )
+ aMesh = myActor->GetObject()->GetMesh();
+ if ( aMesh ) {
+
+ mySelection->ClearIObjects();
+ mySelection->AddIObject( myActor->getIO() );
+
+ QStringList aListId = QStringList::split( " ", theNewText, false);
+ for ( int i = 0; i < aListId.count(); i++ ) {
+ const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
+ if ( e ) {
+ if ( !mySelection->IsIndexSelected( myActor->getIO(), e->GetID() ))
+ mySelection->AddOrRemoveIndex (myActor->getIO(), e->GetID(), true);
+ myNbOkElements++;
+ }
+ }
+
+ if ( myNbOkElements ) {
+ buttonOk->setEnabled( true );
+ buttonApply->setEnabled( true );
+ }
+ }
+
+ myBusy = false;
+}
+