Files
create/src/Gui/ToolBox.h
Tobias Frost 460da406f8 spelling fixes (#18688)
* Fixes spelling of "Allow to" to "Allow one to"

and those variants:
Allows to -> Allows one to
allow to -> allow one to
allows to -> allows one to

* Fix "Let's -> Lets"

(and lower case variant.)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/3rdParty/salomesmesh/inc/MED_Wrapper.hxx

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Base/PyObjectBase.cpp
Update src/App/ExtensionContainer.h
Update src/App/PropertyContainer.h

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Use gerund in user-facing texts.

* Use gerund for two more user-facing strings.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Tobias Frost <tobi@debian.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-01-13 11:22:20 -06:00

113 lines
4.5 KiB
C++

/***************************************************************************
* Copyright (c) 2004 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef GUI_DOCKWND_TOOLBOX_H
#define GUI_DOCKWND_TOOLBOX_H
#include <QWidget>
#include <FCGlobal.h>
class QToolBox;
namespace Gui
{
namespace DockWnd
{
/** The ToolBox class provides a column of tabbed widget items.
* A toolbox is a widget that displays a column of tabs one above the other, with the current item displayed
* below the current tab. Every tab has an index position within the column of tabs. A tab's item is a QWidget.
*
* Each item has an itemLabel(), an optional icon, itemIconSet(), an optional itemToolTip(), and a widget.
* The item's attributes can be changed with setItemLabel(), setItemIconSet() and setItemToolTip().
*
* Items are added using addItem(), or inserted at particular positions using insertItem(). The total number of
* items is given by count(). Items can be deleted with delete, or removed from the toolbox with removeItem().
* Combining removeItem() and insertItem() allows one to move items to different positions.
*
* The current item widget is returned by currentItem() and set with setCurrentItem(). If you prefer you can
* work in terms of indexes using currentIndex(), setCurrentIndex(), indexOf() and item().
*
* The currentChanged() signal is emitted when the current item is changed.
*
* \a Note: This class implements the same API as the QToolBox does provided by Qt unless removeItem(),
* which also deletes the item to be removed.
* \author Werner Mayer
*/
class GuiExport ToolBox : public QWidget
{
Q_OBJECT
public:
ToolBox( QWidget *parent=nullptr );
~ToolBox() override;
int addItem ( QWidget * w, const QString & label );
int addItem ( QWidget * item, const QIcon & iconSet, const QString & label );
int insertItem ( int index, QWidget * item, const QString & label );
int insertItem ( int index, QWidget * item, const QIcon & iconSet, const QString & label );
void removeItem ( int index );
void setItemEnabled ( int index, bool enabled );
bool isItemEnabled ( int index ) const;
void setItemText ( int index, const QString & label );
QString itemText ( int index ) const;
void setItemIcon ( int index, const QIcon & iconSet );
QIcon itemIcon ( int index ) const;
void setItemToolTip ( int index, const QString & toolTip );
QString itemToolTip ( int index ) const;
QWidget * currentWidget () const;
int currentIndex () const;
QWidget * widget ( int index ) const;
int indexOf ( QWidget * item ) const;
int count () const;
public Q_SLOTS:
void setCurrentIndex ( int index );
void setCurrentWidget ( QWidget * item );
protected:
void changeEvent(QEvent *e) override;
Q_SIGNALS:
/** This signal is emitted when the current item changed.
* The new current item's index is passed in index, or -1 if there is no current item.
*/
void currentChanged ( int index );
private:
QToolBox* _pToolBox;
};
} // namespace DockWnd
} // namespace Gui
#endif // GUI_DOCKWND_TOOLBOX_H