X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetEditor.h;h=d9c0671f7e3087e55ccd48cd0c29bb669faf5148;hb=d0e479afb535cd9d6542d53302428a5c8e99485f;hp=ded82628957ee54451f83046cd567772af409561;hpb=eb46781716082e5c57561426894fe4c0c989224e;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetEditor.h b/src/ModuleBase/ModuleBase_WidgetEditor.h index ded826289..d9c0671f7 100644 --- a/src/ModuleBase/ModuleBase_WidgetEditor.h +++ b/src/ModuleBase/ModuleBase_WidgetEditor.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ModuleBase_WidgetEditor.h // Created: 25 Apr 2014 // Author: Natalia ERMOLAEVA @@ -23,15 +25,12 @@ class MODULEBASE_EXPORT ModuleBase_WidgetEditor : public ModuleBase_WidgetDouble Q_OBJECT public: /// Constructor - /// \theParent the parent object - /// \theParent the parent object - /// \theData the widget configuation. The attribute of the model widget is obtained from - ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + /// \param theParent the parent object + /// \param theData the widget configuation. The attribute of the model widget is obtained from + ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData); /// Constructor - /// \theParent the parent object - /// \theParent the parent object - /// \theData the widget configuation. The attribute of the model widget is obtained from + /// \param theParent the parent object + /// \param theAttribute The attribute of the model widget ModuleBase_WidgetEditor(QWidget* theParent, const std::string& theAttribute); /// Destructor @@ -42,18 +41,32 @@ Q_OBJECT /// \return the state whether the widget can accept the focus virtual bool focusTo(); - /// Creates an editor for the real value and set the new value to the feature - /// \param theFeature the model feature - /// \param theAttribute the feature attribute - static void editFeatureValue(FeaturePtr theFeature, const std::string theAttribute); + /// Shous popup window under cursor for data editing + /// \param theSendSignals a flag whether the signals should be sent or the value + /// is to be applyed directly + /// \return true if the editor value is accepted + bool showPopupEditor(const bool theSendSignals = true); + + /// Set current cursor position + /// \param theX the X coordinate + /// \param theY the Y coordinate + void setCursorPosition(const int theX, const int theY); - private slots: - /// Shous popup window under cursor for data editing - void showPopupEditor(); +private: + /// Show editor + /// \param theOutValue a result value + /// \param theOutText a result text + /// \return true if the editor value is accepted + bool editedValue(double& theOutValue, QString& theOutText); private: - FeaturePtr myFeature; ///< the current widget feature - QStringList myFeatureKinds; ///< the kinds of possible features + ///< the current widget feature + FeaturePtr myFeature; + + ///< the kinds of possible features + QStringList myFeatureKinds; + + int myXPosition, myYPosition; }; #endif