From cff8ae756112693525aa593070d726dabdf3d05c Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Sat, 14 Oct 2017 17:34:33 -0300 Subject: [PATCH] Make AutoPosition setting default to true. --- source/global/IDEsettings.bas | 10 +++------- source/ide/ide_methods.bas | 1 - source/qb64.bas | 4 +++- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/source/global/IDEsettings.bas b/source/global/IDEsettings.bas index c5d6b137d..e811f9bcc 100644 --- a/source/global/IDEsettings.bas +++ b/source/global/IDEsettings.bas @@ -239,8 +239,8 @@ IF LoadedIDESettings = 0 THEN WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "FALSE" END IF ELSE - IDE_Autopostion = 0 - WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "FALSE" + IDE_AutoPosition = -1 + WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "TRUE" END IF result = ReadConfigSetting("IDE_TopPosition", value$) @@ -248,9 +248,7 @@ IF LoadedIDESettings = 0 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$) @@ -258,8 +256,6 @@ IF LoadedIDESettings = 0 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 @@ -411,7 +407,7 @@ IF LoadedIDESettings = 0 THEN 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" + WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "TRUE" END IF WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_Width", "80" WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_Height", "25" diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index af2cd4b7f..4411a2f5c 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -730,7 +730,6 @@ FUNCTION ide2 (ignore) idecontextualmenu = 0 idedeltxt 'removes temporary strings (typically created by guibox commands) by setting an index to 0 IF IDE_AutoPosition THEN - 'if _SCreenhide = 0 then 'Screenhide currently does not work in Linux, so we need a different check IF IDE_TopPosition <> _SCREENY OR IDE_LeftPosition <> _SCREENX THEN IF _SCREENY >= -_HEIGHT * _FONTHEIGHT AND _SCREENX >= -_WIDTH * _FONTWIDTH THEN 'Don't record the position if it's off the screen, past the point where we can drag it back into a different position. WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_TopPosition", STR$(_SCREENY) diff --git a/source/qb64.bas b/source/qb64.bas index 2fdce9f8a..2cc7923d4 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -915,7 +915,9 @@ gl_scan_header '-----------------------QB64 COMPILER ONCE ONLY SETUP CODE ENDS HERE--------------------------------------- IF NoIDEMode THEN IDE_AutoPosition = 0: GOTO noide -IF IDE_AutoPosition THEN _SCREENMOVE IDE_LeftPosition, IDE_TopPosition +IF IDE_AutoPosition <> 0 AND IDE_TopPosition <> 0 AND IDE_LeftPosition <> 0 THEN + _SCREENMOVE IDE_LeftPosition, IDE_TopPosition +END IF idemode = 1 sendc$ = "" 'no initial message IF CMDLineFile <> "" THEN sendc$ = CHR$(1) + CMDLineFile