Class: Wx::WEB::WebViewEvent
- Inherits:
-
NotifyEvent
- Object
- Object
- Event
- CommandEvent
- NotifyEvent
- Wx::WEB::WebViewEvent
- Defined in:
- lib/wx/doc/gen/web/web_view_event.rb
Overview
A navigation event holds information about events associated with WebView objects.
Events emitted by this class
The following event-handler methods redirect the events to member method or handler blocks for WebViewEvent events. Event handler methods for events emitted by this class:
-
EvtHandler#evt_webview_created(id, meth = nil, &block): Process a EVT_WEBVIEW_CREATED event, generated when the object is fully initialized. For the backends using asynchronous initialization, such as Wx::WebViewChromium, most of this class member functions can be only used once this event is received.
-
EvtHandler#evt_webview_navigating(id, meth = nil, &block): Process a EVT_WEBVIEW_NAVIGATING event, generated before trying to get a resource. This event may be vetoed to prevent navigating to this resource. Note that if the displayed HTML document has several frames, one such event will be generated per frame.
-
EvtHandler#evt_webview_navigated(id, meth = nil, &block): Process a EVT_WEBVIEW_NAVIGATED event generated after it was confirmed that a resource would be requested. This event may not be vetoed. Note that if the displayed HTML document has several frames, one such event will be generated per frame.
-
EvtHandler#evt_webview_loaded(id, meth = nil, &block): Process a EVT_WEBVIEW_LOADED event generated when the document is fully loaded and displayed. Note that if the displayed HTML document has several frames, one such event will be generated per frame.
-
EvtHandler#evt_webview_error(id, meth = nil, &block): Process a EVT_WEBVIEW_ERROR event generated when a navigation error occurs. The integer associated with this event will be a WebViewNavigationError item. The string associated with this event may contain a backend-specific more precise error message/code.
-
EvtHandler#evt_webview_newwindow(id, meth = nil, &block): Process a EVT_WEBVIEW_NEWWINDOW event, generated when a new window is created. You must handle this event if you want anything to happen, for example to load the page in a new window or tab. For usage details see WebViewWindowFeatures.
-
EvtHandler#evt_webview_newwindow_features(id, meth = nil, &block): Process a EVT_WEBVIEW_NEWWINDOW_FEATURES event, generated when window features are available for the new window. For usage details see WebViewWindowFeatures. only available in wxWidgets 3.3.0 or later.
-
EvtHandler#evt_webview_window_close_requested(id, meth = nil, &block): Process a EVT_WEBVIEW_WINDOW_CLOSE_REQUESTED event, generated when a window is requested to be closed. only available in wxWidgets 3.3.0 or later.
-
EvtHandler#evt_webview_title_changed(id, meth = nil, &block): Process a EVT_WEBVIEW_TITLE_CHANGED event, generated when the page title changes. Use GetString to get the title.
-
EvtHandler#evt_webview_fullscreen_changed(id, meth = nil, &block): Process a EVT_WEBVIEW_FULLSCREEN_CHANGED event, generated when the page wants to enter or leave fullscreen. Use GetInt to get the status. Not implemented for the IE backend and is only available in wxWidgets 3.1.5 or later.
-
EvtHandler#evt_webview_script_message_received(id, meth = nil, &block): Process a EVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED event only available in wxWidgets 3.1.5 or later. For usage details see Wx::WEB::WebView#add_script_message_handler.
-
EvtHandler#evt_webview_script_result(id, meth = nil, &block): Process a EVT_WEBVIEW_SCRIPT_RESULT event only available in wxWidgets 3.1.6 or later. For usage details see Wx::WEB::WebView#run_script_async.
-
evt_webview_browsing_data_cleared(id,func): Process a EVT_WEBVIEW_BROWSING_DATA_CLEARED event only available in wxWidgets 3.3.0 or later. For usage details see Wx::WEB::WebView#clear_browsing_data.
Instance Method Summary collapse
-
#get_message_handler ⇒ Wx::String
(also: #message_handler)
Get the name of the script handler.
-
#get_navigation_action ⇒ Wx::WebViewNavigationActionFlags
(also: #navigation_action)
Get the type of navigation action.
-
#get_target ⇒ Wx::String
(also: #target)
Get the name of the target frame which the url of this event has been or will be loaded into.
-
#get_target_window_features ⇒ Wx::WEB::WebViewWindowFeatures
(also: #target_window_features)
Get information about the target window.
-
#get_url ⇒ Wx::String
(also: #url)
Get the URL being visited.
-
#initialize(*args) ⇒ WebViewEvent
constructor
A new instance of WebViewEvent.
-
#is_error ⇒ Boolean
(also: #error?)
Returns true if the operation failed.
-
#is_target_main_frame ⇒ Boolean
(also: #target_main_frame?)
Returns true if the navigation target is the main frame.
Methods inherited from NotifyEvent
Methods inherited from CommandEvent
#client_data, #client_data=, #get_client_data, #get_client_object, #get_int, #get_selection, #get_string, #is_checked, #is_selection, #set_client_data, #set_client_object, #set_extra_long, #set_int, #set_string
Methods inherited from Event
#clone, #get_event_category, #get_event_object, #get_event_type, #get_id, #get_skipped, #get_timestamp, #is_command_event, #resume_propagation, #set_event_object, #set_event_type, #set_id, #set_timestamp, #should_propagate, #skip, #stop_propagation
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize ⇒ Wx::WEB::WebViewEvent #initialize(type, id, href, target, flags = Wx::WEB::WebViewNavigationActionFlags::WEBVIEW_NAV_ACTION_NONE, messageHandler = ('')) ⇒ Wx::WEB::WebViewEvent
Returns a new instance of WebViewEvent.
62 |
# File 'lib/wx/doc/gen/web/web_view_event.rb', line 62 def initialize(*args) end |
Instance Method Details
#get_message_handler ⇒ Wx::String Also known as: message_handler
Get the name of the script handler.
Only valid for events of type EVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED
87 |
# File 'lib/wx/doc/gen/web/web_view_event.rb', line 87 def ; end |
#get_navigation_action ⇒ Wx::WebViewNavigationActionFlags Also known as:
Get the type of navigation action.
Only valid for events of type EVT_WEBVIEW_NEWWINDOW
80 |
# File 'lib/wx/doc/gen/web/web_view_event.rb', line 80 def ; end |
#get_target ⇒ Wx::String Also known as: target
Get the name of the target frame which the url of this event has been or will be loaded into.
This may return an empty string if the frame is not available.
68 |
# File 'lib/wx/doc/gen/web/web_view_event.rb', line 68 def get_target; end |
#get_target_window_features ⇒ Wx::WEB::WebViewWindowFeatures Also known as: target_window_features
Get information about the target window.
Only valid for events of type EVT_WEBVIEW_NEWWINDOW_FEATURES
This function is not implemented and always returns nil when using WebKit1 or Internet Explorer backend.
101 |
# File 'lib/wx/doc/gen/web/web_view_event.rb', line 101 def get_target_window_features; end |
#get_url ⇒ Wx::String Also known as: url
Get the URL being visited.
73 |
# File 'lib/wx/doc/gen/web/web_view_event.rb', line 73 def get_url; end |
#is_error ⇒ Boolean Also known as: error?
Returns true if the operation failed.
Only valid for events of type EVT_WEBVIEW_SCRIPT_RESULT and EVT_WEBVIEW_BROWSING_DATA_CLEARED
108 |
# File 'lib/wx/doc/gen/web/web_view_event.rb', line 108 def is_error; end |
#is_target_main_frame ⇒ Boolean Also known as: target_main_frame?
Returns true if the navigation target is the main frame.
Only valid for events of type EVT_WEBVIEW_NAVIGATING
This is only available with the macOS and the Edge backend.
121 |
# File 'lib/wx/doc/gen/web/web_view_event.rb', line 121 def is_target_main_frame; end |