Sign in to follow this  
Followers 0
DjDiabolik

Multi configuration windows...

7 posts in this topic

Hi boys.. i'm new and i have initiated to use AutoIt recently.

Used google and the help in SciTe i still try to make a programs with this programs.

I alredy know how it's possible to read/write information on .ini file and i have created a .ini like this:

[SECTION1]
Value1=xxxxxxx
Value2=yyyyy
Value3=aaaaaaa
Value4=bbbbbb
Value5=rrrrrr
Value6=tttttt

If it's possible i want to obtain a multiconfiguration.... like a listbox how all SECTIONx it's listed and it's possible to chose one of this.

How it's possible to ADD more SECTION or delete it.

Every one SECTIONx it's configurated i want to add the possibily to edit all value in a like inputbox or other thing.

How it's possibly to obtain a similar thing ?

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

A really great tool to edit a ini file is this


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I don't need how create ini file... but i need how can be read multi section from this ini file... and if it's possible to chose one of this from a menù or list of choice.

*EDIT*

Ok... for 1.0 i have decided to not use the multiconfiguration.

I have choose to use single configuration.... this is the code i used:

$Form2 = GUICreate("Menù di Configurazione", 277, 200, 293, 315)
$IPAddress1=IniRead (".\config.ini", "CONFIG", "Ip", "")
$Input1=IniRead (".\config.ini", "CONFIG", "Username", "")
$Input2=IniRead (".\config.ini", "CONFIG", "Password", "")
$Input3=IniRead (".\config.ini", "CONFIG", "HttpPort", "")
$Input4=IniRead (".\config.ini", "CONFIG", "FtpPort", "")

$IPAddress1 = _GUICtrlIpAddress_Create($Form2, 8, 24, 113, 25)
_GUICtrlIpAddress_Set($IPAddress1, "0.0.0.0")
;_GUICtrlIpAddress_Set($IPAddress1)
$Input1 = GUICtrlCreateInput($Input1, 8, 72, 113, 21)
$Input2 = GUICtrlCreateInput($Input2, 8, 120, 113, 21)
$Input3 = GUICtrlCreateInput($Input3, 152, 72, 113, 21)
$Input4 = GUICtrlCreateInput($input4, 152, 120, 113, 21)
$Label1 = GUICtrlCreateLabel("DreamBox IP", 32, 8, 66, 17)
$Label2 = GUICtrlCreateLabel("UserName", 40, 56, 54, 17)
$Label3 = GUICtrlCreateLabel("Password", 40, 104, 50, 17)
$Label4 = GUICtrlCreateLabel("HTTP Port (Default:80)", 152, 56, 113, 17)
$Label5 = GUICtrlCreateLabel("FTP Port (Default:21)", 152, 104, 104, 17)
$Button1 = GUICtrlCreateButton("Salva Configurazione", 72, 160, 113, 33)

Before to load i have read from ini file the configuration........ but i can't found a solution for Ip Address..... it's possibly to import it from ini file like Other value ?

Edited by DjDiabolik

Share this post


Link to post
Share on other sites

DjDiabolik,

You can get a list of the Section titles using IniReadSectionNames. If you put that list into a combo you can then get the user to choose one. Once you have the section title, IniReadSection will pull all of the values listed in that section which you can use to complete your GUI as you wish.

Not too difficult to do - try and code something yourself. You know where we are if you run into problems. :x

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

DjDiabolik,

You can get a list of the Section titles using IniReadSectionNames. If you put that list into a combo you can then get the user to choose one. Once you have the section title, IniReadSection will pull all of the values listed in that section which you can use to complete your GUI as you wish.

Not too difficult to do - try and code something yourself. You know where we are if you run into problems. :x

M23

Ok.. this is for multiselection true ?

And for part of script posted up here ? You can help me how i can show the ip readed from .ini file ?

Edited by DjDiabolik

Share this post


Link to post
Share on other sites

$Input1 = GUICtrlCreateInput($Input1, 8, 72, 113, 21)
$Input2 = GUICtrlCreateInput($Input2, 8, 120, 113, 21)
$Input3 = GUICtrlCreateInput($Input3, 152, 72, 113, 21)
$Input4 = GUICtrlCreateInput($input4, 152, 120, 113, 21)
$Input5 = GUICtrlCreateInput($Input5, 8, 24, 113, 21)
$Label1 = GUICtrlCreateLabel("DreamBox IP", 32, 8, 66, 17)
$Label2 = GUICtrlCreateLabel("UserName", 40, 56, 54, 17)
$Label3 = GUICtrlCreateLabel("Password", 40, 104, 50, 17)
$Label4 = GUICtrlCreateLabel("HTTP Port (Default:80)", 152, 56, 113, 17)
$Label5 = GUICtrlCreateLabel("FTP Port (Default:21)", 152, 104, 104, 17)
$Button1 = GUICtrlCreateButton("Salva Configurazione", 72, 160, 113, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Button1
            call ("StoreCfg")
            GUISetState(@SW_HIDE)
            call ("Menu")
    EndSwitch
WEnd
EndFunc
    
;Storaggio Configurazioni
Func StoreCfg()
IniWrite (".\config.ini", "CONFIG", "Username", $Input1)
IniWrite (".\config.ini", "CONFIG", "Password", $Input2)
IniWrite (".\config.ini", "CONFIG", "HttpPort", $Input3)
IniWrite (".\config.ini", "CONFIG", "FtpPort", $Input4)
IniWrite (".\config.ini", "CONFIG", "Ip", $Input5)
EndFunc

For example.... for now i chose to use it.... because after this the with Iniwrite i obtain ad error....

Variables not declared.... because ?

I have try to add at the start of script the Dim... but after it in the config.ini i not obtain text but all numbers... because ?

Share this post


Link to post
Share on other sites

IniWrite (".\config.ini", "CONFIG", "Username", GUICtrlRead($Input1))
IniWrite (".\config.ini", "CONFIG", "Password", GUICtrlRead($Input2))
IniWrite (".\config.ini", "CONFIG", "HttpPort", GUICtrlRead($Input3))
IniWrite (".\config.ini", "CONFIG", "FtpPort", GUICtrlRead($Input4))
IniWrite (".\config.ini", "CONFIG", "Ip", GUICtrlRead($Input5))

Found solution on help.

@Mod... Close this... i decided to open another thread and posted here every difficulty i found to create this my little programs :x

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