|
@@ -48,20 +48,6 @@ static int __fastcall GetColumnTextWidth(TListView * ListView, int ColumnPadding
|
|
|
ListView->Canvas->TextExtent(Text).Width;
|
|
|
}
|
|
|
//---------------------------------------------------------------------------
|
|
|
-void DisableRedraw(TWinControl * Control)
|
|
|
-{
|
|
|
- SendMessage(Control->Handle, WM_SETREDRAW, false, 0);
|
|
|
-}
|
|
|
-//---------------------------------------------------------------------------
|
|
|
-void EnableRedraw(TWinControl * Control)
|
|
|
-{
|
|
|
- SendMessage(Control->Handle, WM_SETREDRAW, true, 0);
|
|
|
- // As recommended by documentation for WM_SETREDRAW.
|
|
|
- // Without this, session list on Import dialog stops working after the list is reloaded while visible
|
|
|
- // (i.e. when chaing import source)
|
|
|
- RedrawWindow(Control->Handle, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
|
|
-}
|
|
|
-//---------------------------------------------------------------------------
|
|
|
void __fastcall AutoSizeListColumnsWidth(TListView * ListView, int ColumnToShrinkIndex)
|
|
|
{
|
|
|
// Preallocate handle to precreate columns, otherwise our changes may get
|
|
@@ -71,7 +57,7 @@ void __fastcall AutoSizeListColumnsWidth(TListView * ListView, int ColumnToShrin
|
|
|
// what may cause a flicker of the currently focused window title.
|
|
|
ListView->HandleNeeded();
|
|
|
|
|
|
- DisableRedraw(ListView);
|
|
|
+ ListView->LockDrawing();
|
|
|
|
|
|
try
|
|
|
{
|
|
@@ -212,7 +198,7 @@ void __fastcall AutoSizeListColumnsWidth(TListView * ListView, int ColumnToShrin
|
|
|
}
|
|
|
__finally
|
|
|
{
|
|
|
- EnableRedraw(ListView);
|
|
|
+ ListView->UnlockDrawing();
|
|
|
}
|
|
|
}
|
|
|
//---------------------------------------------------------------------------
|