00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FXRULERVIEW_H
00022 #define FXRULERVIEW_H
00023
00024 #ifndef FXSCROLLAREA_H
00025 #include "FXScrollArea.h"
00026 #endif
00027
00028
00029 namespace FX {
00030
00031
00032 class FXRuler;
00033 class FXFrame;
00034
00035
00044 class FXAPI FXRulerView : public FXScrollArea {
00045 FXDECLARE(FXRulerView)
00046 protected:
00047 FXRuler *hruler;
00048 FXRuler *vruler;
00049 FXFrame *filler;
00050 FXColor docColor;
00051 FXString tip;
00052 FXString help;
00053 protected:
00054 FXRulerView();
00055 virtual void moveContents(FXint x,FXint y);
00056 virtual void drawBackground(FXDCWindow& dc);
00057 virtual void drawContents(FXDCWindow& dc);
00058 private:
00059 FXRulerView(const FXRulerView&);
00060 FXRulerView &operator=(const FXRulerView&);
00061 public:
00062 long onPaint(FXObject*,FXSelector,void*);
00063 long onMotion(FXObject*,FXSelector,void*);
00064 long onCmdSetHelp(FXObject*,FXSelector,void*);
00065 long onCmdGetHelp(FXObject*,FXSelector,void*);
00066 long onCmdSetTip(FXObject*,FXSelector,void*);
00067 long onCmdGetTip(FXObject*,FXSelector,void*);
00068 long onQueryHelp(FXObject*,FXSelector,void*);
00069 long onQueryTip(FXObject*,FXSelector,void*);
00070 long onDocChanged(FXObject*,FXSelector,void*);
00071 public:
00072 enum {
00073 ID_HRULER=FXScrollArea::ID_LAST,
00074 ID_VRULER,
00075 ID_LAST
00076 };
00077 public:
00078
00080 FXRulerView(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00081
00083 virtual FXint getDefaultWidth();
00084
00086 virtual FXint getDefaultHeight();
00087
00089 virtual FXint getVisibleX() const;
00090
00092 virtual FXint getVisibleY() const;
00093
00095 virtual FXint getVisibleWidth() const;
00096
00098 virtual FXint getVisibleHeight() const;
00099
00101 virtual FXint getContentWidth();
00102
00104 virtual FXint getContentHeight();
00105
00107 virtual void layout();
00108
00110 FXRuler* horizontalRuler() const { return hruler; }
00111
00113 FXRuler* verticalRuler() const { return vruler; }
00114
00116 FXint getDocumentX() const;
00117
00119 FXint getDocumentY() const;
00120
00122 void setDocumentWidth(FXint w,FXbool notify=false);
00123
00125 FXint getDocumentWidth() const;
00126
00128 void setDocumentHeight(FXint h,FXbool notify=false);
00129
00131 FXint getDocumentHeight() const;
00132
00134 void setDocumentColor(FXColor clr);
00135
00137 FXColor getDocumentColor() const { return docColor; }
00138
00140 void setHEdgeSpacing(FXint es,FXbool notify=false);
00141 void setVEdgeSpacing(FXint es,FXbool notify=false);
00142
00144 FXint getHEdgeSpacing() const;
00145 FXint getVEdgeSpacing() const;
00146
00148 void setHMarginLower(FXint marg,FXbool notify=false);
00149
00151 void setHMarginUpper(FXint marg,FXbool notify=false);
00152
00154 FXint getHMarginLower() const;
00155
00157 FXint getHMarginUpper() const;
00158
00160 void setVMarginLower(FXint marg,FXbool notify=false);
00161
00163 void setVMarginUpper(FXint marg,FXbool notify=false);
00164
00166 FXint getVMarginLower() const;
00167
00169 FXint getVMarginUpper() const;
00170
00172 void setHAlignment(FXuint align,FXbool notify=false);
00173
00175 FXuint getHAlignment() const;
00176
00178 void setVAlignment(FXuint align,FXbool notify=false);
00179
00181 FXuint getVAlignment() const;
00182
00184 void setArrowPosX(FXint x);
00185
00187 void setArrowPosY(FXint y);
00188
00190 FXint getArrowPosX() const;
00191
00193 FXint getArrowPosY() const;
00194
00196 void setHRulerFont(FXFont *fnt,FXbool notify=false);
00197
00199 FXFont* getHRulerFont() const;
00200
00202 void setVRulerFont(FXFont *fnt,FXbool notify=false);
00203
00205 FXFont* getVRulerFont() const;
00206
00208 void setHNumberTicks(FXint ticks,FXbool notify=false);
00209 void setVNumberTicks(FXint ticks,FXbool notify=false);
00210
00212 FXint getHNumberTicks() const;
00213 FXint getVNumberTicks() const;
00214
00216 void setHMajorTicks(FXint ticks,FXbool notify=false);
00217 void setVMajorTicks(FXint ticks,FXbool notify=false);
00218
00220 FXint getHMajorTicks() const;
00221 FXint getVMajorTicks() const;
00222
00224 void setHMediumTicks(FXint ticks,FXbool notify=false);
00225 void setVMediumTicks(FXint ticks,FXbool notify=false);
00226
00228 FXint getHMediumTicks() const;
00229 FXint getVMediumTicks() const;
00230
00232 void setHTinyTicks(FXint ticks,FXbool notify=false);
00233 void setVTinyTicks(FXint ticks,FXbool notify=false);
00234
00236 FXint getHTinyTicks() const;
00237 FXint getVTinyTicks() const;
00238
00240 void setHPixelPerTick(FXdouble space,FXbool notify=false);
00241 void setVPixelPerTick(FXdouble space,FXbool notify=false);
00242
00244 FXdouble getHPixelPerTick() const;
00245 FXdouble getVPixelPerTick() const;
00246
00248 void setHRulerStyle(FXuint style);
00249 void setVRulerStyle(FXuint style);
00250
00252 FXuint getHRulerStyle() const;
00253 FXuint getVRulerStyle() const;
00254
00256 void setHelpText(const FXString& text){ help=text; }
00257
00259 const FXString& getHelpText() const { return help; }
00260
00262 void setTipText(const FXString& text){ tip=text; }
00263
00265 const FXString& getTipText() const { return tip; }
00266
00268 virtual void save(FXStream& store) const;
00269
00271 virtual void load(FXStream& store);
00272
00274 virtual ~FXRulerView();
00275 };
00276
00277 }
00278
00279 #endif