mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-08-05 22:50:25 +00:00
Merge pull request #356 from SteveMcNeill/main
Savefile GUI added to IDE
This commit is contained in:
commit
5757e38388
1 changed files with 45 additions and 10 deletions
|
@ -6356,10 +6356,11 @@ FUNCTION ide2 (ignore)
|
||||||
IF r$ = "Y" THEN
|
IF r$ = "Y" THEN
|
||||||
IF ideprogname = "" THEN
|
IF ideprogname = "" THEN
|
||||||
ProposedTitle$ = FindProposedTitle$
|
ProposedTitle$ = FindProposedTitle$
|
||||||
IF ProposedTitle$ = "" THEN
|
IF ProposedTitle$ = "" THEN ProposedTitle$ = "untitled" + tempfolderindexstr$
|
||||||
r$ = idefiledialog$("untitled" + tempfolderindexstr$ + ".bas", 2)
|
IF UseGuiDialogs Then
|
||||||
|
a$ = Savefile$ (ProposedTitle$ + ".bas")
|
||||||
ELSE
|
ELSE
|
||||||
r$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
a$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
||||||
END IF
|
END IF
|
||||||
IF ideerror > 1 THEN PCOPY 3, 0: SCREEN , , 3, 0: GOTO IDEerrorMessage
|
IF ideerror > 1 THEN PCOPY 3, 0: SCREEN , , 3, 0: GOTO IDEerrorMessage
|
||||||
IF r$ = "C" THEN GOTO ideloop
|
IF r$ = "C" THEN GOTO ideloop
|
||||||
|
@ -6384,14 +6385,14 @@ FUNCTION ide2 (ignore)
|
||||||
PCOPY 2, 0
|
PCOPY 2, 0
|
||||||
IF ideprogname = "" THEN
|
IF ideprogname = "" THEN
|
||||||
ProposedTitle$ = FindProposedTitle$
|
ProposedTitle$ = FindProposedTitle$
|
||||||
IF ProposedTitle$ = "" THEN
|
IF ProposedTitle$ = "" THEN ProposedTitle$ = "untitled" + tempfolderindexstr$
|
||||||
a$ = idefiledialog$("untitled" + tempfolderindexstr$ + ".bas", 2)
|
IF UseGuiDialogs Then
|
||||||
|
a$ = Savefile$ (ProposedTitle$ + ".bas")
|
||||||
ELSE
|
ELSE
|
||||||
a$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
a$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
||||||
END IF
|
END IF
|
||||||
IF ideerror > 1 THEN PCOPY 3, 0: SCREEN , , 3, 0: GOTO IDEerrorMessage
|
|
||||||
ELSE
|
ELSE
|
||||||
idesave idepath$ + idepathsep$ + ideprogname$
|
idesave idepath$ + idepathsep$ + ideprogname
|
||||||
END IF
|
END IF
|
||||||
PCOPY 3, 0: SCREEN , , 3, 0: GOTO ideloop
|
PCOPY 3, 0: SCREEN , , 3, 0: GOTO ideloop
|
||||||
END IF
|
END IF
|
||||||
|
@ -6401,14 +6402,19 @@ FUNCTION ide2 (ignore)
|
||||||
PCOPY 2, 0
|
PCOPY 2, 0
|
||||||
IF ideprogname = "" THEN
|
IF ideprogname = "" THEN
|
||||||
ProposedTitle$ = FindProposedTitle$
|
ProposedTitle$ = FindProposedTitle$
|
||||||
IF ProposedTitle$ = "" THEN
|
IF ProposedTitle$ = "" THEN ProposedTitle$ = "untitled" + tempfolderindexstr$
|
||||||
a$ = idefiledialog$("untitled" + tempfolderindexstr$ + ".bas", 2)
|
IF UseGuiDialogs Then
|
||||||
|
a$ = Savefile$ (ProposedTitle$ + ".bas")
|
||||||
ELSE
|
ELSE
|
||||||
a$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
a$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
||||||
END IF
|
END IF
|
||||||
|
ELSE
|
||||||
|
IF UseGuiDialogs Then
|
||||||
|
a$ = Savefile$ (ideprogname$)
|
||||||
ELSE
|
ELSE
|
||||||
a$ = idefiledialog$(ideprogname$, 2)
|
a$ = idefiledialog$(ideprogname$, 2)
|
||||||
END IF
|
END IF
|
||||||
|
END IF
|
||||||
PCOPY 3, 0: SCREEN , , 3, 0
|
PCOPY 3, 0: SCREEN , , 3, 0
|
||||||
IF ideerror > 1 THEN GOTO IDEerrorMessage
|
IF ideerror > 1 THEN GOTO IDEerrorMessage
|
||||||
GOTO ideloop
|
GOTO ideloop
|
||||||
|
@ -20286,6 +20292,35 @@ end sub
|
||||||
' Download = MKI$(0) 'still working
|
' Download = MKI$(0) 'still working
|
||||||
'END FUNCTION
|
'END FUNCTION
|
||||||
|
|
||||||
|
Function SaveFile$ (IdeOpenFile as string)
|
||||||
|
STATIC Default_StartDir$
|
||||||
|
|
||||||
|
IF Default_StartDir$ = "" THEN
|
||||||
|
Default_StartDir$ = _STARTDIR$
|
||||||
|
if Right$(Default_StartDir$, 1) <> idepathsep$ then Default_StartDir$ = Default_StartDir$ + idepathsep$
|
||||||
|
END IF
|
||||||
|
|
||||||
|
f$ = _SaveFileDialog$("Save As", Default_StartDir$ + path$ + IdeOpenFile, ".bas", "QB64PE BAS file")
|
||||||
|
if f$ = "" THEN EXIT FUNCTION 'someone canceled the input.
|
||||||
|
IF FileHasExtension(f$) = 0 THEN f$ = f$ + ".bas"
|
||||||
|
path$ = idezgetfilepath$(ideroot$, f$)
|
||||||
|
pathseppos = _INSTRREV(f$, idepathsep$)
|
||||||
|
IF pathseppos > 0 THEN f$ = Mid$(f$, pathseppos +1)
|
||||||
|
|
||||||
|
ideerror = 3
|
||||||
|
OPEN path$ + idepathsep$ + f$ FOR BINARY AS #150
|
||||||
|
ideerror = 1
|
||||||
|
ideprogname$ = f$: _TITLE ideprogname + " - " + WindowTitle
|
||||||
|
idesave path$ + idepathsep$ + f$
|
||||||
|
idepath$ = path$
|
||||||
|
IdeAddRecent path$ + idepathsep$ + f$
|
||||||
|
IdeSaveBookmarks path$ + idepathsep$ + f$
|
||||||
|
CLOSE #150
|
||||||
|
end sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function OpenFile$ (IdeOpenFile as string)'load routine copied/pasted from the old IDE file load/save dialog routines
|
Function OpenFile$ (IdeOpenFile as string)'load routine copied/pasted from the old IDE file load/save dialog routines
|
||||||
|
|
||||||
STATIC Default_StartDir$
|
STATIC Default_StartDir$
|
||||||
|
|
Loading…
Reference in a new issue