DisplayAgentThreads

From 40tude Dialog Wiki

Display Threads in Agent- and Xnews-Style

This script was kindly donated by Matija. He also made the x-now-playing script. Thanks Matija!

To make Dialog behave like Agent or Xnews when displaying threads (Thread title displayed once, follow-ups with the authors name only), you'll have to make a few changes in the header layout and use the included script.


Here you can find an enhanced version of this script.


To have an impression how it looks like, take a look at the following screenshot.


Setup & Installation

Header Layout changes:
Change the Subject column to %subjectnamechange%
Leave the Name (From) column it as it is (%fromname%).

Paste the script in Event scripts -> OnArticleListPaint, save, compile and run. The column numbers affected are in the const statement.


Warning

Please read the Painting script warning page before trying out this script.


program OnArticleListPaint;

function OnArticleListPaint(PaintString:widestring;ColumnIndex:integer):widestring;

var n:integer;
    c:widestring;
    tmpstring:widestring;

begin
  tmpstring := paintstring;
  n := length(tmpstring);

  if (n > 0) then
    begin
      n := length(tmpstring);

      c := copy(tmpstring, n, 1);
      if c = ')' then
        begin
          while (n > 1) do
            begin
              n := n - 1;
              c := copy(tmpstring, n, 1);
              if c = '(' then
                begin
                  result := copy (tmpstring, 1, n-2);
                  exit;
                end;
            end;
        end;
    end;
  result := tmpstring;
end;

begin
end.

J. Cifer, René Fischer