Clean up the drawing code after a label update. There were problems if

the new label is shorter that the old label fragments of the old label
were left drawn.
This commit is contained in:
Aric Stewart 2000-05-11 00:07:44 +00:00 committed by Alexandre Julliard
parent 38db0980c5
commit 0406a08cdc
1 changed files with 11 additions and 5 deletions

View File

@ -2934,6 +2934,8 @@ TREEVIEW_EndEditLabelNow (HWND hwnd, WPARAM wParam, LPARAM lParam)
BOOL bRevert = (BOOL)wParam;
BOOL bReturn = ! bRevert;
NMTVDISPINFOA tvdi;
RECT itemRect;
if ( ! (BOOL)wParam ) /* wParam is set to true to cancel the edition */
{
@ -3024,13 +3026,17 @@ TREEVIEW_EndEditLabelNow (HWND hwnd, WPARAM wParam, LPARAM lParam)
(LPARAM)&tvdi);
}
}
ShowWindow(infoPtr->hwndEdit, SW_HIDE);
EnableWindow(infoPtr->hwndEdit, FALSE);
infoPtr->editItem = 0;
}
ShowWindow(infoPtr->hwndEdit, SW_HIDE);
EnableWindow(infoPtr->hwndEdit, FALSE);
/* update the window to eliminate fragments and the like */
TreeView_GetItemRect(hwnd,infoPtr->editItem,&itemRect,FALSE);
RedrawWindow(hwnd,&itemRect,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW);
infoPtr->editItem = 0;
return bReturn;
}