Sync to Wine-0_9_5:

Vitaliy Margolen <[email protected]>
- comctl32: Listview - allow selection toggle with ctrl+space.
Robert Reif <[email protected]>
- comctl32: Create ipaddress in enabled state.
Thomas Weidenmueller <[email protected]>
- comctrl32: ReAlloc should be able to move memory blocks if necessary.
- comctl32: Fix error handling in PSM_ADDPAGE in case of memory
  allocation failure.

svn path=/trunk/; revision=20619
This commit is contained in:
Gé van Geldorp
2006-01-06 19:59:46 +00:00
parent c509ca7a82
commit 95f799abe6
3 changed files with 24 additions and 5 deletions
+2 -1
View File
@@ -189,7 +189,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, LPCREATESTRUCTA lpCreate)
edit.bottom = rcClient.bottom - 2;
infoPtr->Self = hwnd;
infoPtr->Enabled = FALSE;
infoPtr->Enabled = TRUE;
infoPtr->Notify = lpCreate->hwndParent;
for (i = 0; i < 4; i++) {
@@ -208,6 +208,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, LPCREATESTRUCTA lpCreate)
part->OrigProc = (WNDPROC)
SetWindowLongPtrW (part->EditHwnd, GWLP_WNDPROC,
(DWORD_PTR)IPADDRESS_SubclassProc);
EnableWindow(part->EditHwnd, infoPtr->Enabled);
}
return 0;
+14 -1
View File
@@ -3175,6 +3175,7 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem)
WORD wCtrl = HIWORD(GetKeyState(VK_CONTROL));
BOOL bResult = FALSE;
TRACE("nItem=%d, wShift=%d, wCtrl=%d\n", nItem, wShift, wCtrl);
if ((nItem >= 0) && (nItem < infoPtr->nItemCount))
{
if (infoPtr->dwStyle & LVS_SINGLESEL)
@@ -3191,6 +3192,14 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem)
}
else if (wCtrl)
{
LVITEMW lvItem;
lvItem.state = ~LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED);
lvItem.stateMask = LVIS_SELECTED;
LISTVIEW_SetItemState(infoPtr, nItem, &lvItem);
if (lvItem.state & LVIS_SELECTED)
infoPtr->nSelectionMark = nItem;
bResult = LISTVIEW_SetItemFocus(infoPtr, nItem);
}
else
@@ -8020,6 +8029,10 @@ static LRESULT LISTVIEW_KeyDown(LISTVIEW_INFO *infoPtr, INT nVirtualKey, LONG lK
switch (nVirtualKey)
{
case VK_SPACE:
nItem = infoPtr->nFocusedItem;
break;
case VK_RETURN:
if ((infoPtr->nItemCount > 0) && (infoPtr->nFocusedItem != -1))
{
@@ -8086,7 +8099,7 @@ static LRESULT LISTVIEW_KeyDown(LISTVIEW_INFO *infoPtr, INT nVirtualKey, LONG lK
break;
}
if ((nItem != -1) && (nItem != infoPtr->nFocusedItem))
if ((nItem != -1) && (nItem != infoPtr->nFocusedItem || nVirtualKey == VK_SPACE))
LISTVIEW_KeySelection(infoPtr, nItem);
return 0;
+8 -3
View File
@@ -2288,6 +2288,7 @@ static LRESULT PROPSHEET_QuerySiblings(HWND hwndDlg,
static BOOL PROPSHEET_AddPage(HWND hwndDlg,
HPROPSHEETPAGE hpage)
{
PropPageInfo * ppi;
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
PropSheetInfoStr);
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
@@ -2298,9 +2299,13 @@ static BOOL PROPSHEET_AddPage(HWND hwndDlg,
/*
* Allocate and fill in a new PropPageInfo entry.
*/
psInfo->proppage = (PropPageInfo*) ReAlloc(psInfo->proppage,
sizeof(PropPageInfo) *
(psInfo->nPages + 1));
ppi = (PropPageInfo*) ReAlloc(psInfo->proppage,
sizeof(PropPageInfo) *
(psInfo->nPages + 1));
if (!ppi)
return FALSE;
psInfo->proppage = ppi;
if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, psInfo->nPages))
return FALSE;