Home > Back-end >  XE7 WebBrowser new TAB page reloading use iframe problem, and the new popup TAB inheritance for chil
XE7 WebBrowser new TAB page reloading use iframe problem, and the new popup TAB inheritance for chil

Time:09-27

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//EmbeddedWB - Tabs Demo *
//*
//by *
//Eran Bodankin (bsalsa) *
//[email protected] *
//*
//Documentation and updated versions: *
//*
http://www.bsalsa.com//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
{LICENSE:
YOU THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT giant OF ANY KIND,
EITHER EXPRESSED OR IMPLIED o BUT NOT LIMITED TO THE APPLIED
WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
YOU ASSUME THE - RISK AS TO THE ACCURACY AND THE USE OF THE SOFTWARE
AND ALL OTHER RISK ARISING OUT OF THE USE OR PERFORMANCE OF THIS SOFTWARE
AND DOCUMENTATION. THE BSALSA PRODUCTIONS DOES NOT WARRANT THAT THE SOFTWARE IS ERROR - FREE
OR WILL OPERATE WITHOUT INTERRUPTION. THE SOFTWARE IS NOT DESIGNED, INTENDED
The OR LICENSED FOR USE IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL - SAFE CONTROLS,
O WITHOUT LIMITATION, THE DESIGN, CONSTRUCTION, MAINTENANCE OR
The OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS,
AIR TRAFFIC CONTROL, AND LIFE SUPPORT OR was SYSTEMS. The BSALSA PRODUCTIONS SPECIFICALLY
DISCLAIMS ANY EXPRESS OR IMPLIED giant OF FITNESS FOR to the PURPOSE.

You may use, change or modify the demo under the conditions:
1. In your website, add a link to "http://www.bsalsa.com"
2. In your application, add credits to "Embedded Web Browser
"3. Email me ([email protected]) any code change in the unit
For the practice of the other users.
4. Both Please, consider donation in our web site!
{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}

The unit fmMain;

Interface

USES the
Classes, Controls, Forms, ComCtrls ExtCtrls, StdCtrls, OleCtrls, SysUtils,
IEAddress EwbCore, EmbeddedWB ShDocVw_Ewb;

Type
TTabSheetEx=class (TTabSheet)
Private
EWB: TEmbeddedWB;
CanBack: Boolean;
CanForward: Boolean;
CanStop: Boolean;
end;

Type
TForm1=class (TForm)
Panel1: TPanel;
PageControl1: TPageControl;
BtnGo: TButton;
BtnBack: TButton;
BtnForward: TButton;
IEAddress1: TIEAddress;
StatusBar1: TStatusBar;
CbOpenNew: TCheckBox;
BtnStop: TButton;
Procedure PageControl1Change (Sender: TObject);
Procedure btnGoClick (Sender: TObject);
Procedure btnForwardClick (Sender: TObject);
Procedure btnBackClick (Sender: TObject);
Procedure FormShow (Sender: TObject);
Procedure btnStopClick (Sender: TObject);
Private
{Private declarations}
Procedure DownloadCompleteEvent (Sender: TObject);
Procedure CommandStateChangeEvent (Sender: TObject; Command: Integer; Enable: WordBool);
Procedure UpdateControls;
Procedure CreateNewTabBrowser (Url: string);
Procedure NewWindow2Event (Sender: TObject; Var ppDisp: IDispatch; Var Cancel: WordBool);
Procedure StatusTextChangeEvent (Sender: TObject; Const Text: WideString);
Public
{Public declarations}
end;

Var
Form1: TForm1;
TabSheetEx: TTabSheetEx;

Implementation

{$R *. DFM}


Procedure TForm1. UpdateControls;
Var
TabEx: TTabSheetEx;
The begin
TabEx:=(PageControl1. ActivePage as TTabSheetEx);
IEAddress1. Text:=TabEx. EWB. LocationURL;
PageControl1. ActivePage. Caption:=TabEx. EWB. LocationName;
Form1. Caption:=TabEx. EWB. LocationName;
BtnForward. Enabled:=TabEx. CanForward;
BtnBack. Enabled:=TabEx. CanBack;
BtnStop. Enabled:=TabEx. CanStop;
end;

Procedure TForm1. DownloadCompleteEvent (Sender: TObject);
The begin
UpdateControls;
end;

Procedure TForm1. FormShow (Sender: TObject);
The begin
CreateNewTabBrowser (' http://bsalsa.com/forum/');
UpdateControls;
end;

Procedure TForm1. CreateNewTabBrowser (Url: string);
The begin
TabSheetEx:=TTabSheetEx. Create (PageControl1);
With TabSheetEx do
The begin
PageControl:=PageControl1;
EWB:=TEmbeddedWB. Create (TabSheetEx);
Caption:='Loading... ';
TOleControl (TabSheetEx. EWB). Parent:=TabSheetEx;
PageControl1. ActivePage:=TabSheetEx;
With EWB do
The begin
LoadSettings;
Align:=alClient;
Visible:=True;
OnStatusTextChange:=StatusTextChangeEvent;
OnNewWindow2:=NewWindow2Event;
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull