The WebBrowser class represents a web browser control.
// create our own class derived from form
class MyForm extends Form
{
var m_url_textbox;
var m_browser;
function MyForm()
{
super("Mini Browser", 100, 100, 800, 600);
m_url_textbox = new TextBox("http://www.google.com", 0, 0, 500);
m_url_textbox.enterPressed.connect(this, onUrlEnterPressed);
m_browser = new WebBrowser(0, 50, 500, 350);
m_browser.navigate("http://www.google.com");
// vertical sizer
var main_layout = new BoxLayout(Layout.Vertical);
main_layout.add(m_url_textbox, 0, Layout.Expand | Layout.All, 5);
main_layout.add(m_browser, 1, Layout.Expand);
setLayout(main_layout);
}
function onUrlEnterPressed()
{
// user pressed enter, navigate to the new location
m_browser.navigate(m_url_textbox.getText());
}
}
// create an instance of our derived MyForm class
// and show it
var f = new MyForm;
f.show();
f = null;
// start the event loop; the application will exit as
// soon as the button is clicked
Application.run();
Returns true if the current image contents can be copied, and false otherwise.
Returns true if the current image contents can be copied, and false otherwise.
Returns true if the current image location can be copied, and false otherwise.
Returns true if the current image location can be copied, and false otherwise.
Returns true if the current link location can be copied, and false otherwise.
Returns true if the current link location can be copied, and false otherwise.
Returns true if there's a selection in the web control that can be copied, and false otherwise.
Returns true if there's a selection in the web control that can be copied, and false otherwise.
Returns true if there's a selection in the web control that can be cut, and false otherwise.
Returns true if there's a selection in the web control that can be cut, and false otherwise.
Returns true if the current contents of the system clipboard can be pasted, and false otherwise.
Copies the current image contents to the system clipboard.
Copies the current image location to the system clipboard.
Copies the current link location to the system clipboard.
Copies the current selection to the system clipboard.
Cuts the current selection.
Returns the current URI for the web control.
Returns the current URI for the web control.
Opens the previous URI in the list of navigated URIs.
Opens the next URI in the list of navigated URIs.
Pastes the contents of the system clipboard to the web control.
Reloads the current URI in the web control.
Selects all the selectable content of the web control.
Deselects all the selected content of the web control.
true if the operation succeeded, false otherwise
Display's the text passed in the html_text parameter in the browser control. The text is stored in a temporary file which is removed after the control has been destroyed.
Stops the web control from loading a URI that's currently being loaded.
Calling this method will cause execution to wait until the web browser has finished loading the web document. It is normally invoked after a call to navigate() is issued. The function may return before all images are loaded, but ensures that the web pages DOM document is fully present. The optional parameter, max_milliseconds, specifies the maximum amount of time the call should wait before returning. If no parameter is specified, the method will wait indefinitely.