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 FXRULERVIEW_H
00025 #define FXRULERVIEW_H
00026
00027 #ifndef FXSCROLLAREA_H
00028 #include "FXScrollArea.h"
00029 #endif
00030
00031
00032 namespace FX {
00033
00034
00035 class FXRuler;
00036 class FXFrame;
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 class FXRulerView : public FXScrollArea {
00048 FXDECLARE(FXRulerView)
00049 protected:
00050 FXRuler *hruler;
00051 FXRuler *vruler;
00052 FXFrame *filler;
00053 FXColor docColor;
00054 FXString tip;
00055 FXString help;
00056 protected:
00057 FXRulerView();
00058 virtual void moveContents(FXint x,FXint y);
00059 virtual void drawBackground(FXDCWindow& dc);
00060 virtual void drawContents(FXDCWindow& dc);
00061 private:
00062 FXRulerView(const FXRulerView&);
00063 FXRulerView &operator=(const FXRulerView&);
00064 public:
00065 long onPaint(FXObject*,FXSelector,void*);
00066 long onMotion(FXObject*,FXSelector,void*);
00067 long onCmdSetHelp(FXObject*,FXSelector,void*);
00068 long onCmdGetHelp(FXObject*,FXSelector,void*);
00069 long onCmdSetTip(FXObject*,FXSelector,void*);
00070 long onCmdGetTip(FXObject*,FXSelector,void*);
00071 long onQueryHelp(FXObject*,FXSelector,void*);
00072 long onQueryTip(FXObject*,FXSelector,void*);
00073 long onDocChanged(FXObject*,FXSelector,void*);
00074 public:
00075 enum {
00076 ID_HRULER=FXScrollArea::ID_LAST,
00077 ID_VRULER,
00078 ID_LAST
00079 };
00080 public:
00081
00082
00083 FXRulerView(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00084
00085
00086 virtual FXint getViewportHeight();
00087
00088
00089 virtual FXint getViewportWidth();
00090
00091
00092 virtual FXint getContentWidth();
00093
00094
00095 virtual FXint getContentHeight();
00096
00097
00098 virtual void layout();
00099
00100
00101 FXRuler* horizontalRuler() const { return hruler; }
00102
00103
00104 FXRuler* verticalRuler() const { return vruler; }
00105
00106
00107 FXint getDocumentX() const;
00108
00109
00110 FXint getDocumentY() const;
00111
00112
00113 void setDocumentWidth(FXint w,FXbool notify=FALSE);
00114
00115
00116 FXint getDocumentWidth() const;
00117
00118
00119 void setDocumentHeight(FXint h,FXbool notify=FALSE);
00120
00121
00122 FXint getDocumentHeight() const;
00123
00124
00125 void setDocumentColor(FXColor clr);
00126
00127
00128 FXColor getDocumentColor() const { return docColor; }
00129
00130
00131 void setHEdgeSpacing(FXint es,FXbool notify=FALSE);
00132 void setVEdgeSpacing(FXint es,FXbool notify=FALSE);
00133
00134
00135 FXint getHEdgeSpacing() const;
00136 FXint getVEdgeSpacing() const;
00137
00138
00139 void setHMarginLower(FXint marg,FXbool notify=FALSE);
00140
00141
00142 void setHMarginUpper(FXint marg,FXbool notify=FALSE);
00143
00144
00145 FXint getHMarginLower() const;
00146
00147
00148 FXint getHMarginUpper() const;
00149
00150
00151 void setVMarginLower(FXint marg,FXbool notify=FALSE);
00152
00153
00154 void setVMarginUpper(FXint marg,FXbool notify=FALSE);
00155
00156
00157 FXint getVMarginLower() const;
00158
00159
00160 FXint getVMarginUpper() const;
00161
00162
00163 void setHAlignment(FXuint align,FXbool notify=FALSE);
00164
00165
00166 FXuint getHAlignment() const;
00167
00168
00169 void setVAlignment(FXuint align,FXbool notify=FALSE);
00170
00171
00172 FXuint getVAlignment() const;
00173
00174
00175 void setArrowPosX(FXint x);
00176
00177
00178 void setArrowPosY(FXint y);
00179
00180
00181 FXint getArrowPosX() const;
00182
00183
00184 FXint getArrowPosY() const;
00185
00186
00187 void setHRulerFont(FXFont *fnt,FXbool notify=FALSE);
00188
00189
00190 FXFont* getHRulerFont() const;
00191
00192
00193 void setVRulerFont(FXFont *fnt,FXbool notify=FALSE);
00194
00195
00196 FXFont* getVRulerFont() const;
00197
00198
00199 void setHNumberTicks(FXint ticks,FXbool notify=FALSE);
00200 void setVNumberTicks(FXint ticks,FXbool notify=FALSE);
00201
00202
00203 FXint getHNumberTicks() const;
00204 FXint getVNumberTicks() const;
00205
00206
00207 void setHMajorTicks(FXint ticks,FXbool notify=FALSE);
00208 void setVMajorTicks(FXint ticks,FXbool notify=FALSE);
00209
00210
00211 FXint getHMajorTicks() const;
00212 FXint getVMajorTicks() const;
00213
00214
00215 void setHMediumTicks(FXint ticks,FXbool notify=FALSE);
00216 void setVMediumTicks(FXint ticks,FXbool notify=FALSE);
00217
00218
00219 FXint getHMediumTicks() const;
00220 FXint getVMediumTicks() const;
00221
00222
00223 void setHTinyTicks(FXint ticks,FXbool notify=FALSE);
00224 void setVTinyTicks(FXint ticks,FXbool notify=FALSE);
00225
00226
00227 FXint getHTinyTicks() const;
00228 FXint getVTinyTicks() const;
00229
00230
00231 void setHPixelPerTick(FXdouble space,FXbool notify=FALSE);
00232 void setVPixelPerTick(FXdouble space,FXbool notify=FALSE);
00233
00234
00235 FXdouble getHPixelPerTick() const;
00236 FXdouble getVPixelPerTick() const;
00237
00238
00239 void setHRulerStyle(FXuint style);
00240 void setVRulerStyle(FXuint style);
00241
00242
00243 FXuint getHRulerStyle() const;
00244 FXuint getVRulerStyle() const;
00245
00246
00247 void setHelpText(const FXString& text){ help=text; }
00248
00249
00250 const FXString& getHelpText() const { return help; }
00251
00252
00253 void setTipText(const FXString& text){ tip=text; }
00254
00255
00256 const FXString& getTipText() const { return tip; }
00257
00258
00259 virtual void save(FXStream& store) const;
00260
00261
00262 virtual void load(FXStream& store);
00263
00264
00265 virtual ~FXRulerView();
00266 };
00267
00268 }
00269
00270 #endif