INSERT INTO `wStats` (`Date`,`UID`,`URL`,`ARGS`,`IP`,`Referer`) VALUES ("2010-09-10 12:36","1284133909-5724028","docs.mioplanet.com/browser_createex.php","","38.107.191.119","") browser.createEx | MioScript | MioFactory | Mioplanet Documentation Center
  Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | browser.createEx SEARCH    

  Functions
browser.create
browser.createEx
browser.eventFrame
browser.fromPoint
browser.ID.cancel
browser.ID.copyTo.ID
browser.ID.download.current
browser.ID.download.max
browser.ID.execScript
browser.ID.get.status
browser.ID.get.URL
browser.ID.getSource
browser.ID.goBack
browser.ID.goForward
browser.ID.goHome
browser.ID.handle
browser.ID.height
browser.ID.HTML.fromPoint.attribute
browser.ID.HTML.fromPoint.tagName
browser.ID.HTML.get.background.color
browser.ID.HTML.get.element.attribute
browser.ID.HTML.get.element.content
browser.ID.HTML.get.element.list
browser.ID.HTML.get.title
browser.ID.HTML.set.background.color
browser.ID.HTML.set.element.content
browser.ID.HTML.set.link.color
browser.ID.HTML.set.title
browser.ID.isAvailable
browser.ID.left
browser.ID.manualMailTo
browser.ID.navigate
browser.ID.newWindow
browser.ID.offline
browser.ID.options.connection
browser.ID.options.general
browser.ID.parent
browser.ID.pos
browser.ID.print
browser.ID.print.pageSetup
browser.ID.property
browser.ID.refresh
browser.ID.repaint
browser.ID.rzBackColor
browser.ID.saveAs
browser.ID.scrollbar.visible
browser.ID.silent
browser.ID.stop
browser.ID.top
browser.ID.visible
browser.ID.width
browser.ID.zoom
browser.manualCommand

  Events
event.browser:beforeNavigate
event.browser:documentComplete
event.browser:download:begin
event.browser:download:complete
event.browser:download:progress
event.browser:manualMailTo
event.browser:mioCommand
event.browser:navigate:error
event.browser:navigatecomplete
event.browser:newWindow
event.browser:statusChange
event.browser:titleChange

  MioScript Reference
> Statements
app...
browser...
dialog...
disk...
draw...
extern...
filename...
keyboard...
menu...
mio...
mouse...
num...
path...
pushButton...
reg...
RS232...
sci...
screen...
shortcut...
sound...
str...
system...
time...
var...
window...

Function
browser.createEx

Language: MioScript
Product: MioFactory


Syntax

browser.createEx(windowID, URL, x,y, width,height)


Parameters

IDwindowIDWindow ID to host the web browser object.
STRINGURLLocal file or URL to be loaded in the web browser object.
The HTML document should load the JavaScript library mioEngine.js.
INTx,yPosition of the web browser object in the window.
INTwidth,heightSize of the web browser object.


Return value

ID of the new web browser object, or NULL if object cannot be created.



Description

Creates and initialize a web browser object and establishes communication from JavaScript to MioScript.

Uses this function instead of browser.create when you need to communicate from JavaScript to MioScript.

The JavaScript library mioEngine.js contains all the code required to communicate with mioEngine.
This library must be loaded by the HTML document loaded in the web browser object as follow:

<SCRIPT src="mioEngine.js"></SCRIPT>


The function do the following process to initialize the web browser object:

Creates the web browser object with browser.create;
Sets the position;
Enable silent mode if debug is false (browser.ID.silent;
Registers the web browser to be scanned to catch function calls sent from JavaScript.
Opens the specified URL;
Check continuously if the user tries to move the window when the mouse is over the browser object. If the tag under the mouse has an attribute movable set to true, xonly, or yonly, the window can be moved.

When the attribute movable is set to:
true, the window can be moved.

xonly, the window can be moved on the horizontal axis.

yonly the window can be moved on the vertical axis.



When the page is loaded:

An new tag <miocmd> is add by mioEngine.js in the HTML document.
MioEngine scans continuously the tag <miocmd> for a command sent from JavaScript.
If one or several functions calls are found, the functions are called with the prefix public:.

You can declare a function accessible from JavaScript as follow:

function.public:myFunction()
...
function.end


And call it from JavaScript as follow:

sendToMio("myFunction")


You can also call it from MioScript as follow:

public.myFunction()


For more information: mioEngine.js

Note: This function is defined in the library klib.k and is linked automatically.




MioScript Sample Code

// Declaration of a public function in MioScript

function.public:myFunction()
    ...
function.end


// Calling the function in the HTML document

<SCRIPT src="mioEngine.js"></SCRIPT>

<SCRIPT>
    sendToMio("myFunction");
</SCRIPT>