; --------------------------------------------------------------------------------------------; Copyright (c) Fantaisie Software. All rights reserved.; Dual licensed under the GPL and Fantaisie Software licenses.; See LICENSE and LICENSE-FANTAISIE in the project root for license information.; --------------------------------------------------------------------------------------------Procedure.s RecentFiles_EntryString(Index)If Index > #MAX_RecentFiles ; its a projectName$ = ProjectName(RecentFiles(Index))If Name$ <> ""Name$ = " (" + Name$ + ")"EndIfProcedureReturn RSet(Str(Index-#MAX_RecentFiles), Len(Str(FilesHistorySize))) + ") " + GetFilePart(RecentFiles(Index)) + Name$Else ; its a source fileProcedureReturn RSet(Str(Index), Len(Str(FilesHistorySize))) + ") " + RecentFiles(Index) ; Display full path here, to avoid issue if some files gets same name (ie: main.pb) https://www.purebasic.fr/english/viewtopic.php?f=3&t=60650EndIfEndProcedureProcedure RecentFiles_AddMenuEntries(IsProject)If IsProject = #FalseOffset = 0ElseOffset = #MAX_RecentFilesEndIfCount = 0For i = 1 To FilesHistorySizeIf RecentFiles(Offset+i)MenuItem(#MENU_RecentFiles_Start+Offset+i-1, ReplaceString(RecentFiles_EntryString(Offset+i), "&", "&&")) ; escape the "menu char"Count + 1EndIfNext iIf IsProject = #FalseDisplayedRecentFiles = CountElseDisplayedRecentProjects = CountEndIfEndProcedureProcedure RecentFiles_AddFile(FileName,ドル IsProject)CompilerIf #CompileWindows; Also notify the OS of the file usage; This is useful for the 'recent file' list in the start menu and Windows7 TaskbarCompilerIf #PB_Compiler_Unicode#SHARD_PATH = 00000003ドルCompilerElse#SHARD_PATH = 00000002ドルCompilerEndIfSHAddToRecentDocs_(#SHARD_PATH, @FileName$)CompilerEndIfIf IsProject = #FalseOffset = 0OldCount = DisplayedRecentFilesElseOffset = #MAX_RecentFilesOldCount = DisplayedRecentProjectsEndIfIf IsEqualFile(FileName,ドル RecentFiles(Offset+1))ProcedureReturn ; the file is already at the top of the list, so there is nothing to doEndIf; search for the same filename in the list;Found = 0For index = 1 To FilesHistorySizeIf RecentFiles(Offset+index) = "" Or IsEqualFile(FileName,ドル RecentFiles(Offset+index))Found = 1BreakEndIfNext indexIf Found = 0index = FilesHistorySizeEndIf; now move all other files one index down..;For i = index-1 To 1 Step -1RecentFiles(Offset+i+1) = RecentFiles(Offset+i)Next iRecentFiles(Offset+1) = FileName$; Count the number of entries we haveCount = 0For i = 1 To FilesHistorySizeIf RecentFiles(Offset+i)Count + 1EndIfNext iIf Count = OldCount And Count = FilesHistorySize; rename the menu items for Recentfiles (no recreation of the whole menu)For i = 1 To FilesHistorySizeSetMenuItemText(#MENU, #MENU_RecentFiles_Start+Offset+i-1, ReplaceString(RecentFiles_EntryString(Offset+i), "&", "&&"))Next iElse; the count changed.. we must re-create the menuStartFlickerFix(#WINDOW_Main)CreateIDEMenu() ; update the menuStopFlickerFix(#WINDOW_Main, 1)EndIfEndProcedureProcedure RecentFiles_Open(MenuItemID)If MenuItemID >= #MENU_RecentFiles_Start And MenuItemID <= #MENU_RecentFiles_EndIf Trim(RecentFiles(MenuItemID - #MENU_RecentFiles_Start + 1)) <> ""If MenuItemID < #MENU_RecentFiles_Start+#MAX_RecentFiles ; RecentFiles rangeLoadSourceFile(RecentFiles(MenuItemID - #MENU_RecentFiles_Start + 1))Else ; RecentProjects rangeLoadProject(RecentFiles(MenuItemID - #MENU_RecentFiles_Start + 1))EndIf; do not add the filename to the beginning of the list, LoadSourceFile()/LoadProject() will do soEndIfEndIfEndProcedure
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。