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