![]() |
Delphi and indy
i have chat application i want To Recive text message in Tembeddedwb because i want to show smileys like this with text :? :evil: any help to implement this ?
|
AW: Delphi and indy
Zitat:
|
AW: Delphi and indy
Some inspiration to get started implementing a chat web page with Indy and jQuery:
![]() |
AW: Delphi and indy
Zitat:
Delphi-Quellcode:
i cant do same with Embedded WB ?
MeMoTEXT.Lines.Add(MSG);
|
AW: Delphi and indy
Why don't you just use standard Unicode characters like 😁 😊 😒 and whatever? That's the same stuff you find on your touch-based Keyboard (Win, Android, iOS). I suppose.
|
AW: Delphi and indy
Zitat:
|
AW: Delphi and indy
Zitat:
You need a HTML page which is generated and updated automatically when a new chat message arrives. So you need a HTTP server (for example TIdHTTPServer), and a good knowledge of HTML. The dynamic HTML content can use animated icons of course. The main problem however is how the HTML page is refreshed when new messages arrive. I recommend to start with a simple prototype, using a JavaScript framework like jQuery, to build a first basic chat app. The basic chat page would contain one public chat room where all messages can be seen by all users. New chat messages can be added as new elements in the HTML document tree. With jQuery, you can delete and append HTML elements very easy, so the client side would only contain some lines of JavaScript. The server needs to build th new HTML elements and serve them to the jQuery script. This is where long polling comes into the play, see my linked article. |
AW: Delphi and indy
Why do you think a Tembeddedwb is able to receive "text messages" with embedded pictures?
When, where and how should "Tembeddedwb" receive those messages, on which port? Why do Facebook/Google/Twitter do have different Messengers, when receiving a "text message in Tembeddedwb" should be sooo simple stupid? SCNR |
AW: Delphi and indy
i search in google and i found this very old code
Delphi-Quellcode:
and this how i find example to add text
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;
Delphi-Quellcode:
i cant get this worked in delphi xe5
addChatText(weblog,'<span class="Name">'+userSetting.Name+':</span> '+ strMsg,1);
Thats why i thought i can do it like Tmemo :) |
AW: Delphi and indy
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:24 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz