Diffstat (limited to 'microkde/KDGanttMinimizeSplitter.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h index 585298d..3042e0a 100644 --- a/microkde/KDGanttMinimizeSplitter.h +++ b/microkde/KDGanttMinimizeSplitter.h | |||
@@ -22,106 +22,107 @@ | |||
22 | ** See http://www.klaralvdalens-datakonsult.se/Public/products/ for | 22 | ** See http://www.klaralvdalens-datakonsult.se/Public/products/ for |
23 | ** information about KDGantt Commercial License Agreements. | 23 | ** information about KDGantt Commercial License Agreements. |
24 | ** | 24 | ** |
25 | ** Contact info@klaralvdalens-datakonsult.se if any conditions of this | 25 | ** Contact info@klaralvdalens-datakonsult.se if any conditions of this |
26 | ** licensing are not clear to you. | 26 | ** licensing are not clear to you. |
27 | ** | 27 | ** |
28 | ** As a special exception, permission is given to link this program | 28 | ** As a special exception, permission is given to link this program |
29 | ** with any edition of Qt, and distribute the resulting executable, | 29 | ** with any edition of Qt, and distribute the resulting executable, |
30 | ** without including the source code for Qt in the source distribution. | 30 | ** without including the source code for Qt in the source distribution. |
31 | ** | 31 | ** |
32 | **********************************************************************/ | 32 | **********************************************************************/ |
33 | 33 | ||
34 | #ifndef KDGANTTMINIMIZESPLITTER_H | 34 | #ifndef KDGANTTMINIMIZESPLITTER_H |
35 | #define KDGANTTMINIMIZESPLITTER_H | 35 | #define KDGANTTMINIMIZESPLITTER_H |
36 | 36 | ||
37 | #ifndef QT_H | 37 | #ifndef QT_H |
38 | #include "qframe.h" | 38 | #include "qframe.h" |
39 | #include "qvaluelist.h" | 39 | #include "qvaluelist.h" |
40 | #endif // QT_H | 40 | #endif // QT_H |
41 | 41 | ||
42 | #ifndef QT_NO_SPLITTER___ | 42 | #ifndef QT_NO_SPLITTER___ |
43 | class QSplitterData; | 43 | class QSplitterData; |
44 | class QSplitterLayoutStruct; | 44 | class QSplitterLayoutStruct; |
45 | class KDGanttSplitterHandle; | 45 | class KDGanttSplitterHandle; |
46 | class KDRubberBand; | ||
46 | class KDGanttMinimizeSplitter : public QFrame | 47 | class KDGanttMinimizeSplitter : public QFrame |
47 | { | 48 | { |
48 | Q_OBJECT | 49 | Q_OBJECT |
49 | // Q_ENUMS( Direction ) | 50 | // Q_ENUMS( Direction ) |
50 | // Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) | 51 | // Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) |
51 | // Q_PROPERTY( Direction minimizeDirection READ minimizeDirection WRITE setMinimizeDirection ) | 52 | // Q_PROPERTY( Direction minimizeDirection READ minimizeDirection WRITE setMinimizeDirection ) |
52 | 53 | ||
53 | public: | 54 | public: |
54 | enum ResizeMode { Stretch, KeepSize, FollowSizeHint }; | 55 | enum ResizeMode { Stretch, KeepSize, FollowSizeHint }; |
55 | enum Direction { Left, Right, Up, Down }; | 56 | enum Direction { Left, Right, Up, Down }; |
56 | 57 | ||
57 | KDGanttMinimizeSplitter( QWidget* parent=0, const char* name=0 ); | 58 | KDGanttMinimizeSplitter( QWidget* parent=0, const char* name=0 ); |
58 | KDGanttMinimizeSplitter( Orientation, QWidget* parent=0, const char* name=0 ); | 59 | KDGanttMinimizeSplitter( Orientation, QWidget* parent=0, const char* name=0 ); |
59 | ~KDGanttMinimizeSplitter(); | 60 | ~KDGanttMinimizeSplitter(); |
60 | 61 | ||
61 | virtual void setOrientation( Orientation ); | 62 | virtual void setOrientation( Orientation ); |
62 | Orientation orientation() const { return orient; } | 63 | Orientation orientation() const { return orient; } |
63 | 64 | ||
64 | void setMinimizeDirection( Direction ); | 65 | void setMinimizeDirection( Direction ); |
65 | Direction minimizeDirection() const; | 66 | Direction minimizeDirection() const; |
66 | 67 | ||
67 | #if QT_VERSION >= 232 | 68 | #if QT_VERSION >= 232 |
68 | virtual void setResizeMode( QWidget *w, ResizeMode ); | 69 | virtual void setResizeMode( QWidget *w, ResizeMode ); |
69 | virtual void setOpaqueResize( bool = TRUE ); | 70 | virtual void setOpaqueResize( bool = TRUE ); |
70 | bool opaqueResize() const; | 71 | bool opaqueResize() const; |
71 | 72 | ||
72 | void moveToFirst( QWidget * ); | 73 | void moveToFirst( QWidget * ); |
73 | void moveToLast( QWidget * ); | 74 | void moveToLast( QWidget * ); |
74 | 75 | ||
75 | void refresh() { recalc( TRUE ); } | 76 | void refresh() { recalc( TRUE ); } |
76 | QSize sizeHint() const; | 77 | QSize sizeHint() const; |
77 | QSize minimumSizeHint() const; | 78 | QSize minimumSizeHint() const; |
78 | 79 | ||
79 | QValueList<int> sizes() const; | 80 | QValueList<int> sizes() const; |
80 | void setSizes( QValueList<int> ); | 81 | void setSizes( QValueList<int> ); |
81 | KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} | 82 | KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} |
82 | void expandPos( int id, int* min, int* max ); | 83 | void expandPos( int id, int* min, int* max ); |
83 | QFrame* rubberBand() { return mRubberBand ;} | 84 | KDRubberBand* rubberBand() { return mRubberBand ;} |
84 | public slots: | 85 | public slots: |
85 | void toggle(); | 86 | void toggle(); |
86 | protected: | 87 | protected: |
87 | void childEvent( QChildEvent * ); | 88 | void childEvent( QChildEvent * ); |
88 | 89 | ||
89 | bool event( QEvent * ); | 90 | bool event( QEvent * ); |
90 | void resizeEvent( QResizeEvent * ); | 91 | void resizeEvent( QResizeEvent * ); |
91 | 92 | ||
92 | int idAfter( QWidget* ) const; | 93 | int idAfter( QWidget* ) const; |
93 | 94 | ||
94 | void moveSplitter( QCOORD pos, int id ); | 95 | void moveSplitter( QCOORD pos, int id ); |
95 | virtual void drawSplitter( QPainter*, QCOORD x, QCOORD y, | 96 | virtual void drawSplitter( QPainter*, QCOORD x, QCOORD y, |
96 | QCOORD w, QCOORD h ); | 97 | QCOORD w, QCOORD h ); |
97 | void styleChange( QStyle& ); | 98 | void styleChange( QStyle& ); |
98 | int adjustPos( int , int ); | 99 | int adjustPos( int , int ); |
99 | virtual void setRubberband( int ); | 100 | virtual void setRubberband( int ); |
100 | void getRange( int id, int*, int* ); | 101 | void getRange( int id, int*, int* ); |
101 | 102 | ||
102 | private: | 103 | private: |
103 | QFrame* mRubberBand; | 104 | KDRubberBand* mRubberBand; |
104 | void init(); | 105 | void init(); |
105 | void recalc( bool update = FALSE ); | 106 | void recalc( bool update = FALSE ); |
106 | void doResize(); | 107 | void doResize(); |
107 | void storeSizes(); | 108 | void storeSizes(); |
108 | void processChildEvents(); | 109 | void processChildEvents(); |
109 | QSplitterLayoutStruct *addWidget( QWidget*, bool first = FALSE ); | 110 | QSplitterLayoutStruct *addWidget( QWidget*, bool first = FALSE ); |
110 | void recalcId(); | 111 | void recalcId(); |
111 | void moveBefore( int pos, int id, bool upLeft ); | 112 | void moveBefore( int pos, int id, bool upLeft ); |
112 | void moveAfter( int pos, int id, bool upLeft ); | 113 | void moveAfter( int pos, int id, bool upLeft ); |
113 | void setG( QWidget *w, int p, int s, bool isSplitter = FALSE ); | 114 | void setG( QWidget *w, int p, int s, bool isSplitter = FALSE ); |
114 | 115 | ||
115 | QCOORD pick( const QPoint &p ) const | 116 | QCOORD pick( const QPoint &p ) const |
116 | { return orient == Horizontal ? p.x() : p.y(); } | 117 | { return orient == Horizontal ? p.x() : p.y(); } |
117 | QCOORD pick( const QSize &s ) const | 118 | QCOORD pick( const QSize &s ) const |
118 | { return orient == Horizontal ? s.width() : s.height(); } | 119 | { return orient == Horizontal ? s.width() : s.height(); } |
119 | 120 | ||
120 | QCOORD trans( const QPoint &p ) const | 121 | QCOORD trans( const QPoint &p ) const |
121 | { return orient == Vertical ? p.x() : p.y(); } | 122 | { return orient == Vertical ? p.x() : p.y(); } |
122 | QCOORD trans( const QSize &s ) const | 123 | QCOORD trans( const QSize &s ) const |
123 | { return orient == Vertical ? s.width() : s.height(); } | 124 | { return orient == Vertical ? s.width() : s.height(); } |
124 | KDGanttSplitterHandle* mFirstHandle; | 125 | KDGanttSplitterHandle* mFirstHandle; |
125 | QSplitterData *data; | 126 | QSplitterData *data; |
126 | #endif | 127 | #endif |
127 | 128 | ||