1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-26 17:10:38 +00:00

Allow Shift+ENTER to edit RGB values without the contextual menu.

This commit is contained in:
FellippeHeitor 2016-06-28 11:29:46 -03:00
parent 886627d0cf
commit 1e3cb88fc9
2 changed files with 24 additions and 4 deletions

View file

@ -3,5 +3,5 @@ DIM SHARED BuildNum AS STRING
Version$ = "1.000"
'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$ = "20160628/26"
BuildNum$ = "20160628/27"

View file

@ -3089,10 +3089,23 @@ DO
IF K$ = CHR$(13) THEN
IF KSHIFT THEN
IF EnteringRGB THEN
IF EnteringRGB THEN 'The "Hit Shift+ENTER" message is being shown
retval$ = idecolorpicker$(0)
GOTO specialchar
ELSE
IF ideselect THEN
IF ideselecty1 <> idecy THEN GOTO NoRGBFound 'multi line selected
END IF
a$ = idegetline(idecy)
Found_RGB = 0
Found_RGB = Found_RGB + INSTR(UCASE$(a$), "_RGB(")
Found_RGB = Found_RGB + INSTR(UCASE$(a$), "_RGB32(")
Found_RGB = Found_RGB + INSTR(UCASE$(a$), "_RGBA(")
Found_RGB = Found_RGB + INSTR(UCASE$(a$), "_RGBA32(")
IF Found_RGB THEN retval$ = idecolorpicker$(-1)
END IF
NoRGBFound:
GOTO specialchar
ELSE
ideselect = 0
desiredcolumn = 1
@ -7504,8 +7517,8 @@ FOR y = 0 TO (idewy - 9)
'If the user is typing on the current line and has just inserted
'an _RGB(, _RGB32(, _RGBA( or _RGBA32(, we'll offer the RGB
'color mixer.
a2$ = UCASE$(a$)
IF idecx = LEN(a$) + 1 AND idecx_comment + idecx_quote = 0 THEN
a2$ = UCASE$(a$)
IF RIGHT$(a2$, 5) = "_RGB(" OR _
RIGHT$(a2$, 7) = "_RGB32(" OR _
RIGHT$(a2$, 6) = "_RGBA(" OR _
@ -7513,6 +7526,13 @@ FOR y = 0 TO (idewy - 9)
a$ = a$ + " 'Hit Shift+ENTER to open the RGB mixer"
EnteringRGB = -1
END IF
ELSEIF idecx_comment + idecx_quote = 0 THEN
IF MID$(a2$, idecx - 5, 5) = "_RGB(" OR _
MID$(a2$, idecx - 7, 7) = "_RGB32(" OR _
MID$(a2$, idecx - 6, 6) = "_RGBA(" OR _
MID$(a2$, idecx - 8, 8) = "_RGBA32(" THEN
IF INSTR("0123456789", MID$(a2$, idecx, 1)) = 0 THEN EnteringRGB = -1
END IF
END IF
END IF 'l = idecy