presentation über html

  • hallo

    hab am Montag meine Eurocom(son englischreferat) über html und hab mir dazu mal ein kleines script geschrieben...

    euch bringt es reichlich wenig da es auflösungsabhängig ist, aber ich denke der eine oder andere kann sich ein paar kleine anregungen holen...

    hier mal der source :

    Spoiler anzeigen
    [autoit]


    #region unwichtiges
    ;hotkeys------------------------------------
    HotKeySet("{esc}","_exit")
    HotKeySet("{right}","_weiter")
    HotKeySet("{left}","_zurueck")
    ;hotkeys end--------------------------------
    ;includes-----------------------------------
    #include <ie.au3>
    #include <GUIConstants.au3>
    #include <RTF_writer.au3>
    #include <guiedit.au3>
    #include <misc.au3>
    #include <string.au3>
    ;endinclude---------------------------------
    ;globals------------------------------------
    Global $hl_tag = 0x0000ff
    Global $hl_attrib = 0xff5500
    Global $hl_value = 0x999999
    Global $hl_plaintext = 0x000000
    Global $move = -1
    Global $mark = 100
    Global $titletext = " - Microsoft Internet Explorer"
    ;globals end--------------------------------
    ;special controls---------------------------
    $hPlug = PluginOpen ("rtfplugin.dll")
    $oIE = _IECreateEmbedded()
    ;special controls end-----------------------
    ;guicrate-----------------------------------
    $hGUI = GUICreate('Eurocom - HTML',@DesktopWidth,@DesktopHeight,0,0,$ws_popup)
    $group1 = GUICtrlCreateGroup("HTML code :",10,10,@DesktopWidth/2-20,@DesktopHeight-20)
    $hEdit = GUICtrlCreateRTFEdit($hGUI,20,30,@desktopwidth/2-40,@DesktopHeight-50)
    $group2 = GUICtrlCreateGroup("Browser :",@DesktopWidth/2+10,10,@DesktopWidth/2-20,@DesktopHeight-20)
    $title = GUICtrlCreateLabel("Microsoft Internet Explorer",@DesktopWidth/2+20,30,@DesktopWidth/2-41,20)
    GUICtrlSetBkColor($title,0x0000ff)
    GUICtrlSetFont($title,11,-1,-1,"Arial Black")
    GUICtrlSetColor($title,0xffffff)
    $ObjIE = GUICtrlCreateObj($oIE,@DesktopWidth/2+20,50,@DesktopWidth/2-40,@DesktopHeight-70)
    _IENavigate($oIE,"about:blank")
    GUISetBkColor(0xffffff)
    ;hilfsgui-----------------------------------
    $hhelpGUI = GUICreate('Eurocom - HTML (help)',@DesktopWidth,@DesktopHeight,0,0,$ws_popup)
    GUISetBkColor(0xffffff,$hhelpGUI)
    $startuploabel = GUICtrlCreateLabel("Hypertext Markup Language",0,0,@DesktopWidth,@DesktopHeight-300,$bs_center+$es_center)
    GUICtrlSetBkColor($startuploabel,0xffffff)
    GUICtrlSetFont($startuploabel,30,-1,-1,"Arial Black")
    GUICtrlSetColor($startuploabel,0x0000ff)
    GUISetState(@SW_SHOW,$hhelpGUI)
    GUISetState(@SW_SHOWNOACTIVATE,$hGUI)
    ;gui erstellen end--------------------------
    ;main---------------------------------------
    Beep(1000,100)
    While 1
    Sleep(1000)
    ;idle
    WEnd
    ;main end-----------------------------------
    ;functions----------------------------------
    Func _exit()
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func code($sText,$color,$crlf="")
    Local $out = _RTFCreateDocument("MS Sans Serif")
    $out = _RTFAppendString($out, " " & $sText &$crlf,$color, 12, 1, "MS Sans Serif")
    GUICtrlRTFSet($hEdit, $out, 1)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _mark($width,$height,$left,$top,$color=0x00ff00,$trans=200)
    Local $gui
    $gui = GUICreate(Random(1,1000),$width,$height,$left,$top,$ws_popup,$ws_ex_toolwindow+$ws_ex_topmost)
    GUISetBkColor($color)
    WinSetTrans($gui,"",$trans)
    GUISetState(@SW_SHOWNOACTIVATE)
    Return $gui
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _markdelete($handle)
    Return GUIDelete($handle)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func clearcode()
    GUICtrlRTFSet($hEdit, "", 0)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func browser($html)
    $titlesplit = _StringBetween($html,"<title>","</title>")
    If IsArray($titlesplit) Then
    GUICtrlSetData($title,$titlesplit[0]&$titletext)
    Else
    GUICtrlSetData($title," Microsoft Internet Explorer")
    EndIf
    _IEDocWriteHTML($oIE,$html)
    EndFunc
    Func _weiter()
    $move = $move +1
    _step($move)
    HotKeySet("{right}")
    While _IsPressed("27")
    Sleep(1)
    WEnd
    HotKeySet("{right}","_weiter")
    EndFunc
    Func _zurueck()
    $move = $move -1
    _step($move)
    HotKeySet("{left}")
    While _IsPressed("25")
    Sleep(1)
    WEnd
    HotKeySet("{left}","_zurueck")
    EndFunc
    Func clearbrowser()
    _IEDocWriteHTML($oIE,"")
    GUICtrlSetData($title," Microsoft Internet Explorer")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;functions end------------------------------
    #endregion unwichtiges
    ;Steps--------------------------------------
    Func _step($step)
    Switch $step
    Case 0
    _markdelete($mark)
    GUIDelete($hhelpGUI)
    clearcode()
    clearbrowser()
    Case 1
    _markdelete($mark)
    $mark = _mark(@DesktopWidth/2,@DesktopHeight,0,0,0x00ff00,150)
    clearcode()
    clearbrowser()
    Case 2
    _markdelete($mark)
    $mark = _mark(@DesktopWidth/2,@DesktopHeight,@DesktopWidth/2,0,0x00ff00,150)
    clearcode()
    clearbrowser()
    Case 3
    _markdelete($mark)
    clearcode()
    clearbrowser()
    ;syntax---------------------------------------
    Case 4
    _markdelete($mark)
    clearcode()
    code(@CRLF&"<html>"&@CRLF,$hl_tag,@CRLF)
    code(@TAB&"<head>",$hl_tag,@CRLF)
    code(@TAB&@TAB&"<title>",$hl_tag)
    code("Title of the HTML-file",$hl_plaintext)
    code("</title>",$hl_tag,@CRLF)
    code(@TAB&"</head>",$hl_tag,@CRLF)
    code(@CRLF&@TAB&"<body ",$hl_tag)
    code("bgcolor",$hl_attrib)
    code("=",$hl_tag)
    code('"green"',$hl_value)
    code(">",$hl_tag,@CRLF&@crlf)
    code(@tab&@tab&"<img ",$hl_tag)
    code("src",$hl_attrib)
    code("=",$hl_tag)
    code('"/test.bmp"',$hl_value)
    code(">",$hl_tag,@crlf)
    code(@tab&@tab&"<b>",$hl_tag)
    code("some bold text",$hl_plaintext)
    code("</b>",$hl_tag,@crlf&@crlf)
    code(@TAB&"</body>",$hl_tag,@CRLF&@CRLF)
    code("</html>",$hl_tag)
    browser("<html><head><title> Title of the HTML-file </title></head><body bgcolor='green'><img src='C:\Dokumente und Einstellungen\Eurocom\Eigene Dateien\eurocom\test.bmp'><br><b>some bold text<b></body></html>")
    Case 5
    _markdelete($mark)
    $mark = _mark(10,20,23,53); less than
    Case 6
    _markdelete($mark)
    $mark = _mark(34,20,33,53); code
    Case 7
    _markdelete($mark)
    $mark = _mark(10,20,67,53);greater than
    Case 8
    _markdelete($mark)
    $mark = _mark(10,20,28,313);less than endtag
    Case 9
    _markdelete($mark)
    $mark = _mark(5,20,38,313);slash
    Case 10
    _markdelete($mark)
    $mark = _mark(34,20,43,313); html ende
    Case 11
    _markdelete($mark)
    $mark = _mark(10,20,77,313); greater than
    Case 12
    _markdelete($mark)
    $mark = _mark(196,20,119,213); image
    Case 13
    _markdelete($mark)
    $mark = _mark(192,20,119,233); bold text
    Case 14
    _markdelete($mark)
    clearcode()
    code(@CRLF&"<html>"&@CRLF,$hl_tag,@CRLF)
    code(@TAB&"<head>",$hl_tag,@CRLF)
    code(@TAB&@TAB&"<title>",$hl_tag)
    code("Title of the HTML-file",$hl_plaintext)
    code("</title>",$hl_tag,@CRLF)
    code(@TAB&"</head>",$hl_tag,@CRLF)
    code(@CRLF&@TAB&"<body ",$hl_tag)
    code("bgcolor",$hl_attrib)
    code("=",$hl_tag)
    code('"green"',$hl_value)
    code(">",$hl_tag,@CRLF&@crlf)
    code(@tab&@tab&"<img ",$hl_tag)
    code("src",$hl_attrib)
    code("=",$hl_tag)
    code('"/test.bmp"',$hl_value)
    code(">",$hl_tag,@crlf)
    code(@tab&@tab&"<b>",$hl_tag)
    code("some bold text",$hl_plaintext)
    code("</b>",$hl_tag,@crlf&@crlf)
    code(@TAB&"</body>",$hl_tag,@CRLF&@CRLF)
    code("</html>",$hl_tag)
    browser("<html><head><title> Title of the HTML-file </title></head><body bgcolor='green'><img src='C:\Dokumente und Einstellungen\Eurocom\Eigene Dateien\eurocom\test.bmp'><br><b>some bold text<b></body></html>")
    $mark = _mark(139,20,129,173);bgcolor
    Case 15
    _markdelete($mark)
    clearcode()
    code(@CRLF&"<html>"&@CRLF,$hl_tag,@CRLF)
    code(@TAB&"<head>",$hl_tag,@CRLF)
    code(@TAB&@TAB&"<title>",$hl_tag)
    code("Title of the HTML-file",$hl_plaintext)
    code("</title>",$hl_tag,@CRLF)
    code(@TAB&"</head>",$hl_tag,@CRLF)
    code(@CRLF&@TAB&"<body ",$hl_tag)
    code("bgcolor",$hl_attrib)
    code("=",$hl_tag)
    code('"blue"',$hl_value)
    code(">",$hl_tag,@CRLF&@crlf)
    code(@tab&@tab&"<img ",$hl_tag)
    code("src",$hl_attrib)
    code("=",$hl_tag)
    code('"/test.bmp"',$hl_value)
    code(">",$hl_tag,@crlf)
    code(@tab&@tab&"<b>",$hl_tag)
    code("some bold text",$hl_plaintext)
    code("</b>",$hl_tag,@crlf&@crlf)
    code(@TAB&"</body>",$hl_tag,@CRLF&@CRLF)
    code("</html>",$hl_tag)
    browser("<html><head><title> Title of the HTML-file </title></head><body bgcolor='blue'><img src='C:\Dokumente und Einstellungen\Eurocom\Eigene Dateien\eurocom\test.bmp'><br><b>some bold text<b></body></html>")
    ;syntax end---------------------------------------------
    ;tags---------------------------------------------------
    Case 16
    clearcode()
    clearbrowser()
    _markdelete($mark)
    code(@CRLF&"<img ",$hl_tag)
    code("src",$hl_attrib)
    code("=",$hl_tag)
    code('"images/test.bmp"',$hl_value)
    code(">",$hl_tag)
    browser('<html><body><img src="C:\Dokumente und Einstellungen\Eurocom\Eigene Dateien\eurocom\test.bmp"></body></html>')
    Case 17
    _markdelete($mark)
    $mark = _mark(190,20,71,53)
    Case 18
    _markdelete($mark)
    clearbrowser()
    clearcode()
    code(@CRLF&'<a ',$hl_tag)
    code("href",$hl_attrib)
    code("=",$hl_tag)
    code('"http://www.google.de"',$hl_value)
    code(">",$hl_tag)
    code("klick to go to google",$hl_plaintext)
    code("</a>",$hl_tag)
    browser("<html><body><a href='http://www.google.de'>klick to go to google</a></body></html>")
    Case 19
    _markdelete($mark)
    $mark = _mark(233,20,53,53)
    Case 20
    _markdelete($mark)
    clearbrowser()
    clearcode()
    code(@CRLF&"some text in the first line",$hl_plaintext)
    code("<br>",$hl_tag)
    code("some text in the second line",$hl_plaintext)
    browser("<html><body>some text in the first line<br>some text in the second line</body></html>")
    Case 21
    _markdelete($mark)
    clearbrowser()
    clearcode()
    code(@CRLF&"<u>",$hl_tag)
    code("I am displayed underlined",$hl_plaintext)
    code("</u>",$hl_tag,@CRLF)
    code(@CRLF&"<b>",$hl_tag)
    code("I am displayed bold",$hl_plaintext)
    code("</b>",$hl_tag,@CRLF)
    code(@CRLF&"<i>",$hl_tag)
    code("I am dispayed italic",$hl_plaintext)
    code("</i>",$hl_tag,@CRLF)
    code(@CRLF&"<u><b><i>",$hl_tag)
    code("I am displayed underlined, bold and italic",$hl_plaintext)
    code("</u></b></i>",$hl_tag)
    browser("<html><body><br><u>I am displayed underlined</u><br><br><b>I am displayed bold</b><br><br><i>I am displayed italic</i><br><br><u><b><i>I am displayed underlined, bold and italic</u></b></i></body></html>")
    ;tags end-----------------------------------------------
    ;zukunft------------------------------------------------
    Case 22
    clearcode()
    code(@crlf&"<img ",$hl_tag)
    code("src",$hl_attrib)
    code("=",$hl_tag)
    code('"/test.bmp"',$hl_value)
    code(">",$hl_tag)
    browser("<html><body><img src='C:\Dokumente und Einstellungen\Eurocom\Eigene Dateien\eurocom\test.bmp'></body></html>")
    Case 23
    _markdelete($mark)
    clearcode()
    code(@crlf&"<img ",$hl_tag)
    code("src",$hl_attrib)
    code("=",$hl_tag)
    code('"/test.bmp"',$hl_value)
    code(">",$hl_tag)
    code("</img>",$hl_tag)
    Case 24
    $mark = _mark(58,20,219,53);img ende
    clearcode()
    code(@crlf&"<img ",$hl_tag)
    code("src",$hl_attrib)
    code("=",$hl_tag)
    code('"/test.bmp"',$hl_value)
    code(">",$hl_tag)
    code("</img>",$hl_tag)
    Case 25
    _markdelete($mark)
    clearcode()
    code(@crlf&"<textarea ",$hl_tag)
    code("readonly",$hl_attrib)
    code(">",$hl_tag)
    code("some text in a textarea",$hl_plaintext)
    code("</textarea>",$hl_tag)
    browser("<html><body><textarea readonly>some text in a textarea</textarea></body></html>")
    Case 26
    _markdelete($mark)
    $mark = _mark(68,20,109,53);readonly
    clearcode()
    code(@crlf&"<textarea ",$hl_tag)
    code("readonly",$hl_attrib)
    code(">",$hl_tag)
    code("some text in a textarea",$hl_plaintext)
    code("</textarea>",$hl_tag)
    browser("<html><body><textarea readonly>some text in a textarea</textarea></body></html>")
    Case 27
    _markdelete($mark)
    clearcode()
    code(@crlf&"<textarea ",$hl_tag)
    code("readonly",$hl_attrib)
    code("=",$hl_tag)
    code('"readonly"',$hl_value)
    code(">",$hl_tag)
    code("some text in a textarea",$hl_plaintext)
    code("</textarea>",$hl_tag)
    browser("<html><body><textarea readonly>some text in a textarea</textarea></body></html>")
    EndSwitch
    EndFunc
    ;steps--------------------------------------

    [/autoit]

    und an die warumhastdunichtpowerpointbenutzt frager... man durfe es nciht bentzen und ich finde die meisten Powerpointpräsentationen auch reichlich unprofesionell

    ihr braucht auch noch das rtfplugin ausm englischen forum... deswegen hab ich das ganze auch nochmal als zip

    und nun viel spaß in meinem dateichaos^^

    und wünscht mir glück *g*

    grez derda

    edit: cool habs grad an meinem vater seim pc getestet und sihe da ... :) es ist anscheinend doch nciht so auflösungsabhängig wie ich dachte

    edit2: wer will das ein bild angezeigt wird muss den source anpassen... einfach in scite alle "C:\Dokumente und Einstellungen\Eurocom\Eigene Dateien\eurocom\test.bmp" mit eurem bildpfad ersetzen^^