ExpandGetAndCollapse

From 40tude Dialog Wiki

Expand active thread, get selected message and collapse all other threads

Script description:

When you click on article (or when you move on it with arrow or space keys) at Header List Pane, Dialog expands active thread, gets selected message body and collapses all other threads.

For mouse click detection use 'ARTICLELV_WM_LBUTTONUP' message and get this script:

//    Type  : 40tude Dialog Message script.
//    Name  : ExpandGetAndCollapse
//  Version : 1.0. (2003-09-05)
//  Author  : Doktor (doktorlubicz <at> poczta <dot> onet <dot> pl)

program ARTICLELV_WM_LBUTTONUP;

procedure ExpandGetAndCollapse ();
begin
  lockdisplay;
  try
  ADo ('AddMarker');
  ADo ('CollapseAllThreads');
  ADo ('GoToPreviousMarker');
  ADo ('ExpandThread');
  finally
  unlockdisplay;
  end;
  ADo ('GetSelectedMessageBodies');
end;

procedure OnWMessage (var Msg : TMessage; var handled : boolean);
begin
  ExpandGetAndCollapse ();
  handled := false;
end;

begin
end.





For arrow and space keys detection use 'ARTICLELV_WM_KEYUP' message and get this script:

//    Type  : 40tude Dialog Message script.
//    Name  : ExpandGetAndCollapse
//  Version : 1.0. (2003-09-05)
//  Author  : Doktor (doktorlubicz <at> poczta <dot> onet <dot> pl)

program ARTICLELV_WM_KEYUP;

procedure ExpandGetAndCollapse ();
begin
  lockdisplay;
  try
  ADo ('AddMarker');
  ADo ('CollapseAllThreads');
  ADo ('GoToPreviousMarker');
  ADo ('ExpandThread');
  finally
  unlockdisplay;
  end;
  ADo ('GetSelectedMessageBodies');
end;

procedure OnWMessage (var Msg : TMessage; var handled : boolean);
begin
  ExpandGetAndCollapse ();
  handled := false;
end;

begin
end.