// SpotLightPanel.cpp : implementation file // #include "stdafx.h" #include "mw4gameed2.h" #include "SpotLightPanel.h" #include "GUILight.h" ///////////////////////////////////////////////////////////////////////////// // CSpotLightPanel dialog CSpotLightPanel::CSpotLightPanel(GUISpotLight *gobj,UndoCommand **cmd,CWnd* pParent) : CPanelDlg(CSpotLightPanel::IDD, pParent) { MyObj=gobj; CmdLst=cmd; //{{AFX_DATA_INIT(CSpotLightPanel) m_Spread = 0.0f; //}}AFX_DATA_INIT } void CSpotLightPanel::DoDataExchange(CDataExchange* pDX) { CPanelDlg::DoDataExchange(pDX); //{{AFX_DATA_MAP(CSpotLightPanel) DDX_Text(pDX, IDC_SPREAD, m_Spread); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CSpotLightPanel, CPanelDlg) //{{AFX_MSG_MAP(CSpotLightPanel) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CSpotLightPanel message handlers void CSpotLightPanel::OnOK() { UpdateData(TRUE); MyObj->SetSpreadAngle(m_Spread*Radians_Per_Degree); //CPanelDlg::OnOK(); } void CSpotLightPanel::OnCancel() { //CPanelDlg::OnOK(); } BOOL CSpotLightPanel::OnInitDialog() { CPanelDlg::OnInitDialog(); m_Spread=Degrees_Per_Radian*MyObj->GetSpreadAngle(); UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }