X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetChoice.h;h=f88a56e7f57690911f73070c5f8a469ab484a7fc;hb=49d5a27258260087aad5e7ca30d6863e08a186d1;hp=72f6df4cd2e15eebbe100559cd7b8e4d6f7ba0d8;hpb=9a7ff0679f4cd8c203f53a2187d47a008bbd11c6;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.h b/src/ModuleBase/ModuleBase_WidgetChoice.h index 72f6df4cd..f88a56e7f 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.h +++ b/src/ModuleBase/ModuleBase_WidgetChoice.h @@ -13,6 +13,7 @@ class QWidget; class QLabel; class QComboBox; +class QButtonGroup; /** * \ingroup GUI @@ -22,9 +23,15 @@ class QComboBox; * * \endcode +* Aditionally can be used: +* A key "widget_type". It can have values "combobox" or "radiobuttons". +* By default it uses "combobox". +* A key "buttons_dir" which is applicable only for "radiobuttons" mode. +* It defines direction of radiobuttons layout. it can be "vertical" or "horizontal" +* Default value is "vertical" */ class MODULEBASE_EXPORT ModuleBase_WidgetChoice : public ModuleBase_ModelWidget { @@ -33,22 +40,35 @@ Q_OBJECT /// Constructor /// \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_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId); + ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData); virtual ~ModuleBase_WidgetChoice(); - + + /// Defines if it is supported to set the value in this widget + /// It returns false because this is an info widget + virtual bool canAcceptFocus() const { return false; }; + virtual bool focusTo(); /// Returns list of widget controls /// \return a controls list virtual QList getControls() const; + /// Returns text value for the property panel title + /// \param theIndex a button index + /// \return the title value + QString getPropertyPanelTitle(int theIndex); + +signals: + /// Segnal about selected item + /// \param theWidget selected widget + /// \param theIndex selected index + void itemSelected(ModuleBase_ModelWidget* theWidget, int theIndex); + protected: /// Saves the internal parameters to the given feature /// \return True in success - virtual bool storeValueCustom() const; + virtual bool storeValueCustom(); virtual bool restoreValueCustom(); @@ -62,6 +82,10 @@ private: /// The control QComboBox* myCombo; + QButtonGroup* myButtons; + + // XML definition of titles + QStringList myButtonTitles; }; #endif