size optimization (zlib is back to 34)
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4477 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
a1f2413942
commit
09e44a9feb
1 changed files with 47 additions and 57 deletions
|
@ -1106,25 +1106,37 @@ static void FORCE_INLINE NSISCALL RefreshComponents(HWND hwTree, HTREEITEM *item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HTREEITEM NSISCALL TreeHitTest(HWND tree)
|
int NSISCALL TreeGetSelectedSection(HWND tree, BOOL mouse)
|
||||||
{
|
{
|
||||||
TVHITTESTINFO ht;
|
HTREEITEM hItem = TreeView_GetSelection(tree);
|
||||||
DWORD dwpos = GetMessagePos();
|
TVITEM item;
|
||||||
|
|
||||||
ht.pt.x = GET_X_LPARAM(dwpos);
|
if (mouse)
|
||||||
ht.pt.y = GET_Y_LPARAM(dwpos);
|
{
|
||||||
ScreenToClient(tree, &ht.pt);
|
TVHITTESTINFO ht;
|
||||||
|
DWORD dwpos = GetMessagePos();
|
||||||
|
|
||||||
TreeView_HitTest(tree, &ht);
|
ht.pt.x = GET_X_LPARAM(dwpos);
|
||||||
|
ht.pt.y = GET_Y_LPARAM(dwpos);
|
||||||
|
ScreenToClient(tree, &ht.pt);
|
||||||
|
|
||||||
|
TreeView_HitTest(tree, &ht);
|
||||||
|
|
||||||
#ifdef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
|
#ifdef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
|
||||||
if (ht.flags & TVHT_ONITEMSTATEICON)
|
if (!(ht.flags & TVHT_ONITEMSTATEICON))
|
||||||
#else
|
#else
|
||||||
if (ht.flags & (TVHT_ONITEMSTATEICON|TVHT_ONITEMLABEL|TVHT_ONITEMRIGHT|TVHT_ONITEM))
|
if (!(ht.flags & (TVHT_ONITEMSTATEICON|TVHT_ONITEMLABEL|TVHT_ONITEMRIGHT|TVHT_ONITEM)))
|
||||||
#endif
|
#endif
|
||||||
return ht.hItem;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
hItem = ht.hItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
item.mask = TVIF_PARAM;
|
||||||
|
item.hItem = hItem;
|
||||||
|
TreeView_GetItem(tree, &item);
|
||||||
|
|
||||||
|
return (int) item.lParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LONG oldTreeWndProc;
|
static LONG oldTreeWndProc;
|
||||||
|
@ -1141,21 +1153,8 @@ static DWORD WINAPI newTreeWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
}
|
}
|
||||||
#ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
|
#ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
|
||||||
if (uMsg == WM_MOUSEMOVE) {
|
if (uMsg == WM_MOUSEMOVE) {
|
||||||
TVITEM tvItem;
|
|
||||||
|
|
||||||
if (IsWindowVisible(hwnd)) {
|
if (IsWindowVisible(hwnd)) {
|
||||||
tvItem.hItem = TreeHitTest(hwnd);
|
lParam = TreeGetSelectedSection(hwnd, TRUE);
|
||||||
|
|
||||||
lParam = -1;
|
|
||||||
|
|
||||||
if (tvItem.hItem)
|
|
||||||
{
|
|
||||||
tvItem.mask = TVIF_PARAM;
|
|
||||||
|
|
||||||
TreeView_GetItem(hwnd, &tvItem);
|
|
||||||
|
|
||||||
lParam = tvItem.lParam;
|
|
||||||
}
|
|
||||||
uMsg = WM_NOTIFY_SELCHANGE;
|
uMsg = WM_NOTIFY_SELCHANGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1293,48 +1292,39 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||||
{
|
{
|
||||||
if (!(g_flags&CH_FLAGS_NO_CUSTOM) && (uMsg == WM_TREEVIEW_KEYHACK || lpnmh->code == NM_CLICK))
|
if (!(g_flags&CH_FLAGS_NO_CUSTOM) && (uMsg == WM_TREEVIEW_KEYHACK || lpnmh->code == NM_CLICK))
|
||||||
{
|
{
|
||||||
TVITEM tvItem;
|
int secid = TreeGetSelectedSection(hwndTree1, uMsg != WM_TREEVIEW_KEYHACK);
|
||||||
|
|
||||||
if (uMsg != WM_TREEVIEW_KEYHACK)
|
if (secid >= 0)
|
||||||
tvItem.hItem=TreeHitTest(hwndTree1);
|
|
||||||
else
|
|
||||||
tvItem.hItem=TreeView_GetSelection(hwndTree1);
|
|
||||||
|
|
||||||
if (tvItem.hItem)
|
|
||||||
{
|
{
|
||||||
tvItem.mask = TVIF_PARAM;
|
int flags = sections[secid].flags;
|
||||||
if (TreeView_GetItem(hwndTree1, &tvItem))
|
|
||||||
|
if ((flags & SF_RO) == 0)
|
||||||
{
|
{
|
||||||
int flags = sections[tvItem.lParam].flags;
|
if ((flags & SF_PSELECTED))
|
||||||
|
|
||||||
if ((flags & SF_RO) == 0)
|
|
||||||
{
|
{
|
||||||
if ((flags & SF_PSELECTED))
|
flags ^= SF_TOGGLED;
|
||||||
{
|
|
||||||
flags ^= SF_TOGGLED;
|
|
||||||
|
|
||||||
if (flags & SF_TOGGLED)
|
if (flags & SF_TOGGLED)
|
||||||
{
|
{
|
||||||
flags |= SF_SELECTED;
|
flags |= SF_SELECTED;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
flags &= ~SF_SELECTED;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
flags ^= SF_SELECTED;
|
flags &= ~SF_SELECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
sections[tvItem.lParam].flags = flags;
|
|
||||||
|
|
||||||
SectionFlagsChanged(tvItem.lParam);
|
|
||||||
|
|
||||||
wParam = 1;
|
|
||||||
lParam = !(g_flags & CH_FLAGS_COMP_ONLY_ON_CUSTOM);
|
|
||||||
uMsg = WM_IN_UPDATEMSG;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
flags ^= SF_SELECTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
sections[secid].flags = flags;
|
||||||
|
|
||||||
|
SectionFlagsChanged(secid);
|
||||||
|
|
||||||
|
wParam = 1;
|
||||||
|
lParam = !(g_flags & CH_FLAGS_COMP_ONLY_ON_CUSTOM);
|
||||||
|
uMsg = WM_IN_UPDATEMSG;
|
||||||
}
|
}
|
||||||
} // was valid click
|
} // was valid click
|
||||||
} // was click or hack
|
} // was click or hack
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue