0031622: Samples - update MFC Animation sample with proper frame updates
[occt.git] / samples / mfc / standard / 09_Animation / src / Sensitivity.cpp
1 // Sensitivity.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5
6 #include "Sensitivity.h"
7
8 #include "AnimationApp.h"
9
10 #ifdef _DEBUG
11 #define new DEBUG_NEW
12 #undef THIS_FILE
13 static char THIS_FILE[] = __FILE__;
14 #endif
15
16 /////////////////////////////////////////////////////////////////////////////
17 // CSensitivity dialog
18
19
20 CSensitivity::CSensitivity(CWnd* pParent /*=NULL*/)
21         : CDialog(CSensitivity::IDD, pParent)
22 {
23         //{{AFX_DATA_INIT(CSensitivity)
24         m_SensFly = 0.0;
25         m_SensTurn = 0.0;
26         //}}AFX_DATA_INIT
27 }
28
29
30 void CSensitivity::DoDataExchange(CDataExchange* pDX)
31 {
32         CDialog::DoDataExchange(pDX);
33         //{{AFX_DATA_MAP(CSensitivity)
34         DDX_Text(pDX, IDC_FLY, m_SensFly);
35         DDV_MinMaxDouble(pDX, m_SensFly, 0., 10000000.);
36         DDX_Text(pDX, IDC_TURN, m_SensTurn);
37         DDV_MinMaxDouble(pDX, m_SensTurn, 0., 10000000.);
38         //}}AFX_DATA_MAP
39 }
40
41
42 BEGIN_MESSAGE_MAP(CSensitivity, CDialog)
43         //{{AFX_MSG_MAP(CSensitivity)
44         ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN1, OnDeltaposSpin1)
45         ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN2, OnDeltaposSpin2)
46         //}}AFX_MSG_MAP
47 END_MESSAGE_MAP()
48
49 /////////////////////////////////////////////////////////////////////////////
50 // CSensitivity message handlers
51
52 void CSensitivity::OnDeltaposSpin1(NMHDR* pNMHDR, LRESULT* pResult) 
53 {
54         NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
55         // TODO: Add your control notification handler code here
56         if ( pNMUpDown->iDelta > 0 ) {
57                 m_SensFly  /= 1.1 ;
58         }
59         else {
60                 m_SensFly  *= 1.1 ;
61         }
62         UpdateData ( FALSE ) ;
63
64
65         *pResult = 0;
66 }
67
68 void CSensitivity::OnDeltaposSpin2(NMHDR* pNMHDR, LRESULT* pResult) 
69 {
70         NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
71         // TODO: Add your control notification handler code here
72         if ( pNMUpDown->iDelta > 0 ) {
73                 m_SensTurn  /= 1.1 ;
74         }
75         else {
76                 m_SensTurn  *= 1.1 ;
77         }
78         UpdateData ( FALSE ) ;
79         
80         *pResult = 0;
81 }