home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 November / Chip_2002-11_cd1.bin / zkuste / delphi / kompon / d3456 / ICQ.ZIP / ICQ / Example / RecvMsg.pas < prev    next >
Pascal/Delphi Source File  |  2002-07-11  |  1KB  |  54 lines

  1. unit RecvMsg;
  2. {(C) Alex Demchenko(alex@ritlabs.com)}
  3.  
  4. interface
  5.  
  6. uses
  7.   Windows, Messages, Classes, Graphics, Controls, Forms,
  8.   StdCtrls, ComCtrls, SendMsg;
  9.  
  10. type
  11.   TRecvMsgForm = class(TForm)
  12.     Button1: TButton;
  13.     Button2: TButton;
  14.     RichEdit1: TRichEdit;
  15.     procedure Button2Click(Sender: TObject);
  16.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  17.     procedure Button1Click(Sender: TObject);
  18.   private
  19.     { Private declarations }
  20.   public
  21.     FSource: String;
  22.   end;
  23.  
  24. var
  25.   RecvMsgForm: TRecvMsgForm;
  26.  
  27. implementation
  28.  
  29. {$R *.dfm}
  30.  
  31. procedure TRecvMsgForm.FormClose(Sender: TObject;
  32.   var Action: TCloseAction);
  33. begin
  34.   Action := caFree;
  35. end;
  36.  
  37. procedure TRecvMsgForm.Button1Click(Sender: TObject);
  38. begin
  39.   with TSendMsgForm.Create(nil) do
  40.   begin
  41.     Caption := 'Send message to: ' + FSource;
  42.     FDest := FSource;
  43.     Show;
  44.   end;
  45.   Close;
  46. end;
  47.  
  48. procedure TRecvMsgForm.Button2Click(Sender: TObject);
  49. begin
  50.   Close;
  51. end;
  52.  
  53. end.
  54.