Ignore:
Timestamp:
May 6, 2013, 12:16:30 AM (12 years ago)
Author:
chronos
Message:
  • Modified: Improved messages passing to controls.
  • Modified: Now TButton change background color during mouse click.
Location:
branches/Xvcl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Xvcl

    • Property svn:ignore
      •  

        old new  
        22*.local
        33Win32
         4__history
  • branches/Xvcl/Xvcl.Kernel.pas

    r19 r20  
    4545  TMouse = class
    4646    Kernel: TKernel;
    47     procedure HandleClick(Position: TPoint);
     47    procedure HandleDown(Position: TPoint);
     48    procedure HandleUp(Position: TPoint);
    4849  end;
    4950
     
    199200{ TMouse }
    200201
    201 procedure TMouse.HandleClick(Position: TPoint);
     202procedure TMouse.HandleDown(Position: TPoint);
    202203var
    203204  Form: TForm;
    204 begin
    205   for Form in Kernel.Screen.Forms do begin
    206     Form.HandleClick(Position.Substract(Form.Bounds.LeftTop));
     205  NewMessage: TMessageMouse;
     206begin
     207  NewMessage := TMessageMouseDown.Create;
     208  NewMessage.Position := Position;
     209  try
     210    for Form in Kernel.Screen.Forms do begin
     211      if Form.HandleMessage(NewMessage) then begin
     212        Break;
     213      end;
     214    end;
     215  finally
     216    NewMessage.Destroy;
     217  end;
     218end;
     219
     220procedure TMouse.HandleUp(Position: TPoint);
     221var
     222  Form: TForm;
     223  NewMessage: TMessageMouse;
     224begin
     225  NewMessage := TMessageMouseUp.Create;
     226  NewMessage.Position := Position;
     227  try
     228    for Form in Kernel.Screen.Forms do begin
     229      if Form.HandleMessage(NewMessage) then begin
     230        Break;
     231      end;
     232    end;
     233  finally
     234    NewMessage.Destroy;
    207235  end;
    208236end;
Note: See TracChangeset for help on using the changeset viewer.