LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 06/08/2009

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

Message 11 of 19
(1,778 Views)

OK, this is my last one (unless there are more improvement suggestions Smiley Wink)  Add improved UP and DOWN arrow detection for when you hold the key down.  It also scrolls when the keys are pressed! Yeah!

 

-Branson

Message 12 of 19
(1,762 Views)

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)

Message 13 of 19
(1,738 Views)

(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.

 

 


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
Message 14 of 19
(1,731 Views)

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

0 Kudos
Message 15 of 19
(1,724 Views)

Hi Ray,

 

I m glad that Darren has already explained my thought. Smiley Happy

 

I have posted here also.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 16 of 19
(1,724 Views)

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.


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 17 of 19
(1,695 Views)

@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

0 Kudos
Message 18 of 19
(1,674 Views)
Good additions, Branson.  "Hide drop down list when there are no matches" had a slight bug.  If you typed and then deleted all your characters, the drop down list was still visible.  See my change in the "Search": Value Change case.  Also, in the same case, I tweaked your empty string array code to demonstrate the Empty Array? primitive.

Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 19 of 19
(1,662 Views)