Changeset 159


Ignore:
Timestamp:
Dec 22, 2018, 4:39:19 PM (5 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Components/DrawDlg.pas

    r111 r159  
    6666procedure TDrawDlg.OnHitTest(var Msg: TMessage);
    6767var
    68   i: integer;
     68  I: integer;
    6969  ControlBounds: TRect;
     70  Pos: TPoint;
    7071begin
    7172  if BorderStyle <> bsNone then
     
    7374  else
    7475  begin
    75     if integer((Msg.LParam shr 16) and $ffff) >= Top + TitleHeight then
    76       Msg.result := HTCLIENT
     76    Pos := Point(Integer(Msg.LParam and $ffff),
     77      Integer((Msg.LParam shr 16) and $ffff));
     78    if Pos.Y >= Top + TitleHeight then
     79      Msg.Result := HTCLIENT
    7780    else
    7881    begin
    79       for i := 0 to ControlCount - 1 do
    80         if Controls[i].Visible then
     82      for I := 0 to ControlCount - 1 do
     83        if Controls[I].Visible then
    8184        begin
    82           ControlBounds := Controls[i].BoundsRect;
    83           if (integer(Msg.LParam and $ffff) >= Left + ControlBounds.Left) and
    84             (integer(Msg.LParam and $ffff) < Left + ControlBounds.Right) and
    85             (integer((Msg.LParam shr 16 ) and $ffff) >= Top + ControlBounds.Top) and
    86             (integer((Msg.LParam shr 16) and $ffff) < Top + ControlBounds.Bottom) then
     85          ControlBounds := Controls[I].BoundsRect;
     86          if (Pos.X >= Left + ControlBounds.Left) and
     87            (Pos.X < Left + ControlBounds.Right) and
     88            (Pos.Y >= Top + ControlBounds.Top) and
     89            (Pos.Y < Top + ControlBounds.Bottom) then
    8790          begin
    8891            Msg.result := HTCLIENT;
    89             exit;
     92            Exit;
    9093          end;
    9194        end;
    92       Msg.result := HTCAPTION
    93     end;
    94   end
     95      Msg.Result := HTCAPTION
     96    end;
     97  end;
    9598end;
    9699
Note: See TracChangeset for help on using the changeset viewer.