mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2024-11-16 00:05:55 +01:00
MiniBrowser demo : Added context menu option to show the ZoomPct value in the statusbar
This commit is contained in:
parent
86fd4a0c4d
commit
91615ff437
@ -269,6 +269,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
|
||||
OnNavigationVisitorResultAvailable = Chromium1NavigationVisitorResultAvailable
|
||||
OnDownloadImageFinished = Chromium1DownloadImageFinished
|
||||
OnCookiesFlushed = Chromium1CookiesFlushed
|
||||
OnExecuteTaskOnCefThread = Chromium1ExecuteTaskOnCefThread
|
||||
OnRenderCompMsg = Chromium1RenderCompMsg
|
||||
OnLoadEnd = Chromium1LoadEnd
|
||||
OnLoadError = Chromium1LoadError
|
||||
|
@ -82,6 +82,7 @@ const
|
||||
MINIBROWSER_CONTEXTMENU_GETNAVIGATION = MENU_ID_USER_FIRST + 12;
|
||||
MINIBROWSER_CONTEXTMENU_MUTEAUDIO = MENU_ID_USER_FIRST + 13;
|
||||
MINIBROWSER_CONTEXTMENU_UNMUTEAUDIO = MENU_ID_USER_FIRST + 14;
|
||||
MINIBROWSER_CONTEXTMENU_SHOWZOOMPCT = MENU_ID_USER_FIRST + 15;
|
||||
|
||||
type
|
||||
TMiniBrowserFrm = class(TForm)
|
||||
@ -232,6 +233,8 @@ type
|
||||
pluginUrl: ustring; isMainFrame: Boolean;
|
||||
const topOriginUrl: ustring; const pluginInfo: ICefWebPluginInfo;
|
||||
var pluginPolicy: TCefPluginPolicy; var aResult: Boolean);
|
||||
procedure Chromium1ExecuteTaskOnCefThread(Sender: TObject;
|
||||
aTaskID: Cardinal);
|
||||
|
||||
protected
|
||||
FResponse : TStringList;
|
||||
@ -385,6 +388,7 @@ begin
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_JSWRITEDOC, 'Modify HTML document');
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_JSPRINTDOC, 'Print using Javascript');
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_SHOWRESPONSE, 'Show server headers');
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_SHOWZOOMPCT, 'Show ZoomPct');
|
||||
|
||||
if DevTools.Visible then
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_HIDEDEVTOOLS, 'Hide DevTools')
|
||||
@ -564,6 +568,9 @@ begin
|
||||
|
||||
MINIBROWSER_CONTEXTMENU_MUTEAUDIO :
|
||||
Chromium1.AudioMuted := True;
|
||||
|
||||
MINIBROWSER_CONTEXTMENU_SHOWZOOMPCT :
|
||||
Chromium1.ExecuteTaskOnCefThread(TID_UI, 1);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -602,6 +609,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1ExecuteTaskOnCefThread(Sender: TObject;
|
||||
aTaskID: Cardinal);
|
||||
begin
|
||||
ShowStatusText('ZoomPct : ' + floattostr(Chromium1.ZoomPct));
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1FullScreenModeChange(Sender: TObject;
|
||||
const browser: ICefBrowser; fullscreen: Boolean);
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user