NewMapSpDlg.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. FinalSun/FinalAlert 2 Mission Editor
  3. Copyright (C) 1999-2024 Electronic Arts, Inc.
  4. Authored by Matthias Wagner
  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. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <https://www.gnu.org/licenses/>.
  15. */
  16. // NewMapSpDlg.cpp: Implementierungsdatei
  17. //
  18. #include "stdafx.h"
  19. #include "finalsun.h"
  20. #include "NewMapSpDlg.h"
  21. #include "variables.h"
  22. #include "functions.h"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // Dialogfeld CNewMapSpDlg
  30. CNewMapSpDlg::CNewMapSpDlg(CWnd* pParent /*=NULL*/)
  31. : CDialog(CNewMapSpDlg::IDD, pParent)
  32. {
  33. //{{AFX_DATA_INIT(CNewMapSpDlg)
  34. m_AutoProd = FALSE;
  35. m_House = -1;
  36. m_PrepareHouses = FALSE;
  37. //}}AFX_DATA_INIT
  38. }
  39. void CNewMapSpDlg::DoDataExchange(CDataExchange* pDX)
  40. {
  41. CDialog::DoDataExchange(pDX);
  42. //{{AFX_DATA_MAP(CNewMapSpDlg)
  43. DDX_Check(pDX, IDC_AUTOPROD, m_AutoProd);
  44. DDX_CBIndex(pDX, IDC_HOUSE, m_House);
  45. DDX_Check(pDX, IDC_PREPAREHOUSES, m_PrepareHouses);
  46. //}}AFX_DATA_MAP
  47. }
  48. BEGIN_MESSAGE_MAP(CNewMapSpDlg, CDialog)
  49. //{{AFX_MSG_MAP(CNewMapSpDlg)
  50. ON_BN_CLICKED(IDC_PREPAREHOUSES, OnPreparehouses)
  51. //}}AFX_MSG_MAP
  52. END_MESSAGE_MAP()
  53. /////////////////////////////////////////////////////////////////////////////
  54. // Behandlungsroutinen für Nachrichten CNewMapSpDlg
  55. void CNewMapSpDlg::OnPreparehouses()
  56. {
  57. UpdateData(TRUE);
  58. BOOL bEnable=m_PrepareHouses;
  59. GetDlgItem(IDC_AUTOPROD)->EnableWindow(bEnable);
  60. GetDlgItem(IDC_HOUSE)->EnableWindow(bEnable);
  61. }
  62. BOOL CNewMapSpDlg::OnInitDialog()
  63. {
  64. CDialog::OnInitDialog();
  65. CComboBox& house=*((CComboBox*)(GetDlgItem(IDC_HOUSE)));
  66. int i;
  67. for(i=0;i<rules.sections[HOUSES].values.size();i++)
  68. {
  69. house.AddString(TranslateHouse(*rules.sections[HOUSES].GetValue(i), TRUE));
  70. }
  71. m_PrepareHouses=TRUE;
  72. m_AutoProd=TRUE;
  73. m_House=0;
  74. UpdateData(FALSE);
  75. return TRUE; // return TRUE unless you set the focus to a control
  76. // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben
  77. }
  78. void CNewMapSpDlg::OnOK()
  79. {
  80. CDialog::OnOK();
  81. //m_House=TranslateHouse(m_House);
  82. }