From 82ecd83484c9fa1ede059986ab771e74e33e68ef Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 16 Aug 2024 19:11:00 +0900 Subject: Rename layout nt* related files to equivalent tq* Signed-off-by: Michele Calgaro --- src/widgets/ntqdockarea.h | 2 +- src/widgets/ntqgroupbox.h | 165 ------- src/widgets/ntqhbox.h | 76 --- src/widgets/ntqhbuttongroup.h | 68 --- src/widgets/ntqhgroupbox.h | 67 --- src/widgets/ntqvbox.h | 65 --- src/widgets/ntqvbuttongroup.h | 69 --- src/widgets/ntqvgroupbox.h | 68 --- src/widgets/qdockarea.cpp | 2 +- src/widgets/qdockwindow.cpp | 2 +- src/widgets/qgroupbox.cpp | 990 ---------------------------------------- src/widgets/qhbox.cpp | 145 ------ src/widgets/qhbuttongroup.cpp | 94 ---- src/widgets/qhgroupbox.cpp | 93 ---- src/widgets/qsplitter.cpp | 4 +- src/widgets/qt_widgets.pri | 28 +- src/widgets/qvbox.cpp | 71 --- src/widgets/qvbuttongroup.cpp | 92 ---- src/widgets/qvgroupbox.cpp | 91 ---- src/widgets/tqbuttongroup.h | 2 +- src/widgets/tqdialogbuttons.cpp | 2 +- src/widgets/tqgrid.cpp | 2 +- src/widgets/tqgroupbox.cpp | 990 ++++++++++++++++++++++++++++++++++++++++ src/widgets/tqgroupbox.h | 165 +++++++ src/widgets/tqhbox.cpp | 145 ++++++ src/widgets/tqhbox.h | 76 +++ src/widgets/tqhbuttongroup.cpp | 94 ++++ src/widgets/tqhbuttongroup.h | 68 +++ src/widgets/tqhgroupbox.cpp | 93 ++++ src/widgets/tqhgroupbox.h | 67 +++ src/widgets/tqiconview.cpp | 2 +- src/widgets/tqlistview.cpp | 2 +- src/widgets/tqmainwindow.cpp | 2 +- src/widgets/tqmenubar.cpp | 2 +- src/widgets/tqstatusbar.cpp | 2 +- src/widgets/tqtextbrowser.cpp | 4 +- src/widgets/tqtextedit.cpp | 2 +- src/widgets/tqtoolbar.cpp | 2 +- src/widgets/tqtoolbox.cpp | 4 +- src/widgets/tqvbox.cpp | 71 +++ src/widgets/tqvbox.h | 65 +++ src/widgets/tqvbuttongroup.cpp | 92 ++++ src/widgets/tqvbuttongroup.h | 69 +++ src/widgets/tqvgroupbox.cpp | 91 ++++ src/widgets/tqvgroupbox.h | 68 +++ src/widgets/tqwidgetstack.cpp | 4 +- 46 files changed, 2189 insertions(+), 2189 deletions(-) delete mode 100644 src/widgets/ntqgroupbox.h delete mode 100644 src/widgets/ntqhbox.h delete mode 100644 src/widgets/ntqhbuttongroup.h delete mode 100644 src/widgets/ntqhgroupbox.h delete mode 100644 src/widgets/ntqvbox.h delete mode 100644 src/widgets/ntqvbuttongroup.h delete mode 100644 src/widgets/ntqvgroupbox.h delete mode 100644 src/widgets/qgroupbox.cpp delete mode 100644 src/widgets/qhbox.cpp delete mode 100644 src/widgets/qhbuttongroup.cpp delete mode 100644 src/widgets/qhgroupbox.cpp delete mode 100644 src/widgets/qvbox.cpp delete mode 100644 src/widgets/qvbuttongroup.cpp delete mode 100644 src/widgets/qvgroupbox.cpp create mode 100644 src/widgets/tqgroupbox.cpp create mode 100644 src/widgets/tqgroupbox.h create mode 100644 src/widgets/tqhbox.cpp create mode 100644 src/widgets/tqhbox.h create mode 100644 src/widgets/tqhbuttongroup.cpp create mode 100644 src/widgets/tqhbuttongroup.h create mode 100644 src/widgets/tqhgroupbox.cpp create mode 100644 src/widgets/tqhgroupbox.h create mode 100644 src/widgets/tqvbox.cpp create mode 100644 src/widgets/tqvbox.h create mode 100644 src/widgets/tqvbuttongroup.cpp create mode 100644 src/widgets/tqvbuttongroup.h create mode 100644 src/widgets/tqvgroupbox.cpp create mode 100644 src/widgets/tqvgroupbox.h (limited to 'src/widgets') diff --git a/src/widgets/ntqdockarea.h b/src/widgets/ntqdockarea.h index f70f61fe5..10a62debd 100644 --- a/src/widgets/ntqdockarea.h +++ b/src/widgets/ntqdockarea.h @@ -45,7 +45,7 @@ #include "tqwidget.h" #include "tqptrlist.h" #include "ntqdockwindow.h" -#include "ntqlayout.h" +#include "tqlayout.h" #include "tqvaluelist.h" #include "ntqguardedptr.h" #include "tqtextstream.h" diff --git a/src/widgets/ntqgroupbox.h b/src/widgets/ntqgroupbox.h deleted file mode 100644 index 14198de3e..000000000 --- a/src/widgets/ntqgroupbox.h +++ /dev/null @@ -1,165 +0,0 @@ -/********************************************************************** -** -** Definition of TQGroupBox widget class -** -** Created : 950203 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGROUPBOX_H -#define TQGROUPBOX_H - -#ifndef QT_H -#include "tqframe.h" -#endif // QT_H - -#ifndef TQT_NO_GROUPBOX - - -class TQAccel; -class TQGroupBoxPrivate; -class TQVBoxLayout; -class TQGridLayout; -class TQSpacerItem; - -class TQ_EXPORT TQGroupBox : public TQFrame -{ - TQ_OBJECT - TQ_PROPERTY( TQString title READ title WRITE setTitle ) - TQ_PROPERTY( Alignment alignment READ alignment WRITE setAlignment ) - TQ_PROPERTY( Orientation orientation READ orientation WRITE setOrientation DESIGNABLE false ) - TQ_PROPERTY( int columns READ columns WRITE setColumns DESIGNABLE false ) - TQ_PROPERTY( bool flat READ isFlat WRITE setFlat ) -#ifndef TQT_NO_CHECKBOX - TQ_PROPERTY( bool checkable READ isCheckable WRITE setCheckable ) - TQ_PROPERTY( bool checked READ isChecked WRITE setChecked ) -#endif -public: - TQGroupBox( TQWidget* parent=0, const char* name=0 ); - TQGroupBox( const TQString &title, - TQWidget* parent=0, const char* name=0 ); - TQGroupBox( int strips, Orientation o, - TQWidget* parent=0, const char* name=0 ); - TQGroupBox( int strips, Orientation o, const TQString &title, - TQWidget* parent=0, const char* name=0 ); - ~TQGroupBox(); - - virtual void setColumnLayout(int strips, Orientation o); - - TQString title() const { return str; } - virtual void setTitle( const TQString &); - - int alignment() const { return align; } - virtual void setAlignment( int ); - - int columns() const; - void setColumns( int ); - - Orientation orientation() const { return dir; } - void setOrientation( Orientation ); - - int insideMargin() const; - int insideSpacing() const; - void setInsideMargin( int m ); - void setInsideSpacing( int s ); - - void addSpace( int ); - TQSize sizeHint() const; - - bool isFlat() const; - void setFlat( bool b ); - bool isCheckable() const; -#ifndef TQT_NO_CHECKBOX - void setCheckable( bool b ); -#endif - bool isChecked() const; - void setEnabled(bool on); - -#ifndef TQT_NO_CHECKBOX -public slots: - void setChecked( bool b ); - -signals: - void toggled( bool ); -#endif -protected: - bool event( TQEvent * ); - void childEvent( TQChildEvent * ); - void resizeEvent( TQResizeEvent * ); - void paintEvent( TQPaintEvent * ); - void focusInEvent( TQFocusEvent * ); - void fontChange( const TQFont & ); - -private slots: - void fixFocus(); - void setChildrenEnabled( bool b ); - -private: - void skip(); - void init(); - void calculateFrame(); - void insertWid( TQWidget* ); - void setTextSpacer(); -#ifndef TQT_NO_CHECKBOX - void updateCheckBoxGeometry(); -#endif - TQString str; - int align; - int lenvisible; -#ifndef TQT_NO_ACCEL - TQAccel * accel; -#endif - TQGroupBoxPrivate * d; - - TQVBoxLayout *vbox; - TQGridLayout *grid; - int row; - int col : 30; - uint bFlat : 1; - int nRows, nCols; - Orientation dir; - int spac, marg; - -private: // Disabled copy constructor and operator= -#if defined(TQ_DISABLE_COPY) - TQGroupBox( const TQGroupBox & ); - TQGroupBox &operator=( const TQGroupBox & ); -#endif -}; - - -#endif // TQT_NO_GROUPBOX - -#endif // TQGROUPBOX_H diff --git a/src/widgets/ntqhbox.h b/src/widgets/ntqhbox.h deleted file mode 100644 index fec6a33cd..000000000 --- a/src/widgets/ntqhbox.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - - -#ifndef TQHBOX_H -#define TQHBOX_H - -#ifndef QT_H -#include "tqwidget.h" -#endif // QT_H - -#ifndef TQT_NO_HBOX - -#include "tqframe.h" - -class TQBoxLayout; - -class TQ_EXPORT TQHBox : public TQFrame -{ - TQ_OBJECT -public: - TQHBox( TQWidget* parent=0, const char* name=0, WFlags f=0 ); - - void setSpacing( int ); - bool setStretchFactor( TQWidget*, int stretch ); - TQSize sizeHint() const; - -protected: - TQHBox( bool horizontal, TQWidget* parent, const char* name, WFlags f = 0 ); - void frameChanged(); - -private: - TQBoxLayout *lay; - -#if defined(TQ_DISABLE_COPY) - TQHBox( const TQHBox & ); - TQHBox &operator=( const TQHBox & ); -#endif -}; - -#endif // TQT_NO_HBOX - -#endif // TQHBOX_H diff --git a/src/widgets/ntqhbuttongroup.h b/src/widgets/ntqhbuttongroup.h deleted file mode 100644 index ab53a0824..000000000 --- a/src/widgets/ntqhbuttongroup.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Definition of TQHButtonGroup class -** -** Created : 990602 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQHBUTTONGROUP_H -#define TQHBUTTONGROUP_H - -#ifndef QT_H -#include "tqbuttongroup.h" -#endif // QT_H - -#ifndef TQT_NO_HBUTTONGROUP - -class TQ_EXPORT TQHButtonGroup : public TQButtonGroup -{ - TQ_OBJECT -public: - TQHButtonGroup( TQWidget* parent=0, const char* name=0 ); - TQHButtonGroup( const TQString &title, TQWidget* parent=0, const char* name=0 ); - ~TQHButtonGroup(); - -private: // Disabled copy constructor and operator= -#if defined(TQ_DISABLE_COPY) - TQHButtonGroup( const TQHButtonGroup & ); - TQHButtonGroup &operator=( const TQHButtonGroup & ); -#endif -}; - - -#endif // TQT_NO_HBUTTONGROUP - -#endif // TQHBUTTONGROUP_H diff --git a/src/widgets/ntqhgroupbox.h b/src/widgets/ntqhgroupbox.h deleted file mode 100644 index b71776a05..000000000 --- a/src/widgets/ntqhgroupbox.h +++ /dev/null @@ -1,67 +0,0 @@ -/********************************************************************** -** -** Definition of TQHGroupBox widget class -** -** Created : 990602 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQHGROUPBOX_H -#define TQHGROUPBOX_H - -#ifndef QT_H -#include "ntqgroupbox.h" -#endif // QT_H - -#ifndef TQT_NO_HGROUPBOX - -class TQ_EXPORT TQHGroupBox : public TQGroupBox -{ - TQ_OBJECT -public: - TQHGroupBox( TQWidget* parent=0, const char* name=0 ); - TQHGroupBox( const TQString &title, TQWidget* parent=0, const char* name=0 ); - ~TQHGroupBox(); - -private: // Disabled copy constructor and operator= -#if defined(TQ_DISABLE_COPY) - TQHGroupBox( const TQHGroupBox & ); - TQHGroupBox &operator=( const TQHGroupBox & ); -#endif -}; - -#endif // TQT_NO_HGROUPBOX - -#endif // TQHGROUPBOX_H diff --git a/src/widgets/ntqvbox.h b/src/widgets/ntqvbox.h deleted file mode 100644 index ae1d5fabd..000000000 --- a/src/widgets/ntqvbox.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Definition of vertical box layout widget class -** -** Created : 990124 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVBOX_H -#define TQVBOX_H - -#ifndef QT_H -#include "ntqhbox.h" -#endif // QT_H - -#ifndef TQT_NO_VBOX - -class TQ_EXPORT TQVBox : public TQHBox -{ - TQ_OBJECT -public: - TQVBox( TQWidget* parent=0, const char* name=0, WFlags f=0 ); - -private: // Disabled copy constructor and operator= -#if defined(TQ_DISABLE_COPY) - TQVBox( const TQVBox & ); - TQVBox& operator=( const TQVBox & ); -#endif -}; - -#endif // TQT_NO_VBOX - -#endif // TQVBOX_H diff --git a/src/widgets/ntqvbuttongroup.h b/src/widgets/ntqvbuttongroup.h deleted file mode 100644 index a8050bc76..000000000 --- a/src/widgets/ntqvbuttongroup.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Definition of TQVButtonGroup class -** -** Created : 990602 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVBUTTONGROUP_H -#define TQVBUTTONGROUP_H - -#ifndef QT_H -#include "tqbuttongroup.h" -#endif // QT_H - -#ifndef TQT_NO_VBUTTONGROUP - -class TQ_EXPORT TQVButtonGroup : public TQButtonGroup -{ - TQ_OBJECT -public: - TQVButtonGroup( TQWidget* parent=0, const char* name=0 ); - TQVButtonGroup( const TQString &title, TQWidget* parent=0, const char* name=0 ); - - ~TQVButtonGroup(); - -private: // Disabled copy constructor and operator= -#if defined(TQ_DISABLE_COPY) - TQVButtonGroup( const TQVButtonGroup & ); - TQVButtonGroup &operator=( const TQVButtonGroup & ); -#endif -}; - - -#endif // TQT_NO_VBUTTONGROUP - -#endif // TQVBUTTONGROUP_H diff --git a/src/widgets/ntqvgroupbox.h b/src/widgets/ntqvgroupbox.h deleted file mode 100644 index 4a4505c8e..000000000 --- a/src/widgets/ntqvgroupbox.h +++ /dev/null @@ -1,68 +0,0 @@ -/********************************************************************** -** -** Definition of TQVGroupBox widget class -** -** Created : 990602 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQVGROUPBOX_H -#define TQVGROUPBOX_H - -#ifndef QT_H -#include "ntqgroupbox.h" -#endif // QT_H - -#ifndef TQT_NO_VGROUPBOX - -class TQ_EXPORT TQVGroupBox : public TQGroupBox -{ - TQ_OBJECT -public: - TQVGroupBox( TQWidget* parent=0, const char* name=0 ); - TQVGroupBox( const TQString &title, TQWidget* parent=0, const char* name=0 ); - - ~TQVGroupBox(); - -private: // Disabled copy constructor and operator= -#if defined(TQ_DISABLE_COPY) - TQVGroupBox( const TQVGroupBox & ); - TQVGroupBox &operator=( const TQVGroupBox & ); -#endif -}; - -#endif // TQT_NO_VGROUPBOX - -#endif // TQVGROUPBOX_H diff --git a/src/widgets/qdockarea.cpp b/src/widgets/qdockarea.cpp index 07ebbaa03..a74fbabb8 100644 --- a/src/widgets/qdockarea.cpp +++ b/src/widgets/qdockarea.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_MAINWINDOW #include "ntqsplitter.h" -#include "ntqlayout.h" +#include "tqlayout.h" #include "tqptrvector.h" #include "ntqapplication.h" #include "tqpainter.h" diff --git a/src/widgets/qdockwindow.cpp b/src/widgets/qdockwindow.cpp index 4d0d41141..1c056828e 100644 --- a/src/widgets/qdockwindow.cpp +++ b/src/widgets/qdockwindow.cpp @@ -49,7 +49,7 @@ #include "ntqapplication.h" #include "tqtoolbutton.h" #include "tqtoolbar.h" -#include "ntqlayout.h" +#include "tqlayout.h" #include "tqmainwindow.h" #include "tqtimer.h" #include "tqtooltip.h" diff --git a/src/widgets/qgroupbox.cpp b/src/widgets/qgroupbox.cpp deleted file mode 100644 index 906af0f6f..000000000 --- a/src/widgets/qgroupbox.cpp +++ /dev/null @@ -1,990 +0,0 @@ -/********************************************************************** -** -** Implementation of TQGroupBox widget class -** -** Created : 950203 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "ntqgroupbox.h" -#ifndef TQT_NO_GROUPBOX -#include "ntqlayout.h" -#include "tqpainter.h" -#include "tqbitmap.h" -#include "ntqaccel.h" -#include "tqradiobutton.h" -#include "ntqfocusdata.h" -#include "tqobjectlist.h" -#include "ntqdrawutil.h" -#include "ntqapplication.h" -#include "tqstyle.h" -#include "tqcheckbox.h" -#include "tqbuttongroup.h" -#if defined(QT_ACCESSIBILITY_SUPPORT) -#include "ntqaccessible.h" -#endif - -/*! - \class TQGroupBox ntqgroupbox.h - \brief The TQGroupBox widget provides a group box frame with a title. - - \ingroup organizers - \ingroup geomanagement - \ingroup appearance - \mainclass - - A group box provides a frame, a title and a keyboard shortcut, and - displays various other widgets inside itself. The title is on top, - the keyboard shortcut moves keyboard focus to one of the group - box's child widgets, and the child widgets are usually laid out - horizontally (or vertically) inside the frame. - - The simplest way to use it is to create a group box with the - desired number of columns (or rows) and orientation, and then just - create widgets with the group box as parent. - - It is also possible to change the orientation() and number of - columns() after construction, or to ignore all the automatic - layout support and manage the layout yourself. You can add 'empty' - spaces to the group box with addSpace(). - - TQGroupBox also lets you set the title() (normally set in the - constructor) and the title's alignment(). - - You can change the spacing used by the group box with - setInsideMargin() and setInsideSpacing(). To minimize space - consumption, you can remove the right, left and bottom edges of - the frame with setFlat(). - - - - \sa TQButtonGroup -*/ - -class TQCheckBox; - -class TQGroupBoxPrivate -{ -public: - TQGroupBoxPrivate(): - spacer( 0 ), - checkbox( 0 ) {} - - TQSpacerItem *spacer; - TQCheckBox *checkbox; -}; - - - - -/*! - Constructs a group box widget with no title. - - The \a parent and \a name arguments are passed to the TQWidget - constructor. - - This constructor does not do automatic layout. -*/ - -TQGroupBox::TQGroupBox( TQWidget *parent, const char *name ) - : TQFrame( parent, name ) -{ - init(); -} - -/*! - Constructs a group box with the title \a title. - - The \a parent and \a name arguments are passed to the TQWidget - constructor. - - This constructor does not do automatic layout. -*/ - -TQGroupBox::TQGroupBox( const TQString &title, TQWidget *parent, const char *name ) - : TQFrame( parent, name ) -{ - init(); - setTitle( title ); -} - -/*! - Constructs a group box with no title. Child widgets will be - arranged in \a strips rows or columns (depending on \a - orientation). - - The \a parent and \a name arguments are passed to the TQWidget - constructor. -*/ - -TQGroupBox::TQGroupBox( int strips, Orientation orientation, - TQWidget *parent, const char *name ) - : TQFrame( parent, name ) -{ - init(); - setColumnLayout( strips, orientation ); -} - -/*! - Constructs a group box titled \a title. Child widgets will be - arranged in \a strips rows or columns (depending on \a - orientation). - - The \a parent and \a name arguments are passed to the TQWidget - constructor. -*/ - -TQGroupBox::TQGroupBox( int strips, Orientation orientation, - const TQString &title, TQWidget *parent, - const char *name ) - : TQFrame( parent, name ) -{ - init(); - setTitle( title ); - setColumnLayout( strips, orientation ); -} - -/*! - Destroys the group box. -*/ -TQGroupBox::~TQGroupBox() -{ - delete d; -} - -void TQGroupBox::init() -{ - align = AlignAuto; - setFrameStyle( TQFrame::GroupBoxPanel | TQFrame::Sunken ); -#ifndef TQT_NO_ACCEL - accel = 0; -#endif - vbox = 0; - grid = 0; - d = new TQGroupBoxPrivate(); - lenvisible = 0; - nCols = nRows = 0; - dir = Horizontal; - marg = 11; - spac = 5; - bFlat = FALSE; -} - -void TQGroupBox::setTextSpacer() -{ - if ( !d->spacer ) - return; - int h = 0; - int w = 0; - if ( isCheckable() || lenvisible ) { - TQFontMetrics fm = fontMetrics(); - int fh = fm.height(); - if ( isCheckable() ) { -#ifndef TQT_NO_CHECKBOX - fh = d->checkbox->sizeHint().height() + 2; - w = d->checkbox->sizeHint().width() + 2*fm.width( "xx" ); -#endif - } else { - fh = fm.height(); - w = fm.width( str, lenvisible ) + 2*fm.width( "xx" ); - } - h = frameRect().y(); - if ( layout() ) { - int m = layout()->margin(); - int sp = layout()->spacing(); - // do we have a child layout? - for ( TQLayoutIterator it = layout()->iterator(); it.current(); ++it ) { - if ( it.current()->layout() ) { - m += it.current()->layout()->margin(); - sp = TQMAX( sp, it.current()->layout()->spacing() ); - break; - } - } - h = TQMAX( fh-m, h ); - h += TQMAX( sp - (h+m - fh), 0 ); - } - } - d->spacer->changeSize( w, h, TQSizePolicy::Minimum, TQSizePolicy::Fixed ); -} - - -void TQGroupBox::setTitle( const TQString &title ) -{ - if ( str == title ) // no change - return; - str = title; -#ifndef TQT_NO_ACCEL - if ( accel ) - delete accel; - accel = 0; - int s = TQAccel::shortcutKey( title ); - if ( s ) { - accel = new TQAccel( this, "automatic focus-change accelerator" ); - accel->connectItem( accel->insertItem( s, 0 ), - this, TQ_SLOT(fixFocus()) ); - } -#endif -#ifndef TQT_NO_CHECKBOX - if ( d->checkbox ) { - d->checkbox->setText( str ); - updateCheckBoxGeometry(); - } -#endif - calculateFrame(); - setTextSpacer(); - - update(); - updateGeometry(); -#if defined(QT_ACCESSIBILITY_SUPPORT) - TQAccessible::updateAccessibility( this, 0, TQAccessible::NameChanged ); -#endif -} - -/*! - \property TQGroupBox::title - \brief the group box title text. - - The group box title text will have a focus-change keyboard - accelerator if the title contains \&, followed by a letter. - - \code - g->setTitle( "&User information" ); - \endcode - This produces "User information"; Alt+U moves the keyboard - focus to the group box. - - There is no default title text. -*/ - -/*! - \property TQGroupBox::alignment - \brief the alignment of the group box title. - - The title is always placed on the upper frame line. The horizontal - alignment can be specified by the alignment parameter. - - The alignment is one of the following flags: - \list - \i \c AlignAuto aligns the title according to the language, - usually to the left. - \i \c AlignLeft aligns the title text to the left. - \i \c AlignRight aligns the title text to the right. - \i \c AlignHCenter aligns the title text centered. - \endlist - - The default alignment is \c AlignAuto. - - \sa TQt::AlignmentFlags -*/ - -void TQGroupBox::setAlignment( int alignment ) -{ - align = alignment; -#ifndef TQT_NO_CHECKBOX - updateCheckBoxGeometry(); -#endif - update(); -} - -/*! \reimp -*/ -void TQGroupBox::resizeEvent( TQResizeEvent *e ) -{ - TQFrame::resizeEvent(e); -#ifndef TQT_NO_CHECKBOX - if ( align & AlignRight || align & AlignCenter || - ( TQApplication::reverseLayout() && !(align & AlignLeft) ) ) - updateCheckBoxGeometry(); -#endif - calculateFrame(); -} - -/*! \reimp - - \internal - overrides TQFrame::paintEvent -*/ - -void TQGroupBox::paintEvent( TQPaintEvent *event ) -{ - TQPainter paint( this ); - - if ( lenvisible && !isCheckable() ) { // draw title - TQFontMetrics fm = paint.fontMetrics(); - int h = fm.height(); - int tw = fm.width( str, lenvisible ) + fm.width(TQChar(' ')); - int x; - int marg = bFlat ? 0 : 8; - if ( align & AlignHCenter ) // center alignment - x = frameRect().width()/2 - tw/2; - else if ( align & AlignRight ) // right alignment - x = frameRect().width() - tw - marg; - else if ( align & AlignLeft ) // left alignment - x = marg; - else { // auto align - if( TQApplication::reverseLayout() ) - x = frameRect().width() - tw - marg; - else - x = marg; - } - TQRect r( x, 0, tw, h ); - int va = style().styleHint(TQStyle::SH_GroupBox_TextLabelVerticalAlignment, this); - if(va & AlignTop) - r.moveBy(0, fm.descent()); - TQColor pen( (TQRgb) style().styleHint(TQStyle::SH_GroupBox_TextLabelColor, this ) ); - if ((!style().styleHint(TQStyle::SH_UnderlineAccelerator, this)) || ((style().styleHint(TQStyle::SH_HideUnderlineAcceleratorWhenAltUp, this)) && (!style().acceleratorsShown()))) { - va |= NoAccel; - } - style().drawItem( &paint, r, ShowPrefix | AlignHCenter | va, colorGroup(), - isEnabled(), 0, str, -1, ownPalette() ? 0 : &pen ); - paint.setClipRegion( event->region().subtract( r ) ); // clip everything but title -#ifndef TQT_NO_CHECKBOX - } else if ( d->checkbox ) { - TQRect cbClip = d->checkbox->geometry(); - TQFontMetrics fm = paint.fontMetrics(); - cbClip.setX( cbClip.x() - fm.width(TQChar(' ')) ); - cbClip.setWidth( cbClip.width() + fm.width(TQChar(' ')) ); - paint.setClipRegion( event->region().subtract( cbClip ) ); -#endif - } - if ( bFlat ) { - TQRect fr = frameRect(); - TQPoint p1( fr.x(), fr.y() + 1 ); - TQPoint p2( fr.x() + fr.width(), p1.y() ); - // ### This should probably be a style primitive. - qDrawShadeLine( &paint, p1, p2, colorGroup(), TRUE, - lineWidth(), midLineWidth() ); - } else { - drawFrame(&paint); - } - drawContents( &paint ); // draw the contents -} - - -/*! - Adds an empty cell at the next free position. If \a size is - greater than 0, the empty cell takes \a size to be its fixed width - (if orientation() is \c Horizontal) or height (if orientation() is - \c Vertical). - - Use this method to separate the widgets in the group box or to - skip the next free cell. For performance reasons, call this method - after calling setColumnLayout() or by changing the \l - TQGroupBox::columns or \l TQGroupBox::orientation properties. It is - generally a good idea to call these methods first (if needed at - all), and insert the widgets and spaces afterwards. -*/ -void TQGroupBox::addSpace( int size ) -{ - TQApplication::sendPostedEvents( this, TQEvent::ChildInserted ); - - if ( nCols <= 0 || nRows <= 0 ) - return; - - if ( row >= nRows || col >= nCols ) - grid->expand( row+1, col+1 ); - - if ( size > 0 ) { - TQSpacerItem *spacer - = new TQSpacerItem( ( dir == Horizontal ) ? 0 : size, - ( dir == Vertical ) ? 0 : size, - TQSizePolicy::Fixed, TQSizePolicy::Fixed ); - grid->addItem( spacer, row, col ); - } - - skip(); -} - -/*! - \property TQGroupBox::columns - \brief the number of columns or rows (depending on \l TQGroupBox::orientation) in the group box - - Usually it is not a good idea to set this property because it is - slow (it does a complete layout). It is best to set the number - of columns directly in the constructor. -*/ -int TQGroupBox::columns() const -{ - if ( dir == Horizontal ) - return nCols; - return nRows; -} - -void TQGroupBox::setColumns( int c ) -{ - setColumnLayout( c, dir ); -} - -/*! - Returns the width of the empty space between the items in the - group and the frame of the group. - - Only applies if the group box has a defined orientation. - - The default is usually 11, by may vary depending on the platform - and style. - - \sa setInsideMargin(), orientation -*/ -int TQGroupBox::insideMargin() const -{ - return marg; -} - -/*! - Returns the width of the empty space between each of the items - in the group. - - Only applies if the group box has a defined orientation. - - The default is usually 5, by may vary depending on the platform - and style. - - \sa setInsideSpacing(), orientation -*/ -int TQGroupBox::insideSpacing() const -{ - return spac; -} - -/*! - Sets the the width of the inside margin to \a m pixels. - - \sa insideMargin() -*/ -void TQGroupBox::setInsideMargin( int m ) -{ - marg = m; - setColumnLayout( columns(), dir ); -} - -/*! - Sets the width of the empty space between each of the items in - the group to \a s pixels. - - \sa insideSpacing() -*/ -void TQGroupBox::setInsideSpacing( int s ) -{ - spac = s; - setColumnLayout( columns(), dir ); -} - -/*! - \property TQGroupBox::orientation - \brief the group box's orientation - - A horizontal group box arranges it's children in columns, while a - vertical group box arranges them in rows. - - Usually it is not a good idea to set this property because it is - slow (it does a complete layout). It is better to set the - orientation directly in the constructor. -*/ -void TQGroupBox::setOrientation( TQt::Orientation o ) -{ - setColumnLayout( columns(), o ); -} - -/*! - Changes the layout of the group box. This function is only useful - in combination with the default constructor that does not take any - layout information. This function will put all existing children - in the new layout. It is not good TQt programming style to call - this function after children have been inserted. Sets the number - of columns or rows to be \a strips, depending on \a direction. - - \sa orientation columns -*/ -void TQGroupBox::setColumnLayout(int strips, Orientation direction) -{ - if ( layout() ) - delete layout(); - - vbox = 0; - grid = 0; - - if ( strips < 0 ) // if 0, we create the vbox but not the grid. See below. - return; - - vbox = new TQVBoxLayout( this, marg, 0 ); - - d->spacer = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, - TQSizePolicy::Fixed ); - - setTextSpacer(); - vbox->addItem( d->spacer ); - - nCols = 0; - nRows = 0; - dir = direction; - - // Send all child events and ignore them. Otherwise we will end up - // with doubled insertion. This won't do anything because nCols == - // nRows == 0. - TQApplication::sendPostedEvents( this, TQEvent::ChildInserted ); - - // if 0 or smaller , create a vbox-layout but no grid. This allows - // the designer to handle its own grid layout in a group box. - if ( strips <= 0 ) - return; - - dir = direction; - if ( dir == Horizontal ) { - nCols = strips; - nRows = 1; - } else { - nCols = 1; - nRows = strips; - } - grid = new TQGridLayout( nRows, nCols, spac ); - row = col = 0; - grid->setAlignment( AlignTop ); - vbox->addLayout( grid ); - - // Add all children - if ( children() ) { - TQObjectListIt it( *children() ); - TQWidget *w; - while( (w=(TQWidget *)it.current()) != 0 ) { - ++it; - if ( w->isWidgetType() -#ifndef TQT_NO_CHECKBOX - && w != d->checkbox -#endif - ) - insertWid( w ); - } - } -} - - -/*! \reimp */ -bool TQGroupBox::event( TQEvent * e ) -{ - if ( e->type() == TQEvent::LayoutHint && layout() ) - setTextSpacer(); - return TQFrame::event( e ); -} - -/*!\reimp */ -void TQGroupBox::childEvent( TQChildEvent *c ) -{ - if ( !c->inserted() || !c->child()->isWidgetType() ) - return; - TQWidget *w = (TQWidget*)c->child(); -#ifndef TQT_NO_CHECKBOX - if ( d->checkbox ) { - if ( w == d->checkbox ) - return; - if ( d->checkbox->isChecked() ) { - if ( !w->testWState( WState_ForceDisabled ) ) - w->setEnabled( TRUE ); - } else { - if ( w->isEnabled() ) { - w->setEnabled( FALSE ); - ((TQGroupBox*)w)->clearWState( WState_ForceDisabled ); - } - } - } -#endif - if ( !grid ) - return; - insertWid( w ); -} - -void TQGroupBox::insertWid( TQWidget* w ) -{ - if ( row >= nRows || col >= nCols ) - grid->expand( row+1, col+1 ); - grid->addWidget( w, row, col ); - skip(); - TQApplication::postEvent( this, new TQEvent( TQEvent::LayoutHint ) ); -} - - -void TQGroupBox::skip() -{ - // Same as TQGrid::skip() - if ( dir == Horizontal ) { - if ( col+1 < nCols ) { - col++; - } else { - col = 0; - row++; - } - } else { //Vertical - if ( row+1 < nRows ) { - row++; - } else { - row = 0; - col++; - } - } -} - - -/*! - \internal - - This private slot finds a widget in this group box that can accept - focus, and gives the focus to that widget. -*/ - -void TQGroupBox::fixFocus() -{ - TQFocusData * fd = focusData(); - TQWidget * orig = fd->home(); - TQWidget * best = 0; - TQWidget * candidate = 0; - TQWidget * w = orig; - do { - TQWidget * p = w; - while( p && p != this && !p->isTopLevel() ) - p = p->parentWidget(); - if ( p == this && ( w->focusPolicy() & TabFocus ) == TabFocus - && w->isVisibleTo(this) ) { - if ( w->hasFocus() -#ifndef TQT_NO_RADIOBUTTON - || ( !best && ::tqt_cast(w) - && ((TQRadioButton*)w)->isChecked() ) -#endif - ) - // we prefer a checked radio button or a widget that - // already has focus, if there is one - best = w; - else if ( !candidate ) - // but we'll accept anything that takes focus - candidate = w; - } - w = fd->next(); - } while( w != orig ); - if ( best ) - best->setFocus(); - else if ( candidate ) - candidate->setFocus(); -} - - -/* - Sets the right frame rect depending on the title. Also calculates - the visible part of the title. -*/ -void TQGroupBox::calculateFrame() -{ - lenvisible = str.length(); - - if ( lenvisible && !isCheckable() ) { // do we have a label? - TQFontMetrics fm = fontMetrics(); - while ( lenvisible ) { - int tw = fm.width( str, lenvisible ) + 4*fm.width(TQChar(' ')); - if ( tw < width() ) - break; - lenvisible--; - } - if ( lenvisible ) { // but do we also have a visible label? - TQRect r = rect(); - int va = style().styleHint(TQStyle::SH_GroupBox_TextLabelVerticalAlignment, this); - if(va & AlignVCenter) - r.setTop( fm.height()/2 ); // frame rect should be - else if(va & AlignTop) - r.setTop(fm.ascent()); - setFrameRect( r ); // smaller than client rect - return; - } - } else if ( isCheckable() ) { -#ifndef TQT_NO_CHECKBOX - TQRect r = rect(); - int va = style().styleHint(TQStyle::SH_GroupBox_TextLabelVerticalAlignment, this); - if( va & AlignVCenter ) - r.setTop( d->checkbox->rect().height()/2 ); - else if( va & AlignTop ) - r.setTop( fontMetrics().ascent() ); - setFrameRect( r ); - return; -#endif - } - - // no visible label - setFrameRect( TQRect(0,0,0,0) ); // then use client rect -} - - - -/*! \reimp - */ -void TQGroupBox::focusInEvent( TQFocusEvent * ) -{ // note no call to super - fixFocus(); -} - - -/*!\reimp - */ -void TQGroupBox::fontChange( const TQFont & oldFont ) -{ - TQWidget::fontChange( oldFont ); -#ifndef TQT_NO_CHECKBOX - updateCheckBoxGeometry(); -#endif - calculateFrame(); - setTextSpacer(); -} - -/*! - \reimp -*/ - -TQSize TQGroupBox::sizeHint() const -{ - TQFontMetrics fm( font() ); - int tw, th; - if ( isCheckable() ) { -#ifndef TQT_NO_CHECKBOX - tw = d->checkbox->sizeHint().width() + 2*fm.width( "xx" ); - th = d->checkbox->sizeHint().height() + fm.width( TQChar(' ') ); -#endif - } else { - tw = fm.width( title() ) + 2 * fm.width( "xx" ); - th = fm.height() + fm.width( TQChar(' ') ); - } - - TQSize s; - if ( layout() ) { - s = TQFrame::sizeHint(); - return s.expandedTo( TQSize( tw, 0 ) ); - } else { - TQRect r = childrenRect(); - TQSize s( 100, 50 ); - s = s.expandedTo( TQSize( tw, th ) ); - if ( r.isNull() ) - return s; - - return s.expandedTo( TQSize( r.width() + 2 * r.x(), r.height()+ 2 * r.y() ) ); - } -} - -/*! - \property TQGroupBox::flat - \brief whether the group box is painted flat or has a frame - - By default a group box has a surrounding frame, with the title - being placed on the upper frame line. In flat mode the right, left - and bottom frame lines are omitted, and only the thin line at the - top is drawn. - - \sa title -*/ -bool TQGroupBox::isFlat() const -{ - return bFlat; -} - -void TQGroupBox::setFlat( bool b ) -{ - if ( (bool)bFlat == b ) - return; - bFlat = b; - update(); -} - - -/*! - \property TQGroupBox::checkable - \brief Whether the group box has a checkbox in its title. - - If this property is TRUE, the group box has a checkbox. If the - checkbox is checked (which is the default), the group box's - children are enabled. - - setCheckable() controls whether or not the group box has a - checkbox, and isCheckable() controls whether the checkbox is - checked or not. -*/ -#ifndef TQT_NO_CHECKBOX -void TQGroupBox::setCheckable( bool b ) -{ - if ( (d->checkbox != 0) == b ) - return; - - if ( b ) { - if ( !d->checkbox ) { - d->checkbox = new TQCheckBox( title(), this, "qt_groupbox_checkbox" ); - if (TQButtonGroup *meAsButtonGroup = ::tqt_cast(this)) - meAsButtonGroup->remove(d->checkbox); - setChecked( TRUE ); - setChildrenEnabled( TRUE ); - connect( d->checkbox, TQ_SIGNAL( toggled(bool) ), - this, TQ_SLOT( setChildrenEnabled(bool) ) ); - connect( d->checkbox, TQ_SIGNAL( toggled(bool) ), - this, TQ_SIGNAL( toggled(bool) ) ); - updateCheckBoxGeometry(); - } - d->checkbox->show(); - } else { - setChildrenEnabled( TRUE ); - delete d->checkbox; - d->checkbox = 0; - } - calculateFrame(); - setTextSpacer(); - update(); -} -#endif //TQT_NO_CHECKBOX - -bool TQGroupBox::isCheckable() const -{ -#ifndef TQT_NO_CHECKBOX - return ( d->checkbox != 0 ); -#else - return FALSE; -#endif -} - - -bool TQGroupBox::isChecked() const -{ -#ifndef TQT_NO_CHECKBOX - return d->checkbox && d->checkbox->isChecked(); -#else - return FALSE; -#endif -} - - -/*! - \fn void TQGroupBox::toggled( bool on ) - - If the group box has a check box (see \l isCheckable()) this signal - is emitted when the check box is toggled. \a on is TRUE if the check - box is checked; otherwise it is FALSE. -*/ - -/*! - \property TQGroupBox::checked - \brief Whether the group box's checkbox is checked. - - If the group box has a check box (see \l isCheckable()), and the - check box is checked (see \l isChecked()), the group box's children - are enabled. If the checkbox is unchecked the children are - disabled. -*/ -#ifndef TQT_NO_CHECKBOX -void TQGroupBox::setChecked( bool b ) -{ - if ( d->checkbox ) - d->checkbox->setChecked( b ); -} -#endif - -/* - sets all children of the group box except the qt_groupbox_checkbox - to either disabled/enabled -*/ -void TQGroupBox::setChildrenEnabled( bool b ) -{ - if ( !children() ) - return; - TQObjectListIt it( *children() ); - TQObject *o; - while( (o = it.current()) ) { - ++it; - if ( o->isWidgetType() -#ifndef TQT_NO_CHECKBOX - && o != d->checkbox -#endif - ) { - TQWidget *w = (TQWidget*)o; - if ( b ) { - if ( !w->testWState( WState_ForceDisabled ) ) - w->setEnabled( TRUE ); - } else { - if ( w->isEnabled() ) { - w->setEnabled( FALSE ); - ((TQGroupBox*)w)->clearWState( WState_ForceDisabled ); - } - } - } - } -} - -/*! \reimp */ -void TQGroupBox::setEnabled(bool on) -{ - TQFrame::setEnabled(on); - if ( !d->checkbox || !on ) - return; - -#ifndef TQT_NO_CHECKBOX - // we are being enabled - disable children - if ( !d->checkbox->isChecked() ) - setChildrenEnabled( FALSE ); -#endif -} - -/* - recalculates and sets the checkbox setGeometry -*/ -#ifndef TQT_NO_CHECKBOX -void TQGroupBox::updateCheckBoxGeometry() -{ - if ( d->checkbox ) { - TQSize cbSize = d->checkbox->sizeHint(); - TQRect cbRect( 0, 0, cbSize.width(), cbSize.height() ); - - int marg = bFlat ? 2 : 8; - marg += fontMetrics().width( TQChar(' ') ); - - if ( align & AlignHCenter ) { - cbRect.moveCenter( frameRect().center() ); - cbRect.moveTop( 0 ); - } else if ( align & AlignRight ) { - cbRect.moveRight( frameRect().right() - marg ); - } else if ( align & AlignLeft ) { - cbRect.moveLeft( frameRect().left() + marg ); - } else { // auto align - if( TQApplication::reverseLayout() ) - cbRect.moveRight( frameRect().right() - marg ); - else - cbRect.moveLeft( frameRect().left() + marg ); - } - - d->checkbox->setGeometry( cbRect ); - } -} -#endif //TQT_NO_CHECKBOX - - -#endif //TQT_NO_GROUPBOX diff --git a/src/widgets/qhbox.cpp b/src/widgets/qhbox.cpp deleted file mode 100644 index 7f5e0c893..000000000 --- a/src/widgets/qhbox.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "ntqhbox.h" -#ifndef TQT_NO_HBOX -#include "ntqlayout.h" -#include "ntqapplication.h" -#include "tqobjectlist.h" - - -/*! - \class TQHBox ntqhbox.h - \brief The TQHBox widget provides horizontal geometry management - for its child widgets. - - \ingroup organizers - \ingroup geomanagement - \ingroup appearance - - All the horizontal box's child widgets will be placed alongside - each other and sized according to their sizeHint()s. - - Use setMargin() to add space around the edges, and use - setSpacing() to add space between the widgets. Use - setStretchFactor() if you want the widgets to be different sizes - in proportion to one another. (See \link layout.html - Layouts\endlink for more information on stretch factors.) - - \img qhbox-m.png TQHBox - - \sa TQHBoxLayout TQVBox TQGrid -*/ - - -/*! - Constructs an hbox widget with parent \a parent, called \a name. - The parent, name and widget flags, \a f, are passed to the TQFrame - constructor. -*/ -TQHBox::TQHBox( TQWidget *parent, const char *name, WFlags f ) - :TQFrame( parent, name, f ) -{ - lay = new TQHBoxLayout( this, frameWidth(), frameWidth(), name ); - lay->setAutoAdd( TRUE ); -} - - -/*! - Constructs a horizontal hbox if \a horizontal is TRUE, otherwise - constructs a vertical hbox (also known as a vbox). - - This constructor is provided for the TQVBox class. You should never - need to use it directly. - - The \a parent, \a name and widget flags, \a f, are passed to the - TQFrame constructor. -*/ - -TQHBox::TQHBox( bool horizontal, TQWidget *parent , const char *name, WFlags f ) - :TQFrame( parent, name, f ) -{ - lay = new TQBoxLayout( this, - horizontal ? TQBoxLayout::LeftToRight : TQBoxLayout::Down, - frameWidth(), frameWidth(), name ); - lay->setAutoAdd( TRUE ); -} - -/*!\reimp - */ -void TQHBox::frameChanged() -{ - if ( !layout() ) - return; - layout()->setMargin( frameWidth() ); -} - - -/*! - Sets the spacing between the child widgets to \a space. -*/ - -void TQHBox::setSpacing( int space ) -{ - if ( layout() ) // ### why not use this->lay? - layout()->setSpacing( space ); -} - - -/*! - \reimp -*/ - -TQSize TQHBox::sizeHint() const -{ - TQWidget *mThis = (TQWidget*)this; - TQApplication::sendPostedEvents( mThis, TQEvent::ChildInserted ); - return TQFrame::sizeHint(); -} - -/*! - Sets the stretch factor of widget \a w to \a stretch. Returns TRUE if - \a w is found. Otherwise returns FALSE. - - \sa TQBoxLayout::setStretchFactor() \link layout.html Layouts\endlink -*/ -bool TQHBox::setStretchFactor( TQWidget* w, int stretch ) -{ - TQWidget *mThis = (TQWidget*)this; - TQApplication::sendPostedEvents( mThis, TQEvent::ChildInserted ); - return lay->setStretchFactor( w, stretch ); -} -#endif diff --git a/src/widgets/qhbuttongroup.cpp b/src/widgets/qhbuttongroup.cpp deleted file mode 100644 index 4b5dbf0fc..000000000 --- a/src/widgets/qhbuttongroup.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Implementation of TQHButtonGroup class -** -** Created : 990602 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "ntqhbuttongroup.h" -#ifndef TQT_NO_HBUTTONGROUP - -/*! - \class TQHButtonGroup ntqhbuttongroup.h - \brief The TQHButtonGroup widget organizes TQButton widgets in a - group with one horizontal row. - - \ingroup organizers - \ingroup geomanagement - \ingroup appearance - - TQHButtonGroup is a convenience class that offers a thin layer on - top of TQButtonGroup. From a layout point of view it is effectively - a TQHBox that offers a frame with a title and is specifically - designed for buttons. From a functionality point of view it is a - TQButtonGroup. - - \img tqbuttongroup-h.png TQButtonGroup - - \sa TQVButtonGroup -*/ - -/*! - Constructs a horizontal button group with no title. - - The \a parent and \a name arguments are passed to the TQWidget - constructor. -*/ -TQHButtonGroup::TQHButtonGroup( TQWidget *parent, const char *name ) - : TQButtonGroup( 1, Vertical /* sic! */, parent, name ) -{ -} - -/*! - Constructs a horizontal button group with the title \a title. - - The \a parent and \a name arguments are passed to the TQWidget - constructor. -*/ - -TQHButtonGroup::TQHButtonGroup( const TQString &title, TQWidget *parent, - const char *name ) - : TQButtonGroup( 1, Vertical /* sic! */, title, parent, name ) -{ -} - -/*! - Destroys the horizontal button group, deleting its child widgets. -*/ -TQHButtonGroup::~TQHButtonGroup() -{ -} -#endif diff --git a/src/widgets/qhgroupbox.cpp b/src/widgets/qhgroupbox.cpp deleted file mode 100644 index 1a37a9583..000000000 --- a/src/widgets/qhgroupbox.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Implementation of TQHGroupBox class -** -** Created : 990602 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "ntqhgroupbox.h" -#ifndef TQT_NO_HGROUPBOX - -/*! - \class TQHGroupBox ntqhgroupbox.h - - \brief The TQHGroupBox widget organizes widgets in a group with one - horizontal row. - - \ingroup organizers - \ingroup geomanagement - \ingroup appearance - - TQHGroupBox is a convenience class that offers a thin layer on top - of TQGroupBox. Think of it as a TQHBox that offers a frame with a - title. - - \img qgroupboxes.png Group Boxes - - \sa TQVGroupBox -*/ - -/*! - Constructs a horizontal group box with no title. - - The \a parent and \a name arguments are passed to the TQWidget - constructor. -*/ -TQHGroupBox::TQHGroupBox( TQWidget *parent, const char *name ) - : TQGroupBox( 1, Vertical /* sic! */, parent, name ) -{ -} - -/*! - Constructs a horizontal group box with the title \a title. - - The \a parent and \a name arguments are passed to the TQWidget - constructor. -*/ - -TQHGroupBox::TQHGroupBox( const TQString &title, TQWidget *parent, - const char *name ) - : TQGroupBox( 1, Vertical /* sic! */, title, parent, name ) -{ -} - -/*! - Destroys the horizontal group box, deleting its child widgets. -*/ -TQHGroupBox::~TQHGroupBox() -{ -} -#endif diff --git a/src/widgets/qsplitter.cpp b/src/widgets/qsplitter.cpp index 2a4a193bb..cff76bc50 100644 --- a/src/widgets/qsplitter.cpp +++ b/src/widgets/qsplitter.cpp @@ -41,8 +41,8 @@ #include "ntqsplitter.h" #ifndef TQT_NO_SPLITTER -#include "ntqlayout.h" -#include "../kernel/qlayoutengine_p.h" +#include "tqlayout.h" +#include "../kernel/tqlayoutengine_p.h" #include "ntqapplication.h" #include "tqbitmap.h" #include "ntqdrawutil.h" diff --git a/src/widgets/qt_widgets.pri b/src/widgets/qt_widgets.pri index 19cf6d377..7a4e4b3b5 100644 --- a/src/widgets/qt_widgets.pri +++ b/src/widgets/qt_widgets.pri @@ -15,11 +15,11 @@ widgets { $$WIDGETS_H/tqframe.h \ $$WIDGETS_H/tqgrid.h \ $$WIDGETS_H/tqgridview.h \ - $$WIDGETS_H/ntqgroupbox.h \ - $$WIDGETS_H/ntqhbuttongroup.h \ + $$WIDGETS_H/tqgroupbox.h \ + $$WIDGETS_H/tqhbuttongroup.h \ $$WIDGETS_H/tqheader.h \ - $$WIDGETS_H/ntqhgroupbox.h \ - $$WIDGETS_H/ntqhbox.h \ + $$WIDGETS_H/tqhgroupbox.h \ + $$WIDGETS_H/tqhbox.h \ $$WIDGETS_H/tqiconview.h \ $$WIDGETS_H/tqlabel.h \ $$WIDGETS_H/tqlcdnumber.h \ @@ -52,9 +52,9 @@ widgets { $$WIDGETS_H/tqtoolbutton.h \ $$WIDGETS_H/tqtooltip.h \ $$WIDGETS_H/ntqvalidator.h \ - $$WIDGETS_H/ntqvbox.h \ - $$WIDGETS_H/ntqvbuttongroup.h \ - $$WIDGETS_H/ntqvgroupbox.h \ + $$WIDGETS_H/tqvbox.h \ + $$WIDGETS_H/tqvbuttongroup.h \ + $$WIDGETS_H/tqvgroupbox.h \ $$WIDGETS_H/tqwhatsthis.h \ $$WIDGETS_H/tqwidgetstack.h \ $$WIDGETS_H/tqaction.h \ @@ -77,11 +77,11 @@ widgets { $$WIDGETS_CPP/tqframe.cpp \ $$WIDGETS_CPP/tqgrid.cpp \ $$WIDGETS_CPP/tqgridview.cpp \ - $$WIDGETS_CPP/qgroupbox.cpp \ - $$WIDGETS_CPP/qhbuttongroup.cpp \ + $$WIDGETS_CPP/tqgroupbox.cpp \ + $$WIDGETS_CPP/tqhbuttongroup.cpp \ $$WIDGETS_CPP/tqheader.cpp \ - $$WIDGETS_CPP/qhgroupbox.cpp \ - $$WIDGETS_CPP/qhbox.cpp \ + $$WIDGETS_CPP/tqhgroupbox.cpp \ + $$WIDGETS_CPP/tqhbox.cpp \ $$WIDGETS_CPP/tqiconview.cpp \ $$WIDGETS_CPP/tqlabel.cpp \ $$WIDGETS_CPP/tqlcdnumber.cpp \ @@ -114,9 +114,9 @@ widgets { $$WIDGETS_CPP/tqtoolbutton.cpp \ $$WIDGETS_CPP/tqtooltip.cpp \ $$WIDGETS_CPP/qvalidator.cpp \ - $$WIDGETS_CPP/qvbox.cpp \ - $$WIDGETS_CPP/qvbuttongroup.cpp \ - $$WIDGETS_CPP/qvgroupbox.cpp \ + $$WIDGETS_CPP/tqvbox.cpp \ + $$WIDGETS_CPP/tqvbuttongroup.cpp \ + $$WIDGETS_CPP/tqvgroupbox.cpp \ $$WIDGETS_CPP/tqwhatsthis.cpp \ $$WIDGETS_CPP/tqwidgetstack.cpp \ $$WIDGETS_CPP/tqaction.cpp \ diff --git a/src/widgets/qvbox.cpp b/src/widgets/qvbox.cpp deleted file mode 100644 index 8236c1a4f..000000000 --- a/src/widgets/qvbox.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Implementation of vertical box layout widget class -** -** Created : 990124 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - - -#include "ntqvbox.h" -#ifndef TQT_NO_VBOX - -/*! - \class TQVBox ntqvbox.h - \brief The TQVBox widget provides vertical geometry management of - its child widgets. - - \ingroup geomanagement - \ingroup appearance - \ingroup organizers - - All its child widgets will be placed vertically and sized - according to their sizeHint()s. - - \img qvbox-m.png TQVBox - - \sa TQHBox -*/ - - -/*! - Constructs a vbox widget called \a name with parent \a parent and - widget flags \a f. - */ -TQVBox::TQVBox( TQWidget *parent, const char *name, WFlags f ) - :TQHBox( FALSE, parent, name, f ) -{ -} -#endif diff --git a/src/widgets/qvbuttongroup.cpp b/src/widgets/qvbuttongroup.cpp deleted file mode 100644 index 06658c18d..000000000 --- a/src/widgets/qvbuttongroup.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Implementation of TQVButtonGroup class -** -** Created : 990602 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "ntqvbuttongroup.h" -#ifndef TQT_NO_VBUTTONGROUP - -/*! - \class TQVButtonGroup ntqvbuttongroup.h - \brief The TQVButtonGroup widget organizes TQButton widgets in a - vertical column. - - \ingroup geomanagement - \ingroup organizers - \ingroup appearance - - TQVButtonGroup is a convenience class that offers a thin layer on top - of TQButtonGroup. Think of it as a TQVBox that offers a frame with a - title and is specifically designed for buttons. - - \img tqbuttongroup-v.png TQButtonGroup - - \sa TQHButtonGroup -*/ - -/*! - Constructs a vertical button group with no title. - - The \a parent and \a name arguments are passed on to the TQWidget - constructor. -*/ -TQVButtonGroup::TQVButtonGroup( TQWidget *parent, const char *name ) - : TQButtonGroup( 1, Horizontal /* sic! */, parent, name ) -{ -} - -/*! - Constructs a vertical button group with the title \a title. - - The \a parent and \a name arguments are passed on to the TQWidget - constructor. -*/ - -TQVButtonGroup::TQVButtonGroup( const TQString &title, TQWidget *parent, - const char *name ) - : TQButtonGroup( 1, Horizontal /* sic! */, title, parent, name ) -{ -} - -/*! - Destroys the vertical button group, deleting its child widgets. -*/ -TQVButtonGroup::~TQVButtonGroup() -{ -} -#endif diff --git a/src/widgets/qvgroupbox.cpp b/src/widgets/qvgroupbox.cpp deleted file mode 100644 index de48909bf..000000000 --- a/src/widgets/qvgroupbox.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Implementation of TQVGroupBox class -** -** Created : 990602 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the widgets module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "ntqvgroupbox.h" -#ifndef TQT_NO_VGROUPBOX - -/*! - \class TQVGroupBox ntqvgroupbox.h - \brief The TQVGroupBox widget organizes a group of widgets in a - vertical column. - - \ingroup geomanagement - \ingroup appearance - \ingroup organizers - - TQVGroupBox is a convenience class that offers a thin layer on top of - TQGroupBox. Think of it as a TQVBox that offers a frame with a title. - - \img qgroupboxes.png Group Boxes - - \sa TQHGroupBox -*/ - -/*! - Constructs a vertical group box with no title. - - The \a parent and \a name arguments are passed on to the TQWidget - constructor. -*/ -TQVGroupBox::TQVGroupBox( TQWidget *parent, const char *name ) - : TQGroupBox( 1, Horizontal /* sic! */, parent, name ) -{ -} - -/*! - Constructs a vertical group box with the title \a title. - - The \a parent and \a name arguments are passed on to the TQWidget - constructor. -*/ - -TQVGroupBox::TQVGroupBox( const TQString &title, TQWidget *parent, - const char *name ) - : TQGroupBox( 1, Horizontal /* sic! */, title, parent, name ) -{ -} - -/*! - Destroys the vertical group box, deleting its child widgets. -*/ -TQVGroupBox::~TQVGroupBox() -{ -} -#endif diff --git a/src/widgets/tqbuttongroup.h b/src/widgets/tqbuttongroup.h index 1eff32887..ee27d9db7 100644 --- a/src/widgets/tqbuttongroup.h +++ b/src/widgets/tqbuttongroup.h @@ -42,7 +42,7 @@ #define TQBUTTONGROUP_H #ifndef QT_H -#include "ntqgroupbox.h" +#include "tqgroupbox.h" #endif // QT_H #ifndef TQT_NO_BUTTONGROUP diff --git a/src/widgets/tqdialogbuttons.cpp b/src/widgets/tqdialogbuttons.cpp index b20f70350..939384281 100644 --- a/src/widgets/tqdialogbuttons.cpp +++ b/src/widgets/tqdialogbuttons.cpp @@ -47,7 +47,7 @@ #ifndef TQT_NO_DIALOG #include #endif // TQT_NO_DIALOG -#include +#include #include #include diff --git a/src/widgets/tqgrid.cpp b/src/widgets/tqgrid.cpp index 0fe3f6949..bdc43f9e1 100644 --- a/src/widgets/tqgrid.cpp +++ b/src/widgets/tqgrid.cpp @@ -37,7 +37,7 @@ #include "tqgrid.h" #ifndef TQT_NO_GRID -#include "ntqlayout.h" +#include "tqlayout.h" #include "ntqapplication.h" /*! diff --git a/src/widgets/tqgroupbox.cpp b/src/widgets/tqgroupbox.cpp new file mode 100644 index 000000000..54b5dd5cf --- /dev/null +++ b/src/widgets/tqgroupbox.cpp @@ -0,0 +1,990 @@ +/********************************************************************** +** +** Implementation of TQGroupBox widget class +** +** Created : 950203 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "tqgroupbox.h" +#ifndef TQT_NO_GROUPBOX +#include "tqlayout.h" +#include "tqpainter.h" +#include "tqbitmap.h" +#include "ntqaccel.h" +#include "tqradiobutton.h" +#include "ntqfocusdata.h" +#include "tqobjectlist.h" +#include "ntqdrawutil.h" +#include "ntqapplication.h" +#include "tqstyle.h" +#include "tqcheckbox.h" +#include "tqbuttongroup.h" +#if defined(QT_ACCESSIBILITY_SUPPORT) +#include "ntqaccessible.h" +#endif + +/*! + \class TQGroupBox tqgroupbox.h + \brief The TQGroupBox widget provides a group box frame with a title. + + \ingroup organizers + \ingroup geomanagement + \ingroup appearance + \mainclass + + A group box provides a frame, a title and a keyboard shortcut, and + displays various other widgets inside itself. The title is on top, + the keyboard shortcut moves keyboard focus to one of the group + box's child widgets, and the child widgets are usually laid out + horizontally (or vertically) inside the frame. + + The simplest way to use it is to create a group box with the + desired number of columns (or rows) and orientation, and then just + create widgets with the group box as parent. + + It is also possible to change the orientation() and number of + columns() after construction, or to ignore all the automatic + layout support and manage the layout yourself. You can add 'empty' + spaces to the group box with addSpace(). + + TQGroupBox also lets you set the title() (normally set in the + constructor) and the title's alignment(). + + You can change the spacing used by the group box with + setInsideMargin() and setInsideSpacing(). To minimize space + consumption, you can remove the right, left and bottom edges of + the frame with setFlat(). + + + + \sa TQButtonGroup +*/ + +class TQCheckBox; + +class TQGroupBoxPrivate +{ +public: + TQGroupBoxPrivate(): + spacer( 0 ), + checkbox( 0 ) {} + + TQSpacerItem *spacer; + TQCheckBox *checkbox; +}; + + + + +/*! + Constructs a group box widget with no title. + + The \a parent and \a name arguments are passed to the TQWidget + constructor. + + This constructor does not do automatic layout. +*/ + +TQGroupBox::TQGroupBox( TQWidget *parent, const char *name ) + : TQFrame( parent, name ) +{ + init(); +} + +/*! + Constructs a group box with the title \a title. + + The \a parent and \a name arguments are passed to the TQWidget + constructor. + + This constructor does not do automatic layout. +*/ + +TQGroupBox::TQGroupBox( const TQString &title, TQWidget *parent, const char *name ) + : TQFrame( parent, name ) +{ + init(); + setTitle( title ); +} + +/*! + Constructs a group box with no title. Child widgets will be + arranged in \a strips rows or columns (depending on \a + orientation). + + The \a parent and \a name arguments are passed to the TQWidget + constructor. +*/ + +TQGroupBox::TQGroupBox( int strips, Orientation orientation, + TQWidget *parent, const char *name ) + : TQFrame( parent, name ) +{ + init(); + setColumnLayout( strips, orientation ); +} + +/*! + Constructs a group box titled \a title. Child widgets will be + arranged in \a strips rows or columns (depending on \a + orientation). + + The \a parent and \a name arguments are passed to the TQWidget + constructor. +*/ + +TQGroupBox::TQGroupBox( int strips, Orientation orientation, + const TQString &title, TQWidget *parent, + const char *name ) + : TQFrame( parent, name ) +{ + init(); + setTitle( title ); + setColumnLayout( strips, orientation ); +} + +/*! + Destroys the group box. +*/ +TQGroupBox::~TQGroupBox() +{ + delete d; +} + +void TQGroupBox::init() +{ + align = AlignAuto; + setFrameStyle( TQFrame::GroupBoxPanel | TQFrame::Sunken ); +#ifndef TQT_NO_ACCEL + accel = 0; +#endif + vbox = 0; + grid = 0; + d = new TQGroupBoxPrivate(); + lenvisible = 0; + nCols = nRows = 0; + dir = Horizontal; + marg = 11; + spac = 5; + bFlat = FALSE; +} + +void TQGroupBox::setTextSpacer() +{ + if ( !d->spacer ) + return; + int h = 0; + int w = 0; + if ( isCheckable() || lenvisible ) { + TQFontMetrics fm = fontMetrics(); + int fh = fm.height(); + if ( isCheckable() ) { +#ifndef TQT_NO_CHECKBOX + fh = d->checkbox->sizeHint().height() + 2; + w = d->checkbox->sizeHint().width() + 2*fm.width( "xx" ); +#endif + } else { + fh = fm.height(); + w = fm.width( str, lenvisible ) + 2*fm.width( "xx" ); + } + h = frameRect().y(); + if ( layout() ) { + int m = layout()->margin(); + int sp = layout()->spacing(); + // do we have a child layout? + for ( TQLayoutIterator it = layout()->iterator(); it.current(); ++it ) { + if ( it.current()->layout() ) { + m += it.current()->layout()->margin(); + sp = TQMAX( sp, it.current()->layout()->spacing() ); + break; + } + } + h = TQMAX( fh-m, h ); + h += TQMAX( sp - (h+m - fh), 0 ); + } + } + d->spacer->changeSize( w, h, TQSizePolicy::Minimum, TQSizePolicy::Fixed ); +} + + +void TQGroupBox::setTitle( const TQString &title ) +{ + if ( str == title ) // no change + return; + str = title; +#ifndef TQT_NO_ACCEL + if ( accel ) + delete accel; + accel = 0; + int s = TQAccel::shortcutKey( title ); + if ( s ) { + accel = new TQAccel( this, "automatic focus-change accelerator" ); + accel->connectItem( accel->insertItem( s, 0 ), + this, TQ_SLOT(fixFocus()) ); + } +#endif +#ifndef TQT_NO_CHECKBOX + if ( d->checkbox ) { + d->checkbox->setText( str ); + updateCheckBoxGeometry(); + } +#endif + calculateFrame(); + setTextSpacer(); + + update(); + updateGeometry(); +#if defined(QT_ACCESSIBILITY_SUPPORT) + TQAccessible::updateAccessibility( this, 0, TQAccessible::NameChanged ); +#endif +} + +/*! + \property TQGroupBox::title + \brief the group box title text. + + The group box title text will have a focus-change keyboard + accelerator if the title contains \&, followed by a letter. + + \code + g->setTitle( "&User information" ); + \endcode + This produces "User information"; Alt+U moves the keyboard + focus to the group box. + + There is no default title text. +*/ + +/*! + \property TQGroupBox::alignment + \brief the alignment of the group box title. + + The title is always placed on the upper frame line. The horizontal + alignment can be specified by the alignment parameter. + + The alignment is one of the following flags: + \list + \i \c AlignAuto aligns the title according to the language, + usually to the left. + \i \c AlignLeft aligns the title text to the left. + \i \c AlignRight aligns the title text to the right. + \i \c AlignHCenter aligns the title text centered. + \endlist + + The default alignment is \c AlignAuto. + + \sa TQt::AlignmentFlags +*/ + +void TQGroupBox::setAlignment( int alignment ) +{ + align = alignment; +#ifndef TQT_NO_CHECKBOX + updateCheckBoxGeometry(); +#endif + update(); +} + +/*! \reimp +*/ +void TQGroupBox::resizeEvent( TQResizeEvent *e ) +{ + TQFrame::resizeEvent(e); +#ifndef TQT_NO_CHECKBOX + if ( align & AlignRight || align & AlignCenter || + ( TQApplication::reverseLayout() && !(align & AlignLeft) ) ) + updateCheckBoxGeometry(); +#endif + calculateFrame(); +} + +/*! \reimp + + \internal + overrides TQFrame::paintEvent +*/ + +void TQGroupBox::paintEvent( TQPaintEvent *event ) +{ + TQPainter paint( this ); + + if ( lenvisible && !isCheckable() ) { // draw title + TQFontMetrics fm = paint.fontMetrics(); + int h = fm.height(); + int tw = fm.width( str, lenvisible ) + fm.width(TQChar(' ')); + int x; + int marg = bFlat ? 0 : 8; + if ( align & AlignHCenter ) // center alignment + x = frameRect().width()/2 - tw/2; + else if ( align & AlignRight ) // right alignment + x = frameRect().width() - tw - marg; + else if ( align & AlignLeft ) // left alignment + x = marg; + else { // auto align + if( TQApplication::reverseLayout() ) + x = frameRect().width() - tw - marg; + else + x = marg; + } + TQRect r( x, 0, tw, h ); + int va = style().styleHint(TQStyle::SH_GroupBox_TextLabelVerticalAlignment, this); + if(va & AlignTop) + r.moveBy(0, fm.descent()); + TQColor pen( (TQRgb) style().styleHint(TQStyle::SH_GroupBox_TextLabelColor, this ) ); + if ((!style().styleHint(TQStyle::SH_UnderlineAccelerator, this)) || ((style().styleHint(TQStyle::SH_HideUnderlineAcceleratorWhenAltUp, this)) && (!style().acceleratorsShown()))) { + va |= NoAccel; + } + style().drawItem( &paint, r, ShowPrefix | AlignHCenter | va, colorGroup(), + isEnabled(), 0, str, -1, ownPalette() ? 0 : &pen ); + paint.setClipRegion( event->region().subtract( r ) ); // clip everything but title +#ifndef TQT_NO_CHECKBOX + } else if ( d->checkbox ) { + TQRect cbClip = d->checkbox->geometry(); + TQFontMetrics fm = paint.fontMetrics(); + cbClip.setX( cbClip.x() - fm.width(TQChar(' ')) ); + cbClip.setWidth( cbClip.width() + fm.width(TQChar(' ')) ); + paint.setClipRegion( event->region().subtract( cbClip ) ); +#endif + } + if ( bFlat ) { + TQRect fr = frameRect(); + TQPoint p1( fr.x(), fr.y() + 1 ); + TQPoint p2( fr.x() + fr.width(), p1.y() ); + // ### This should probably be a style primitive. + qDrawShadeLine( &paint, p1, p2, colorGroup(), TRUE, + lineWidth(), midLineWidth() ); + } else { + drawFrame(&paint); + } + drawContents( &paint ); // draw the contents +} + + +/*! + Adds an empty cell at the next free position. If \a size is + greater than 0, the empty cell takes \a size to be its fixed width + (if orientation() is \c Horizontal) or height (if orientation() is + \c Vertical). + + Use this method to separate the widgets in the group box or to + skip the next free cell. For performance reasons, call this method + after calling setColumnLayout() or by changing the \l + TQGroupBox::columns or \l TQGroupBox::orientation properties. It is + generally a good idea to call these methods first (if needed at + all), and insert the widgets and spaces afterwards. +*/ +void TQGroupBox::addSpace( int size ) +{ + TQApplication::sendPostedEvents( this, TQEvent::ChildInserted ); + + if ( nCols <= 0 || nRows <= 0 ) + return; + + if ( row >= nRows || col >= nCols ) + grid->expand( row+1, col+1 ); + + if ( size > 0 ) { + TQSpacerItem *spacer + = new TQSpacerItem( ( dir == Horizontal ) ? 0 : size, + ( dir == Vertical ) ? 0 : size, + TQSizePolicy::Fixed, TQSizePolicy::Fixed ); + grid->addItem( spacer, row, col ); + } + + skip(); +} + +/*! + \property TQGroupBox::columns + \brief the number of columns or rows (depending on \l TQGroupBox::orientation) in the group box + + Usually it is not a good idea to set this property because it is + slow (it does a complete layout). It is best to set the number + of columns directly in the constructor. +*/ +int TQGroupBox::columns() const +{ + if ( dir == Horizontal ) + return nCols; + return nRows; +} + +void TQGroupBox::setColumns( int c ) +{ + setColumnLayout( c, dir ); +} + +/*! + Returns the width of the empty space between the items in the + group and the frame of the group. + + Only applies if the group box has a defined orientation. + + The default is usually 11, by may vary depending on the platform + and style. + + \sa setInsideMargin(), orientation +*/ +int TQGroupBox::insideMargin() const +{ + return marg; +} + +/*! + Returns the width of the empty space between each of the items + in the group. + + Only applies if the group box has a defined orientation. + + The default is usually 5, by may vary depending on the platform + and style. + + \sa setInsideSpacing(), orientation +*/ +int TQGroupBox::insideSpacing() const +{ + return spac; +} + +/*! + Sets the the width of the inside margin to \a m pixels. + + \sa insideMargin() +*/ +void TQGroupBox::setInsideMargin( int m ) +{ + marg = m; + setColumnLayout( columns(), dir ); +} + +/*! + Sets the width of the empty space between each of the items in + the group to \a s pixels. + + \sa insideSpacing() +*/ +void TQGroupBox::setInsideSpacing( int s ) +{ + spac = s; + setColumnLayout( columns(), dir ); +} + +/*! + \property TQGroupBox::orientation + \brief the group box's orientation + + A horizontal group box arranges it's children in columns, while a + vertical group box arranges them in rows. + + Usually it is not a good idea to set this property because it is + slow (it does a complete layout). It is better to set the + orientation directly in the constructor. +*/ +void TQGroupBox::setOrientation( TQt::Orientation o ) +{ + setColumnLayout( columns(), o ); +} + +/*! + Changes the layout of the group box. This function is only useful + in combination with the default constructor that does not take any + layout information. This function will put all existing children + in the new layout. It is not good TQt programming style to call + this function after children have been inserted. Sets the number + of columns or rows to be \a strips, depending on \a direction. + + \sa orientation columns +*/ +void TQGroupBox::setColumnLayout(int strips, Orientation direction) +{ + if ( layout() ) + delete layout(); + + vbox = 0; + grid = 0; + + if ( strips < 0 ) // if 0, we create the vbox but not the grid. See below. + return; + + vbox = new TQVBoxLayout( this, marg, 0 ); + + d->spacer = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, + TQSizePolicy::Fixed ); + + setTextSpacer(); + vbox->addItem( d->spacer ); + + nCols = 0; + nRows = 0; + dir = direction; + + // Send all child events and ignore them. Otherwise we will end up + // with doubled insertion. This won't do anything because nCols == + // nRows == 0. + TQApplication::sendPostedEvents( this, TQEvent::ChildInserted ); + + // if 0 or smaller , create a vbox-layout but no grid. This allows + // the designer to handle its own grid layout in a group box. + if ( strips <= 0 ) + return; + + dir = direction; + if ( dir == Horizontal ) { + nCols = strips; + nRows = 1; + } else { + nCols = 1; + nRows = strips; + } + grid = new TQGridLayout( nRows, nCols, spac ); + row = col = 0; + grid->setAlignment( AlignTop ); + vbox->addLayout( grid ); + + // Add all children + if ( children() ) { + TQObjectListIt it( *children() ); + TQWidget *w; + while( (w=(TQWidget *)it.current()) != 0 ) { + ++it; + if ( w->isWidgetType() +#ifndef TQT_NO_CHECKBOX + && w != d->checkbox +#endif + ) + insertWid( w ); + } + } +} + + +/*! \reimp */ +bool TQGroupBox::event( TQEvent * e ) +{ + if ( e->type() == TQEvent::LayoutHint && layout() ) + setTextSpacer(); + return TQFrame::event( e ); +} + +/*!\reimp */ +void TQGroupBox::childEvent( TQChildEvent *c ) +{ + if ( !c->inserted() || !c->child()->isWidgetType() ) + return; + TQWidget *w = (TQWidget*)c->child(); +#ifndef TQT_NO_CHECKBOX + if ( d->checkbox ) { + if ( w == d->checkbox ) + return; + if ( d->checkbox->isChecked() ) { + if ( !w->testWState( WState_ForceDisabled ) ) + w->setEnabled( TRUE ); + } else { + if ( w->isEnabled() ) { + w->setEnabled( FALSE ); + ((TQGroupBox*)w)->clearWState( WState_ForceDisabled ); + } + } + } +#endif + if ( !grid ) + return; + insertWid( w ); +} + +void TQGroupBox::insertWid( TQWidget* w ) +{ + if ( row >= nRows || col >= nCols ) + grid->expand( row+1, col+1 ); + grid->addWidget( w, row, col ); + skip(); + TQApplication::postEvent( this, new TQEvent( TQEvent::LayoutHint ) ); +} + + +void TQGroupBox::skip() +{ + // Same as TQGrid::skip() + if ( dir == Horizontal ) { + if ( col+1 < nCols ) { + col++; + } else { + col = 0; + row++; + } + } else { //Vertical + if ( row+1 < nRows ) { + row++; + } else { + row = 0; + col++; + } + } +} + + +/*! + \internal + + This private slot finds a widget in this group box that can accept + focus, and gives the focus to that widget. +*/ + +void TQGroupBox::fixFocus() +{ + TQFocusData * fd = focusData(); + TQWidget * orig = fd->home(); + TQWidget * best = 0; + TQWidget * candidate = 0; + TQWidget * w = orig; + do { + TQWidget * p = w; + while( p && p != this && !p->isTopLevel() ) + p = p->parentWidget(); + if ( p == this && ( w->focusPolicy() & TabFocus ) == TabFocus + && w->isVisibleTo(this) ) { + if ( w->hasFocus() +#ifndef TQT_NO_RADIOBUTTON + || ( !best && ::tqt_cast(w) + && ((TQRadioButton*)w)->isChecked() ) +#endif + ) + // we prefer a checked radio button or a widget that + // already has focus, if there is one + best = w; + else if ( !candidate ) + // but we'll accept anything that takes focus + candidate = w; + } + w = fd->next(); + } while( w != orig ); + if ( best ) + best->setFocus(); + else if ( candidate ) + candidate->setFocus(); +} + + +/* + Sets the right frame rect depending on the title. Also calculates + the visible part of the title. +*/ +void TQGroupBox::calculateFrame() +{ + lenvisible = str.length(); + + if ( lenvisible && !isCheckable() ) { // do we have a label? + TQFontMetrics fm = fontMetrics(); + while ( lenvisible ) { + int tw = fm.width( str, lenvisible ) + 4*fm.width(TQChar(' ')); + if ( tw < width() ) + break; + lenvisible--; + } + if ( lenvisible ) { // but do we also have a visible label? + TQRect r = rect(); + int va = style().styleHint(TQStyle::SH_GroupBox_TextLabelVerticalAlignment, this); + if(va & AlignVCenter) + r.setTop( fm.height()/2 ); // frame rect should be + else if(va & AlignTop) + r.setTop(fm.ascent()); + setFrameRect( r ); // smaller than client rect + return; + } + } else if ( isCheckable() ) { +#ifndef TQT_NO_CHECKBOX + TQRect r = rect(); + int va = style().styleHint(TQStyle::SH_GroupBox_TextLabelVerticalAlignment, this); + if( va & AlignVCenter ) + r.setTop( d->checkbox->rect().height()/2 ); + else if( va & AlignTop ) + r.setTop( fontMetrics().ascent() ); + setFrameRect( r ); + return; +#endif + } + + // no visible label + setFrameRect( TQRect(0,0,0,0) ); // then use client rect +} + + + +/*! \reimp + */ +void TQGroupBox::focusInEvent( TQFocusEvent * ) +{ // note no call to super + fixFocus(); +} + + +/*!\reimp + */ +void TQGroupBox::fontChange( const TQFont & oldFont ) +{ + TQWidget::fontChange( oldFont ); +#ifndef TQT_NO_CHECKBOX + updateCheckBoxGeometry(); +#endif + calculateFrame(); + setTextSpacer(); +} + +/*! + \reimp +*/ + +TQSize TQGroupBox::sizeHint() const +{ + TQFontMetrics fm( font() ); + int tw, th; + if ( isCheckable() ) { +#ifndef TQT_NO_CHECKBOX + tw = d->checkbox->sizeHint().width() + 2*fm.width( "xx" ); + th = d->checkbox->sizeHint().height() + fm.width( TQChar(' ') ); +#endif + } else { + tw = fm.width( title() ) + 2 * fm.width( "xx" ); + th = fm.height() + fm.width( TQChar(' ') ); + } + + TQSize s; + if ( layout() ) { + s = TQFrame::sizeHint(); + return s.expandedTo( TQSize( tw, 0 ) ); + } else { + TQRect r = childrenRect(); + TQSize s( 100, 50 ); + s = s.expandedTo( TQSize( tw, th ) ); + if ( r.isNull() ) + return s; + + return s.expandedTo( TQSize( r.width() + 2 * r.x(), r.height()+ 2 * r.y() ) ); + } +} + +/*! + \property TQGroupBox::flat + \brief whether the group box is painted flat or has a frame + + By default a group box has a surrounding frame, with the title + being placed on the upper frame line. In flat mode the right, left + and bottom frame lines are omitted, and only the thin line at the + top is drawn. + + \sa title +*/ +bool TQGroupBox::isFlat() const +{ + return bFlat; +} + +void TQGroupBox::setFlat( bool b ) +{ + if ( (bool)bFlat == b ) + return; + bFlat = b; + update(); +} + + +/*! + \property TQGroupBox::checkable + \brief Whether the group box has a checkbox in its title. + + If this property is TRUE, the group box has a checkbox. If the + checkbox is checked (which is the default), the group box's + children are enabled. + + setCheckable() controls whether or not the group box has a + checkbox, and isCheckable() controls whether the checkbox is + checked or not. +*/ +#ifndef TQT_NO_CHECKBOX +void TQGroupBox::setCheckable( bool b ) +{ + if ( (d->checkbox != 0) == b ) + return; + + if ( b ) { + if ( !d->checkbox ) { + d->checkbox = new TQCheckBox( title(), this, "qt_groupbox_checkbox" ); + if (TQButtonGroup *meAsButtonGroup = ::tqt_cast(this)) + meAsButtonGroup->remove(d->checkbox); + setChecked( TRUE ); + setChildrenEnabled( TRUE ); + connect( d->checkbox, TQ_SIGNAL( toggled(bool) ), + this, TQ_SLOT( setChildrenEnabled(bool) ) ); + connect( d->checkbox, TQ_SIGNAL( toggled(bool) ), + this, TQ_SIGNAL( toggled(bool) ) ); + updateCheckBoxGeometry(); + } + d->checkbox->show(); + } else { + setChildrenEnabled( TRUE ); + delete d->checkbox; + d->checkbox = 0; + } + calculateFrame(); + setTextSpacer(); + update(); +} +#endif //TQT_NO_CHECKBOX + +bool TQGroupBox::isCheckable() const +{ +#ifndef TQT_NO_CHECKBOX + return ( d->checkbox != 0 ); +#else + return FALSE; +#endif +} + + +bool TQGroupBox::isChecked() const +{ +#ifndef TQT_NO_CHECKBOX + return d->checkbox && d->checkbox->isChecked(); +#else + return FALSE; +#endif +} + + +/*! + \fn void TQGroupBox::toggled( bool on ) + + If the group box has a check box (see \l isCheckable()) this signal + is emitted when the check box is toggled. \a on is TRUE if the check + box is checked; otherwise it is FALSE. +*/ + +/*! + \property TQGroupBox::checked + \brief Whether the group box's checkbox is checked. + + If the group box has a check box (see \l isCheckable()), and the + check box is checked (see \l isChecked()), the group box's children + are enabled. If the checkbox is unchecked the children are + disabled. +*/ +#ifndef TQT_NO_CHECKBOX +void TQGroupBox::setChecked( bool b ) +{ + if ( d->checkbox ) + d->checkbox->setChecked( b ); +} +#endif + +/* + sets all children of the group box except the qt_groupbox_checkbox + to either disabled/enabled +*/ +void TQGroupBox::setChildrenEnabled( bool b ) +{ + if ( !children() ) + return; + TQObjectListIt it( *children() ); + TQObject *o; + while( (o = it.current()) ) { + ++it; + if ( o->isWidgetType() +#ifndef TQT_NO_CHECKBOX + && o != d->checkbox +#endif + ) { + TQWidget *w = (TQWidget*)o; + if ( b ) { + if ( !w->testWState( WState_ForceDisabled ) ) + w->setEnabled( TRUE ); + } else { + if ( w->isEnabled() ) { + w->setEnabled( FALSE ); + ((TQGroupBox*)w)->clearWState( WState_ForceDisabled ); + } + } + } + } +} + +/*! \reimp */ +void TQGroupBox::setEnabled(bool on) +{ + TQFrame::setEnabled(on); + if ( !d->checkbox || !on ) + return; + +#ifndef TQT_NO_CHECKBOX + // we are being enabled - disable children + if ( !d->checkbox->isChecked() ) + setChildrenEnabled( FALSE ); +#endif +} + +/* + recalculates and sets the checkbox setGeometry +*/ +#ifndef TQT_NO_CHECKBOX +void TQGroupBox::updateCheckBoxGeometry() +{ + if ( d->checkbox ) { + TQSize cbSize = d->checkbox->sizeHint(); + TQRect cbRect( 0, 0, cbSize.width(), cbSize.height() ); + + int marg = bFlat ? 2 : 8; + marg += fontMetrics().width( TQChar(' ') ); + + if ( align & AlignHCenter ) { + cbRect.moveCenter( frameRect().center() ); + cbRect.moveTop( 0 ); + } else if ( align & AlignRight ) { + cbRect.moveRight( frameRect().right() - marg ); + } else if ( align & AlignLeft ) { + cbRect.moveLeft( frameRect().left() + marg ); + } else { // auto align + if( TQApplication::reverseLayout() ) + cbRect.moveRight( frameRect().right() - marg ); + else + cbRect.moveLeft( frameRect().left() + marg ); + } + + d->checkbox->setGeometry( cbRect ); + } +} +#endif //TQT_NO_CHECKBOX + + +#endif //TQT_NO_GROUPBOX diff --git a/src/widgets/tqgroupbox.h b/src/widgets/tqgroupbox.h new file mode 100644 index 000000000..14198de3e --- /dev/null +++ b/src/widgets/tqgroupbox.h @@ -0,0 +1,165 @@ +/********************************************************************** +** +** Definition of TQGroupBox widget class +** +** Created : 950203 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGROUPBOX_H +#define TQGROUPBOX_H + +#ifndef QT_H +#include "tqframe.h" +#endif // QT_H + +#ifndef TQT_NO_GROUPBOX + + +class TQAccel; +class TQGroupBoxPrivate; +class TQVBoxLayout; +class TQGridLayout; +class TQSpacerItem; + +class TQ_EXPORT TQGroupBox : public TQFrame +{ + TQ_OBJECT + TQ_PROPERTY( TQString title READ title WRITE setTitle ) + TQ_PROPERTY( Alignment alignment READ alignment WRITE setAlignment ) + TQ_PROPERTY( Orientation orientation READ orientation WRITE setOrientation DESIGNABLE false ) + TQ_PROPERTY( int columns READ columns WRITE setColumns DESIGNABLE false ) + TQ_PROPERTY( bool flat READ isFlat WRITE setFlat ) +#ifndef TQT_NO_CHECKBOX + TQ_PROPERTY( bool checkable READ isCheckable WRITE setCheckable ) + TQ_PROPERTY( bool checked READ isChecked WRITE setChecked ) +#endif +public: + TQGroupBox( TQWidget* parent=0, const char* name=0 ); + TQGroupBox( const TQString &title, + TQWidget* parent=0, const char* name=0 ); + TQGroupBox( int strips, Orientation o, + TQWidget* parent=0, const char* name=0 ); + TQGroupBox( int strips, Orientation o, const TQString &title, + TQWidget* parent=0, const char* name=0 ); + ~TQGroupBox(); + + virtual void setColumnLayout(int strips, Orientation o); + + TQString title() const { return str; } + virtual void setTitle( const TQString &); + + int alignment() const { return align; } + virtual void setAlignment( int ); + + int columns() const; + void setColumns( int ); + + Orientation orientation() const { return dir; } + void setOrientation( Orientation ); + + int insideMargin() const; + int insideSpacing() const; + void setInsideMargin( int m ); + void setInsideSpacing( int s ); + + void addSpace( int ); + TQSize sizeHint() const; + + bool isFlat() const; + void setFlat( bool b ); + bool isCheckable() const; +#ifndef TQT_NO_CHECKBOX + void setCheckable( bool b ); +#endif + bool isChecked() const; + void setEnabled(bool on); + +#ifndef TQT_NO_CHECKBOX +public slots: + void setChecked( bool b ); + +signals: + void toggled( bool ); +#endif +protected: + bool event( TQEvent * ); + void childEvent( TQChildEvent * ); + void resizeEvent( TQResizeEvent * ); + void paintEvent( TQPaintEvent * ); + void focusInEvent( TQFocusEvent * ); + void fontChange( const TQFont & ); + +private slots: + void fixFocus(); + void setChildrenEnabled( bool b ); + +private: + void skip(); + void init(); + void calculateFrame(); + void insertWid( TQWidget* ); + void setTextSpacer(); +#ifndef TQT_NO_CHECKBOX + void updateCheckBoxGeometry(); +#endif + TQString str; + int align; + int lenvisible; +#ifndef TQT_NO_ACCEL + TQAccel * accel; +#endif + TQGroupBoxPrivate * d; + + TQVBoxLayout *vbox; + TQGridLayout *grid; + int row; + int col : 30; + uint bFlat : 1; + int nRows, nCols; + Orientation dir; + int spac, marg; + +private: // Disabled copy constructor and operator= +#if defined(TQ_DISABLE_COPY) + TQGroupBox( const TQGroupBox & ); + TQGroupBox &operator=( const TQGroupBox & ); +#endif +}; + + +#endif // TQT_NO_GROUPBOX + +#endif // TQGROUPBOX_H diff --git a/src/widgets/tqhbox.cpp b/src/widgets/tqhbox.cpp new file mode 100644 index 000000000..41b4fabbf --- /dev/null +++ b/src/widgets/tqhbox.cpp @@ -0,0 +1,145 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "tqhbox.h" +#ifndef TQT_NO_HBOX +#include "tqlayout.h" +#include "ntqapplication.h" +#include "tqobjectlist.h" + + +/*! + \class TQHBox tqhbox.h + \brief The TQHBox widget provides horizontal geometry management + for its child widgets. + + \ingroup organizers + \ingroup geomanagement + \ingroup appearance + + All the horizontal box's child widgets will be placed alongside + each other and sized according to their sizeHint()s. + + Use setMargin() to add space around the edges, and use + setSpacing() to add space between the widgets. Use + setStretchFactor() if you want the widgets to be different sizes + in proportion to one another. (See \link layout.html + Layouts\endlink for more information on stretch factors.) + + \img tqhbox-m.png TQHBox + + \sa TQHBoxLayout TQVBox TQGrid +*/ + + +/*! + Constructs an hbox widget with parent \a parent, called \a name. + The parent, name and widget flags, \a f, are passed to the TQFrame + constructor. +*/ +TQHBox::TQHBox( TQWidget *parent, const char *name, WFlags f ) + :TQFrame( parent, name, f ) +{ + lay = new TQHBoxLayout( this, frameWidth(), frameWidth(), name ); + lay->setAutoAdd( TRUE ); +} + + +/*! + Constructs a horizontal hbox if \a horizontal is TRUE, otherwise + constructs a vertical hbox (also known as a vbox). + + This constructor is provided for the TQVBox class. You should never + need to use it directly. + + The \a parent, \a name and widget flags, \a f, are passed to the + TQFrame constructor. +*/ + +TQHBox::TQHBox( bool horizontal, TQWidget *parent , const char *name, WFlags f ) + :TQFrame( parent, name, f ) +{ + lay = new TQBoxLayout( this, + horizontal ? TQBoxLayout::LeftToRight : TQBoxLayout::Down, + frameWidth(), frameWidth(), name ); + lay->setAutoAdd( TRUE ); +} + +/*!\reimp + */ +void TQHBox::frameChanged() +{ + if ( !layout() ) + return; + layout()->setMargin( frameWidth() ); +} + + +/*! + Sets the spacing between the child widgets to \a space. +*/ + +void TQHBox::setSpacing( int space ) +{ + if ( layout() ) // ### why not use this->lay? + layout()->setSpacing( space ); +} + + +/*! + \reimp +*/ + +TQSize TQHBox::sizeHint() const +{ + TQWidget *mThis = (TQWidget*)this; + TQApplication::sendPostedEvents( mThis, TQEvent::ChildInserted ); + return TQFrame::sizeHint(); +} + +/*! + Sets the stretch factor of widget \a w to \a stretch. Returns TRUE if + \a w is found. Otherwise returns FALSE. + + \sa TQBoxLayout::setStretchFactor() \link layout.html Layouts\endlink +*/ +bool TQHBox::setStretchFactor( TQWidget* w, int stretch ) +{ + TQWidget *mThis = (TQWidget*)this; + TQApplication::sendPostedEvents( mThis, TQEvent::ChildInserted ); + return lay->setStretchFactor( w, stretch ); +} +#endif diff --git a/src/widgets/tqhbox.h b/src/widgets/tqhbox.h new file mode 100644 index 000000000..fec6a33cd --- /dev/null +++ b/src/widgets/tqhbox.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + + +#ifndef TQHBOX_H +#define TQHBOX_H + +#ifndef QT_H +#include "tqwidget.h" +#endif // QT_H + +#ifndef TQT_NO_HBOX + +#include "tqframe.h" + +class TQBoxLayout; + +class TQ_EXPORT TQHBox : public TQFrame +{ + TQ_OBJECT +public: + TQHBox( TQWidget* parent=0, const char* name=0, WFlags f=0 ); + + void setSpacing( int ); + bool setStretchFactor( TQWidget*, int stretch ); + TQSize sizeHint() const; + +protected: + TQHBox( bool horizontal, TQWidget* parent, const char* name, WFlags f = 0 ); + void frameChanged(); + +private: + TQBoxLayout *lay; + +#if defined(TQ_DISABLE_COPY) + TQHBox( const TQHBox & ); + TQHBox &operator=( const TQHBox & ); +#endif +}; + +#endif // TQT_NO_HBOX + +#endif // TQHBOX_H diff --git a/src/widgets/tqhbuttongroup.cpp b/src/widgets/tqhbuttongroup.cpp new file mode 100644 index 000000000..50e061e51 --- /dev/null +++ b/src/widgets/tqhbuttongroup.cpp @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Implementation of TQHButtonGroup class +** +** Created : 990602 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "tqhbuttongroup.h" +#ifndef TQT_NO_HBUTTONGROUP + +/*! + \class TQHButtonGroup tqhbuttongroup.h + \brief The TQHButtonGroup widget organizes TQButton widgets in a + group with one horizontal row. + + \ingroup organizers + \ingroup geomanagement + \ingroup appearance + + TQHButtonGroup is a convenience class that offers a thin layer on + top of TQButtonGroup. From a layout point of view it is effectively + a TQHBox that offers a frame with a title and is specifically + designed for buttons. From a functionality point of view it is a + TQButtonGroup. + + \img tqbuttongroup-h.png TQButtonGroup + + \sa TQVButtonGroup +*/ + +/*! + Constructs a horizontal button group with no title. + + The \a parent and \a name arguments are passed to the TQWidget + constructor. +*/ +TQHButtonGroup::TQHButtonGroup( TQWidget *parent, const char *name ) + : TQButtonGroup( 1, Vertical /* sic! */, parent, name ) +{ +} + +/*! + Constructs a horizontal button group with the title \a title. + + The \a parent and \a name arguments are passed to the TQWidget + constructor. +*/ + +TQHButtonGroup::TQHButtonGroup( const TQString &title, TQWidget *parent, + const char *name ) + : TQButtonGroup( 1, Vertical /* sic! */, title, parent, name ) +{ +} + +/*! + Destroys the horizontal button group, deleting its child widgets. +*/ +TQHButtonGroup::~TQHButtonGroup() +{ +} +#endif diff --git a/src/widgets/tqhbuttongroup.h b/src/widgets/tqhbuttongroup.h new file mode 100644 index 000000000..ab53a0824 --- /dev/null +++ b/src/widgets/tqhbuttongroup.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Definition of TQHButtonGroup class +** +** Created : 990602 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQHBUTTONGROUP_H +#define TQHBUTTONGROUP_H + +#ifndef QT_H +#include "tqbuttongroup.h" +#endif // QT_H + +#ifndef TQT_NO_HBUTTONGROUP + +class TQ_EXPORT TQHButtonGroup : public TQButtonGroup +{ + TQ_OBJECT +public: + TQHButtonGroup( TQWidget* parent=0, const char* name=0 ); + TQHButtonGroup( const TQString &title, TQWidget* parent=0, const char* name=0 ); + ~TQHButtonGroup(); + +private: // Disabled copy constructor and operator= +#if defined(TQ_DISABLE_COPY) + TQHButtonGroup( const TQHButtonGroup & ); + TQHButtonGroup &operator=( const TQHButtonGroup & ); +#endif +}; + + +#endif // TQT_NO_HBUTTONGROUP + +#endif // TQHBUTTONGROUP_H diff --git a/src/widgets/tqhgroupbox.cpp b/src/widgets/tqhgroupbox.cpp new file mode 100644 index 000000000..c170d8a4a --- /dev/null +++ b/src/widgets/tqhgroupbox.cpp @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Implementation of TQHGroupBox class +** +** Created : 990602 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "tqhgroupbox.h" +#ifndef TQT_NO_HGROUPBOX + +/*! + \class TQHGroupBox tqhgroupbox.h + + \brief The TQHGroupBox widget organizes widgets in a group with one + horizontal row. + + \ingroup organizers + \ingroup geomanagement + \ingroup appearance + + TQHGroupBox is a convenience class that offers a thin layer on top + of TQGroupBox. Think of it as a TQHBox that offers a frame with a + title. + + \img tqgroupboxes.png Group Boxes + + \sa TQVGroupBox +*/ + +/*! + Constructs a horizontal group box with no title. + + The \a parent and \a name arguments are passed to the TQWidget + constructor. +*/ +TQHGroupBox::TQHGroupBox( TQWidget *parent, const char *name ) + : TQGroupBox( 1, Vertical /* sic! */, parent, name ) +{ +} + +/*! + Constructs a horizontal group box with the title \a title. + + The \a parent and \a name arguments are passed to the TQWidget + constructor. +*/ + +TQHGroupBox::TQHGroupBox( const TQString &title, TQWidget *parent, + const char *name ) + : TQGroupBox( 1, Vertical /* sic! */, title, parent, name ) +{ +} + +/*! + Destroys the horizontal group box, deleting its child widgets. +*/ +TQHGroupBox::~TQHGroupBox() +{ +} +#endif diff --git a/src/widgets/tqhgroupbox.h b/src/widgets/tqhgroupbox.h new file mode 100644 index 000000000..67865c062 --- /dev/null +++ b/src/widgets/tqhgroupbox.h @@ -0,0 +1,67 @@ +/********************************************************************** +** +** Definition of TQHGroupBox widget class +** +** Created : 990602 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQHGROUPBOX_H +#define TQHGROUPBOX_H + +#ifndef QT_H +#include "tqgroupbox.h" +#endif // QT_H + +#ifndef TQT_NO_HGROUPBOX + +class TQ_EXPORT TQHGroupBox : public TQGroupBox +{ + TQ_OBJECT +public: + TQHGroupBox( TQWidget* parent=0, const char* name=0 ); + TQHGroupBox( const TQString &title, TQWidget* parent=0, const char* name=0 ); + ~TQHGroupBox(); + +private: // Disabled copy constructor and operator= +#if defined(TQ_DISABLE_COPY) + TQHGroupBox( const TQHGroupBox & ); + TQHGroupBox &operator=( const TQHGroupBox & ); +#endif +}; + +#endif // TQT_NO_HGROUPBOX + +#endif // TQHGROUPBOX_H diff --git a/src/widgets/tqiconview.cpp b/src/widgets/tqiconview.cpp index 6febcfe30..70462bc05 100644 --- a/src/widgets/tqiconview.cpp +++ b/src/widgets/tqiconview.cpp @@ -62,7 +62,7 @@ #include "tqtextedit.h" #include "tqmemarray.h" #include "tqptrlist.h" -#include "ntqvbox.h" +#include "tqvbox.h" #include "tqtooltip.h" #include "tqbitmap.h" #include "tqpixmapcache.h" diff --git a/src/widgets/tqlistview.cpp b/src/widgets/tqlistview.cpp index d5b083520..104362f9b 100644 --- a/src/widgets/tqlistview.cpp +++ b/src/widgets/tqlistview.cpp @@ -59,7 +59,7 @@ #include "ntqtl.h" #include "tqdragobject.h" #include "tqlineedit.h" -#include "ntqvbox.h" +#include "tqvbox.h" #include "tqtooltip.h" #include "tqstyle.h" #include "tqstylesheet.h" diff --git a/src/widgets/tqmainwindow.cpp b/src/widgets/tqmainwindow.cpp index cda9afcb3..c84e7fe65 100644 --- a/src/widgets/tqmainwindow.cpp +++ b/src/widgets/tqmainwindow.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_MAINWINDOW #include "tqtimer.h" -#include "ntqlayout.h" +#include "tqlayout.h" #include "tqobjectlist.h" #include "tqintdict.h" #include "ntqapplication.h" diff --git a/src/widgets/tqmenubar.cpp b/src/widgets/tqmenubar.cpp index 1f1dc08c5..b288f6280 100644 --- a/src/widgets/tqmenubar.cpp +++ b/src/widgets/tqmenubar.cpp @@ -50,7 +50,7 @@ #include "ntqdrawutil.h" #include "ntqapplication.h" #include "ntqguardedptr.h" -#include "ntqlayout.h" +#include "tqlayout.h" #include "ntqcleanuphandler.h" #include "../kernel/qinternal_p.h" #include "tqstyle.h" diff --git a/src/widgets/tqstatusbar.cpp b/src/widgets/tqstatusbar.cpp index 746f45e5a..29aaadfa1 100644 --- a/src/widgets/tqstatusbar.cpp +++ b/src/widgets/tqstatusbar.cpp @@ -42,7 +42,7 @@ #ifndef TQT_NO_STATUSBAR #include "tqptrlist.h" -#include "ntqlayout.h" +#include "tqlayout.h" #include "tqpainter.h" #include "tqtimer.h" #include "ntqdrawutil.h" diff --git a/src/widgets/tqtextbrowser.cpp b/src/widgets/tqtextbrowser.cpp index 1409a20ff..504209717 100644 --- a/src/widgets/tqtextbrowser.cpp +++ b/src/widgets/tqtextbrowser.cpp @@ -43,14 +43,14 @@ #include "../kernel/qrichtext_p.h" #include "ntqapplication.h" -#include "ntqlayout.h" +#include "tqlayout.h" #include "tqpainter.h" #include "tqvaluestack.h" #include "stdio.h" #include "tqfile.h" #include "tqtextstream.h" -#include "ntqlayout.h" +#include "tqlayout.h" #include "tqbitmap.h" #include "tqtimer.h" #include "tqimage.h" diff --git a/src/widgets/tqtextedit.cpp b/src/widgets/tqtextedit.cpp index 304c27172..d57724ab3 100644 --- a/src/widgets/tqtextedit.cpp +++ b/src/widgets/tqtextedit.cpp @@ -60,7 +60,7 @@ #include "tqtimer.h" #include "ntqapplication.h" #include "tqlistbox.h" -#include "ntqvbox.h" +#include "tqvbox.h" #include "ntqapplication.h" #include "tqclipboard.h" #include "tqcolordialog.h" diff --git a/src/widgets/tqtoolbar.cpp b/src/widgets/tqtoolbar.cpp index 99947c59e..27c06fb64 100644 --- a/src/widgets/tqtoolbar.cpp +++ b/src/widgets/tqtoolbar.cpp @@ -44,7 +44,7 @@ #include "tqmainwindow.h" #include "tqtooltip.h" #include "ntqcursor.h" -#include "ntqlayout.h" +#include "tqlayout.h" #include "tqframe.h" #include "tqobjectlist.h" #include "tqpainter.h" diff --git a/src/widgets/tqtoolbox.cpp b/src/widgets/tqtoolbox.cpp index ad97a79c3..ac9df2f82 100644 --- a/src/widgets/tqtoolbox.cpp +++ b/src/widgets/tqtoolbox.cpp @@ -43,14 +43,14 @@ #ifndef TQT_NO_TOOLBOX #include -#include +#include #include #include #include #include #include #include -#include +#include #include #include #include diff --git a/src/widgets/tqvbox.cpp b/src/widgets/tqvbox.cpp new file mode 100644 index 000000000..ad6c7e0b7 --- /dev/null +++ b/src/widgets/tqvbox.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Implementation of vertical box layout widget class +** +** Created : 990124 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + + +#include "tqvbox.h" +#ifndef TQT_NO_VBOX + +/*! + \class TQVBox tqvbox.h + \brief The TQVBox widget provides vertical geometry management of + its child widgets. + + \ingroup geomanagement + \ingroup appearance + \ingroup organizers + + All its child widgets will be placed vertically and sized + according to their sizeHint()s. + + \img tqvbox-m.png TQVBox + + \sa TQHBox +*/ + + +/*! + Constructs a vbox widget called \a name with parent \a parent and + widget flags \a f. + */ +TQVBox::TQVBox( TQWidget *parent, const char *name, WFlags f ) + :TQHBox( FALSE, parent, name, f ) +{ +} +#endif diff --git a/src/widgets/tqvbox.h b/src/widgets/tqvbox.h new file mode 100644 index 000000000..7eed7460f --- /dev/null +++ b/src/widgets/tqvbox.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Definition of vertical box layout widget class +** +** Created : 990124 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVBOX_H +#define TQVBOX_H + +#ifndef QT_H +#include "tqhbox.h" +#endif // QT_H + +#ifndef TQT_NO_VBOX + +class TQ_EXPORT TQVBox : public TQHBox +{ + TQ_OBJECT +public: + TQVBox( TQWidget* parent=0, const char* name=0, WFlags f=0 ); + +private: // Disabled copy constructor and operator= +#if defined(TQ_DISABLE_COPY) + TQVBox( const TQVBox & ); + TQVBox& operator=( const TQVBox & ); +#endif +}; + +#endif // TQT_NO_VBOX + +#endif // TQVBOX_H diff --git a/src/widgets/tqvbuttongroup.cpp b/src/widgets/tqvbuttongroup.cpp new file mode 100644 index 000000000..312fad1b5 --- /dev/null +++ b/src/widgets/tqvbuttongroup.cpp @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Implementation of TQVButtonGroup class +** +** Created : 990602 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "tqvbuttongroup.h" +#ifndef TQT_NO_VBUTTONGROUP + +/*! + \class TQVButtonGroup tqvbuttongroup.h + \brief The TQVButtonGroup widget organizes TQButton widgets in a + vertical column. + + \ingroup geomanagement + \ingroup organizers + \ingroup appearance + + TQVButtonGroup is a convenience class that offers a thin layer on top + of TQButtonGroup. Think of it as a TQVBox that offers a frame with a + title and is specifically designed for buttons. + + \img tqbuttongroup-v.png TQButtonGroup + + \sa TQHButtonGroup +*/ + +/*! + Constructs a vertical button group with no title. + + The \a parent and \a name arguments are passed on to the TQWidget + constructor. +*/ +TQVButtonGroup::TQVButtonGroup( TQWidget *parent, const char *name ) + : TQButtonGroup( 1, Horizontal /* sic! */, parent, name ) +{ +} + +/*! + Constructs a vertical button group with the title \a title. + + The \a parent and \a name arguments are passed on to the TQWidget + constructor. +*/ + +TQVButtonGroup::TQVButtonGroup( const TQString &title, TQWidget *parent, + const char *name ) + : TQButtonGroup( 1, Horizontal /* sic! */, title, parent, name ) +{ +} + +/*! + Destroys the vertical button group, deleting its child widgets. +*/ +TQVButtonGroup::~TQVButtonGroup() +{ +} +#endif diff --git a/src/widgets/tqvbuttongroup.h b/src/widgets/tqvbuttongroup.h new file mode 100644 index 000000000..a8050bc76 --- /dev/null +++ b/src/widgets/tqvbuttongroup.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Definition of TQVButtonGroup class +** +** Created : 990602 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVBUTTONGROUP_H +#define TQVBUTTONGROUP_H + +#ifndef QT_H +#include "tqbuttongroup.h" +#endif // QT_H + +#ifndef TQT_NO_VBUTTONGROUP + +class TQ_EXPORT TQVButtonGroup : public TQButtonGroup +{ + TQ_OBJECT +public: + TQVButtonGroup( TQWidget* parent=0, const char* name=0 ); + TQVButtonGroup( const TQString &title, TQWidget* parent=0, const char* name=0 ); + + ~TQVButtonGroup(); + +private: // Disabled copy constructor and operator= +#if defined(TQ_DISABLE_COPY) + TQVButtonGroup( const TQVButtonGroup & ); + TQVButtonGroup &operator=( const TQVButtonGroup & ); +#endif +}; + + +#endif // TQT_NO_VBUTTONGROUP + +#endif // TQVBUTTONGROUP_H diff --git a/src/widgets/tqvgroupbox.cpp b/src/widgets/tqvgroupbox.cpp new file mode 100644 index 000000000..468a7e4f1 --- /dev/null +++ b/src/widgets/tqvgroupbox.cpp @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Implementation of TQVGroupBox class +** +** Created : 990602 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "tqvgroupbox.h" +#ifndef TQT_NO_VGROUPBOX + +/*! + \class TQVGroupBox tqvgroupbox.h + \brief The TQVGroupBox widget organizes a group of widgets in a + vertical column. + + \ingroup geomanagement + \ingroup appearance + \ingroup organizers + + TQVGroupBox is a convenience class that offers a thin layer on top of + TQGroupBox. Think of it as a TQVBox that offers a frame with a title. + + \img tqgroupboxes.png Group Boxes + + \sa TQHGroupBox +*/ + +/*! + Constructs a vertical group box with no title. + + The \a parent and \a name arguments are passed on to the TQWidget + constructor. +*/ +TQVGroupBox::TQVGroupBox( TQWidget *parent, const char *name ) + : TQGroupBox( 1, Horizontal /* sic! */, parent, name ) +{ +} + +/*! + Constructs a vertical group box with the title \a title. + + The \a parent and \a name arguments are passed on to the TQWidget + constructor. +*/ + +TQVGroupBox::TQVGroupBox( const TQString &title, TQWidget *parent, + const char *name ) + : TQGroupBox( 1, Horizontal /* sic! */, title, parent, name ) +{ +} + +/*! + Destroys the vertical group box, deleting its child widgets. +*/ +TQVGroupBox::~TQVGroupBox() +{ +} +#endif diff --git a/src/widgets/tqvgroupbox.h b/src/widgets/tqvgroupbox.h new file mode 100644 index 000000000..e98c993d3 --- /dev/null +++ b/src/widgets/tqvgroupbox.h @@ -0,0 +1,68 @@ +/********************************************************************** +** +** Definition of TQVGroupBox widget class +** +** Created : 990602 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the widgets module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQVGROUPBOX_H +#define TQVGROUPBOX_H + +#ifndef QT_H +#include "tqgroupbox.h" +#endif // QT_H + +#ifndef TQT_NO_VGROUPBOX + +class TQ_EXPORT TQVGroupBox : public TQGroupBox +{ + TQ_OBJECT +public: + TQVGroupBox( TQWidget* parent=0, const char* name=0 ); + TQVGroupBox( const TQString &title, TQWidget* parent=0, const char* name=0 ); + + ~TQVGroupBox(); + +private: // Disabled copy constructor and operator= +#if defined(TQ_DISABLE_COPY) + TQVGroupBox( const TQVGroupBox & ); + TQVGroupBox &operator=( const TQVGroupBox & ); +#endif +}; + +#endif // TQT_NO_VGROUPBOX + +#endif // TQVGROUPBOX_H diff --git a/src/widgets/tqwidgetstack.cpp b/src/widgets/tqwidgetstack.cpp index 6e043943b..5cd6f6254 100644 --- a/src/widgets/tqwidgetstack.cpp +++ b/src/widgets/tqwidgetstack.cpp @@ -39,8 +39,8 @@ **********************************************************************/ #include "tqwidgetstack.h" -#include "ntqlayout.h" -#include "../kernel/qlayoutengine_p.h" +#include "tqlayout.h" +#include "../kernel/tqlayoutengine_p.h" #ifndef TQT_NO_WIDGETSTACK #include "tqobjectlist.h" -- cgit v1.2.1