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

Fix "CopyOfCopyOf..." control naming issue when copying/pasting. Also:

- Bypass display of position/size panel when the selected control is a menubar/menuitem.
This commit is contained in:
FellippeHeitor 2017-01-08 01:44:53 -02:00
parent 109d822c6e
commit e94cda2a11
3 changed files with 65 additions and 41 deletions

View file

@ -1017,11 +1017,12 @@ SUB __UI_UpdateDisplay
ELSE
_DEST Control(__UI_FormID).HelperCanvas
END IF
OverlayisVisible = True
i = __UI_FirstSelectedID
IF Control(__UI_HoveringID).ControlIsSelected THEN i = __UI_HoveringID
IF Control(i).Type <> __UI_Type_MenuBar AND Control(i).Type <> __UI_Type_MenuItem THEN
OverlayisVisible = True
DIM SizeAndPosition1$, SizeAndPosition2$, pw&
DIM InfoLeft AS INTEGER, InfoTop AS INTEGER
_FONT Control(__UI_FormID).Font
@ -1061,6 +1062,7 @@ SUB __UI_UpdateDisplay
COLOR _RGB32(0, 0, 0)
__UI_PrintString InfoLeft + 3, InfoTop + 3, SizeAndPosition1$
__UI_PrintString InfoLeft + 3, InfoTop + 3 + uspacing&, SizeAndPosition2$
END IF
_DEST 0
END IF
@ -1071,8 +1073,10 @@ SUB __UI_UpdateDisplay
END IF
IF OverlayisVisible THEN
IF Control(__UI_FormID).HelperCanvas < -1 THEN
__UI_MakeHardwareImage Control(__UI_FormID).HelperCanvas
IF Control(__UI_FormID).HelperCanvas < -1 THEN _PUTIMAGE , Control(__UI_FormID).HelperCanvas
_PUTIMAGE , Control(__UI_FormID).HelperCanvas
END IF
END IF
IF __UI_ActiveMenu > 0 AND LEFT$(Control(__UI_ParentMenu).Name, 5) = "__UI_" THEN
@ -3425,6 +3429,7 @@ SUB __UI_EventDispatcher
IF Clip$ = "InForm" + CHR$(1) THEN
DIM PasteID AS LONG, ThisControl AS LONG, FirstToBeSelected AS LONG
DIM TempCanvas AS LONG, TempTop AS INTEGER, TempLeft AS INTEGER
DIM TempName$, OriginalIndex$, c$
j = CVL(MID$(ControlClipboard$, 1, 4))
@ -3446,12 +3451,31 @@ SUB __UI_EventDispatcher
FOR i = 1 TO j
ThisControl = CVL(MID$(Clip$, (i * 4 - 3), 4))
IF Control(ThisControl).ID > 0 AND Control(ThisControl).Type <> __UI_Type_Frame THEN
PasteID = __UI_NewControl(Control(ThisControl).Type, "", 0, 0, 0, 0, 0)
PasteID = __UI_NewControl(Control(ThisControl).Type, "", Control(ThisControl).Width, Control(ThisControl).Height, 0, 0, 0)
TempCanvas = Control(PasteID).Canvas
Control(PasteID) = Control(ThisControl)
Control(PasteID).ID = 0
DO WHILE __UI_GetID(Control(PasteID).Name) > 0
Control(PasteID).Name = "Cp" + Control(PasteID).Name
TempName$ = RTRIM$(Control(PasteID).Name)
c$ = RIGHT$(TempName$, 1)
IF ASC(c$) >= 48 AND ASC(c$) <= 57 THEN
'Update this control's name by the ID # assigned to it, if any
OriginalIndex$ = c$
TempName$ = LEFT$(TempName$, LEN(TempName$) - 1)
DO
c$ = RIGHT$(TempName$, 1)
IF ASC(c$) >= 48 AND ASC(c$) <= 57 THEN
OriginalIndex$ = c$ + OriginalIndex$
TempName$ = LEFT$(TempName$, LEN(TempName$) - 1)
IF LEN(TempName$) = 0 THEN EXIT DO
ELSE
EXIT DO
END IF
LOOP
ELSE
OriginalIndex$ = "1"
END IF
Control(PasteID).Name = TempName$ + LTRIM$(STR$(VAL(OriginalIndex$) + 1))
LOOP
Control(PasteID).ID = PasteID
Control(PasteID).ParentID = 0
@ -3460,7 +3484,7 @@ SUB __UI_EventDispatcher
ToolTip(PasteID) = ToolTip(ThisControl)
Control(PasteID).Canvas = TempCanvas
IF Control(ThisControl).HelperCanvas <> 0 THEN
Control(ThisControl).HelperCanvas = _COPYIMAGE(Control(ThisControl).HelperCanvas, 32)
Control(PasteID).HelperCanvas = _COPYIMAGE(Control(ThisControl).HelperCanvas, 32)
END IF
IF j = 1 AND TempTop + TempLeft >= 0 THEN
Control(PasteID).Top = TempTop

Binary file not shown.

Binary file not shown.