X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FCollectionPlugin%2FCollectionPlugin_WidgetField.cpp;h=5c0040a916fcb79fc61d45b9c8d088f41ccff9c4;hb=0f22bfc2773dcbb793c2c9c6562d25e114250617;hp=ceab82f125c8d9544decf08ca910e094387b7061;hpb=7be77c97a026a5ee5a396af6281dfa17e1bf1127;p=modules%2Fshaper.git diff --git a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp index ceab82f12..5c0040a91 100644 --- a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp +++ b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp @@ -10,10 +10,7 @@ #include #include #include - -#include -#include -#include +#include #include #include @@ -116,7 +113,7 @@ CollectionPlugin_WidgetField:: ModuleBase_IWorkshop* theWorkshop, const Config_WidgetAPI* theData): ModuleBase_WidgetSelector(theParent, theWorkshop, theData), myHeaderEditor(0), - myIsEditing(false), myActivation(false) + myIsTabEdit(false), myActivation(false) { QVBoxLayout* aMainLayout = new QVBoxLayout(this); @@ -284,6 +281,13 @@ void CollectionPlugin_WidgetField::deactivate() storeValueCustom(); } +//********************************************************************************** +//void CollectionPlugin_WidgetField::showEvent(QShowEvent* theEvent) +//{ +// myShapeTypeCombo->setEnabled(!isEditingMode()); +// myFieldTypeCombo->setEnabled(!isEditingMode()); +// myNbComponentsSpn->setEnabled(!isEditingMode()); +//} //********************************************************************************** bool CollectionPlugin_WidgetField::eventFilter(QObject* theObject, QEvent* theEvent) @@ -349,8 +353,7 @@ bool CollectionPlugin_WidgetField::eventFilter(QObject* theObject, QEvent* theEv } else if (theEvent->type() == QEvent::FocusIn) { QTableWidget* aTable = dynamic_cast(theObject); if (aTable) { - XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop); - XGUI_PropertyPanel* aPanel = aWorkshop->propertyPanel(); + ModuleBase_IPropertyPanel* aPanel = myWorkshop->propertyPanel(); if (aPanel->activeWidget() != this) { myActivation = true; aPanel->activateWidget(this, false); @@ -583,17 +586,19 @@ bool CollectionPlugin_WidgetField::restoreValueCustom() //********************************************************************************** int CollectionPlugin_WidgetField::getSelectionType(const std::string& theStr) const { - if (theStr == "vertex") + QString aType(theStr.c_str()); + aType = aType.toLower(); + if (aType == "vertex") return 0; - else if (theStr == "edge") + else if (aType == "edge") return 1; - else if (theStr == "face") + else if (aType == "face") return 2; - else if (theStr == "solid") + else if (aType == "solid") return 3; - else if (theStr == "object") + else if (aType == "object") return 4; - else if (theStr == "part") + else if (aType == "part") return 5; return -1; } @@ -786,7 +791,7 @@ void CollectionPlugin_WidgetField::onStepMove(int theStep) //********************************************************************************** bool CollectionPlugin_WidgetField:: - isValidSelection(const std::shared_ptr& thePrs) + isValidSelectionCustom(const std::shared_ptr& thePrs) { return (myShapeTypeCombo->currentIndex() == 5)? false : true; } @@ -794,6 +799,9 @@ bool CollectionPlugin_WidgetField:: //********************************************************************************** void CollectionPlugin_WidgetField::onSelectionChanged() { + //if (isEditingMode()) + // return; + if (myActivation) { myActivation = false; return; @@ -802,8 +810,7 @@ void CollectionPlugin_WidgetField::onSelectionChanged() if (myShapeTypeCombo->currentIndex() == 5) return; - QList aSelected = - myWorkshop->selection()->getSelected(ModuleBase_ISelection::AllControls); + QList aSelected = getFilteredSelected(); AttributeSelectionListPtr aSelList = myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID()); @@ -952,8 +959,8 @@ void CollectionPlugin_WidgetField::onShapeTypeChanged(int theType) //********************************************************************************** bool CollectionPlugin_WidgetField::processEnter() { - if (myIsEditing) { - myIsEditing = false; + if (myIsTabEdit) { + myIsTabEdit = false; return true; } return false; @@ -962,8 +969,8 @@ bool CollectionPlugin_WidgetField::processEnter() //********************************************************************************** void CollectionPlugin_WidgetField::onFocusChanged(QWidget* theOld, QWidget* theNew) { - if (theNew && (!myIsEditing)) - myIsEditing = dynamic_cast(theNew); + if (theNew && (!myIsTabEdit)) + myIsTabEdit = dynamic_cast(theNew); } //**********************************************************************************