FindDialog.cpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. // FindDialog.cpp : implementation file
  19. //
  20. #include "stdafx.h"
  21. #include "wdump.h"
  22. #include "FindDialog.h"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. // Static data.
  29. char FindDialog::_FindString [MAX_FIND_STRING_LENGTH + 1] = "";
  30. bool FindDialog::_Found;
  31. /////////////////////////////////////////////////////////////////////////////
  32. // FindDialog dialog
  33. FindDialog::FindDialog(CWnd* pParent /*=NULL*/)
  34. : CDialog(FindDialog::IDD, pParent)
  35. {
  36. //{{AFX_DATA_INIT(FindDialog)
  37. // NOTE: the ClassWizard will add member initialization here
  38. //}}AFX_DATA_INIT
  39. }
  40. void FindDialog::DoDataExchange(CDataExchange* pDX)
  41. {
  42. CDialog::DoDataExchange(pDX);
  43. //{{AFX_DATA_MAP(FindDialog)
  44. // NOTE: the ClassWizard will add DDX and DDV calls here
  45. //}}AFX_DATA_MAP
  46. }
  47. BEGIN_MESSAGE_MAP(FindDialog, CDialog)
  48. //{{AFX_MSG_MAP(FindDialog)
  49. ON_EN_CHANGE(IDC_FIND_STRING, OnChangeFindString)
  50. ON_EN_UPDATE(IDC_FIND_STRING, OnUpdateFindString)
  51. //}}AFX_MSG_MAP
  52. END_MESSAGE_MAP()
  53. /////////////////////////////////////////////////////////////////////////////
  54. // FindDialog message handlers
  55. BOOL FindDialog::OnInitDialog()
  56. {
  57. CDialog::OnInitDialog();
  58. ((CEdit*) GetDlgItem (IDC_FIND_STRING))->SetLimitText (MAX_FIND_STRING_LENGTH);
  59. GetDlgItem (IDC_FIND_STRING)->SetWindowText (_FindString);
  60. return TRUE; // return TRUE unless you set the focus to a control
  61. // EXCEPTION: OCX Property Pages should return FALSE
  62. }
  63. void FindDialog::OnChangeFindString()
  64. {
  65. GetDlgItem (IDC_FIND_STRING)->GetWindowText (_FindString, MAX_FIND_STRING_LENGTH);
  66. }
  67. void FindDialog::OnUpdateFindString()
  68. {
  69. GetDlgItem (IDOK)->EnableWindow (GetDlgItem (IDC_FIND_STRING)->GetWindowTextLength() > 0);
  70. }