#include <ModuleBase_Tools.h>
#include <ModuleBase_IWorkshop.h>
#include <ModuleBase_ISelection.h>
-
-#include <XGUI_Tools.h>
-#include <XGUI_Workshop.h>
-#include <XGUI_PropertyPanel.h>
+#include <ModuleBase_IPropertyPanel.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeStringArray.h>
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);
storeValueCustom();
}
+//**********************************************************************************
+//void CollectionPlugin_WidgetField::showEvent(QShowEvent* theEvent)
+//{
+// myShapeTypeCombo->setEnabled(!isEditingMode());
+// myFieldTypeCombo->setEnabled(!isEditingMode());
+// myNbComponentsSpn->setEnabled(!isEditingMode());
+//}
//**********************************************************************************
bool CollectionPlugin_WidgetField::eventFilter(QObject* theObject, QEvent* theEvent)
} else if (theEvent->type() == QEvent::FocusIn) {
QTableWidget* aTable = dynamic_cast<QTableWidget*>(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);
//**********************************************************************************
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;
}
//**********************************************************************************
bool CollectionPlugin_WidgetField::
- isValidSelection(const std::shared_ptr<ModuleBase_ViewerPrs>& thePrs)
+ isValidSelectionCustom(const std::shared_ptr<ModuleBase_ViewerPrs>& thePrs)
{
return (myShapeTypeCombo->currentIndex() == 5)? false : true;
}
//**********************************************************************************
void CollectionPlugin_WidgetField::onSelectionChanged()
{
+ //if (isEditingMode())
+ // return;
+
if (myActivation) {
myActivation = false;
return;
if (myShapeTypeCombo->currentIndex() == 5)
return;
- QList<ModuleBase_ViewerPrsPtr> aSelected =
- myWorkshop->selection()->getSelected(ModuleBase_ISelection::AllControls);
+ QList<ModuleBase_ViewerPrsPtr> aSelected = getFilteredSelected();
AttributeSelectionListPtr aSelList =
myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID());
//**********************************************************************************
bool CollectionPlugin_WidgetField::processEnter()
{
- if (myIsEditing) {
- myIsEditing = false;
+ if (myIsTabEdit) {
+ myIsTabEdit = false;
return true;
}
return false;
//**********************************************************************************
void CollectionPlugin_WidgetField::onFocusChanged(QWidget* theOld, QWidget* theNew)
{
- if (theNew && (!myIsEditing))
- myIsEditing = dynamic_cast<QLineEdit*>(theNew);
+ if (theNew && (!myIsTabEdit))
+ myIsTabEdit = dynamic_cast<QLineEdit*>(theNew);
}
//**********************************************************************************