unit Unit1;

interface

uses
     wxoUnit,
     wxoExec,
     //
     XPMan,
     DateUtils,
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Panel_All: TPanel;
    Panel2: TPanel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Edit1: TEdit;
    Button4: TButton;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Unit2;

{$R *.dfm}

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
     ShowMessage('This is Closed by WXO');
end;                                              

procedure TForm1.FormCreate(Sender: TObject);
begin
     //ÉèÖÃWebXone¿ØÖÆ
     wxoPrepare(Handle,Application.Handle);
     //ShowMessage(gsUrl);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
     try
          Form1.Panel_All.Enabled  := False;
          Windows.SetParent(Form2.Handle,Handle);
          Form2.ShowModal;
     finally
          Form1.Panel_All.Enabled  := True;
     end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
     //¹Ø±ÕÒ³Ãæ
     wxoClose;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
     ShowMessage(gsUrl);
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
     wxoSendMessage(giApp,
               Handle,
               'RNJS',
               Handle,
               'window.document.title = "'+Edit1.Text+'"');

end;

end.
