Sign in to follow this  
Followers 0
NELyon

setting listview settings

6 posts in this topic

#1 ·  Posted (edited)

#include <GUIConstants.au3>
global $number
$Snippets = GUICreate("Snippets", 411, 465, 189, 114)
$List1 = GUICtrlCreateList(INIRead("snippets.ini", "snippets", $number, ""), 0, 0, 409, 292, -1, $WS_EX_CLIENTEDGE)
$Add = GUICtrlCreateButton("Add", 144, 304, 105, 49)
$Clipboard = GUICtrlCreateButton("Clipboard", 144, 400, 105, 49)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Add
    $addbox = InputBox("Add Snippet", "Type in the code you want to save")
    GUICtrlSetData($List1, $addbox)
    INIWrite("snippets.ini", "snippets", $number + 1, $addbox)
    EndSelect
WEnd
Exit

Does anyone know why this won't re-read the stuff in the INI? it will also overwrite the ini each time, replacing 1=anything with 1=other thing and not making a 2=anything

EDIT: I know the clipboard part has no function yet. still in progress

Edited by codemyster

Share this post


Link to post
Share on other sites



#include <GUIConstants.au3>
global $number
$Snippets = GUICreate("Snippets", 411, 465, 189, 114)
$List1 = GUICtrlCreateList(INIRead("snippets.ini", "snippets", $number, ""), 0, 0, 409, 292, -1, $WS_EX_CLIENTEDGE)
$Add = GUICtrlCreateButton("Add", 144, 304, 105, 49)
$Clipboard = GUICtrlCreateButton("Clipboard", 144, 400, 105, 49)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Add
    $addbox = InputBox("Add Snippet", "Type in the code you want to save")
    GUICtrlSetData($List1, $addbox)
    INIWrite("snippets.ini", "snippets", $number + 1, $addbox)
    EndSelect
WEnd
Exit

oÝ÷ ÚÈhºW[y«­¢+Ø)±½°ÀÌØí¹ÕµÈôÄ(

start from there.

btw your working with a listbox not a listview


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

now it does the same thing, but with two. i tried adding this:

;right after the inputbox
$number + 1

but i get a syntax error. also, does anyone know why it won't read the INI?

Edited by codemyster

Share this post


Link to post
Share on other sites

i would suggest researching IniReadSection and adapting that to what your trying to do for the read.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Ok, so i have this. But all it does is return how many keys are in the INI

#include <GUIConstants.au3>
global $number = 1
$var = IniReadSection("snippets.ini", "snippets")
$Snippets = GUICreate("Snippets", 411, 465, 189, 114)
$List1 = GUICtrlCreateList($var[0][0], 0, 0, 409, 292, -1, $WS_EX_CLIENTEDGE)
$Add = GUICtrlCreateButton("Add", 144, 304, 105, 49)
$Clipboard = GUICtrlCreateButton("Clipboard", 144, 400, 105, 49)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Add
    $addbox = InputBox("Add Snippet", "Type in the code you want to save")
    GUICtrlSetData($List1, $addbox)
    INIWrite("snippets.ini", "snippets", $number + 1, $addbox)
    EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites

Now that you've "Glanced" at the IniReadSection

You'll want to read up on For Next


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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