1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-05 00:40:26 +00:00

Enables the IDE to accept files via drag/drop (Windows-only).

This commit is contained in:
FellippeHeitor 2018-07-31 21:59:31 -03:00
parent 60d6aa7d27
commit 9a1b8450aa
3 changed files with 21 additions and 1 deletions

View file

@ -2237,7 +2237,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
break;
case WM_DROPFILES:
qb64_custom_event(QB64_EVENT_FILE_DROP,0,0,0,0,0,0,0,0,wParam,NULL);
qb64_custom_event(QB64_EVENT_FILE_DROP,0,0,0,0,0,0,0,0,(void*)wParam,NULL);
break;
case WM_DESTROY:

View file

@ -1275,6 +1275,15 @@ FUNCTION ide2 (ignore)
END IF
END IF
IF _TOTALDROPPEDFILES > 0 THEN
IF _FILEEXISTS(_DROPPEDFILE$(1)) THEN
IdeOpenFile$ = _DROPPEDFILE$(1)
_FINISHDROP
GOTO ctrlOpen
END IF
_FINISHDROP
END IF
'Hover/click (QuickNav)
IF IdeSystem = 1 AND QuickNavTotal > 0 THEN
IF mY = 2 THEN
@ -7440,6 +7449,14 @@ FUNCTION ideopen$
IF mB THEN change = 1
alt = KALT: IF alt <> oldalt THEN change = 1
oldalt = alt
IF _TOTALDROPPEDFILES > 0 THEN
idetxt(o(1).txt) = _DROPPEDFILE$(1)
o(1).v1 = LEN(idetxt(o(1).txt))
_FINISHDROP
change = 1
END IF
_LIMIT 100
LOOP UNTIL change
IF alt AND NOT KCTRL THEN idehl = 1 ELSE idehl = 0

View file

@ -921,6 +921,9 @@ gl_scan_header
'-----------------------QB64 COMPILER ONCE ONLY SETUP CODE ENDS HERE---------------------------------------
IF NoIDEMode THEN IDE_AutoPosition = 0: GOTO noide
DIM FileDropEnabled AS _BYTE
IF FileDropEnabled = 0 THEN FileDropEnabled = -1: _ACCEPTFILEDROP
IF IDE_AutoPosition AND NOT IDE_BypassAutoPosition THEN _SCREENMOVE IDE_LeftPosition, IDE_TopPosition
idemode = 1
sendc$ = "" 'no initial message