Jump to content
Sign in to follow this  

help with opening .ini data into a listview box

Recommended Posts


the title explains my sitution.. i guess this MIGHT be a double post if so i am sorry "see gui help for my SAVEING to ini post" now im having trouble loading from an ini into a listiewbox.... i got this code that i got some VERY usefull help in puting togther

;This is made by BOB
;(bob00037 on the autoitforums)
; This script Is An Information Organizer For The Not Very Widely Known MMORPG Endless Online;
#include <GuiConstantsEx.au3>
#Include <GuiListView.au3>
#include <ButtonConstants.au3>
#include <GuiConstants.au3>

If FileExists("C:\guildinfo\Guild.ini") Then
    MsgBox(64,"no", "Does NOT exists")
    IniWrite("C:\GUILDINFO\Guild.ini", "Help", "#", "*****this is a help guide on the controlls of GI******                                                                                                                                                                                      #[For Each editbox hitting ENTER will call a function]                                            #[top right [X]=exit\OR\ ALT+f4=exit]                                                                         #[CANNOT edit the list box BUT just add a member then Delete it when you need to edit it, then ad again]                                                                                         #[DO NOT change the directory outputs (i have not designed it to be user friendly)]")
    IniWrite("C:\guildinfo\Guild.ini", "Personal", "#Text", "0")
    IniWrite("C:\guildinfo\Guild.ini", "CurrentMembers", "#Current", "0")
    iniwrite("C:\guildinfo\Guild.ini", "OldMembers", "#Old", "0")
    IniWrite("C:\guildinfo\Guild.ini", "Rules", "#Rule", "0")
    MsgBox(64,"NOW", "it exists")
#region ; GLOBAL VARS
Global $GUI, $Pdt, $PSv, $Ldbtn, $Pdtdr, $INIp, $OpnDrb, $OpnDrI, $hlp, $INIh,$Delcm, $AdRcm, $Adrcm2, $Addcm, $listview, $Listview2, $INIcm, $Cmdt, $Cmld, $listedit, $CmSv, $Cmsv2, $CmLd, $CmLd2, $Cmcount, $Cmmemup, $CmMemCount, $Cmupdate

#region; GUI
$GUI = GuiCreate("GI    (Guild Information)   VERSION 0.00004", 400, 400)
GuiSetIcon(@SystemDir & "\mspaint.exe", 0)

#Region ; PIC
GuiCtrlCreatePic("guild.bmp",0,0, 399,79)

#Region ; Personal TAB
GuiCtrlCreateTab(0, 80)

Func _vars()
    $PSv = GuiCtrlCreateButton("SAVE", 0, 360, 400, 20); The "save" button on the personal tab
    $OpnDrB = GuiCtrlCreateButton("OPEN DIR", 300, 315, 100, 20);  The "OPEN" button on the personal tab
    $Ldbtn = GUICtrlCreateButton("LOAD", 300, 335,100,20); The "load" button on the personal tab
    $hlp = GUICtrlCreateButton("HELP", 200, 380, 200,20); HELP button for the help file
    $Pdtdr = GUICtrlCreateInput("C:\guildinfo\guild.ini", 0, 335, 300, 20); The DIRECTORY input for LOAD on the personal tab
    $Pdt = GUICtrlCreateEdit(" ", 0, 130, 400, 175, 0x0004);The BIG input on the personal tab
    $OpnDrI = GUICtrlCreateInput("C:\guildinfo", 0, 315, 300, 20); The DIRECTORY input for OPEN DIR on the personal tab
    $INIp = IniRead("Guild.ini", "personal", "#text", ""); The [personal] .ini text readback call
    $INIh = IniRead("Guild.ini", "Help", "#", ""); The [help] .ini text readback call

GuiCtrlCreateDate("", 0, 380, 200, 20)

#Region ;Guild TAB
GuiCtrlCreateTab(0, 80)

#Region ; DATE
GuiCtrlCreateDate("", 0, 380, 200, 20)

Func _vars2()
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)  ; to allow drag and dropping
    $CmMemCount = GUICtrlCreateEdit("0", 0, 130, 224, 20)
    $Adrcm = GuiCtrlCreateInput("Name|0|0|0|0", 0, 110, 224, 20)
    $Delcm = GuiCtrlCreateButton("Delete", 306, 110, 80, 20)
    $Addcm = GuiCtrlCreateButton("Add ", 226, 110, 80, 20)
    $listview = GuiCtrlCreateListView("Member|Rank|Warnings|Test Taken|Gone", 0, 150, 399, 200, BitOR($LVS_EDITLABELS, $LVS_EX_GRIDLINES))
    $Listview2 = GUICtrlRead($listview)
    $Adrcm2 = GUICtrlRead( $Adrcm )
    $CmSv = GUICtrlCreateButton("SAVE", 0, 360, 197, 18)
    $Cmsv2 = FileSaveDialog("SAVE", "C:\GUILDINFO\", "(*.ini*)", "guild.ini", "guild.ini")
    $Cmld = GUICtrlCreateButton("LOAD", 198, 360, 200, 18)
    $Cmupdate = GUICtrlCreateButton("UPDATE", 226,130,160,20)
    $CMmemup = IniRead("guild.ini", "CurrentMembers", "Itemcount", "default")


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case $PSv
            Iniwrite("guild.ini", "personal", "#text", GUICtrlRead($Pdt))
        Case $Ldbtn
            GUICtrlSetData ( $Pdt, $INIp )
        Case $OpnDrB
            MsgBox( 0, "OPEN?", "UDF Directory" )
        Case $hlp
            MsgBox(0,"Help?", "UDF file",GUICtrlRead($Pdtdr))
            GUICtrlSetData ( $Pdt, $INIh )
        Case $Addcm
            GUICtrlCreateListViewItem( GUICtrlRead( $Adrcm ), $listview)
        Case $Delcm
        Case $CmSv
             if FileExists($cmsv2) then IniDelete($cmsv2,"CurrentMembers")
            For $n = 0 To _GUICtrlListView_GetItemCount($listview) - 1
                $Itemtext = _GUICtrlListView_GetItemText($listview, $n)
                For $p = 1 To 5;for each column
                    $Itemtext &= '|' & _GUICtrlListView_GetItemText($listview, $n,$p)
        Case $CmLd
            $NoItems = Number(IniRead($cmsv2,"listviewitems","ItemCount",""))
            For $n = 1 to $NoItems
            GUICtrlCreateListViewItem( (IniRead($cmsv2,"listviewitems", $n,""), $listview)
        Case $Cmupdate
            GUICtrlSetData( $CmMemCount, $Cmmemup)

that is the code for my entire GUI... any mistakes you guys can see?

Edited by bob00037

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