VertRuler.h
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 2k
Category:

Graph program

Development Platform:

Visual C++

  1. #if !defined(AFX_VERTRULER_H__E5302FEE_F2AB_4887_B517_450F51159895__INCLUDED_)
  2. #define AFX_VERTRULER_H__E5302FEE_F2AB_4887_B517_450F51159895__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // VertRuler.h : header file
  7. //
  8. #ifndef MEASURE_PIXELS
  9. #define MEASURE_PIXELS 0
  10. #define MEASURE_INCHES 1
  11. #define MEASURE_CENTIMETERS 2
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CVertRuler window
  15. #ifndef round
  16. #define round(a) ( int ) ( a + .5 )
  17. #endif
  18. class CVertRuler : public CWnd
  19. {
  20. // Construction
  21. public:
  22. CVertRuler();
  23. virtual ~CVertRuler();
  24. // Operations
  25. void SetStartPos( int startPos );
  26. int GetStartPos() const;
  27. void SetMeasurements( int measurements );
  28. int GetMeasurements() const;
  29. void SetZoom( double zoom );
  30. double GetZoom() const;
  31. void SetPointerPos( int pointerPos );
  32. int GetPointerPos() const;
  33. // Overrides
  34. // ClassWizard generated virtual function overrides
  35. //{{AFX_VIRTUAL(CVertRuler)
  36. //}}AFX_VIRTUAL
  37. // Implementation
  38. // Generated message map functions
  39. protected:
  40. //{{AFX_MSG(CVertRuler)
  41. afx_msg void OnPaint();
  42. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  43. //}}AFX_MSG
  44. DECLARE_MESSAGE_MAP()
  45. void DrawPixelScale( CDC* dc, CRect rect );
  46. void DrawInchScale( CDC* dc, CRect rect );
  47. void DrawCentimeterScale( CDC* dc, CRect rect );
  48. void DrawScale( CDC* dc, CRect rect, double seg, double stepno );
  49. private:
  50. int m_startPos;
  51. int m_measurements;
  52. int m_pointerPos;
  53. double m_zoom;
  54. };
  55. /////////////////////////////////////////////////////////////////////////////
  56. //{{AFX_INSERT_LOCATION}}
  57. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  58. #endif // !defined(AFX_VERTRULER_H__E5302FEE_F2AB_4887_B517_450F51159895__INCLUDED_)