From 27f2abaeb7b8bb05fb34ac9f2c451a0ed93cf0bc Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 31 May 2012 04:27:27 +0200 Subject: [PATCH] CHANGED: #1471 Moved some more code from CInterfaceManager to CWidgetManager ( mostly widget lookup, modal handling, pointer, etc ) --- code/ryzom/client/src/commands.cpp | 8 +- code/ryzom/client/src/connection.cpp | 58 +- code/ryzom/client/src/contextual_cursor.cpp | 2 +- code/ryzom/client/src/continent_manager.cpp | 6 +- code/ryzom/client/src/cursor_functions.cpp | 6 +- code/ryzom/client/src/entities.cpp | 8 +- code/ryzom/client/src/entity_cl.cpp | 4 +- code/ryzom/client/src/far_tp.cpp | 6 +- code/ryzom/client/src/fog_map.cpp | 2 +- code/ryzom/client/src/init_main_loop.cpp | 18 +- code/ryzom/client/src/input.cpp | 12 +- .../src/interface_v3/action_handler.cpp | 30 +- .../src/interface_v3/action_handler_game.cpp | 70 +- .../src/interface_v3/action_handler_help.cpp | 18 +- .../src/interface_v3/action_handler_item.cpp | 116 ++-- .../src/interface_v3/action_handler_misc.cpp | 22 +- .../src/interface_v3/action_handler_move.cpp | 2 +- .../interface_v3/action_handler_outpost.cpp | 4 +- .../interface_v3/action_handler_phrase.cpp | 38 +- .../src/interface_v3/action_handler_ui.cpp | 30 +- .../src/interface_v3/action_phrase_faber.cpp | 58 +- .../client/src/interface_v3/bot_chat_page.cpp | 2 +- .../bot_chat_page_create_guild.cpp | 6 +- .../bot_chat_page_dynamic_mission.cpp | 4 +- .../interface_v3/bot_chat_page_mission.cpp | 6 +- .../bot_chat_page_mission_end.cpp | 2 +- .../src/interface_v3/bot_chat_page_trade.cpp | 76 +-- .../client/src/interface_v3/chat_window.cpp | 14 +- .../src/interface_v3/ctrl_base_button.cpp | 4 +- .../client/src/interface_v3/ctrl_scroll.cpp | 6 +- .../client/src/interface_v3/dbctrl_sheet.cpp | 18 +- .../src/interface_v3/dbgroup_combo_box.cpp | 12 +- .../src/interface_v3/dbgroup_list_sheet.cpp | 16 +- .../interface_v3/dbgroup_list_sheet_text.cpp | 14 +- .../dbgroup_list_sheet_text_share.cpp | 4 +- .../src/interface_v3/encyclopedia_manager.cpp | 30 +- .../client/src/interface_v3/group_compas.cpp | 12 +- .../src/interface_v3/group_container.cpp | 24 +- .../client/src/interface_v3/group_editbox.cpp | 4 +- .../client/src/interface_v3/group_header.cpp | 2 +- .../client/src/interface_v3/group_html.cpp | 8 +- .../src/interface_v3/group_html_qcm.cpp | 2 +- .../src/interface_v3/group_html_webig.cpp | 6 +- .../interface_v3/group_in_scene_bubble.cpp | 30 +- .../interface_v3/group_in_scene_user_info.cpp | 4 +- .../client/src/interface_v3/group_list.cpp | 6 +- .../client/src/interface_v3/group_map.cpp | 50 +- .../client/src/interface_v3/group_menu.cpp | 16 +- .../src/interface_v3/group_modal_get_key.cpp | 12 +- .../src/interface_v3/group_paragraph.cpp | 6 +- .../group_phrase_skill_filter.cpp | 2 +- .../src/interface_v3/group_quick_help.cpp | 6 +- .../client/src/interface_v3/group_skills.cpp | 2 +- .../client/src/interface_v3/group_tree.cpp | 8 +- .../client/src/interface_v3/guild_manager.cpp | 70 +- .../interface_v3/input_handler_manager.cpp | 4 +- .../src/interface_v3/interface_3d_scene.cpp | 6 +- .../src/interface_v3/interface_config.cpp | 10 +- .../client/src/interface_v3/interface_ddx.cpp | 4 +- .../interface_expr_user_fct_game.cpp | 4 +- .../interface_expr_user_fct_items.cpp | 2 +- .../src/interface_v3/interface_group.cpp | 2 +- .../src/interface_v3/interface_link.cpp | 4 +- .../src/interface_v3/interface_manager.cpp | 612 ++++-------------- .../src/interface_v3/interface_manager.h | 95 +-- .../src/interface_v3/interface_parser.cpp | 9 +- .../src/interface_v3/interface_parser.h | 2 - .../src/interface_v3/inventory_manager.cpp | 136 ++-- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 22 +- .../client/src/interface_v3/macrocmd_key.cpp | 94 +-- .../src/interface_v3/macrocmd_manager.cpp | 42 +- .../client/src/interface_v3/music_player.cpp | 2 +- .../client/src/interface_v3/obs_huge_list.cpp | 16 +- .../src/interface_v3/people_interraction.cpp | 40 +- .../client/src/interface_v3/people_list.cpp | 12 +- .../client/src/interface_v3/player_trade.cpp | 4 +- .../client/src/interface_v3/skill_manager.cpp | 4 +- .../src/interface_v3/sphrase_manager.cpp | 20 +- .../src/interface_v3/task_bar_manager.cpp | 6 +- .../src/interface_v3/view_bitmap_combo.cpp | 10 +- .../client/src/interface_v3/view_pointer.cpp | 6 +- .../client/src/interface_v3/view_text.cpp | 6 +- .../src/interface_v3/widget_manager.cpp | 351 ++++++++++ .../client/src/interface_v3/widget_manager.h | 115 +++- code/ryzom/client/src/login.cpp | 104 +-- code/ryzom/client/src/main_loop.cpp | 32 +- .../ryzom/client/src/motion/modes/ai_mode.cpp | 2 +- .../ryzom/client/src/motion/user_controls.cpp | 4 +- code/ryzom/client/src/net_manager.cpp | 76 +-- code/ryzom/client/src/outpost_manager.cpp | 6 +- code/ryzom/client/src/player_cl.cpp | 2 +- code/ryzom/client/src/r2/displayer_visual.cpp | 2 +- code/ryzom/client/src/r2/editor.cpp | 30 +- code/ryzom/client/src/r2/npc_editor.cpp | 2 +- code/ryzom/client/src/r2/tool.cpp | 6 +- .../ryzom/client/src/session_browser_impl.cpp | 2 +- code/ryzom/client/src/user_entity.cpp | 6 +- 97 files changed, 1446 insertions(+), 1470 deletions(-) diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 70d435f6f..3f97ff83d 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -3318,7 +3318,7 @@ NLMISC_COMMAND(loadIntCfg, "load the interface config file","") CInterfaceManager *im = CInterfaceManager::getInstance(); im->loadConfig ("save/interface.icfg"); // reset the compass target - CGroupCompas *gc = dynamic_cast(im->getElementFromId("ui:interface:compass")); + CGroupCompas *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:compass")); if (gc && gc->isSavedTargetValid()) { gc->setTarget(gc->getSavedTarget()); @@ -3341,7 +3341,7 @@ NLMISC_COMMAND(harvestDeposit, "harvest a deposit", "") NetMngr.push(out); // open the interface - // CInterfaceManager::getInstance()->getWindowFromId("ui:interface:harvest")->setActive(true); + // CWidgetManager::getInstance()->getWindowFromId("ui:interface:harvest")->setActive(true); } else nlwarning("command : unknown message name : 'HARVEST:DEPOSIT'"); @@ -4960,7 +4960,7 @@ NLMISC_COMMAND(dumpUICoords, "Debug only : dump all coords info of an UI", "uiid return false; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceElement *el= pIM->getElementFromId(args[0]); + CInterfaceElement *el= CWidgetManager::getInstance()->getElementFromId(args[0]); if(!el) { pIM->displaySystemInfo(toString("dumpUICoords: '%s' does not exist", args[0].c_str())); @@ -5497,7 +5497,7 @@ NLMISC_COMMAND(clear, "clear content of current char window", "(im->getElementFromId(args[0]))); + cw = getChatWndMgr().getChatWindowFromCaller(dynamic_cast(CWidgetManager::getInstance()->getElementFromId(args[0]))); } else { diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index d2efd56bb..e6017ea6b 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -235,7 +235,7 @@ class CAHOnReloadTestPage: public IActionHandler { CInterfaceManager *pIM = CInterfaceManager::getInstance(); // need to reset password and current screen - CGroupHTML *pGH = dynamic_cast(pIM->getElementFromId(GROUP_BROWSER)); + CGroupHTML *pGH = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_BROWSER)); pGH->browse(ClientCfg.TestBrowserUrl.c_str()); @@ -250,7 +250,7 @@ void initWebBrowser() //NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_WEBSTART); // start the browser - CGroupHTML *pGH = dynamic_cast(pIM->getElementFromId(GROUP_BROWSER)); + CGroupHTML *pGH = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_BROWSER)); if (pGH) { @@ -388,7 +388,7 @@ bool connection (const string &cookie, const string &fsaddr) WaitServerAnswer = true; }*/ - pIM->activateMasterGroup ("ui:outgame", true); + CWidgetManager::getInstance()->activateMasterGroup ("ui:outgame", true); NLGUI::CDBManager::getInstance()->getDbProp ("UI:CURRENT_SCREEN")->setValue32(ClientCfg.Local ? 6 : -1); // TMP TMP IngameDbMngr.flushObserverCalls(); NLGUI::CDBManager::getInstance()->flushObserverCalls(); @@ -552,7 +552,7 @@ bool reconnection() // Start the finite state machine TInterfaceState InterfaceState = GLOBAL_MENU; - pIM->activateMasterGroup ("ui:outgame", true); + CWidgetManager::getInstance()->activateMasterGroup ("ui:outgame", true); NLGUI::CDBManager::getInstance()->getDbProp ("UI:CURRENT_SCREEN")->setValue32(-1); IngameDbMngr.flushObserverCalls(); NLGUI::CDBManager::getInstance()->flushObserverCalls(); @@ -825,7 +825,7 @@ void updateBGDownloaderUI() static NLMISC::CRefPtr bgDownloaderWindow; if (!bgDownloaderWindow) { - bgDownloaderWindow = im->getElementFromId("ui:interface:bg_downloader"); + bgDownloaderWindow = CWidgetManager::getInstance()->getElementFromId("ui:interface:bg_downloader"); } bgWindowVisible = bgDownloaderWindow && bgDownloaderWindow->getActive(); } @@ -992,12 +992,12 @@ TInterfaceState globalMenu() { pIM->uninitOutGame(); pIM->initOutGame(); - pIM->activateMasterGroup ("ui:outgame", true); + CWidgetManager::getInstance()->activateMasterGroup ("ui:outgame", true); NLGUI::CDBManager::getInstance()->getDbProp ("UI:CURRENT_SCREEN")->setValue32(2); // TMP TMP IngameDbMngr.flushObserverCalls(); NLGUI::CDBManager::getInstance()->flushObserverCalls(); - pIM->getElementFromId("ui:outgame:charsel")->setActive(false); - pIM->getElementFromId("ui:outgame:charsel")->setActive(true); + CWidgetManager::getInstance()->getElementFromId("ui:outgame:charsel")->setActive(false); + CWidgetManager::getInstance()->getElementFromId("ui:outgame:charsel")->setActive(true); // Active inputs Actions.enable(true); EditActions.enable(true); @@ -1024,7 +1024,7 @@ TInterfaceState globalMenu() else { // Display the firewall alert string - CViewText *pVT = dynamic_cast(pIM->getElementFromId("ui:outgame:connecting:title")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:outgame:connecting:title")); if (pVT != NULL) pVT->setText(CI18N::get("uiFirewallAlert")+ucstring("...")); @@ -1229,7 +1229,7 @@ TInterfaceState globalMenu() if ( firewallTimeout ) { // Display the firewall error string instead of the normal failure string - CViewText *pVT = dynamic_cast(pIM->getElementFromId("ui:outgame:crashing:title")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:outgame:crashing:title")); if (pVT != NULL) { pVT->setMultiLine( true ); @@ -1300,7 +1300,7 @@ public: for (i = 0; i < CharacterSummaries.size(); ++i) { CCharacterSummary &rCS = CharacterSummaries[i]; - CInterfaceElement *pIE = pIM->getElementFromId(sPath+":text"+NLMISC::toString(i)); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(sPath+":text"+NLMISC::toString(i)); CViewText *pVT = dynamic_cast(pIE); if (pVT == NULL) return; @@ -1312,7 +1312,7 @@ public: // 5 slots for (; i < 5; ++i) { - CViewText *pVT = dynamic_cast(pIM->getElementFromId(sPath+":text"+NLMISC::toString(i))); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sPath+":text"+NLMISC::toString(i))); if (pVT == NULL) return; pVT->setText(CI18N::get("uiEmptySlot")); } @@ -1492,7 +1492,7 @@ public: { string sDBLink = getParam(Params, "dblink"); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceElement *pIE = pIM->getElementFromId(pCaller->getId(), sDBLink); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(pCaller->getId(), sDBLink); CInterfaceGroup *pIG = dynamic_cast(pIE); if (pIG == NULL) return; @@ -1662,7 +1662,7 @@ public: string sEditBoxPath = getParam (Params, "name"); ucstring sFirstName = ucstring("NotSet"); ucstring sSurName = ucstring("NotSet"); - CGroupEditBox *pGEB = dynamic_cast(pIM->getElementFromId(sEditBoxPath)); + CGroupEditBox *pGEB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sEditBoxPath)); if (pGEB != NULL) sFirstName = pGEB->getInputString(); else @@ -2118,7 +2118,7 @@ public: { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *pList = dynamic_cast(pIM->getElementFromId(GROUP_LIST_MAINLAND)); + CInterfaceGroup *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_MAINLAND)); if (pList == NULL) { nlwarning("element "GROUP_LIST_MAINLAND" not found probably bad outgame.xml"); @@ -2175,7 +2175,7 @@ public: } } - CCtrlButton *pCB = dynamic_cast(pIM->getElementFromId(GROUP_LIST_MAINLAND ":"+toString(Mainlands[defaultMainland].Id)+":but")); + CCtrlButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_MAINLAND ":"+toString(Mainlands[defaultMainland].Id)+":but")); if (pCB != NULL) { pCB->setPushed(true); @@ -2196,7 +2196,7 @@ public: virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *pList = dynamic_cast(pIM->getElementFromId(GROUP_LIST_MAINLAND)); + CInterfaceGroup *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_MAINLAND)); pList->clearGroups(); } }; @@ -2216,7 +2216,7 @@ class CAHMainlandSelect : public IActionHandler // Unselect if (MainlandSelected.asInt() != 0) { - pCB = dynamic_cast(pIM->getElementFromId(GROUP_LIST_MAINLAND ":"+toString(MainlandSelected)+":but")); + pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_MAINLAND ":"+toString(MainlandSelected)+":but")); if (pCB != NULL) pCB->setPushed(false); } @@ -2311,7 +2311,7 @@ public: PrevLine = NULL; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - List = dynamic_cast(pIM->getElementFromId(GROUP_LIST_KEYSET)); + List = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_KEYSET)); if (List == NULL) { nlwarning("element "GROUP_LIST_KEYSET" not found probably bad outgame.xml"); @@ -2437,7 +2437,7 @@ public: virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *pList = dynamic_cast(pIM->getElementFromId(GROUP_LIST_KEYSET)); + CInterfaceGroup *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_KEYSET)); pList->clearGroups(); } }; @@ -2476,7 +2476,7 @@ public: } }; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup * list = dynamic_cast(pIM->getElementFromId(GROUP_LIST_KEYSET)); + CInterfaceGroup * list = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_KEYSET)); if (list) { CUnpush unpusher; @@ -2635,7 +2635,7 @@ class CAHScenarioControl : public IActionHandler nlinfo("CAHScenarioControl called"); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup* scenarioWnd = dynamic_cast(pIM->getElementFromId("ui:interface:r2ed_scenario_control")); + CInterfaceGroup* scenarioWnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_scenario_control")); if(!scenarioWnd) return; // -------- active some groups in function of Ryzom mode or Edition/Animation mode ---- @@ -2846,7 +2846,7 @@ class CAHScenarioInformation : public IActionHandler nlinfo("CAHScenarioDescription called"); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup* scenarioWnd = dynamic_cast(pIM->getElementFromId("ui:interface:r2ed_scenario_control")); + CInterfaceGroup* scenarioWnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_scenario_control")); if(!scenarioWnd) return; CInterfaceElement *result = scenarioWnd->findFromShortId(string("scenario_value_text")); @@ -2890,7 +2890,7 @@ class CAHHideCharsFilters : public IActionHandler nlinfo("CAHHideCharsFilters called"); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup* scenarioWnd = dynamic_cast(pIM->getElementFromId("ui:interface:r2ed_scenario_control")); + CInterfaceGroup* scenarioWnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_scenario_control")); if(!scenarioWnd) return; bool lookingForPlayers = true; @@ -2937,7 +2937,7 @@ class CAHLoadScenario : public IActionHandler nlinfo("CAHLoadScenario called"); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup* scenarioWnd = dynamic_cast(pIM->getElementFromId("ui:interface:r2ed_scenario_control")); + CInterfaceGroup* scenarioWnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_scenario_control")); if(!scenarioWnd) return; CInterfaceElement *result = NULL; @@ -3226,7 +3226,7 @@ class CAHLoadScenario : public IActionHandler bool noob = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:IS_NEWBIE")->getValueBool(); if (FreeTrial && noob && (nevraxScenario != "1" || trialAllowed != "1")) { - CViewText* pVT = dynamic_cast(pIM->getElementFromId("ui:interface:warning_free_trial:text")); + CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) pVT->setText(CI18N::get("uiRingWarningFreeTrial")); pIM->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); @@ -3307,7 +3307,7 @@ class CAHLoadScenario : public IActionHandler if(sessionBrowser._LastInvokeResult == 14) { - CViewText* pVT = dynamic_cast(pIM->getElementFromId("ui:interface:warning_free_trial:text")); + CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) pVT->setText(CI18N::get("uiRingWarningFreeTrial")); pIM->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); @@ -3336,7 +3336,7 @@ class CAHLoadScenario : public IActionHandler if(sessionBrowser._LastInvokeResult == 14) { - CViewText* pVT = dynamic_cast(pIM->getElementFromId("ui:interface:warning_free_trial:text")); + CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial")); pIM->runActionHandler("enter_modal", pCaller, "group=ui:interface:warning_free_trial"); @@ -3406,7 +3406,7 @@ class CAHOpenRingSessions : public IActionHandler if(!R2::getEditor().isInitialized()) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup* ringSessionsWnd = dynamic_cast(pIM->getElementFromId("ui:interface:ring_sessions")); + CInterfaceGroup* ringSessionsWnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:ring_sessions")); if(!ringSessionsWnd) return; ringSessionsWnd->setActive(true); } diff --git a/code/ryzom/client/src/contextual_cursor.cpp b/code/ryzom/client/src/contextual_cursor.cpp index 27a9f2863..ded0866e6 100644 --- a/code/ryzom/client/src/contextual_cursor.cpp +++ b/code/ryzom/client/src/contextual_cursor.cpp @@ -143,7 +143,7 @@ bool CContextualCursor::context(const std::string &contextName, float dist, cons CInterfaceManager *IM = CInterfaceManager::getInstance(); if(IM) { - CViewPointer *cursor = IM->getPointer(); + CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); if(cursor) { if (!functions.isString) diff --git a/code/ryzom/client/src/continent_manager.cpp b/code/ryzom/client/src/continent_manager.cpp index ec2a03f69..e8ac1f824 100644 --- a/code/ryzom/client/src/continent_manager.cpp +++ b/code/ryzom/client/src/continent_manager.cpp @@ -368,10 +368,10 @@ void CContinentManager::select(const string &name, const CVectorD &pos, NLMISC:: if (pWS->Maps[i].ContinentName == name) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupMap *pMap = dynamic_cast(pIM->getElementFromId("ui:interface:map:content:map_content:actual_map")); + CGroupMap *pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); if (pMap != NULL) pMap->setMap(pWS->Maps[i].Name); - pMap = dynamic_cast(pIM->getElementFromId("ui:interface:respawn_map:content:map_content:actual_map")); + pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:respawn_map:content:map_content:actual_map")); if (pMap != NULL) pMap->setMap(pWS->Maps[i].Name); break; @@ -549,7 +549,7 @@ void CContinentManager::checkNumberOfUserLandmarks( uint maxNumber ) // Just cut down the last landmarks (in case of hacked file) if ( cont == _Current ) { - CGroupMap *pMap = dynamic_cast(CInterfaceManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); + CGroupMap *pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); if ( pMap ) pMap->removeExceedingUserLandMarks( maxNumber ); } diff --git a/code/ryzom/client/src/cursor_functions.cpp b/code/ryzom/client/src/cursor_functions.cpp index 312dd589e..7e64c644e 100644 --- a/code/ryzom/client/src/cursor_functions.cpp +++ b/code/ryzom/client/src/cursor_functions.cpp @@ -239,7 +239,7 @@ void checkUnderCursor() return; // Get the cursor instance - CViewPointer *cursor = IM->getPointer(); + CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); if(cursor == 0) return; @@ -874,8 +874,8 @@ void contextWebPage(bool rightClick, bool dblClick) void contextWebIG(bool rightClick, bool dblClick) { CInterfaceManager *IM = CInterfaceManager::getInstance(); - CInterfaceElement *pGC = IM->getElementFromId("ui:interface:bot_chat_object"); - CInterface3DShape *el= dynamic_cast(IM->getElementFromId("ui:interface:bot_chat_object:scene3d:object_1")); + CInterfaceElement *pGC = CWidgetManager::getInstance()->getElementFromId("ui:interface:bot_chat_object"); + CInterface3DShape *el= dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:bot_chat_object:scene3d:object_1")); if (el != NULL) { el->setName(selectedInstance.getShapeName()); diff --git a/code/ryzom/client/src/entities.cpp b/code/ryzom/client/src/entities.cpp index 37bd0293c..68abecadb 100644 --- a/code/ryzom/client/src/entities.cpp +++ b/code/ryzom/client/src/entities.cpp @@ -132,7 +132,7 @@ public : entity->updateMissionTarget(); CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupCompas *gc = dynamic_cast(im->getElementFromId("ui:interface:compass")); + CGroupCompas *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:compass")); // if new target title is not NULL, then show the compass and make it blink to indicate new location // please note that the first time the player login, a target has not been saved in his config file, so // we permit the first (and only one) mission that is received to become the new compass direction (chiang the strong ...) @@ -159,7 +159,7 @@ public : if (leaf->getOldValue32() != 0) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupCompas *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:compass")); + CGroupCompas *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:compass")); if (pGC == NULL) { nlwarning("Can't retrieve compass group"); @@ -198,7 +198,7 @@ public : // { // _AlreadyReceived.insert(name); CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupCompas *gc = dynamic_cast(im->getElementFromId("ui:interface:compass")); + CGroupCompas *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:compass")); if (!gc) { nlwarning("Can't retrieve compass group"); @@ -223,7 +223,7 @@ public : gc->setTarget(ct); gc->blink(); gc->enableBlink(2); - im->setTopWindow(gc); + CWidgetManager::getInstance()->setTopWindow(gc); } } } diff --git a/code/ryzom/client/src/entity_cl.cpp b/code/ryzom/client/src/entity_cl.cpp index 690bb12da..b05c8ae69 100644 --- a/code/ryzom/client/src/entity_cl.cpp +++ b/code/ryzom/client/src/entity_cl.cpp @@ -2331,10 +2331,10 @@ void CEntityCL::onStringAvailable(uint /* stringId */, const ucstring &value) if (_Slot == 0) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId("ui:interface:player:header_opened:player_title")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:player:header_opened:player_title")); if (pVT != NULL) pVT->setText(_Title); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:player")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:player")); if (pGC != NULL) pGC->setUCTitle(_EntityName); CSkillManager *pSM = CSkillManager::getInstance(); diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index a7e4ebb94..dec9aed6f 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/ryzom/client/src/far_tp.cpp @@ -861,12 +861,12 @@ retryJoinEdit: // pIM->runActionHandler( "proc", NULL, "charsel_disable_buttons" ); // pIM->runActionHandler( "set", NULL, "target_property=ui:outgame:charsel:quit_but:active|value=1" ); - CInterfaceElement *btnOk = pIM->getElementFromId("ui:outgame:charsel:message_box:ok"); + CInterfaceElement *btnOk = CWidgetManager::getInstance()->getElementFromId("ui:outgame:charsel:message_box:ok"); if (btnOk) btnOk->setActive( ! requestRetToMainland ); // Hide the black screen i.e. force showing the interface - CInterfaceElement *charSelBlackScreen = pIM->getElementFromId("ui:outgame:charsel:black_screen"); + CInterfaceElement *charSelBlackScreen = CWidgetManager::getInstance()->getElementFromId("ui:outgame:charsel:black_screen"); if (charSelBlackScreen) { CViewBase *charSelBlackScreenBitmap = dynamic_cast(charSelBlackScreen); @@ -928,7 +928,7 @@ retryJoinEdit: pIM->runActionHandler( "proc", NULL, "charsel_enable_buttons" ); pIM->runActionHandler( "set", NULL, "target_property=ui:outgame:charsel:create_new_but:active|value=0" ); - CInterfaceGroup* charselGroup = dynamic_cast(pIM->getElementFromId("ui:outgame:charsel")); + CInterfaceGroup* charselGroup = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:outgame:charsel")); if(charselGroup) pIM->runActionHandler( "proc", charselGroup, "charsel_init_buttons" ); } diff --git a/code/ryzom/client/src/fog_map.cpp b/code/ryzom/client/src/fog_map.cpp index 78cd7ecda..e8352e5c3 100644 --- a/code/ryzom/client/src/fog_map.cpp +++ b/code/ryzom/client/src/fog_map.cpp @@ -79,7 +79,7 @@ void CFogMap::getFogParams(float startDist, float endDist, float x, float y, flo float ddMx = x; float ddMy = y; CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupMap *gm = dynamic_cast(im->getElementFromId("ui:interface:map:content:map_content:actual_map")); + CGroupMap *gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); if (gm && gm->isIsland()) { CVector front = MainCam.getMatrix().getJ(); diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index caa765af5..6a79b0de3 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -1187,8 +1187,8 @@ void initMainLoop() ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) ); //CDebugInit dbg; //dbg.init(&Driver->EventServer); - CInterfaceManager::getInstance()->activateMasterGroup("ui:login", false); - CInterfaceManager::getInstance()->activateMasterGroup("ui:interface", true); + CWidgetManager::getInstance()->activateMasterGroup("ui:login", false); + CWidgetManager::getInstance()->activateMasterGroup("ui:interface", true); } @@ -1485,7 +1485,7 @@ void setLoadingContinent (CContinent *continent) void initWelcomeWindow() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup* welcomeWnd = dynamic_cast(pIM->getElementFromId("ui:interface:welcome_info")); + CInterfaceGroup* welcomeWnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:welcome_info")); if(welcomeWnd) { bool welcomeDbProp = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:WELCOME")->getValueBool(); @@ -1518,11 +1518,11 @@ void initHardwareCursor(bool secondCall) // else, only the first time after this patch, open popup to propose hardare cursor mode else { - CInterfaceGroup * cursorWnd = dynamic_cast(pIM->getElementFromId("ui:interface:hardware_cursor")); + CInterfaceGroup * cursorWnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:hardware_cursor")); if(cursorWnd) { cursorWnd->setActive((sb.CurrentJoinMode!=CFarTP::LaunchEditor) || secondCall); - pIM->setTopWindow(cursorWnd); + CWidgetManager::getInstance()->setTopWindow(cursorWnd); cursorWnd->updateCoords(); cursorWnd->center(); } @@ -1546,25 +1546,25 @@ void initBloomConfigUI() bool supportBloom = Driver->supportBloomEffect(); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CCtrlBaseButton* button = dynamic_cast(pIM->getElementFromId("ui:interface:game_config:content:fx:bloom_gr:bloom:c")); + CCtrlBaseButton* button = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:game_config:content:fx:bloom_gr:bloom:c")); if(button) { button->setFrozen(!supportBloom); } - button = dynamic_cast(pIM->getElementFromId("ui:interface:game_config:content:fx:bloom_gr:square_bloom:c")); + button = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:game_config:content:fx:bloom_gr:square_bloom:c")); if(button) { button->setFrozen(!supportBloom); } - CCtrlScroll * scroll = dynamic_cast(pIM->getElementFromId("ui:interface:game_config:content:fx:bloom_gr:density_bloom:c")); + CCtrlScroll * scroll = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:game_config:content:fx:bloom_gr:density_bloom:c")); if(scroll) { scroll->setFrozen(!supportBloom); } - CInterfaceGroup* group = dynamic_cast(pIM->getElementFromId("ui:interface:game_config:content:fx:bloom_gr")); + CInterfaceGroup* group = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:game_config:content:fx:bloom_gr")); if(!supportBloom) { diff --git a/code/ryzom/client/src/input.cpp b/code/ryzom/client/src/input.cpp index 0d0e2c4ca..3d67c2455 100644 --- a/code/ryzom/client/src/input.cpp +++ b/code/ryzom/client/src/input.cpp @@ -124,7 +124,7 @@ bool InitMouseWithCursor (bool hardware) { Driver->showCursor(true); - CViewPointer *pointer = CInterfaceManager::getInstance()->getPointer(); + CViewPointer *pointer = CWidgetManager::getInstance()->getPointer(); if (pointer) { float x = (float)pointer->getX()/(float)Driver->getWindowWidth(); @@ -145,7 +145,7 @@ bool InitMouseWithCursor (bool hardware) else { CInterfaceManager *pIm = CInterfaceManager::getInstance(); - CViewPointer *vp = pIm->getPointer(); + CViewPointer *vp = CWidgetManager::getInstance()->getPointer(); Driver->showCursor(false); SetMousePosFirstTime = false; if (vp) @@ -247,7 +247,7 @@ void SetMouseFreeLook () CInterfaceManager *im = CInterfaceManager::getInstance(); if (im) { - CViewPointer *pointer = im->getPointer(); + CViewPointer *pointer = CWidgetManager::getInstance()->getPointer(); if (pointer) pointer->show (false); } @@ -281,7 +281,7 @@ void SetMouseCursor (bool updatePos) if (instance) { // Get the cursor instance - CViewPointer *cursor = instance->getPointer(); + CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); if (cursor) { sint32 ix, iy; @@ -319,7 +319,7 @@ void SetMouseCursor (bool updatePos) if (instance) { // Get the cursor instance - CViewPointer *cursor = instance->getPointer(); + CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); if (cursor) { cursor->setPointerPos(ix, iy); @@ -342,7 +342,7 @@ void SetMouseCursor (bool updatePos) CInterfaceManager *im = CInterfaceManager::getInstance(); if (im) { - CViewPointer *pointer = im->getPointer(); + CViewPointer *pointer = CWidgetManager::getInstance()->getPointer(); if (pointer) pointer->show (true); } diff --git a/code/ryzom/client/src/interface_v3/action_handler.cpp b/code/ryzom/client/src/interface_v3/action_handler.cpp index d826a2dea..7cc097492 100644 --- a/code/ryzom/client/src/interface_v3/action_handler.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler.cpp @@ -290,7 +290,7 @@ public: if (ig == NULL) { string elt = property.substr(0,property.rfind(':')); - CInterfaceElement *pIE = pIM->getElementFromId(elt); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(elt); ig = dynamic_cast(pIE); if (ig == NULL && pIE != NULL) ig = pIE->getParent(); @@ -401,7 +401,7 @@ public: sint32 limit; fromString(getParam(Params, "limit"), limit); - CInterfaceElement *pIE = pIM->getElementFromId (pCaller->getId(), elt); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId (pCaller->getId(), elt); if (pIE == NULL) return; sint32 newW = pIE->getW(); @@ -432,9 +432,9 @@ public: string target = getParam (Params, "target"); CGroupEditBox *geb; if (pCaller == NULL) - geb = dynamic_cast(pIM->getElementFromId (target)); + geb = dynamic_cast(CWidgetManager::getInstance()->getElementFromId (target)); else - geb = dynamic_cast(pIM->getElementFromId (pCaller->getId(), target)); + geb = dynamic_cast(CWidgetManager::getInstance()->getElementFromId (pCaller->getId(), target)); if (geb == NULL) { nlwarning(" Can't get target edit box %s, or bad type", target.c_str()); @@ -514,7 +514,7 @@ class CAHActiveMenu : public IActionHandler // open the menu if (CDBCtrlSheet::getDraggedSheet() == NULL) { - CInterfaceManager::getInstance()->enableModalWindow (pCaller, getParam(Params, "menu")); + CWidgetManager::getInstance()->enableModalWindow (pCaller, getParam(Params, "menu")); } } }; @@ -541,9 +541,9 @@ class CAHSetServerString : public IActionHandler string elt = sTarget.substr(0,sTarget.rfind(':')); CInterfaceElement *pIE; if (pCaller != NULL) - pIE = pIM->getElementFromId(pCaller->getId(), elt); + pIE = CWidgetManager::getInstance()->getElementFromId(pCaller->getId(), elt); else - pIE = pIM->getElementFromId(elt); + pIE = CWidgetManager::getInstance()->getElementFromId(elt); if (pIE == NULL) return; sTarget = pIE->getId() + ":" + sTarget.substr(sTarget.rfind(':')+1,sTarget.size()); } @@ -581,9 +581,9 @@ class CAHSetServerID : public IActionHandler string elt = sTarget.substr(0,sTarget.rfind(':')); CInterfaceElement *pIE; if (pCaller != NULL) - pIE = pIM->getElementFromId(pCaller->getId(), elt); + pIE = CWidgetManager::getInstance()->getElementFromId(pCaller->getId(), elt); else - pIE = pIM->getElementFromId(elt); + pIE = CWidgetManager::getInstance()->getElementFromId(elt); if (pIE == NULL) return; sTarget = pIE->getId() + ":" + sTarget.substr(sTarget.rfind(':')+1,sTarget.size()); } @@ -626,9 +626,9 @@ class CAHResetCamera : public IActionHandler CInterfaceManager *pIM = CInterfaceManager::getInstance(); CInterfaceElement *pIE; if (pCaller != NULL) - pIE = pIM->getElementFromId(pCaller->getId(), sTarget); + pIE = CWidgetManager::getInstance()->getElementFromId(pCaller->getId(), sTarget); else - pIE = pIM->getElementFromId(sTarget); + pIE = CWidgetManager::getInstance()->getElementFromId(sTarget); CInterface3DCamera *pCam = dynamic_cast(pIE); if (pCam == NULL) return; pCam->reset(); @@ -726,7 +726,7 @@ public: // Enable 'use global alpha' button NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:USER_ALPHA")->setValue64(gc->isUsingGlobalAlpha() ? 0 : 1); // show the modal box - im->enableModalWindow(gc, "ui:interface:define_ui_transparency"); + CWidgetManager::getInstance()->enableModalWindow(gc, "ui:interface:define_ui_transparency"); } @@ -819,7 +819,7 @@ class CAHSetTransparent : public IActionHandler virtual void execute (CCtrlBase * /* pCaller */, const std::string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(Params)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(Params)); if (pGC != NULL) { pGC->setUseGlobalAlpha(false); @@ -844,7 +844,7 @@ class CAHSetAlpha : public IActionHandler uint8 alpha; fromString(getParam (Params, "alpha"), alpha); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(ui)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(ui)); if (pGC != NULL) { pGC->setUseGlobalAlpha(false); @@ -1033,7 +1033,7 @@ class CAHPopup : public IActionHandler sCont = eVal.getString(); if (sCont.empty()) return; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(sCont)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sCont)); if (pGC == NULL) return; if (pGC->isPopuped()) return; pGC->setHighLighted(false); diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index 2d6ee545d..cf3f89251 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -227,7 +227,7 @@ class CHandlerContextRingSessions : public IActionHandler // when player go away) CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceElement *pIE = pIM->getElementFromId("ui:interface:ring_sessions"); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId("ui:interface:ring_sessions"); // check if selection is a Ring terminal CEntityCL * selection = EntitiesMngr.entity(UserEntity->selection()); @@ -1383,11 +1383,11 @@ void CSelectItemSheet::showItemFlags(CInterfaceManager *im,bool canUse,bool canB if (!im) return; CInterfaceGroup *gr; #define BOT_CHAT_TRADE_PATH "ui:interface:bot_chat_trade:header_opened:trade_content:" - gr = dynamic_cast( im->getElementFromId(BOT_CHAT_TRADE_PATH "cant_use_item")); + gr = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(BOT_CHAT_TRADE_PATH "cant_use_item")); if (gr) gr->setActive(!canUse); - gr = dynamic_cast(im->getElementFromId(BOT_CHAT_TRADE_PATH "cant_use_built_item")); + gr = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(BOT_CHAT_TRADE_PATH "cant_use_built_item")); if (gr) gr->setActive(!canUseBuiltItem); - gr = dynamic_cast(im->getElementFromId(BOT_CHAT_TRADE_PATH "cant_build_item")); + gr = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(BOT_CHAT_TRADE_PATH "cant_build_item")); if (gr) gr->setActive(!canBuild); } @@ -1671,7 +1671,7 @@ class CHandlerAnimalOpenInventory : public IActionHandler if(animalIndex>=1 && animalIndex<=MAX_INVENTORY_ANIMAL) { // show/hide the inventory - CInterfaceElement *group= pIM->getElementFromId(toString("ui:interface:inv_pa%d", animalIndex-1) ); + CInterfaceElement *group= CWidgetManager::getInstance()->getElementFromId(toString("ui:interface:inv_pa%d", animalIndex-1) ); if(group) group->setActive(!group->getActive()); } @@ -1687,7 +1687,7 @@ REGISTER_ACTION_HANDLER( CHandlerAnimalOpenInventory, "animal_open_inventory" ); static void closeGroup(const string &groupName) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *pIG = dynamic_cast(pIM->getElementFromId(groupName)); + CInterfaceGroup *pIG = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(groupName)); if (pIG == NULL) return; pIG->setActive(false); } @@ -1883,7 +1883,7 @@ public: helpContainer = "ui:interface:help_browser"; // open the help browser - CInterfaceElement *pIG= pIM->getElementFromId(helpContainer); + CInterfaceElement *pIG= CWidgetManager::getInstance()->getElementFromId(helpContainer); if(pIG) pIG->setActive(true); @@ -1907,9 +1907,9 @@ static bool findInterfacePath(string &sPath, CCtrlBase *pCaller) string elt = sPath.substr(0,sPath.rfind(':')); CInterfaceElement *pIE; if (pCaller != NULL) - pIE = pIM->getElementFromId(pCaller->getId(), elt); + pIE = CWidgetManager::getInstance()->getElementFromId(pCaller->getId(), elt); else - pIE = pIM->getElementFromId(elt); + pIE = CWidgetManager::getInstance()->getElementFromId(elt); if (pIE == NULL) return false; sPath = pIE->getId() + ":" + sPath.substr(sPath.rfind(':')+1,sPath.size()); } @@ -2071,17 +2071,17 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler // Access UI elements if (sSlot.empty()) return; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewBitmap *pVBR = dynamic_cast(pIM->getElementFromId(sTargetRegion)); + CViewBitmap *pVBR = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sTargetRegion)); if (pVBR == NULL) return; - CViewBitmap *pVBL = dynamic_cast(pIM->getElementFromId(sTargetLevel)); + CViewBitmap *pVBL = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sTargetLevel)); if (pVBL == NULL) return; CInterfaceExprValue evValue; if (!CInterfaceExpr::eval(sSlot, evValue, NULL)) return; sint32 nSlot = (sint32)evValue.getInteger(); - CCtrlBase *pTooltip = dynamic_cast(pIM->getElementFromId("ui:interface:target:header_opened:force")); + CCtrlBase *pTooltip = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:target:header_opened:force")); // Access target entity CEntityCL *pE = NULL; @@ -2167,7 +2167,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler pVBL->setTexture(sTexture); // Set tooltip - CCtrlBase *tooltip = dynamic_cast(pIM->getElementFromId("ui:interface:target:header_opened:force")); + CCtrlBase *tooltip = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:target:header_opened:force")); if (tooltip) { ucstring str; @@ -2750,13 +2750,13 @@ public: }*/ CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:gestion_windows")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:gestion_windows")); if (pGC == NULL) { nlwarning("gestion_windows not found as a container"); return; } - CInterfaceElement *pIE = pIM->getElementFromId("ui:interface:gestion_windows:close"); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId("ui:interface:gestion_windows:close"); if (pIE != NULL) pIE->setActive(false); CActionsManager *pAM = &Actions; @@ -2783,7 +2783,7 @@ public: // Show the container pGC->setActive(true); // Yoyo: important to setTopWindow ONLY if needed, else save of the TopWindow doesn't work when you switch it. - pIM->setTopWindow(pGC); + CWidgetManager::getInstance()->setTopWindow(pGC); } } } @@ -2837,7 +2837,7 @@ class CHandlerCloseAllLabosBut : public IActionHandler // if not the excluded one if( Params != laboWindows[i] ) { - CInterfaceElement *pElt= pIM->getElementFromId(laboWindows[i]); + CInterfaceElement *pElt= CWidgetManager::getInstance()->getElementFromId(laboWindows[i]); if(pElt) pElt->setActive(false); } @@ -2866,12 +2866,12 @@ class CHandlerToggleInventory : public IActionHandler // For all labos bool state = false; - CInterfaceElement *pElt= pIM->getElementFromId(inventoryWindows[0]); + CInterfaceElement *pElt= CWidgetManager::getInstance()->getElementFromId(inventoryWindows[0]); if (pElt) state = !pElt->getActive(); for(uint i=0;igetElementFromId(inventoryWindows[i]); + pElt= CWidgetManager::getInstance()->getElementFromId(inventoryWindows[i]); if(pElt) pElt->setActive(state); } @@ -2922,7 +2922,7 @@ public: // Initialize interface combo box CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBGroupComboBox *pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); + CDBGroupComboBox *pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); if( pCB ) { pCB->resetTexts(); @@ -2934,7 +2934,7 @@ public: NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_VIDEO_FREQ_DB )->setValue32(-1); NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_VIDEO_MODE_DB )->setValue32(nFoundMode); - CCtrlBaseButton *pBut = dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_FULLSCREEN_BUTTON )); + CCtrlBaseButton *pBut = dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_FULLSCREEN_BUTTON )); if (pBut) { if (ClientCfg.Windowed) @@ -2946,7 +2946,7 @@ public: // **** Init Texture Size Modes // init the combo box, according to Texture Installed or not - pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_TEXTURE_MODE_COMBO )); + pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_TEXTURE_MODE_COMBO )); if( pCB ) { pCB->resetTexts(); @@ -3008,7 +3008,7 @@ class CHandlerGameConfigMode : public IActionHandler sint nVideModeNb = NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_VIDEO_MODE_DB )->getValue32(); if (nVideModeNb == -1) return; - CDBGroupComboBox *pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); + CDBGroupComboBox *pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); if( pCB == NULL ) return; // Get W, H @@ -3046,7 +3046,7 @@ class CHandlerGameConfigMode : public IActionHandler } if (nFoundFreq == -1) nFoundFreq = 0; // Initialize interface combo box - pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); + pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); if( pCB ) { pCB->resetTexts(); @@ -3147,28 +3147,28 @@ class CHandlerGameConfigFullscreen : public IActionHandler CInterfaceManager *pIM = CInterfaceManager::getInstance(); bool bFullscreen = false; { - CCtrlBaseButton *pBut = dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_FULLSCREEN_BUTTON )); + CCtrlBaseButton *pBut = dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_FULLSCREEN_BUTTON )); if (pBut) bFullscreen = pBut->getPushed(); } CDBGroupComboBox *pCB; if (bFullscreen) { // show modes combo - pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); + pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); if (pCB) pCB->setActive(true); // show frequencies combo - pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); + pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); if (pCB) pCB->setActive(true); } else { // hide modes combo - pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); + pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); if (pCB) pCB->setActive(false); // hide frequencies combo - pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); + pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); if (pCB) pCB->setActive(false); } @@ -3202,7 +3202,7 @@ class CHandlerGameConfigApply : public IActionHandler // Get W, H sint w = 1024, h = 768; { - CDBGroupComboBox *pCB = dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); + CDBGroupComboBox *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); if( pCB != NULL ) { string vidModeStr = pCB->getText(nVideModeNb).toString(); @@ -3216,7 +3216,7 @@ class CHandlerGameConfigApply : public IActionHandler // Get Frequency sint freq = 60; { - CDBGroupComboBox *pCB = dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); + CDBGroupComboBox *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); if( pCB != NULL ) { string vidFreqStr = pCB->getText(nVideoFreqNb).toString(); @@ -3227,7 +3227,7 @@ class CHandlerGameConfigApply : public IActionHandler // Get Fullscreen bool bFullscreen = false; { - CCtrlBaseButton *pBut = dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_FULLSCREEN_BUTTON )); + CCtrlBaseButton *pBut = dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_VIDEO_FULLSCREEN_BUTTON )); if (pBut != NULL) bFullscreen = pBut->getPushed(); } @@ -3823,13 +3823,13 @@ void runMissionProc(sint32 nSelected) else if (nSelected < nNbMission) { string sButtonPath = UI_MISSION_LIST ":b_title"+toString(nSelected); - CCtrlButton *pCB = dynamic_cast(pIM->getElementFromId(sButtonPath)); + CCtrlButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sButtonPath)); pIM->runActionHandler("proc", pCB, "mission_proc_title|"+toString(nSelected)); } else if (nSelected < (nNbMission+nNbGroupMission)) { string sButtonPath = UI_MISSION_LIST ":b_group_title"+toString(nSelected-nNbMission); - CCtrlButton *pCB = dynamic_cast(pIM->getElementFromId(sButtonPath)); + CCtrlButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sButtonPath)); pIM->runActionHandler("proc", pCB, "group_mission_proc_title|"+toString(nSelected-nNbMission)); } return; @@ -3964,7 +3964,7 @@ public: { // hide interface CInterfaceManager* pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *pIG = (CInterfaceGroup*)pIM->getElementFromId ("ui:interface:enter_crzone_proposal"); + CInterfaceGroup *pIG = (CInterfaceGroup*)CWidgetManager::getInstance()->getElementFromId ("ui:interface:enter_crzone_proposal"); if(pIG) pIG->setActive(false); diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index 16b5c93b5..7004f31c9 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -167,7 +167,7 @@ void CInterfaceHelp::initWindows() for(sint i=0;i(pIM->getElementFromId("ui:interface:sheet_help"+toString(i))); + CInterfaceGroup *group= dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:sheet_help"+toString(i))); // if the window exist, insert if(group) { @@ -275,7 +275,7 @@ CInterfaceGroup *CInterfaceHelp::activateNextWindow(CDBCtrlSheet *elt, sint forc if(ok) { // then don't neet to open a new window, but make the older top. - pIM->setTopWindow(group); + CWidgetManager::getInstance()->setTopWindow(group); return NULL; } } @@ -356,7 +356,7 @@ CInterfaceGroup *CInterfaceHelp::activateNextWindow(CDBCtrlSheet *elt, sint forc // activate it, set top, copy item watched group->setActive(true); - pIM->setTopWindow(group); + CWidgetManager::getInstance()->setTopWindow(group); _InfoWindows[newIndexWindow].CtrlSheet= elt; // insert in list if(mustAddToActiveWindows) @@ -914,7 +914,7 @@ class CHandlerBrowse : public IActionHandler void execute (CCtrlBase *pCaller, const std::string &sParams) { string container = getParam (sParams, "name"); - CInterfaceElement *element = CInterfaceManager::getInstance()->getElementFromId(container); + CInterfaceElement *element = CWidgetManager::getInstance()->getElementFromId(container); CInterfaceGroup *elementGroup = dynamic_cast(element); string urls = getParam (sParams, "url"); @@ -1055,7 +1055,7 @@ public: { CInterfaceManager *pIM= CInterfaceManager::getInstance(); string container = getParam (sParams, "name"); - CGroupHTML *groupHtml = dynamic_cast(pIM->getElementFromId(container)); + CGroupHTML *groupHtml = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(container)); if (groupHtml) { groupHtml->browseUndo(); @@ -1074,7 +1074,7 @@ public: { CInterfaceManager *pIM= CInterfaceManager::getInstance(); string container = getParam (sParams, "name"); - CGroupHTML *groupHtml = dynamic_cast(pIM->getElementFromId(container)); + CGroupHTML *groupHtml = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(container)); if (groupHtml) { groupHtml->browseRedo(); @@ -1093,7 +1093,7 @@ public: { CInterfaceManager *pIM= CInterfaceManager::getInstance(); string container = getParam (sParams, "name"); - CGroupHTML *groupHtml = dynamic_cast(pIM->getElementFromId(container)); + CGroupHTML *groupHtml = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(container)); if (groupHtml) { groupHtml->refresh(); @@ -1118,7 +1118,7 @@ class CHandlerHTMLSubmitForm : public IActionHandler string submit_button = getParam (sParams, "submit_button"); - CInterfaceElement *element = CInterfaceManager::getInstance()->getElementFromId(container); + CInterfaceElement *element = CWidgetManager::getInstance()->getElementFromId(container); { // Group HTML ? CGroupHTML *groupHtml = dynamic_cast(element); @@ -3883,7 +3883,7 @@ public: string dbitem= getParam(Params, "dbitem"); string prefix= getParam(Params, "prefix"); - CInterfaceGroup *wnd= dynamic_cast(pIM->getElementFromId(wndStr)); + CInterfaceGroup *wnd= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(wndStr)); CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp(dbitem); // common method for info and botchat diff --git a/code/ryzom/client/src/interface_v3/action_handler_item.cpp b/code/ryzom/client/src/interface_v3/action_handler_item.cpp index b5fb53fea..16b7cdc68 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -107,13 +107,13 @@ void CInterfaceItemEdition::CItemEditionWindow::infoReceived() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); // get the dialog stack - CInterfaceGroup* group = dynamic_cast( pIM->getElementFromId(WindowName) ); + CInterfaceGroup* group = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(WindowName) ); - CInterfaceGroup* editShort = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_display")) ); + CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_short")) ); + CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); + CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); + CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); + CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_display")) ); if (group && editShort && editBoxShort && editLarge && editBoxLarge && display) { CClientItemInfo const& itemInfo = getInventory().getItemInfo( ItemSlotId ); @@ -159,7 +159,7 @@ void CInterfaceItemEdition::CItemEditionWindow::infoReceived() string::size_type delimiter = text.find(' '); if(text.size() > 3 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B') { - CGroupHTML *pGH = dynamic_cast(pIM->getElementFromId("ui:interface:web_transactions:content:html")); + CGroupHTML *pGH = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:web_transactions:content:html")); if (pGH) pGH->browse(ucstring(text.substr(4, delimiter-4)).toString().c_str()); if (delimiter == string::npos) @@ -197,16 +197,16 @@ void CInterfaceItemEdition::CItemEditionWindow::begin() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); // get the dialog stack - CGroupContainer* group = dynamic_cast( pIM->getElementFromId(WindowName) ); + CGroupContainer* group = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(WindowName) ); - CInterfaceGroup* editShort = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_display")) ); - CInterfaceGroup* editButtons = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_buttons")) ); - CCtrlBaseButton* closeButton = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_close_button")) ); - CViewBitmap* background = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_background")) ); + CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_short")) ); + CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); + CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); + CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); + CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_display")) ); + CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_buttons")) ); + CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_close_button")) ); + CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_background")) ); if (group && editShort && editBoxShort && editLarge && editBoxLarge && display && editButtons && closeButton && background) { @@ -297,7 +297,7 @@ void CInterfaceItemEdition::CItemEditionWindow::begin() string::size_type delimiter = text.find(' '); if(text.size() > 3 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B') { - CGroupHTML *pGH = dynamic_cast(pIM->getElementFromId("ui:interface:web_transactions:content:html")); + CGroupHTML *pGH = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:web_transactions:content:html")); if (pGH) pGH->browse(ucstring(text.substr(4, delimiter-4)).toString().c_str()); if (delimiter == string::npos) @@ -334,16 +334,16 @@ void CInterfaceItemEdition::CItemEditionWindow::end() // hide the dialog CInterfaceManager *pIM = CInterfaceManager::getInstance(); // get the dialog stack - CInterfaceGroup* group = dynamic_cast( pIM->getElementFromId(windowName) ); + CInterfaceGroup* group = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(windowName) ); - CInterfaceGroup* editShort = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_display")) ); - CInterfaceGroup* editButtons = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_buttons")) ); - CCtrlBaseButton* closeButton = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_close_button")) ); - CViewBitmap* background = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_background")) ); + CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_short")) ); + CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); + CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); + CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); + CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_display")) ); + CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_buttons")) ); + CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_close_button")) ); + CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_background")) ); if (group && editShort && editBoxShort && editLarge && editBoxLarge && display && editButtons && closeButton && background) { // disable the window @@ -373,16 +373,16 @@ void CInterfaceItemEdition::CItemEditionWindow::validate() CInterfaceManager *pIM = CInterfaceManager::getInstance(); // get the dialog stack - CInterfaceGroup* group = dynamic_cast( pIM->getElementFromId(windowName) ); + CInterfaceGroup* group = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(windowName) ); - CInterfaceGroup* editShort = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_display")) ); - CInterfaceGroup* editButtons = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_edit_buttons")) ); - CCtrlBaseButton* closeButton = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_close_button")) ); - CViewBitmap* background = dynamic_cast( pIM->getElementFromId(pIM->getDefine("edit_custom_background")) ); + CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_short")) ); + CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); + CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); + CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); + CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_display")) ); + CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_buttons")) ); + CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_close_button")) ); + CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_background")) ); if (group && editShort && editBoxShort && editLarge && editBoxLarge && display && editButtons && closeButton && background) { bool textValid = editShort->getActive(); @@ -479,8 +479,8 @@ static void displayQuantityPopup(CCtrlBase *pCaller, CDBCtrlSheet *pCSSrc, CDBCt { CInterfaceManager *pIM = CInterfaceManager::getInstance(); // get the dialog stack - CInterfaceGroup *group= dynamic_cast( pIM->getElementFromId("ui:interface:stack_dialog") ); - CGroupEditBox *editBox= dynamic_cast( pIM->getElementFromId("ui:interface:stack_dialog:edit:eb") ); + CInterfaceGroup *group= dynamic_cast( CWidgetManager::getInstance()->getElementFromId("ui:interface:stack_dialog") ); + CGroupEditBox *editBox= dynamic_cast( CWidgetManager::getInstance()->getElementFromId("ui:interface:stack_dialog:edit:eb") ); if(group && editBox) { // write all info for the modal @@ -500,7 +500,7 @@ static void displayQuantityPopup(CCtrlBase *pCaller, CDBCtrlSheet *pCSSrc, CDBCt editBox->setInputStringAsInt(availableStack); // enable the modal - pIM->enableModalWindow(pCaller, group); + CWidgetManager::getInstance()->enableModalWindow(pCaller, group); // Set the Keyboard focus to the editbox (after the enableModalWindow()) pIM->setCaptureKeyboard(editBox); @@ -723,7 +723,7 @@ public: { CInterfaceManager *pIM = CInterfaceManager::getInstance(); string src = getParam(Params, "src"); - CInterfaceElement *pElt = pIM->getElementFromId(src); + CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src); CDBCtrlSheet *pCSSrc = dynamic_cast(pElt); CDBCtrlSheet *pCSDst = dynamic_cast(pCaller); if ((pCSSrc == NULL) || (pCSDst == NULL)) return; @@ -828,7 +828,7 @@ public: { CInterfaceManager *im = CInterfaceManager::getInstance(); CDBCtrlSheet *src = dynamic_cast(pCaller); - CDBCtrlSheet *dest = dynamic_cast(im->getCtrlLaunchingModal()); + CDBCtrlSheet *dest = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (src->getSheetId() == 0) { putExchangedItemToInventory(dest); @@ -866,7 +866,7 @@ public: { CInterfaceManager *pIM = CInterfaceManager::getInstance(); string src = getParam(Params, "src"); - CInterfaceElement *pElt = pIM->getElementFromId(src); + CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src); CDBCtrlSheet *pCSSrc = dynamic_cast(pElt); CDBCtrlSheet *pCSDst = dynamic_cast(pCaller); if (pCSSrc->getType() == CCtrlSheetInfo::SheetType_Item) @@ -887,7 +887,7 @@ public: { CInterfaceManager *pIM = CInterfaceManager::getInstance(); string src = getParam(Params, "src"); - CInterfaceElement *pElt = pIM->getElementFromId(src); + CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src); CDBCtrlSheet *pCSSrc = dynamic_cast(pElt); CDBCtrlSheet *pCSDst = dynamic_cast(pCaller); if (pCSSrc->getType() == CCtrlSheetInfo::SheetType_Item) @@ -933,7 +933,7 @@ public: string src = getParam(Params, "src"); string strTestEmpty= getParam(Params, "test_empty"); bool testEmpty= strTestEmpty=="true"; - CInterfaceElement *pElt = pIM->getElementFromId(src); + CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src); CDBCtrlSheet *pCSSrc = dynamic_cast(pElt); CDBCtrlSheet *pCSDst = dynamic_cast(pCaller); if (!pCSSrc || !pCSDst) return; @@ -1024,7 +1024,7 @@ class CCanDropToExchange : public IActionHandler { CInterfaceManager *pIM = CInterfaceManager::getInstance(); string src = getParam(Params, "src"); - CInterfaceElement *pElt = pIM->getElementFromId(src); + CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src); CDBCtrlSheet *pCSSrc = dynamic_cast(pElt); CDBCtrlSheet *pCSDst = dynamic_cast(pCaller); if (!pCSSrc || !pCSDst) return; @@ -1489,7 +1489,7 @@ class CHandlerMoveItem : public IActionHandler string sListId = getParam(sParams, "listsheet"+toString(nListIt)); while (!sListId.empty()) { - IListSheetBase *pLS = dynamic_cast(pIM->getElementFromId(sListId)); + IListSheetBase *pLS = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sListId)); if (pLS == NULL) return; // search an empty slot where to put sint32 nbelt = pLS->getNbSheet(); @@ -1550,7 +1550,7 @@ class CHandlerMoveItem : public IActionHandler while (!sGrpId.empty()) { uint i; - CInterfaceGroup *pIG = dynamic_cast(pIM->getElementFromId(sGrpId)); + CInterfaceGroup *pIG = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sGrpId)); if (pIG != NULL) { // Get all the sheets of the group @@ -1583,7 +1583,7 @@ class CHandlerMoveItem : public IActionHandler while (!sGrpId.empty()) { uint i; - CInterfaceGroup *pIG = dynamic_cast(pIM->getElementFromId(sGrpId)); + CInterfaceGroup *pIG = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sGrpId)); if (pIG != NULL) { // Get all the sheets of the group @@ -1626,8 +1626,8 @@ class CHandlerDragNDrop : public IActionHandler string sDst = getParam(sParams,"dst"); string sAH = getParam(sParams,"ah"); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBCtrlSheet *pCSsrc = dynamic_cast(pIM->getElementFromId(sSrc)); - CDBCtrlSheet *pCSdst = dynamic_cast(pIM->getElementFromId(sDst)); + CDBCtrlSheet *pCSsrc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sSrc)); + CDBCtrlSheet *pCSdst = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sDst)); if ((pCSdst == NULL) || (pCSsrc == NULL) || sAH.empty()) return; pIM->runActionHandler(sAH, pCSdst, "src="+pCSsrc->getId()); } @@ -1668,7 +1668,7 @@ class CHandlerItemCristalReload : public IActionHandler void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBCtrlSheet *pCS = dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCS == NULL) return; sendToServerEnchantMessage((uint8)pCS->getInventoryIndex(), (uint16)pCS->getIndexInDB()); @@ -1701,7 +1701,7 @@ void CItemMenuInBagInfoWaiter::infoValidated(CDBCtrlSheet* ctrlSheet) CInterfaceManager *pIM = CInterfaceManager::getInstance(); // get the dialog stack - CInterfaceGroup* pMenu = dynamic_cast( pIM->getElementFromId("ui:interface:item_menu_in_bag") ); + CInterfaceGroup* pMenu = dynamic_cast( CWidgetManager::getInstance()->getElementFromId("ui:interface:item_menu_in_bag") ); if(!pMenu) return; const CItemSheet *pIS = ctrlSheet->asItemSheet(); @@ -1734,7 +1734,7 @@ class CHandlerItemMenuCheck : public IActionHandler uint i; // Get the ctrl sheet that launched this menu - CDBCtrlSheet *pCS = dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCS == NULL) return; INVENTORIES::TInventory invId= (INVENTORIES::TInventory)pCS->getInventoryIndex(); @@ -2039,7 +2039,7 @@ class CHandlerItemMenuBaseCheck : public IActionHandler CInterfaceManager *pIM = CInterfaceManager::getInstance(); // Get the ctrl sheet that launched this menu - CDBCtrlSheet *pCS = dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCS == NULL) return; INVENTORIES::TInventory invId= (INVENTORIES::TInventory)pCS->getInventoryIndex(); @@ -2111,7 +2111,7 @@ class CHandlerTeleportUse : public IActionHandler void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBCtrlSheet *pCS = dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCS == NULL) return; // use the item @@ -2143,7 +2143,7 @@ class CHandlerItemConsume : public IActionHandler void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBCtrlSheet *pCS = dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCS == NULL) return; // use the item @@ -2171,7 +2171,7 @@ class CHandlerItemTextDisplay : public IActionHandler { std::string const& windowName = sParams; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBCtrlSheet *pCSItem = dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBCtrlSheet *pCSItem = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCSItem == NULL || windowName.empty()) return; @@ -2188,7 +2188,7 @@ class CHandlerItemTextEdition : public IActionHandler { std::string const& windowName = sParams; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBCtrlSheet *pCSItem = dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBCtrlSheet *pCSItem = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCSItem == NULL || windowName.empty()) return; @@ -2213,7 +2213,7 @@ class CHandlerXpCatalyserUse : public IActionHandler void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBCtrlSheet *pCS = dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCS == NULL) return; // use the item diff --git a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp index 358b94d88..050ac1cd1 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp @@ -99,13 +99,13 @@ void CActionHandlerShowOne::execute (CCtrlBase * /* pCaller */, const std::strin // hide all window from the list. for(uint i=0;igetElementFromId(wndList[i]); + CInterfaceElement *wnd= CWidgetManager::getInstance()->getElementFromId(wndList[i]); if(wnd) wnd->setActive(false); } // show the one needed - CInterfaceElement *wnd= mngr->getElementFromId(wndShow); + CInterfaceElement *wnd= CWidgetManager::getInstance()->getElementFromId(wndShow); if(wnd) wnd->setActive(true); } @@ -127,7 +127,7 @@ void CActionHandlerActive::execute (CCtrlBase * /* pCaller */, const std::string return; } CInterfaceManager *mngr = CInterfaceManager::getInstance(); - CInterfaceElement *wnd = mngr->getElementFromId(target); + CInterfaceElement *wnd = CWidgetManager::getInstance()->getElementFromId(target); if(!wnd) { nlwarning(" Can't get window %s", target.c_str()); @@ -158,7 +158,7 @@ void CActionHandlerSetOpen::execute (CCtrlBase * /* pCaller */, const std::strin return; } CInterfaceManager *mngr = CInterfaceManager::getInstance(); - CGroupContainer *wnd = dynamic_cast(mngr->getElementFromId(target)); + CGroupContainer *wnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(target)); if(!wnd) { nlwarning(" Can't get window %s", target.c_str()); @@ -199,7 +199,7 @@ void CActionHandlerHideClose::execute (CCtrlBase * /* pCaller */, const std::str uint i; for(i=0;igetElementFromId(hideList[i]); + CInterfaceElement *wnd= CWidgetManager::getInstance()->getElementFromId(hideList[i]); if(wnd) wnd->setActive(false); } @@ -208,7 +208,7 @@ void CActionHandlerHideClose::execute (CCtrlBase * /* pCaller */, const std::str for(i=0;igetElementFromId(closeList[i]); + CInterfaceElement *wnd= CWidgetManager::getInstance()->getElementFromId(closeList[i]); CGroupContainer *pIC = dynamic_cast(wnd); if(pIC) pIC->close(); @@ -236,13 +236,13 @@ void CActionHandlerEnterModal::execute(CCtrlBase *pCaller, const std::string &pa // get the group from param string groupName= getParam(params, "group"); - CInterfaceGroup *group= dynamic_cast( pIM->getElementFromId(groupName) ); + CInterfaceGroup *group= dynamic_cast( CWidgetManager::getInstance()->getElementFromId(groupName) ); if(group) { UserControls.stopFreeLook(); // enable the modal - pIM->enableModalWindow(pCaller, group); + CWidgetManager::getInstance()->enableModalWindow(pCaller, group); } else { @@ -257,11 +257,11 @@ void CActionHandlerPushModal::execute(CCtrlBase *pCaller, const std::string &par // get the group from param string groupName= getParam(params, "group"); - CInterfaceGroup *group= dynamic_cast( mngr->getElementFromId(groupName) ); + CInterfaceGroup *group= dynamic_cast( CWidgetManager::getInstance()->getElementFromId(groupName) ); if(group) { // enable the modal - mngr->pushModalWindow(pCaller, group); + CWidgetManager::getInstance()->pushModalWindow(pCaller, group); } else { @@ -276,7 +276,7 @@ void CActionHandlerLeaveModal::execute(CCtrlBase * /* pCaller */, const std::str CInterfaceManager *mngr= CInterfaceManager::getInstance(); // quit the modal - mngr->popModalWindow(); + CWidgetManager::getInstance()->popModalWindow(); } diff --git a/code/ryzom/client/src/interface_v3/action_handler_move.cpp b/code/ryzom/client/src/interface_v3/action_handler_move.cpp index 2d52c0d14..67d0c7b72 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_move.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_move.cpp @@ -187,7 +187,7 @@ class CAHFreeMouse : public IActionHandler CInterfaceManager *im = CInterfaceManager::getInstance(); if (im) { - CInterfaceGroup *ig = dynamic_cast(im->getElementFromId("ui:interface:game_config")); + CInterfaceGroup *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:game_config")); if (ig && ig->getActive()) { CInterfaceGroup *igHard = dynamic_cast(ig->getGroup("hard")); diff --git a/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp b/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp index 34808c9bf..c544594d5 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp @@ -207,7 +207,7 @@ public: void execute (CCtrlBase * /* pCaller */, const std::string &sParams) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupMap *pMap = dynamic_cast(pIM->getElementFromId(sParams)); + CGroupMap *pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sParams)); if (pMap == NULL) return; @@ -313,7 +313,7 @@ public: void execute (CCtrlBase * /* pCaller */, const std::string &sParams) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupMap *pMap = dynamic_cast(pIM->getElementFromId(sParams)); + CGroupMap *pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sParams)); if (pMap == NULL) return; diff --git a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp index 91a7687d5..551c17f5c 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp @@ -263,10 +263,10 @@ void launchPhraseComposition(bool creation) CInterfaceManager *pIM= CInterfaceManager::getInstance(); // Launch the composition window - CGroupContainer *window= dynamic_cast( pIM->getElementFromId(PhraseComposition) ); + CGroupContainer *window= dynamic_cast( CWidgetManager::getInstance()->getElementFromId(PhraseComposition) ); if(window) { - CDBGroupBuildPhrase *buildSentenceTarget= dynamic_cast( pIM->getElementFromId(PhraseCompositionGroup) ); + CDBGroupBuildPhrase *buildSentenceTarget= dynamic_cast( CWidgetManager::getInstance()->getElementFromId(PhraseCompositionGroup) ); // if found if(buildSentenceTarget) { @@ -371,7 +371,7 @@ public: } // And hide the modal - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } public: enum TType {Root, OtherMain, Param, NewOpCredit, FaberPlan}; @@ -418,11 +418,11 @@ public: buildGroup->fillSelectionMain(index); // launch the modal - CInterfaceGroup *group= dynamic_cast( pIM->getElementFromId( CDBGroupBuildPhrase::BrickSelectionModal ) ); + CInterfaceGroup *group= dynamic_cast( CWidgetManager::getInstance()->getElementFromId( CDBGroupBuildPhrase::BrickSelectionModal ) ); if(group) { // enable the modal - pIM->enableModalWindow(pCaller, group); + CWidgetManager::getInstance()->enableModalWindow(pCaller, group); } } }; @@ -456,11 +456,11 @@ public: buildGroup->fillSelectionParam(index, paramIndex); // launch the modal - CInterfaceGroup *group= dynamic_cast( pIM->getElementFromId( CDBGroupBuildPhrase::BrickSelectionModal ) ); + CInterfaceGroup *group= dynamic_cast( CWidgetManager::getInstance()->getElementFromId( CDBGroupBuildPhrase::BrickSelectionModal ) ); if(group) { // enable the modal - pIM->enableModalWindow(pCaller, group); + CWidgetManager::getInstance()->enableModalWindow(pCaller, group); } } }; @@ -493,11 +493,11 @@ public: buildGroup->fillSelectionNewCredit(); // launch the modal - CInterfaceGroup *group= dynamic_cast( pIM->getElementFromId( CDBGroupBuildPhrase::BrickSelectionModal ) ); + CInterfaceGroup *group= dynamic_cast( CWidgetManager::getInstance()->getElementFromId( CDBGroupBuildPhrase::BrickSelectionModal ) ); if(group) { // enable the modal - pIM->enableModalWindow(pCaller, group); + CWidgetManager::getInstance()->enableModalWindow(pCaller, group); } } }; @@ -541,11 +541,11 @@ public: CHandlerPhraseValidateBrick::BrickType= CHandlerPhraseValidateBrick::FaberPlan; // launch the modal - CInterfaceGroup *group= dynamic_cast( pIM->getElementFromId( CDBGroupBuildPhrase::BrickSelectionModal ) ); + CInterfaceGroup *group= dynamic_cast( CWidgetManager::getInstance()->getElementFromId( CDBGroupBuildPhrase::BrickSelectionModal ) ); if(group) { // enable the modal - pIM->enableModalWindow(pCaller, group); + CWidgetManager::getInstance()->enableModalWindow(pCaller, group); } } }; @@ -571,7 +571,7 @@ static void updateAllSPhraseInfo() // update all info windows CInterfaceHelp::updateWindowSPhraseTexts(); // If the composition is opened, refresh - CInterfaceGroup *pIG= dynamic_cast(pIM->getElementFromId("ui:interface:phrase_composition")); + CInterfaceGroup *pIG= dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:phrase_composition")); if(pIG && pIG->getActive()) { CDBGroupBuildPhrase *buildPhrase= dynamic_cast(pIG->getGroup("header_opened")); @@ -653,7 +653,7 @@ public: CMacroCmdManager *pMM = CMacroCmdManager::getInstance(); string src = getParam(Params, "src"); - CInterfaceElement *pElt = pIM->getElementFromId(src); + CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src); CDBCtrlSheet *pCSSrc = dynamic_cast(pElt); CDBCtrlSheet *pCSDst = dynamic_cast(pCaller); // can be a phrase id (comes from memory), a phraseSheet (comes from progression), or a macro, @@ -806,7 +806,7 @@ void CHandlerMemorizePhraseOrMacro::execute (CCtrlBase *pCaller, const string &P } else { - CInterfaceElement *pElt = pIM->getElementFromId(src); + CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src); pCSSrc = dynamic_cast(pElt); // type check @@ -1265,9 +1265,9 @@ public: // get the control CInterfaceElement *elm; if (shortcut < RYZOM_MAX_SHORTCUT) - elm = pIM->getElementFromId(PhraseMemoryCtrlBase + toString(shortcut) ); + elm = CWidgetManager::getInstance()->getElementFromId(PhraseMemoryCtrlBase + toString(shortcut) ); else - elm = pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(shortcut-RYZOM_MAX_SHORTCUT) ); + elm = CWidgetManager::getInstance()->getElementFromId(PhraseMemoryAltCtrlBase + toString(shortcut-RYZOM_MAX_SHORTCUT) ); CDBCtrlSheet *ctrl= dynamic_cast(elm); if(ctrl) { @@ -1314,7 +1314,7 @@ public: { // opens the menu CDBCtrlSheet::setCurrSelSheet(pCSDst); - pIM->enableModalWindow (pCSDst, menu); + CWidgetManager::getInstance()->enableModalWindow (pCSDst, menu); } } } @@ -1443,7 +1443,7 @@ public: CInterfaceManager *pIM = CInterfaceManager::getInstance(); CSPhraseManager *pPM = CSPhraseManager::getInstance(); CSBrickManager *pBM = CSBrickManager::getInstance(); - CInterfaceElement *pCristalizeMenuOption = pIM->getElementFromId(sCristalizePath); + CInterfaceElement *pCristalizeMenuOption = CWidgetManager::getInstance()->getElementFromId(sCristalizePath); if (pCristalizeMenuOption == NULL) return; // The default is to not display the cristalize menu option @@ -1452,7 +1452,7 @@ public: // Get the interface control sheet - CDBCtrlSheet *pCS = dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCS == NULL) return; if (!pCS->isSPhraseIdMemory()) return; diff --git a/code/ryzom/client/src/interface_v3/action_handler_ui.cpp b/code/ryzom/client/src/interface_v3/action_handler_ui.cpp index 8fcd4726f..745b89d57 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_ui.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_ui.cpp @@ -89,7 +89,7 @@ class CAHUIOpen : public IActionHandler virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface", Params)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface", Params)); if (pGC == NULL) { nlwarning("%s is not a container", Params.c_str()); @@ -111,7 +111,7 @@ class CAHUIClose : public IActionHandler virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface", Params)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface", Params)); if (pGC == NULL) { nlwarning("%s is not a container", Params.c_str()); @@ -132,7 +132,7 @@ class CAHUIOpenClose : public IActionHandler virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface", Params)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface", Params)); if (pGC == NULL) { nlwarning("%s is not a container", Params.c_str()); @@ -154,7 +154,7 @@ class CAHUIPopup : public IActionHandler virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface", Params)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface", Params)); if (pGC == NULL) { nlwarning("%s is not a container", Params.c_str()); @@ -185,7 +185,7 @@ class CAHUIPopin : public IActionHandler virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface", Params)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface", Params)); if (pGC == NULL) { nlwarning("%s is not a container", Params.c_str()); @@ -220,7 +220,7 @@ class CAHUIPopupPopin : public IActionHandler virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface", Params)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface", Params)); if (pGC == NULL) { nlwarning("%s is not a container", Params.c_str()); @@ -256,7 +256,7 @@ public: virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface", Params)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface", Params)); if (pGC == NULL) { nlwarning("%s is not a container", Params.c_str()); @@ -307,7 +307,7 @@ public: virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface", Params)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface", Params)); if (pGC == NULL) { nlwarning("%s is not a container", Params.c_str()); @@ -316,7 +316,7 @@ public: if (!isContainerAuthorized(pGC)) return; pGC->setActive(true); - pIM->setTopWindow(pGC); + CWidgetManager::getInstance()->setTopWindow(pGC); } }; REGISTER_ACTION_HANDLER( CAHUIShow, "show" ); @@ -338,7 +338,7 @@ public: virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface", Params)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface", Params)); if (pGC == NULL) { nlwarning("%s is not a container", Params.c_str()); @@ -388,7 +388,7 @@ class CAHUIShowHide : public IActionHandler } CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface", window)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface", window)); if (pGC == NULL) { nlwarning("%s is not a container", window.c_str()); @@ -410,7 +410,7 @@ class CAHUIShowHide : public IActionHandler } if(!webapp.empty() && pGC->getActive()) { - CGroupHTML *pGH = dynamic_cast(pIM->getElementFromId("ui:interface:webig:content:html")); + CGroupHTML *pGH = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:webig:content:html")); if (pGH == NULL) { nlwarning("%s is not a group html", window.c_str()); @@ -533,7 +533,7 @@ class CAHTalkUntalk : public IActionHandler cw->getContainer()->setActive(true); cw->getContainer()->setOpen(true); CInterfaceManager *im = CInterfaceManager::getInstance(); - im->setTopWindow(cw->getContainer()); + CWidgetManager::getInstance()->setTopWindow(cw->getContainer()); cw->enableBlink(1); im->setCaptureKeyboard(cw->getEditBox()); PeopleInterraction.MainChat.Filter.setTargetPlayer(selection->getName()); @@ -654,8 +654,8 @@ class CAHUISetTopWindow : public IActionHandler { CInterfaceManager *pIM = CInterfaceManager::getInstance(); string sWin = getParam(Params,"win"); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(sWin)); - if (pGC != NULL && isContainerAuthorized(pGC)) pIM->setTopWindow(pGC); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sWin)); + if (pGC != NULL && isContainerAuthorized(pGC)) CWidgetManager::getInstance()->setTopWindow(pGC); } }; REGISTER_ACTION_HANDLER( CAHUISetTopWindow, "set_top_window" ); diff --git a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp index b48a3a705..b6b797246 100644 --- a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -133,7 +133,7 @@ void CActionPhraseFaber::launchFaberCastWindow(sint32 memoryLine, uint memoryIn // **** Hide all widgets, MP Ctrls, and reset DB, until the Plan is not selected CInterfaceManager *pIM= CInterfaceManager::getInstance(); // Hide the valid button - CCtrlBaseButton *validButton= dynamic_cast(pIM->getElementFromId(FaberPhraseValidButton)); + CCtrlBaseButton *validButton= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseValidButton)); if(validButton) validButton->setFrozen(true); @@ -150,7 +150,7 @@ void CActionPhraseFaber::launchFaberCastWindow(sint32 memoryLine, uint memoryIn } // Hide item requirements groups per default - CInterfaceGroup *itemReqLineGroup= dynamic_cast(pIM->getElementFromId( toString(FaberPhraseItemReqLine.c_str(), itemReqLine) )); + CInterfaceGroup *itemReqLineGroup= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( toString(FaberPhraseItemReqLine.c_str(), itemReqLine) )); if(itemReqLineGroup) itemReqLineGroup->setActive(false); } @@ -166,13 +166,13 @@ void CActionPhraseFaber::launchFaberCastWindow(sint32 memoryLine, uint memoryIn node->setValue32(0); // Hide the ItemResult group - CInterfaceGroup *groupMp= dynamic_cast(pIM->getElementFromId(FaberPhraseItemResultGroup)); + CInterfaceGroup *groupMp= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseItemResultGroup)); if(groupMp) groupMp->setActive(false); // **** Open the window! - CGroupContainer *window= dynamic_cast(pIM->getElementFromId(FaberPhraseWindow)); + CGroupContainer *window= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseWindow)); if(window) { window->setActive(true); @@ -385,7 +385,7 @@ void CActionPhraseFaber::validateFaberPlanSelection(CSBrickSheet *itemPlanBrick node->setValue32(itemPlanBrick->FaberPlan.NbItemBuilt); // Show the ItemResult group - CInterfaceGroup *groupMp= dynamic_cast(pIM->getElementFromId(FaberPhraseItemResultGroup)); + CInterfaceGroup *groupMp= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseItemResultGroup)); if(groupMp) groupMp->setActive(true); @@ -471,7 +471,7 @@ void CActionPhraseFaber::validateFaberPlanSelection(CSBrickSheet *itemPlanBrick // **** show ItemParts according to plan. // Hide the valid button - CCtrlBaseButton *validButton= dynamic_cast(pIM->getElementFromId(FaberPhraseValidButton)); + CCtrlBaseButton *validButton= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseValidButton)); if(validButton) validButton->setFrozen(true); @@ -489,7 +489,7 @@ void CActionPhraseFaber::validateFaberPlanSelection(CSBrickSheet *itemPlanBrick } // Setup item requirement groups - CInterfaceGroup *itemReqLineGroup= dynamic_cast(pIM->getElementFromId( toString(FaberPhraseItemReqLine.c_str(), itemReqLine) )); + CInterfaceGroup *itemReqLineGroup= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( toString(FaberPhraseItemReqLine.c_str(), itemReqLine) )); if(itemReqLineGroup) { if( itemReqLine<_MPBuildNumTotalItemReq ) @@ -556,7 +556,7 @@ void CActionPhraseFaber::validateFaberPlanSelection(CSBrickSheet *itemPlanBrick } // **** Setup the new window title - CGroupContainer *window= dynamic_cast(pIM->getElementFromId(FaberPhraseWindow)); + CGroupContainer *window= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseWindow)); if(window) { // Setup the Title with the item built @@ -666,7 +666,7 @@ void CActionPhraseFaber::startMpSelection(uint itemReqLine, uint mpSlot) // get the ctrlSlot CDBCtrlSheet *ctrlSlot= NULL; - CInterfaceGroup *itemReqLineGroup= dynamic_cast(pIM->getElementFromId( toString(FaberPhraseItemReqLine.c_str(), itemReqLine) )); + CInterfaceGroup *itemReqLineGroup= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( toString(FaberPhraseItemReqLine.c_str(), itemReqLine) )); if(itemReqLineGroup) { CDBGroupListSheet *listSheet= dynamic_cast(itemReqLineGroup->getGroup(FaberPhraseList)); @@ -702,7 +702,7 @@ void CActionPhraseFaber::startMpSelection(uint itemReqLine, uint mpSlot) _MpChangeQuantitySlot= mpSlot; // Setup the text with value by default - CInterfaceGroup *quantityModal= dynamic_cast(pIM->getElementFromId(FaberPhraseMpQuantityModal)); + CInterfaceGroup *quantityModal= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseMpQuantityModal)); if(quantityModal) { CGroupEditBox *eb = dynamic_cast(quantityModal->getGroup("eb")); @@ -715,7 +715,7 @@ void CActionPhraseFaber::startMpSelection(uint itemReqLine, uint mpSlot) } // launch the modal - pIM->enableModalWindow(ctrlSlot, quantityModal); + CWidgetManager::getInstance()->enableModalWindow(ctrlSlot, quantityModal); } // else select new MP else @@ -756,7 +756,7 @@ void CActionPhraseFaber::startMpSelection(uint itemReqLine, uint mpSlot) _MpCurrentSelection= selectMps; // Open the Selection Window. - pIM->enableModalWindow(ctrlSlot, FaberPhraseMpListModal); + CWidgetManager::getInstance()->enableModalWindow(ctrlSlot, FaberPhraseMpListModal); } } @@ -767,7 +767,7 @@ void CActionPhraseFaber::validateMpSelection(uint selectId) if(selectId>=_MpCurrentSelection.size()) { - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); return; } @@ -817,7 +817,7 @@ void CActionPhraseFaber::validateMpSelection(uint selectId) // must hide the modal window which had open us. NB: must be done here because next, // we'll open the MP quantity selection - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); // **** when all is correctly ended, open the quantity selection // NB: just enable this code, if you want this feature @@ -882,7 +882,7 @@ void CActionPhraseFaber::validateMpSelectQuantity() updateItemResult(); // hide the Modal Quantity selection - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } // *************************************************************************** @@ -931,7 +931,7 @@ void CActionPhraseFaber::validateExecution() // NO more Close the Execution window (allow refaber quick) /*CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CInterfaceElement *window= pIM->getElementFromId(FaberPhraseWindow); + CInterfaceElement *window= CWidgetManager::getInstance()->getElementFromId(FaberPhraseWindow); if(window) window->setActive(false); */ @@ -981,7 +981,7 @@ void CActionPhraseFaber::updateEmptySlot(uint itemReqLine, CInterfaceGroup *it CInterfaceManager *pIM= CInterfaceManager::getInstance(); if(!itemReqLineGroup) - itemReqLineGroup= dynamic_cast(pIM->getElementFromId( toString(FaberPhraseItemReqLine.c_str(), itemReqLine) )); + itemReqLineGroup= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( toString(FaberPhraseItemReqLine.c_str(), itemReqLine) )); if(!itemReqLineGroup) return; @@ -1085,7 +1085,7 @@ void CActionPhraseFaber::updateValidButton() // unfreeze if valid CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CCtrlBaseButton *validButton= dynamic_cast(pIM->getElementFromId(FaberPhraseValidButton)); + CCtrlBaseButton *validButton= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseValidButton)); if(validButton) validButton->setFrozen(!canValid); } @@ -1178,7 +1178,7 @@ public: if(!ctrl) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); return; } @@ -1213,7 +1213,7 @@ public: { // get the button CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CCtrlBaseButton *button= dynamic_cast(pIM->getElementFromId(FaberPhraseValidButton)); + CCtrlBaseButton *button= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseValidButton)); // Ok, button found. test if active. if( button && !button->getFrozen() ) @@ -1265,7 +1265,7 @@ void validateFaberPlanSelection(CSBrickSheet *itemPlanBrick) void closeFaberCastWindow() { if (ActionPhraseFaber == NULL) return; - CGroupContainer *window= dynamic_cast(CInterfaceManager::getInstance()->getElementFromId(FaberPhraseWindow)); + CGroupContainer *window= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseWindow)); if(window && window->getActive()) window->setActive(false); } @@ -1480,12 +1480,12 @@ void CActionPhraseFaber::onInventoryChange() updateValidButton(); // close selection modals if they are opened - CInterfaceGroup *quantityModal= dynamic_cast(pIM->getElementFromId(FaberPhraseMpQuantityModal)); - if(quantityModal && pIM->getModalWindow()==quantityModal) - pIM->disableModalWindow(); - CInterfaceGroup *listModal= dynamic_cast(pIM->getElementFromId(FaberPhraseMpListModal)); - if(listModal && pIM->getModalWindow()==listModal) - pIM->disableModalWindow(); + CInterfaceGroup *quantityModal= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseMpQuantityModal)); + if(quantityModal && CWidgetManager::getInstance()->getModalWindow()==quantityModal) + CWidgetManager::getInstance()->disableModalWindow(); + CInterfaceGroup *listModal= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseMpListModal)); + if(listModal && CWidgetManager::getInstance()->getModalWindow()==listModal) + CWidgetManager::getInstance()->disableModalWindow(); // update item result updateItemResult(); @@ -1674,7 +1674,7 @@ void CActionPhraseFaber::updateItemResult() // **** change success rate too - CViewText *successView= dynamic_cast(pIM->getElementFromId(FaberPhraseFpSuccessText)); + CViewText *successView= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseFpSuccessText)); if(successView) { ucstring text= CI18N::get("uiPhraseFaberSuccessRate"); @@ -1742,7 +1742,7 @@ void CActionPhraseFaber::updateItemResult() // **** Stats - CInterfaceGroup *groupMp= dynamic_cast(pIM->getElementFromId(FaberPhraseItemResultGroup)); + CInterfaceGroup *groupMp= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(FaberPhraseItemResultGroup)); if(groupMp) { // default: hide all diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page.cpp index 5714afffa..1194c649f 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page.cpp @@ -27,7 +27,7 @@ void CBotChatPage::activateWindow(const char *windowName, bool active) { CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceGroup *ig = dynamic_cast(im->getElementFromId(windowName)); + CInterfaceGroup *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(windowName)); if (ig) { ig->setActive(active); diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_create_guild.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_create_guild.cpp index e7d4c2d7a..2e7c95ca2 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_create_guild.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_create_guild.cpp @@ -59,13 +59,13 @@ class CHandlerGuildCreate : public IActionHandler string IconWin = getParam(Params, "icon"); string guildDescWin = getParam(Params, "desc"); - CGroupEditBox *pGEB = dynamic_cast(pIM->getElementFromId(guildNameWin)); + CGroupEditBox *pGEB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(guildNameWin)); if (pGEB == NULL) return; - CDBCtrlSheet *pCS = dynamic_cast(pIM->getElementFromId(IconWin)); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(IconWin)); if (pCS == NULL) return; - CGroupEditBox *pDesc = dynamic_cast(pIM->getElementFromId(guildDescWin)); + CGroupEditBox *pDesc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(guildDescWin)); ucstring guildName = pGEB->getInputString(); diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp index 0d53ef84b..15f3dc6aa 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp @@ -87,7 +87,7 @@ void CBotChatPageDynamicMission::begin() } } activateWindow(WIN_BOT_CHAT_PAGE_DYNAMIC_MISSION, true); - CInterfaceGroup *ig = dynamic_cast(im->getElementFromId(WIN_BOT_CHAT_PAGE_DYNAMIC_MISSION)); + CInterfaceGroup *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_PAGE_DYNAMIC_MISSION)); if (!ig) { std::fill(_ChoiceCB, _ChoiceCB + DYNAMIC_MISSION_NUM_CHOICES, (CDBGroupComboBox *) NULL); @@ -122,7 +122,7 @@ void CBotChatPageDynamicMission::end() { // if a menu is currently poped, disable it CInterfaceManager *im = CInterfaceManager::getInstance(); - im->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); activateWindow(WIN_BOT_CHAT_PAGE_DYNAMIC_MISSION, false); } diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp index 5b2c06083..fc84aedde 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp @@ -67,7 +67,7 @@ void CBotChatPageMission::begin() // Select the Mission Aspect according to mission type NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:MISSION:MISSION_TYPE")->setValue32(_MType); - CGroupContainer *gc = dynamic_cast(im->getElementFromId(WIN_BOT_CHAT_PAGE_MISSION)); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_PAGE_MISSION)); if (gc) { // show the ui @@ -96,7 +96,7 @@ void CBotChatPageMission::selectMission(CDBCtrlSheet *missionSheet) if (missionSheet->getGrayed()) return; // show the dialog with good infos CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *gc = dynamic_cast(im->getElementFromId(WIN_BOT_CHAT_ACCEPT_MISSION)); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_ACCEPT_MISSION)); // copy text id for title { @@ -123,7 +123,7 @@ void CBotChatPageMission::selectMission(CDBCtrlSheet *missionSheet) } // if (!gc) return; - im->setTopWindow(gc); + CWidgetManager::getInstance()->setTopWindow(gc); gc->setActive(true); gc->updateCoords(); gc->center(); diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_mission_end.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_mission_end.cpp index 58161417b..acc65410b 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_mission_end.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_mission_end.cpp @@ -40,7 +40,7 @@ void CBotChatPageMissionEnd::begin() CInterfaceManager *im = CInterfaceManager::getInstance(); uint flags = CBotChatManager::getInstance().getChosenMissionFlags(); // reward text - CInterfaceGroup *ig = dynamic_cast(im->getElementFromId(WIN_BOT_CHAT_PAGE_MISSION_END)); + CInterfaceGroup *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_PAGE_MISSION_END)); if (!ig) return; CInterfaceGroup *rewardText = ig->getGroup("reward_text"); if (rewardText) diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp index 356845d35..c3b1f2df8 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp @@ -97,7 +97,7 @@ public: { CSheetHelpSetup helpSetup; CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *ig = dynamic_cast(im->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); + CGroupContainer *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); fillHelpSetupInfosForTrade(helpSetup, Sheet, ig); refreshItemHelp(helpSetup); } @@ -171,7 +171,7 @@ void CBotChatPageTrade::init() void CBotChatPageTrade::invalidateCoords() { CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *gc = dynamic_cast(im->getElementFromId(_BuyOnly ? WIN_BOT_CHAT_PAGE_BUY : WIN_BOT_CHAT_PAGE_TRADE)); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_BuyOnly ? WIN_BOT_CHAT_PAGE_BUY : WIN_BOT_CHAT_PAGE_TRADE)); if (!gc) return; // invalidate buy group gc->invalidateCoords(); @@ -241,7 +241,7 @@ void CBotChatPageTrade::begin() _DownloadComplete = false; // update interface - CGroupContainer *gc = dynamic_cast(pIM->getElementFromId(_BuyOnly ? WIN_BOT_CHAT_PAGE_BUY : WIN_BOT_CHAT_PAGE_TRADE)); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_BuyOnly ? WIN_BOT_CHAT_PAGE_BUY : WIN_BOT_CHAT_PAGE_TRADE)); if (gc) { // set the title @@ -323,7 +323,7 @@ uint32 CBotChatPageTrade::getCurrItemQuantity() const itemSheet->Family != ITEMFAMILY::GUILD_OPTION) { CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceGroup *ig = dynamic_cast(im->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); + CInterfaceGroup *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); if (!ig) return std::numeric_limits::max(); // TODO: edit box in faction points? CGroupEditBox *ed = dynamic_cast(ig->getGroup("header_opened:standard_price:quantity:edit:eb")); @@ -357,7 +357,7 @@ uint32 CBotChatPageTrade::getCurrItemPriceResale() const // const CItemSheet *itemSheet = _CurrItemSheet->asItemSheet(); CInterfaceManager *pIM = CInterfaceManager::getInstance(); // get the edited resale price - CInterfaceGroup *ig = dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); + CInterfaceGroup *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); if (!ig) return 0; CGroupEditBox *resaleMarginBox = dynamic_cast(ig->getGroup("header_opened:resell_group:can_resell:choose_resell:edit:eb")); if (!resaleMarginBox) return 0; @@ -506,7 +506,7 @@ uint32 CBotChatPageTrade::getUserFactionPoints(PVP_CLAN::TPVPClan clan) const void CBotChatPageTrade::notifyDownloadComplete(bool completed) { CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *gc = dynamic_cast(im->getElementFromId(_BuyOnly ? WIN_BOT_CHAT_PAGE_BUY : WIN_BOT_CHAT_PAGE_TRADE)); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_BuyOnly ? WIN_BOT_CHAT_PAGE_BUY : WIN_BOT_CHAT_PAGE_TRADE)); if (!gc) return; class CDBListVisitor : public CInterfaceElementVisitor { @@ -552,7 +552,7 @@ void CBotChatPageTrade::updateTradeModal() } // get pointers on interface elements CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *ig = dynamic_cast(im->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); + CGroupContainer *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); CInterfaceGroup *confirmTradeGroup = ig->getGroup("confirm_trade"); CCtrlBase *confirmResellGroup = ig->getCtrl("confirm_trade_resell"); CInterfaceGroup *cantTradeGroup = ig->getGroup("cant_trade"); @@ -841,7 +841,7 @@ void CBotChatPageTrade::startBuyDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCall { if (!sheet) return; CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *ig = dynamic_cast(im->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); + CGroupContainer *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); if (!ig) return; // don't know why but in some case, the sheetId is 0 @@ -922,7 +922,7 @@ void CBotChatPageTrade::startBuyDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCall ig->updateCoords(); ig->center(); ig->setModalParentList(_BuyOnly ? WIN_BOT_CHAT_PAGE_BUY : WIN_BOT_CHAT_PAGE_TRADE); - im->setTopWindow(ig); + CWidgetManager::getInstance()->setTopWindow(ig); // _CurrItemSheet = sheet; _CurrItemIndex = sheet->getIndexInDB(); @@ -949,7 +949,7 @@ void CBotChatPageTrade::updateSPhraseBuyDialog() CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CGroupContainer *ig = dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); + CGroupContainer *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); if (!ig) return; CSheetHelpSetup helpSetup; @@ -963,7 +963,7 @@ void CBotChatPageTrade::startSellDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCal nlassert(!_BuyOnly); if (!sheet) return; CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *ig = dynamic_cast(im->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); + CGroupContainer *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); if (!ig) return; // If this sheet is grayed cause of an "Animal Inventory unavailable" flag, quit @@ -1020,7 +1020,7 @@ void CBotChatPageTrade::startSellDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCal ig->updateCoords(); ig->center(); ig->setModalParentList(WIN_BOT_CHAT_PAGE_TRADE); - im->setTopWindow(ig); + CWidgetManager::getInstance()->setTopWindow(ig); // _CurrItemSheet = sheet; _CurrItemIndex = sheet->getIndexInDB(); @@ -1048,7 +1048,7 @@ void CBotChatPageTrade::endTradeModal() // hide the dialog CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *ig = dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); + CGroupContainer *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); if (ig) ig->setActive(false); // Hide any confirmation dialog related to trade (important for building MessageBox confirmation) @@ -1056,7 +1056,7 @@ void CBotChatPageTrade::endTradeModal() if(pIM->getCurrentValidMessageBoxOnOk(vmbOnOk)) { if(vmbOnOk=="confirm_trade") - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } } @@ -1296,7 +1296,7 @@ void CBotChatPageTrade::confirmTrade( bool enableResale ) if ( _ResaleEdit ) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *ig = dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); + CInterfaceGroup *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); if (ig) { CGroupEditBox *eb = dynamic_cast(ig->getGroup("header_opened:resell_group:can_resell:choose_resell:edit:eb")); @@ -1706,7 +1706,7 @@ void CBotChatPageTrade::startChangeBuyFilterDialog(const std::string &dbext, con _FilterBuyDlgMaxValue= maxValue; // change the title - CInterfaceGroup *ig= dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER)); + CInterfaceGroup *ig= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER)); if(!ig) return; CViewText *vtitle= dynamic_cast(ig->getView("title")); if(vtitle) @@ -1730,7 +1730,7 @@ void CBotChatPageTrade::startChangeBuyFilterDialog(const std::string &dbext, con setFocusOnEditBox(ig->getGroup("edit_min:eb")); // go - pIM->enableModalWindow(NULL, ig); + CWidgetManager::getInstance()->enableModalWindow(NULL, ig); } // *************************************************************************** @@ -1739,7 +1739,7 @@ void CBotChatPageTrade::resetBuyFilterDialog() CInterfaceManager *pIM= CInterfaceManager::getInstance(); // get the modal window - CInterfaceGroup *ig= dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER)); + CInterfaceGroup *ig= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER)); if(!ig) return; // reset the edited values @@ -1759,7 +1759,7 @@ void CBotChatPageTrade::resetBuyFilterDialog() sendCurrentBuyFilterToServer(true); // and leave modal - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } // *************************************************************************** @@ -1768,7 +1768,7 @@ void CBotChatPageTrade::confirmChangeBuyFilterDialog() CInterfaceManager *pIM= CInterfaceManager::getInstance(); // get the modal window - CInterfaceGroup *ig= dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER)); + CInterfaceGroup *ig= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER)); if(!ig) return; // retrieve the edited values @@ -1792,7 +1792,7 @@ void CBotChatPageTrade::confirmChangeBuyFilterDialog() sendCurrentBuyFilterToServer(true); // and leave modal - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } // *************************************************************************** @@ -1801,7 +1801,7 @@ void CBotChatPageTrade::giveFocusToMaxEBChangeBuyFilterDialog() CInterfaceManager *pIM= CInterfaceManager::getInstance(); // get the modal window - CInterfaceGroup *ig= dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER)); + CInterfaceGroup *ig= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER)); if(!ig) return; // set focus on max @@ -1815,11 +1815,11 @@ void CBotChatPageTrade::startChangeBuyFilterMPDialog() CInterfaceManager *pIM= CInterfaceManager::getInstance(); // show the modal - CInterfaceGroup *ig= dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER_MP)); + CInterfaceGroup *ig= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER_MP)); if(!ig) return; // go - pIM->enableModalWindow(NULL, ig); + CWidgetManager::getInstance()->enableModalWindow(NULL, ig); } @@ -1837,7 +1837,7 @@ void CBotChatPageTrade::confirmChangeBuyFilterMPDialog(uint ft) sendCurrentBuyFilterToServer(true); // and leave modal - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } @@ -1915,7 +1915,7 @@ void CBotChatPageTrade::sendCurrentBuyFilterToServer(bool resetBuyList) _TradePagesObs.start(); // update interface - CGroupContainer *gc = dynamic_cast(pIM->getElementFromId(_BuyOnly ? WIN_BOT_CHAT_PAGE_BUY : WIN_BOT_CHAT_PAGE_TRADE)); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_BuyOnly ? WIN_BOT_CHAT_PAGE_BUY : WIN_BOT_CHAT_PAGE_TRADE)); if (gc) { // unselect just buy list (don't need for sell) @@ -1989,7 +1989,7 @@ void CBotChatPageTrade::refreshResale() _TradePagesObs.start(); // update interface - CGroupContainer *gc = dynamic_cast(pIM->getElementFromId(_BuyOnly ? WIN_BOT_CHAT_PAGE_BUY : WIN_BOT_CHAT_PAGE_TRADE)); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_BuyOnly ? WIN_BOT_CHAT_PAGE_BUY : WIN_BOT_CHAT_PAGE_TRADE)); if (gc) { // unselect just buy list (don't need for sell) @@ -2013,11 +2013,11 @@ void CBotChatPageTrade::startChangeBuyFilterClassDialog() if(dbClassMax) tempClassMax->setValue32(dbClassMax->getValue32()); // show the modal - CInterfaceGroup *ig= dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER_CLASS)); + CInterfaceGroup *ig= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER_CLASS)); if(!ig) return; // go - pIM->enableModalWindow(NULL, ig); + CWidgetManager::getInstance()->enableModalWindow(NULL, ig); } @@ -2041,7 +2041,7 @@ void CBotChatPageTrade::resetBuyFilterClassDialog() sendCurrentBuyFilterToServer(true); // and leave modal - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } // *************************************************************************** @@ -2066,7 +2066,7 @@ void CBotChatPageTrade::confirmChangeBuyFilterClassDialog() sendCurrentBuyFilterToServer(true); // and leave modal - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } @@ -2091,11 +2091,11 @@ void CBotChatPageTrade::startChangeBuyFilterItemTypeDialog() // the list of possible item type to select is filled when the DB of bitfield change // show the modal - CInterfaceGroup *ig= dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER_ITEM_TYPE)); + CInterfaceGroup *ig= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_CHANGE_BUY_FILTER_ITEM_TYPE)); if(!ig) return; // go - pIM->enableModalWindow(NULL, ig); + CWidgetManager::getInstance()->enableModalWindow(NULL, ig); } // *************************************************************************** @@ -2111,7 +2111,7 @@ void CBotChatPageTrade::confirmChangeBuyFilterItemTypeDialog(ITEM_TYPE::TItemTy sendCurrentBuyFilterToServer(true); // and leave modal - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } // *************************************************************************** @@ -2132,9 +2132,9 @@ void CBotChatPageTrade::startDestroyItemDialog() NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:TRADE_ITEM:DESTROY_QUANTITY")->setValue32(quantity); // show the modal - CInterfaceGroup *ig= dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_DESTROY_ITEM)); + CInterfaceGroup *ig= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_DESTROY_ITEM)); if(!ig) return; - pIM->enableModalWindow(NULL, ig); + CWidgetManager::getInstance()->enableModalWindow(NULL, ig); } // *************************************************************************** @@ -2190,7 +2190,7 @@ void CBotChatPageTrade::confirmDestroyItemDialog() } // in all cases, close the modal - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); // if the quantity entered was correct if(quantity!=0 && quantity!=std::numeric_limits::max()) @@ -2551,7 +2551,7 @@ class CAHBotChatChangeResaleMargin : public IActionHandler virtual void execute(CCtrlBase * /* pCaller */, const std::string &sParams) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *ig = dynamic_cast(pIM->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); + CInterfaceGroup *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_BOT_CHAT_SELL_BUY_ITEM)); if (!ig) return; CGroupEditBox *resaleMarginBox = dynamic_cast(ig->getGroup("header_opened:resell_group:can_resell:choose_resell:edit:eb")); if (resaleMarginBox) diff --git a/code/ryzom/client/src/interface_v3/chat_window.cpp b/code/ryzom/client/src/interface_v3/chat_window.cpp index 446174778..30985718c 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.cpp +++ b/code/ryzom/client/src/interface_v3/chat_window.cpp @@ -92,7 +92,7 @@ bool CChatWindow::create(const CChatWindowDesc &desc, const std::string &chatId) { if (desc.FatherContainer != "ui:interface" ) { - fatherContainer = dynamic_cast(im->getElementFromId(desc.FatherContainer)); + fatherContainer = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(desc.FatherContainer)); if (!fatherContainer) { nlwarning(" Can't get father group, or bad type"); @@ -143,7 +143,7 @@ bool CChatWindow::create(const CChatWindowDesc &desc, const std::string &chatId) _EB->setAHOnEnter("chat_box_entry"); } - CInterfaceGroup *pRoot = dynamic_cast(im->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); if (fatherContainer) { @@ -289,7 +289,7 @@ void CChatWindow::deleteContainer() proprietaryContainer->detachContainer(_Chat); // just detach } CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceGroup *pRoot = dynamic_cast(im->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); pRoot->delGroup (_Chat); } else @@ -667,7 +667,7 @@ void CChatGroupWindow::displayTellMessage(const ucstring &msg, NLMISC::CRGBA col gcChat->requireAttention(); - CInterfaceManager::getInstance()->setTopWindow(gcChat); + CWidgetManager::getInstance()->setTopWindow(gcChat); // add the text to this window CGroupList *gl = dynamic_cast(gcChat->getGroup("text_list")); @@ -769,7 +769,7 @@ CGroupContainer *CChatGroupWindow::createFreeTeller(const ucstring &winNameIn, c pGC->setSavable(true); pGC->setEscapable(true); - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); pRoot->addGroup (pGC); pGC->setParent(pRoot); // must be done before makeWindow pIM->makeWindow(pGC); @@ -896,7 +896,7 @@ bool CChatGroupWindow::removeFreeTeller(const std::string &containerID) { pIM->removeGroupContainerImage(_FreeTellers[i]->getId(), m); } - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); pIM->unMakeWindow(_FreeTellers[i]); pRoot->delGroup (_FreeTellers[i]); _FreeTellers[i] = NULL; @@ -1377,7 +1377,7 @@ public: { CInterfaceManager *im = CInterfaceManager::getInstance(); std::string callerId = getParam(sParams, "id"); - CInterfaceElement *prevCaller = im->getElementFromId(callerId); + CInterfaceElement *prevCaller = CWidgetManager::getInstance()->getElementFromId(callerId); ucstring playerName = ::getFreeTellerName(prevCaller); if (!playerName.empty()) { diff --git a/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp index 7ba05b25c..b0248aa66 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp @@ -288,7 +288,7 @@ bool CCtrlBaseButton::handleEvent (const NLGUI::CEventDescriptor& event) // Run Menu if (!_ListMenuLeft.empty()) - pIM->enableModalWindow (this, _ListMenuLeft); + CWidgetManager::getInstance()->enableModalWindow (this, _ListMenuLeft); if (_AHOnLeftDblClick != NULL) { @@ -323,7 +323,7 @@ bool CCtrlBaseButton::handleEvent (const NLGUI::CEventDescriptor& event) if (!_ListMenuRight .empty()) { handled= true; - pIM->enableModalWindow (this, _ListMenuRight); + CWidgetManager::getInstance()->enableModalWindow (this, _ListMenuRight); } // If not handled here, ret to parent return handled; diff --git a/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp b/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp index 9b313ef75..f77bb4397 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp @@ -167,9 +167,9 @@ bool CCtrlScroll::parse(xmlNodePtr node, CInterfaceGroup * parentGroup) if (prop) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CInterfaceGroup *group = dynamic_cast(pIM->getElementFromId(prop)); + CInterfaceGroup *group = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(prop)); if(group == NULL) - group = dynamic_cast(pIM->getElementFromId(this->getId(), prop)); + group = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(this->getId(), prop)); if(group != NULL) setTarget (group); @@ -210,7 +210,7 @@ int CCtrlScroll::luaSetTarget(CLuaState &ls) std::string targetId = ls.toString(1); CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CInterfaceGroup *group = dynamic_cast(pIM->getElementFromId(targetId)); + CInterfaceGroup *group = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(targetId)); if(group != NULL) { setTarget (group); diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index f5d68f690..980a8459b 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -1858,11 +1858,11 @@ void CDBCtrlSheet::draw() if (_AHOnCanDrop != NULL) if ((pIM->getCapturePointerLeft() != NULL) && (pIM->getCapturePointerLeft() != this)) { - if ((pIM->getPointer()->getX() >= _XReal) && - (pIM->getPointer()->getX() < (_XReal + _WReal))&& - (pIM->getPointer()->getY() > _YReal) && - (pIM->getPointer()->getY() <= (_YReal+ _HReal))) - if (pIM->getCurrentWindowUnder() == pIM->getWindow(this)) + if ((CWidgetManager::getInstance()->getPointer()->getX() >= _XReal) && + (CWidgetManager::getInstance()->getPointer()->getX() < (_XReal + _WReal))&& + (CWidgetManager::getInstance()->getPointer()->getY() > _YReal) && + (CWidgetManager::getInstance()->getPointer()->getY() <= (_YReal+ _HReal))) + if (pIM->getCurrentWindowUnder() == CWidgetManager::getInstance()->getWindow(this)) { CDBCtrlSheet *pCSSrc = dynamic_cast(pIM->getCapturePointerLeft()); if ((pCSSrc != NULL) && pCSSrc->isDraging()) @@ -2861,7 +2861,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) if (getSheetId() != 0) { _CurrMenuSheet = this; - pIM->enableModalWindow (this, _ListMenuLeft); + CWidgetManager::getInstance()->enableModalWindow (this, _ListMenuLeft); } } // Always return true on LeftClick. @@ -2899,7 +2899,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) if(!_ListMenuRight.empty()) { _CurrMenuSheet = this; - pIM->enableModalWindow (this, _ListMenuRight); + CWidgetManager::getInstance()->enableModalWindow (this, _ListMenuRight); } } // if sheetId==0, then may open the other menu @@ -2908,7 +2908,7 @@ bool CDBCtrlSheet::handleEvent (const NLGUI::CEventDescriptor &event) if(!_ListMenuRightEmptySlot.empty()) { _CurrMenuSheet = this; - pIM->enableModalWindow (this, _ListMenuRightEmptySlot); + CWidgetManager::getInstance()->enableModalWindow (this, _ListMenuRightEmptySlot); } } } @@ -3638,7 +3638,7 @@ void CDBCtrlSheet::setupInit() { // typically replace "handl" with "handr" or vice versa CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CInterfaceElement *pElt = pIM->getElementFromId (_Id, _OptString); + CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId (_Id, _OptString); CDBCtrlSheet *pOtherHand = dynamic_cast(pElt); if( !pOtherHand || pOtherHand ->getType() != CCtrlSheetInfo::SheetType_Item ) { diff --git a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp index 3ccc65b7c..30d25ba22 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp @@ -58,7 +58,7 @@ sint32 CDBGroupComboBox::evalContentWidth() const { CInterfaceManager *pIM = CInterfaceManager::getInstance(); // get the menu to open. - CGroupMenu *groupMenu= dynamic_cast(pIM->getElementFromId( loginFinished ? WIN_COMBO_BOX_MEASURE_MENU : WIN_COMBO_BOX_MEASURE_MENU_LOGIN )); + CGroupMenu *groupMenu= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( loginFinished ? WIN_COMBO_BOX_MEASURE_MENU : WIN_COMBO_BOX_MEASURE_MENU_LOGIN )); if( !groupMenu ) { return 0; @@ -551,10 +551,10 @@ public: return; // get the menu to open. - CGroupMenu *groupMenu= dynamic_cast(pIM->getElementFromId(loginFinished ? WIN_COMBO_BOX_SELECT_MENU: WIN_COMBO_BOX_SELECT_MENU_LOGIN )); + CGroupMenu *groupMenu= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(loginFinished ? WIN_COMBO_BOX_SELECT_MENU: WIN_COMBO_BOX_SELECT_MENU_LOGIN )); if( !groupMenu ) { - groupMenu= dynamic_cast(pIM->getElementFromId(WIN_COMBO_BOX_SELECT_MENU_OUTGAME)); + groupMenu= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_COMBO_BOX_SELECT_MENU_OUTGAME)); } if( !groupMenu ) return; @@ -586,12 +586,12 @@ public: if(dynamic_cast(pCB->getRootWindow())) { groupMenu->setCloseSubMenuUsingPopModal(true); - pIM->pushModalWindow(pCB, groupMenu); + CWidgetManager::getInstance()->pushModalWindow(pCB, groupMenu); } else { groupMenu->setCloseSubMenuUsingPopModal(false); - pIM->enableModalWindow (pCB, groupMenu); + CWidgetManager::getInstance()->enableModalWindow (pCB, groupMenu); } } }; @@ -607,7 +607,7 @@ public: virtual void execute (CCtrlBase * /* pCaller */, const std::string &Params) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CDBGroupComboBox *pCB = dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBGroupComboBox *pCB = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCB == NULL) return; // set the selection diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp index c56b90d9e..f5b920383 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp @@ -252,7 +252,7 @@ sint CDBGroupListSheet::getCurScrollValue() // *************************************************************************** CGroupContainer *CDBGroupListSheet::getContainer() { - return dynamic_cast(CInterfaceManager::getInstance()->getWindow(this)); + return dynamic_cast(CWidgetManager::getInstance()->getWindow(this)); /* CGroupContainer *pGC = NULL; CInterfaceGroup *pParent = getParent(); while (pParent != NULL) @@ -326,7 +326,7 @@ void CDBGroupListSheet::updateCoords () if (_DisplayEmptySlot) { // increment num sheet if the empty slot is to be displayed - CDBCtrlSheet *pCS = dynamic_cast(CInterfaceManager::getInstance()->getCtrlLaunchingModal()); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCS != NULL && pCS->isSheetValid()) ++numValidSheets; } _ColumnMax = (uint) (ceil(sqrtf((float) numValidSheets))); @@ -388,7 +388,7 @@ void CDBGroupListSheet::updateCoords () if ( (_DisplayEmptySlot) && (i == 0) ) { _SheetChildren[i]->Valid= true; - CDBCtrlSheet *pCS = dynamic_cast(CInterfaceManager::getInstance()->getCtrlLaunchingModal()); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCS != NULL) { ctrl->setTextureNoItem (pCS->getTextureNoItem()); @@ -716,10 +716,10 @@ void CDBGroupListSheet::draw () CGroupContainer *pGC = getContainer(); if (pIM->getCurrentWindowUnder() == pGC) { - if ((pIM->getPointer()->getX() >= _XReal) && - (pIM->getPointer()->getX() < (_XReal + _WReal))&& - (pIM->getPointer()->getY() > _YReal) && - (pIM->getPointer()->getY() <= (_YReal+ _HReal))) + if ((CWidgetManager::getInstance()->getPointer()->getX() >= _XReal) && + (CWidgetManager::getInstance()->getPointer()->getX() < (_XReal + _WReal))&& + (CWidgetManager::getInstance()->getPointer()->getY() > _YReal) && + (CWidgetManager::getInstance()->getPointer()->getY() <= (_YReal+ _HReal))) { CDBCtrlSheet *pCSSrc = dynamic_cast(pIM->getCapturePointerLeft()); if ((pCSSrc != NULL) && pCSSrc->isDraging()) @@ -942,7 +942,7 @@ sint32 CDBGroupListSheet::getNbElt () const // special display empty slot if ( (_DisplayEmptySlot) && (i == 0) ) { - CDBCtrlSheet *pCS = dynamic_cast(CInterfaceManager::getInstance()->getCtrlLaunchingModal()); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (pCS != NULL) { ctrl->setTextureNoItem (pCS->getTextureNoItem()); diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp index ac3e6e45f..0dfd0c909 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp @@ -626,10 +626,10 @@ void CDBGroupListSheetText::draw () CGroupContainer *pGC = getContainer(); if (pIM->getCurrentWindowUnder() == pGC) { - if ((pIM->getPointer()->getX() >= _XReal) && - (pIM->getPointer()->getX() < (_XReal + _WReal))&& - (pIM->getPointer()->getY() > _YReal) && - (pIM->getPointer()->getY() <= (_YReal+ _HReal))) + if ((CWidgetManager::getInstance()->getPointer()->getX() >= _XReal) && + (CWidgetManager::getInstance()->getPointer()->getX() < (_XReal + _WReal))&& + (CWidgetManager::getInstance()->getPointer()->getY() > _YReal) && + (CWidgetManager::getInstance()->getPointer()->getY() <= (_YReal+ _HReal))) { CDBCtrlSheet *pCSSrc = dynamic_cast(pIM->getCapturePointerLeft()); if ((pCSSrc != NULL) && pCSSrc->isDraging()) @@ -1008,7 +1008,7 @@ void CDBGroupListSheetText::CSheetChild::hide(CDBGroupListSheetText * /* pFather // *************************************************************************** CGroupContainer *CDBGroupListSheetText::getContainer() { - return dynamic_cast(CInterfaceManager::getInstance()->getWindow(this)); + return dynamic_cast(CWidgetManager::getInstance()->getWindow(this)); } // *************************************************************************** @@ -1184,7 +1184,7 @@ class CHandlerListSheetTextRightClick : public IActionHandler { if ( CDBCtrlSheet::getDraggedSheet() == NULL) { - pIM->enableModalWindow (ctrlSheet, listSheetTrade->_CtrlInfo._ListMenuRight); + CWidgetManager::getInstance()->enableModalWindow (ctrlSheet, listSheetTrade->_CtrlInfo._ListMenuRight); } } @@ -1201,7 +1201,7 @@ class CHandlerListSheetTextResetSelection : public IActionHandler { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CDBGroupListSheetText *listSheetTrade = dynamic_cast(pIM->getElementFromId(Params)); + CDBGroupListSheetText *listSheetTrade = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(Params)); if (listSheetTrade == NULL) return; diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_share.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_share.cpp index c2633d567..d43d8e2f8 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_share.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_share.cpp @@ -264,7 +264,7 @@ class CHandlerTeamShareChoose : public IActionHandler CInterfaceManager *pIM = CInterfaceManager::getInstance(); CBitMemStream out; - CCtrlTextButton *pTB = dynamic_cast(pIM->getElementFromId("ui:interface:team_share:content:ok")); + CCtrlTextButton *pTB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:team_share:content:ok")); if (pTB == NULL) return; if (pTB->getActive() == false) return; @@ -317,7 +317,7 @@ class CHandlerTeamShareValid : public IActionHandler CBitMemStream out; string strMsgName = "TEAM:SHARE_VALID"; - CCtrlTextButton *pTB = dynamic_cast(pIM->getElementFromId("ui:interface:team_share:content:ok")); + CCtrlTextButton *pTB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:team_share:content:ok")); if (pTB != NULL) pTB->setActive(false); diff --git a/code/ryzom/client/src/interface_v3/encyclopedia_manager.cpp b/code/ryzom/client/src/interface_v3/encyclopedia_manager.cpp index 7ec68afab..8bdac6a34 100644 --- a/code/ryzom/client/src/interface_v3/encyclopedia_manager.cpp +++ b/code/ryzom/client/src/interface_v3/encyclopedia_manager.cpp @@ -162,7 +162,7 @@ void CEncyclopediaManager::updateThema(uint32 nAlbumName, const CEncyMsgThema &t _AlbumNameSelected = nAlbumName; _ThemaNameSelected = t.Name; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceElement *pContainer = dynamic_cast(pIM->getElementFromId(CONT_ENCY)); + CInterfaceElement *pContainer = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CONT_ENCY)); if (pContainer != NULL) pContainer->setActive(true); } @@ -186,7 +186,7 @@ void CEncyclopediaManager::rebuildAlbumList() CInterfaceManager *pIM = CInterfaceManager::getInstance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); - CGroupTree *pTree = dynamic_cast(pIM->getElementFromId(LIST_ENCY_ALBUM)); + CGroupTree *pTree = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_ENCY_ALBUM)); nlassert(pTree != NULL); CGroupTree::SNode *pRoot = new CGroupTree::SNode; @@ -281,22 +281,22 @@ void CEncyclopediaManager::rebuildAlbumPage(uint32 albumName) CInterfaceManager *pIM = CInterfaceManager::getInstance(); // Hide and show good group - CInterfaceElement *pIE = pIM->getElementFromId(PAGE_ENCY_ALBUM); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(PAGE_ENCY_ALBUM); nlassert(pIE != NULL); pIE->setActive(true); - pIE = pIM->getElementFromId(PAGE_ENCY_HELP); + pIE = CWidgetManager::getInstance()->getElementFromId(PAGE_ENCY_HELP); pIE->setActive(false); - pIE = pIM->getElementFromId(PAGE_ENCY_THEMA); + pIE = CWidgetManager::getInstance()->getElementFromId(PAGE_ENCY_THEMA); pIE->setActive(false); // Setup title - CViewTextID *pVT = dynamic_cast(pIM->getElementFromId(PAGE_ENCY_ALBUM ":title")); + CViewTextID *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(PAGE_ENCY_ALBUM ":title")); nlassert(pVT != NULL); pVT->setTextId(pAlbum->Name); // Setup brick reward NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:ENCY:ALBUMBRICK:SHEET")->setValue32(pAlbum->RewardBrick); - CViewText *pRBVT = dynamic_cast(pIM->getElementFromId(PAGE_ENCY_ALBUM ":reward:desc")); + CViewText *pRBVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(PAGE_ENCY_ALBUM ":reward:desc")); if (pRBVT != NULL) { STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); @@ -328,27 +328,27 @@ void CEncyclopediaManager::rebuildThemaPage(uint32 themaName) CInterfaceManager *pIM = CInterfaceManager::getInstance(); // Hide and show good group - CInterfaceElement *pIE = pIM->getElementFromId(PAGE_ENCY_ALBUM); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(PAGE_ENCY_ALBUM); nlassert(pIE != NULL); pIE->setActive(false); - pIE = pIM->getElementFromId(PAGE_ENCY_HELP); + pIE = CWidgetManager::getInstance()->getElementFromId(PAGE_ENCY_HELP); pIE->setActive(false); - pIE = pIM->getElementFromId(PAGE_ENCY_THEMA); + pIE = CWidgetManager::getInstance()->getElementFromId(PAGE_ENCY_THEMA); pIE->setActive(true); // Setup title - CViewTextID *pVT = dynamic_cast(pIM->getElementFromId(PAGE_ENCY_THEMA ":title")); + CViewTextID *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(PAGE_ENCY_THEMA ":title")); nlassert(pVT != NULL); pVT->setTextId(pThema->Name); // Setup rewards - pVT = dynamic_cast(pIM->getElementFromId(PAGE_ENCY_THEMA ":reward_text:desc")); + pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(PAGE_ENCY_THEMA ":reward_text:desc")); nlassert(pVT != NULL); pVT->setTextId(pThema->RewardText); // Setup brick reward NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:ENCY:REWARDBRICK:SHEET")->setValue32(pThema->RewardSheet); - CViewText *pRBVT = dynamic_cast(pIM->getElementFromId(PAGE_ENCY_THEMA ":reward:desc")); + CViewText *pRBVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(PAGE_ENCY_THEMA ":reward:desc")); nlassert(pRBVT != NULL); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); CEntitySheet *pES = SheetMngr.get(CSheetId(pThema->RewardSheet)); @@ -392,7 +392,7 @@ void CEncyclopediaManager::rebuildThemaPage(uint32 themaName) sTmp = PAGE_ENCY_THEMA ":todo:task" + toString(i); // setup task description - CViewTextID *pText = dynamic_cast(pIM->getElementFromId(sTmp+":desc")); + CViewTextID *pText = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sTmp+":desc")); nlassert(pText != NULL); pText->setTextId(pThema->TaskName[i]); @@ -407,7 +407,7 @@ void CEncyclopediaManager::rebuildThemaPage(uint32 themaName) pText->setAlpha(160); // If the task is finished toggle it - CViewBitmap *pBitmap = dynamic_cast(pIM->getElementFromId(sTmp+":done")); + CViewBitmap *pBitmap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sTmp+":done")); nlassert(pBitmap != NULL); if (pThema->getTaskState((uint8)i) == 2) pBitmap->setActive(true); diff --git a/code/ryzom/client/src/interface_v3/group_compas.cpp b/code/ryzom/client/src/interface_v3/group_compas.cpp index 6d28b7ec7..356393fe2 100644 --- a/code/ryzom/client/src/interface_v3/group_compas.cpp +++ b/code/ryzom/client/src/interface_v3/group_compas.cpp @@ -926,9 +926,9 @@ class CHandlerSetCompas : public IActionHandler std::string compassID = getParam(sParams, "compass"); std::string menuID = getParam(sParams, "menu"); CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupCompas *gc = dynamic_cast(im->getElementFromId(compassID)); + CGroupCompas *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(compassID)); if (!gc) return; - CGroupCompasMenu *gcm = dynamic_cast(im->getElementFromId(menuID)); + CGroupCompasMenu *gcm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(menuID)); if (!gcm) return; int index; std::string id = getParam(sParams, "id"); @@ -938,7 +938,7 @@ class CHandlerSetCompas : public IActionHandler gc->setTarget(gcm->Targets[index]); gc->setActive(true); gc->blink(); - im->setTopWindow(gc); + CWidgetManager::getInstance()->setTopWindow(gc); } } }; @@ -967,13 +967,13 @@ class CHandlerSetTeamCompas : public IActionHandler CCompassTarget ct; if(buildCompassTargetFromTeamMember(ct, peopleIndex)) { - CGroupCompas *gc= dynamic_cast(pIM->getElementFromId(compassID)); + CGroupCompas *gc= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(compassID)); if(gc) { gc->setTarget(ct); gc->setActive(true); gc->blink(); - pIM->setTopWindow(gc); + CWidgetManager::getInstance()->setTopWindow(gc); } } } @@ -989,7 +989,7 @@ class CHandlerSetCompassNorth : public IActionHandler { std::string compassID = getParam(sParams, "compass"); CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupCompas *gc = dynamic_cast(im->getElementFromId(compassID)); + CGroupCompas *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(compassID)); if (!gc) return; gc->setTarget(CCompassTarget()); } diff --git a/code/ryzom/client/src/interface_v3/group_container.cpp b/code/ryzom/client/src/interface_v3/group_container.cpp index 8ea72a0df..19e3891f9 100644 --- a/code/ryzom/client/src/interface_v3/group_container.cpp +++ b/code/ryzom/client/src/interface_v3/group_container.cpp @@ -712,7 +712,7 @@ bool CCtrlMover::handleEvent (const NLGUI::CEventDescriptor &event) _MoveDeltaYReal= _Parent->getYReal() - _Parent->getY(); _Moving= true; // set the window at top. - CInterfaceManager::getInstance()->setTopWindow(_Parent); + CWidgetManager::getInstance()->setTopWindow(_Parent); if (gc->getAHOnBeginMovePtr()) { CInterfaceManager *im = CInterfaceManager::getInstance(); @@ -2086,7 +2086,7 @@ void CGroupContainer::draw () { CRGBA c = CRGBA(255,255,255,255); // Display the header in white if we are the last clicked window - if (pIM->getTopWindow(pIM->getLastTopWindowPriority()) != this) + if (CWidgetManager::getInstance()->getTopWindow(CWidgetManager::getInstance()->getLastTopWindowPriority()) != this) { if (_HeaderColor.getNodePtr() != NULL) c = _HeaderColor.getRGBA(); @@ -2194,7 +2194,7 @@ void CGroupContainer::draw () // manage rollover - CViewPointer *mousePointer = pIM->getPointer(); + CViewPointer *mousePointer = CWidgetManager::getInstance()->getPointer(); if (mousePointer) { bool dontFade = false; @@ -3204,9 +3204,9 @@ void CGroupContainer::setActive (bool state) if(state != getActive() && getLayer()==0) { if (state) - pIM->setTopWindow(this); + CWidgetManager::getInstance()->setTopWindow(this); else - pIM->setBackWindow(this); + CWidgetManager::getInstance()->setBackWindow(this); } pIM->submitEvent((state?"show:":"hide:")+getId()); @@ -3290,7 +3290,7 @@ void CGroupContainer::popupCurrentPos() CInterfaceManager *im = CInterfaceManager::getInstance(); im->makeWindow(this); - im->setTopWindow(this); + CWidgetManager::getInstance()->setTopWindow(this); im->clearViewUnders(); im->clearCtrlsUnders(); @@ -3512,7 +3512,7 @@ public: { im->runActionHandler(pIC->getAHOnCloseButton(), pCaller, pIC->getAHOnCloseButtonParams()); } - CInterfaceManager::getInstance()->setBackWindow(pIC); + CWidgetManager::getInstance()->setBackWindow(pIC); pIC->setActive(false); } } @@ -3641,7 +3641,7 @@ void CGroupContainer::setOpenable(bool openable) void CGroupContainer::rollOverAlphaUp() { CInterfaceManager *im = CInterfaceManager::getInstance(); - CViewPointer *vp = im->getPointer(); + CViewPointer *vp = CWidgetManager::getInstance()->getPointer(); float speed = im->getAlphaRolloverSpeed(); if (!isIn(vp->getX(), vp->getY())) { @@ -3741,9 +3741,9 @@ void CGroupContainer::setModalParentList (const std::string &name) // add each of them (if possible) for(uint i=0;i(pIM->getElementFromId(modalParents[i])); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(modalParents[i])); if (pGC == NULL) - pGC = dynamic_cast(pIM->getElementFromId("ui:interface:"+modalParents[i])); + pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:"+modalParents[i])); if (pGC == NULL) nlwarning(" not found %s",modalParents[i].c_str()); else @@ -3944,7 +3944,7 @@ CRGBA CGroupContainer::getDrawnHeaderColor () const CRGBA c = CRGBA(255,255,255,255); // Display the header in white if we are the last clicked window - if (pIM->getTopWindow(pIM->getLastTopWindowPriority()) != static_cast(this)) + if (CWidgetManager::getInstance()->getTopWindow(CWidgetManager::getInstance()->getLastTopWindowPriority()) != static_cast(this)) { if (_HeaderColor.getNodePtr() != NULL) c = _HeaderColor.getRGBA(); @@ -3974,7 +3974,7 @@ void CGroupContainer::requireAttention() // Window have headers opened => blink it if is not the top window if (isOpen()) { - if (getId() != CInterfaceManager::getInstance()->getTopWindow()->getId()) + if (getId() != CWidgetManager::getInstance()->getTopWindow()->getId()) { enableBlink(3); } diff --git a/code/ryzom/client/src/interface_v3/group_editbox.cpp b/code/ryzom/client/src/interface_v3/group_editbox.cpp index 0afbe81b5..478bb73a2 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.cpp +++ b/code/ryzom/client/src/interface_v3/group_editbox.cpp @@ -885,7 +885,7 @@ bool CGroupEditBox::handleEvent (const NLGUI::CEventDescriptor& event) if (CDBCtrlSheet::getDraggedSheet() == NULL) { _MenuFather = this; - pIM->enableModalWindow (this, _ListMenuRight); + CWidgetManager::getInstance()->enableModalWindow (this, _ListMenuRight); stopParentBlink(); } } @@ -1307,7 +1307,7 @@ void CGroupEditBox::makeTopWindow() CInterfaceGroup *root = getRootWindow(); if (root) { - im->setTopWindow(root); + CWidgetManager::getInstance()->setTopWindow(root); } } diff --git a/code/ryzom/client/src/interface_v3/group_header.cpp b/code/ryzom/client/src/interface_v3/group_header.cpp index 93f418a65..964f6ca82 100644 --- a/code/ryzom/client/src/interface_v3/group_header.cpp +++ b/code/ryzom/client/src/interface_v3/group_header.cpp @@ -418,7 +418,7 @@ bool CGroupHeaderEntry::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) CInterfaceGroup *CGroupHeaderEntry::getTargetColumn() const { CInterfaceManager *im = CInterfaceManager::getInstance(); - return dynamic_cast(im->getElementFromId(_TargetColumnId)); + return dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_TargetColumnId)); } // ***************************************************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/group_html.cpp b/code/ryzom/client/src/interface_v3/group_html.cpp index 82a8d3828..c566fd477 100644 --- a/code/ryzom/client/src/interface_v3/group_html.cpp +++ b/code/ryzom/client/src/interface_v3/group_html.cpp @@ -2221,7 +2221,7 @@ void CGroupHTML::doBrowse(const char *url) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CGroupTree *groupTree=dynamic_cast(pIM->getElementFromId(_BrowseTree)); + CGroupTree *groupTree=dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_BrowseTree)); if(groupTree) { string nodeId= selectTreeNodeRecurs(groupTree->getRootNode(), url); @@ -3634,8 +3634,8 @@ void CGroupHTML::browseRedo() void CGroupHTML::updateUndoRedoButtons() { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CCtrlBaseButton *butUndo= dynamic_cast(pIM->getElementFromId(_BrowseUndoButton)); - CCtrlBaseButton *butRedo= dynamic_cast(pIM->getElementFromId(_BrowseRedoButton)); + CCtrlBaseButton *butUndo= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_BrowseUndoButton)); + CCtrlBaseButton *butRedo= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_BrowseRedoButton)); // gray according to list size if(butUndo) @@ -3648,7 +3648,7 @@ void CGroupHTML::updateUndoRedoButtons() void CGroupHTML::updateRefreshButton() { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CCtrlBaseButton *butRefresh = dynamic_cast(pIM->getElementFromId(_BrowseRefreshButton)); + CCtrlBaseButton *butRefresh = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_BrowseRefreshButton)); bool enabled = !_Browsing && !_Connecting; if(butRefresh) diff --git a/code/ryzom/client/src/interface_v3/group_html_qcm.cpp b/code/ryzom/client/src/interface_v3/group_html_qcm.cpp index 4414556b0..426c6dbd5 100644 --- a/code/ryzom/client/src/interface_v3/group_html_qcm.cpp +++ b/code/ryzom/client/src/interface_v3/group_html_qcm.cpp @@ -56,7 +56,7 @@ void CGroupHTMLQCM::addText (const char * buf, int len) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); pIM->runActionHandler("quit_ryzom", NULL); - CInterfaceElement *pIE = pIM->getElementFromId("ui:interface:web_on_quit"); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId("ui:interface:web_on_quit"); pIE->setActive(false); } diff --git a/code/ryzom/client/src/interface_v3/group_html_webig.cpp b/code/ryzom/client/src/interface_v3/group_html_webig.cpp index 0b84f7749..1ab1f40bc 100644 --- a/code/ryzom/client/src/interface_v3/group_html_webig.cpp +++ b/code/ryzom/client/src/interface_v3/group_html_webig.cpp @@ -38,7 +38,7 @@ public: { CInterfaceManager *pIM= CInterfaceManager::getInstance(); string container = getParam (sParams, "name"); - CGroupHTML *groupHtml = dynamic_cast(pIM->getElementFromId(container)); + CGroupHTML *groupHtml = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(container)); if (groupHtml) { groupHtml->browse(groupHtml->Home.c_str()); @@ -199,7 +199,7 @@ struct CWebigNotificationThread : public NLMISC::IRunnable if(_CheckMailNode) { _CheckMailNode->setValue32(nbmail==0?0:1); - CInterfaceElement *elm = pIM->getElementFromId("ui:interface:compass:mail:mail_nb"); + CInterfaceElement *elm = CWidgetManager::getInstance()->getElementFromId("ui:interface:compass:mail:mail_nb"); if (elm) { CViewText *vt = dynamic_cast(elm); @@ -226,7 +226,7 @@ struct CWebigNotificationThread : public NLMISC::IRunnable if(_CheckForumNode) { _CheckForumNode->setValue32(nbforum==0?0:1); - CInterfaceElement *elm = pIM->getElementFromId("ui:interface:compass:forum:forum_nb"); + CInterfaceElement *elm = CWidgetManager::getInstance()->getElementFromId("ui:interface:compass:forum:forum_nb"); if (elm) { CViewText *vt = dynamic_cast(elm); diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index 3b442ce3b..be8d1a950 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -61,7 +61,7 @@ void contextHelp (const std::string &name) string target = pIM->getDefine(defineTarget); string url = pIM->getDefine(defineUrl); - CInterfaceElement *elementTarget = pIM->getElementFromId(target); + CInterfaceElement *elementTarget = CWidgetManager::getInstance()->getElementFromId(target); if (elementTarget && elementTarget->getActive()) { // Add the context help @@ -165,7 +165,7 @@ void CGroupInSceneBubbleManager::alignMessagePopup (vector &rList, bool // First message must be aligned from the screen if (!rList.empty()) { - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); if (pRoot) { sint i = (sint)rList.size ()-1; @@ -234,7 +234,7 @@ void CGroupInSceneBubbleManager::init () { // Link to the interface CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group); - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); group->setParent(pRoot); if (pRoot) pRoot->addGroup (group); @@ -359,7 +359,7 @@ void CGroupInSceneBubbleManager::update () if (!_BubblePopup[i].Target.empty()) { // Get the target - CInterfaceElement *target = pIM->getElementFromId(_BubblePopup[i].Target); + CInterfaceElement *target = CWidgetManager::getInstance()->getElementFromId(_BubblePopup[i].Target); if (target) { // Target is good ? @@ -539,7 +539,7 @@ void CGroupInSceneBubbleManager::addSkillPopup (uint skillId, sint delta, uint t // Link to the interface CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group); - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); group->setParent(pRoot); if (pRoot) pRoot->addGroup (group); @@ -588,7 +588,7 @@ void CGroupInSceneBubbleManager::addMessagePopup (const ucstring &message, CRGBA // Link to the interface CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group); - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); group->setParent(pRoot); if (pRoot) pRoot->addGroup (group); @@ -637,7 +637,7 @@ void CGroupInSceneBubbleManager::addMessagePopupCenter (const ucstring &message, // Link to the interface CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group); - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); group->setParent(pRoot); if (pRoot) pRoot->addGroup (group); @@ -663,7 +663,7 @@ CGroupInSceneBubbleManager::CPopupContext *CGroupInSceneBubbleManager::buildCont string v="m"; string h="m"; - target = CInterfaceManager::getInstance()->getElementFromId(targetName); + target = CWidgetManager::getInstance()->getElementFromId(targetName); if (target) { // Find a position @@ -711,7 +711,7 @@ CGroupInSceneBubbleManager::CPopupContext *CGroupInSceneBubbleManager::buildCont // Link to the interface CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group); - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); group->setParent(pRoot); if (pRoot) pRoot->addGroup (group); @@ -904,7 +904,7 @@ void CGroupInSceneBubbleManager::dynChatOpen (uint32 nBotUID, uint32 nBotName, c } // Link to the interface CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group); - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); group->setParent(pRoot); if (pRoot) pRoot->addGroup (group); @@ -1017,7 +1017,7 @@ void CGroupInSceneBubbleManager::webIgChatOpen (uint32 nBotUID, string text, con } // Link to the interface CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group); - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); group->setParent(pRoot); if (pRoot) pRoot->addGroup (group); @@ -1468,7 +1468,7 @@ void CGroupInSceneBubble::setRawText (const ucstring &text) { _CanBeShown = !text.empty(); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceElement *pVTIE = pIM->getElementFromId(getId()+":header_opened:window:text"); + CInterfaceElement *pVTIE = CWidgetManager::getInstance()->getElementFromId(getId()+":header_opened:window:text"); CViewText *pVT= dynamic_cast(pVTIE); if (pVT != NULL) pVT->setText(text); @@ -1479,11 +1479,11 @@ void CGroupInSceneBubble::setRawText (const ucstring &text) void CGroupInSceneBubble::displayNextAndSkip(bool show) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceElement *pIE = pIM->getElementFromId(getId()+":header_opened:window:but_next"); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(getId()+":header_opened:window:but_next"); if (pIE != NULL) pIE->setActive(show); - pIE = pIM->getElementFromId(getId()+":header_opened:window:but_skip"); + pIE = CWidgetManager::getInstance()->getElementFromId(getId()+":header_opened:window:but_skip"); if (pIE != NULL) pIE->setActive(show); - pIE = pIM->getElementFromId(getId()+":header_opened:window:text"); + pIE = CWidgetManager::getInstance()->getElementFromId(getId()+":header_opened:window:text"); if (pIE != NULL) { if (show) diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp index d19c2dcd3..7d0253978 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp @@ -742,7 +742,7 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) // Link to the interface CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", info); - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); info->setParent(pRoot); if (pRoot) pRoot->addGroup (info); @@ -1156,7 +1156,7 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::newGroupInScene(const std::string { // NB : only use the fast version during edition because duplication of CCDBCtrlSheet not implemented now, but we don't // use it for the edition !!!! - CInterfaceElement *prototype = im->getElementFromId("ui:interface:" + templateName + "_proto"); + CInterfaceElement *prototype = CWidgetManager::getInstance()->getElementFromId("ui:interface:" + templateName + "_proto"); if (prototype && dynamic_cast(prototype)) { extern bool NoOpForCCtrlSheetInfo_Serial; // CCDBCtrlSheet::serial not implemented, but prevent an assert in its serial because diff --git a/code/ryzom/client/src/interface_v3/group_list.cpp b/code/ryzom/client/src/interface_v3/group_list.cpp index 91c245851..c8d45b576 100644 --- a/code/ryzom/client/src/interface_v3/group_list.cpp +++ b/code/ryzom/client/src/interface_v3/group_list.cpp @@ -573,10 +573,10 @@ void CGroupList::draw () CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewRenderer &rVR = pIM->getViewRenderer(); - if (pIM->getModalWindow() == NULL) + if (CWidgetManager::getInstance()->getModalWindow() == NULL) { - sint32 x = pIM->getPointer()->getX(); - sint32 y = pIM->getPointer()->getY(); + sint32 x = CWidgetManager::getInstance()->getPointer()->getX(); + sint32 y = CWidgetManager::getInstance()->getPointer()->getY(); CInterfaceGroup *pIG = pIM->getWindowUnder(x, y); CInterfaceGroup *pParent = this; diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index 6cdd08bbc..f2bf62aff 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -98,13 +98,13 @@ static void popupLandMarkNameDialog() { // pop the rename dialog CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *gc = dynamic_cast(im->getElementFromId(WIN_LANDMARK_NAME)); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_LANDMARK_NAME)); if (!gc) return; gc->setActive(true); gc->updateCoords(); gc->center(); - im->setTopWindow(gc); + CWidgetManager::getInstance()->setTopWindow(gc); gc->enableBlink(1); CGroupEditBox *eb = dynamic_cast(gc->getGroup("eb")); @@ -133,7 +133,7 @@ static void popupLandMarkNameDialog() static void closeLandMarkNameDialog() { CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *gc = dynamic_cast(im->getElementFromId(WIN_LANDMARK_NAME)); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_LANDMARK_NAME)); if (!gc) return; gc->setActive(false); } @@ -721,7 +721,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) _RespawnSelectedBitmap->setPosRef(Hotspot_MM); addView(_RespawnSelectedBitmap); - //CCtrlBaseButton *pCB = dynamic_cast(CInterfaceManager::getInstance()->getElementFromId(_RespawnButton)); + //CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_RespawnButton)); //if (pCB != NULL) pCB->setActive(false); } nlassert(!_FrustumView); @@ -1578,13 +1578,13 @@ void CGroupMap::draw() _FrustumView->setQuad(fruQuad); _FrustumView->updateCoords(); // handle mouse over - if (im->getPointer()) + if (CWidgetManager::getInstance()->getPointer()) { sint32 originX, originY; getCorner(originX, originY, getPosRef()); CVector delta((float) originX, (float) originY, 0.f); fruTri = CTriangle(fruQuad.V0, fruQuad.V1, fruQuad.V2); - CVector mousePos((float) im->getPointer()->getXReal(), (float) im->getPointer()->getYReal(), 0.f); + CVector mousePos((float) CWidgetManager::getInstance()->getPointer()->getXReal(), (float) CWidgetManager::getInstance()->getPointer()->getYReal(), 0.f); mousePos -= delta; CVector dummyHit; float deltaBlend = DT / (0.001f * (float) _FrustumViewBlendTimeInMs); @@ -2396,13 +2396,13 @@ static void hideTeleportButtonsInPopupMenuIfNotEnoughPriv() bool showTeleport = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG()); CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceElement *ie = im->getElementFromId("ui:interface:map_menu:teleport"); + CInterfaceElement *ie = CWidgetManager::getInstance()->getElementFromId("ui:interface:map_menu:teleport"); if(ie) ie->setActive(showTeleport); - ie = im->getElementFromId("ui:interface:land_mark_menu:lmteleport"); + ie = CWidgetManager::getInstance()->getElementFromId("ui:interface:land_mark_menu:lmteleport"); if(ie) ie->setActive(showTeleport); - ie = im->getElementFromId("ui:interface:user_land_mark_menu:lmteleport"); + ie = CWidgetManager::getInstance()->getElementFromId("ui:interface:user_land_mark_menu:lmteleport"); if(ie) ie->setActive(showTeleport); } @@ -2878,7 +2878,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm) { NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:SQUAD_RESPAWN_PT")->setValue32(_RespawnSelected); // Close window containing the map - CInterfaceGroup *pGrp = pIM->getWindow(this); + CInterfaceGroup *pGrp = CWidgetManager::getInstance()->getWindow(this); if (pGrp != NULL) pGrp->setActive(false); } invalidateCoords(); @@ -2936,13 +2936,13 @@ void CGroupMap::targetLandmark(CCtrlButton *lm) if (found) { CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupCompas *gc = dynamic_cast(im->getElementFromId(_CompassId)); + CGroupCompas *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_CompassId)); if (gc) { gc->setActive(true); gc->setTarget(ct); gc->blink(); - im->setTopWindow(gc); + CWidgetManager::getInstance()->setTopWindow(gc); } } } @@ -3197,7 +3197,7 @@ class CAHValidateUserLandMarkName : public IActionHandler virtual void execute (CCtrlBase * /* pCaller */, const string &/* params */) { CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceGroup *ig = dynamic_cast(im->getElementFromId(WIN_LANDMARK_NAME)); + CInterfaceGroup *ig = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_LANDMARK_NAME)); if (!ig) return; CGroupEditBox *eb = dynamic_cast(ig->getGroup("eb")); if (!eb) return; @@ -3241,7 +3241,7 @@ void createUserLandMark(CCtrlBase * /* pCaller */, const string &/* params */) { CInterfaceManager *im = CInterfaceManager::getInstance(); // pop the rename dialog - LastClickedMap = dynamic_cast(im->getCtrlLaunchingModal()); + LastClickedMap = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (LastClickedMap->isInDeathMode()) return; if (LastClickedMap->getNumUserLandMarks() >= CContinent::getMaxNbUserLandMarks() ) { @@ -3284,7 +3284,7 @@ class CAHMapZoomIn : public IActionHandler { std::string map = getParam(params, "map"); CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupMap *gm = dynamic_cast(im->getElementFromId(map)); + CGroupMap *gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(map)); if (!gm) return; NLMISC::CVector2f center; gm->windowToMap(center, gm->getWReal() / 2, gm->getHReal() / 2); @@ -3301,7 +3301,7 @@ class CAHMapZoomOut : public IActionHandler { std::string map = getParam(params, "map"); CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupMap *gm = dynamic_cast(im->getElementFromId(map)); + CGroupMap *gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(map)); if (!gm) return; NLMISC::CVector2f center; gm->windowToMap(center, gm->getWReal() / 2, gm->getHReal() / 2); @@ -3318,7 +3318,7 @@ class CAHMapCenter : public IActionHandler { std::string map = getParam(params, "map"); CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupMap *gm = dynamic_cast(im->getElementFromId(map)); + CGroupMap *gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(map)); if (!gm) return; gm->centerOnPlayer(); } @@ -3333,7 +3333,7 @@ class CAHMapBack : public IActionHandler { std::string map = getParam(params, "map"); CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupMap *pGM = dynamic_cast(im->getElementFromId(map)); + CGroupMap *pGM = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(map)); if (pGM == NULL) return; SMap *pMap = pGM->getParentMap(pGM->getCurMap()); if (pMap != NULL) @@ -3350,7 +3350,7 @@ class CAHRespawnMapValid : public IActionHandler { std::string map = getParam(params, "map"); CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupMap *gm = dynamic_cast(im->getElementFromId(map)); + CGroupMap *gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(map)); if (!gm) return; if (gm->getRespawnSelected() == -1) return; @@ -3406,7 +3406,7 @@ class CAHWorldMapRightClick : public IActionHandler hideTeleportButtonsInPopupMenuIfNotEnoughPriv(); - CGroupMap *gm = dynamic_cast(im->getElementFromId(map)); + CGroupMap *gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(map)); if (!gm) return; if (!gm->isIsland()) { @@ -3457,7 +3457,7 @@ class CAHMapTeleport : public IActionHandler virtual void execute (CCtrlBase * /* pCaller */, const string &/* params */) { CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupMap *clickedMap = dynamic_cast(im->getCtrlLaunchingModal()); + CGroupMap *clickedMap = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); closeLandMarkNameDialog(); NLMISC::CVector2f pos = clickedMap->getRightClickLastPos(); clickedMap->mapToWorld(pos, pos); @@ -3512,7 +3512,7 @@ class CUpdateLandMarksColor : public IActionHandler{public: virtual void execute - CGroupMap *pGM = dynamic_cast(pIM->getElementFromId("ui:interface:map:content:map_content:actual_map")); + CGroupMap *pGM = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); if (pGM == NULL) return; pGM->updateUserLandMarks(); @@ -3555,7 +3555,7 @@ NLMISC_COMMAND( testRespawn, "Debug : test respawn map", "" ) rpm.RespawnPoints.push_back(CRespawnPointsMsg::SRespawnPoint(4050*1000,-4200*1000)); rpm.RespawnPoints.push_back(CRespawnPointsMsg::SRespawnPoint(4200*1000,-4150*1000)); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupMap *pMap = dynamic_cast(pIM->getElementFromId("ui:interface:respawn_map:content:map_content:actual_map")); + CGroupMap *pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:respawn_map:content:map_content:actual_map")); if (pMap == NULL) { nlwarning("problem cannot find ui:interface:respawn_map:content:map_content:actual_map"); @@ -3564,7 +3564,7 @@ NLMISC_COMMAND( testRespawn, "Debug : test respawn map", "" ) pMap->addRespawnPoints(rpm); - pMap = dynamic_cast(pIM->getElementFromId("ui:interface:map:content:map_content:actual_map")); + pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); if (pMap == NULL) { nlwarning("problem cannot find ui:interface:map:content:map_content:actual_map"); @@ -3584,7 +3584,7 @@ NLMISC_COMMAND( setMap, "Debug : test respawn map", "" ) if (args.size() != 1) return false; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupMap *pMap = dynamic_cast(pIM->getElementFromId("ui:interface:map:content:map_content:actual_map")); + CGroupMap *pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); if (pMap != NULL) pMap->setMap(args[0]); diff --git a/code/ryzom/client/src/interface_v3/group_menu.cpp b/code/ryzom/client/src/interface_v3/group_menu.cpp index dcadb3e82..9f8bbf3aa 100644 --- a/code/ryzom/client/src/interface_v3/group_menu.cpp +++ b/code/ryzom/client/src/interface_v3/group_menu.cpp @@ -867,8 +867,8 @@ void CGroupSubMenu::checkCoords() // if the mouse goes out the window, unselect all (because handleEvent may not be called) CInterfaceManager *pIM = CInterfaceManager::getInstance(); - sint xMouse= pIM->getPointer()->getX(); - sint yMouse= pIM->getPointer()->getY(); + sint xMouse= CWidgetManager::getInstance()->getPointer()->getX(); + sint yMouse= CWidgetManager::getInstance()->getPointer()->getY(); if (!((xMouse >= _XReal) && (xMouse < (_XReal + _WReal))&& (yMouse > _YReal) && @@ -984,7 +984,7 @@ bool CGroupSubMenu::handleEvent (const NLGUI::CEventDescriptor &event) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); pIM->runActionHandler ( _Lines[_Selected].AHName, - pIM->getCtrlLaunchingModal(), + CWidgetManager::getInstance()->getCtrlLaunchingModal(), _Lines[_Selected].AHParams ); if (_SubMenus[_Selected] != NULL) @@ -994,12 +994,12 @@ bool CGroupSubMenu::handleEvent (const NLGUI::CEventDescriptor &event) else { // if the menu hasn't triggered a new modal window, disable it - if (pIM->getModalWindow() == _GroupMenu) + if (CWidgetManager::getInstance()->getModalWindow() == _GroupMenu) { if(_GroupMenu && _GroupMenu->getCloseSubMenuUsingPopModal()) - pIM->popModalWindow(); + CWidgetManager::getInstance()->popModalWindow(); else - pIM->disableModalWindow (); + CWidgetManager::getInstance()->disableModalWindow (); } } } @@ -1936,10 +1936,10 @@ bool CGroupMenu::parse (xmlNodePtr in, CInterfaceGroup *parentGroup) if (prop) { CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupMenu *gm = dynamic_cast(im->getElementFromId(prop)); + CGroupMenu *gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(prop)); if (!gm) { - gm = dynamic_cast(im->getElementFromId("ui:interface:" + std::string((const char*)prop))); + gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:" + std::string((const char*)prop))); } if (gm) { diff --git a/code/ryzom/client/src/interface_v3/group_modal_get_key.cpp b/code/ryzom/client/src/interface_v3/group_modal_get_key.cpp index adf817b8d..6ca9541d4 100644 --- a/code/ryzom/client/src/interface_v3/group_modal_get_key.cpp +++ b/code/ryzom/client/src/interface_v3/group_modal_get_key.cpp @@ -57,11 +57,11 @@ void CGroupModalGetKey::setActive (bool state) else pIM->setCaptureKeyboard (NULL); - CViewText *pVT= dynamic_cast(pIM->getElementFromId( VIEW_TEXT_KEY )); + CViewText *pVT= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( VIEW_TEXT_KEY )); if (pVT != NULL) pVT->setText(string("")); - pVT= dynamic_cast(pIM->getElementFromId( VIEW_TEXT_INUSE )); + pVT= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( VIEW_TEXT_INUSE )); if (pVT != NULL) pVT->setText(string("")); - CCtrlBaseButton *pCB= dynamic_cast(pIM->getElementFromId( CTRL_BUTTON_OK )); + CCtrlBaseButton *pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( CTRL_BUTTON_OK )); if (pCB != NULL) pCB->setFrozen(true); CGroupModal::setActive(state); @@ -85,7 +85,7 @@ bool CGroupModalGetKey::handleEvent (const NLGUI::CEventDescriptor &event) // Setup the text ! CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewText *pVT= dynamic_cast(pIM->getElementFromId( VIEW_TEXT_KEY )); + CViewText *pVT= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( VIEW_TEXT_KEY )); if (pVT != NULL) pVT->setText(Combo.toUCString()); // Check if in use @@ -101,7 +101,7 @@ bool CGroupModalGetKey::handleEvent (const NLGUI::CEventDescriptor &event) { const CActionsManager::TComboActionMap &keyShortcut = pCurAM->getComboActionMap(); CActionsManager::TComboActionMap::const_iterator it = keyShortcut.find(Combo); - pVT = dynamic_cast(pIM->getElementFromId( VIEW_TEXT_INUSE )); + pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId( VIEW_TEXT_INUSE )); if (it != keyShortcut.end()) { const CBaseAction *baseAction = pCurAM->getBaseAction(it->second); @@ -118,7 +118,7 @@ bool CGroupModalGetKey::handleEvent (const NLGUI::CEventDescriptor &event) } // Show the ok button - CCtrlBaseButton *pCB= dynamic_cast(pIM->getElementFromId( CTRL_BUTTON_OK )); + CCtrlBaseButton *pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( CTRL_BUTTON_OK )); if (pCB != NULL) pCB->setFrozen(false); } // } diff --git a/code/ryzom/client/src/interface_v3/group_paragraph.cpp b/code/ryzom/client/src/interface_v3/group_paragraph.cpp index 5cc17105e..e600638a4 100644 --- a/code/ryzom/client/src/interface_v3/group_paragraph.cpp +++ b/code/ryzom/client/src/interface_v3/group_paragraph.cpp @@ -773,10 +773,10 @@ void CGroupParagraph::draw () CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewRenderer &rVR = pIM->getViewRenderer(); - if (pIM->getModalWindow() == NULL) + if (CWidgetManager::getInstance()->getModalWindow() == NULL) { - sint32 x = pIM->getPointer()->getX(); - sint32 y = pIM->getPointer()->getY(); + sint32 x = CWidgetManager::getInstance()->getPointer()->getX(); + sint32 y = CWidgetManager::getInstance()->getPointer()->getY(); CInterfaceGroup *pIG = pIM->getWindowUnder(x,y); CInterfaceGroup *pParent = this; diff --git a/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp b/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp index 775a0acf2..10f23bb9a 100644 --- a/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp +++ b/code/ryzom/client/src/interface_v3/group_phrase_skill_filter.cpp @@ -153,7 +153,7 @@ void CGroupPhraseSkillFilter::rebuild() // get the tree if (_Tree == NULL) { - _Tree = dynamic_cast(pIM->getElementFromId(getId(),"sbtree:tree_list")); + _Tree = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(getId(),"sbtree:tree_list")); if (_Tree == NULL) { diff --git a/code/ryzom/client/src/interface_v3/group_quick_help.cpp b/code/ryzom/client/src/interface_v3/group_quick_help.cpp index 3f829c8ef..26245433a 100644 --- a/code/ryzom/client/src/interface_v3/group_quick_help.cpp +++ b/code/ryzom/client/src/interface_v3/group_quick_help.cpp @@ -359,7 +359,7 @@ class CHandlerSubmitQuickHelp : public IActionHandler { void execute (CCtrlBase * /* pCaller */, const std::string &sParams) { - CInterfaceElement *element = CInterfaceManager::getInstance()->getElementFromId("ui:interface:quick_help:content:html"); + CInterfaceElement *element = CWidgetManager::getInstance()->getElementFromId("ui:interface:quick_help:content:html"); if (element) { // Group HTML ? @@ -370,7 +370,7 @@ class CHandlerSubmitQuickHelp : public IActionHandler groupQH->submitEvent (sParams.c_str()); } } - element = CInterfaceManager::getInstance()->getElementFromId("ui:interface:help_browser:content:html"); + element = CWidgetManager::getInstance()->getElementFromId("ui:interface:help_browser:content:html"); if (element) { // Group HTML ? @@ -400,7 +400,7 @@ class CHandlerRunQuickHelp : public IActionHandler if (!buttonId.empty()) { // Get the button id - CInterfaceElement *element = pIM->getElementFromId(buttonId+":"+sParams); + CInterfaceElement *element = CWidgetManager::getInstance()->getElementFromId(buttonId+":"+sParams); if (element) { // Button Ctrl ? diff --git a/code/ryzom/client/src/interface_v3/group_skills.cpp b/code/ryzom/client/src/interface_v3/group_skills.cpp index 619438f12..8fc17fac5 100644 --- a/code/ryzom/client/src/interface_v3/group_skills.cpp +++ b/code/ryzom/client/src/interface_v3/group_skills.cpp @@ -124,7 +124,7 @@ void CGroupSkills::rebuild() // **** first time bind? if(!_Tree) { - _Tree = dynamic_cast(pIM->getElementFromId(getId(),WIN_TREE_LIST)); + _Tree = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(getId(),WIN_TREE_LIST)); if (_Tree == NULL) { nlwarning("cant find tree"); diff --git a/code/ryzom/client/src/interface_v3/group_tree.cpp b/code/ryzom/client/src/interface_v3/group_tree.cpp index 6eb9159e3..9797f0844 100644 --- a/code/ryzom/client/src/interface_v3/group_tree.cpp +++ b/code/ryzom/client/src/interface_v3/group_tree.cpp @@ -571,10 +571,10 @@ void CGroupTree::draw() bDisplayOver = false; } else - if (pIM->getModalWindow() == NULL) + if (CWidgetManager::getInstance()->getModalWindow() == NULL) { - sint32 x = pIM->getPointer()->getX(); - sint32 y = pIM->getPointer()->getY(); + sint32 x = CWidgetManager::getInstance()->getPointer()->getX(); + sint32 y = CWidgetManager::getInstance()->getPointer()->getY(); CInterfaceGroup *pIG = pIM->getWindowUnder(x, y); CInterfaceGroup *pParent = this; @@ -1331,7 +1331,7 @@ public: void execute (CCtrlBase * /* pCaller */, const std::string &sParams) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupTree *pTree = dynamic_cast(pIM->getElementFromId(sParams)); + CGroupTree *pTree = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sParams)); if (pTree != NULL) pTree->reset(); } diff --git a/code/ryzom/client/src/interface_v3/guild_manager.cpp b/code/ryzom/client/src/interface_v3/guild_manager.cpp index 79a39c56d..7092cd903 100644 --- a/code/ryzom/client/src/interface_v3/guild_manager.cpp +++ b/code/ryzom/client/src/interface_v3/guild_manager.cpp @@ -325,12 +325,12 @@ void CGuildManager::update() // Open the guild info if we are not in the init phase if (!IngameDbMngr.initInProgress()) { - pElt = pIM->getElementFromId(WIN_GUILD); + pElt = CWidgetManager::getInstance()->getElementFromId(WIN_GUILD); if (pElt != NULL) pElt->setActive(true); } // Browse the forum - pElt = pIM->getElementFromId(WIN_GUILD_FORUM":content:html"); + pElt = CWidgetManager::getInstance()->getElementFromId(WIN_GUILD_FORUM":content:html"); if (pElt != NULL) { CGroupHTML *html = dynamic_cast(pElt); @@ -423,17 +423,17 @@ void CGuildManager::update() NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:USER:GUILD_GRADE")->setValue32(_Grade); // update the guild display - CGroupContainer *pGuild = dynamic_cast(pIM->getElementFromId(WIN_GUILD)); + CGroupContainer *pGuild = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_GUILD)); if (pGuild != NULL) { // if the guild window is visible if (pGuild->isOpen() && pGuild->getActive()) { // Close the modal window if the member list will change - if(pIM->getModalWindow()!=NULL && _NeedUpdateMembers) + if(CWidgetManager::getInstance()->getModalWindow()!=NULL && _NeedUpdateMembers) { - if (pIM->getModalWindow()->getId() == MENU_GUILD_MEMBER ) - pIM->disableModalWindow(); + if (CWidgetManager::getInstance()->getModalWindow()->getId() == MENU_GUILD_MEMBER ) + CWidgetManager::getInstance()->disableModalWindow(); } // Rebuild interface. Rebuild members only if needed @@ -456,15 +456,15 @@ void CGuildManager::update() if (bAllValid) { _JoinPropUpdate = false; - CGroupContainer *pJoinProp = dynamic_cast(pIM->getElementFromId(WIN_JOIN_PROPOSAL)); + CGroupContainer *pJoinProp = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_JOIN_PROPOSAL)); if (pJoinProp != NULL) { - CViewText *pJoinPropPhraseView = dynamic_cast(pIM->getElementFromId(VIEW_JOIN_PROPOSAL_PHRASE)); + CViewText *pJoinPropPhraseView = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(VIEW_JOIN_PROPOSAL_PHRASE)); if (pJoinPropPhraseView != NULL) pJoinPropPhraseView->setText(_JoinPropPhrase); pJoinProp->setActive(true); - pIM->setTopWindow(pJoinProp); + CWidgetManager::getInstance()->setTopWindow(pJoinProp); pJoinProp->updateCoords(); pJoinProp->center(); pJoinProp->enableBlink(2); @@ -498,10 +498,10 @@ void CGuildManager::launchAscensor() // Start Ascensor Interface CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pAC = dynamic_cast(pIM->getElementFromId(WIN_ASCENSOR)); + CGroupContainer *pAC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_ASCENSOR)); if (pAC == NULL) return; pAC->setActive(true); - pIM->setTopWindow(pAC); + CWidgetManager::getInstance()->setTopWindow(pAC); } // TEMP TEMP TEMP @@ -550,7 +550,7 @@ NLMISC_COMMAND(testAscensorPage, "Temp : Simulate the server that fills the data void CGuildManager::quitAscensor() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pAC = dynamic_cast(pIM->getElementFromId(WIN_ASCENSOR)); + CGroupContainer *pAC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_ASCENSOR)); if (pAC == NULL) return; pAC->setActive(false); } @@ -566,7 +566,7 @@ void CGuildManager::launchJoinProposal(uint32 phraseID) void CGuildManager::quitJoinProposal() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pJoinProp = dynamic_cast(pIM->getElementFromId(WIN_JOIN_PROPOSAL)); + CGroupContainer *pJoinProp = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_JOIN_PROPOSAL)); if (pJoinProp != NULL) pJoinProp->setActive(false); } @@ -575,13 +575,13 @@ void CGuildManager::quitJoinProposal() void CGuildManager::closeAllInterfaces() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGuild = dynamic_cast(pIM->getElementFromId(WIN_GUILD)); + CGroupContainer *pGuild = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_GUILD)); if (pGuild != NULL) pGuild->setActive(false); - CGroupContainer *pGuildForum = dynamic_cast(pIM->getElementFromId(WIN_GUILD_FORUM)); + CGroupContainer *pGuildForum = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_GUILD_FORUM)); if (pGuildForum != NULL) pGuildForum->setActive(false); - CGroupContainer *pGuildChat = dynamic_cast(pIM->getElementFromId(WIN_GUILD_CHAT)); + CGroupContainer *pGuildChat = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_GUILD_CHAT)); if (pGuildChat != NULL) pGuildChat->setActive(false); } @@ -598,13 +598,13 @@ void CGuildManager::openGuildWindow() // node->setValue64(1); // // CInterfaceElement *pElt; -// pElt = pIM->getElementFromId(WIN_GUILD); +// pElt = CWidgetManager::getInstance()->getElementFromId(WIN_GUILD); // if (pElt != NULL) // { // pElt->setActive(true); // } // // Browse the forum -// pElt = pIM->getElementFromId(WIN_GUILD_FORUM":content:html"); +// pElt = CWidgetManager::getInstance()->getElementFromId(WIN_GUILD_FORUM":content:html"); // if (pElt != NULL) // { // CGroupHTML *html = dynamic_cast(pElt); @@ -785,7 +785,7 @@ class CAHGuildSheetOpen : public IActionHandler const SGuild &rGuild = pGM->getGuild(); // Freeze / unfreeze quit button - CCtrlBaseButton *control = dynamic_cast(pIM->getElementFromId(VIEW_TEXT_GUILD_QUIT)); + CCtrlBaseButton *control = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(VIEW_TEXT_GUILD_QUIT)); if (control) control->setFrozen (!rGuild.QuitGuildAvailable || pGM->isProxy()); @@ -799,12 +799,12 @@ class CAHGuildSheetOpen : public IActionHandler // update member count view const vector &rGuildMembers = pGM->getGuildMembers(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId(VIEW_TEXT_GUILD_MEMBER_COUNT)); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(VIEW_TEXT_GUILD_MEMBER_COUNT)); if (pVT) pVT->setText(toString(rGuildMembers.size())); // rebuild guild member list - CGroupList *pParent = dynamic_cast(pIM->getElementFromId(LIST_GUILD_MEMBERS)); + CGroupList *pParent = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_GUILD_MEMBERS)); if (pParent == NULL) return; pParent->clearGroups(); pParent->setDynamicDisplaySize(false); @@ -892,19 +892,19 @@ static void setRights(bool lead, bool hioff, bool offi, bool recr, bool bear, bo { CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewTextMenu *pVTM; - pVTM = dynamic_cast(pIM->getElementFromId(string(MENU_GUILD_MEMBER":lead"))); + pVTM = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(string(MENU_GUILD_MEMBER":lead"))); if (pVTM != NULL) pVTM->setGrayed(!lead); - pVTM = dynamic_cast(pIM->getElementFromId(string(MENU_GUILD_MEMBER":hiof"))); + pVTM = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(string(MENU_GUILD_MEMBER":hiof"))); if (pVTM != NULL) pVTM->setGrayed(!hioff); - pVTM = dynamic_cast(pIM->getElementFromId(string(MENU_GUILD_MEMBER":offi"))); + pVTM = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(string(MENU_GUILD_MEMBER":offi"))); if (pVTM != NULL) pVTM->setGrayed(!offi); - pVTM = dynamic_cast(pIM->getElementFromId(string(MENU_GUILD_MEMBER":recr"))); + pVTM = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(string(MENU_GUILD_MEMBER":recr"))); if (pVTM != NULL) pVTM->setGrayed(!recr); - pVTM = dynamic_cast(pIM->getElementFromId(string(MENU_GUILD_MEMBER":bear"))); + pVTM = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(string(MENU_GUILD_MEMBER":bear"))); if (pVTM != NULL) pVTM->setGrayed(!bear); - pVTM = dynamic_cast(pIM->getElementFromId(string(MENU_GUILD_MEMBER":memb"))); + pVTM = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(string(MENU_GUILD_MEMBER":memb"))); if (pVTM != NULL) pVTM->setGrayed(!memb); - pVTM = dynamic_cast(pIM->getElementFromId(string(MENU_GUILD_MEMBER":kick"))); + pVTM = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(string(MENU_GUILD_MEMBER":kick"))); if (pVTM != NULL) pVTM->setGrayed(!kick); } @@ -918,11 +918,11 @@ class CAHGuildSheetMenuOpen : public IActionHandler const vector &rGuildMembers = pGM->getGuildMembers(); // *** Check and retrieve the current member index (index in the member list) - CCtrlBase *ctrlLaunchingModal= pIM->getCtrlLaunchingModal(); + CCtrlBase *ctrlLaunchingModal= CWidgetManager::getInstance()->getCtrlLaunchingModal(); if (pCaller == NULL || ctrlLaunchingModal == NULL) { // Error -> Close - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); return; } string sId = ctrlLaunchingModal->getId(); @@ -932,7 +932,7 @@ class CAHGuildSheetMenuOpen : public IActionHandler if ((nLineNb < 0) || (nLineNb >= (sint32)rGuildMembers.size())) { // Error -> Close - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); return; } MemberIndexSelected= nLineNb; @@ -942,7 +942,7 @@ class CAHGuildSheetMenuOpen : public IActionHandler if(MemberNameSelected.empty()) { // Error -> Close - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); return; } @@ -1052,7 +1052,7 @@ public: CGuildManager *pGM = CGuildManager::getInstance(); const vector &rGuildMembers = pGM->getGuildMembers(); // *** Check and retrieve the current member index (index in the member list) - CCtrlBase *ctrlLaunchingModal= pIM->getCtrlLaunchingModal(); + CCtrlBase *ctrlLaunchingModal= CWidgetManager::getInstance()->getCtrlLaunchingModal(); if (pCaller == NULL) { // Error -> Close @@ -1355,7 +1355,7 @@ class CHandlerGuildInvGetMoney : public IActionHandler virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */) { sendMoneyServerMessage("GUILD:TAKE_MONEY"); - CInterfaceManager::getInstance()->popModalWindow(); + CWidgetManager::getInstance()->popModalWindow(); } }; REGISTER_ACTION_HANDLER (CHandlerGuildInvGetMoney, "guild_inv_get_money"); @@ -1367,7 +1367,7 @@ class CHandlerGuildInvPutMoney : public IActionHandler virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */) { sendMoneyServerMessage("GUILD:PUT_MONEY"); - CInterfaceManager::getInstance()->popModalWindow(); + CWidgetManager::getInstance()->popModalWindow(); } }; REGISTER_ACTION_HANDLER (CHandlerGuildInvPutMoney, "guild_inv_put_money"); diff --git a/code/ryzom/client/src/interface_v3/input_handler_manager.cpp b/code/ryzom/client/src/interface_v3/input_handler_manager.cpp index 18420ef82..3332e33ac 100644 --- a/code/ryzom/client/src/interface_v3/input_handler_manager.cpp +++ b/code/ryzom/client/src/interface_v3/input_handler_manager.cpp @@ -258,7 +258,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) } } // **** Event Mouse - else if(pIM->getPointer() && _Focus /* && pIM->isMouseHandlingEnabled() */ && + else if(CWidgetManager::getInstance()->getPointer() && _Focus /* && pIM->isMouseHandlingEnabled() */ && ( event == EventMouseMoveId || event == EventMouseDownId || event == EventMouseUpId || @@ -268,7 +268,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) { - CViewPointer &rIP = *pIM->getPointer(); + CViewPointer &rIP = *CWidgetManager::getInstance()->getPointer(); NLGUI::CEventDescriptorMouse eventDesc; diff --git a/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp b/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp index 52186b823..fc0582d19 100644 --- a/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp +++ b/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp @@ -162,7 +162,7 @@ bool CInterface3DScene::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) _Ref3DScene = NULL; if (ptr) { - CInterfaceElement *pIE = pIM->getElementFromId(this->getId(), ptr); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(this->getId(), ptr); _Ref3DScene = dynamic_cast(pIE); } if (_Ref3DScene != NULL) @@ -705,7 +705,7 @@ void CInterface3DScene::setCurrentCamera (const string &name) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); CInterface3DScene *pI3DS = (_Ref3DScene != NULL) ? _Ref3DScene : this; - CInterfaceElement *pIE = pIM->getElementFromId(pI3DS->getId(), name); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(pI3DS->getId(), name); CInterface3DCamera *pI3DCam = dynamic_cast(pIE); if (pI3DCam != NULL) { @@ -732,7 +732,7 @@ void CInterface3DScene::setCurrentClusterSystem(const string &sCSName) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); CInterface3DScene *pI3DS = (_Ref3DScene != NULL) ? _Ref3DScene : this; - CInterfaceElement *pIE = pIM->getElementFromId(pI3DS->getId(), sCSName); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(pI3DS->getId(), sCSName); CInterface3DIG *pI3DIG = dynamic_cast(pIE); if (pI3DIG != NULL) { diff --git a/code/ryzom/client/src/interface_v3/interface_config.cpp b/code/ryzom/client/src/interface_v3/interface_config.cpp index 486b05487..34fb9d52e 100644 --- a/code/ryzom/client/src/interface_v3/interface_config.cpp +++ b/code/ryzom/client/src/interface_v3/interface_config.cpp @@ -565,7 +565,7 @@ void CInterfaceConfig::CDesktopImage::fromCurrentDesktop() f.resetPtrTable(); f.seek(0, NLMISC::IStream::begin); // Save the Top Window for this config. - CInterfaceGroup *topWindow= pIM->getTopWindow(pIM->getLastTopWindowPriority()); + CInterfaceGroup *topWindow= CWidgetManager::getInstance()->getTopWindow(CWidgetManager::getInstance()->getLastTopWindowPriority()); string topWindowName; if (topWindow) { @@ -595,7 +595,7 @@ void CInterfaceConfig::CDesktopImage::toCurrentDesktop() for(uint k = 0; k < GCImages.size(); ++k) { - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(GCImages[k].Id)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GCImages[k].Id)); if (pGC != NULL) GCImages[k].setTo(pGC); } @@ -617,9 +617,9 @@ void CInterfaceConfig::CDesktopImage::toCurrentDesktop() f.serial(topWindowName); if(!topWindowName.empty()) { - CInterfaceGroup *window= dynamic_cast(pIM->getElementFromId(topWindowName)); + CInterfaceGroup *window= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(topWindowName)); if(window && window->getActive()) - pIM->setTopWindow(window); + CWidgetManager::getInstance()->setTopWindow(window); } } uint32 numElemWithConfig; @@ -632,7 +632,7 @@ void CInterfaceConfig::CDesktopImage::toCurrentDesktop() f.serial(chunkSize); uint startPos = f.getPos(); CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceElement *elem = im->getElementFromId(elemID); + CInterfaceElement *elem = CWidgetManager::getInstance()->getElementFromId(elemID); if (!elem) { nlwarning("Element %s not found while loading config, skipping datas", elemID.c_str()); diff --git a/code/ryzom/client/src/interface_v3/interface_ddx.cpp b/code/ryzom/client/src/interface_v3/interface_ddx.cpp index c22c5204a..73f4873b4 100644 --- a/code/ryzom/client/src/interface_v3/interface_ddx.cpp +++ b/code/ryzom/client/src/interface_v3/interface_ddx.cpp @@ -627,7 +627,7 @@ bool CInterfaceDDX::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) else if( stricmp((char*)cur->name,"apply") == 0 ) { CXMLAutoPtr ptrUI((const char*)xmlGetProp (cur, (xmlChar*)"ui")); - _ApplyButton = dynamic_cast(pIM->getElementFromId(_Parent->getId(),(const char*)ptrUI)); + _ApplyButton = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_Parent->getId(),(const char*)ptrUI)); } cur = cur->next; @@ -1083,7 +1083,7 @@ public: CDDXManager *pDM = CDDXManager::getInstance(); if (pCaller == NULL) return; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CCtrlBase *pCB = pIM->getCtrlLaunchingModal(); + CCtrlBase *pCB = CWidgetManager::getInstance()->getCtrlLaunchingModal(); // Search for a ddx in the parents CInterfaceGroup *pIG = pCB->getParent(); bool found = false; diff --git a/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp b/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp index 949e0875d..091c941cd 100644 --- a/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp +++ b/code/ryzom/client/src/interface_v3/interface_expr_user_fct_game.cpp @@ -120,7 +120,7 @@ static DECLARE_INTERFACE_USER_FCT(isOpen) { if (args.size() != 1) return false; if (!args[0].toString()) return false; - CGroupContainer *elm = dynamic_cast(CInterfaceManager::getInstance()->getElementFromId(args[0].getString())); + CGroupContainer *elm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(args[0].getString())); if (!elm) { nlwarning(" : can't find element %s", args[0].getString().c_str()); @@ -733,7 +733,7 @@ static DECLARE_INTERFACE_USER_FCT(isCtrlLaunchModalMacro) } CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CDBCtrlSheet *ctrl= dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBCtrlSheet *ctrl= dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); result.setBool( ctrl->isMacro() ); diff --git a/code/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp b/code/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp index aa1f880e8..356ca8c38 100644 --- a/code/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp +++ b/code/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp @@ -157,7 +157,7 @@ static DECLARE_INTERFACE_USER_FCT(getSheetFromId) { if (args.size() != 1 || !args[0].toString()) return false; CInterfaceManager *im = CInterfaceManager::getInstance(); - CDBCtrlSheet *sheet = dynamic_cast(im->getElementFromId(args[0].getString())); + CDBCtrlSheet *sheet = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(args[0].getString())); if (!sheet) { nlwarning("Sheet %s not found", args[0].getString().c_str()); diff --git a/code/ryzom/client/src/interface_v3/interface_group.cpp b/code/ryzom/client/src/interface_v3/interface_group.cpp index 24fd256f3..814560331 100644 --- a/code/ryzom/client/src/interface_v3/interface_group.cpp +++ b/code/ryzom/client/src/interface_v3/interface_group.cpp @@ -246,7 +246,7 @@ void CInterfaceGroup::setPriority(uint8 nprio) { if (nprio != _Priority) { - CInterfaceManager::getInstance()->setWindowPriority(this, nprio); + CWidgetManager::getInstance()->setWindowPriority(this, nprio); } } diff --git a/code/ryzom/client/src/interface_v3/interface_link.cpp b/code/ryzom/client/src/interface_v3/interface_link.cpp index 8b783d03b..4a7315ef0 100644 --- a/code/ryzom/client/src/interface_v3/interface_link.cpp +++ b/code/ryzom/client/src/interface_v3/interface_link.cpp @@ -477,7 +477,7 @@ bool CInterfaceLink::splitLinkTarget(const std::string &target, CInterfaceGroup { // try the absolute adress of the element elmPath = target.substr(0, lastPos); - elm = CInterfaceManager::getInstance()->getElementFromId(elmPath); + elm = CWidgetManager::getInstance()->getElementFromId(elmPath); elmProp = target.substr(lastPos + 1); } @@ -544,7 +544,7 @@ void CInterfaceLink::setTargetProperty (const std::string &Target, const CInt // Eval target ! string elt = Target.substr(0,Target.rfind(':')); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceElement *pIE = pIM->getElementFromId(elt); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(elt); CInterfaceGroup *pIG = dynamic_cast(pIE); if (pIG == NULL) pIG = pIE->getParent(); diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index e5d10e45a..41f678289 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -181,10 +181,6 @@ CChatDisplayer * ChatDisplayer = NULL; void initActions(); void uninitActions(); -// ------------------------------------------------------------------------------------------------ -string CInterfaceManager::_CtrlLaunchingModalId= "ctrl_launch_modal"; - - // ------------------------------------------------------------------------------------------------ static const uint DOUBLE_CLICK_MIN = 50; static const uint DOUBLE_CLICK_MAX = 750; @@ -268,7 +264,6 @@ _ViewRenderer( driver, textcontext ) interfaceLinkUpdater = new CInterfaceLink::CInterfaceLinkUpdater(); _ScreenW = _ScreenH = 0; _LastInGameScreenW = _LastInGameScreenH = 0; - _Pointer = NULL; _DescTextTarget = NULL; _GlobalColor = CRGBA(255,255,255,255); _GlobalColorForContent = _GlobalColor; @@ -294,7 +289,7 @@ _ViewRenderer( driver, textcontext ) _EmotesInitialized = false; // context help - _DeltaTimeStopingContextHelp= 0; + CWidgetManager::getInstance()->_DeltaTimeStopingContextHelp = 0; _MaxTimeStopingContextHelp= 0.2f; _LastXContextHelp= -10000; _LastYContextHelp= -10000; @@ -377,7 +372,7 @@ void CInterfaceManager::reset() { _ViewRenderer.reset(); _CtrlsUnderPointer.clear(); - _CurCtrlContextHelp = ""; + CWidgetManager::getInstance()->setCurContextHelp( NULL ); _ViewsUnderPointer.clear(); _GroupsUnderPointer.clear(); _CaptureKeyboard = NULL; @@ -421,7 +416,7 @@ void CInterfaceManager::resetShardSpecificData() CSPhraseManager *pPM= CSPhraseManager::getInstance(); pPM->setEquipInvalidation(0, 0); - CGroupContainer *pGC = dynamic_cast(getElementFromId(WIN_TEMPINV)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_TEMPINV)); if (pGC != NULL) pGC->setActive(false); } @@ -484,7 +479,7 @@ void CInterfaceManager::initLogin() updateAllLocalisedElements(); - activateMasterGroup ("ui:login", true); + CWidgetManager::getInstance()->activateMasterGroup ("ui:login", true); { initActions(); @@ -495,12 +490,12 @@ void CInterfaceManager::initLogin() void CInterfaceManager::uninitLogin() { - activateMasterGroup ("ui:login", false); + CWidgetManager::getInstance()->activateMasterGroup ("ui:login", false); removeAll(); reset(); - _Pointer = NULL; + CWidgetManager::getInstance()->setPointer( NULL ); CInterfaceLink::removeAllLinks(); @@ -574,7 +569,7 @@ void CInterfaceManager::initOutGame() updateAllLocalisedElements(); - activateMasterGroup ("ui:outgame", true); + CWidgetManager::getInstance()->activateMasterGroup ("ui:outgame", true); // if (!ClientCfg.FSHost.empty()) // { @@ -598,7 +593,7 @@ void CInterfaceManager::uninitOutGame() if (ClientCfg.SelectCharacter != -1) return; - disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); //_Database->display(""); CBotChatManager::getInstance()->setCurrPage(NULL); @@ -615,7 +610,7 @@ void CInterfaceManager::uninitOutGame() //nlinfo ("%d seconds for uninitOutGame", (uint32)(ryzomGetLocalTime ()-initStart)/1000); initStart = ryzomGetLocalTime (); - activateMasterGroup ("ui:outgame", false); + CWidgetManager::getInstance()->activateMasterGroup ("ui:outgame", false); //nlinfo ("%d seconds for activateMasterGroup", (uint32)(ryzomGetLocalTime ()-initStart)/1000); initStart = ryzomGetLocalTime (); removeAll(); @@ -624,7 +619,7 @@ void CInterfaceManager::uninitOutGame() reset(); //nlinfo ("%d seconds for reset", (uint32)(ryzomGetLocalTime ()-initStart)/1000); // reset the mouse pointer to avoid invalid pointer access - _Pointer = NULL; + CWidgetManager::getInstance()->setPointer( NULL ); initStart = ryzomGetLocalTime (); CInterfaceLink::removeAllLinks(); //nlinfo ("%d seconds for removeAllLinks", (uint32)(ryzomGetLocalTime ()-initStart)/1000); @@ -787,7 +782,7 @@ void CInterfaceManager::initInGame() //CBotChatUI::refreshActiveWindows(); // bot chat windows are saved too.. - activateMasterGroup ("ui:interface", true); + CWidgetManager::getInstance()->activateMasterGroup ("ui:interface", true); // Update the time in the ui database _CheckMailNode = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:MAIL_WAITING"); @@ -826,7 +821,7 @@ void CInterfaceManager::initInGame() nlinfo ("%d seconds for initInGame", (uint32)(ryzomGetLocalTime ()-initStart)/1000); // reset the compass target - CGroupCompas *gc = dynamic_cast(getElementFromId("ui:interface:compass")); + CGroupCompas *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:compass")); if (gc && gc->isSavedTargetValid()) { gc->setTarget(gc->getSavedTarget()); @@ -887,7 +882,7 @@ void CInterfaceManager::configureQuitDialogBox() CInterfaceManager *pIM = CInterfaceManager::getInstance(); string quitDialogMainStr = "ui:interface:quit_dialog"; string quitDialogStr = quitDialogMainStr + ":indent_middle"; - CInterfaceGroup *quitDlg = dynamic_cast(pIM->getElementFromId(quitDialogStr)); + CInterfaceGroup *quitDlg = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(quitDialogStr)); if (quitDlg) { CInterfaceElement *eltRet, *eltQuit, *eltQuitNow; @@ -976,7 +971,7 @@ void CInterfaceManager::configureQuitDialogBox() } // Make all controls have the same size - CInterfaceGroup *quitDlgMain = dynamic_cast(pIM->getElementFromId(quitDialogMainStr)); + CInterfaceGroup *quitDlgMain = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(quitDialogMainStr)); if ( quitDlgMain ) { @@ -1148,10 +1143,10 @@ void CInterfaceManager::uninitInGame1 () } // disable the game_quitting modal window - disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); // Remove all interface objects (containers, groups, variables, defines, ...) - activateMasterGroup ("ui:interface", false); + CWidgetManager::getInstance()->activateMasterGroup ("ui:interface", false); removeAll(); reset(); CInterfaceLink::removeAllLinks(); @@ -1287,7 +1282,7 @@ void CInterfaceManager::updateFrameEvents() CI18N::get (WeatherManager.getCurrWeatherState().LocalizedName); - CViewText *pVT = dynamic_cast(getElementFromId("ui:interface:map:content:map_content:weather")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:weather")); if (pVT != NULL) pVT->setText(str); @@ -1311,13 +1306,13 @@ void CInterfaceManager::updateFrameEvents() str += CI18N::get("uiAtysianCycle" + toString(RT.getRyzomCycle()+1) + "Ordinal") + " " + CI18N::get("uiAtysianCycle") + " "; str += toString("%04d", RT.getRyzomYear()); - pVT = dynamic_cast(getElementFromId("ui:interface:map:content:map_content:time")); + pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:time")); if (pVT != NULL) pVT->setText(str); str.clear(); // Update the clock in the compass if enabled. - pVT = dynamic_cast(getElementFromId("ui:interface:compass:clock:time")); + pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:compass:clock:time")); if (pVT != NULL) { if (pVT->getActive()) @@ -1962,10 +1957,8 @@ void CInterfaceManager::checkCoords() } } - if (_Pointer != NULL) - { - _Pointer->updateCoords(); - } + if ( CWidgetManager::getInstance()->getPointer() != NULL) + CWidgetManager::getInstance()->getPointer()->updateCoords(); } @@ -1973,10 +1966,10 @@ void CInterfaceManager::checkCoords() if (bRecomputeCtrlUnderPtr) { H_AUTO ( RZ_Interface_RecomputeCtrlUnderPtr ) - if (_Pointer) + if ( CWidgetManager::getInstance()->getPointer() != NULL ) { - sint32 mx = _Pointer->getX(); - sint32 my = _Pointer->getY(); + sint32 mx = CWidgetManager::getInstance()->getPointer()->getX(); + sint32 my = CWidgetManager::getInstance()->getPointer()->getY(); getViewsUnder (mx, my, _ViewsUnderPointer); getCtrlsUnder (mx, my, _CtrlsUnderPointer); getGroupsUnder (mx, my, _GroupsUnderPointer); @@ -2130,17 +2123,17 @@ void CInterfaceManager::drawViews(NL3D::UCamera camera) drawContextHelp (); // Draw the pointer and DND Item - if (_Pointer != NULL) + if ( CWidgetManager::getInstance()->getPointer() != NULL) { //_Pointer->updateCoords(); - if (_Pointer->show()) + if ( CWidgetManager::getInstance()->getPointer()->show()) { CDBCtrlSheet *pCS = dynamic_cast((CCtrlBase*)_CapturePointerLeft); if ((pCS != NULL) && (pCS->isDraging())) { - sint x= _Pointer->getX() - pCS->getDeltaDragX(); - sint y= _Pointer->getY() - pCS->getDeltaDragY(); + sint x= CWidgetManager::getInstance()->getPointer()->getX() - pCS->getDeltaDragX(); + sint y= CWidgetManager::getInstance()->getPointer()->getY() - pCS->getDeltaDragY(); pCS->drawSheet (x, y, false, false); // if the control support CopyDrag, and if copy key pressed, display a tiny "+" @@ -2158,8 +2151,8 @@ void CInterfaceManager::drawViews(NL3D::UCamera camera) // Even if hardware, Force draw if the cursor is a string (ATTACK etc...) /*if (_Pointer->getActive() && (!IsMouseCursorHardware () || _Pointer->getStringMode()) ) _Pointer->draw ();*/ - if (_Pointer->getActive()) - _Pointer->draw (); + if (CWidgetManager::getInstance()->getPointer()->getActive()) + CWidgetManager::getInstance()->getPointer()->draw (); } // flush layers @@ -2188,9 +2181,9 @@ CCtrlBase* CInterfaceManager::getNewContextHelpCtrl() { if ((pICL->getActive()) && (!pICL->emptyContextHelp())) { - if (!_Pointer) return pICL; + if (!CWidgetManager::getInstance()->getPointer()) return pICL; sint32 mx, my; - _Pointer->getPointerPos(mx, my); + CWidgetManager::getInstance()->getPointer()->getPointerPos(mx, my); if (pICL->preciseHitTest(mx, my)) { best = pICL; @@ -2210,9 +2203,9 @@ CCtrlBase* CInterfaceManager::getNewContextHelpCtrl() { if ((pICL->getActive()) && (!pICL->emptyContextHelp())) { - if (!_Pointer) return pICL; + if (!CWidgetManager::getInstance()->getPointer()) return pICL; sint32 mx, my; - _Pointer->getPointerPos(mx, my); + CWidgetManager::getInstance()->getPointer()->getPointerPos(mx, my); if (pICL->preciseHitTest(mx, my)) { best = pICL; @@ -2235,7 +2228,7 @@ CInterfaceGroup *CInterfaceManager::getWindowForActiveMasterGroup(const std::str const CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; if (rMG.Group->getActive()) { - CInterfaceElement *pEL= getElementFromId( rMG.Group->getId() + ":" + window); + CInterfaceElement *pEL= CWidgetManager::getInstance()->getElementFromId( rMG.Group->getId() + ":" + window); if(pEL && pEL->isGroup()) return (CInterfaceGroup*)pEL; } @@ -2248,7 +2241,7 @@ CInterfaceGroup *CInterfaceManager::getWindowForActiveMasterGroup(const std::str // ---------------------------------------------------------------------------- void CInterfaceManager::updateTooltipCoords() { - updateTooltipCoords(_CurCtrlContextHelp); + updateTooltipCoords( CWidgetManager::getInstance()->getCurContextHelp() ); } // ---------------------------------------------------------------------------- @@ -2271,8 +2264,8 @@ void CInterfaceManager::updateTooltipCoords(CCtrlBase *newCtrl) CCtrlBase::TToolTipParentType parentType= newCtrl->getToolTipParent(); CInterfaceGroup *win= NULL; // adjust to the mouse by default - sint32 xParent= _Pointer->getX(); - sint32 yParent= _Pointer->getY(); + sint32 xParent= CWidgetManager::getInstance()->getPointer()->getX(); + sint32 yParent= CWidgetManager::getInstance()->getPointer()->getY(); sint32 wParent= 0; sint32 hParent= 0; // adjust to the window @@ -2281,7 +2274,7 @@ void CInterfaceManager::updateTooltipCoords(CCtrlBase *newCtrl) if(parentType==CCtrlBase::TTWindow) win= newCtrl->getRootWindow(); else - win= dynamic_cast(getElementFromId(newCtrl->getToolTipSpecialParent())); + win= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(newCtrl->getToolTipSpecialParent())); if(win) { xParent = win->getXReal(); @@ -2336,19 +2329,20 @@ void CInterfaceManager::updateTooltipCoords(CCtrlBase *newCtrl) // ---------------------------------------------------------------------------- void CInterfaceManager::drawContextHelp () { - if (!_Pointer || !_ContextHelpActive) + if (!CWidgetManager::getInstance()->getPointer() || !_ContextHelpActive) return; - sint32 x = _Pointer->getX(); - sint32 y = _Pointer->getY(); + sint32 x = CWidgetManager::getInstance()->getPointer()->getX(); + sint32 y = CWidgetManager::getInstance()->getPointer()->getY(); // *************** // **** try to disable // *************** // test disable first, so can recheck asap if another present. see below - if(_CurCtrlContextHelp) + CCtrlBase *_CurCtrlContextHelp = CWidgetManager::getInstance()->getCurContextHelp(); + if( _CurCtrlContextHelp) { if(x!=_LastXContextHelp || y!=_LastYContextHelp) { @@ -2393,12 +2387,12 @@ void CInterfaceManager::drawContextHelp () CCtrlBase *newCtrl= getNewContextHelpCtrl(); if(x==_LastXContextHelp && y==_LastYContextHelp) - _DeltaTimeStopingContextHelp+= DT; + CWidgetManager::getInstance()->_DeltaTimeStopingContextHelp+= DT; else - _DeltaTimeStopingContextHelp= 0; + CWidgetManager::getInstance()->_DeltaTimeStopingContextHelp = 0; // If reach the time limit - if( _DeltaTimeStopingContextHelp > _MaxTimeStopingContextHelp || (newCtrl && newCtrl->wantInstantContextHelp())) + if( CWidgetManager::getInstance()->_DeltaTimeStopingContextHelp > _MaxTimeStopingContextHelp || (newCtrl && newCtrl->wantInstantContextHelp())) { // if present, get the ctx help text. if(newCtrl) @@ -2419,11 +2413,11 @@ void CInterfaceManager::drawContextHelp () // not present? wait furthermore to move the mouse. if(!newCtrl) - _DeltaTimeStopingContextHelp= 0; + CWidgetManager::getInstance()->_DeltaTimeStopingContextHelp= 0; else { // enable - _CurCtrlContextHelp = newCtrl->getId(); + CWidgetManager::getInstance()->setCurContextHelp( newCtrl ); newCtrl->invalidateCoords(); } } @@ -2443,9 +2437,9 @@ void CInterfaceManager::drawContextHelp () /** If there's a modal box around, should be sure that the context help doesn't intersect it. * If this is the case, we just disable it, unless the tooltip was generated by the current modal window */ - if (!_ModalStack.empty()) + if ( CWidgetManager::getInstance()->hasModal() ) { - CInterfaceGroup *mw = _ModalStack.back().ModalWindow; + CInterfaceGroup *mw = CWidgetManager::getInstance()->getModal().ModalWindow; if (mw && mw->isIn(*groupContextHelp)) { if (_CurCtrlContextHelp->isSonOf(mw)) @@ -2674,6 +2668,7 @@ uint CInterfaceManager::getDepth (CCtrlBase *ctrl, CInterfaceGroup *pNewCurrentW bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) { bool handled= false; + CViewPointer *_Pointer = CWidgetManager::getInstance()->getPointer(); if( event.getType() == NLGUI::CEventDescriptor::system ) { @@ -2712,11 +2707,11 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) // Hide menu (or popup menu) is ESCAPE pressed if( eventDesc.getKeyEventType() == NLGUI::CEventDescriptorKey::keychar && eventDesc.getChar() == KeyESCAPE ) { - if(_ModalStack.size() > 0) + if( CWidgetManager::getInstance()->hasModal() ) { - CModalWndInfo mwi = _ModalStack.back(); + CWidgetManager::SModalWndInfo mwi = CWidgetManager::getInstance()->getModal(); if (mwi.ModalExitKeyPushed) - disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } } @@ -2724,7 +2719,7 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) if( eventDesc.getKeyEventType() == NLGUI::CEventDescriptorKey::keychar && eventDesc.getChar() == KeyESCAPE ) { // Get the last escapable active top window. NB: this is ergonomically better. - CInterfaceGroup *win= getLastEscapableTopWindow(); + CInterfaceGroup *win= CWidgetManager::getInstance()->getLastEscapableTopWindow(); if( win ) { // If the window is a modal, must pop it. @@ -2732,7 +2727,7 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) { if(!win->getAHOnEscape().empty()) runActionHandler(win->getAHOnEscape(), win, win->getAHOnEscapeParams()); - popModalWindow(); + CWidgetManager::getInstance()->popModalWindow(); handled= true; } // else just disable it. @@ -2751,7 +2746,7 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) if (eventDesc.getKeyEventType() == NLGUI::CEventDescriptorKey::keychar && eventDesc.getChar() == KeyRETURN) { // If the top window has Enter AH - CInterfaceGroup *tw= getTopWindow(); + CInterfaceGroup *tw= CWidgetManager::getInstance()->getTopWindow(); if(tw && !tw->getAHOnEnter().empty()) { // if the captured keyboard is in this Modal window, then must handle him in priority @@ -2804,7 +2799,7 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) } if (lastContainer) { - setTopWindow(lastContainer); + CWidgetManager::getInstance()->setTopWindow(lastContainer); lastContainer->enableBlink(1); } handled= true; @@ -2868,9 +2863,9 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) NLMISC::CRefPtr clickedOutModalWindow; // modal special features - if (!_ModalStack.empty()) + if ( CWidgetManager::getInstance()->hasModal() ) { - CModalWndInfo mwi = _ModalStack.back(); + CWidgetManager::SModalWndInfo mwi = CWidgetManager::getInstance()->getModal(); if(mwi.ModalWindow) { // If we are not in "click out" mode so we dont handle controls other than those of the modal @@ -2898,22 +2893,12 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) { clickedOutModalWindow = dynamic_cast((CInterfaceGroup*)mwi.ModalWindow); // disable the modal - popModalWindow(); - if (!_ModalStack.empty()) + CWidgetManager::getInstance()->popModalWindow(); + if ( CWidgetManager::getInstance()->hasModal() ) { // don't handle event unless it is a previous modal window - uint k = 0; - for(k = 0; k < _ModalStack.size(); ++k) - { - if (_ModalStack[k].ModalWindow == pNewCurrentWnd) - { - break; - } - } - if (k == _ModalStack.size()) - { + if( !CWidgetManager::getInstance()->isPreviousModal( pNewCurrentWnd ) ) pNewCurrentWnd = NULL; // can't handle event before we have left all modal windows - } } movePointer (0,0); // Reget controls under pointer } @@ -2925,16 +2910,16 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) // Manage LeftClick. if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown) { - if ((pNewCurrentWnd != NULL) && (_ModalStack.empty()) && (pNewCurrentWnd->getOverlappable())) + if ((pNewCurrentWnd != NULL) && (!CWidgetManager::getInstance()->hasModal()) && (pNewCurrentWnd->getOverlappable())) { CGroupContainer *pGC = dynamic_cast(pNewCurrentWnd); if (pGC != NULL) { - if (!pGC->isGrayed()) setTopWindow(pNewCurrentWnd); + if (!pGC->isGrayed()) CWidgetManager::getInstance()->setTopWindow(pNewCurrentWnd); } else { - setTopWindow(pNewCurrentWnd); + CWidgetManager::getInstance()->setTopWindow(pNewCurrentWnd); } } @@ -2977,16 +2962,16 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) // Manage RightClick if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown) { - if ((pNewCurrentWnd != NULL) && (_ModalStack.empty()) && (pNewCurrentWnd->getOverlappable())) + if ((pNewCurrentWnd != NULL) && (!CWidgetManager::getInstance()->hasModal()) && (pNewCurrentWnd->getOverlappable())) { CGroupContainer *pGC = dynamic_cast(pNewCurrentWnd); if (pGC != NULL) { - if (!pGC->isGrayed()) setTopWindow(pNewCurrentWnd); + if (!pGC->isGrayed()) CWidgetManager::getInstance()->setTopWindow(pNewCurrentWnd); } else { - setTopWindow(pNewCurrentWnd); + CWidgetManager::getInstance()->setTopWindow(pNewCurrentWnd); } } @@ -3037,7 +3022,8 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) // window handling. if not handled by a control if (!handled) { - if (((pNewCurrentWnd != NULL) && _ModalStack.empty()) || ((!_ModalStack.empty() && _ModalStack.back().ModalWindow == pNewCurrentWnd))) + if (((pNewCurrentWnd != NULL) && !CWidgetManager::getInstance()->hasModal()) || + ((CWidgetManager::getInstance()->hasModal() && CWidgetManager::getInstance()->getModal().ModalWindow == pNewCurrentWnd))) { NLGUI::CEventDescriptorMouse ev2 = eventDesc; sint32 x= eventDesc.getX(), y = eventDesc.getY(); @@ -3069,17 +3055,17 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) // If the current window is the modal, may Modal quit. Do it after standard event handle - if(!_ModalStack.empty() && pNewCurrentWnd == _ModalStack.back().ModalWindow) + if(CWidgetManager::getInstance()->hasModal() && pNewCurrentWnd == CWidgetManager::getInstance()->getModal().ModalWindow) { // NB: don't force handle==true because to quit a modal does not avoid other actions - CModalWndInfo mwi = _ModalStack.back(); + CWidgetManager::SModalWndInfo mwi = CWidgetManager::getInstance()->getModal(); // and if must quit on click right if(mwi.ModalExitClickR) { // quit if click right if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightup) // disable the modal - disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } // and if must quit on click left @@ -3088,7 +3074,7 @@ bool CInterfaceManager::handleEvent (const NLGUI::CEventDescriptor& event) // quit if click right if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup) // disable the modal - disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } } @@ -3111,8 +3097,8 @@ bool CInterfaceManager::handleMouseMoveEvent( const NLGUI::CEventDescriptor &eve uint32 screenW, screenH; _ViewRenderer.getScreenSize( screenW, screenH ); - sint32 oldX = _Pointer->getX(); - sint32 oldY = _Pointer->getY(); + sint32 oldX = CWidgetManager::getInstance()->getPointer()->getX(); + sint32 oldY = CWidgetManager::getInstance()->getPointer()->getY(); sint32 x = e.getX(); sint32 y = e.getY(); @@ -3126,8 +3112,8 @@ bool CInterfaceManager::handleMouseMoveEvent( const NLGUI::CEventDescriptor &eve { movePointerAbs( newX, newY ); NLGUI::CEventDescriptorMouse &ve = const_cast< NLGUI::CEventDescriptorMouse& >( e ); - ve.setX( _Pointer->getX() ); - ve.setY( _Pointer->getY() ); + ve.setX( CWidgetManager::getInstance()->getPointer()->getX() ); + ve.setY( CWidgetManager::getInstance()->getPointer()->getY() ); } return true; @@ -3136,7 +3122,8 @@ bool CInterfaceManager::handleMouseMoveEvent( const NLGUI::CEventDescriptor &eve // ------------------------------------------------------------------------------------------------ void CInterfaceManager::movePointer (sint32 dx, sint32 dy) { - if (!_Pointer) return; + if (!CWidgetManager::getInstance()->getPointer()) return; + CViewPointer *_Pointer = CWidgetManager::getInstance()->getPointer(); uint32 nScrW, nScrH; sint32 oldpx, oldpy, newpx, newpy, disppx, disppy, olddisppx, olddisppy; @@ -3173,14 +3160,14 @@ void CInterfaceManager::movePointer (sint32 dx, sint32 dy) // ------------------------------------------------------------------------------------------------ void CInterfaceManager::movePointerAbs(sint32 px, sint32 py) { - if (!_Pointer) return; + if (!CWidgetManager::getInstance()->getPointer()) return; uint32 nScrW, nScrH; _ViewRenderer.getScreenSize (nScrW, nScrH); clamp(px, 0, (sint32) nScrW); clamp(py, 0, (sint32) nScrH); // - _Pointer->setPointerPos (px, py); - _Pointer->setPointerDispPos (px, py); + CWidgetManager::getInstance()->getPointer()->setPointerPos (px, py); + CWidgetManager::getInstance()->getPointer()->setPointerDispPos (px, py); // getViewsUnder (px, py, _ViewsUnderPointer); getCtrlsUnder (px, py, _CtrlsUnderPointer); @@ -3609,7 +3596,7 @@ void CInterfaceManager::getCtrlsUnder (sint32 x, sint32 y, std::vectorhasModal() || CWidgetManager::getInstance()->getModal().ModalWindow == pIG || CWidgetManager::getInstance()->getModal().ModalExitClickOut) if (pIG->getActive() && pIG->getUseCursor()) { if (pIG->getCtrlsUnder (x, y, 0, 0, (sint32) sw, (sint32) sh, vICL)) @@ -3649,7 +3636,8 @@ void CInterfaceManager::getGroupsUnder (sint32 x, sint32 y, std::vectorhasModal() || CWidgetManager::getInstance()->getModal().ModalWindow == pIG || + CWidgetManager::getInstance()->getModal().ModalExitClickOut) if (pIG->getActive() && pIG->getUseCursor()) { if (pIG->isIn(x, y)) @@ -3666,323 +3654,10 @@ void CInterfaceManager::getGroupsUnder (sint32 x, sint32 y, std::vectorgetMasterGroupFromId (sMasterGroupName); - if (pIG != NULL) - { - pIG->setActive(bActive); - pIG->invalidateCoords(); - } -} - -// ------------------------------------------------------------------------------------------------ -CInterfaceGroup* CInterfaceManager::getWindow(CInterfaceElement *pIE) -{ - CInterfaceGroup *pIG = pIE->getParent(); - if (pIG == NULL) return NULL; - if (pIG->getParent() == NULL) return NULL; - while (pIG->getParent()->getParent() != NULL) - { - pIG = pIG->getParent(); - } - return pIG; -} - -// ------------------------------------------------------------------------------------------------ -CInterfaceElement* CInterfaceManager::getElementFromId (const std::string &sEltId) -{ - // System special - if(sEltId == _CtrlLaunchingModalId) - return getCtrlLaunchingModal(); - - std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = CWidgetManager::getInstance()->getAllMasterGroup(); - - // Search for all elements - for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) - { - CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; - CInterfaceElement *pIEL = rMG.Group->getElement (sEltId); - if (pIEL != NULL) - return pIEL; - } - return NULL; -} - // ------------------------------------------------------------------------------------------------ CInterfaceElement* CInterfaceManager::getElementFromDefine (const std::string &defineId) { - return getElementFromId(getDefine(defineId)); -} - -// ------------------------------------------------------------------------------------------------ -CInterfaceElement* CInterfaceManager::getElementFromId (const std::string &sStart, const std::string &sEltId) -{ - CInterfaceElement *pIEL = getElementFromId (sEltId); - if (pIEL == NULL) - { - string sZeStart = sStart, sTmp; - if (sZeStart[sZeStart.size()-1] == ':') - sZeStart = sZeStart.substr(0, sZeStart.size()-1); - - while (sZeStart != "") - { - if (sEltId[0] == ':') - sTmp = sZeStart + sEltId; - else - sTmp = sZeStart + ":" + sEltId; - pIEL = getElementFromId (sTmp); - if (pIEL != NULL) - return pIEL; - string::size_type nextPos = sZeStart.rfind(':'); - if (nextPos == string::npos) break; - sZeStart = sZeStart.substr(0, nextPos); - } - } - return pIEL; -} - -// ------------------------------------------------------------------------------------------------ -void CInterfaceManager::setTopWindow (CInterfaceGroup* win) -{ - std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = CWidgetManager::getInstance()->getAllMasterGroup(); - //find the window in the window list - for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) - { - CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; - if (rMG.Group->getActive()) - { - rMG.setTopWindow(win); -/* - for (list::iterator it = rMG.Windows.begin(); it != rMG.Windows.end() ;it++) - { - if (win == *it) - { - CInterfaceGroup* buf = *it; - - CInterfaceGroup* pIGLast = rMG.Windows.back(); - if (pIGLast != NULL) - { - CGroupContainer *pGC = dynamic_cast(pIGLast); - if (pGC != NULL) - { - pGC->setHighLighted(false,0); - } - } - - rMG.Windows.erase(it); - rMG.Windows.push_back(buf); - break; - } - } -*/ - } - } -} - -// ------------------------------------------------------------------------------------------------ -void CInterfaceManager::setBackWindow(CInterfaceGroup* win) -{ - std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = CWidgetManager::getInstance()->getAllMasterGroup(); - for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) - { - CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; - if (rMG.Group->getActive()) - { - rMG.setBackWindow(win); -/* - //find the window in the window list - for (list::iterator it = rMG.Windows.begin(); it != rMG.Windows.end() ;it++) - { - if (win == *it) - { - CInterfaceGroup* buf = *it; - rMG.Windows.erase(it); - rMG.Windows.push_front(buf); - break; - } - } -*/ - } - } -} - -// ------------------------------------------------------------------------------------------------ -CInterfaceGroup *CInterfaceManager::getTopWindow (uint8 nPriority) const -{ - std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = CWidgetManager::getInstance()->getAllMasterGroup(); - for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) - { - const CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; - if (rMG.Group->getActive()) - { - // return the first. - if(rMG.PrioritizedWindows[nPriority].empty()) - return NULL; - else - return rMG.PrioritizedWindows[nPriority].back(); - } - } - return NULL; -} - - -// ------------------------------------------------------------------------------------------------ -CInterfaceGroup *CInterfaceManager::getBackWindow (uint8 nPriority) const -{ - std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = CWidgetManager::getInstance()->getAllMasterGroup(); - for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) - { - const CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; - if (rMG.Group->getActive()) - { - // return the first. - if(rMG.PrioritizedWindows[nPriority].empty()) - return NULL; - else - return rMG.PrioritizedWindows[nPriority].front(); - } - } - return NULL; -} - -// ------------------------------------------------------------------------------------------------ -void CInterfaceManager::enableModalWindow (CCtrlBase *ctrlLaunchingModal, CInterfaceGroup *pIG) -{ - // disable any modal before. release keyboard - disableModalWindow(); - pushModalWindow(ctrlLaunchingModal, pIG); -} - -// ------------------------------------------------------------------------------------------------ -void CInterfaceManager::enableModalWindow (CCtrlBase *CtrlLaunchingModal, const std::string &groupName) -{ - CInterfaceGroup *group= dynamic_cast( getElementFromId(groupName) ); - if(group) - { - // enable the modal - enableModalWindow(CtrlLaunchingModal, group); - } -} - -// ------------------------------------------------------------------------------------------------ -void CInterfaceManager::disableModalWindow () -{ - while (!_ModalStack.empty()) - { - CModalWndInfo winInfo = _ModalStack.back(); - _ModalStack.pop_back(); // must pop back as early as possible because 'setActive' may trigger another 'popModalWindow', leading to a crash - // disable old modal window - if(winInfo.ModalWindow) - { - setBackWindow(winInfo.ModalWindow); - winInfo.ModalWindow->setActive(false); - } - } - - // disable any context help - _CurCtrlContextHelp = ""; - _DeltaTimeStopingContextHelp = 0; -} - -// ------------------------------------------------------------------------------------------------ -void CInterfaceManager::pushModalWindow(CCtrlBase *ctrlLaunchingModal, CInterfaceGroup *pIG) -{ - // enable the wanted modal - if(pIG) - { - CModalWndInfo mwi; - mwi.ModalWindow = pIG; - mwi.CtrlLaunchingModal = ctrlLaunchingModal; - // setup special group - CGroupModal *groupModal= dynamic_cast(pIG); - if(groupModal) - { - mwi.ModalExitClickOut = groupModal->ExitClickOut; - mwi.ModalExitClickL = groupModal->ExitClickL; - mwi.ModalExitClickR = groupModal->ExitClickR; - mwi.ModalHandlerClickOut = groupModal->OnClickOut; - mwi.ModalClickOutParams = groupModal->OnClickOutParams; - mwi.ModalExitKeyPushed = groupModal->ExitKeyPushed; - // update coords of the modal - if(groupModal->SpawnOnMousePos) - { - groupModal->SpawnMouseX = _Pointer->getX(); - groupModal->SpawnMouseY = _Pointer->getY(); - - } - } - else - { - // default for group not modal. Backward compatibility - mwi.ModalExitClickOut = false; - mwi.ModalExitClickL = false; - mwi.ModalExitClickR = false; - mwi.ModalExitKeyPushed = false; - } - - _ModalStack.push_back(mwi); - - // update coords and activate the modal - mwi.ModalWindow->invalidateCoords(); - mwi.ModalWindow->setActive(true); - setTopWindow(mwi.ModalWindow); - } -} - -// ------------------------------------------------------------------------------------------------ -void CInterfaceManager::pushModalWindow(CCtrlBase *ctrlLaunchingModal, const std::string &groupName) -{ - CInterfaceGroup *group= dynamic_cast( getElementFromId(groupName) ); - if(group) - { - // enable the modal - enableModalWindow(ctrlLaunchingModal, group); - } -} - -// ------------------------------------------------------------------------------------------------ -void CInterfaceManager::popModalWindow() -{ - if (!_ModalStack.empty()) - { - CModalWndInfo winInfo = _ModalStack.back(); - _ModalStack.pop_back(); // must pop back as early as possible because 'setActive' may trigger another 'popModalWindow', leading to a crash - if(winInfo.ModalWindow) - { - setBackWindow(winInfo.ModalWindow); - winInfo.ModalWindow->setActive(false); - } - if (!_ModalStack.empty()) - { - if(_ModalStack.back().ModalWindow) - { - _ModalStack.back().ModalWindow->setActive(true); - setTopWindow(_ModalStack.back().ModalWindow); - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -void CInterfaceManager::popModalWindowCategory(const std::string &category) -{ - for(;;) - { - if (_ModalStack.empty()) break; - if (!_ModalStack.back().ModalWindow) break; - CGroupModal *gm = dynamic_cast((CInterfaceGroup*)(_ModalStack.back().ModalWindow)); - if (gm && gm->Category == category) - { - _ModalStack.back().ModalWindow->setActive(false); - _ModalStack.pop_back(); - } - else - { - break; - } - } + return CWidgetManager::getInstance()->getElementFromId(getDefine(defineId)); } // ------------------------------------------------------------------------------------------------ @@ -4163,14 +3838,14 @@ void CInterfaceManager::stopAnim (const string &animId) // ------------------------------------------------------------------------------------------------ void CInterfaceManager::messageBoxInternal(const string &msgBoxGroup, const ucstring &text, const string &masterGroup, TCaseMode caseMode) { - CInterfaceGroup *group= dynamic_cast(getElementFromId(masterGroup+":" + msgBoxGroup)); - CViewText *viewText= dynamic_cast(getElementFromId(masterGroup+":" + msgBoxGroup + ":text")); + CInterfaceGroup *group= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(masterGroup+":" + msgBoxGroup)); + CViewText *viewText= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(masterGroup+":" + msgBoxGroup + ":text")); if (group && viewText) { viewText->setCaseMode(caseMode); viewText->setText(text); - enableModalWindow(NULL, group); + CWidgetManager::getInstance()->enableModalWindow(NULL, group); // don't understand why but need to update coords here group->updateCoords(); group->updateCoords(); @@ -4196,7 +3871,7 @@ void CInterfaceManager::messageBoxWithHelp(const ucstring &text, const std::stri // clicking 'ok' do not have any consequence, so allow exiting the message box by clicking // outside of it (this behavior is wanted on the login page, to allow to reclick on 'login' without // having to click 'ok' in the message box each time) - CInterfaceGroup *group= dynamic_cast(getElementFromId(masterGroup+":" + mbName)); + CInterfaceGroup *group= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(masterGroup+":" + mbName)); CGroupModal *gm = dynamic_cast(group); if (gm) { @@ -4210,9 +3885,9 @@ void CInterfaceManager::messageBoxWithHelp(const ucstring &text, const std::stri void CInterfaceManager::validMessageBox(TValidMessageIcon icon, const ucstring &text, const std::string &ahOnOk, const std::string ¶msOnOk, const std::string &ahOnCancel, const std::string ¶msOnCancel, const string &masterGroup) { - CInterfaceGroup *group= dynamic_cast(getElementFromId(masterGroup+":valid_message_box")); - CViewText *viewText= dynamic_cast(getElementFromId(masterGroup+":valid_message_box:text")); - CViewBitmap *viewBitmap= dynamic_cast(getElementFromId(masterGroup+":valid_message_box:icon_group:icon")); + CInterfaceGroup *group= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(masterGroup+":valid_message_box")); + CViewText *viewText= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(masterGroup+":valid_message_box:text")); + CViewBitmap *viewBitmap= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(masterGroup+":valid_message_box:icon_group:icon")); if (group && viewText) { @@ -4238,7 +3913,7 @@ void CInterfaceManager::validMessageBox(TValidMessageIcon icon, const ucstring & } // Go - enableModalWindow(NULL, group); + CWidgetManager::getInstance()->enableModalWindow(NULL, group); // don't understand why but need to update coords here group->updateCoords(); group->updateCoords(); @@ -4250,12 +3925,12 @@ void CInterfaceManager::validMessageBox(TValidMessageIcon icon, const ucstring & bool CInterfaceManager::getCurrentValidMessageBoxOnOk(string &ahOnOk, const std::string &masterGroup) { // any modal window opened? - CInterfaceGroup *mw= getModalWindow(); + CInterfaceGroup *mw= CWidgetManager::getInstance()->getModalWindow(); if(!mw) return false; // Is this modal window the valid_message_box window? - CInterfaceGroup *group= dynamic_cast(getElementFromId(masterGroup+":valid_message_box")); + CInterfaceGroup *group= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(masterGroup+":valid_message_box")); if(mw==group) { // Ok, get the current procedure OnOk action @@ -4278,8 +3953,8 @@ void CInterfaceManager::setContextHelpText(const ucstring &text) // ------------------------------------------------------------------------------------------------ void CInterfaceManager::disableContextHelp() { - _CurCtrlContextHelp = ""; - _DeltaTimeStopingContextHelp = 0; + CWidgetManager::getInstance()->setCurContextHelp( NULL ); + CWidgetManager::getInstance()->_DeltaTimeStopingContextHelp = 0; } // ------------------------------------------------------------------------------------------------ @@ -4287,7 +3962,7 @@ void CInterfaceManager::disableContextHelpForControl(CCtrlBase *pCtrl) { if(!pCtrl) return; - if(_CurCtrlContextHelp == pCtrl ) + if( CWidgetManager::getInstance()->getCurContextHelp() == pCtrl ) disableContextHelp(); } @@ -4387,7 +4062,7 @@ void CInterfaceManager::enableMouseHandling(bool handle) _MouseHandlingEnabled= handle; if(!handle) { - if(!_Pointer) + if(!CWidgetManager::getInstance()->getPointer()) return; // If Left captured, reset @@ -4403,7 +4078,7 @@ void CInterfaceManager::enableMouseHandling(bool handle) } // Avoid any problem with modals - disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } } @@ -4492,7 +4167,7 @@ void CInterfaceManager::launchContextMenuInGame (const std::string &nameOfCM) // Launch the context menu in-game: can't appear while dragging an item if (CDBCtrlSheet::getDraggedSheet() == NULL) { - if (_ModalStack.empty()) + if ( !CWidgetManager::getInstance()->hasModal() ) { // We must be in-game ! CInterfaceGroup *pMG = CWidgetManager::getInstance()->getMasterGroupFromId("ui:interface"); @@ -4507,11 +4182,11 @@ void CInterfaceManager::launchContextMenuInGame (const std::string &nameOfCM) } if ((pMG != NULL) && (pMG->getActive())) { - CInterfaceElement *pIE = getElementFromId(nameOfCM); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(nameOfCM); CInterfaceGroup *pIG = dynamic_cast(pIE); if (pIG != NULL) { - enableModalWindow (NULL, pIG); + CWidgetManager::getInstance()->enableModalWindow (NULL, pIG); } } } @@ -4617,7 +4292,7 @@ void CInterfaceManager::setMode(uint8 newMode) // if this GC is a Full modal window, or if it is a modal son of another GC, if (pGC->isModal() || pGC->isModalSon()) { - setTopWindow(pGC); + CWidgetManager::getInstance()->setTopWindow(pGC); pGC->enableBlink(2); return; } @@ -4890,49 +4565,6 @@ bool CInterfaceManager::saveKeys(const std::string &filename) return ret; } -// *************************************************************************** -CInterfaceGroup *CInterfaceManager::getLastEscapableTopWindow() const -{ - std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = CWidgetManager::getInstance()->getAllMasterGroup(); - for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) - { - const CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; - if (rMG.Group->getActive()) - { - for (uint8 nPriority = WIN_PRIORITY_MAX; nPriority > 0; nPriority--) - { - const list &rList = rMG.PrioritizedWindows[nPriority-1]; - list::const_reverse_iterator it; - it= rList.rbegin(); - for(;it!=rList.rend();it++) - { - if((*it)->getActive() && (*it)->getEscapable()) - return *it; - } - } - } - } - return NULL; -} - -// *************************************************************************** -void CInterfaceManager::setWindowPriority (CInterfaceGroup *pWin, uint8 nNewPriority) -{ - std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = CWidgetManager::getInstance()->getAllMasterGroup(); - for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) - { - CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; - if (rMG.Group->getActive()) - { - if (rMG.isWindowPresent(pWin)) - { - rMG.delWindow(pWin); - rMG.addWindow(pWin, nNewPriority); - } - } - } -} - // *************************************************************************** bool CInterfaceManager::deletePlayerConfig (const std::string &playerFileIdent) { @@ -5007,27 +4639,11 @@ void CInterfaceManager::restoreAllContainersBackupPosition() } -// *************************************************************************** -uint8 CInterfaceManager::getLastTopWindowPriority() const -{ - std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = CWidgetManager::getInstance()->getAllMasterGroup(); - for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) - { - const CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; - if (rMG.Group->getActive()) - { - return rMG.LastTopWindowPriority; - } - } - return 0; -} - - // *************************************************************************** void CInterfaceManager::removeRefOnCtrl (CCtrlBase *ctrlBase) { - if (_CurCtrlContextHelp == ctrlBase) - _CurCtrlContextHelp = ""; + if ( CWidgetManager::getInstance()->getCurContextHelp() == ctrlBase) + CWidgetManager::getInstance()->setCurContextHelp( NULL ); if (getCapturePointerLeft() == ctrlBase) setCapturePointerLeft(NULL); if (getCapturePointerRight() == ctrlBase) @@ -5264,7 +4880,7 @@ NLMISC_COMMAND(loadui, "Load an interface file", "") // *************************************************************************** void CInterfaceManager::displayWebWindow(const string & name, const string & url) { - CInterfaceGroup *pIG = dynamic_cast(getElementFromId(name)); + CInterfaceGroup *pIG = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(name)); if (pIG != NULL) { pIG->setActive(true); @@ -5413,7 +5029,7 @@ void CInterfaceManager::initEmotes() if (sName[i] == '|') nbToken++; - CGroupMenu *pRootMenu = dynamic_cast(pIM->getElementFromId("ui:interface:user_chat_emote_menu")); + CGroupMenu *pRootMenu = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:user_chat_emote_menu")); nlassert(pRootMenu); CGroupSubMenu *pMenu = pRootMenu->getRootMenu(); @@ -5539,7 +5155,7 @@ void CInterfaceManager::uninitEmotes() // get the emotes menu CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupMenu *pRootMenu = dynamic_cast(pIM->getElementFromId("ui:interface:game_context_menu")); + CGroupMenu *pRootMenu = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:game_context_menu")); if( pRootMenu ) { CGroupSubMenu *pMenu = pRootMenu->getRootMenu(); @@ -5656,7 +5272,7 @@ void CInterfaceManager::resetTextIndex() CInterfaceElement *getInterfaceResource(const std::string &key) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - return pIM->getElementFromId (key); + return CWidgetManager::getInstance()->getElementFromId (key); } diff --git a/code/ryzom/client/src/interface_v3/interface_manager.h b/code/ryzom/client/src/interface_v3/interface_manager.h index 66c7a7987..ac8e9b408 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.h +++ b/code/ryzom/client/src/interface_v3/interface_manager.h @@ -247,42 +247,8 @@ public: * NB: "ctrl_launch_modal" is a special Id which return the last ctrl which has launch a modal. NULL if modal closed. * \param groupId : the Id of the window group */ - CInterfaceElement* getElementFromId (const std::string &sEltId); - CInterfaceElement* getElementFromId (const std::string &sStart, const std::string &sEltId); - void activateMasterGroup (const std::string &sMasterGroupName, bool bActive); /// get an element from a define ID. shortcut for getElementFromId(getDefine(define)) CInterfaceElement* getElementFromDefine (const std::string &defineId); - /// Get the window from an element (ui:interface:###) - CInterfaceGroup* getWindow(CInterfaceElement*); - /** - * set the top window - * \param win : pointer to the window to be set on top - */ - void setTopWindow (CInterfaceGroup *pWin); - - /** - * set the back window - * \param win : pointer to the window to be set on top - */ - void setBackWindow (CInterfaceGroup *pWin); - - /** get the top window in the first activated masterGroup - */ - CInterfaceGroup *getTopWindow (uint8 nPriority = WIN_PRIORITY_NORMAL) const; - - /** get the back window in the first activated masterGroup - */ - CInterfaceGroup *getBackWindow (uint8 nPriority = WIN_PRIORITY_NORMAL) const; - - /** get the last escapable top window in the first activated masterGroup - */ - CInterfaceGroup *getLastEscapableTopWindow() const; - - void setWindowPriority (CInterfaceGroup *pWin, uint8 nPriority); - - /** return the priority of the Last Window setTopWindow()-ed. - */ - uint8 getLastTopWindowPriority() const; /// Control specific @@ -305,30 +271,6 @@ public: * NB : the keyboard capture is released on both calls. * NB : cascaded modal windows are disabled by the call */ - void enableModalWindow (CCtrlBase *ctrlLaunchingModal, CInterfaceGroup *pIG); - void enableModalWindow (CCtrlBase *ctrlLaunchingModal, const std::string &groupName); - // Disable all modals windows - void disableModalWindow (); - - /** Push a modal window that becomes the current modal window - */ - void pushModalWindow(CCtrlBase *ctrlLaunchingModal, CInterfaceGroup *pIG); - void pushModalWindow (CCtrlBase *ctrlLaunchingModal, const std::string &groupName); - void popModalWindow(); - // pop all top modal windows with the given category (a string stored in the modal) - void popModalWindowCategory(const std::string &category); - - CCtrlBase *getCtrlLaunchingModal () - { - if (_ModalStack.empty()) return NULL; - return _ModalStack.back().CtrlLaunchingModal; - } - /// get the currently active modal window, or NULL if none - CInterfaceGroup *getModalWindow() const - { - if (_ModalStack.empty()) return NULL; - return _ModalStack.back().ModalWindow; - } /// Handle The Event. return true if the interfaceManager catch it and if must not send to the Game Action Manager @@ -379,9 +321,6 @@ public: uint8 getGlobalRolloverFactorContainer() const { return _GlobalRolloverFactorContainer; } - /// Pointer - CViewPointer *getPointer () { return _Pointer; } - // Relative move of pointer void movePointer (sint32 dx, sint32 dy); // Set absolute coordinates of pointer @@ -770,33 +709,6 @@ private: void buildRecursLocalLeaves(NLMISC::CCDBNodeBranch *branch, std::vector &leaves); }; - // Infos about a modal window. - class CModalWndInfo - { - public: - // Yoyo: store as CRefPtr in case they are deleted (can happen for instance if menu right click on a guild memeber, and guild members are udpated after) - NLMISC::CRefPtr ModalWindow; // the current modal window - NLMISC::CRefPtr CtrlLaunchingModal; - bool ModalClip; - bool ModalExitClickOut; - bool ModalExitClickL; - bool ModalExitClickR; - bool ModalExitKeyPushed; - std::string ModalHandlerClickOut; - std::string ModalClickOutParams; - public: - CModalWndInfo() - { - ModalWindow = NULL; - CtrlLaunchingModal= NULL; - ModalExitClickOut= false; - ModalExitClickL= false; - ModalExitClickR= false; - ModalExitKeyPushed= false; - } - }; - - // Database management stuff class CDBLandmarkObs : public NLMISC::ICDBNode::IPropertyObserver { @@ -883,10 +795,6 @@ private: NLMISC::CRefPtr _CapturePointerRight; bool _MouseOverWindow; - std::vector _ModalStack; - static std::string _CtrlLaunchingModalId; - - // view that should be notified from clock msg std::vector _ClockMsgTargets; @@ -898,8 +806,7 @@ private: // Context Help bool _ContextHelpActive; - CCtrlBasePtr _CurCtrlContextHelp; - float _DeltaTimeStopingContextHelp; + //CCtrlBasePtr _CurCtrlContextHelp; //Delay before displaying ContextHelp on a ctrl having wantInstantContextHelp set to false (in seconds) float _MaxTimeStopingContextHelp; sint _LastXContextHelp; diff --git a/code/ryzom/client/src/interface_v3/interface_parser.cpp b/code/ryzom/client/src/interface_v3/interface_parser.cpp index fa27fa060..4c225ddf5 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.cpp +++ b/code/ryzom/client/src/interface_v3/interface_parser.cpp @@ -299,17 +299,12 @@ private: // ---------------------------------------------------------------------------- CInterfaceParser::CInterfaceParser() { - _Pointer= NULL; - // LUA _LuaState= NULL; } CInterfaceParser::~CInterfaceParser() { -// delete _Pointer; - _Pointer = NULL; - //delete _LuaState; _LuaState = NULL; } /** Convert a string into a memstream @@ -1745,7 +1740,7 @@ bool CInterfaceParser::parseView(xmlNodePtr cur, CInterfaceGroup * parentGroup, if ( !strcmp(ptr,"pointer")) { - _Pointer = dynamic_cast(view); + CWidgetManager::getInstance()->setPointer( dynamic_cast(view) ); } //nlinfo("view type %s mem : %d",ptr,view->getMemory()); @@ -3491,7 +3486,7 @@ CInterfaceElement *CInterfaceParser::createUIElement(const std::string &template } CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CInterfaceElement *pIE= pIM->getElementFromId(parentID); + CInterfaceElement *pIE= CWidgetManager::getInstance()->getElementFromId(parentID); CInterfaceGroup * parentGroup = dynamic_cast(pIE); if(!parentGroup) diff --git a/code/ryzom/client/src/interface_v3/interface_parser.h b/code/ryzom/client/src/interface_v3/interface_parser.h index 81da7731c..650e60cb9 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.h +++ b/code/ryzom/client/src/interface_v3/interface_parser.h @@ -248,8 +248,6 @@ protected: * Data of initialized interface */ - CViewPointer *_Pointer; - // Options description std::map > _OptionsMap; diff --git a/code/ryzom/client/src/interface_v3/inventory_manager.cpp b/code/ryzom/client/src/interface_v3/inventory_manager.cpp index 7069d2a12..bb959f0ba 100644 --- a/code/ryzom/client/src/interface_v3/inventory_manager.cpp +++ b/code/ryzom/client/src/interface_v3/inventory_manager.cpp @@ -331,44 +331,44 @@ void CInventoryManager::init() DNDCurrentItem = NULL; DNDFrom = Nowhere; // Initialize interface part - UIHands[0] = dynamic_cast(im->getElementFromId(CTRL_HAND_RIGHT)); - UIHands[1] = dynamic_cast(im->getElementFromId(CTRL_HAND_LEFT)); + UIHands[0] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_HAND_RIGHT)); + UIHands[1] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_HAND_LEFT)); - UIEquip[SLOT_EQUIPMENT::HEADDRESS] = dynamic_cast(im->getElementFromId(CTRL_JEWEL_HEADDRESS)); - UIEquip[SLOT_EQUIPMENT::EARL] = dynamic_cast(im->getElementFromId(CTRL_JEWEL_EARING_LEFT)); - UIEquip[SLOT_EQUIPMENT::EARR] = dynamic_cast(im->getElementFromId(CTRL_JEWEL_EARING_RIGHT)); - UIEquip[SLOT_EQUIPMENT::NECKLACE] = dynamic_cast(im->getElementFromId(CTRL_JEWEL_NECK)); - UIEquip[SLOT_EQUIPMENT::WRISTL] = dynamic_cast(im->getElementFromId(CTRL_JEWEL_BRACELET_LEFT)); - UIEquip[SLOT_EQUIPMENT::WRISTR] = dynamic_cast(im->getElementFromId(CTRL_JEWEL_BRACELET_RIGHT)); - UIEquip[SLOT_EQUIPMENT::FINGERL] = dynamic_cast(im->getElementFromId(CTRL_JEWEL_RING_LEFT)); - UIEquip[SLOT_EQUIPMENT::FINGERR] = dynamic_cast(im->getElementFromId(CTRL_JEWEL_RING_RIGHT)); - UIEquip[SLOT_EQUIPMENT::ANKLEL] = dynamic_cast(im->getElementFromId(CTRL_JEWEL_ANKLET_LEFT)); - UIEquip[SLOT_EQUIPMENT::ANKLER] = dynamic_cast(im->getElementFromId(CTRL_JEWEL_ANKLET_RIGHT)); + UIEquip[SLOT_EQUIPMENT::HEADDRESS] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWEL_HEADDRESS)); + UIEquip[SLOT_EQUIPMENT::EARL] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWEL_EARING_LEFT)); + UIEquip[SLOT_EQUIPMENT::EARR] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWEL_EARING_RIGHT)); + UIEquip[SLOT_EQUIPMENT::NECKLACE] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWEL_NECK)); + UIEquip[SLOT_EQUIPMENT::WRISTL] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWEL_BRACELET_LEFT)); + UIEquip[SLOT_EQUIPMENT::WRISTR] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWEL_BRACELET_RIGHT)); + UIEquip[SLOT_EQUIPMENT::FINGERL] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWEL_RING_LEFT)); + UIEquip[SLOT_EQUIPMENT::FINGERR] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWEL_RING_RIGHT)); + UIEquip[SLOT_EQUIPMENT::ANKLEL] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWEL_ANKLET_LEFT)); + UIEquip[SLOT_EQUIPMENT::ANKLER] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWEL_ANKLET_RIGHT)); - UIEquip[SLOT_EQUIPMENT::HEAD] = dynamic_cast(im->getElementFromId(CTRL_ARMOR_HEAD)); - UIEquip[SLOT_EQUIPMENT::CHEST] = dynamic_cast(im->getElementFromId(CTRL_ARMOR_CHEST)); - UIEquip[SLOT_EQUIPMENT::ARMS] = dynamic_cast(im->getElementFromId(CTRL_ARMOR_ARMS)); - UIEquip[SLOT_EQUIPMENT::FEET] = dynamic_cast(im->getElementFromId(CTRL_ARMOR_FEET)); - UIEquip[SLOT_EQUIPMENT::LEGS] = dynamic_cast(im->getElementFromId(CTRL_ARMOR_LEGS)); - UIEquip[SLOT_EQUIPMENT::HANDS] = dynamic_cast(im->getElementFromId(CTRL_ARMOR_HANDS)); + UIEquip[SLOT_EQUIPMENT::HEAD] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMOR_HEAD)); + UIEquip[SLOT_EQUIPMENT::CHEST] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMOR_CHEST)); + UIEquip[SLOT_EQUIPMENT::ARMS] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMOR_ARMS)); + UIEquip[SLOT_EQUIPMENT::FEET] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMOR_FEET)); + UIEquip[SLOT_EQUIPMENT::LEGS] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMOR_LEGS)); + UIEquip[SLOT_EQUIPMENT::HANDS] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMOR_HANDS)); - UIEquip2[SLOT_EQUIPMENT::HEADDRESS] = dynamic_cast(im->getElementFromId(CTRL_JEWL2_HEADDRESS)); - UIEquip2[SLOT_EQUIPMENT::EARL] = dynamic_cast(im->getElementFromId(CTRL_JEWL2_EARING_LEFT)); - UIEquip2[SLOT_EQUIPMENT::EARR] = dynamic_cast(im->getElementFromId(CTRL_JEWL2_EARING_RIGHT)); - UIEquip2[SLOT_EQUIPMENT::NECKLACE] = dynamic_cast(im->getElementFromId(CTRL_JEWL2_NECK)); - UIEquip2[SLOT_EQUIPMENT::WRISTL] = dynamic_cast(im->getElementFromId(CTRL_JEWL2_BRACELET_LEFT)); - UIEquip2[SLOT_EQUIPMENT::WRISTR] = dynamic_cast(im->getElementFromId(CTRL_JEWL2_BRACELET_RIGHT)); - UIEquip2[SLOT_EQUIPMENT::FINGERL] = dynamic_cast(im->getElementFromId(CTRL_JEWL2_RING_LEFT)); - UIEquip2[SLOT_EQUIPMENT::FINGERR] = dynamic_cast(im->getElementFromId(CTRL_JEWL2_RING_RIGHT)); - UIEquip2[SLOT_EQUIPMENT::ANKLEL] = dynamic_cast(im->getElementFromId(CTRL_JEWL2_ANKLET_LEFT)); - UIEquip2[SLOT_EQUIPMENT::ANKLER] = dynamic_cast(im->getElementFromId(CTRL_JEWL2_ANKLET_RIGHT)); + UIEquip2[SLOT_EQUIPMENT::HEADDRESS] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_HEADDRESS)); + UIEquip2[SLOT_EQUIPMENT::EARL] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_EARING_LEFT)); + UIEquip2[SLOT_EQUIPMENT::EARR] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_EARING_RIGHT)); + UIEquip2[SLOT_EQUIPMENT::NECKLACE] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_NECK)); + UIEquip2[SLOT_EQUIPMENT::WRISTL] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_BRACELET_LEFT)); + UIEquip2[SLOT_EQUIPMENT::WRISTR] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_BRACELET_RIGHT)); + UIEquip2[SLOT_EQUIPMENT::FINGERL] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_RING_LEFT)); + UIEquip2[SLOT_EQUIPMENT::FINGERR] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_RING_RIGHT)); + UIEquip2[SLOT_EQUIPMENT::ANKLEL] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_ANKLET_LEFT)); + UIEquip2[SLOT_EQUIPMENT::ANKLER] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_ANKLET_RIGHT)); - UIEquip2[SLOT_EQUIPMENT::HEAD] = dynamic_cast(im->getElementFromId(CTRL_ARMR2_HEAD)); - UIEquip2[SLOT_EQUIPMENT::CHEST] = dynamic_cast(im->getElementFromId(CTRL_ARMR2_CHEST)); - UIEquip2[SLOT_EQUIPMENT::ARMS] = dynamic_cast(im->getElementFromId(CTRL_ARMR2_ARMS)); - UIEquip2[SLOT_EQUIPMENT::FEET] = dynamic_cast(im->getElementFromId(CTRL_ARMR2_FEET)); - UIEquip2[SLOT_EQUIPMENT::LEGS] = dynamic_cast(im->getElementFromId(CTRL_ARMR2_LEGS)); - UIEquip2[SLOT_EQUIPMENT::HANDS] = dynamic_cast(im->getElementFromId(CTRL_ARMR2_HANDS)); + UIEquip2[SLOT_EQUIPMENT::HEAD] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMR2_HEAD)); + UIEquip2[SLOT_EQUIPMENT::CHEST] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMR2_CHEST)); + UIEquip2[SLOT_EQUIPMENT::ARMS] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMR2_ARMS)); + UIEquip2[SLOT_EQUIPMENT::FEET] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMR2_FEET)); + UIEquip2[SLOT_EQUIPMENT::LEGS] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMR2_LEGS)); + UIEquip2[SLOT_EQUIPMENT::HANDS] = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_ARMR2_HANDS)); // Init ItemInfoObservers @@ -662,7 +662,7 @@ static void grayItem (const std::string &listname, sint32 bagEntryIndex, bool gr { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - IListSheetBase *pList = dynamic_cast(pIM->getElementFromId(listname)); + IListSheetBase *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(listname)); if (pList != NULL) { @@ -787,7 +787,7 @@ void CInventoryManager::equip(const std::string &bagPath, const std::string &inv sint16 oldRightIndexInBag = NLGUI::CDBManager::getInstance()->getDbProp(invPath + ":INDEX_IN_BAG")->getValue16(); if (inventory == INVENTORIES::handling && invSlot == 0) { - CDBCtrlSheet *pCSLeftHand = dynamic_cast(pIM->getElementFromId(CTRL_HAND_LEFT)); + CDBCtrlSheet *pCSLeftHand = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_HAND_LEFT)); if (pCSLeftHand == NULL) { return; @@ -919,7 +919,7 @@ void CInventoryManager::unequip(const std::string &invPath) // Hands management : check if we have to unequip left hand because of incompatibility with right hand item if (inventory == INVENTORIES::handling && invSlot == 0) { - CDBCtrlSheet *pCSLeftHand = dynamic_cast(pIM->getElementFromId(CTRL_HAND_LEFT)); + CDBCtrlSheet *pCSLeftHand = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_HAND_LEFT)); if (pCSLeftHand == NULL) { return; @@ -1073,8 +1073,8 @@ void CInventoryManager::CDBEquipObs::update(ICDBNode* node) else return; // Set database for wearing the right item - CDBCtrlSheet *pCS = dynamic_cast(pIM->getElementFromId(sIE)); - CDBCtrlSheet *pCS2 = dynamic_cast(pIM->getElementFromId(sIE2)); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sIE)); + CDBCtrlSheet *pCS2 = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sIE2)); // Remove Last reference and update database sint16 oldVal = pNL->getOldValue16(); @@ -1105,7 +1105,7 @@ void CInventoryManager::CDBEquipObs::update(ICDBNode* node) if (sIE == CTRL_HAND_RIGHT) { // if nothing in left hand -> return - CDBCtrlSheet *pCSLeftHand = dynamic_cast(pIM->getElementFromId(CTRL_HAND_LEFT)); + CDBCtrlSheet *pCSLeftHand = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_HAND_LEFT)); if (pCSLeftHand == NULL) { return; @@ -1184,7 +1184,7 @@ void CInventoryManager::CDBEquipObs::update(ICDBNode* node) // left hand item is changing if (sIE == CTRL_HAND_LEFT) { - CDBCtrlSheet *pCSLeftHand = dynamic_cast(pIM->getElementFromId(CTRL_HAND_LEFT)); + CDBCtrlSheet *pCSLeftHand = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_HAND_LEFT)); if ( pCSLeftHand ) { CViewRenderer &rVR = pIM->getViewRenderer(); @@ -1196,7 +1196,7 @@ void CInventoryManager::CDBEquipObs::update(ICDBNode* node) { // check if we clear display (have to manage 2 hands weapons for instance) bool clearLeftHandDisplay = true; - CDBCtrlSheet * pCSRightHand = dynamic_cast(pIM->getElementFromId(CTRL_HAND_RIGHT)); + CDBCtrlSheet * pCSRightHand = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_HAND_RIGHT)); if ( pCSRightHand && pCSRightHand->getSheetId() ) { CCDBNodeLeaf *pNL3 = NLGUI::CDBManager::getInstance()->getDbProp(LOCAL_INVENTORY ":HAND:0:INDEX_IN_BAG", false); @@ -1272,7 +1272,7 @@ bool CInventoryManager::autoEquip(sint bagEntryIndex, bool allowReplace) uint i; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - IListSheetBase *pList = dynamic_cast(pIM->getElementFromId(LIST_BAG_TEXT)); + IListSheetBase *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_BAG_TEXT)); CDBCtrlSheet *pCSSrc = NULL; if (pList == NULL) return false; @@ -1705,7 +1705,7 @@ void CTempInvManager::update() _Mode = (TEMP_INV_MODE::TInventoryMode)NLGUI::CDBManager::getInstance()->getDbProp("LOCAL:INVENTORY:TEMP:TYPE")->getValue8(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(WIN_TEMPINV)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_TEMPINV)); if (pGC == NULL) return; @@ -1774,7 +1774,7 @@ void CTempInvManager::updateType() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); _Mode = (TEMP_INV_MODE::TInventoryMode)NLGUI::CDBManager::getInstance()->getDbProp("LOCAL:INVENTORY:TEMP:TYPE")->getValue8(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(WIN_TEMPINV)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_TEMPINV)); // Something arrived, change text switch(_Mode) { @@ -1837,7 +1837,7 @@ void CTempInvManager::updateForageQQ( uint whichOne ) ucstring title = CI18N::get( WIN_TEMPINV_TITLE_FORAGING ); strFindReplace( title, "%qt", toString( "%.1f", qt ) ); strFindReplace( title, "%ql", toString( "%.1f", ql ) ); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(WIN_TEMPINV)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_TEMPINV)); pGC->setUCTitle( title ); } @@ -1849,7 +1849,7 @@ void CTempInvManager::open(TEMP_INV_MODE::TInventoryMode m) { _Mode = m; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(WIN_TEMPINV)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_TEMPINV)); // In Foraging mode, we can call open() on the inventory with the same contents (e.g. when changing Forage action) if ( _Mode != TEMP_INV_MODE::Forage ) @@ -1902,7 +1902,7 @@ void CTempInvManager::close() pNL->setValue32(0); } - CInterfaceGroup *pIG = dynamic_cast(pIM->getElementFromId(WIN_TEMPINV)); + CInterfaceGroup *pIG = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_TEMPINV)); if (pIG != NULL) { pIG->setActive(false); @@ -1914,7 +1914,7 @@ void CTempInvManager::close() bool CTempInvManager::isOpened() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(WIN_TEMPINV)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_TEMPINV)); if (pGC != NULL) return pGC->getActive(); return false; @@ -2313,7 +2313,7 @@ bool CDBGroupListSheetFilterCLMSlot::CSheetChildFilter::isSheetValid(CDBGroupLis Plus the ChildControl must not be locked */ CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBCtrlSheet *clmCtrl = dynamic_cast(pIM->getCtrlLaunchingModal()); + CDBCtrlSheet *clmCtrl = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (!clmCtrl || !Ctrl) return false; if (clmCtrl->getInventoryIndex() == INVENTORIES::exchange && Ctrl->getInventoryIndex() == INVENTORIES::exchange) @@ -2467,7 +2467,7 @@ class CHandlerInvCanDropTo : public IActionHandler CInterfaceManager *pIM = CInterfaceManager::getInstance(); string src = getParam(Params, "src"); - CInterfaceElement *pElt = pIM->getElementFromId(src); + CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src); CDBCtrlSheet *pCSSrc = dynamic_cast(pElt); if (pCSSrc == NULL) return; // Cannot do anything if the incoming sheet is not a sheet @@ -2618,14 +2618,14 @@ class CHandlerInvDropTo : public IActionHandler // To prevent other things to happens if (!getInventory().isDragging()) { - CInterfaceGroup *pIG = pIM->getModalWindow(); + CInterfaceGroup *pIG = CWidgetManager::getInstance()->getModalWindow(); if (pIG == NULL) return; if (pIG->getId() != "ui:interface:bag_choose") return; getInventory().beginDrag(NULL, CInventoryManager::TextList); // Special case for choose in bag dialog string src = getParam(Params, "src"); - CInterfaceElement *pElt = pIM->getElementFromId(src); + CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src); CDBCtrlSheet *pCSSrc = dynamic_cast(pElt); CDBCtrlSheet *pCSDst = dynamic_cast(pCaller); @@ -2642,7 +2642,7 @@ class CHandlerInvDropTo : public IActionHandler } string src = getParam(Params, "src"); - CInterfaceElement *pElt = pIM->getElementFromId(src); + CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src); CDBCtrlSheet *pCSSrc = dynamic_cast(pElt); CDBCtrlSheet *pCSDst = dynamic_cast(pCaller); if (pCSSrc == NULL) return; @@ -3309,39 +3309,39 @@ void CInventoryManager::sortBag() CDBGroupIconListBag *pIconList; CDBGroupListSheetBag *pList; - pIconList = dynamic_cast(pIM->getElementFromId(LIST_BAG_ICONS)); + pIconList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_BAG_ICONS)); if (pIconList != NULL) pIconList->needToSort(); - pList = dynamic_cast(pIM->getElementFromId(LIST_BAG_TEXT)); + pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_BAG_TEXT)); if (pList != NULL) pList->needToSort(); - pIconList = dynamic_cast(pIM->getElementFromId(LIST_ROOM_ICONS)); + pIconList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_ROOM_ICONS)); if (pIconList != NULL) pIconList->needToSort(); - pList = dynamic_cast(pIM->getElementFromId(LIST_ROOM_TEXT)); + pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_ROOM_TEXT)); if (pList != NULL) pList->needToSort(); - pIconList = dynamic_cast(pIM->getElementFromId(LIST_GUILD_ICONS)); + pIconList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_GUILD_ICONS)); if (pIconList != NULL) pIconList->needToSort(); - pList = dynamic_cast(pIM->getElementFromId(LIST_GUILD_TEXT)); + pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_GUILD_TEXT)); if (pList != NULL) pList->needToSort(); - pIconList = dynamic_cast(pIM->getElementFromId(LIST_PA0_ICONS)); + pIconList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_PA0_ICONS)); if (pIconList != NULL) pIconList->needToSort(); - pList = dynamic_cast(pIM->getElementFromId(LIST_PA0_TEXT)); + pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_PA0_TEXT)); if (pList != NULL) pList->needToSort(); - pIconList = dynamic_cast(pIM->getElementFromId(LIST_PA1_ICONS)); + pIconList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_PA1_ICONS)); if (pIconList != NULL) pIconList->needToSort(); - pList = dynamic_cast(pIM->getElementFromId(LIST_PA1_TEXT)); + pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_PA1_TEXT)); if (pList != NULL) pList->needToSort(); - pIconList = dynamic_cast(pIM->getElementFromId(LIST_PA2_ICONS)); + pIconList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_PA2_ICONS)); if (pIconList != NULL) pIconList->needToSort(); - pList = dynamic_cast(pIM->getElementFromId(LIST_PA2_TEXT)); + pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_PA2_TEXT)); if (pList != NULL) pList->needToSort(); - pIconList = dynamic_cast(pIM->getElementFromId(LIST_PA3_ICONS)); + pIconList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_PA3_ICONS)); if (pIconList != NULL) pIconList->needToSort(); - pList = dynamic_cast(pIM->getElementFromId(LIST_PA3_TEXT)); + pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(LIST_PA3_TEXT)); if (pList != NULL) pList->needToSort(); } diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 430f53f0c..6c9ebb167 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -1019,7 +1019,7 @@ int CLuaIHMRyzom::getUI(CLuaState &ls) // return the element CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CInterfaceElement *pIE= pIM->getElementFromId(eltStr); + CInterfaceElement *pIE= CWidgetManager::getInstance()->getElementFromId(eltStr); if(!pIE) { ls.pushNil(); @@ -1504,7 +1504,7 @@ int CLuaIHMRyzom::setTopWindow(CLuaState &ls) CLuaIHM::fails(ls, "%s : interface group expected as arg 1", funcName); } CInterfaceManager *im = CInterfaceManager::getInstance(); - im->setTopWindow(wnd); + CWidgetManager::getInstance()->setTopWindow(wnd); return 0; } @@ -1739,7 +1739,7 @@ int CLuaIHMRyzom::initEmotesMenu(CLuaState &ls) betaTester = pSM->isTitleUnblocked(CHARACTER_TITLE::FBT); - CGroupMenu *pInitRootMenu = dynamic_cast(pIM->getElementFromId(emoteMenu)); + CGroupMenu *pInitRootMenu = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(emoteMenu)); pInitRootMenu->reset(); for (std::list::const_iterator it = entries.begin(); it != entries.end(); it++) @@ -1768,7 +1768,7 @@ int CLuaIHMRyzom::initEmotesMenu(CLuaState &ls) if (sName[i] == '|') nbToken++; - CGroupMenu *pRootMenu = dynamic_cast(pIM->getElementFromId(emoteMenu)); + CGroupMenu *pRootMenu = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(emoteMenu)); CGroupSubMenu *pMenu = pRootMenu->getRootMenu(); for (i = 0; i < nbToken; ++i) @@ -1999,13 +1999,13 @@ int CLuaIHMRyzom::enableModalWindow(CLuaState &ls) if(ctrl) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CInterfaceGroup *group= dynamic_cast( pIM->getElementFromId(modalId) ); + CInterfaceGroup *group= dynamic_cast( CWidgetManager::getInstance()->getElementFromId(modalId) ); if(group) { UserControls.stopFreeLook(); // enable the modal - pIM->enableModalWindow(ctrl, group); + CWidgetManager::getInstance()->enableModalWindow(ctrl, group); } else { @@ -2024,7 +2024,7 @@ int CLuaIHMRyzom::disableModalWindow(CLuaState &ls) //H_AUTO(Lua_CLuaIHM_disableModalWindow) CLuaIHM::checkArgCount(ls, "disableModalWindow", 0); CInterfaceManager *pIM= CInterfaceManager::getInstance(); - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); return 0; } @@ -2555,7 +2555,7 @@ int CLuaIHMRyzom::createRootGroupInstance(CLuaState &ls) result->setId("ui:interface:"+string(ls.toString(2))); result->updateCoords(); CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", result); - CInterfaceGroup *pRoot = dynamic_cast(im->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); result->setParent(pRoot); if (pRoot) pRoot->addGroup(result); @@ -3271,7 +3271,7 @@ void CLuaIHMRyzom::browseNpcWebPage(const std::string &htmlId, const std::string { //H_AUTO(Lua_CLuaIHM_browseNpcWebPage) CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CGroupHTML *groupHtml= dynamic_cast(pIM->getElementFromId(htmlId)); + CGroupHTML *groupHtml= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(htmlId)); if(groupHtml) { // if true, it means that we want to display a web page that use webig auth @@ -3343,7 +3343,7 @@ void CLuaIHMRyzom::clearHtmlUndoRedo(const std::string &htmlId) { //H_AUTO(Lua_CLuaIHM_clearHtmlUndoRedo) CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CGroupHTML *groupHtml= dynamic_cast(pIM->getElementFromId(htmlId)); + CGroupHTML *groupHtml= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(htmlId)); if(groupHtml) groupHtml->clearUndoRedo(); } @@ -3609,7 +3609,7 @@ void CLuaIHMRyzom::tell(const ucstring &player, const ucstring &msg) if (w->getContainer()) { w->getContainer()->setActive(true); - im->setTopWindow(w->getContainer()); + CWidgetManager::getInstance()->setTopWindow(w->getContainer()); } } } diff --git a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp index ebd96ec5b..4103026e1 100644 --- a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp +++ b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp @@ -237,7 +237,7 @@ public: for (uint i = 0; i < rCats.size(); ++i) { string contName = string(WIN_KEYS_GAME)+rCats[i].Name; - pGC = dynamic_cast(pIM->getElementFromId(contName)); + pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(contName)); if(pGC != NULL) { pGC->setX(0); @@ -259,8 +259,8 @@ public: for (uint i = 0; i < rCats.size(); ++i) { string contName = string(WIN_KEYS_GAME)+rCats[i].Name; - CInterfaceGroup *pCategory = dynamic_cast(pIM->getElementFromId(contName)); - CGroupList *pList = dynamic_cast(pIM->getElementFromId(contName + ":content")); + CInterfaceGroup *pCategory = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(contName)); + CGroupList *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(contName + ":content")); if (pCategory != NULL && pList != NULL) { pList->clearGroups(); @@ -317,9 +317,9 @@ public: pMCM->NewKey->CurrentEditCmdLine = pMCM->NewKey->AllLines[nLineNb]; pMCM->NewKey->CurAM = pMCM->ActionManagers[pMCM->NewKey->AllLines[nLineNb].ComboAM]; - CGroupModalGetKey*pGetKey = dynamic_cast(pIM->getElementFromId(WIN_MODAL_GET_KEY)); + CGroupModalGetKey*pGetKey = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_MODAL_GET_KEY)); pGetKey->Caller = "editkey"; - pIM->enableModalWindow(pCaller, WIN_MODAL_GET_KEY); + CWidgetManager::getInstance()->enableModalWindow(pCaller, WIN_MODAL_GET_KEY); } }; REGISTER_ACTION_HANDLER( CHandlerKeysAssign, "keys_assign"); @@ -433,11 +433,11 @@ void CModalContainerEditCmd::create(const std::string &name, bool bDefKey, bool WinName = "ui:interface:" + name; CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", Win); - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); Win->setParent(pRoot); pRoot->addGroup(Win); - CInterfaceGroup *pIG = dynamic_cast(pIM->getElementFromId(WinName+CTRL_EDITCMD_KEY_GROUP)); + CInterfaceGroup *pIG = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_KEY_GROUP)); if (pIG != NULL) pIG->setActive (CanDefineKey); } @@ -458,7 +458,7 @@ void CModalContainerEditCmd::activate() Win->launch(); // Initialisation of category combo box CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBGroupComboBox *pCB= dynamic_cast(pIM->getElementFromId( WinName+WIN_EDITCMD_COMBO_CATEGORY )); + CDBGroupComboBox *pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( WinName+WIN_EDITCMD_COMBO_CATEGORY )); if (pCB != NULL) { CurrentEditCmdCategories.clear(); @@ -493,7 +493,7 @@ void CModalContainerEditCmd::activate() } } // Clean up all actions - pCB= dynamic_cast(pIM->getElementFromId( WinName+WIN_EDITCMD_COMBO_ACTION )); + pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( WinName+WIN_EDITCMD_COMBO_ACTION )); if (pCB != NULL) pCB->resetTexts(); // Clean up CurAM = NULL; @@ -504,9 +504,9 @@ void CModalContainerEditCmd::activate() NLGUI::CDBManager::getInstance()->getDbProp( DbComboDisp1P )->setValue32(-1); NLGUI::CDBManager::getInstance()->getDbProp( DbComboDisp2P )->setValue32(-1); // reset name of params - CViewText *pViewParamName = dynamic_cast(pIM->getElementFromId(WinName+VIEW_EDITCMD_FIRST_PARAM_NAME)); + CViewText *pViewParamName = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_FIRST_PARAM_NAME)); if (pViewParamName != NULL) pViewParamName->setText (string("")); - pViewParamName = dynamic_cast(pIM->getElementFromId(WinName+VIEW_EDITCMD_SECOND_PARAM_NAME)); + pViewParamName = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_SECOND_PARAM_NAME)); if (pViewParamName != NULL) pViewParamName->setText (string("")); invalidCurrentCommand(); } @@ -579,13 +579,13 @@ void CModalContainerEditCmd::activateFrom (const std::string &cmdName, const std // Set category : Search the right category CDBGroupComboBox *pCB; - pCB = dynamic_cast(pIM->getElementFromId(WinName+WIN_EDITCMD_COMBO_CATEGORY)); + pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+WIN_EDITCMD_COMBO_CATEGORY)); pCB->setSelection(catCBIndex); onChangeCategory(); IngameDbMngr.flushObserverCalls(); NLGUI::CDBManager::getInstance()->flushObserverCalls(); //pIM->runActionHandler("editcmd_change_category",NULL); - pCB = dynamic_cast(pIM->getElementFromId(WinName+WIN_EDITCMD_COMBO_ACTION)); + pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+WIN_EDITCMD_COMBO_ACTION)); pCB->setSelection(actCBIndex); onChangeAction(); IngameDbMngr.flushObserverCalls(); @@ -658,7 +658,7 @@ void CModalContainerEditCmd::activateFrom (const std::string &cmdName, const std string sCombo; if (noParam == 0) sCombo = WinName+WIN_EDITCMD_COMBO_FIRST_PARAM_LIST; else sCombo = WinName+WIN_EDITCMD_COMBO_SECOND_PARAM_LIST; - pCB = dynamic_cast(pIM->getElementFromId(sCombo)); + pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sCombo)); pCB->setSelection(nPinCB); } } @@ -670,7 +670,7 @@ void CModalContainerEditCmd::activateFrom (const std::string &cmdName, const std string sEditBox; if (noParam == 0) sEditBox = WinName+WIN_EDITCMD_COMBO_FIRST_PARAM_EDITBOX; else sEditBox = WinName+WIN_EDITCMD_COMBO_SECOND_PARAM_EDITBOX; - CGroupEditBox *pEB = dynamic_cast(pIM->getElementFromId(sEditBox)); + CGroupEditBox *pEB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sEditBox)); // sTmp is utf8 pEB->setInputStringAsUtf8(sTmp); } @@ -681,7 +681,7 @@ void CModalContainerEditCmd::activateFrom (const std::string &cmdName, const std string sText; if (noParam == 0) sText = WinName+VIEW_EDITCMD_FIRST_PARAM_NAME; else sText = WinName+VIEW_EDITCMD_SECOND_PARAM_NAME; - CViewText *pVT = dynamic_cast(pIM->getElementFromId(sText)); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sText)); if (pVT != NULL) pVT->setText(CI18N::get(pBA->Parameters[i].LocalizedName)); noParam++; } @@ -693,7 +693,7 @@ void CModalContainerEditCmd::activateFrom (const std::string &cmdName, const std CActionsManager::TActionComboMap::const_iterator it = actionCombo.find(CurrentEditCmdLine.ActionName); // Deactive the key definition (we are in edit key mode) - CCtrlBaseButton *pBut = dynamic_cast(pIM->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_KEY)); + CCtrlBaseButton *pBut = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_KEY)); if (pBut != NULL) pBut->setActive(false); if (it != actionCombo.end()) @@ -701,13 +701,13 @@ void CModalContainerEditCmd::activateFrom (const std::string &cmdName, const std CurrentEditCmdLine.Combo = it->second; // Activate the key definer text - CViewText *pVT = dynamic_cast(pIM->getElementFromId(WinName+VIEW_EDITCMD_TEXT_KEY)); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_TEXT_KEY)); if (pVT != NULL) pVT->setActive(true); // setup the text of the key pVT->setText(it->second.toUCString()); // There is already a shortcut so we can display ok button - pBut = dynamic_cast(pIM->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); + pBut = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); if (pBut != NULL) pBut->setFrozen (false); } } @@ -770,20 +770,20 @@ void CModalContainerEditCmd::invalidCurrentCommand() if (CurrentEditCmdNb == -1) { // Dont display key shortcut if we are in creation mode - pVT= dynamic_cast(pIM->getElementFromId( WinName+VIEW_EDITCMD_TEXT_KEY )); + pVT= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( WinName+VIEW_EDITCMD_TEXT_KEY )); if (pVT != NULL) pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT)); // Deactivate the key definer text - pVT = dynamic_cast(pIM->getElementFromId(WinName+VIEW_EDITCMD_TEXT_KEY)); + pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_TEXT_KEY)); if (pVT != NULL) pVT->setActive(false); } // Deactivate the key definer button - CCtrlBaseButton *pCB = dynamic_cast(pIM->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_KEY)); + CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_KEY)); if (pCB != NULL) pCB->setActive(false); // Deactivate ok button - pCB = dynamic_cast(pIM->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); + pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); if (pCB != NULL) pCB->setFrozen (true); } @@ -853,7 +853,7 @@ void CModalContainerEditCmd::validCurrentCommand() string sWin; if (noParam == 0) sWin = WinName+WIN_EDITCMD_COMBO_FIRST_PARAM_EDITBOX; else sWin = WinName+WIN_EDITCMD_COMBO_SECOND_PARAM_EDITBOX; - CGroupEditBox *pEB= dynamic_cast(pIM->getElementFromId( sWin )); + CGroupEditBox *pEB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( sWin )); // convert to utf8 if (pEB != NULL) CurrentEditCmdLine.ActionName.Argu += pEB->getInputStringAsUtf8(); @@ -868,10 +868,10 @@ void CModalContainerEditCmd::validCurrentCommand() if (CurrentEditCmdNb == -1) { // Activate the key definer button - CCtrlBaseButton *pCB = dynamic_cast(pIM->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_KEY)); + CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_KEY)); if (pCB != NULL) pCB->setActive(true); // Activate the key definer text - CViewText *pVT = dynamic_cast(pIM->getElementFromId(WinName+VIEW_EDITCMD_TEXT_KEY)); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_TEXT_KEY)); if (pVT != NULL) pVT->setActive(true); // Does the command already exists ? const CActionsManager::TActionComboMap &actionCombo = pAM->getActionComboMap(); @@ -882,7 +882,7 @@ void CModalContainerEditCmd::validCurrentCommand() // Yes ok let setup the text of the key pVT->setText(it->second.toUCString()); // There is already a shortcut so we can display ok button - CCtrlBaseButton *pCB = dynamic_cast(pIM->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); + CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); if (pCB != NULL) pCB->setFrozen (false); } else @@ -892,13 +892,13 @@ void CModalContainerEditCmd::validCurrentCommand() // Display not assigned text pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT)); // Do not display the ok button - CCtrlBaseButton *pCB = dynamic_cast(pIM->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); + CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); if (pCB != NULL) pCB->setFrozen (true); } } else { - CCtrlBaseButton *pCB = dynamic_cast(pIM->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); + CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); if (pCB != NULL) pCB->setFrozen (false); } } @@ -906,7 +906,7 @@ void CModalContainerEditCmd::validCurrentCommand() // If we are in mode new command (from macro) just turn on the ok button if (WinName == "ui:interface:editcmd") { - CCtrlBaseButton *pCB = dynamic_cast(pIM->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); + CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+CTRL_EDITCMD_BUTTON_OK)); if (pCB != NULL) pCB->setFrozen(false); } } @@ -932,8 +932,8 @@ bool CModalContainerEditCmd::isParamValid (sint32 nParamIndex) else if (paramType == 1) { CGroupEditBox *pEB; - if (nParamIndex == 0) pEB = dynamic_cast(pIM->getElementFromId( WinName+WIN_EDITCMD_COMBO_FIRST_PARAM_EDITBOX )); - else pEB = dynamic_cast(pIM->getElementFromId( WinName+WIN_EDITCMD_COMBO_SECOND_PARAM_EDITBOX )); + if (nParamIndex == 0) pEB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId( WinName+WIN_EDITCMD_COMBO_FIRST_PARAM_EDITBOX )); + else pEB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId( WinName+WIN_EDITCMD_COMBO_SECOND_PARAM_EDITBOX )); if (pEB == NULL) return false; // no need to translate utf8 or not here @@ -1008,7 +1008,7 @@ void CModalContainerEditCmd::onChangeCategory() return; // Update the combo box of actions - CDBGroupComboBox *pCB= dynamic_cast(pIM->getElementFromId( WinName+WIN_EDITCMD_COMBO_ACTION )); + CDBGroupComboBox *pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( WinName+WIN_EDITCMD_COMBO_ACTION )); if( pCB ) { pCB->resetTexts(); @@ -1040,9 +1040,9 @@ void CModalContainerEditCmd::onChangeCategory() NLGUI::CDBManager::getInstance()->getDbProp( DbComboDisp2P )->setValue32(-1); // reset name of params CViewText *pViewParamName; - pViewParamName = dynamic_cast(pIM->getElementFromId(WinName+VIEW_EDITCMD_FIRST_PARAM_NAME)); + pViewParamName = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_FIRST_PARAM_NAME)); if (pViewParamName != NULL) pViewParamName->setText (string("")); - pViewParamName = dynamic_cast(pIM->getElementFromId(WinName+VIEW_EDITCMD_SECOND_PARAM_NAME)); + pViewParamName = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_SECOND_PARAM_NAME)); if (pViewParamName != NULL) pViewParamName->setText (string("")); // Reset key invalidCurrentCommand(); @@ -1078,9 +1078,9 @@ void CModalContainerEditCmd::onChangeAction() NLGUI::CDBManager::getInstance()->getDbProp( DbComboSel2P )->setValue32(-1); // reset name of params CViewText *pViewParamName; - pViewParamName = dynamic_cast(pIM->getElementFromId(WinName+VIEW_EDITCMD_FIRST_PARAM_NAME)); + pViewParamName = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_FIRST_PARAM_NAME)); if (pViewParamName != NULL) pViewParamName->setText (string("")); - pViewParamName = dynamic_cast(pIM->getElementFromId(WinName+VIEW_EDITCMD_SECOND_PARAM_NAME)); + pViewParamName = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WinName+VIEW_EDITCMD_SECOND_PARAM_NAME)); if (pViewParamName != NULL) pViewParamName->setText (string("")); uint noParam = 0; @@ -1102,7 +1102,7 @@ void CModalContainerEditCmd::onChangeAction() if (noParam == 0) sViewText = WinName+VIEW_EDITCMD_FIRST_PARAM_NAME; else sViewText = WinName+VIEW_EDITCMD_SECOND_PARAM_NAME; - pViewParamName = dynamic_cast(pIM->getElementFromId(sViewText)); + pViewParamName = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sViewText)); if (pViewParamName != NULL) pViewParamName->setText (CI18N::get(rP.LocalizedName)); } @@ -1112,7 +1112,7 @@ void CModalContainerEditCmd::onChangeAction() string sWin; if (noParam == 0) sWin = WinName+WIN_EDITCMD_COMBO_FIRST_PARAM_LIST; else sWin = WinName+WIN_EDITCMD_COMBO_SECOND_PARAM_LIST; - CDBGroupComboBox *pCB= dynamic_cast(pIM->getElementFromId( sWin )); + CDBGroupComboBox *pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( sWin )); if( pCB ) { pCB->resetTexts(); @@ -1138,7 +1138,7 @@ void CModalContainerEditCmd::onChangeAction() string sWin; if (noParam == 0) sWin = WinName+WIN_EDITCMD_COMBO_FIRST_PARAM_EDITBOX; else sWin = WinName+WIN_EDITCMD_COMBO_SECOND_PARAM_EDITBOX; - CGroupEditBox *pEB= dynamic_cast(pIM->getElementFromId( sWin )); + CGroupEditBox *pEB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( sWin )); if( pEB ) { pEB->setInputString(ucstring("")); @@ -1270,9 +1270,9 @@ public: { //checkCurrentCommandValidity(); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupModalGetKey*pGetKey = dynamic_cast(pIM->getElementFromId(WIN_MODAL_GET_KEY)); + CGroupModalGetKey*pGetKey = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_MODAL_GET_KEY)); pGetKey->Caller = Params; - pIM->enableModalWindow(pCaller, WIN_MODAL_GET_KEY); + CWidgetManager::getInstance()->enableModalWindow(pCaller, WIN_MODAL_GET_KEY); } }; REGISTER_ACTION_HANDLER( CHandlerEditCmdDefineKey, "editcmd_cmd_def_key"); @@ -1326,8 +1326,8 @@ public: { CInterfaceManager *pIM = CInterfaceManager::getInstance(); CMacroCmdManager *pMCM = CMacroCmdManager::getInstance(); - pIM->disableModalWindow(); - CGroupModalGetKey*pGetKey = dynamic_cast(pIM->getElementFromId(WIN_MODAL_GET_KEY)); + CWidgetManager::getInstance()->disableModalWindow(); + CGroupModalGetKey*pGetKey = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_MODAL_GET_KEY)); if (pGetKey == NULL) return; @@ -1346,10 +1346,10 @@ public: { pMCM->NewKey->CurrentEditCmdLine.Combo = pGetKey->Combo; - CViewText *pVT = dynamic_cast(pIM->getElementFromId(pMCM->NewKey->WinName+VIEW_EDITCMD_TEXT_KEY)); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(pMCM->NewKey->WinName+VIEW_EDITCMD_TEXT_KEY)); if (pVT != NULL) pVT->setText(pMCM->NewKey->CurrentEditCmdLine.Combo.toUCString()); - CCtrlBaseButton *pCB = dynamic_cast(pIM->getElementFromId(pMCM->NewKey->WinName+CTRL_EDITCMD_BUTTON_OK)); + CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(pMCM->NewKey->WinName+CTRL_EDITCMD_BUTTON_OK)); if (pCB != NULL) pCB->setFrozen (false); } @@ -1358,7 +1358,7 @@ public: { pMCM->EditCmd->CurrentEditCmdLine.Combo = pGetKey->Combo; pMCM->CurrentEditMacro.Combo = pMCM->EditCmd->CurrentEditCmdLine.Combo; - CViewText *pVT = dynamic_cast(pIM->getElementFromId(VIEW_NEWMACRO_KEY)); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(VIEW_NEWMACRO_KEY)); if (pVT != NULL) pVT->setText(pMCM->EditCmd->CurrentEditCmdLine.Combo.toUCString()); } } diff --git a/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp b/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp index 3effb37cd..47b770a10 100644 --- a/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp +++ b/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp @@ -580,7 +580,7 @@ public: CInterfaceManager *pIM = CInterfaceManager::getInstance(); string sTP = getParam(Params, "target"); if (sTP.empty()) return; - CDBCtrlSheet *pCS = dynamic_cast(pIM->getElementFromId(sTP)); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sTP)); sint32 nb; fromString(getParam(Params, "value"), nb); if (pCS != NULL) pCS->setMacroBack((uint8)nb); @@ -597,7 +597,7 @@ public: CInterfaceManager *pIM = CInterfaceManager::getInstance(); string sTP = getParam(Params, "target"); if (sTP.empty()) return; - CDBCtrlSheet *pCS = dynamic_cast(pIM->getElementFromId(sTP)); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sTP)); sint32 nb; fromString(getParam(Params, "value"), nb); if (pCS != NULL) pCS->setMacroIcon((uint8)nb); @@ -614,7 +614,7 @@ public: CInterfaceManager *pIM = CInterfaceManager::getInstance(); string sTP = getParam(Params, "target"); if (sTP.empty()) return; - CDBCtrlSheet *pCS = dynamic_cast(pIM->getElementFromId(sTP)); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sTP)); sint32 nb; fromString(getParam(Params, "value"), nb); if (pCS != NULL) pCS->setMacroOver((uint8)nb); @@ -632,7 +632,7 @@ public: CGroupEditBox *pEB = dynamic_cast(pCaller); if (pEB == NULL) return; - CDBCtrlSheet *pCS = dynamic_cast(pIM->getElementFromId(Params)); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(Params)); if (pCS == NULL) return; pCS->setMacroText(pEB->getInputStringAsStdString()); } @@ -649,13 +649,13 @@ public: CInterfaceManager *pIM = CInterfaceManager::getInstance(); CMacroCmdManager *pMCM = CMacroCmdManager::getInstance(); - CDBCtrlSheet *pCS = dynamic_cast(pIM->getElementFromId(CTRL_MACROICONCREATION_ICON)); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_MACROICONCREATION_ICON)); if (pCS != NULL) pCS->writeToMacro(pMCM->CurrentEditMacro); - pCS = dynamic_cast(pIM->getElementFromId(CTRL_NEWMACRO_ICON)); + pCS = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_NEWMACRO_ICON)); if (pCS != NULL) pCS->readFromMacro(pMCM->CurrentEditMacro); - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } }; REGISTER_ACTION_HANDLER( CHandlerMacroIconCreation, "macro_icon_creation_ok"); @@ -678,7 +678,7 @@ public: if (back != 0xff) { string sButton = string(GROUP_MACROICONCREATION_BACK) + CTRL_MACROICONCREATION_BUTTON + toString(back+1); - CCtrlBaseButton *pCB = dynamic_cast(pIM->getElementFromId(sButton)); + CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sButton)); if (pCB != NULL) pCB->setPushed(true); } @@ -686,7 +686,7 @@ public: if (icon != 0xff) { string sButton = string(GROUP_MACROICONCREATION_ICON) + CTRL_MACROICONCREATION_BUTTON + toString(icon+1); - CCtrlBaseButton *pCB = dynamic_cast(pIM->getElementFromId(sButton)); + CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sButton)); if (pCB != NULL) pCB->setPushed(true); } @@ -694,15 +694,15 @@ public: if (over != 0xff) { string sButton = string(GROUP_MACROICONCREATION_OVER) + CTRL_MACROICONCREATION_BUTTON + toString(over+1); - CCtrlBaseButton *pCB = dynamic_cast(pIM->getElementFromId(sButton)); + CCtrlBaseButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sButton)); if (pCB != NULL) pCB->setPushed(true); } - CGroupEditBox *pEB = dynamic_cast(pIM->getElementFromId(CTRL_MACROICONCREATION_EDITTEXT)); + CGroupEditBox *pEB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_MACROICONCREATION_EDITTEXT)); if (pEB != NULL) { pEB->setInputStringAsStdString(pMCM->CurrentEditMacro.DispText); - CDBCtrlSheet *pCS = dynamic_cast(pIM->getElementFromId(CTRL_MACROICONCREATION_ICON)); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_MACROICONCREATION_ICON)); if (pCS != NULL) pCS->setMacroText(pEB->getInputStringAsStdString()); } @@ -836,7 +836,7 @@ public: { CInterfaceManager *pIM = CInterfaceManager::getInstance(); if (pCaller == NULL) - pCaller = dynamic_cast(pIM->getElementFromId("ui:interface:new_macro:content:edit_name")); + pCaller = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:new_macro:content:edit_name")); CGroupEditBox *pEB = dynamic_cast(pCaller); if (pEB == NULL) return; @@ -861,16 +861,16 @@ public: CInterfaceManager *pIM = CInterfaceManager::getInstance(); CMacroCmdManager *pMCM = CMacroCmdManager::getInstance(); // Icon - CDBCtrlSheet *pCS = dynamic_cast(pIM->getElementFromId(CTRL_NEWMACRO_ICON)); + CDBCtrlSheet *pCS = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_NEWMACRO_ICON)); if (pCS != NULL) pCS->readFromMacro(pMCM->CurrentEditMacro); // Name - CGroupEditBox *pEB = dynamic_cast(pIM->getElementFromId(GROUP_NEWMACRO_EDIT_NAME)); + CGroupEditBox *pEB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_NEWMACRO_EDIT_NAME)); if (pEB != NULL) pEB->setInputString(pMCM->CurrentEditMacro.Name); // Commands - CGroupList *pList = dynamic_cast(pIM->getElementFromId(GROUP_NEWMACRO_COMMANDS)); + CGroupList *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_NEWMACRO_COMMANDS)); if (pList == NULL) return; // Key Shortcut - CViewText *pVT = dynamic_cast(pIM->getElementFromId(VIEW_NEWMACRO_KEY)); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(VIEW_NEWMACRO_KEY)); if (pVT != NULL) { if (pMCM->CurrentEditMacro.Combo.Key == KeyCount) @@ -936,7 +936,7 @@ public: pMCM->addMacro(pMCM->CurrentEditMacro); } - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(WIN_NEWMACRO)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_NEWMACRO)); if (pGC != NULL) pGC->setActive (false); pIM->runActionHandler("macros_open",NULL); @@ -1001,7 +1001,7 @@ public: CInterfaceManager *pIM = CInterfaceManager::getInstance(); CMacroCmdManager *pMCM = CMacroCmdManager::getInstance(); - CGroupList *pList = dynamic_cast(pIM->getElementFromId(WIN_MACRO_CONTENT)); + CGroupList *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_MACRO_CONTENT)); if (pList == NULL) return; pList->clearGroups(); @@ -1037,7 +1037,7 @@ public: mc.BitmapOver = 0; pMCM->CurrentEditMacro = mc; - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(WIN_NEWMACRO)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_NEWMACRO)); if (pGC != NULL) { pGC->setTitle(NEWMACRO_TITLE_NEW); @@ -1077,7 +1077,7 @@ public: CMacroCmdManager *pMCM = CMacroCmdManager::getInstance(); pMCM->CurrentEditMacro = pMCM->getMacros()[nMacNb]; pMCM->CurrentEditMacroNb = nMacNb; - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId(WIN_NEWMACRO)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_NEWMACRO)); if (pGC != NULL) { pGC->setTitle(NEWMACRO_TITLE_EDIT); diff --git a/code/ryzom/client/src/interface_v3/music_player.cpp b/code/ryzom/client/src/interface_v3/music_player.cpp index 3f5782c92..1aeabb9cb 100644 --- a/code/ryzom/client/src/interface_v3/music_player.cpp +++ b/code/ryzom/client/src/interface_v3/music_player.cpp @@ -81,7 +81,7 @@ void CMusicPlayer::play () /* Show the song title */ CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId("ui:interface:mp3_player:screen:text")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:mp3_player:screen:text")); if (pVT) pVT->setText (_Songs[_CurrentSong].Title); } diff --git a/code/ryzom/client/src/interface_v3/obs_huge_list.cpp b/code/ryzom/client/src/interface_v3/obs_huge_list.cpp index 6d7121a88..1af0044b5 100644 --- a/code/ryzom/client/src/interface_v3/obs_huge_list.cpp +++ b/code/ryzom/client/src/interface_v3/obs_huge_list.cpp @@ -511,12 +511,12 @@ void CHugeListObs::updateUIItemPage(uint index) if (BotChatPageAll->Trade->getBuyOnly()) { dbPath = DB_LOCAL_BRANCH_FOR_ITEM_FOR_MONEY ":"; - listSheet = dynamic_cast(im->getElementFromId(UI_LIST_OF_ITEMS_FOR_MONEY_BUY_ONLY)); + listSheet = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(UI_LIST_OF_ITEMS_FOR_MONEY_BUY_ONLY)); } else { dbPath = DB_LOCAL_BRANCH_FOR_ITEM_FOR_MONEY ":"; - listSheet = dynamic_cast(im->getElementFromId(UI_LIST_OF_ITEMS_FOR_MONEY)); + listSheet = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(UI_LIST_OF_ITEMS_FOR_MONEY)); } if (!listSheet) return; itemListCategoryLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:TYPE_OF_ITEMS_TO_BUY", false); @@ -525,32 +525,32 @@ void CHugeListObs::updateUIItemPage(uint index) case ItemForMissions: { dbPath = DB_LOCAL_BRANCH_FOR_ITEM_FOR_MISSION ":"; - listSheet = dynamic_cast(im->getElementFromId(UI_LIST_OF_ITEMS_FOR_MISSION)); + listSheet = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(UI_LIST_OF_ITEMS_FOR_MISSION)); if (!listSheet) return; itemListCategoryLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:TYPE_OF_ITEMS_FOR_MISSION", false); if (!itemListCategoryLeaf) return; // display the group for mission items - CInterfaceElement *elm = im->getElementFromId(UI_GROUP_OF_ITEMS_FOR_MISSION); + CInterfaceElement *elm = CWidgetManager::getInstance()->getElementFromId(UI_GROUP_OF_ITEMS_FOR_MISSION); if (elm) elm->setActive(true); } break; case Ascensor: { dbPath = DB_LOCAL_BRANCH_FOR_ASCENSOR ":"; - listSheet = dynamic_cast(im->getElementFromId(UI_LIST_OF_ITEMS_FOR_ASCENSOR)); + listSheet = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(UI_LIST_OF_ITEMS_FOR_ASCENSOR)); if (!listSheet) return; // display the group for mission items - CInterfaceElement *elm = im->getElementFromId(UI_GROUP_OF_ITEMS_FOR_ASCENSOR); + CInterfaceElement *elm = CWidgetManager::getInstance()->getElementFromId(UI_GROUP_OF_ITEMS_FOR_ASCENSOR); if (elm) elm->setActive(true); } break; case Missions: { dbPath = DB_LOCAL_BRANCH_FOR_MISSIONS ":"; - listSheet = dynamic_cast(im->getElementFromId(UI_LIST_OF_MISSIONS)); + listSheet = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(UI_LIST_OF_MISSIONS)); if (!listSheet) return; // display the group for mission items - CInterfaceElement *elm = im->getElementFromId(UI_GROUP_OF_MISSIONS); + CInterfaceElement *elm = CWidgetManager::getInstance()->getElementFromId(UI_GROUP_OF_MISSIONS); if (elm) elm->setActive(true); } break; diff --git a/code/ryzom/client/src/interface_v3/people_interraction.cpp b/code/ryzom/client/src/interface_v3/people_interraction.cpp index 4c2bd1403..c357505cc 100644 --- a/code/ryzom/client/src/interface_v3/people_interraction.cpp +++ b/code/ryzom/client/src/interface_v3/people_interraction.cpp @@ -1087,7 +1087,7 @@ bool CPeopleInterraction::getPeopleFromCurrentMenu(CPeopleList *&peopleList, uin { CInterfaceManager *im = CInterfaceManager::getInstance(); // the group that launched the modal window (the menu) must be the header of the group container that represent a people entry - CInterfaceGroup *header = dynamic_cast(im->getCtrlLaunchingModal()); + CInterfaceGroup *header = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (!header) return false; // get the parent container CGroupContainer *gc = dynamic_cast(header->getParent()); @@ -1100,7 +1100,7 @@ CPeopleList *CPeopleInterraction::getPeopleListFromCurrentMenu() { CInterfaceManager *im = CInterfaceManager::getInstance(); // the group that launched the modal window (the menu) must be the header of the group container that represent a people entry - CInterfaceGroup *header = dynamic_cast(im->getCtrlLaunchingModal()); + CInterfaceGroup *header = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (!header) return NULL; // get the parent container CGroupContainer *gc = dynamic_cast(header->getParent()); @@ -2230,7 +2230,7 @@ public: { CInterfaceManager *pIM = CInterfaceManager::getInstance(); string groupName= getParam(sParams, "group"); - CInterfaceGroup *gc = dynamic_cast(pIM->getElementFromId(groupName)); + CInterfaceGroup *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(groupName)); if (gc) { CGroupEditBox *geb = dynamic_cast(gc->getGroup("add_contact_eb:eb")); @@ -2416,9 +2416,9 @@ public: nlwarning("Deactivated for now!"); return; CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *gc = dynamic_cast(im->getElementFromId(NEW_PARTY_CHAT_WINDOW)); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(NEW_PARTY_CHAT_WINDOW)); if (!gc) return; - im->setTopWindow(gc); + CWidgetManager::getInstance()->setTopWindow(gc); // Set the keyboard focus CGroupEditBox *eb = dynamic_cast(gc->getGroup("eb")); if (eb) @@ -2447,7 +2447,7 @@ class CHandlerValidatePartyChatName : public IActionHandler void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *gc = dynamic_cast(im->getElementFromId(NEW_PARTY_CHAT_WINDOW)); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(NEW_PARTY_CHAT_WINDOW)); if (!gc) return; CGroupEditBox *eb = dynamic_cast(gc->getGroup("eb")); if (!eb) return; @@ -2484,7 +2484,7 @@ class CHandlerRemovePartyChat : public IActionHandler { void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { - CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CInterfaceManager::getInstance()->getCtrlLaunchingModal()); + CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal()); if (chat) PeopleInterraction.removePartyChat(chat); } }; @@ -2523,7 +2523,7 @@ class CHandlerAddAllTeamMembersToPartyChat : public IActionHandler { void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { -// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CInterfaceManager::getInstance()->getCtrlLaunchingModal()); +// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal()); // TODO GAMEDEV : add all team members } }; @@ -2536,7 +2536,7 @@ class CHandlerRemoveAllTeamMembersToPartyChat : public IActionHandler { void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { -// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CInterfaceManager::getInstance()->getCtrlLaunchingModal()); +// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal()); // TODO GAMEDEV : remove all team members } }; @@ -2549,7 +2549,7 @@ class CHandlerAddAllGuildMembersToPartyChat : public IActionHandler { void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { -// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CInterfaceManager::getInstance()->getCtrlLaunchingModal()); +// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal()); // TODO GAMEDEV : add all guild members } }; @@ -2562,7 +2562,7 @@ class CHandlerRemoveAllGuildMembersToPartyChat : public IActionHandler { void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { -// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CInterfaceManager::getInstance()->getCtrlLaunchingModal()); +// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal()); // TODO_GAMEDEV : remove all guild members } }; @@ -2594,7 +2594,7 @@ public: partyChats = nlstricmp("true", strPartyChats.c_str()) == 0; } // get the menu - CGroupMenu *menu = dynamic_cast(im->getElementFromId(menuName)); + CGroupMenu *menu = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(menuName)); if (!menu) return; // remove all party chat from the previous list uint lastTargetSelectedIndex = 0; @@ -2639,7 +2639,7 @@ public: CInterfaceManager *pIM = CInterfaceManager::getInstance(); cw = PeopleInterraction.TheUserChat.Window; // CChatStdInput &ci = PeopleInterraction.ChatInput; - CGroupMenu *pMenu = dynamic_cast(pIM->getElementFromId("ui:interface:user_chat_target_menu")); + CGroupMenu *pMenu = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:user_chat_target_menu")); CViewTextMenu *pMenuAround = dynamic_cast(pMenu->getElement("ui:interface:user_chat_target_menu:around")); CViewTextMenu *pMenuRegion = dynamic_cast(pMenu->getElement("ui:interface:user_chat_target_menu:region")); CViewTextMenu *pMenuUniverse = dynamic_cast(pMenu->getElement("ui:interface:user_chat_target_menu:universe")); @@ -2681,7 +2681,7 @@ public: } // activate the menu - CInterfaceManager::getInstance()->enableModalWindow(pCaller, menuName); + CWidgetManager::getInstance()->enableModalWindow(pCaller, menuName); } }; REGISTER_ACTION_HANDLER( CHandlerSelectChatTarget, "select_chat_target"); @@ -2844,13 +2844,13 @@ class CHandlerSelectChatSource : public IActionHandler if (cw == pi.ChatGroup.Window) { // select main chat menu - menu = dynamic_cast(im->getElementFromId(MAIN_CHAT_SOURCE_MENU)); + menu = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(MAIN_CHAT_SOURCE_MENU)); // Remove all unused dynamic channels and set the names for (uint i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++) { string s = toString(i); - CViewTextMenu *pVTM = dynamic_cast(im->getElementFromId(MAIN_CHAT_SOURCE_MENU+":tab:dyn"+s)); + CViewTextMenu *pVTM = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(MAIN_CHAT_SOURCE_MENU+":tab:dyn"+s)); if (pVTM) { uint32 textId = ChatMngr.getDynamicChannelNameFromDbIndex(i); @@ -2885,7 +2885,7 @@ class CHandlerSelectChatSource : public IActionHandler if (cw == pi.TheUserChat.Window) { // select user chat menu - menu = dynamic_cast(im->getElementFromId(USER_CHAT_SOURCE_MENU)); + menu = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(USER_CHAT_SOURCE_MENU)); addUserChatEntries= true; } // Simple menu @@ -2895,7 +2895,7 @@ class CHandlerSelectChatSource : public IActionHandler // Just open the STD chat menu, and quit NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:GC_POPUP")->setValue64(cw->getContainer()->isPopuped() || cw->getContainer()->getLayerSetup() == 0 ? 1 : 0); NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:GC_HAS_HELP")->setValue64(!cw->getContainer()->getHelpPage().empty()); - CInterfaceManager::getInstance()->enableModalWindow(pCaller, STD_CHAT_SOURCE_MENU); + CWidgetManager::getInstance()->enableModalWindow(pCaller, STD_CHAT_SOURCE_MENU); return; } } @@ -2997,7 +2997,7 @@ class CHandlerSelectChatSource : public IActionHandler // *** active the menu NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:GC_POPUP")->setValue64(cw->getContainer()->isPopuped() || cw->getContainer()->getLayerSetup() == 0 ? 1 : 0); NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:GC_HAS_HELP")->setValue64(!cw->getContainer()->getHelpPage().empty()); - im->enableModalWindow(pCaller, menu); + CWidgetManager::getInstance()->enableModalWindow(pCaller, menu); } }; REGISTER_ACTION_HANDLER(CHandlerSelectChatSource, "select_chat_source"); @@ -3116,7 +3116,7 @@ class CHandlerToggleChatEBVis : public IActionHandler { void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { - CCtrlBase *clm = CInterfaceManager::getInstance()->getCtrlLaunchingModal(); + CCtrlBase *clm = CWidgetManager::getInstance()->getCtrlLaunchingModal(); if (!clm) return; CInterfaceGroup *ig = clm->getParent(); do diff --git a/code/ryzom/client/src/interface_v3/people_list.cpp b/code/ryzom/client/src/interface_v3/people_list.cpp index 6664b1418..1b904bbeb 100644 --- a/code/ryzom/client/src/interface_v3/people_list.cpp +++ b/code/ryzom/client/src/interface_v3/people_list.cpp @@ -63,7 +63,7 @@ bool CPeopleList::create(const CPeopleListDesc &desc, const CChatWindowDesc *cha CGroupContainer *fatherContainer = NULL; if (!desc.FatherContainer.empty()) { - fatherContainer = dynamic_cast(im->getElementFromId(desc.FatherContainer)); + fatherContainer = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(desc.FatherContainer)); if (!fatherContainer) { nlwarning(" Can't get father group, or bad type"); @@ -99,7 +99,7 @@ bool CPeopleList::create(const CPeopleListDesc &desc, const CChatWindowDesc *cha { // Root container - CInterfaceGroup *pRoot = dynamic_cast(im->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", gc); gc->setParent(pRoot); pRoot->addGroup (gc); @@ -384,7 +384,7 @@ sint CPeopleList::addPeople(const ucstring &name, uint teamMateIndex /*= 0*/) _BaseContainer->attachContainer(gc); } - CInterfaceGroup *pRoot = dynamic_cast(im->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); pRoot->addGroup (gc); _Peoples.push_back(CPeople()); @@ -416,7 +416,7 @@ void CPeopleList::removePeople(uint index) _BaseContainer->detachContainer(_Peoples[index].Container); } CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceGroup *pRoot = dynamic_cast(im->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); pRoot->delGroup (_Peoples[index].Container); _Peoples.erase(_Peoples.begin() + index); @@ -528,7 +528,7 @@ void CPeopleList::displayMessage(uint index, const ucstring &msg, NLMISC::CRGBA gcChat->requireAttention(); - CInterfaceManager::getInstance()->setTopWindow(gcChat); + CWidgetManager::getInstance()->setTopWindow(gcChat); CGroupList *gl = dynamic_cast(gcChat->getGroup("text_list")); if (gl == NULL) @@ -582,7 +582,7 @@ void CPeopleList::reset() else // detach from root { CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceGroup *pRoot = dynamic_cast(im->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); pRoot->delGroup(_BaseContainer); } _BaseContainer = ""; diff --git a/code/ryzom/client/src/interface_v3/player_trade.cpp b/code/ryzom/client/src/interface_v3/player_trade.cpp index 47d8bfecc..1e4c4a172 100644 --- a/code/ryzom/client/src/interface_v3/player_trade.cpp +++ b/code/ryzom/client/src/interface_v3/player_trade.cpp @@ -152,7 +152,7 @@ void CPlayerTrade::restoreItem(CDBCtrlSheet *exchangeSlot) CDBCtrlSheet *CPlayerTrade::getExchangeItem(uint index) { CInterfaceManager *im = CInterfaceManager::getInstance(); - return dynamic_cast(im->getElementFromId(NLMISC::toString("ui:interface:player_trade:header_opened:give:given_items:slot%d", (int) index))); + return dynamic_cast(CWidgetManager::getInstance()->getElementFromId(NLMISC::toString("ui:interface:player_trade:header_opened:give:given_items:slot%d", (int) index))); } @@ -225,7 +225,7 @@ class CPlayerTradeLeftClickOnSlotHandler : public IActionHandler } } CInterfaceManager *im = CInterfaceManager::getInstance(); - im->pushModalWindow(pCaller, "ui:interface:exchange_choose_in_bag"); + CWidgetManager::getInstance()->pushModalWindow(pCaller, "ui:interface:exchange_choose_in_bag"); } }; REGISTER_ACTION_HANDLER(CPlayerTradeLeftClickOnSlotHandler, "exchange_left_click_on_slot"); diff --git a/code/ryzom/client/src/interface_v3/skill_manager.cpp b/code/ryzom/client/src/interface_v3/skill_manager.cpp index e72ab80c6..0df3a071e 100644 --- a/code/ryzom/client/src/interface_v3/skill_manager.cpp +++ b/code/ryzom/client/src/interface_v3/skill_manager.cpp @@ -1084,7 +1084,7 @@ public: pSM->tryToUnblockTitleFromItems(false); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBGroupComboBox *pCB = dynamic_cast(pIM->getElementFromId(GROUP_TITLE_COMBO)); + CDBGroupComboBox *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_TITLE_COMBO)); if (pCB != NULL) { pCB->resetTexts(); @@ -1116,7 +1116,7 @@ public: uint8 nNewTitle = 0; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CDBGroupComboBox *pCB = dynamic_cast(pIM->getElementFromId(GROUP_TITLE_COMBO)); + CDBGroupComboBox *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_TITLE_COMBO)); if (pCB == NULL) return; if ((pCB->getSelection() < 0) || (pCB->getSelection() >= (sint32)pSM->_UIUnblockedTitles.size())) return; diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp index 26245b2c5..749bd00ea 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp @@ -1629,7 +1629,7 @@ float CSPhraseManager::getPhraseSumBrickProp(const CSPhraseCom &phrase, uint { CInterfaceManager *im = CInterfaceManager::getInstance(); uint32 weight = (uint32) NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:DEFAULT_WEIGHT_HANDS")->getValue32() / 10; // weight must be in dg here - CDBCtrlSheet *ctrlSheet = dynamic_cast(im->getElementFromId("ui:interface:gestionsets:hands:handr")); + CDBCtrlSheet *ctrlSheet = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:gestionsets:hands:handr")); if (ctrlSheet) { const CItemSheet *itemSheet = ctrlSheet->asItemSheet(); @@ -1638,7 +1638,7 @@ float CSPhraseManager::getPhraseSumBrickProp(const CSPhraseCom &phrase, uint weight = (uint32) ctrlSheet->getItemWeight(); } } - ctrlSheet = dynamic_cast(im->getElementFromId("ui:interface:gestionsets:hands:handl")); + ctrlSheet = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:gestionsets:hands:handl")); if (ctrlSheet) { const CItemSheet *itemSheet = ctrlSheet->asItemSheet(); @@ -1838,12 +1838,12 @@ void CSPhraseManager::updateExecutionDisplay() displayNext= false; // DisplayCycleSelectionOnActionBar - CInterfaceElement *viewCycle= pIM->getElementFromId(PhraseMemoryViewCycleAction); + CInterfaceElement *viewCycle= CWidgetManager::getInstance()->getElementFromId(PhraseMemoryViewCycleAction); if(viewCycle) { CInterfaceElement *ctrl= NULL; if(displayCycle) - ctrl= pIM->getElementFromId(PhraseMemoryViewSlotBase + toString(_CurrentExecuteSlotCycle)); + ctrl= CWidgetManager::getInstance()->getElementFromId(PhraseMemoryViewSlotBase + toString(_CurrentExecuteSlotCycle)); if(displayCycle && ctrl) { viewCycle->setParentPos(ctrl); @@ -1857,12 +1857,12 @@ void CSPhraseManager::updateExecutionDisplay() } // DisplayNextSelectionOnActionBar - CInterfaceElement *viewNext= pIM->getElementFromId(PhraseMemoryViewNextAction); + CInterfaceElement *viewNext= CWidgetManager::getInstance()->getElementFromId(PhraseMemoryViewNextAction); if(viewNext) { CInterfaceElement *ctrl= NULL; if(displayNext) - ctrl= pIM->getElementFromId(PhraseMemoryViewSlotBase + toString(_CurrentExecuteSlotNext)); + ctrl= CWidgetManager::getInstance()->getElementFromId(PhraseMemoryViewSlotBase + toString(_CurrentExecuteSlotNext)); if(displayNext && ctrl) { viewNext->setParentPos(ctrl); @@ -3037,13 +3037,13 @@ void CSPhraseManager::updateAllMemoryCtrlState() for(uint i=0;i(pIM->getElementFromId(PhraseMemoryCtrlBase + toString(i)) ); + CDBCtrlSheet *ctrl= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(PhraseMemoryCtrlBase + toString(i)) ); if(ctrl) { // update the valid state. updateMemoryCtrlState(i, ctrl, itemSkill); } - CDBCtrlSheet *ctrlAlt= dynamic_cast(pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(i)) ); + CDBCtrlSheet *ctrlAlt= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(PhraseMemoryAltCtrlBase + toString(i)) ); if(ctrlAlt) updateMemoryCtrlState(i, ctrlAlt, itemSkill); } @@ -3069,7 +3069,7 @@ CDBCtrlSheet *CSPhraseManager::getMemorySlotCtrl(uint memorySlot) // Get the ctrl CInterfaceManager *pIM= CInterfaceManager::getInstance(); - return dynamic_cast(pIM->getElementFromId(PhraseMemoryCtrlBase + toString(memorySlot))); + return dynamic_cast(CWidgetManager::getInstance()->getElementFromId(PhraseMemoryCtrlBase + toString(memorySlot))); } // *************************************************************************** @@ -3080,7 +3080,7 @@ CDBCtrlSheet *CSPhraseManager::getMemoryAltSlotCtrl(uint memorySlot) // Get the ctrl CInterfaceManager *pIM= CInterfaceManager::getInstance(); - return dynamic_cast(pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(memorySlot))); + return dynamic_cast(CWidgetManager::getInstance()->getElementFromId(PhraseMemoryAltCtrlBase + toString(memorySlot))); } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/task_bar_manager.cpp b/code/ryzom/client/src/interface_v3/task_bar_manager.cpp index 99d573381..de19fbdca 100644 --- a/code/ryzom/client/src/interface_v3/task_bar_manager.cpp +++ b/code/ryzom/client/src/interface_v3/task_bar_manager.cpp @@ -137,7 +137,7 @@ public: virtual void execute(CCtrlBase * /* pCaller */, const string &/* Params */) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainerWindows *pGCW = dynamic_cast(pIM->getElementFromId("ui:interface:windows")); + CGroupContainerWindows *pGCW = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:windows")); if (pGCW == NULL) return; pGCW->setShowDesktops(!pGCW->getShowDesktops()); } @@ -154,7 +154,7 @@ public: virtual void execute(CCtrlBase * /* pCaller */, const string &/* Params */) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:gestion_windows")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:gestion_windows")); if (pGC == NULL) return; CActionsManager *pAM = &Actions; const CActionsManager::TActionComboMap &acmap = pAM->getActionComboMap(); @@ -171,7 +171,7 @@ public: CActionsManager::TActionComboMap::const_iterator it = acmap.find(CAction::CName("show_hide",sWin.c_str())); string sFullTxt = string("ui:interface:gestion_windows:") + sTxt + ":key"; - CViewText *pVT = dynamic_cast(pIM->getElementFromId(sFullTxt)); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sFullTxt)); if (pVT != NULL) { if (it != acmap.end()) diff --git a/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp b/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp index d9eb19957..a44dcf509 100644 --- a/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp +++ b/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp @@ -278,8 +278,8 @@ void CViewBitmapCombo::draw() CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewRenderer &rVR = pIM->getViewRenderer(); const std::vector &rVB = pIM->getViewsUnderPointer(); - if (!pIM->getPointer()) return; - pIM->getPointer()->getPointerDispPos(mx, my); + if (!CWidgetManager::getInstance()->getPointer()) return; + CWidgetManager::getInstance()->getPointer()->getPointerDispPos(mx, my); bool over = false; uint32 i; for (i = 0; i < rVB.size(); ++i) @@ -361,7 +361,7 @@ void CViewBitmapCombo::draw() && my < py + (sint32) itemh) { overItem = true; - if (pIM->getPointer()->getButtonState() & NLMISC::leftButton) + if (CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton) { textId = getTexId(_TexsPushedId, texIndex); color = getCol(_ColPushed, texIndex); @@ -416,7 +416,7 @@ void CViewBitmapCombo::draw() // if (_CD.Unrolled.getBool()) { - if (overItem && pIM->getPointer()->getButtonState() & NLMISC::leftButton) + if (overItem && CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton) { textId = getTexId(_TexsId, selectedTexIndex); color = getCol(_Col, selectedTexIndex); @@ -436,7 +436,7 @@ void CViewBitmapCombo::draw() && my < py + (sint32) itemh ) { - if (pIM->getPointer()->getButtonState() & NLMISC::leftButton) + if (CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton) { textId = getTexId(_TexsPushedId, selectedTexIndex); color = getCol(_ColPushed, selectedTexIndex); diff --git a/code/ryzom/client/src/interface_v3/view_pointer.cpp b/code/ryzom/client/src/interface_v3/view_pointer.cpp index 195977a6b..941f5ffb1 100644 --- a/code/ryzom/client/src/interface_v3/view_pointer.cpp +++ b/code/ryzom/client/src/interface_v3/view_pointer.cpp @@ -181,13 +181,13 @@ void CViewPointer::draw () _StringCursor = pIM->createGroupInstance("string_cursor", "", templateParams); if (_StringCursor) - _StringCursor->setParentPos(pIM->getElementFromId("ui:interface")); + _StringCursor->setParentPos(CWidgetManager::getInstance()->getElementFromId("ui:interface")); templateParams.clear(); templateParams.push_back (std::pair("id", "string_cursor_hardware")); _StringCursorHardware = pIM->createGroupInstance("string_cursor_hardware", "", templateParams); if (_StringCursorHardware) - _StringCursorHardware->setParentPos(pIM->getElementFromId("ui:interface")); + _StringCursorHardware->setParentPos(CWidgetManager::getInstance()->getElementFromId("ui:interface")); } CRGBA col; @@ -305,7 +305,7 @@ void CViewPointer::draw () // is the cursor currently over a modal window ? - CInterfaceGroup *currModal = pIM->getModalWindow(); + CInterfaceGroup *currModal = CWidgetManager::getInstance()->getModalWindow(); if (currModal) { sint32 xPos = _XReal + _OffsetX; diff --git a/code/ryzom/client/src/interface_v3/view_text.cpp b/code/ryzom/client/src/interface_v3/view_text.cpp index 969691ac1..6167fd5f9 100644 --- a/code/ryzom/client/src/interface_v3/view_text.cpp +++ b/code/ryzom/client/src/interface_v3/view_text.cpp @@ -615,11 +615,11 @@ void CViewText::draw () TextContext->resetStringSelection(_Index); // if single line clamped, may allow to draw an over - if(isSingleLineTextClamped() && _OverExtendViewText && pIM->getPointer()) + if(isSingleLineTextClamped() && _OverExtendViewText && CWidgetManager::getInstance()->getPointer()) { // but must check first if mouse is over - sint32 x = pIM->getPointer()->getX(); - sint32 y = pIM->getPointer()->getY(); + sint32 x = CWidgetManager::getInstance()->getPointer()->getX(); + sint32 y = CWidgetManager::getInstance()->getPointer()->getY(); bool mouseIn; // use parent clip or self clip? if(_OverExtendViewTextUseParentRect) diff --git a/code/ryzom/client/src/interface_v3/widget_manager.cpp b/code/ryzom/client/src/interface_v3/widget_manager.cpp index 76ca72a8b..2bf490e13 100644 --- a/code/ryzom/client/src/interface_v3/widget_manager.cpp +++ b/code/ryzom/client/src/interface_v3/widget_manager.cpp @@ -18,8 +18,10 @@ #include "interface_group.h" #include "group_container.h" #include "group_in_scene.h" +#include "view_pointer.h" CWidgetManager* CWidgetManager::instance = NULL; +std::string CWidgetManager::_CtrlLaunchingModalId= "ctrl_launch_modal"; // ---------------------------------------------------------------------------- // SMasterGroup @@ -351,10 +353,356 @@ void CWidgetManager::removeAllMasterGroups() } +// ------------------------------------------------------------------------------------------------ +void CWidgetManager::activateMasterGroup (const std::string &sMasterGroupName, bool bActive) +{ + CInterfaceGroup *pIG = CWidgetManager::getInstance()->getMasterGroupFromId (sMasterGroupName); + if (pIG != NULL) + { + pIG->setActive(bActive); + pIG->invalidateCoords(); + } +} + +// ------------------------------------------------------------------------------------------------ +CInterfaceGroup* CWidgetManager::getWindow(CInterfaceElement *pIE) +{ + CInterfaceGroup *pIG = pIE->getParent(); + if (pIG == NULL) return NULL; + if (pIG->getParent() == NULL) return NULL; + while (pIG->getParent()->getParent() != NULL) + { + pIG = pIG->getParent(); + } + return pIG; +} + + +// ------------------------------------------------------------------------------------------------ +CInterfaceElement* CWidgetManager::getElementFromId (const std::string &sEltId) +{ + // System special + if(sEltId == _CtrlLaunchingModalId) + return getCtrlLaunchingModal(); + + // Search for all elements + for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) + { + CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; + CInterfaceElement *pIEL = rMG.Group->getElement (sEltId); + if (pIEL != NULL) + return pIEL; + } + return NULL; +} + +// ------------------------------------------------------------------------------------------------ +CInterfaceElement* CWidgetManager::getElementFromId (const std::string &sStart, const std::string &sEltId) +{ + CInterfaceElement *pIEL = getElementFromId (sEltId); + if (pIEL == NULL) + { + std::string sZeStart = sStart, sTmp; + if (sZeStart[sZeStart.size()-1] == ':') + sZeStart = sZeStart.substr(0, sZeStart.size()-1); + + while (sZeStart != "") + { + if (sEltId[0] == ':') + sTmp = sZeStart + sEltId; + else + sTmp = sZeStart + ":" + sEltId; + pIEL = getElementFromId (sTmp); + if (pIEL != NULL) + return pIEL; + std::string::size_type nextPos = sZeStart.rfind(':'); + if (nextPos == std::string::npos) break; + sZeStart = sZeStart.substr(0, nextPos); + } + } + return pIEL; +} + +// ------------------------------------------------------------------------------------------------ +void CWidgetManager::setTopWindow (CInterfaceGroup* win) +{ + //find the window in the window list + for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) + { + CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; + if (rMG.Group->getActive()) + rMG.setTopWindow(win); + } +} + +// ------------------------------------------------------------------------------------------------ +void CWidgetManager::setBackWindow(CInterfaceGroup* win) +{ + for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) + { + CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; + if (rMG.Group->getActive()) + rMG.setBackWindow(win); + } +} + +// ------------------------------------------------------------------------------------------------ +CInterfaceGroup* CWidgetManager::getTopWindow (uint8 nPriority) const +{ + for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) + { + const CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; + if (rMG.Group->getActive()) + { + // return the first. + if(rMG.PrioritizedWindows[nPriority].empty()) + return NULL; + else + return rMG.PrioritizedWindows[nPriority].back(); + } + } + return NULL; +} + + +// ------------------------------------------------------------------------------------------------ +CInterfaceGroup* CWidgetManager::getBackWindow (uint8 nPriority) const +{ + for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) + { + const CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; + if (rMG.Group->getActive()) + { + // return the first. + if(rMG.PrioritizedWindows[nPriority].empty()) + return NULL; + else + return rMG.PrioritizedWindows[nPriority].front(); + } + } + return NULL; +} + +// *************************************************************************** +CInterfaceGroup* CWidgetManager::getLastEscapableTopWindow() const +{ + for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) + { + const CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; + if (rMG.Group->getActive()) + { + for (uint8 nPriority = WIN_PRIORITY_MAX; nPriority > 0; nPriority--) + { + const std::list &rList = rMG.PrioritizedWindows[nPriority-1]; + std::list::const_reverse_iterator it; + it= rList.rbegin(); + for(;it!=rList.rend();it++) + { + if((*it)->getActive() && (*it)->getEscapable()) + return *it; + } + } + } + } + return NULL; +} + +// *************************************************************************** +void CWidgetManager::setWindowPriority (CInterfaceGroup *pWin, uint8 nNewPriority) +{ + for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) + { + CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; + if (rMG.Group->getActive()) + { + if (rMG.isWindowPresent(pWin)) + { + rMG.delWindow(pWin); + rMG.addWindow(pWin, nNewPriority); + } + } + } +} + +// *************************************************************************** +uint8 CWidgetManager::getLastTopWindowPriority() const +{ + for (uint32 nMasterGroup = 0; nMasterGroup < _MasterGroups.size(); nMasterGroup++) + { + const CWidgetManager::SMasterGroup &rMG = _MasterGroups[nMasterGroup]; + if (rMG.Group->getActive()) + { + return rMG.LastTopWindowPriority; + } + } + return 0; +} + +bool CWidgetManager::hasModal() const +{ + if( !_ModalStack.empty() ) + return true; + else + return false; +} + +CWidgetManager::SModalWndInfo& CWidgetManager::getModal() +{ + return _ModalStack.back(); +} + +bool CWidgetManager::isPreviousModal( CInterfaceGroup *wnd ) const +{ + std::vector< SModalWndInfo >::size_type s = _ModalStack.size(); + for( std::vector< SModalWndInfo >::size_type i = 0; i < s; i++ ) + if( _ModalStack[ i ].ModalWindow == wnd ) + return true; + + return false; +} + +// ------------------------------------------------------------------------------------------------ +void CWidgetManager::enableModalWindow (CCtrlBase *ctrlLaunchingModal, CInterfaceGroup *pIG) +{ + // disable any modal before. release keyboard + disableModalWindow(); + pushModalWindow(ctrlLaunchingModal, pIG); +} + +// ------------------------------------------------------------------------------------------------ +void CWidgetManager::enableModalWindow (CCtrlBase *CtrlLaunchingModal, const std::string &groupName) +{ + CInterfaceGroup *group= dynamic_cast( getElementFromId(groupName) ); + if(group) + { + // enable the modal + enableModalWindow(CtrlLaunchingModal, group); + } +} + +// ------------------------------------------------------------------------------------------------ +void CWidgetManager::disableModalWindow () +{ + while (!_ModalStack.empty()) + { + SModalWndInfo winInfo = _ModalStack.back(); + _ModalStack.pop_back(); // must pop back as early as possible because 'setActive' may trigger another 'popModalWindow', leading to a crash + // disable old modal window + if(winInfo.ModalWindow) + { + setBackWindow(winInfo.ModalWindow); + winInfo.ModalWindow->setActive(false); + } + } + + // disable any context help + setCurContextHelp( NULL ); + CWidgetManager::getInstance()->_DeltaTimeStopingContextHelp = 0; +} + +// ------------------------------------------------------------------------------------------------ +void CWidgetManager::pushModalWindow(CCtrlBase *ctrlLaunchingModal, CInterfaceGroup *pIG) +{ + // enable the wanted modal + if(pIG) + { + SModalWndInfo mwi; + mwi.ModalWindow = pIG; + mwi.CtrlLaunchingModal = ctrlLaunchingModal; + // setup special group + CGroupModal *groupModal= dynamic_cast(pIG); + if(groupModal) + { + mwi.ModalExitClickOut = groupModal->ExitClickOut; + mwi.ModalExitClickL = groupModal->ExitClickL; + mwi.ModalExitClickR = groupModal->ExitClickR; + mwi.ModalHandlerClickOut = groupModal->OnClickOut; + mwi.ModalClickOutParams = groupModal->OnClickOutParams; + mwi.ModalExitKeyPushed = groupModal->ExitKeyPushed; + // update coords of the modal + if(groupModal->SpawnOnMousePos) + { + groupModal->SpawnMouseX = _Pointer->getX(); + groupModal->SpawnMouseY = _Pointer->getY(); + } + } + else + { + // default for group not modal. Backward compatibility + mwi.ModalExitClickOut = false; + mwi.ModalExitClickL = false; + mwi.ModalExitClickR = false; + mwi.ModalExitKeyPushed = false; + } + + _ModalStack.push_back(mwi); + + // update coords and activate the modal + mwi.ModalWindow->invalidateCoords(); + mwi.ModalWindow->setActive(true); + setTopWindow(mwi.ModalWindow); + } +} + +// ------------------------------------------------------------------------------------------------ +void CWidgetManager::pushModalWindow(CCtrlBase *ctrlLaunchingModal, const std::string &groupName) +{ + CInterfaceGroup *group= dynamic_cast( getElementFromId(groupName) ); + if(group) + { + // enable the modal + enableModalWindow(ctrlLaunchingModal, group); + } +} + +// ------------------------------------------------------------------------------------------------ +void CWidgetManager::popModalWindow() +{ + if (!_ModalStack.empty()) + { + SModalWndInfo winInfo = _ModalStack.back(); + _ModalStack.pop_back(); // must pop back as early as possible because 'setActive' may trigger another 'popModalWindow', leading to a crash + if(winInfo.ModalWindow) + { + setBackWindow(winInfo.ModalWindow); + winInfo.ModalWindow->setActive(false); + } + if (!_ModalStack.empty()) + { + if(_ModalStack.back().ModalWindow) + { + _ModalStack.back().ModalWindow->setActive(true); + setTopWindow(_ModalStack.back().ModalWindow); + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +void CWidgetManager::popModalWindowCategory(const std::string &category) +{ + for(;;) + { + if (_ModalStack.empty()) break; + if (!_ModalStack.back().ModalWindow) break; + CGroupModal *gm = dynamic_cast((CInterfaceGroup*)(_ModalStack.back().ModalWindow)); + if (gm && gm->Category == category) + { + _ModalStack.back().ModalWindow->setActive(false); + _ModalStack.pop_back(); + } + else + { + break; + } + } +} CWidgetManager::CWidgetManager() { + _Pointer = NULL; + curContextHelp = NULL; } CWidgetManager::~CWidgetManager() @@ -363,4 +711,7 @@ CWidgetManager::~CWidgetManager() { delete _MasterGroups[i].Group; } + + _Pointer = NULL; + curContextHelp = NULL; } \ No newline at end of file diff --git a/code/ryzom/client/src/interface_v3/widget_manager.h b/code/ryzom/client/src/interface_v3/widget_manager.h index d70fcc99e..76d03b514 100644 --- a/code/ryzom/client/src/interface_v3/widget_manager.h +++ b/code/ryzom/client/src/interface_v3/widget_manager.h @@ -23,13 +23,16 @@ #include "nel/misc/types_nl.h" #include "nel/gui/interface_common.h" +class CInterfaceElement; +class CCtrlBase; class CInterfaceGroup; +class CViewPointer; /// Manages the GUI widgets class CWidgetManager{ public: - + // Master groups encapsulate all windows struct SMasterGroup { SMasterGroup() @@ -59,6 +62,32 @@ public: }; + // Infos about a modal window. + struct SModalWndInfo + { + // Yoyo: store as CRefPtr in case they are deleted (can happen for instance if menu right click on a guild memeber, and guild members are udpated after) + NLMISC::CRefPtr< CInterfaceGroup > ModalWindow; // the current modal window + NLMISC::CRefPtr< CCtrlBase > CtrlLaunchingModal; + bool ModalClip; + bool ModalExitClickOut; + bool ModalExitClickL; + bool ModalExitClickR; + bool ModalExitKeyPushed; + std::string ModalHandlerClickOut; + std::string ModalClickOutParams; + + SModalWndInfo() + { + ModalWindow = NULL; + CtrlLaunchingModal = NULL; + ModalExitClickOut = false; + ModalExitClickL = false; + ModalExitClickR = false; + ModalExitKeyPushed = false; + } + }; + + static CWidgetManager* getInstance(); static void release(); @@ -70,14 +99,94 @@ public: void removeWindowFromMasterGroup( const std::string &sMasterGroupName, CInterfaceGroup *pIG ); void removeAllMasterGroups(); + void activateMasterGroup (const std::string &sMasterGroupName, bool bActive); + + CInterfaceElement* getElementFromId( const std::string &sEltId ); + CInterfaceElement* getElementFromId( const std::string &sStart, const std::string &sEltId ); + + /// Get the window from an element (ui:interface:###) + CInterfaceGroup* getWindow(CInterfaceElement*); + + + /** + * set the top window + * \param win : pointer to the window to be set on top + */ + void setTopWindow (CInterfaceGroup *pWin); + + /** + * set the back window + * \param win : pointer to the window to be set on top + */ + void setBackWindow (CInterfaceGroup *pWin); + + /** get the top window in the first activated masterGroup + */ + CInterfaceGroup* getTopWindow (uint8 nPriority = WIN_PRIORITY_NORMAL) const; + + /** get the back window in the first activated masterGroup + */ + CInterfaceGroup* getBackWindow (uint8 nPriority = WIN_PRIORITY_NORMAL) const; + + /** get the last escapable top window in the first activated masterGroup + */ + CInterfaceGroup* getLastEscapableTopWindow() const; + + void setWindowPriority (CInterfaceGroup *pWin, uint8 nPriority); + + /** return the priority of the Last Window setTopWindow()-ed. + */ + uint8 getLastTopWindowPriority() const; + + bool hasModal() const; + + SModalWndInfo& getModal(); + + bool isPreviousModal( CInterfaceGroup *wnd ) const; + + void enableModalWindow (CCtrlBase *ctrlLaunchingModal, CInterfaceGroup *pIG); + void enableModalWindow (CCtrlBase *ctrlLaunchingModal, const std::string &groupName); + // Disable all modals windows + void disableModalWindow (); + + /** Push a modal window that becomes the current modal window + */ + void pushModalWindow(CCtrlBase *ctrlLaunchingModal, CInterfaceGroup *pIG); + void pushModalWindow (CCtrlBase *ctrlLaunchingModal, const std::string &groupName); + void popModalWindow(); + // pop all top modal windows with the given category (a string stored in the modal) + void popModalWindowCategory(const std::string &category); + + CCtrlBase *getCtrlLaunchingModal () + { + if (_ModalStack.empty()) return NULL; + return _ModalStack.back().CtrlLaunchingModal; + } + /// get the currently active modal window, or NULL if none + CInterfaceGroup *getModalWindow() const + { + if (_ModalStack.empty()) return NULL; + return _ModalStack.back().ModalWindow; + } + + void setCurContextHelp( CCtrlBase *curContextHelp ){ this->curContextHelp = curContextHelp; } + CCtrlBase* getCurContextHelp(){ return curContextHelp; } + + float _DeltaTimeStopingContextHelp; + + CViewPointer* getPointer(){ return _Pointer; } + void setPointer( CViewPointer *pointer ){ _Pointer = pointer; } + private: CWidgetManager(); ~CWidgetManager(); static CWidgetManager *instance; - - // Master groups encapsulate all windows std::vector< SMasterGroup > _MasterGroups; + std::vector< SModalWndInfo > _ModalStack; + static std::string _CtrlLaunchingModalId; + NLMISC::CRefPtr< CCtrlBase > curContextHelp; + CViewPointer *_Pointer; }; #endif diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index ef014f6bc..1457aa396 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -162,7 +162,7 @@ static void errorMessageBox(const ucstring &msg) void createOptionalCatUI() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *pList = dynamic_cast(pIM->getElementFromId(GROUP_LIST_CAT)); + CInterfaceGroup *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_CAT)); if (pList == NULL) { nlwarning("element "GROUP_LIST_CAT" not found probably bad login_main.xml"); @@ -229,7 +229,7 @@ void initEula() static void setDataScanLog(const ucstring &text) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId("ui:login:datascan:content:log_txt:log")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:datascan:content:log_txt:log")); if (pVT != NULL) { pVT->setText(text); @@ -240,10 +240,10 @@ static void setDataScanLog(const ucstring &text) static void setDataScanState(const ucstring &text, ucstring progress= ucstring()) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId("ui:login:datascan:content:state")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:datascan:content:state")); if (pVT != NULL) pVT->setText(text); - pVT = dynamic_cast(pIM->getElementFromId("ui:login:datascan:content:progress")); + pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:datascan:content:progress")); if (pVT != NULL) pVT->setText(progress); } @@ -280,7 +280,7 @@ void initReboot() static void setPatcherStateText(const std::string &baseUIPath, const ucstring &str) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId(baseUIPath + ":content:state")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(baseUIPath + ":content:state")); if (pVT != NULL) { pVT->setText(str); @@ -291,7 +291,7 @@ static void setPatcherStateText(const std::string &baseUIPath, const ucstring &s static void setPatcherProgressText(const std::string &baseUIPath, const ucstring &str) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId(baseUIPath + ":content:progress")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(baseUIPath + ":content:progress")); if (pVT != NULL) { pVT->setText(str); @@ -657,7 +657,7 @@ void loginMainLoop() } } - CViewText *pVT = dynamic_cast(pIM->getElementFromId(VIEW_TOTAL_SIZE_PATCH)); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(VIEW_TOTAL_SIZE_PATCH)); ucstring sTmp; sTmp = BGDownloader::getWrittenSize(currentPatchingSize); sTmp += " / " + BGDownloader::getWrittenSize(totalPatchSize); @@ -672,7 +672,7 @@ void loginMainLoop() uint32 nNonOptSize = 0; TotalPatchSize = 0; vector ReqCat; - CInterfaceGroup *pList = dynamic_cast(pIM->getElementFromId(GROUP_LIST_CAT)); + CInterfaceGroup *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_CAT)); if (pList != NULL) { for(uint i = 0; i < InfoOnPatch.OptCat.size(); i++) @@ -709,10 +709,10 @@ void loginMainLoop() TotalPatchSize += nNonOptSize; // Total size of the patches is optional cats + required cat (f(optCat)) + non opt cat - CViewText *pVT = dynamic_cast(pIM->getElementFromId(VIEW_TOTAL_SIZE)); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(VIEW_TOTAL_SIZE)); if (pVT != NULL) pVT->setText(BGDownloader::getWrittenSize(TotalPatchSize)); - pVT = dynamic_cast(pIM->getElementFromId(VIEW_NON_OPTIONAL_SIZE)); + pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(VIEW_NON_OPTIONAL_SIZE)); if (pVT != NULL) pVT->setText(BGDownloader::getWrittenSize(nNonOptSize)); } } @@ -739,7 +739,7 @@ void initLoginScreen() if(!l.empty()) { - CGroupEditBox *pGEB = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_LOGIN)); + CGroupEditBox *pGEB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_LOGIN)); if (pGEB != NULL && (pGEB->getInputString().empty())) { pGEB->setInputString(l); @@ -752,7 +752,7 @@ void initLoginScreen() } - CCtrlTextButton *pCB = dynamic_cast(pIM->getElementFromId(CTRL_BUTTON_CONNECT)); + CCtrlTextButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_BUTTON_CONNECT)); if (pCB != NULL) pCB->setActive(false); loginFinished = false; @@ -762,8 +762,8 @@ void initLoginScreen() void initAutoLogin() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupEditBox *pGEBLog = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_LOGIN)); - CGroupEditBox *pGEBPwd = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_PASSWORD)); + CGroupEditBox *pGEBLog = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_LOGIN)); + CGroupEditBox *pGEBPwd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_PASSWORD)); pGEBLog->setInputString(LoginLogin); pGEBPwd->setInputString(LoginPassword); pIM->runActionHandler("on_login", NULL, ""); @@ -831,17 +831,17 @@ bool login() // NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_WEBSTART); // // // hide 'back to login' button -// CInterfaceElement *backToLogin = pIM->getElementFromId(CTRL_BUTTON_BACKTOLOGIN); +// CInterfaceElement *backToLogin = CWidgetManager::getInstance()->getElementFromId(CTRL_BUTTON_BACKTOLOGIN); // if (backToLogin) // backToLogin->setActive(false); // // // show 'reload test page' button -// CInterfaceElement *reloadTest = pIM->getElementFromId(CTRL_BUTTON_RELOADTESTPAGE); +// CInterfaceElement *reloadTest = CWidgetManager::getInstance()->getElementFromId(CTRL_BUTTON_RELOADTESTPAGE); // if (reloadTest) // reloadTest->setActive(true); // // // start the browser -// CGroupHTML *pGH = dynamic_cast(pIM->getElementFromId(GROUP_BROWSER)); +// CGroupHTML *pGH = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_BROWSER)); // // pGH->browse(ClientCfg.TestBrowserUrl.c_str()); // @@ -866,7 +866,7 @@ bool login() // // if(!l.empty()) // { -// CGroupEditBox *pGEB = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_LOGIN)); +// CGroupEditBox *pGEB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_LOGIN)); // if (pGEB != NULL) // pGEB->setInputString(l); // pIM->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_PASSWORD "|select_all=false"); @@ -877,7 +877,7 @@ bool login() // } ShardSelected = -1; -// CCtrlTextButton *pCB = dynamic_cast(pIM->getElementFromId(CTRL_BUTTON_CONNECT)); +// CCtrlTextButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_BUTTON_CONNECT)); // if (pCB != NULL) pCB->setActive(false); // // loginFinished = false; @@ -887,8 +887,8 @@ bool login() // if (!LoginLogin.empty()) // { // CInterfaceManager *pIM = CInterfaceManager::getInstance(); -// CGroupEditBox *pGEBLog = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_LOGIN)); -// CGroupEditBox *pGEBPwd = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_PASSWORD)); +// CGroupEditBox *pGEBLog = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_LOGIN)); +// CGroupEditBox *pGEBPwd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_PASSWORD)); // pGEBLog->setInputString(LoginLogin); // pGEBPwd->setInputString(LoginPassword); // pIM->runActionHandler("on_login", NULL, ""); @@ -1031,7 +1031,7 @@ void initShardDisplay() CInterfaceManager *pIM = CInterfaceManager::getInstance(); NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_SHARDDISP); - CInterfaceGroup *pList = dynamic_cast(pIM->getElementFromId(GROUP_LIST_SHARD)); + CInterfaceGroup *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_SHARD)); if (pList == NULL) { nlwarning("element "GROUP_LIST_SHARD" not found probably bad login_main.xml"); @@ -1087,7 +1087,7 @@ void initShardDisplay() // UI Patch if (!Shards.empty()) { - CCtrlButton *pCB = dynamic_cast(pIM->getElementFromId(GROUP_LIST_SHARD ":s0:but")); + CCtrlButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_SHARD ":s0:but")); if (pCB != NULL) pCB->setPushed(true); pIM->runActionHandler (pCB->getActionOnLeftClick(), pCB, pCB->getParamsOnLeftClick()); @@ -1147,7 +1147,7 @@ void onlogin(bool vanishScreen = true) // // CInterfaceManager *pIM = CInterfaceManager::getInstance(); // // start the browser -// CGroupHTML *pGH = dynamic_cast(pIM->getElementFromId(GROUP_BROWSER)); +// CGroupHTML *pGH = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_BROWSER)); // // pGH->browse(RingMainURL.c_str()); // } @@ -1158,7 +1158,7 @@ void onlogin(bool vanishScreen = true) // NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_SHARDDISP); } -// CInterfaceGroup *pList = dynamic_cast(pIM->getElementFromId(GROUP_LIST_SHARD)); +// CInterfaceGroup *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_SHARD)); // if (pList == NULL) // { // nlwarning("element "GROUP_LIST_SHARD" not found probably bad login_main.xml"); @@ -1214,7 +1214,7 @@ void onlogin(bool vanishScreen = true) // // UI Patch // if (!Shards.empty()) // { -// CCtrlButton *pCB = dynamic_cast(pIM->getElementFromId(GROUP_LIST_SHARD ":s0:but")); +// CCtrlButton *pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_SHARD ":s0:but")); // if (pCB != NULL) // pCB->setPushed(true); // pIM->runActionHandler (pCB->getActionOnLeftClick(), pCB, pCB->getParamsOnLeftClick()); @@ -1248,8 +1248,8 @@ class CAHOnLogin : public IActionHandler CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupEditBox *pGEBLog = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_LOGIN)); - CGroupEditBox *pGEBPwd = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_PASSWORD)); + CGroupEditBox *pGEBLog = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_LOGIN)); + CGroupEditBox *pGEBPwd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_PASSWORD)); if ((pGEBLog == NULL) || (pGEBPwd == NULL)) { nlwarning("element "CTRL_EDITBOX_LOGIN" or "CTRL_EDITBOX_PASSWORD" not found probably bad login_main.xml"); @@ -1325,9 +1325,9 @@ class CAHLoginTab : public IActionHandler CCtrlBase *pNewCB; string sID = pCB->getId(); if (sID == CTRL_EDITBOX_LOGIN) - pNewCB = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_PASSWORD)); + pNewCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_PASSWORD)); else - pNewCB = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_LOGIN)); + pNewCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_LOGIN)); pIM->setCaptureKeyboard(pNewCB); } } @@ -1339,13 +1339,13 @@ class CAHLoginTab : public IActionHandler CCtrlBase *pNewCB; string sID = pCB->getId(); if (sID == CTRL_EDITBOX_CREATEACCOUNT_LOGIN) - pNewCB = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_CREATEACCOUNT_PASSWORD)); + pNewCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_CREATEACCOUNT_PASSWORD)); else if (sID == CTRL_EDITBOX_CREATEACCOUNT_PASSWORD) - pNewCB = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_CREATEACCOUNT_CONFIRMPASSWORD)); + pNewCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_CREATEACCOUNT_CONFIRMPASSWORD)); else if (sID == CTRL_EDITBOX_CREATEACCOUNT_CONFIRMPASSWORD) - pNewCB = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_CREATEACCOUNT_EMAIL)); + pNewCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_CREATEACCOUNT_EMAIL)); else - pNewCB = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_CREATEACCOUNT_LOGIN)); + pNewCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_CREATEACCOUNT_LOGIN)); pIM->setCaptureKeyboard(pNewCB); } } @@ -1367,7 +1367,7 @@ class CAHShardSelect : public IActionHandler // Unselect if (ShardSelected != -1) { - pCB = dynamic_cast(pIM->getElementFromId(GROUP_LIST_SHARD ":s"+toString(ShardSelected)+":but")); + pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_SHARD ":s"+toString(ShardSelected)+":but")); if (pCB != NULL) pCB->setPushed(false); } @@ -1383,7 +1383,7 @@ class CAHShardSelect : public IActionHandler pCB->setPushed(true); } - CCtrlTextButton *pCTB = dynamic_cast(pIM->getElementFromId(CTRL_BUTTON_CONNECT)); + CCtrlTextButton *pCTB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_BUTTON_CONNECT)); if (pCTB != NULL) pCTB->setActive(true); } @@ -1533,7 +1533,7 @@ void initPatch() // Get the list of optional categories to patch vector vCategories; - CInterfaceGroup *pList = dynamic_cast(pIM->getElementFromId(GROUP_LIST_CAT)); + CInterfaceGroup *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_CAT)); if (pList == NULL) { nlwarning("element "GROUP_LIST_CAT" not found probably bad login_main.xml"); @@ -1573,7 +1573,7 @@ void initPatch() } NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_PATCHING); - CInterfaceElement *closeBtn = pIM->getElementFromId(CTRL_BUTTON_CLOSE_PATCH); + CInterfaceElement *closeBtn = CWidgetManager::getInstance()->getElementFromId(CTRL_BUTTON_CLOSE_PATCH); if (closeBtn) closeBtn->setActive(false); @@ -1597,7 +1597,7 @@ class CAHLoginPatch : public IActionHandler // // Get the list of optional categories to patch // vector vCategories; // -// CInterfaceGroup *pList = dynamic_cast(pIM->getElementFromId(GROUP_LIST_CAT)); +// CInterfaceGroup *pList = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_LIST_CAT)); // if (pList == NULL) // { // nlwarning("element "GROUP_LIST_CAT" not found probably bad login_main.xml"); @@ -1666,7 +1666,7 @@ class CAHSetReleaseNote : public IActionHandler string sShard = getParam(sParams, "shard"); string sGroupHtml = getParam(sParams, "group"); - CGroupHTML *pQH = dynamic_cast(pIM->getElementFromId(sGroupHtml)); + CGroupHTML *pQH = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(sGroupHtml)); if (pQH == NULL) return; @@ -1761,7 +1761,7 @@ class CAHAcceptEula : public IActionHandler // NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_WEBSTART); // // // start the browser -// CGroupHTML *pGH = dynamic_cast(pIM->getElementFromId(GROUP_BROWSER)); +// CGroupHTML *pGH = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GROUP_BROWSER)); // // pGH->browse(RingMainURL.c_str()); // } @@ -1912,7 +1912,7 @@ class CAHInitResLod : public IActionHandler CurrentMode = 1; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId("ui:login:checkpass:content:res_value")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:checkpass:content:res_value")); if (pVT != NULL) pVT->setHardText(StringModeList[CurrentMode]); @@ -1989,7 +1989,7 @@ class CAHInitResLod : public IActionHandler else if (nPreset&8) CurrentPreset = 3; } - pVT = dynamic_cast(pIM->getElementFromId("ui:login:checkpass:content:lod_value")); + pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:checkpass:content:lod_value")); if (pVT != NULL) pVT->setHardText(StringPresetList[CurrentPreset]); } @@ -2005,7 +2005,7 @@ class CAHMoreRes : public IActionHandler if (CurrentMode < ((sint)StringModeList.size()-1)) CurrentMode++; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId("ui:login:checkpass:content:res_value")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:checkpass:content:res_value")); if (pVT != NULL) pVT->setHardText(StringModeList[CurrentMode]); } @@ -2021,7 +2021,7 @@ class CAHLessRes : public IActionHandler if (CurrentMode > 0) CurrentMode--; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId("ui:login:checkpass:content:res_value")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:checkpass:content:res_value")); if (pVT != NULL) pVT->setHardText(StringModeList[CurrentMode]); } @@ -2037,7 +2037,7 @@ class CAHMoreLod : public IActionHandler if (CurrentPreset < ((sint)StringPresetList.size()-1)) CurrentPreset++; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId("ui:login:checkpass:content:lod_value")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:checkpass:content:lod_value")); if (pVT != NULL) pVT->setHardText(StringPresetList[CurrentPreset]); } @@ -2053,7 +2053,7 @@ class CAHLessLod : public IActionHandler if (CurrentPreset > 0) CurrentPreset--; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CViewText *pVT = dynamic_cast(pIM->getElementFromId("ui:login:checkpass:content:lod_value")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:checkpass:content:lod_value")); if (pVT != NULL) pVT->setHardText(StringPresetList[CurrentPreset]); } @@ -2168,7 +2168,7 @@ class CAHOnScanDataClose : public IActionHandler // // // Give focus to password if some login entered // string loginEB; -// CGroupEditBox *pGEB = dynamic_cast(pIM->getElementFromId(CTRL_EDITBOX_LOGIN)); +// CGroupEditBox *pGEB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CTRL_EDITBOX_LOGIN)); // if(pGEB) // loginEB= pGEB->getInputStringAsStdString(); // // if none entered @@ -2234,7 +2234,7 @@ bool initCreateAccount() CInterfaceManager *pIM = CInterfaceManager::getInstance(); // reset UI - CInterfaceGroup *createAccountUI = dynamic_cast(pIM->getElementFromId("ui:login:create_account")); + CInterfaceGroup *createAccountUI = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:create_account")); if(createAccountUI) { // show "submit interface", hide "login interface" @@ -2372,7 +2372,7 @@ class CAHCreateAccountRules : public IActionHandler nlinfo("CAHCreateAccountRules called"); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *createAccountUI = dynamic_cast(pIM->getElementFromId("ui:login:create_account")); + CInterfaceGroup *createAccountUI = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:create_account")); if(createAccountUI) { CInterfaceGroup * rulesGr = dynamic_cast(createAccountUI->findFromShortId("rules_gr")); @@ -2426,7 +2426,7 @@ class CAHOnCreateAccountSubmit : public IActionHandler CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *createAccountUI = dynamic_cast(pIM->getElementFromId("ui:login:create_account")); + CInterfaceGroup *createAccountUI = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:create_account")); if(createAccountUI) { // recover data from UI @@ -2589,7 +2589,7 @@ class CAHCreateAccountLogin : public IActionHandler CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *createAccountUI = dynamic_cast(pIM->getElementFromId("ui:login:create_account")); + CInterfaceGroup *createAccountUI = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:create_account")); if(createAccountUI) { CGroupEditBox * eb = dynamic_cast(createAccountUI->findFromShortId("eb_login:eb")); diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index 4989b3f71..1abf1dc28 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -1310,44 +1310,44 @@ void updateGameQuitting() // update the window CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CInterfaceGroup *group= dynamic_cast(pIM->getElementFromId("ui:interface:free_trial_game_quitting")); + CInterfaceGroup *group= dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:free_trial_game_quitting")); if(group) { // if Free trial if(paying_account_request) { // if no current modal window, or if not the quit window - if(group != pIM->getModalWindow()) + if(group != CWidgetManager::getInstance()->getModalWindow()) { // disable - pIM->disableModalWindow(); - pIM->enableModalWindow(NULL, group); + CWidgetManager::getInstance()->disableModalWindow(); + CWidgetManager::getInstance()->enableModalWindow(NULL, group); } } else { // if the current modal window is the quit window, disable - if(group == pIM->getModalWindow()) + if(group == CWidgetManager::getInstance()->getModalWindow()) { // disable - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } } } - group= dynamic_cast(pIM->getElementFromId("ui:interface:game_quitting")); + group= dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:game_quitting")); if(group) { // if exit request if(game_exit_request && !paying_account_request) { // if no current modal window, or if not the quit window - if(group != pIM->getModalWindow()) + if(group != CWidgetManager::getInstance()->getModalWindow()) { // disable - pIM->disableModalWindow(); - pIM->enableModalWindow(NULL, group); + CWidgetManager::getInstance()->disableModalWindow(); + CWidgetManager::getInstance()->enableModalWindow(NULL, group); bool farTPing = FarTP.isFarTPInProgress(); // Far TP: skipping not allowed (because we can't duplicate the avatar...), anyway the quit button would quit the game (no far tp) @@ -1370,10 +1370,10 @@ void updateGameQuitting() else { // if the current modal window is the quit window, disable - if(group == pIM->getModalWindow()) + if(group == CWidgetManager::getInstance()->getModalWindow()) { // disable - pIM->disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); } } } @@ -1738,7 +1738,7 @@ bool mainLoop() if(!pIMinstance->getViewRenderer().isMinimized()) { // Get the cursor instance - CViewPointer *cursor = pIMinstance->getPointer(); + CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); if(cursor) { // Get the pointer position (in pixel) @@ -1778,7 +1778,7 @@ bool mainLoop() { // When database received, activate allegiance buttons (for neutral state) in fame window CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *group = dynamic_cast(pIM->getElementFromId("ui:interface:fame:content:you")); + CInterfaceGroup *group = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:fame:content:you")); if (group) group->updateAllLinks(); // send a msg to lua for specific ui update @@ -4552,11 +4552,11 @@ void inGamePatchUncompleteWarning() im->executeLuaScript("bgdownloader:inGamePatchUncompleteWarning()"); /* CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *gc = dynamic_cast(im->getElementFromId("ui:interface:bg_downloader")); + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:bg_downloader")); if (gc) { gc->setActive(true); - im->setTopWindow(gc); + CWidgetManager::getInstance()->setTopWindow(gc); gc->enableBlink(2); } im->messageBoxWithHelp(CI18N::get("uiBGD_InGamePatchIncomplete")); diff --git a/code/ryzom/client/src/motion/modes/ai_mode.cpp b/code/ryzom/client/src/motion/modes/ai_mode.cpp index 779072e21..775aff68c 100644 --- a/code/ryzom/client/src/motion/modes/ai_mode.cpp +++ b/code/ryzom/client/src/motion/modes/ai_mode.cpp @@ -150,7 +150,7 @@ void CUserControls::aiMode() IM->enableMouseHandling(false); EventsListener.enableMouseSmoothing(true); // Get the cursor instance and hide. - CViewPointer *cursor = IM->getPointer(); + CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); if(cursor) { // Freelook mode. diff --git a/code/ryzom/client/src/motion/user_controls.cpp b/code/ryzom/client/src/motion/user_controls.cpp index 158465420..4697a0d5e 100644 --- a/code/ryzom/client/src/motion/user_controls.cpp +++ b/code/ryzom/client/src/motion/user_controls.cpp @@ -507,7 +507,7 @@ void CUserControls::freeLook(bool fullMode) // disable interface mouse handling. IM->enableMouseHandling(false); // Get the cursor instance - CViewPointer *cursor = IM->getPointer(); + CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); if(cursor) { // Hide the Cursor. @@ -590,7 +590,7 @@ void CUserControls::cameraLook(bool fullMode) // disable interface mouse handling. IM->enableMouseHandling(false); // Get the cursor instance - CViewPointer *cursor = IM->getPointer(); + CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); if(cursor) { // Hide the Cursor. diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 467991245..5ca5219d4 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -1073,7 +1073,7 @@ void setFakeNews () iname += table[i]; iname += "_friendly_main"; - CInterfaceGroup *inter = CInterfaceManager::getInstance()->getWindowFromId(iname); + CInterfaceGroup *inter = CWidgetManager::getInstance()->getWindowFromId(iname); if (inter == NULL) { nlwarning ("cant find interface 's%'", iname.c_str()); @@ -1098,7 +1098,7 @@ void setFakeNews () iname += table[i]; iname += "_neutral_main"; - CInterfaceGroup *inter = CInterfaceManager::getInstance()->getWindowFromId(iname); + CInterfaceGroup *inter = CWidgetManager::getInstance()->getWindowFromId(iname); if (inter == NULL) { nlwarning ("cant find interface 's%'", iname.c_str()); @@ -1119,7 +1119,7 @@ void setFakeNews () iname += table[i]; iname += "_more_news"; - CInterfaceGroup *inter = CInterfaceManager::getInstance()->getWindowFromId(iname); + CInterfaceGroup *inter = CWidgetManager::getInstance()->getWindowFromId(iname); if (inter == NULL) { nlwarning ("cant find interface 's%'", iname.c_str()); @@ -1230,7 +1230,7 @@ void impulseBotChatSetInterface(NLMISC::CBitMemStream &impulse) */ // TEMP FOR THE DEMO, DON'T USE THE NETWORK NEW BUT SELECT A NEWS HERE /* - CInterfaceGroup *inter = CInterfaceManager::getInstance()->getWindowFromId("ui:interface:bot_chat_intro"); + CInterfaceGroup *inter = CWidgetManager::getInstance()->getWindowFromId("ui:interface:bot_chat_intro"); nlassert (inter != NULL); inter->setActive(true); @@ -1254,7 +1254,7 @@ void impulseBotChatSetInterface(NLMISC::CBitMemStream &impulse) } else { - CInterfaceGroup *inter = CInterfaceManager::getInstance()->getWindowFromId(interfaceName); + CInterfaceGroup *inter = CWidgetManager::getInstance()->getWindowFromId(interfaceName); if (inter == NULL) { nlwarning ("Can't find interface name '%s' %d", interfaceName.c_str(), interfaceId); @@ -1715,10 +1715,10 @@ void impulseTeamShareOpen(NLMISC::CBitMemStream &impulse) { if (PermanentlyBanned) return; CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *gc = dynamic_cast( im->getElementFromId("ui:interface:team_share")); + CGroupContainer *gc = dynamic_cast( CWidgetManager::getInstance()->getElementFromId("ui:interface:team_share")); if (!gc) return; gc->setActive(true); - im->setTopWindow(gc); + CWidgetManager::getInstance()->setTopWindow(gc); gc->updateCoords(); gc->center(); }// impulseTeamShareOpen // @@ -1734,7 +1734,7 @@ void impulseTeamShareInvalid(NLMISC::CBitMemStream &impulse) { if (PermanentlyBanned) return; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CCtrlTextButton *pTB = dynamic_cast(pIM->getElementFromId("ui:interface:team_share:content:ok")); + CCtrlTextButton *pTB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:team_share:content:ok")); if (pTB != NULL) pTB->setActive(true); }// impulseTeamShareInvalid // @@ -1748,10 +1748,10 @@ void impulseTeamShareClose(NLMISC::CBitMemStream &impulse) if (PermanentlyBanned) return; CInterfaceManager *pIM = CInterfaceManager::getInstance(); CGroupContainer - *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:team_share")); + *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:team_share")); if (pGC != NULL) pGC->setActive(false); - CCtrlTextButton *pTB = dynamic_cast(pIM->getElementFromId("ui:interface:team_share:content:ok")); + CCtrlTextButton *pTB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:team_share:content:ok")); if (pTB != NULL) pTB->setActive(true); }// impulseTeamShareClose // @@ -1932,13 +1932,13 @@ void impulseGuildJoinProposal(NLMISC::CBitMemStream &impulse) CGuildManager::getInstance()->launchJoinProposal(phraseID); /*//activate the pop up window CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *gc = dynamic_cast( im->getElementFromId("ui:interface:join_guild_proposal")); + CGroupContainer *gc = dynamic_cast( CWidgetManager::getInstance()->getElementFromId("ui:interface:join_guild_proposal")); if (!gc) return; CViewText *vt = dynamic_cast(gc->getView("invitor_name")); if (vt == NULL) return; vt->setText(invitor); gc->setActive(true); - im->setTopWindow(gc); + CWidgetManager::getInstance()->setTopWindow(gc); gc->updateCoords(); gc->center(); gc->enableBlink(2);*/ @@ -1975,13 +1975,13 @@ void impulseEnterCrZoneProposal(NLMISC::CBitMemStream &impulse) //activate the pop up window CInterfaceManager *im = CInterfaceManager::getInstance(); - CGroupContainer *gc = dynamic_cast( im->getElementFromId("ui:interface:enter_crzone_proposal")); + CGroupContainer *gc = dynamic_cast( CWidgetManager::getInstance()->getElementFromId("ui:interface:enter_crzone_proposal")); if (!gc) return; CViewTextID *vti = dynamic_cast(gc->getView("phrase")); if (!vti) return; vti->setTextId(phraseID); gc->setActive(true); - im->setTopWindow(gc); + CWidgetManager::getInstance()->setTopWindow(gc); gc->updateCoords(); gc->center(); gc->enableBlink(2); @@ -1995,7 +1995,7 @@ void impulseCloseEnterCrZoneProposal(NLMISC::CBitMemStream &impulse) { // hide interface CInterfaceManager* pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *pIG = (CInterfaceGroup*)pIM->getElementFromId ("ui:interface:enter_crzone_proposal"); + CInterfaceGroup *pIG = (CInterfaceGroup*)CWidgetManager::getInstance()->getElementFromId ("ui:interface:enter_crzone_proposal"); if(pIG) pIG->setActive(false); }// impulseCloseEnterCrZoneProposal // @@ -2012,14 +2012,14 @@ void impulseExchangeInvitation(NLMISC::CBitMemStream &impulse) CInterfaceManager* iMngr = CInterfaceManager::getInstance(); // show the modal window that allow the player to accept / decline the invitation - CGroupContainer *wnd = dynamic_cast(iMngr->getElementFromId(PLAYER_EXCHANGE_INVITATION_DIALOG)); + CGroupContainer *wnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(PLAYER_EXCHANGE_INVITATION_DIALOG)); if (wnd) { wnd->setActive(true); wnd->updateCoords(); wnd->center(); wnd->enableBlink(2); - iMngr->setTopWindow(wnd); + CWidgetManager::getInstance()->setTopWindow(wnd); } CViewTextID *vti = dynamic_cast(wnd->getView("invite_phrase")); @@ -2038,7 +2038,7 @@ void impulseExchangeCloseInvitation(NLMISC::CBitMemStream &impulse) if (PermanentlyBanned) return; CInterfaceManager* iMngr = CInterfaceManager::getInstance(); // hide the modal window that allow the player to accept / decline the invitation - CInterfaceGroup *wnd = dynamic_cast(iMngr->getElementFromId(PLAYER_EXCHANGE_INVITATION_DIALOG)); + CInterfaceGroup *wnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(PLAYER_EXCHANGE_INVITATION_DIALOG)); if (wnd) wnd->setActive(false); } @@ -2310,7 +2310,7 @@ void impulseBotChatForceEnd(NLMISC::CBitMemStream &impulse) CGroupContainer *getMissionCompletedContainer() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceElement *pIE = pIM->getElementFromId(MC_M_CONTAINER); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(MC_M_CONTAINER); CGroupContainer *pGCM = dynamic_cast(pIE); if (pGCM == NULL) return NULL; @@ -2899,7 +2899,7 @@ void impulseDeathRespawnPoint (NLMISC::CBitMemStream &impulse) impulse.serial(msg); if (PermanentlyBanned) return; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupMap *pMap = dynamic_cast(pIM->getElementFromId("ui:interface:respawn_map:content:map_content:actual_map")); + CGroupMap *pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:respawn_map:content:map_content:actual_map")); if (pMap == NULL) { nlwarning("problem cannot find ui:interface:respawn_map:content:map_content:actual_map"); @@ -2908,7 +2908,7 @@ void impulseDeathRespawnPoint (NLMISC::CBitMemStream &impulse) pMap->addRespawnPoints(msg); - pMap = dynamic_cast(pIM->getElementFromId("ui:interface:map:content:map_content:actual_map")); + pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); if (pMap == NULL) { nlwarning("problem cannot find ui:interface:map:content:map_content:actual_map"); @@ -2938,13 +2938,13 @@ void impulseDuelInvitation(NLMISC::CBitMemStream &impulse) //activate the pop up window CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:join_duel_proposal")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_duel_proposal")); if (pGC == NULL) return; CViewTextID *pVTID = dynamic_cast(pGC->getView("invitor_name")); if (pVTID == NULL) return; pVTID->setTextId(textID); pGC->setActive(true); - pIM->setTopWindow(pGC); + CWidgetManager::getInstance()->setTopWindow(pGC); pGC->updateCoords(); pGC->center(); pGC->enableBlink(2); @@ -2961,7 +2961,7 @@ void impulseDuelCancelInvitation(NLMISC::CBitMemStream &impulse) //activate the pop up window CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:join_duel_proposal")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_duel_proposal")); if (pGC == NULL) return; pGC->setActive(false); @@ -2981,13 +2981,13 @@ void impulsePVPChallengeInvitation(NLMISC::CBitMemStream &impulse) //activate the pop up window CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:join_pvp_challenge_proposal")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_challenge_proposal")); if (pGC == NULL) return; CViewTextID *pVTID = dynamic_cast(pGC->getView("invitor_name")); if (pVTID == NULL) return; pVTID->setTextId(textID); pGC->setActive(true); - pIM->setTopWindow(pGC); + CWidgetManager::getInstance()->setTopWindow(pGC); pGC->updateCoords(); pGC->center(); pGC->enableBlink(2); @@ -3003,7 +3003,7 @@ void impulsePVPChallengeCancelInvitation(NLMISC::CBitMemStream &impulse) //activate the pop up window CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:join_pvp_challenge_proposal")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_challenge_proposal")); if (pGC == NULL) return; pGC->setActive(false); @@ -3075,16 +3075,16 @@ void impulsePVPChooseClan(NLMISC::CBitMemStream &impulse) //activate the pop up window CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:join_pvp_clan_proposal")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_clan_proposal")); if (pGC == NULL) return; pGC->setActive(true); - CCtrlTextButton * butClan1 = dynamic_cast(pIM->getElementFromId("ui:interface:join_pvp_clan_proposal:content:clan1")); + CCtrlTextButton * butClan1 = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_clan_proposal:content:clan1")); if( butClan1 == NULL ) return; butClan1->setText( ucstring(EGSPD::CPeople::toString( clan1 )) ); - CCtrlTextButton * butClan2 = dynamic_cast(pIM->getElementFromId("ui:interface:join_pvp_clan_proposal:content:clan2")); + CCtrlTextButton * butClan2 = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_clan_proposal:content:clan2")); if( butClan2 == NULL ) return; butClan2->setText( ucstring(EGSPD::CPeople::toString( clan2 )) ); @@ -3137,7 +3137,7 @@ void impulseItemCloseRoomInventory(NLMISC::CBitMemStream &impulse) NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:INVENTORY_ROOM_OPENED")->setValue32(0); // deactivate the pop up window - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:inv_room")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:inv_room")); if (pGC == NULL) return; pGC->setActive(false); } @@ -3297,16 +3297,16 @@ private: string group = titleStr.toString(); // group = group.substr(9, group.size()-10); - groupHtml = dynamic_cast(pIM->getElementFromId("ui:interface:"+group+":content:html")); + groupHtml = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:"+group+":content:html")); if (!groupHtml) { - groupHtml = dynamic_cast(pIM->getElementFromId("ui:interface:webig:content:html")); + groupHtml = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:webig:content:html")); group = "webig"; } if (groupHtml) { - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:"+group)); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:"+group)); if (pGC) { if (contentStr.empty()) @@ -3320,14 +3320,14 @@ private: string url = contentStr.toString(); addWebIGParams(url, true); groupHtml->browse(url.c_str()); - pIM->setTopWindow(pGC); + CWidgetManager::getInstance()->setTopWindow(pGC); } } } } else { - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:server_message_box")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:server_message_box")); if (pGC) { // show the window with correct width @@ -3335,12 +3335,12 @@ private: pGC->setActive(true); // must set the text by hand - CViewText *vt= dynamic_cast(pIM->getElementFromId(pIM->getDefine("server_message_box_content_view_text"))); + CViewText *vt= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("server_message_box_content_view_text"))); if(vt) vt->setTextFormatTaged(contentStr); // open - pIM->setTopWindow(pGC); + CWidgetManager::getInstance()->setTopWindow(pGC); pGC->invalidateCoords(); // Yoyo: because of buggued group container, I found that 6 times is a good number.... for(uint i=0;i<6;i++) diff --git a/code/ryzom/client/src/outpost_manager.cpp b/code/ryzom/client/src/outpost_manager.cpp index 01b073cc9..1f6deb320 100644 --- a/code/ryzom/client/src/outpost_manager.cpp +++ b/code/ryzom/client/src/outpost_manager.cpp @@ -58,11 +58,11 @@ void COutpostManager::startPvpJoinProposal(bool playerGuildInConflict, bool play if(node) node->setValue32(_EndTickForPvpJoinProposal); // open Popup - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:join_pvp_outpost_proposal")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal")); if (pGC) { pGC->setActive(true); - pIM->setTopWindow(pGC); + CWidgetManager::getInstance()->setTopWindow(pGC); pGC->updateCoords(); pGC->updateCoords(); pGC->center(); @@ -108,7 +108,7 @@ void COutpostManager::update() pIM->runActionHandler("outpost_pvp_join", NULL, "neutral"); // close the window - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:join_pvp_outpost_proposal")); + CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:join_pvp_outpost_proposal")); if (pGC) pGC->setActive(false); diff --git a/code/ryzom/client/src/player_cl.cpp b/code/ryzom/client/src/player_cl.cpp index 69755bab2..fb1c4fbe0 100644 --- a/code/ryzom/client/src/player_cl.cpp +++ b/code/ryzom/client/src/player_cl.cpp @@ -683,7 +683,7 @@ void CPlayerCL::updateVisualPropertyVpa(const NLMISC::TGameCycle &/* gameCycle * // display the new title in player interface if (_Slot == 0) { - CViewText *pVT = dynamic_cast(IM->getElementFromId("ui:interface:player:header_opened:player_title")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:player:header_opened:player_title")); if (pVT != NULL) pVT->setText(_Title); } diff --git a/code/ryzom/client/src/r2/displayer_visual.cpp b/code/ryzom/client/src/r2/displayer_visual.cpp index 6caa4127f..3e49d57fa 100644 --- a/code/ryzom/client/src/r2/displayer_visual.cpp +++ b/code/ryzom/client/src/r2/displayer_visual.cpp @@ -442,7 +442,7 @@ void CDisplayerVisual::onPostRender() { // Link to the interface CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group); - CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); group->setParent(pRoot); if (pRoot) pRoot->addGroup (group); diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index 567a9a864..24b0cd302 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -615,7 +615,7 @@ void CEditor::clearDebugWindow() //H_AUTO(R2_CEditor_clearDebugWindow) CHECK_EDITOR getUI().flushDebugWindow(); - CGroupList *gl = dynamic_cast(getUI().getElementFromId("ui:interface:debug_info:content:cb:text_list")); + CGroupList *gl = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:debug_info:content:cb:text_list")); if (gl) { gl->deleteAllChildren(); @@ -1648,11 +1648,11 @@ void CEditor::waitScenarioScreen() setMode(GoingToEditionMode); } getUI().hideAllWindows(); - CInterfaceGroup *waitScreen = dynamic_cast(getUI().getElementFromId("ui:interface:r2ed_connecting")); + CInterfaceGroup *waitScreen = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_connecting")); if (waitScreen) { waitScreen->setActive(true); - getUI().setTopWindow(waitScreen); + CWidgetManager::getInstance()->setTopWindow(waitScreen); } // enum TState { WaitingScenario, WaitingTP, DoExit }; @@ -1669,7 +1669,7 @@ void CEditor::waitScenarioScreen() loadBackgroundBitmap (StartBackground); // patch for the 'sys info that pop' prb (cause unknown for now ...) - CInterfaceElement *sysInfo = getUI().getElementFromId("ui:interface:system_info"); + CInterfaceElement *sysInfo = CWidgetManager::getInstance()->getElementFromId("ui:interface:system_info"); bool sysInfoActive = false; if (sysInfo) sysInfoActive = sysInfo->getActive(); @@ -1718,7 +1718,7 @@ void CEditor::waitScenarioScreen() else { // Display the firewall alert string - CViewText *pVT = dynamic_cast(getUI().getElementFromId("ui:interface:r2ed_connecting:title")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_connecting:title")); if (pVT != NULL) pVT->setText(CI18N::get("uiFirewallAlert")+ucstring("...")); @@ -1767,7 +1767,7 @@ void CEditor::waitScenarioScreen() if (waitScreen) { - getUI().setTopWindow(waitScreen); + CWidgetManager::getInstance()->setTopWindow(waitScreen); } if (sysInfo) sysInfo->setActive(false); @@ -1807,7 +1807,7 @@ void CEditor::waitScenarioScreen() if ( firewallTimeout ) { // Display the firewall error string instead of the normal failure string - CViewText *pVT = dynamic_cast(getUI().getElementFromId("ui:interface:r2ed_connecting:title")); + CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_connecting:title")); if (pVT != NULL) { pVT->setMultiLine( true ); @@ -2350,7 +2350,7 @@ void CEditor::setMode(TMode mode) ContextCur.release(); _Mode = mode; loadKeySet(getKeySetPrefix(_Mode)); - getUI().disableModalWindow(); + CWidgetManager::getInstance()->disableModalWindow(); getUI().setCapturePointerLeft(NULL); getUI().setCapturePointerRight(NULL); getUI().setCaptureKeyboard(NULL); @@ -2578,7 +2578,7 @@ void CEditor::hideRingWindows() for (uint k = 0; k < sizeofarray(ringWindows); ++k) { std::string id = "ui:interface:" + std::string(ringWindows[k]); - CInterfaceElement *grp = getUI().getElementFromId(id); + CInterfaceElement *grp = CWidgetManager::getInstance()->getElementFromId(id); if (grp) { grp->setActive(false); @@ -5191,7 +5191,7 @@ void CEditor::onEditionModeConnected( uint32 userSlotId, uint32 adventureId, COb { setMode(EditionMode); } - CInterfaceGroup *currentSessionGroup = dynamic_cast(getUI().getElementFromId("ui:interface:r2ed_current_session")); + CInterfaceGroup *currentSessionGroup = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_current_session")); if (currentSessionGroup) { CViewText *text = dynamic_cast(currentSessionGroup->getView("current_session")); @@ -5242,7 +5242,7 @@ void CEditor::onAnimationModeConnected(const CClientMessageAdventureUserConnecti } - CInterfaceGroup *currentSessionGroup = dynamic_cast(getUI().getElementFromId("ui:interface:r2ed_current_session")); + CInterfaceGroup *currentSessionGroup = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_current_session")); if (currentSessionGroup) { CViewText *text = dynamic_cast(currentSessionGroup->getView("current_session")); @@ -6386,7 +6386,7 @@ void CEditor::connexionMsg(const std::string &stringId) // ignore if current ui desktop is not the third if (getUI().getMode() != 3) return; // show the connection window - CInterfaceGroup *r2ConnectWindow = dynamic_cast(getUI().getElementFromId("ui:interface:r2ed_connect")); + CInterfaceGroup *r2ConnectWindow = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_connect")); if (!r2ConnectWindow) return; if (stringId.empty()) { @@ -7330,9 +7330,9 @@ class CAHOpenScenarioControl : public IActionHandler CInterfaceGroup* wnd = NULL; if(!R2::getEditor().isInitialized()) - wnd = dynamic_cast(pIM->getElementFromId("ui:interface:ring_scenario_loading_window")); + wnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:ring_scenario_loading_window")); else - wnd = dynamic_cast(pIM->getElementFromId("ui:interface:r2ed_scenario_control")); + wnd = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_scenario_control")); if(wnd) { @@ -7425,7 +7425,7 @@ class CAHInviteCharacter : public IActionHandler if(sessionBrowser._LastInvokeResult == 14) { - CViewText* pVT = dynamic_cast(pIM->getElementFromId("ui:interface:warning_free_trial:text")); + CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) pVT->setText(CI18N::get("uiRingWarningInviteFreeTrial")); diff --git a/code/ryzom/client/src/r2/npc_editor.cpp b/code/ryzom/client/src/r2/npc_editor.cpp index 8317f92d7..5522b2014 100644 --- a/code/ryzom/client/src/r2/npc_editor.cpp +++ b/code/ryzom/client/src/r2/npc_editor.cpp @@ -52,7 +52,7 @@ CNPCEditor::~CNPCEditor() void CNPCEditor::updateNPCView(uint slot) { _NPCWindow = dynamic_cast( - CEditor::getUI().getElementFromId("ui:interface:r2ed_npc")); + CWidgetManager::getInstance()->getElementFromId("ui:interface:r2ed_npc")); if (!_NPCWindow) { nlwarning(" can't retrieve npc window, or bad type"); diff --git a/code/ryzom/client/src/r2/tool.cpp b/code/ryzom/client/src/r2/tool.cpp index eb5083806..4d3e890e2 100644 --- a/code/ryzom/client/src/r2/tool.cpp +++ b/code/ryzom/client/src/r2/tool.cpp @@ -155,7 +155,7 @@ uint32 CTool::getScreenHeight() void CTool::getMousePos(sint32 &x, sint32 &y) { //H_AUTO(R2_CTool_getMousePos) - CViewPointer *cursor = getUI().getPointer(); + CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); if(cursor == NULL) { x = y = -1; @@ -198,7 +198,7 @@ CGroupMap *CTool::getWorldMap() static volatile bool cacheTest = true; if (!mapPtr || !cacheTest) { - mapPtr = dynamic_cast(getUI().getElementFromId("ui:interface:map:content:map_content:actual_map")); + mapPtr = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); } return mapPtr; } @@ -752,7 +752,7 @@ bool CTool::isMouseCaptured() void CTool::setMouseCursor(const char *cursorTexture) { //H_AUTO(R2_CTool_setMouseCursor) - CViewPointer *cursor = getUI().getPointer(); + CViewPointer *cursor = CWidgetManager::getInstance()->getPointer(); if(cursor) { cursor->setCursor(cursorTexture); diff --git a/code/ryzom/client/src/session_browser_impl.cpp b/code/ryzom/client/src/session_browser_impl.cpp index 7828ed52a..b408686aa 100644 --- a/code/ryzom/client/src/session_browser_impl.cpp +++ b/code/ryzom/client/src/session_browser_impl.cpp @@ -219,7 +219,7 @@ int CSessionBrowserImpl::luaJoinRingSession(CLuaState &ls) if(sessionBrowser._LastJoinSessionResult == 20) { - CViewText* pVT = dynamic_cast(pIM->getElementFromId("ui:interface:warning_free_trial:text")); + CViewText* pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:warning_free_trial:text")); if (pVT != NULL) pVT->setText(CI18N::get("uiRingWarningFreeTrial")); pIM->runActionHandler("enter_modal", NULL, "group=ui:interface:warning_free_trial"); diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index 2a713554e..08d12fd0d 100644 --- a/code/ryzom/client/src/user_entity.cpp +++ b/code/ryzom/client/src/user_entity.cpp @@ -510,7 +510,7 @@ void CUserEntity::updateVisualPropertyName(const NLMISC::TGameCycle &gameCycle, /* if (oldNameId != _NameId) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceElement *element = pIM->getElementFromId("ui:interface:mailbox:content:html"); + CInterfaceElement *element = CWidgetManager::getInstance()->getElementFromId("ui:interface:mailbox:content:html"); if (element) { CGroupHTML *html = dynamic_cast(element); @@ -2667,7 +2667,7 @@ void CUserEntity::selection(const CLFECOMMON::TCLEntityId &slot) // virtual if (pPlayer) { /*// Pvp Mode - CViewBitmap * tagMode = dynamic_cast(pIM->getElementFromId("ui:interface:target:pvp_tags:mode")); + CViewBitmap * tagMode = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:target:pvp_tags:mode")); if (tagMode) { if (pPlayer->getPvpMode()&PVP_MODE::PvpFaction) @@ -2679,7 +2679,7 @@ void CUserEntity::selection(const CLFECOMMON::TCLEntityId &slot) // virtual } */ /*// Pvp available actions (attack, heal, both) - CViewBitmap * tagMode = dynamic_cast(pIM->getElementFromId("ui:interface:target:pvp_tags:actions")); + CViewBitmap * tagMode = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:target:pvp_tags:actions")); if (tagMode) { if (pPlayer->getPvpMode()&PVP_MODE::PvpFaction)