unit MesUtils;

interface

//  procedure SaveMessageSeqc(Sender: TObject; MesText: string; BckgColor: integer; FontColor: integer);
  procedure SaveMessageSeqCheckbox(sender: TObject);


implementation
uses
  Numbers,
  MesLogging,
  MesConst,
  VisCheckBox,
  VisSeqc,
  VisSeqdControl;



//procedure SaveMessageSeqc(Sender: TObject; MesText: string; BckgColor: integer; FontColor: integer);
//var
//  seqc: TVisSeqc;
//begin
//  if findSeqc(sender, seqc) then
//    SaveMessageText(
//      MesText,
//      seqc.TagRoot,
//      seqc.objLabel.Caption,
//      BckgColor, FontColor);
//end;



procedure SaveMessageSeqCheckbox(sender: TObject);
var
  cb: TVisCheckBox;
  tagroot: string;
  seqc: TVisSeqc;
  seqname: string;
begin
  if not(sender is TVisCheckBox) then
    exit;

  cb := sender as TVisCheckBox;
  tagroot := cb.HelpKeyword;
  seqname := getSeqdNameByTagroot(tagroot);
  if (seqname = '') and findSeqc(tagroot, seqc) then
    seqname := tagroot + ' ' + seqc.objLabel.Caption;

  if seqname = '' then
    seqname := cb.HelpKeyword;

  SaveMessageText(
    seqname,
    cb.Hint,
    iif(cb.objCheckBox.Checked, 'Вкл', 'Выкл'),
    mcCheckbox_bc, mcCheckbox_fc);
end;



end.

