Good morning,
I would like to be able to put next to the time under the message also the status of the message ( Sent, delivered, failed...etc )
Where the time is I can only put the time ?
How can I get the result 06 Nov 08:59 ( read )
These are the settings I used
// Time show and Format
//
chat.MessageTimestamp.Font.Name := chat.GlobalFont.Name;
chat.MessageTimestamp.Font.Size := 9;
chat.MessageTimestamp.Font.Style := [fsItalic];
chat.MessageTimestamp.Format := 'dd mmm hh.nn';
chat.MessageTimestamp.Show := true;
// ..and where I load new message
//
item.Timestamp := mmMSG.FieldByName('Data').AsDateTime;
Currently we don't have a Status property. However, it is a good idea and we'll look into adding something similar.
In the meantime, you can achieve this with a custom drawing implementation, replacing the default timestamp drawing using the OnBeforeDrawTimestamp event:
procedure TForm2.TMSFNCChat1BeforeDrawTimestamp(Sender: TObject;
AGraphics: TTMSFNCGraphics; ARect: TRectF; AItem: TTMSFNCChatItem;
var AAllow: Boolean);
var
sText: string;
sSize: Single;
begin
//1. Disable the default drawing:
AAllow := False;
//2. Get your text that you are going to append to the timestamp:
//(TODO: ideally you want this dynamically, e.g. via AItem.DataString)
sText := ' (read) ';
//3. Shift ARect to the left, so it can fit the appended text:
//(Use CalculateTextWidth to know the size)
sSize := AGraphics.CalculateTextWidth(sText);
ARect.Left := ARect.Left - sSize;
//4. Finally, draw the timestamp + text:
AGraphics.DrawText(ARect, FormatDateTime(TMSFNCChat1.MessageTimestamp.Format, AItem.Timestamp) + sText);
end;