Talktimer blinken lassen

Bitte nochmals testen:

const
  TALK_TIME = 90;                // Zeit in Sekunden bis zur Warnung

  BUTTON_NAME = 'BUTTON.TALK';   // Name des statischen Textes

  BCOLOR_ON  = '#FF0000';        // Hintergrundfarbe "an"
  BCOLOR_OFF = '#8A0808';        // Hintergrundfarbe "aus"
  FCOLOR_ON  = '#F7F8E0';        // Schriftfarbe "an"
  FCOLOR_OFF = '#848484';        // Schriftfarbe "aus"
      
var
  TalktimerOn, ButtonStatus: boolean;
  
procedure ButtonOn;
begin
  ExecuteCommand(BUTTON_NAME + ' FONTCOLOR ' + FCOLOR_ON);
  ExecuteCommand(BUTTON_NAME + ' BACKGROUNDCOLOR ' + BCOLOR_ON);
  ButtonStatus := true;
end;

procedure ButtonOff;
begin
  ExecuteCommand(BUTTON_NAME + ' FONTCOLOR ' + FCOLOR_OFF);
  ExecuteCommand(BUTTON_NAME + ' BACKGROUNDCOLOR ' + BCOLOR_OFF);
  ButtonStatus := false;
end;

procedure ButtonFlash;
begin
  EnableTimerEx('Flash', 750);
end;

procedure ButtonStop;
begin
  DisableTimerEx('Flash');
  ButtonOff;
end;

procedure OnLoad;
begin
  TalktimerOn := false;
  ButtonOff;
end;

procedure OnTimerEx(ID: string);
begin
  if ID = 'Time' then
  begin
    ButtonFlash;
    DisableTimerEx('Time');
  end;
  if ID = 'Flash' then
  begin
    if ButtonStatus then
      ButtonOff
    else
      ButtonOn;
  end;
end;

procedure OnEncoderInputToggle(Input: TEncoderInput; NewState: boolean);
begin
  if Input = eiMic then begin
    if NewState = true then
    begin
      ExecuteCommand('TALKTIMER START');
      if TALK_TIME > 0 then
        EnableTimerEx('Time', TALK_TIME * 1000);
    end
    else begin
      ExecuteCommand('TALKTIMER STOP');
      DisableTimerEx('Time');
      ButtonStop;
    end;
  end;
end;

begin
end.


Sorry for any inconvenience caused.