Ignore:
Timestamp:
May 8, 2013, 2:53:22 PM (11 years ago)
Author:
chronos
Message:
  • Fixed: Make only one form focused at once.
  • Modified: Enhanced TList generic class to support more methods.
File:
1 edited

Legend:

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

    r23 r24  
    6666  with TMessageMouseDown(Message) do begin
    6767    TitleBarBounds := TRectangle.Create(0, 0, Bounds.Width, TitleBarHeight);
     68    Focused := True;
    6869    if TitleBarBounds.Contains(ScreenToClient(Position)) then begin
    69       Focused := True;
    70       Result := True;
    7170      Move.StartControlPos := Bounds.TopLeft;
    7271      Move.StartMousePos := Position;
    7372      Move.Active := True;
     73     Result := True;
    7474    end;
    7575  end else
     
    9090procedure TForm.Paint;
    9191begin
     92  inherited;
    9293  with Canvas do begin
    93     Canvas.Brush.Color := clWhite;
    94     Canvas.FillRect(TRectangle.Create(0, TitleBarHeight, Size.X, Size.Y));
    9594    if Focused then Brush.Color := clLightBlue else
    9695      Brush.Color := clSilver;
     
    106105      (TitleBarHeight - GetTextSize(Caption).Y) div 2), Caption);
    107106  end;
    108   inherited;
    109107end;
    110108
    111109procedure TForm.SetFocused(const Value: Boolean);
    112110begin
    113   FFocused := Value;
    114   Paint;
     111  if FFocused <> Value then begin
     112    FFocused := Value;
     113    if Value then TScreen(Screen).FocusForm(Self);
     114  end;
    115115end;
    116116
Note: See TracChangeset for help on using the changeset viewer.