ValueListDialog.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. // ValueListDialogClass.cpp : implementation file
  19. //
  20. #include "stdafx.h"
  21. #include "leveledit.h"
  22. #include "ValueListDialog.H"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // ValueListDialogClass dialog
  30. ValueListDialogClass::ValueListDialogClass(CWnd* pParent /*=NULL*/)
  31. : CDialog(ValueListDialogClass::IDD, pParent)
  32. {
  33. //{{AFX_DATA_INIT(ValueListDialogClass)
  34. // NOTE: the ClassWizard will add member initialization here
  35. //}}AFX_DATA_INIT
  36. }
  37. void ValueListDialogClass::DoDataExchange(CDataExchange* pDX)
  38. {
  39. CDialog::DoDataExchange(pDX);
  40. //{{AFX_DATA_MAP(ValueListDialogClass)
  41. // NOTE: the ClassWizard will add DDX and DDV calls here
  42. //}}AFX_DATA_MAP
  43. }
  44. BEGIN_MESSAGE_MAP(ValueListDialogClass, CDialog)
  45. //{{AFX_MSG_MAP(ValueListDialogClass)
  46. ON_EN_UPDATE(IDC_LIST_EDIT, OnUpdateListEdit)
  47. //}}AFX_MSG_MAP
  48. END_MESSAGE_MAP()
  49. ////////////////////////////////////////////////////////////////////
  50. //
  51. // OnOK
  52. //
  53. void
  54. ValueListDialogClass::OnOK (void)
  55. {
  56. // Record the entries for later
  57. GetDlgItemText (IDC_LIST_EDIT, m_ListEntries);
  58. // Allow the base class to process this message
  59. CDialog::OnOK ();
  60. return ;
  61. }
  62. ////////////////////////////////////////////////////////////////////
  63. //
  64. // OnUpdateListEdit
  65. //
  66. void
  67. ValueListDialogClass::OnUpdateListEdit (void)
  68. {
  69. // Enable or disable the OK button
  70. bool benable = bool(::GetWindowTextLength (::GetDlgItem (m_hWnd, IDC_LIST_EDIT)) > 0);
  71. ::EnableWindow (::GetDlgItem (m_hWnd, IDOK), benable);
  72. return ;
  73. }
  74. ////////////////////////////////////////////////////////////////////
  75. //
  76. // OnInitDialog
  77. //
  78. BOOL
  79. ValueListDialogClass::OnInitDialog (void)
  80. {
  81. // Allow the base class to process this message
  82. CDialog::OnInitDialog ();
  83. // Put the initial text into the edit control
  84. SetDlgItemText (IDC_LIST_EDIT, m_ListEntries);
  85. return TRUE;
  86. }