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:
parent
b4a00a8ede
commit
88572123e5
1 changed files with 106 additions and 91 deletions
|
@ -581,21 +581,38 @@ int WINAPI ReadSettings(void) {
|
||||||
return nNumFields;
|
return nNumFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LRESULT WINAPI WMCommandProc(HWND hWnd, UINT id, HWND hwndCtl, UINT codeNotify) {
|
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);
|
int nIdx = FindControlIdx(id);
|
||||||
// Ignore if the dialog is in the process of being created
|
// Ignore if the dialog is in the process of being created
|
||||||
if (g_done || nIdx < 0)
|
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;
|
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)
|
if (pFields[nIdx].nType == FIELD_BROWSEBUTTON)
|
||||||
--nIdx;
|
--nIdx;
|
||||||
FieldType *pField = pFields + nIdx;
|
|
||||||
|
char szBrowsePath[MAX_PATH];
|
||||||
|
|
||||||
switch (pField->nType) {
|
switch (pField->nType) {
|
||||||
case FIELD_FILEREQUEST: {
|
case FIELD_FILEREQUEST: {
|
||||||
OPENFILENAME ofn={0,};
|
OPENFILENAME ofn={0,};
|
||||||
|
@ -684,9 +701,7 @@ LRESULT WINAPI WMCommandProc(HWND hWnd, UINT id, HWND hwndCtl, UINT codeNotify)
|
||||||
g_NotifyField = nIdx + 1;
|
g_NotifyField = nIdx + 1;
|
||||||
mySendMessage(hMainWindow, WM_NOTIFY_OUTER_NEXT, 1, 0);
|
mySendMessage(hMainWindow, WM_NOTIFY_OUTER_NEXT, 1, 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue