00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #ifndef INC_OILRULERS
00101 #define INC_OILRULERS
00102
00103 #include "guides.h"
00104 #include "camview.h"
00105
00106 class WinCoord;
00107 class WinRect;
00108 class DovView;
00109 class RulerBase;
00110 class OILHorizontalRuler;
00111 class CRenderWnd;
00112
00113 #define MAX_RULER_DIGITS 3
00114
00115 enum MouseFollowerRenderType { RenderOn, RenderOff };
00116
00117
00118
00119 #ifndef WEBSTER
00120 #ifndef EXCLUDE_FROM_RALPH
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130 class LegendLabel : public wxWindow
00131 {
00132 friend class OILHorizontalRuler;
00133 DECLARE_DYNAMIC_CLASS(LegendLabel)
00134
00135 public:
00136 LegendLabel();
00137 virtual ~LegendLabel();
00138 BOOL Create(OILHorizontalRuler* pHorzRuler, wxWindow* pParentWindow, INT32 id);
00139
00140 void ShowLabel(BOOL show);
00141 BOOL PositionLegend();
00142
00143 wxPoint ClientToParentClient(wxPoint point);
00144
00145 BOOL GetStatusLineText(String_256* pText, WinCoord MousePos, CWindowID hWnd);
00146
00147 protected:
00148 BOOL SetLegendText(StringBase* pText);
00149 BOOL SetLegendSize();
00150
00151 protected:
00152
00153 void DoPaint(wxDC* pDC);
00154
00155 void OnPaint(wxPaintEvent &event);
00156
00157 void OnSize(wxSizeEvent &event);
00158 void OnLButtonDown(wxMouseEvent& event);
00159 void OnLButtonDblClk(wxMouseEvent& event);
00160 void OnRButtonUp(wxMouseEvent& event);
00161 void OnMouseMove(wxMouseEvent& event);
00162
00163 protected:
00164 UINT32 LegendWidth;
00165 UINT32 LegendHeight;
00166 String_256 LegendText;
00167 OILHorizontalRuler* m_pHorzRuler;
00168
00169 DECLARE_EVENT_TABLE()
00170 };
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183 class OILRuler : public wxWindow
00184 {
00185 DECLARE_DYNAMIC_CLASS(OILRuler)
00186
00187 public:
00188 OILRuler();
00189 virtual ~OILRuler();
00190 virtual BOOL PostCreate() {return FALSE;}
00191 BOOL Create(CCamView* pOwnerView, INT32 id);
00192 void LinkToKernel(RulerBase* pKRuler) { pKernelRuler=pKRuler; }
00193
00194 static BOOL GetMinGraticuleSpacing(OilRect* pSpacing, DocView* pDocView);
00195 static BOOL GetTextSize(OilRect* pTextSize, LPCTSTR str, DocView* pDocView);
00196 static BOOL GetTextSize(WinRect* pTextSize, LPCTSTR str);
00197 static void PatB(wxDC* pDC, INT32 x, INT32 y, INT32 dx, INT32 dy, wxColour rgb);
00198
00199 wxPoint ClientToOtherClient(wxWindow* pOtherCWnd, wxPoint point);
00200 WinRect ClientToOtherClient(wxWindow* pOtherCWnd, WinRect WR);
00201
00202 OilCoord ClientToOil(DocView* pDocView, wxPoint point);
00203 OilRect ClientToOil(DocView* pDocView, WinRect WR);
00204
00205 virtual BOOL DrawMajorGraticule(OilCoord GratOilPos, LPCTSTR str) {return FALSE;}
00206 virtual BOOL DrawMinorGraticule(OilCoord GratOilPos, INT32 ExtraSize=0);
00207 BOOL HighlightSection(OilCoord Lo, OilCoord Hi);
00208 BOOL DrawBitmap(OilCoord Pos, ResourceID BitmapID);
00209 BOOL StartToolDrag(ClickModifiers Mods, OilCoord point, String_256* OpToken, OpParam* Param);
00210
00211 BOOL PaintMouseFollower(OilCoord OilPos, DocView* pDocView, MouseFollowerRenderType RenderType);
00212 BOOL DrawMouseFollower(OilCoord OilPos, DocView* pDocView, MouseFollowerRenderType RenderType, wxDC* pDC);
00213
00214 BOOL GetStatusLineText(String_256* pText, WinCoord MousePos, CWindowID hWnd);
00215
00216 virtual void ShowRuler(BOOL show);
00217 void UpdateRuler();
00218
00219 static BOOL Init();
00220 static void Deinit();
00221 static INT32 GetRenderWidth() { return RenderWidth; }
00222 static UINT32 GetWidth() { return RulerWidth; }
00223 static wxFont GetRulerFont();
00224
00225 protected:
00226 virtual BOOL IsHorizontal() {return FALSE;}
00227 virtual BOOL StartDrag(UINT32 nFlags, wxPoint point);
00228 virtual BOOL HandleRulerDragEvent(UINT32 Button, UINT32 nFlags, WinCoord point, ClickType t);
00229 virtual BOOL HandleRulerUpEvent(UINT32 Button, WinCoord point);
00230
00231 CRenderWnd* GetRenderWindow() {return m_pOwnerView ? m_pOwnerView->GetRenderWindow() : NULL;}
00232 void SetCurrentStates();
00233
00234 protected:
00235
00236 void DoPaint(wxDC* pDC);
00237
00238 void OnPaint(wxPaintEvent &event);
00239
00240
00241
00242
00243 void OnMouseMove(wxMouseEvent& event);
00244
00245 void OnLButtonDown( wxMouseEvent &event );
00246 void OnLButtonDblClk( wxMouseEvent &event );
00247 void OnLButtonUp( wxMouseEvent &event );
00248 void OnMButtonDown( wxMouseEvent &event );
00249 void OnMButtonDblClk( wxMouseEvent &event );
00250 void OnMButtonUp( wxMouseEvent &event );
00251 void OnRButtonDown( wxMouseEvent &event );
00252 void OnRButtonDblClk( wxMouseEvent &event );
00253 void OnRButtonUp( wxMouseEvent &event );
00254
00255 void OnFocus( wxFocusEvent& event );
00256
00257 public:
00258 static String_256* FontName;
00259 static INT32 FontSize;
00260
00261 protected:
00262 static INT32 RenderWidth;
00263 static UINT32 RulerWidth;
00264 static INT32 CharHeight;
00265 static INT32 CharWidth;
00266
00267
00268
00269 static wxDC* pPaintDC;
00270 static DocView* pPaintDocView;
00271 static wxSize RulerToDocOffset;
00272
00273 static OpGuidelineParam NewGuidelineParam;
00274
00275 CCamView* m_pOwnerView;
00276 RulerBase* pKernelRuler;
00277
00278 ClickType m_LastClickType;
00279 UINT32 m_LastClickButton;
00280 wxPoint m_LastClickPoint;
00281 ClickModifiers m_LastClickMods;
00282 UINT32 m_FirstClickButton;
00283
00284 BOOL InDrag;
00285
00286 DECLARE_EVENT_TABLE()
00287 };
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297 class OILHorizontalRuler : public OILRuler
00298 {
00299 friend class LegendLabel;
00300 DECLARE_DYNAMIC_CLASS(OILHorizontalRuler)
00301
00302 public:
00303 OILHorizontalRuler();
00304 ~OILHorizontalRuler();
00305 virtual BOOL PostCreate();
00306
00307 void CalcPosFromParentClient(WinRect* lpRect);
00308 void ScrollRuler(INT32 amount);
00309
00310 virtual void ShowRuler(BOOL show);
00311 virtual BOOL DrawMajorGraticule(OilCoord GratOilPos, LPCTSTR str);
00312
00313 BOOL PositionLegend();
00314 BOOL SetLegendText(StringBase* pText);
00315
00316 LegendLabel* GetpLegendLabel() { return pLegend; }
00317
00318 protected:
00319 virtual BOOL StartDrag(UINT32 nFlags, wxPoint point);
00320 virtual BOOL IsHorizontal(){ return TRUE ;};
00321
00322 private:
00323 LegendLabel* pLegend;
00324 };
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334 class OILVerticalRuler : public OILRuler
00335 {
00336 DECLARE_DYNAMIC_CLASS(OILVerticalRuler)
00337
00338 public:
00339 OILVerticalRuler();
00340 virtual BOOL PostCreate();
00341
00342 void CalcPosFromParentClient(WinRect* lpRect);
00343 void ScrollRuler(INT32 amount);
00344
00345 virtual BOOL DrawMajorGraticule(OilCoord GratOilPos, LPCTSTR str);
00346
00347 protected:
00348 virtual BOOL StartDrag(UINT32 nFlags, wxPoint point);
00349 virtual BOOL IsHorizontal(){ return FALSE ;};
00350
00351 };
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362 class OriginGadget : public wxWindow
00363 {
00364 DECLARE_DYNAMIC_CLASS(OriginGadget)
00365
00366 public:
00367 OriginGadget();
00368 virtual ~OriginGadget();
00369 BOOL Create(CCamView* pOwnerView, INT32 id);
00370
00371 void ShowGadget(BOOL show);
00372 void CalcPosFromParentClient(WinRect* lpRect);
00373
00374 BOOL GetStatusLineText(String_256* pText, WinCoord MousePos, CWindowID hWnd);
00375 #if !defined(EXCLUDE_FROM_XARALX)
00376 static TCHAR* BubbleHelpCallBack(CWindowID hWnd, UINT32 PaneIndex, void* UserData);
00377 #endif
00378
00379 protected:
00380
00381 void DoPaint(wxDC* pDC);
00382
00383 void OnPaint(wxPaintEvent &event);
00384
00385 void OnLButtonDown(wxMouseEvent& event);
00386 void OnLButtonDblClk(wxMouseEvent& event);
00387 void OnRButtonUp(wxMouseEvent& event);
00388 void OnMouseMove(wxMouseEvent& event);
00389
00390 protected:
00391 CCamView* m_pOwnerView;
00392
00393 wxBitmap* pGlyph;
00394
00395 DECLARE_EVENT_TABLE()
00396 };
00397
00398 #endif
00399 #endif // WEBSTER
00400 #endif // INC_OILRULERS