1919// AnimationPropPage.cpp : implementation file
2020//
2121
22- #include " AnimationPropPage.h"
2322#include " StdAfx.h"
24- #include " Utils.h"
2523#include " W3DView.h"
26- #include " W3DViewDoc.h"
24+ #include " AnimationPropPage.h"
25+ #include " rendobj.h"
2726#include " assetmgr.h"
2827#include " mesh.h"
29- #include " rendobj.h"
28+ #include " W3DViewDoc.h"
29+ #include " Utils.h"
30+
3031
3132#ifdef RTS_DEBUG
3233#define new DEBUG_NEW
@@ -39,72 +40,83 @@ static char THIS_FILE[] = __FILE__;
3940
4041IMPLEMENT_DYNCREATE (CAnimationPropPage, CPropertyPage)
4142
43+
4244// //////////////////////////////////////////////////////////////
4345//
4446// CAnimationPropPage
4547//
46- CAnimationPropPage::CAnimationPropPage(void )
47- : CPropertyPage(CAnimationPropPage::IDD) {
48- // {{AFX_DATA_INIT(CAnimationPropPage)
49- // NOTE: the ClassWizard will add member initialization here
50- // }}AFX_DATA_INIT
48+ CAnimationPropPage::CAnimationPropPage (void )
49+ : CPropertyPage(CAnimationPropPage::IDD)
50+ {
51+ // {{AFX_DATA_INIT(CAnimationPropPage)
52+ // NOTE: the ClassWizard will add member initialization here
53+ // }}AFX_DATA_INIT
5154}
5255
5356// //////////////////////////////////////////////////////////////
5457//
5558// CAnimationPropPage
5659//
57- CAnimationPropPage::~CAnimationPropPage (void ) {}
60+ CAnimationPropPage::~CAnimationPropPage (void )
61+ {
62+ }
5863
5964// //////////////////////////////////////////////////////////////
6065//
6166// DoDataExchange
6267//
63- void CAnimationPropPage::DoDataExchange (CDataExchange *pDX) {
64- // Allow the base class to process this message
65- CPropertyPage::DoDataExchange (pDX);
66- // {{AFX_DATA_MAP(CAnimationPropPage)
67- // NOTE: the ClassWizard will add DDX and DDV calls here
68- // }}AFX_DATA_MAP
69- }
68+ void
69+ CAnimationPropPage::DoDataExchange (CDataExchange* pDX)
70+ {
71+ // Allow the base class to process this message
72+ CPropertyPage::DoDataExchange (pDX);
73+ // {{AFX_DATA_MAP(CAnimationPropPage)
74+ // NOTE: the ClassWizard will add DDX and DDV calls here
75+ // }}AFX_DATA_MAP
76+ }
77+
7078
7179BEGIN_MESSAGE_MAP (CAnimationPropPage, CPropertyPage)
72- // {{AFX_MSG_MAP(CAnimationPropPage)
73- // }}AFX_MSG_MAP
80+ // {{AFX_MSG_MAP(CAnimationPropPage)
81+ // }}AFX_MSG_MAP
7482END_MESSAGE_MAP()
7583
7684// //////////////////////////////////////////////////////////////
7785//
7886// OnInitDialog
7987//
80- BOOL CAnimationPropPage::OnInitDialog(void ) {
81- // Allow the base class to process this message
82- CPropertyPage::OnInitDialog ();
88+ BOOL
89+ CAnimationPropPage::OnInitDialog (void )
90+ {
91+ // Allow the base class to process this message
92+ CPropertyPage::OnInitDialog ();
93+
94+ // Get a pointer to the doc so we can get at the current animation object
95+ CW3DViewDoc *pCDoc = ::GetCurrentDocument ();
96+ if (pCDoc && pCDoc->GetCurrentAnimation ())
97+ {
98+ HAnimClass *pCAnimation = pCDoc->GetCurrentAnimation ();
8399
84- // Get a pointer to the doc so we can get at the current animation object
85- CW3DViewDoc *pCDoc = :: GetCurrentDocument () ;
86- if (pCDoc && pCDoc-> GetCurrentAnimation ()) {
87- HAnimClass *pCAnimation = pCDoc-> GetCurrentAnimation ( );
100+ // Set the description text at the top of the dialog
101+ CString stringTemp ;
102+ stringTemp. Format (IDS_ANI_PROP_DESC, pCAnimation-> Get_Name ());
103+ SetDlgItemText (IDC_DESCRIPTION, stringTemp );
88104
89- // Set the description text at the top of the dialog
90- CString stringTemp;
91- stringTemp.Format (IDS_ANI_PROP_DESC, pCAnimation->Get_Name ());
92- SetDlgItemText (IDC_DESCRIPTION, stringTemp);
105+ // Fill in the number of frames
106+ SetDlgItemInt (IDC_FRAME_COUNT, pCAnimation->Get_Num_Frames ());
93107
94- // Fill in the number of frames
95- SetDlgItemInt (IDC_FRAME_COUNT, pCAnimation->Get_Num_Frames ());
108+ // Fill in the frame rate of the animation
109+ stringTemp.Format (" %.2f fps" , pCAnimation->Get_Frame_Rate ());
110+ SetDlgItemText (IDC_FRAME_RATE, stringTemp);
96111
97- // Fill in the frame rate of the animation
98- stringTemp.Format (" %.2f fps " , pCAnimation->Get_Frame_Rate ());
99- SetDlgItemText (IDC_FRAME_RATE , stringTemp);
112+ // Fill in the total time taken by the animation
113+ stringTemp.Format (" %.3f seconds " , pCAnimation->Get_Total_Time ());
114+ SetDlgItemText (IDC_TOTAL_TIME , stringTemp);
100115
101- // Fill in the total time taken by the animation
102- stringTemp.Format (" %.3f seconds" , pCAnimation->Get_Total_Time ());
103- SetDlgItemText (IDC_TOTAL_TIME, stringTemp);
116+ // Set the name of the hierarchy this animation belongs to.
117+ SetDlgItemText (IDC_HIERARCHY_NAME, pCAnimation->Get_HName ());
104118
105- // Set the name of the hierarchy this animation belongs to.
106- SetDlgItemText (IDC_HIERARCHY_NAME, pCAnimation->Get_HName ());
107- }
119+ }
108120
109- return TRUE ;
121+ return TRUE ;
110122}
0 commit comments