mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-07 08:20:18 +00:00
Remove some redundancy in color dialog code
This commit is contained in:
parent
d0c7b5abb2
commit
093396d538
1 changed files with 31 additions and 61 deletions
|
@ -16636,19 +16636,7 @@ FUNCTION idechoosecolorsbox
|
||||||
'Build scheme string
|
'Build scheme string
|
||||||
SchemeString$ = SchemeString$ + "|"
|
SchemeString$ = SchemeString$ + "|"
|
||||||
FOR j = 1 TO 10
|
FOR j = 1 TO 10
|
||||||
SELECT CASE j
|
CurrentColor~& = GetCurrentColor(j)
|
||||||
CASE 1: CurrentColor~& = IDETextColor
|
|
||||||
CASE 2: CurrentColor~& = IDEKeywordColor
|
|
||||||
CASE 3: CurrentColor~& = IDENumbersColor
|
|
||||||
CASE 4: CurrentColor~& = IDEQuoteColor
|
|
||||||
CASE 5: CurrentColor~& = IDEMetaCommandColor
|
|
||||||
CASE 6: CurrentColor~& = IDECommentColor
|
|
||||||
CASE 7: CurrentColor~& = IDEBackgroundColor
|
|
||||||
CASE 8: CurrentColor~& = IDEBackgroundColor2
|
|
||||||
CASE 9: CurrentColor~& = IDEBracketHighlightColor
|
|
||||||
CASE 10: CurrentColor~& = IDEChromaColor
|
|
||||||
END SELECT
|
|
||||||
|
|
||||||
r$ = str2$(_RED32(CurrentColor~&)): r$ = STRING$(3 - LEN(r$), "0") + r$
|
r$ = str2$(_RED32(CurrentColor~&)): r$ = STRING$(3 - LEN(r$), "0") + r$
|
||||||
g$ = str2$(_GREEN32(CurrentColor~&)): g$ = STRING$(3 - LEN(g$), "0") + g$
|
g$ = str2$(_GREEN32(CurrentColor~&)): g$ = STRING$(3 - LEN(g$), "0") + g$
|
||||||
b$ = str2$(_BLUE32(CurrentColor~&)): b$ = STRING$(3 - LEN(b$), "0") + b$
|
b$ = str2$(_BLUE32(CurrentColor~&)): b$ = STRING$(3 - LEN(b$), "0") + b$
|
||||||
|
@ -16675,19 +16663,7 @@ FUNCTION idechoosecolorsbox
|
||||||
|
|
||||||
'Build scheme string
|
'Build scheme string
|
||||||
FOR j = 1 TO 10
|
FOR j = 1 TO 10
|
||||||
SELECT CASE j
|
CurrentColor~& = GetCurrentColor(j)
|
||||||
CASE 1: CurrentColor~& = IDETextColor
|
|
||||||
CASE 2: CurrentColor~& = IDEKeywordColor
|
|
||||||
CASE 3: CurrentColor~& = IDENumbersColor
|
|
||||||
CASE 4: CurrentColor~& = IDEQuoteColor
|
|
||||||
CASE 5: CurrentColor~& = IDEMetaCommandColor
|
|
||||||
CASE 6: CurrentColor~& = IDECommentColor
|
|
||||||
CASE 7: CurrentColor~& = IDEBackgroundColor
|
|
||||||
CASE 8: CurrentColor~& = IDEBackgroundColor2
|
|
||||||
CASE 9: CurrentColor~& = IDEBracketHighlightColor
|
|
||||||
CASE 10: CurrentColor~& = IDEChromaColor
|
|
||||||
END SELECT
|
|
||||||
|
|
||||||
r$ = str2$(_RED32(CurrentColor~&)): r$ = STRING$(3 - LEN(r$), "0") + r$
|
r$ = str2$(_RED32(CurrentColor~&)): r$ = STRING$(3 - LEN(r$), "0") + r$
|
||||||
g$ = str2$(_GREEN32(CurrentColor~&)): g$ = STRING$(3 - LEN(g$), "0") + g$
|
g$ = str2$(_GREEN32(CurrentColor~&)): g$ = STRING$(3 - LEN(g$), "0") + g$
|
||||||
b$ = str2$(_BLUE32(CurrentColor~&)): b$ = STRING$(3 - LEN(b$), "0") + b$
|
b$ = str2$(_BLUE32(CurrentColor~&)): b$ = STRING$(3 - LEN(b$), "0") + b$
|
||||||
|
@ -16858,32 +16834,21 @@ FUNCTION idechoosecolorsbox
|
||||||
FOR i = 1 TO 10: SelectionIndicator$(i) = " ": NEXT i
|
FOR i = 1 TO 10: SelectionIndicator$(i) = " ": NEXT i
|
||||||
SelectionIndicator$(SelectedITEM) = CHR$(16)
|
SelectionIndicator$(SelectedITEM) = CHR$(16)
|
||||||
|
|
||||||
i = 0
|
i = 10 'total number of selection indicators
|
||||||
i = i + 1: l$ = SelectionIndicator$(i) + "Normal Text"
|
l$ = SelectionIndicator$(1) + "Normal Text"
|
||||||
i = i + 1: l$ = l$ + sep + SelectionIndicator$(i) + "Keywords"
|
l$ = l$ + sep + SelectionIndicator$(2) + "Keywords"
|
||||||
i = i + 1: l$ = l$ + sep + SelectionIndicator$(i) + "Numbers"
|
l$ = l$ + sep + SelectionIndicator$(3) + "Numbers"
|
||||||
i = i + 1: l$ = l$ + sep + SelectionIndicator$(i) + "Strings"
|
l$ = l$ + sep + SelectionIndicator$(4) + "Strings"
|
||||||
i = i + 1: l$ = l$ + sep + SelectionIndicator$(i) + "Metacommand/custom keywords"
|
l$ = l$ + sep + SelectionIndicator$(5) + "Metacommand/custom keywords"
|
||||||
i = i + 1: l$ = l$ + sep + SelectionIndicator$(i) + "Comments"
|
l$ = l$ + sep + SelectionIndicator$(6) + "Comments"
|
||||||
i = i + 1: l$ = l$ + sep + SelectionIndicator$(i) + "Background"
|
l$ = l$ + sep + SelectionIndicator$(7) + "Background"
|
||||||
i = i + 1: l$ = l$ + sep + SelectionIndicator$(i) + "Current line background"
|
l$ = l$ + sep + SelectionIndicator$(8) + "Current line background"
|
||||||
i = i + 1: l$ = l$ + sep + SelectionIndicator$(i) + "Bracket/selection highlight"
|
l$ = l$ + sep + SelectionIndicator$(9) + "Bracket/selection highlight"
|
||||||
i = i + 1: l$ = l$ + sep + SelectionIndicator$(i) + "Menus and dialogs"
|
l$ = l$ + sep + SelectionIndicator$(10) + "Menus and dialogs"
|
||||||
idetxt(o(1).txt) = l$
|
idetxt(o(1).txt) = l$
|
||||||
|
|
||||||
ChangeTextBoxes:
|
ChangeTextBoxes:
|
||||||
SELECT CASE SelectedITEM
|
CurrentColor~& = GetCurrentColor(SelectedITEM)
|
||||||
CASE 1: CurrentColor~& = IDETextColor
|
|
||||||
CASE 2: CurrentColor~& = IDEKeywordColor
|
|
||||||
CASE 3: CurrentColor~& = IDENumbersColor
|
|
||||||
CASE 4: CurrentColor~& = IDEQuoteColor
|
|
||||||
CASE 5: CurrentColor~& = IDEMetaCommandColor
|
|
||||||
CASE 6: CurrentColor~& = IDECommentColor
|
|
||||||
CASE 7: CurrentColor~& = IDEBackgroundColor
|
|
||||||
CASE 8: CurrentColor~& = IDEBackgroundColor2
|
|
||||||
CASE 9: CurrentColor~& = IDEBracketHighlightColor
|
|
||||||
CASE 10: CurrentColor~& = IDEChromaColor
|
|
||||||
END SELECT
|
|
||||||
idetxt(o(2).txt) = str2$(_RED32(CurrentColor~&))
|
idetxt(o(2).txt) = str2$(_RED32(CurrentColor~&))
|
||||||
idetxt(o(3).txt) = str2$(_GREEN32(CurrentColor~&))
|
idetxt(o(3).txt) = str2$(_GREEN32(CurrentColor~&))
|
||||||
idetxt(o(4).txt) = str2$(_BLUE32(CurrentColor~&))
|
idetxt(o(4).txt) = str2$(_BLUE32(CurrentColor~&))
|
||||||
|
@ -16928,6 +16893,7 @@ FUNCTION idechoosecolorsbox
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
CurrentColor~& = _RGB32(VAL(idetxt(o(2).txt)), VAL(idetxt(o(3).txt)), VAL(idetxt(o(4).txt)))
|
CurrentColor~& = _RGB32(VAL(idetxt(o(2).txt)), VAL(idetxt(o(3).txt)), VAL(idetxt(o(4).txt)))
|
||||||
|
|
||||||
SELECT CASE SelectedITEM
|
SELECT CASE SelectedITEM
|
||||||
CASE 1: IDETextColor = CurrentColor~& 'Normal text
|
CASE 1: IDETextColor = CurrentColor~& 'Normal text
|
||||||
CASE 2: IDEKeywordColor = CurrentColor~& 'Keywords
|
CASE 2: IDEKeywordColor = CurrentColor~& 'Keywords
|
||||||
|
@ -16979,18 +16945,7 @@ FUNCTION idechoosecolorsbox
|
||||||
|
|
||||||
WriteConfigSetting colorSettingsSection$, "SchemeID", str2$(SchemeID)
|
WriteConfigSetting colorSettingsSection$, "SchemeID", str2$(SchemeID)
|
||||||
FOR i = 1 TO 10
|
FOR i = 1 TO 10
|
||||||
SELECT CASE i
|
CurrentColor~& = GetCurrentColor(i)
|
||||||
CASE 1: CurrentColor~& = IDETextColor: colorid$ = "TextColor"
|
|
||||||
CASE 2: CurrentColor~& = IDEKeywordColor: colorid$ = "KeywordColor"
|
|
||||||
CASE 3: CurrentColor~& = IDENumbersColor: colorid$ = "NumbersColor"
|
|
||||||
CASE 4: CurrentColor~& = IDEQuoteColor: colorid$ = "QuoteColor"
|
|
||||||
CASE 5: CurrentColor~& = IDEMetaCommandColor: colorid$ = "MetaCommandColor"
|
|
||||||
CASE 6: CurrentColor~& = IDECommentColor: colorid$ = "CommentColor"
|
|
||||||
CASE 7: CurrentColor~& = IDEBackgroundColor: colorid$ = "BackgroundColor"
|
|
||||||
CASE 8: CurrentColor~& = IDEBackgroundColor2: colorid$ = "BackgroundColor2"
|
|
||||||
CASE 9: CurrentColor~& = IDEBracketHighlightColor: colorid$ = "HighlightColor"
|
|
||||||
CASE 10: CurrentColor~& = IDEChromaColor: colorid$ = "ChromaColor"
|
|
||||||
END SELECT
|
|
||||||
WriteConfigSetting colorSettingsSection$, colorid$, rgbs$(CurrentColor~&)
|
WriteConfigSetting colorSettingsSection$, colorid$, rgbs$(CurrentColor~&)
|
||||||
NEXT i
|
NEXT i
|
||||||
|
|
||||||
|
@ -17056,6 +17011,21 @@ FUNCTION idechoosecolorsbox
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
|
|
||||||
|
FUNCTION GetCurrentColor~&(Selection AS INTEGER)
|
||||||
|
SELECT CASE Selection
|
||||||
|
CASE 1: GetCurrentColor = IDETextColor
|
||||||
|
CASE 2: GetCurrentColor = IDEKeywordColor
|
||||||
|
CASE 3: GetCurrentColor = IDENumbersColor
|
||||||
|
CASE 4: GetCurrentColor = IDEQuoteColor
|
||||||
|
CASE 5: GetCurrentColor = IDEMetaCommandColor
|
||||||
|
CASE 6: GetCurrentColor = IDECommentColor
|
||||||
|
CASE 7: GetCurrentColor = IDEBackgroundColor
|
||||||
|
CASE 8: GetCurrentColor = IDEBackgroundColor2
|
||||||
|
CASE 9: GetCurrentColor = IDEBracketHighlightColor
|
||||||
|
CASE 10: GetCurrentColor = IDEChromaColor
|
||||||
|
END SELECT
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
FUNCTION idergbmixer$ (editing)
|
FUNCTION idergbmixer$ (editing)
|
||||||
'-------- generic dialog box header --------
|
'-------- generic dialog box header --------
|
||||||
PCOPY 0, 2
|
PCOPY 0, 2
|
||||||
|
|
Loading…
Reference in a new issue