------------------------------------------------------------------------------- Update the file history -------------------------------------------------------------------------------
| 793 | // Update the file history |
| 794 | //------------------------------------------------------------------------------- |
| 795 | void 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 |
no outgoing calls
no test coverage detected