mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-06 01:10:23 +00:00
Savefile GUI added to IDE
Added the ability to use the Save Dialogs in the IDE.
This commit is contained in:
parent
27b6fdb0a9
commit
00921c6d84
|
@ -6401,13 +6401,18 @@ FUNCTION ide2 (ignore)
|
|||
PCOPY 2, 0
|
||||
IF ideprogname = "" THEN
|
||||
ProposedTitle$ = FindProposedTitle$
|
||||
IF ProposedTitle$ = "" THEN
|
||||
a$ = idefiledialog$("untitled" + tempfolderindexstr$ + ".bas", 2)
|
||||
IF ProposedTitle$ = "" THEN ProposedTitle$ = "untitled" + tempfolderindexstr$
|
||||
IF UseGuiDialogs Then
|
||||
a$ = Savefile$ (ProposedTitle$ + ".bas")
|
||||
ELSE
|
||||
a$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
||||
END IF
|
||||
ELSE
|
||||
a$ = idefiledialog$(ideprogname$, 2)
|
||||
IF UseGuiDialogs Then
|
||||
a$ = Savefile$ (ideprogname$)
|
||||
ELSE
|
||||
a$ = idefiledialog$(ideprogname$, 2)
|
||||
END IF
|
||||
END IF
|
||||
PCOPY 3, 0: SCREEN , , 3, 0
|
||||
IF ideerror > 1 THEN GOTO IDEerrorMessage
|
||||
|
@ -20286,6 +20291,31 @@ end sub
|
|||
' Download = MKI$(0) 'still working
|
||||
'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 RIght$(Ucase$(f$),4) <> ".BAS" THEN f$ = f$ + ".bas"
|
||||
|
||||
ideerror = 3
|
||||
OPEN f$ FOR BINARY AS #150
|
||||
ideerror = 1
|
||||
ideprogname$ = f$: _TITLE ideprogname + " - " + WindowTitle
|
||||
idesave f$
|
||||
idepath$ = path$
|
||||
IdeAddRecent f$
|
||||
IdeSaveBookmarks f$
|
||||
CLOSE #150
|
||||
end sub
|
||||
|
||||
|
||||
|
||||
|
||||
Function OpenFile$ (IdeOpenFile as string)'load routine copied/pasted from the old IDE file load/save dialog routines
|
||||
|
||||
STATIC Default_StartDir$
|
||||
|
|
Loading…
Reference in a new issue