From fbc6c128e7d08a19666b1fb093a57564ba4d1620 Mon Sep 17 00:00:00 2001 From: Roland Heyder Date: Thu, 19 Jan 2023 23:41:38 +0100 Subject: [PATCH 1/4] Context work - rewording of some labels for better spelling and context --- source/global/constants.bas | 1 + source/ide/ide_methods.bas | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/source/global/constants.bas b/source/global/constants.bas index 4cb07b517..318ce10c8 100644 --- a/source/global/constants.bas +++ b/source/global/constants.bas @@ -55,6 +55,7 @@ CONST KEY_UP = 18432 CONST KEY_DOWN = 20480 CONST KEY_ESC = 27 CONST KEY_ENTER = 13 +CONST KEY_TAB = 9 DIM SHARED CHR_QUOTE AS STRING: CHR_QUOTE = CHR$(34) DIM SHARED CHR_TAB AS STRING: CHR_TAB = CHR$(9) diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index f16a981ae..14cc5059d 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -2432,8 +2432,8 @@ FUNCTION ide2 (ignore) END IF keep_select: - IF KB = 9 THEN - IF LEN(Help_Search_Str) THEN norep = 1: GOTO delsrchagain + IF KB = KEY_TAB THEN + IF LEN(Help_Search_Str) THEN norep = 1: GOTO searchnext END IF IF LEN(K$) = 1 AND KCONTROL = 0 THEN @@ -2450,7 +2450,7 @@ FUNCTION ide2 (ignore) END IF Help_Search_Time = t# 'search for next appropriate link - delsrchagain: + searchnext: ox = Help_cx oy = Help_cy IF oy > help_h THEN oy = 1 @@ -2682,7 +2682,7 @@ FUNCTION ide2 (ignore) WikiParse a$ END IF IF Help_LinkL THEN - norep = 1: GOTO delsrchagain + norep = 1: GOTO searchnext ELSE GOTO newpageparsed END IF @@ -2746,7 +2746,7 @@ FUNCTION ide2 (ignore) IF INSTR(UCASE$(lnk$), "PARENTHESIS") THEN GOTO ideloop - OpenHelpLnk: + OpenHelpLink: Help_Back(Help_Back_Pos).sx = Help_sx 'update position @@ -5361,17 +5361,17 @@ FUNCTION ide2 (ignore) IF menu$(m, s) = "#Contents Page" THEN PCOPY 3, 0: SCREEN , , 3, 0 lnk$ = "QB64 Help Menu" - GOTO OpenHelpLnk + GOTO OpenHelpLink END IF IF menu$(m, s) = "Keyword #Index" THEN PCOPY 3, 0: SCREEN , , 3, 0 lnk$ = "Keyword Reference - Alphabetical" - GOTO OpenHelpLnk + GOTO OpenHelpLink END IF IF menu$(m, s) = "#Keywords by Usage" THEN PCOPY 3, 0: SCREEN , , 3, 0 lnk$ = "Keyword Reference - By usage" - GOTO OpenHelpLnk + GOTO OpenHelpLink END IF IF menu$(m, s) = "#View Shift+F1" THEN @@ -5486,7 +5486,7 @@ FUNCTION ide2 (ignore) PCOPY 3, 0: SCREEN , , 3, 0 IF uerr THEN lnk$ = "Update All" - GOTO OpenHelpLnk + GOTO OpenHelpLink END IF END IF GOTO ideloop From 7ad57f5c30b96e3b5e82a23fe8c131a2bf1ef8a2 Mon Sep 17 00:00:00 2001 From: Roland Heyder Date: Thu, 19 Jan 2023 23:45:18 +0100 Subject: [PATCH 2/4] Fix F1 key context help - fully implements local link targets --- source/ide/ide_methods.bas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index 14cc5059d..3a4a3ec42 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -2747,6 +2747,11 @@ FUNCTION ide2 (ignore) IF INSTR(UCASE$(lnk$), "PARENTHESIS") THEN GOTO ideloop OpenHelpLink: + l2 = INSTR(lnk$, "#") 'local link? + IF l2 > 0 THEN + Help_Search_Str = StrReplace$(MID$(lnk$, l2 + 1), "_", " ") + lnk$ = LEFT$(lnk$, l2 - 1): Help_LinkL = -1 + END IF Help_Back(Help_Back_Pos).sx = Help_sx 'update position @@ -2805,7 +2810,11 @@ FUNCTION ide2 (ignore) END IF GOSUB redrawitall - GOTO specialchar + IF Help_LinkL THEN + norep = 1: GOTO searchnext + ELSE + GOTO specialchar + END IF ELSE 'No help found; Does the user want help for a SUB or FUNCTION? From 12e63da7a4b66445655ace84787effdc4b75735c Mon Sep 17 00:00:00 2001 From: Roland Heyder Date: Thu, 19 Jan 2023 23:46:51 +0100 Subject: [PATCH 3/4] Fix "Update all pages" process - ignore local link targets here, only the page name is relevant for download --- source/ide/ide_methods.bas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index 3a4a3ec42..f3ce9c523 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -18959,8 +18959,9 @@ FUNCTION ideupdatehelpbox DO UNTIL EOF(fh) LINE INPUT #fh, l$ IF LEN(l$) THEN - c = INSTR(l$, ","): l$ = RIGHT$(l$, LEN(l$) - c) - IF Help_Recaching < 2 OR LEFT$(l$, 3) <> "_gl" THEN 'ignore _GL pages for 'qb64pe -u' (build time update) + c = INSTR(l$, ","): l$ = MID$(l$, c + 1) ' 'we only need the page name here + c = INSTR(l$, "#"): IF c > 0 THEN l$ = LEFT$(l$, c - 1) 'but not the local link target (if any) + IF Help_Recaching < 2 OR LEFT$(l$, 3) <> "_gl" THEN ' 'ignore _GL pages for 'qb64pe -u' (build time update) 'Escape all invalid and other critical chars in filenames PageName2$ = "" FOR i = 1 TO LEN(l$) From 163f6eb6e20789f72b2821dc5c693ae3d07a9820 Mon Sep 17 00:00:00 2001 From: Roland Heyder Date: Thu, 19 Jan 2023 23:48:22 +0100 Subject: [PATCH 4/4] Availability gallery - add handling for the new separator image --- source/ide/wiki/wiki_methods.bas | 1 + 1 file changed, 1 insertion(+) diff --git a/source/ide/wiki/wiki_methods.bas b/source/ide/wiki/wiki_methods.bas index 06d92111b..aa6304525 100644 --- a/source/ide/wiki/wiki_methods.bas +++ b/source/ide/wiki/wiki_methods.bas @@ -357,6 +357,7 @@ SUB WikiParse (a$) 'Wiki page interpret i = ii + LEN(wla$) 'ignore this gallery ELSE wla$ = StrRemove$(wla$, " "): wla$ = StrRemove$(wla$, CHR$(10)) + wla$ = StrRemove$(wla$, "File:Apix.png") 'alpha pixels image (separator only) wla$ = StrReplace$(wla$, "|'''", "|*"): wla$ = StrReplace$(wla$, "'''", "'' / ") wla$ = StrReplace$(wla$, "File:Qb64.png|*", "'''QB64;''' ''") wla$ = StrReplace$(wla$, "File:Qbpe.png|*", "'''QB64-PE;''' ''")