mirror of
https://github.com/FellippeHeitor/InForm.git
synced 2025-01-14 19:49:33 +00:00
Prevents changes to BorderSize property for Frames. Also:
Validates .BorderSize before drawing it.
This commit is contained in:
parent
b1740261d6
commit
7cd15f2cfc
3 changed files with 20 additions and 15 deletions
|
@ -1750,6 +1750,7 @@ SUB __UI_BeforeUpdateDisplay
|
|||
Caption(ValueLB) = "Value"
|
||||
Caption(MaxLB) = "Max"
|
||||
Control(SizeTB).Disabled = True
|
||||
Control(SizeTB).Hidden = True
|
||||
IF TotalSelected > 0 THEN
|
||||
SELECT EVERYCASE PreviewControls(FirstSelected).Type
|
||||
CASE __UI_Type_ToggleSwitch
|
||||
|
@ -2002,11 +2003,11 @@ SUB __UI_BeforeUpdateDisplay
|
|||
|
||||
'Custom cases
|
||||
Control(AutoSize).Disabled = Control(WordWrap).Value
|
||||
Control(SizeTB).Disabled = NOT Control(HasBorder).Value
|
||||
Control(SizeTB).Hidden = Control(SizeTB).Disabled
|
||||
Control(SizeTB).Top = Control(HasBorder).Top
|
||||
IF Control(HasBorder).Value = True THEN
|
||||
Caption(HasBorder) = "Has border Size:"
|
||||
IF Control(HasBorder).Value = True AND PreviewControls(FirstSelected).Type <> __UI_Type_Frame THEN
|
||||
Control(SizeTB).Disabled = False
|
||||
Control(SizeTB).Hidden = False
|
||||
Control(SizeTB).Top = Control(HasBorder).Top
|
||||
Caption(HasBorder) = "Has border Size"
|
||||
END IF
|
||||
|
||||
Control(FontSizeList).Disabled = Control(FontList).Disabled
|
||||
|
|
|
@ -256,9 +256,6 @@ SUB __UI_BeforeUpdateDisplay
|
|||
END IF
|
||||
|
||||
SELECT CASE tempType
|
||||
'CASE __UI_Type_ListBox
|
||||
' Control(TempValue).HasBorder = True
|
||||
' Control(TempValue).BorderSize = 1
|
||||
CASE __UI_Type_ProgressBar
|
||||
SetCaption TempValue, "\#"
|
||||
END SELECT
|
||||
|
@ -1207,12 +1204,16 @@ SUB __UI_BeforeUpdateDisplay
|
|||
TempValue = CVI(b$)
|
||||
IF TotalLockedControls THEN
|
||||
FOR j = 1 TO TotalLockedControls
|
||||
Control(LockedControls(j)).BorderSize = TempValue
|
||||
IF Control(LockedControls(j)).Type <> __UI_Type_Frame THEN
|
||||
Control(LockedControls(j)).BorderSize = TempValue
|
||||
END IF
|
||||
NEXT
|
||||
ELSEIF __UI_TotalSelectedControls > 0 THEN
|
||||
FOR i = 1 TO UBOUND(Control)
|
||||
IF Control(i).ControlIsSelected THEN
|
||||
Control(i).BorderSize = TempValue
|
||||
IF Control(i).Type <> __UI_Type_Frame THEN
|
||||
Control(i).BorderSize = TempValue
|
||||
END IF
|
||||
END IF
|
||||
NEXT
|
||||
END IF
|
||||
|
|
|
@ -764,7 +764,14 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A
|
|||
TempCaption$ = __UI_TrimAt0$(Caption(This.ID))
|
||||
CaptionIndent = 0
|
||||
|
||||
IF This.HasBorder THEN CaptionIndent = 5 + This.BorderSize
|
||||
IF This.HasBorder THEN
|
||||
IF This.BorderSize > __UI_MaxBorderSize THEN
|
||||
This.BorderSize = __UI_MaxBorderSize
|
||||
ELSEIF This.BorderSize < 1 THEN
|
||||
This.BorderSize = 1
|
||||
END IF
|
||||
CaptionIndent = 5 + This.BorderSize
|
||||
END IF
|
||||
|
||||
IF NOT This.Disabled AND (LEN(Text(This.ID)) OR This.Multiline) THEN
|
||||
COLOR This.ForeColor, This.BackColor
|
||||
|
@ -934,10 +941,6 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A
|
|||
END IF
|
||||
|
||||
IF This.HasBorder = True THEN
|
||||
IF This.BorderSize > __UI_MaxBorderSize THEN
|
||||
This.BorderSize = __UI_MaxBorderSize
|
||||
END IF
|
||||
|
||||
FOR i = 0 TO This.BorderSize - 1
|
||||
LINE (i, i)-STEP(This.Width - 1 - i * 2, This.Height - 1 - i * 2), This.BorderColor, B
|
||||
NEXT
|
||||
|
|
Loading…
Reference in a new issue