1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef ModuleBase_ToolBox_H
21 #define ModuleBase_ToolBox_H
23 #include <ModuleBase.h>
30 class ModuleBase_ModelWidget;
33 * \class ModuleBase_ToolBox
35 * \brief An extension of QFrame object
37 class MODULEBASE_EXPORT ModuleBase_ToolBox : public QFrame
43 /// \param theParent a parent widget
44 /// \param theUseFrameStyleBox a flag if the tool box should have box covered
45 /// buttons and current page
46 ModuleBase_ToolBox(QWidget* theParent, const bool theUseFrameStyleBox = false);
47 virtual ~ModuleBase_ToolBox();
49 /// Add a new item to the tool box
50 /// \param thePage a widget of the new item
51 /// \param theName a name of the item
52 /// \param theIcon an icon of the item
53 void addItem(QWidget* thePage, const QString& theName, const QPixmap& theIcon);
55 /// \return number of items
58 /// \return index of current widget
59 int currentIndex() const;
62 /// \param theIdx an index
63 void setCurrentIndex(const int theIdx);
65 /// Found in the controls of the model widget parent in Stacked Widget
66 /// returns whether this controls are in the current widget of the stacked widgets
67 /// \param theWidget a model widget
68 /// \return boolean result
69 static bool isOffToolBoxParent(ModuleBase_ModelWidget* theWidget);
72 /// A signal which is emited on current item changed
73 void currentChanged(int);
76 /// A slot called on button press
80 QButtonGroup* myButtonsGroup;
81 QFrame* myButtonsFrame;
82 QHBoxLayout* myButtonsLayout;
83 QStackedWidget* myStack;