From b5310c5151704a1d7f1e705bb88e7bf96a4d7517 Mon Sep 17 00:00:00 2001 From: blikblum Date: Tue, 25 Dec 2007 17:15:45 +0000 Subject: [PATCH] * Fixed inline editor auto size feature * Removed references for TnT components git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@302 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../virtualtreeview-unstable/VTConfig.inc | 5 +--- .../virtualtreeview-unstable/VirtualTrees.pas | 27 +++---------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/components/virtualtreeview-unstable/VTConfig.inc b/components/virtualtreeview-unstable/VTConfig.inc index 61fca78f3..9d33f235e 100644 --- a/components/virtualtreeview-unstable/VTConfig.inc +++ b/components/virtualtreeview-unstable/VTConfig.inc @@ -20,10 +20,7 @@ // See below for more info about it. {.$define UseLocalMemoryManager} -{.$define TntSupport} // Added by Igor Afanasyev to support unicode-aware inplace editors. This implementation uses - // Troy Wolbrink's TNT controls, which can be found at: - // http://home.ccci.org/wolbrink/tnt/delphi_unicode_controls.htm. - + //Lazarus port options {$define EnableOLE} {.$define EnableNativeTVM} diff --git a/components/virtualtreeview-unstable/VirtualTrees.pas b/components/virtualtreeview-unstable/VirtualTrees.pas index e6006e5ea..bea86a497 100644 --- a/components/virtualtreeview-unstable/VirtualTrees.pas +++ b/components/virtualtreeview-unstable/VirtualTrees.pas @@ -137,9 +137,6 @@ uses , Themes, UxTheme {$endif COMPILE_7_UP} {$endif ThemeSupport} - {$ifdef TntSupport} - , TntStdCtrls // Unicode aware inplace editor. - {$endif TntSupport} {$ifdef EnableAccessible} , oleacc // for MSAA IAccessible support {$endif}; @@ -2738,11 +2735,7 @@ type // Edit support classes. TStringEditLink = class; - {$ifdef TntSupport} - TVTEdit = class(TTntEdit) - {$else} - TVTEdit = class(TCustomEdit) - {$endif TntSupport} + TVTEdit = class(TCustomEdit) private FRefLink: IVTEditLink; FLink: TStringEditLink; @@ -28679,18 +28672,11 @@ var begin if not (vsMultiline in FLink.FNode.States) then begin - // avoid flicker - SendMessage(Handle, WM_SETREDRAW, 0, 0); - DC := GetDC(Handle); LastFont := SelectObject(DC, Font.Handle); try // Read needed space for the current text. - {$ifdef TntSupport} - GetTextExtentPoint32W(DC, PWideChar(Text), Length(Text), Size); - {$else} - GetTextExtentPoint32(DC, PChar(Text), Length(Text), Size); - {$endif TntSupport} + GetTextExtentPoint32(DC, PChar(Text), Length(Text), Size); Inc(Size.cx, 2 * FLink.FTree.FTextMargin); // Repaint associated node if the edit becomes smaller. @@ -28704,7 +28690,6 @@ begin finally SelectObject(DC, LastFont); ReleaseDC(Handle, DC); - SendMessage(Handle, WM_SETREDRAW, 1, 0); end; end; end; @@ -28860,25 +28845,21 @@ begin FTree.GetTextInfo(Node, Column, FEdit.Font, FTextBounds, Text); FEdit.Font.Color := clWindowText; FEdit.Parent := Tree; - //todo_lcl_check see effect of recreatewnd - RecreateWnd(FEdit); FEdit.HandleNeeded; FEdit.Text := Text; if Column <= NoColumn then begin - //FEdit.BidiMode := FTree.BidiMode; + FEdit.BidiMode := FTree.BidiMode; FAlignment := FTree.Alignment; end else begin - //FEdit.BidiMode := FTree.Header.Columns[Column].BidiMode; + FEdit.BidiMode := FTree.Header.Columns[Column].BidiMode; FAlignment := FTree.Header.Columns[Column].Alignment; end; - { if FEdit.BidiMode <> bdLeftToRight then ChangeBidiModeAlignment(FAlignment); - } end; end;