You've already forked lazarus-ccr
* Synchronize with main VTV repository up to svn rev 603
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3413 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -102,8 +102,8 @@ const
|
|||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
VTMajorVersion = 5;
|
VTMajorVersion = 5;
|
||||||
VTMinorVersion = 2;
|
VTMinorVersion = 3;
|
||||||
VTReleaseVersion = 2;
|
VTReleaseVersion = 0;
|
||||||
VTTreeStreamVersion = 2;
|
VTTreeStreamVersion = 2;
|
||||||
VTHeaderStreamVersion = 6; // The header needs an own stream version to indicate changes only relevant to the header.
|
VTHeaderStreamVersion = 6; // The header needs an own stream version to indicate changes only relevant to the header.
|
||||||
|
|
||||||
@ -950,7 +950,7 @@ type
|
|||||||
FMargin,
|
FMargin,
|
||||||
FSpacing: Integer;
|
FSpacing: Integer;
|
||||||
FOptions: TVTColumnOptions;
|
FOptions: TVTColumnOptions;
|
||||||
FTag: Integer;
|
FTag: NativeInt;
|
||||||
FAlignment: TAlignment;
|
FAlignment: TAlignment;
|
||||||
FCaptionAlignment: TAlignment; // Alignment of the caption.
|
FCaptionAlignment: TAlignment; // Alignment of the caption.
|
||||||
FLastWidth: Integer;
|
FLastWidth: Integer;
|
||||||
@ -1033,7 +1033,7 @@ type
|
|||||||
property Position: TColumnPosition read FPosition write SetPosition;
|
property Position: TColumnPosition read FPosition write SetPosition;
|
||||||
property Spacing: Integer read FSpacing write SetSpacing default 3;
|
property Spacing: Integer read FSpacing write SetSpacing default 3;
|
||||||
property Style: TVirtualTreeColumnStyle read FStyle write SetStyle default vsText;
|
property Style: TVirtualTreeColumnStyle read FStyle write SetStyle default vsText;
|
||||||
property Tag: Integer read FTag write FTag default 0;
|
property Tag: NativeInt read FTag write FTag default 0;
|
||||||
property Text: String read FText write SetText;
|
property Text: String read FText write SetText;
|
||||||
property Width: Integer read FWidth write SetWidth default 50;
|
property Width: Integer read FWidth write SetWidth default 50;
|
||||||
end;
|
end;
|
||||||
@ -5430,6 +5430,7 @@ begin
|
|||||||
if csUseCache in EnterStates then
|
if csUseCache in EnterStates then
|
||||||
Include(LeaveStates, csValidationNeeded);
|
Include(LeaveStates, csValidationNeeded);
|
||||||
ChangeTreeStates(EnterStates, LeaveStates);
|
ChangeTreeStates(EnterStates, LeaveStates);
|
||||||
|
Synchronize(FCurrentTree.UpdateEditBounds);
|
||||||
FCurrentTree := nil;
|
FCurrentTree := nil;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -7437,7 +7438,7 @@ begin
|
|||||||
if Layout = blGlyphLeft then
|
if Layout = blGlyphLeft then
|
||||||
MinLeft := HeaderGlyphPos.X + HeaderGlyphSize.X + FSpacing;
|
MinLeft := HeaderGlyphPos.X + HeaderGlyphSize.X + FSpacing;
|
||||||
if FCheckBox and (Owner.Header.MainColumn = Self.Index) then
|
if FCheckBox and (Owner.Header.MainColumn = Self.Index) then
|
||||||
Dec(HeaderGlyphPos.X, 2 + 2 * Integer(toShowRoot in Owner.FHeader.Treeview.TreeOptions.FPaintOptions))
|
Dec(HeaderGlyphPos.X, 2)
|
||||||
else
|
else
|
||||||
if Owner.Header.MainColumn <> Self.Index then
|
if Owner.Header.MainColumn <> Self.Index then
|
||||||
Dec(HeaderGlyphPos.X, 2);
|
Dec(HeaderGlyphPos.X, 2);
|
||||||
@ -10431,17 +10432,18 @@ begin
|
|||||||
// to handle WM_LBUTTONDOWN here, too.
|
// to handle WM_LBUTTONDOWN here, too.
|
||||||
LM_LBUTTONDOWN:
|
LM_LBUTTONDOWN:
|
||||||
begin
|
begin
|
||||||
if csDesigning in Treeview.ComponentState then
|
|
||||||
Exit;
|
|
||||||
|
|
||||||
Application.CancelHint;
|
Application.CancelHint;
|
||||||
|
|
||||||
// make sure no auto scrolling is active...
|
if not (csDesigning in Treeview.ComponentState) then
|
||||||
KillTimer(Treeview.Handle, ScrollTimer);
|
begin
|
||||||
Treeview.DoStateChange([], [tsScrollPending, tsScrolling]);
|
// make sure no auto scrolling is active...
|
||||||
// ... pending editing is cancelled (actual editing remains active)
|
KillTimer(Treeview.Handle, ScrollTimer);
|
||||||
KillTimer(Treeview.Handle, EditTimer);
|
Treeview.DoStateChange([], [tsScrollPending, tsScrolling]);
|
||||||
Treeview.DoStateChange([], [tsEditPending]);
|
// ... pending editing is cancelled (actual editing remains active)
|
||||||
|
KillTimer(Treeview.Handle, EditTimer);
|
||||||
|
Treeview.DoStateChange([], [tsEditPending]);
|
||||||
|
end;
|
||||||
|
|
||||||
with TLMLButtonDown(Message) do
|
with TLMLButtonDown(Message) do
|
||||||
begin
|
begin
|
||||||
@ -10453,7 +10455,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
IsInHeader := InHeader(P);
|
IsInHeader := InHeader(P);
|
||||||
IsVSplitterHit := InHeaderSplitterArea(P) and CanSplitterResize(P);
|
// in design-time header columns are always resizable
|
||||||
|
if (csDesigning in Treeview.ComponentState) then
|
||||||
|
IsVSplitterHit := InHeaderSplitterArea(P)
|
||||||
|
else
|
||||||
|
IsVSplitterHit := InHeaderSplitterArea(P) and CanSplitterResize(P);
|
||||||
IsHSplitterHit := HSplitterHit;
|
IsHSplitterHit := HSplitterHit;
|
||||||
|
|
||||||
if IsVSplitterHit or IsHSplitterHit then
|
if IsVSplitterHit or IsHSplitterHit then
|
||||||
@ -10462,12 +10468,14 @@ begin
|
|||||||
FColumns.FHoverIndex := NoColumn;
|
FColumns.FHoverIndex := NoColumn;
|
||||||
if IsVSplitterHit then
|
if IsVSplitterHit then
|
||||||
begin
|
begin
|
||||||
DoBeforeHeightTracking(GetShiftState);
|
if not (csDesigning in Treeview.ComponentState) then
|
||||||
|
DoBeforeHeightTracking(GetShiftState);
|
||||||
Include(FStates, hsHeightTrackPending)
|
Include(FStates, hsHeightTrackPending)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
DoBeforeColumnWidthTracking(FColumns.FTrackIndex, GetShiftState);
|
if not (csDesigning in Treeview.ComponentState) then
|
||||||
|
DoBeforeColumnWidthTracking(FColumns.FTrackIndex, GetShiftState);
|
||||||
Include(FStates, hsColumnWidthTrackPending);
|
Include(FStates, hsColumnWidthTrackPending);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -10478,7 +10486,9 @@ begin
|
|||||||
else if IsInHeader then
|
else if IsInHeader then
|
||||||
begin
|
begin
|
||||||
HitIndex := Columns.AdjustDownColumn(P);
|
HitIndex := Columns.AdjustDownColumn(P);
|
||||||
if (hoDrag in FOptions) and (HitIndex > NoColumn) and (coDraggable in FColumns[HitIndex].FOptions) then
|
// in design-time header columns are always draggable
|
||||||
|
if ((csDesigning in Treeview.ComponentState) and (HitIndex > NoColumn)) or
|
||||||
|
((hoDrag in FOptions) and (HitIndex > NoColumn) and (coDraggable in FColumns[HitIndex].FOptions)) then
|
||||||
begin
|
begin
|
||||||
// Show potential drag operation.
|
// Show potential drag operation.
|
||||||
// Disabled columns do not start a drag operation because they can't be clicked.
|
// Disabled columns do not start a drag operation because they can't be clicked.
|
||||||
@ -10490,7 +10500,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// This is a good opportunity to notify the application.
|
// This is a good opportunity to notify the application.
|
||||||
if IsInHeader then
|
if not (csDesigning in Treeview.ComponentState) and IsInHeader then
|
||||||
FOwner.DoHeaderMouseDown(mbLeft, GetShiftState, P.X, P.Y + Integer(FHeight));
|
FOwner.DoHeaderMouseDown(mbLeft, GetShiftState, P.X, P.Y + Integer(FHeight));
|
||||||
end;
|
end;
|
||||||
LM_RBUTTONDOWN:
|
LM_RBUTTONDOWN:
|
||||||
@ -10679,11 +10689,16 @@ begin
|
|||||||
FCheckBoxHit := False;
|
FCheckBoxHit := False;
|
||||||
end;
|
end;
|
||||||
//Adjust Cursor
|
//Adjust Cursor
|
||||||
if not (csDesigning in FOwner.ComponentState) and (FStates = []) then
|
// Feature: design-time header
|
||||||
|
if (FStates = []) then
|
||||||
begin
|
begin
|
||||||
//todo: see a way to store the user defined cursor.
|
//todo: see a way to store the user defined cursor.
|
||||||
IsHSplitterHit := IsInHeader and HSplitterHit;
|
IsHSplitterHit := HSplitterHit;
|
||||||
IsVSplitterHit := InHeaderSplitterArea(P) and Self.CanSplitterResize(P);
|
// in design-time header columns are always resizable
|
||||||
|
if (csDesigning in Treeview.ComponentState) then
|
||||||
|
IsVSplitterHit := InHeaderSplitterArea(P)
|
||||||
|
else
|
||||||
|
IsVSplitterHit := InHeaderSplitterArea(P) and FHeader.CanSplitterResize(P);
|
||||||
|
|
||||||
if IsVSplitterHit or IsHSplitterHit then
|
if IsVSplitterHit or IsHSplitterHit then
|
||||||
begin
|
begin
|
||||||
@ -16613,8 +16628,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// According to http://www.it-faq.pl/mskb/99/337.HTM there is a problem with ToASCII when used in conjunction
|
// According to https://web.archive.org/web/20041129085958/http://www.it-faq.pl/mskb/99/337.HTM
|
||||||
// with dead chars. The article recommends to call ToASCII twice to restore a deleted flag in the key message
|
// there is a problem with ToASCII when used in conjunction with dead chars.
|
||||||
|
// The article recommends to call ToASCII twice to restore a deleted flag in the key message
|
||||||
// structure under certain circumstances. It turned out it is best to always call ToASCII twice.
|
// structure under certain circumstances. It turned out it is best to always call ToASCII twice.
|
||||||
ToASCII(Message.CharCode, (Message.KeyData shr 16) and 7, KeyState, @Buffer, 0);
|
ToASCII(Message.CharCode, (Message.KeyData shr 16) and 7, KeyState, @Buffer, 0);
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -17003,7 +17019,7 @@ procedure TBaseVirtualTree.WMNCHitTest(var Message: TWMNCHitTest);
|
|||||||
begin
|
begin
|
||||||
{$ifdef DEBUG_VTV}Logger.EnterMethod([lcMessages],'WMNCHitTest');{$endif}
|
{$ifdef DEBUG_VTV}Logger.EnterMethod([lcMessages],'WMNCHitTest');{$endif}
|
||||||
inherited WMNCHitTest(Message);
|
inherited WMNCHitTest(Message);
|
||||||
if not (csDesigning in ComponentState) and (hoVisible in FHeader.FOptions) and
|
if (hoVisible in FHeader.FOptions) and
|
||||||
FHeader.InHeader(ScreenToClient(SmallPointToPoint(Message.Pos))) then
|
FHeader.InHeader(ScreenToClient(SmallPointToPoint(Message.Pos))) then
|
||||||
Message.Result := HTBORDER;
|
Message.Result := HTBORDER;
|
||||||
{$ifdef DEBUG_VTV}Logger.ExitMethod([lcMessages],'WMNCHitTest');{$endif}
|
{$ifdef DEBUG_VTV}Logger.ExitMethod([lcMessages],'WMNCHitTest');{$endif}
|
||||||
@ -24725,6 +24741,10 @@ var
|
|||||||
begin
|
begin
|
||||||
if (tsEditing in FStates) and Assigned(FFocusedNode) then
|
if (tsEditing in FStates) and Assigned(FFocusedNode) then
|
||||||
begin
|
begin
|
||||||
|
if (GetCurrentThreadId <> MainThreadID) then begin
|
||||||
|
// UpdateEditBounds() will be called at the end of the thread
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
if vsMultiline in FFocusedNode.States then
|
if vsMultiline in FFocusedNode.States then
|
||||||
R := GetDisplayRect(FFocusedNode, FEditColumn, True, False)
|
R := GetDisplayRect(FFocusedNode, FEditColumn, True, False)
|
||||||
else
|
else
|
||||||
@ -24752,6 +24772,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
if toShowHorzGridLines in TreeOptions.PaintOptions then
|
if toShowHorzGridLines in TreeOptions.PaintOptions then
|
||||||
Dec(R.Bottom);
|
Dec(R.Bottom);
|
||||||
|
R.Bottom := R.Top + Max(R.Bottom - R.Top, FEditLink.GetBounds.Bottom - FEditLink.GetBounds.Top); // Ensure to never decrease the size of the currently active edit control. Helps to prevent issue #159
|
||||||
FEditLink.SetBounds(R);
|
FEditLink.SetBounds(R);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -31974,7 +31995,9 @@ begin
|
|||||||
not (vsMultiline in FLink.FNode.States) then
|
not (vsMultiline in FLink.FNode.States) then
|
||||||
// Instead directly calling AutoAdjustSize it is necessary on Win9x/Me to decouple this notification message
|
// Instead directly calling AutoAdjustSize it is necessary on Win9x/Me to decouple this notification message
|
||||||
// and eventual resizing. Hence we use a message to accomplish that.
|
// and eventual resizing. Hence we use a message to accomplish that.
|
||||||
AutoAdjustSize;
|
AutoAdjustSize()
|
||||||
|
else
|
||||||
|
Inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
@ -32117,10 +32140,11 @@ begin
|
|||||||
// Read needed space for the current text.
|
// Read needed space for the current text.
|
||||||
GetTextExtentPoint32(DC, PChar(Text), Length(Text), Size);
|
GetTextExtentPoint32(DC, PChar(Text), Length(Text), Size);
|
||||||
Inc(Size.cx, 2 * FLink.FTree.FTextMargin);
|
Inc(Size.cx, 2 * FLink.FTree.FTextMargin);
|
||||||
|
Inc(Size.cy, 2 * FLink.FTree.FTextMargin);
|
||||||
|
Height := Max(Size.cy, Height - 2 * GetSystemMetrics(SM_CYBORDER)); // Ensure a minimum height so that the edit field's content and cursor are displayed correctly.
|
||||||
// Repaint associated node if the edit becomes smaller.
|
// Repaint associated node if the edit becomes smaller.
|
||||||
if Size.cx < Width then
|
if Size.cx < Width then
|
||||||
FLink.FTree.InvalidateNode(FLink.FNode);
|
FLink.FTree.Invalidate();
|
||||||
|
|
||||||
if FLink.FAlignment = taRightJustify then
|
if FLink.FAlignment = taRightJustify then
|
||||||
FLink.SetBounds(Rect(Left + Width - Size.cx, Top, Left + Width, Top + Height))
|
FLink.SetBounds(Rect(Left + Width - Size.cx, Top, Left + Width, Top + Height))
|
||||||
@ -32353,7 +32377,7 @@ begin
|
|||||||
InflateRect(R, -FTree.FTextMargin + lOffset, lOffset);
|
InflateRect(R, -FTree.FTextMargin + lOffset, lOffset);
|
||||||
if not (vsMultiline in FNode.States) then
|
if not (vsMultiline in FNode.States) then
|
||||||
OffsetRect(R, 0, FTextBounds.Top - FEdit.Top);
|
OffsetRect(R, 0, FTextBounds.Top - FEdit.Top);
|
||||||
|
R.Top := Max(-1, R.Top); // A value smaller than -1 will prevent the edit cursor from being shown by Windows, see issue #159
|
||||||
SendMessage(FEdit.Handle, EM_SETRECTNP, 0, LPARAM(@R));
|
SendMessage(FEdit.Handle, EM_SETRECTNP, 0, LPARAM(@R));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -15,3 +15,4 @@
|
|||||||
* Reverted changes is FillBitmap. See if will work as is
|
* Reverted changes is FillBitmap. See if will work as is
|
||||||
* See if will keep TVTHintKind
|
* See if will keep TVTHintKind
|
||||||
* Review thread support
|
* Review thread support
|
||||||
|
* Test design-time header feature. Look for code in WMSetCursor (does not exist in LCL)
|
Reference in New Issue
Block a user