MCPcopy Create free account
hub / github.com/assimp/assimp / UpdateHistory

Function UpdateHistory

tools/assimp_view/MessageProc.cpp:795–820  ·  view source on GitHub ↗

------------------------------------------------------------------------------- Update the file history -------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

793// Update the file history
794//-------------------------------------------------------------------------------
795void UpdateHistory() {
796 if (!g_hHistoryMenu) {
797 return;
798 }
799
800 std::string sz = std::string(g_szFileName);
801 if (g_aPreviousFiles[AI_VIEW_NUM_RECENT_FILES - 1] == sz) {
802 return;
803 }
804
805 // add the new asset to the list of recent files
806 for (unsigned int i = 0; i < AI_VIEW_NUM_RECENT_FILES-1;++i) {
807 g_aPreviousFiles[i] = g_aPreviousFiles[i+1];
808 }
809 g_aPreviousFiles[AI_VIEW_NUM_RECENT_FILES-1] = sz;
810 for (int i = AI_VIEW_NUM_RECENT_FILES-1; i >= 0;--i) {
811 const char* szText = g_aPreviousFiles[i].c_str();
812 UINT iFlags = 0;
813 if ('\0' == *szText) {
814 szText = "<empty>";
815 iFlags = MF_GRAYED | MF_DISABLED;
816 }
817 ModifyMenu(g_hHistoryMenu,AI_VIEW_RECENT_FILE_ID(i),
818 MF_STRING | MF_BYCOMMAND | iFlags,AI_VIEW_RECENT_FILE_ID(i),szText);
819 }
820}
821
822//-------------------------------------------------------------------------------
823// Open a new asset

Callers 3

HandleCommandLineFunction · 0.85
OpenAssetFunction · 0.85
MessageProcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected