From b32059f155161c336aca64b26ccafbe74d903110 Mon Sep 17 00:00:00 2001 From: SteveMcNeill Date: Sat, 26 Nov 2022 03:06:36 -0500 Subject: [PATCH] Change to Open File Dialog Change to open file dialog so that it initially opens in the user's StartDir$, and then from whatever folder they navigate to after that. --- source/ide/ide_methods.bas | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index e12c19e6e..0f2592eb0 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -20234,12 +20234,21 @@ end sub Function OpenFile$ (IdeOpenFile as string)'load routine copied/pasted from the old IDE file load/save dialog routines + STATIC Default_StartDir$ + + IF Default_StartDir$ = "" THEN + Default_StartDir$ = _STARTDIR$ + if Right$(Default_StartDir$, 1) <> idepathsep$ then Default_StartDir$ = Default_StartDir$ + idepathsep$ + END IF ideopenloop: - if IdeOpenFile = "" THEN f$ = _OpenFileDialog$("Open Source File", "", "*.bas|*.BAS|*.Bas|*.bi|*.BI|*.Bi|*.bm|*.BM|*.Bm", "QB64-PE Source Files", 0) ELSE f$ = IdeOpenFile - if f$ = "" THEN OpenFile$ = "C":EXIT FUNCTION + IF IdeOpenFile = "" THEN f$ = _OpenFileDialog$("Open Source File", Default_StartDir$, "*.bas|*.BAS|*.Bas|*.bi|*.BI|*.Bi|*.bm|*.BM|*.Bm", "QB64-PE Source Files", 0) ELSE f$ = IdeOpenFile + IF f$ = "" THEN OpenFile$ = "C":EXIT FUNCTION path$ = ideztakepath$ (f$) + Default_StartDir$ = path$ + if Right$(Default_StartDir$, 1) <> idepathsep$ then Default_StartDir$ = Default_StartDir$ + idepathsep$ + IF _FILEEXISTS(path$ + idepathsep$ + f$) = 0 THEN 'see if the user forgot the .bas extension and check for the file IF (LCASE$(RIGHT$(f$, 4)) <> ".bas") AND AllFiles = 0 THEN f$ = f$ + ".bas"