Changeset 476


Ignore:
Timestamp:
Dec 4, 2023, 9:46:31 PM (13 months ago)
Author:
chronos
Message:
  • Fixed: Build under Linux.
Location:
trunk/Packages/DpiControls
Files:
3 edited

Legend:

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

    r475 r476  
    1515    XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean;
    1616function CreateRectRgn(X1, Y1, X2, Y2: Integer): HRGN;
     17{$IFDEF WINDOWS}
    1718function ScrollDC(hDC: HDC; dx: longint; dy: longint; const lprcScroll: RECT;
    1819  const lprcClip:RECT;hrgnUpdate:HRGN; lprcUpdate: LPRECT): WINBOOL; overload;
     20{$ENDIF}
    1921function ScrollDC(Canvas: TCanvas; dx: Longint; dy: Longint; const lprcScroll: TRect;
    2022  const lprcClip:TRect; hrgnUpdate: Handle; lprcUpdate: PRect): Boolean; overload;
     
    5153end;
    5254
     55{$IFDEF WINDOWS}
    5356function ScrollDC(hDC: HDC; dx: longint; dy: longint; const lprcScroll: RECT;
    5457  const lprcClip: RECT; hrgnUpdate: HRGN; lprcUpdate: LPRECT): WINBOOL;
     
    6366    ScaleRectToNative(lprcScroll), ScaleRectToNative(lprcClip), hrgnUpdate, lprcUpdate);
    6467end;
     68{$ENDIF}
    6569
    6670function ScrollDC(Canvas: TCanvas; dx: Longint; dy: Longint;
  • 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
  • trunk/Packages/DpiControls/Dpi.StdCtrls.pas

    r468 r476  
    139139    property Count: Integer read GetCount;
    140140  published
     141    property ParentColor;
    141142    property TopIndex: Integer read GetTopIndex write SetTopIndex default 0;
    142143    property ScrollWidth: Integer read GetScrollWidth write SetScrollWidth default 0;
Note: See TracChangeset for help on using the changeset viewer.