AnimPageKeyFrame.cpp
资源名称:gloop.zip [点击查看]
上传用户:shxiangxiu
上传日期:2007-01-03
资源大小:1101k
文件大小:3k
源码类别:
OpenGL
开发平台:
Visual C++
- /////////////////////////////////////////////////////////////////////////////
- // AnimPageKeyFrame.cpp : implementation file
- //
- // glOOP (OpenGL Object Oriented Programming library)
- // Copyright (c) Craig Fahrnbach 1997, 1998
- //
- // OpenGL is a registered trademark of Silicon Graphics
- //
- //
- // This program is provided for educational and personal use only and
- // is provided without guarantee or warrantee expressed or implied.
- //
- // Commercial use is strickly prohibited without written permission
- // from ImageWare Development.
- //
- // This program is -not- in the public domain.
- //
- /////////////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "glOOP.h"
- #include "AnimationDialog.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CAnimPageKeyFrame
- IMPLEMENT_DYNCREATE(CAnimPageKeyFrame, CPropertyPage)
- /////////////////////////////////////////////////////////////////////////////
- // CAnimPageKeyFrame dialog construction
- CAnimPageKeyFrame::CAnimPageKeyFrame()
- : CPropertyPage(CAnimPageKeyFrame::IDD)
- {
- //{{AFX_DATA_INIT(CAnimPageKeyFrame)
- m_iNumFrames = 0;
- m_iCycleKeyFrames = -1;
- //}}AFX_DATA_INIT
- }
- /////////////////////////////////////////////////////////////////////////////
- // CAnimPageKeyFrame Destructor
- CAnimPageKeyFrame::~CAnimPageKeyFrame()
- {
- }
- void CAnimPageKeyFrame::DoDataExchange(CDataExchange* pDX)
- {
- CPropertyPage::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAnimPageKeyFrame)
- DDX_Text(pDX, IDC_NUM_KEYFRAMES, m_iNumFrames);
- DDX_Radio(pDX, IDC_RADIO_CYCLE, m_iCycleKeyFrames);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CAnimPageKeyFrame, CPropertyPage)
- //{{AFX_MSG_MAP(CAnimPageKeyFrame)
- ON_BN_CLICKED(IDC_RADIO_CYCLE, OnRadioCycle)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CAnimPageKeyFrame message handlers
- BOOL CAnimPageKeyFrame::OnInitDialog()
- {
- // Set our local values to the Objects' values
- if(m_pAnimation)
- {
- // Disable the data windows (for reference only...)
- GetDlgItem(IDC_NUM_KEYFRAMES)->EnableWindow(FALSE);
- m_iNumFrames = m_pAnimation->m_pKeyFrameList->GetNumKeys();
- if(m_pAnimation->m_bCycleKeyFrames)
- m_iCycleKeyFrames = 0;
- else
- m_iCycleKeyFrames = 1;
- }
- CPropertyPage::OnInitDialog(); // let the base class do the default work
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CAnimPageKeyFrame::OnOK()
- {
- // Dialog box is being initialized (FALSE)
- // or data is being retrieved (TRUE).
- UpdateData(TRUE);
- // Set our Objects' values to the local values
- if(m_pAnimation)
- {
- }
- CPropertyPage::OnOK();
- }
- void CAnimPageKeyFrame::OnRadioCycle()
- {
- if(m_pAnimation)
- {
- // Toggle the radio selection
- if(m_pAnimation->m_bCycleKeyFrames)
- {
- m_pAnimation->m_bCycleKeyFrames = FALSE;
- m_iCycleKeyFrames = 1;
- }
- else
- {
- m_pAnimation->m_bCycleKeyFrames = TRUE;
- m_iCycleKeyFrames = 0;
- }
- // Initialize the Dialog Data (forces DoDataExchange)
- UpdateData(FALSE);
- }
- }