1 /**************************************************************************** 2 ** 3 ** DQt - D bindings for the Qt Toolkit 4 ** 5 ** GNU Lesser General Public License Usage 6 ** This file may be used under the terms of the GNU Lesser 7 ** General Public License version 3 as published by the Free Software 8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the 9 ** packaging of this file. Please review the following information to 10 ** ensure the GNU Lesser General Public License version 3 requirements 11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 12 ** 13 ****************************************************************************/ 14 module qt.widgets.toolbox; 15 extern(C++): 16 17 import qt.config; 18 import qt.core.coreevent; 19 import qt.core.namespace; 20 import qt.core.string; 21 import qt.gui.event; 22 import qt.gui.icon; 23 import qt.helpers; 24 import qt.widgets.frame; 25 import qt.widgets.widget; 26 27 /+ QT_REQUIRE_CONFIG(toolbox); +/ 28 29 30 extern(C++, class) struct QToolBoxPrivate; 31 32 class /+ Q_WIDGETS_EXPORT +/ QToolBox : QFrame 33 { 34 mixin(Q_OBJECT); 35 /+ Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged) 36 Q_PROPERTY(int count READ count) +/ 37 38 public: 39 /+ explicit +/this(QWidget parent = null, /+ Qt:: +/qt.core.namespace.WindowFlags f = /+ Qt:: +/qt.core.namespace.WindowFlags()); 40 ~this(); 41 42 pragma(inline, true) final int addItem(QWidget item, ref const(QString) text) 43 { auto tmp = QIcon(); return insertItem(-1, item, tmp, text); } 44 pragma(inline, true) final int addItem(QWidget item, ref const(QIcon) iconSet, ref const(QString) text) 45 { return insertItem(-1, item, iconSet, text); } 46 pragma(inline, true) final int insertItem(int index, QWidget item, ref const(QString) text) 47 { auto tmp = QIcon(); return insertItem(index, item, tmp, text); } 48 final int insertItem(int index, QWidget widget, ref const(QIcon) icon, ref const(QString) text); 49 50 final void removeItem(int index); 51 52 final void setItemEnabled(int index, bool enabled); 53 final bool isItemEnabled(int index) const; 54 55 final void setItemText(int index, ref const(QString) text); 56 final QString itemText(int index) const; 57 58 final void setItemIcon(int index, ref const(QIcon) icon); 59 final QIcon itemIcon(int index) const; 60 61 version(QT_NO_TOOLTIP){}else 62 { 63 final void setItemToolTip(int index, ref const(QString) toolTip); 64 final QString itemToolTip(int index) const; 65 } 66 67 final int currentIndex() const; 68 final QWidget currentWidget() const; 69 final QWidget widget(int index) const; 70 final int indexOf(QWidget widget) const; 71 final int count() const; 72 73 public /+ Q_SLOTS +/: 74 @QSlot final void setCurrentIndex(int index); 75 @QSlot final void setCurrentWidget(QWidget widget); 76 77 /+ Q_SIGNALS +/public: 78 @QSignal final void currentChanged(int index); 79 80 protected: 81 override bool event(QEvent e); 82 /+ virtual +/ void itemInserted(int index); 83 /+ virtual +/ void itemRemoved(int index); 84 override void showEvent(QShowEvent e); 85 override void changeEvent(QEvent ); 86 87 88 private: 89 /+ Q_DECLARE_PRIVATE(QToolBox) +/ 90 /+ Q_DISABLE_COPY(QToolBox) +/ 91 /+ Q_PRIVATE_SLOT(d_func(), void _q_buttonClicked()) 92 Q_PRIVATE_SLOT(d_func(), void _q_widgetDestroyed(QObject*)) +/ 93 } 94 95