06-11-2009 11:39 AM
Here are those changes, plus a few extra. Thanks for the tips btw. Press ENTER will place highlighted entry in the Search field. Press ESC will hide the box. Press arrow UP or DOWN to change the value (but it doesn't scroll, don't know why?)
-Branson
06-11-2009 01:41 PM
OK, this is my last one (unless there are more improvement suggestions ) Add improved UP and DOWN arrow detection for when you hold the key down. It also scrolls when the keys are pressed! Yeah!
-Branson
06-11-2009 05:08 PM
Couple of simple enhancements:
- "Discard?" is set for the arrow keys so that the cursor doesn't move in the string (Key Down?/Key Repeat?)
- The selected item is now only changed or updated if the cursor is "In bounds" (i.e. not on the scroll bar) in the listbox (Mouse Move/Mouse Up)
06-11-2009 05:39 PM
(Thanks for posting.)
Pressing Escape to remove drop down list followed by Enter / Return produced the default item in the list, regardless of what was typed in the string control. Since this was compared to search engine behavior, I've added to GregS's changes the ability to have "undefined values". If this were ported to XControl, obviously the implementation could be custom.
06-11-2009 10:51 PM
Branson wrote:
As always, I am open to critiquing
Here's a question to the community, and possibly a critique. The event structure has a timeout of 50msec, but no code in the timeout case. Would it be appropriate to simply have a -1 (or no input) to the timeout of the event structure? Would it be more efficient to have an event structure that does not timeout? In that case, is it more efficient to not even register the timeout case?
Functionally, there is no difference in operation. Realistically, you may save .0000001% CPU. But bottom line... is it more efficient to not timeout?
Regards,
Jack
06-11-2009 11:07 PM
Hi Ray,
I m glad that Darren has already explained my thought.
I have posted here also.
06-12-2009 07:53 AM
Jack,
In this case you could change the timeout to -1 and add an event case to catch the Stop value change and stop the loop that way. While it would also save a 50 ms hit on the processor, for me the bigger advantage is that using the value change event makes the loop easier to debug (e.g. probing which events are firing) since it isn't free-wheeling.
06-12-2009 10:27 AM
@GregS, Thanks for the tips, I am still learning LabVIEW and didn't know what "Discard?" actually did. "In bounds" is very helpful too because it would highlight the line when I was dragging the scroll bar.
@LabBEAN, Thanks for the added features to make the control feel more compatible, and "undefined values" are needed.
I've done some more tweaking and added ...
- Close button to the right of the Search field (functions the same as the ESC key)
- Keys added (PageUp, PageDown, Home, End)
- Selectable max rows to be displayed on the pull down list
- Resizing the rows when there are fewer results than the max rows
- Hide drop down list when there are no matches
Thanks again for all the responses and tweaks,
-Branson
06-12-2009 11:27 AM