1 #ifndef _EASING_FUNCTION_SELECT_DLG_
2 #define _EASING_FUNCTION_SELECT_DLG_
3 #include "afxwin.h"
4 // easing_function_select_dlg dialog
5 
6 class easing_function_select_dlg : public express_dialog
7 {
8     DECLARE_DYNAMIC(easing_function_select_dlg)
9 
10 public:
11     easing_function_select_dlg(int easing_function_id, CWnd* pParent = NULL);   // standard constructor
12     virtual ~easing_function_select_dlg();
13     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
14     virtual BOOL OnInitDialog();
15     afx_msg void OnPaint();
16     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
17     afx_msg void OnTimer(UINT_PTR nIDEvent);
18 
19     static int GetEasingFuncId(CString type_name);
20     static CString GetEasingFuncIdName(int type);
21 
GetEasingFuncId()22     int GetEasingFuncId(){ return mEasingFuncId; };
23 
24     enum { IDD = IDD_EASING_FUNCTION_SELECT_DLG };
25 
26 public:
27     afx_msg void OnSelecteEasingFuncCombo();
28     afx_msg void OnAnimationStart();
29     afx_msg LRESULT OnTestMessage(WPARAM wParam, LPARAM lParam);
30 
31     DECLARE_MESSAGE_MAP()
32 
33 private:
34     static float BackEaseIn(float t, float d);
35     static float BackEaseOut(float t, float d);
36     static float BackEaseInOut(float t, float d);
37     static float BounceEaseIn(float t, float d);
38     static float BounceEaseOut(float t, float d);
39     static float BounceEaseInOut(float t, float d);
40     static float CircEaseIn(float t, float d);
41     static float CircEaseOut(float t, float d);
42     static float CircEaseInOut(float t, float d);
43     static float CubicEaseIn(float t, float d);
44     static float CubicEaseOut(float t, float d);
45     static float CubicEaseInOut(float t, float d);
46     static float ElasticEaseIn(float t, float d);
47     static float ElasticEaseOut(float t, float d);
48     static float ElasticEaseInOut(float t, float d);
49     static float ExpoEaseIn(float t, float d);
50     static float ExpoEaseOut(float t, float d);
51     static float ExpoEaseInOut(float t, float d);
52     static float QuadEaseInt(float t, float d);
53     static float QuadEaseOut(float t, float d);
54     static float QuadEaseInOut(float t, float d);
55     static float QuartEaseIn(float t, float d);
56     static float QuartEaseOut(float t, float d);
57     static float QuartEaseInOut(float t, float d);
58     static float QuintEaseIn(float t, float d);
59     static float QuintEaseOut(float t, float d);
60     static float QuintEaseInOut(float t, float d);
61     static float SinEaseIn(float t, float d);
62     static float SinEaseOut(float t, float d);
63     static float SinEaseInOut(float t, float d);
64     float(*mpEasingFuncCallback)(float time, float duration);
65     void DrawEasingCurve(Graphics &g);
66 
67 protected:
68     express_combobox mEasingFuncCombo;
69     int       mEasingFuncId;
70     CRect     mWaveRect;
71     CRect     mAnimationRect;
72     int       mAnimationStep;
73     CStatic   mAnimationStatus;
74     CSize     mAnimationBoxSize;
75     int       mAnimationDotRadius;
76 };
77 #endif
78