1
1
Fork 0
mirror of https://github.com/FellippeHeitor/InForm.git synced 2025-01-15 11:59:34 +00:00

Reorders Font list for proper tabbing. Also:

Tweaks the behavior of the ENTER key when editing a property and also fixes the wrong behavior that had property boxes lose focus after values were sent.
This commit is contained in:
FellippeHeitor 2018-06-11 11:46:48 -03:00
parent b63e8acda0
commit 1b05a1ef23
3 changed files with 38 additions and 39 deletions

View file

@ -1064,7 +1064,7 @@ SUB __UI_BeforeUpdateDisplay
IF CVI(b$) = -1 THEN IF CVI(b$) = -1 THEN
IF __UI_ActiveMenu > 0 THEN __UI_DestroyControl Control(__UI_ActiveMenu) IF __UI_ActiveMenu > 0 THEN __UI_DestroyControl Control(__UI_ActiveMenu)
END IF END IF
IF __UI_ActiveMenu = 0 THEN __UI_Focus = 0 IF CVI(b$) = -3 THEN __UI_Focus = 0
__UI_ForceRedraw = True __UI_ForceRedraw = True
ELSEIF CVI(b$) = -2 THEN ELSEIF CVI(b$) = -2 THEN
'User attempted to right-click a control but the preview 'User attempted to right-click a control but the preview
@ -2458,31 +2458,29 @@ SUB __UI_KeyPress (id AS LONG)
END IF END IF
CASE NameTB, CaptionTB, TextTB, MaskTB, TopTB, LeftTB, WidthTB, HeightTB, FontTB, TooltipTB, ValueTB, MinTB, MaxTB, IntervalTB, PaddingTB, MinIntervalTB CASE NameTB, CaptionTB, TextTB, MaskTB, TopTB, LeftTB, WidthTB, HeightTB, FontTB, TooltipTB, ValueTB, MinTB, MaxTB, IntervalTB, PaddingTB, MinIntervalTB
IF __UI_KeyHit = 13 THEN IF __UI_KeyHit = 13 THEN
IF __UI_Focus = id THEN 'Send the preview the new property value
'Send the preview the new property value DIM FloatValue AS _FLOAT, b$, TempValue AS LONG, i AS LONG
DIM FloatValue AS _FLOAT, b$, TempValue AS LONG, i AS LONG STATIC PreviousValue$, PreviousControl AS LONG, PreviousProperty AS INTEGER
STATIC PreviousValue$, PreviousControl AS LONG, PreviousProperty AS INTEGER
IF PreviousValue$ <> Text(id) OR PreviousControl <> FirstSelected OR PreviousProperty <> id THEN IF InputBox(GetInputBoxFromID(id)).Sent = False THEN
PreviousValue$ = Text(id) PreviousValue$ = Text(id)
PreviousControl = FirstSelected PreviousControl = FirstSelected
PreviousProperty = id PreviousProperty = id
TempValue = GetPropertySignal(id) TempValue = GetPropertySignal(id)
SELECT CASE TempValue SELECT CASE TempValue
CASE 1, 2, 3, 8, 9, 35 'Name, caption, text, font, tooltips, mask CASE 1, 2, 3, 8, 9, 35 'Name, caption, text, font, tooltips, mask
b$ = MKL$(LEN(Text(id))) + Text(id) b$ = MKL$(LEN(Text(id))) + Text(id)
CASE 4, 5, 6, 7, 31 'Top, left, width, height, padding CASE 4, 5, 6, 7, 31 'Top, left, width, height, padding
b$ = MKI$(VAL(Text(id))) b$ = MKI$(VAL(Text(id)))
CASE 10, 11, 12, 13, 36 'Value, min, max, interval, mininterval CASE 10, 11, 12, 13, 36 'Value, min, max, interval, mininterval
b$ = _MK$(_FLOAT, VAL(Text(id))) b$ = _MK$(_FLOAT, VAL(Text(id)))
END SELECT END SELECT
SendData b$, TempValue SendData b$, TempValue
SelectPropertyFully id SelectPropertyFully id
InputBoxText(GetInputBoxFromID(id)) = Text(id) InputBoxText(GetInputBoxFromID(id)) = Text(id)
InputBox(GetInputBoxFromID(id)).LastEdited = TIMER InputBox(GetInputBoxFromID(id)).LastEdited = TIMER
InputBox(GetInputBoxFromID(id)).Sent = True InputBox(GetInputBoxFromID(id)).Sent = True
Caption(StatusBar) = "Ready." Caption(StatusBar) = "Ready."
END IF
END IF END IF
ELSEIF __UI_KeyHit = 32 THEN ELSEIF __UI_KeyHit = 32 THEN
IF id = NameTB THEN IF id = NameTB THEN

View file

@ -383,6 +383,20 @@ SUB __UI_LoadForm
Control(__UI_NewID).HasBorder = True Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).CanHaveFocus = True
__UI_NewID = __UI_NewControl(__UI_Type_Label, "FontListLB", 120, 23, 10, 362, __UI_GetID("ControlProperties"))
SetCaption __UI_NewID, "Font"
Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).VAlign = __UI_Middle
Control(__UI_NewID).ContextMenuID = __UI_GetID("FontSwitchMenu")
__UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "FontList", 180, 23, 129, 362, __UI_GetID("ControlProperties"))
Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).CanHaveFocus = True
__UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "FontSizeList", 50, 23, 309, 362, __UI_GetID("ControlProperties"))
Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).CanHaveFocus = True
__UI_NewID = __UI_NewControl(__UI_Type_TextBox, "TooltipTB", 230, 23, 129, 208, __UI_GetID("ControlProperties")) __UI_NewID = __UI_NewControl(__UI_Type_TextBox, "TooltipTB", 230, 23, 129, 208, __UI_GetID("ControlProperties"))
Control(__UI_NewID).HasBorder = True Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).CanHaveFocus = True
@ -467,20 +481,6 @@ SUB __UI_LoadForm
Control(__UI_NewID).Value = 1 Control(__UI_NewID).Value = 1
Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).CanHaveFocus = True
__UI_NewID = __UI_NewControl(__UI_Type_Label, "FontListLB", 120, 23, 10, 362, __UI_GetID("ControlProperties"))
SetCaption __UI_NewID, "Font"
Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).VAlign = __UI_Middle
Control(__UI_NewID).ContextMenuID = __UI_GetID("FontSwitchMenu")
__UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "FontList", 180, 23, 129, 362, __UI_GetID("ControlProperties"))
Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).CanHaveFocus = True
__UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "FontSizeList", 50, 23, 309, 362, __UI_GetID("ControlProperties"))
Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).CanHaveFocus = True
__UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "Stretch", 181, 20, 12, 12, __UI_GetID("ControlToggles")) __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "Stretch", 181, 20, 12, 12, __UI_GetID("ControlToggles"))
SetCaption __UI_NewID, "Stretch" SetCaption __UI_NewID, "Stretch"
Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).CanHaveFocus = True

View file

@ -104,6 +104,7 @@ $END IF
'Event procedures: --------------------------------------------------------------- 'Event procedures: ---------------------------------------------------------------
SUB __UI_Click (id AS LONG) SUB __UI_Click (id AS LONG)
SendSignal -3
END SUB END SUB
SUB __UI_MouseEnter (id AS LONG) SUB __UI_MouseEnter (id AS LONG)