NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Branson
Posts: 54

Re: 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

Member
Branson
Posts: 54

Re: Darren's Weekly Nugget 06/08/2009

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

 

-Branson

Active Participant
GregS
Posts: 478

Re: Darren's Weekly Nugget 06/08/2009

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)

Active Participant
LabBEAN
Posts: 340

Re: Darren's Weekly Nugget 06/08/2009

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

 

 

Trusted Enthusiast
JackDunaway
Posts: 2,445
0 Kudos

Re: Darren's Weekly Nugget 06/08/2009


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

Wirebird Labs: Expert Toolkits for LabVIEWDeploy, by Wirebird Labs: Expert Toolkits for LabVIEW
Trusted Enthusiast
parthabe
Posts: 2,458
0 Kudos

Re: Darren's Weekly Nugget 06/08/2009

Hi Ray,

 

I m glad that Darren has already explained my thought. :smileyhappy:

 

I have posted here also.


Re-cLAD,
Partha.

Havells - Wires that don't catch fire!
LabVIEW - Wires that catch bugs!
Active Participant
LabBEAN
Posts: 340
0 Kudos

Re: Darren's Weekly Nugget 06/08/2009

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.

Member
Branson
Posts: 54
0 Kudos

Re: Darren's Weekly Nugget 06/08/2009

@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

Active Participant
LabBEAN
Posts: 340
0 Kudos

Re: Darren's Weekly Nugget 06/08/2009

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.
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page