mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-28 11:17:46 +00:00
Allow Shift+ENTER to edit RGB values without the contextual menu.
This commit is contained in:
parent
886627d0cf
commit
1e3cb88fc9
2 changed files with 24 additions and 4 deletions
|
@ -3,5 +3,5 @@ DIM SHARED BuildNum AS STRING
|
||||||
Version$ = "1.000"
|
Version$ = "1.000"
|
||||||
'BuildNum format is YYYYMMDD/id, where id is a ever-increasing
|
'BuildNum format is YYYYMMDD/id, where id is a ever-increasing
|
||||||
'integer. If you make a change, update the date and increase the id!
|
'integer. If you make a change, update the date and increase the id!
|
||||||
BuildNum$ = "20160628/26"
|
BuildNum$ = "20160628/27"
|
||||||
|
|
||||||
|
|
|
@ -3089,10 +3089,23 @@ DO
|
||||||
|
|
||||||
IF K$ = CHR$(13) THEN
|
IF K$ = CHR$(13) THEN
|
||||||
IF KSHIFT THEN
|
IF KSHIFT THEN
|
||||||
IF EnteringRGB THEN
|
IF EnteringRGB THEN 'The "Hit Shift+ENTER" message is being shown
|
||||||
retval$ = idecolorpicker$(0)
|
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
|
END IF
|
||||||
|
NoRGBFound:
|
||||||
|
GOTO specialchar
|
||||||
ELSE
|
ELSE
|
||||||
ideselect = 0
|
ideselect = 0
|
||||||
desiredcolumn = 1
|
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
|
'If the user is typing on the current line and has just inserted
|
||||||
'an _RGB(, _RGB32(, _RGBA( or _RGBA32(, we'll offer the RGB
|
'an _RGB(, _RGB32(, _RGBA( or _RGBA32(, we'll offer the RGB
|
||||||
'color mixer.
|
'color mixer.
|
||||||
|
a2$ = UCASE$(a$)
|
||||||
IF idecx = LEN(a$) + 1 AND idecx_comment + idecx_quote = 0 THEN
|
IF idecx = LEN(a$) + 1 AND idecx_comment + idecx_quote = 0 THEN
|
||||||
a2$ = UCASE$(a$)
|
|
||||||
IF RIGHT$(a2$, 5) = "_RGB(" OR _
|
IF RIGHT$(a2$, 5) = "_RGB(" OR _
|
||||||
RIGHT$(a2$, 7) = "_RGB32(" OR _
|
RIGHT$(a2$, 7) = "_RGB32(" OR _
|
||||||
RIGHT$(a2$, 6) = "_RGBA(" 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"
|
a$ = a$ + " 'Hit Shift+ENTER to open the RGB mixer"
|
||||||
EnteringRGB = -1
|
EnteringRGB = -1
|
||||||
END IF
|
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
|
||||||
END IF 'l = idecy
|
END IF 'l = idecy
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue