mirror of
https://github.com/FellippeHeitor/InForm.git
synced 2025-01-15 11:59:34 +00:00
Fixes #69.
This commit is contained in:
parent
83f826f8da
commit
8d1b9374da
3 changed files with 43 additions and 44 deletions
|
@ -1290,6 +1290,7 @@ SUB __UI_UpdateDisplay
|
||||||
IF __UI_ActiveTipID > 0 THEN
|
IF __UI_ActiveTipID > 0 THEN
|
||||||
IF __UI_ActiveTipID <> __UI_PreviousTipID OR ToolTip(__UI_ActiveTipID) <> __UI_TempTips(__UI_ActiveTipID) THEN
|
IF __UI_ActiveTipID <> __UI_PreviousTipID OR ToolTip(__UI_ActiveTipID) <> __UI_TempTips(__UI_ActiveTipID) THEN
|
||||||
__UI_PreviousTipID = __UI_ActiveTipID
|
__UI_PreviousTipID = __UI_ActiveTipID
|
||||||
|
ToolTip(__UI_ActiveTipID) = RestoreCHR$(ToolTip(__UI_ActiveTipID))
|
||||||
__UI_TempTips(__UI_ActiveTipID) = ToolTip(__UI_ActiveTipID)
|
__UI_TempTips(__UI_ActiveTipID) = ToolTip(__UI_ActiveTipID)
|
||||||
|
|
||||||
DIM ThisLine%, TextTop%, Temp&
|
DIM ThisLine%, TextTop%, Temp&
|
||||||
|
@ -4398,7 +4399,7 @@ SUB SetCaption (ThisID AS LONG, TempCaption$)
|
||||||
|
|
||||||
IF ThisID = 0 THEN EXIT SUB
|
IF ThisID = 0 THEN EXIT SUB
|
||||||
|
|
||||||
NewCaption$ = TempCaption$
|
NewCaption$ = RestoreCHR$(TempCaption$)
|
||||||
|
|
||||||
'Parse for hotkey markers
|
'Parse for hotkey markers
|
||||||
StartSearchForSep:
|
StartSearchForSep:
|
||||||
|
@ -4846,16 +4847,14 @@ FUNCTION __UI_GetTextBoxLine$ (id AS LONG, LineNumber AS LONG, StartPosition AS
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
'---------------------------------------------------------------------------------
|
'---------------------------------------------------------------------------------
|
||||||
SUB AddItem (WhichListBox AS LONG, Item$)
|
SUB AddItem (WhichListBox AS LONG, TempItem$)
|
||||||
DIM ThisID AS LONG, prevFont AS LONG
|
DIM ThisID AS LONG, prevFont AS LONG
|
||||||
DIM BorderOffset AS INTEGER
|
DIM BorderOffset AS INTEGER, Item$
|
||||||
|
|
||||||
ThisID = WhichListBox
|
ThisID = WhichListBox
|
||||||
IF Control(ThisID).Type <> __UI_Type_ListBox AND Control(ThisID).Type <> __UI_Type_DropdownList THEN EXIT SUB
|
IF Control(ThisID).Type <> __UI_Type_ListBox AND Control(ThisID).Type <> __UI_Type_DropdownList THEN EXIT SUB
|
||||||
|
|
||||||
DO WHILE INSTR(Item$, CHR$(13)) > 0
|
Item$ = Replace$(RestoreCHR$(TempItem$), CHR$(13), CHR$(10), False, 0)
|
||||||
MID$(Item$, INSTR(Item$, CHR$(13)), 1) = CHR$(10)
|
|
||||||
LOOP
|
|
||||||
|
|
||||||
Text(ThisID) = Text(ThisID) + Item$ + CHR$(13)
|
Text(ThisID) = Text(ThisID) + Item$ + CHR$(13)
|
||||||
Control(ThisID).Max = Control(ThisID).Max + 1
|
Control(ThisID).Max = Control(ThisID).Max + 1
|
||||||
|
@ -5895,6 +5894,38 @@ FUNCTION IconPreview& (IconFile$)
|
||||||
END IF
|
END IF
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
|
FUNCTION RestoreCHR$ (__Text$)
|
||||||
|
DIM Text$, i AS LONG, BackSlash AS LONG, SemiColon AS LONG
|
||||||
|
DIM j AS LONG, tempNum$
|
||||||
|
|
||||||
|
Text$ = __Text$
|
||||||
|
|
||||||
|
IF INSTR(Text$, "\") = 0 THEN
|
||||||
|
RestoreCHR$ = Text$
|
||||||
|
EXIT FUNCTION
|
||||||
|
END IF
|
||||||
|
|
||||||
|
DO
|
||||||
|
BackSlash = INSTR(BackSlash + 1, Text$, "\")
|
||||||
|
IF BackSlash = 0 THEN EXIT DO
|
||||||
|
|
||||||
|
SemiColon = INSTR(BackSlash + 1, Text$, ";")
|
||||||
|
IF SemiColon = 0 THEN _CONTINUE
|
||||||
|
|
||||||
|
tempNum$ = ""
|
||||||
|
FOR j = BackSlash + 1 TO SemiColon - 1
|
||||||
|
IF ASC(Text$, j) < 48 OR ASC(Text$, j) > 57 THEN tempNum$ = "": EXIT FOR
|
||||||
|
tempNum$ = tempNum$ + MID$(Text$, j, 1)
|
||||||
|
NEXT
|
||||||
|
|
||||||
|
IF LEN(tempNum$) THEN
|
||||||
|
Text$ = LEFT$(Text$, BackSlash - 1) + CHR$(VAL(tempNum$)) + MID$(Text$, SemiColon + 1)
|
||||||
|
END IF
|
||||||
|
LOOP
|
||||||
|
|
||||||
|
RestoreCHR$ = Text$
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
'Control types:
|
'Control types:
|
||||||
FUNCTION __UI_Type_Form%%:__UI_Type_Form%% = 1: END FUNCTION
|
FUNCTION __UI_Type_Form%%:__UI_Type_Form%% = 1: END FUNCTION
|
||||||
FUNCTION __UI_Type_Frame%%: __UI_Type_Frame%% = 2: END FUNCTION
|
FUNCTION __UI_Type_Frame%%: __UI_Type_Frame%% = 2: END FUNCTION
|
||||||
|
|
|
@ -2254,12 +2254,11 @@ SUB LoadPreviewText
|
||||||
'Caption
|
'Caption
|
||||||
DummyText$ = nextParameter(b$) 'discard first parameter
|
DummyText$ = nextParameter(b$) 'discard first parameter
|
||||||
DummyText$ = nextParameter(b$)
|
DummyText$ = nextParameter(b$)
|
||||||
DummyText$ = RestoreCHRfromEscapeCode$(DummyText$)
|
|
||||||
SetCaption TempValue, DummyText$
|
SetCaption TempValue, DummyText$
|
||||||
ELSEIF LEFT$(b$, 8) = "AddItem " THEN
|
ELSEIF LEFT$(b$, 8) = "AddItem " THEN
|
||||||
'Caption
|
'Caption
|
||||||
DummyText$ = nextParameter(b$) 'discard first parameter
|
DummyText$ = nextParameter(b$) 'discard first parameter
|
||||||
DummyText$ = RestoreCHRfromEscapeCode(nextParameter(b$))
|
DummyText$ = nextParameter(b$)
|
||||||
AddItem TempValue, DummyText$
|
AddItem TempValue, DummyText$
|
||||||
ELSEIF LEFT$(b$, 10) = "LoadImage " THEN
|
ELSEIF LEFT$(b$, 10) = "LoadImage " THEN
|
||||||
'Image
|
'Image
|
||||||
|
@ -2269,12 +2268,12 @@ SUB LoadPreviewText
|
||||||
ELSEIF LEFT$(b$, 22) = "ToolTip(__UI_NewID) = " THEN
|
ELSEIF LEFT$(b$, 22) = "ToolTip(__UI_NewID) = " THEN
|
||||||
'Tooltip
|
'Tooltip
|
||||||
DummyText$ = MID$(b$, INSTR(b$, " = ") + 3)
|
DummyText$ = MID$(b$, INSTR(b$, " = ") + 3)
|
||||||
DummyText$ = RestoreCHRfromEscapeCode$(DummyText$)
|
DummyText$ = RestoreCHR$(DummyText$)
|
||||||
ToolTip(TempValue) = removeQuotation$(DummyText$)
|
ToolTip(TempValue) = removeQuotation$(DummyText$)
|
||||||
ELSEIF LEFT$(b$, 19) = "Text(__UI_NewID) = " THEN
|
ELSEIF LEFT$(b$, 19) = "Text(__UI_NewID) = " THEN
|
||||||
'Text
|
'Text
|
||||||
DummyText$ = MID$(b$, INSTR(b$, " = ") + 3)
|
DummyText$ = MID$(b$, INSTR(b$, " = ") + 3)
|
||||||
DummyText$ = RestoreCHRfromEscapeCode$(DummyText$)
|
DummyText$ = RestoreCHR$(DummyText$)
|
||||||
Text(TempValue) = removeQuotation$(DummyText$)
|
Text(TempValue) = removeQuotation$(DummyText$)
|
||||||
|
|
||||||
IF Control(TempValue).Type = __UI_Type_PictureBox OR Control(TempValue).Type = __UI_Type_Button THEN
|
IF Control(TempValue).Type = __UI_Type_PictureBox OR Control(TempValue).Type = __UI_Type_Button THEN
|
||||||
|
@ -2289,7 +2288,7 @@ SUB LoadPreviewText
|
||||||
ELSEIF LEFT$(b$, 19) = "Mask(__UI_NewID) = " THEN
|
ELSEIF LEFT$(b$, 19) = "Mask(__UI_NewID) = " THEN
|
||||||
'Mask
|
'Mask
|
||||||
DummyText$ = MID$(b$, INSTR(b$, " = ") + 3)
|
DummyText$ = MID$(b$, INSTR(b$, " = ") + 3)
|
||||||
DummyText$ = RestoreCHRfromEscapeCode$(DummyText$)
|
DummyText$ = RestoreCHR$(DummyText$)
|
||||||
Mask(TempValue) = removeQuotation$(DummyText$)
|
Mask(TempValue) = removeQuotation$(DummyText$)
|
||||||
ELSEIF INSTR(b$, "__UI_NewControl") > 0 THEN
|
ELSEIF INSTR(b$, "__UI_NewControl") > 0 THEN
|
||||||
'New Control
|
'New Control
|
||||||
|
@ -2983,36 +2982,3 @@ SUB LoadDefaultFonts
|
||||||
Control(__UI_FormID).Font = SetFont("InForm/resources/NotoMono-Regular.ttf", 12)
|
Control(__UI_FormID).Font = SetFont("InForm/resources/NotoMono-Regular.ttf", 12)
|
||||||
END IF
|
END IF
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
FUNCTION RestoreCHRfromEscapeCode$ (__Text$)
|
|
||||||
DIM Text$, i AS LONG, BackSlash AS LONG, SemiColon AS LONG
|
|
||||||
DIM j AS LONG, tempNum$
|
|
||||||
|
|
||||||
Text$ = __Text$
|
|
||||||
|
|
||||||
IF INSTR(Text$, "\") = 0 THEN
|
|
||||||
RestoreCHRfromEscapeCode$ = Text$
|
|
||||||
EXIT FUNCTION
|
|
||||||
END IF
|
|
||||||
|
|
||||||
DO
|
|
||||||
BackSlash = INSTR(BackSlash + 1, Text$, "\")
|
|
||||||
IF BackSlash = 0 THEN EXIT DO
|
|
||||||
|
|
||||||
SemiColon = INSTR(BackSlash + 1, Text$, ";")
|
|
||||||
IF SemiColon = 0 THEN _CONTINUE
|
|
||||||
|
|
||||||
tempNum$ = ""
|
|
||||||
FOR j = BackSlash + 1 TO SemiColon - 1
|
|
||||||
IF ASC(Text$, j) < 48 OR ASC(Text$, j) > 57 THEN tempNum$ = "": EXIT FOR
|
|
||||||
tempNum$ = tempNum$ + MID$(Text$, j, 1)
|
|
||||||
NEXT
|
|
||||||
|
|
||||||
IF LEN(tempNum$) THEN
|
|
||||||
Text$ = LEFT$(Text$, BackSlash - 1) + CHR$(VAL(tempNum$)) + MID$(Text$, SemiColon + 1)
|
|
||||||
END IF
|
|
||||||
LOOP
|
|
||||||
|
|
||||||
RestoreCHRfromEscapeCode$ = Text$
|
|
||||||
END FUNCTION
|
|
||||||
|
|
||||||
|
|
|
@ -729,11 +729,13 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A
|
||||||
This.FocusState = __UI_Focus = This.ID
|
This.FocusState = __UI_Focus = This.ID
|
||||||
__UI_TempCaptions(This.ID) = Caption(This.ID)
|
__UI_TempCaptions(This.ID) = Caption(This.ID)
|
||||||
IF Mask(This.ID) <> __UI_TempMask(This.ID) THEN
|
IF Mask(This.ID) <> __UI_TempMask(This.ID) THEN
|
||||||
|
Mask(This.ID) = RestoreCHR$(Mask(This.ID))
|
||||||
__UI_TempMask(This.ID) = Mask(This.ID)
|
__UI_TempMask(This.ID) = Mask(This.ID)
|
||||||
Text(This.ID) = __UI_EmptyMask(This.ID)
|
Text(This.ID) = __UI_EmptyMask(This.ID)
|
||||||
END IF
|
END IF
|
||||||
IF __UI_TempTexts(This.ID) <> Text(This.ID) THEN
|
IF __UI_TempTexts(This.ID) <> Text(This.ID) THEN
|
||||||
__UI_StateHasChanged = True
|
__UI_StateHasChanged = True
|
||||||
|
Text(This.ID) = RestoreCHR$(Text(This.ID))
|
||||||
__UI_TempTexts(This.ID) = Text(This.ID)
|
__UI_TempTexts(This.ID) = Text(This.ID)
|
||||||
END IF
|
END IF
|
||||||
This.SelectionLength = __UI_SelectionLength
|
This.SelectionLength = __UI_SelectionLength
|
||||||
|
|
Loading…
Reference in a new issue