type TCustomWindowDelegate = class(TCefWindowDelegateOwn)
This class handles all the TCustomWindowDelegate methods which call the ICefWindowDelegateEvents methods. ICefWindowDelegateEvents will be implemented by the control receiving the TCustomWindowDelegate events.
FEvents: Pointer; |
procedure OnGetPreferredSize(const view: ICefView; var aResult : TCefSize); override; |
|
procedure OnGetMinimumSize(const view: ICefView; var aResult : TCefSize); override; |
|
procedure OnGetMaximumSize(const view: ICefView; var aResult : TCefSize); override; |
|
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override; |
|
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override; |
|
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override; |
|
procedure OnWindowChanged(const view: ICefView; added: boolean); override; |
|
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override; |
|
procedure OnFocus(const view: ICefView); override; |
|
procedure OnBlur(const view: ICefView); override; |
|
procedure OnThemeChanged(const view: ICefView); override; |
|
procedure OnWindowCreated(const window_: ICefWindow); override; |
|
procedure OnWindowClosing(const window_: ICefWindow); override; |
|
procedure OnWindowDestroyed(const window_: ICefWindow); override; |
|
procedure OnWindowActivationChanged(const window_: ICefWindow; active: boolean); override; |
|
procedure OnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect); override; |
|
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean); override; |
|
procedure OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); override; |
|
procedure OnIsWindowModalDialog(const window_: ICefWindow; var aResult: boolean); override; |
|
procedure OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); override; |
|
procedure OnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState); override; |
|
procedure OnIsFrameless(const window_: ICefWindow; var aResult : boolean); override; |
|
procedure OnWithStandardWindowButtons(const window_: ICefWindow; var aResult : boolean); override; |
|
procedure OnGetTitlebarHeight(const window_: ICefWindow; var titlebar_height: Single; var aResult : boolean); override; |
|
procedure OnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState); override; |
|
procedure OnCanResize(const window_: ICefWindow; var aResult : boolean); override; |
|
procedure OnCanMaximize(const window_: ICefWindow; var aResult : boolean); override; |
|
procedure OnCanMinimize(const window_: ICefWindow; var aResult : boolean); override; |
|
procedure OnCanClose(const window_: ICefWindow; var aResult : boolean); override; |
|
procedure OnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean); override; |
|
procedure OnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean); override; |
|
procedure OnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer); override; |
|
procedure OnGetWindowRuntimeStyle(var aResult: TCefRuntimeStyle); override; |
|
procedure OnGetLinuxWindowProperties(const window_: ICefWindow; var properties: TLinuxWindowProperties; var aResult: boolean); override; |
|
constructor Create(const events: ICefWindowDelegateEvents); reintroduce; |
FEvents: Pointer; |
|
This item has no description. |
procedure OnGetPreferredSize(const view: ICefView; var aResult : TCefSize); override; |
|
ICefViewDelegate |
procedure OnGetMinimumSize(const view: ICefView; var aResult : TCefSize); override; |
|
This item has no description. Showing description inherited from TCefViewDelegateOwn.OnGetMinimumSize. Return the minimum size for |view|. |
procedure OnGetMaximumSize(const view: ICefView; var aResult : TCefSize); override; |
|
This item has no description. Showing description inherited from TCefViewDelegateOwn.OnGetMaximumSize. Return the maximum size for |view|. |
procedure OnGetHeightForWidth(const view: ICefView; width: Integer; var aResult: Integer); override; |
|
This item has no description. Showing description inherited from TCefViewDelegateOwn.OnGetHeightForWidth. Return the height necessary to display |view| with the provided |width|. If not specified the result of get_preferred_size().height will be used by default. Override if |view|'s preferred height depends upon the width (for example, with Labels). |
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override; |
|
This item has no description. Showing description inherited from TCefViewDelegateOwn.OnParentViewChanged. Called when the parent of |view| has changed. If |view| is being added to |parent| then |added| will be true (1). If |view| is being removed from |parent| then |added| will be false (0). If |view| is being reparented the remove notification will be sent before the add notification. Do not modify the view hierarchy in this callback. |
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override; |
|
This item has no description. Showing description inherited from TCefViewDelegateOwn.OnChildViewChanged. Called when a child of |view| has changed. If |child| is being added to |view| then |added| will be true (1). If |child| is being removed from |view| then |added| will be false (0). If |child| is being reparented the remove notification will be sent to the old parent before the add notification is sent to the new parent. Do not modify the view hierarchy in this callback. |
procedure OnWindowChanged(const view: ICefView; added: boolean); override; |
|
This item has no description. Showing description inherited from TCefViewDelegateOwn.OnWindowChanged. Called when |view| is added or removed from the ICefWindow. |
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override; |
|
This item has no description. Showing description inherited from TCefViewDelegateOwn.OnLayoutChanged. Called when the layout of |view| has changed. |
procedure OnFocus(const view: ICefView); override; |
|
This item has no description. Showing description inherited from TCefViewDelegateOwn.OnFocus. Called when |view| gains focus. |
procedure OnBlur(const view: ICefView); override; |
|
This item has no description. Showing description inherited from TCefViewDelegateOwn.OnBlur. Called when |view| loses focus. |
procedure OnThemeChanged(const view: ICefView); override; |
|
This item has no description. Showing description inherited from TCefViewDelegateOwn.OnThemeChanged. ( Called when the theme for |view| has changed, after the new theme colors have already been applied. Views are notified via the component hierarchy in depth-first reverse order (children before parents). This will be called in the following cases: 1. When |view|, or a parent of |view|, is added to a Window. 2. When the native/OS or Chrome theme changes for the Window that contains |view|. See ICefWindowDelegate.OnThemeColorsChanged documentation. 3. When the client explicitly calls ICefWindow.ThemeChanged on the Window that contains |view|.
Optionally use this callback to override the new per-View theme colors by calling ICefView.SetBackgroundColor or the appropriate component- specific function. See ICefWindow.SetThemeColor documentation for how to customize additional Window theme colors. ( |
procedure OnWindowCreated(const window_: ICefWindow); override; |
|
ICefWindowDelegate |
procedure OnWindowClosing(const window_: ICefWindow); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnWindowClosing. Called when |window| is closing. |
procedure OnWindowDestroyed(const window_: ICefWindow); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnWindowDestroyed. Called when |window| is destroyed. Release all references to |window| and do not attempt to execute any functions on |window| after this callback returns. |
procedure OnWindowActivationChanged(const window_: ICefWindow; active: boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnWindowActivationChanged. Called when |window| is activated or deactivated. |
procedure OnWindowBoundsChanged(const window_: ICefWindow; const new_bounds: TCefRect); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnWindowBoundsChanged. Called when |window| bounds have changed. |new_bounds| will be in DIP screen coordinates. |
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnWindowFullscreenTransition. Called when |window| is transitioning to or from fullscreen mode. On MacOS the transition occurs asynchronously with |is_competed| set to false (0) when the transition starts and true (1) after the transition completes. On other platforms the transition occurs synchronously with |is_completed| set to true (1) after the transition completes. With Alloy style you must also implement ICefDisplayHandler.OnFullscreenModeChange to handle fullscreen transitions initiated by browser content. |
procedure OnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnGetParentWindow. Return the parent for |window| or NULL if the |window| does not have a parent. Windows with parents will not get a taskbar button. Set |is_menu| to true (1) if |window| will be displayed as a menu, in which case it will not be clipped to the parent window bounds. Set |can_activate_menu| to false (0) if |is_menu| is true (1) and |window| should not be activated (given keyboard focus) when displayed. |
procedure OnIsWindowModalDialog(const window_: ICefWindow; var aResult: boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnIsWindowModalDialog. Return true (1) if |window| should be created as a window modal dialog. Only called when a Window is returned via get_parent_window() with |is_menu| set to false (0). All controls in the parent Window will be disabled while |window| is visible. This functionality is not supported by all Linux window managers. Alternately, use ICefWindow.ShowAsBrowserModalDialog() for a browser modal dialog that works on all platforms. |
procedure OnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnGetInitialBounds. Return the initial bounds for |window| in density independent pixel (DIP) coordinates. If this function returns an NULL CefRect then GetPreferredSize() will be called to retrieve the size, and the window will be placed on the screen with origin (0,0). This function can be used in combination with ICefView.GetBoundsInScreen() to restore the previous window bounds. |
procedure OnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnGetInitialShowState. Return the initial show state for |window|. |
procedure OnIsFrameless(const window_: ICefWindow; var aResult : boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnIsFrameless. Return true (1) if |window| should be created without a frame or title bar. The window will be resizable if can_resize() returns true (1). Use ICefWindow.SetDraggableRegions() to specify draggable regions. |
procedure OnWithStandardWindowButtons(const window_: ICefWindow; var aResult : boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnWithStandardWindowButtons. Return true (1) if |window| should be created with standard window buttons like close, minimize and zoom. This function is only supported on macOS. |
procedure OnGetTitlebarHeight(const window_: ICefWindow; var titlebar_height: Single; var aResult : boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnGetTitlebarHeight. Return whether the titlebar height should be overridden, and sets the height of the titlebar in |titlebar_height|. On macOS, it can also be used to adjust the vertical position of the traffic light buttons in frameless windows. The buttons will be positioned halfway down the titlebar at a height of |titlebar_height| / 2. |
procedure OnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnAcceptsFirstMouse.
Return whether the view should accept the initial mouse-down event, allowing it to respond to click-through behavior. If STATE_ENABLED is returned, the view will be sent a mouseDown: message for an initial mouse- down event, activating the view with one click, instead of clicking first to make the window active and then clicking the view. This function is only supported on macOS. For more details, refer to the documentation of acceptsFirstMouse. |
procedure OnCanResize(const window_: ICefWindow; var aResult : boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnCanResize. Return true (1) if |window| can be resized. |
procedure OnCanMaximize(const window_: ICefWindow; var aResult : boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnCanMaximize. Return true (1) if |window| can be maximized. |
procedure OnCanMinimize(const window_: ICefWindow; var aResult : boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnCanMinimize. Return true (1) if |window| can be minimized. |
procedure OnCanClose(const window_: ICefWindow; var aResult : boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnCanClose. Return true (1) if |window| can be closed. This will be called for user- initiated window close actions and when ICefWindow.close() is called. |
procedure OnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnAccelerator. Called when a keyboard accelerator registered with ICefWindow.SetAccelerator is triggered. Return true (1) if the accelerator was handled or false (0) otherwise. |
procedure OnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnKeyEvent. Called after all other controls in the window have had a chance to handle the event. |event| contains information about the keyboard event. Return true (1) if the keyboard event was handled or false (0) otherwise. |
procedure OnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnThemeColorsChanged.
Called after the native/OS or Chrome theme for |window| has changed. |chrome_theme| will be true (1) if the notification is for a Chrome theme. Native/OS theme colors are configured globally and do not need to be customized for each Window individually. An example of a native/OS theme change that triggers this callback is when the user switches between dark and light mode during application lifespan. Native/OS theme changes can be disabled by passing the `–force-dark-mode` or `–force-light-mode` command-line flag. Chrome theme colors will be applied and this callback will be triggered if/when a BrowserView is added to the Window's component hierarchy. Chrome theme colors can be configured on a per-RequestContext basis using ICefRequestContext.SetChromeColorScheme or (Chrome style only) by visiting chrome://settings/manageProfile. Any theme changes using those mechanisms will also trigger this callback. Chrome theme colors will be persisted and restored from disk cache. This callback is not triggered on Window creation so clients that wish to customize the initial native/OS theme must call ICefWindow.SetThemeColor and ICefWindow.ThemeChanged before showing the first Window. Theme colors will be reset to standard values before this callback is called for the first affected Window. Call ICefWindow.SetThemeColor from inside this callback to override a standard color or add a custom color. ICefViewDelegate.OnThemeChanged will be called after this callback for the complete |window| component hierarchy. |
procedure OnGetWindowRuntimeStyle(var aResult: TCefRuntimeStyle); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnGetWindowRuntimeStyle. Optionally change the runtime style for this Window. See TCefRuntimeStyle documentation for details. |
procedure OnGetLinuxWindowProperties(const window_: ICefWindow; var properties: TLinuxWindowProperties; var aResult: boolean); override; |
|
This item has no description. Showing description inherited from TCefWindowDelegateOwn.OnGetLinuxWindowProperties. Return Linux-specific window properties for correctly handling by window managers. |
constructor Create(const events: ICefWindowDelegateEvents); reintroduce; |
|
Creates an instance of this class liked to an interface that's implemented by a control receiving the events. |