Recent

Author Topic: TATStatus changing panel property by say file modified state  (Read 1104 times)

zxandris

  • Full Member
  • ***
  • Posts: 170
I've got a TATStatus and I would like it to show a particular panel that shows the filename, if the file is modified i'd like it to show the text as red, or green if not.  I don't seem to be able to find a way of doing this.  Can anyone help me please?


AlexTP

  • Hero Member
  • *****
  • Posts: 2652
    • UVviewsoft
Re: TATStatus changing panel property by say file modified state
« Reply #1 on: June 27, 2025, 07:22:23 am »
1. Place ATStatus on a form
2. In ObjectInspector, add an item to Panels property
3. For new Panels[0], set Caption and FontColor properties

It shows caption in given FontColor for me.
« Last Edit: June 27, 2025, 07:24:23 am by AlexTP »

zxandris

  • Full Member
  • ***
  • Posts: 170
Re: TATStatus changing panel property by say file modified state
« Reply #2 on: June 27, 2025, 07:24:07 am »
That's actually what I've already done, but what I actually want to do is do that on the fly in code, so when the file is modified it changes color during the execution.  Setting it at design time seems simple enough but during execution is what has totally foxed me. :)

1. Place ATStatus on a form
2. In ObjectInspector, add an item to Panels property
3. For this new Panel, set Caption and FontColor properties

It shows caption in given FontColor for me.

AlexTP

  • Hero Member
  • *****
  • Posts: 2652
    • UVviewsoft
Re: TATStatus changing panel property by say file modified state
« Reply #3 on: June 27, 2025, 07:30:33 am »
This code should help?
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   ShowTxt('eee', clGreen);
  4. end;
  5.  
  6. procedure TForm1.ShowTxt(const S: string; AColor: TColor);
  7. var
  8.   D: TATStatusData;
  9. begin
  10.   D:= ATStatus1.GetPanelData(0);
  11.   if Assigned(D) then
  12.   begin
  13.     D.Caption:= S;
  14.     D.ColorFont:= AColor;
  15.   end;
  16. end;        

zxandris

  • Full Member
  • ***
  • Posts: 170
Thank You! That is what I was missing the TATStatusData, I couldn't find anything in the listed properties there but that's exactly what I need.

Thanks,

CJ

This code should help?
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   ShowTxt('eee', clGreen);
  4. end;
  5.  
  6. procedure TForm1.ShowTxt(const S: string; AColor: TColor);
  7. var
  8.   D: TATStatusData;
  9. begin
  10.   D:= ATStatus1.GetPanelData(0);
  11.   if Assigned(D) then
  12.   begin
  13.     D.Caption:= S;
  14.     D.ColorFont:= AColor;
  15.   end;
  16. end;        

 

TinyPortal © 2005-2018