DlgWOLAutoStart.cpp 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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 : Commando *
  23. * *
  24. * $Archive:: /Commando/Code/Commando/DlgWOLAutoStart.cpp $*
  25. * *
  26. * $Author:: Steve_t $*
  27. * *
  28. * $Modtime:: 12/06/01 2:04p $*
  29. * *
  30. * $Revision:: 2 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #include "always.h"
  36. #include "autostart.h"
  37. #include "win.h"
  38. #include "listctrl.h"
  39. #include "dlgwolautostart.h"
  40. #include "menubackdrop.h"
  41. #include "registry.h"
  42. #include "_globals.h"
  43. /***********************************************************************************************
  44. * AutoRestartProgressDialogClass::AutoRestartProgressDialogClass -- Constructor *
  45. * *
  46. * *
  47. * *
  48. * INPUT: Nothing *
  49. * *
  50. * OUTPUT: Nothing *
  51. * *
  52. * WARNINGS: None *
  53. * *
  54. * HISTORY: *
  55. * 11/6/2001 11:02AM ST : Created *
  56. *=============================================================================================*/
  57. AutoRestartProgressDialogClass::AutoRestartProgressDialogClass(void) :
  58. MenuDialogClass (IDD_MP_AUTO_RESTART_PROGRESS)
  59. {
  60. Instance = this;
  61. AddItemIndex = 0;
  62. }
  63. /***********************************************************************************************
  64. * AutoRestartProgressDialogClass::On_Init_Dialog -- Initialise the dialog *
  65. * *
  66. * *
  67. * *
  68. * INPUT: Nothing *
  69. * *
  70. * OUTPUT: Nothing *
  71. * *
  72. * WARNINGS: None *
  73. * *
  74. * HISTORY: *
  75. * 11/6/2001 11:03AM ST : Created *
  76. *=============================================================================================*/
  77. void AutoRestartProgressDialogClass::On_Init_Dialog (void)
  78. {
  79. /*
  80. ** Create the backdrop if necessary
  81. */
  82. RegistryClass reg(APPLICATION_SUB_KEY_NAME_OPTIONS);
  83. if (reg.Get_Int("DisableMenuAnim", 0) == 0) {
  84. if (Get_BackDrop ()->Peek_Model () == NULL) {
  85. Get_BackDrop ()->Set_Model ("IF_BACK01");
  86. Get_BackDrop ()->Set_Animation ("IF_BACK01.IF_BACK01");
  87. }
  88. }
  89. /*
  90. ** Set the columns up. Just one with nothing in it.
  91. */
  92. ListCtrlClass *list_ctrl = (ListCtrlClass *)Get_Dlg_Item (IDC_PROGRESS_INFO);
  93. if (list_ctrl != NULL) {
  94. list_ctrl->Add_Column (L"", 1.0F, Vector3 (1, 1, 1));
  95. list_ctrl->Allow_Selection(false);
  96. list_ctrl->Set_Wants_Focus(false);
  97. }
  98. /*
  99. ** Start adding items at index 0.
  100. */
  101. AddItemIndex = 0;
  102. /*
  103. ** Call the base class init.
  104. */
  105. MenuDialogClass::On_Init_Dialog ();
  106. }
  107. /***********************************************************************************************
  108. * AutoRestartProgressDialogClass::On_Command -- Message handler for dialog *
  109. * *
  110. * *
  111. * *
  112. * INPUT: ID of control that message refers to *
  113. * ID of message *
  114. * misc param *
  115. * *
  116. * OUTPUT: Nothing *
  117. * *
  118. * WARNINGS: None *
  119. * *
  120. * HISTORY: *
  121. * 11/6/2001 11:03AM ST : Created *
  122. *=============================================================================================*/
  123. void AutoRestartProgressDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
  124. {
  125. switch (ctrl_id)
  126. {
  127. case IDCANCEL:
  128. AutoRestart.Cancel();
  129. break;
  130. }
  131. MenuDialogClass::On_Command (ctrl_id, message_id, param);
  132. }
  133. /***********************************************************************************************
  134. * AutoRestartProgressDialogClass::Add_Text -- Adds text to the progress info box *
  135. * *
  136. * *
  137. * *
  138. * INPUT: Ptr to wide text string *
  139. * *
  140. * OUTPUT: Nothing *
  141. * *
  142. * WARNINGS: None *
  143. * *
  144. * HISTORY: *
  145. * 11/6/2001 11:04AM ST : Created *
  146. *=============================================================================================*/
  147. void AutoRestartProgressDialogClass::Add_Text(unsigned short *txt)
  148. {
  149. ListCtrlClass *list_ctrl = (ListCtrlClass *)Get_Dlg_Item(IDC_PROGRESS_INFO);
  150. if (list_ctrl) {
  151. list_ctrl->Insert_Entry(AddItemIndex++, txt);
  152. }
  153. }