X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetChoice.h;h=bcb24aa8808911004dd2e1215391a2997b37e77d;hb=eaf84a526d6b44d1d9cd7c56daea6c63f97a679c;hp=e0f90d7203fbe9135913cb29cf6914dcf3a6123c;hpb=af73a3e00de48eeff2610b25e2d5f851df7a5075;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.h b/src/ModuleBase/ModuleBase_WidgetChoice.h index e0f90d720..bcb24aa88 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.h +++ b/src/ModuleBase/ModuleBase_WidgetChoice.h @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: ModuleBase_WidgetChoice.h -// Created: 03 Sept 2014 -// Author: Vitaly Smetannikov +// Copyright (C) 2014-2020 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 +// #ifndef ModuleBase_WidgetChoice_H #define ModuleBase_WidgetChoice_H @@ -11,9 +24,7 @@ #include "ModuleBase_ModelWidget.h" class QWidget; -class QLabel; -class QComboBox; -class QButtonGroup; +class ModuleBase_ChoiceCtrl; /** * \ingroup GUI @@ -59,13 +70,19 @@ Q_OBJECT /// \return the title value QString getPropertyPanelTitle(int theIndex); + /// The slot is called when user press Ok or OkPlus buttons in the parent property panel + virtual void onFeatureAccepted(); + 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(); @@ -74,15 +91,15 @@ private slots: void onCurrentIndexChanged(int theIndex); private: - /// The label - QLabel* myLabel; - - /// The control - QComboBox* myCombo; - QButtonGroup* myButtons; + ModuleBase_ChoiceCtrl* myChoiceCtrl; // XML definition of titles QStringList myButtonTitles; + std::string myStringListAttribute; + + bool myIsFirst; + int myDefValue; + bool myHasValue; }; #endif