Sign in to follow this  
Followers 0
brad25

gui help

6 posts in this topic

Hi i need a little help im wanting to be able to type a word in the input hit start and it puts the word in the edit box. and i have the options to add 1 and 2 to the beginning and end of the word so if both options are check and test was typed in the input it should say 1test1 2test2 but in a row. also how can i load a premade list from a txt file to run the options ty.

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=c:\documents and settings\bryan theard\desktop\form2.kxf
$Form2 = GUICreate("Form2", 413, 378, 303, 219)
$Edit1 = GUICtrlCreateEdit("", 80, 40, 249, 169)
GUICtrlSetData(-1, "Edit1")
$Button1 = GUICtrlCreateButton("Start", 72, 336, 81, 25, 0)
$Button2 = GUICtrlCreateButton("Exit", 256, 335, 81, 25, 0)
$Input1 = GUICtrlCreateInput("", 120, 224, 177, 21)
$Button3 = GUICtrlCreateButton("Load", 163, 335, 81, 25, 0)
$Checkbox1 = GUICtrlCreateCheckbox("Puts a 1 in front and behind", 128, 264, 161, 25)
$Checkbox2 = GUICtrlCreateCheckbox("Puts a 2 in front and behind", 127, 286, 161, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

EndSwitch
WEnd

Share this post


Link to post
Share on other sites



brad25,

- Use GUICtrlRead to get the contents of the input.

- Then you will need a couple of If structures to look to see if the Checkboxes are checked (you use GUICtrlRead here as well). In each of the structures, you will need to concatenate (add strings together) using the & operator.

- Finally you will need to put the entire string into the Edit using GUICtrlSetData.

All of these commands are very well expained, with examples, in the Help file. Give a go yourself - you know where we are if you run into difficulties. :)

Loading a premade list file can be done in a number of ways. You can use an ini file (lots of Ini* commands in AutoIt), _FileReadToArray which gives you a array of the file lines, or plain old FileRead/FileReadLine where you will probably have to do a fair amount of work to get the content as you might wish. Can you be a bit more specific about what you are trying to do - it is difficult to offer more than general advice at the moment? ;)

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

maybe i should use 2 edit boxes load the list into one then get it to add the 1's in the 2nd one. and i was useing GUICtrlRead but i couldnt get it to work. and what im tryimg to accomplish is make a new list of word by picking different options like adding 1 to front and behind the word

Share this post


Link to post
Share on other sites

brad25,

I would use List rather than Edit controls in that case - much easier to make a selection in a list. ;)

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

brad25,

I would use List rather than Edit controls in that case - much easier to make a selection in a list. ;)

M23

ok will do and how can i make guictrlread put it from the input to the list?

Share this post


Link to post
Share on other sites

brad25,

how can i make guictrlread put it from the input to the list?

You use GUICtrlRead to get the value from the input and then GUICtrlSetData to put it in another control like the List. ;)

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

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