Ignore:
Timestamp:
May 8, 2013, 1:52:33 PM (12 years ago)
Author:
chronos
Message:
  • Added: Support for mouse move handling. Now forms can be moved by dragging title bar.
  • Fixed: Clearing background during painting in screen and forms.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Xvcl/Xvcl.Controls.pas

    r21 r23  
    2323  TMessageMouseDown = class(TMessageMouse);
    2424  TMessageMouseUp = class(TMessageMouse);
     25  TMessageMouseMove = class(TMessageMouse);
    2526
    2627  TKeyState = (ksShift, ksAlt, ksOS);
     
    3738    Control: TControl;
    3839    function AdjustPos(Position: TPoint): TPoint; override;
     40  end;
     41
     42  TControlMove = class
     43    Control: TControl;
     44    StartControlPos: TPoint;
     45    StartMousePos: TPoint;
     46    Active: Boolean;
    3947  end;
    4048
     
    5462  protected
    5563    function GetVideoDevice: TVideoDevice; virtual;
    56   public
    57     Controls: TList<TControl>;
    5864    function HandleMessage(Message: TMessage): Boolean; virtual;
     65  public
     66    Move: TControlMove;
    5967    function ClientToScreen(Position: TPoint): TPoint; virtual;
    6068    function ScreenToClient(Position: TPoint): TPoint; virtual;
     
    7583  TWinControl = class(TControl)
    7684  protected
     85    function HandleMessage(Message: TMessage): Boolean; override;
    7786  public
    7887    Controls: TList<TControl>;
    79     function HandleMessage(Message: TMessage): Boolean; override;
     88    procedure Paint; override;
    8089    constructor Create; override;
    8190    destructor Destroy; override;
     
    115124begin
    116125  inherited;
    117   Controls := TList<TControl>.Create;
     126  Move := TControlMove.Create;
    118127end;
    119128
    120129destructor TControl.Destroy;
    121130begin
    122   Controls.Destroy;
     131  Move.Destroy;
    123132  if Assigned(FCanvas) then FCanvas.Destroy;
    124133  inherited;
     
    159168
    160169procedure TControl.Paint;
    161 var
    162   C: TControl;
    163 begin
    164   for C in Controls do C.Paint;
     170begin
    165171end;
    166172
     
    267273end;
    268274
     275procedure TWinControl.Paint;
     276var
     277  C: TControl;
     278begin
     279  inherited;
     280  for C in Controls do C.Paint;
     281end;
     282
    269283{ TLabel }
    270284
Note: See TracChangeset for help on using the changeset viewer.