MCPcopy Create free account
hub / github.com/MyGUI/mygui / updateRecentFilesMenu

Method updateRecentFilesMenu

Tools/LayoutEditor/MainMenuControl.cpp:155–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153 }
154
155 void MainMenuControlLE::updateRecentFilesMenu()
156 {
157 MyGUI::MenuItem* recentFilesMenu = mBar->findItemById("RecentFiles", true);
158 if (recentFilesMenu != nullptr)
159 {
160 recentFilesMenu->getItemChild()->removeAllItems();
161 // список последних открытых файлов
162 const RecentFilesManager::VectorUString& recentFiles = RecentFilesManager::getInstance().getRecentFiles();
163 if (!recentFiles.empty())
164 {
165 size_t index = 1;
166 for (RecentFilesManager::VectorUString::const_iterator iter = recentFiles.begin();
167 iter != recentFiles.end();
168 ++iter, ++index)
169 {
170 addUserTag("IndexRecentFile", MyGUI::utility::toString(index));
171 addUserTag("RecentFile", *iter);
172 recentFilesMenu->getItemChild()->addItem(
173 replaceTags("FormatRecentFile"),
174 MyGUI::MenuItemType::Normal,
175 "Command_OpenRecentFile",
176 *iter);
177 }
178 }
179 }
180 }
181
182 void MainMenuControlLE::updateRecentProjectsMenu()
183 {

Callers

nothing calls this directly

Calls 10

addUserTagFunction · 0.85
toStringFunction · 0.85
replaceTagsFunction · 0.85
findItemByIdMethod · 0.80
removeAllItemsMethod · 0.45
getItemChildMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
addItemMethod · 0.45

Tested by

no test coverage detected