X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetEditor.h;h=063dd2b2b33d56ddf980e940fadcb8662f0ecb55;hb=29dfb8a802f61cacf5f57fb79c62badee00ebcdf;hp=e75d4cebda4b7c171b743359b64f6ba3b27d83c4;hpb=e6aea428c7da7751e753eac36b99e16b7e3166e4;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetEditor.h b/src/ModuleBase/ModuleBase_WidgetEditor.h index e75d4cebd..063dd2b2b 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 @@ -20,17 +22,17 @@ class QLineEdit; */ class MODULEBASE_EXPORT ModuleBase_WidgetEditor : public ModuleBase_WidgetDoubleValue { - Q_OBJECT -public: +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); + /// \param theParent the parent object + /// \param theData the widget configuation. The attribute of the model widget is obtained from + /// \param theParentId is Id of a parent of the current attribute + ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData, + const std::string& theParentId); /// 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 @@ -38,16 +40,32 @@ public: /// Set focus to the first control of the current widget. The focus policy of the control is checked. /// If the widget has the NonFocus focus policy, it is skipped. - virtual void focusTo(); + /// \return the state whether the widget can accept the focus + virtual bool focusTo(); + + /// 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 + void showPopupEditor(const bool theSendSignals = true); - /// 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); + void setCursorPosition(const int theX, const int theY); + +//protected slots: + //void onEnterPressed(); private: - FeaturePtr myFeature; ///< the current widget feature - QStringList myFeatureKinds; ///< the kinds of possible features + void editedValue(double& outValue, QString& outText); + + private: + ///< the current widget feature + FeaturePtr myFeature; + + ///< the kinds of possible features + QStringList myFeatureKinds; + + //bool myIsEnterPressedEmitted; + + int myXPosition, myYPosition; }; #endif