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

Enhances "Align vertically" to consider the menu bar height, if any.

Closes #58
This commit is contained in:
FellippeHeitor 2018-06-16 19:54:47 -03:00
parent 6821e5c429
commit 52de6bae6d
2 changed files with 32 additions and 33 deletions

View file

@ -206,7 +206,7 @@ DIM SHARED __UI_SnappedX AS INTEGER, __UI_SnappedY AS INTEGER
DIM SHARED __UI_SnappedXID AS LONG, __UI_SnappedYID AS LONG 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$ DIM SHARED __UI_ClipboardCheck$, __UI_MenuBarOffsetV 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
@ -816,9 +816,12 @@ SUB __UI_ProcessInput
IF __UI_HasMenuBar = True THEN IF __UI_HasMenuBar = True THEN
'Add menubar div to main form's canvas 'Add menubar div to main form's canvas
_FONT Control(__UI_FormID).Font _FONT Control(__UI_FormID).Font
LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80) __UI_MenuBarOffsetV = falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2
LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120) LINE (0, __UI_MenuBarOffsetV - 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80)
LINE (0, __UI_MenuBarOffsetV)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120)
__UI_RefreshMenuBar __UI_RefreshMenuBar
ELSE
__UI_MenuBarOffsetV = 0
END IF END IF
_DEST 0 _DEST 0
@ -890,8 +893,11 @@ SUB __UI_UpdateDisplay
CLS CLS
IF __UI_HasMenuBar THEN IF __UI_HasMenuBar THEN
_FONT Control(__UI_FormID).Font _FONT Control(__UI_FormID).Font
__UI_MenuBarOffsetV = falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2
LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80) LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80)
LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120) LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120)
ELSE
__UI_MenuBarOffsetV = 0
END IF END IF
_DEST 0 _DEST 0
END IF END IF
@ -2655,11 +2661,11 @@ SUB __UI_EventDispatcher
END IF END IF
'Middle of form: 'Middle of form:
YSnapOffset = ABS((Control(__UI_FormID).Height / 2) - (Control(__UI_DraggingID).Top + Control(__UI_DraggingID).Height / 2)) YSnapOffset = ABS(((Control(__UI_FormID).Height - __UI_MenuBarOffsetV) / 2 + __UI_MenuBarOffsetV) - (Control(__UI_DraggingID).Top + Control(__UI_DraggingID).Height / 2))
IF YSnapOffset < 5 AND MouseYOffset < 10 THEN IF YSnapOffset < 5 AND MouseYOffset < 10 THEN
Control(__UI_DraggingID).Top = Control(__UI_FormID).Height / 2 - Control(__UI_DraggingID).Height / 2 Control(__UI_DraggingID).Top = (Control(__UI_FormID).Height - __UI_MenuBarOffsetV) / 2 + __UI_MenuBarOffsetV - Control(__UI_DraggingID).Height / 2
__UI_Snapped = True __UI_Snapped = True
__UI_SnappedY = Control(__UI_FormID).Height / 2 __UI_SnappedY = (Control(__UI_FormID).Height - __UI_MenuBarOffsetV) / 2 + __UI_MenuBarOffsetV
END IF END IF
'Center of form: 'Center of form:
@ -4235,6 +4241,7 @@ FUNCTION __UI_NewControl (ControlType AS INTEGER, ControlName AS STRING, NewWidt
COLOR Control(__UI_FormID).ForeColor, Control(__UI_FormID).BackColor COLOR Control(__UI_FormID).ForeColor, Control(__UI_FormID).BackColor
CLS CLS
IF Control(__UI_FormID).Font THEN _FONT Control(__UI_FormID).Font IF Control(__UI_FormID).Font THEN _FONT Control(__UI_FormID).Font
__UI_MenuBarOffsetV = falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2
LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80) LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80)
LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120) LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120)
_DEST 0 _DEST 0

View file

@ -196,17 +196,21 @@ SUB __UI_BeforeUpdateDisplay
Stream$ = Stream$ + incomingData$ Stream$ = Stream$ + incomingData$
DIM ThisContainer AS LONG, TempWidth AS INTEGER, TempHeight AS INTEGER DIM ThisContainer AS LONG, TempWidth AS INTEGER, TempHeight AS INTEGER
DIM TempTop AS INTEGER
IF Control(Control(__UI_FirstSelectedID).ParentID).Type = __UI_Type_Frame THEN IF Control(Control(__UI_FirstSelectedID).ParentID).Type = __UI_Type_Frame THEN
ThisContainer = Control(__UI_FirstSelectedID).ParentID ThisContainer = Control(__UI_FirstSelectedID).ParentID
TempWidth = Control(Control(__UI_FirstSelectedID).ParentID).Width TempWidth = Control(Control(__UI_FirstSelectedID).ParentID).Width
TempHeight = Control(Control(__UI_FirstSelectedID).ParentID).Height TempHeight = Control(Control(__UI_FirstSelectedID).ParentID).Height
TempTop = TempHeight \ 2
ELSEIF Control(__UI_FirstSelectedID).Type = __UI_Type_Frame THEN ELSEIF Control(__UI_FirstSelectedID).Type = __UI_Type_Frame THEN
ThisContainer = Control(__UI_FirstSelectedID).ID ThisContainer = Control(__UI_FirstSelectedID).ID
TempWidth = Control(__UI_FirstSelectedID).Width TempWidth = Control(__UI_FirstSelectedID).Width
TempHeight = Control(__UI_FirstSelectedID).Height TempHeight = Control(__UI_FirstSelectedID).Height
TempTop = TempHeight \ 2
ELSE ELSE
TempWidth = Control(__UI_FormID).Width TempWidth = Control(__UI_FormID).Width
TempHeight = Control(__UI_FormID).Height TempHeight = Control(__UI_FormID).Height
TempTop = (TempHeight - __UI_MenuBarOffsetV) \ 2 + __UI_MenuBarOffsetV
END IF END IF
DIM thisData$, thisCommand$ DIM thisData$, thisCommand$
@ -244,31 +248,31 @@ SUB __UI_BeforeUpdateDisplay
SaveUndoImage SaveUndoImage
SELECT CASE TempValue SELECT CASE TempValue
CASE __UI_Type_Button CASE __UI_Type_Button
TempValue = __UI_NewControl(__UI_Type_Button, "", 80, 23, TempWidth \ 2 - 40, TempHeight \ 2 - 12, ThisContainer) TempValue = __UI_NewControl(__UI_Type_Button, "", 80, 23, TempWidth \ 2 - 40, TempTop - 12, ThisContainer)
SetCaption TempValue, RTRIM$(Control(TempValue).Name) SetCaption TempValue, RTRIM$(Control(TempValue).Name)
CASE __UI_Type_Label CASE __UI_Type_Label
TempValue = __UI_NewControl(TempValue, "", 150, 23, TempWidth \ 2 - 75, TempHeight \ 2 - 12, ThisContainer) TempValue = __UI_NewControl(TempValue, "", 150, 23, TempWidth \ 2 - 75, TempTop - 12, ThisContainer)
SetCaption TempValue, RTRIM$(Control(TempValue).Name) SetCaption TempValue, RTRIM$(Control(TempValue).Name)
AutoSizeLabel Control(TempValue) AutoSizeLabel Control(TempValue)
CASE __UI_Type_CheckBox, __UI_Type_RadioButton CASE __UI_Type_CheckBox, __UI_Type_RadioButton
TempValue = __UI_NewControl(TempValue, "", 150, 23, TempWidth \ 2 - 75, TempHeight \ 2 - 12, ThisContainer) TempValue = __UI_NewControl(TempValue, "", 150, 23, TempWidth \ 2 - 75, TempTop - 12, ThisContainer)
SetCaption TempValue, RTRIM$(Control(TempValue).Name) SetCaption TempValue, RTRIM$(Control(TempValue).Name)
CASE __UI_Type_TextBox CASE __UI_Type_TextBox
TempValue = __UI_NewControl(__UI_Type_TextBox, "", 120, 23, TempWidth \ 2 - 60, TempHeight \ 2 - 12, ThisContainer) TempValue = __UI_NewControl(__UI_Type_TextBox, "", 120, 23, TempWidth \ 2 - 60, TempTop - 12, ThisContainer)
SetCaption TempValue, RTRIM$(Control(TempValue).Name) SetCaption TempValue, RTRIM$(Control(TempValue).Name)
CASE __UI_Type_ListBox CASE __UI_Type_ListBox
TempValue = __UI_NewControl(__UI_Type_ListBox, "", 200, 200, TempWidth \ 2 - 100, TempHeight \ 2 - 100, ThisContainer) TempValue = __UI_NewControl(__UI_Type_ListBox, "", 200, 200, TempWidth \ 2 - 100, TempTop - 100, ThisContainer)
Control(TempValue).HasBorder = True Control(TempValue).HasBorder = True
CASE __UI_Type_DropdownList CASE __UI_Type_DropdownList
TempValue = __UI_NewControl(__UI_Type_DropdownList, "", 200, 23, TempWidth \ 2 - 100, TempHeight \ 2 - 12, ThisContainer) TempValue = __UI_NewControl(__UI_Type_DropdownList, "", 200, 23, TempWidth \ 2 - 100, TempTop - 12, ThisContainer)
CASE __UI_Type_TrackBar CASE __UI_Type_TrackBar
TempValue = __UI_NewControl(__UI_Type_TrackBar, "", 300, 45, TempWidth \ 2 - 150, TempHeight \ 2 - 23, ThisContainer) TempValue = __UI_NewControl(__UI_Type_TrackBar, "", 300, 45, TempWidth \ 2 - 150, TempTop - 23, ThisContainer)
CASE __UI_Type_ProgressBar CASE __UI_Type_ProgressBar
TempValue = __UI_NewControl(__UI_Type_ProgressBar, "", 300, 23, TempWidth \ 2 - 150, TempHeight \ 2 - 12, ThisContainer) TempValue = __UI_NewControl(__UI_Type_ProgressBar, "", 300, 23, TempWidth \ 2 - 150, TempTop - 12, ThisContainer)
CASE __UI_Type_PictureBox CASE __UI_Type_PictureBox
TempValue = __UI_NewControl(TempValue, "", 230, 150, TempWidth \ 2 - 115, TempHeight \ 2 - 75, ThisContainer) TempValue = __UI_NewControl(TempValue, "", 230, 150, TempWidth \ 2 - 115, TempTop - 75, ThisContainer)
CASE __UI_Type_Frame CASE __UI_Type_Frame
TempValue = __UI_NewControl(TempValue, "", 230, 150, TempWidth \ 2 - 115, TempHeight \ 2 - 75, 0) TempValue = __UI_NewControl(TempValue, "", 230, 150, TempWidth \ 2 - 115, TempTop - 75, 0)
SetCaption TempValue, RTRIM$(Control(TempValue).Name) SetCaption TempValue, RTRIM$(Control(TempValue).Name)
CASE __UI_Type_MenuBar CASE __UI_Type_MenuBar
TempValue = AddNewMenuBarControl TempValue = AddNewMenuBarControl
@ -279,7 +283,7 @@ SUB __UI_BeforeUpdateDisplay
__UI_ActivateMenu Control(__UI_ParentMenu), False __UI_ActivateMenu Control(__UI_ParentMenu), False
END IF END IF
CASE __UI_Type_ToggleSwitch CASE __UI_Type_ToggleSwitch
TempValue = __UI_NewControl(TempValue, "", 40, 17, TempWidth \ 2 - 20, TempHeight \ 2 - 8, ThisContainer) TempValue = __UI_NewControl(TempValue, "", 40, 17, TempWidth \ 2 - 20, TempTop - 8, ThisContainer)
END SELECT END SELECT
IF __UI_ActiveMenu > 0 AND (Control(TempValue).Type <> __UI_Type_MenuBar AND Control(TempValue).Type <> __UI_Type_MenuItem) THEN IF __UI_ActiveMenu > 0 AND (Control(TempValue).Type <> __UI_Type_MenuBar AND Control(TempValue).Type <> __UI_Type_MenuItem) THEN
__UI_DestroyControl Control(__UI_ActiveMenu) __UI_DestroyControl Control(__UI_ActiveMenu)
@ -967,7 +971,7 @@ SUB __UI_BeforeUpdateDisplay
__UI_KeyPress TempValue __UI_KeyPress TempValue
CASE 222 'New textbox control with the NumericOnly property set to true CASE 222 'New textbox control with the NumericOnly property set to true
b$ = ReadSequential$(Property$, 2) b$ = ReadSequential$(Property$, 2)
TempValue = __UI_NewControl(__UI_Type_TextBox, "", 120, 23, TempWidth \ 2 - 60, TempHeight \ 2 - 12, ThisContainer) TempValue = __UI_NewControl(__UI_Type_TextBox, "", 120, 23, TempWidth \ 2 - 60, TempTop - 12, ThisContainer)
Control(TempValue).Name = "Numeric" + Control(TempValue).Name Control(TempValue).Name = "Numeric" + Control(TempValue).Name
SetCaption TempValue, RTRIM$(Control(TempValue).Name) SetCaption TempValue, RTRIM$(Control(TempValue).Name)
Control(TempValue).NumericOnly = True Control(TempValue).NumericOnly = True
@ -1199,7 +1203,6 @@ SUB DoAlign (AlignMode AS INTEGER)
NEXT NEXT
FOR i = 1 TO UBOUND(Control) FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN IF Control(i).ControlIsSelected THEN
__UI_Click 0 'Force the preview to inform it was edited
Control(i).Left = LeftMost Control(i).Left = LeftMost
END IF END IF
NEXT NEXT
@ -1214,7 +1217,6 @@ SUB DoAlign (AlignMode AS INTEGER)
NEXT NEXT
FOR i = 1 TO UBOUND(Control) FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN IF Control(i).ControlIsSelected THEN
__UI_Click 0 'Force the preview to inform it was edited
Control(i).Left = RightMost - (Control(i).Width - 1) Control(i).Left = RightMost - (Control(i).Width - 1)
END IF END IF
NEXT NEXT
@ -1229,7 +1231,6 @@ SUB DoAlign (AlignMode AS INTEGER)
NEXT NEXT
FOR i = 1 TO UBOUND(Control) FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN IF Control(i).ControlIsSelected THEN
__UI_Click 0 'Force the preview to inform it was edited
Control(i).Top = TopMost Control(i).Top = TopMost
END IF END IF
NEXT NEXT
@ -1244,7 +1245,6 @@ SUB DoAlign (AlignMode AS INTEGER)
NEXT NEXT
FOR i = 1 TO UBOUND(Control) FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN IF Control(i).ControlIsSelected THEN
__UI_Click 0 'Force the preview to inform it was edited
Control(i).Top = BottomMost - (Control(i).Height - 1) Control(i).Top = BottomMost - (Control(i).Height - 1)
END IF END IF
NEXT NEXT
@ -1267,7 +1267,6 @@ SUB DoAlign (AlignMode AS INTEGER)
NewTopMost = TopMost + SelectionHeight / 2 NewTopMost = TopMost + SelectionHeight / 2
FOR i = 1 TO UBOUND(Control) FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN IF Control(i).ControlIsSelected THEN
__UI_Click 0 'Force the preview to inform it was edited
Control(i).Top = NewTopMost - Control(i).Height / 2 Control(i).Top = NewTopMost - Control(i).Height / 2
END IF END IF
NEXT NEXT
@ -1290,7 +1289,6 @@ SUB DoAlign (AlignMode AS INTEGER)
NewLeftMost = LeftMost + SelectionWidth / 2 NewLeftMost = LeftMost + SelectionWidth / 2
FOR i = 1 TO UBOUND(Control) FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN IF Control(i).ControlIsSelected THEN
__UI_Click 0 'Force the preview to inform it was edited
Control(i).Left = NewLeftMost - Control(i).Width / 2 Control(i).Left = NewLeftMost - Control(i).Width / 2
END IF END IF
NEXT NEXT
@ -1298,7 +1296,7 @@ SUB DoAlign (AlignMode AS INTEGER)
CASE 207 'Center vertically to form CASE 207 'Center vertically to form
IF __UI_TotalSelectedControls = 1 THEN IF __UI_TotalSelectedControls = 1 THEN
IF Control(__UI_FirstSelectedID).ParentID = 0 THEN IF Control(__UI_FirstSelectedID).ParentID = 0 THEN
Control(__UI_FirstSelectedID).Top = Control(__UI_FormID).Height / 2 - Control(__UI_FirstSelectedID).Height / 2 Control(__UI_FirstSelectedID).Top = (Control(__UI_FormID).Height - __UI_MenuBarOffsetV) / 2 - Control(__UI_FirstSelectedID).Height / 2 + __UI_MenuBarOffsetV
ELSE ELSE
Control(__UI_FirstSelectedID).Top = Control(Control(__UI_FirstSelectedID).ParentID).Height / 2 - Control(__UI_FirstSelectedID).Height / 2 Control(__UI_FirstSelectedID).Top = Control(Control(__UI_FirstSelectedID).ParentID).Height / 2 - Control(__UI_FirstSelectedID).Height / 2
END IF END IF
@ -1311,22 +1309,20 @@ SUB DoAlign (AlignMode AS INTEGER)
BottomMost = 0 BottomMost = 0
FOR i = 1 TO UBOUND(Control) FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN IF Control(i).ControlIsSelected THEN
__UI_Click 0 'Force the preview to inform it was edited
IF Control(i).Top < TopMost THEN TopMost = Control(i).Top IF Control(i).Top < TopMost THEN TopMost = Control(i).Top
IF Control(i).Top + Control(i).Height - 1 > BottomMost THEN BottomMost = Control(i).Top + Control(i).Height - 1 IF Control(i).Top + Control(i).Height - 1 > BottomMost THEN BottomMost = Control(i).Top + Control(i).Height - 1
END IF END IF
NEXT NEXT
SelectionHeight = BottomMost - TopMost SelectionHeight = BottomMost - TopMost
IF Control(__UI_FirstSelectedID).ParentID = 0 THEN IF Control(__UI_FirstSelectedID).ParentID = 0 THEN
NewTopMost = Control(__UI_FormID).Height / 2 - SelectionHeight / 2 NewTopMost = (Control(__UI_FormID).Height - __UI_MenuBarOffsetV) / 2 - SelectionHeight / 2
ELSE ELSE
NewTopMost = Control(Control(__UI_FirstSelectedID).ParentID).Height / 2 - SelectionHeight / 2 NewTopMost = Control(Control(__UI_FirstSelectedID).ParentID).Height / 2 - SelectionHeight / 2
END IF END IF
TopDifference = TopMost - NewTopMost TopDifference = TopMost - NewTopMost
FOR i = 1 TO UBOUND(Control) FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN IF Control(i).ControlIsSelected THEN
__UI_Click 0 'Force the preview to inform it was edited Control(i).Top = Control(i).Top - TopDifference + __UI_MenuBarOffsetV
Control(i).Top = Control(i).Top - TopDifference
END IF END IF
NEXT NEXT
END IF END IF
@ -1359,7 +1355,6 @@ SUB DoAlign (AlignMode AS INTEGER)
LeftDifference = LeftMost - NewLeftMost LeftDifference = LeftMost - NewLeftMost
FOR i = 1 TO UBOUND(Control) FOR i = 1 TO UBOUND(Control)
IF Control(i).ControlIsSelected THEN IF Control(i).ControlIsSelected THEN
__UI_Click 0 'Force the preview to inform it was edited
Control(i).Left = Control(i).Left - LeftDifference Control(i).Left = Control(i).Left - LeftDifference
END IF END IF
NEXT NEXT
@ -1397,7 +1392,6 @@ SUB DoAlign (AlignMode AS INTEGER)
BinSize = TotalSpace \ (__UI_TotalSelectedControls - 1) BinSize = TotalSpace \ (__UI_TotalSelectedControls - 1)
FindTops = Control(SubList(1)).Top - BinSize FindTops = Control(SubList(1)).Top - BinSize
FOR i = 1 TO __UI_TotalSelectedControls FOR i = 1 TO __UI_TotalSelectedControls
__UI_Click 0 'Force the preview to inform it was edited
FindTops = FindTops + BinSize FindTops = FindTops + BinSize
Control(SubList(i)).Top = FindTops Control(SubList(i)).Top = FindTops
FindTops = FindTops + Control(SubList(i)).Height FindTops = FindTops + Control(SubList(i)).Height
@ -1438,7 +1432,6 @@ SUB DoAlign (AlignMode AS INTEGER)
BinSize = TotalSpace \ (__UI_TotalSelectedControls - 1) BinSize = TotalSpace \ (__UI_TotalSelectedControls - 1)
FindLefts = Control(SubList(1)).Left - BinSize FindLefts = Control(SubList(1)).Left - BinSize
FOR i = 1 TO __UI_TotalSelectedControls FOR i = 1 TO __UI_TotalSelectedControls
__UI_Click 0 'Force the preview to inform it was edited
FindLefts = FindLefts + BinSize FindLefts = FindLefts + BinSize
Control(SubList(i)).Left = FindLefts Control(SubList(i)).Left = FindLefts
FindLefts = FindLefts + Control(SubList(i)).Width FindLefts = FindLefts + Control(SubList(i)).Width
@ -1514,7 +1507,6 @@ SUB DeleteSelectedControls
NEXT NEXT
IF didDelete THEN IF didDelete THEN
IF __UI_TotalSelectedControls > 0 THEN __UI_TotalSelectedControls = 0 IF __UI_TotalSelectedControls > 0 THEN __UI_TotalSelectedControls = 0
__UI_Click 0 'Force the preview to inform it was edited
END IF END IF
END SUB END SUB