ParticleFrameKeyDialog.cpp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // ParticleFrameKeyDialog.cpp : implementation file
  19. //
  20. #include "stdafx.h"
  21. #include "w3dview.h"
  22. #include "ParticleFrameKeyDialog.h"
  23. #include "Utils.H"
  24. #ifdef _DEBUG
  25. #define new DEBUG_NEW
  26. #undef THIS_FILE
  27. static char THIS_FILE[] = __FILE__;
  28. #endif
  29. /////////////////////////////////////////////////////////////////////////////
  30. // ParticleFrameKeyDialogClass dialog
  31. ParticleFrameKeyDialogClass::ParticleFrameKeyDialogClass(float frame,CWnd* pParent /*=NULL*/) :
  32. CDialog(ParticleFrameKeyDialogClass::IDD, pParent),
  33. m_Frame(frame)
  34. {
  35. //{{AFX_DATA_INIT(ParticleFrameKeyDialogClass)
  36. // NOTE: the ClassWizard will add member initialization here
  37. //}}AFX_DATA_INIT
  38. }
  39. void ParticleFrameKeyDialogClass::DoDataExchange(CDataExchange* pDX)
  40. {
  41. CDialog::DoDataExchange(pDX);
  42. //{{AFX_DATA_MAP(ParticleFrameKeyDialogClass)
  43. DDX_Control(pDX, IDC_FRAME_SPIN, m_FrameSpin);
  44. //}}AFX_DATA_MAP
  45. }
  46. BEGIN_MESSAGE_MAP(ParticleFrameKeyDialogClass, CDialog)
  47. //{{AFX_MSG_MAP(ParticleFrameKeyDialogClass)
  48. //}}AFX_MSG_MAP
  49. END_MESSAGE_MAP()
  50. /////////////////////////////////////////////////////////////////////////////
  51. // ParticleFrameKeyDialogClass message handlers
  52. BOOL ParticleFrameKeyDialogClass::OnInitDialog()
  53. {
  54. CDialog::OnInitDialog();
  55. Initialize_Spinner (m_FrameSpin, m_Frame, -1024, 1024);
  56. return TRUE; // return TRUE unless you set the focus to a control
  57. // EXCEPTION: OCX Property Pages should return FALSE
  58. }
  59. void ParticleFrameKeyDialogClass::OnOK()
  60. {
  61. m_Frame = GetDlgItemFloat(m_hWnd,IDC_FRAME_EDIT);
  62. CDialog::OnOK();
  63. }
  64. BOOL ParticleFrameKeyDialogClass::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
  65. {
  66. //
  67. // Update the spinner control if necessary
  68. //
  69. NMHDR *pheader = (NMHDR *)lParam;
  70. if ((pheader != NULL) && (pheader->code == UDN_DELTAPOS)) {
  71. LPNMUPDOWN pupdown = (LPNMUPDOWN)lParam;
  72. ::Update_Spinner_Buddy (pheader->hwndFrom, pupdown->iDelta);
  73. }
  74. return CDialog::OnNotify(wParam, lParam, pResult);
  75. }