-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General ide refactoring #519
Conversation
- correct wrong information - fix typos and capitalize keywords - comment unused code
- added 4 new schemes - established somewhat of a logic order
- moved converter function from file.bas to qb64pe.bas, as it's rather compiler related than a common file function - also fixed several "change state" related bugs (i.e. switching certain settings in the Options Menu will no longer mark the current code as "changed")
- using the new _READFILE$ and _WRITEFILE commands where applicable - moved error handler changes inside CopyFile&() so we don't need to remember to do this before calling the function - fixed file tests complaining about missing error handlers
- fixed spacing calculation for action buttons (wrong string tested, dates back to SDL age, unbelievable nobody before recognized the spacing was wrong) - in messagebox raise max. lines (needed later) - also move bound check before index increment, formerly the index was incremented once more which lead to a subscript out of range later in the function
- some fixes according to the things I've learned now about the IDE dialogs
- the old Backup/Undo limit dialog was replaced by the new Undo/History limits dialog, which also allows to set the limits for Recent files and Search history
- add new requirements, and remove no longer used code
- IDEsettings.bas cannot longer used, it's split into the usual global/methods pair and saved in source/ide/config - new $INCLUDE lines in qb64pe.bas - moved wiki methods $INCLUDE to a more appropriate place in ide_methods.bas
- autosave.bin doesn't need to be opened and read anymore, instead it's mere existence flags the availability of a restorable backup
- all files maintained in qb64pe/settings now and addressed using file name variables instead of hardcoded names - maintain recent/search histories according to the limits set in Options>Undo/History... dialog (saved in config.ini) - update recent files in the File Menu only when needed (i.e. right before the menu is displayed) rather than on every change to the history
- ask user to import config files from another QB64-PE installation (triggered by absence of the settings folder, i.e. on a new installed release as we don't maintain the folder in the repo) - simplified the other 1st time messages (use \n instead of the bulky +CHR$(10)), the messagebox function understands \n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add settings
to .gitignore
. Other than that, this looks good to me. 👍
- fixed/added custom font error checking on IDE startup and in Options>Display... dialog - added new settings folder to .gitignore list
source/ide/ide_methods.bas
Outdated
IF idecustomfonthandle = -1 THEN | ||
'failed! - revert to default settings | ||
IF idecustomfonthandle < 1 THEN | ||
retval = idemessagebox("Custom font not found!", "Your desired font was not found at the specified location, or is\nof unsupported format. Reverting back to default built-in font.", "#OK") | ||
idecustomfont = 0: idecustomfontfile$ = "C:\Windows\Fonts\lucon.ttf": idecustomfontheight = 21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can change
idecustomfontfile$ = "C:\Windows\Fonts\lucon.ttf"
to
idecustomfontfile$ = _DIR$("fonts") + "lucon.ttf"
That way it will point to the correct Windows directory (whichever drive / directory it is installed in).
As a bonus, we can also make this cross-platform by replacing 'lucon.ttf" with a font that is available on other platforms.
IF INSTR(_OS$, "[MACOSX]") THEN
idecustomfontfile$ = _DIR$("fonts") + "Courier New.ttf"
ELSEIF INSTR(_OS$, "[LINUX]") THEN
idecustomfontfile$ = _DIR$("fonts") + "truetype/liberation/LiberationMono-Regular.ttf"
ELSE
idecustomfontfile$ = _DIR$("fonts") + "lucon.ttf"
END IF
@@ -1385,7 +1385,7 @@ id.args = 4 | |||
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) | |||
id.specialformat = "?,?[,[?][,[?]]]" | |||
id.ret = LONGTYPE - ISPOINTER | |||
id.hr_syntax = "_LOADFONT(fileName$, size&[, " + CHR$(34) + "{MONOSPACE|, UNICODE|, DONTBLEND|, MEMORY}" + CHR$(34) + "][, fontIndex])" | |||
id.hr_syntax = "_LOADFONT(fileName$, size&[, " + CHR$(34) + "{MONOSPACE|, UNICODE|, DONTBLEND|, MEMORY|, AUTOMONO}" + CHR$(34) + "][, fontIndex])" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 😁
- preset default custom fonts by platform, not all have lucon.ttf available
internal/temp
intosettings
directly under theqb64pe
folder