home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / gauge / slidvb25 / vcview.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-13  |  2.0 KB  |  94 lines

  1. // vcview.cpp : implementation of the CVcView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "vc.h"
  6.  
  7. #include "vcdoc.h"
  8. #include "vcview.h"
  9.  
  10. #ifdef _DEBUG
  11. #undef THIS_FILE
  12. static char BASED_CODE THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CVcView
  17.  
  18. IMPLEMENT_DYNCREATE(CVcView, CFormView)
  19.  
  20. BEGIN_MESSAGE_MAP(CVcView, CFormView)
  21.     //{{AFX_MSG_MAP(CVcView)
  22.     ON_VBXEVENT(VBN_MOUSEMOVE, IDC_SLIDER2, OnMousemoveSlider2)
  23.     ON_VBXEVENT(VBN_MOUSEMOVE, IDC_SLIDER3, OnMousemoveSlider3)
  24.     //}}AFX_MSG_MAP
  25. END_MESSAGE_MAP()
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CVcView construction/destruction
  29.  
  30. CVcView::CVcView()
  31.     : CFormView(CVcView::IDD)
  32. {
  33.     //{{AFX_DATA_INIT(CVcView)
  34.     m_slider3 = NULL;
  35.     m_slider2 = NULL;
  36.     //}}AFX_DATA_INIT
  37.     // TODO: add construction code here
  38. }
  39.  
  40. CVcView::~CVcView()
  41. {
  42. }
  43.  
  44. void CVcView::DoDataExchange(CDataExchange* pDX)
  45. {
  46.     CFormView::DoDataExchange(pDX);
  47.     //{{AFX_DATA_MAP(CVcView)
  48.     DDX_VBControl(pDX, IDC_SLIDER3, m_slider3);
  49.     DDX_VBControl(pDX, IDC_SLIDER2, m_slider2);
  50.     //}}AFX_DATA_MAP
  51. }
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CVcView diagnostics
  55.  
  56. #ifdef _DEBUG
  57. void CVcView::AssertValid() const
  58. {
  59.     CFormView::AssertValid();
  60. }
  61.  
  62. void CVcView::Dump(CDumpContext& dc) const
  63. {
  64.     CFormView::Dump(dc);
  65. }
  66.  
  67. CVcDoc* CVcView::GetDocument() // non-debug version is inline
  68. {
  69.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CVcDoc)));
  70.     return (CVcDoc*)m_pDocument;
  71. }
  72. #endif //_DEBUG
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75. // CVcView message handlers
  76.  
  77. void CVcView::OnMousemoveSlider2(UINT, int, CWnd*, LPVOID)
  78. {
  79. float value;
  80.  
  81.     value=m_slider2->GetFloatProperty("Value");
  82.     m_slider3->SetFloatProperty("Value",value);  
  83.     
  84. }
  85.  
  86. void CVcView::OnMousemoveSlider3(UINT, int, CWnd*, LPVOID)
  87. {
  88. float value;
  89.  
  90.     value=m_slider3->GetFloatProperty("Value");
  91.     m_slider2->SetFloatProperty("Value",value);  
  92.     
  93. }
  94.