Seminko Posted May 7, 2014 Posted May 7, 2014 Hey fellas, I'm working on a script that will hopefully be used one day in the company I work for. Now, there are multiple teams that work with the same system. What I need to do is to allow every user to save his own set of predefined clicks. Let's say there are 6 buttons in the software - A, B, C, D, E and F and everyone clicks those buttons in a different order. I imagine a GUI with a combobox with two predefined sequences but with a save button somewhere near to allow the user to manually click the sequence representation in the GUI and save it under a name that he defines. This new preset would then appear in the combobox. The thing is I have no idea how to get this done in autoit. Am I playing with fire or is it not that hard? Thank you for any help I can get.
JohnOne Posted May 7, 2014 Posted May 7, 2014 (edited) It's not difficult at all, you just need to decide how you will save the data across restarts. For what you say, I believe an ini file will suffice. Look at iniread() and iniwrite functions. Edited May 7, 2014 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Seminko Posted May 11, 2014 Author Posted May 11, 2014 The *.ini worked perfectly but as I'm not that skilled with GUI I need additional help. Let's say I have two combo-boxes and several images (icons). What I need is when an image is clicked a combo-box gets updated. That wouldn't be that hard BUT a specific combo-box need to be updated, not both of them. I imagine users clicking into a combo box they want to update and then clicking an icon and ONLY the combo-box selected would get updated. Is that something that could be done?
Moderators Melba23 Posted May 11, 2014 Moderators Posted May 11, 2014 Seminko,Yes, it is perfectly possible. But rather than post simple questions (perhaps in the hope that some one will write the code for you ), why not post what code you have already so we can get a better idea of what you are trying to do and can then offer more focused assistance. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Seminko Posted May 11, 2014 Author Posted May 11, 2014 (edited) Seminko, Yes, it is perfectly possible. But rather than post simple questions (perhaps in the hope that some one will write the code for you ), why not post what code you have already so we can get a better idea of what you are trying to do and can then offer more focused assistance. M23 Hey Melba, actually quite the opposite. I'm looking for a direction to implement into my script, not the code itself. I found that is the best way to learn, rathen then copying a script and pasting it into my project. To the point, I re-done the GUI and now I face another problem. I have multiple combo-boxes which are linked with GUICtrlRead($Combo1) to the *.ini file. Now, the *.ini file does not work with spaces but obviously I want the text in the combo-boxes to have spaces. Any clean way to get around that? Thx EDIT: Oh comooon... ini can have spaces? lol :-D Edited May 11, 2014 by Seminko
Moderators Melba23 Posted May 11, 2014 Moderators Posted May 11, 2014 Seminko,My comment was "tongue-in-cheek" - do not take it personally. But commenting on some code is always much more likely to be productive than making suggestions which might, or might not, be suitable for any specific case. As to the "space / no_space" problem - just replace the spaces when you store the data and restore them when you recall it. StringReplace is the function you need - and the italicised section at the beginning of this paragraph an example of how it might work . M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Seminko Posted May 11, 2014 Author Posted May 11, 2014 As per above, iniread etc does not have a problem with spaces. Another issue --> Is there a function that would feed the ini sections into a combo box? I tried IniReadSectionNames but that does not work or I don't use it properly.
Moderators Melba23 Posted May 11, 2014 Moderators Posted May 11, 2014 Seminko,I seem to remember that you can have spaces in the "value" part of an ini entry - it is the "key" part that needs to be a single item. IniReadSectionNames returns an array - you need to convert it to a delimited string to get the list into a combo. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Seminko Posted May 11, 2014 Author Posted May 11, 2014 IniReadSectionNames returns an array - you need to convert it to a delimited string to get the list into a combo. How do I do that pls?
Moderators Melba23 Posted May 11, 2014 Moderators Posted May 11, 2014 Seminko,Just loop through the array and concatenate the elements to a string - do not forget to add the delimiters. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Seminko Posted May 11, 2014 Author Posted May 11, 2014 Seminko, Just loop through the array and concatenate the elements to a string - do not forget to add the delimiters. M23 No idea how to do that... trying to goole it...
Moderators Solution Melba23 Posted May 11, 2014 Moderators Solution Posted May 11, 2014 Seminko,Like this: Global $aArray[5] = [0, 1, 2, 3, 4] $sString = "" For $i = 0 To UBound($aArray) - 1 $sString &= "|" & $aArray[$i] Next MsgBox(0, "String", $sString)M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Seminko Posted May 11, 2014 Author Posted May 11, 2014 (edited) Seminko, Like this: Global $aArray[5] = [0, 1, 2, 3, 4] $sString = "" For $i = 0 To UBound($aArray) - 1 $sString &= "|" & $aArray[$i] Next MsgBox(0, "String", $sString) M23 I figured it out. But I have two issues. First off the combo now correctly shows the section names but as the first entry there is the section count. I do not want that. EDIT: It says this: |3|Icon1|Icon2|Icon3| The first '3' should not be there... how do I get rid of it? Edited May 11, 2014 by Seminko
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now