Diffstat (limited to 'microkde/KDGanttMinimizeSplitter.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.h | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h index 3042e0a..338d965 100644 --- a/microkde/KDGanttMinimizeSplitter.h +++ b/microkde/KDGanttMinimizeSplitter.h | |||
@@ -1,6 +1,13 @@ | |||
1 | //Added by qt3to4: | ||
2 | #include <Q3PointArray> | ||
3 | #include <QPaintEvent> | ||
4 | #include <QResizeEvent> | ||
5 | #include <QChildEvent> | ||
6 | #include <QMouseEvent> | ||
7 | #include <QEvent> | ||
1 | /* -*- Mode: C++ -*- | 8 | /* -*- Mode: C++ -*- |
2 | $Id$ | 9 | $Id$ |
3 | */ | 10 | */ |
4 | 11 | ||
5 | /**************************************************************************** | 12 | /**************************************************************************** |
6 | ** Copyright (C) 2001-2004 Klarälvdalens Datakonsult AB. All rights reserved. | 13 | ** Copyright (C) 2001-2004 Klarälvdalens Datakonsult AB. All rights reserved. |
@@ -32,38 +39,38 @@ | |||
32 | **********************************************************************/ | 39 | **********************************************************************/ |
33 | 40 | ||
34 | #ifndef KDGANTTMINIMIZESPLITTER_H | 41 | #ifndef KDGANTTMINIMIZESPLITTER_H |
35 | #define KDGANTTMINIMIZESPLITTER_H | 42 | #define KDGANTTMINIMIZESPLITTER_H |
36 | 43 | ||
37 | #ifndef QT_H | 44 | #ifndef QT_H |
38 | #include "qframe.h" | 45 | #include "q3frame.h" |
39 | #include "qvaluelist.h" | 46 | #include "q3valuelist.h" |
40 | #endif // QT_H | 47 | #endif // QT_H |
41 | 48 | ||
42 | #ifndef QT_NO_SPLITTER___ | 49 | #ifndef QT_NO_SPLITTER___ |
43 | class QSplitterData; | 50 | class QSplitterData; |
44 | class QSplitterLayoutStruct; | 51 | class QSplitterLayoutStruct; |
45 | class KDGanttSplitterHandle; | 52 | class KDGanttSplitterHandle; |
46 | class KDRubberBand; | 53 | class KDRubberBand; |
47 | class KDGanttMinimizeSplitter : public QFrame | 54 | class KDGanttMinimizeSplitter : public Q3Frame |
48 | { | 55 | { |
49 | Q_OBJECT | 56 | Q_OBJECT |
50 | // Q_ENUMS( Direction ) | 57 | // Q_ENUMS( Direction ) |
51 | // Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) | 58 | // Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) |
52 | // Q_PROPERTY( Direction minimizeDirection READ minimizeDirection WRITE setMinimizeDirection ) | 59 | // Q_PROPERTY( Direction minimizeDirection READ minimizeDirection WRITE setMinimizeDirection ) |
53 | 60 | ||
54 | public: | 61 | public: |
55 | enum ResizeMode { Stretch, KeepSize, FollowSizeHint }; | 62 | enum ResizeMode { Stretch, KeepSize, FollowSizeHint }; |
56 | enum Direction { Left, Right, Up, Down }; | 63 | enum Direction { Left, Right, Up, Down }; |
57 | 64 | ||
58 | KDGanttMinimizeSplitter( QWidget* parent=0, const char* name=0 ); | 65 | KDGanttMinimizeSplitter( QWidget* parent=0, const char* name=0 ); |
59 | KDGanttMinimizeSplitter( Orientation, QWidget* parent=0, const char* name=0 ); | 66 | KDGanttMinimizeSplitter( Qt::Orientation, QWidget* parent=0, const char* name=0 ); |
60 | ~KDGanttMinimizeSplitter(); | 67 | ~KDGanttMinimizeSplitter(); |
61 | 68 | ||
62 | virtual void setOrientation( Orientation ); | 69 | virtual void setOrientation( Qt::Orientation ); |
63 | Orientation orientation() const { return orient; } | 70 | Qt::Orientation orientation() const { return orient; } |
64 | 71 | ||
65 | void setMinimizeDirection( Direction ); | 72 | void setMinimizeDirection( Direction ); |
66 | Direction minimizeDirection() const; | 73 | Direction minimizeDirection() const; |
67 | 74 | ||
68 | #if QT_VERSION >= 232 | 75 | #if QT_VERSION >= 232 |
69 | virtual void setResizeMode( QWidget *w, ResizeMode ); | 76 | virtual void setResizeMode( QWidget *w, ResizeMode ); |
@@ -74,14 +81,14 @@ public: | |||
74 | void moveToLast( QWidget * ); | 81 | void moveToLast( QWidget * ); |
75 | 82 | ||
76 | void refresh() { recalc( TRUE ); } | 83 | void refresh() { recalc( TRUE ); } |
77 | QSize sizeHint() const; | 84 | QSize sizeHint() const; |
78 | QSize minimumSizeHint() const; | 85 | QSize minimumSizeHint() const; |
79 | 86 | ||
80 | QValueList<int> sizes() const; | 87 | Q3ValueList<int> sizes() const; |
81 | void setSizes( QValueList<int> ); | 88 | void setSizes( Q3ValueList<int> ); |
82 | KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} | 89 | KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} |
83 | void expandPos( int id, int* min, int* max ); | 90 | void expandPos( int id, int* min, int* max ); |
84 | KDRubberBand* rubberBand() { return mRubberBand ;} | 91 | KDRubberBand* rubberBand() { return mRubberBand ;} |
85 | public slots: | 92 | public slots: |
86 | void toggle(); | 93 | void toggle(); |
87 | protected: | 94 | protected: |
@@ -111,26 +118,26 @@ private: | |||
111 | void recalcId(); | 118 | void recalcId(); |
112 | void moveBefore( int pos, int id, bool upLeft ); | 119 | void moveBefore( int pos, int id, bool upLeft ); |
113 | void moveAfter( int pos, int id, bool upLeft ); | 120 | void moveAfter( int pos, int id, bool upLeft ); |
114 | void setG( QWidget *w, int p, int s, bool isSplitter = FALSE ); | 121 | void setG( QWidget *w, int p, int s, bool isSplitter = FALSE ); |
115 | 122 | ||
116 | QCOORD pick( const QPoint &p ) const | 123 | QCOORD pick( const QPoint &p ) const |
117 | { return orient == Horizontal ? p.x() : p.y(); } | 124 | { return orient == Qt::Horizontal ? p.x() : p.y(); } |
118 | QCOORD pick( const QSize &s ) const | 125 | QCOORD pick( const QSize &s ) const |
119 | { return orient == Horizontal ? s.width() : s.height(); } | 126 | { return orient == Qt::Horizontal ? s.width() : s.height(); } |
120 | 127 | ||
121 | QCOORD trans( const QPoint &p ) const | 128 | QCOORD trans( const QPoint &p ) const |
122 | { return orient == Vertical ? p.x() : p.y(); } | 129 | { return orient == Qt::Vertical ? p.x() : p.y(); } |
123 | QCOORD trans( const QSize &s ) const | 130 | QCOORD trans( const QSize &s ) const |
124 | { return orient == Vertical ? s.width() : s.height(); } | 131 | { return orient == Qt::Vertical ? s.width() : s.height(); } |
125 | KDGanttSplitterHandle* mFirstHandle; | 132 | KDGanttSplitterHandle* mFirstHandle; |
126 | QSplitterData *data; | 133 | QSplitterData *data; |
127 | #endif | 134 | #endif |
128 | 135 | ||
129 | private: | 136 | private: |
130 | Orientation orient; | 137 | Qt::Orientation orient; |
131 | Direction _direction; | 138 | Direction _direction; |
132 | #ifndef DOXYGEN_SKIP_INTERNAL | 139 | #ifndef DOXYGEN_SKIP_INTERNAL |
133 | friend class KDGanttSplitterHandle; | 140 | friend class KDGanttSplitterHandle; |
134 | #endif | 141 | #endif |
135 | private:// Disabled copy constructor and operator= | 142 | private:// Disabled copy constructor and operator= |
136 | #if defined(Q_DISABLE_COPY) | 143 | #if defined(Q_DISABLE_COPY) |
@@ -160,13 +167,13 @@ public: | |||
160 | void toggle(); | 167 | void toggle(); |
161 | 168 | ||
162 | int id() const { return myId; } // data->list.at(id())->wid == this | 169 | int id() const { return myId; } // data->list.at(id())->wid == this |
163 | void setId( int i ) { myId = i; } | 170 | void setId( int i ) { myId = i; } |
164 | 171 | ||
165 | protected: | 172 | protected: |
166 | QValueList<QPointArray> buttonRegions(); | 173 | Q3ValueList<Q3PointArray> buttonRegions(); |
167 | void paintEvent( QPaintEvent * ); | 174 | void paintEvent( QPaintEvent * ); |
168 | void mouseMoveEvent( QMouseEvent * ); | 175 | void mouseMoveEvent( QMouseEvent * ); |
169 | void mousePressEvent( QMouseEvent * ); | 176 | void mousePressEvent( QMouseEvent * ); |
170 | void mouseReleaseEvent( QMouseEvent * ); | 177 | void mouseReleaseEvent( QMouseEvent * ); |
171 | int onButton( const QPoint& p ); | 178 | int onButton( const QPoint& p ); |
172 | void updateCursor( const QPoint& p ); | 179 | void updateCursor( const QPoint& p ); |