FXRulerView.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         R u l e r V i e w   W i d g e t                       *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2005,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXRulerView.h,v 1.15 2006/01/28 20:29:30 fox Exp $                       *
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 
00047 class FXRulerView : public FXScrollArea {
00048   FXDECLARE(FXRulerView)
00049 protected:
00050   FXRuler *hruler;      // Horizontal ruler
00051   FXRuler *vruler;      // Vertical ruler
00052   FXFrame *filler;      // Corner thingy
00053   FXColor  docColor;    // Color of document
00054   FXString tip;         // Tooltip text
00055   FXString help;        // Help text
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 
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 
00086   virtual FXint getViewportHeight();
00087 
00089   virtual FXint getViewportWidth();
00090 
00092   virtual FXint getContentWidth();
00093 
00095   virtual FXint getContentHeight();
00096 
00098   virtual void layout();
00099 
00101   FXRuler* horizontalRuler() const { return hruler; }
00102 
00104   FXRuler* verticalRuler() const { return vruler; }
00105 
00107   FXint getDocumentX() const;
00108 
00110   FXint getDocumentY() const;
00111 
00113   void setDocumentWidth(FXint w,FXbool notify=FALSE);
00114 
00116   FXint getDocumentWidth() const;
00117 
00119   void setDocumentHeight(FXint h,FXbool notify=FALSE);
00120 
00122   FXint getDocumentHeight() const;
00123 
00125   void setDocumentColor(FXColor clr);
00126 
00128   FXColor getDocumentColor() const { return docColor; }
00129 
00131   void setHEdgeSpacing(FXint es,FXbool notify=FALSE);
00132   void setVEdgeSpacing(FXint es,FXbool notify=FALSE);
00133 
00135   FXint getHEdgeSpacing() const;
00136   FXint getVEdgeSpacing() const;
00137 
00139   void setHMarginLower(FXint marg,FXbool notify=FALSE);
00140 
00142   void setHMarginUpper(FXint marg,FXbool notify=FALSE);
00143 
00145   FXint getHMarginLower() const;
00146 
00148   FXint getHMarginUpper() const;
00149 
00151   void setVMarginLower(FXint marg,FXbool notify=FALSE);
00152 
00154   void setVMarginUpper(FXint marg,FXbool notify=FALSE);
00155 
00157   FXint getVMarginLower() const;
00158 
00160   FXint getVMarginUpper() const;
00161 
00163   void setHAlignment(FXuint align,FXbool notify=FALSE);
00164 
00166   FXuint getHAlignment() const;
00167 
00169   void setVAlignment(FXuint align,FXbool notify=FALSE);
00170 
00172   FXuint getVAlignment() const;
00173 
00175   void setArrowPosX(FXint x);
00176 
00178   void setArrowPosY(FXint y);
00179 
00181   FXint getArrowPosX() const;
00182 
00184   FXint getArrowPosY() const;
00185 
00187   void setHRulerFont(FXFont *fnt,FXbool notify=FALSE);
00188 
00190   FXFont* getHRulerFont() const;
00191 
00193   void setVRulerFont(FXFont *fnt,FXbool notify=FALSE);
00194 
00196   FXFont* getVRulerFont() const;
00197 
00199   void setHNumberTicks(FXint ticks,FXbool notify=FALSE);
00200   void setVNumberTicks(FXint ticks,FXbool notify=FALSE);
00201 
00203   FXint getHNumberTicks() const;
00204   FXint getVNumberTicks() const;
00205 
00207   void setHMajorTicks(FXint ticks,FXbool notify=FALSE);
00208   void setVMajorTicks(FXint ticks,FXbool notify=FALSE);
00209 
00211   FXint getHMajorTicks() const;
00212   FXint getVMajorTicks() const;
00213 
00215   void setHMediumTicks(FXint ticks,FXbool notify=FALSE);
00216   void setVMediumTicks(FXint ticks,FXbool notify=FALSE);
00217 
00219   FXint getHMediumTicks() const;
00220   FXint getVMediumTicks() const;
00221 
00223   void setHTinyTicks(FXint ticks,FXbool notify=FALSE);
00224   void setVTinyTicks(FXint ticks,FXbool notify=FALSE);
00225 
00227   FXint getHTinyTicks() const;
00228   FXint getVTinyTicks() const;
00229 
00231   void setHPixelPerTick(FXdouble space,FXbool notify=FALSE);
00232   void setVPixelPerTick(FXdouble space,FXbool notify=FALSE);
00233 
00235   FXdouble getHPixelPerTick() const;
00236   FXdouble getVPixelPerTick() const;
00237 
00239   void setHRulerStyle(FXuint style);
00240   void setVRulerStyle(FXuint style);
00241 
00243   FXuint getHRulerStyle() const;
00244   FXuint getVRulerStyle() const;
00245 
00247   void setHelpText(const FXString& text){ help=text; }
00248 
00250   const FXString& getHelpText() const { return help; }
00251 
00253   void setTipText(const FXString& text){ tip=text; }
00254 
00256   const FXString& getTipText() const { return tip; }
00257 
00259   virtual void save(FXStream& store) const;
00260 
00262   virtual void load(FXStream& store);
00263 
00265   virtual ~FXRulerView();
00266   };
00267 
00268 }
00269 
00270 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:24 2009 for TnFOX by doxygen v1.4.7