GenerateBaseDialog.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. // GenerateBaseDialog.cpp : implementation file
  19. //
  20. #include "stdafx.h"
  21. #include "leveledit.h"
  22. #include "GenerateBaseDialog.h"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // GenerateBaseDialogClass dialog
  30. GenerateBaseDialogClass::GenerateBaseDialogClass(CWnd* pParent /*=NULL*/)
  31. : CDialog(GenerateBaseDialogClass::IDD, pParent)
  32. {
  33. //{{AFX_DATA_INIT(GenerateBaseDialogClass)
  34. // NOTE: the ClassWizard will add member initialization here
  35. //}}AFX_DATA_INIT
  36. }
  37. void GenerateBaseDialogClass::DoDataExchange(CDataExchange* pDX)
  38. {
  39. CDialog::DoDataExchange(pDX);
  40. //{{AFX_DATA_MAP(GenerateBaseDialogClass)
  41. // NOTE: the ClassWizard will add DDX and DDV calls here
  42. //}}AFX_DATA_MAP
  43. }
  44. BEGIN_MESSAGE_MAP(GenerateBaseDialogClass, CDialog)
  45. //{{AFX_MSG_MAP(GenerateBaseDialogClass)
  46. ON_EN_UPDATE(IDC_PRESET_NAME, OnUpdatePresetName)
  47. //}}AFX_MSG_MAP
  48. END_MESSAGE_MAP()
  49. /////////////////////////////////////////////////////////////////////////////
  50. // GenerateBaseDialogClass message handlers
  51. void
  52. GenerateBaseDialogClass::OnOK (void)
  53. {
  54. GetDlgItemText (IDC_PRESET_NAME, m_PresetName);
  55. CDialog::OnOK();
  56. return ;
  57. }
  58. void
  59. GenerateBaseDialogClass::OnUpdatePresetName (void)
  60. {
  61. // Enable/disable the OK button based on the entry in the name editfield
  62. BOOL benable = (::GetWindowTextLength (::GetDlgItem (m_hWnd, IDC_PRESET_NAME)) > 0);
  63. ::EnableWindow (::GetDlgItem (m_hWnd, IDOK), benable);
  64. return ;
  65. }