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:
parent
38db0980c5
commit
0406a08cdc
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue