EditRemarkDialog.cpp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. // EditRemarkDialog.cpp : implementation file
  19. //
  20. #include "stdafx.h"
  21. #if 0
  22. #include "leveledit.h"
  23. #include "editremarkdialog.h"
  24. #include "dialogue.h"
  25. #include "translatedb.h"
  26. #include "translateobj.h"
  27. #ifdef _DEBUG
  28. #define new DEBUG_NEW
  29. #undef THIS_FILE
  30. static char THIS_FILE[] = __FILE__;
  31. #endif
  32. /////////////////////////////////////////////////////////////////////////////
  33. // Constants
  34. /////////////////////////////////////////////////////////////////////////////
  35. enum
  36. {
  37. COL_TEXT = 0
  38. };
  39. /////////////////////////////////////////////////////////////////////////////
  40. //
  41. // EditRemarkDialogClass
  42. //
  43. /////////////////////////////////////////////////////////////////////////////
  44. EditRemarkDialogClass::EditRemarkDialogClass(CWnd* pParent /*=NULL*/)
  45. : m_Remark (NULL),
  46. CDialog(EditRemarkDialogClass::IDD, pParent)
  47. {
  48. //{{AFX_DATA_INIT(EditRemarkDialogClass)
  49. // NOTE: the ClassWizard will add member initialization here
  50. //}}AFX_DATA_INIT
  51. return ;
  52. }
  53. /////////////////////////////////////////////////////////////////////////////
  54. //
  55. // DoDataExchange
  56. //
  57. /////////////////////////////////////////////////////////////////////////////
  58. void
  59. EditRemarkDialogClass::DoDataExchange (CDataExchange *pDX)
  60. {
  61. CDialog::DoDataExchange(pDX);
  62. //{{AFX_DATA_MAP(EditRemarkDialogClass)
  63. DDX_Control(pDX, IDC_WEIGHT_SPIN, m_WeightSpin);
  64. //}}AFX_DATA_MAP
  65. return ;
  66. }
  67. BEGIN_MESSAGE_MAP(EditRemarkDialogClass, CDialog)
  68. //{{AFX_MSG_MAP(EditRemarkDialogClass)
  69. //}}AFX_MSG_MAP
  70. END_MESSAGE_MAP()
  71. /////////////////////////////////////////////////////////////////////////////
  72. //
  73. // OnInitDialog
  74. //
  75. /////////////////////////////////////////////////////////////////////////////
  76. BOOL
  77. EditRemarkDialogClass::OnInitDialog (void)
  78. {
  79. CDialog::OnInitDialog ();
  80. ASSERT (m_Remark != NULL);
  81. //
  82. // Calculate the rectangle where we are to display the string picker
  83. //
  84. CRect rect;
  85. ::GetWindowRect (::GetDlgItem (m_hWnd, IDC_PICKER_AREA), &rect);
  86. ScreenToClient (&rect);
  87. //
  88. // Create the string picker
  89. //
  90. StringPicker.Set_Selection (m_Remark->Get_Text_ID ());
  91. StringPicker.Create (this);
  92. StringPicker.SetWindowPos (NULL, rect.left, rect.top, rect.Width (), rect.Height (), SWP_NOZORDER);
  93. StringPicker.ShowWindow (SW_SHOW);
  94. //
  95. // Configure the weight controls
  96. //
  97. m_WeightSpin.SetRange (0, 100);
  98. m_WeightSpin.SetPos ((int)m_Remark->Get_Weight ());
  99. SetDlgItemInt (IDC_WEIGHT_EDIT, (int)m_Remark->Get_Weight ());
  100. return TRUE;
  101. }
  102. /////////////////////////////////////////////////////////////////////////////
  103. //
  104. // OnOK
  105. //
  106. /////////////////////////////////////////////////////////////////////////////
  107. void
  108. EditRemarkDialogClass::OnOK (void)
  109. {
  110. //
  111. // Read the silence configuration
  112. //
  113. int new_weight = GetDlgItemInt (IDC_WEIGHT_EDIT);
  114. m_Remark->Set_Weight (new_weight);
  115. //
  116. // Get the selected string from the picker object
  117. //
  118. m_Remark->Set_Text_ID (StringPicker.Get_Selection ());
  119. CDialog::OnOK ();
  120. return ;
  121. }
  122. #endif //0