CardSelectionDialog.cpp 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. /***********************************************************************************************
  19. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Installer *
  23. * *
  24. * $Archive:: /Commando/Code/Installer/CardSelectionDialog.cpp $ *
  25. * *
  26. * $Author:: Ian_l $*
  27. * *
  28. * $Modtime:: 11/09/01 1:07p $*
  29. * *
  30. * $Revision:: 3 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. // Includes.
  36. #include "CardSelectionDialog.h"
  37. #include "ErrorHandler.h"
  38. #include "ListCtrl.h"
  39. #include "MessageBox.h"
  40. #include "RDDesc.h"
  41. #include "Translator.h"
  42. /***********************************************************************************************
  43. * CardSelectionDialogClass::On_Init_Dialog -- *
  44. * *
  45. * INPUT: *
  46. * *
  47. * OUTPUT: *
  48. * *
  49. * WARNINGS: *
  50. * *
  51. * HISTORY: *
  52. * 08/22/01 IML : Created. *
  53. *=============================================================================================*/
  54. void CardSelectionDialogClass::On_Init_Dialog (void)
  55. {
  56. ListCtrlClass *listctrl;
  57. int e;
  58. listctrl = Get_Dlg_Item (IDC_CARD_SELECTION_LIST)->As_ListCtrlClass();
  59. listctrl->Add_Column (L"", 1.0f, Vector3 (1.0f, 1.0f, 1.0f));
  60. e = 0;
  61. for (int d = 0; d < WW3D::Get_Render_Device_Count(); d++) {
  62. listctrl->Insert_Entry (e, WideStringClass (WW3D::Get_Render_Device_Name (d)));
  63. e++;
  64. }
  65. listctrl->Set_Curr_Sel (0);
  66. MenuDialogClass::On_Init_Dialog();
  67. // Show message to indicate that the user's last video card selection was unsuccessful?
  68. if (ShowMessage) {
  69. MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_CANNOT_INITIALIZE_THIS_D3D_DEVICE), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
  70. }
  71. }
  72. /***********************************************************************************************
  73. * CardSelectionDialogClass::Callback -- *
  74. * *
  75. * INPUT: *
  76. * *
  77. * OUTPUT: *
  78. * *
  79. * WARNINGS: *
  80. * *
  81. * HISTORY: *
  82. * 08/22/01 IML : Created. *
  83. *=============================================================================================*/
  84. void CardSelectionDialogClass::Callback (int id, PopupDialogClass *popup)
  85. {
  86. switch (id) {
  87. case IDC_BUTTON_YES:
  88. CancelApplication = true;
  89. End_Dialog();
  90. break;
  91. default:
  92. break;
  93. }
  94. }
  95. /***********************************************************************************************
  96. * CardSelectionDialogClass::On_Command -- *
  97. * *
  98. * INPUT: *
  99. * *
  100. * OUTPUT: *
  101. * *
  102. * WARNINGS: *
  103. * *
  104. * HISTORY: *
  105. * 08/22/01 IML : Created. *
  106. *=============================================================================================*/
  107. void CardSelectionDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
  108. {
  109. switch (ctrl_id)
  110. {
  111. case IDCANCEL:
  112. MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_EXIT_SETUP), TxWideStringClass (IDS_PROMPT_EXIT_SETUP), MessageBoxClass::MESSAGE_BOX_TYPE_YES_NO, this);
  113. return;
  114. case IDOK:
  115. {
  116. ListCtrlClass *listctrl;
  117. listctrl = Get_Dlg_Item (IDC_CARD_SELECTION_LIST)->As_ListCtrlClass();
  118. CardSelection = listctrl->Get_Curr_Sel();
  119. End_Dialog();
  120. }
  121. default:
  122. break;
  123. }
  124. MenuDialogClass::On_Command (ctrl_id, message_id, param);
  125. }