1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef ModuleBase_ToolBox_H
22 #define ModuleBase_ToolBox_H
24 #include <ModuleBase.h>
31 class ModuleBase_ModelWidget;
34 * \class ModuleBase_ToolBox
36 * \brief An extension of QFrame object
38 class MODULEBASE_EXPORT ModuleBase_ToolBox : public QFrame
44 /// \param theParent a parent widget
45 /// \param theUseFrameStyleBox a flag if the tool box should have box covered
46 /// buttons and current page
47 ModuleBase_ToolBox(QWidget* theParent, const bool theUseFrameStyleBox = false);
48 virtual ~ModuleBase_ToolBox();
50 /// Add a new item to the tool box
51 /// \param thePage a widget of the new item
52 /// \param theName a name of the item
53 /// \param theIcon an icon of the item
54 void addItem(QWidget* thePage, const QString& theName, const QPixmap& theIcon);
56 /// \return number of items
59 /// \return index of current widget
60 int currentIndex() const;
63 /// \param theIdx an index
64 void setCurrentIndex(const int theIdx);
66 /// Found in the controls of the model widget parent in Stacked Widget
67 /// returns whether this controls are in the current widget of the stacked widgets
68 /// \param theWidget a model widget
69 /// \return boolean result
70 static bool isOffToolBoxParent(ModuleBase_ModelWidget* theWidget);
73 /// A signal which is emited on current item changed
74 void currentChanged(int);
77 /// A slot called on button press
81 QButtonGroup* myButtonsGroup;
82 QFrame* myButtonsFrame;
83 QHBoxLayout* myButtonsLayout;
84 QStackedWidget* myStack;