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

Adds new .BulletStyle property to UiEditor.

This commit is contained in:
FellippeHeitor 2018-05-22 23:53:48 -03:00
parent 600026a3c2
commit 3cc23a2965
3 changed files with 53 additions and 2 deletions

View file

@ -104,6 +104,7 @@ DIM SHARED ValueTB AS LONG, MinTB AS LONG
DIM SHARED MaxTB AS LONG, IntervalTB AS LONG
DIM SHARED MinIntervalTB AS LONG, PaddingTB AS LONG
DIM SHARED MaskTB AS LONG, MaskLB AS LONG
DIM SHARED BulletOptions AS LONG, BulletOptionsLB AS LONG
'------------------------------------------------------------------------------
'Other shared variables:
@ -1456,6 +1457,7 @@ SUB __UI_BeforeUpdateDisplay
Control(PasswordMaskCB).Value = PreviewControls(FirstSelected).PasswordField
Control(AlignOptions).Value = PreviewControls(FirstSelected).Align + 1
Control(VAlignOptions).Value = PreviewControls(FirstSelected).VAlign + 1
Control(BulletOptions).Value = PreviewControls(FirstSelected).BulletStyle + 1
Control(Transparent).Value = PreviewControls(FirstSelected).BackStyle
Control(Resizable).Value = PreviewControls(FirstSelected).CanResize
@ -1471,6 +1473,7 @@ SUB __UI_BeforeUpdateDisplay
Control(PasswordMaskCB).Disabled = True
Control(AlignOptions).Disabled = True
Control(VAlignOptions).Disabled = True
Control(BulletOptions).Disabled = True
Control(Transparent).Disabled = True
Caption(TextLB) = "Text"
Control(Resizable).Disabled = True
@ -1513,7 +1516,7 @@ SUB __UI_BeforeUpdateDisplay
CASE __UI_Type_MenuItem
FOR i = 1 TO UBOUND(InputBox)
SELECT CASE InputBox(i).ID
CASE NameTB, CaptionTB, TextTB, TooltipTB, ValueTB
CASE NameTB, CaptionTB, TextTB, TooltipTB, ValueTB, BulletOptions
Control(InputBox(i).ID).Disabled = False
CASE ELSE
Control(InputBox(i).ID).Disabled = True
@ -1839,6 +1842,7 @@ SUB __UI_OnLoad
i = i + 1: InputBox(i).ID = PaddingTB: InputBox(i).LabelID = PaddingLeftrightLB: InputBox(i).Signal = 31
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 = BulletOptions: InputBox(i).LabelID = BulletOptionsLB
REDIM _PRESERVE InputBox(1 TO i) AS newInputBox
REDIM InputBoxText(1 TO i) AS STRING
@ -2208,6 +2212,9 @@ SUB __UI_ValueChanged (id AS LONG)
CASE VAlignOptions
b$ = MKI$(Control(VAlignOptions).Value - 1)
SendData b$, 32
CASE BulletOptions
b$ = MKI$(Control(BulletOptions).Value - 1)
SendData b$, 37
CASE Red
Text(RedValue) = LTRIM$(STR$(Control(Red).Value))
CASE Green
@ -6119,6 +6126,10 @@ SUB LoadPreview
PreviewControls(Dummy).NumericOnly = True
CASE -39
PreviewControls(Dummy).NumericOnly = __UI_NumericWithBounds
CASE -40
b$ = SPACE$(2)
GET #BinaryFileNum, , b$
PreviewControls(Dummy).BulletStyle = CVI(b$)
CASE -1 'new control
EXIT DO
CASE -1024
@ -6532,6 +6543,12 @@ SUB SaveForm (ExitToQB64 AS _BYTE, SaveOnlyFrm AS _BYTE)
ELSEIF PreviewControls(i).NumericOnly = __UI_NumericWithBounds THEN
PRINT #TextFileNum, " Control(__UI_NewID).NumericOnly = __UI_NumericWithBounds"
END IF
IF PreviewControls(i).BulletStyle > 0 THEN
SELECT CASE PreviewControls(i).BulletStyle
CASE __UI_Bullet
PRINT #TextFileNum, " Control(__UI_NewID).BulletStyle = __UI_Bullet"
END SELECT
END IF
PRINT #TextFileNum,
END IF
EndOfThisPass:

View file

@ -420,6 +420,18 @@ SUB __UI_LoadForm
Control(__UI_NewID).Value = 1
Control(__UI_NewID).CanHaveFocus = True
__UI_NewID = __UI_NewControl(__UI_Type_Label, "BulletOptionsLB", 120, 23, 10, 340, __UI_GetID("ControlProperties"))
SetCaption __UI_NewID, "Marker style"
Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).VAlign = __UI_Middle
__UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "BulletOptions", 230, 23, 129, 340, __UI_GetID("ControlProperties"))
AddItem __UI_NewID, "Check mark"
AddItem __UI_NewID, "Bullet"
Control(__UI_NewID).HasBorder = True
Control(__UI_NewID).Value = 1
Control(__UI_NewID).CanHaveFocus = True
__UI_NewID = __UI_NewControl(__UI_Type_Label, "VerticalAlignLB", 120, 23, 10, 362, __UI_GetID("ControlProperties"))
SetCaption __UI_NewID, "Vertical align"
Control(__UI_NewID).HasBorder = True
@ -748,4 +760,6 @@ SUB __UI_AssignIDs
MaskTB = __UI_GetID("MaskTB")
MaskLB = __UI_GetID("MaskLB")
ControlToggles = __UI_GetID("ControlToggles")
BulletOptions = __UI_GetID("BulletOptions")
BulletOptionsLB = __UI_GetID("BulletOptionsLB")
END SUB

View file

@ -873,6 +873,13 @@ SUB __UI_BeforeUpdateDisplay
Control(i).MinInterval = _CV(_FLOAT, b$)
END IF
NEXT
CASE 37 'BulletStyle
b$ = SPACE$(2): GET #UiEditorFile, OffsetPropertyValue, b$
FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN
Control(i).BulletStyle = CVI(b$)
END IF
NEXT
CASE 201 TO 210
'Alignment commands
DoAlign TempValue
@ -2054,6 +2061,12 @@ SUB LoadPreviewText
ELSEIF DummyText$ = "__UI_NumericWithBounds" THEN
Control(TempValue).NumericOnly = __UI_NumericWithBounds
END IF
CASE "BulletStyle"
IF DummyText$ = "__UI_CheckMark" THEN
Control(TempValue).BulletStyle = __UI_CheckMark
ELSEIF DummyText$ = "__UI_Bullet" THEN
Control(TempValue).BulletStyle = __UI_Bullet
END IF
END SELECT
ELSEIF b$ = "__UI_DefaultButtonID = __UI_NewID" THEN
__UI_DefaultButtonID = TempValue
@ -2446,7 +2459,14 @@ SUB SavePreview (Destination AS _BYTE)
Clip$ = Clip$ + b$
END IF
END IF
IF Control(i).BulletStyle = __UI_Bullet THEN
b$ = MKI$(-40) + MKI$(Control(i).BulletStyle)
IF Disk THEN
PUT #BinFileNum, , b$
ELSE
Clip$ = Clip$ + b$
END IF
END IF
END IF
NEXT
b$ = MKI$(-1024) 'end of file