mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-07 15:20:18 +00:00
Merge pull request #261 from SteveMcNeill/main
Change to Open File Dialog
This commit is contained in:
commit
f9b7da4777
1 changed files with 11 additions and 2 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue