OptionsDialog.cpp 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  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 : LightMap *
  23. * *
  24. * $Archive:: /Commando/Code/Tool $*
  25. * *
  26. * $Author:: Ian_l $*
  27. * *
  28. * $Modtime:: 9/08/00 6:37p $*
  29. * *
  30. * $Revision:: 7 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. // Includes.
  36. #include "StdAfx.h"
  37. #include "LightMap.h"
  38. #include "OptionsDialog.h"
  39. #include "StringBuilder.h"
  40. // The following is maintained by MFC tools.
  41. #ifdef _DEBUG
  42. #define new DEBUG_NEW
  43. #undef THIS_FILE
  44. static char THIS_FILE[] = __FILE__;
  45. #endif
  46. // Defines.
  47. #define OPTIONS_SECTION_NAME "Options"
  48. #define SPATIAL_TOLERANCE_NAME "Spatial Tolerance"
  49. #define SMOOTHING_ANGLE_NAME "Smoothing Angle"
  50. #define FILTER_SHARPNESS_NAME "Filter Sharpness"
  51. #define FILL_COLOR_RED_NAME "Fill Color Red"
  52. #define FILL_COLOR_GREEN_NAME "Fill Color Green"
  53. #define FILL_COLOR_BLUE_NAME "Fill Color Blue"
  54. #define SCALE_FACTOR_NAME "Scale Factor"
  55. #define SAMPLE_RATE_NAME "Sample Rate"
  56. #define FILTER_ERROR_NAME "Filter Error"
  57. #define BIT_DEPTH_NAME "Bit Depth"
  58. #define LIGHT_EXPORT_SELECTIVE_NAME "Light Export Selective"
  59. #define LIGHT_EXCLUSION_STRING_NAME "Light Exclusion String"
  60. #define PERCENT_SLIDER_TICK_COUNT 101
  61. #define SMOOTHING_ANGLE_TICK_COUNT 181
  62. #define MIN_SAMPLE_RATE 1
  63. #define MAX_SAMPLE_RATE 9999
  64. #define SAMPLE_RATE_VALUE_CONTROL_STRING "%4.1f"
  65. /***********************************************************************************************
  66. * OptionsDialog::OptionsDialog -- Constructor *
  67. * *
  68. * INPUT: *
  69. * *
  70. * OUTPUT: *
  71. * *
  72. * WARNINGS: *
  73. * *
  74. * HISTORY: *
  75. * 6/1/99 IML : Created. *
  76. *=============================================================================================*/
  77. OptionsDialog::OptionsDialog (CWnd *parent)
  78. : CDialog (OptionsDialog::IDD, parent)
  79. {
  80. SpatialTolerance = AfxGetApp()->GetProfileInt (OPTIONS_SECTION_NAME, SPATIAL_TOLERANCE_NAME, 1);
  81. SmoothingAngle = AfxGetApp()->GetProfileInt (OPTIONS_SECTION_NAME, SMOOTHING_ANGLE_NAME, 89);
  82. FilterSharpness = AfxGetApp()->GetProfileInt (OPTIONS_SECTION_NAME, FILTER_SHARPNESS_NAME, 50);
  83. FillColor.R = AfxGetApp()->GetProfileInt (OPTIONS_SECTION_NAME, FILL_COLOR_RED_NAME, 0);
  84. FillColor.G = AfxGetApp()->GetProfileInt (OPTIONS_SECTION_NAME, FILL_COLOR_GREEN_NAME, _UI8_MAX);
  85. FillColor.B = AfxGetApp()->GetProfileInt (OPTIONS_SECTION_NAME, FILL_COLOR_BLUE_NAME, 0);
  86. SampleRate = AfxGetApp()->GetProfileInt (OPTIONS_SECTION_NAME, SAMPLE_RATE_NAME, 50);
  87. FilterError = AfxGetApp()->GetProfileInt (OPTIONS_SECTION_NAME, FILTER_ERROR_NAME, 50);
  88. BitDepth = AfxGetApp()->GetProfileInt (OPTIONS_SECTION_NAME, BIT_DEPTH_NAME, 16);
  89. LightExportSelective = AfxGetApp()->GetProfileInt (OPTIONS_SECTION_NAME, LIGHT_EXPORT_SELECTIVE_NAME, 1) > 0 ? true : false;
  90. LightExclusionString = AfxGetApp()->GetProfileString (OPTIONS_SECTION_NAME, LIGHT_EXCLUSION_STRING_NAME, "@");
  91. }
  92. void OptionsDialog::DoDataExchange(CDataExchange* pDX)
  93. {
  94. CDialog::DoDataExchange(pDX);
  95. //{{AFX_DATA_MAP(OptionsDialog)
  96. // NOTE: the ClassWizard will add DDX and DDV calls here
  97. //}}AFX_DATA_MAP
  98. }
  99. BEGIN_MESSAGE_MAP(OptionsDialog, CDialog)
  100. //{{AFX_MSG_MAP(OptionsDialog)
  101. ON_WM_HSCROLL()
  102. ON_EN_CHANGE(IDC_SPATIAL_TOLERANCE, OnChangeSpatialTolerance)
  103. ON_EN_UPDATE(IDC_SPATIAL_TOLERANCE, OnUpdateSpatialTolerance)
  104. ON_EN_CHANGE(IDC_FILL_COLOR_RED, OnChangeFillColorRed)
  105. ON_EN_CHANGE(IDC_FILL_COLOR_GREEN, OnChangeFillColorGreen)
  106. ON_EN_CHANGE(IDC_FILL_COLOR_BLUE, OnChangeFillColorBlue)
  107. ON_EN_UPDATE(IDC_FILL_COLOR_RED, OnUpdateFillColorRed)
  108. ON_EN_UPDATE(IDC_FILL_COLOR_GREEN, OnUpdateFillColorGreen)
  109. ON_EN_UPDATE(IDC_FILL_COLOR_BLUE, OnUpdateFillColorBlue)
  110. ON_BN_CLICKED(IDC_16_BITS_PER_PIXEL, On16BitsPerPixel)
  111. ON_BN_CLICKED(IDC_24_BITS_PER_PIXEL, On24BitsPerPixel)
  112. ON_WM_VSCROLL()
  113. ON_BN_CLICKED(IDC_LIGHT_EXPORT_SELECTIVE, OnLightExportSelective)
  114. ON_EN_CHANGE(IDC_LIGHT_EXCLUSION_STRING, OnChangeLightExclusionString)
  115. //}}AFX_MSG_MAP
  116. END_MESSAGE_MAP()
  117. /***********************************************************************************************
  118. * OptionsDialog::OnInitDialog -- *
  119. * *
  120. * INPUT: *
  121. * *
  122. * OUTPUT: *
  123. * *
  124. * WARNINGS: *
  125. * *
  126. * HISTORY: *
  127. * 11/2/99 IML : Created. *
  128. *=============================================================================================*/
  129. BOOL OptionsDialog::OnInitDialog()
  130. {
  131. CDialog::OnInitDialog();
  132. // Initialize.
  133. SetDlgItemInt (IDC_SPATIAL_TOLERANCE, SpatialTolerance, FALSE);
  134. Initialize_Slider (IDC_SMOOTHING_ANGLE, 0, SMOOTHING_ANGLE_TICK_COUNT - 1, SmoothingAngle);
  135. Set_Text (IDC_SMOOTHING_ANGLE_VALUE, "%d", (int) SmoothingAngle);
  136. Initialize_Slider (IDC_FILTER_SHARPNESS, 0, PERCENT_SLIDER_TICK_COUNT - 1, FilterSharpness);
  137. Set_Text (IDC_FILTER_SHARPNESS_VALUE, "%d", (int) FilterSharpness);
  138. SetDlgItemInt (IDC_FILL_COLOR_RED, FillColor.R, FALSE);
  139. SetDlgItemInt (IDC_FILL_COLOR_GREEN, FillColor.G, FALSE);
  140. SetDlgItemInt (IDC_FILL_COLOR_BLUE, FillColor.B, FALSE);
  141. Initialize_Spinner (IDC_SAMPLE_RATE, MIN_SAMPLE_RATE, MAX_SAMPLE_RATE, SampleRate);
  142. Set_Text (IDC_SAMPLE_RATE_VALUE, SAMPLE_RATE_VALUE_CONTROL_STRING, Get_Sample_Rate());
  143. Initialize_Slider (IDC_FILTER_ERROR, 0, PERCENT_SLIDER_TICK_COUNT - 1, FilterError);
  144. Set_Text (IDC_FILTER_ERROR_VALUE, "%d", (int) FilterError);
  145. // Initialize bit depth option.
  146. switch (BitDepth) {
  147. case 16:
  148. CheckDlgButton (IDC_16_BITS_PER_PIXEL, 1);
  149. break;
  150. case 24:
  151. CheckDlgButton (IDC_24_BITS_PER_PIXEL, 1);
  152. break;
  153. default:
  154. ASSERT (FALSE);
  155. break;
  156. }
  157. CheckDlgButton (IDC_LIGHT_EXPORT_SELECTIVE, LightExportSelective);
  158. GetDlgItem (IDC_LIGHT_EXCLUSION_STRING)->SetWindowText (LightExclusionString);
  159. GetDlgItem (IDC_LIGHT_EXCLUSION_STRING)->EnableWindow (LightExportSelective);
  160. return TRUE; // return TRUE unless you set the focus to a control
  161. // EXCEPTION: OCX Property Pages should return FALSE
  162. }
  163. /***********************************************************************************************
  164. * OptionsDialog::DoModal -- *
  165. * *
  166. * INPUT: *
  167. * *
  168. * OUTPUT: *
  169. * *
  170. * WARNINGS: *
  171. * *
  172. * HISTORY: *
  173. * 11/2/99 IML : Created. *
  174. *=============================================================================================*/
  175. int OptionsDialog::DoModal()
  176. {
  177. int result;
  178. result = CDialog::DoModal();
  179. if (result == IDOK) {
  180. AfxGetApp()->WriteProfileInt (OPTIONS_SECTION_NAME, SPATIAL_TOLERANCE_NAME, SpatialTolerance);
  181. AfxGetApp()->WriteProfileInt (OPTIONS_SECTION_NAME, SMOOTHING_ANGLE_NAME, SmoothingAngle);
  182. AfxGetApp()->WriteProfileInt (OPTIONS_SECTION_NAME, FILTER_SHARPNESS_NAME, FilterSharpness);
  183. AfxGetApp()->WriteProfileInt (OPTIONS_SECTION_NAME, FILL_COLOR_RED_NAME, FillColor.R);
  184. AfxGetApp()->WriteProfileInt (OPTIONS_SECTION_NAME, FILL_COLOR_GREEN_NAME, FillColor.G);
  185. AfxGetApp()->WriteProfileInt (OPTIONS_SECTION_NAME, FILL_COLOR_BLUE_NAME, FillColor.B);
  186. AfxGetApp()->WriteProfileInt (OPTIONS_SECTION_NAME, SAMPLE_RATE_NAME, SampleRate);
  187. AfxGetApp()->WriteProfileInt (OPTIONS_SECTION_NAME, FILTER_ERROR_NAME, FilterError);
  188. AfxGetApp()->WriteProfileInt (OPTIONS_SECTION_NAME, BIT_DEPTH_NAME, BitDepth);
  189. AfxGetApp()->WriteProfileInt (OPTIONS_SECTION_NAME, LIGHT_EXPORT_SELECTIVE_NAME, LightExportSelective);
  190. AfxGetApp()->WriteProfileString (OPTIONS_SECTION_NAME, LIGHT_EXCLUSION_STRING_NAME, LightExclusionString);
  191. }
  192. return (result);
  193. }
  194. /***********************************************************************************************
  195. * OptionsDialog::OnChangeSpatialTolerance -- *
  196. * *
  197. * INPUT: *
  198. * *
  199. * OUTPUT: *
  200. * *
  201. * WARNINGS: *
  202. * *
  203. * HISTORY: *
  204. * 02/03/00 IML : Created. *
  205. *=============================================================================================*/
  206. void OptionsDialog::OnChangeSpatialTolerance()
  207. {
  208. SpatialTolerance = GetDlgItemInt (IDC_SPATIAL_TOLERANCE, NULL, FALSE);
  209. }
  210. void OptionsDialog::OnUpdateSpatialTolerance()
  211. {
  212. const unsigned maxtolerance = 10000;
  213. unsigned v = GetDlgItemInt (IDC_SPATIAL_TOLERANCE, NULL, FALSE);
  214. if (v > maxtolerance) SetDlgItemInt (IDC_SPATIAL_TOLERANCE, maxtolerance, FALSE);
  215. }
  216. /***********************************************************************************************
  217. * OptionsDialog::OnChangeFillColorRed -- *
  218. * *
  219. * INPUT: *
  220. * *
  221. * OUTPUT: *
  222. * *
  223. * WARNINGS: *
  224. * *
  225. * HISTORY: *
  226. * 11/16/99 IML : Created. *
  227. *=============================================================================================*/
  228. void OptionsDialog::OnChangeFillColorRed()
  229. {
  230. FillColor.R = GetDlgItemInt (IDC_FILL_COLOR_RED, NULL, FALSE);
  231. }
  232. void OptionsDialog::OnUpdateFillColorRed()
  233. {
  234. unsigned v = GetDlgItemInt (IDC_FILL_COLOR_RED, NULL, FALSE);
  235. if (v > _UI8_MAX) SetDlgItemInt (IDC_FILL_COLOR_RED, _UI8_MAX, FALSE);
  236. }
  237. /***********************************************************************************************
  238. * OptionsDialog::OnChangeFillColorGreen -- *
  239. * *
  240. * INPUT: *
  241. * *
  242. * OUTPUT: *
  243. * *
  244. * WARNINGS: *
  245. * *
  246. * HISTORY: *
  247. * 11/16/99 IML : Created. *
  248. *=============================================================================================*/
  249. void OptionsDialog::OnChangeFillColorGreen()
  250. {
  251. FillColor.G = GetDlgItemInt (IDC_FILL_COLOR_GREEN, NULL, FALSE);
  252. }
  253. void OptionsDialog::OnUpdateFillColorGreen()
  254. {
  255. unsigned v = GetDlgItemInt (IDC_FILL_COLOR_GREEN, NULL, FALSE);
  256. if (v > _UI8_MAX) SetDlgItemInt (IDC_FILL_COLOR_GREEN, _UI8_MAX, FALSE);
  257. }
  258. /***********************************************************************************************
  259. * OptionsDialog::OnChangeFillColorBlue -- *
  260. * *
  261. * INPUT: *
  262. * *
  263. * OUTPUT: *
  264. * *
  265. * WARNINGS: *
  266. * *
  267. * HISTORY: *
  268. * 11/16/99 IML : Created. *
  269. *=============================================================================================*/
  270. void OptionsDialog::OnChangeFillColorBlue()
  271. {
  272. FillColor.B = GetDlgItemInt (IDC_FILL_COLOR_BLUE, NULL, FALSE);
  273. }
  274. void OptionsDialog::OnUpdateFillColorBlue()
  275. {
  276. unsigned v = GetDlgItemInt (IDC_FILL_COLOR_BLUE, NULL, FALSE);
  277. if (v > _UI8_MAX) SetDlgItemInt (IDC_FILL_COLOR_BLUE, _UI8_MAX, FALSE);
  278. }
  279. /***********************************************************************************************
  280. * OptionsDialog::On16BitsPerPixel -- *
  281. * *
  282. * INPUT: *
  283. * *
  284. * OUTPUT: *
  285. * *
  286. * WARNINGS: *
  287. * *
  288. * HISTORY: *
  289. * 11/2/99 IML : Created. *
  290. *=============================================================================================*/
  291. void OptionsDialog::On16BitsPerPixel()
  292. {
  293. BitDepth = 16;
  294. }
  295. /***********************************************************************************************
  296. * OptionsDialog::On24BitsPerPixel -- *
  297. * *
  298. * INPUT: *
  299. * *
  300. * OUTPUT: *
  301. * *
  302. * WARNINGS: *
  303. * *
  304. * HISTORY: *
  305. * 11/2/99 IML : Created. *
  306. *=============================================================================================*/
  307. void OptionsDialog::On24BitsPerPixel()
  308. {
  309. BitDepth = 24;
  310. }
  311. /***********************************************************************************************
  312. * OptionsDialog::OnHScroll -- *
  313. * *
  314. * INPUT: *
  315. * *
  316. * OUTPUT: *
  317. * *
  318. * WARNINGS: *
  319. * *
  320. * HISTORY: *
  321. * 11/2/99 IML : Created. *
  322. *=============================================================================================*/
  323. void OptionsDialog::OnHScroll (UINT sbcode, UINT pos, CScrollBar *scrollbar)
  324. {
  325. int controlid = scrollbar->GetDlgCtrlID();
  326. CSliderCtrl *slider = (CSliderCtrl*) GetDlgItem (controlid);
  327. ASSERT (slider != NULL);
  328. switch (controlid) {
  329. case IDC_SMOOTHING_ANGLE:
  330. SmoothingAngle = slider->GetPos();
  331. Set_Text (IDC_SMOOTHING_ANGLE_VALUE, "%d", (int) SmoothingAngle);
  332. break;
  333. case IDC_FILTER_SHARPNESS:
  334. FilterSharpness = slider->GetPos();
  335. Set_Text (IDC_FILTER_SHARPNESS_VALUE, "%d", (int) FilterSharpness);
  336. break;
  337. case IDC_FILTER_ERROR:
  338. FilterError = slider->GetPos();
  339. Set_Text (IDC_FILTER_ERROR_VALUE, "%d", (int) FilterError);
  340. break;
  341. default:
  342. break;
  343. }
  344. CDialog::OnHScroll (sbcode, pos, scrollbar);
  345. }
  346. /***********************************************************************************************
  347. * OptionsDialog::OnVScroll -- *
  348. * *
  349. * INPUT: *
  350. * *
  351. * OUTPUT: *
  352. * *
  353. * WARNINGS: *
  354. * *
  355. * HISTORY: *
  356. * 08/16/00 IML : Created. *
  357. *=============================================================================================*/
  358. void OptionsDialog::OnVScroll (UINT sbcode, UINT pos, CScrollBar *scrollbar)
  359. {
  360. int controlid = scrollbar->GetDlgCtrlID();
  361. CSpinButtonCtrl *spinner = (CSpinButtonCtrl*) GetDlgItem (controlid);
  362. ASSERT (spinner != NULL);
  363. switch (controlid) {
  364. case IDC_SAMPLE_RATE:
  365. SampleRate = spinner->GetPos() & 0xffff;
  366. Set_Text (IDC_SAMPLE_RATE_VALUE, SAMPLE_RATE_VALUE_CONTROL_STRING, Get_Sample_Rate());
  367. break;
  368. default:
  369. break;
  370. }
  371. CDialog::OnVScroll (sbcode, pos, scrollbar);
  372. }
  373. /***********************************************************************************************
  374. * OptionsDialog::OnLightExportSelective -- *
  375. * *
  376. * INPUT: *
  377. * *
  378. * OUTPUT: *
  379. * *
  380. * WARNINGS: *
  381. * *
  382. * HISTORY: *
  383. * 08/16/00 IML : Created. *
  384. *=============================================================================================*/
  385. void OptionsDialog::OnLightExportSelective()
  386. {
  387. LightExportSelective = !LightExportSelective;
  388. GetDlgItem (IDC_LIGHT_EXCLUSION_STRING)->EnableWindow (LightExportSelective);
  389. }
  390. /***********************************************************************************************
  391. * OptionsDialog::OnChangeLightExclusionString -- *
  392. * *
  393. * INPUT: *
  394. * *
  395. * OUTPUT: *
  396. * *
  397. * WARNINGS: *
  398. * *
  399. * HISTORY: *
  400. * 08/16/00 IML : Created. *
  401. *=============================================================================================*/
  402. void OptionsDialog::OnChangeLightExclusionString()
  403. {
  404. GetDlgItem (IDC_LIGHT_EXCLUSION_STRING)->GetWindowText (LightExclusionString);
  405. }
  406. /***********************************************************************************************
  407. * OptionsDialog::Initialize_Slider -- *
  408. * *
  409. * INPUT: *
  410. * *
  411. * OUTPUT: *
  412. * *
  413. * WARNINGS: *
  414. * *
  415. * HISTORY: *
  416. * 11/2/99 IML : Created. *
  417. *=============================================================================================*/
  418. void OptionsDialog::Initialize_Slider (int sliderid, int start, int end, int value)
  419. {
  420. CSliderCtrl *slider;
  421. slider = (CSliderCtrl*) GetDlgItem (sliderid);
  422. ASSERT (slider != NULL);
  423. slider->SetRange (start, end);
  424. slider->SetPos (value);
  425. }
  426. /***********************************************************************************************
  427. * OptionsDialog::Initialize_Spinner -- *
  428. * *
  429. * INPUT: *
  430. * *
  431. * OUTPUT: *
  432. * *
  433. * WARNINGS: *
  434. * *
  435. * HISTORY: *
  436. * 11/2/99 IML : Created. *
  437. *=============================================================================================*/
  438. void OptionsDialog::Initialize_Spinner (int spinnerid, int start, int end, int value)
  439. {
  440. CSpinButtonCtrl *spinner;
  441. spinner = (CSpinButtonCtrl*) GetDlgItem (spinnerid);
  442. ASSERT (spinner != NULL);
  443. spinner->SetRange (start, end);
  444. spinner->SetPos (value);
  445. }
  446. /***********************************************************************************************
  447. * OptionsDialog::Set_Text -- *
  448. * *
  449. * INPUT: *
  450. * *
  451. * OUTPUT: *
  452. * *
  453. * WARNINGS: *
  454. * *
  455. * HISTORY: *
  456. * 11/2/99 IML : Created. *
  457. *=============================================================================================*/
  458. void OptionsDialog::Set_Text (int textid, const char *controlstring, int value)
  459. {
  460. StringBuilder text (32);
  461. text.Copy (controlstring, value);
  462. GetDlgItem (textid)->SetWindowText (text.String());
  463. }
  464. /***********************************************************************************************
  465. * OptionsDialog::Set_Text -- *
  466. * *
  467. * INPUT: *
  468. * *
  469. * OUTPUT: *
  470. * *
  471. * WARNINGS: *
  472. * *
  473. * HISTORY: *
  474. * 11/2/99 IML : Created. *
  475. *=============================================================================================*/
  476. void OptionsDialog::Set_Text (int textid, const char *controlstring, float value)
  477. {
  478. StringBuilder text (32);
  479. text.Copy (controlstring, value);
  480. GetDlgItem (textid)->SetWindowText (text.String());
  481. }