Sign in to follow this  
Followers 0
BananaFredSoft

PresentationStudio

29 posts in this topic

This is a project that I started on, got fairly far on, and abandoned. I thought that it might be useful to someone, or could serve as a good learning experience. Do whatever you want with the code. You'll notice that "Present Show" doesn't work, I'm not sure why. It should call the function, but doesn't.

Functions: Picture, Text, Add Slide, Save, Open, Delete Item, Edit Item

Here's the code:

#include <GUIConstants.au3>
#include <Array.au3>
#include <Misc.au3>
#include <String.au3>
#include <FileRegister.au3>
#include <GUIComboBox.au3>

$slidearray = _ArrayCreate(0)
;pics
$pics = _ArrayCreate(0)
$pl = _ArrayCreate(0)
$pt = _ArrayCreate(0)
$pw = _ArrayCreate(0)
$ph = _ArrayCreate(0)
$ptab = _ArrayCreate(0)
$ppath = _ArrayCreate(0)
;text
$texts = _ArrayCreate(0)
$tl = _ArrayCreate(0)
$tt = _ArrayCreate(0)
$tw = _ArrayCreate(0)
$th = _ArrayCreate(0)
$tfname = _ArrayCreate(0)
$tfsize = _ArrayCreate(0)
$tfweight = _ArrayCreate(0)
$tfcolor = _ArrayCreate(0)
$tfattribs = _ArrayCreate(0)
$ttab = _ArrayCreate(0)
$tbkcolor = _ArrayCreate(0)
$tptexts = _ArrayCreate(0)
$bksetitems = _ArrayCreate(0)
;end text
$cinfonow = _ArrayCreate(0, 0)

$slidebks = _ArrayCreate(0)

$drawingpic = 0
$created = 0
$clicking = 0
$drawingtext = 0
$created2 = 0
$clicking2 = 0
$grabber = "null"
$selected = 0
$grabbing = 0
$moving = 0
$selectedID = "null"
$editing = 0
$deleteing = 0
$cr = TimerInit()
$c1 = "null"
$c2 = "null"
$c3 = "null"
$c4 = "null"
$c5 = "null"
$c6 = "null"

If BitAND(IniRead(@ScriptDir & "\PresentationStudioData.data", "Main", "New", 1) = 1, @Compiled = 1) Then
    FileRegister("psp", '"' & @ScriptFullPath & '" "%1"', "Open in PresentationStudio", 1, @ScriptFullPath & ',0', "PresentationStudio Presentation")
    IniWrite(@ScriptDir & "\PresentationStudioData.data", "Main", "New", 0)
EndIf

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("PresentationStudio", 733, 444)
$Tab1 = GUICtrlCreateTab(20, 20, 594, 364)
GUICtrlCreateTabItem("")
$createtextitem = GUICtrlCreateButton("Create Text...", 8 + 617 + 8, 8, 90, 25)
$createpicitem = GUICtrlCreateButton("Create Picture...", 8 + 617 + 8, 16 + 25, 90, 25)
$Button1 = GUICtrlCreateButton("Add Slide", 8, 392, 113, 25, 0)
$Button2 = GUICtrlCreateButton("Present Show", 128, 392, 113, 25, 0)
$file = GUICtrlCreateMenu("File")
$open = GUICtrlCreateMenuItem("Open", $file)
$save = GUICtrlCreateMenuItem("Save", $file)
$item = GUICtrlCreateMenu("Item")
$deleteitem = GUICtrlCreateMenuItem("Delete", $item)
$edit = GUICtrlCreateButton("Edit", 8 + 617 + 8, 108, 90, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$slidearray[0] += 1
_ArrayAdd($slidearray, GUICtrlCreateTabItem("Slide " & $slidearray[0]))
_ArrayAdd($slidebks, "Color|0xFFFFFF")
$m = GUICtrlCreateContextMenu()
_ArrayAdd($bksetitems, GUICtrlCreateMenuItem("Set Background", $m))

If $CmdLine[0] <> 0 Then
    Open($CmdLine[1])
EndIf

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Tab1
            
        Case $GUI_EVENT_CLOSE
            Exit
        Case $deleteitem
            $deleteing = 1
            ToolTip("Click on the item you want to delete.")
        Case $open
            $opened = FileOpenDialog("Open Presentation", "", "PresentationStudio files (*.psp)")
            Open($opened)
        Case $c4
            If $editing = 1 Then
                $cColor = _ChooseColor()
                GUICtrlSetColor($selectedID, $cColor)
                $tfcolor[$snum] = $cColor
                GUICtrlSetColor($c6, $cColor)
            EndIf
        Case $c5
            If $editing = 1 Then
                $cColor = _ChooseColor()
                GUICtrlSetBkColor($selectedID, $cColor)
                $tbkcolor[$snum] = $cColor
                GUICtrlSetBkColor($c6, $cColor)
            EndIf
        Case $save
            If IsDeclared("opened") Then
                Save($opened)
            Else
                $opened  = FileSaveDialog("Save File as...", "", "PresentationStudio files (*.psp)") & ".psp"
                Save($opened)
            EndIf
        Case $edit
            If $editing = 1 Then
                If $selectedtype <> "Pic" Then
                    GUICtrlSetData($selectedID, GUICtrlRead($c6))
                    $tptexts[$snum] = GUICtrlRead($c6)
                EndIf
                $editing = 0
                GUICtrlSetData($edit, "Edit")
                GUICtrlDelete($c1)
                GUICtrlDelete($c2)
                GUICtrlDelete($c3)
                GUICtrlDelete($c4)
                GUICtrlDelete($c5)
                GUICtrlDelete($c6)
            Else
                If $selected = 1 Then
                    $editing = 1
                    If $selectedtype = "Pic" Then
                        $c1 = GUICtrlCreateButton("Change Image", 635, 140, 90, 25)
                        $c2 = GUICtrlCreateLabel($ppath[$snum], 8 + 617 + 4, 178, 300, 20)
                        GUICtrlSetTip(-1, $ppath[$snum])
                        GUICtrlSetData($edit, "OK")
                    Else
                        GUICtrlSetData($edit, "OK")
                        $c1 = GUICtrlCreateCombo($tfname[$snum], 635, 143, 90)
                        _GUICtrlComboBox_AddString($c1, "Times New Roman")
                        _GUICtrlComboBox_AddString($c1, "Arial Black")
                        _GUICtrlComboBox_AddString($c1, "Comic Sans MS")
                        _GUICtrlComboBox_AddString($c1, "Script")
                        $c2 = GUICtrlCreateCombo($tfsize[$snum], 635, 173, 90)
                        _GUICtrlComboBox_AddString($c2, "8")
                        _GUICtrlComboBox_AddString($c2, "9")
                        _GUICtrlComboBox_AddString($c2, "10")
                        _GUICtrlComboBox_AddString($c2, "11")
                        _GUICtrlComboBox_AddString($c2, "12")
                        _GUICtrlComboBox_AddString($c2, "14")
                        _GUICtrlComboBox_AddString($c2, "16")
                        _GUICtrlComboBox_AddString($c2, "18")
                        _GUICtrlComboBox_AddString($c2, "24")
                        _GUICtrlComboBox_AddString($c2, "32")
                        _GUICtrlComboBox_AddString($c2, "48")
                        _GUICtrlComboBox_AddString($c2, "60")
                        _GUICtrlComboBox_AddString($c2, "72")
                        $c3 = GUICtrlCreateCombo($tfweight[$snum], 635, 203, 90)
                        _GUICtrlComboBox_AddString($c3, "500")
                        _GUICtrlComboBox_AddString($c3, "600")
                        _GUICtrlComboBox_AddString($c3, "700")
                        _GUICtrlComboBox_AddString($c3, "800")
                        $c4 = GUICtrlCreateButton("Color", 635, 233, 90)
                        $c5 = GUICtrlCreateButton("BK Color", 635, 263, 90)
                        $c6 = GUICtrlCreateEdit(GUICtrlRead($selectedID), 635, 293, 90, 90)
                        GUICtrlSetFont(-1, $tfsize[$snum], $tfweight[$snum], $tfattribs[$snum], $tfname[$snum])
                        GUICtrlSetColor($c2, $tfcolor[$snum])
                    EndIf
                EndIf
            EndIf
        Case $c2
            If StringIsAlNum(GUICtrlRead($c2)) Then
                GUICtrlSetFont($selectedID, GUICtrlRead($c2))
                $tfsize[$snum] = GUICtrlRead($c2)
                GUICtrlSetFont($c6, GUICtrlRead($c2))
            Else
                GUICtrlSetData($c2, $tfsize[$snum])
            EndIf
        Case $c3
            If StringIsAlNum(GUICtrlRead($c3)) Then
                GUICtrlSetFont($selectedID, $tfsize[$snum], GUICtrlRead($c3))
                $tfweight[$snum] = GUICtrlRead($c3)
                GUICtrlSetFont($c6, $tfsize[$snum], GUICtrlRead($c3))
            Else
                GUICtrlSetData($c3, $tfweight[$snum])
            EndIf
        Case $c1
            If $editing = 1 Then
                If $selectedtype = "Pic" Then
                    $od = FileOpenDialog("Locate picture", "", "Images (*.bmp; *.JPG; *.jpeg)")
                    GUICtrlDelete($selectedID)
                    $selectedID = GUICtrlCreatePic($od, $pl[$snum], $pt[$snum], $pw[$snum], $ph[$snum])
                    $ppath[$snum] = $od
                    $pics[$snum] = $selectedID
                    GUICtrlSetData($c2, $od)
                    GUICtrlSetTip($c2, $od)
                Else
                    GUICtrlSetFont($selectedID, $tfsize[$snum], $tfweight[$snum], $tfattribs[$snum], GUICtrlRead($c1))
                    $tfname[$snum] = GUICtrlRead($c1)
                    GUICtrlSetFont($c6, $tfsize[$snum], $tfweight[$snum], $tfattribs[$snum], GUICtrlRead($c1))
                EndIf
            EndIf
        Case $Button1
            $slidearray[0] += 1
            GUISwitch($Form1)
            _ArrayAdd($slidearray, GUICtrlCreateTabItem("Slide " & $slidearray[0]))
            _ArrayAdd($slidebks, "Color|0xFFFFFF")
            $m = GUICtrlCreateContextMenu()
            _ArrayAdd($bksetitems, GUICtrlCreateMenuItem("Set Background", $m))
        Case $createpicitem
            $picpath = FileOpenDialog("Load Picture", "", "JPG images (*.jpg); bmp images (*.bmp)")
            $drawingpic = 1
            $created = 0
            $clicking = 0
        Case $Button2
            MsgBox(0, "ShowShow", "")
            ShowShow()
        Case $createtextitem
            $text = SelectText()
            If IsArray($text) Then
                $ptext = $text[8]
                $font = $text[2]
                $color = $text[7]
                $size = $text[3]
                $weight = $text[4]
                $attribs = $text[1]
                $bkcolor = $text[9]
                $drawingtext = 1
                $created2 = 0
                $clicking2 = 0
            EndIf
    EndSwitch
    ;For $i = 1 To $slidearray[0]
    ;   If $nMsg = $bksetitems[$i] Then
    ;       SetSlideBK()
    ;   EndIf
    ;Next
    $cursorinfo = GUIGetCursorInfo()
    If BitAND($drawingpic = 1, _IsPressed("01")) Then
        If $clicking = 0 Then
            $cinfo1 = GUIGetCursorInfo()
            $clicking = 1
            GUISwitch($Form1, $slidearray[GUICtrlRead($Tab1)])
            $lv = GUICtrlCreateLabel("", 0, 0, 20, 20)
            GUICtrlSetBkColor(-1, 0x000000)
        EndIf
    ElseIf BitAND($drawingpic = 1, _IsPressed("01") = 0, $clicking = 1) Then
        $clicking = 0
        $created = 1
        $drawingpic = 0
        $cinfo2 = GUIGetCursorInfo()
        GUISwitch($Form1, $slidearray[GUICtrlRead($Tab1) + 1])
        $tabstuff = $slidearray[GUICtrlRead($Tab1) + 1]
        GUICtrlDelete($lv)
        CreatePic($picpath, $cinfo1[0], $cinfo1[1], $cinfo2[0] - $cinfo1[0], $cinfo2[1] - $cinfo1[1])
        GUISwitch($Form1)
    EndIf
    If BitAND($drawingtext = 1, _IsPressed("01")) Then
        If $clicking2 = 0 Then
            $cinfo1 = GUIGetCursorInfo()
            $clicking2 = 1
            $lv = GUICtrlCreateLabel("", 0, 0, 20, 20)
            GUICtrlSetBkColor(-1, 0x999999)
        EndIf
    ElseIf BitAND($drawingtext = 1, _IsPressed("01") = 0, $clicking2 = 1) Then
        $clicking2 = 0
        $created2 = 1
        $drawingtext = 0
        $cinfo2 = GUIGetCursorInfo()
        GUISwitch($Form1, $slidearray[GUICtrlRead($Tab1) + 1])
        $tabstuff = $slidearray[GUICtrlRead($Tab1) + 1]
        GUICtrlDelete($lv)
        CreateText($cinfo1[0], $cinfo1[1], $cinfo2[0] - $cinfo1[0], $cinfo2[1] - $cinfo1[1])
        GUISwitch($Form1)
    EndIf
    If BitAND($clicking = 0, BitOR(_ArraySearch($pics, $cursorinfo[4]) > 0, _ArraySearch($texts, $cursorinfo[4]) > 0), _IsPressed("01"), $grabbing = 0, $selected = 0, $moving = 0) Then
        If _ArraySearch($pics, $cursorinfo[4]) <> -1 Then
            $selectedtype = "Pic"
            $snum = _ArraySearch($pics, $cursorinfo[4])
        Else
            $selectedtype = "Text"
            $snum = _ArraySearch($texts, $cursorinfo[4])
        EndIf
        $selected = 1
        $selectedID = $cursorinfo[4]
        If $selectedtype = "Pic" Then
            $grabber = GUICtrlCreateButton("", ($pl[_ArraySearch($pics, $selectedID)] + $pw[_ArraySearch($pics, $selectedID)]) - 5, ($pt[_ArraySearch($pics, $selectedID)] + $ph[_ArraySearch($pics, $selectedID)]) - 5, 10, 10)
        Else
            $grabber = GUICtrlCreateButton("", ($tl[_ArraySearch($texts, $selectedID)] + $tw[_ArraySearch($texts, $selectedID)]) - 5, ($tt[_ArraySearch($texts, $selectedID)] + $th[_ArraySearch($texts, $selectedID)]) - 5, 10, 10)
        EndIf
        $cr = TimerInit()
    EndIf
    If BitAND($cursorinfo[4] = $grabber, _IsPressed("01"), $selected = 1, $moving = 0) then
        $grabbing = 1
        $graborigcinfo = GUIGetCursorInfo()
    EndIf
    If $grabbing = 1 Then
        $gcinfonow = GUIGetCursorInfo()
        If $selectedtype = "Pic" Then
            GUICtrlSetPos($pics[$snum], $pl[$snum], $pt[$snum], $pw[$snum] + ($gcinfonow[0] - $graborigcinfo[0]), $ph[$snum] + ($gcinfonow[1] - $graborigcinfo[1]))
            GUICtrlSetPos($grabber, ($pl[$snum] + $pw[$snum] + ($gcinfonow[0] - $graborigcinfo[0])) - 5, ($pt[$snum] + $ph[$snum] + ($gcinfonow[1] - $graborigcinfo[1])) - 5, 10, 10)
        Else
            GUICtrlSetPos($texts[$snum], $tl[$snum], $tt[$snum], $tw[$snum] + ($gcinfonow[0] - $graborigcinfo[0]), $th[$snum] + ($gcinfonow[1] - $graborigcinfo[1]))
            GUICtrlSetPos($grabber, ($tl[$snum] + $tw[$snum] + ($gcinfonow[0] - $graborigcinfo[0])) - 5, ($tt[$snum] + $th[$snum] + ($gcinfonow[1] - $graborigcinfo[1])) - 5, 10, 10)
        EndIf
    EndIf
    If BitAND(_IsPressed("01"), $deleteing = 1) Then
        If BitOR(_ArraySearch($pics, $cursorinfo[4]) <> -1, _ArraySearch($texts, $cursorinfo[4]) <> -1) Then
            If _ArraySearch($pics, $cursorinfo[4]) <> -1 Then
                DeletePic($cursorinfo[4])
            Else
                DeleteText($cursorinfo[4])
            EndIf
        EndIf
        $deleteing = 0
    EndIf
    If BitAND($grabbing = 1, _IsPressed("01") = 0) Then
        $gcinfonow = GUIGetCursorInfo()
        $grabbing = 0
        If $selectedtype = "Pic" Then
            $pw[$snum] += $gcinfonow[0] - $graborigcinfo[0]
            $ph[$snum] += $gcinfonow[1] - $graborigcinfo[1]
        Else
            $tw[$snum] += $gcinfonow[0] - $graborigcinfo[0]
            $th[$snum] += $gcinfonow[1] - $graborigcinfo[1]
        EndIf
    EndIf
    If BitAND(_IsPressed("01"), $selected = 1, $selectedID = $cursorinfo[4], $grabbing = 0, $moving = 0, TimerDiff($cr) > 100) Then
        $moving = 1
        $mvcinfoprv = GUIGetCursorInfo()
        If $selectedtype = "Pic" Then
            $diffl = $mvcinfoprv[0] - $pl[$snum]
            $diff = $mvcinfoprv[1] - $pt[$snum]
        Else
            $diffl = $mvcinfoprv[0] - $tl[$snum]
            $diff = $mvcinfoprv[1] - $tt[$snum]
        EndIf
    EndIf
    If $moving = 1 Then
        $cinfonow = GUIGetCursorInfo()
        If $selectedtype = "Pic" Then
            GUICtrlSetPos($selectedID, $cinfonow[0] - $diffl, $cinfonow[1] - $diff, $pw[$snum], $ph[$snum])
            $pl[$snum] = $cinfonow[0] - $diffl
            $pt[$snum] = $cinfonow[1] - $diff
            GUICtrlSetPos($grabber, ($pl[$snum] + $pw[$snum]) - 5, ($pt[$snum] + $ph[$snum]) - 5, 10, 10)
        Else
            GUICtrlSetPos($selectedID, $cinfonow[0] - $diffl, $cinfonow[1] - $diff, $tw[$snum], $th[$snum])
            $tl[$snum] = $cinfonow[0] - $diffl
            $tt[$snum] = $cinfonow[1] - $diff
            GUICtrlSetPos($grabber, ($tl[$snum] + $tw[$snum]) - 5, ($tt[$snum] + $th[$snum]) - 5, 10, 10)
        EndIf
    EndIf
    If BitAND($moving = 1, _IsPressed("01") = 0) Then
        $moving = 0
    EndIf
    If BitAND(_IsPressed("01") = 1, $cursorinfo[4] <> $selectedID, $cursorinfo[4] <> $grabber, $editing = 0, $cursorinfo[4] <> $edit) Then
        GUICtrlDelete($grabber)
        $selected = 0
    EndIf
    If BitOR($clicking = 1, $clicking2 = 1) Then
        $cinfoLV = GUIGetCursorInfo()
        GUICtrlSetPos($lv, $cinfo1[0], $cinfo1[1], $cinfoLV[0] - $cinfo1[0], $cinfoLV[1] - $cinfo1[1])
    EndIf
WEnd

Func CreatePic($imagepath, $left, $top, $width, $height)
    _ArrayAdd($pl, $left)
    _ArrayAdd($pt, $top)
    _ArrayAdd($pw, $width)
    _ArrayAdd($ph, $height)
    _ArrayAdd($ptab, $tabstuff)
    _ArrayAdd($ppath, $imagepath)
    GUISwitch($Form1, $tabstuff)
    $return = GUICtrlCreatePic($imagepath, $left, $top, $width, $height)
    GUICtrlCreateTabItem("")
    _ArrayAdd($pics, $return)
    $pics[0] += 1
    Return $return
EndFunc

Func DeletePic($id)
    $num = _ArraySearch($pics, $id)
    _ArrayDelete($pl, $num)
    _ArrayDelete($pt, $num)
    _ArrayDelete($pw, $num)
    _ArrayDelete($ph, $num)
    _ArrayDelete($ptab, $num)
    _ArrayDelete($ppath, $num)
    GUICtrlDelete($id)
    GUICtrlCreateTabItem("")
    _ArrayDelete($pics, $num)
    $pics[0] -= 1
EndFunc

Func CreateText($left, $top, $width, $height)
    _ArrayAdd($ttab, $tabstuff)
    _ArrayAdd($tl, $left)
    _ArrayAdd($tt, $top)
    _ArrayAdd($tw, $width)
    _ArrayAdd($th, $height)
    _ArrayAdd($tfattribs, $attribs)
    _ArrayAdd($tfcolor, $color)
    _ArrayAdd($tfname, $font)
    _ArrayAdd($tfweight, $weight)
    _ArrayAdd($tfsize, $size)
    _ArrayAdd($tptexts, $ptext)
    _ArrayAdd($ttab, $tabstuff)
    GUISwitch($Form1, $tabstuff)
    $return = GUICtrlCreateLabel($ptext, $left, $top, $width, $height)
    GUICtrlCreateTabItem("")
    GUICtrlSetFont($return, $size, $weight, $attribs, $font)
    GUICtrlSetColor($return, $color)
    GUICtrlSetBkColor($return, $bkcolor)
    _ArrayAdd($tbkcolor, $bkcolor)
    _ArrayAdd($texts, $return)
    $texts[0] += 1
    Return $return
EndFunc

Func DeleteText($id)
    $num = _ArraySearch($texts, $id)
    _ArrayDelete($ttab, $num)
    _ArrayDelete($tl, $num)
    _ArrayDelete($tt, $num)
    _ArrayDelete($tw, $num)
    _ArrayDelete($th, $num)
    _ArrayDelete($tfattribs, $num)
    _ArrayDelete($tfcolor, $num)
    _ArrayDelete($tfname, $num)
    _ArrayDelete($tfweight, $num)
    _ArrayDelete($tfsize, $num)
    GUICtrlDelete($id)
    _ArrayDelete($tbkcolor, $num)
    _ArrayDelete($texts, $num)
    $texts[0] -= 1
EndFunc

Func SelectText()
    #Region ### START Koda GUI section ### Form=g:\applications\koda formdesigner\forms\createtextbox.kxf
    $Form1_1 = GUICreate("Create Text", 636, 312, 193, 115)
    $Edit1 = GUICtrlCreateEdit("", 8, 8, 617, 265)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $aFontArray = _ArrayCreate(0, 0, "Arial", 12, 400, 0, 0, 0x000000, "", 0xFFFFFF)
    $Button1 = GUICtrlCreateButton("Font...", 8, 280, 101, 25, 0)
    $btnColor = GUICtrlCreateButton("Color...", 16 + 101, 280, 90, 25, 0)
    $fwidth = GUICtrlCreateInput("Size", 16 + 201, 280, 32, 25)
    $Button2 = GUICtrlCreateButton("OK", 256, 280, 201, 25, 0)
    $Button3 = GUICtrlCreateButton("Cancel", 464, 280, 161, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                GUISwitch($Form1)
                GUIDelete($Form1_1)
                Return 0
            Case $Button1
                $aFontArray = _ChooseFont()
                GUICtrlSetFont($Edit1, $aFontArray[3], $aFontArray[4], $aFontArray[1], $aFontArray[2])
                GUICtrlSetColor($Edit1, $aFontArray[7])
            Case $Button3
                GUISwitch($Form1)
                GUIDelete($Form1_1)
                Return 0
            Case $Button2
                $aFontArray[8] = GUICtrlRead($Edit1)
                ExitLoop
            Case $fwidth
                If StringIsAlNum(GUICtrlRead($fwidth)) Then
                    $aFontArray[3] = GUICtrlRead($fwidth)
                Else
                    MsgBox(0, "Error", "The font size must be a number.")
                EndIf
                GUICtrlSetFont($Edit1, $aFontArray[3], $aFontArray[4], $aFontArray[1], $aFontArray[2])
            Case $btnColor
                $aFontArray[9] = _ChooseColor()
                GUICtrlSetBkColor($Edit1, $aFontArray[9])
        EndSwitch
    WEnd
    GUIDelete($Form1_1)
    Return $aFontArray
EndFunc

Func ShowShow ()
    $showgui = GUICreate("Slide Show", @DesktopWidth, @DesktopHeight)
    GUISwitch($showgui)
    $showcontextmenu = GUICtrlCreateContextMenu()
    $exit = GUICtrlCreateMenuItem("Exit Show", $showcontextmenu)
    $controlsincurrent = _ArrayCreate(0)
    $nombre = _ArrayCreate(0)
    $type = _ArrayCreate(0)
    $id = _ArrayCreate(0)
    GUISetState(@SW_SHOW)
    $slidenum = 1
    $pressed = 0
    
    For $i = 1 To $pics[0]
        If _ArraySearch($slidearray, $ptab[$i]) = 1 Then
            _ArrayAdd($controlsincurrent, $pics[$i])
            _ArrayAdd($type, "p")
            _ArrayAdd($nombre, $i)
            $controlsincurrent[0] += 1
            _ArrayAdd($id, GUICtrlCreatePic($ppath[$i], _CP(594, $pl[$i], @DesktopWidth), _CP(364, $pt[$i], @DesktopHeight), _CP(594, $pw[$i], @DesktopWidth), _CP(364, $ph[$i], @DesktopHeight)))
        EndIf
    Next
    
    For $i = 1 To $texts[0]
        If _ArraySearch($slidearray, $ttab[$i]) = 1 Then
            _ArrayAdd($controlsincurrent, $texts[$i])
            _ArrayAdd($type, "p")
            _ArrayAdd($nombre, $i)
            $controlsincurrent[0] += 1
            $x = GUICtrlCreateLabel(GUICtrlRead($texts[$i]), _CP(594, $tl[$i], @DesktopWidth), _CP(364, $tt[$i], @DesktopHeight), _CP(594, $tw[$i], @DesktopWidth), _CP(364, $th[$i], @DesktopHeight))
            _ArrayAdd($id, $x)
            GUICtrlSetBkColor($x, $tbkcolor[$i])
            GUICtrlSetColor($x, $tfcolor[$i])
            GUICtrlSetFont($x, $tfsize[$i], $tfweight[$i], $tfattribs[$i], $tfname[$i])
        EndIf
    Next
    
    $split = StringSplit($slidebks[$slidenum], "|")
    If $split[1] = "Color" Then
        GUISwitch($showgui)
        GUISetBkColor($split[2], $showgui)
        $bktype = "Color"
    Else
        GUISwitch($showgui)
        $bkimage = GUICtrlCreatePic($split[2], 0, 0, @DesktopWidth, @DesktopHeight)
        $bktype = "Image"
    EndIf
    
    While 1
        If GUIGetMsg() = $GUI_EVENT_CLOSE then
            GUIDelete($showgui)
            Return
        ElseIf BitAND(_IsPressed("01"), $pressed = 0) Then
            If $slidenum + 1 <= $slidearray[0] Then
                $slidenum += 1
                If $bktype = "Image" Then
                    GUICtrlDelete($bkimage)
                EndIf
                $split = StringSplit($slidebks[$slidenum], "|")
                If $split[1] = "Color" Then
                    GUISwitch($showgui)
                    GUISetBkColor($split[2], $showgui)
                Else
                    GUISwitch($showgui)
                    $bkimage = GUICtrlCreatePic($split[2], 0, 0, @DesktopWidth, @DesktopHeight)
                    $bktype = "Image"
                EndIf
                For $i = 1 To $controlsincurrent[0]
                    GUICtrlDelete($id[$i])
                Next
                For $i = 1 To $pics[0]
                    If _ArraySearch($slidearray, $ptab[$i]) = $slidenum Then
                        _ArrayAdd($controlsincurrent, $pics[$i])
                        _ArrayAdd($type, "p")
                        _ArrayAdd($nombre, $i)
                        $controlsincurrent[0] += 1
                        GUISwitch($showgui)
                        $pictocreate = GUICtrlCreatePic($ppath[$i], _CP(594, $pl[$i], @DesktopWidth), _CP(364, $pt[$i], @DesktopHeight), _CP(594, $pw[$i], @DesktopWidth), _CP(364, $ph[$i], @DesktopHeight))
                        _ArrayAdd($id, $pictocreate)
                    EndIf
                Next
                
                For $i = 1 To $texts[0]
                    If _ArraySearch($slidearray, $ttab[$i]) = $slidenum Then
                        _ArrayAdd($controlsincurrent, $texts[$i])
                        _ArrayAdd($type, "p")
                        _ArrayAdd($nombre, $i)
                        $controlsincurrent[0] += 1
                        GUISwitch($showgui)
                        $x = GUICtrlCreateLabel(GUICtrlRead($texts[$i]), _CP(594, $tl[$i], @DesktopWidth), _CP(364, $tt[$i], @DesktopHeight), _CP(594, $tw[$i], @DesktopWidth), _CP(364, $th[$i], @DesktopHeight))
                        _ArrayAdd($id, $x)
                        GUICtrlSetBkColor($x, $tbkcolor[$i])
                        GUICtrlSetColor($x, $tfcolor[$i])
                        GUICtrlSetFont($x, _CP(594, $tfsize[$i], @DesktopWidth), $tfweight[$i], $tfattribs[$i], $tfname[$i])
                    EndIf
                Next
                $pressed = 1
            Else
                GUIDelete($showgui)
                GUISwitch($Form1)
                Return
            EndIf
        ElseIf _IsPressed("01") = 0 Then
            $pressed = 0
        EndIf
        If BitAND(_IsPressed("08"), $selected = 1) Then
            If $selectedtype = "Pic" Then
                DeletePic($selectedID)
            Else
                DeleteText($selectedID)
            EndIf
        EndIf
    WEnd
EndFunc

Func _CP($a1, $a2, $b1)
    Return round(($a2 * $b1) / $a1)
EndFunc

Func Save ($filepath) ; 24
    ProgressOn("Saving...", "Now saving...") 
    For $i = 0 To $pics[0]
        IniWrite($filepath, "pics", $i, $pics[$i])
    Next
    ProgressSet(Round((2 / 24) * 100))
    For $i = 0 To $pics[0]
        IniWrite($filepath, "pt", $i, $pt[$i])
    Next
    ProgressSet(Round((3 / 24) * 100))
    For $i = 0 To $pics[0]
        IniWrite($filepath, "pl", $i, $pl[$i])
    Next
    ProgressSet(Round((4 / 24) * 100))
    For $i = 0 To $pics[0]
        IniWrite($filepath, "pw", $i, $pw[$i])
    Next
    ProgressSet(Round((5 / 24) * 100))
    For $i = 0 To $Pics[0]
        IniWrite($filepath, "ph", $i, $ph[$i])
    Next
    ProgressSet(Round((6 / 24) * 100))
    For $i = 0 To $pics[0]
        IniWrite($filepath, "ppath", $i, $ppath[$i])
    Next
    ProgressSet(Round((7 / 24) * 100))
    For $i = 0 To $Pics[0]
        IniWrite($filepath, "ptab", $i, $ptab[$i])
    Next
    ProgressSet(Round((8 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "texts", $i, $texts[$i])
    Next
    ProgressSet(Round((9 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tl", $i, $tl[$i])
    Next
    ProgressSet(Round((10 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tt", $i, $tt[$i])
    Next
    ProgressSet(Round((11 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tw", $i, $tw[$i])
    Next
    ProgressSet(Round((12 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "th", $i, $th[$i])
    Next
    ProgressSet(Round((13 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "ttab", $i, $ttab[$i])
    Next
    ProgressSet(Round((14 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tbkcolor", $i, $tbkcolor[$i])
    Next
    ProgressSet(Round((15 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tfname", $i, $tfname[$i])
    Next
    ProgressSet(Round((16 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tfsize", $i, $tfsize[$i])
    Next
    ProgressSet(Round((17 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tfattribs", $i, $tfattribs[$i])
    Next
    ProgressSet(Round((18 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tfweight", $i, $tfweight[$i])
    Next
    ProgressSet(Round((19 / 24) * 100))
    For $i = 0 To $slidearray[0]
        IniWrite($filepath, "slidearray", $i, $slidearray[$i])
    Next
    ProgressSet(Round((20 / 24) * 100))
    For $i = 0 To $slidearray[0]
        IniWrite($filepath, "slidebks", $i, $slidebks[$i])
    Next
    ProgressSet(Round((21 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tptexts", $i, $tptexts[$i])
    Next
    ProgressSet(Round((22 / 24) * 100))
    For $i = 1 To $pics[0]
        IniWrite($filepath, "ptabnumber", $i, _ArraySearch($slidearray, $ptab[$i]))
    Next
    ProgressSet(Round((23 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "ttabnumber", $i, _ArraySearch($slidearray, $ttab[$i]))
    Next
    ProgressSet(Round((24 / 24) * 100))
    Sleep(500)
    ProgressOff()
    MsgBox(0, "Save", "File saved.")
EndFunc

Func Open ($filepath)
    $pics = _ArrayCreate(0)
    $pl = _ArrayCreate("")
    $pt = _ArrayCreate("")
    $pw = _ArrayCreate("")
    $ph = _ArrayCreate("")
    $ptab = _ArrayCreate("")
    $ppath = _ArrayCreate("")
    $tbkcolor = _ArrayCreate("")
    $texts = _ArrayCreate(0)
    $tfattribs = _ArrayCreate("")
    $tfcolor = _ArrayCreate("")
    $tfname = _ArrayCreate("")
    $tfsize = _ArrayCreate("")
    $tfweight = _ArrayCreate("")
    $th = _ArrayCreate("")
    $tw = _ArrayCreate("")
    $tl = _ArrayCreate("")
    $tt = _ArrayCreate("")
    $ttab = _ArrayCreate("")
    $tptexts = _ArrayCreate("")
    GUICtrlDelete($slidearray[1])
    $slidearray = _ArrayCreate(0)
    For $i = 1 To IniRead($filepath, "slidearray", 0, 0)
        _ArrayAdd($slidearray, "null")
        _ArrayAdd($slidebks, "null")
        $slidearray[0] += 1
    Next
    For $i = 1 To IniRead($filepath, "slidearray", 0, 0)
        $slidearray[$i] = GUICtrlCreateTabItem("Slide " & $i)
        $slidebks[$i] = "Color|0xFFFFFF"
    Next
    for $i = 1 To IniRead($filepath, "pics", 0, 0)
        Global $tabstuff = $slidearray[IniRead($filepath, "ptabnumber", $i, 0)]
        CreatePic(IniRead($filepath, "ppath", $i, 0), IniRead($filepath, "pl", $i, 0), IniRead($filepath, "pt", $i, 0), IniRead($filepath, "pw", $i, 0), IniRead($filepath, "ph", $i, 0))
    Next
    For $i = 1 To IniRead($filepath, "texts", 0, 0)
        Global $attribs = IniRead($filepath, "tfattribs", $i, "")
        Global $ptext = IniRead($filepath, "tptexts", $i, "")
        Global $bkcolor = IniRead($filepath, "tbkcolor", $i, "")
        Global $color = IniRead($filepath, "tcolor", $i, "")
        Global $font = IniRead($filepath, "tfname", $i, "")
        Global $size = IniRead($filepath, "tfsize", $i, "")
        Global $weight = IniRead($filepath, "tfweight", $i, "")
        Global $tabstuff = $slidearray[IniRead($filepath, "ttabnumber", $i, 0)]
        CreateText(IniRead($filepath, "tl", $i, ""), IniRead($filepath, "tt", $i, 0), IniRead($filepath, "tw", $i, 0), IniRead($filepath, "th", "", 0))
    Next
    for $i = 0 To IniRead($filepath, "slidearray", 0, 0)
        If $i <> 0 Then _ArrayAdd($slidearray, "null")
        $slidearray[$i] = IniRead($filepath, "slidearray", $i, "")
    Next
    for $i = 0 To IniRead($filepath, "slidebks", 0, 0)
        If $i <> 0 Then _ArrayAdd($slidebks, "null")
        $slidebks[$i] = IniRead($filepath, "slidebks", $i, "")
    Next
EndFunc

Func SetSlideBK ()
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Slide BK", 134, 134, 193, 115)
    $split = StringSplit($slidebks[GUICtrlRead($Tab1)], "|")
    MsgBox(0, GUICtrlRead($Tab1), "")
    If $split[1] = "Color" Then
        $m = 1
    Else
        $m = 2
    EndIf
    $Radio1 = GUICtrlCreateRadio("Color", 8, 8, 113, 17)
    If $m = 1 Then
        GUICtrlSetState($Radio1, $GUI_CHECKED)
    EndIf
    $Radio2 = GUICtrlCreateRadio("Image", 8, 32, 113, 25)
    If $m = 2 Then
        GUICtrlSetState($Radio2, $GUI_CHECKED)
    EndIf
    $Button1 = GUICtrlCreateButton("Select", 8, 72, 121, 25, 0)
    $Button2 = GUICtrlCreateButton("OK", 8, 104, 33, 25, 0)
    $Button3 = GUICtrlCreateButton("Cancel", 48, 104, 81, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    
    $return = $split[1] & "|" & $split[2]
    
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
        Case $Button1
            If GUICtrlRead($Radio1) = $GUI_CHECKED Then
                $split[1] = "Color"
                $split[2] = _ChooseColor()
                $return = $split[1] & "|" & $split[2]
            Else
                $split[1] = "Image"
                $split[2] = FileOpenDialog("Select Image", "", "Images (*.jpg; *.jpeg; *.bmp)")
                $return = $split[1] & "|" & $split[2]
            EndIf
        Case $Button3
            GUIDelete($Form1)
            GUISwitch($Form1_1)
            ExitLoop
        Case $Button2
            $slidebks[GUICtrlRead($Tab1)] = $return
            GUIDelete($Form1)
            GUISwitch($Form1_1)
            ExitLoop
        EndSwitch
    WEnd
EndFunc

Share this post


Link to post
Share on other sites



Who are you, PowerPoint? ^_^

Nice.... :)


I can do signature me.

Share this post


Link to post
Share on other sites

After finding FileRegister.au3 in another topic where you used it without posting it I still get these errors:

C:\Documents and Settings\Michael McFarland\Desktop\New AutoIt v3 Script (2).au3(107,31) : WARNING: $snum: possibly used before declaration.

$tfcolor[$snum]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Michael McFarland\Desktop\New AutoIt v3 Script (2).au3(126,34) : WARNING: $selectedtype: possibly used before declaration.

If $selectedtype <>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Michael McFarland\Desktop\New AutoIt v3 Script (2).au3(811,31) : WARNING: $Form1_1: possibly used before declaration.

GUISwitch($Form1_1)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Michael McFarland\Desktop\New AutoIt v3 Script (2).au3(811,31) : ERROR: $Form1_1: undeclared global variable.

GUISwitch($Form1_1)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Michael McFarland\Desktop\New AutoIt v3 Script (2).au3 - 1 error(s), 3 warning(s)


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

Make sure you declare versions and make sure it's universal compatable.

~Smith

Share this post


Link to post
Share on other sites

Sorry about that FileRegister thing...it's not an important file, so just delete the Include line. Also, you can drag and resize and edit items. I can't edit the post (when I click on Full/Quick Edit, the test shows as blank). The errors don't mean anything, it still works fine.

Share this post


Link to post
Share on other sites

The errors don't mean anything, it still works fine.

Well, the errors do mean something on my computer. This program won't even start. I took out the #include line but the errors are the same as I listed above.

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

I got over 16 errors, all that would keep it from starting. Why does it regsister file associations?

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Ohhh. I know now why yours doesn't work! You have an older version of Autoit, because the new GUIComboBox.au3 has different function names.

Edited by BananaFredSoft

Share this post


Link to post
Share on other sites

No, I have the newest.

Share this post


Link to post
Share on other sites

Ohhh. I know now why yours doesn't work! You have an older version of Autoit, because the new GUIComboBox.au3 has different function names.

I have the newest, 3.2.10.0, as well... As a matter of interest, what version do you have?

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

3.2.10.0...hmmm...works on my system.

And you're sure you've posted when you're running??? I try this and it doesn't work:

#include <GUIConstants.au3>
#include <Array.au3>
#include <Misc.au3>
#include <String.au3>
;~ #include <FileRegister.au3>
#include <GUIComboBox.au3>

$slidearray = _ArrayCreate(0)
;pics
$pics = _ArrayCreate(0)
$pl = _ArrayCreate(0)
$pt = _ArrayCreate(0)
$pw = _ArrayCreate(0)
$ph = _ArrayCreate(0)
$ptab = _ArrayCreate(0)
$ppath = _ArrayCreate(0)
;text
$texts = _ArrayCreate(0)
$tl = _ArrayCreate(0)
$tt = _ArrayCreate(0)
$tw = _ArrayCreate(0)
$th = _ArrayCreate(0)
$tfname = _ArrayCreate(0)
$tfsize = _ArrayCreate(0)
$tfweight = _ArrayCreate(0)
$tfcolor = _ArrayCreate(0)
$tfattribs = _ArrayCreate(0)
$ttab = _ArrayCreate(0)
$tbkcolor = _ArrayCreate(0)
$tptexts = _ArrayCreate(0)
$bksetitems = _ArrayCreate(0)
;end text
$cinfonow = _ArrayCreate(0, 0)

$slidebks = _ArrayCreate(0)

$drawingpic = 0
$created = 0
$clicking = 0
$drawingtext = 0
$created2 = 0
$clicking2 = 0
$grabber = "null"
$selected = 0
$grabbing = 0
$moving = 0
$selectedID = "null"
$editing = 0
$deleteing = 0
$cr = TimerInit()
$c1 = "null"
$c2 = "null"
$c3 = "null"
$c4 = "null"
$c5 = "null"
$c6 = "null"

If BitAND(IniRead(@ScriptDir & "\PresentationStudioData.data", "Main", "New", 1) = 1, @Compiled = 1) Then
    FileRegister("psp", '"' & @ScriptFullPath & '" "%1"', "Open in PresentationStudio", 1, @ScriptFullPath & ',0', "PresentationStudio Presentation")
    IniWrite(@ScriptDir & "\PresentationStudioData.data", "Main", "New", 0)
EndIf

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("PresentationStudio", 733, 444)
$Tab1 = GUICtrlCreateTab(20, 20, 594, 364)
GUICtrlCreateTabItem("")
$createtextitem = GUICtrlCreateButton("Create Text...", 8 + 617 + 8, 8, 90, 25)
$createpicitem = GUICtrlCreateButton("Create Picture...", 8 + 617 + 8, 16 + 25, 90, 25)
$Button1 = GUICtrlCreateButton("Add Slide", 8, 392, 113, 25, 0)
$Button2 = GUICtrlCreateButton("Present Show", 128, 392, 113, 25, 0)
$file = GUICtrlCreateMenu("File")
$open = GUICtrlCreateMenuItem("Open", $file)
$save = GUICtrlCreateMenuItem("Save", $file)
$item = GUICtrlCreateMenu("Item")
$deleteitem = GUICtrlCreateMenuItem("Delete", $item)
$edit = GUICtrlCreateButton("Edit", 8 + 617 + 8, 108, 90, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$slidearray[0] += 1
_ArrayAdd($slidearray, GUICtrlCreateTabItem("Slide " & $slidearray[0]))
_ArrayAdd($slidebks, "Color|0xFFFFFF")
$m = GUICtrlCreateContextMenu()
_ArrayAdd($bksetitems, GUICtrlCreateMenuItem("Set Background", $m))

If $CmdLine[0] <> 0 Then
    Open($CmdLine[1])
EndIf

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Tab1
           
        Case $GUI_EVENT_CLOSE
            Exit
        Case $deleteitem
            $deleteing = 1
            ToolTip("Click on the item you want to delete.")
        Case $open
            $opened = FileOpenDialog("Open Presentation", "", "PresentationStudio files (*.psp)")
            Open($opened)
        Case $c4
            If $editing = 1 Then
                $cColor = _ChooseColor()
                GUICtrlSetColor($selectedID, $cColor)
                $tfcolor[$snum] = $cColor
                GUICtrlSetColor($c6, $cColor)
            EndIf
        Case $c5
            If $editing = 1 Then
                $cColor = _ChooseColor()
                GUICtrlSetBkColor($selectedID, $cColor)
                $tbkcolor[$snum] = $cColor
                GUICtrlSetBkColor($c6, $cColor)
            EndIf
        Case $save
            If IsDeclared("opened") Then
                Save($opened)
            Else
                $opened  = FileSaveDialog("Save File as...", "", "PresentationStudio files (*.psp)") & ".psp"
                Save($opened)
            EndIf
        Case $edit
            If $editing = 1 Then
                If $selectedtype <> "Pic" Then
                    GUICtrlSetData($selectedID, GUICtrlRead($c6))
                    $tptexts[$snum] = GUICtrlRead($c6)
                EndIf
                $editing = 0
                GUICtrlSetData($edit, "Edit")
                GUICtrlDelete($c1)
                GUICtrlDelete($c2)
                GUICtrlDelete($c3)
                GUICtrlDelete($c4)
                GUICtrlDelete($c5)
                GUICtrlDelete($c6)
            Else
                If $selected = 1 Then
                    $editing = 1
                    If $selectedtype = "Pic" Then
                        $c1 = GUICtrlCreateButton("Change Image", 635, 140, 90, 25)
                        $c2 = GUICtrlCreateLabel($ppath[$snum], 8 + 617 + 4, 178, 300, 20)
                        GUICtrlSetTip(-1, $ppath[$snum])
                        GUICtrlSetData($edit, "OK")
                    Else
                        GUICtrlSetData($edit, "OK")
                        $c1 = GUICtrlCreateCombo($tfname[$snum], 635, 143, 90)
                        _GUICtrlComboBox_AddString($c1, "Times New Roman")
                        _GUICtrlComboBox_AddString($c1, "Arial Black")
                        _GUICtrlComboBox_AddString($c1, "Comic Sans MS")
                        _GUICtrlComboBox_AddString($c1, "Script")
                        $c2 = GUICtrlCreateCombo($tfsize[$snum], 635, 173, 90)
                        _GUICtrlComboBox_AddString($c2, "8")
                        _GUICtrlComboBox_AddString($c2, "9")
                        _GUICtrlComboBox_AddString($c2, "10")
                        _GUICtrlComboBox_AddString($c2, "11")
                        _GUICtrlComboBox_AddString($c2, "12")
                        _GUICtrlComboBox_AddString($c2, "14")
                        _GUICtrlComboBox_AddString($c2, "16")
                        _GUICtrlComboBox_AddString($c2, "18")
                        _GUICtrlComboBox_AddString($c2, "24")
                        _GUICtrlComboBox_AddString($c2, "32")
                        _GUICtrlComboBox_AddString($c2, "48")
                        _GUICtrlComboBox_AddString($c2, "60")
                        _GUICtrlComboBox_AddString($c2, "72")
                        $c3 = GUICtrlCreateCombo($tfweight[$snum], 635, 203, 90)
                        _GUICtrlComboBox_AddString($c3, "500")
                        _GUICtrlComboBox_AddString($c3, "600")
                        _GUICtrlComboBox_AddString($c3, "700")
                        _GUICtrlComboBox_AddString($c3, "800")
                        $c4 = GUICtrlCreateButton("Color", 635, 233, 90)
                        $c5 = GUICtrlCreateButton("BK Color", 635, 263, 90)
                        $c6 = GUICtrlCreateEdit(GUICtrlRead($selectedID), 635, 293, 90, 90)
                        GUICtrlSetFont(-1, $tfsize[$snum], $tfweight[$snum], $tfattribs[$snum], $tfname[$snum])
                        GUICtrlSetColor($c2, $tfcolor[$snum])
                    EndIf
                EndIf
            EndIf
        Case $c2
            If StringIsAlNum(GUICtrlRead($c2)) Then
                GUICtrlSetFont($selectedID, GUICtrlRead($c2))
                $tfsize[$snum] = GUICtrlRead($c2)
                GUICtrlSetFont($c6, GUICtrlRead($c2))
            Else
                GUICtrlSetData($c2, $tfsize[$snum])
            EndIf
        Case $c3
            If StringIsAlNum(GUICtrlRead($c3)) Then
                GUICtrlSetFont($selectedID, $tfsize[$snum], GUICtrlRead($c3))
                $tfweight[$snum] = GUICtrlRead($c3)
                GUICtrlSetFont($c6, $tfsize[$snum], GUICtrlRead($c3))
            Else
                GUICtrlSetData($c3, $tfweight[$snum])
            EndIf
        Case $c1
            If $editing = 1 Then
                If $selectedtype = "Pic" Then
                    $od = FileOpenDialog("Locate picture", "", "Images (*.bmp; *.JPG; *.jpeg)")
                    GUICtrlDelete($selectedID)
                    $selectedID = GUICtrlCreatePic($od, $pl[$snum], $pt[$snum], $pw[$snum], $ph[$snum])
                    $ppath[$snum] = $od
                    $pics[$snum] = $selectedID
                    GUICtrlSetData($c2, $od)
                    GUICtrlSetTip($c2, $od)
                Else
                    GUICtrlSetFont($selectedID, $tfsize[$snum], $tfweight[$snum], $tfattribs[$snum], GUICtrlRead($c1))
                    $tfname[$snum] = GUICtrlRead($c1)
                    GUICtrlSetFont($c6, $tfsize[$snum], $tfweight[$snum], $tfattribs[$snum], GUICtrlRead($c1))
                EndIf
            EndIf
        Case $Button1
            $slidearray[0] += 1
            GUISwitch($Form1)
            _ArrayAdd($slidearray, GUICtrlCreateTabItem("Slide " & $slidearray[0]))
            _ArrayAdd($slidebks, "Color|0xFFFFFF")
            $m = GUICtrlCreateContextMenu()
            _ArrayAdd($bksetitems, GUICtrlCreateMenuItem("Set Background", $m))
        Case $createpicitem
            $picpath = FileOpenDialog("Load Picture", "", "JPG images (*.jpg); bmp images (*.bmp)")
            $drawingpic = 1
            $created = 0
            $clicking = 0
        Case $Button2
            MsgBox(0, "ShowShow", "")
            ShowShow()
        Case $createtextitem
            $text = SelectText()
            If IsArray($text) Then
                $ptext = $text[8]
                $font = $text[2]
                $color = $text[7]
                $size = $text[3]
                $weight = $text[4]
                $attribs = $text[1]
                $bkcolor = $text[9]
                $drawingtext = 1
                $created2 = 0
                $clicking2 = 0
            EndIf
    EndSwitch
   ;For $i = 1 To $slidearray[0]
   ;   If $nMsg = $bksetitems[$i] Then
   ;      SetSlideBK()
   ;   EndIf
   ;Next
    $cursorinfo = GUIGetCursorInfo()
    If BitAND($drawingpic = 1, _IsPressed("01")) Then
        If $clicking = 0 Then
            $cinfo1 = GUIGetCursorInfo()
            $clicking = 1
            GUISwitch($Form1, $slidearray[GUICtrlRead($Tab1)])
            $lv = GUICtrlCreateLabel("", 0, 0, 20, 20)
            GUICtrlSetBkColor(-1, 0x000000)
        EndIf
    ElseIf BitAND($drawingpic = 1, _IsPressed("01") = 0, $clicking = 1) Then
        $clicking = 0
        $created = 1
        $drawingpic = 0
        $cinfo2 = GUIGetCursorInfo()
        GUISwitch($Form1, $slidearray[GUICtrlRead($Tab1) + 1])
        $tabstuff = $slidearray[GUICtrlRead($Tab1) + 1]
        GUICtrlDelete($lv)
        CreatePic($picpath, $cinfo1[0], $cinfo1[1], $cinfo2[0] - $cinfo1[0], $cinfo2[1] - $cinfo1[1])
        GUISwitch($Form1)
    EndIf
    If BitAND($drawingtext = 1, _IsPressed("01")) Then
        If $clicking2 = 0 Then
            $cinfo1 = GUIGetCursorInfo()
            $clicking2 = 1
            $lv = GUICtrlCreateLabel("", 0, 0, 20, 20)
            GUICtrlSetBkColor(-1, 0x999999)
        EndIf
    ElseIf BitAND($drawingtext = 1, _IsPressed("01") = 0, $clicking2 = 1) Then
        $clicking2 = 0
        $created2 = 1
        $drawingtext = 0
        $cinfo2 = GUIGetCursorInfo()
        GUISwitch($Form1, $slidearray[GUICtrlRead($Tab1) + 1])
        $tabstuff = $slidearray[GUICtrlRead($Tab1) + 1]
        GUICtrlDelete($lv)
        CreateText($cinfo1[0], $cinfo1[1], $cinfo2[0] - $cinfo1[0], $cinfo2[1] - $cinfo1[1])
        GUISwitch($Form1)
    EndIf
    If BitAND($clicking = 0, BitOR(_ArraySearch($pics, $cursorinfo[4]) > 0, _ArraySearch($texts, $cursorinfo[4]) > 0), _IsPressed("01"), $grabbing = 0, $selected = 0, $moving = 0) Then
        If _ArraySearch($pics, $cursorinfo[4]) <> -1 Then
            $selectedtype = "Pic"
            $snum = _ArraySearch($pics, $cursorinfo[4])
        Else
            $selectedtype = "Text"
            $snum = _ArraySearch($texts, $cursorinfo[4])
        EndIf
        $selected = 1
        $selectedID = $cursorinfo[4]
        If $selectedtype = "Pic" Then
            $grabber = GUICtrlCreateButton("", ($pl[_ArraySearch($pics, $selectedID)] + $pw[_ArraySearch($pics, $selectedID)]) - 5, ($pt[_ArraySearch($pics, $selectedID)] + $ph[_ArraySearch($pics, $selectedID)]) - 5, 10, 10)
        Else
            $grabber = GUICtrlCreateButton("", ($tl[_ArraySearch($texts, $selectedID)] + $tw[_ArraySearch($texts, $selectedID)]) - 5, ($tt[_ArraySearch($texts, $selectedID)] + $th[_ArraySearch($texts, $selectedID)]) - 5, 10, 10)
        EndIf
        $cr = TimerInit()
    EndIf
    If BitAND($cursorinfo[4] = $grabber, _IsPressed("01"), $selected = 1, $moving = 0) then
        $grabbing = 1
        $graborigcinfo = GUIGetCursorInfo()
    EndIf
    If $grabbing = 1 Then
        $gcinfonow = GUIGetCursorInfo()
        If $selectedtype = "Pic" Then
            GUICtrlSetPos($pics[$snum], $pl[$snum], $pt[$snum], $pw[$snum] + ($gcinfonow[0] - $graborigcinfo[0]), $ph[$snum] + ($gcinfonow[1] - $graborigcinfo[1]))
            GUICtrlSetPos($grabber, ($pl[$snum] + $pw[$snum] + ($gcinfonow[0] - $graborigcinfo[0])) - 5, ($pt[$snum] + $ph[$snum] + ($gcinfonow[1] - $graborigcinfo[1])) - 5, 10, 10)
        Else
            GUICtrlSetPos($texts[$snum], $tl[$snum], $tt[$snum], $tw[$snum] + ($gcinfonow[0] - $graborigcinfo[0]), $th[$snum] + ($gcinfonow[1] - $graborigcinfo[1]))
            GUICtrlSetPos($grabber, ($tl[$snum] + $tw[$snum] + ($gcinfonow[0] - $graborigcinfo[0])) - 5, ($tt[$snum] + $th[$snum] + ($gcinfonow[1] - $graborigcinfo[1])) - 5, 10, 10)
        EndIf
    EndIf
    If BitAND(_IsPressed("01"), $deleteing = 1) Then
        If BitOR(_ArraySearch($pics, $cursorinfo[4]) <> -1, _ArraySearch($texts, $cursorinfo[4]) <> -1) Then
            If _ArraySearch($pics, $cursorinfo[4]) <> -1 Then
                DeletePic($cursorinfo[4])
            Else
                DeleteText($cursorinfo[4])
            EndIf
        EndIf
        $deleteing = 0
    EndIf
    If BitAND($grabbing = 1, _IsPressed("01") = 0) Then
        $gcinfonow = GUIGetCursorInfo()
        $grabbing = 0
        If $selectedtype = "Pic" Then
            $pw[$snum] += $gcinfonow[0] - $graborigcinfo[0]
            $ph[$snum] += $gcinfonow[1] - $graborigcinfo[1]
        Else
            $tw[$snum] += $gcinfonow[0] - $graborigcinfo[0]
            $th[$snum] += $gcinfonow[1] - $graborigcinfo[1]
        EndIf
    EndIf
    If BitAND(_IsPressed("01"), $selected = 1, $selectedID = $cursorinfo[4], $grabbing = 0, $moving = 0, TimerDiff($cr) > 100) Then
        $moving = 1
        $mvcinfoprv = GUIGetCursorInfo()
        If $selectedtype = "Pic" Then
            $diffl = $mvcinfoprv[0] - $pl[$snum]
            $diff = $mvcinfoprv[1] - $pt[$snum]
        Else
            $diffl = $mvcinfoprv[0] - $tl[$snum]
            $diff = $mvcinfoprv[1] - $tt[$snum]
        EndIf
    EndIf
    If $moving = 1 Then
        $cinfonow = GUIGetCursorInfo()
        If $selectedtype = "Pic" Then
            GUICtrlSetPos($selectedID, $cinfonow[0] - $diffl, $cinfonow[1] - $diff, $pw[$snum], $ph[$snum])
            $pl[$snum] = $cinfonow[0] - $diffl
            $pt[$snum] = $cinfonow[1] - $diff
            GUICtrlSetPos($grabber, ($pl[$snum] + $pw[$snum]) - 5, ($pt[$snum] + $ph[$snum]) - 5, 10, 10)
        Else
            GUICtrlSetPos($selectedID, $cinfonow[0] - $diffl, $cinfonow[1] - $diff, $tw[$snum], $th[$snum])
            $tl[$snum] = $cinfonow[0] - $diffl
            $tt[$snum] = $cinfonow[1] - $diff
            GUICtrlSetPos($grabber, ($tl[$snum] + $tw[$snum]) - 5, ($tt[$snum] + $th[$snum]) - 5, 10, 10)
        EndIf
    EndIf
    If BitAND($moving = 1, _IsPressed("01") = 0) Then
        $moving = 0
    EndIf
    If BitAND(_IsPressed("01") = 1, $cursorinfo[4] <> $selectedID, $cursorinfo[4] <> $grabber, $editing = 0, $cursorinfo[4] <> $edit) Then
        GUICtrlDelete($grabber)
        $selected = 0
    EndIf
    If BitOR($clicking = 1, $clicking2 = 1) Then
        $cinfoLV = GUIGetCursorInfo()
        GUICtrlSetPos($lv, $cinfo1[0], $cinfo1[1], $cinfoLV[0] - $cinfo1[0], $cinfoLV[1] - $cinfo1[1])
    EndIf
WEnd

Func CreatePic($imagepath, $left, $top, $width, $height)
    _ArrayAdd($pl, $left)
    _ArrayAdd($pt, $top)
    _ArrayAdd($pw, $width)
    _ArrayAdd($ph, $height)
    _ArrayAdd($ptab, $tabstuff)
    _ArrayAdd($ppath, $imagepath)
    GUISwitch($Form1, $tabstuff)
    $return = GUICtrlCreatePic($imagepath, $left, $top, $width, $height)
    GUICtrlCreateTabItem("")
    _ArrayAdd($pics, $return)
    $pics[0] += 1
    Return $return
EndFunc

Func DeletePic($id)
    $num = _ArraySearch($pics, $id)
    _ArrayDelete($pl, $num)
    _ArrayDelete($pt, $num)
    _ArrayDelete($pw, $num)
    _ArrayDelete($ph, $num)
    _ArrayDelete($ptab, $num)
    _ArrayDelete($ppath, $num)
    GUICtrlDelete($id)
    GUICtrlCreateTabItem("")
    _ArrayDelete($pics, $num)
    $pics[0] -= 1
EndFunc

Func CreateText($left, $top, $width, $height)
    _ArrayAdd($ttab, $tabstuff)
    _ArrayAdd($tl, $left)
    _ArrayAdd($tt, $top)
    _ArrayAdd($tw, $width)
    _ArrayAdd($th, $height)
    _ArrayAdd($tfattribs, $attribs)
    _ArrayAdd($tfcolor, $color)
    _ArrayAdd($tfname, $font)
    _ArrayAdd($tfweight, $weight)
    _ArrayAdd($tfsize, $size)
    _ArrayAdd($tptexts, $ptext)
    _ArrayAdd($ttab, $tabstuff)
    GUISwitch($Form1, $tabstuff)
    $return = GUICtrlCreateLabel($ptext, $left, $top, $width, $height)
    GUICtrlCreateTabItem("")
    GUICtrlSetFont($return, $size, $weight, $attribs, $font)
    GUICtrlSetColor($return, $color)
    GUICtrlSetBkColor($return, $bkcolor)
    _ArrayAdd($tbkcolor, $bkcolor)
    _ArrayAdd($texts, $return)
    $texts[0] += 1
    Return $return
EndFunc

Func DeleteText($id)
    $num = _ArraySearch($texts, $id)
    _ArrayDelete($ttab, $num)
    _ArrayDelete($tl, $num)
    _ArrayDelete($tt, $num)
    _ArrayDelete($tw, $num)
    _ArrayDelete($th, $num)
    _ArrayDelete($tfattribs, $num)
    _ArrayDelete($tfcolor, $num)
    _ArrayDelete($tfname, $num)
    _ArrayDelete($tfweight, $num)
    _ArrayDelete($tfsize, $num)
    GUICtrlDelete($id)
    _ArrayDelete($tbkcolor, $num)
    _ArrayDelete($texts, $num)
    $texts[0] -= 1
EndFunc

Func SelectText()
    #Region ### START Koda GUI section ### Form=g:\applications\koda formdesigner\forms\createtextbox.kxf
    $Form1_1 = GUICreate("Create Text", 636, 312, 193, 115)
    $Edit1 = GUICtrlCreateEdit("", 8, 8, 617, 265)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $aFontArray = _ArrayCreate(0, 0, "Arial", 12, 400, 0, 0, 0x000000, "", 0xFFFFFF)
    $Button1 = GUICtrlCreateButton("Font...", 8, 280, 101, 25, 0)
    $btnColor = GUICtrlCreateButton("Color...", 16 + 101, 280, 90, 25, 0)
    $fwidth = GUICtrlCreateInput("Size", 16 + 201, 280, 32, 25)
    $Button2 = GUICtrlCreateButton("OK", 256, 280, 201, 25, 0)
    $Button3 = GUICtrlCreateButton("Cancel", 464, 280, 161, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                GUISwitch($Form1)
                GUIDelete($Form1_1)
                Return 0
            Case $Button1
                $aFontArray = _ChooseFont()
                GUICtrlSetFont($Edit1, $aFontArray[3], $aFontArray[4], $aFontArray[1], $aFontArray[2])
                GUICtrlSetColor($Edit1, $aFontArray[7])
            Case $Button3
                GUISwitch($Form1)
                GUIDelete($Form1_1)
                Return 0
            Case $Button2
                $aFontArray[8] = GUICtrlRead($Edit1)
                ExitLoop
            Case $fwidth
                If StringIsAlNum(GUICtrlRead($fwidth)) Then
                    $aFontArray[3] = GUICtrlRead($fwidth)
                Else
                    MsgBox(0, "Error", "The font size must be a number.")
                EndIf
                GUICtrlSetFont($Edit1, $aFontArray[3], $aFontArray[4], $aFontArray[1], $aFontArray[2])
            Case $btnColor
                $aFontArray[9] = _ChooseColor()
                GUICtrlSetBkColor($Edit1, $aFontArray[9])
        EndSwitch
    WEnd
    GUIDelete($Form1_1)
    Return $aFontArray
EndFunc

Func ShowShow ()
    $showgui = GUICreate("Slide Show", @DesktopWidth, @DesktopHeight)
    GUISwitch($showgui)
    $showcontextmenu = GUICtrlCreateContextMenu()
    $exit = GUICtrlCreateMenuItem("Exit Show", $showcontextmenu)
    $controlsincurrent = _ArrayCreate(0)
    $nombre = _ArrayCreate(0)
    $type = _ArrayCreate(0)
    $id = _ArrayCreate(0)
    GUISetState(@SW_SHOW)
    $slidenum = 1
    $pressed = 0
   
    For $i = 1 To $pics[0]
        If _ArraySearch($slidearray, $ptab[$i]) = 1 Then
            _ArrayAdd($controlsincurrent, $pics[$i])
            _ArrayAdd($type, "p")
            _ArrayAdd($nombre, $i)
            $controlsincurrent[0] += 1
            _ArrayAdd($id, GUICtrlCreatePic($ppath[$i], _CP(594, $pl[$i], @DesktopWidth), _CP(364, $pt[$i], @DesktopHeight), _CP(594, $pw[$i], @DesktopWidth), _CP(364, $ph[$i], @DesktopHeight)))
        EndIf
    Next
   
    For $i = 1 To $texts[0]
        If _ArraySearch($slidearray, $ttab[$i]) = 1 Then
            _ArrayAdd($controlsincurrent, $texts[$i])
            _ArrayAdd($type, "p")
            _ArrayAdd($nombre, $i)
            $controlsincurrent[0] += 1
            $x = GUICtrlCreateLabel(GUICtrlRead($texts[$i]), _CP(594, $tl[$i], @DesktopWidth), _CP(364, $tt[$i], @DesktopHeight), _CP(594, $tw[$i], @DesktopWidth), _CP(364, $th[$i], @DesktopHeight))
            _ArrayAdd($id, $x)
            GUICtrlSetBkColor($x, $tbkcolor[$i])
            GUICtrlSetColor($x, $tfcolor[$i])
            GUICtrlSetFont($x, $tfsize[$i], $tfweight[$i], $tfattribs[$i], $tfname[$i])
        EndIf
    Next
   
    $split = StringSplit($slidebks[$slidenum], "|")
    If $split[1] = "Color" Then
        GUISwitch($showgui)
        GUISetBkColor($split[2], $showgui)
        $bktype = "Color"
    Else
        GUISwitch($showgui)
        $bkimage = GUICtrlCreatePic($split[2], 0, 0, @DesktopWidth, @DesktopHeight)
        $bktype = "Image"
    EndIf
   
    While 1
        If GUIGetMsg() = $GUI_EVENT_CLOSE then
            GUIDelete($showgui)
            Return
        ElseIf BitAND(_IsPressed("01"), $pressed = 0) Then
            If $slidenum + 1 <= $slidearray[0] Then
                $slidenum += 1
                If $bktype = "Image" Then
                    GUICtrlDelete($bkimage)
                EndIf
                $split = StringSplit($slidebks[$slidenum], "|")
                If $split[1] = "Color" Then
                    GUISwitch($showgui)
                    GUISetBkColor($split[2], $showgui)
                Else
                    GUISwitch($showgui)
                    $bkimage = GUICtrlCreatePic($split[2], 0, 0, @DesktopWidth, @DesktopHeight)
                    $bktype = "Image"
                EndIf
                For $i = 1 To $controlsincurrent[0]
                    GUICtrlDelete($id[$i])
                Next
                For $i = 1 To $pics[0]
                    If _ArraySearch($slidearray, $ptab[$i]) = $slidenum Then
                        _ArrayAdd($controlsincurrent, $pics[$i])
                        _ArrayAdd($type, "p")
                        _ArrayAdd($nombre, $i)
                        $controlsincurrent[0] += 1
                        GUISwitch($showgui)
                        $pictocreate = GUICtrlCreatePic($ppath[$i], _CP(594, $pl[$i], @DesktopWidth), _CP(364, $pt[$i], @DesktopHeight), _CP(594, $pw[$i], @DesktopWidth), _CP(364, $ph[$i], @DesktopHeight))
                        _ArrayAdd($id, $pictocreate)
                    EndIf
                Next
               
                For $i = 1 To $texts[0]
                    If _ArraySearch($slidearray, $ttab[$i]) = $slidenum Then
                        _ArrayAdd($controlsincurrent, $texts[$i])
                        _ArrayAdd($type, "p")
                        _ArrayAdd($nombre, $i)
                        $controlsincurrent[0] += 1
                        GUISwitch($showgui)
                        $x = GUICtrlCreateLabel(GUICtrlRead($texts[$i]), _CP(594, $tl[$i], @DesktopWidth), _CP(364, $tt[$i], @DesktopHeight), _CP(594, $tw[$i], @DesktopWidth), _CP(364, $th[$i], @DesktopHeight))
                        _ArrayAdd($id, $x)
                        GUICtrlSetBkColor($x, $tbkcolor[$i])
                        GUICtrlSetColor($x, $tfcolor[$i])
                        GUICtrlSetFont($x, _CP(594, $tfsize[$i], @DesktopWidth), $tfweight[$i], $tfattribs[$i], $tfname[$i])
                    EndIf
                Next
                $pressed = 1
            Else
                GUIDelete($showgui)
                GUISwitch($Form1)
                Return
            EndIf
        ElseIf _IsPressed("01") = 0 Then
            $pressed = 0
        EndIf
        If BitAND(_IsPressed("08"), $selected = 1) Then
            If $selectedtype = "Pic" Then
                DeletePic($selectedID)
            Else
                DeleteText($selectedID)
            EndIf
        EndIf
    WEnd
EndFunc

Func _CP($a1, $a2, $b1)
    Return round(($a2 * $b1) / $a1)
EndFunc

Func Save ($filepath); 24
    ProgressOn("Saving...", "Now saving...")
    For $i = 0 To $pics[0]
        IniWrite($filepath, "pics", $i, $pics[$i])
    Next
    ProgressSet(Round((2 / 24) * 100))
    For $i = 0 To $pics[0]
        IniWrite($filepath, "pt", $i, $pt[$i])
    Next
    ProgressSet(Round((3 / 24) * 100))
    For $i = 0 To $pics[0]
        IniWrite($filepath, "pl", $i, $pl[$i])
    Next
    ProgressSet(Round((4 / 24) * 100))
    For $i = 0 To $pics[0]
        IniWrite($filepath, "pw", $i, $pw[$i])
    Next
    ProgressSet(Round((5 / 24) * 100))
    For $i = 0 To $Pics[0]
        IniWrite($filepath, "ph", $i, $ph[$i])
    Next
    ProgressSet(Round((6 / 24) * 100))
    For $i = 0 To $pics[0]
        IniWrite($filepath, "ppath", $i, $ppath[$i])
    Next
    ProgressSet(Round((7 / 24) * 100))
    For $i = 0 To $Pics[0]
        IniWrite($filepath, "ptab", $i, $ptab[$i])
    Next
    ProgressSet(Round((8 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "texts", $i, $texts[$i])
    Next
    ProgressSet(Round((9 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tl", $i, $tl[$i])
    Next
    ProgressSet(Round((10 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tt", $i, $tt[$i])
    Next
    ProgressSet(Round((11 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tw", $i, $tw[$i])
    Next
    ProgressSet(Round((12 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "th", $i, $th[$i])
    Next
    ProgressSet(Round((13 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "ttab", $i, $ttab[$i])
    Next
    ProgressSet(Round((14 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tbkcolor", $i, $tbkcolor[$i])
    Next
    ProgressSet(Round((15 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tfname", $i, $tfname[$i])
    Next
    ProgressSet(Round((16 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tfsize", $i, $tfsize[$i])
    Next
    ProgressSet(Round((17 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tfattribs", $i, $tfattribs[$i])
    Next
    ProgressSet(Round((18 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tfweight", $i, $tfweight[$i])
    Next
    ProgressSet(Round((19 / 24) * 100))
    For $i = 0 To $slidearray[0]
        IniWrite($filepath, "slidearray", $i, $slidearray[$i])
    Next
    ProgressSet(Round((20 / 24) * 100))
    For $i = 0 To $slidearray[0]
        IniWrite($filepath, "slidebks", $i, $slidebks[$i])
    Next
    ProgressSet(Round((21 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "tptexts", $i, $tptexts[$i])
    Next
    ProgressSet(Round((22 / 24) * 100))
    For $i = 1 To $pics[0]
        IniWrite($filepath, "ptabnumber", $i, _ArraySearch($slidearray, $ptab[$i]))
    Next
    ProgressSet(Round((23 / 24) * 100))
    For $i = 0 To $texts[0]
        IniWrite($filepath, "ttabnumber", $i, _ArraySearch($slidearray, $ttab[$i]))
    Next
    ProgressSet(Round((24 / 24) * 100))
    Sleep(500)
    ProgressOff()
    MsgBox(0, "Save", "File saved.")
EndFunc

Func Open ($filepath)
    $pics = _ArrayCreate(0)
    $pl = _ArrayCreate("")
    $pt = _ArrayCreate("")
    $pw = _ArrayCreate("")
    $ph = _ArrayCreate("")
    $ptab = _ArrayCreate("")
    $ppath = _ArrayCreate("")
    $tbkcolor = _ArrayCreate("")
    $texts = _ArrayCreate(0)
    $tfattribs = _ArrayCreate("")
    $tfcolor = _ArrayCreate("")
    $tfname = _ArrayCreate("")
    $tfsize = _ArrayCreate("")
    $tfweight = _ArrayCreate("")
    $th = _ArrayCreate("")
    $tw = _ArrayCreate("")
    $tl = _ArrayCreate("")
    $tt = _ArrayCreate("")
    $ttab = _ArrayCreate("")
    $tptexts = _ArrayCreate("")
    GUICtrlDelete($slidearray[1])
    $slidearray = _ArrayCreate(0)
    For $i = 1 To IniRead($filepath, "slidearray", 0, 0)
        _ArrayAdd($slidearray, "null")
        _ArrayAdd($slidebks, "null")
        $slidearray[0] += 1
    Next
    For $i = 1 To IniRead($filepath, "slidearray", 0, 0)
        $slidearray[$i] = GUICtrlCreateTabItem("Slide " & $i)
        $slidebks[$i] = "Color|0xFFFFFF"
    Next
    for $i = 1 To IniRead($filepath, "pics", 0, 0)
        Global $tabstuff = $slidearray[IniRead($filepath, "ptabnumber", $i, 0)]
        CreatePic(IniRead($filepath, "ppath", $i, 0), IniRead($filepath, "pl", $i, 0), IniRead($filepath, "pt", $i, 0), IniRead($filepath, "pw", $i, 0), IniRead($filepath, "ph", $i, 0))
    Next
    For $i = 1 To IniRead($filepath, "texts", 0, 0)
        Global $attribs = IniRead($filepath, "tfattribs", $i, "")
        Global $ptext = IniRead($filepath, "tptexts", $i, "")
        Global $bkcolor = IniRead($filepath, "tbkcolor", $i, "")
        Global $color = IniRead($filepath, "tcolor", $i, "")
        Global $font = IniRead($filepath, "tfname", $i, "")
        Global $size = IniRead($filepath, "tfsize", $i, "")
        Global $weight = IniRead($filepath, "tfweight", $i, "")
        Global $tabstuff = $slidearray[IniRead($filepath, "ttabnumber", $i, 0)]
        CreateText(IniRead($filepath, "tl", $i, ""), IniRead($filepath, "tt", $i, 0), IniRead($filepath, "tw", $i, 0), IniRead($filepath, "th", "", 0))
    Next
    for $i = 0 To IniRead($filepath, "slidearray", 0, 0)
        If $i <> 0 Then _ArrayAdd($slidearray, "null")
        $slidearray[$i] = IniRead($filepath, "slidearray", $i, "")
    Next
    for $i = 0 To IniRead($filepath, "slidebks", 0, 0)
        If $i <> 0 Then _ArrayAdd($slidebks, "null")
        $slidebks[$i] = IniRead($filepath, "slidebks", $i, "")
    Next
EndFunc

Func SetSlideBK ()
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Slide BK", 134, 134, 193, 115)
    $split = StringSplit($slidebks[GUICtrlRead($Tab1)], "|")
    MsgBox(0, GUICtrlRead($Tab1), "")
    If $split[1] = "Color" Then
        $m = 1
    Else
        $m = 2
    EndIf
    $Radio1 = GUICtrlCreateRadio("Color", 8, 8, 113, 17)
    If $m = 1 Then
        GUICtrlSetState($Radio1, $GUI_CHECKED)
    EndIf
    $Radio2 = GUICtrlCreateRadio("Image", 8, 32, 113, 25)
    If $m = 2 Then
        GUICtrlSetState($Radio2, $GUI_CHECKED)
    EndIf
    $Button1 = GUICtrlCreateButton("Select", 8, 72, 121, 25, 0)
    $Button2 = GUICtrlCreateButton("OK", 8, 104, 33, 25, 0)
    $Button3 = GUICtrlCreateButton("Cancel", 48, 104, 81, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
   
    $return = $split[1] & "|" & $split[2]
   
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
        Case $Button1
            If GUICtrlRead($Radio1) = $GUI_CHECKED Then
                $split[1] = "Color"
                $split[2] = _ChooseColor()
                $return = $split[1] & "|" & $split[2]
            Else
                $split[1] = "Image"
                $split[2] = FileOpenDialog("Select Image", "", "Images (*.jpg; *.jpeg; *.bmp)")
                $return = $split[1] & "|" & $split[2]
            EndIf
        Case $Button3
            GUIDelete($Form1)
            GUISwitch($Form1_1)
            ExitLoop
        Case $Button2
            $slidebks[GUICtrlRead($Tab1)] = $return
            GUIDelete($Form1)
            GUISwitch($Form1_1)
            ExitLoop
        EndSwitch
    WEnd
EndFunc

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /AU3Check /in "C:\Documents and Settings\Jar\Desktop\AutoIt\Autoit Scripts\test3.au3"

+>18:57:53 Starting AutoIt3Wrapper v.1.9.2

>Running AU3Check (1.54.10.0) from:C:\Program Files\AutoIt3

C:\Documents and Settings\Jar\Desktop\AutoIt\Autoit Scripts\test3.au3(5,10) : ERROR: can't open include file <FileRegister.au3>

#include <FileRegister.au3>

~~~~~~~~~^

C:\Documents and Settings\Jar\Desktop\AutoIt\Autoit Scripts\test3.au3(107,31) : WARNING: $snum: possibly used before declaration.

$tfcolor[$snum]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Jar\Desktop\AutoIt\Autoit Scripts\test3.au3(126,34) : WARNING: $selectedtype: possibly used before declaration.

If $selectedtype <>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Jar\Desktop\AutoIt\Autoit Scripts\test3.au3(811,31) : WARNING: $Form1_1: possibly used before declaration.

GUISwitch($Form1_1)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Jar\Desktop\AutoIt\Autoit Scripts\test3.au3(811,31) : ERROR: $Form1_1: undeclared global variable.

GUISwitch($Form1_1)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Jar\Desktop\AutoIt\Autoit Scripts\test3.au3(59,149) : ERROR: FileRegister(): undefined function.

FileRegister("psp", '"' & @ScriptFullPath & '" "%1"', "Open in PresentationStudio", 1, @ScriptFullPath & ',0', "PresentationStudio Presentation")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Jar\Desktop\AutoIt\Autoit Scripts\test3.au3 - 3 error(s), 3 warning(s)

!>18:57:53 AU3Check ended.rc:2

+>18:57:53 AutoIt3Wrapper Finished

>Exit code: 0 Time: 1.751

Share this post


Link to post
Share on other sites

It runs on my PC... :)


I can do signature me.

Share this post


Link to post
Share on other sites

Make sure you declare versions and make sure it's universal compatable.

~Smith

Share this post


Link to post
Share on other sites

I've posted the errors I get and so has Justin.. just look in our posts.

You say it doesn't run on your PC. If you run the script and it exits due to an error, there should be a ConsoleWrite or a message box that tells you why it exited. What does it say?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0