diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 9035db8b..58dd7c8a 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -1244,7 +1244,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SectionFlagsChanged(tvItem.lParam); wParam = 1; - lParam = 1; + lParam = !(g_flags & CH_FLAGS_COMP_ONLY_ON_CUSTOM); uMsg = WM_IN_UPDATEMSG; } } @@ -1282,6 +1282,8 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SetInstType(whichcfg); + SendMessage(hwndDlg, WM_NOTIFY_INSTTYPE_CHANGED, 0, whichcfg); + wParam = 1; lParam = 0; uMsg = WM_IN_UPDATEMSG; @@ -1315,38 +1317,22 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar 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; - - int t = SendMessage(hwndCombo1,CB_GETCURSEL,0,0); - if (t != CB_ERR) + if (install_types[i]) { - int whichcfg = SendMessage(hwndCombo1, CB_GETITEMDATA, t, 0); - - if (whichcfg != CB_ERR && install_types[whichcfg] && whichcfg != NSIS_MAX_INST_TYPES) - c = SW_HIDE; + cbi++; } - - 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++) - { - if (install_types[i]) - { - cbi++; - } - } + SendMessage(hwndCombo1, CB_SETCURSEL, cbi, 0); - SendMessage(hwndCombo1, CB_SETCURSEL, cbi, 0); - } // end of typecheckshit + lParam = inst_type; + uMsg = WM_NOTIFY_INSTTYPE_CHANGED; } 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(); } #endif//NSIS_CONFIG_COMPONENTPAGE diff --git a/Source/exehead/ui.h b/Source/exehead/ui.h index 28368f37..fd8545f5 100644 --- a/Source/exehead/ui.h +++ b/Source/exehead/ui.h @@ -29,22 +29,16 @@ void NSISCALL build_g_logfile(void); // update message used by DirProc and SelProc for space display #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 #define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd) // simulates clicking on the tree #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) #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_