fixed bug #1606716 - InstallOptions might send irrelevant NOTIFY for radiobuttons

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4854 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-01-19 19:26:04 +00:00
parent b4a00a8ede
commit 88572123e5

View file

@ -581,21 +581,38 @@ int WINAPI ReadSettings(void) {
return nNumFields;
}
LRESULT WINAPI WMCommandProc(HWND hWnd, UINT id, HWND hwndCtl, UINT codeNotify) {
switch (codeNotify) {
case BN_CLICKED: // The user pressed a button
case LBN_SELCHANGE: // The user changed the selection in a ListBox control
// case CBN_SELCHANGE: // The user changed the selection in a DropList control (same value as LBN_SELCHANGE)
{
char szBrowsePath[MAX_PATH];
int nIdx = FindControlIdx(id);
// Ignore if the dialog is in the process of being created
if (g_done || nIdx < 0)
return 0;
FieldType *pField = pFields + nIdx;
switch (pField->nType)
{
case FIELD_BROWSEBUTTON:
case FIELD_LINK:
case FIELD_BUTTON:
case FIELD_CHECKBOX:
case FIELD_RADIOBUTTON:
if (codeNotify != BN_CLICKED)
return 0;
break;
case FIELD_COMBOBOX:
case FIELD_LISTBOX:
if (codeNotify != LBN_SELCHANGE) // LBN_SELCHANGE == CBN_SELCHANGE
return 0;
break;
default:
return 0;
}
if (pFields[nIdx].nType == FIELD_BROWSEBUTTON)
--nIdx;
FieldType *pField = pFields + nIdx;
char szBrowsePath[MAX_PATH];
switch (pField->nType) {
case FIELD_FILEREQUEST: {
OPENFILENAME ofn={0,};
@ -684,9 +701,7 @@ LRESULT WINAPI WMCommandProc(HWND hWnd, UINT id, HWND hwndCtl, UINT codeNotify)
g_NotifyField = nIdx + 1;
mySendMessage(hMainWindow, WM_NOTIFY_OUTER_NEXT, 1, 0);
}
}
break;
}
return 0;
}