home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / include / qgroupbox.h < prev    next >
C/C++ Source or Header  |  2001-10-11  |  4KB  |  138 lines

  1. /**********************************************************************
  2. ** $Id:  qt/qgroupbox.h   3.0.0   edited Sep 21 17:17 $
  3. **
  4. ** Definition of QGroupBox widget class
  5. **
  6. ** Created : 950203
  7. **
  8. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the widgets module of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed under the terms of the Q Public License
  13. ** as defined by Trolltech AS of Norway and appearing in the file
  14. ** LICENSE.QPL included in the packaging of this file.
  15. **
  16. ** This file may be distributed and/or modified under the terms of the
  17. ** GNU General Public License version 2 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.GPL included in the
  19. ** packaging of this file.
  20. **
  21. ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
  22. ** licenses may use this file in accordance with the Qt Commercial License
  23. ** Agreement provided with the Software.
  24. **
  25. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  26. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27. **
  28. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  29. **   information about Qt Commercial License Agreements.
  30. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  31. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  32. **
  33. ** Contact info@trolltech.com if any conditions of this licensing are
  34. ** not clear to you.
  35. **
  36. **********************************************************************/
  37.  
  38. #ifndef QGROUPBOX_H
  39. #define QGROUPBOX_H
  40.  
  41. #ifndef QT_H
  42. #include "qframe.h"
  43. #endif // QT_H
  44.  
  45. #ifndef QT_NO_GROUPBOX
  46.  
  47.  
  48. class QAccel;
  49. class QGroupBoxPrivate;
  50. class QVBoxLayout;
  51. class QGridLayout;
  52. class QSpacerItem;
  53.  
  54. class Q_EXPORT QGroupBox : public QFrame
  55. {
  56.     Q_OBJECT
  57.     Q_PROPERTY( QString title READ title WRITE setTitle )
  58.     Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment )
  59.     Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation DESIGNABLE false )
  60.     Q_PROPERTY( int columns READ columns WRITE setColumns DESIGNABLE false )
  61.     
  62. public:
  63.     QGroupBox( QWidget* parent=0, const char* name=0 );
  64.     QGroupBox( const QString &title,
  65.            QWidget* parent=0, const char* name=0 );
  66.     QGroupBox( int columns, Orientation o,
  67.            QWidget* parent=0, const char* name=0 );
  68.     QGroupBox( int columns, Orientation o, const QString &title,
  69.            QWidget* parent=0, const char* name=0 );
  70.  
  71.     virtual void setColumnLayout(int columns, Orientation o);
  72.  
  73.     QString title() const { return str; }
  74.     virtual void setTitle( const QString &);
  75.  
  76.     int alignment() const { return align; }
  77.     virtual void setAlignment( int );
  78.  
  79.     int columns() const;
  80.     void setColumns( int );
  81.  
  82.     Orientation orientation() const { return dir; }
  83.     void setOrientation( Orientation );
  84.  
  85.     int insideMargin() const;
  86.     int insideSpacing() const;
  87.     void setInsideMargin( int m );
  88.     void setInsideSpacing( int s );
  89.  
  90.     void addSpace( int );
  91.     QSize sizeHint() const;
  92.  
  93. protected:
  94.     bool event( QEvent * );
  95.     void childEvent( QChildEvent * );
  96.     void resizeEvent( QResizeEvent * );
  97.     void paintEvent( QPaintEvent * );
  98.     void focusInEvent( QFocusEvent * );
  99.     void fontChange( const QFont & );
  100.  
  101. private slots:
  102.     void fixFocus();
  103.  
  104. private:
  105.     void skip();
  106.     void init();
  107.     void calculateFrame();
  108.     void insertWid( QWidget* );
  109.     void setTextSpacer();
  110.  
  111.     QString str;
  112.     int align;
  113.     int lenvisible;
  114. #ifndef QT_NO_ACCEL
  115.     QAccel * accel;
  116. #endif
  117.     QGroupBoxPrivate * d;
  118.  
  119.     QVBoxLayout *vbox;
  120.     QGridLayout *grid;
  121.     int row;
  122.     int col;
  123.     int nRows, nCols;
  124.     Orientation dir;
  125.     int spac, marg;
  126.  
  127. private:    // Disabled copy constructor and operator=
  128. #if defined(Q_DISABLE_COPY)
  129.     QGroupBox( const QGroupBox & );
  130.     QGroupBox &operator=( const QGroupBox & );
  131. #endif
  132. };
  133.  
  134.  
  135. #endif // QT_NO_GROUPBOX
  136.  
  137. #endif // QGROUPBOX_H
  138.