MultiSort.h
上传用户:zhanglf88
上传日期:2013-11-19
资源大小:6036k
文件大小:3k
源码类别:

金融证券系统

开发平台:

Visual C++

  1. // MultiSort.h : interface of the CMultiSort class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_MULTISORT_H__0A8D66A9_30E0_4AAA_8E17_06B721FC0E97__INCLUDED_)
  5. #define AFX_MULTISORT_H__0A8D66A9_30E0_4AAA_8E17_06B721FC0E97__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. /***
  10. 画图类,负责画出综合排名图中的所有部分
  11. */
  12. class CMultiSort
  13. {
  14. public:
  15. CMultiSort( );
  16. virtual ~CMultiSort( );
  17. void SetParent( CWnd * pParent );
  18. enum SelectArea {
  19. areaNone = 0x00,
  20. areaRise = 0x01,
  21. areaFall = 0x02,
  22. areaDiff = 0x03,
  23. areaRiseMin5 = 0x04,
  24. areaFallMin5 = 0x05,
  25. areaVolRatio = 0x06,
  26. areaBSRatioAsc = 0x07,
  27. areaBSRatioDesc = 0x08,
  28. areaAmount = 0x09,
  29. };
  30. void SetMultiSortClass( LONG type );
  31. LONG GetMultiSortClass( );
  32. BOOL RecalculateSortID( BOOL bReloadMinute, BOOL bUpdateWindow );
  33. BOOL RecalculateSortID( PCOMMPACKET pPacket );
  34. void Redraw( CDC * pDC, CRect rectAll );
  35. public:
  36. // 刷新实时行情数据
  37. LRESULT OnStkReceiverData( WPARAM wParam, LPARAM lParam );
  38. void OnLButtonDown( UINT nFlags, CPoint point, BOOL bShiftPressed, BOOL bCtrlPressed );
  39. void OnLButtonDblClk( UINT nFlags, CPoint point );
  40. protected:
  41. void ResetClient( CRect rectAll );
  42. int GetClickPos( CRect rect, CPoint point );
  43. void DrawSelection( CDC * pDC, int nSelectArea, int nSelectPos, COLORREF clr );
  44. void DrawMultiSort( CDC * pDC, CSPDWordArray &adwSortID, CRect rect, UINT nSLH, int nSelectPos );
  45. void DrawMultiSort( CDC * pDC, MULTISORT &ms, CRect rect, UINT nSLH, int nSelectPos );
  46. void DrawRise( CDC * pDC, CRect rect );
  47. void DrawFall( CDC * pDC, CRect rect );
  48. void DrawDiff( CDC * pDC, CRect rect );
  49. void DrawRiseMin5( CDC * pDC, CRect rect );
  50. void DrawFallMin5( CDC * pDC, CRect rect );
  51. void DrawVolRatio( CDC * pDC, CRect rect );
  52. void DrawBSRatioAsc( CDC * pDC, CRect rect );
  53. void DrawBSRatioDesc( CDC * pDC, CRect rect );
  54. void DrawAmount( CDC * pDC, CRect rect );
  55. protected:
  56. CWnd * m_pParent; // 父窗口
  57. LONG m_lMultiSortClass;
  58. CRect m_rectAll; // 整个Rect
  59. CRect m_rectRise; // 今日涨幅排名区域
  60. CRect m_rectFall; // 今日跌幅排名区域
  61. CRect m_rectDiff; // 今日震幅排名区域
  62. CRect m_rectRiseMin5; // 5分钟涨幅排名区域
  63. CRect m_rectFallMin5; // 5分钟跌幅排名区域
  64. CRect m_rectVolRatio; // 5分钟震幅排名区域
  65. CRect m_rectBSRatioAsc; // 今日委比前六名区域
  66. CRect m_rectBSRatioDesc; // 今日委比后六名区域
  67. CRect m_rectAmount; // 今日总金额排名区域
  68. CSPDWordArray m_adwRise;
  69. CSPDWordArray m_adwFall;
  70. CSPDWordArray m_adwDiff;
  71. CSPDWordArray m_adwRiseMin5;
  72. CSPDWordArray m_adwFallMin5;
  73. CSPDWordArray m_adwVolRatio;
  74. CSPDWordArray m_adwBSRatioAsc;
  75. CSPDWordArray m_adwBSRatioDesc;
  76. CSPDWordArray m_adwAmount;
  77. int m_nSelectArea;
  78. int m_nSelectPos;
  79. enum RefreshMode {
  80. modeSort = 0x01,
  81. modeDirect = 0x02,
  82. };
  83. int m_nRefreshMode;
  84. MULTISORT m_msRise;
  85. MULTISORT m_msFall;
  86. MULTISORT m_msDiff;
  87. MULTISORT m_msRiseMin5;
  88. MULTISORT m_msFallMin5;
  89. MULTISORT m_msVolRatio;
  90. MULTISORT m_msBSRatioAsc;
  91. MULTISORT m_msBSRatioDesc;
  92. MULTISORT m_msAmount;
  93. };
  94. /////////////////////////////////////////////////////////////////////////////
  95. //{{AFX_INSERT_LOCATION}}
  96. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  97. #endif // !defined(AFX_MULTISORT_H__0A8D66A9_30E0_4AAA_8E17_06B721FC0E97__INCLUDED_)