diff --git a/InForm/InForm.ui b/InForm/InForm.ui index 7fafc2b..0ed2799 100644 --- a/InForm/InForm.ui +++ b/InForm/InForm.ui @@ -1017,51 +1017,53 @@ 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 - DIM SizeAndPosition1$, SizeAndPosition2$, pw& - DIM InfoLeft AS INTEGER, InfoTop AS INTEGER - _FONT Control(__UI_FormID).Font - 'Calculate the info panel width - SizeAndPosition1$ = LTRIM$(STR$(Control(i).Left)) + "," + LTRIM$(STR$(Control(i).Top)) - pw& = __UI_PrintWidth(SizeAndPosition1$) - SizeAndPosition2$ = LTRIM$(STR$(Control(i).Width)) + "x" + LTRIM$(STR$(Control(i).Height)) - IF __UI_PrintWidth(SizeAndPosition2$) > pw& THEN pw& = __UI_PrintWidth(SizeAndPosition2$) + 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 + 'Calculate the info panel width + SizeAndPosition1$ = LTRIM$(STR$(Control(i).Left)) + "," + LTRIM$(STR$(Control(i).Top)) + pw& = __UI_PrintWidth(SizeAndPosition1$) + SizeAndPosition2$ = LTRIM$(STR$(Control(i).Width)) + "x" + LTRIM$(STR$(Control(i).Height)) + IF __UI_PrintWidth(SizeAndPosition2$) > pw& THEN pw& = __UI_PrintWidth(SizeAndPosition2$) - 'Calculate the info panel position - InfoLeft = Control(Control(i).ParentID).Left + Control(i).Left - IF InfoLeft < 0 THEN InfoLeft = 0 - IF InfoLeft + pw& + 4 > Control(__UI_FormID).Width THEN InfoLeft = Control(__UI_FormID).Width - (pw& + 4) + 'Calculate the info panel position + InfoLeft = Control(Control(i).ParentID).Left + Control(i).Left + IF InfoLeft < 0 THEN InfoLeft = 0 + IF InfoLeft + pw& + 4 > Control(__UI_FormID).Width THEN InfoLeft = Control(__UI_FormID).Width - (pw& + 4) - InfoTop = Control(Control(i).ParentID).Top + Control(i).Top + Control(i).Height + 2 - IF InfoTop < 0 THEN InfoTop = 0 - IF InfoTop + uspacing& * 2 + 4 > Control(__UI_FormID).Height THEN InfoTop = Control(__UI_FormID).Height - (uspacing& * 2 + 4) + InfoTop = Control(Control(i).ParentID).Top + Control(i).Top + Control(i).Height + 2 + IF InfoTop < 0 THEN InfoTop = 0 + IF InfoTop + uspacing& * 2 + 4 > Control(__UI_FormID).Height THEN InfoTop = Control(__UI_FormID).Height - (uspacing& * 2 + 4) - 'Reposition the panel if it intersects with the controls - IF InfoLeft < Control(Control(i).ParentID).Left + Control(i).Left + Control(i).Width AND _ - Control(Control(i).ParentID).Left + Control(i).Left < InfoLeft + pw& + 4 AND _ - InfoTop < Control(Control(i).ParentID).Top + Control(i).Top + Control(i).Height + 2 AND _ - Control(Control(i).ParentID).Top + Control(i).Top < InfoTop + uspacing& * 2 + 4 THEN - InfoTop = Control(Control(i).ParentID).Top + Control(i).Top - (uspacing& * 2 + 4) + 'Reposition the panel if it intersects with the controls + IF InfoLeft < Control(Control(i).ParentID).Left + Control(i).Left + Control(i).Width AND _ + Control(Control(i).ParentID).Left + Control(i).Left < InfoLeft + pw& + 4 AND _ + InfoTop < Control(Control(i).ParentID).Top + Control(i).Top + Control(i).Height + 2 AND _ + Control(Control(i).ParentID).Top + Control(i).Top < InfoTop + uspacing& * 2 + 4 THEN + InfoTop = Control(Control(i).ParentID).Top + Control(i).Top - (uspacing& * 2 + 4) + END IF + + 'Reposition the panel if the mouse is where it'd be drawn + IF __UI_MouseLeft >= InfoLeft AND __UI_MouseLeft <= InfoLeft + pw& + 4 AND _ + __UI_MouseTop >= InfoTop AND __UI_MouseTop <= InfoTop + uspacing& * 2 + 4 THEN + InfoLeft = InfoLeft + Control(i).Width + END IF + + 'Draw the info panel + __UI_ShadowBox InfoLeft, InfoTop, pw& + 4, uspacing& * 2 + 4, __UI_DefaultColor(__UI_Type_Form, 6), 40, 5 + + 'Print the info + COLOR _RGB32(0, 0, 0) + __UI_PrintString InfoLeft + 3, InfoTop + 3, SizeAndPosition1$ + __UI_PrintString InfoLeft + 3, InfoTop + 3 + uspacing&, SizeAndPosition2$ END IF - 'Reposition the panel if the mouse is where it'd be drawn - IF __UI_MouseLeft >= InfoLeft AND __UI_MouseLeft <= InfoLeft + pw& + 4 AND _ - __UI_MouseTop >= InfoTop AND __UI_MouseTop <= InfoTop + uspacing& * 2 + 4 THEN - InfoLeft = InfoLeft + Control(i).Width - END IF - - 'Draw the info panel - __UI_ShadowBox InfoLeft, InfoTop, pw& + 4, uspacing& * 2 + 4, __UI_DefaultColor(__UI_Type_Form, 6), 40, 5 - - 'Print the info - COLOR _RGB32(0, 0, 0) - __UI_PrintString InfoLeft + 3, InfoTop + 3, SizeAndPosition1$ - __UI_PrintString InfoLeft + 3, InfoTop + 3 + uspacing&, SizeAndPosition2$ - _DEST 0 END IF END IF @@ -1071,8 +1073,10 @@ SUB __UI_UpdateDisplay END IF IF OverlayisVisible THEN - __UI_MakeHardwareImage Control(__UI_FormID).HelperCanvas - IF Control(__UI_FormID).HelperCanvas < -1 THEN _PUTIMAGE , Control(__UI_FormID).HelperCanvas + IF Control(__UI_FormID).HelperCanvas < -1 THEN + __UI_MakeHardwareImage 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 diff --git a/InForm/UiEditorPreview.exe b/InForm/UiEditorPreview.exe index fcb1572..143bc89 100644 Binary files a/InForm/UiEditorPreview.exe and b/InForm/UiEditorPreview.exe differ diff --git a/UiEditor.exe b/UiEditor.exe index a843bfe..7570b2a 100644 Binary files a/UiEditor.exe and b/UiEditor.exe differ