Click here to Skip to main content
15,886,110 members
Articles / Desktop Programming / MFC

High-speed Charting Control

Rate me:
Please Sign up or sign in to vote.
4.95/5 (327 votes)
13 Jul 2010CPOL35 min read 4.2M   100.5K   787  
A flexible charting control to display 2D data
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChartDemo: E:/Sources Misc/ChartDemo/ChartCtrl/ChartScrollBar.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    </ul>
  </div>
<h1>E:/Sources Misc/ChartDemo/ChartCtrl/ChartScrollBar.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> *</span>
<a name="l00003"></a>00003 <span class="comment"> *      ChartScrollBar.h</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> *      Written by C�dric Moonen (cedric_moonen@hotmail.com)</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> *</span>
<a name="l00009"></a>00009 <span class="comment"> *      This code may be used for any non-commercial and commercial purposes in a compiled form.</span>
<a name="l00010"></a>00010 <span class="comment"> *      The code may be redistributed as long as it remains unmodified and providing that the </span>
<a name="l00011"></a>00011 <span class="comment"> *      author name and this disclaimer remain intact. The sources can be modified WITH the author </span>
<a name="l00012"></a>00012 <span class="comment"> *      consent only.</span>
<a name="l00013"></a>00013 <span class="comment"> *      </span>
<a name="l00014"></a>00014 <span class="comment"> *      This code is provided without any garanties. I cannot be held responsible for the damage or</span>
<a name="l00015"></a>00015 <span class="comment"> *      the loss of time it causes. Use it at your own risks</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> *      An e-mail to notify me that you are using this code is appreciated also.</span>
<a name="l00018"></a>00018 <span class="comment"> *</span>
<a name="l00019"></a>00019 <span class="comment"> *</span>
<a name="l00020"></a>00020 <span class="comment"> */</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#pragma once</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span>
<a name="l00024"></a>00024 <span class="keyword">class </span><a class="code" href="class_c_chart_axis.html" title="Base class that takes care of the management of a chart axis.">CChartAxis</a>;
<a name="l00025"></a>00025 
<a name="l00027"></a>00027 
<a name="l00030"></a><a class="code" href="class_c_chart_scroll_bar.html">00030</a> <span class="keyword">class </span><a class="code" href="class_c_chart_scroll_bar.html" title="Class which manages the interaction with the axis scroll bar.">CChartScrollBar</a> : <span class="keyword">public</span> CScrollBar
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032 <span class="keyword">friend</span> <a class="code" href="class_c_chart_axis.html" title="Base class that takes care of the management of a chart axis.">CChartAxis</a>;
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="keyword">public</span>:
<a name="l00036"></a>00036         <span class="keywordtype">void</span> <a class="code" href="class_c_chart_scroll_bar.html#fd81755f9221643097d71b0ad919d203" title="Creates the scroll bar within a specified rectangle.">CreateScrollBar</a>(<span class="keyword">const</span> CRect&amp; PlottingRect);
<a name="l00037"></a>00037 
<a name="l00039"></a>00039         <span class="keywordtype">void</span> <a class="code" href="class_c_chart_scroll_bar.html#9192b0e2c5bafdef560cdd28690299c6" title="Called on horizontal scrolling.">OnHScroll</a>(UINT nSBCode, UINT nPos);
<a name="l00041"></a>00041         <span class="keywordtype">void</span> <a class="code" href="class_c_chart_scroll_bar.html#80a7bccff25ffa0c7b928c4419b052d0" title="Called on vertical scrolling.">OnVScroll</a>(UINT nSBCode, UINT nPos);
<a name="l00043"></a>00043         <span class="keywordtype">void</span> <a class="code" href="class_c_chart_scroll_bar.html#a390273b9f3f4243e3667be5d09b5fcb" title="Refreshes the scroll bar position.">Refresh</a>();
<a name="l00044"></a>00044 
<a name="l00046"></a><a class="code" href="class_c_chart_scroll_bar.html#8d49e8bb3d1d8e7f0606855137ae5114">00046</a>         <span class="keywordtype">void</span> <a class="code" href="class_c_chart_scroll_bar.html#8d49e8bb3d1d8e7f0606855137ae5114" title="Enables/disables the scroll bar.">SetEnabled</a>(<span class="keywordtype">bool</span> bEnabled)  { m_bEnabled = bEnabled; }
<a name="l00048"></a><a class="code" href="class_c_chart_scroll_bar.html#f71fa8b4d24a4b5d8ae6577b0a4691f5">00048</a>         <span class="keywordtype">bool</span> <a class="code" href="class_c_chart_scroll_bar.html#f71fa8b4d24a4b5d8ae6577b0a4691f5" title="Returns true if the scroll bar is enabled.">GetEnabled</a>()<span class="keyword"> const                 </span>{ <span class="keywordflow">return</span> m_bEnabled; }
<a name="l00050"></a>00050 
<a name="l00054"></a><a class="code" href="class_c_chart_scroll_bar.html#7a39f2691c50f60f85b5f6abffff10d5">00054</a>         <span class="keywordtype">void</span> <a class="code" href="class_c_chart_scroll_bar.html#7a39f2691c50f60f85b5f6abffff10d5" title="Enables/disables the auto-hide mode.">SetAutoHide</a>(<span class="keywordtype">bool</span> bAutoHide)  { m_bAutoHide = bAutoHide; }
<a name="l00056"></a><a class="code" href="class_c_chart_scroll_bar.html#f2ec9b07c5f1e800aee44fb844b8e5ad">00056</a>         <span class="keywordtype">bool</span> <a class="code" href="class_c_chart_scroll_bar.html#f2ec9b07c5f1e800aee44fb844b8e5ad" title="Returns true if the auto-hide mode is activated.">GetAutoHide</a>()<span class="keyword"> const                  </span>{ <span class="keywordflow">return</span> m_bAutoHide; }
<a name="l00057"></a>00057 
<a name="l00059"></a>00059         <span class="keywordtype">void</span> <a class="code" href="class_c_chart_scroll_bar.html#f7714e4b05c62bd3a4ad10e3e62fbd87" title="Called when the mouse enters the scroll bar area.">OnMouseEnter</a>();
<a name="l00061"></a>00061         <span class="keywordtype">void</span> <a class="code" href="class_c_chart_scroll_bar.html#cec567d8be6853724afd047a5a74a6c9" title="Called when the mouse leaves the scroll bar area.">OnMouseLeave</a>();
<a name="l00062"></a>00062 
<a name="l00063"></a>00063 <span class="keyword">private</span>:
<a name="l00065"></a>00065         <a class="code" href="class_c_chart_scroll_bar.html" title="Class which manages the interaction with the axis scroll bar.">CChartScrollBar</a>(<a class="code" href="class_c_chart_axis.html" title="Base class that takes care of the management of a chart axis.">CChartAxis</a>* pParentAxis);
<a name="l00067"></a>00067         ~<a class="code" href="class_c_chart_scroll_bar.html" title="Class which manages the interaction with the axis scroll bar.">CChartScrollBar</a>();
<a name="l00068"></a>00068 
<a name="l00069"></a>00069         <span class="keywordtype">bool</span> IsScrollInverted() <span class="keyword">const</span>;
<a name="l00070"></a>00070         <span class="keywordtype">void</span> MoveAxisToPos(<span class="keywordtype">int</span> PreviousPos, <span class="keywordtype">int</span> CurPos);
<a name="l00071"></a>00071 
<a name="l00072"></a>00072         <a class="code" href="class_c_chart_axis.html" title="Base class that takes care of the management of a chart axis.">CChartAxis</a>* m_pParentAxis;
<a name="l00073"></a>00073         <span class="keywordtype">bool</span> m_bEnabled;
<a name="l00074"></a>00074         <span class="keywordtype">bool</span> m_bAutoHide;
<a name="l00075"></a>00075 };
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Jan 17 13:33:10 2010 for ChartDemo by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
Belgium Belgium
I am a 29 years old guy and I live with my girlfriend in Hoegaarden, little city from Belgium well known for its white beer Smile | :) .
I studied as an industrial engineer in electronics but I oriented myself more towards software development when I started to work.
Currently I am working in a research centre in mechatronica. I mainly develop in C++ but I also do a bit of Java.
When I have so spare time, I like to read (mainly fantasy) and play electric guitar.

Comments and Discussions