1
1
Fork 0
mirror of https://github.com/FellippeHeitor/InForm.git synced 2025-01-15 03:49:56 +00:00

Simplifies the selection of the built-in VGA font.

This commit is contained in:
FellippeHeitor 2020-02-23 19:40:03 -03:00
parent 2a0d81eb37
commit eb106a33f5

View file

@ -1177,7 +1177,12 @@ SUB SelectFontInList (FontSetup$)
thisFile$ = UCASE$(LEFT$(FontSetup$, INSTR(FontSetup$, ",") - 1)) thisFile$ = UCASE$(LEFT$(FontSetup$, INSTR(FontSetup$, ",") - 1))
thisSize% = VAL(MID$(FontSetup$, INSTR(FontSetup$, ",") + 1)) thisSize% = VAL(MID$(FontSetup$, INSTR(FontSetup$, ",") + 1))
Control(FontSizeList).Value = thisSize% - 7 ResetList FontSizeList
FOR i = 8 TO 120
AddItem FontSizeList, LTRIM$(STR$(i))
NEXT
i = SelectItem(FontSizeList, LTRIM$(STR$(thisSize%)))
IF LEN(thisFile$) > 0 THEN IF LEN(thisFile$) > 0 THEN
FOR i = 1 TO UBOUND(FontFile) FOR i = 1 TO UBOUND(FontFile)
IF UCASE$(RIGHT$(FontFile(i), LEN(thisFile$))) = thisFile$ THEN IF UCASE$(RIGHT$(FontFile(i), LEN(thisFile$))) = thisFile$ THEN
@ -1188,12 +1193,15 @@ SUB SelectFontInList (FontSetup$)
END IF END IF
NEXT NEXT
ELSE ELSE
IF thisSize% = 8 OR thisSize% = 16 THEN IF thisSize% > 8 THEN thisSize% = 16 ELSE thisSize% = 8
i = SelectItem(FontList, "Built-in _FONT" + STR$(thisSize%)) ResetList FontSizeList
BypassShowFontList = False AddItem FontSizeList, "8"
AttemptToShowFontList = False AddItem FontSizeList, "16"
EXIT SUB i = SelectItem(FontSizeList, LTRIM$(STR$(thisSize%)))
END IF Control(FontList).Value = 1 'Built-in VGA font
BypassShowFontList = False
AttemptToShowFontList = False
EXIT SUB
END IF END IF
'If this line is reached, the currently open form 'If this line is reached, the currently open form
@ -3500,11 +3508,7 @@ SUB __UI_ValueChanged (id AS LONG)
END IF END IF
SendData b$, 41 SendData b$, 41
CASE FontList, FontSizeList CASE FontList, FontSizeList
IF id = FontList AND Control(FontList).Value < 3 THEN b$ = FontFile(Control(FontList).Value) + "," + GetItem$(FontSizeList, Control(FontSizeList).Value)
'First item is _FONT 8, second item is _FONT 16
Control(FontSizeList).Value = (Control(FontList).Value * 8) - 7
END IF
b$ = FontFile(Control(FontList).Value) + "," + LTRIM$(STR$(Control(FontSizeList).Value + 7))
b$ = MKL$(LEN(b$)) + b$ b$ = MKL$(LEN(b$)) + b$
SendData b$, 8 SendData b$, 8
PropertySent = True PropertySent = True
@ -4744,9 +4748,8 @@ $IF WIN THEN
bData = SPACE$(&H7FFF) 'arbitrary bData = SPACE$(&H7FFF) 'arbitrary
HasFontList = True HasFontList = True
AddItem FontList, "Built-in _FONT 8" AddItem FontList, "Built-in VGA font"
AddItem FontList, "Built-in _FONT 16" TotalFontsFound = 1
TotalFontsFound = 2
l = RegOpenKeyExA(Ky, _OFFSET(SubKey), 0, KEY_READ, _OFFSET(hKey)) l = RegOpenKeyExA(Ky, _OFFSET(SubKey), 0, KEY_READ, _OFFSET(hKey))
IF l THEN IF l THEN
@ -4873,8 +4876,8 @@ $ELSE
END IF END IF
NEXT NEXT
TotalFontsFound = TotalFontsFound + 2 TotalFontsFound = TotalFontsFound + 1
Text(FontList) = "Built-in _FONT 8" + CHR$(10) + "Built-in _FONT 16" + CHR$(10) + Text(FontList) Text(FontList) = "Built-in VGA font" + CHR$(10) + Text(FontList)
Control(FontList).Max = TotalFontsFound Control(FontList).Max = TotalFontsFound
REDIM FontFile(TotalFontsFound) AS STRING REDIM FontFile(TotalFontsFound) AS STRING