new(Parent,Id)->wxWebView()
Types:
Parent = wxWindow:wxWindow()
Id = integer()
new(Parent,Id,Options::[Option])->wxWebView()
Types:
Parent = wxWindow:wxWindow()
Id = integer()
Option =
{url, unicode:chardata()} |
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{backend, unicode:chardata()} |
{style, integer()}
Factory function to create a new wxWebView using a wxWebViewFactory (not implemented in wx).
Return: The created wxWebView, or NULL if the requested backend is not available
Since: 2.9.5
getCurrentTitle(This)->unicode:charlist()
Types:
This = wxWebView()
Get the title of the current web page, or its URL/path if title is not available.
getCurrentURL(This)->unicode:charlist()
Types:
This = wxWebView()
Get the URL of the currently displayed document.
getPageSource(This)->unicode:charlist()
Types:
This = wxWebView()
Get the HTML source code of the currently displayed document.
Return: The HTML source code, or an empty string if no page is currently shown.
getPageText(This)->unicode:charlist()
Types:
This = wxWebView()
Get the text of the current page.
isBusy(This)->boolean()
Types:
This = wxWebView()
Returns whether the web control is currently busy (e.g. loading a page).
isEditable(This)->boolean()
Types:
This = wxWebView()
Returns whether the web control is currently editable.
loadURL(This,Url)->ok
Types:
This = wxWebView()
Url = unicode:chardata()
Load a web page from a URL.
Note: Web engines generally report errors asynchronously, so if you wish to know whether loading
the URL was successful, register to receive navigation error events.
print(This)->ok
Types:
This = wxWebView()
Opens a print dialog so that the user may print the currently displayed page.
reload(This)->ok
Types:
This = wxWebView()
reload(This,Options::[Option])->ok
Types:
This = wxWebView()
Option = {flags, wx:wx_enum()}
Reload the currently displayed URL.
Note: The flags are ignored by the edge backend.
runScript(This,Javascript)->Result
Types:
Result = {Res :: boolean(), Output :: unicode:charlist()}
This = wxWebView()
Javascript = unicode:chardata()
Runs the given JavaScript code.
JavaScript code is executed inside the browser control and has full access to DOM and other
browser-provided functionality. For example, this code will replace the current page contents with
the provided string.
If output is non-null, it is filled with the result of executing this code on success, e.g. a
JavaScript value such as a string, a number (integer or floating point), a boolean or JSON
representation for non-primitive types such as arrays and objects. For example:
This function has a few platform-specific limitations:
Also notice that under MSW converting JavaScript objects to JSON is not supported in the default
emulation mode. wxWebView implements its own object-to-JSON conversion as a fallback for this
case, however it is not as full-featured, well-tested or performing as the implementation of this
functionality in the browser control itself, so it is recommended to use MSWSetEmulationLevel() to
change emulation level to a more modern one in which JSON conversion is done by the control
itself.
Return: true if there is a result, false if there is an error.
setEditable(This)->ok
Types:
This = wxWebView()
setEditable(This,Options::[Option])->ok
Types:
This = wxWebView()
Option = {enable, boolean()}
Set the editable property of the web control.
Enabling allows the user to edit the page even if the contenteditable attribute is not set. The
exact capabilities vary with the backend being used.
setPage(This,Html,BaseUrl)->ok
Types:
This = wxWebView()
Html = BaseUrl = unicode:chardata()
Set the displayed page source to the contents of the given string.
Note: When using wxWEBVIEW_BACKEND_IE you must wait for the current page to finish loading before
calling setPage/3. The baseURL parameter is not used in this backend and the edge backend.
stop(This)->ok
Types:
This = wxWebView()
Stop the current page loading process, if any.
May trigger an error event of type wxWEBVIEW_NAV_ERR_USER_CANCELLED. TODO: make
wxWEBVIEW_NAV_ERR_USER_CANCELLED errors uniform across ports.
canCopy(This)->boolean()
Types:
This = wxWebView()
Returns true if the current selection can be copied.
Note: This always returns true on the macOS WebKit backend.
canCut(This)->boolean()
Types:
This = wxWebView()
Returns true if the current selection can be cut.
Note: This always returns true on the macOS WebKit backend.
canPaste(This)->boolean()
Types:
This = wxWebView()
Returns true if data can be pasted.
Note: This always returns true on the macOS WebKit backend.
copy(This)->ok
Types:
This = wxWebView()
Copies the current selection.
cut(This)->ok
Types:
This = wxWebView()
Cuts the current selection.
paste(This)->ok
Types:
This = wxWebView()
Pastes the current data.
enableContextMenu(This)->ok
Types:
This = wxWebView()
enableContextMenu(This,Options::[Option])->ok
Types:
This = wxWebView()
Option = {enable, boolean()}
Enable or disable the right click context menu.
By default the standard context menu is enabled, this method can be used to disable it or re-
enable it later.
Since: 2.9.5
isContextMenuEnabled(This)->boolean()
Types:
This = wxWebView()
Returns true if a context menu will be shown on right click.
Since: 2.9.5
canGoBack(This)->boolean()
Types:
This = wxWebView()
Returns true if it is possible to navigate backward in the history of visited pages.
canGoForward(This)->boolean()
Types:
This = wxWebView()
Returns true if it is possible to navigate forward in the history of visited pages.
clearHistory(This)->ok
Types:
This = wxWebView()
Clear the history, this will also remove the visible page.
Note: This is not implemented on the WebKit2GTK+ backend.
enableHistory(This)->ok
Types:
This = wxWebView()
enableHistory(This,Options::[Option])->ok
Types:
This = wxWebView()
Option = {enable, boolean()}
Enable or disable the history.
This will also clear the history.
Note: This is not implemented on the WebKit2GTK+ backend.
goBack(This)->ok
Types:
This = wxWebView()
Navigate back in the history of visited pages.
Only valid if canGoBack/1 returns true.
goForward(This)->ok
Types:
This = wxWebView()
Navigate forward in the history of visited pages.
Only valid if canGoForward/1 returns true.
clearSelection(This)->ok
Types:
This = wxWebView()
Clears the current selection.
deleteSelection(This)->ok
Types:
This = wxWebView()
Deletes the current selection.
Note that for wxWEBVIEW_BACKEND_WEBKIT the selection must be editable, either through SetEditable
or the correct HTML attribute.
getSelectedSource(This)->unicode:charlist()
Types:
This = wxWebView()
Returns the currently selected source, if any.
getSelectedText(This)->unicode:charlist()
Types:
This = wxWebView()
Returns the currently selected text, if any.
hasSelection(This)->boolean()
Types:
This = wxWebView()
Returns true if there is a current selection.
selectAll(This)->ok
Types:
This = wxWebView()
Selects the entire page.
canRedo(This)->boolean()
Types:
This = wxWebView()
Returns true if there is an action to redo.
canUndo(This)->boolean()
Types:
This = wxWebView()
Returns true if there is an action to undo.
redo(This)->ok
Types:
This = wxWebView()
Redos the last action.
undo(This)->ok
Types:
This = wxWebView()
Undos the last action.
find(This,Text)->integer()
Types:
This = wxWebView()
Text = unicode:chardata()
find(This,Text,Options::[Option])->integer()
Types:
This = wxWebView()
Text = unicode:chardata()
Option = {flags, wx:wx_enum()}
Finds a phrase on the current page and if found, the control will scroll the phrase into view and
select it.
Return: If search phrase was not found in combination with the flags then wxNOT_FOUND is returned.
If called for the first time with search phrase then the total number of results will be returned.
Then for every time its called with the same search phrase it will return the number of the
current match.
Note: This function will restart the search if the flags wxWEBVIEW_FIND_ENTIRE_WORD or
wxWEBVIEW_FIND_MATCH_CASE are changed, since this will require a new search. To reset the search,
for example resetting the highlights call the function with an empty search phrase. This always
returns wxNOT_FOUND on the macOS WebKit backend.
Since: 2.9.5
canSetZoomType(This,Type)->boolean()
Types:
This = wxWebView()
Type = wx:wx_enum()
Retrieve whether the current HTML engine supports a zoom type.
Return: Whether this type of zoom is supported by this HTML engine (and thus can be set through
setZoomType/2).
getZoom(This)->wx:wx_enum()
Types:
This = wxWebView()
Get the zoom level of the page.
See getZoomFactor/1 to get more precise zoom scale value other than as provided by wxWebViewZoom.
Return: The current level of zoom.
getZoomType(This)->wx:wx_enum()
Types:
This = wxWebView()
Get how the zoom factor is currently interpreted.
Return: How the zoom factor is currently interpreted by the HTML engine.
setZoom(This,Zoom)->ok
Types:
This = wxWebView()
Zoom = wx:wx_enum()
Set the zoom level of the page.
See setZoomFactor/2 for more precise scaling other than the measured steps provided by
wxWebViewZoom.
setZoomType(This,ZoomType)->ok
Types:
This = wxWebView()
ZoomType = wx:wx_enum()
Set how to interpret the zoom factor.
Note: invoke canSetZoomType/2 first, some HTML renderers may not support all zoom types.
getZoomFactor(This)->number()
Types:
This = wxWebView()
Get the zoom factor of the page.
Return: The current factor of zoom.
Since: 3.1.4
setZoomFactor(This,Zoom)->ok
Types:
This = wxWebView()
Zoom = number()
Set the zoom factor of the page.
Note: zoom scale in IE will be converted into wxWebViewZoom levels for wxWebViewZoomType of
wxWEBVIEW_ZOOM_TYPE_TEXT.
Since: 3.1.4
isBackendAvailable(Backend)->boolean()
Types:
Backend = unicode:chardata()
Allows to check if a specific backend is currently available.
Since: 3.1.4
wxWidgets team. wx 2.1.1 wxWebView(3erl)