menuentryctrl.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789
  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. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Combat *
  23. * *
  24. * $Archive:: /Commando/Code/wwui/menuentryctrl.cpp $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 1/02/02 11:01a $*
  29. * *
  30. * $Revision:: 19 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #include "menuentryctrl.h"
  36. #include "assetmgr.h"
  37. #include "font3d.h"
  38. #include "dialogbase.h"
  39. #include "mousemgr.h"
  40. #include "stylemgr.h"
  41. #include "dialogmgr.h"
  42. #include "texture.h"
  43. #include "ww3d.h"
  44. ////////////////////////////////////////////////////////////////
  45. // Static member initialization
  46. ////////////////////////////////////////////////////////////////
  47. int MenuEntryCtrlClass::MaxDefaultRedValue = 9;
  48. int MenuEntryCtrlClass::MaxHilightRedValue = 16;
  49. ////////////////////////////////////////////////////////////////
  50. //
  51. // MenuEntryCtrlClass
  52. //
  53. ////////////////////////////////////////////////////////////////
  54. MenuEntryCtrlClass::MenuEntryCtrlClass (void) :
  55. CurrState (UP),
  56. WasButtonPressedOnMe (false),
  57. IsMouseOverMe (false),
  58. CurrRadiusX (5),
  59. CurrRadiusY (5),
  60. StartTime (0),
  61. EndTime (0),
  62. CurrColor (RGB_TO_INT32 (0, MaxDefaultRedValue, 0))
  63. {
  64. //
  65. // Get the current bits-per-pixel of the display
  66. //
  67. int foo = 0;
  68. int bits = 0;
  69. bool windowed = 0;
  70. WW3D::Get_Device_Resolution (foo, foo, bits, windowed);
  71. //
  72. // If we are running at anything less then 32bpp, then
  73. // scale the glow colors
  74. //
  75. if (bits < 32) {
  76. MaxDefaultRedValue = 11;
  77. MaxHilightRedValue = 22;
  78. }
  79. //
  80. // Set the font for the text renderer
  81. //
  82. StyleMgrClass::Assign_Font (&TextRenderer, StyleMgrClass::FONT_MENU);
  83. StyleMgrClass::Assign_Font (&GlowRenderer, StyleMgrClass::FONT_MENU);
  84. return ;
  85. }
  86. ////////////////////////////////////////////////////////////////
  87. //
  88. // ~MenuEntryCtrlClass
  89. //
  90. ////////////////////////////////////////////////////////////////
  91. MenuEntryCtrlClass::~MenuEntryCtrlClass (void)
  92. {
  93. return ;
  94. }
  95. ////////////////////////////////////////////////////////////////
  96. //
  97. // Render
  98. //
  99. ////////////////////////////////////////////////////////////////
  100. void
  101. MenuEntryCtrlClass::Render (void)
  102. {
  103. //
  104. // Refresh the cached renderer (if necessary)
  105. //
  106. if (Is_Dirty ()) {
  107. Create_Text_Renderer ();
  108. }
  109. //
  110. // Render the menu text
  111. //
  112. GlowRenderer.Render ();
  113. TextRenderer.Render ();
  114. DialogControlClass::Render ();
  115. return ;
  116. }
  117. ////////////////////////////////////////////////////////////////
  118. //
  119. // On_Frame_Update
  120. //
  121. ////////////////////////////////////////////////////////////////
  122. void
  123. MenuEntryCtrlClass::On_Frame_Update (void)
  124. {
  125. //
  126. // Allow the current state to update
  127. //
  128. Update_State ();
  129. return ;
  130. }
  131. ////////////////////////////////////////////////////////////////
  132. //
  133. // On_Create
  134. //
  135. ////////////////////////////////////////////////////////////////
  136. void
  137. MenuEntryCtrlClass::On_Create (void)
  138. {
  139. if ((Style & 0xF) == BS_OWNERDRAW) {
  140. //
  141. // Set the font for the text renderer
  142. //
  143. StyleMgrClass::Assign_Font (&TextRenderer, StyleMgrClass::FONT_SM_MENU);
  144. StyleMgrClass::Assign_Font (&GlowRenderer, StyleMgrClass::FONT_SM_MENU);
  145. /*FontCharsClass *font = WW3DAssetManager::Get_Instance()->Get_FontChars ("Lucida Sans Unicode", 12);
  146. TextRenderer.Set_Font (font);
  147. GlowRenderer.Set_Font (font);
  148. font->Release_Ref ();*/
  149. }
  150. TextRenderer.Build_Sentence (Title);
  151. GlowRenderer.Build_Sentence (Title);
  152. //
  153. // Determine what rectangle should be clickable
  154. //
  155. Vector2 extents = TextRenderer.Get_Text_Extents (Title);
  156. Rect = MaxRect;
  157. //
  158. // Should we left justify?
  159. //
  160. if ((Style & 0xF00) == BS_LEFT) {
  161. Rect.Right = Rect.Left + extents.X + TextRenderer.Get_Text_Extents (L"W").X;
  162. } else {
  163. Rect.Left = int(Rect.Left + (Rect.Width () / 2) - (extents.X / 2));
  164. Rect.Right = Rect.Left + extents.X + TextRenderer.Get_Text_Extents (L"W").X;
  165. }
  166. return ;
  167. }
  168. ////////////////////////////////////////////////////////////////
  169. //
  170. // Update_Client_Rect
  171. //
  172. ////////////////////////////////////////////////////////////////
  173. void
  174. MenuEntryCtrlClass::Update_Client_Rect (void)
  175. {
  176. MaxRect = Rect;
  177. Set_Dirty ();
  178. return ;
  179. }
  180. ////////////////////////////////////////////////////////////////
  181. //
  182. // On_Mouse_Wheel
  183. //
  184. ////////////////////////////////////////////////////////////////
  185. void
  186. MenuEntryCtrlClass::On_Mouse_Wheel (int direction)
  187. {
  188. if (HasFocus) {
  189. //
  190. // Find the next control to set the focus to...
  191. //
  192. DialogControlClass *control = Parent->Find_Next_Group_Control (this, direction);
  193. if (control != NULL) {
  194. control->Set_Focus ();
  195. control->Center_Mouse ();
  196. }
  197. }
  198. return ;
  199. }
  200. ////////////////////////////////////////////////////////////////
  201. //
  202. // On_LButton_Down
  203. //
  204. ////////////////////////////////////////////////////////////////
  205. void
  206. MenuEntryCtrlClass::On_LButton_Down (const Vector2 &mouse_pos)
  207. {
  208. Set_Capture ();
  209. //
  210. // Update our mouse flags
  211. //
  212. WasButtonPressedOnMe = true;
  213. IsMouseOverMe = Rect.Contains (mouse_pos);
  214. if (IsMouseOverMe) {
  215. Set_State (DOWN);
  216. }
  217. return ;
  218. }
  219. ////////////////////////////////////////////////////////////////
  220. //
  221. // On_LButton_Up
  222. //
  223. ////////////////////////////////////////////////////////////////
  224. void
  225. MenuEntryCtrlClass::On_LButton_Up (const Vector2 &mouse_pos)
  226. {
  227. Release_Capture ();
  228. //
  229. // Update our mouse flags
  230. //
  231. WasButtonPressedOnMe = false;
  232. IsMouseOverMe = Rect.Contains (mouse_pos);
  233. //
  234. // Switch states
  235. //
  236. if (CurrState != DOWN) {
  237. if (HasFocus) {
  238. if (IsMouseOverMe == false || CurrState != DOWN) {
  239. Set_State (HILIGHT);
  240. }
  241. } else {
  242. Set_State (UP);
  243. }
  244. }
  245. return ;
  246. }
  247. ////////////////////////////////////////////////////////////////
  248. //
  249. // On_Mouse_Move
  250. //
  251. ////////////////////////////////////////////////////////////////
  252. void
  253. MenuEntryCtrlClass::On_Mouse_Move (const Vector2 &mouse_pos)
  254. {
  255. //
  256. // Force focus onto the control
  257. //
  258. Set_Focus ();
  259. //
  260. // Check to see whether or not the mouse is over the control
  261. //
  262. IsMouseOverMe = Rect.Contains (mouse_pos);
  263. return ;
  264. }
  265. ////////////////////////////////////////////////////////////////
  266. //
  267. // Set_State
  268. //
  269. ////////////////////////////////////////////////////////////////
  270. void
  271. MenuEntryCtrlClass::Set_State (int new_state)
  272. {
  273. if (new_state != CurrState) {
  274. //
  275. // Update the state and force a repaint
  276. //
  277. CurrState = new_state;
  278. Set_Dirty ();
  279. //
  280. // Switch to the new state
  281. //
  282. switch (CurrState)
  283. {
  284. case UP:
  285. CurrRadiusX = 5;
  286. CurrRadiusY = 5;
  287. break;
  288. case DOWN:
  289. StartTime = DialogMgrClass::Get_Time ();
  290. EndTime = StartTime + 300;
  291. CurrColor = RGB_TO_INT32 (MaxHilightRedValue, 0, 0);
  292. //
  293. // Play the sound effect
  294. //
  295. StyleMgrClass::Play_Sound (StyleMgrClass::EVENT_MOUSE_CLICK);
  296. break;
  297. case HILIGHT:
  298. StartTime = DialogMgrClass::Get_Time ();
  299. EndTime = StartTime + 1000;
  300. CurrColor = RGB_TO_INT32 (MaxHilightRedValue, 0, 0);
  301. break;
  302. }
  303. }
  304. return ;
  305. }
  306. ////////////////////////////////////////////////////////////////
  307. //
  308. // Update_State
  309. //
  310. ////////////////////////////////////////////////////////////////
  311. void
  312. MenuEntryCtrlClass::Update_State (void)
  313. {
  314. switch (CurrState)
  315. {
  316. case UP:
  317. break;
  318. case DOWN:
  319. {
  320. //
  321. // Do we need to animate the glow?
  322. //
  323. int curr_time = DialogMgrClass::Get_Time ();
  324. if (curr_time < EndTime) {
  325. //
  326. // Expand the glow
  327. //
  328. float percent = float(curr_time - StartTime) / float(EndTime - StartTime);
  329. CurrRadiusX = int(5.0F + (155.0F * percent));
  330. CurrRadiusY = int(5.0F + (25.0F * percent));
  331. CurrColor = RGB_TO_INT32 (MaxHilightRedValue * 3, 0, 0);
  332. uint32 time1 = StartTime;
  333. uint32 time2 = time1 + (EndTime - StartTime) / 2;
  334. uint32 time3 = EndTime;
  335. if (curr_time >= (int)time2) {
  336. Vector3 start_color (MaxHilightRedValue * 3, MaxHilightRedValue * 3.0F * 0.6F, 0);
  337. Vector3 end_color (0, 0, 0);
  338. //
  339. // Transition the color from start to finish
  340. //
  341. uint32 start_time = time2;
  342. uint32 end_time = time3;
  343. float percent = float(float(curr_time - start_time) / float(end_time - start_time));
  344. Vector3 color = start_color + (end_color - start_color) * percent;
  345. CurrColor = RGB_TO_INT32 (color.X, color.Y, color.Z);
  346. } else {
  347. Vector3 start_color (MaxHilightRedValue * 3, 0, 0);
  348. Vector3 end_color (MaxHilightRedValue * 3, MaxHilightRedValue * 3.0F * 0.6F, 0);
  349. uint32 start_time = time1;
  350. uint32 end_time = time2;
  351. float percent = float(float(curr_time - start_time) / float(end_time - start_time));
  352. Vector3 color = start_color + (end_color - start_color) * percent;
  353. CurrColor = RGB_TO_INT32 (color.X, color.Y, color.Z);
  354. }
  355. //
  356. // Force update the display
  357. //
  358. Set_Dirty ();
  359. } else {
  360. if (CurrRadiusX != 160.0F) {
  361. //
  362. // Snap the glow to its max
  363. //
  364. CurrRadiusX = 160.0F;
  365. CurrRadiusY = 60.0F;
  366. CurrColor = RGB_TO_INT32 (0, 0, 0);
  367. }
  368. //
  369. // Send the command (if necessary)
  370. //
  371. On_Pushed ();
  372. if (HasFocus) {
  373. Set_State (HILIGHT);
  374. } else {
  375. Set_State (UP);
  376. }
  377. }
  378. break;
  379. }
  380. case HILIGHT:
  381. {
  382. //
  383. // Do we need to animate the glow?
  384. //
  385. int curr_time = DialogMgrClass::Get_Time ();
  386. if (curr_time < EndTime) {
  387. //
  388. // Expand the glow
  389. //
  390. float percent = float(curr_time - StartTime) / float(EndTime - StartTime);
  391. CurrRadiusX = int(5.0F + (55.0F * percent));
  392. CurrRadiusY = CurrRadiusX;
  393. //
  394. // Fade out the color
  395. //
  396. if (curr_time > (EndTime - 500)) {
  397. float start_time = EndTime - 500;
  398. float red_percent = float(float(curr_time - start_time) / float(EndTime - start_time));
  399. int red_value = (1.0F - red_percent) * MaxHilightRedValue;
  400. CurrColor = RGB_TO_INT32 (red_value, 0, 0);
  401. }
  402. //
  403. // Force update the display
  404. //
  405. Set_Dirty ();
  406. } else {
  407. //
  408. // Snap the glow to its max
  409. //
  410. CurrRadiusX = 5;
  411. CurrRadiusY = 5;
  412. CurrColor = RGB_TO_INT32 (MaxHilightRedValue, 0, 0);
  413. //
  414. // Restart the animation
  415. //
  416. StartTime = curr_time;
  417. EndTime = curr_time + 1000;
  418. }
  419. break;
  420. }
  421. }
  422. return ;
  423. }
  424. ////////////////////////////////////////////////////////////////
  425. //
  426. // Create_Text_Renderer
  427. //
  428. ////////////////////////////////////////////////////////////////
  429. void
  430. MenuEntryCtrlClass::Create_Text_Renderer (void)
  431. {
  432. TextRenderer.Reset_Polys ();
  433. GlowRenderer.Reset_Polys ();
  434. //
  435. // Get the extents of the text we will be drawing
  436. //
  437. Vector2 text_extent = TextRenderer.Get_Text_Extents (Title);
  438. //
  439. // Assume cenetered text
  440. //
  441. int x_pos = int(Rect.Left + (Rect.Width () / 2) - (text_extent.X / 2));
  442. int y_pos = int(Rect.Top + (Rect.Height () / 2) - (text_extent.Y / 2));
  443. //
  444. // Should we left justify?
  445. //
  446. if ((Style & 0xF00) == BS_LEFT) {
  447. x_pos = int(Rect.Left + 1);
  448. }
  449. if (CurrState == UP) {
  450. //
  451. // Render the glow
  452. //
  453. Create_Glow (CurrRadiusX, CurrRadiusY, RGB_TO_INT32 (MaxDefaultRedValue, 0, 0));
  454. //
  455. // Render the text
  456. //
  457. TextRenderer.Set_Location (Vector2 (x_pos, y_pos));
  458. TextRenderer.Draw_Sentence (StyleMgrClass::Get_Text_Color ());
  459. } else if (CurrState == DOWN) {
  460. //
  461. // Render the glow
  462. //
  463. Create_Glow (CurrRadiusX, CurrRadiusY, CurrColor);
  464. //
  465. // Render the text
  466. //
  467. TextRenderer.Set_Location (Vector2 (x_pos + 1, y_pos + 1));
  468. TextRenderer.Draw_Sentence (RGB_TO_INT32 (0, 0, 0));
  469. TextRenderer.Set_Location (Vector2 (x_pos, y_pos));
  470. TextRenderer.Draw_Sentence (RGB_TO_INT32 (0, 0, 0));
  471. } else if (CurrState == HILIGHT) {
  472. //
  473. // Render the glow
  474. //
  475. Create_Glow (CurrRadiusX, CurrRadiusY, CurrColor);
  476. TextRenderer.Set_Location (Vector2 (x_pos-1, y_pos-1));
  477. TextRenderer.Draw_Sentence (StyleMgrClass::Get_Text_Color ());
  478. TextRenderer.Set_Location (Vector2 (x_pos, y_pos));
  479. TextRenderer.Draw_Sentence (RGB_TO_INT32 (0, 0, 0));
  480. }
  481. return ;
  482. }
  483. ////////////////////////////////////////////////////////////////
  484. //
  485. // On_Set_Cursor
  486. //
  487. ////////////////////////////////////////////////////////////////
  488. void
  489. MenuEntryCtrlClass::On_Set_Cursor (const Vector2 &mouse_pos)
  490. {
  491. //
  492. // Change the mouse cursor if necessary
  493. //
  494. if (Rect.Contains (mouse_pos)) {
  495. MouseMgrClass::Set_Cursor (MouseMgrClass::CURSOR_ACTION);
  496. } else {
  497. MouseMgrClass::Set_Cursor (MouseMgrClass::CURSOR_ARROW);
  498. }
  499. return ;
  500. }
  501. ////////////////////////////////////////////////////////////////
  502. //
  503. // Create_Glow
  504. //
  505. ////////////////////////////////////////////////////////////////
  506. void
  507. MenuEntryCtrlClass::Create_Glow (int radiusx, int radiusy, int color)
  508. {
  509. GlowRenderer.Reset_Polys ();
  510. //
  511. // Determine how to justify the text
  512. //
  513. StyleMgrClass::JUSTIFICATION justification = StyleMgrClass::CENTER_JUSTIFY;
  514. if ((Style & 0xF00) == BS_LEFT) {
  515. justification = StyleMgrClass::LEFT_JUSTIFY;
  516. }
  517. //
  518. // Render the text in "glow" fashion
  519. //
  520. StyleMgrClass::Render_Glow (Title, &GlowRenderer, Rect, radiusx, radiusy,
  521. color, justification);
  522. return ;
  523. }
  524. ////////////////////////////////////////////////////////////////
  525. //
  526. // On_Set_Focus
  527. //
  528. ////////////////////////////////////////////////////////////////
  529. void
  530. MenuEntryCtrlClass::On_Set_Focus (void)
  531. {
  532. //
  533. // Set the state to hilight if the mouse button
  534. // isn't down
  535. //
  536. if (WasButtonPressedOnMe == false) {
  537. Set_State (HILIGHT);
  538. //
  539. // Play the sound effect
  540. //
  541. StyleMgrClass::Play_Sound (StyleMgrClass::EVENT_MOUSE_OVER);
  542. }
  543. DialogControlClass::On_Set_Focus ();
  544. return ;
  545. }
  546. ////////////////////////////////////////////////////////////////
  547. //
  548. // On_Kill_Focus
  549. //
  550. ////////////////////////////////////////////////////////////////
  551. void
  552. MenuEntryCtrlClass::On_Kill_Focus (DialogControlClass *focus)
  553. {
  554. //
  555. // Restore the entry to its default state
  556. //
  557. if (CurrState != DOWN) {
  558. Set_State (UP);
  559. }
  560. WasButtonPressedOnMe = false;
  561. DialogControlClass::On_Kill_Focus (focus);
  562. return ;
  563. }
  564. ////////////////////////////////////////////////////////////////
  565. //
  566. // On_Key_Down
  567. //
  568. ////////////////////////////////////////////////////////////////
  569. bool
  570. MenuEntryCtrlClass::On_Key_Down (uint32 key_id, uint32 key_data)
  571. {
  572. bool handled = true;
  573. switch (key_id)
  574. {
  575. case VK_RETURN:
  576. case VK_SPACE:
  577. Set_State (DOWN);
  578. break;
  579. case VK_LEFT:
  580. case VK_UP:
  581. {
  582. //
  583. // Set the focus to the previous control in our group
  584. //
  585. DialogControlClass *control = Parent->Find_Next_Group_Control (this, -1);
  586. if (control != NULL) {
  587. control->Set_Focus ();
  588. }
  589. break;
  590. }
  591. case VK_RIGHT:
  592. case VK_DOWN:
  593. {
  594. //
  595. // Set the focus to the next control in our group
  596. //
  597. DialogControlClass *control = Parent->Find_Next_Group_Control (this, 1);
  598. if (control != NULL) {
  599. control->Set_Focus ();
  600. }
  601. break;
  602. }
  603. default:
  604. handled = false;
  605. break;
  606. }
  607. return handled;
  608. }
  609. ////////////////////////////////////////////////////////////////
  610. //
  611. // On_Key_Up
  612. //
  613. ////////////////////////////////////////////////////////////////
  614. bool
  615. MenuEntryCtrlClass::On_Key_Up (uint32 key_id)
  616. {
  617. return false;
  618. }
  619. ////////////////////////////////////////////////////////////////
  620. //
  621. // On_Pushed
  622. //
  623. ////////////////////////////////////////////////////////////////
  624. void
  625. MenuEntryCtrlClass::On_Pushed (void)
  626. {
  627. Parent->On_Command (ID, BN_CLICKED, 0);
  628. return ;
  629. }
  630. ////////////////////////////////////////////////////////////////
  631. //
  632. // Center_Mouse
  633. //
  634. ////////////////////////////////////////////////////////////////
  635. void
  636. MenuEntryCtrlClass::Center_Mouse (void)
  637. {
  638. //
  639. // Get the extents of the text we will be drawing
  640. //
  641. Vector2 text_extent = TextRenderer.Get_Text_Extents (Title);
  642. int x_pos = 0;
  643. //
  644. // Should we left justify?
  645. //
  646. if ((Style & 0xF00) == BS_LEFT) {
  647. x_pos = int(Rect.Left + (text_extent.X / 2));
  648. } else {
  649. x_pos = int(Rect.Left + (Rect.Width () / 2) - (text_extent.X / 2));
  650. }
  651. int y_pos = int(Rect.Top + (Rect.Height () / 2));
  652. //
  653. // Put the mouse cursor in the middle of this control
  654. //
  655. Vector3 mouse_pos = DialogMgrClass::Get_Mouse_Pos ();
  656. mouse_pos.X = x_pos;
  657. mouse_pos.Y = y_pos;
  658. DialogMgrClass::Set_Mouse_Pos (mouse_pos);
  659. return ;
  660. }