ParticleBlurTimeKeyDialog.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. // ParticleBlurTimeKeyDialog.cpp : implementation file
  19. //
  20. #include "stdafx.h"
  21. #include "w3dview.h"
  22. #include "ParticleBlurTimeKeyDialog.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. // ParticleBlurTimeKeyDialogClass dialog
  31. ParticleBlurTimeKeyDialogClass::ParticleBlurTimeKeyDialogClass(float blur_time, CWnd* pParent) :
  32. CDialog(ParticleBlurTimeKeyDialogClass::IDD, pParent),
  33. m_BlurTime(blur_time)
  34. {
  35. //{{AFX_DATA_INIT(ParticleBlurTimeKeyDialogClass)
  36. // NOTE: the ClassWizard will add member initialization here
  37. //}}AFX_DATA_INIT
  38. }
  39. void ParticleBlurTimeKeyDialogClass::DoDataExchange(CDataExchange* pDX)
  40. {
  41. CDialog::DoDataExchange(pDX);
  42. //{{AFX_DATA_MAP(ParticleBlurTimeKeyDialogClass)
  43. DDX_Control(pDX, IDC_BLUR_TIME_SPIN, m_BlurTimeSpin);
  44. //}}AFX_DATA_MAP
  45. }
  46. BEGIN_MESSAGE_MAP(ParticleBlurTimeKeyDialogClass, CDialog)
  47. //{{AFX_MSG_MAP(ParticleBlurTimeKeyDialogClass)
  48. ON_BN_CLICKED(IDOK2, OnOk2)
  49. //}}AFX_MSG_MAP
  50. END_MESSAGE_MAP()
  51. /////////////////////////////////////////////////////////////////////////////
  52. // ParticleBlurTimeKeyDialogClass message handlers
  53. BOOL ParticleBlurTimeKeyDialogClass::OnInitDialog()
  54. {
  55. CDialog::OnInitDialog();
  56. Initialize_Spinner (m_BlurTimeSpin, m_BlurTime, -1024, 1024);
  57. return TRUE; // return TRUE unless you set the focus to a control
  58. // EXCEPTION: OCX Property Pages should return FALSE
  59. }
  60. BOOL ParticleBlurTimeKeyDialogClass::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
  61. {
  62. //
  63. // Update the spinner control if necessary
  64. //
  65. NMHDR *pheader = (NMHDR *)lParam;
  66. if ((pheader != NULL) && (pheader->code == UDN_DELTAPOS)) {
  67. LPNMUPDOWN pupdown = (LPNMUPDOWN)lParam;
  68. ::Update_Spinner_Buddy (pheader->hwndFrom, pupdown->iDelta);
  69. }
  70. return CDialog::OnNotify(wParam, lParam, pResult);
  71. }
  72. void ParticleBlurTimeKeyDialogClass::OnOk2()
  73. {
  74. m_BlurTime = GetDlgItemFloat(m_hWnd,IDC_BLUR_TIME_EDIT);
  75. CDialog::OnOK();
  76. }