You've already forked lazarus-ccr
Reintroduced overrides for CreateWnd because the component creation at runtime will not work without it. Refactored the initialization to not be called 2 times, one from Loaded and one from CreateWnd. Tested win32 but it should not affect other widgetsets.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1380 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -183,6 +183,7 @@ type
|
||||
|
||||
//misc settings
|
||||
FDisableJavaScript: Boolean;
|
||||
FInitializationStarted: Boolean;
|
||||
FInitialized: Boolean;
|
||||
|
||||
function GetDisableJavaScript: Boolean;
|
||||
@ -208,6 +209,7 @@ type
|
||||
//function GetMarkupDocumentViewer: nsIMarkupDocumentViewer;
|
||||
//function GetDocShell: nsIDocShell;
|
||||
//function GetDocumentCharsetInfo: nsIDocumentCharsetInfo;
|
||||
procedure DoInitializationIfNeeded;
|
||||
protected
|
||||
procedure Paint; override;
|
||||
public
|
||||
@ -239,6 +241,10 @@ type
|
||||
procedure Resize; override;
|
||||
|
||||
procedure Loaded; override;
|
||||
|
||||
//TWinControl
|
||||
procedure CreateWnd; override;
|
||||
procedure DestroyWnd; override;
|
||||
protected
|
||||
property Chrome: TCustomGeckoBrowserChrome
|
||||
read FChrome write SetChrome;
|
||||
@ -1054,17 +1060,24 @@ end;
|
||||
procedure TCustomGeckoBrowser.Loaded;
|
||||
begin
|
||||
inherited Loaded;
|
||||
if not (csDesigning in ComponentState) then
|
||||
DoInitializationIfNeeded;
|
||||
end;
|
||||
|
||||
procedure TCustomGeckoBrowser.CreateWnd;
|
||||
begin
|
||||
InitWebBrowser;
|
||||
LoadURI('about:blank');
|
||||
FInitialized:=true;
|
||||
if Assigned(FOnSetupProperties) then begin
|
||||
FOnSetupProperties(Self);
|
||||
end;
|
||||
//Set again the published properties
|
||||
SetDisableJavascript(FDisableJavaScript);
|
||||
{$IFDEF DEBUG}
|
||||
OutputDebugString('TGeckoBrowser.CreateWnd');
|
||||
{$ENDIF}
|
||||
inherited CreateWnd;
|
||||
DoInitializationIfNeeded;
|
||||
end;
|
||||
|
||||
procedure TCustomGeckoBrowser.DestroyWnd;
|
||||
begin
|
||||
{$IFDEF DEBUG}
|
||||
OutputDebugString('TGeckoBrowser.DestroyWnd');
|
||||
{$ENDIF}
|
||||
inherited DestroyWnd;
|
||||
end;
|
||||
|
||||
procedure TCustomGeckoBrowser.GoBack;
|
||||
@ -1895,6 +1908,23 @@ begin
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TCustomGeckoBrowser.DoInitializationIfNeeded;
|
||||
begin
|
||||
if not FInitializationStarted then
|
||||
if not (csDesigning in ComponentState) then
|
||||
begin
|
||||
FInitializationStarted:=true;
|
||||
InitWebBrowser;
|
||||
LoadURI('about:blank');
|
||||
FInitialized:=true;
|
||||
if Assigned(FOnSetupProperties) then begin
|
||||
FOnSetupProperties(Self);
|
||||
end;
|
||||
//Set again the published properties
|
||||
SetDisableJavascript(FDisableJavaScript);
|
||||
end;
|
||||
end;
|
||||
|
||||
{
|
||||
function TCustomGeckoBrowser.GetMarkupDocumentViewer: nsIMarkupDocumentViewer;
|
||||
var
|
||||
|
Reference in New Issue
Block a user