Jump to content

Alternative to _ArrayDisplay


saywell
 Share

Recommended Posts

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

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

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

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

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

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 by saywell
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...