00001 /* 00002 * 00003 * ChartScrollBar.h 00004 * 00005 * Written by Cédric Moonen (cedric_moonen@hotmail.com) 00006 * 00007 * 00008 * 00009 * This code may be used for any non-commercial and commercial purposes in a compiled form. 00010 * The code may be redistributed as long as it remains unmodified and providing that the 00011 * author name and this disclaimer remain intact. The sources can be modified WITH the author 00012 * consent only. 00013 * 00014 * This code is provided without any garanties. I cannot be held responsible for the damage or 00015 * the loss of time it causes. Use it at your own risks 00016 * 00017 * An e-mail to notify me that you are using this code is appreciated also. 00018 * 00019 * 00020 */ 00021 00022 #pragma once 00023 00024 class CChartAxis; 00025 00027 00030 class CChartScrollBar : public CScrollBar 00031 { 00032 friend CChartAxis; 00033 00034 public: 00036 void CreateScrollBar(const CRect& PlottingRect); 00037 00039 void OnHScroll(UINT nSBCode, UINT nPos); 00041 void OnVScroll(UINT nSBCode, UINT nPos); 00043 void Refresh(); 00044 00046 void SetEnabled(bool bEnabled) { m_bEnabled = bEnabled; } 00048 bool GetEnabled() const { return m_bEnabled; } 00050 00054 void SetAutoHide(bool bAutoHide) { m_bAutoHide = bAutoHide; } 00056 bool GetAutoHide() const { return m_bAutoHide; } 00057 00059 void OnMouseEnter(); 00061 void OnMouseLeave(); 00062 00063 private: 00065 CChartScrollBar(CChartAxis* pParentAxis); 00067 ~CChartScrollBar(); 00068 00069 bool IsScrollInverted() const; 00070 void MoveAxisToPos(int PreviousPos, int CurPos); 00071 00072 CChartAxis* m_pParentAxis; 00073 bool m_bEnabled; 00074 bool m_bAutoHide; 00075 };