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.Kernel.pas

    r23 r24  
    3333
    3434  TScreen = class(TComponent)
    35     Canvas: TCanvas;
     35    Canvas: TScreenCanvas;
    3636    Size: TPoint;
    3737    Forms: TList<TForm>;
    3838    VideoDevice: TVideoDevice;
    3939    procedure Paint;
     40    procedure FocusForm(Form: TForm);
    4041    constructor Create; override;
    4142    destructor Destroy; override;
     
    152153  Forms := TList<TForm>.Create;
    153154  Canvas := TScreenCanvas.Create;
     155  Canvas.Screen := Self;
    154156end;
    155157
     
    159161  Forms.Destroy;
    160162  inherited;
     163end;
     164
     165procedure TScreen.FocusForm(Form: TForm);
     166var
     167  I: Integer;
     168  FormIndex: Integer;
     169begin
     170  FormIndex := Forms.IndexOf(Form);
     171  for I := 0 to Forms.Count - 1 do
     172    Forms[I].Focused := I = FormIndex;
     173
     174  Forms.Move(FormsIndex, Forms.Count - 1);
     175  Paint;
    161176end;
    162177
Note: See TracChangeset for help on using the changeset viewer.