Jump to content

Check list item


3dude
 Share

Recommended Posts

Hello guys

I have a question for my project

I have gathere some themes fro different CMSs like phpFusion, phpBB and more and I'd like to show some info and screenshot with my software. At the moment I have this:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("CMSDB Theme preview", 482, 433, 483, 183)
$Group1 = GUICtrlCreateGroup("Settings", 8, 8, 465, 193)
$List1 = GUICtrlCreateList("", 16, 48, 169, 136)
GUICtrlSetData(-1, "myBB|phpBB|phpFusion")
$List2 = GUICtrlCreateList("", 288, 48, 169, 136)
$Label1 = GUICtrlCreateLabel("Choose a System", 24, 24, 86, 17)
$Label2 = GUICtrlCreateLabel("and then a theme!", 264, 24, 90, 17)
$Button1 = GUICtrlCreateButton(">>", 216, 80, 41, 33, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Show Info", 200, 160, 75, 25, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Theme Info", 8, 208, 465, 201)
;$Pic1 = GUICtrlCreatePic("", 24, 232, 225, 169, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Label3 = GUICtrlCreateLabel("Theme Name", 256, 304, 68, 17)
$Label4 = GUICtrlCreateLabel("Theme Version", 256, 328, 75, 17)
$Label5 = GUICtrlCreateLabel("Theme Platform", 256, 352, 78, 17)
$Label6 = GUICtrlCreateLabel("File Size", 256, 376, 43, 17)
$Icon1 = GUICtrlCreateIcon("", -1, 264, 240, 49, 49, BitOR($SS_NOTIFY,$WS_GROUP))
$Edit1 = GUICtrlCreateEdit("", 344, 328, 113, 17, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, "Edit1")
$Edit2 = GUICtrlCreateEdit("", 344, 304, 113, 17, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, "Edit1")
$Edit3 = GUICtrlCreateEdit("", 344, 352, 113, 17, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, "Edit1")
$Edit4 = GUICtrlCreateEdit("", 344, 376, 113, 17, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, "Edit1")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
If $nMsg = $Button1 Then
    $menustate = GUICtrlRead($List1)
    IF $menustate = "myBB" Then
    GUICtrlSetData($List2, "")
    GUICtrlSetData($List2, "Theme1|Theme2")
ElseIf $menustate = "phpFusion" Then
    GUICtrlSetData($List2, "")
    GUICtrlSetData($List2, "Ztheme|Xtheme")
ElseIf $menustate = "phpBB" Then
    GUICtrlSetData($List2, "")
    GUICtrlSetData($List2, "RoflCopter|Lmao")
EndIf

EndIf
EndIf    
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd

I am trying to do this >> Selext a system then select a theme and when you click Show Info you get a picture on the left and the info at the right. I am stuck at the part where I have to read $List2 and see what the selection is so I can show info.

I will really appreciate your help and I hope you understand me >_<

View my blog :) 3dude's blog <= help with project :S

Link to comment
Share on other sites

Hi, here's a rough idea..

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("CMSDB Theme preview", 482, 433, 483, 183)
$Group1 = GUICtrlCreateGroup("Settings", 8, 8, 465, 193)
$List1 = GUICtrlCreateList("", 16, 48, 169, 136)
GUICtrlSetData(-1, "myBB|phpBB|phpFusion")
$List2 = GUICtrlCreateList("", 288, 48, 169, 136)
$Label1 = GUICtrlCreateLabel("Choose a System", 24, 24, 86, 17)
$Label2 = GUICtrlCreateLabel("and then a theme!", 264, 24, 90, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Theme Info", 8, 208, 465, 201)
$Pic1 = GUICtrlCreatePic("", 24, 232, 225, 169)
$Label3 = GUICtrlCreateLabel("Theme Name", 256, 304, 68, 17)
$Label4 = GUICtrlCreateLabel("Theme Version", 256, 328, 75, 17)
$Label5 = GUICtrlCreateLabel("Theme Platform", 256, 352, 78, 17)
$Label6 = GUICtrlCreateLabel("File Size", 256, 376, 43, 17)
$Icon1 = GUICtrlCreateIcon("", -1, 264, 240, 49, 49, BitOR($SS_NOTIFY,$WS_GROUP))
$Input1 = GUICtrlCreateInput("", 344, 304, 113, 17)
$Input2 = GUICtrlCreateInput("", 344, 328, 113, 17)
$Input3 = GUICtrlCreateInput("", 344, 352, 113, 17)
$Input4 = GUICtrlCreateInput("", 344, 376, 113, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $List1
            GUICtrlSetImage($Pic1, "")
            GUICtrlSetData($List2, "")
            GUICtrlSetData($Input1, "")
            GUICtrlSetData($Input2, "")
            GUICtrlSetData($Input3, "")
            GUICtrlSetData($Input4, "")
            Switch GUICtrlRead($List1)
                Case "myBB"
                    GUICtrlSetData($List2, "Theme1|Theme2")
                Case "phpBB"
                    GUICtrlSetData($List2, "RoflCopter|Lmao")
                Case "phpFusion"
                    GUICtrlSetData($List2, "Ztheme|Xtheme")
            EndSwitch
        Case $List2
            Switch GUICtrlRead($List2)
                Case "Theme1"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\Theme1.jpg")
                    GUICtrlSetData($Input1, "Theme1")
                    GUICtrlSetData($Input2, "0.0.0.1")
                    GUICtrlSetData($Input3, "Windows 2000")
                    GUICtrlSetData($Input4, "20MB")
                Case "Theme2"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\Theme2.jpg")
                    GUICtrlSetData($Input1, "Theme2")
                    GUICtrlSetData($Input2, "0.0.0.2")
                    GUICtrlSetData($Input3, "Windows XP")
                    GUICtrlSetData($Input4, "200MB")
                Case "Ztheme"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\Ztheme.jpg")
                    GUICtrlSetData($Input1, "Ztheme")
                    GUICtrlSetData($Input2, "1.0.0.1")
                    GUICtrlSetData($Input3, "Windows Vista")
                    GUICtrlSetData($Input4, "200MB")
                Case "Xtheme"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\Xtheme.jpg")
                    GUICtrlSetData($Input1, "Xtheme")
                    GUICtrlSetData($Input2, "1.0.0.2")
                    GUICtrlSetData($Input3, "Windows 7")
                    GUICtrlSetData($Input4, "18MB")
                Case "RoflCopter"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\RoflCopter.jpg")
                    GUICtrlSetData($Input1, "RoflCopter")
                    GUICtrlSetData($Input2, "6.9.6.9")
                    GUICtrlSetData($Input3, "Winblows ME")
                    GUICtrlSetData($Input4, "10MB")
                Case "Lmao"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\Lmao.jpg")
                    GUICtrlSetData($Input1, "Lmao")
                    GUICtrlSetData($Input2, "1.1.1.1")
                    GUICtrlSetData($Input3, "LMFAO")
                    GUICtrlSetData($Input4, "500GB")
            EndSwitch
    EndSwitch
WEnd

Myself I'd probably set all the data and paths to arrays and then loop the arrays to set the data when clicked.

It would make the event handling code shorter and easier to update as new themes are added.

Cheers

Edited by smashly
Link to comment
Share on other sites

I am almost done but I have just one question.

What was the comand fore opening a folder.

I want to have an open button that will open the folder that contains the current selected theme.

Thanks

Hi,

FileSelectFolder()

You can find the function in Autoit Help File -> Function Reference -> File, Directory and Disk Management -> FileSelectFolder()

Post your code when your ready finished and I'll trim it down into arrays if you like.

Cheers

Link to comment
Share on other sites

Hi,

FileSelectFolder()

You can find the function in Autoit Help File -> Function Reference -> File, Directory and Disk Management -> FileSelectFolder()

Post your code when your ready finished and I'll trim it down into arrays if you like.

Cheers

I was talking about this:

when I click "open" it opens the folder which contains the theme(in explorer.exe)

You misunderstood me >_<

But thanks anyway this is useful too

View my blog :) 3dude's blog <= help with project :S

Link to comment
Share on other sites

The code until now:

You will have some missing images but thats not a problem

#NoTrayIcon
#include <IE.au3>
#include <Constants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("CMSDB Theme preview", 482, 450, 483, 183)
$Group1 = GUICtrlCreateGroup("Settings", 8, 8, 465, 193)
$List1 = GUICtrlCreateList("", 16, 48, 169, 136)
GUICtrlSetData(-1, "myBB|phpBB|phpFusion")
$List2 = GUICtrlCreateList("", 288, 48, 169, 136)
$Label1 = GUICtrlCreateLabel("Choose a System", 24, 24, 86, 17)
$Label2 = GUICtrlCreateLabel("and then a theme!", 264, 24, 90, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Theme Info", 8, 208, 465, 201)
$Pic1 = GUICtrlCreatePic("", 24, 232, 225, 169)
$Label3 = GUICtrlCreateLabel("Theme Name", 256, 304, 68, 17)
$Label4 = GUICtrlCreateLabel("Theme Author", 256, 328, 75, 17)
$Label5 = GUICtrlCreateLabel("Theme Platform", 256, 352, 78, 17)
$Label6 = GUICtrlCreateLabel("File Size", 256, 376, 43, 17)
$Icon1 = GUICtrlCreateIcon("", -1, 264, 240, 49, 49, BitOR($SS_NOTIFY,$WS_GROUP))
$Input1 = GUICtrlCreateInput("", 344, 304, 113, 17, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
$Input2 = GUICtrlCreateEdit("", 344, 328, 113, 17, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
$Input3 = GUICtrlCreateInput("", 344, 352, 113, 17, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
$Input4 = GUICtrlCreateInput("", 344, 376, 113, 17, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
$openz = GUICtrlCreateButton("Open", 170, 415, 140)
$blank = ""
$Pic2 = GUICtrlCreatePic(@ScriptDir & "\res\logo.jpg", 260, 220, 200, 75)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Opt("TrayMenuMode",1)   ; Default tray menu items (Script Paused/Exit) will not be shown.
$websiteurl  = TrayCreateItem("Website")
TrayCreateItem("")
$aboutitem  = TrayCreateItem("About")
TrayCreateItem("")
$exititem   = TrayCreateItem("Exit")
TraySetState(1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    $msg = TrayGetMsg()
    
    If $msg = $exititem Then
        Exit
    ElseIf $msg = $aboutitem Then
        MsgBox(1, "About", "CMS Database BG Theme Preview by Headbuster!")
    ElseIf $msg = $websiteurl Then
        _IECreate ("www.cmsdb-bg.com")
    EndIf    
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $List1
            GUICtrlSetImage($Pic1, "")
            GUICtrlSetData($List2, "")
            GUICtrlSetData($Input1, "")
            GUICtrlSetData($Input2, "")
            GUICtrlSetData($Input3, "")
            GUICtrlSetData($Input4, "")
            Switch GUICtrlRead($List1)
                Case "myBB"
                    GUICtrlSetData($List2, "Theme1|Theme2")
                Case "phpBB"
                    GUICtrlSetData($List2, "1thank|1thank green|2unliever|4poziomseo_blue|beta7|ca_black|ca_gen2|envision|pro_iphone|seo|skymiles|starcraft|vistablue|wow")
                Case "phpFusion"
                    GUICtrlSetData($List2, "Ztheme|Xtheme")
            EndSwitch
        Case $List2
            Switch GUICtrlRead($List2)
                Case "1thank"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\1thank\1thank.jpg")
                    GUICtrlSetData($Input1, "1thank")
                    GUICtrlSetData($Input2, "1.0.2.1")
                    GUICtrlSetData($Input3, "gokinstudio.com")
                    GUICtrlSetData($Input4, "782kb")
                    $dir = @ScriptDir & "\phpbb3\1thank\1thank.jpg"
                Case "1thank green"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\1thank_green\1thankgreen.jpg")
                    GUICtrlSetData($Input1, "1thank green")
                    GUICtrlSetData($Input2, "1.0.2")
                    GUICtrlSetData($Input3, "gokinstudio.com")
                    GUICtrlSetData($Input4, "826kb")
                Case "2unliever"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\2unliever\2unilever.jpg")
                    GUICtrlSetData($Input1, "2unliever")
                    GUICtrlSetData($Input2, "3.0.5")
                    GUICtrlSetData($Input3, "gokinstudio.com")
                    GUICtrlSetData($Input4, "656kb")
                Case "4poziomseo_blue"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\4poziomseo_blue\4poziomSEO.jpg")
                    GUICtrlSetData($Input1, "4poziomseo_blue")
                    GUICtrlSetData($Input2, "3.0.5")
                    GUICtrlSetData($Input3, "gokinstudio.com 7")
                    GUICtrlSetData($Input4, "695kb")
                Case "beta7"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\beta7\beta7.jpg")
                    GUICtrlSetData($Input1, "beta7")
                    GUICtrlSetData($Input2, "1.0.1")
                    GUICtrlSetData($Input3, "TRX")
                    GUICtrlSetData($Input4, "1.12mb")
                Case "ca_black"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\ca_black\ca_black.jpg")
                    GUICtrlSetData($Input1, "ca_black")
                    GUICtrlSetData($Input2, "1.0.6")
                    GUICtrlSetData($Input3, "stsoftware.com")
                    GUICtrlSetData($Input4, "228kb")
                Case "ca_gen2"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\ca_gen2\ca_gen.jpg")
                    GUICtrlSetData($Input1, "ca_gen2")
                    GUICtrlSetData($Input2, "1.0.6")
                    GUICtrlSetData($Input3, "stsoftware.com")
                    GUICtrlSetData($Input4, "221kb")
                Case "envision"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\envision\envision.jpg")
                    GUICtrlSetData($Input1, "envision")
                    GUICtrlSetData($Input2, "3.0.5")
                    GUICtrlSetData($Input3, "AkAnsu")
                    GUICtrlSetData($Input4, "246kb")
                Case "pro_iphone"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\pro_iphone\pro_iphone.jpg")
                    GUICtrlSetData($Input1, "pro_iphone")
                    GUICtrlSetData($Input2, "1.0.0")
                    GUICtrlSetData($Input3, "Samurai Design")
                    GUICtrlSetData($Input4, "504kb")
                Case "seo"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\seo\seo.jpg")
                    GUICtrlSetData($Input1, "seo")
                    GUICtrlSetData($Input2, "3.0.5")
                    GUICtrlSetData($Input3, "gokinstudio.com")
                    GUICtrlSetData($Input4, "705kb")
                Case "skymiles"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\skymiles\skymile.jpg")
                    GUICtrlSetData($Input1, "skymiles")
                    GUICtrlSetData($Input2, "1.0.1")
                    GUICtrlSetData($Input3, "msi_333")
                    GUICtrlSetData($Input4, "234kb")
                Case "starcraft"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\Lmao.jpg")
                    GUICtrlSetData($Input1, "starcraft")
                    GUICtrlSetData($Input2, "1.8")
                    GUICtrlSetData($Input3, "Ron2K, blackraven007")
                    GUICtrlSetData($Input4, "217kb")                
                Case "vistablue"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\Lmao.jpg")
                    GUICtrlSetData($Input1, "vistablue")
                    GUICtrlSetData($Input2, "1.0.0")
                    GUICtrlSetData($Input3, "Samurai Design")
                    GUICtrlSetData($Input4, "836kb")                
                Case "wow"
                    GUICtrlSetImage($Pic1, @ScriptDir & "\phpbb3\wow\wow.jpg")
                    GUICtrlSetData($Input1, "wow")
                    GUICtrlSetData($Input2, "3.0.5 ")
                    GUICtrlSetData($Input3, "Moonclaw")
                    GUICtrlSetData($Input4, "687kb")
                
            EndSwitch
        EndSwitch
WEnd

View my blog :) 3dude's blog <= help with project :S

Link to comment
Share on other sites

Hi again,

Here's your code back.

I tried to make it not hard coded paths and names so you don't have to change the code everytime a system or theme is is added.

This way you can create any amount of directories with any name and in that directory have as many theme folders as you like.

This way the Gui will load what it see's.

So you can spend your time getting your theme directories in order instead of worrying about editing your code every time a file or directory is changed or added.

What it does now is looks in the $ThemesPath directory (Currently set as @ScriptDir & "\").

Any folders in the $ThemesPath directory it sees the name will be added to List1.

In each folder it finds it will look for folders and uses the name of the folder as a theme name in List2

In each theme folder you will need an image the same name as the theme folder name, this image is what's used for that theme.

Also in each theme folder you will need an Info.ini

Info.ini must be in this format.

[INFO]
Name=
Author=
Platform=
Version=
Size=

The info.ini in each theme folder is used to diplay info in the Info fields of the Gui.

So an example of the directory structure on you harddrive would look something like this.

$ThemesPath\phpBB\1thank\1thank.jpg

$ThemesPath\phpBB\1thank\Info.ini

$ThemesPath\phpBB\1thank green\1thank green.jpg

$ThemesPath\phpBB\1thank green\Info.ini

$ThemesPath\phpFusion\Ztheme\Ztheme.jpg

$ThemesPath\phpFusion\Ztheme\Info.ini

$ThemesPath\phpFusion\Xtheme\Xtheme.jpg

$ThemesPath\phpFusion\Xtheme\Info.ini

etc..

The open button will open at the selected directory in explorer.

So if you have nothing selected in List1 it would open explorer at the $ThemesPath directory.

If you have an item in List1 selected but nothing in List2 selected then it would open explorer at the $ThemesPath\List1 directory

If you have an item in List2 selected then it would open explorer at the $ThemesPath\List2 directory

Let me know how it goes and Have fun...

#include <Constants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#NoTrayIcon

Opt("MustDeclareVars", 1)
Opt("TrayMenuMode", 1)


Global $ThemesPath = @ScriptDir & "\" ; <-- Set this to the folder where your system/theme directories are.
Global $hGui, $List1, $List2, $Pic1, $aInfo[5] = ["Name", "Author", "Platform", "Version", "Size"]
Global $GCR1, $GCR2, $Open, $OpenPath, $SS1, $SS2, $SS3, $SSI, $Image, $nMsg, $msg
Global $websiteurl, $aboutitem, $exititem
Global $aList = _GetThemes($ThemesPath)

$hGui = GUICreate("CMSDB Theme preview", 482, 450, 483, 183)
GUICtrlCreateGroup("Settings", 8, 8, 465, 193)
GUICtrlCreateLabel("Choose a System", 24, 24, 86, 17)
GUICtrlCreateLabel("Select a theme", 288, 24, 90, 17)
$List1 = GUICtrlCreateList("", 16, 48, 169, 136)
GUICtrlSetData(-1, $aList[0][0])
$List2 = GUICtrlCreateList("", 288, 48, 169, 136)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("Theme Info", 8, 208, 465, 201)
$Pic1 = GUICtrlCreatePic("", 24, 232, 225, 169)
For $i = 0 To UBound($aInfo) - 1
    GUICtrlCreateLabel("Theme " & $aInfo[$i], 260, ($i * 32) + 240, 78, 17)
    $aInfo[$i] = GUICtrlCreateInput("", 344, ($i * 32) + 240, 113, 17, BitOR($ES_READONLY, $ES_AUTOHSCROLL))
    GUICtrlSetBkColor(-1, 0xFFFFFF)
Next
$Open = GUICtrlCreateButton("Open", 170, 415, 140)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW, $hGui)

$websiteurl = TrayCreateItem("Website")
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")
TraySetState(1)

While 1
    $nMsg = GUIGetMsg()
    $msg = TrayGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $List1
            $GCR2 = ""
            GUICtrlSetData($List2, "")
            GUICtrlSetImage($Pic1, "")
            For $i = 0 To 4
                GUICtrlSetData($aInfo[$i], "")
            Next
            $GCR1 = GUICtrlRead($List1)
            For $i = 1 To UBound($aList, 1) - 1
                If $GCR1 = $aList[$i][0] Then
                    GUICtrlSetData($List2, $aList[$i][1])
                    ExitLoop
                EndIf
            Next
        Case $List2
            $GCR2 = GUICtrlRead($List2)
            For $i = 1 To UBound($aList, 1) - 1
                If $GCR1 = $aList[$i][0] Then
                    $SS1 = StringSplit($aList[$i][1], "|")
                    $SS2 = StringSplit($aList[$i][2], "|")
                    $SS3 = StringSplit($aList[$i][3], Chr(128))
                    For $j = 0 To $SS1[0]
                        If $GCR2 = $SS1[$j] Then
                            Local $Image = $SS2[$j]
                            If Not FileExists($Image) Then $Image = ""
                            GUICtrlSetImage($Pic1, $Image)
                            $SSI = StringSplit($SS3[$j], Chr(0), 2)
                            For $k = 0 To UBound($SSI) - 1
                                GUICtrlSetData($aInfo[$k], $SSI[$k])
                            Next
                            ExitLoop
                        EndIf
                    Next
                EndIf
            Next
        Case $Open
            $OpenPath = $ThemesPath & $GCR1
            If $GCR2 Then $OpenPath = $ThemesPath & $GCR1 & "\" & $GCR2
            ShellExecute("explorer.exe", "/e," & $OpenPath)
    EndSwitch
    Switch $msg
        Case $exititem
            Exit
        Case $aboutitem
            MsgBox(1, "About", "CMS Database BG Theme Preview by Headbuster!")
        Case $websiteurl
            ShellExecute("www.cmsdb-bg.com")
    EndSwitch
WEnd

Func _GetThemes($sPath)
    Local $a_List1, $a_List2, $aRet[1][4]
    $a_List1 = _FileListToArray($sPath, "*", 2)
    If Not @error Then
        ReDim $aRet[$a_List1[0] + 1][4]
        For $i = 1 To $a_List1[0]
            $aRet[0][0] &= $a_List1[$i] & "|"
            $aRet[$i][0] = $a_List1[$i]
            $a_List2 = _FileListToArray($sPath & $a_List1[$i], "*", 2)
            If Not @error Then
                For $j = 1 To $a_List2[0]
                    $aRet[$i][1] &= $a_List2[$j] & "|"
                    $aRet[$i][2] &= $sPath & $a_List1[$i] & "\" & $a_List2[$j] & "\" & $a_List2[$j] & ".jpg" & "|"
                    For $k = 0 To UBound($aInfo) - 1
                        $aRet[$i][3] &= IniRead($sPath & $a_List1[$i] & "\" & $a_List2[$j] & "\" & "Info.ini", "INFO", $aInfo[$k], "") & Chr(0)
                    Next
                    $aRet[$i][3] = StringTrimRight($aRet[$i][3], 1)
                    $aRet[$i][3] &= Chr(128)
                Next
                $aRet[$i][1] = StringTrimRight($aRet[$i][1], 1)
                $aRet[$i][2] = StringTrimRight($aRet[$i][2], 1)
                $aRet[$i][3] = StringTrimRight($aRet[$i][3], 1)
            EndIf
        Next
        $aRet[0][0] = StringTrimRight($aRet[0][0], 1)
    EndIf
    Return $aRet
EndFunc   ;==>_GetThemes

Cheers

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...