From 0c2a0c2770e02781bda275d7f26acbad99654d3b Mon Sep 17 00:00:00 2001 From: ChrisRfr Date: Fri, 16 Jan 2026 22:08:47 +0100 Subject: [PATCH 1/7] Sort and Filter Project Files In Project Management and Project Panel tool Add a checkbox to sort the project files on Autoload, folder and filename and a StringGadget to filter the displayed items. --- Documentation/Catalogs/Deutsch/Editor.catalog | 1 + Documentation/Catalogs/Editor.catalog | 1 + .../Catalogs/Francais/Editor.catalog | 1 + Documentation/Catalogs/Italian/Editor.Catalog | 1 + Documentation/Catalogs/Russian/editor.catalog | 1 + Documentation/Catalogs/Spanish/Editor.catalog | 1 + .../Catalogs/Deutsch/Editor.catalog | 1 + .../SpiderBasic/Catalogs/Editor.catalog | 1 + .../Catalogs/Francais/Editor.catalog | 1 + .../Catalogs/Italian/Editor.Catalog | 1 + .../Catalogs/Spanish/Editor.catalog | 1 + PureBasicIDE/Common.pb | 7 +- PureBasicIDE/Language.pb | 1 + PureBasicIDE/Preferences.pb | 2 + PureBasicIDE/ProjectManagement.pb | 104 +++++++++++--- PureBasicIDE/ProjectPanel.pb | 133 ++++++++++++------ PureBasicIDE/UserInterface.pb | 19 ++- 17 files changed, 207 insertions(+), 70 deletions(-) diff --git a/Documentation/Catalogs/Deutsch/Editor.catalog b/Documentation/Catalogs/Deutsch/Editor.catalog index 689f6395..b85659b9 100644 --- a/Documentation/Catalogs/Deutsch/Editor.catalog +++ b/Documentation/Catalogs/Deutsch/Editor.catalog @@ -264,6 +264,7 @@ FileLoad = Datei laden, wenn das Projekt geöffnet wird FilePanel = Datei in der Projektliste anzeigen FileWarn = Eine Warnung anzeigen, wenn Datei verändert wurde Filename = Dateiname +FileListSort = Sortieren nach Laden und Dateiname FileScanShort = Scannen FileLoadShort = Laden FilePanelShort = Liste diff --git a/Documentation/Catalogs/Editor.catalog b/Documentation/Catalogs/Editor.catalog index 29f65241..e17192ef 100644 --- a/Documentation/Catalogs/Editor.catalog +++ b/Documentation/Catalogs/Editor.catalog @@ -264,6 +264,7 @@ FileLoad = Load file when opening the project FilePanel = Show file in the Project panel FileWarn = Display a warning if file changed Filename = Filename +FileListSort = Sort on Load and Filename FileScanShort = Scan FileLoadShort = Load FilePanelShort = Panel diff --git a/Documentation/Catalogs/Francais/Editor.catalog b/Documentation/Catalogs/Francais/Editor.catalog index fa685fef..ea43defd 100644 --- a/Documentation/Catalogs/Francais/Editor.catalog +++ b/Documentation/Catalogs/Francais/Editor.catalog @@ -265,6 +265,7 @@ FileLoad = Charger le fichier à l'ouverture du projet FilePanel = Afficher le fichier dans le panneau de projet FileWarn = Afficher une alerte si le fichier a été modifié Filename = Nom du fichier +FileListSort = Trier sur Charger et Nom du fichier FileScanShort = Scanner FileLoadShort = Charger FilePanelShort = Panneau diff --git a/Documentation/Catalogs/Italian/Editor.Catalog b/Documentation/Catalogs/Italian/Editor.Catalog index 4c23c6d8..605624bf 100644 --- a/Documentation/Catalogs/Italian/Editor.Catalog +++ b/Documentation/Catalogs/Italian/Editor.Catalog @@ -245,6 +245,7 @@ FileLoad = Carica il file quando si apre il Progetto FilePanel = Mostra il file nel pannello Progetto FileWarn = Mostra un avvertimento se viene modificato il file Filename = Nome del file +FileListSort = Ordina per Carica e Nome del file FileScanShort = Scansiona FileLoadShort = Carica FilePanelShort = Pannello diff --git a/Documentation/Catalogs/Russian/editor.catalog b/Documentation/Catalogs/Russian/editor.catalog index 8835dfaf..0a4e7b75 100644 --- a/Documentation/Catalogs/Russian/editor.catalog +++ b/Documentation/Catalogs/Russian/editor.catalog @@ -260,6 +260,7 @@ FileLoad = Загрузить файл при открытии проекта FilePanel = Показать файл в панели проекта FileWarn = Предупреждать, если файл изменился Filename = Имя файла +FileListSort = Сортировка по загрузке и имени файла FileScanShort = Сканирование FileLoadShort = Загрузка FilePanelShort = Панель diff --git a/Documentation/Catalogs/Spanish/Editor.catalog b/Documentation/Catalogs/Spanish/Editor.catalog index 91ca4459..e77c3354 100644 --- a/Documentation/Catalogs/Spanish/Editor.catalog +++ b/Documentation/Catalogs/Spanish/Editor.catalog @@ -237,6 +237,7 @@ FileLoad = Carga de archivos al abrir el proyecto FilePanel = Mostrar archivo en el panel Proyecto FileWarn = Mostrar una advertencia si el archivo modificado Filename = Nombre del archivo +FileListSort = Ordenar por Carga y Nombre del archivo FileScanShort = Scan FileLoadShort = Carga FilePanelShort = Panel diff --git a/Documentation/SpiderBasic/Catalogs/Deutsch/Editor.catalog b/Documentation/SpiderBasic/Catalogs/Deutsch/Editor.catalog index d3902400..b79aa883 100644 --- a/Documentation/SpiderBasic/Catalogs/Deutsch/Editor.catalog +++ b/Documentation/SpiderBasic/Catalogs/Deutsch/Editor.catalog @@ -253,6 +253,7 @@ FileLoad = Datei laden, wenn das Projekt ge FilePanel = Datei in der Projektliste anzeigen FileWarn = Eine Warnung anzeigen, wenn Datei verndert wurde Filename = Dateiname +FileListSort = Sortieren nach Laden und Dateiname FileScanShort = Scannen FileLoadShort = Laden FilePanelShort = Liste diff --git a/Documentation/SpiderBasic/Catalogs/Editor.catalog b/Documentation/SpiderBasic/Catalogs/Editor.catalog index 9f3da00b..9964fc4e 100644 --- a/Documentation/SpiderBasic/Catalogs/Editor.catalog +++ b/Documentation/SpiderBasic/Catalogs/Editor.catalog @@ -253,6 +253,7 @@ FileLoad = Load file when opening the project FilePanel = Show file in the Project panel FileWarn = Display a warning if file changed Filename = Filename +FileListSort = Sort on Load and Filename FileScanShort = Scan FileLoadShort = Load FilePanelShort = Panel diff --git a/Documentation/SpiderBasic/Catalogs/Francais/Editor.catalog b/Documentation/SpiderBasic/Catalogs/Francais/Editor.catalog index fe0f277c..f2e473c5 100644 --- a/Documentation/SpiderBasic/Catalogs/Francais/Editor.catalog +++ b/Documentation/SpiderBasic/Catalogs/Francais/Editor.catalog @@ -253,6 +253,7 @@ FileLoad = Charger le fichier FilePanel = Afficher le fichier dans le panneau de projet FileWarn = Afficher une alerte si le fichier a t modifi Filename = Nom du fichier +FileListSort = Trier sur Charger et Nom du fichier FileScanShort = Scanner FileLoadShort = Charger FilePanelShort = Panneau diff --git a/Documentation/SpiderBasic/Catalogs/Italian/Editor.Catalog b/Documentation/SpiderBasic/Catalogs/Italian/Editor.Catalog index 8e01d03a..536dd263 100644 --- a/Documentation/SpiderBasic/Catalogs/Italian/Editor.Catalog +++ b/Documentation/SpiderBasic/Catalogs/Italian/Editor.Catalog @@ -235,6 +235,7 @@ FileLoad = Carica il file quando si apre il Progetto FilePanel = Mostra il file nel pannello Progetto FileWarn = Mostra un avvertimento se viene modificato il file Filename = Nome del file +FileListSort = Ordina per Carica e Nome del file FileScanShort = Scansiona FileLoadShort = Carica FilePanelShort = Pannello diff --git a/Documentation/SpiderBasic/Catalogs/Spanish/Editor.catalog b/Documentation/SpiderBasic/Catalogs/Spanish/Editor.catalog index 5d27b270..9b9d5c2f 100644 --- a/Documentation/SpiderBasic/Catalogs/Spanish/Editor.catalog +++ b/Documentation/SpiderBasic/Catalogs/Spanish/Editor.catalog @@ -227,6 +227,7 @@ FileLoad = Carga de archivos al abrir el proyecto FilePanel = Mostrar archivo en el panel Proyecto FileWarn = Mostrar una advertencia si el archivo modificado Filename = Nombre del archivo +FileListSort = Ordenar por Carga y Nombre del archivo FileScanShort = Scan FileLoadShort = Carga FilePanelShort = Panel diff --git a/PureBasicIDE/Common.pb b/PureBasicIDE/Common.pb index c6d5ea15..cc1618af 100644 --- a/PureBasicIDE/Common.pb +++ b/PureBasicIDE/Common.pb @@ -145,6 +145,8 @@ Runtime Enumeration 1 ; 0 is reserved for uninitialized #PB_Any #GADGET_ProjectInfo_FrameFiles #GADGET_ProjectInfo_FrameTargets #GADGET_ProjectInfo_Info + #GADGET_ProjectInfo_FilterInput + #GADGET_ProjectInfo_SortFiles #GADGET_ProjectInfo_Files #GADGET_ProjectInfo_Targets #GADGET_ProjectInfo_OpenOptions @@ -186,6 +188,8 @@ Runtime Enumeration 1 ; 0 is reserved for uninitialized #PB_Any #GADGET_ProcedureBrowser_SwitchButtons #GADGET_ProjectPanel + #GADGET_ProjectPanel_FilterInput + #GADGET_ProjectPanel_DummyButton #GADGET_Explorer #GADGET_Explorer_Pattern @@ -2801,7 +2805,7 @@ Global IsProjectBusy = 0 Global ProjectFile$, ProjectName$, ProjectComments$, DefaultProjectFile$, LastOpenProjectFile$ Global ProjectExplorerPattern, ProjectExplorerPath$ Global ProjectCloseFiles.l -Global ProjectOpenMode.l, ProjectShowLog.l, AutoCloseBuildWindow.l +Global ProjectOpenMode.l, ProjectShowLog.l, AutoCloseBuildWindow.l, ProjectFilesSort.l Global ProjectLastOpenDate, ProjectLastOpenHost$, ProjectLastOpenUser$, ProjectLastOpenEditor$ Global *DefaultTarget.CompileTarget Global *ProjectInfo.SourceFile ; the fake sourcefile in the File tab @@ -2810,6 +2814,7 @@ Global UseProjectBuildWindow Global CommandlineBuild, QuietBuild, CommandlineBuildSuccess Global NewList ProjectFiles.ProjectFile() +Global NewList ProjectInfoFiles.ProjectFile() Global NewList ProjectConfig.ProjectFileConfig() ; project files during configuration Global NewList ProjectTargets.CompileTarget() Global NewList ProjectOptionTargets.CompileTarget() ; target list during options diff --git a/PureBasicIDE/Language.pb b/PureBasicIDE/Language.pb index 5502e62a..5960bf68 100644 --- a/PureBasicIDE/Language.pb +++ b/PureBasicIDE/Language.pb @@ -698,6 +698,7 @@ DataSection Data$ "FileWarn", "Display a warning if file changed" Data$ "Filename", "Filename" + Data$ "FileListSort", "Sort on Load and Filename" Data$ "FileScanShort", "Scan" Data$ "FileLoadShort", "Load" Data$ "FilePanelShort", "Panel" diff --git a/PureBasicIDE/Preferences.pb b/PureBasicIDE/Preferences.pb index 3af9711f..309a27e4 100644 --- a/PureBasicIDE/Preferences.pb +++ b/PureBasicIDE/Preferences.pb @@ -388,6 +388,7 @@ Procedure LoadPreferences() ;- - Projects PreferenceGroup("Projects") DefaultProjectFile$ = ReadPreferenceString("DefaultProject", "") + ProjectFilesSort = ReadPreferenceLong("ProjectFilesSort", 1) LoadDialogPosition(@ProjectOptionsPosition, -1, -1, 0, 0, "ProjectOptions") ; will get a minimum size anyway, so no default w/h @@ -1193,6 +1194,7 @@ Procedure SavePreferences() PreferenceGroup("Projects") PreferenceComment("") WritePreferenceString("DefaultProject", DefaultProjectFile$) + WritePreferenceLong("ProjectFilesSort",ProjectFilesSort) SaveDialogPosition(@ProjectOptionsPosition, 1, "ProjectOptions") diff --git a/PureBasicIDE/ProjectManagement.pb b/PureBasicIDE/ProjectManagement.pb index 5d19124b..8de483cc 100644 --- a/PureBasicIDE/ProjectManagement.pb +++ b/PureBasicIDE/ProjectManagement.pb @@ -15,6 +15,10 @@ #Project_Open_LoadMain = 3 #Project_Open_LoadNone = 4 +; Filter text for the ProjectFiles() list. +Global ProjectInfoFilterText$ +Global ProjectInfoFilter + ; Some helpers for the XML reading/writing ; Procedure NewSection(*Main, Name$) @@ -145,6 +149,14 @@ Procedure AddProjectBuildMenuEntries() EndIf EndProcedure +Procedure ProjectInfo_InBasePath(Base$, Filename$) + If Len(Base$) < Len(Filename$) And CompareMemoryString(@Base$, @Filename$, #PATH_CaseInsensitive, Len(Base$)) = #PB_String_Equal + ProcedureReturn #True + Else + ProcedureReturn #False + EndIf +EndProcedure + Procedure IsProjectFile(FileName$) Protected Result = #False @@ -433,18 +445,22 @@ Procedure ResizeProjectInfo(Width, Height) CompilerEndIf ; size for other parts - PartHeight = (Height-60-InfoHeight) / 2 + PartHeight = Height-40-InfoHeight - Button1Height + PartFilesHeight = PartHeight * 3 / 5 + PartProjectHeight = PartHeight - PartFilesHeight - ResizeGadget(#GADGET_ProjectInfo_FrameProject, 20-BorderOffset, 20-BorderOffset, Width-40, InfoHeight) - ResizeGadget(#GADGET_ProjectInfo_Info, 30-BorderOffset, 25+ProjectInfoFrameHeight-BorderOffset, Width-65-ButtonWidth, InfoHeight-15-ProjectInfoFrameHeight) + ResizeGadget(#GADGET_ProjectInfo_FrameProject, 20-BorderOffset, 10-BorderOffset, Width-40, InfoHeight) + ResizeGadget(#GADGET_ProjectInfo_Info, 30-BorderOffset, 15+ProjectInfoFrameHeight-BorderOffset, Width-65-ButtonWidth, InfoHeight-15-ProjectInfoFrameHeight) ResizeGadget(#GADGET_ProjectInfo_OpenOptions, Width-30-ButtonWidth-BorderOffset, 25+ProjectInfoFrameHeight-BorderOffset, ButtonWidth, Button1Height) ResizeGadget(#GADGET_ProjectInfo_OpenCompilerOptions, Width-30-ButtonWidth-BorderOffset, 30+ProjectInfoFrameHeight+Button1Height-BorderOffset, ButtonWidth, Button1Height) - ResizeGadget(#GADGET_ProjectInfo_FrameFiles, 20-BorderOffset, InfoHeight+30-BorderOffset, Width-40, PartHeight) - ResizeGadget(#GADGET_ProjectInfo_Files, 30-BorderOffset, InfoHeight+35+ProjectInfoFrameHeight-BorderOffset, Width-60, PartHeight-15-ProjectInfoFrameHeight) + ResizeGadget(#GADGET_ProjectInfo_FrameFiles, 20-BorderOffset, InfoHeight+20-BorderOffset, Width-40, PartFilesHeight) + ResizeGadget(#GADGET_ProjectInfo_FilterInput, 30-BorderOffset, InfoHeight+25+ProjectInfoFrameHeight-BorderOffset, 200, Button1Height) + ResizeGadget(#GADGET_ProjectInfo_SortFiles, 240-BorderOffset, InfoHeight+25+ProjectInfoFrameHeight-BorderOffset, 200, Button1Height) + ResizeGadget(#GADGET_ProjectInfo_Files, 30-BorderOffset, InfoHeight+30+ProjectInfoFrameHeight+Button1Height-BorderOffset, Width-60, PartFilesHeight-15-ProjectInfoFrameHeight) - ResizeGadget(#GADGET_ProjectInfo_FrameTargets, 20-BorderOffset, InfoHeight+PartHeight+40-BorderOffset, Width-40, PartHeight) - ResizeGadget(#GADGET_ProjectInfo_Targets, 30-BorderOffset, InfoHeight+PartHeight+45+ProjectInfoFrameHeight-BorderOffset, Width-60, PartHeight-15-ProjectInfoFrameHeight) + ResizeGadget(#GADGET_ProjectInfo_FrameTargets, 20-BorderOffset, InfoHeight+PartFilesHeight+30+Button1Height-BorderOffset, Width-40, PartProjectHeight) + ResizeGadget(#GADGET_ProjectInfo_Targets, 30-BorderOffset, InfoHeight+PartFilesHeight+35+Button1Height+ProjectInfoFrameHeight-BorderOffset, Width-60, PartProjectHeight-15-ProjectInfoFrameHeight) CompilerIf #CompileWindows ; Will size the middle columns small, and the last as big as possible @@ -474,7 +490,7 @@ EndProcedure ; Apply project data changes Procedure UpdateProjectInfo() If *ProjectInfo - + Base$ = GetPathPart(ProjectFile$) ; Project Info ; Text$ = Language("Project","ProjectName")+": " + ProjectName$ + #NewLine @@ -497,22 +513,53 @@ Procedure UpdateProjectInfo() ; File List ; ClearGadgetItems(#GADGET_ProjectInfo_Files) - ForEach ProjectFiles() - Text$ = CreateRelativePath(GetPathPart(ProjectFile$), ProjectFiles()\Filename$) + Chr(10) - Text$ + ProjectInfo_Boolean(ProjectFiles()\AutoLoad) + Chr(10) - Text$ + ProjectInfo_Boolean(ProjectFiles()\ShowWarning) + Chr(10) - Text$ + ProjectInfo_Boolean(ProjectFiles()\AutoScan) + Chr(10) - Text$ + ProjectInfo_Boolean(ProjectFiles()\ShowPanel) + Chr(10) + + ; copied ProjectFiles() to ProjectInfoFiles() and sorted it on PanelState$ (overwritten) to preserve the default sorting of projectfiles() + CopyList(ProjectFiles(), ProjectInfoFiles()) + + ForEach ProjectInfoFiles() + ProjectInfoFiles()\PanelState$ = Str(ProjectInfoFiles()\AutoLoad!1) ; Descending + If ProjectInfo_InBasePath(Base$, ProjectInfoFiles()\FileName$) = #False + ProjectInfoFiles()\PanelState$ + "2" + ProjectInfoFiles()\FileName$ ;ExternalBase + Else + RelativePathFilename$ = CreateRelativePath(GetPathPart(ProjectFile$), ProjectInfoFiles()\Filename$) + If Right(GetPathPart(RelativePathFilename$), 1) = #Separator + ProjectInfoFiles()\PanelState$ + "1" ;Directory + Else + ProjectInfoFiles()\PanelState$ + "0" ;ProjectFile + EndIf + ProjectInfoFiles()\PanelState$ + RelativePathFilename$ + EndIf + Next ProjectInfoFiles() + + If GetGadgetState(#GADGET_ProjectInfo_SortFiles) = #PB_Checkbox_Checked + SortStructuredList(ProjectInfoFiles(), #PB_Sort_Ascending, OffsetOf(ProjectFile\PanelState$), #PB_String) + EndIf + + ForEach ProjectInfoFiles() + ; Filter the project list + RelativePathFilename$ = CreateRelativePath(GetPathPart(ProjectFile$), ProjectInfoFiles()\Filename$) + If ProjectInfoFilter + If Not FindString(RelativePathFilename$, ProjectInfoFilterText$, 1, #PB_String_NoCase) + Continue + EndIf + EndIf - Size = FileSize(ProjectFiles()\Filename$) + Text$ = RelativePathFilename$ + Chr(10) + Text$ + ProjectInfo_Boolean(ProjectInfoFiles()\AutoLoad) + Chr(10) + Text$ + ProjectInfo_Boolean(ProjectInfoFiles()\ShowWarning) + Chr(10) + Text$ + ProjectInfo_Boolean(ProjectInfoFiles()\AutoScan) + Chr(10) + Text$ + ProjectInfo_Boolean(ProjectInfoFiles()\ShowPanel) + Chr(10) + + Size = FileSize(ProjectInfoFiles()\Filename$) If Size < 0 ; file missing Text$ + Chr(10) + Chr(10) Else Text$ + StrByteSize(Size) + Chr(10) - Text$ + FormatDate(Language("Project","FileDateFormat"), GetFileDate(ProjectFiles()\Filename$, #PB_Date_Modified)) + Text$ + FormatDate(Language("Project","FileDateFormat"), GetFileDate(ProjectInfoFiles()\Filename$, #PB_Date_Modified)) EndIf - If ProjectFiles()\AutoScan + If ProjectInfoFiles()\AutoScan ImageID = OptionalImageID(#IMAGE_ProjectPanel_FileScanned) Else ImageID = OptionalImageID(#IMAGE_ProjectPanel_File) @@ -520,8 +567,8 @@ Procedure UpdateProjectInfo() AddGadgetItem(#GADGET_ProjectInfo_Files, -1, Text$, ImageID) ; Associate the ProjectFile structure (for the Popup menu) - SetGadgetItemData(#GADGET_ProjectInfo_Files, CountGadgetItems(#GADGET_ProjectInfo_Files)-1, @ProjectFiles()) - Next ProjectFiles() + SetGadgetItemData(#GADGET_ProjectInfo_Files, CountGadgetItems(#GADGET_ProjectInfo_Files)-1, @ProjectInfoFiles()) + Next ProjectInfoFiles() ; Target list ; @@ -576,6 +623,19 @@ Procedure UpdateProjectInfo() EndProcedure +Procedure ProjectInfo_Filter(Text$) + + If Asc(Text$) + ProjectInfoFilter = #True + Else + ProjectInfoFilter = #False + EndIf + + ProjectInfoFilterText$ = Text$ + UpdateProjectInfo() + +EndProcedure + ; Apply preferences changes Procedure UpdateProjectInfoPreferences() If *ProjectInfo @@ -588,6 +648,7 @@ Procedure UpdateProjectInfoPreferences() SetGadgetText(#GADGET_ProjectInfo_FrameProject, Language("Project","ProjectInfo")) SetGadgetText(#GADGET_ProjectInfo_FrameFiles, Language("Project","FileTab")) + SetGadgetText(#GADGET_ProjectInfo_SortFiles, Language("Project","FileListSort")) SetGadgetText(#GADGET_ProjectInfo_FrameTargets, Language("Project","ProjectTargets")) SetGadgetText(#GADGET_ProjectInfo_OpenOptions, Language("Project","ProjectOptions")) @@ -668,6 +729,10 @@ Procedure AddProjectInfo() ButtonGadget(#GADGET_ProjectInfo_OpenCompilerOptions, 0, 0, 0, 0, Language("Project","CompilerOptions")) FrameGadget(#GADGET_ProjectInfo_FrameFiles, 0, 0, 0, 0, Language("Project","FileTab")) + StringGadget(#GADGET_ProjectInfo_FilterInput, 0, 0, 0, 0, "") + + CheckBoxGadget(#GADGET_ProjectInfo_SortFiles, 0, 0, 0, 0, Language("Project","FileListSort")) + SetGadgetState(#GADGET_ProjectInfo_SortFiles, ProjectFilesSort) ListIconGadget(#GADGET_ProjectInfo_Files, 0, 0, 300, 0, Language("Project","Filename"), 300, #PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_MultiSelect) AddGadgetColumn(#GADGET_ProjectInfo_Files, 1, Language("Project","FileLoadShort"), 60) AddGadgetColumn(#GADGET_ProjectInfo_Files, 2, Language("Project","FileWarnShort"), 60) @@ -967,6 +1032,7 @@ Procedure LoadProject(Filename$) ; Project file list ; (load this even in commandline build mode, so the project is correctly saved back!) ; + *Files = GetSection(*Main, "files") If *Files *File = ChildXMLNode(*Files) diff --git a/PureBasicIDE/ProjectPanel.pb b/PureBasicIDE/ProjectPanel.pb index 11103460..28420a61 100644 --- a/PureBasicIDE/ProjectPanel.pb +++ b/PureBasicIDE/ProjectPanel.pb @@ -18,6 +18,9 @@ Global ProjectPanelVisible Global ProjectPanelMenuGadget +; Filter text for the ProjectFiles() list. +Global ProjectPanelFilterText$ +Global ProjectPanelFilter ; Delete a file entry and all its parents if empty (recursive) ; @@ -429,6 +432,19 @@ Procedure UpdateProjectPanel() EndIf Next i + ; Filter the project list. + If ProjectPanelFilter + For i = CountGadgetItems(#GADGET_ProjectPanel)-1 To 0 Step -1 + Select GetGadgetItemData(#GADGET_ProjectPanel, i) + Case #ProjectPanel_Directory, #ProjectPanel_InternalBase, #ProjectPanel_ExternalBase + Default ; its a ProjectFile. Remove the Gadget Item if the input filter was not found in the project file name. + If Not FindString(GetGadgetItemText(#GADGET_ProjectPanel, i), ProjectPanelFilterText$, 1, #PB_String_NoCase) + RemoveGadgetItem(#GADGET_ProjectPanel, i) + EndIf + EndSelect + Next i + EndIf + Else ; project was closed ClearGadgetItems(#GADGET_ProjectPanel) @@ -438,11 +454,27 @@ Procedure UpdateProjectPanel() EndProcedure +Procedure ProjectPanel_Filter(Text$) + + If Asc(Text$) + ProjectPanelFilter = #True + Else + ProjectPanelFilter = #False + EndIf + + ProjectPanelFilterText$ = Text$ + UpdateProjectPanel() + +EndProcedure Procedure ProjectPanel_CreateFunction(*Entry.ToolsPanelEntry) ; Note: The ProjectPanel menu is created in CreateIDEPopupMenu() as the ProjectInfo uses it too ; + ; The Button #GADGET_ProjectPanel_DummyButton is here to obtain its height, which isapplied to the String filter, to have a height similar to the ProcedureBrowser filter one + ButtonGadget(#GADGET_ProjectPanel_DummyButton, -10, -10, 0, 0, "Abc") + HideGadget(#GADGET_ProjectPanel_DummyButton, #True) + StringGadget(#GADGET_ProjectPanel_FilterInput, 0, 0, 0, 0, "") TreeGadget(#GADGET_ProjectPanel, 0, 0, 0, 0) ProjectPanelVisible = #True @@ -457,7 +489,8 @@ EndProcedure Procedure ProjectPanel_DestroyFunction(*Entry.ToolsPanelEntry) StoreProjectPanelStates() ; store expanded states - + FreeGadget(#GADGET_ProjectPanel_DummyButton) + FreeGadget(#GADGET_ProjectPanel_FilterInput) FreeGadget(#GADGET_ProjectPanel) ProjectPanelVisible = #False @@ -465,10 +498,13 @@ EndProcedure Procedure ProjectPanel_ResizeHandler(*Entry.ToolsPanelEntry, PanelWidth, PanelHeight) + GetRequiredSize(#GADGET_ProjectPanel_DummyButton, @Width.l, @Height.l) + + ResizeGadget(#GADGET_ProjectPanel_FilterInput, 5, 5, PanelWidth-10, Height) If *Entry\IsSeparateWindow - ResizeGadget(#GADGET_ProjectPanel, 5, 5, PanelWidth-10, PanelHeight-10) + ResizeGadget(#GADGET_ProjectPanel, 5, 10+Height, PanelWidth-10, PanelHeight-15-Height) Else - ResizeGadget(#GADGET_ProjectPanel, 0, 0, PanelWidth, PanelHeight) + ResizeGadget(#GADGET_ProjectPanel, 0, 10+Height, PanelWidth, PanelHeight-15-Height) EndIf EndProcedure @@ -673,52 +709,58 @@ EndProcedure Procedure ProjectPanel_EventHandler(*Entry.ToolsPanelEntry, EventGadgetID) - If EventGadgetID = #GADGET_ProjectPanel - Index = GetGadgetState(#GADGET_ProjectPanel) - - Select EventType() - - Case #PB_EventType_DragStart - If Index <> -1 - *File.ProjectFile = GetGadgetItemData(#GADGET_ProjectPanel, Index) - If ProjectPanel_IsFile(*File) - ; its a single file - DragFiles(*File\FileName$) - - ElseIf *File = #ProjectPanel_Directory - ; its a directory - Files$ = "" - Sublevel = GetGadgetItemAttribute(#GADGET_ProjectPanel, Index, #PB_Tree_SubLevel) - Count = CountGadgetItems(#GADGET_ProjectPanel) - Index + 1 - While Index < Count And GetGadgetItemAttribute(#GADGET_ProjectPanel, Index, #PB_Tree_SubLevel) > Sublevel - *File = GetGadgetItemData(#GADGET_ProjectPanel, Index) - If ProjectPanel_IsFile(*File) - Files$ + *File\FileName$ + Chr(10) + Select EventGadgetID + Case #GADGET_ProjectPanel_FilterInput + If EventType() = #PB_EventType_Change + ProjectPanel_Filter(GetGadgetText(#GADGET_ProjectPanel_FilterInput)) + EndIf + + Case #GADGET_ProjectPanel + Index = GetGadgetState(#GADGET_ProjectPanel) + + Select EventType() + + Case #PB_EventType_DragStart + If Index <> -1 + *File.ProjectFile = GetGadgetItemData(#GADGET_ProjectPanel, Index) + If ProjectPanel_IsFile(*File) + ; its a single file + DragFiles(*File\FileName$) + + ElseIf *File = #ProjectPanel_Directory + ; its a directory + Files$ = "" + Sublevel = GetGadgetItemAttribute(#GADGET_ProjectPanel, Index, #PB_Tree_SubLevel) + Count = CountGadgetItems(#GADGET_ProjectPanel) + Index + 1 + While Index < Count And GetGadgetItemAttribute(#GADGET_ProjectPanel, Index, #PB_Tree_SubLevel) > Sublevel + *File = GetGadgetItemData(#GADGET_ProjectPanel, Index) + If ProjectPanel_IsFile(*File) + Files$ + *File\FileName$ + Chr(10) + EndIf + Index + 1 + Wend + If Files$ <> "" + DragFiles(Left(Files$, Len(Files$)-1)) ; cut the last Chr(10) EndIf - Index + 1 - Wend - If Files$ <> "" - DragFiles(Left(Files$, Len(Files$)-1)) ; cut the last Chr(10) + EndIf - EndIf - EndIf - - Case #PB_EventType_LeftDoubleClick - If Index <> -1 - *File.ProjectFile = GetGadgetItemData(#GADGET_ProjectPanel, Index) - If ProjectPanel_IsFile(*File) - LoadSourceFile(*File\FileName$, 1, 0) ; will just switch if open + + Case #PB_EventType_LeftDoubleClick + If Index <> -1 + *File.ProjectFile = GetGadgetItemData(#GADGET_ProjectPanel, Index) + If ProjectPanel_IsFile(*File) + LoadSourceFile(*File\FileName$, 1, 0) ; will just switch if open + EndIf EndIf - EndIf - - Case #PB_EventType_RightClick - DisplayProjectPanelMenu(*Entry, #GADGET_ProjectPanel) - - EndSelect - - EndIf + + Case #PB_EventType_RightClick + DisplayProjectPanelMenu(*Entry, #GADGET_ProjectPanel) + + EndSelect + + EndSelect EndProcedure @@ -748,4 +790,3 @@ AvailablePanelTools()\PanelTitle$ = "ProjectPanelShort" AvailablePanelTools()\ToolName$ = "ProjectPanelLong" AvailablePanelTools()\PanelTabOrder = 2 - diff --git a/PureBasicIDE/UserInterface.pb b/PureBasicIDE/UserInterface.pb index 828a7016..13207bdf 100644 --- a/PureBasicIDE/UserInterface.pb +++ b/PureBasicIDE/UserInterface.pb @@ -2224,19 +2224,30 @@ Procedure MainWindowEvents(EventID) DisplayPopupMenu(#POPUPMENU_ErrorLog, WindowID(#WINDOW_Main)) EndIf + + Case #GADGET_ProjectInfo_FilterInput + If EventType() = #PB_EventType_Change + ProjectInfo_Filter(GetGadgetText(#GADGET_ProjectInfo_FilterInput)) + EndIf + + Case #GADGET_ProjectInfo_SortFiles + ProjectFilesSort = GetGadgetState(#GADGET_ProjectInfo_SortFiles) + UpdateProjectInfo() Case #GADGET_ProjectInfo_Files index = GetGadgetState(#GADGET_ProjectInfo_Files) Select EventType() Case #PB_EventType_DragStart - If index <> -1 And SelectElement(ProjectFiles(), index) - DragFiles(ProjectFiles()\Filename$) + If index <> -1 + *ProjectFiles.ProjectFile = GetGadgetItemData(#GADGET_ProjectInfo_Files, index) + DragFiles(*ProjectFiles\Filename$) EndIf Case #PB_EventType_LeftDoubleClick - If index <> -1 And SelectElement(ProjectFiles(), index) - LoadSourceFile(ProjectFiles()\Filename$) ; will just switch if open + If index <> -1 + *ProjectFiles.ProjectFile = GetGadgetItemData(#GADGET_ProjectInfo_Files, index) + LoadSourceFile(*ProjectFiles\Filename$) ; will just switch if open EndIf Case #PB_EventType_RightClick From ed383b37ab4299bb083083ae7f7631fd41491d87 Mon Sep 17 00:00:00 2001 From: ChrisRfr Date: Sat, 17 Jan 2026 02:12:27 +0100 Subject: [PATCH 2/7] Reduce a little the flickering on ProjectManagement On Windows, reduce a little the flickering on ProjectManagement --- PureBasicIDE/ProjectManagement.pb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PureBasicIDE/ProjectManagement.pb b/PureBasicIDE/ProjectManagement.pb index 8de483cc..63125f44 100644 --- a/PureBasicIDE/ProjectManagement.pb +++ b/PureBasicIDE/ProjectManagement.pb @@ -449,6 +449,9 @@ Procedure ResizeProjectInfo(Width, Height) PartFilesHeight = PartHeight * 3 / 5 PartProjectHeight = PartHeight - PartFilesHeight + CompilerIf #CompileWindows + SendMessage_(GadgetID(#GADGET_ProjectInfo), #WM_SETREDRAW, #False, 0) + CompilerEndIf ResizeGadget(#GADGET_ProjectInfo_FrameProject, 20-BorderOffset, 10-BorderOffset, Width-40, InfoHeight) ResizeGadget(#GADGET_ProjectInfo_Info, 30-BorderOffset, 15+ProjectInfoFrameHeight-BorderOffset, Width-65-ButtonWidth, InfoHeight-15-ProjectInfoFrameHeight) ResizeGadget(#GADGET_ProjectInfo_OpenOptions, Width-30-ButtonWidth-BorderOffset, 25+ProjectInfoFrameHeight-BorderOffset, ButtonWidth, Button1Height) @@ -475,6 +478,8 @@ Procedure ResizeProjectInfo(Width, Height) SendMessage_(GadgetID(#GADGET_ProjectInfo_Targets), #LVM_SETCOLUMNWIDTH, i, #LVSCW_AUTOSIZE_USEHEADER) EndIf Next i + SendMessage_(GadgetID(#GADGET_ProjectInfo), #WM_SETREDRAW, #True, 0) + RedrawWindow_(GadgetID(#GADGET_ProjectInfo), #Null, #Null, #RDW_INVALIDATE | #RDW_ERASE | #RDW_ALLCHILDREN | #RDW_UPDATENOW) CompilerEndIf EndProcedure From 6fdc59ce4f8ffb7903e26bcca8eb0a80afb9614f Mon Sep 17 00:00:00 2001 From: ChrisRfr Date: Sat, 17 Jan 2026 23:48:55 +0100 Subject: [PATCH 3/7] Sort on Filename only Sort on Filename only, without autoLoad, it's simpler The ProjectInfoFiles() list is now local --- Documentation/Catalogs/Deutsch/Editor.catalog | 2 +- Documentation/Catalogs/Editor.catalog | 2 +- Documentation/Catalogs/Francais/Editor.catalog | 2 +- Documentation/Catalogs/Italian/Editor.Catalog | 2 +- Documentation/Catalogs/Russian/editor.catalog | 2 +- Documentation/Catalogs/Spanish/Editor.catalog | 2 +- .../SpiderBasic/Catalogs/Deutsch/Editor.catalog | 2 +- Documentation/SpiderBasic/Catalogs/Editor.catalog | 2 +- .../SpiderBasic/Catalogs/Francais/Editor.catalog | 2 +- .../SpiderBasic/Catalogs/Italian/Editor.Catalog | 2 +- .../SpiderBasic/Catalogs/Spanish/Editor.catalog | 2 +- PureBasicIDE/Common.pb | 1 - PureBasicIDE/Language.pb | 2 +- PureBasicIDE/ProjectManagement.pb | 14 ++++++++------ PureBasicIDE/dialogs/Projects.xml | 2 +- 15 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Documentation/Catalogs/Deutsch/Editor.catalog b/Documentation/Catalogs/Deutsch/Editor.catalog index b85659b9..120f6bd9 100644 --- a/Documentation/Catalogs/Deutsch/Editor.catalog +++ b/Documentation/Catalogs/Deutsch/Editor.catalog @@ -264,7 +264,7 @@ FileLoad = Datei laden, wenn das Projekt geöffnet wird FilePanel = Datei in der Projektliste anzeigen FileWarn = Eine Warnung anzeigen, wenn Datei verändert wurde Filename = Dateiname -FileListSort = Sortieren nach Laden und Dateiname +FileListSort = Nach Dateinamen sortieren FileScanShort = Scannen FileLoadShort = Laden FilePanelShort = Liste diff --git a/Documentation/Catalogs/Editor.catalog b/Documentation/Catalogs/Editor.catalog index e17192ef..1335542d 100644 --- a/Documentation/Catalogs/Editor.catalog +++ b/Documentation/Catalogs/Editor.catalog @@ -264,7 +264,7 @@ FileLoad = Load file when opening the project FilePanel = Show file in the Project panel FileWarn = Display a warning if file changed Filename = Filename -FileListSort = Sort on Load and Filename +FileListSort = Sort on Filename FileScanShort = Scan FileLoadShort = Load FilePanelShort = Panel diff --git a/Documentation/Catalogs/Francais/Editor.catalog b/Documentation/Catalogs/Francais/Editor.catalog index ea43defd..0b9b5346 100644 --- a/Documentation/Catalogs/Francais/Editor.catalog +++ b/Documentation/Catalogs/Francais/Editor.catalog @@ -265,7 +265,7 @@ FileLoad = Charger le fichier à l'ouverture du projet FilePanel = Afficher le fichier dans le panneau de projet FileWarn = Afficher une alerte si le fichier a été modifié Filename = Nom du fichier -FileListSort = Trier sur Charger et Nom du fichier +FileListSort = Trier sur le Nom du fichier FileScanShort = Scanner FileLoadShort = Charger FilePanelShort = Panneau diff --git a/Documentation/Catalogs/Italian/Editor.Catalog b/Documentation/Catalogs/Italian/Editor.Catalog index 605624bf..f2070e6c 100644 --- a/Documentation/Catalogs/Italian/Editor.Catalog +++ b/Documentation/Catalogs/Italian/Editor.Catalog @@ -245,7 +245,7 @@ FileLoad = Carica il file quando si apre il Progetto FilePanel = Mostra il file nel pannello Progetto FileWarn = Mostra un avvertimento se viene modificato il file Filename = Nome del file -FileListSort = Ordina per Carica e Nome del file +FileListSort = Ordina per Nome del file FileScanShort = Scansiona FileLoadShort = Carica FilePanelShort = Pannello diff --git a/Documentation/Catalogs/Russian/editor.catalog b/Documentation/Catalogs/Russian/editor.catalog index 0a4e7b75..c675ea3b 100644 --- a/Documentation/Catalogs/Russian/editor.catalog +++ b/Documentation/Catalogs/Russian/editor.catalog @@ -260,7 +260,7 @@ FileLoad = Загрузить файл при открытии проекта FilePanel = Показать файл в панели проекта FileWarn = Предупреждать, если файл изменился Filename = Имя файла -FileListSort = Сортировка по загрузке и имени файла +FileListSort = Сортировать по Имя файла FileScanShort = Сканирование FileLoadShort = Загрузка FilePanelShort = Панель diff --git a/Documentation/Catalogs/Spanish/Editor.catalog b/Documentation/Catalogs/Spanish/Editor.catalog index e77c3354..183a5093 100644 --- a/Documentation/Catalogs/Spanish/Editor.catalog +++ b/Documentation/Catalogs/Spanish/Editor.catalog @@ -237,7 +237,7 @@ FileLoad = Carga de archivos al abrir el proyecto FilePanel = Mostrar archivo en el panel Proyecto FileWarn = Mostrar una advertencia si el archivo modificado Filename = Nombre del archivo -FileListSort = Ordenar por Carga y Nombre del archivo +FileListSort = Ordenar por Nombre del archivo FileScanShort = Scan FileLoadShort = Carga FilePanelShort = Panel diff --git a/Documentation/SpiderBasic/Catalogs/Deutsch/Editor.catalog b/Documentation/SpiderBasic/Catalogs/Deutsch/Editor.catalog index b79aa883..8b70bddd 100644 --- a/Documentation/SpiderBasic/Catalogs/Deutsch/Editor.catalog +++ b/Documentation/SpiderBasic/Catalogs/Deutsch/Editor.catalog @@ -253,7 +253,7 @@ FileLoad = Datei laden, wenn das Projekt ge FilePanel = Datei in der Projektliste anzeigen FileWarn = Eine Warnung anzeigen, wenn Datei verndert wurde Filename = Dateiname -FileListSort = Sortieren nach Laden und Dateiname +FileListSort = Nach Dateinamen sortieren FileScanShort = Scannen FileLoadShort = Laden FilePanelShort = Liste diff --git a/Documentation/SpiderBasic/Catalogs/Editor.catalog b/Documentation/SpiderBasic/Catalogs/Editor.catalog index 9964fc4e..a3419136 100644 --- a/Documentation/SpiderBasic/Catalogs/Editor.catalog +++ b/Documentation/SpiderBasic/Catalogs/Editor.catalog @@ -253,7 +253,7 @@ FileLoad = Load file when opening the project FilePanel = Show file in the Project panel FileWarn = Display a warning if file changed Filename = Filename -FileListSort = Sort on Load and Filename +FileListSort = Sort on Filename FileScanShort = Scan FileLoadShort = Load FilePanelShort = Panel diff --git a/Documentation/SpiderBasic/Catalogs/Francais/Editor.catalog b/Documentation/SpiderBasic/Catalogs/Francais/Editor.catalog index f2e473c5..24e1376c 100644 --- a/Documentation/SpiderBasic/Catalogs/Francais/Editor.catalog +++ b/Documentation/SpiderBasic/Catalogs/Francais/Editor.catalog @@ -253,7 +253,7 @@ FileLoad = Charger le fichier FilePanel = Afficher le fichier dans le panneau de projet FileWarn = Afficher une alerte si le fichier a t modifi Filename = Nom du fichier -FileListSort = Trier sur Charger et Nom du fichier +FileListSort = Trier sur le Nom du fichier FileScanShort = Scanner FileLoadShort = Charger FilePanelShort = Panneau diff --git a/Documentation/SpiderBasic/Catalogs/Italian/Editor.Catalog b/Documentation/SpiderBasic/Catalogs/Italian/Editor.Catalog index 536dd263..fd12c719 100644 --- a/Documentation/SpiderBasic/Catalogs/Italian/Editor.Catalog +++ b/Documentation/SpiderBasic/Catalogs/Italian/Editor.Catalog @@ -235,7 +235,7 @@ FileLoad = Carica il file quando si apre il Progetto FilePanel = Mostra il file nel pannello Progetto FileWarn = Mostra un avvertimento se viene modificato il file Filename = Nome del file -FileListSort = Ordina per Carica e Nome del file +FileListSort = Ordina per Nome del file FileScanShort = Scansiona FileLoadShort = Carica FilePanelShort = Pannello diff --git a/Documentation/SpiderBasic/Catalogs/Spanish/Editor.catalog b/Documentation/SpiderBasic/Catalogs/Spanish/Editor.catalog index 9b9d5c2f..153a821d 100644 --- a/Documentation/SpiderBasic/Catalogs/Spanish/Editor.catalog +++ b/Documentation/SpiderBasic/Catalogs/Spanish/Editor.catalog @@ -227,7 +227,7 @@ FileLoad = Carga de archivos al abrir el proyecto FilePanel = Mostrar archivo en el panel Proyecto FileWarn = Mostrar una advertencia si el archivo modificado Filename = Nombre del archivo -FileListSort = Ordenar por Carga y Nombre del archivo +FileListSort = Ordenar por Nombre del archivo FileScanShort = Scan FileLoadShort = Carga FilePanelShort = Panel diff --git a/PureBasicIDE/Common.pb b/PureBasicIDE/Common.pb index cc1618af..7c9ad60d 100644 --- a/PureBasicIDE/Common.pb +++ b/PureBasicIDE/Common.pb @@ -2814,7 +2814,6 @@ Global UseProjectBuildWindow Global CommandlineBuild, QuietBuild, CommandlineBuildSuccess Global NewList ProjectFiles.ProjectFile() -Global NewList ProjectInfoFiles.ProjectFile() Global NewList ProjectConfig.ProjectFileConfig() ; project files during configuration Global NewList ProjectTargets.CompileTarget() Global NewList ProjectOptionTargets.CompileTarget() ; target list during options diff --git a/PureBasicIDE/Language.pb b/PureBasicIDE/Language.pb index 5960bf68..3551656d 100644 --- a/PureBasicIDE/Language.pb +++ b/PureBasicIDE/Language.pb @@ -698,7 +698,7 @@ DataSection Data$ "FileWarn", "Display a warning if file changed" Data$ "Filename", "Filename" - Data$ "FileListSort", "Sort on Load and Filename" + Data$ "FileListSort", "Sort on Filename" Data$ "FileScanShort", "Scan" Data$ "FileLoadShort", "Load" Data$ "FilePanelShort", "Panel" diff --git a/PureBasicIDE/ProjectManagement.pb b/PureBasicIDE/ProjectManagement.pb index 63125f44..9d92c410 100644 --- a/PureBasicIDE/ProjectManagement.pb +++ b/PureBasicIDE/ProjectManagement.pb @@ -520,20 +520,20 @@ Procedure UpdateProjectInfo() ClearGadgetItems(#GADGET_ProjectInfo_Files) ; copied ProjectFiles() to ProjectInfoFiles() and sorted it on PanelState$ (overwritten) to preserve the default sorting of projectfiles() + NewList ProjectInfoFiles.ProjectFile() CopyList(ProjectFiles(), ProjectInfoFiles()) ForEach ProjectInfoFiles() - ProjectInfoFiles()\PanelState$ = Str(ProjectInfoFiles()\AutoLoad!1) ; Descending + ProjectInfoFiles()\SortIndex = ListIndex(ProjectInfoFiles()) If ProjectInfo_InBasePath(Base$, ProjectInfoFiles()\FileName$) = #False - ProjectInfoFiles()\PanelState$ + "2" + ProjectInfoFiles()\FileName$ ;ExternalBase + ProjectInfoFiles()\PanelState$ = "2" + ProjectInfoFiles()\FileName$ ;ExternalBase Else RelativePathFilename$ = CreateRelativePath(GetPathPart(ProjectFile$), ProjectInfoFiles()\Filename$) If Right(GetPathPart(RelativePathFilename$), 1) = #Separator - ProjectInfoFiles()\PanelState$ + "1" ;Directory + ProjectInfoFiles()\PanelState$ = "1" + RelativePathFilename$ ;Directory Else - ProjectInfoFiles()\PanelState$ + "0" ;ProjectFile + ProjectInfoFiles()\PanelState$ = "0" + RelativePathFilename$ ;ProjectFile EndIf - ProjectInfoFiles()\PanelState$ + RelativePathFilename$ EndIf Next ProjectInfoFiles() @@ -572,8 +572,10 @@ Procedure UpdateProjectInfo() AddGadgetItem(#GADGET_ProjectInfo_Files, -1, Text$, ImageID) ; Associate the ProjectFile structure (for the Popup menu) - SetGadgetItemData(#GADGET_ProjectInfo_Files, CountGadgetItems(#GADGET_ProjectInfo_Files)-1, @ProjectInfoFiles()) + SelectElement(ProjectFiles(), ProjectInfoFiles()\SortIndex) + SetGadgetItemData(#GADGET_ProjectInfo_Files, CountGadgetItems(#GADGET_ProjectInfo_Files)-1, @ProjectFiles()) Next ProjectInfoFiles() + FreeList(ProjectInfoFiles()) ; Target list ; diff --git a/PureBasicIDE/dialogs/Projects.xml b/PureBasicIDE/dialogs/Projects.xml index 8c63f696..87f0af1b 100644 --- a/PureBasicIDE/dialogs/Projects.xml +++ b/PureBasicIDE/dialogs/Projects.xml @@ -74,7 +74,7 @@ - + From bcedae1eac4949a4032d213a673e7962de7a2328 Mon Sep 17 00:00:00 2001 From: ChrisRfr Date: Sun, 18 Jan 2026 00:09:44 +0100 Subject: [PATCH 4/7] RelativePathFilename for External base file --- PureBasicIDE/ProjectManagement.pb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PureBasicIDE/ProjectManagement.pb b/PureBasicIDE/ProjectManagement.pb index 9d92c410..b265dfdd 100644 --- a/PureBasicIDE/ProjectManagement.pb +++ b/PureBasicIDE/ProjectManagement.pb @@ -524,11 +524,12 @@ Procedure UpdateProjectInfo() CopyList(ProjectFiles(), ProjectInfoFiles()) ForEach ProjectInfoFiles() - ProjectInfoFiles()\SortIndex = ListIndex(ProjectInfoFiles()) + ProjectInfoFiles()\SortIndex = ListIndex(ProjectInfoFiles()) ; ProjectFile() index + RelativePathFilename$ = CreateRelativePath(GetPathPart(ProjectFile$), ProjectInfoFiles()\Filename$) If ProjectInfo_InBasePath(Base$, ProjectInfoFiles()\FileName$) = #False - ProjectInfoFiles()\PanelState$ = "2" + ProjectInfoFiles()\FileName$ ;ExternalBase + ProjectInfoFiles()\PanelState$ = "2" + RelativePathFilename$ ;ExternalBase Else - RelativePathFilename$ = CreateRelativePath(GetPathPart(ProjectFile$), ProjectInfoFiles()\Filename$) + If Right(GetPathPart(RelativePathFilename$), 1) = #Separator ProjectInfoFiles()\PanelState$ = "1" + RelativePathFilename$ ;Directory Else From bad793b40c74689d84e82ce8a40326afffd3c267 Mon Sep 17 00:00:00 2001 From: ChrisRfr Date: Sun, 18 Jan 2026 01:04:39 +0100 Subject: [PATCH 5/7] Reduce the flickering 2 on ProjectManagement On Windows, reduce the flickering 2 on ProjectManagement --- PureBasicIDE/ProjectManagement.pb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PureBasicIDE/ProjectManagement.pb b/PureBasicIDE/ProjectManagement.pb index b265dfdd..edd4cb26 100644 --- a/PureBasicIDE/ProjectManagement.pb +++ b/PureBasicIDE/ProjectManagement.pb @@ -452,6 +452,7 @@ Procedure ResizeProjectInfo(Width, Height) CompilerIf #CompileWindows SendMessage_(GadgetID(#GADGET_ProjectInfo), #WM_SETREDRAW, #False, 0) CompilerEndIf + ResizeGadget(#GADGET_ProjectInfo_FrameProject, 20-BorderOffset, 10-BorderOffset, Width-40, InfoHeight) ResizeGadget(#GADGET_ProjectInfo_Info, 30-BorderOffset, 15+ProjectInfoFrameHeight-BorderOffset, Width-65-ButtonWidth, InfoHeight-15-ProjectInfoFrameHeight) ResizeGadget(#GADGET_ProjectInfo_OpenOptions, Width-30-ButtonWidth-BorderOffset, 25+ProjectInfoFrameHeight-BorderOffset, ButtonWidth, Button1Height) @@ -478,8 +479,9 @@ Procedure ResizeProjectInfo(Width, Height) SendMessage_(GadgetID(#GADGET_ProjectInfo_Targets), #LVM_SETCOLUMNWIDTH, i, #LVSCW_AUTOSIZE_USEHEADER) EndIf Next i + SendMessage_(GadgetID(#GADGET_ProjectInfo), #WM_SETREDRAW, #True, 0) - RedrawWindow_(GadgetID(#GADGET_ProjectInfo), #Null, #Null, #RDW_INVALIDATE | #RDW_ERASE | #RDW_ALLCHILDREN | #RDW_UPDATENOW) + InvalidateRect_(GadgetID(#GADGET_ProjectInfo), 0, #False) CompilerEndIf EndProcedure From 49057e3a02ae1893c5e5bdaca0cc73b2984e2abd Mon Sep 17 00:00:00 2001 From: ChrisRfr Date: Fri, 23 Jan 2026 17:12:51 +0100 Subject: [PATCH 6/7] Reduce the flickering 3 InvalidateRect() is not enough, return to RedrawWindow() --- PureBasicIDE/ProjectManagement.pb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PureBasicIDE/ProjectManagement.pb b/PureBasicIDE/ProjectManagement.pb index edd4cb26..b5de1312 100644 --- a/PureBasicIDE/ProjectManagement.pb +++ b/PureBasicIDE/ProjectManagement.pb @@ -481,7 +481,7 @@ Procedure ResizeProjectInfo(Width, Height) Next i SendMessage_(GadgetID(#GADGET_ProjectInfo), #WM_SETREDRAW, #True, 0) - InvalidateRect_(GadgetID(#GADGET_ProjectInfo), 0, #False) + RedrawWindow_(GadgetID(#GADGET_ProjectInfo), #Null, #Null, #RDW_INVALIDATE | #RDW_ERASE | #RDW_ALLCHILDREN | #RDW_UPDATENOW) CompilerEndIf EndProcedure From 7324a6aaa7a676d228b41a81ebecddbeda3e35fb Mon Sep 17 00:00:00 2001 From: ChrisRfr Date: Tue, 27 Jan 2026 16:15:33 +0100 Subject: [PATCH 7/7] Remove previous changes made to reduce flickering Remove previous changes made to reduce flickering. It's not really satisfactory, as it has display problems here and there. --- PureBasicIDE/ProjectManagement.pb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/PureBasicIDE/ProjectManagement.pb b/PureBasicIDE/ProjectManagement.pb index b5de1312..e8fc5961 100644 --- a/PureBasicIDE/ProjectManagement.pb +++ b/PureBasicIDE/ProjectManagement.pb @@ -449,10 +449,6 @@ Procedure ResizeProjectInfo(Width, Height) PartFilesHeight = PartHeight * 3 / 5 PartProjectHeight = PartHeight - PartFilesHeight - CompilerIf #CompileWindows - SendMessage_(GadgetID(#GADGET_ProjectInfo), #WM_SETREDRAW, #False, 0) - CompilerEndIf - ResizeGadget(#GADGET_ProjectInfo_FrameProject, 20-BorderOffset, 10-BorderOffset, Width-40, InfoHeight) ResizeGadget(#GADGET_ProjectInfo_Info, 30-BorderOffset, 15+ProjectInfoFrameHeight-BorderOffset, Width-65-ButtonWidth, InfoHeight-15-ProjectInfoFrameHeight) ResizeGadget(#GADGET_ProjectInfo_OpenOptions, Width-30-ButtonWidth-BorderOffset, 25+ProjectInfoFrameHeight-BorderOffset, ButtonWidth, Button1Height) @@ -480,8 +476,6 @@ Procedure ResizeProjectInfo(Width, Height) EndIf Next i - SendMessage_(GadgetID(#GADGET_ProjectInfo), #WM_SETREDRAW, #True, 0) - RedrawWindow_(GadgetID(#GADGET_ProjectInfo), #Null, #Null, #RDW_INVALIDATE | #RDW_ERASE | #RDW_ALLCHILDREN | #RDW_UPDATENOW) CompilerEndIf EndProcedure