saywell Posted February 12, 2011 Share Posted February 12, 2011 I'm currently using array display to work with SQLite queries. If the query returns more than one result, it's displayed by -arraydisplay [ 2d array]. The user than reviews the content and chooses which of the entries to use. This is done by selecting the row then copying to clipboard then closing the arraydisplay window. This is quite a clunky process, though it works well, and I'm looking for a more elegant alternative - but preferably doesn't involve creating extra GUIs. Any suggestions, team? Thanks, William Link to comment Share on other sites More sharing options...
Bowmore Posted February 12, 2011 Share Posted February 12, 2011 It seems to me that what you need to do is re-write your SQL query so that it only returns what you are interested in. You could then pass the returned data directly to wherever it is needed. "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
hannes08 Posted February 12, 2011 Share Posted February 12, 2011 Hi saywell, it seems what you want is another possibility to display the results. You could, for example, create a new GUI with a listview or a combobox. Regards, Hannes Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
saywell Posted February 12, 2011 Author Share Posted February 12, 2011 Thanks, @Bowmore: the query returns >1 valid results - but only the user has the information to know which is the one required, from which to import the data. Actually, it's doctors surgery addresses, where one Dr can work from >1 surgery. The user has the referral letter to know which surgery to send the reply letter to, then selects it to import the full address into the rtf. @Hannes123 - I was hoping to avoid a custom built GUI but that may be the best way... Regards, William Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 13, 2011 Moderators Share Posted February 13, 2011 saywell,Have you thought about using a ListView to display the results? My GUIListViewEx UDF would allow you to get the data into a ListView painlessly and a doubleclick on the correct line would get the data from that line. A bit less clunky than the process you described earlier. If you could give me a sample of the data that you are sending to the _ArrayDisplay I could run up a short demo for you. 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  Link to comment Share on other sites More sharing options...
saywell Posted February 14, 2011 Author Share Posted February 14, 2011 (edited) [edit]duplicate post but delete failed Edited February 14, 2011 by saywell Link to comment Share on other sites More sharing options...
saywell Posted February 14, 2011 Author Share Posted February 14, 2011 (edited) saywell, If you could give me a sample of the data that you are sending to the _ArrayDisplay I could run up a short demo for you. M23 Thanks, M23. I'd thought of listboxes, but haven't ventured into that territory yet. Maybe your udf will pilot me into these uncharted [for me] waters! I've attached a screenshot of a typical result - SQLite search on the Gpcode showing the 2 surgeries he works at. User selects the one from which the original referral letter was sent from, copies to clipboard and closes _arraydisplay to continue. The actual display is fine - the ideal would be to have the same, but with an OK/cancel box, and perhaps a bit of space for instructions. Regards, William PS my script uses On Event Mode - if that makes any difference. Edited February 14, 2011 by saywell Link to comment Share on other sites More sharing options...
saywell Posted February 14, 2011 Author Share Posted February 14, 2011 Another thought - perhaps I could modify the _ArrayDisplay function slightly - change the wording of the copy to clipboard button and get it to return with the string that would have gone to the clipboard at that point? W. Link to comment Share on other sites More sharing options...
Mat Posted February 14, 2011 Share Posted February 14, 2011 Have you looked at the code for _ArrayDisplay?? All it's doing is making another GUI. There is no magic involved at all. To modify the text on the button would be a simple job, and to change what happens when it's clicked is pretty simple too. However, you are much better off making the GUI yourself. Use the _ArrayDisplay dialog as a template, but if you make a listview yourself you can control all sorts of other things like context menus and double clicking items. You could also set the column headers to be a bit more descriptive. If you are trying to make a good program then copy and paste _ArrayDisplay and rename it _ResultsDisplay and modify till it does exactly what you want. Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
saywell Posted February 14, 2011 Author Share Posted February 14, 2011 Mat, yes, I've been doing just that - added a copy of the _ArrayDisplay function to my test script, with a new name. I've already altered the button text and set it to return the selected value when clicked, so I think this is the way to go. Will only need minimal tweaking. The column headers come from the SQlite function, and I'm happy with them. However, I need to have a fiddle with some listview work, for future reference and my own edification! Thanks, all for your help and suggestions. william Link to comment Share on other sites More sharing options...
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