mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-05 18:10:24 +00:00
Push to change the config system to work with "config.txt", which should be a file editable by the IDE or any other text editer.
This commit is contained in:
parent
8b02aafd8c
commit
ee03158465
238
source/global/IDEsettings.bas
Normal file
238
source/global/IDEsettings.bas
Normal file
|
@ -0,0 +1,238 @@
|
|||
DIM SHARED IDECommentColor AS _UNSIGNED LONG, IDEMetaCommandColor AS _UNSIGNED LONG
|
||||
DIM SHARED IDEQuoteColor AS _UNSIGNED LONG, IDETextColor AS _UNSIGNED LONG
|
||||
DIM SHARED IDE_AutoPosition AS _BYTE, IDE_TopPosition AS INTEGER, IDE_LeftPosition AS INTEGER
|
||||
DIM SHARED IDE_Index$
|
||||
DIM SHARED LoadedIDESettings AS INTEGER
|
||||
|
||||
IF LoadedIDESettings = 0 THEN
|
||||
'We only want to load the file once when QB64 first starts
|
||||
'Other changes should occur to our settings when we change them in their appropiate routines.
|
||||
'There's no reason to open and close and open and close the same file a million times.
|
||||
|
||||
LoadedIDESettings = -1
|
||||
|
||||
ConfigFile$ = "internal/config.txt"
|
||||
ConfigBak$ = "internal/config.bak"
|
||||
|
||||
GOSUB CheckConfigFileExists 'make certain the config file exists and if not, create one
|
||||
|
||||
IF INSTR(_OS$, "WIN") THEN
|
||||
|
||||
result = ReadConfigSetting("AllowIndependentSettings", value$)
|
||||
IF result THEN
|
||||
IF value$ = "TRUE" OR ABS(VAL(value$)) = 1 THEN 'We default to false and only use one set of IDE settings, no matter how many windows we open up
|
||||
IDE_Index$ = "(" + LTRIM$(RTRIM$(STR$(tempfolderindex))) + ")"
|
||||
ConfigFile$ = "internal/config" + IDE_Index$ + ".txt"
|
||||
ConfigBak$ = "internal/config" + IDE_Index$ + ".bak"
|
||||
GOSUB CheckConfigFileExists
|
||||
ELSE
|
||||
WriteConfigSetting "'[GENERAL SETTINGS]", "AllowIndependentSettings", "FALSE"
|
||||
IDE_Index$ = ""
|
||||
END IF
|
||||
ELSE
|
||||
WriteConfigSetting "'[GENERAL SETTINGS]", "AllowIndependentSettings", "FALSE"
|
||||
IDE_Index$ = ""
|
||||
END IF
|
||||
|
||||
ELSE
|
||||
'Linux doesn't offer multiple temp folders and thus can not work properly with independent settings
|
||||
'This option is not included on Linux, and if manually inserted will simply be ignored.
|
||||
IDE_Index$ = ""
|
||||
END IF
|
||||
|
||||
result = ReadConfigSetting("ConfigVersion", value$) 'Not really used for anything at this point, but might be important in the future.
|
||||
ConfigFileVersion = VAL(value$) 'We'll get a config file version of 0 if there isn't any in the file
|
||||
|
||||
result = ReadConfigSetting("CommentColor", value$)
|
||||
IF result THEN
|
||||
IDECommentColor = VRGBS(value$, _RGB32(85, 255, 255))
|
||||
ELSE
|
||||
IDECommentColor = _RGB32(85, 255, 255)
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "CommentColor", "_RGB32(85,255,255)"
|
||||
END IF
|
||||
|
||||
result = ReadConfigSetting("MetaCommandColor", value$)
|
||||
IF result THEN
|
||||
IDEMetaCommandColor = VRGBS(value$, _RGB32(85, 255, 85))
|
||||
ELSE
|
||||
IDEMetaCommandColor = _RGB32(85, 255, 85)
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "MetaCommandColor", "_RGB32(85,255,85)"
|
||||
END IF
|
||||
|
||||
result = ReadConfigSetting("QuoteColor", value$)
|
||||
IF result THEN
|
||||
IDEQuoteColor = VRGBS(value$, _RGB32(255, 255, 85))
|
||||
ELSE
|
||||
IDEQuoteColor = _RGB32(255, 255, 85)
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "QuoteColor", "_RGB32(255,255,85)"
|
||||
END IF
|
||||
|
||||
result = ReadConfigSetting("TextColor", value$)
|
||||
IF result THEN
|
||||
IDETextColor = VRGBS(value$, _RGB32(255, 255, 2555))
|
||||
ELSE
|
||||
IDETextColor = _RGB32(255, 255, 255)
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "TextColor", "_RGB32(255,255,255)"
|
||||
END IF
|
||||
|
||||
IF INSTR(_OS$, "WIN") THEN
|
||||
|
||||
result = ReadConfigSetting("IDE_AutoPosition", value$)
|
||||
IF result THEN
|
||||
IF UCASE$(value$) = "TRUE" OR ABS(VAL(value$)) = 1 THEN
|
||||
IDE_AutoPosition = -1
|
||||
ELSE
|
||||
IDE_AutoPosition = 0
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "FALSE"
|
||||
END IF
|
||||
ELSE
|
||||
IDE_Autopostion = 0
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "FALSE"
|
||||
END IF
|
||||
|
||||
result = ReadConfigSetting("IDE_TopPosition", value$)
|
||||
IF result THEN
|
||||
IDE_TopPosition = VAL(value$)
|
||||
ELSE
|
||||
IDE_Autopostion = 0 'If there's no position saved in the file, then we certainly don't need to try and auto-position to our last setting.
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "FALSE"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_TopPosition", "0"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_LeftPosition", "0"
|
||||
END IF
|
||||
|
||||
result = ReadConfigSetting("IDE_LeftPosition", value$)
|
||||
IF result THEN
|
||||
IDE_LeftPosition = VAL(value$)
|
||||
ELSE
|
||||
IDE_Autopostion = 0 'If there's no position saved in the file, then we certainly don't need to try and auto-position to our last setting.
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "FALSE"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_TopPosition", "0"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_LeftPosition", "0"
|
||||
END IF
|
||||
|
||||
'I was going to do some basic error checking for screen position to make certain that we appeared on the monitor,
|
||||
'but I decided not to. Some people (like me) may have multiple monitors set up and may wish for QB64 to pop-up at
|
||||
'a coordinate which seems insane at first glance (-1000,0 for instance), but which may move the IDE window to the
|
||||
'second monitor instead of the primary one.
|
||||
'I'm going to trust that the user doesn't go crazy and enter values like IDE_TopPosition = 123456789 or something insane...
|
||||
|
||||
ELSE 'Linux doesn't work with _SCREENY or _SCREENY, so it's impossible to move the IDE properly.
|
||||
'These settings aren't included and are always set FALSE for them.
|
||||
IDE_AutoPosition = 0
|
||||
IDE_TopPosition = 0
|
||||
IDE_LeftPosition = 0
|
||||
END IF
|
||||
result = ReadConfigSetting("IDE_Width", value$)
|
||||
idewx = VAL(value$)
|
||||
IF idewx < 80 OR idewx > 1000 THEN idewx = 80: WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_Width", "80"
|
||||
|
||||
result = ReadConfigSetting("IDE_Height", value$)
|
||||
idewy = VAL(value$)
|
||||
IF idewx < 25 OR idewx > 1000 THEN idewx = 25: WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_Height", "25"
|
||||
|
||||
result = ReadConfigSetting("IDE_AutoFormat", value$)
|
||||
ideautolayout = VAL(value$)
|
||||
IF UCASE$(value$) = "TRUE" OR ideautolayout <> 0 THEN
|
||||
ideautolayout = 1
|
||||
ELSE
|
||||
IF UCASE$(value$) <> "FALSE" AND value$ <> "0" THEN WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoFormat", "TRUE"
|
||||
END IF
|
||||
|
||||
result = ReadConfigSetting("IDE_AutoIndent", value$)
|
||||
ideautoindent = VAL(value$)
|
||||
IF UCASE$(value$) = "TRUE" OR ideautoindent <> 0 THEN
|
||||
ideautoindent = 1
|
||||
ELSE
|
||||
IF UCASE$(value$) <> "FALSE" AND value$ <> "0" THEN WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoIndent", "TRUE"
|
||||
END IF
|
||||
|
||||
result = ReadConfigSetting("IDE_IndentSize", value$)
|
||||
ideautoindentsize = VAL(value$)
|
||||
IF ideautoindentsize < 0 OR ideautoindentsize > 64 THEN ideautoindentsize = 4: WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_IndentSize", "4"
|
||||
|
||||
result = ReadConfigSetting("IDE_CustomFont", value$)
|
||||
idecustomfont = VAL(value$)
|
||||
IF UCASE$(value$) = "TRUE" OR idecustomfont <> 0 THEN idecustomfont = 1 ELSE WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CustomFont", "FALSE"
|
||||
|
||||
result = ReadConfigSetting("IDE_CustomFont$", value$)
|
||||
idecustomfontfile$ = value$
|
||||
IF idecustomfontfile$ = "" THEN WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CustomFont$", "c:\windows\fonts\lucon.ttf"
|
||||
|
||||
result = ReadConfigSetting("IDE_CustomFontSize", value$)
|
||||
idecustomfontheight = VAL(value$)
|
||||
IF idecustomfontheight < 8 OR idecustomfontheight > 100 THEN idecustomfontheight = 21: WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CustomFontSize", "21"
|
||||
|
||||
result = ReadConfigSetting("IDE_CodePage", value$)
|
||||
idecpindex = VAL(value$)
|
||||
IF idecpindex < 0 OR idecpindex > idecpnum THEN idecpindex = 0: WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CodePage", "0"
|
||||
|
||||
result = ReadConfigSetting("BackupSize", value$)
|
||||
idebackupdize = VAL(value$)
|
||||
IF idebackupsize < 10 OR idebackupsize > 2000 THEN idebackupize = 100: WriteConfigSetting "'[GENERAL SETTINGS]", "BackupSize", "100 'in MB"
|
||||
|
||||
result = ReadConfigSetting("DeBugInfo", value$)
|
||||
idedebuginfo = VAL(value$)
|
||||
IF UCASE$(LEFT$(value$, 4)) = "TRUE" THEN idedebuginfo = 1
|
||||
IF idedebuginfo = 0 THEN WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "FALSE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
||||
Include_GDB_Debugging_Info = idedebuginfo
|
||||
|
||||
result = ReadConfigSetting("IDE_AndroidMenu", value$)
|
||||
IdeAndroidMenu = ABS(VAL(value$))
|
||||
IF UCASE$(value$) = "TRUE" THEN IdeAndroidMenu = 1
|
||||
IF IdeAndroidMenu <> 1 THEN ideideandroidmenu = 0: WriteConfigSetting "'[ANDROID MENU]", "IDE_AndroidMenu", "FALSE"
|
||||
|
||||
result = ReadConfigSetting("IDE_AndroidStartScript$", value$)
|
||||
IdeAndroidStartScript$ = value$ 'no default values in case this fails??
|
||||
IF result = 0 THEN WriteConfigSetting "'[ANDROID MENU]", "IDE_AndroidStartScript$", "programs\android\start_android.bat"
|
||||
|
||||
result = ReadConfigSetting("IDE_AndroidMakeScript$", value$)
|
||||
IdeAndroidMakeScript$ = value$ 'no default values in case this fails??
|
||||
IF result = 0 THEN WriteConfigSetting "'[ANDROID MENU]", "IDE_AndroidMakeScript$", "programs\android\start_android.bat"
|
||||
|
||||
|
||||
GOTO SkipCheckConfigFileExists
|
||||
CheckConfigFileExists:
|
||||
IF _FILEEXISTS(ConfigFile$) = 0 THEN
|
||||
'There's no config file in the folder. Let's make one for future use.
|
||||
IF ConfigFile$ = "internal/config.txt" THEN 'It's the main file which we use for default/global settings
|
||||
WriteConfigSetting "'[CONFIG VERSION]", "ConfigVersion", "1"
|
||||
WriteConfigSetting "'[ANDROID MENU]", "IDE_AndroidMakeScript$", "programs\android\start_android.bat"
|
||||
WriteConfigSetting "'[ANDROID MENU]", "IDE_AndroidStartScript$", "programs\android\start_android.bat"
|
||||
WriteConfigSetting "'[ANDROID MENU]", "IDE_AndroidMenu", "FALSE"
|
||||
IF INSTR(_OS$, "WIN") THEN WriteConfigSetting "'[GENERAL SETTINGS]", "AllowIndependentSettings", "FALSE"
|
||||
WriteConfigSetting "'[GENERAL SETTINGS]", "BackupSize", "100 'in MB"
|
||||
WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "FALSE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "CommentColor", "_RGB32(85,255,255)"
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "MetaCommandColor", "_RGB32(85,255,85)"
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "QuoteColor", "_RGB32(255,255,85)"
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "TextColor", "_RGB32(255,255,255)"
|
||||
IF INSTR(_OS$, "WIN") THEN
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_TopPosition", "0"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_LeftPosition", "0"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "FALSE"
|
||||
END IF
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_Width", "80"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_Height", "25"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_IndentSize", "4"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoIndent", "TRUE"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoFormat", "TRUE"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CustomFontSize", "21"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CustomFont$", "c:\windows\fonts\lucon.ttf"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CustomFont", "FALSE"
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CodePage", "0"
|
||||
ELSE
|
||||
'use the main config file as the default values and just copy it over to the new file
|
||||
f = FREEFILE
|
||||
OPEN "internal/config.txt" FOR BINARY AS #f
|
||||
L = LOF(f): temp$ = SPACE$(L)
|
||||
GET #f, 1, temp$
|
||||
CLOSE #f
|
||||
OPEN ConfigFile$ FOR BINARY AS #f
|
||||
PUT #f, 1, temp$
|
||||
CLOSE #f
|
||||
END IF
|
||||
END IF
|
||||
RETURN
|
||||
SkipCheckConfigFileExists:
|
||||
END IF
|
||||
|
|
@ -1,40 +1,3 @@
|
|||
'Used for debugging the compiler's code (not the code it compiles) [for temporary/advanced usage]
|
||||
CONST Debug = 0
|
||||
DIM SHARED IDECommentColor AS _UNSIGNED LONG, IDEMetaCommandColor AS _UNSIGNED LONG
|
||||
DIM SHARED IDEQuoteColor AS _UNSIGNED LONG, IDETextColor AS _UNSIGNED LONG
|
||||
|
||||
ConfigFile$ = "internal/config.txt"
|
||||
ConfigBak$ = "internal/config.bak"
|
||||
|
||||
IF _FILEEXISTS(ConfigFile$) = 0 THEN
|
||||
'There's no config file in the folder. Let's make one for future use.
|
||||
WriteConfigSetting "'[CONFIG VERSION]", "ConfigVersion", "1"
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "CommentColor", "_RGB32(85,255,255)"
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "MetaCommandColor", "_RGB32(85,255,85)"
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "QuoteColor", "_RGB32(255,255,85)"
|
||||
WriteConfigSetting "'[IDE COLOR SETTINGS]", "TextColor", "_RGB32(255,255,255)"
|
||||
|
||||
'go ahead and set default values automatically
|
||||
ConfigFileVersion = 1
|
||||
IDECommentColor = _RGB32(85, 255, 255)
|
||||
IDEMetaCommandColor = _RGB32(85, 255, 85)
|
||||
IDEQuoteColor = _RGB32(255, 255, 85)
|
||||
IDETextColor = _RGB32(255, 255, 255)
|
||||
ELSE
|
||||
|
||||
result = ReadConfigSetting("ConfigVersion", value$) 'Not really used for anything at this point, but might be important in the future.
|
||||
ConfigFileVersion = VAL(value$) 'We'll get a config file version of 0 if there isn't any in the file
|
||||
|
||||
result = ReadConfigSetting("CommentColor", value$)
|
||||
IF result THEN IDECommentColor = VRGBS(value$, _RGB32(85, 255, 255)) ELSE IDECommentColor = _RGB32(85, 255, 255)
|
||||
|
||||
result = ReadConfigSetting("MetaCommandColor", value$)
|
||||
IF result THEN IDEMetaCommandColor = VRGBS(value$, _RGB32(85, 255, 85)) ELSE IDEMetaCommandColor = _RGB32(85, 255, 85)
|
||||
|
||||
result = ReadConfigSetting("QuoteColor", value$)
|
||||
IF result THEN IDEQuoteColor = VRGBS(value$, _RGB32(255, 255, 85)) ELSE IDEQuoteColor = _RGB32(255, 255, 85)
|
||||
|
||||
result = ReadConfigSetting("TextColor", value$)
|
||||
IF result THEN IDETextColor = VRGBS(value$, _RGB32(255, 255, 2555)) ELSE IDETextColor = _RGB32(255, 255, 255)
|
||||
|
||||
END IF
|
||||
|
|
|
@ -624,22 +624,28 @@ DO
|
|||
|
||||
idedeltxt 'removes temporary strings (typically created by guibox commands) by setting an index to 0
|
||||
STATIC ForceResize
|
||||
'### STEVE WAS HERE 10/11/2013 ###
|
||||
if IDE_AutoPosition then
|
||||
IF IDE_TopPosition <> _SCREENY OR IDE_LeftPosition <> _SCREENX THEN
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_TopPosition" , str$(_SCREENY)
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_LeftPosition" , str$(_SCREENX)
|
||||
IDE_TopPosition = _SCREENY: IDE_LeftPosition = _SCREENX
|
||||
END IF
|
||||
end if
|
||||
|
||||
IF _RESIZE or ForceResize THEN
|
||||
IF idesubwindow <> 0 THEN 'If there's a subwindow up, don't resize as it screws all sorts of things up.
|
||||
ForceResize = -1
|
||||
ELSE
|
||||
ForceResize = 0
|
||||
f = FREEFILE
|
||||
OPEN ".\internal\temp\options.bin" FOR BINARY AS #f
|
||||
v% = _RESIZEWIDTH \ _FONTWIDTH: IF v% < 80 OR v% > 1000 THEN v% = 80
|
||||
IF v% <> idewx THEN retval = 1: idewx = v%
|
||||
PUT #f, 7, v%
|
||||
v% = _RESIZEHEIGHT \ _FONTHEIGHT: IF v% < 25 OR v% > 1000 THEN v% = 25
|
||||
IF v% <> idewy THEN retval = 1: idewy = v%
|
||||
PUT #f, 9, v%
|
||||
CLOSE #f
|
||||
|
||||
IF retval = 1 THEN 'screen dimensions have changed and everything must be redrawn/reapplied
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_Width", str$(idewx)
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_Height", str$(idewy)
|
||||
|
||||
tempf& = _font
|
||||
WIDTH idewx, idewy + idesubwindow
|
||||
_font tempf&
|
||||
|
@ -647,7 +653,6 @@ DO
|
|||
END IF
|
||||
END IF
|
||||
END IF
|
||||
'### END OF STEVE EDIT
|
||||
|
||||
IF skipdisplay = 0 THEN
|
||||
|
||||
|
@ -6638,16 +6643,9 @@ DO 'main loop
|
|||
_MAPUNICODE u TO x
|
||||
NEXT
|
||||
|
||||
'SEEK 1049
|
||||
'[2] codepage(=0)
|
||||
'total bytes: 1050
|
||||
|
||||
'save changes
|
||||
OPEN ".\internal\temp\options.bin" FOR BINARY AS #150
|
||||
SEEK #150, 1049
|
||||
v% = y: PUT #150, , v%: idecpindex = v%
|
||||
CLOSE #150
|
||||
|
||||
v% = y: idecpindex = v%
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CodePage", str$(idecpindex)
|
||||
EXIT FUNCTION
|
||||
END IF
|
||||
|
||||
|
@ -7564,23 +7562,33 @@ DO 'main loop
|
|||
IF K$ = CHR$(27) OR (focus = 5 AND info <> 0) THEN EXIT FUNCTION
|
||||
IF K$ = CHR$(13) OR (focus = 4 AND info <> 0) THEN
|
||||
'save changes
|
||||
OPEN ".\internal\temp\options.bin" FOR BINARY AS #150
|
||||
v% = o(1).sel: IF v% <> 0 THEN v% = 1 'ideautolayout
|
||||
PUT #150, , v%
|
||||
|
||||
IF ideautolayout <> v% THEN ideautolayout = v%: idelayoutbox = 1
|
||||
v% = o(2).sel: IF v% <> 0 THEN v% = 1 'ideautoindent
|
||||
PUT #150, , v%
|
||||
|
||||
IF ideautoindent <> v% THEN ideautoindent = v%: idelayoutbox = 1
|
||||
v$ = idetxt(o(3).txt) 'ideautoindentsize
|
||||
IF v$ = "" THEN v$ = "4"
|
||||
v% = VAL(v$)
|
||||
IF v% < 0 OR v% > 64 THEN v% = 4
|
||||
PUT #150, , v%
|
||||
IF ideautoindentsize <> v% THEN
|
||||
ideautoindentsize = v%
|
||||
IF ideautoindent <> 0 THEN idelayoutbox = 1
|
||||
END IF
|
||||
CLOSE #150
|
||||
|
||||
if ideautolayout then
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoFormat", "TRUE"
|
||||
else
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoFormat", "FALSE"
|
||||
end if
|
||||
if ideautoindent then
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoIndent", "TRUE"
|
||||
else
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoIndent", "FALSE"
|
||||
end if
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_IndentSize", str$(ideautoindentsize)
|
||||
|
||||
EXIT FUNCTION
|
||||
END IF
|
||||
|
||||
|
@ -7723,8 +7731,6 @@ DO 'main loop
|
|||
|
||||
IF K$ = CHR$(13) OR (focus = 2 AND info <> 0) THEN
|
||||
'save changes
|
||||
OPEN ".\internal\temp\options.bin" FOR BINARY AS #150
|
||||
SEEK #150, 1051
|
||||
v$ = idetxt(o(1).txt) 'idebackupsize
|
||||
v& = VAL(v$)
|
||||
IF v& < 10 THEN v& = 10
|
||||
|
@ -7737,8 +7743,7 @@ DO 'main loop
|
|||
END IF
|
||||
|
||||
idebackupsize = v&
|
||||
PUT #150, , v&
|
||||
CLOSE #150
|
||||
WriteConfigSetting "'[GENERAL SETTINGS]", "BackupSize", str$(v&) + " 'in MB"
|
||||
idebackupbox = 1
|
||||
EXIT FUNCTION
|
||||
END IF
|
||||
|
@ -8029,13 +8034,16 @@ DO 'main loop
|
|||
|
||||
IF K$ = CHR$(13) OR (focus = 1 AND info <> 0) THEN 'close
|
||||
'save changes
|
||||
OPEN ".\internal\temp\options.bin" FOR BINARY AS #150
|
||||
|
||||
'update idedebuginfo?
|
||||
v% = o(2).sel: IF v% <> 0 THEN v% = 1
|
||||
IF v% <> idedebuginfo THEN
|
||||
SEEK #150, 1055: PUT #150, , v%
|
||||
idedebuginfo = v%
|
||||
if idedebuginfo then
|
||||
WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "TRUE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
||||
else
|
||||
WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "FALSE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
||||
end if
|
||||
Include_GDB_Debugging_Info = idedebuginfo
|
||||
IF os$ = "WIN" THEN
|
||||
CHDIR "internal\c"
|
||||
|
@ -8057,7 +8065,6 @@ DO 'main loop
|
|||
|
||||
'...
|
||||
|
||||
CLOSE #150
|
||||
|
||||
EXIT FUNCTION
|
||||
END IF
|
||||
|
@ -8477,12 +8484,14 @@ DO 'main loop
|
|||
v3$ = idetxt(o(3 - 1).txt)
|
||||
IF LEN(v3$) > 256 THEN v3$ = LEFT$(v3$, 256)
|
||||
IF LEN(v3$) < 256 THEN v3$ = v3$ + SPACE$(256 - LEN(v3$))
|
||||
OPEN ".\internal\temp\options.bin" FOR BINARY AS #150
|
||||
SEEK #150, 1057
|
||||
PUT #150, , v%
|
||||
PUT #150, , v$
|
||||
PUT #150, , v3$
|
||||
CLOSE #150
|
||||
WriteConfigSetting "'[ANDROID MENU]", "IDE_AndroidMakeScript$", v3$
|
||||
WriteConfigSetting "'[ANDROID MENU]", "IDE_AndroidStartScript$", v$
|
||||
if v% then
|
||||
WriteConfigSetting "'[ANDROID MENU]", "IDE_AndroidMenu", "TRUE"
|
||||
ELSE
|
||||
WriteConfigSetting "'[ANDROID MENU]", "IDE_AndroidMenu", "FALSE"
|
||||
end if
|
||||
|
||||
IdeAndroidMenu = o(1).sel
|
||||
IdeAndroidStartScript = "" 'idetxt(o(2).txt)
|
||||
IdeAndroidMakeScript = idetxt(o(3 - 1).txt)
|
||||
|
@ -8732,44 +8741,47 @@ DO 'main loop
|
|||
END IF
|
||||
|
||||
'save changes
|
||||
OPEN ".\internal\temp\options.bin" FOR BINARY AS #150
|
||||
|
||||
SEEK #150, 7
|
||||
|
||||
v$ = idetxt(o(1).txt): IF v$ = "" THEN v$ = "0"
|
||||
v% = VAL(v$)
|
||||
IF v% < 80 THEN v% = 80
|
||||
IF v% > 999 THEN v% = 999
|
||||
PUT #150, , v%
|
||||
IF v% <> idewx THEN idedisplaybox = 1
|
||||
idewx = v%
|
||||
|
||||
|
||||
v$ = idetxt(o(2).txt): IF v$ = "" THEN v$ = "0"
|
||||
v% = VAL(v$)
|
||||
IF v% < 25 THEN v% = 25
|
||||
IF v% > 999 THEN v% = 999
|
||||
PUT #150, , v%
|
||||
IF v% <> idewy THEN idedisplaybox = 1
|
||||
idewy = v% - idesubwindow
|
||||
|
||||
v% = o(3).sel
|
||||
IF v% <> 0 THEN v% = 1
|
||||
PUT #150, , v%
|
||||
idecustomfont = v%
|
||||
|
||||
v$ = idetxt(o(4).txt)
|
||||
IF LEN(v$) > 1024 THEN v$ = LEFT$(v$, 1024)
|
||||
idecustomfontfile$ = v$
|
||||
v$ = v$ + SPACE$(1024 - LEN(v$))
|
||||
PUT #150, , v$
|
||||
|
||||
v$ = idetxt(o(5).txt): IF v$ = "" THEN v$ = "0"
|
||||
v% = VAL(v$)
|
||||
IF v% < 8 THEN v% = 8
|
||||
IF v% > 99 THEN v% = 99
|
||||
PUT #150, , v%
|
||||
idecustomfontheight = v%
|
||||
|
||||
CLOSE #150
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_Width", str$(idewx)
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_Height", str$(idewy)
|
||||
IF idecustomfont THEN
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CustomFont", "TRUE"
|
||||
ELSE
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CustomFont", "FALSE"
|
||||
END IF
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CustomFont$", idecustomfontfile$
|
||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_CustomFontSize", str$(idecustomfontheight)
|
||||
|
||||
|
||||
EXIT FUNCTION
|
||||
END IF
|
||||
|
||||
|
|
170
source/qb64.bas
170
source/qb64.bas
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue