; #FUNCTION# ====================================================================================================================
; Name...........: _IE_Example
; Description ...: Display a new browser window pre-loaded with documents to be used in IE.au3 examples
; Parameters ....: $s_module - Optional: specifies which module to run
; - basic = (Default) simple HTML page with text, links and images
; - form = simple HTML page with multiple form elements
; - frameset = simple HTML page with frames
; - iframe = simple HTML page with iframes
; - table = simple HTML page with tables
; Return values .: On Success - Returns an object variable pointing to an InternetExplorer.Application object
; On Failure - Returns 0 and sets @ERROR
; @ERROR - 0 ($_IEStatus_Success) = No Error
; - 5 ($_IEStatus_InvalidValue) = Invalid Value
; @Extended - Contains invalid parameter number
; Author ........: Dale Hohm
; ===============================================================================================================================
Func _IE_Example($s_module = "basic")
Local $s_html = "", $o_object
Switch $s_module
Case "basic"
$s_html &= "<HEAD>" & @CR
$s_html &= "<TITLE>_IE_Example('basic')</TITLE>" & @CR
$s_html &= "<STYLE>body {font-family: Arial}</STYLE>" & @CR
$s_html &= "</HEAD>" & @CR
$s_html &= "<BODY>" & @CR
$s_html &= "<a href='http://www.autoitscript.com'><img src='http://www.autoitscript.com/images/autoit_6_240x100.jpg' name='AutoItImage' alt='AutoIt Homepage Image'></a>" & @CR
$s_html &= "<p>" & @CR
$s_html &= "<div id=line1>This is a simple HTML page with text, links and images.</div>" & @CR
$s_html &= "<p>" & @CR
$s_html &= "<div id=line2><a href='http://www.autoitscript.com'>AutoIt</a> is a wonderful automation scripting language.</div>" & @CR
$s_html &= "<p>" & @CR
$s_html &= "<div id=line3>It is supported by a very active and supporting <a href='http://www.autoitscript.com/forum/'>user forum</a>.</div>" & @CR
$s_html &= "<p>" & @CR
$s_html &= "<div id=IEAu3Data></div>" & @CR
$s_html &= "</BODY>" & @CR
$s_html &= "</HTML>"
$o_object = _IECreate()
_IEDocWriteHTML($o_object, $s_html)
Case "table"
$s_html &= "<HTML>" & @CR
$s_html &= "<HEAD>" & @CR
$s_html &= "<TITLE>_IE_Example('table')</TITLE>" & @CR
$s_html &= "<STYLE>body {font-family: Arial}</STYLE>" & @CR
$s_html &= "</HEAD>" & @CR
$s_html &= "<BODY>" & @CR
$s_html &= "$oTableOne = _IETableGetObjByName($oIE, "tableOne")
" & @CR
$s_html &= "<table border=1 id='tableOne'><p>" & @CR
$s_html &= "<table border=1 id='tableOne'>" & @CR
$s_html &= " <tr>" & @CR
$s_html &= " <td>AutoIt</td>" & @CR
$s_html &= " <td>is</td>" & @CR
$s_html &= " <td>really</td>" & @CR
$s_html &= " <td>great</td>" & @CR
$s_html &= " <td>with</td>" & @CR
$s_html &= " <td>IE.au3</td>" & @CR
$s_html &= " </tr>" & @CR
$s_html &= " <tr>" & @CR
$s_html &= " <td>1</td>" & @CR
$s_html &= " <td>2</td>" & @CR
$s_html &= " <td>3</td>" & @CR
$s_html &= " <td>4</td>" & @CR
$s_html &= " <td>5</td>" & @CR
$s_html &= " <td>6</td>" & @CR
$s_html &= " </tr>" & @CR
$s_html &= " <tr>" & @CR
$s_html &= " <td>the</td>" & @CR
$s_html &= " <td>quick</td>" & @CR
$s_html &= " <td>red</td>" & @CR
$s_html &= " <td>fox</td>" & @CR
$s_html &= " <td>jumped</td>" & @CR
$s_html &= " <td>over</td>" & @CR
$s_html &= " </tr>" & @CR
$s_html &= " <tr>" & @CR
$s_html &= " <td>the</td>" & @CR
$s_html &= " <td>lazy</td>" & @CR
$s_html &= " <td>brown</td>" & @CR
$s_html &= " <td>dog</td>" & @CR
$s_html &= " <td>the</td>" & @CR
$s_html &= " <td>time</td>" & @CR
$s_html &= " </tr>" & @CR
$s_html &= " <tr>" & @CR
$s_html &= " <td>has</td>" & @CR
$s_html &= " <td>come</td>" & @CR
$s_html &= " <td>for</td>" & @CR
$s_html &= " <td>all</td>" & @CR
$s_html &= " <td>good</td>" & @CR
$s_html &= " <td>men</td>" & @CR
$s_html &= " </tr>" & @CR
$s_html &= " <tr>" & @CR
$s_html &= " <td>to</td>" & @CR
$s_html &= " <td>come</td>" & @CR
$s_html &= " <td>to</td>" & @CR
$s_html &= " <td>the</td>" & @CR
$s_html &= " <td>aid</td>" & @CR
$s_html &= " <td>of</td>" & @CR
$s_html &= " </tr>" & @CR
$s_html &= "</table>" & @CR
$s_html &= "<p>" & @CR
$s_html &= "$oTableTwo = _IETableGetObjByName($oIE, "tableTwo")
" & @CR
$s_html &= "<table border="1" id='tableTwo'><p>" & @CR
$s_html &= "<table border=1 id='tableTwo'>" & @CR
$s_html &= " <tr>" & @CR
$s_html &= " <td colspan='4'>Table Top</td>" & @CR
$s_html &= " </tr>" & @CR
$s_html &= " <tr>" & @CR
$s_html &= " <td>One</td>" & @CR
$s_html &= " <td colspan='3'>Two</td>" & @CR
$s_html &= " </tr>" & @CR
$s_html &= " <tr>" & @CR
$s_html &= " <td>Three</td>" & @CR
$s_html &= " <td>Four</td>" & @CR
$s_html &= " <td colspan='2'>Five</td>" & @CR
$s_html &= " </tr>" & @CR
$s_html &= " <tr>" & @CR
$s_html &= " <td>Six</td>" & @CR
$s_html &= " <td colspan='3'>Seven</td>" & @CR
$s_html &= " </tr>" & @CR
$s_html &= " <tr>" & @CR
$s_html &= " <td>Eight</td>" & @CR
$s_html &= " <td>Nine</td>" & @CR
$s_html &= " <td>Ten</td>" & @CR
$s_html &= " <td>Eleven</td>" & @CR
$s_html &= " </tr>" & @CR
$s_html &= "</table>" & @CR
$s_html &= "</BODY>" & @CR
$s_html &= "</HTML>"
$o_object = _IECreate()
_IEDocWriteHTML($o_object, $s_html)
Case "form"
$s_html &= "<HTML>" & @CR
$s_html &= "<HEAD>" & @CR
$s_html &= "<TITLE>_IE_Example('form')</TITLE>" & @CR
$s_html &= "<STYLE>body {font-family: Arial}</STYLE>" & @CR
$s_html &= "</HEAD>" & @CR
$s_html &= "<BODY>" & @CR
$s_html &= "<form name='ExampleForm' onSubmit='javascript:alert(""ExampleFormSubmitted"");' method='post'>" & @CR
$s_html &= "<table cellspacing=6 cellpadding=6 border=1>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>ExampleForm</td>" & @CR
$s_html &= "<td><form name='ExampleForm' onSubmit='javascript:alert(""ExampleFormSubmitted"");' method='post'></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>Hidden Input Element<input type='hidden' name='hiddenExample' value='secret value'></td>" & @CR
$s_html &= "<td><input type='hidden' name='hiddenExample' value='secret value'></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>" & @CR
$s_html &= "<input type='text' name='textExample' value='http://' size='20' maxlength='30'>" & @CR
$s_html &= "</td>" & @CR
$s_html &= "<td><input type='text' name='textExample' value='http://' size='20' maxlength='30'></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>" & @CR
$s_html &= "<input type='password' name='passwordExample' size='10'>" & @CR
$s_html &= "</td>" & @CR
$s_html &= "<td><input type='password' name='passwordExample' size='10'></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>" & @CR
$s_html &= "<input type='file' name='fileExample'>" & @CR
$s_html &= "</td>" & @CR
$s_html &= "<td><input type='file' name='fileExample'></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>" & @CR
$s_html &= "<input type='image' name='imageExample' alt='AutoIt Homepage' src='http://www.autoitscript.com/images/autoit_6_240x100.jpg'>" & @CR
$s_html &= "</td>" & @CR
$s_html &= "<td><input type='image' name='imageExample' alt='AutoIt Homepage' src='http://www.autoitscript.com/images/autoit_6_240x100.jpg'></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>" & @CR
$s_html &= "<textarea name='textareaExample' rows='5' cols='15'>Hello!</textarea>" & @CR
$s_html &= "</td>" & @CR
$s_html &= "<td><textarea name='textareaExample' rows='5' cols='15'>Hello!</textarea></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>" & @CR
$s_html &= "<input type='checkbox' name='checkboxG1Example' value='gameBasketball'>Basketball
" & @CR
$s_html &= "<input type='checkbox' name='checkboxG1Example' value='gameFootball'>Football
" & @CR
$s_html &= "<input type='checkbox' name='checkboxG2Example' value='gameTennis' checked>Tennis
" & @CR
$s_html &= "<input type='checkbox' name='checkboxG2Example' value='gameBaseball'>Baseball" & @CR
$s_html &= "</td>" & @CR
$s_html &= "<td><input type='checkbox' name='checkboxG1Example' value='gameBasketball'>Basketball<br>
" & @CR
$s_html &= "<input type='checkbox' name='checkboxG1Example' value='gameFootball'>Football<br>
" & @CR
$s_html &= "<input type='checkbox' name='checkboxG2Example' value='gameTennis' checked>Tennis<br>
" & @CR
$s_html &= "<input type='checkbox' name='checkboxG2Example' value='gameBaseball'>Baseball</td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>" & @CR
$s_html &= "<input type='radio' name='radioExample' value='vehicleAirplane'>Airplane
" & @CR
$s_html &= "<input type='radio' name='radioExample' value='vehicleTrain' checked>Train
" & @CR
$s_html &= "<input type='radio' name='radioExample' value='vehicleBoat'>Boat
" & @CR
$s_html &= "<input type='radio' name='radioExample' value='vehicleCar'>Car</td>" & @CR
$s_html &= "<td><input type='radio' name='radioExample' value='vehicleAirplane'>Airplane<br>
" & @CR
$s_html &= "<input type='radio' name='radioExample' value='vehicleTrain' checked>Train<br>
" & @CR
$s_html &= "<input type='radio' name='radioExample' value='vehicleBoat'>Boat<br>
" & @CR
$s_html &= "<input type='radio' name='radioExample' value='vehicleCar'>Car<br></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>" & @CR
$s_html &= "<select name='selectExample'>" & @CR
$s_html &= "<option value='homepage.html'>Homepage" & @CR
$s_html &= "<option value='midipage.html'>Midipage" & @CR
$s_html &= "<option value='freepage.html'>Freepage" & @CR
$s_html &= "</select>" & @CR
$s_html &= "</td>" & @CR
$s_html &= "<td><select name='selectExample'>
" & @CR
$s_html &= "<option value='homepage.html'>Homepage
" & @CR
$s_html &= "<option value='midipage.html'>Midipage
" & @CR
$s_html &= "<option value='freepage.html'>Freepage
" & @CR
$s_html &= "</select></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>" & @CR
$s_html &= "<select name='multipleSelectExample' size='6' multiple>" & @CR
$s_html &= "<option value='Name1'>Aaron" & @CR
$s_html &= "<option value='Name2'>Bruce" & @CR
$s_html &= "<option value='Name3'>Carlos" & @CR
$s_html &= "<option value='Name4'>Denis" & @CR
$s_html &= "<option value='Name5'>Ed" & @CR
$s_html &= "<option value='Name6'>Freddy" & @CR
$s_html &= "</select>" & @CR
$s_html &= "</td>" & @CR
$s_html &= "<td><select name='multipleSelectExample' size='6' multiple>
" & @CR
$s_html &= "<option value='Name1'>Aaron
" & @CR
$s_html &= "<option value='Name2'>Bruce
" & @CR
$s_html &= "<option value='Name3'>Carlos
" & @CR
$s_html &= "<option value='Name4'>Denis
" & @CR
$s_html &= "<option value='Name5'>Ed
" & @CR
$s_html &= "<option value='Name6'>Freddy
" & @CR
$s_html &= "</select></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td>" & @CR
$s_html &= "<input name='submitExample' type='submit' value='Submit'>" & @CR
$s_html &= "<input name='resetExample' type='reset' value='Reset'>" & @CR
$s_html &= "</td>" & @CR
$s_html &= "<td><input name='submitExample' type='submit' value='Submit'>
" & @CR
$s_html &= "<input name='resetExample' type='reset' value='Reset'></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "</table>" & @CR
$s_html &= "<input type='hidden' name='hiddenExample' value='secret value'>" & @CR
$s_html &= "</FORM>" & @CR
$s_html &= "</BODY>" & @CR
$s_html &= "</HTML>"
$o_object = _IECreate()
_IEDocWriteHTML($o_object, $s_html)
Case "frameset"
$s_html &= "<HTML>" & @CR
$s_html &= "<HEAD>" & @CR
$s_html &= "<TITLE>_IE_Example('frameset')</TITLE>" & @CR
$s_html &= "</HEAD>" & @CR
$s_html &= "<FRAMESET rows='25,200'>" & @CR
$s_html &= " <FRAME NAME=Top SRC=about:blank>" & @CR
$s_html &= " <FRAMESET cols='100,500'>" & @CR
$s_html &= " <FRAME NAME=Menu SRC=about:blank>" & @CR
$s_html &= " <FRAME NAME=Main SRC=about:blank>" & @CR
$s_html &= " </FRAMESET>" & @CR
$s_html &= "</FRAMESET>" & @CR
$s_html &= "</HTML>"
$o_object = _IECreate()
_IEDocWriteHTML($o_object, $s_html)
_IEAction($o_object, "refresh")
Local $oFrameTop = _IEFrameGetObjByName($o_object, "Top")
Local $oFrameMenu = _IEFrameGetObjByName($o_object, "Menu")
Local $oFrameMain = _IEFrameGetObjByName($o_object, "Main")
_IEBodyWriteHTML($oFrameTop, '$oFrameTop = _IEFrameGetObjByName($oIE, "Top")')
_IEBodyWriteHTML($oFrameMenu, '$oFrameMenu = _IEFrameGetObjByName($oIE, "Menu")')
_IEBodyWriteHTML($oFrameMain, '$oFrameMain = _IEFrameGetObjByName($oIE, "Main")')
Case "iframe"
$s_html &= "<HTML>" & @CR
$s_html &= "<HEAD>" & @CR
$s_html &= "<TITLE>_IE_Example('iframe')</TITLE>" & @CR
$s_html &= "</HEAD>" & @CR
$s_html &= "<BODY>" & @CR
$s_html &= "<table cellspacing=6 cellpadding=6 border=1>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td><iframe name='iFrameOne' src='about:blank' title='iFrameOne'></iframe></td>" & @CR
$s_html &= "<td><iframe name="iFrameOne" src="about:blank" title="iFrameOne"></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "<tr>" & @CR
$s_html &= "<td><iframe name='iFrameTwo' src='about:blank' title='iFrameTwo'></iframe></td>" & @CR
$s_html &= "<td><iframe name="iFrameTwo" src="about:blank" title="iFrameTwo"></td>" & @CR
$s_html &= "</tr>" & @CR
$s_html &= "</table>" & @CR
$s_html &= "</BODY>" & @CR
$s_html &= "</HTML>"
$o_object = _IECreate()
_IEDocWriteHTML($o_object, $s_html)
_IEAction($o_object, "refresh")
Local $oIFrameOne = _IEFrameGetObjByName($o_object, "iFrameOne")
Local $oIFrameTwo = _IEFrameGetObjByName($o_object, "iFrameTwo")
_IEBodyWriteHTML($oIFrameOne, '$oIFrameOne = _IEFrameGetObjByName($oIE, "iFrameOne")')
_IEBodyWriteHTML($oIFrameTwo, '$oIFrameTwo = _IEFrameGetObjByName($oIE, "iFrameTwo")')
Case Else
__IEErrorNotify("Error", "_IE_Example", "$_IEStatus_InvalidValue")
Return SetError($_IEStatus_InvalidValue, 1, 0)
EndSwitch
Return SetError($_IEStatus_Success, 0, $o_object)
EndFunc ;==>_IE_Example