Xojo Conferences
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

HTMLViewer.ApplicationNameForUserAgentMBS as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: The application name.
Example:
htmlviewer1.ApplicationNameForUserAgentMBS="test"
// useragent is now "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/417.9 (KHTML, like Gecko) test"
Notes:
This name will be used in user-agent strings that are chosen for best results in rendering web pages.
(Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

HTMLViewer.backForwardListMBS as WebBackForwardListMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: The backforward list for this webView.
Notes: Nil on failure.

Feedback, Comments & Corrections

HTMLViewer.BoundsHeightMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: The height of the htmlviewer control.
Example:
MsgBox str(HTMLViewer1.BoundsLeftMBS)+" "+str(HTMLViewer1.BoundsTopMBS)+" "+str(HTMLViewer1.BoundsWidthMBS)+" "+str(HTMLViewer1.BoundsHeightMBS)
Notes:
Bounds is the width and height of the controls area, but visible is only a part depending on the window size. So if Bounds are equal to the visible part, there is no scrollbar.
(Read and Write computed property)

Feedback, Comments & Corrections

HTMLViewer.BoundsLeftMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No No No
Function: The left position of the control size.
Example:
MsgBox str(HTMLViewer1.BoundsLeftMBS)+" "+str(HTMLViewer1.BoundsTopMBS)+" "+str(HTMLViewer1.BoundsWidthMBS)+" "+str(HTMLViewer1.BoundsHeightMBS)
Notes:
Should be 0.
(Read and Write computed property)

Feedback, Comments & Corrections

HTMLViewer.BoundsTopMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No No No
Function: The top position of the view size.
Example:
MsgBox str(HTMLViewer1.BoundsLeftMBS)+" "+str(HTMLViewer1.BoundsTopMBS)+" "+str(HTMLViewer1.BoundsWidthMBS)+" "+str(HTMLViewer1.BoundsHeightMBS)
Notes:
Should be 0.
(Read and Write computed property)

Feedback, Comments & Corrections

HTMLViewer.BoundsWidthMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: The width of the htmlviewer control.
Example:
dim w as NSViewMBS

w=HTMLViewer1.mainFrameMBS.frameView.documentView

MsgBox "width: "+str(w.Bounds.Width)+" height: "+str(w.Bounds.Height)

w=HTMLViewer1.WebViewMBS

MsgBox "width: "+str(w.Bounds.Width)+" height: "+str(w.Bounds.Height)
Notes:
Bounds is the width and height of the controls area, but visible is only a part depending on the window size. So if Bounds are equal to the visible part, there is no scrollbar.
(Read and Write computed property)

Feedback, Comments & Corrections

HTMLViewer.canGoBackMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.7 Yes No No No No
Function: Whether the history can be used to move back one website.
Example:
MsgBox str(HTMLViewer1.canGoBackMBS)

Feedback, Comments & Corrections

HTMLViewer.canGoForwardMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.7 Yes No No No No
Function: Whether the history can be used to move forward one website.
Example:
MsgBox str(HTMLViewer1.canGoForwardMBS)

Feedback, Comments & Corrections

HTMLViewer.canMakeTextLargerMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.7 Yes No No No No
Function: Whether the text size can be increased.
Example:
MsgBox str(HTMLViewer1.canMakeTextLargerMBS)

Feedback, Comments & Corrections

HTMLViewer.canMakeTextSmallerMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.7 Yes No No No No
Function: Whether the text size can be decreased.
Example:
MsgBox str(HTMLViewer1.canMakeTextSmallerMBS)

Feedback, Comments & Corrections

HTMLViewer.canResetPageZoomMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 11.0 Yes No No No No
Function: Whether web page can be reset.
Example:
MsgBox str(HTMLViewer1.canResetPageZoomMBS)
Notes: This is a new webview function which is not available on all webview versions. So be aware that you may get an NSExceptionMBS about the function not being available.

Feedback, Comments & Corrections

HTMLViewer.CanShowMIMETypeAsHTMLMBS(mime as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: Checks if the the MIME type is a type that the WebKit will interpret as HTML.
Example:
MsgBox str(HTMLViewer1.CanShowMIMETypeAsHTMLMBS("text/plain"))
Notes:
Returns false on any error and true on success.
See also FileExtensionToMimeTypeMBS function.

Some examples which use this method:

Feedback, Comments & Corrections

HTMLViewer.CanShowMIMETypeMBS(mime as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: Checks if the WebKit can show content of a certain MIME type.
Example:
MsgBox str(HTMLViewer1.CanShowMIMETypeMBS("text/plain"))
Notes:
Returns false on any error and true on success.
See also FileExtensionToMimeTypeMBS function.

Some examples which use this method:

Feedback, Comments & Corrections

HTMLViewer.canZoomPageInMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 11.0 Yes No No No No
Function: Whether web page can be zoomed in.
Example:
MsgBox str(HTMLViewer1.canZoomPageInMBS)
Notes: This is a new webview function which is not available on all webview versions. So be aware that you may get an NSExceptionMBS about the function not being available.

Feedback, Comments & Corrections

HTMLViewer.canZoomPageOutMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 11.0 Yes No No No No
Function: Whether web page can be zoomed out.
Example:
MsgBox str(HTMLViewer1.canZoomPageOutMBS)
Notes: This is a new webview function which is not available on all webview versions. So be aware that you may get an NSExceptionMBS about the function not being available.

Feedback, Comments & Corrections

HTMLViewer.ClearFocusMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.4 Yes No No No No
Function: Clears the focus.
Example:
HTMLViewer1.ClearFocusMBS
Notes: If the focus is on the webpage, it will be cleared so there is no focus on the window. Useful if you want to workaround a focus bug in the htmlviewer control.

Feedback, Comments & Corrections

HTMLViewer.ContinuousSpellCheckingEnabledMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.7 Yes No No No No
Function: Whether continuous spell checking is enabled.
Example:
htmlviewer1.ContinuousSpellCheckingEnabledMBS=True
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

HTMLViewer.CustomTextEncodingNameMBS as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: The custom text encoding name.
Example:
MsgBox HTMLViewer1.CustomTextEncodingNameMBS
Notes:
On getting:
The custom text encoding name or "" if no custom text encoding name has been set.

On setting:
Make the page display with a different text encoding; stops any load in progress.
The text encoding passed in overrides the normal text encoding smarts including what's specified in a web page's header or HTTP response.
The text encoding automatically goes back to the default when the top level frame changes to a new location.
Setting the text encoding name to nil makes the webView use default encoding rules.
(Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

HTMLViewer.CustomUserAgentMBS as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: The custom user-agent string or nil if no custom user-agent string has been set.
Example:
htmlviewer1.CustomUserAgentMBS=NewCFStringMBS("HelloWorldBrowser")
Notes: (Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

HTMLViewer.dashboardBehaviorMBS(behavior as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.8 Yes Yes Yes No No
Function: Get or set the htmlviewer behavior.
Notes:
This is a private API from Apple which may break in the future.
It seems to exist for the dashboard application to switch some flags for event handling.

Behavior constants:
const WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows = 0
const WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns = 1
const WebDashboardBehaviorAlwaysAcceptsFirstMouse = 2
const WebDashboardBehaviorAllowWheelScrolling = 3
const WebDashboardBehaviorUseBackwardCompatibilityMode = 4
(Read and Write computed property)

Feedback, Comments & Corrections

HTMLViewer.DrawsBackgroundMBS as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: Enable or disable the background drawing.
Example:
HTMLViewer1.DrawsBackgroundMBS = false
Notes:
Works only with Webkit on Mac OS X 10.3.9 and newer.
Returns false on unsupported Webkit versions.
If you set it to false, the background is not drawn and you can have transparent websites like the Dashboard widgets.
(Read and Write computed property)

Feedback, Comments & Corrections

HTMLViewer.EditableMBS as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 11.3 Yes No No No No
Function: Whether the user is allowed to edit the document.
Notes:
You can change the receiver's document programmatically regardless of this setting.
Available in Mac OS X v10.3.9 and later.

Normally, an HTML document is not editable unless the elements within the document are editable. This method provides a low-level way to make the contents of a WebView object editable without altering the document or DOM structure.

True if the receiver allows the user to edit the document. False if an element in the receiver's document can be edited only if the CONTENTEDITABLE attribute has been set on the element or one of its parent elements.
(Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

HTMLViewer.EstimatedProgressMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: An estimate of the percent complete for a document load.
Example:
MsgBox str(HTMLViewer1.EstimatedProgressMBS)
Notes: This value will range from 0 to 1.0 and, once a load completes, will remain at 1.0 until a new load starts, at which point it will be reset to 0. The value is an estimate based on the total number of bytes expected to be received for a document, including all it's possible subresources. For more accurate progress indication it is recommended that you implement a WebFrameLoadDelegate and a WebResourceLoadDelegate.

Some examples which use this method:

Feedback, Comments & Corrections

HTMLViewer.EvaluateJavaScriptMBS(code as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: Runs the given java script and returns the result.
Example:
// shows current user agent string which the control sends to website
MsgBox htmlviewer1.EvaluateJavaScriptMBS("navigator.userAgent")

// using eval:
MsgBox HTMLViewer1.EvaluateJavaScriptMBS("eval(""x=10;y=20;x*y"")")

// with function:
MsgBox HTMLViewer1.EvaluateJavaScriptMBS(" test(); function test() { x = 10 ; y = 20; return x * y;}")

// with multiline script:
dim s as string = "test();"+EndOfLine+_
"function test()"+EndOfLine+_
"{ "+EndOfLine+_
" x = 10; "+EndOfLine+_
" y = 20; "+EndOfLine+_
" return x * y;"+EndOfLine+_
"}"

MsgBox HTMLViewer1.EvaluateJavaScriptMBS(s)
Notes:
Returns "" on any error.

In Safari 2 we used "return 1+2;" while in Safari 3 we only need "1+2;". The return is no longer needed. Be aware that there is an implicit return now with Safari 3!

For Windows use IERunJavaScriptMBS function.

Some examples which use this method:

Feedback, Comments & Corrections

HTMLViewer.FrameHeightMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No No No
Function: The height of the view frame.
Example:
MsgBox str(HTMLViewer1.FrameLeftMBS)+" "+str(HTMLViewer1.FrameTopMBS)+" "+str(HTMLViewer1.FrameWidthMBS)+" "+str(HTMLViewer1.FrameHeightMBS)
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

HTMLViewer.FrameLeftMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No No No
Function: The left position of the view frame.
Example:
MsgBox str(HTMLViewer1.FrameLeftMBS)+" "+str(HTMLViewer1.FrameTopMBS)+" "+str(HTMLViewer1.FrameWidthMBS)+" "+str(HTMLViewer1.FrameHeightMBS)
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

HTMLViewer.FrameTopMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No No No
Function: The top position of the view frame.
Example:
MsgBox str(HTMLViewer1.FrameLeftMBS)+" "+str(HTMLViewer1.FrameTopMBS)+" "+str(HTMLViewer1.FrameWidthMBS)+" "+str(HTMLViewer1.FrameHeightMBS)
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

HTMLViewer.FrameWidthMBS as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property HTMLViewer Mac MBS MacControls Plugin 7.5 Yes No No No No
Function: The width of the view frame.
Example:
MsgBox str(HTMLViewer1.FrameLeftMBS)+" "+str(HTMLViewer1.FrameTopMBS)+" "+str(HTMLViewer1.FrameWidthMBS)+" "+str(HTMLViewer1.FrameHeightMBS)
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

HTMLViewer.GetPageFormatMBS as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method HTMLViewer Mac MBS MacControls Plugin 7.2 Yes No No No No
Function: The current page format settings as a string.
Example:
MsgBox HTMLViewer1.GetPageFormatMBS
// shows a big XML String
Notes:
Can be used to save current printer settings to a preferences file.
Value is an empty string until a page format is defined.

Feedback, Comments & Corrections

Next items

The items on this page are in the following plugins: MBS MacControls Plugin.

The biggest plugin in space...




Links
MBS Xojo tutorial videos