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
|
//misc settings
|
||||||
FDisableJavaScript: Boolean;
|
FDisableJavaScript: Boolean;
|
||||||
|
FInitializationStarted: Boolean;
|
||||||
FInitialized: Boolean;
|
FInitialized: Boolean;
|
||||||
|
|
||||||
function GetDisableJavaScript: Boolean;
|
function GetDisableJavaScript: Boolean;
|
||||||
@ -208,6 +209,7 @@ type
|
|||||||
//function GetMarkupDocumentViewer: nsIMarkupDocumentViewer;
|
//function GetMarkupDocumentViewer: nsIMarkupDocumentViewer;
|
||||||
//function GetDocShell: nsIDocShell;
|
//function GetDocShell: nsIDocShell;
|
||||||
//function GetDocumentCharsetInfo: nsIDocumentCharsetInfo;
|
//function GetDocumentCharsetInfo: nsIDocumentCharsetInfo;
|
||||||
|
procedure DoInitializationIfNeeded;
|
||||||
protected
|
protected
|
||||||
procedure Paint; override;
|
procedure Paint; override;
|
||||||
public
|
public
|
||||||
@ -239,6 +241,10 @@ type
|
|||||||
procedure Resize; override;
|
procedure Resize; override;
|
||||||
|
|
||||||
procedure Loaded; override;
|
procedure Loaded; override;
|
||||||
|
|
||||||
|
//TWinControl
|
||||||
|
procedure CreateWnd; override;
|
||||||
|
procedure DestroyWnd; override;
|
||||||
protected
|
protected
|
||||||
property Chrome: TCustomGeckoBrowserChrome
|
property Chrome: TCustomGeckoBrowserChrome
|
||||||
read FChrome write SetChrome;
|
read FChrome write SetChrome;
|
||||||
@ -1054,17 +1060,24 @@ end;
|
|||||||
procedure TCustomGeckoBrowser.Loaded;
|
procedure TCustomGeckoBrowser.Loaded;
|
||||||
begin
|
begin
|
||||||
inherited Loaded;
|
inherited Loaded;
|
||||||
if not (csDesigning in ComponentState) then
|
DoInitializationIfNeeded;
|
||||||
begin
|
end;
|
||||||
InitWebBrowser;
|
|
||||||
LoadURI('about:blank');
|
procedure TCustomGeckoBrowser.CreateWnd;
|
||||||
FInitialized:=true;
|
begin
|
||||||
if Assigned(FOnSetupProperties) then begin
|
{$IFDEF DEBUG}
|
||||||
FOnSetupProperties(Self);
|
OutputDebugString('TGeckoBrowser.CreateWnd');
|
||||||
end;
|
{$ENDIF}
|
||||||
//Set again the published properties
|
inherited CreateWnd;
|
||||||
SetDisableJavascript(FDisableJavaScript);
|
DoInitializationIfNeeded;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomGeckoBrowser.DestroyWnd;
|
||||||
|
begin
|
||||||
|
{$IFDEF DEBUG}
|
||||||
|
OutputDebugString('TGeckoBrowser.DestroyWnd');
|
||||||
|
{$ENDIF}
|
||||||
|
inherited DestroyWnd;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomGeckoBrowser.GoBack;
|
procedure TCustomGeckoBrowser.GoBack;
|
||||||
@ -1895,6 +1908,23 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
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;
|
function TCustomGeckoBrowser.GetMarkupDocumentViewer: nsIMarkupDocumentViewer;
|
||||||
var
|
var
|
||||||
|
Reference in New Issue
Block a user