Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi and indy (https://www.delphipraxis.net/182182-delphi-indy.html)

drama22 7. Okt 2014 17:43

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 ?

mjustin 7. Okt 2014 17:52

AW: Delphi and indy
 
Zitat:

Zitat von drama22 (Beitrag 1275155)
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 ?

Do you plan to implement the HTTP server with Indy (TIdHTTPServer)?

mjustin 7. Okt 2014 17:54

AW: Delphi and indy
 
Some inspiration to get started implementing a chat web page with Indy and jQuery:

How can I update HTML pages dynamically with Indy HTTP server using jQuery and “Long Polling”?

drama22 7. Okt 2014 18:46

AW: Delphi and indy
 
Zitat:

Zitat von mjustin (Beitrag 1275157)
Zitat:

Zitat von drama22 (Beitrag 1275155)
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 ?

Do you plan to implement the HTTP server with Indy (TIdHTTPServer)?

do i have to use TIDHTTP and get message in webpage ? i cant do it directly ? like sending message from TMEMO and show it in Embedded WB ? i usuaily do this with after sending the message

Delphi-Quellcode:
MeMoTEXT.Lines.Add(MSG);
i cant do same with Embedded WB ?

Der schöne Günther 7. Okt 2014 18:54

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.

drama22 8. Okt 2014 15:33

AW: Delphi and indy
 
Zitat:

Zitat von Der schöne Günther (Beitrag 1275167)
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.

i need it animated images beside :roll: :cyclops: :lol: :x :| Looks Nice more then the keyboard emoji

mjustin 8. Okt 2014 17:15

AW: Delphi and indy
 
Zitat:

Zitat von drama22 (Beitrag 1275165)

do i have to use TIDHTTP and get message in webpage ?

i usuaily do this with after sending the message

Delphi-Quellcode:
MeMoTEXT.Lines.Add(MSG);
i cant do same with Embedded WB ?

No, you can not use Memo Lines in a web browser. A web browser renders HTML and optionally processes JavaScript.

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.

pelzig 8. Okt 2014 17:25

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

drama22 9. Okt 2014 00:36

AW: Delphi and indy
 
i search in google and i found this very old code
Delphi-Quellcode:
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;
and this how i find example to add text
Delphi-Quellcode:
addChatText(weblog,'<span class="Name">'+userSetting.Name+':</span> '+ strMsg,1);
i cant get this worked in delphi xe5

Thats why i thought i can do it like Tmemo :)

drama22 9. Okt 2014 00:43

AW: Delphi and indy
 
Zitat:

Zitat von mjustin (Beitrag 1275288)
Zitat:

Zitat von drama22 (Beitrag 1275165)

do i have to use TIDHTTP and get message in webpage ?

i usuaily do this with after sending the message

Delphi-Quellcode:
MeMoTEXT.Lines.Add(MSG);
i cant do same with Embedded WB ?

No, you can not use Memo Lines in a web browser. A web browser renders HTML and optionally processes JavaScript.

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.

i have good knoweledge in html and php and js and css iam still new in delphi the project that i worked on its like Paltalk its multiple chat room i dont think app like paltalk using IDHTTP can i do it inside delphi ? adding smiles and color of text with any good component ?


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:24 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz