Damein Posted July 13, 2014 Share Posted July 13, 2014 (edited) I wrote this for myself but figured some people out there might find it interesting too! It's a way to store your movies in many categories and also favorite them for quick reference! Video Link: YouTube Link Website/Download Link: Website Link Screenshot of GUI Source expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Images\Icon.ico #AutoIt3Wrapper_Compression=0 #AutoIt3Wrapper_Res_Fileversion=1.3.0.0 #AutoIt3Wrapper_Res_LegalCopyright=R.S.S. #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;~ #AutoIt3Wrapper_Icon=Images\Icon.ico #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <EditConstants.au3> #include <GuiListView.au3> #include ".\Skins\Cosmo.au3" #include "_UskinLibrary.au3" _Uskin_LoadDLL() _USkin_Init(_Cosmo(True)) Global $MainGui, $CurrentGui, $AddMovieGui, $AlreadySaved, $fSortSense = False, $NotFound Global $OwnedCheckBox, $WantCheckBox, $LoanedCheckBox, $TreeView, $SplitData, $CurrentCategory, $ReadControl Global $TitleInput, $CategoryBox, $FavoritesCheckBox, $DescriptionInput, $StatusOfMovie, $MovieListView, $Count Dim $OldData[4000] Opt("GUIOnEventMode", 1) _CreateGui() Func _CreateGui() $CurrentGui = "MainGui" $MainGui = GUICreate("Movie Database", 800, 600) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetFont(11) GUICtrlCreateLabel("An R.S.S. Production ©2014", 680, 590, 120, 20) GuiCtrlSetFont(-1, 7) $TreeView = GUICtrlCreateTreeView(10, 10, 220, 520) $ActionTreeView = GUICtrlCreateTreeViewItem("Action", $TreeView) $ActionOwnedTV = GUICtrlCreateTreeViewItem("Owned", $ActionTreeView) GUICtrlSetOnEvent(-1, "_DisplayAction") $ActionWantTV = GUICtrlCreateTreeViewItem("Want", $ActionTreeView) GUICtrlSetOnEvent(-1, "_DisplayAction") $ActionLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $ActionTreeView) GUICtrlSetOnEvent(-1, "_DisplayAction") $ComedyTreeView = GUICtrlCreateTreeViewItem("Comedy", $TreeView) $ComedyOwnedTV = GUICtrlCreateTreeViewItem("Owned", $ComedyTreeView) GUICtrlSetOnEvent(-1, "_DisplayComedy") $ComedyWantTV = GUICtrlCreateTreeViewItem("Want", $ComedyTreeView) GUICtrlSetOnEvent(-1, "_DisplayComedy") $ComedyLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $ComedyTreeView) GUICtrlSetOnEvent(-1, "_DisplayComedy") $HorrorTreeView = GUICtrlCreateTreeViewItem("Horror", $TreeView) $HorrorOwnedTV = GUICtrlCreateTreeViewItem("Owned", $HorrorTreeView) GUICtrlSetOnEvent(-1, "_DisplayHorror") $HorrorWantTV = GUICtrlCreateTreeViewItem("Want", $HorrorTreeView) GUICtrlSetOnEvent(-1, "_DisplayHorror") $HorrorLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $HorrorTreeView) GUICtrlSetOnEvent(-1, "_DisplayHorror") $RomanceTreeView = GUICtrlCreateTreeViewItem("Romance", $TreeView) $RomanceOwnedTV = GUICtrlCreateTreeViewItem("Owned", $RomanceTreeView) GUICtrlSetOnEvent(-1, "_DisplayRomance") $RomanceWantTV = GUICtrlCreateTreeViewItem("Want", $RomanceTreeView) GUICtrlSetOnEvent(-1, "_DisplayRomance") $RomanceLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $RomanceTreeView) GUICtrlSetOnEvent(-1, "_DisplayRomance") $ChildrenTreeView = GUICtrlCreateTreeViewItem("Children", $TreeView) $ChildrenOwnedTV = GUICtrlCreateTreeViewItem("Owned", $ChildrenTreeView) GUICtrlSetOnEvent(-1, "_DisplayChildren") $ChildrenWantTV = GUICtrlCreateTreeViewItem("Want", $ChildrenTreeView) GUICtrlSetOnEvent(-1, "_DisplayChildren") $ChildrenLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $ChildrenTreeView) GUICtrlSetOnEvent(-1, "_DisplayChildren") $MysteryTreeView = GUICtrlCreateTreeViewItem("Mystery", $TreeView) $MysteryOwnedTV = GUICtrlCreateTreeViewItem("Owned", $MysteryTreeView) GUICtrlSetOnEvent(-1, "_DisplayMystery") $MysteryWantTV = GUICtrlCreateTreeViewItem("Want", $MysteryTreeView) GUICtrlSetOnEvent(-1, "_DisplayMystery") $MysteryLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $MysteryTreeView) GUICtrlSetOnEvent(-1, "_DisplayMystery") $AdventureTreeView = GUICtrlCreateTreeViewItem("Adventure", $TreeView) $AdventureOwnedTV = GUICtrlCreateTreeViewItem("Owned", $AdventureTreeView) GUICtrlSetOnEvent(-1, "_DisplayAdventure") $AdventureWantTV = GUICtrlCreateTreeViewItem("Want", $AdventureTreeView) GUICtrlSetOnEvent(-1, "_DisplayAdventure") $AdventureLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $AdventureTreeView) GUICtrlSetOnEvent(-1, "_DisplayAdventure") $SciFiTreeView = GUICtrlCreateTreeViewItem("Sci-Fi", $TreeView) $SciFiOwnedTV = GUICtrlCreateTreeViewItem("Owned", $SciFiTreeView) GUICtrlSetOnEvent(-1, "_DisplaySciFi") $SciFiWantTV = GUICtrlCreateTreeViewItem("Want", $SciFiTreeView) GUICtrlSetOnEvent(-1, "_DisplaySciFi") $SciFiLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $SciFiTreeView) GUICtrlSetOnEvent(-1, "_DisplaySciFi") $WesternTreeView = GUICtrlCreateTreeViewItem("Western", $TreeView) $WesternOwnedTV = GUICtrlCreateTreeViewItem("Owned", $WesternTreeView) GUICtrlSetOnEvent(-1, "_DisplayWestern") $WesternWantTV = GUICtrlCreateTreeViewItem("Want", $WesternTreeView) GUICtrlSetOnEvent(-1, "_DisplayWestern") $WesternLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $WesternTreeView) GUICtrlSetOnEvent(-1, "_DisplayWestern") $MusicalTreeView = GUICtrlCreateTreeViewItem("Musical", $TreeView) $MusicalOwnedTV = GUICtrlCreateTreeViewItem("Owned", $MusicalTreeView) GUICtrlSetOnEvent(-1, "_DisplayMusical") $MusicalWantTV = GUICtrlCreateTreeViewItem("Want", $MusicalTreeView) GUICtrlSetOnEvent(-1, "_DisplayMusical") $MusicalLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $MusicalTreeView) GUICtrlSetOnEvent(-1, "_DisplayMusical") $DocumentaryTreeView = GUICtrlCreateTreeViewItem("Documentary", $TreeView) $DocumentaryOwnedTV = GUICtrlCreateTreeViewItem("Owned", $DocumentaryTreeView) GUICtrlSetOnEvent(-1, "_DisplayDocumentary") $DocumentaryWantTV = GUICtrlCreateTreeViewItem("Want", $DocumentaryTreeView) GUICtrlSetOnEvent(-1, "_DisplayDocumentary") $DocumentaryLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $DocumentaryTreeView) GUICtrlSetOnEvent(-1, "_DisplayDocumentary") $AnimationTreeView = GUICtrlCreateTreeViewItem("Animation", $TreeView) $AnimationOwnedTV = GUICtrlCreateTreeViewItem("Owned", $AnimationTreeView) GUICtrlSetOnEvent(-1, "_DisplayAnimation") $AnimationWantTV = GUICtrlCreateTreeViewItem("Want", $AnimationTreeView) GUICtrlSetOnEvent(-1, "_DisplayAnimation") $AnimationLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $AnimationTreeView) GUICtrlSetOnEvent(-1, "_DisplayAnimation") $WarTreeView = GUICtrlCreateTreeViewItem("War", $TreeView) $WarOwnedTV = GUICtrlCreateTreeViewItem("Owned", $WarTreeView) GUICtrlSetOnEvent(-1, "_DisplayWar") $WarWantTV = GUICtrlCreateTreeViewItem("Want", $WarTreeView) GUICtrlSetOnEvent(-1, "_DisplayWar") $WarLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $WarTreeView) GUICtrlSetOnEvent(-1, "_DisplayWar") $FavoriteTreeView = GUICtrlCreateTreeViewItem("Favorites", $TreeView) $WarOwnedTV = GUICtrlCreateTreeViewItem("Owned", $FavoriteTreeView) GUICtrlSetOnEvent(-1, "_DisplayFavorites") $WarWantTV = GUICtrlCreateTreeViewItem("Want", $FavoriteTreeView) GUICtrlSetOnEvent(-1, "_DisplayFavorites") $WarLoanedOutTV = GUICtrlCreateTreeViewItem("Loaned Out", $FavoriteTreeView) GUICtrlSetOnEvent(-1, "_DisplayFavorites") $MovieListView = GUICtrlCreateListView("Movie", 250, 10, 530, 520, $LVS_SINGLESEL) GUICtrlSendMsg($MovieListView, $LVM_SETCOLUMNWIDTH, 0, 525) $AddMovie = GUICtrlCreateButton("Add Movie", 150, 540, 150, 50) GUICtrlSetOnEvent(-1, "_AddMovie") $RemoveMovie = GUICtrlCreateButton("Remove Movie", 317, 540, 150, 50) GUICtrlSetOnEvent(-1, "_RemoveMovie") $EditMovie = GUICtrlCreateButton("Edit Movie", 484, 540, 150, 50) GUICtrlSetOnEvent(-1, "_EditMovie") GUISetState() EndFunc ;==>_CreateGui Func _DisplayAction() $CurrentCategory = "Action" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Action") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayAction Func _DisplayComedy() $CurrentCategory = "Comedy" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Comedy") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayComedy Func _DisplayHorror() $CurrentCategory = "Horror" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Horror") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayHorror Func _DisplayRomance() $CurrentCategory = "Romance" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Romance") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayRomance Func _DisplayChildren() $CurrentCategory = "Children" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Children") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayChildren Func _DisplayMystery() $CurrentCategory = "Mystery" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Mystery") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayMystery Func _DisplayAdventure() $CurrentCategory = "Adventure" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Adventure") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayAdventure Func _DisplaySciFi() $CurrentCategory = "Sci-Fi" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Sci-Fi") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplaySciFi Func _DisplayWestern() $CurrentCategory = "Western" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Western") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayWestern Func _DisplayMusical() $CurrentCategory = "Musical" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Musical") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayMusical Func _DisplayDocumentary() $CurrentCategory = "Documentary" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Documentary") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayDocumentary Func _DisplayAnimation() $CurrentCategory = "Animation" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Animation") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayAnimation Func _DisplayWar() $CurrentCategory = "War" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "War") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayWar Func _DisplayFavorites() $CurrentCategory = "Favorites" _GUICtrlListView_DeleteAllItems($MovieListView) $ReadDataBase = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Favorites") $ReadControl = GUICtrlRead($TreeView, 1) If $ReadControl = "Owned" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Owned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Want" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Want" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf If $ReadControl = "Loaned Out" Then For $i = 2 To $ReadDataBase[0][0] $SplitData = StringSplit($ReadDataBase[$i][1], "|") If $SplitData[3] = "Loaned" Then _GUICtrlListView_AddItem($MovieListView, $SplitData[1]) Else Sleep(10) EndIf Next EndIf _GUICtrlListView_SimpleSort($MovieListView, $fSortSense, 0) EndFunc ;==>_DisplayFavorites Func _AddMovie() GUISetState(@SW_DISABLE, $MainGui) $CurrentGui = "AddMovies" $AddMovieGui = GUICreate("Add Movie..", 600, 400) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetFont(13) GUICtrlCreateLabel("Movie Title", 250, 10) $TitleInput = GUICtrlCreateInput("", 90, 40, 400, 23, $ES_CENTER) GUICtrlCreateLabel("Category", 255, 80) $CategoryBox = GUICtrlCreateCombo("Action", 200, 110, 185, 20) GUICtrlSetData($CategoryBox, "Comedy|Horror|Romance|Children|Mystery|Adventure|Sci-Fi|Western|Musical|Documentary|Animation|War") GUICtrlCreateLabel("Add To Favorites?", 230, 150) $FavoritesCheckBox = GUICtrlCreateCheckbox("", 285, 170, 20, 30) GUICtrlCreateLabel("Owned, Want or Loaned Out?", 190, 205) $OwnedCheckBox = GUICtrlCreateCheckbox("Owned", 170, 230, 70, Default) GUICtrlSetOnEvent(-1, "_AddMovieCheckboxSwitcher") $WantCheckBox = GUICtrlCreateCheckbox("Want", 265, 230, 70, Default) GUICtrlSetOnEvent(-1, "_AddMovieCheckboxSwitcher") $LoanedCheckBox = GUICtrlCreateCheckbox("Loaned", 350, 230, 70, Default) GUICtrlSetOnEvent(-1, "_AddMovieCheckboxSwitcher") GUICtrlCreateLabel("Short Description", 230, 270) $DescriptionInput = GUICtrlCreateInput("", 90, 300, 400, 23, $ES_CENTER) $SaveButton = GUICtrlCreateButton("Save", 40, 350, 150, 50) GUICtrlSetOnEvent(-1, "_SaveNewMovie") $CancelButton = GUICtrlCreateButton("Cancel", 405, 350, 150, 50) GUICtrlSetOnEvent(-1, "_CheckCancel") GUISetState() EndFunc ;==>_AddMovie Func _AddMovieCheckboxSwitcher() $CheckCheckBox = GUICtrlRead($OwnedCheckBox) If $CheckCheckBox = 1 Then GUICtrlSetState($WantCheckBox, $Gui_Unchecked) GUICtrlSetState($LoanedCheckBox, $Gui_Unchecked) $StatusOfMovie = "Owned" EndIf $CheckCheckBox = GUICtrlRead($WantCheckBox) If $CheckCheckBox = 1 Then GUICtrlSetState($OwnedCheckBox, $Gui_Unchecked) GUICtrlSetState($LoanedCheckBox, $Gui_Unchecked) $StatusOfMovie = "Want" EndIf $CheckCheckBox = GUICtrlRead($LoanedCheckBox) If $CheckCheckBox = 1 Then GUICtrlSetState($OwnedCheckBox, $Gui_Unchecked) GUICtrlSetState($WantCheckBox, $Gui_Unchecked) $StatusOfMovie = "Loaned" EndIf EndFunc ;==>_AddMovieCheckboxSwitcher Func _SaveNewMovie() $ReadTitle = GUICtrlRead($TitleInput) $ReadCategory = GUICtrlRead($CategoryBox) $MovieCount = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", $ReadCategory) For $i = 1 To $MovieCount[0][0] $SplitData = StringSplit($MovieCount[$i][1], "|") If $SplitData[1] = $ReadTitle Then MsgBox(48, "Error", "Error, movie is already in database. If you want to edit something about the title please use the edit button!") $NotFound = 1 ExitLoop EndIf Next If $NotFound = 0 Then $CheckSave = MsgBox(4, "Check..", "Are you ready to save your movie?") If $CheckSave = 6 Then $ReadData1 = GUICtrlRead($TitleInput) $ReadData2 = GUICtrlRead($CategoryBox) $ReadData3 = GUICtrlRead($FavoritesCheckBox) $ReadData4 = GUICtrlRead($DescriptionInput) IniWrite(@ScriptDir & "/Data/Movie Database.ini", $ReadData2, $MovieCount[0][0], _ $ReadData1 & "|" & $ReadData3 & "|" & $StatusOfMovie & "|" & $ReadData4) If $ReadData3 = 1 Then If $AlreadySaved = 0 Then $MovieCount2 = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Favorites") IniWrite(@ScriptDir & "/Data/Movie Database.ini", "Favorites", $MovieCount2[0][0], _ $ReadData1 & "|" & $ReadData3 & "|" & $StatusOfMovie & "|" & $ReadData4) $AlreadySaved = 1 EndIf EndIf Else Sleep(10) EndIf Else Sleep(10) EndIf $AlreadySaved = 0 _GUICtrlListView_DeleteAllItems($MovieListView) _Exit() EndFunc ;==>_SaveNewMovie Func _EditMovie() $Index = ControlListView($MainGui, "Movie Database", $MovieListView, "GetSelected") $ReadControl = _GUICtrlListView_GetItemText($MovieListView, 0 + $Index) If $ReadControl = "" Then MsgBox(48, "Error", "No movie selected, please select a movie first.") Else GUISetState(@SW_DISABLE, $MainGui) $CurrentGui = "EditMovies" $AddMovieGui = GUICreate("Edit Movie..", 600, 400) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetFont(13) GUICtrlCreateLabel("Movie Title", 250, 10) $TitleInput = GUICtrlCreateInput("", 90, 40, 400, 23, $ES_CENTER) GUICtrlCreateLabel("Category", 255, 80) $CategoryBox = GUICtrlCreateCombo("Action", 200, 110, 185, 20) GUICtrlSetData($CategoryBox, "Comedy|Horror|Romance|Children|Mystery|Adventure|Sci-Fi|Western|Musical|Documentary|Animation|War") GUICtrlCreateLabel("Add To Favorites?", 230, 150) $FavoritesCheckBox = GUICtrlCreateCheckbox("", 285, 170, 20, 30) GUICtrlCreateLabel("Owned, Want or Loaned Out?", 190, 205) $OwnedCheckBox = GUICtrlCreateCheckbox("Owned", 170, 230, 70, Default) GUICtrlSetOnEvent(-1, "_EditMovieCheckboxSwitcher") $WantCheckBox = GUICtrlCreateCheckbox("Want", 265, 230, 70, Default) GUICtrlSetOnEvent(-1, "_EditMovieCheckboxSwitcher") $LoanedCheckBox = GUICtrlCreateCheckbox("Loaned", 350, 230, 70, Default) GUICtrlSetOnEvent(-1, "_EditMovieCheckboxSwitcher") GUICtrlCreateLabel("Short Description", 230, 270) $DescriptionInput = GUICtrlCreateInput("", 90, 300, 400, 23, $ES_CENTER) $ReadSections = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", $CurrentCategory) For $i = 1 To $ReadSections[0][0] - 1 $ReadMovie = IniRead(@ScriptDir & "/Data/Movie Database.ini", $CurrentCategory, $i, "NA") $SplitData = StringSplit($ReadMovie, "|") If $SplitData[1] = $ReadControl Then GUICtrlSetData($TitleInput, $SplitData[1]) GUICtrlSetData($CategoryBox, $CurrentCategory) If $SplitData[2] = 1 Then GUICtrlSetState($FavoritesCheckBox, $GUI_CHECKED) EndIf If $SplitData[3] = "Owned" Then GUICtrlSetState($OwnedCheckBox, $GUI_CHECKED) $StatusOfMovie = "Owned" ElseIf $SplitData[3] = "Want" Then GUICtrlSetState($WantCheckBox, $GUI_CHECKED) $StatusOfMovie = "Want" ElseIf $SplitData[3] = "Loaned" Then GUICtrlSetState($LoanedCheckBox, $GUI_CHECKED) $StatusOfMovie = "Loaned" EndIf GUICtrlSetData($DescriptionInput, $SplitData[4]) ExitLoop EndIf Next $SaveButton = GUICtrlCreateButton("Save", 40, 350, 150, 50) GUICtrlSetOnEvent(-1, "_SaveEditMovie") $CancelButton = GUICtrlCreateButton("Cancel", 405, 350, 150, 50) GUICtrlSetOnEvent(-1, "_CheckCancel") GUISetState() EndIf EndFunc ;==>_EditMovie Func _EditMovieCheckboxSwitcher() $CheckCheckBox = GUICtrlRead($OwnedCheckBox) If $CheckCheckBox = 1 Then GUICtrlSetState($WantCheckBox, $Gui_Unchecked) GUICtrlSetState($LoanedCheckBox, $Gui_Unchecked) $StatusOfMovie = "Owned" EndIf $CheckCheckBox = GUICtrlRead($WantCheckBox) If $CheckCheckBox = 1 Then GUICtrlSetState($OwnedCheckBox, $Gui_Unchecked) GUICtrlSetState($LoanedCheckBox, $Gui_Unchecked) $StatusOfMovie = "Want" EndIf $CheckCheckBox = GUICtrlRead($LoanedCheckBox) If $CheckCheckBox = 1 Then GUICtrlSetState($OwnedCheckBox, $Gui_Unchecked) GUICtrlSetState($WantCheckBox, $Gui_Unchecked) $StatusOfMovie = "Loaned" EndIf EndFunc ;==>_EditMovieCheckboxSwitcher Func _SaveEditMovie() $CheckSave = MsgBox(4, "Check..", "Are you ready to save your movie?") If $CheckSave = 6 Then $ReadData1 = GUICtrlRead($TitleInput) $ReadData2 = GUICtrlRead($CategoryBox) $ReadData3 = GUICtrlRead($FavoritesCheckBox) $ReadData4 = GUICtrlRead($DescriptionInput) $MovieCount = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", $ReadData2) For $i = 1 To $MovieCount[0][0] $SplitData = StringSplit($MovieCount[$i][1], "|") If $SplitData[1] = $ReadData1 Then IniDelete(@ScriptDir & "/Data/Movie Database.ini", $i) IniWrite(@ScriptDir & "/Data/Movie Database.ini", $ReadData2, $i - 1, _ $ReadData1 & "|" & $ReadData3 & "|" & $StatusOfMovie & "|" & $ReadData4) EndIf If $ReadData3 = 1 Then If $AlreadySaved = 0 Then $MovieCount2 = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", "Favorites") IniWrite(@ScriptDir & "/Data/Movie Database.ini", "Favorites", $MovieCount2[0][0], _ $ReadData1 & "|" & $ReadData3 & "|" & $StatusOfMovie & "|" & $ReadData4) $AlreadySaved = 1 EndIf EndIf Next Else Sleep(10) EndIf $AlreadySaved = 0 _GUICtrlListView_DeleteAllItems($MovieListView) _Exit() EndFunc ;==>_SaveEditMovie Func _RemoveMovie() $Index = ControlListView($MainGui, "Movie Database", $MovieListView, "GetSelected") $ReadControl = _GUICtrlListView_GetItemText($MovieListView, 0 + $Index) If $ReadControl = "" Then MsgBox(48, "Error", "Error, no movie selected. Please select a movie first.") Else $CheckMsgBox = MsgBox(4, "Remove", "Are you sure you wish to remove this movie?") If $CheckMsgBox = 6 Then $MovieCount = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", $CurrentCategory) For $i = 0 To $MovieCount[0][0] $SplitData = StringSplit($MovieCount[$i][1], "|") If $SplitData[1] = $ReadControl Then IniDelete(@ScriptDir & "/Data/Movie DataBase.ini", $CurrentCategory, $i - 1) ExitLoop EndIf Next $MovieCount = IniReadSection(@ScriptDir & "/Data/Movie Database.ini", $CurrentCategory) For $i = 1 To $MovieCount[0][0] $OldData[$i] = IniRead(@ScriptDir & "/Data/Movie Database.ini", $CurrentCategory, $i, "NA") If $OldData[$i] = "NA" Then $OldData[$i] = IniRead(@ScriptDir & "/Data/Movie Database.ini", $CurrentCategory, $i + 1, "NA") IniDelete(@ScriptDir & "/Data/Movie Database.ini", $CurrentCategory, $i + 1) EndIf IniDelete(@ScriptDir & "/Data/Movie Database.ini", $CurrentCategory, $i) $Count = $i Next For $i = 1 To $Count - 1 IniWrite(@ScriptDir & "/Data/Movie Database.ini", $CurrentCategory, $i, $OldData[$i]) Next _GUICtrlListView_DeleteAllItems($MovieListView) Else Sleep(10) EndIf EndIf EndFunc ;==>_RemoveMovie Func _CheckCancel() $CheckCancel = MsgBox(4, "Cancel..", "Are you sure you wish to cancel?") If $CheckCancel = 6 Then _Exit() Else Sleep(10) EndIf EndFunc ;==>_CheckCancel Func _Exit() If $CurrentGui = "MainGui" Then $CheckMsgBox = MsgBox(4, "Exit", "Are you sure you wish to exit the program?") If $CheckMsgBox = 6 Then Exit EndIf ElseIf $CurrentGui = "AddMovies" Then GUIDelete($AddMovieGui) $CurrentGui = "MainGui" GUISetState(@SW_ENABLE, $MainGui) WinActivate($MainGui) ElseIf $CurrentGui = "EditMovies" Then GUIDelete($AddMovieGui) $CurrentGui = "MainGui" GUISetState(@SW_ENABLE, $MainGui) WinActivate($MainGui) EndIf EndFunc ;==>_Exit While 1 Sleep(10) WEnd Edited July 14, 2014 by Damein Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic Link to comment Share on other sites More sharing options...
Damein Posted July 14, 2014 Author Share Posted July 14, 2014 A few small updates made. Mistyped "Want" in the GUI. Fixed crash if no movie selected and you click "Edit Movie" Fixed crash if no movie selected and you clock "Remove Movie" Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic Link to comment Share on other sites More sharing options...
Werty Posted July 15, 2014 Share Posted July 15, 2014 Mistyped "Want" in the GUI. It's "Lend Out", not "Loaned Out", if you want to go into details Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
Damein Posted July 15, 2014 Author Share Posted July 15, 2014 (edited) Lol, I may change the typing if I think its going to bother any anal people But nonetheless thank you for pointing it out. Some big changes Added "Drama" genre Added "Family" genre Added "Story" genre Added "Misc" genre Added a total movie count to bottom right (Only for the section you selected) Version 1.5 uploaded to website/sourceforge! Edited July 15, 2014 by Damein Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic Link to comment Share on other sites More sharing options...
Damein Posted July 17, 2014 Author Share Posted July 17, 2014 Updated 7/17/2014: Added in "Add Category" Added in "Remove Category" Optimized how list is populated for use of user defined categories Version 1.6 uploaded to website/sourceforge! Nearly 80 downloads between the two Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now