Finished the re-disabling of all windows on Windows dialogs.
This commit is contained in:
parent
6a81921c1a
commit
1db3027619
|
@ -1,6 +1,9 @@
|
||||||
// 22 may 2015
|
// 22 may 2015
|
||||||
#include "uipriv_windows.hpp"
|
#include "uipriv_windows.hpp"
|
||||||
|
|
||||||
|
// TODO document all this is what we want
|
||||||
|
// TODO do the same for font and color buttons
|
||||||
|
|
||||||
// notes:
|
// notes:
|
||||||
// - FOS_SUPPORTSTREAMABLEITEMS doesn't seem to be supported on windows vista, or at least not with the flags we use
|
// - FOS_SUPPORTSTREAMABLEITEMS doesn't seem to be supported on windows vista, or at least not with the flags we use
|
||||||
// - even with FOS_NOVALIDATE the dialogs will reject invalid filenames (at least on Vista, anyway)
|
// - even with FOS_NOVALIDATE the dialogs will reject invalid filenames (at least on Vista, anyway)
|
||||||
|
@ -75,16 +78,26 @@ out:
|
||||||
|
|
||||||
char *uiOpenFile(uiWindow *parent)
|
char *uiOpenFile(uiWindow *parent)
|
||||||
{
|
{
|
||||||
return commonItemDialog(windowHWND(parent),
|
char *res;
|
||||||
|
|
||||||
|
disableAllWindowsExcept(parent);
|
||||||
|
res = commonItemDialog(windowHWND(parent),
|
||||||
CLSID_FileOpenDialog, IID_IFileOpenDialog,
|
CLSID_FileOpenDialog, IID_IFileOpenDialog,
|
||||||
FOS_NOCHANGEDIR | FOS_ALLNONSTORAGEITEMS | FOS_NOVALIDATE | FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST | FOS_SHAREAWARE | FOS_NOTESTFILECREATE | FOS_NODEREFERENCELINKS | FOS_FORCESHOWHIDDEN | FOS_DEFAULTNOMINIMODE);
|
FOS_NOCHANGEDIR | FOS_ALLNONSTORAGEITEMS | FOS_NOVALIDATE | FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST | FOS_SHAREAWARE | FOS_NOTESTFILECREATE | FOS_NODEREFERENCELINKS | FOS_FORCESHOWHIDDEN | FOS_DEFAULTNOMINIMODE);
|
||||||
|
enableAllWindowsExcept(parent);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *uiSaveFile(uiWindow *parent)
|
char *uiSaveFile(uiWindow *parent)
|
||||||
{
|
{
|
||||||
return commonItemDialog(windowHWND(parent),
|
char *res;
|
||||||
|
|
||||||
|
disableAllWindowsExcept(parent);
|
||||||
|
res = commonItemDialog(windowHWND(parent),
|
||||||
CLSID_FileSaveDialog, IID_IFileSaveDialog,
|
CLSID_FileSaveDialog, IID_IFileSaveDialog,
|
||||||
FOS_OVERWRITEPROMPT | FOS_NOCHANGEDIR | FOS_ALLNONSTORAGEITEMS | FOS_NOVALIDATE | FOS_SHAREAWARE | FOS_NOTESTFILECREATE | FOS_NODEREFERENCELINKS | FOS_FORCESHOWHIDDEN | FOS_DEFAULTNOMINIMODE);
|
FOS_OVERWRITEPROMPT | FOS_NOCHANGEDIR | FOS_ALLNONSTORAGEITEMS | FOS_NOVALIDATE | FOS_SHAREAWARE | FOS_NOTESTFILECREATE | FOS_NODEREFERENCELINKS | FOS_FORCESHOWHIDDEN | FOS_DEFAULTNOMINIMODE);
|
||||||
|
enableAllWindowsExcept(parent);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO switch to TaskDialogIndirect()?
|
// TODO switch to TaskDialogIndirect()?
|
||||||
|
@ -107,10 +120,14 @@ static void msgbox(HWND parent, const char *title, const char *description, TASK
|
||||||
|
|
||||||
void uiMsgBox(uiWindow *parent, const char *title, const char *description)
|
void uiMsgBox(uiWindow *parent, const char *title, const char *description)
|
||||||
{
|
{
|
||||||
|
disableAllWindowsExcept(parent);
|
||||||
msgbox(windowHWND(parent), title, description, TDCBF_OK_BUTTON, NULL);
|
msgbox(windowHWND(parent), title, description, TDCBF_OK_BUTTON, NULL);
|
||||||
|
enableAllWindowsExcept(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiMsgBoxError(uiWindow *parent, const char *title, const char *description)
|
void uiMsgBoxError(uiWindow *parent, const char *title, const char *description)
|
||||||
{
|
{
|
||||||
|
disableAllWindowsExcept(parent);
|
||||||
msgbox(windowHWND(parent), title, description, TDCBF_OK_BUTTON, TD_ERROR_ICON);
|
msgbox(windowHWND(parent), title, description, TDCBF_OK_BUTTON, TD_ERROR_ICON);
|
||||||
|
enableAllWindowsExcept(parent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,7 +399,7 @@ void enableAllWindowsExcept(uiWindow *which)
|
||||||
for (auto &w : windows) {
|
for (auto &w : windows) {
|
||||||
if (w.first == which)
|
if (w.first == which)
|
||||||
continue;
|
continue;
|
||||||
if (!uiControlEnabled(uiControl(w.first))
|
if (!uiControlEnabled(uiControl(w.first)))
|
||||||
continue;
|
continue;
|
||||||
EnableWindow(w.first->hwnd, TRUE);
|
EnableWindow(w.first->hwnd, TRUE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue