From e0115a84d06d6bf12096f20cf6d969a3917c86e7 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Wed, 1 May 2019 20:29:49 -0300 Subject: [PATCH] Accepts drag/drop from file system (Editor) --- InForm/UiEditor.bas | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/InForm/UiEditor.bas b/InForm/UiEditor.bas index f7c75b3..e97feaf 100644 --- a/InForm/UiEditor.bas +++ b/InForm/UiEditor.bas @@ -1223,6 +1223,7 @@ SUB __UI_BeforeUpdateDisplay InstanceStream$ = MID$(InstanceStream$, 13) InstanceStream$ = LEFT$(InstanceStream$, INSTR(InstanceStream$, "") - 1) IF _FILEEXISTS(InstanceStream$) THEN + LoadNewInstanceForm: IF INSTR(InstanceStream$, "/") > 0 OR INSTR(InstanceStream$, "\") > 0 THEN FOR i = LEN(InstanceStream$) TO 1 STEP -1 IF ASC(InstanceStream$, i) = 92 OR ASC(InstanceStream$, i) = 47 THEN @@ -1262,6 +1263,15 @@ SUB __UI_BeforeUpdateDisplay InstanceStream$ = "" END IF + 'Check if a form file was dropped onto the Editor for loading + FOR i = 1 TO _TOTALDROPPEDFILES + IF _FILEEXISTS(_DROPPEDFILE(i)) THEN + InstanceStream$ = _DROPPEDFILE(i) + _FINISHDROP + GOTO LoadNewInstanceForm + END IF + NEXT + IF CheckUpdates THEN IF CheckUpdateDone = False THEN STATIC ThisStep AS INTEGER @@ -3017,7 +3027,7 @@ SUB __UI_OnLoad __UI_ForceRedraw = True _FREEIMAGE tempIcon - 'TIMER(CheckPreviewTimer) ON + _ACCEPTFILEDROP EXIT SUB UiEditorPreviewNotFound: