ListWindow.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. /*
  2. ===========================================================================
  3. Doom 3 BFG Edition GPL Source Code
  4. Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
  6. Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 BFG Edition Source Code 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. You should have received a copy of the GNU General Public License
  15. along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #pragma hdrstop
  21. #include "../idlib/precompiled.h"
  22. #include "DeviceContext.h"
  23. #include "Window.h"
  24. #include "UserInterfaceLocal.h"
  25. #include "SliderWindow.h"
  26. #include "ListWindow.h"
  27. // Number of pixels above the text that the rect starts
  28. static const int pixelOffset = 3;
  29. // number of pixels between columns
  30. static const int tabBorder = 4;
  31. // Time in milliseconds between clicks to register as a double-click
  32. static const int doubleClickSpeed = 300;
  33. void idListWindow::CommonInit() {
  34. typed = "";
  35. typedTime = 0;
  36. clickTime = 0;
  37. currentSel.Clear();
  38. top = 0;
  39. sizeBias = 0;
  40. horizontal = false;
  41. scroller = new (TAG_OLD_UI) idSliderWindow(gui);
  42. multipleSel = false;
  43. }
  44. idListWindow::idListWindow(idUserInterfaceLocal *g) : idWindow(g) {
  45. gui = g;
  46. CommonInit();
  47. }
  48. void idListWindow::SetCurrentSel( int sel ) {
  49. currentSel.Clear();
  50. currentSel.Append( sel );
  51. }
  52. void idListWindow::ClearSelection( int sel ) {
  53. int cur = currentSel.FindIndex( sel );
  54. if ( cur >= 0 ) {
  55. currentSel.RemoveIndex( cur );
  56. }
  57. }
  58. void idListWindow::AddCurrentSel( int sel ) {
  59. currentSel.Append( sel );
  60. }
  61. int idListWindow::GetCurrentSel() {
  62. return ( currentSel.Num() ) ? currentSel[0] : 0;
  63. }
  64. bool idListWindow::IsSelected( int index ) {
  65. return ( currentSel.FindIndex( index ) >= 0 );
  66. }
  67. const char *idListWindow::HandleEvent(const sysEvent_t *event, bool *updateVisuals) {
  68. // need to call this to allow proper focus and capturing on embedded children
  69. const char *ret = idWindow::HandleEvent(event, updateVisuals);
  70. float vert = GetMaxCharHeight();
  71. int numVisibleLines = textRect.h / vert;
  72. int key = event->evValue;
  73. if ( event->evType == SE_KEY ) {
  74. if ( !event->evValue2 ) {
  75. // We only care about key down, not up
  76. return ret;
  77. }
  78. if ( key == K_MOUSE1 || key == K_MOUSE2 ) {
  79. // If the user clicked in the scroller, then ignore it
  80. if ( scroller->Contains(gui->CursorX(), gui->CursorY()) ) {
  81. return ret;
  82. }
  83. }
  84. if ( ( key == K_ENTER || key == K_KP_ENTER ) ) {
  85. RunScript( ON_ENTER );
  86. return cmd;
  87. }
  88. if ( key == K_MWHEELUP ) {
  89. key = K_UPARROW;
  90. } else if ( key == K_MWHEELDOWN ) {
  91. key = K_DOWNARROW;
  92. }
  93. if ( key == K_MOUSE1) {
  94. if (Contains(gui->CursorX(), gui->CursorY())) {
  95. int cur = ( int )( ( gui->CursorY() - actualY - pixelOffset ) / vert ) + top;
  96. if ( cur >= 0 && cur < listItems.Num() ) {
  97. if ( multipleSel && ( idKeyInput::IsDown( K_LCTRL ) || idKeyInput::IsDown( K_RCTRL ) ) ) {
  98. if ( IsSelected( cur ) ) {
  99. ClearSelection( cur );
  100. } else {
  101. AddCurrentSel( cur );
  102. }
  103. } else {
  104. if ( IsSelected( cur ) && ( gui->GetTime() < clickTime + doubleClickSpeed ) ) {
  105. // Double-click causes ON_ENTER to get run
  106. RunScript(ON_ENTER);
  107. return cmd;
  108. }
  109. SetCurrentSel( cur );
  110. clickTime = gui->GetTime();
  111. }
  112. } else {
  113. SetCurrentSel( listItems.Num() - 1 );
  114. }
  115. }
  116. } else if ( key == K_UPARROW || key == K_PGUP || key == K_DOWNARROW || key == K_PGDN ) {
  117. int numLines = 1;
  118. if ( key == K_PGUP || key == K_PGDN ) {
  119. numLines = numVisibleLines / 2;
  120. }
  121. if ( key == K_UPARROW || key == K_PGUP ) {
  122. numLines = -numLines;
  123. }
  124. if ( idKeyInput::IsDown( K_LCTRL ) || idKeyInput::IsDown( K_RCTRL ) ) {
  125. top += numLines;
  126. } else {
  127. SetCurrentSel( GetCurrentSel() + numLines );
  128. }
  129. } else {
  130. return ret;
  131. }
  132. } else if ( event->evType == SE_CHAR ) {
  133. if ( !idStr::CharIsPrintable(key) ) {
  134. return ret;
  135. }
  136. if ( gui->GetTime() > typedTime + 1000 ) {
  137. typed = "";
  138. }
  139. typedTime = gui->GetTime();
  140. typed.Append( key );
  141. for ( int i=0; i<listItems.Num(); i++ ) {
  142. if ( idStr::Icmpn( typed, listItems[i], typed.Length() ) == 0 ) {
  143. SetCurrentSel( i );
  144. break;
  145. }
  146. }
  147. } else {
  148. return ret;
  149. }
  150. if ( GetCurrentSel() < 0 ) {
  151. SetCurrentSel( 0 );
  152. }
  153. if ( GetCurrentSel() >= listItems.Num() ) {
  154. SetCurrentSel( listItems.Num() - 1 );
  155. }
  156. if ( scroller->GetHigh() > 0.0f ) {
  157. if ( !idKeyInput::IsDown( K_LCTRL ) && !idKeyInput::IsDown( K_RCTRL ) ) {
  158. if ( top > GetCurrentSel() - 1 ) {
  159. top = GetCurrentSel() - 1;
  160. }
  161. if ( top < GetCurrentSel() - numVisibleLines + 2 ) {
  162. top = GetCurrentSel() - numVisibleLines + 2;
  163. }
  164. }
  165. if ( top > listItems.Num() - 2 ) {
  166. top = listItems.Num() - 2;
  167. }
  168. if ( top < 0 ) {
  169. top = 0;
  170. }
  171. scroller->SetValue(top);
  172. } else {
  173. top = 0;
  174. scroller->SetValue(0.0f);
  175. }
  176. if ( key != K_MOUSE1 ) {
  177. // Send a fake mouse click event so onAction gets run in our parents
  178. const sysEvent_t ev = sys->GenerateMouseButtonEvent( 1, true );
  179. idWindow::HandleEvent(&ev, updateVisuals);
  180. }
  181. if ( currentSel.Num() > 0 ) {
  182. for ( int i = 0; i < currentSel.Num(); i++ ) {
  183. gui->SetStateInt( va( "%s_sel_%i", listName.c_str(), i ), currentSel[i] );
  184. }
  185. } else {
  186. gui->SetStateInt( va( "%s_sel_0", listName.c_str() ), 0 );
  187. }
  188. gui->SetStateInt( va( "%s_numsel", listName.c_str() ), currentSel.Num() );
  189. return ret;
  190. }
  191. bool idListWindow::ParseInternalVar(const char *_name, idTokenParser *src) {
  192. if (idStr::Icmp(_name, "horizontal") == 0) {
  193. horizontal = src->ParseBool();
  194. return true;
  195. }
  196. if (idStr::Icmp(_name, "listname") == 0) {
  197. ParseString(src, listName);
  198. return true;
  199. }
  200. if (idStr::Icmp(_name, "tabstops") == 0) {
  201. ParseString(src, tabStopStr);
  202. return true;
  203. }
  204. if (idStr::Icmp(_name, "tabaligns") == 0) {
  205. ParseString(src, tabAlignStr);
  206. return true;
  207. }
  208. if (idStr::Icmp(_name, "multipleSel") == 0) {
  209. multipleSel = src->ParseBool();
  210. return true;
  211. }
  212. if(idStr::Icmp(_name, "tabvaligns") == 0) {
  213. ParseString(src, tabVAlignStr);
  214. return true;
  215. }
  216. if(idStr::Icmp(_name, "tabTypes") == 0) {
  217. ParseString(src, tabTypeStr);
  218. return true;
  219. }
  220. if(idStr::Icmp(_name, "tabIconSizes") == 0) {
  221. ParseString(src, tabIconSizeStr);
  222. return true;
  223. }
  224. if(idStr::Icmp(_name, "tabIconVOffset") == 0) {
  225. ParseString(src, tabIconVOffsetStr);
  226. return true;
  227. }
  228. idStr strName = _name;
  229. if(idStr::Icmp(strName.Left(4), "mtr_") == 0) {
  230. idStr matName;
  231. const idMaterial* mat;
  232. ParseString(src, matName);
  233. mat = declManager->FindMaterial(matName);
  234. if ( mat != NULL && !mat->TestMaterialFlag( MF_DEFAULTED ) ) {
  235. mat->SetSort(SS_GUI );
  236. }
  237. iconMaterials.Set(_name, mat);
  238. return true;
  239. }
  240. return idWindow::ParseInternalVar(_name, src);
  241. }
  242. idWinVar *idListWindow::GetWinVarByName(const char *_name, bool fixup, drawWin_t** owner) {
  243. return idWindow::GetWinVarByName(_name, fixup, owner);
  244. }
  245. void idListWindow::PostParse() {
  246. idWindow::PostParse();
  247. InitScroller(horizontal);
  248. idList<int> tabStops;
  249. idList<int> tabAligns;
  250. if (tabStopStr.Length()) {
  251. idParser src(tabStopStr, tabStopStr.Length(), "tabstops", LEXFL_NOFATALERRORS | LEXFL_NOSTRINGCONCAT | LEXFL_NOSTRINGESCAPECHARS);
  252. idToken tok;
  253. while (src.ReadToken(&tok)) {
  254. if (tok == ",") {
  255. continue;
  256. }
  257. tabStops.Append(atoi(tok));
  258. }
  259. }
  260. if (tabAlignStr.Length()) {
  261. idParser src(tabAlignStr, tabAlignStr.Length(), "tabaligns", LEXFL_NOFATALERRORS | LEXFL_NOSTRINGCONCAT | LEXFL_NOSTRINGESCAPECHARS);
  262. idToken tok;
  263. while (src.ReadToken(&tok)) {
  264. if (tok == ",") {
  265. continue;
  266. }
  267. tabAligns.Append(atoi(tok));
  268. }
  269. }
  270. idList<int> tabVAligns;
  271. if (tabVAlignStr.Length()) {
  272. idParser src(tabVAlignStr, tabVAlignStr.Length(), "tabvaligns", LEXFL_NOFATALERRORS | LEXFL_NOSTRINGCONCAT | LEXFL_NOSTRINGESCAPECHARS);
  273. idToken tok;
  274. while (src.ReadToken(&tok)) {
  275. if (tok == ",") {
  276. continue;
  277. }
  278. tabVAligns.Append(atoi(tok));
  279. }
  280. }
  281. idList<int> tabTypes;
  282. if (tabTypeStr.Length()) {
  283. idParser src(tabTypeStr, tabTypeStr.Length(), "tabtypes", LEXFL_NOFATALERRORS | LEXFL_NOSTRINGCONCAT | LEXFL_NOSTRINGESCAPECHARS);
  284. idToken tok;
  285. while (src.ReadToken(&tok)) {
  286. if (tok == ",") {
  287. continue;
  288. }
  289. tabTypes.Append(atoi(tok));
  290. }
  291. }
  292. idList<idVec2> tabSizes;
  293. if (tabIconSizeStr.Length()) {
  294. idParser src(tabIconSizeStr, tabIconSizeStr.Length(), "tabiconsizes", LEXFL_NOFATALERRORS | LEXFL_NOSTRINGCONCAT | LEXFL_NOSTRINGESCAPECHARS);
  295. idToken tok;
  296. while (src.ReadToken(&tok)) {
  297. if (tok == ",") {
  298. continue;
  299. }
  300. idVec2 size;
  301. size.x = atoi(tok);
  302. src.ReadToken(&tok); //","
  303. src.ReadToken(&tok);
  304. size.y = atoi(tok);
  305. tabSizes.Append(size);
  306. }
  307. }
  308. idList<float> tabIconVOffsets;
  309. if (tabIconVOffsetStr.Length()) {
  310. idParser src(tabIconVOffsetStr, tabIconVOffsetStr.Length(), "tabiconvoffsets", LEXFL_NOFATALERRORS | LEXFL_NOSTRINGCONCAT | LEXFL_NOSTRINGESCAPECHARS);
  311. idToken tok;
  312. while (src.ReadToken(&tok)) {
  313. if (tok == ",") {
  314. continue;
  315. }
  316. tabIconVOffsets.Append(atof(tok));
  317. }
  318. }
  319. int c = tabStops.Num();
  320. bool doAligns = (tabAligns.Num() == tabStops.Num());
  321. for (int i = 0; i < c; i++) {
  322. idTabRect r;
  323. r.x = tabStops[i];
  324. r.w = (i < c - 1) ? tabStops[i+1] - r.x - tabBorder : -1;
  325. r.align = (doAligns) ? tabAligns[i] : 0;
  326. if(tabVAligns.Num() > 0) {
  327. r.valign = tabVAligns[i];
  328. } else {
  329. r.valign = 0;
  330. }
  331. if(tabTypes.Num() > 0) {
  332. r.type = tabTypes[i];
  333. } else {
  334. r.type = TAB_TYPE_TEXT;
  335. }
  336. if(tabSizes.Num() > 0) {
  337. r.iconSize = tabSizes[i];
  338. } else {
  339. r.iconSize.Zero();
  340. }
  341. if(tabIconVOffsets.Num() > 0 ) {
  342. r.iconVOffset = tabIconVOffsets[i];
  343. } else {
  344. r.iconVOffset = 0;
  345. }
  346. tabInfo.Append(r);
  347. }
  348. flags |= WIN_CANFOCUS;
  349. }
  350. /*
  351. ================
  352. idListWindow::InitScroller
  353. This is the same as in idEditWindow
  354. ================
  355. */
  356. void idListWindow::InitScroller( bool horizontal )
  357. {
  358. const char *thumbImage = "guis/assets/scrollbar_thumb.tga";
  359. const char *barImage = "guis/assets/scrollbarv.tga";
  360. const char *scrollerName = "_scrollerWinV";
  361. if (horizontal) {
  362. barImage = "guis/assets/scrollbarh.tga";
  363. scrollerName = "_scrollerWinH";
  364. }
  365. const idMaterial *mat = declManager->FindMaterial( barImage );
  366. mat->SetSort( SS_GUI );
  367. sizeBias = mat->GetImageWidth();
  368. idRectangle scrollRect;
  369. if (horizontal) {
  370. sizeBias = mat->GetImageHeight();
  371. scrollRect.x = 0;
  372. scrollRect.y = (clientRect.h - sizeBias);
  373. scrollRect.w = clientRect.w;
  374. scrollRect.h = sizeBias;
  375. } else {
  376. scrollRect.x = (clientRect.w - sizeBias);
  377. scrollRect.y = 0;
  378. scrollRect.w = sizeBias;
  379. scrollRect.h = clientRect.h;
  380. }
  381. scroller->InitWithDefaults(scrollerName, scrollRect, foreColor, matColor, mat->GetName(), thumbImage, !horizontal, true);
  382. InsertChild(scroller, NULL);
  383. scroller->SetBuddy(this);
  384. }
  385. void idListWindow::Draw(int time, float x, float y) {
  386. idVec4 color;
  387. idStr work;
  388. int count = listItems.Num();
  389. idRectangle rect = textRect;
  390. float scale = textScale;
  391. float lineHeight = GetMaxCharHeight();
  392. float bottom = textRect.Bottom();
  393. float width = textRect.w;
  394. if ( scroller->GetHigh() > 0.0f ) {
  395. if ( horizontal ) {
  396. bottom -= sizeBias;
  397. } else {
  398. width -= sizeBias;
  399. rect.w = width;
  400. }
  401. }
  402. if ( noEvents || !Contains(gui->CursorX(), gui->CursorY()) ) {
  403. hover = false;
  404. }
  405. for (int i = top; i < count; i++) {
  406. if ( IsSelected( i ) ) {
  407. rect.h = lineHeight;
  408. dc->DrawFilledRect(rect.x, rect.y + pixelOffset, rect.w, rect.h, borderColor);
  409. if ( flags & WIN_FOCUS ) {
  410. idVec4 color = borderColor;
  411. color.w = 1.0f;
  412. dc->DrawRect(rect.x, rect.y + pixelOffset, rect.w, rect.h, 1.0f, color );
  413. }
  414. }
  415. rect.y ++;
  416. rect.h = lineHeight - 1;
  417. if ( hover && !noEvents && Contains(rect, gui->CursorX(), gui->CursorY()) ) {
  418. color = hoverColor;
  419. } else {
  420. color = foreColor;
  421. }
  422. rect.h = lineHeight + pixelOffset;
  423. rect.y --;
  424. if ( tabInfo.Num() > 0 ) {
  425. int start = 0;
  426. int tab = 0;
  427. int stop = listItems[i].Find('\t', 0);
  428. while ( start < listItems[i].Length() ) {
  429. if ( tab >= tabInfo.Num() ) {
  430. common->Warning( "idListWindow::Draw: gui '%s' window '%s' tabInfo.Num() exceeded", gui->GetSourceFile(), name.c_str() );
  431. break;
  432. }
  433. listItems[i].Mid(start, stop - start, work);
  434. rect.x = textRect.x + tabInfo[tab].x;
  435. rect.w = (tabInfo[tab].w == -1) ? width - tabInfo[tab].x : tabInfo[tab].w;
  436. dc->PushClipRect( rect );
  437. if ( tabInfo[tab].type == TAB_TYPE_TEXT ) {
  438. dc->DrawText(work, scale, tabInfo[tab].align, color, rect, false, -1);
  439. } else if (tabInfo[tab].type == TAB_TYPE_ICON) {
  440. const idMaterial **hashMat;
  441. const idMaterial *iconMat;
  442. // leaving the icon name empty doesn't draw anything
  443. if ( work[0] != '\0' ) {
  444. if ( iconMaterials.Get(work, &hashMat) == false ) {
  445. iconMat = declManager->FindMaterial("_default");
  446. } else {
  447. iconMat = *hashMat;
  448. }
  449. idRectangle iconRect;
  450. iconRect.w = tabInfo[tab].iconSize.x;
  451. iconRect.h = tabInfo[tab].iconSize.y;
  452. if(tabInfo[tab].align == idDeviceContext::ALIGN_LEFT) {
  453. iconRect.x = rect.x;
  454. } else if (tabInfo[tab].align == idDeviceContext::ALIGN_CENTER) {
  455. iconRect.x = rect.x + rect.w/2.0f - iconRect.w/2.0f;
  456. } else if (tabInfo[tab].align == idDeviceContext::ALIGN_RIGHT) {
  457. iconRect.x = rect.x + rect.w - iconRect.w;
  458. }
  459. if(tabInfo[tab].valign == 0) { //Top
  460. iconRect.y = rect.y + tabInfo[tab].iconVOffset;
  461. } else if(tabInfo[tab].valign == 1) { //Center
  462. iconRect.y = rect.y + rect.h/2.0f - iconRect.h/2.0f + tabInfo[tab].iconVOffset;
  463. } else if(tabInfo[tab].valign == 2) { //Bottom
  464. iconRect.y = rect.y + rect.h - iconRect.h + tabInfo[tab].iconVOffset;
  465. }
  466. dc->DrawMaterial(iconRect.x, iconRect.y, iconRect.w, iconRect.h, iconMat, idVec4(1.0f,1.0f,1.0f,1.0f), 1.0f, 1.0f);
  467. }
  468. }
  469. dc->PopClipRect();
  470. start = stop + 1;
  471. stop = listItems[i].Find('\t', start);
  472. if ( stop < 0 ) {
  473. stop = listItems[i].Length();
  474. }
  475. tab++;
  476. }
  477. rect.x = textRect.x;
  478. rect.w = width;
  479. } else {
  480. dc->DrawText(listItems[i], scale, 0, color, rect, false, -1);
  481. }
  482. rect.y += lineHeight;
  483. if ( rect.y > bottom ) {
  484. break;
  485. }
  486. }
  487. }
  488. void idListWindow::Activate(bool activate, idStr &act) {
  489. idWindow::Activate(activate, act);
  490. if ( activate ) {
  491. UpdateList();
  492. }
  493. }
  494. void idListWindow::HandleBuddyUpdate(idWindow *buddy) {
  495. top = scroller->GetValue();
  496. }
  497. void idListWindow::UpdateList() {
  498. idStr str, strName;
  499. listItems.Clear();
  500. for (int i = 0; i < MAX_LIST_ITEMS; i++) {
  501. if (gui->State().GetString( va("%s_item_%i", listName.c_str(), i), "", str) ) {
  502. if ( str.Length() ) {
  503. listItems.Append(str);
  504. }
  505. } else {
  506. break;
  507. }
  508. }
  509. float vert = GetMaxCharHeight();
  510. int fit = textRect.h / vert;
  511. if ( listItems.Num() < fit ) {
  512. scroller->SetRange(0.0f, 0.0f, 1.0f);
  513. } else {
  514. scroller->SetRange(0.0f, (listItems.Num() - fit) + 1.0f, 1.0f);
  515. }
  516. SetCurrentSel( gui->State().GetInt( va( "%s_sel_0", listName.c_str() ) ) );
  517. float value = scroller->GetValue();
  518. if ( value > listItems.Num() - 1 ) {
  519. value = listItems.Num() - 1;
  520. }
  521. if ( value < 0.0f ) {
  522. value = 0.0f;
  523. }
  524. scroller->SetValue(value);
  525. top = value;
  526. typedTime = 0;
  527. clickTime = 0;
  528. typed = "";
  529. }
  530. void idListWindow::StateChanged( bool redraw ) {
  531. UpdateList();
  532. }