1
1
Fork 0
mirror of https://github.com/FellippeHeitor/InForm.git synced 2025-01-14 19:49:33 +00:00

Accepts drag/drop from file system (Editor)

This commit is contained in:
FellippeHeitor 2019-05-01 20:29:49 -03:00
parent b63b3ad2ab
commit e0115a84d0

View file

@ -1223,6 +1223,7 @@ SUB __UI_BeforeUpdateDisplay
InstanceStream$ = MID$(InstanceStream$, 13)
InstanceStream$ = LEFT$(InstanceStream$, INSTR(InstanceStream$, "<END>") - 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: