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

Adds .BorderThickness, ranging 1-10; Also:

- Fixes color preview not being dynamically updated.
This commit is contained in:
FellippeHeitor 2018-08-27 01:39:20 -03:00
parent 300006982d
commit 1a36eabc7c
6 changed files with 158 additions and 47 deletions

View file

@ -60,6 +60,7 @@ TYPE __UI_ControlTYPE
SelectedBackColor AS _UNSIGNED LONG SelectedBackColor AS _UNSIGNED LONG
BackStyle AS _BYTE BackStyle AS _BYTE
HasBorder AS _BYTE HasBorder AS _BYTE
BorderThickness AS INTEGER
Padding AS INTEGER Padding AS INTEGER
Encoding AS LONG Encoding AS LONG
Align AS _BYTE Align AS _BYTE
@ -165,6 +166,7 @@ DIM SHARED __UI_PrevMouseLeft AS INTEGER, __UI_PrevMouseTop AS INTEGER
DIM SHARED __UI_MouseButton1 AS _BYTE, __UI_MouseButton2 AS _BYTE DIM SHARED __UI_MouseButton1 AS _BYTE, __UI_MouseButton2 AS _BYTE
DIM SHARED __UI_MouseIsDown AS _BYTE, __UI_MouseDownOnID AS LONG DIM SHARED __UI_MouseIsDown AS _BYTE, __UI_MouseDownOnID AS LONG
DIM SHARED __UI_Mouse2IsDown AS _BYTE, __UI_Mouse2DownOnID AS LONG DIM SHARED __UI_Mouse2IsDown AS _BYTE, __UI_Mouse2DownOnID AS LONG
DIM SHARED __UI_PreviousMouseDownOnID AS LONG
DIM SHARED __UI_KeyIsDown AS _BYTE, __UI_KeyDownOnID AS LONG DIM SHARED __UI_KeyIsDown AS _BYTE, __UI_KeyDownOnID AS LONG
DIM SHARED __UI_ShiftIsDown AS _BYTE, __UI_CtrlIsDown AS _BYTE DIM SHARED __UI_ShiftIsDown AS _BYTE, __UI_CtrlIsDown AS _BYTE
DIM SHARED __UI_AltIsDown AS _BYTE, __UI_ShowHotKeys AS _BYTE, __UI_AltCombo$ DIM SHARED __UI_AltIsDown AS _BYTE, __UI_ShowHotKeys AS _BYTE, __UI_AltCombo$
@ -211,7 +213,7 @@ DIM SHARED __UI_SnappedXID AS LONG, __UI_SnappedYID AS LONG
DIM SHARED __UI_SnapLines AS _BYTE, __UI_SnapDistance AS INTEGER, __UI_SnapDistanceFromForm AS INTEGER DIM SHARED __UI_SnapLines AS _BYTE, __UI_SnapDistance AS INTEGER, __UI_SnapDistanceFromForm AS INTEGER
DIM SHARED __UI_FrameRate AS SINGLE, __UI_Font8Offset AS INTEGER, __UI_Font16Offset AS INTEGER DIM SHARED __UI_FrameRate AS SINGLE, __UI_Font8Offset AS INTEGER, __UI_Font16Offset AS INTEGER
DIM SHARED __UI_ClipboardCheck$, __UI_MenuBarOffsetV AS INTEGER DIM SHARED __UI_ClipboardCheck$, __UI_MenuBarOffsetV AS INTEGER
DIM SHARED __UI_KeepScreenHidden AS _BYTE DIM SHARED __UI_KeepScreenHidden AS _BYTE, __UI_MaxBorderThickness AS INTEGER
'Control types: ----------------------------------------------- 'Control types: -----------------------------------------------
DIM SHARED __UI_Type(0 TO 18) AS __UI_Types DIM SHARED __UI_Type(0 TO 18) AS __UI_Types
@ -286,6 +288,7 @@ CONST True = -1, False = 0
'$INCLUDE:'InFormVersion.bas' '$INCLUDE:'InFormVersion.bas'
__UI_SnapDistance = 5 __UI_SnapDistance = 5
__UI_SnapDistanceFromForm = 10 __UI_SnapDistanceFromForm = 10
__UI_MaxBorderThickness = 10
__UI_Font8Offset = 5 __UI_Font8Offset = 5
__UI_Font16Offset = 3 __UI_Font16Offset = 3
__UI_ClipboardCheck$ = "InForm" + STRING$(2, 10) + "BEGIN CONTROL DATA" + CHR$(10) + STRING$(60, 45) + CHR$(10) __UI_ClipboardCheck$ = "InForm" + STRING$(2, 10) + "BEGIN CONTROL DATA" + CHR$(10) + STRING$(60, 45) + CHR$(10)
@ -1573,7 +1576,7 @@ END FUNCTION
SUB __UI_EventDispatcher SUB __UI_EventDispatcher
STATIC __UI_LastMouseIconSet AS _BYTE STATIC __UI_LastMouseIconSet AS _BYTE
STATIC __UI_PreviousMouseDownOnID AS LONG, __UI_LastMouseDownEvent AS DOUBLE STATIC __UI_LastMouseDownEvent AS DOUBLE
STATIC __UI_MouseDownTop AS INTEGER, __UI_MouseDownLeft AS INTEGER STATIC __UI_MouseDownTop AS INTEGER, __UI_MouseDownLeft AS INTEGER
STATIC __UI_JustOpenedMenu AS _BYTE STATIC __UI_JustOpenedMenu AS _BYTE
STATIC ControlClipboard$ STATIC ControlClipboard$
@ -4507,6 +4510,7 @@ FUNCTION __UI_NewControl (ControlType AS INTEGER, ControlName AS STRING, NewWidt
IF (ControlType = __UI_Type_PictureBox AND __UI_DesignMode) OR ControlType = __UI_Type_TextBox OR ControlType = __UI_Type_Frame OR ControlType = __UI_Type_ListBox OR ControlType = __UI_Type_DropdownList THEN IF (ControlType = __UI_Type_PictureBox AND __UI_DesignMode) OR ControlType = __UI_Type_TextBox OR ControlType = __UI_Type_Frame OR ControlType = __UI_Type_ListBox OR ControlType = __UI_Type_DropdownList THEN
Control(NextSlot).HasBorder = True Control(NextSlot).HasBorder = True
Control(NextSlot).BorderThickness = 1
END IF END IF
IF ControlType = __UI_Type_PictureBox THEN IF ControlType = __UI_Type_PictureBox THEN
@ -5451,6 +5455,7 @@ SUB __UI_ActivateDropdownlist (This AS __UI_ControlTYPE)
Control(__UI_ActiveDropdownList).SelectedBackColor = This.SelectedBackColor Control(__UI_ActiveDropdownList).SelectedBackColor = This.SelectedBackColor
Control(__UI_ActiveDropdownList).Font = This.Font Control(__UI_ActiveDropdownList).Font = This.Font
Control(__UI_ActiveDropdownList).HasBorder = True Control(__UI_ActiveDropdownList).HasBorder = True
Control(__UI_ActiveDropdownList).BorderThickness = 1
Control(__UI_ActiveDropdownList).BorderColor = _RGB32(0, 0, 0) Control(__UI_ActiveDropdownList).BorderColor = _RGB32(0, 0, 0)
Control(__UI_ActiveDropdownList).CanHaveFocus = True Control(__UI_ActiveDropdownList).CanHaveFocus = True
Control(__UI_ActiveDropdownList).InputViewStart = 1 Control(__UI_ActiveDropdownList).InputViewStart = 1

View file

@ -71,7 +71,7 @@ DIM SHARED WordWrap AS LONG, CanHaveFocus AS LONG
DIM SHARED Disabled AS LONG, Transparent AS LONG DIM SHARED Disabled AS LONG, Transparent AS LONG
DIM SHARED Hidden AS LONG, CenteredWindow AS LONG DIM SHARED Hidden AS LONG, CenteredWindow AS LONG
DIM SHARED Resizable AS LONG, AutoScroll AS LONG DIM SHARED Resizable AS LONG, AutoScroll AS LONG
DIM SHARED AutoSize AS LONG DIM SHARED AutoSize AS LONG, ThicknessTB AS LONG
'Open dialog 'Open dialog
DIM SHARED DialogBG AS LONG, FileNameLB AS LONG DIM SHARED DialogBG AS LONG, FileNameLB AS LONG
@ -135,9 +135,14 @@ TYPE newInputBox
LabelID AS LONG LabelID AS LONG
Signal AS INTEGER Signal AS INTEGER
LastEdited AS SINGLE LastEdited AS SINGLE
DataType AS INTEGER
Sent AS _BYTE Sent AS _BYTE
END TYPE END TYPE
CONST DT_Text = 1
CONST DT_Integer = 2
CONST DT_Float = 3
REDIM SHARED PreviewCaptions(0) AS STRING REDIM SHARED PreviewCaptions(0) AS STRING
REDIM SHARED PreviewTexts(0) AS STRING REDIM SHARED PreviewTexts(0) AS STRING
REDIM SHARED PreviewMasks(0) AS STRING REDIM SHARED PreviewMasks(0) AS STRING
@ -742,7 +747,7 @@ END SUB
SUB __UI_FocusIn (id AS LONG) SUB __UI_FocusIn (id AS LONG)
SELECT CASE id SELECT CASE id
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, ThicknessTB
DIM ThisInputBox AS LONG DIM ThisInputBox AS LONG
ThisInputBox = GetInputBoxFromID(id) ThisInputBox = GetInputBoxFromID(id)
InputBoxText(ThisInputBox) = Text(id) InputBoxText(ThisInputBox) = Text(id)
@ -765,7 +770,7 @@ END SUB
SUB __UI_FocusOut (id AS LONG) SUB __UI_FocusOut (id AS LONG)
SELECT CASE id SELECT CASE id
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, ThicknessTB
ConfirmEdits id ConfirmEdits id
END SELECT END SELECT
END SUB END SUB
@ -890,6 +895,24 @@ SUB __UI_BeforeUpdateDisplay
IF Caption(StatusBar) = "" THEN Caption(StatusBar) = "Ready." IF Caption(StatusBar) = "" THEN Caption(StatusBar) = "Ready."
END IF END IF
IF __UI_MouseDownOnID = Red OR __UI_MouseDownOnID = Green OR __UI_MouseDownOnID = Blue OR _
__UI_PreviousMouseDownOnID = Red OR __UI_PreviousMouseDownOnID = Green OR __UI_PreviousMouseDownOnID = Blue THEN
SELECT CASE __UI_MouseDownOnID + __UI_PreviousMouseDownOnID
CASE Red
Text(RedValue) = LTRIM$(STR$(FIX(Control(Red).Value)))
CASE Green
Text(GreenValue) = LTRIM$(STR$(FIX(Control(Green).Value)))
CASE Blue
Text(BlueValue) = LTRIM$(STR$(FIX(Control(Blue).Value)))
END SELECT
'Compose a new color and preview it
DIM NewColor AS _UNSIGNED LONG
NewColor = _RGB32(Control(Red).Value, Control(Green).Value, Control(Blue).Value)
QuickColorPreview NewColor
END IF
'Check if another instance was launched and is passing 'Check if another instance was launched and is passing
'parameters: 'parameters:
STATIC BringToFront AS _BYTE, InstanceStream$ STATIC BringToFront AS _BYTE, InstanceStream$
@ -1374,11 +1397,11 @@ SUB __UI_BeforeUpdateDisplay
IF __UI_Focus = InputBox(i).ID THEN IF __UI_Focus = InputBox(i).ID THEN
Control(InputBox(i).ID).Height = 22 Control(InputBox(i).ID).Height = 22
Control(InputBox(i).ID).BorderColor = _RGB32(0, 0, 0) Control(InputBox(i).ID).BorderColor = _RGB32(0, 0, 0)
Control(InputBox(i).ID).HasBorder = 1 Control(InputBox(i).ID).BorderThickness = 2
ELSE ELSE
Control(InputBox(i).ID).Height = 23 Control(InputBox(i).ID).Height = 23
Control(InputBox(i).ID).BorderColor = __UI_DefaultColor(__UI_Type_TextBox, 5) Control(InputBox(i).ID).BorderColor = __UI_DefaultColor(__UI_Type_TextBox, 5)
Control(InputBox(i).ID).HasBorder = True Control(InputBox(i).ID).BorderThickness = 1
END IF END IF
NEXT NEXT
Control(FontSizeList).Hidden = True Control(FontSizeList).Hidden = True
@ -1673,6 +1696,22 @@ SUB __UI_BeforeUpdateDisplay
END IF END IF
END IF END IF
END IF END IF
IF __UI_Focus <> ThicknessTB OR (__UI_Focus = ThicknessTB AND RevertEdit = True) THEN
Text(ThicknessTB) = LTRIM$(STR$(PreviewControls(FirstSelected).BorderThickness))
IF (__UI_Focus = ThicknessTB AND RevertEdit = True) THEN RevertEdit = False: SelectPropertyFully __UI_Focus
ELSEIF __UI_Focus = ThicknessTB THEN
IF PropertyFullySelected(ThicknessTB) THEN
IF Text(ThicknessTB) = LTRIM$(STR$(PreviewControls(FirstSelected).BorderThickness)) THEN
Control(__UI_Focus).BorderColor = ShadeOfGreen
ELSE
IF TIMER - InputBox(ThisInputBox).LastEdited < PropertyUpdateDelay THEN
Control(__UI_Focus).BorderColor = __UI_DefaultColor(__UI_Type_TextBox, 5)
ELSE
Control(__UI_Focus).BorderColor = ShadeOfRed
END IF
END IF
END IF
END IF
END IF END IF
Control(TextTB).Max = 0 Control(TextTB).Max = 0
@ -1709,6 +1748,7 @@ SUB __UI_BeforeUpdateDisplay
Caption(TextLB) = "Text" Caption(TextLB) = "Text"
Caption(ValueLB) = "Value" Caption(ValueLB) = "Value"
Caption(MaxLB) = "Max" Caption(MaxLB) = "Max"
Control(ThicknessTB).Disabled = True
IF TotalSelected > 0 THEN IF TotalSelected > 0 THEN
SELECT EVERYCASE PreviewControls(FirstSelected).Type SELECT EVERYCASE PreviewControls(FirstSelected).Type
CASE __UI_Type_ToggleSwitch CASE __UI_Type_ToggleSwitch
@ -1936,6 +1976,9 @@ SUB __UI_BeforeUpdateDisplay
LastTopForInputBox = -12 LastTopForInputBox = -12
CONST TopIncrementForInputBox = 22 CONST TopIncrementForInputBox = 22
FOR i = 1 TO UBOUND(InputBox) FOR i = 1 TO UBOUND(InputBox)
'Exception for ThicknessTB:
IF InputBox(i).ID = ThicknessTB THEN _CONTINUE
IF Control(InputBox(i).ID).Disabled THEN IF Control(InputBox(i).ID).Disabled THEN
Control(InputBox(i).ID).Hidden = True Control(InputBox(i).ID).Hidden = True
Control(InputBox(i).LabelID).Hidden = True Control(InputBox(i).LabelID).Hidden = True
@ -1955,7 +1998,12 @@ SUB __UI_BeforeUpdateDisplay
Control(Toggles(i)).Top = LastTopForInputBox Control(Toggles(i)).Top = LastTopForInputBox
END IF END IF
NEXT NEXT
'Custom cases
Control(AutoSize).Disabled = Control(WordWrap).Value Control(AutoSize).Disabled = Control(WordWrap).Value
Control(ThicknessTB).Disabled = NOT Control(HasBorder).Value
Control(ThicknessTB).Hidden = Control(ThicknessTB).Disabled
Control(ThicknessTB).Top = Control(HasBorder).Top
Control(FontSizeList).Disabled = Control(FontList).Disabled Control(FontSizeList).Disabled = Control(FontList).Disabled
Control(FontSizeList).Hidden = Control(FontList).Hidden Control(FontSizeList).Hidden = Control(FontList).Hidden
@ -2389,27 +2437,28 @@ SUB __UI_OnLoad
'Assign InputBox IDs: 'Assign InputBox IDs:
i = 0 i = 0
i = i + 1: InputBox(i).ID = NameTB: InputBox(i).LabelID = NameLB: InputBox(i).Signal = 1 i = i + 1: InputBox(i).ID = NameTB: InputBox(i).LabelID = NameLB: InputBox(i).Signal = 1: InputBox(i).DataType = DT_Text
i = i + 1: InputBox(i).ID = CaptionTB: InputBox(i).LabelID = CaptionLB: InputBox(i).Signal = 2 i = i + 1: InputBox(i).ID = CaptionTB: InputBox(i).LabelID = CaptionLB: InputBox(i).Signal = 2: InputBox(i).DataType = DT_Text
i = i + 1: InputBox(i).ID = TextTB: InputBox(i).LabelID = TextLB: InputBox(i).Signal = 3 i = i + 1: InputBox(i).ID = TextTB: InputBox(i).LabelID = TextLB: InputBox(i).Signal = 3: InputBox(i).DataType = DT_Text
i = i + 1: InputBox(i).ID = MaskTB: InputBox(i).LabelID = MaskLB: InputBox(i).Signal = 35 i = i + 1: InputBox(i).ID = MaskTB: InputBox(i).LabelID = MaskLB: InputBox(i).Signal = 35: InputBox(i).DataType = DT_Text
i = i + 1: InputBox(i).ID = TopTB: InputBox(i).LabelID = TopLB: InputBox(i).Signal = 4 i = i + 1: InputBox(i).ID = TopTB: InputBox(i).LabelID = TopLB: InputBox(i).Signal = 4: InputBox(i).DataType = DT_Integer
i = i + 1: InputBox(i).ID = LeftTB: InputBox(i).LabelID = LeftLB: InputBox(i).Signal = 5 i = i + 1: InputBox(i).ID = LeftTB: InputBox(i).LabelID = LeftLB: InputBox(i).Signal = 5: InputBox(i).DataType = DT_Integer
i = i + 1: InputBox(i).ID = WidthTB: InputBox(i).LabelID = WidthLB: InputBox(i).Signal = 6 i = i + 1: InputBox(i).ID = WidthTB: InputBox(i).LabelID = WidthLB: InputBox(i).Signal = 6: InputBox(i).DataType = DT_Integer
i = i + 1: InputBox(i).ID = HeightTB: InputBox(i).LabelID = HeightLB: InputBox(i).Signal = 7 i = i + 1: InputBox(i).ID = HeightTB: InputBox(i).LabelID = HeightLB: InputBox(i).Signal = 7: InputBox(i).DataType = DT_Integer
i = i + 1: InputBox(i).ID = FontTB: InputBox(i).LabelID = FontLB: InputBox(i).Signal = 8 i = i + 1: InputBox(i).ID = FontTB: InputBox(i).LabelID = FontLB: InputBox(i).Signal = 8: InputBox(i).DataType = DT_Text
i = i + 1: InputBox(i).ID = FontList: InputBox(i).LabelID = FontListLB: InputBox(i).Signal = 8 i = i + 1: InputBox(i).ID = FontList: InputBox(i).LabelID = FontListLB: InputBox(i).Signal = 8: InputBox(i).DataType = DT_Text
i = i + 1: InputBox(i).ID = TooltipTB: InputBox(i).LabelID = TooltipLB: InputBox(i).Signal = 9 i = i + 1: InputBox(i).ID = TooltipTB: InputBox(i).LabelID = TooltipLB: InputBox(i).Signal = 9: InputBox(i).DataType = DT_Text
i = i + 1: InputBox(i).ID = ValueTB: InputBox(i).LabelID = ValueLB: InputBox(i).Signal = 10 i = i + 1: InputBox(i).ID = ValueTB: InputBox(i).LabelID = ValueLB: InputBox(i).Signal = 10: InputBox(i).DataType = DT_Float
i = i + 1: InputBox(i).ID = BooleanOptions: InputBox(i).LabelID = BooleanLB: InputBox(i).Signal = 10 i = i + 1: InputBox(i).ID = BooleanOptions: InputBox(i).LabelID = BooleanLB: InputBox(i).Signal = 10: InputBox(i).DataType = DT_Float
i = i + 1: InputBox(i).ID = MinTB: InputBox(i).LabelID = MinLB: InputBox(i).Signal = 11 i = i + 1: InputBox(i).ID = MinTB: InputBox(i).LabelID = MinLB: InputBox(i).Signal = 11: InputBox(i).DataType = DT_Float
i = i + 1: InputBox(i).ID = MaxTB: InputBox(i).LabelID = MaxLB: InputBox(i).Signal = 12 i = i + 1: InputBox(i).ID = MaxTB: InputBox(i).LabelID = MaxLB: InputBox(i).Signal = 12: InputBox(i).DataType = DT_Float
i = i + 1: InputBox(i).ID = IntervalTB: InputBox(i).LabelID = IntervalLB: InputBox(i).Signal = 13 i = i + 1: InputBox(i).ID = IntervalTB: InputBox(i).LabelID = IntervalLB: InputBox(i).Signal = 13: InputBox(i).DataType = DT_Float
i = i + 1: InputBox(i).ID = MinIntervalTB: InputBox(i).LabelID = MinIntervalLB: InputBox(i).Signal = 36 i = i + 1: InputBox(i).ID = MinIntervalTB: InputBox(i).LabelID = MinIntervalLB: InputBox(i).Signal = 36: InputBox(i).DataType = DT_Float
i = i + 1: InputBox(i).ID = PaddingTB: InputBox(i).LabelID = PaddingLeftrightLB: InputBox(i).Signal = 31 i = i + 1: InputBox(i).ID = PaddingTB: InputBox(i).LabelID = PaddingLeftrightLB: InputBox(i).Signal = 31: InputBox(i).DataType = DT_Integer
i = i + 1: InputBox(i).ID = AlignOptions: InputBox(i).LabelID = TextAlignLB i = i + 1: InputBox(i).ID = AlignOptions: InputBox(i).LabelID = TextAlignLB
i = i + 1: InputBox(i).ID = VAlignOptions: InputBox(i).LabelID = VerticalAlignLB i = i + 1: InputBox(i).ID = VAlignOptions: InputBox(i).LabelID = VerticalAlignLB
i = i + 1: InputBox(i).ID = BulletOptions: InputBox(i).LabelID = BulletOptionsLB i = i + 1: InputBox(i).ID = BulletOptions: InputBox(i).LabelID = BulletOptionsLB
i = i + 1: InputBox(i).ID = ThicknessTB: InputBox(i).Signal = 40: InputBox(i).DataType = DT_Integer
REDIM _PRESERVE InputBox(1 TO i) AS newInputBox REDIM _PRESERVE InputBox(1 TO i) AS newInputBox
REDIM InputBoxText(1 TO i) AS STRING REDIM InputBoxText(1 TO i) AS STRING
@ -2617,7 +2666,7 @@ SUB __UI_KeyPress (id AS LONG)
IF __UI_KeyHit = 27 THEN IF __UI_KeyHit = 27 THEN
__UI_Click CloseZOrderingBT __UI_Click CloseZOrderingBT
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, ThicknessTB
IF __UI_KeyHit = 13 THEN IF __UI_KeyHit = 13 THEN
'Send the preview the new property value 'Send the preview the new property value
ConfirmEdits id ConfirmEdits id
@ -2645,15 +2694,15 @@ SUB ConfirmEdits (id AS LONG)
IF InputBoxText(GetInputBoxFromID(id)) <> Text(id) AND _ IF InputBoxText(GetInputBoxFromID(id)) <> Text(id) AND _
InputBox(GetInputBoxFromID(id)).Sent = False THEN InputBox(GetInputBoxFromID(id)).Sent = False THEN
TempValue = GetPropertySignal(id) SELECT CASE InputBox(GetInputBoxFromID(id)).DataType
SELECT CASE TempValue CASE DT_Text
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 DT_Integer
b$ = MKI$(VAL(Text(id))) b$ = MKI$(VAL(Text(id)))
CASE 10, 11, 12, 13, 36 'Value, min, max, interval, mininterval CASE DT_Float
b$ = _MK$(_FLOAT, VAL(Text(id))) b$ = _MK$(_FLOAT, VAL(Text(id)))
END SELECT END SELECT
TempValue = GetPropertySignal(id)
SendData b$, TempValue SendData b$, TempValue
PropertySent = True PropertySent = True
SelectPropertyFully id SelectPropertyFully id
@ -2724,11 +2773,6 @@ SUB __UI_ValueChanged (id AS LONG)
Text(GreenValue) = LTRIM$(STR$(Control(Green).Value)) Text(GreenValue) = LTRIM$(STR$(Control(Green).Value))
CASE Blue CASE Blue
Text(BlueValue) = LTRIM$(STR$(Control(Blue).Value)) Text(BlueValue) = LTRIM$(STR$(Control(Blue).Value))
CASE Red, Green, Blue
'Compose a new color and preview it
DIM NewColor AS _UNSIGNED LONG
NewColor = _RGB32(Control(Red).Value, Control(Green).Value, Control(Blue).Value)
IF __UI_MouseDownOnID = id THEN QuickColorPreview NewColor
CASE ControlList CASE ControlList
Control(UpBT).Disabled = False Control(UpBT).Disabled = False
Control(DownBT).Disabled = False Control(DownBT).Disabled = False
@ -2748,7 +2792,7 @@ SUB __UI_ValueChanged (id AS LONG)
SendData b$, 213 SendData b$, 213
CASE FileList CASE FileList
Text(FileNameTextBox) = GetItem(FileList, Control(FileList).Value) Text(FileNameTextBox) = GetItem(FileList, Control(FileList).Value)
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, ThicknessTB
Send Client, "LOCKCONTROLS><END>" Send Client, "LOCKCONTROLS><END>"
END SELECT END SELECT
END SUB END SUB
@ -3162,6 +3206,9 @@ SUB LoadPreview
PreviewControls(Dummy).AutoScroll = True PreviewControls(Dummy).AutoScroll = True
CASE -42 CASE -42
PreviewControls(Dummy).AutoSize = True PreviewControls(Dummy).AutoSize = True
CASE -43
b$ = ReadSequential$(FormData$, 2)
PreviewControls(Dummy).BorderThickness = CVI(b$)
CASE -1 'new control CASE -1 'new control
EXIT DO EXIT DO
CASE -1024 CASE -1024
@ -3579,6 +3626,9 @@ SUB SaveForm (ExitToQB64 AS _BYTE, SaveOnlyFrm AS _BYTE)
IF PreviewControls(i).Padding > 0 THEN IF PreviewControls(i).Padding > 0 THEN
PRINT #TextFileNum, " Control(__UI_NewID).Padding = " + LTRIM$(STR$(PreviewControls(i).Padding)) PRINT #TextFileNum, " Control(__UI_NewID).Padding = " + LTRIM$(STR$(PreviewControls(i).Padding))
END IF END IF
IF PreviewControls(i).BorderThickness > 0 THEN
PRINT #TextFileNum, " Control(__UI_NewID).BorderThickness = " + LTRIM$(STR$(PreviewControls(i).BorderThickness))
END IF
IF PreviewControls(i).Encoding > 0 THEN IF PreviewControls(i).Encoding > 0 THEN
PRINT #TextFileNum, " Control(__UI_NewID).Encoding = " + LTRIM$(STR$(PreviewControls(i).Encoding)) PRINT #TextFileNum, " Control(__UI_NewID).Encoding = " + LTRIM$(STR$(PreviewControls(i).Encoding))
END IF END IF

View file

@ -497,6 +497,15 @@ SUB __UI_LoadForm
SetCaption __UI_NewID, "Has border" SetCaption __UI_NewID, "Has border"
Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).CanHaveFocus = True
__UI_NewID = __UI_NewControl(__UI_Type_TextBox, "ThicknessTB", 61, 20, 132, 34, __UI_GetID("ControlToggles"))
Text(__UI_NewID) = "1"
ToolTip(__UI_NewID) = "Border thickness"
Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).NumericOnly = __UI_NumericWithBounds
Control(__UI_NewID).Min = 1
Control(__UI_NewID).Max = 10
Control(__UI_NewID).CanHaveFocus = True
__UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "ShowPercentage", 181, 20, 12, 56, __UI_GetID("ControlToggles")) __UI_NewID = __UI_NewControl(__UI_Type_CheckBox, "ShowPercentage", 181, 20, 12, 56, __UI_GetID("ControlToggles"))
SetCaption __UI_NewID, "Show percentage" SetCaption __UI_NewID, "Show percentage"
Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).CanHaveFocus = True
@ -565,7 +574,7 @@ SUB __UI_LoadForm
__UI_NewID = __UI_NewControl(__UI_Type_TextBox, "RedValue", 36, 23, 530, 20, __UI_GetID("ColorMixer")) __UI_NewID = __UI_NewControl(__UI_Type_TextBox, "RedValue", 36, 23, 530, 20, __UI_GetID("ColorMixer"))
Control(__UI_NewID).BorderColor = _RGB32(255, 0, 0) Control(__UI_NewID).BorderColor = _RGB32(255, 0, 0)
Control(__UI_NewID).HasBorder = 1 Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).CanHaveFocus = True
Control(__UI_NewID).NumericOnly = __UI_NumericWithBounds Control(__UI_NewID).NumericOnly = __UI_NumericWithBounds
Control(__UI_NewID).Min = 0 Control(__UI_NewID).Min = 0
@ -578,7 +587,7 @@ SUB __UI_LoadForm
__UI_NewID = __UI_NewControl(__UI_Type_TextBox, "GreenValue", 36, 23, 530, 70, __UI_GetID("ColorMixer")) __UI_NewID = __UI_NewControl(__UI_Type_TextBox, "GreenValue", 36, 23, 530, 70, __UI_GetID("ColorMixer"))
Control(__UI_NewID).BorderColor = _RGB32(0, 180, 0) Control(__UI_NewID).BorderColor = _RGB32(0, 180, 0)
Control(__UI_NewID).HasBorder = 1 Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).CanHaveFocus = True
Control(__UI_NewID).NumericOnly = __UI_NumericWithBounds Control(__UI_NewID).NumericOnly = __UI_NumericWithBounds
Control(__UI_NewID).Min = 0 Control(__UI_NewID).Min = 0
@ -591,7 +600,7 @@ SUB __UI_LoadForm
__UI_NewID = __UI_NewControl(__UI_Type_TextBox, "BlueValue", 36, 23, 530, 117, __UI_GetID("ColorMixer")) __UI_NewID = __UI_NewControl(__UI_Type_TextBox, "BlueValue", 36, 23, 530, 117, __UI_GetID("ColorMixer"))
Control(__UI_NewID).BorderColor = _RGB32(0, 0, 255) Control(__UI_NewID).BorderColor = _RGB32(0, 0, 255)
Control(__UI_NewID).HasBorder = 1 Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).CanHaveFocus = True Control(__UI_NewID).CanHaveFocus = True
Control(__UI_NewID).NumericOnly = __UI_NumericWithBounds Control(__UI_NewID).NumericOnly = __UI_NumericWithBounds
Control(__UI_NewID).Min = 0 Control(__UI_NewID).Min = 0
@ -826,4 +835,5 @@ SUB __UI_AssignIDs
PasteListBT = __UI_GetID("PasteListBT") PasteListBT = __UI_GetID("PasteListBT")
EditMenuConvertType = __UI_GetID("EditMenuConvertType") EditMenuConvertType = __UI_GetID("EditMenuConvertType")
AutoSize = __UI_GetID("AutoSize") AutoSize = __UI_GetID("AutoSize")
ThicknessTB = __UI_GetID("ThicknessTB")
END SUB END SUB

View file

@ -256,8 +256,9 @@ SUB __UI_BeforeUpdateDisplay
END IF END IF
SELECT CASE tempType SELECT CASE tempType
CASE __UI_Type_ListBox 'CASE __UI_Type_ListBox
Control(TempValue).HasBorder = True ' Control(TempValue).HasBorder = True
' Control(TempValue).BorderThickness = 1
CASE __UI_Type_ProgressBar CASE __UI_Type_ProgressBar
SetCaption TempValue, "\#" SetCaption TempValue, "\#"
END SELECT END SELECT
@ -847,11 +848,21 @@ SUB __UI_BeforeUpdateDisplay
IF TotalLockedControls THEN IF TotalLockedControls THEN
FOR j = 1 TO TotalLockedControls FOR j = 1 TO TotalLockedControls
Control(LockedControls(j)).HasBorder = CVI(b$) Control(LockedControls(j)).HasBorder = CVI(b$)
IF CVI(b$) THEN
IF Control(LockedControls(j)).BorderThickness = 0 THEN
Control(LockedControls(j)).BorderThickness = 1
END IF
END IF
NEXT NEXT
ELSE ELSE
FOR i = 1 TO UBOUND(Control) FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN IF Control(i).ControlIsSelected THEN
Control(i).HasBorder = CVI(b$) Control(i).HasBorder = CVI(b$)
IF CVI(b$) THEN
IF Control(i).BorderThickness = 0 THEN
Control(i).BorderThickness = 1
END IF
END IF
END IF END IF
NEXT NEXT
END IF END IF
@ -1191,6 +1202,20 @@ SUB __UI_BeforeUpdateDisplay
END IF END IF
NEXT NEXT
END IF END IF
CASE 40 'BorderThickness
b$ = ReadSequential$(Property$, 2)
TempValue = CVI(b$)
IF TotalLockedControls THEN
FOR j = 1 TO TotalLockedControls
Control(LockedControls(j)).BorderThickness = TempValue
NEXT
ELSEIF __UI_TotalSelectedControls > 0 THEN
FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN
Control(i).BorderThickness = TempValue
END IF
NEXT
END IF
CASE 201 TO 210 CASE 201 TO 210
'Alignment commands 'Alignment commands
b$ = ReadSequential$(Property$, 2) b$ = ReadSequential$(Property$, 2)
@ -2178,6 +2203,9 @@ SUB LoadPreview (Destination AS _BYTE)
IF LogFileLoad THEN PRINT #LogFileNum, "BACKSTYLE:TRANSPARENT" IF LogFileLoad THEN PRINT #LogFileNum, "BACKSTYLE:TRANSPARENT"
CASE -12 CASE -12
Control(TempValue).HasBorder = True Control(TempValue).HasBorder = True
IF Control(TempValue).BorderThickness = 0 THEN
Control(TempValue).BorderThickness = 1
END IF
IF LogFileLoad THEN PRINT #LogFileNum, "HASBORDER" IF LogFileLoad THEN PRINT #LogFileNum, "HASBORDER"
CASE -13 CASE -13
IF NOT Disk THEN b$ = ReadSequential$(Clip$, 1) ELSE b$ = SPACE$(1): GET #BinaryFileNum, , b$ IF NOT Disk THEN b$ = ReadSequential$(Clip$, 1) ELSE b$ = SPACE$(1): GET #BinaryFileNum, , b$
@ -2273,6 +2301,10 @@ SUB LoadPreview (Destination AS _BYTE)
Control(TempValue).AutoScroll = True Control(TempValue).AutoScroll = True
CASE -42 CASE -42
Control(TempValue).AutoSize = True Control(TempValue).AutoSize = True
CASE -43
IF NOT Disk THEN b$ = ReadSequential$(Clip$, 2) ELSE b$ = SPACE$(2): GET #BinaryFileNum, , b$
Control(TempValue).BorderThickness = CVI(b$)
IF LogFileLoad THEN PRINT #LogFileNum, "BORDER THICKNESS" + STR$(CVI(b$))
CASE -1 'new control CASE -1 'new control
IF LogFileLoad THEN PRINT #LogFileNum, "READ NEW CONTROL: -1" IF LogFileLoad THEN PRINT #LogFileNum, "READ NEW CONTROL: -1"
EXIT DO EXIT DO
@ -2473,7 +2505,12 @@ SUB LoadPreviewText
Control(TempValue).BackStyle = __UI_Transparent Control(TempValue).BackStyle = __UI_Transparent
END IF END IF
CASE "HasBorder" CASE "HasBorder"
Control(TempValue).HasBorder = (DummyText$ = "True") IF DummyText$ = "True" THEN
Control(TempValue).HasBorder = True
IF Control(TempValue).BorderThickness = 0 THEN
Control(TempValue).BorderThickness = 1
END IF
END IF
CASE "Align" CASE "Align"
SELECT CASE DummyText$ SELECT CASE DummyText$
CASE "__UI_Center": Control(TempValue).Align = __UI_Center CASE "__UI_Center": Control(TempValue).Align = __UI_Center
@ -2517,6 +2554,8 @@ SUB LoadPreviewText
Control(TempValue).CanResize = (DummyText$ = "True") Control(TempValue).CanResize = (DummyText$ = "True")
CASE "Padding" CASE "Padding"
Control(TempValue).Padding = VAL(DummyText$) Control(TempValue).Padding = VAL(DummyText$)
CASE "BorderThickness"
Control(TempValue).BorderThickness = VAL(DummyText$)
CASE "VAlign" CASE "VAlign"
SELECT CASE DummyText$ SELECT CASE DummyText$
CASE "__UI_Middle": Control(TempValue).VAlign = __UI_Middle CASE "__UI_Middle": Control(TempValue).VAlign = __UI_Middle
@ -2996,6 +3035,10 @@ SUB SavePreview (Destination AS _BYTE)
Clip$ = Clip$ + b$ Clip$ = Clip$ + b$
END IF END IF
END IF END IF
IF Control(i).BorderThickness > 0 THEN
b$ = MKI$(-43) + MKI$(Control(i).BorderThickness)
IF Disk THEN PUT #BinFileNum, , b$ ELSE Clip$ = Clip$ + b$
END IF
END IF END IF
NEXT NEXT
NEXT NEXT

View file

@ -78,5 +78,6 @@ FOR EACH CONTROL (FORM INCLUDED):
For ListBox controls For ListBox controls
INTEGER -42 (AutoSize = True) INTEGER -42 (AutoSize = True)
For Label controls For Label controls
INTEGER -43 (BorderThickness) + INTEGER .BorderThickness
------------------- -------------------
INTEGER -1024 (End of file) INTEGER -1024 (End of file)

View file

@ -764,7 +764,7 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A
TempCaption$ = __UI_TrimAt0$(Caption(This.ID)) TempCaption$ = __UI_TrimAt0$(Caption(This.ID))
CaptionIndent = 0 CaptionIndent = 0
IF This.HasBorder THEN CaptionIndent = 5 IF This.HasBorder THEN CaptionIndent = 5 + This.BorderThickness
IF NOT This.Disabled AND (LEN(Text(This.ID)) OR This.Multiline) THEN IF NOT This.Disabled AND (LEN(Text(This.ID)) OR This.Multiline) THEN
COLOR This.ForeColor, This.BackColor COLOR This.ForeColor, This.BackColor
@ -934,9 +934,11 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A
END IF END IF
IF This.HasBorder = True THEN IF This.HasBorder = True THEN
LINE (0, 0)-STEP(This.Width - 1, This.Height - 1), This.BorderColor, B IF This.BorderThickness > __UI_MaxBorderThickness THEN
ELSEIF This.HasBorder > 0 THEN This.BorderThickness = __UI_MaxBorderThickness
FOR i = 0 TO This.HasBorder END IF
FOR i = 0 TO This.BorderThickness - 1
LINE (i, i)-STEP(This.Width - 1 - i * 2, This.Height - 1 - i * 2), This.BorderColor, B LINE (i, i)-STEP(This.Width - 1 - i * 2, This.Height - 1 - i * 2), This.BorderColor, B
NEXT NEXT
END IF END IF