Update the changelog
[opencv] / apps / StereoGR / DGProp.cpp
1 /*M///////////////////////////////////////////////////////////////////////////////////////\r
2 //\r
3 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\r
4 //\r
5 //  By downloading, copying, installing or using the software you agree to this license.\r
6 //  If you do not agree to this license, do not download, install,\r
7 //  copy or use the software.\r
8 //\r
9 //\r
10 //                        Intel License Agreement\r
11 //                For Open Source Computer Vision Library\r
12 //\r
13 // Copyright (C) 2000, Intel Corporation, all rights reserved.\r
14 // Third party copyrights are property of their respective owners.\r
15 //\r
16 // Redistribution and use in source and binary forms, with or without modification,\r
17 // are permitted provided that the following conditions are met:\r
18 //\r
19 //   * Redistribution's of source code must retain the above copyright notice,\r
20 //     this list of conditions and the following disclaimer.\r
21 //\r
22 //   * Redistribution's in binary form must reproduce the above copyright notice,\r
23 //     this list of conditions and the following disclaimer in the documentation\r
24 //     and/or other materials provided with the distribution.\r
25 //\r
26 //   * The name of Intel Corporation may not be used to endorse or promote products\r
27 //     derived from this software without specific prior written permission.\r
28 //\r
29 // This software is provided by the copyright holders and contributors "as is" and\r
30 // any express or implied warranties, including, but not limited to, the implied\r
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.\r
32 // In no event shall the Intel Corporation or contributors be liable for any direct,\r
33 // indirect, incidental, special, exemplary, or consequential damages\r
34 // (including, but not limited to, procurement of substitute goods or services;\r
35 // loss of use, data, or profits; or business interruption) however caused\r
36 // and on any theory of liability, whether in contract, strict liability,\r
37 // or tort (including negligence or otherwise) arising in any way out of\r
38 // the use of this software, even if advised of the possibility of such damage.\r
39 //\r
40 //M*/// DGProp.cpp : implementation file\r
41 //\r
42 \r
43 #include "stdafx.h"\r
44 #include "stereogr.h"\r
45 #include "DGProp.h"\r
46 \r
47 #ifdef _DEBUG\r
48 #define new DEBUG_NEW\r
49 #undef THIS_FILE\r
50 static char THIS_FILE[] = __FILE__;\r
51 #endif\r
52 \r
53 /////////////////////////////////////////////////////////////////////////////\r
54 // CDGProp dialog\r
55 \r
56 \r
57 IMPLEMENT_DYNCREATE(CDGProp, CPropertyPage)\r
58 \r
59 CDGProp::CDGProp(CWnd* pParent /*=NULL*/)\r
60         : CPropertyPage(CDGProp::IDD)\r
61 {\r
62         //{{AFX_DATA_INIT(CDGProp)\r
63         m_dgName = _T("Move down");\r
64         m_isSaveToFile = FALSE;\r
65         m_savePath = _T("");\r
66         m_isCollectGesture = FALSE;\r
67         //}}AFX_DATA_INIT\r
68 }\r
69 \r
70 \r
71 void CDGProp::DoDataExchange(CDataExchange* pDX)\r
72 {\r
73         CPropertyPage::DoDataExchange(pDX);\r
74         //{{AFX_DATA_MAP(CDGProp)\r
75         DDX_CBString(pDX, IDC_DGNAME, m_dgName);\r
76         DDX_Check(pDX, IDC_DGSAVE, m_isSaveToFile);\r
77         DDX_Text(pDX, IDC_ESAVEPATH, m_savePath);\r
78         DDX_Check(pDX, IDC_DGCOLLECT, m_isCollectGesture);\r
79         //}}AFX_DATA_MAP\r
80 }\r
81 \r
82 \r
83 BEGIN_MESSAGE_MAP(CDGProp, CPropertyPage)\r
84         //{{AFX_MSG_MAP(CDGProp)\r
85         ON_BN_CLICKED(IDC_DGCOLLECT, OnDgcollect)\r
86         ON_CBN_EDITCHANGE(IDC_DGNAME, OnEditchangeDgname)\r
87         ON_CBN_SELENDOK(IDC_DGNAME, OnSelendokDgname)\r
88         ON_CBN_CLOSEUP(IDC_DGNAME, OnCloseupDgname)\r
89         //}}AFX_MSG_MAP\r
90 END_MESSAGE_MAP()\r
91 \r
92 /////////////////////////////////////////////////////////////////////////////\r
93 // CDGProp message handlers\r
94 \r
95 BOOL CDGProp::OnInitDialog() \r
96 {\r
97         CPropertyPage::OnInitDialog();\r
98         \r
99     CComboBox* box = (CComboBox*)GetDlgItem(IDC_DGNAME);\r
100 \r
101     box->SetCurSel(0);\r
102 \r
103     ShowWindow(SW_SHOW);\r
104         return TRUE;  // return TRUE unless you set the focus to a control\r
105                       // EXCEPTION: OCX Property Pages should return FALSE\r
106 }\r
107 \r
108 CString CDGProp::GetGestureName()\r
109 {\r
110     return m_dgName;\r
111 }\r
112 \r
113 BOOL CDGProp::IsSaveToFile()\r
114 {\r
115     return m_isSaveToFile;\r
116 }\r
117 \r
118 CString CDGProp::GetSavePath()\r
119 {\r
120     return m_savePath;\r
121 }\r
122 \r
123 void CDGProp::OnDgcollect() \r
124 {\r
125         UpdateData(TRUE);\r
126 }\r
127 \r
128 void CDGProp::OnEditchangeDgname() \r
129 {\r
130         UpdateData(TRUE);       \r
131 }\r
132 \r
133 void CDGProp::OnSelendokDgname() \r
134 {\r
135         UpdateData(TRUE);       \r
136 }\r
137 \r
138 void CDGProp::OnCloseupDgname() \r
139 {\r
140         UpdateData(TRUE);       \r
141         CComboBox* box = (CComboBox*)GetDlgItem(IDC_DGNAME);\r
142         int i = box->GetCurSel();\r
143         box->GetLBText(i, m_dgName);\r
144 }\r