1 /*---------------------------------------------------------------------------*
2   Project:  HIO2 demos - dual
3   File:     dualView.h
4 
5   (C)2005 HUDSON SOFT
6 
7   $Header: /home/cvsroot/SDK/build/demos/hio2demo/vc++/dual/dualView.h,v 1.3 2006/03/15 06:31:26 mitu Exp $
8 
9   $NoKeywords: $
10  *---------------------------------------------------------------------------*/
11 
12 // dualView.h : interface of the CDualView class
13 //
14 
15 
16 #pragma once
17 #include "afxcmn.h"
18 
19 
20 class CDualView : public CFormView
21 {
22 ////////// for dualApp //////////
23 public:
24 	RGBQUAD	m_stRGB;
25 
26 	enum USER_EVENT
27 	{
28 		EVENT_SET_SEND_STATUS,
29 		EVENT_SET_RECV_STATUS,
30 		EVENT_VALID_RECV_COLOR,
31 		EVENT_INVALID_RECV_COLOR,
32 		EVENT_UPDATE_COLOR,
33 		EVENT_CONNECT,
34 		EVENT_DISCONNECT,
35 	};
36 
37 protected: // create from serialization only
38 	CDualView();
39 	DECLARE_DYNCREATE(CDualView)
40 
41 public:
42 	enum{ IDD = IDD_DUAL_FORM };
43 
44 // Attributes
45 public:
46 	CDualDoc* GetDocument() const;
47 
48 // Operations
49 public:
50 
51 // Overrides
52 	public:
53 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
54 protected:
55 	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
56 	virtual void OnInitialUpdate(); // called first time after construct
57 
58 // Implementation
59 public:
60 	virtual ~CDualView();
61 #ifdef _DEBUG
62 	virtual void AssertValid() const;
63 	virtual void Dump(CDumpContext& dc) const;
64 #endif
65 
66 protected:
67 
68 // Generated message map functions
69 protected:
70 	DECLARE_MESSAGE_MAP()
71 public:
72 	CSliderCtrl m_cSliderRed;
73 	CSliderCtrl m_cSliderGreen;
74 	CSliderCtrl m_cSliderBlue;
75     afx_msg LRESULT OnMyMessage(WPARAM wParam, LPARAM lParam);
76 	afx_msg void OnBnClickedBtnConnect();
77 	afx_msg void OnBnClickedBtnDisconnect();
78 	afx_msg void OnBnClickedBtnExit();
79 	afx_msg void OnBnClickedRadioSync();
80 	afx_msg void OnBnClickedRadioAsync();
81 	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
82 protected:
83 	virtual void OnDraw(CDC* /*pDC*/);
84 };
85 
86 #ifndef _DEBUG  // debug version in dualView.cpp
GetDocument()87 inline CDualDoc* CDualView::GetDocument() const
88    { return reinterpret_cast<CDualDoc*>(m_pDocument); }
89 #endif
90 
91