Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Delphi xe5 And TEmbeddedWB (http://www.chiefdelphi.com/forums/showthread.php?t=130782)

Drama22 11-10-2014 10:43

Delphi xe5 And TEmbeddedWB
 
hello iam new in this forum i have question i never found any answer for it in another forum i have chat application bulid with indy Tcp and its multichat application that client can send message to all other connected clients and receive it in Tmemo but in finalizing i decided To change Tmemo To TEmbeddedWB because i want the clients embedded Youtube videos and smileys like this ::ouch:: , but i dont know how to implement this with TEmbeddedWB how can i show what client type to other connected clients in TEmbeddedWB , i found this old code but i did not understand any thing from it

code to addText

Code:

procedure addChatText(WB: TEmbeddedWB; const html: string;add:integer = 0);
var
  Range: IHTMLTxtRange;
  mText : string;
  ext : string;
  sURL : string;
  i : Integer;
begin
  if not joined then Exit;

  if Not Assigned(Wb.Document) then exit;
  Range := ((WB.Document AS IHTMLDocument2).body AS IHTMLBodyElement).createTextRange;
  Range.Collapse(False) ;

  if add = 1 then
  begin
    if ChatContent <> nil then
    begin
      ChatContent.Add(html+'<BR>');
      mText := ChatContent.Text;
    end else
    begin
      mText := html+'<BR>';
    end;
  end else begin
    mText := html+'<BR>';
  end;

  if ChatContent <> nil then
  begin
    if ChatContent.Count > ChatContentTotal then
    begin
      for i := 0 to 10 do
      begin
        ChatContent.Delete(0);
      end;
    end;
// while (ChatContent.Count) > ChatContentTotal do ChatContent.Delete(0);
  end;

  mText := Replace(mText,'!res!url!',sURL);
  mText := Replace(mText,'£££',ext);
  chatClear(WB,0);
  Range.PasteHTML(mText);
  // WB.Body.innerHTML := mText;
  if OptionsIni.SoftScrolling = 0 then chatScroll(WB);
end;

code must be used when client click send

Code:

addChatText(weblog,'<span class="Name">'+Name+':</span> '+ Msg,1);
But its not working not shwing any thing in TEmbeddedWB always empty


All times are GMT -5. The time now is 23:16.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi