Skip to content

Commit

Permalink
Another commit
Browse files Browse the repository at this point in the history
  • Loading branch information
salvadorbs committed Jan 2, 2024
1 parent 9991c05 commit 21b7e82
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
54 changes: 27 additions & 27 deletions Source/VirtualTrees.BaseTree.pas
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ TBaseVirtualTree = class abstract(TVTBaseAncestor)

FVclStyleEnabled: Boolean;

{$IFDEF VCLStyleSupport}
{$IFDEF DelphiStyleServices}
procedure CMStyleChanged(var Message: TMessage); message CM_STYLECHANGED;
procedure CMParentDoubleBufferedChange(var Message: TMessage); message CM_PARENTDOUBLEBUFFEREDCHANGED;
{$ENDIF}
Expand Down Expand Up @@ -873,27 +873,27 @@ TBaseVirtualTree = class abstract(TVTBaseAncestor)
function ToggleCallback(Step, StepSize: Integer; Data: Pointer): Boolean;

procedure CMColorChange(var Message: TLMessage); message CM_COLORCHANGED;
{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED;
{$ENDIF}
procedure CMBiDiModeChanged(var Message: TLMessage); message CM_BIDIMODECHANGED;
{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure CMBorderChanged(var Message: TMessage); message CM_BORDERCHANGED;
{$ENDIF}
procedure CMDenySubclassing(var Message: TLMessage); message CM_DENYSUBCLASSING;
{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure CMDrag(var Message: TCMDrag); message CM_DRAG;
procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;
{$ENDIF}
procedure CMFontChanged(var Message: TLMessage); message CM_FONTCHANGED;
procedure CMHintShow(var Message: TCMHintShow); message CM_HINTSHOW;
{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure CMHintShowPause(var Message: TCMHintShowPause); message CM_HINTSHOWPAUSE;
{$ENDIF}
procedure CMMouseEnter(var Message: TLMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TLMessage); message CM_MOUSELEAVE;
procedure CMMouseWheel(var Message: TLMMouseEvent); message LM_MOUSEWHEEL;
{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure CMSysColorChange(var Message: TMessage); message CM_SYSCOLORCHANGE;
{$ENDIF}
{$ifdef EnableNativeTVM}
Expand Down Expand Up @@ -921,7 +921,7 @@ TBaseVirtualTree = class abstract(TVTBaseAncestor)
procedure WMMButtonUp(var Message: TLMMButtonUp); message LM_MBUTTONUP;
{$ifdef EnableNCFunctions}
procedure WMNCCalcSize(var Message: TWMNCCalcSize); message WM_NCCALCSIZE;
{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure WMNCDestroy(var Message: TWMNCDestroy); message WM_NCDESTROY;
{$ENDIF}
procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST;
Expand Down Expand Up @@ -990,7 +990,7 @@ TBaseVirtualTree = class abstract(TVTBaseAncestor)
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWnd; override;
procedure DecVisibleCount;
{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
procedure DefineProperties(Filer: TFiler); override;
{$ENDIF}
procedure DeleteNode(Node: PVirtualNode; Reindex: Boolean; ParentClearing: Boolean); overload;
Expand Down Expand Up @@ -1230,7 +1230,7 @@ TBaseVirtualTree = class abstract(TVTBaseAncestor)
procedure UpdateDesigner; virtual;
procedure UpdateEditBounds; virtual;
procedure UpdateHeaderRect; virtual;
{$ifdef VCLStyleSupport}
{$ifdef DelphiStyleServices}
procedure UpdateStyleElements; override;
{$ifend}
procedure UpdateWindowAndDragImage(const Tree: TBaseVirtualTree; TreeRect: TRect; UpdateNCArea,
Expand All @@ -1242,13 +1242,13 @@ TBaseVirtualTree = class abstract(TVTBaseAncestor)
procedure WriteNode(Stream: TStream; Node: PVirtualNode); virtual;
class procedure RaiseVTError(const Msg: string; HelpContext: Integer); static;

{$ifdef VCLStyleSupport}
{$ifdef DelphiStyleServices}
procedure VclStyleChanged; virtual;
{$ifend}
property VclStyleEnabled: Boolean read GetVclStyleEnabled;
property TotalInternalDataSize: Cardinal read FTotalInternalDataSize;
// Mitigator function to use the correct style service for this context (either the style assigned to the control for Delphi > 10.4 or the application style)
{$ifdef VCLStyleSupport}
{$ifdef DelphiStyleServices}
function StyleServices(AControl: TControl = nil): TCustomStyleServices;
{$ifend}
property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
Expand Down Expand Up @@ -6296,7 +6296,7 @@ procedure TBaseVirtualTree.CMColorChange(var Message: TLMessage);

//----------------------------------------------------------------------------------------------------------------------

{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure TBaseVirtualTree.CMCtl3DChanged(var Message: TMessage);

begin
Expand Down Expand Up @@ -6326,7 +6326,7 @@ procedure TBaseVirtualTree.CMBiDiModeChanged(var Message: TLMessage);
{$ifdef DEBUG_VTV}Logger.Send([lcPaintDetails],'FEffectiveOffsetX after CMBidiModeChanged',FEffectiveOffsetX);{$endif}
end;

{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure TBaseVirtualTree.CMBorderChanged(var Message: TMessage);
begin
inherited;
Expand Down Expand Up @@ -6359,7 +6359,7 @@ procedure TBaseVirtualTree.CMDenySubclassing(var Message: TLMessage);

//----------------------------------------------------------------------------------------------------------------------

{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure TBaseVirtualTree.CMDrag(var Message: TCMDrag);

var
Expand Down Expand Up @@ -6552,7 +6552,7 @@ function TBaseVirtualTree.DoDragMsg(ADragMessage: TDragMessage; APosition: TPoin

//----------------------------------------------------------------------------------------------------------------------

{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure TBaseVirtualTree.CMEnabledChanged(var Message: TMessage);

begin
Expand Down Expand Up @@ -6889,7 +6889,7 @@ procedure TBaseVirtualTree.CMHintShow(var Message: TCMHintShow);

//----------------------------------------------------------------------------------------------------------------------

{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure TBaseVirtualTree.CMHintShowPause(var Message: TCMHintShowPause);

// Tells the application that the tree (and only the tree) does not want a delayed tool tip.
Expand Down Expand Up @@ -7019,7 +7019,7 @@ procedure TBaseVirtualTree.CMMouseWheel(var Message: TLMMouseEvent);

//----------------------------------------------------------------------------------------------------------------------

{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
procedure TBaseVirtualTree.CMSysColorChange(var Message: TMessage);

begin
Expand Down Expand Up @@ -8438,7 +8438,7 @@ procedure TBaseVirtualTree.WMNCPaint(var Message: TWMNCPaint);
finally
ReleaseDC(Handle, DC);
end;
{$IFDEF VCLStyleSupport}
{$IFDEF DelphiStyleServices}
if (((tsUseThemes in FStates) and not VclStyleEnabled) or (VclStyleEnabled and (seBorder in StyleElements))) then
StyleServices.PaintBorder(Self, False)
else
Expand Down Expand Up @@ -9718,7 +9718,7 @@ procedure TBaseVirtualTree.DecVisibleCount;

//----------------------------------------------------------------------------------------------------------------------

{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
procedure TBaseVirtualTree.DefineProperties(Filer: TFiler);

// There were heavy changes in some properties during development of VT. This method helps to make migration easier
Expand Down Expand Up @@ -16321,7 +16321,7 @@ procedure TBaseVirtualTree.StructureChange(Node: PVirtualNode; Reason: TChangeRe

//----------------------------------------------------------------------------------------------------------------------

{$IFDEF VCLStyleSupport}
{$IFDEF DelphiStyleServices}
function TBaseVirtualTree.StyleServices(AControl: TControl): TCustomStyleServices;
begin
if AControl = nil then
Expand Down Expand Up @@ -16849,7 +16849,7 @@ procedure TBaseVirtualTree.ValidateNodeDataSize(var Size: Integer);

//----------------------------------------------------------------------------------------------------------------------

{$ifdef VCLStyleSupport}
{$ifdef DelphiStyleServices}
procedure TBaseVirtualTree.VclStyleChanged();

// Updates the member FVclStyleEnabled, should be called initially and when the VCL style changes
Expand Down Expand Up @@ -17159,7 +17159,7 @@ procedure TBaseVirtualTree.Assign(Source: TPersistent);
Self.Color := Color;
Self.Colors.Assign(Colors);
Self.Constraints.Assign(Constraints);
{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
Self.Ctl3D := Ctl3D;
{$ENDIF}
Self.DefaultNodeHeight := DefaultNodeHeight;
Expand All @@ -17174,7 +17174,7 @@ procedure TBaseVirtualTree.Assign(Source: TPersistent);
Self.HintMode := HintMode;
Self.HotCursor := HotCursor;
Self.Images := Images;
{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
Self.ImeMode := ImeMode;
Self.ImeName := ImeName;
{$ENDIF}
Expand All @@ -17183,11 +17183,11 @@ procedure TBaseVirtualTree.Assign(Source: TPersistent);
Self.NodeAlignment := NodeAlignment;
Self.NodeDataSize := NodeDataSize;
Self.TreeOptions := TreeOptions;
{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
Self.ParentBiDiMode := ParentBiDiMode;
{$ENDIF}
Self.ParentColor := ParentColor;
{$IFDEF DelphiWinEvents}
{$IFDEF DelphiSupport}
Self.ParentCtl3D := ParentCtl3D;
{$ENDIF}
Self.ParentFont := ParentFont;
Expand All @@ -17197,7 +17197,7 @@ procedure TBaseVirtualTree.Assign(Source: TPersistent);
Self.ScrollBarOptions := ScrollBarOptions;
Self.ShowHint := ShowHint;
Self.StateImages := StateImages;
{$IFDEF VCLStyleSupport}
{$IFDEF DelphiStyleServices}
Self.StyleElements := StyleElements;
{$ENDIF}
Self.TabOrder := TabOrder;
Expand Down Expand Up @@ -24152,7 +24152,7 @@ procedure TBaseVirtualTree.UpdateScrollBars(DoRepaint: Boolean);

//----------------------------------------------------------------------------------------------------------------------

{$ifdef VCLStyleSupport}
{$ifdef DelphiStyleServices}
procedure TBaseVirtualTree.UpdateStyleElements;
begin
inherited;
Expand Down
2 changes: 1 addition & 1 deletion Source/VirtualTrees.EditLink.pas
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TVTEdit = class(TCustomEdit)
property CharCase;
property HideSelection;
property MaxLength;
{$IFDEF DelphiProps}
{$IFDEF DelphiSupport}
property OEMConvert;
{$ENDIF}
property PasswordChar;
Expand Down
8 changes: 4 additions & 4 deletions Source/VirtualTrees.Header.pas
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ TVTHeader = class(TPersistent)
procedure RescaleHeader;
procedure UpdateMainColumn;
procedure UpdateSpringColumns;
{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
procedure WriteColumns(Writer : TWriter);
{$ENDIF}
procedure InternalSetMainColumn(const Index : TColumnIndex);
Expand Down Expand Up @@ -2273,7 +2273,7 @@ procedure TVTHeader.UpdateSpringColumns;

//----------------------------------------------------------------------------------------------------------------------

{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
type
//--- HACK WARNING!
//This type cast is a partial rewrite of the private section of TWriter. The purpose is to have access to
Expand Down Expand Up @@ -2458,12 +2458,12 @@ procedure TVTHeader.FixDesignFontsPPI(const ADesignTimePPI: Integer);
function TVTHeader.InHeader(P : TPoint) : Boolean;

//Determines whether the given point (client coordinates!) is within the header rectangle (non-client coordinates).
{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
var
R, RW : TRect;
{$IFEND}
begin
{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
R := Tree.HeaderRect;

//Current position of the owner in screen coordinates.
Expand Down
16 changes: 8 additions & 8 deletions Source/VirtualTrees.Utils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ procedure SetCanvasOrigin(Canvas: TCanvas; X, Y: Integer); inline;
/// </summary>
procedure ClipCanvas(Canvas: TCanvas; ClipRect: TRect; VisibleRegion: HRGN = 0);

{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
procedure DrawImage(ImageList: TCustomImageList; Index: Integer; Canvas: TCanvas; X, Y: Integer; Style: Cardinal; Enabled: Boolean);
{$ENDIF}

Expand All @@ -70,7 +70,7 @@ procedure DrawImage(ImageList: TCustomImageList; Index: Integer; Canvas: TCanvas
/// </summary>
function ShortenString(DC: HDC; const S: string; Width: TDimension; EllipsisWidth: TDimension = 0): string; overload;

{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
//--------------------------
// ShortenString similar to VTV's version, except:
// -- Does not assume using three dots or any particular character for ellipsis
Expand Down Expand Up @@ -106,7 +106,7 @@ function OrderRect(const R: TRect): TRect;
/// </remarks>
procedure FillDragRectangles(DragWidth, DragHeight, DeltaX, DeltaY: Integer; var RClip, RScroll, RSamp1, RSamp2, RDraw1, RDraw2: TRect);

{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
/// <summary>
/// Attaches a bitmap as drag image to an IDataObject, see issue #405
/// <code>
Expand All @@ -123,7 +123,7 @@ procedure ApplyDragImage(const pDataObject: IDataObject; pBitmap: TBitmap);
/// </summary>
function IsMouseCursorVisible(): Boolean;

{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
procedure ScaleImageList(const ImgList: TImageList; M, D: Integer);

/// <summary>
Expand All @@ -140,7 +140,7 @@ function IsHighContrastEnabled(): Boolean;
/// </summary>
function Divide(const Dimension: Integer; const DivideBy: Integer): Integer; overload; inline;

{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
/// <summary>
/// Divide depend of parameter type uses different division operator:
/// <code>Integer uses div</code>
Expand All @@ -155,7 +155,7 @@ function GetBitmapBitsFromBitmap(Bitmap: HBITMAP): Pointer;

implementation

{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
procedure ApplyDragImage(const pDataObject: IDataObject; pBitmap: TBitmap);
var
DragSourceHelper: IDragSourceHelper;
Expand Down Expand Up @@ -380,7 +380,7 @@ function ShortenString(DC: HDC; const S: string; Width: TDimension; EllipsisWidt
end;
{$endif}

{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
//--------------------------
function ShortenString(TargetCanvasDC: HDC; const StrIn: string; const AllowedWidth_px: Integer; const EllipsisWidth_px: Integer; var ShortenedString: string): boolean;
//--------------------------
Expand Down Expand Up @@ -847,7 +847,7 @@ function IsHighContrastEnabled(): Boolean;
Result := False;
end;

{$IFDEF OnlyDelphiSupport}
{$IFDEF DelphiSupport}
function Divide(const Dimension: Single; const DivideBy: Integer): Single;
begin
Result:= Dimension / DivideBy;
Expand Down

0 comments on commit 21b7e82

Please sign in to comment.