Drag-n-drop file in Grafx2 window is now cleanly prevented while a window is open: The OS's mouse cursor is the 'forbidden' sign. Preparatory work for horizontal slider controls.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1597 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
@@ -23,6 +23,14 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <SDL.h>
|
||||
#if defined(__WIN32__)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
// There is no WM on the GP2X...
|
||||
#ifndef __GP2X__
|
||||
#include <SDL_syswm.h>
|
||||
#endif
|
||||
|
||||
#include "global.h"
|
||||
#include "sdlscreen.h"
|
||||
#include "errors.h"
|
||||
@@ -270,3 +278,18 @@ void Clear_border(byte color)
|
||||
}
|
||||
}
|
||||
|
||||
/// Activates or desactivates file drag-dropping in program window.
|
||||
void Allow_drag_and_drop(int flag)
|
||||
{
|
||||
// Inform Windows that we accept drag-n-drop events or not
|
||||
#ifdef __WIN32__
|
||||
SDL_SysWMinfo wminfo;
|
||||
HWND hwnd;
|
||||
|
||||
SDL_VERSION(&wminfo.version);
|
||||
SDL_GetWMInfo(&wminfo);
|
||||
hwnd = wminfo.window;
|
||||
DragAcceptFiles(hwnd,flag?TRUE:FALSE);
|
||||
SDL_EventState (SDL_SYSWMEVENT,flag?SDL_ENABLE:SDL_DISABLE );
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user