kexi
ksplitter.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KDOCKWIDGET_PRIVATE_H
00025 #define KDOCKWIDGET_PRIVATE_H
00026
00027 #include <qwidget.h>
00028 #include <qpushbutton.h>
00029
00030 #include <kdeversion.h>
00031
00032 #ifndef NO_KDE2
00033 #include <netwm_def.h>
00034 #endif
00035
00036 class QFrame;
00037 class KDockContainer;
00038 class KDockWidget;
00039
00040
00047 class KDockSplitter : public QWidget
00048 {
00049
00050 public:
00058 KDockSplitter(QWidget *parent= 0, const char *name= 0, Orientation orient= Vertical, int pos= 50);
00059 virtual ~KDockSplitter(){};
00060
00069 void activate(QWidget *c0, QWidget *c1 = 0L);
00073 void deactivate();
00074
00079 int separatorPosInPercent()
00080 #if KDE_IS_VERSION(3,4,89)
00081 ;
00082 #else
00083 {
00084
00085 return separatorPos() / 100;
00086 }
00087 #endif
00088
00092 void setSeparatorPosInPercent(int percent)
00093 #if KDE_IS_VERSION(3,4,89)
00094 ;
00095 #else
00096 {
00097
00098 setSeparatorPos( percent * 100, false );
00099 }
00100 #endif
00101
00110 int separatorPos() const;
00116 void setSeparatorPos(int pos, bool do_resize = true);
00125
00126 void setSeparatorPosX(int pos, bool do_resize=false);
00127
00132 virtual bool eventFilter(QObject *, QEvent *);
00133 virtual bool event( QEvent * );
00134
00138 QWidget* getFirst() const { return child0; }
00142 QWidget* getLast() const { return child1; }
00147 QWidget* getAnother( QWidget* w ) const;
00148 void updateName();
00149
00155 void setOpaqueResize(bool b=true);
00156 bool opaqueResize() const;
00157
00162 void setKeepSize(bool b=true);
00163 bool keepSize() const;
00164
00165
00166 void setForcedFixedWidth(KDockWidget *dw,int w);
00167 void setForcedFixedHeight(KDockWidget *dw,int h);
00168 void restoreFromForcedFixedSize(KDockWidget *dw);
00169
00173 Orientation orientation(){return m_orientation;}
00174
00175 protected:
00176 friend class KDockContainer;
00182 int checkValue(int position) const;
00190 int checkValueOverlapped(int position, QWidget* child) const;
00191
00206 virtual void resizeEvent(QResizeEvent *ev);
00207
00208
00209
00210
00211
00212 private:
00218 void setupMinMaxSize();
00224 QWidget *child0, *child1;
00225 Orientation m_orientation;
00229 bool initialised;
00234 QFrame* divider;
00245 int xpos, savedXPos;
00246 bool mOpaqueResize, mKeepSize;
00247 int fixedWidth0,fixedWidth1;
00248 int fixedHeight0,fixedHeight1;
00249 bool m_dontRecalc;
00253 static const int factor = 100000;
00254 };
00255
00256 #endif
|