From 3cc23a2965b7dfe270ab15d59b29e69ce3d69dd0 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Tue, 22 May 2018 23:53:48 -0300 Subject: [PATCH] Adds new .BulletStyle property to UiEditor. --- InForm/UiEditor.bas | 19 ++++++++++++++++++- InForm/UiEditor.frm | 14 ++++++++++++++ InForm/UiEditorPreview.bas | 22 +++++++++++++++++++++- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/InForm/UiEditor.bas b/InForm/UiEditor.bas index 165dc56..3213697 100644 --- a/InForm/UiEditor.bas +++ b/InForm/UiEditor.bas @@ -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: diff --git a/InForm/UiEditor.frm b/InForm/UiEditor.frm index df6317d..7f7bf3d 100644 --- a/InForm/UiEditor.frm +++ b/InForm/UiEditor.frm @@ -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 diff --git a/InForm/UiEditorPreview.bas b/InForm/UiEditorPreview.bas index 791b2b3..4b5350b 100644 --- a/InForm/UiEditorPreview.bas +++ b/InForm/UiEditorPreview.bas @@ -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