unit UTailleTampRecVisu;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, Buttons;

type
  TTailleTampRecVisuDLGForm = class(TForm)
    TailleTamponEdit: TEdit;
    NomCanauxLabel: TLabel;
    TailleTamponAlphaTimer: TTimer;
    BitBtn2: TBitBtn;
    BitBtn1: TBitBtn;
    EnregCheckBox: TCheckBox;
    VisuCheckBox: TCheckBox;
    Label1: TLabel;
    procedure TailleTamponAlphaTimerTimer(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure TailleTamponEditKeyPress(Sender: TObject; var Key: Char);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;

var
  TailleTampRecVisuDLGForm: TTailleTampRecVisuDLGForm;

implementation

uses UDocometre, XMLClasses;

{$R *.dfm}

procedure TTailleTampRecVisuDLGForm.TailleTamponAlphaTimerTimer(Sender: TObject);
var i,n1,n2 : integer;
    S : string;
begin
  if ALphaBlendValue < 240
  then ALphaBlendValue := ALphaBlendValue + 40
  else begin
    ALphaBlendValue := 255;
    TailleTamponAlphaTimer.Enabled := false;
  end;
  n1 := DocoForm.OptionsExecFrame.TampTrsfrtRecVisuStringGrid.Selection.Top;
  n2 := DocoForm.OptionsExecFrame.TampTrsfrtRecVisuStringGrid.Selection.Bottom;

  S := '';
  for i := n1 to n1 + 2 do
  begin
    if i<=n2
    then S := S + DocoForm.OptionsExecFrame.TampTrsfrtRecVisuStringGrid.Cells[2,i] + ' '
  end;
  S := S + ' ...';
  NomCanauxLabel.Caption := S;
end;

procedure TTailleTampRecVisuDLGForm.FormShow(Sender: TObject);
var n1,n2 : integer;
begin
  ALphaBlendValue := 0;
  TailleTamponAlphaTimer.Enabled := true;
  n1 := DocoForm.OptionsExecFrame.TampTrsfrtRecVisuStringGrid.Selection.Top;
  n2 := DocoForm.OptionsExecFrame.TampTrsfrtRecVisuStringGrid.Selection.Bottom;
  if n1 = n2
  then TailleTamponEdit.Text := DocoForm.OptionsExecFrame.TampTrsfrtRecVisuStringGrid.Cells[3,n1];
end;

procedure TTailleTampRecVisuDLGForm.TailleTamponEditKeyPress(Sender: TObject;
  var Key: Char);
begin
  if not (key in ['0'..'9',Char(VK_BACK),Char(VK_DELETE)]) then key := #0;
end;

end.
