Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.* 2 > Newsgroup comp.lang.labview

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 07-21-2008, 01:10 PM
lmtis
Guest
 
Posts: n/a
Default Re: Nugget of the week: Dynamic event registration

Ton, I am a bit confused by this.  In your advanced example, two of the events are on a ref constant.  How can you have an event on a ref constant?  I thought that I understood what you were doing by registering a constant, you were turning off an event.  I am trying to write a VI that allows a user to click and drag a data point on a graph.  My intention is that on mouse up, the cursor is placed on a data point.  If the cursor is on the correct data point, the user then could click and drag (mouse move enable) the y axis value of the point.  Upon mouse up, the drag (mouse move) would be disabled again.


MouseEvents3.png:
http://forums.ni.com/attachments/ni/...useEvents3.png


MouseEvents1.png:
http://forums.ni.com/attachments/ni/...useEvents1.png


MouseEvents2.png:
http://forums.ni.com/attachments/ni/...useEvents2.png
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 07-21-2008, 01:10 PM
Ben
Guest
 
Posts: n/a
Default Re: Nugget of the week: Dynamic event registration

Hi Jim,
As I understand Ton's example the re-registration of an event to a contant cancels the previous registration, effectivle shutting it off.
Ben
Reply With Quote
  #3 (permalink)  
Old 07-21-2008, 01:40 PM
lmtis
Guest
 
Posts: n/a
Default Re: Nugget of the week: Dynamic event registration

Hi Ben, that was my understanding of the gist of his posting, and that is what I am trying to do.  What I don't understand from his picture are the two events on a constant (see attached).  I also don't understand why mine is not working.


DynamicEvents.png:
http://forums.ni.com/attachments/ni/...amicEvents.png
Reply With Quote
  #4 (permalink)  
Old 07-21-2008, 01:40 PM
Ben
Guest
 
Posts: n/a
Default Re: Nugget of the week: Dynamic event registration

<img src="http://forums.ni.com/attachments/ni/170/342541/1/DynamicEvents.png">
&nbsp;
The text shown in the header of the evnt structure comes from the code that executes out to the left. In that case, (I think) Ton was creating those events and registering them against the constant so that they would not be registered initially but only registered against the actual picture control when required.
Sorry can't look at your other pictures now, gotta run!
Ben
Reply With Quote
  #5 (permalink)  
Old 07-21-2008, 04:10 PM
TonP
Guest
 
Posts: n/a
Default Re: Nugget of the week: Dynamic event registration

Hi, since you can't create event structures and event handlers during execution I use this technique (which is used by NI in their examples as well).You always need the event handler in the dynamic event parts (with the '&lt;'). To unregister you need to feed a constant, you basically register for a control that does not exist.If you feed nothing the event will not be unregistered (just like an empty input to an unnamed cluster bundler).In your code you do the handling in static events, these be unregistered, you could do this by external coding, but it's much nicer to handle it with dynamic events.Ton
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: convert date to week Ian Whitlock Newsgroup comp.soft-sys.sas 0 06-15-2005 02:58 PM
Re: convert date to week nospam@HOWLES.COM (Howard Schreier Newsgroup comp.soft-sys.sas 0 06-14-2005 07:00 PM
Re: convert date to week Schwarz, Barry A Newsgroup comp.soft-sys.sas 0 06-13-2005 07:14 PM
Re: Missing Values Jim Groeneveld Newsgroup comp.soft-sys.sas 0 12-08-2004 07:45 AM
Missing Values Bosch, Jules Newsgroup comp.soft-sys.sas 0 12-07-2004 04:28 PM



All times are GMT. The time now is 06:10 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.