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:
Yves Rizoud
2010-08-29 19:21:33 +00:00
parent 9e20dd71fd
commit d78c33855b
10 changed files with 91 additions and 54 deletions

View File

@@ -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
}