00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FX4SPLITTER_H
00022 #define FX4SPLITTER_H
00023
00024 #ifndef FXCOMPOSITE_H
00025 #include "FXComposite.h"
00026 #endif
00027
00028 namespace FX {
00029
00030
00031 enum {
00032 FOURSPLITTER_TRACKING = 0x00008000,
00033 FOURSPLITTER_NORMAL = 0
00034 };
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 class FXAPI FX4Splitter : public FXComposite {
00053 FXDECLARE(FX4Splitter)
00054 private:
00055 FXint splitx;
00056 FXint splity;
00057 FXint barsize;
00058 FXint fhor;
00059 FXint fver;
00060 FXint offx;
00061 FXint offy;
00062 FXuchar mode;
00063 protected:
00064 FX4Splitter();
00065 FXuchar getMode(FXint x,FXint y);
00066 void moveSplit(FXint x,FXint y);
00067 void drawSplit(FXint x,FXint y,FXuint m);
00068 void adjustLayout();
00069 private:
00070 FX4Splitter(const FX4Splitter&);
00071 FX4Splitter &operator=(const FX4Splitter&);
00072 public:
00073 long onLeftBtnPress(FXObject*,FXSelector,void*);
00074 long onLeftBtnRelease(FXObject*,FXSelector,void*);
00075 long onMotion(FXObject*,FXSelector,void*);
00076 long onFocusUp(FXObject*,FXSelector,void*);
00077 long onFocusDown(FXObject*,FXSelector,void*);
00078 long onFocusLeft(FXObject*,FXSelector,void*);
00079 long onFocusRight(FXObject*,FXSelector,void*);
00080 long onCmdExpand(FXObject*,FXSelector,void*);
00081 long onUpdExpand(FXObject*,FXSelector,void*);
00082 public:
00083 enum {
00084 ExpandNone = 0,
00085 ExpandTopLeft = 1,
00086 ExpandTopRight = 2,
00087 ExpandBottomLeft = 4,
00088 ExpandBottomRight = 8,
00089 ExpandTop = ExpandTopLeft|ExpandTopRight,
00090 ExpandBottom = ExpandBottomLeft|ExpandBottomRight,
00091 ExpandLeft = ExpandTopLeft|ExpandBottomLeft,
00092 ExpandRight = ExpandTopRight|ExpandBottomRight,
00093 ExpandAll = ExpandLeft|ExpandRight
00094 };
00095 public:
00096 enum {
00097 ID_EXPAND_NONE=FXComposite::ID_LAST+ExpandNone,
00098 ID_EXPAND_TOP=ID_EXPAND_NONE+ExpandTop,
00099 ID_EXPAND_BOTTOM=ID_EXPAND_NONE+ExpandBottom,
00100 ID_EXPAND_LEFT=ID_EXPAND_NONE+ExpandLeft,
00101 ID_EXPAND_RIGHT=ID_EXPAND_NONE+ExpandRight,
00102 ID_EXPAND_TOPLEFT=ID_EXPAND_NONE+ExpandTopLeft,
00103 ID_EXPAND_TOPRIGHT=ID_EXPAND_NONE+ExpandTopRight,
00104 ID_EXPAND_BOTTOMLEFT=ID_EXPAND_NONE+ExpandBottomLeft,
00105 ID_EXPAND_BOTTOMRIGHT=ID_EXPAND_NONE+ExpandBottomRight,
00106 ID_EXPAND_ALL=ID_EXPAND_NONE+ExpandAll,
00107 ID_LAST
00108 };
00109 public:
00110
00111
00112 FX4Splitter(FXComposite* p,FXuint opts=FOURSPLITTER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00113
00114
00115 FX4Splitter(FXComposite* p,FXObject* tgt,FXSelector sel,FXuint opts=FOURSPLITTER_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00116
00117
00118 FXWindow *getTopLeft() const;
00119
00120
00121 FXWindow *getTopRight() const;
00122
00123
00124 FXWindow *getBottomLeft() const;
00125
00126
00127 FXWindow *getBottomRight() const;
00128
00129
00130 FXint getHSplit() const { return fhor; }
00131
00132
00133 FXint getVSplit() const { return fver; }
00134
00135
00136 void setHSplit(FXint s);
00137
00138
00139 void setVSplit(FXint s);
00140
00141
00142 virtual void layout();
00143
00144
00145 virtual FXint getDefaultWidth();
00146
00147
00148 virtual FXint getDefaultHeight();
00149
00150
00151 FXuint getSplitterStyle() const;
00152
00153
00154 void setSplitterStyle(FXuint style);
00155
00156
00157 void setBarSize(FXint bs);
00158
00159
00160 FXint getBarSize() const { return barsize; }
00161
00162
00163 void setExpanded(FXuint set=FX4Splitter::ExpandAll);
00164
00165
00166 FXuint getExpanded() const;
00167
00168
00169 virtual void save(FXStream& store) const;
00170
00171
00172 virtual void load(FXStream& store);
00173 };
00174
00175 }
00176
00177 #endif