mirror of
https://github.com/FellippeHeitor/InForm.git
synced 2025-01-15 03:49:56 +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:
parent
b63e8acda0
commit
1b05a1ef23
3 changed files with 38 additions and 39 deletions
|
@ -1064,7 +1064,7 @@ SUB __UI_BeforeUpdateDisplay
|
|||
IF CVI(b$) = -1 THEN
|
||||
IF __UI_ActiveMenu > 0 THEN __UI_DestroyControl Control(__UI_ActiveMenu)
|
||||
END IF
|
||||
IF __UI_ActiveMenu = 0 THEN __UI_Focus = 0
|
||||
IF CVI(b$) = -3 THEN __UI_Focus = 0
|
||||
__UI_ForceRedraw = True
|
||||
ELSEIF CVI(b$) = -2 THEN
|
||||
'User attempted to right-click a control but the preview
|
||||
|
@ -2458,31 +2458,29 @@ SUB __UI_KeyPress (id AS LONG)
|
|||
END IF
|
||||
CASE NameTB, CaptionTB, TextTB, MaskTB, TopTB, LeftTB, WidthTB, HeightTB, FontTB, TooltipTB, ValueTB, MinTB, MaxTB, IntervalTB, PaddingTB, MinIntervalTB
|
||||
IF __UI_KeyHit = 13 THEN
|
||||
IF __UI_Focus = id THEN
|
||||
'Send the preview the new property value
|
||||
DIM FloatValue AS _FLOAT, b$, TempValue AS LONG, i AS LONG
|
||||
STATIC PreviousValue$, PreviousControl AS LONG, PreviousProperty AS INTEGER
|
||||
'Send the preview the new property value
|
||||
DIM FloatValue AS _FLOAT, b$, TempValue AS LONG, i AS LONG
|
||||
STATIC PreviousValue$, PreviousControl AS LONG, PreviousProperty AS INTEGER
|
||||
|
||||
IF PreviousValue$ <> Text(id) OR PreviousControl <> FirstSelected OR PreviousProperty <> id THEN
|
||||
PreviousValue$ = Text(id)
|
||||
PreviousControl = FirstSelected
|
||||
PreviousProperty = id
|
||||
TempValue = GetPropertySignal(id)
|
||||
SELECT CASE TempValue
|
||||
CASE 1, 2, 3, 8, 9, 35 'Name, caption, text, font, tooltips, mask
|
||||
b$ = MKL$(LEN(Text(id))) + Text(id)
|
||||
CASE 4, 5, 6, 7, 31 'Top, left, width, height, padding
|
||||
b$ = MKI$(VAL(Text(id)))
|
||||
CASE 10, 11, 12, 13, 36 'Value, min, max, interval, mininterval
|
||||
b$ = _MK$(_FLOAT, VAL(Text(id)))
|
||||
END SELECT
|
||||
SendData b$, TempValue
|
||||
SelectPropertyFully id
|
||||
InputBoxText(GetInputBoxFromID(id)) = Text(id)
|
||||
InputBox(GetInputBoxFromID(id)).LastEdited = TIMER
|
||||
InputBox(GetInputBoxFromID(id)).Sent = True
|
||||
Caption(StatusBar) = "Ready."
|
||||
END IF
|
||||
IF InputBox(GetInputBoxFromID(id)).Sent = False THEN
|
||||
PreviousValue$ = Text(id)
|
||||
PreviousControl = FirstSelected
|
||||
PreviousProperty = id
|
||||
TempValue = GetPropertySignal(id)
|
||||
SELECT CASE TempValue
|
||||
CASE 1, 2, 3, 8, 9, 35 'Name, caption, text, font, tooltips, mask
|
||||
b$ = MKL$(LEN(Text(id))) + Text(id)
|
||||
CASE 4, 5, 6, 7, 31 'Top, left, width, height, padding
|
||||
b$ = MKI$(VAL(Text(id)))
|
||||
CASE 10, 11, 12, 13, 36 'Value, min, max, interval, mininterval
|
||||
b$ = _MK$(_FLOAT, VAL(Text(id)))
|
||||
END SELECT
|
||||
SendData b$, TempValue
|
||||
SelectPropertyFully id
|
||||
InputBoxText(GetInputBoxFromID(id)) = Text(id)
|
||||
InputBox(GetInputBoxFromID(id)).LastEdited = TIMER
|
||||
InputBox(GetInputBoxFromID(id)).Sent = True
|
||||
Caption(StatusBar) = "Ready."
|
||||
END IF
|
||||
ELSEIF __UI_KeyHit = 32 THEN
|
||||
IF id = NameTB THEN
|
||||
|
|
|
@ -383,6 +383,20 @@ SUB __UI_LoadForm
|
|||
Control(__UI_NewID).HasBorder = 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"))
|
||||
Control(__UI_NewID).HasBorder = True
|
||||
Control(__UI_NewID).CanHaveFocus = True
|
||||
|
@ -467,20 +481,6 @@ SUB __UI_LoadForm
|
|||
Control(__UI_NewID).Value = 1
|
||||
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"))
|
||||
SetCaption __UI_NewID, "Stretch"
|
||||
Control(__UI_NewID).CanHaveFocus = True
|
||||
|
|
|
@ -104,6 +104,7 @@ $END IF
|
|||
|
||||
'Event procedures: ---------------------------------------------------------------
|
||||
SUB __UI_Click (id AS LONG)
|
||||
SendSignal -3
|
||||
END SUB
|
||||
|
||||
SUB __UI_MouseEnter (id AS LONG)
|
||||
|
|
Loading…
Reference in a new issue