Ignore:
Timestamp:
Dec 4, 2023, 9:46:31 PM (5 months ago)
Author:
chronos
Message:
  • Fixed: Build under Linux.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/DpiControls/Dpi.Controls.pas

    r471 r476  
    2020  TControlEx = class(Controls.TControl)
    2121  public
     22    property ParentColor;
    2223    property OnMouseDown;
    2324    property OnMouseUp;
     
    9899    function GetOnClick: TNotifyEvent;
    99100    function GetOnDblClick: TNotifyEvent;
     101    function GetParentColor: Boolean;
    100102    function GetParentFont: Boolean;
    101103    function GetShowHint: Boolean;
     
    117119    procedure SetOnClick(AValue: TNotifyEvent);
    118120    procedure SetOnDblClick(AValue: TNotifyEvent);
     121    procedure SetParentColor(AValue: Boolean);
    119122    procedure SetParentFont(AValue: Boolean);
    120123    procedure SetShowHint(AValue: Boolean);
     
    133136    procedure MouseEnterHandler(Sender: TObject); virtual;
    134137    procedure SetWindowProc(AValue: TWndMethod);
     138    function ColorIsStored: Boolean; virtual;
    135139  protected
    136140    procedure DoBorderSpacingChange(Sender: TObject; InnerSpaceChanged: Boolean); virtual;
     
    158162    property Text: TCaption read GetText write SetText;
    159163    property ParentFont: Boolean read GetParentFont write SetParentFont default True;
     164    property ParentColor: Boolean read GetParentColor write SetParentColor default True;
    160165  public
    161166    function ScreenToClient(const APoint: TPoint): TPoint; virtual;
     
    172177    procedure Update;
    173178    procedure Refresh;
    174     function IsParentOf(AControl: TControl): boolean; virtual;
     179    function IsParentOf(AControl: TControl): Boolean; virtual;
    175180    function Scale96ToScreen(const ASize: Integer): Integer;
    176181    constructor Create(TheOwner: TComponent); override;
     
    196201    property Font: TFont read FFont write SetFont;
    197202    property Align: TAlign read GetAlign write SetAlign;
    198     property Color: TColor read GetColor write SetColor;
     203    property Color: TColor read GetColor write SetColor stored ColorIsStored default {$ifdef UseCLDefault}clDefault{$else}clWindow{$endif};
    199204    property Constraints: TSizeConstraints read FConstraints write FConstraints;
    200205    property Cursor: TCursor read GetCursor write SetCursor default crDefault;
     
    643648end;
    644649
     650function TControl.ColorIsStored: Boolean;
     651begin
     652  Result := not ParentColor;
     653end;
     654
    645655procedure TControl.DoBorderSpacingChange(Sender: TObject;
    646656  InnerSpaceChanged: Boolean);
     
    747757end;
    748758
    749 function TControl.IsParentOf(AControl: TControl): boolean;
     759function TControl.IsParentOf(AControl: TControl): Boolean;
    750760begin
    751761  Result := False;
     
    887897end;
    888898
     899function TControl.GetParentColor: Boolean;
     900begin
     901  Result := TControlEx(GetNativeControl).ParentColor;
     902end;
     903
    889904function TControl.GetParentFont: Boolean;
    890905begin
     
    976991begin
    977992  TControlEx(GetNativeControl).OnDblClick := AValue;
     993end;
     994
     995procedure TControl.SetParentColor(AValue: Boolean);
     996begin
     997  TControlEx(GetNativeControl).ParentColor := AValue;
    978998end;
    979999
Note: See TracChangeset for help on using the changeset viewer.