X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetPoint2DFlyout.cpp;h=b9f80b78352eecfe1c9926aa3b6c92d7c8866fa6;hb=2532fb2df83ee1ddd9ff3e8b381d3788eaa15b69;hp=61c2aba456c2978d92aabc452a8442a4f4922a93;hpb=1b93f1881c5fec599aa79707f93c84dd9c287bc0;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp b/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp index 61c2aba45..b9f80b783 100755 --- a/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp +++ b/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp @@ -1,11 +1,27 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: PartSet_WidgetPoint2D.cpp -// Created: 25 Apr 2014 -// Author: Natalia ERMOLAEVA +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include "PartSet_WidgetPoint2DFlyout.h" +#include "ModuleBase_WidgetValidator.h" +#include "ModuleBase_ViewerPrs.h" + #include #include #include @@ -16,19 +32,38 @@ #include -PartSet_WidgetPoint2DFlyout::PartSet_WidgetPoint2DFlyout(QWidget* theParent, +PartSet_WidgetPoint2DFlyout::PartSet_WidgetPoint2DFlyout(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData, - const std::string& theParentId) - : PartSet_WidgetPoint2D(theParent, theWorkshop, theData, theParentId) + const Config_WidgetAPI* theData) + : PartSet_WidgetPoint2D(theParent, theWorkshop, theData) +{ + myWidgetValidator = new ModuleBase_WidgetValidator(this, myWorkshop); +} + +bool PartSet_WidgetPoint2DFlyout::setSelection(QList& theValues, + const bool theToValidate) +{ + PartSet_WidgetPoint2D::setSelection(theValues, theToValidate); + // true value should be returned to set this control as processed the selection + // to move focus to the next control if it is filled by preselection + return true; +} + +bool PartSet_WidgetPoint2DFlyout::isValidSelectionCustom( + const std::shared_ptr& theValue) +{ + return false; +} + +bool PartSet_WidgetPoint2DFlyout::useSelectedShapes() const { - myIsInternal = theData->getBooleanAttribute(ATTR_INTERNAL, false); + return false; } bool PartSet_WidgetPoint2DFlyout::focusTo() { bool aCanAcceptFocus = true; - if (myIsInternal && isComputedDefault()) { + if (isInternal() && isComputedDefault()) { AISObjectPtr anObject = workshop()->displayer()->getAISObject(feature()); aCanAcceptFocus = anObject.get() && !anObject->isEmptyDistanceGeometry(); }