Cleanup the edit wndproc a bit.

This commit is contained in:
Dimitrie O. Paun 2003-11-20 04:19:59 +00:00 committed by Alexandre Julliard
parent e5762652d2
commit 6443ee58bc
1 changed files with 8 additions and 22 deletions

View File

@ -3445,31 +3445,23 @@ TREEVIEW_GetEditControl(TREEVIEW_INFO *infoPtr)
static LRESULT CALLBACK static LRESULT CALLBACK
TREEVIEW_Edit_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) TREEVIEW_Edit_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
TREEVIEW_INFO *infoPtr; TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(GetParent(hwnd));
BOOL bCancel = FALSE; BOOL bCancel = FALSE;
LRESULT rc;
switch (uMsg) switch (uMsg)
{ {
case WM_PAINT: case WM_PAINT:
{
LRESULT rc;
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(GetParent(hwnd));
TRACE("WM_PAINT start\n"); TRACE("WM_PAINT start\n");
rc = CallWindowProcA(infoPtr->wpEditOrig, hwnd, uMsg, wParam, rc = CallWindowProcA(infoPtr->wpEditOrig, hwnd, uMsg, wParam,
lParam); lParam);
TRACE("WM_PAINT done\n"); TRACE("WM_PAINT done\n");
return rc; return rc;
}
case WM_KILLFOCUS: case WM_KILLFOCUS:
{
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(GetParent(hwnd));
if (infoPtr->bIgnoreEditKillFocus) if (infoPtr->bIgnoreEditKillFocus)
return TRUE; return TRUE;
break; break;
}
case WM_GETDLGCODE: case WM_GETDLGCODE:
return DLGC_WANTARROWS | DLGC_WANTALLKEYS; return DLGC_WANTARROWS | DLGC_WANTALLKEYS;
@ -3487,18 +3479,12 @@ TREEVIEW_Edit_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* fall through */ /* fall through */
default: default:
{ return CallWindowProcA(infoPtr->wpEditOrig, hwnd, uMsg, wParam, lParam);
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(GetParent(hwnd));
return CallWindowProcA(infoPtr->wpEditOrig, hwnd, uMsg, wParam,
lParam);
}
} }
/* Processing TVN_ENDLABELEDIT message could kill the focus */ /* Processing TVN_ENDLABELEDIT message could kill the focus */
/* eg. Using a messagebox */ /* eg. Using a messagebox */
infoPtr = TREEVIEW_GetInfoPtr(GetParent(hwnd));
infoPtr->bIgnoreEditKillFocus = TRUE; infoPtr->bIgnoreEditKillFocus = TRUE;
TREEVIEW_EndEditLabelNow(infoPtr, bCancel || !infoPtr->bLabelChanged); TREEVIEW_EndEditLabelNow(infoPtr, bCancel || !infoPtr->bLabelChanged);
infoPtr->bIgnoreEditKillFocus = FALSE; infoPtr->bIgnoreEditKillFocus = FALSE;
@ -3570,7 +3556,7 @@ TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
} }
default: default:
return SendMessageA(GetParent(infoPtr->hwnd), WM_COMMAND, wParam, lParam); return SendMessageA(infoPtr->hwndNotify, WM_COMMAND, wParam, lParam);
} }
return 0; return 0;