return true;
}
+void ModuleBase_ModelWidget::activate()
+{
+ if (!isEditingMode()) {
+ // the control value is stored to the mode by the focus in on the widget
+ // we need the value is initialized in order to enable the apply button in the property panel
+ // it should happens only in the creation mode because during edition all fields are filled
+ storeValue();
+ }
+ activateCustom();
+}
+
void ModuleBase_ModelWidget::updateObject(ObjectPtr theObj) const
{
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
virtual bool focusTo();
/// The methiod called when widget is activated
- virtual void activate() {}
+ void activate();
/// The methiod called when widget is deactivated
virtual void deactivate() {}
myAttributeID = theAttribute;
}
+ /// The methiod called when widget is activated
+ virtual void activateCustom() {};
+
/// Sends Update and Redisplay for the given object
/// \param theObj is updating object
void updateObject(ObjectPtr theObj) const;
}
//********************************************************************
-void ModuleBase_WidgetShapeSelector::activate()
+void ModuleBase_WidgetShapeSelector::activateCustom()
{
activateSelection(true);
}
virtual bool setSelection(ModuleBase_ViewerPrs theValue);
- /// The methiod called when widget is activated
- virtual void activate();
-
/// The methiod called when widget is deactivated
virtual void deactivate();
void onSelectionChanged();
protected:
- /// Computes and updates name of selected object in the widget
+ /// The methiod called when widget is activated
+ virtual void activateCustom();
+
+ /// Computes and updates name of selected object in the widget
void updateSelectionName();
/// Raise panel which contains this widget
}
-void PartSet_WidgetPoint2D::activate()
+void PartSet_WidgetPoint2D::activateCustom()
{
XGUI_ViewerProxy* aViewer = myWorkshop->viewer();
connect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)),
QIntList aModes;
aModes << TopAbs_VERTEX;
myWorkshop->moduleConnector()->activateSubShapesSelection(aModes);
- if (!isEditingMode()) {
- // the control value is stored to the mode by the focus in on the widget
- // we need the value is initialized in order to enable the apply button in the property panel
- // it should happens only in the creation mode because during edition all fields are filled
- storeValue();
- }
}
void PartSet_WidgetPoint2D::deactivate()
//bool initFromPrevious(ObjectPtr theObject);
- /// The methiod called when widget is activated
- virtual void activate();
-
/// The methiod called when widget is deactivated
virtual void deactivate();
/// \param theEvent a mouse event
void onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
+protected:
+ /// The methiod called when widget is activated
+ virtual void activateCustom();
+
private slots:
/// Process value changed event
void onValuesChanged();
}
}
-void PartSet_WidgetPoint2dDistance::activate()
+void PartSet_WidgetPoint2dDistance::activateCustom()
{
XGUI_ViewerProxy* aViewer = myWorkshop->viewer();
connect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)),
virtual ~PartSet_WidgetPoint2dDistance();
- /// The methiod called when widget is activated
- virtual void activate();
-
/// The methiod called when widget is deactivated
virtual void deactivate();
void onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
protected:
+ /// The methiod called when widget is activated
+ virtual void activateCustom();
+
/// Set the second point which defines a value in the widget as a distance with a first point defined by feature
void setPoint(FeaturePtr theFeature, const std::shared_ptr<GeomAPI_Pnt2d>& thePnt);
}
-void PartSet_WidgetSketchLabel::activate()
+void PartSet_WidgetSketchLabel::activateCustom()
{
std::shared_ptr<GeomAPI_Pln> aPlane = plane();
if (aPlane) {
QWidget* getControl() const;
- /// The methiod called when widget is activated
- virtual void activate();
-
/// The methiod called when widget is deactivated
virtual void deactivate();
/// Signal on plane selection
void planeSelected(const std::shared_ptr<GeomAPI_Pln>& thePln);
+protected:
+ /// The methiod called when widget is activated
+ virtual void activateCustom();
+
private slots:
/// Slot on plane selection
void onPlaneSelected();
#include <QKeyEvent>
XGUI_OperationMgr::XGUI_OperationMgr(QObject* theParent)
- : QObject(theParent), myIsValidationLock(false)
+ : QObject(theParent), myIsValidationLock(false), myIsApplyEnabled(false)
{
}