* support for dragdrop

* support for loading ROMs via command line (except it will try to get the BIOS/firmware from where the ROM is. derp)
* re-add missing BIOS/firmware dialog. fix libui to allow dialogs without a parent window.
This commit is contained in:
StapleButter
2017-09-23 03:39:09 +02:00
parent 14b7cf1987
commit f52322ee20
4 changed files with 78 additions and 5 deletions

View File

@ -111,6 +111,7 @@ _UI_EXTERN void uiWindowSetBorderless(uiWindow *w, int borderless);
_UI_EXTERN void uiWindowSetChild(uiWindow *w, uiControl *child);
_UI_EXTERN int uiWindowMargined(uiWindow *w);
_UI_EXTERN void uiWindowSetMargined(uiWindow *w, int margined);
_UI_EXTERN void uiWindowSetDropTarget(uiWindow* w, int drop);
_UI_EXTERN uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar);
_UI_EXTERN void uiWindowOnContentSizeChanged(uiWindow *w, void (*f)(uiWindow *, void *), void *data);

View File

@ -14,7 +14,7 @@
// - when a dialog is active, tab navigation in other windows stops working
// - when adding uiOpenFolder(), use IFileDialog as well - https://msdn.microsoft.com/en-us/library/windows/desktop/bb762115%28v=vs.85%29.aspx
#define windowHWND(w) ((HWND) uiControlHandle(uiControl(w)))
#define windowHWND(w) (w ? (HWND) uiControlHandle(uiControl(w)) : NULL)
char *commonItemDialog(HWND parent, REFCLSID clsid, REFIID iid, char* filter, char* initpath, FILEOPENDIALOGOPTIONS optsadd)
{

View File

@ -482,6 +482,12 @@ void uiWindowSetMargined(uiWindow *w, int margined)
windowRelayout(w);
}
void uiWindowSetDropTarget(uiWindow* w, int drop)
{
DragAcceptFiles(w->hwnd, drop?TRUE:FALSE);
}
// see http://blogs.msdn.com/b/oldnewthing/archive/2003/09/11/54885.aspx and http://blogs.msdn.com/b/oldnewthing/archive/2003/09/13/54917.aspx
// TODO use clientSizeToWindowSize()
static void setClientSize(uiWindow *w, int width, int height, BOOL hasMenubar, DWORD style, DWORD exstyle)