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