- Timestamp:
- Mar 6, 2011, 2:30:24 PM (14 years ago)
- Location:
- code/branches/usability
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/data/gui/scripts/SheetManager.lua
r8032 r8033 89 89 ["sheet"] = menuSheet, 90 90 ["bHidePrevious"] = bHidePrevious, 91 ["bNoInput"] = bNoInput 91 ["bNoInput"] = bNoInput, 92 ["name"] = name 92 93 } 93 94 table.insert(activeMenuSheets, sheetTuple) -- indexed array access … … 298 299 end 299 300 301 function getGUIFirstActive(name, bHidePrevious, bNoInput) 302 local sheet = activeMenuSheets.topSheetTuple 303 -- If the topmost gui sheet has the input name 304 if sheet ~= nil and sheet.name == name then 305 guiMgr:toggleGUIHelper(name, bHidePrevious, bNoInput, false); 306 else 307 guiMgr:toggleGUIHelper(name, bHidePrevious, bNoInput, true); 308 end 309 end 310 300 311 ---------------------- 301 312 --- Initialisation --- -
code/branches/usability/src/libraries/core/GUIManager.cc
r7994 r8033 105 105 SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false); 106 106 SetConsoleCommand("hideGUI", &GUIManager::hideGUI); 107 SetConsoleCommand("toggleGUI", &GUIManager::toggleGUI).defaultValue(1, false).defaultValue(2, false); 107 108 108 109 /** … … 282 283 { 283 284 GUIManager::getInstance().executeCode("hideMenuSheet(\"" + name + "\")"); 285 } 286 287 /** 288 @brief 289 Toggles specified GUI. 290 If the GUI with the input name is already shown and on the top, it is hidden, else it is shown. 291 */ 292 /*static*/ void GUIManager::toggleGUI(const std::string& name, bool bHidePrevious, bool bNoInput) 293 { 294 GUIManager::getInstance().executeCode("getGUIFirstActive(\"" + name + "\", " + multi_cast<std::string>(bHidePrevious) + ", " + multi_cast<std::string>(bNoInput) + ")"); 295 } 296 297 /** 298 @brief 299 Helper method to toggle a specified GUI. 300 Is called by lua. 301 */ 302 void GUIManager::toggleGUIHelper(const std::string& name, bool bHidePrevious, bool bNoInput, bool show) 303 { 304 if(show) 305 GUIManager::showGUI(name, bHidePrevious, bNoInput); 306 else 307 GUIManager::hideGUI(name); 284 308 } 285 309 -
code/branches/usability/src/libraries/core/GUIManager.h
r7874 r8033 88 88 void showGUIExtra(const std::string& name, const std::string& ptr, bool bHidePrevious = false, bool bNoInput = false); 89 89 static void hideGUI(const std::string& name); 90 static void toggleGUI(const std::string& name, bool bHidePrevious = false, bool bNoInput = false); 91 void toggleGUIHelper(const std::string& name, bool bHidePrevious, bool bNoInput, bool show); // tolua_export 90 92 void keyESC(); 91 93 void setBackgroundImage(const std::string& imageSet, const std::string imageName); // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.