You've already forked lazarus-ccr
Added Print (to printer) method.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1521 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -453,6 +453,8 @@ type
|
|||||||
|
|
||||||
class function GetGeckoBrowserWithDOMWindow(constref DOMWindow: nsIDOMWindow): TGeckoBrowser;
|
class function GetGeckoBrowserWithDOMWindow(constref DOMWindow: nsIDOMWindow): TGeckoBrowser;
|
||||||
|
|
||||||
|
procedure Print(const aShowPrinterSelectDialog: Boolean);
|
||||||
|
|
||||||
published
|
published
|
||||||
property OnDOMLoad: TGeckoBrowserDOMEventHandler
|
property OnDOMLoad: TGeckoBrowserDOMEventHandler
|
||||||
read FOnDOMLoad write FOnDOMLoad;
|
read FOnDOMLoad write FOnDOMLoad;
|
||||||
@ -1841,6 +1843,23 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGeckoBrowser.Print(const aShowPrinterSelectDialog: Boolean);
|
||||||
|
var
|
||||||
|
PrintInterface: nsIWebBrowserPrint;
|
||||||
|
PrintSettings: nsIPrintSettings;
|
||||||
|
begin
|
||||||
|
PrintInterface:=GetWebBrowserPrint;
|
||||||
|
if Assigned(PrintInterface) then begin
|
||||||
|
PrintSettings:=PrintInterface.GetGlobalPrintSettings;
|
||||||
|
if Assigned(PrintSettings) then begin
|
||||||
|
PrintSettings.ShowPrintProgress:=false; //true implies need of nsIWebProgressListener
|
||||||
|
PrintSettings.PrintBGImages:=true;
|
||||||
|
PrintSettings.SetPrintSilent(not aShowPrinterSelectDialog);
|
||||||
|
end;
|
||||||
|
PrintInterface.Print(PrintSettings,nil);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TGeckoBrowserChrome.NS_GetInterface(constref uuid: TGUID; out _result): nsresult;
|
function TGeckoBrowserChrome.NS_GetInterface(constref uuid: TGUID; out _result): nsresult;
|
||||||
begin
|
begin
|
||||||
if IsEqualGUID(uuid, nsIDOMWindow) then
|
if IsEqualGUID(uuid, nsIDOMWindow) then
|
||||||
@ -2021,6 +2040,7 @@ function TCustomGeckoBrowser.GetWebBrowserFind: nsIWebBrowserFind;
|
|||||||
begin
|
begin
|
||||||
Result := FWebBrowser as nsIWebBrowserFind;
|
Result := FWebBrowser as nsIWebBrowserFind;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomGeckoBrowser.GetWebBrowserPrint: nsIWebBrowserPrint;
|
function TCustomGeckoBrowser.GetWebBrowserPrint: nsIWebBrowserPrint;
|
||||||
var
|
var
|
||||||
ir:nsIInterfaceRequestor;
|
ir:nsIInterfaceRequestor;
|
||||||
@ -2030,6 +2050,7 @@ begin
|
|||||||
ir.GetInterface(nsIWebBrowserPrint, wbp);
|
ir.GetInterface(nsIWebBrowserPrint, wbp);
|
||||||
Result := wbp;
|
Result := wbp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomGeckoBrowser.GetWebNavigation: nsIWebNavigation;
|
function TCustomGeckoBrowser.GetWebNavigation: nsIWebNavigation;
|
||||||
begin
|
begin
|
||||||
Result := FWebBrowser as nsIWebNavigation;
|
Result := FWebBrowser as nsIWebNavigation;
|
||||||
|
Reference in New Issue
Block a user