Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXRulerView.h
1 /********************************************************************************
2 * *
3 * R u l e r V i e w W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2005,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXRULERVIEW_H
22 #define FXRULERVIEW_H
23 
24 #ifndef FXSCROLLAREA_H
25 #include "FXScrollArea.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXRuler;
32 class FXFrame;
33 
34 
43 class FXAPI FXRulerView : public FXScrollArea {
44  FXDECLARE(FXRulerView)
45 protected:
46  FXRuler *hruler; // Horizontal ruler
47  FXRuler *vruler; // Vertical ruler
48  FXFrame *filler; // Corner thingy
49  FXColor docColor; // Color of document
50  FXString tip; // Tooltip text
51  FXString help; // Help text
52 protected:
53  FXRulerView();
54  virtual void moveContents(FXint x,FXint y);
55  virtual void drawBackground(FXDCWindow& dc);
56  virtual void drawContents(FXDCWindow& dc);
57 private:
58  FXRulerView(const FXRulerView&);
59  FXRulerView &operator=(const FXRulerView&);
60 public:
61  long onPaint(FXObject*,FXSelector,void*);
62  long onMotion(FXObject*,FXSelector,void*);
63  long onCmdSetHelp(FXObject*,FXSelector,void*);
64  long onCmdGetHelp(FXObject*,FXSelector,void*);
65  long onCmdSetTip(FXObject*,FXSelector,void*);
66  long onCmdGetTip(FXObject*,FXSelector,void*);
67  long onQueryHelp(FXObject*,FXSelector,void*);
68  long onQueryTip(FXObject*,FXSelector,void*);
69  long onDocChanged(FXObject*,FXSelector,void*);
70 public:
71  enum {
72  ID_HRULER=FXScrollArea::ID_LAST,
73  ID_VRULER,
74  ID_LAST
75  };
76 public:
77 
79  FXRulerView(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
80 
82  virtual FXint getContentWidth();
83 
85  virtual FXint getContentHeight();
86 
88  virtual FXint getVisibleX() const;
89 
91  virtual FXint getVisibleY() const;
92 
94  virtual FXint getVisibleWidth() const;
95 
97  virtual FXint getVisibleHeight() const;
98 
100  virtual FXint getDefaultWidth();
101 
103  virtual FXint getDefaultHeight();
104 
106  virtual void layout();
107 
109  FXRuler* horizontalRuler() const { return hruler; }
110 
112  FXRuler* verticalRuler() const { return vruler; }
113 
115  FXint getDocumentX() const;
116 
118  FXint getDocumentY() const;
119 
121  void setDocumentWidth(FXint w,FXbool notify=false);
122 
124  FXint getDocumentWidth() const;
125 
127  void setDocumentHeight(FXint h,FXbool notify=false);
128 
130  FXint getDocumentHeight() const;
131 
133  void setDocumentColor(FXColor clr);
134 
136  FXColor getDocumentColor() const { return docColor; }
137 
139  void setHEdgeSpacing(FXint es,FXbool notify=false);
140  void setVEdgeSpacing(FXint es,FXbool notify=false);
141 
143  FXint getHEdgeSpacing() const;
144  FXint getVEdgeSpacing() const;
145 
147  void setHMarginLower(FXint marg,FXbool notify=false);
148 
150  void setHMarginUpper(FXint marg,FXbool notify=false);
151 
153  FXint getHMarginLower() const;
154 
156  FXint getHMarginUpper() const;
157 
159  void setVMarginLower(FXint marg,FXbool notify=false);
160 
162  void setVMarginUpper(FXint marg,FXbool notify=false);
163 
165  FXint getVMarginLower() const;
166 
168  FXint getVMarginUpper() const;
169 
171  void setHAlignment(FXuint align,FXbool notify=false);
172 
174  FXuint getHAlignment() const;
175 
177  void setVAlignment(FXuint align,FXbool notify=false);
178 
180  FXuint getVAlignment() const;
181 
183  void setArrowPosX(FXint x);
184 
186  void setArrowPosY(FXint y);
187 
189  FXint getArrowPosX() const;
190 
192  FXint getArrowPosY() const;
193 
195  void setHRulerFont(FXFont *fnt,FXbool notify=false);
196 
198  FXFont* getHRulerFont() const;
199 
201  void setVRulerFont(FXFont *fnt,FXbool notify=false);
202 
204  FXFont* getVRulerFont() const;
205 
207  void setHNumberTicks(FXint ticks,FXbool notify=false);
208  void setVNumberTicks(FXint ticks,FXbool notify=false);
209 
211  FXint getHNumberTicks() const;
212  FXint getVNumberTicks() const;
213 
215  void setHMajorTicks(FXint ticks,FXbool notify=false);
216  void setVMajorTicks(FXint ticks,FXbool notify=false);
217 
219  FXint getHMajorTicks() const;
220  FXint getVMajorTicks() const;
221 
223  void setHMediumTicks(FXint ticks,FXbool notify=false);
224  void setVMediumTicks(FXint ticks,FXbool notify=false);
225 
227  FXint getHMediumTicks() const;
228  FXint getVMediumTicks() const;
229 
231  void setHTinyTicks(FXint ticks,FXbool notify=false);
232  void setVTinyTicks(FXint ticks,FXbool notify=false);
233 
235  FXint getHTinyTicks() const;
236  FXint getVTinyTicks() const;
237 
239  void setHPixelPerTick(FXdouble space,FXbool notify=false);
240  void setVPixelPerTick(FXdouble space,FXbool notify=false);
241 
243  FXdouble getHPixelPerTick() const;
244  FXdouble getVPixelPerTick() const;
245 
247  void setHRulerStyle(FXuint style);
248  void setVRulerStyle(FXuint style);
249 
251  FXuint getHRulerStyle() const;
252  FXuint getVRulerStyle() const;
253 
255  void setHelpText(const FXString& text){ help=text; }
256 
258  const FXString& getHelpText() const { return help; }
259 
261  void setTipText(const FXString& text){ tip=text; }
262 
264  const FXString& getTipText() const { return tip; }
265 
267  virtual void save(FXStream& store) const;
268 
270  virtual void load(FXStream& store);
271 
273  virtual ~FXRulerView();
274  };
275 
276 }
277 
278 #endif

Copyright © 1997-2016 Jeroen van der Zijp