1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 10:30:36 +00:00

Double-clicking on an $INCLUDE statement opens the file in a new window.

This commit is contained in:
FellippeHeitor 2017-05-14 23:10:47 -03:00
parent f5505c5734
commit 60e4054aa5
3 changed files with 35 additions and 9 deletions

View file

@ -4,4 +4,4 @@ DIM SHARED AutoBuildMsg AS STRING
Version$ = "1.1"
'BuildNum format is YYYYMMDD/id, where id is a ever-increasing
'integer. If you make a change, update the date and increase the id!
BuildNum$ = "20170429/52"
BuildNum$ = "20170513/53"

View file

@ -157,6 +157,8 @@ DIM SHARED QuickNavTotal AS LONG
DIM SHARED QuickNavHistory(0) AS LONG
DIM SHARED ModifyCOMMAND$
DIM SHARED EnteringRGB AS _BYTE
DIM SHARED ActiveINCLUDELink AS LONG
DIM SHARED ActiveINCLUDELinkFile AS STRING
'--------------------------------------------------------------------------------
TYPE idedbptype

View file

@ -2480,6 +2480,14 @@ FUNCTION ide2 (ignore)
idecy = mY - 2 + idesy - 1
IF idecy > iden THEN
GOTO regularTextBox_click
ELSEIF ActiveINCLUDELink > 0 THEN
'Double-click on an $INCLUDE statement launches that file in
'a separate instance of QB64:
p$ = idepath$ + pathsep$
f$ = p$ + ActiveINCLUDELinkFile
IF _FILEEXISTS(f$) THEN
SHELL _DONTWAIT QuotedFilename$(COMMAND$(0)) + " " + QuotedFilename$(f$)
END IF
ELSE
a$ = idegetline$(idecy)
IF LEN(a$) = 0 THEN GOTO regularTextBox_click
@ -7731,6 +7739,8 @@ SUB ideshowtext
IF idecy > 1 THEN b$ = idegetline(idecy - 1) ELSE b$ = ""
ActiveINCLUDELink = 0
FOR y = 0 TO (idewy - 9)
LOCATE y + 3, 1
COLOR 7, 1
@ -7745,6 +7755,7 @@ SUB ideshowtext
IF l <= iden THEN
a$ = idegetline(l)
link_idecx = 0
IF l = idecy THEN
IF idecx <= LEN(a$) THEN
cc = ASC(a$, idecx)
@ -7850,6 +7861,17 @@ SUB ideshowtext
IF INSTR("0123456789", MID$(a2$, idecx, 1)) = 0 THEN EnteringRGB = -1
END IF
END IF
IF idecx_comment AND INSTR(a2$, "$INCLUDE:'") > 0 THEN
link_idecx = LEN(a$)
ActiveINCLUDELink = idecy
FindApostrophe1 = INSTR(a$, ":'") + 1
FindApostrophe2 = INSTR(FindApostrophe1 + 1, a$, "'")
ActiveINCLUDELinkFile = MID$(a$, FindApostrophe1 + 1, FindApostrophe2 - FindApostrophe1 - 1)
p$ = idepath$ + pathsep$
f$ = p$ + ActiveINCLUDELinkFile
IF _FILEEXISTS(f$) THEN a$ = a$ + " --> Double-click to open"
END IF
END IF 'l = idecy
a2$ = SPACE$(idesx + (idewx - 3))
@ -7886,6 +7908,8 @@ SUB ideshowtext
IF LEFT$(LTRIM$(a$), 2) = "'$" OR LEFT$(LTRIM$(a$), 1) = "$" THEN metacommand = -1: comment = 0
COLOR 13
IF (link_idecx > 0 AND m > link_idecx) THEN metacommand = 0: comment = -1
IF comment THEN
COLOR 11
ELSEIF metacommand THEN