fixed bug #1155060 - Install type drop down box not showing default InstType

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3925 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-03-19 11:56:23 +00:00
parent b42f4595b1
commit 326556f0e3
2 changed files with 26 additions and 36 deletions

View file

@ -1244,7 +1244,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
SectionFlagsChanged(tvItem.lParam); SectionFlagsChanged(tvItem.lParam);
wParam = 1; wParam = 1;
lParam = 1; lParam = !(g_flags & CH_FLAGS_COMP_ONLY_ON_CUSTOM);
uMsg = WM_IN_UPDATEMSG; uMsg = WM_IN_UPDATEMSG;
} }
} }
@ -1282,6 +1282,8 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
SetInstType(whichcfg); SetInstType(whichcfg);
SendMessage(hwndDlg, WM_NOTIFY_INSTTYPE_CHANGED, 0, whichcfg);
wParam = 1; wParam = 1;
lParam = 0; lParam = 0;
uMsg = WM_IN_UPDATEMSG; uMsg = WM_IN_UPDATEMSG;
@ -1315,38 +1317,22 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (lParam) if (lParam)
{ {
if (g_flags & CH_FLAGS_COMP_ONLY_ON_CUSTOM) int i, cbi;
int inst_type = GetInstType(hTreeItems);
SetInstType(inst_type);
for (i = 0, cbi = 0; i < inst_type; i++)
{ {
int c = SW_SHOWNA; if (install_types[i])
int t = SendMessage(hwndCombo1,CB_GETCURSEL,0,0);
if (t != CB_ERR)
{ {
int whichcfg = SendMessage(hwndCombo1, CB_GETITEMDATA, t, 0); cbi++;
if (whichcfg != CB_ERR && install_types[whichcfg] && whichcfg != NSIS_MAX_INST_TYPES)
c = SW_HIDE;
} }
ShowWindow(hwndTree1, c);
ShowWindow(GetUIItem(IDC_TEXT2), c);
} }
else
{
int i, cbi;
int inst_type = GetInstType(hTreeItems);
SetInstType(inst_type);
for (i = 0, cbi = 0; i < inst_type; i++) SendMessage(hwndCombo1, CB_SETCURSEL, cbi, 0);
{
if (install_types[i])
{
cbi++;
}
}
SendMessage(hwndCombo1, CB_SETCURSEL, cbi, 0); lParam = inst_type;
} // end of typecheckshit uMsg = WM_NOTIFY_INSTTYPE_CHANGED;
} }
RefreshSectionGroups(); RefreshSectionGroups();
@ -1357,6 +1343,16 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
} }
} }
if (uMsg == WM_NOTIFY_INSTTYPE_CHANGED)
{
if (g_flags & CH_FLAGS_COMP_ONLY_ON_CUSTOM)
{
int c = (lParam == NSIS_MAX_INST_TYPES ? 1 : 0) << 3;// SW_SHOWNA=8, SW_HIDE=0
ShowWindow(hwndTree1, c);
ShowWindow(GetUIItem(IDC_TEXT2), c);
}
}
return HandleStaticBkColor(); return HandleStaticBkColor();
} }
#endif//NSIS_CONFIG_COMPONENTPAGE #endif//NSIS_CONFIG_COMPONENTPAGE

View file

@ -29,22 +29,16 @@ void NSISCALL build_g_logfile(void);
// update message used by DirProc and SelProc for space display // update message used by DirProc and SelProc for space display
#define WM_IN_UPDATEMSG (WM_USER+0xf) #define WM_IN_UPDATEMSG (WM_USER+0xf)
// the selected insttype has changed
#define WM_NOTIFY_INSTTYPE_CHANGE (WM_USER+0x32)
// custom pages should send this message to let NSIS know they're ready // custom pages should send this message to let NSIS know they're ready
#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd) #define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
// simulates clicking on the tree // simulates clicking on the tree
#define WM_TREEVIEW_KEYHACK (WM_USER+0x13) #define WM_TREEVIEW_KEYHACK (WM_USER+0x13)
// section text changed
#define WM_NOTIFY_SECTEXT (WM_USER+0x17)
// section flags changed
#define WM_NOTIFY_SECFLAGS (WM_USER+0x18)
// notifies a component selection change (.onMouseOverSection) // notifies a component selection change (.onMouseOverSection)
#define WM_NOTIFY_SELCHANGE (WM_USER+0x19) #define WM_NOTIFY_SELCHANGE (WM_USER+0x19)
// Notifies the installation type has changed by the user
#define WM_NOTIFY_INSTTYPE_CHANGED (WM_USER+0x20)
#endif//_UI_H_ #endif//_UI_H_