Check marks or dynamic items for run-time shortcut menus

Labview version: 8.0
I'd like to create a run-time shortcut menu for my Xcontrol, that would
allow user to toggle between two states of the control. Is it possible
to either
1) dynamically apply check marks to run-time shortcut menus or
2) dynamically modify the run-time shortcut menu content
Tomi
Tomi Maila

Hi Tomi,
Great question.  Yes, you can do what you want with run-time shortcut menus in LabVIEW 8.0.  If you want to dynamically modify the menu content, you have to do it in the "Shortcut Menu Activation?" event in the facade VI of the XControl.  In the event data for this event is a parameter called "MenuRef" which works with the same menu primitives that have been around since LabVIEW 5 for editing the menu bar at run-time. 
With these primitives, you can add/delete/modify menu items to the shortcut menu.  The items that are already in the MenuRef when this event case executes are always the ones that are statically defined, either by LabVIEW or by customizing them.  You do not have control over the state of the items that LabVIEW adds, but you can remove them and add ones with the same text (just with a different tag).  In your case, you would probably want to use the Insert Menu Item primitive to add an item such as "Toggle State".  Give it a tag such as "USER_TOGGLE_STATE".  Then you'll want to use the Set Menu Item Info primitive to set the checkmark for that item based on the state of the XControl.
Then, you'll need to add an event case for the "Shortcut Menu Selection (User)" event so you can handle the item being selected.  Wire the Item Tag parameter from the event data to a case structure and add a case to look for "USER_TOGGLE_STATE".  And in that case, toggle the state of your XControl.  That's all you need to do!
The Dual Mode Thermomter shipping example in <LabVIEW 8.0>\examples\general\xcontrols\Dual Mode Thermometer\Simple Dual Mode Thermometer XControl.lvproj is a simple example of how you can modify the menu and respond to the items selected.  It's a little different than what you want to do, but it might help you to look at it.
Good luck!  Let me know if you have questions.
Robbie

Similar Messages

  • Question about Run-Time Shortcut Menus example

    I am looking at the Run-Time Shortcut Menus.vi that ships with LabVIEW2011. There is an event case "Test List":Mouse Down that does nothing but generate a Val(Sgnl) event for the "Test List" control if the right mouse button was pressed. There is no value change event for that control.
    Is there an obscure reason to do that? One thing I have learned about many of the examples is not to strictly use them as examples.
    =====================
    LabVIEW 2012
    Solved!
    Go to Solution.

    Nevermind - I found the obscure reason. Even though there is not a value change event, generating the value change event is required to change the value on right-click.
    At least NI could have documented this in the example
    =====================
    LabVIEW 2012

  • Application's run-time shortcut menus don't work on local drive.

    The run-time menus in my application don't work, unless I run the application from the location where it is built.  This project has an application build specification, and an installer build specification.  The installer specification, copies the app to the local drive.  But the run-time shortcut menus do not work when the app runs.  Nothing happens when I right click on the control.  However if I run the same app from the network drive, where the application build spec builds it, it runs fine.  When I have the application build spec build the app directly to the local drive, it works fine.  The exe, ini and aliase files are identical.  Why does this app run differently depending on which drive it's on?  How can I fix it so the run-time shortcut menus work on the target machine?  Any ideas?

    Hello, I believe that when you create a custom run-time menu it gets saved to a file.  My guess is that you are not including this file as part of the build specification for the application.  The file likely exists in the build directory but does not on the target directory which is why it no longer works.  If that does not fix the problem, let me know and I will see if I can figure something else out.
    Regards,
    Burt S

  • Run-Time Shortcut Menus

    Hi,
         How can i create Run Time Shortcut menu
    with tick mark?. like here i am attached the file.
    Thanks in
    Advance.
    Sivaraj M S
    Sivaraj M.S
    CLD
    Attachments:
    bb7a9f541545.gif ‏11 KB

    Hi Siva,
    are you talking about the checkmark?
    Read the help for "Set Menu Item Info" function and you will notice the "checked" input
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Is it possible to preserve dynamic run-time shortcut menu updates for a control?

    Hello all,
    I have a question about getting control run-time shortcut menus to persist after adding new items.  I am hopeful that I'm simply missing something simple here.
    Known Information
    I understand the use of the "Shortcut Menu Activation?" event (for the control of interest) which provides the relevant control's menu reference for use with the menu VIs.  No problems there.
    Problem
    I start with a control which has an .rtm file assigned as its run-time shortcut menu.  
    I then generate new items dynamically using the event/menu mechanism noted above.  
    The problem is that there doesn't seem to be a way to *preserve* those newly added items (ie. I have to re-create the new items everytime the menu is *activated*).
    What I observe is that, unless I add all the items every time the right-click event occurs (in the "Shortcut Menu Activation?" event case), it defaults back to the original .rtm menu state.
    Question
    Does anyone know how to either:
    get dynamically added menu items to "stick"
    perhaps dynamically create (new) and load an .rtm for a *control*
    Thanks in advance for any thoughts.  I'm working in LabVIEW 8.6 for this particular project.
    VM

    Looking at the second post link, it seems like you are trying to populate 10,000+ shortcut items on the Shortcut Menu for the control. I'm guessing these are tiered, since I don't think all of them would fit on the screen. If they are tiered, have you tried populating only the top level short cuts, and then populating more as the user navigates down the tree?
    - Regards,
    Beutlich

  • Can we create items dynamically or at run time?

    Hello expert,
    can we create some item dynamically at some button click?
    Thanks
    yash

    yash_08031983 wrote:
    Hello expert,
    can we create some item dynamically at some button click?Hello, yash
    You can not create items at run time. But you can manage them at run time by setting Visible property programatically.
    Hope this helps..
    Hamid

  • Help to create item at run time

    Hi all
    Please help to create item at run time
    I want to create item at run time
    is it Possible ???
    thank you

    Hi,
    As mentioned several times above, you cannot use Forms for displaying dynamic columns. So, you have two options (AFAIK).
    1. Create maximum number of items and set their visibility off based on the user input.
    2. Create a PJC (may be by extending JTable), and display dynamic columns (i feel it is a bit complicated and not straight forward as it sounds). Here is a [simple howto|http://sheikyerbouti.developpez.com/forms-pjc-bean/first-bean/first_bean.pdf] to build the PJC.
    -Arun

  • How to generate database text items at run time in oracle forms 6i?

    i have a text item with NUMBER OF ITEMS DISPLAYED=3. My requirement is, i need to generate text items at run time under each TEXT ITEM(3 text items will be there since number of items displayed is 3) and the values will be stored in the database based on the primary key combination. pls help me to solve this pblm

    Hi,
    You cannot generate items dynamically at runtime. The only thing you can do is show and hide item on time. Thay seems that they are generated at run time. Second thing you can do is that you can put items on stack canvas and set visible property of stack canvas to no and at run time set it to visible according to ur condition. Otherwise there is no way. If you find any other way, plz do inform here also.

  • Dynamic table in Run time

    Hi,
    I need to create a dynamic table in run time
    Input from user will be like
    Param1---->'tablename'
    Param2---->'col1name datatype,col2name datatype,col3name datatype,col4name datatype,col5name datatype,col6name datatype........................'
    Param3---->returnCode OUT NUMBER
    Param4---->errorMessage OUT VARCHAR2
    how to write a script to execute the above statement.
    The input will be from java page, it has connection string of the database
    Thanks!

    After remove *:*
    Error report:
    ORA-06550: line 4, column 6:
    PLS-00103: Encountered the symbol "CREATE_TABLE" when expecting one of the following:
    := . ( @ % ;
    The symbol ":=" was substituted for "CREATE_TABLE" to continue.
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Help for run-time menu localization

    I would like to dynamically change the run-time menu according to the predefined language setting. For example, if the setting (may be set up in a txt file) is German, then when the application is running, it automaticall display a german menu. if the setting is spanish, the menu will change to spanish display. Any help will be appreciated.

    The attached VI can dynamically change the run-time menu and short-cut menu based on language.
    帖子被ttrr在07-24-2006 09:12 PM时编辑过了
    Attachments:
    Multi Language Menu.zip ‏13 KB

  • Create item at run time

    hi all
    i use oracle database 10g and from 6i (winfows 2000pro).
    how can i create items at run time (on my canves)?
    thax
    Rafeek

    Read the following.....
    Re: Creating Dynamic Text Item
    Greetings....
    Sim

  • Problem with Assemble Test VIs for Run-Time Distribution

    I get an error that a file is already in memory and that I will have to remove it before I can build the application. The file in question is Get File System Seperator.vi. It lives in vi.lib\Utility\sysinfo.llb. If it is not a stock vi from national and was placed there by some other add on tools (perhaps an OpenG toolkit), how can I disable it? Labview itself will not boot without this sysinfo.llb.
    I am using TestStand Engine 2.01 on the XP system and 2.01f1 on win2000 with the same results. I am not using numerical limits so the fix (patch) for multiple numerical limits does not seem to be needed.

    Hi Paul,
    In the description of your problem you state that "I will have to remove it before I can build the application". I was wondering if you could elaborate on the scenario you are describing because this is a little bit confusing to me as it is. The "Assemble Test VIs for Run-Time Distribution" tool in the Sequence Editor does not involve "building an application" as part of the process of using it. When you select the menu option for this tool, a TestStand sequence is invoked that has a few LV VI steps in it which perform the VI Assembly process, with no application building involved (just searching through sequences for top-level vis, their sub-vis, and copying them all into a directory you choose). I hope this describes what it is I'm not understanding about your statement, but to explain why it is that I feel this is important is in order to reproduce the problem I need to know exactly what it is you are doing at the time of encountering the problem. To go over a common set of issues people encounter when they use this tool, I would like to see if you have tried the following:
    1) Have you checked to make sure that the LabVIEW Standard Prototype Adapter is configured to use the LabVIEW development environment as its Run-Time Server before running the tool. It will not work if the adapter is set to use TestStand LVRTS or TestStandGUILVRTS. The assembly tool requires features of the full LV IDE to perform the functions it carries out, and you will get an error if the adapter is configured improperly. To check this out, go to Configure >> Adapters..., select the LV Adapter in the listbox, then click the Configure button. In the second dialog, change the run-time server option to "LabVIEW".
    2) Are you actually trying to build the Assemble Test VIs for Runtime Distribution tool into an application? (This is not an intended use of the tool's VIs).
    3) Before running the assembly tool, have you tried using the Sequence Editor's File >> Unload All Modules option?
    Let me know if you have tried the above things or if you are doing any of the "unintended" things with the tool so I can get a better grasp of when it is you are seeing the problem. Again, the goal would be for us to reproduce it.
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • Dynamic month for *XDIM_MEMBERSET TIME

    i have the following statement trying to get the Dynamic month for *XDIM_MEMBERSET TIME
    *SELECT(%THISYEAR%, "YEAR", "TIME", "[ID] = '%TIME_SET%'")
    *XDIM_MEMBERSET TIME= %THISYEAR%.JAN,%THISYEAR%.FEB,%THISYEAR%.MAR,%THISYEAR%.APR....
    I get the error of invalid period.
    Can we get the period dynamic or we need to use
    *XDIM_MEMBERSET TIME= 2010.JAN,2010.FEB,2010.MAR,2010 ....

    Hi Jianbai,
    You can simply use this memberset:
    *XDIM_MEMBERSET  TIME=%YEAR%.JAN,%YEAR%.FEB,%YEAR%.MAR,%YEAR%.APR,%YEAR%.MAY,%YEAR%.JUN,%YEAR%.JUL,%YEAR%.AUG,%YEAR%.SEP ,%YEAR%.OCT,%YEAR%.NOV,%YEAR%.DEC
    Thanks,
    Marvin

  • Copy picture of graph to clipboard through run-time shortcut menu

    Hi,
    I have following problem. I would like to copy picture of graph to clipboard through graph “run-time shortcut menu”. It’s easy when I want copy exactly what I see. There is an Item Tag: APP_SC_COPY_DATA. That works nice. Try an example1.vi. (Run then right click on the graph...)
    But problem is when I want to change the graph appearance before copying (only change the colour of the graph to be more printer-friendly). I have created a subVi with copy of the graph with changed colour. But how to simulate for the graph inside the subVi same runtime shortcut event? How to call APP_SC_COPY_DATA of subVi graph from outside Vi?
    I hope I’ve explain it clear.
    If you have better method for clipboard copying tell me.
    ThanksMessage Edited by jochynator on 08-03-2006 11:48 AM
    jochynator
    LV 8.0.1, WinXP Pro
    Attachments:
    examples.zip ‏37 KB

    You should use GetImage Not ExportImage.
    I modified you VI.
    George Zou
    http://gtoolbox.yeah.net
    George Zou
    http://webspace.webring.com/people/og/gtoolbox
    Attachments:
    export.vi ‏14 KB

  • Image Run-Time Shortcut Menu

    OK, more on the non-standard behavior of Image Controls (in LV 2009 SP1 at least)...
    Having had to deal with the fact that one cannot detect a user right click in an Image Control, I figured that maybe I could at least build my own shortcut menu (the one that pops up when you right-click on an object). Not such luck without loosing some functionalities.
    If you do so, you loose most items that are available by default at runtime (these are called the application items for any other controls):
    - Palette
    - Save Image...
    - Clear ROI
    - Zoom to Fit
    I could rebuild all these functionalities in my custom menu, but:
    1) why should I have to do that?
    2) why do the items above not appear when one opens the default run-time shortcut menu? They do appear at run-time!
    3) why do ALL other shortcut menu items available at edit time (some of which could be handy at run-time) not appear when one opens the default run-time shortcut menu?
    4) At run-time, none of the menu items listed above are returned in the event structure when polling the Shortcut Menu Selection events (either App or User). Why????
    Thanks for reading.

    VTHokie wrote:
    Hi Xavier,
    You can keep an eye out for CAR numbers in the known issues lists as they are published with software patches and releases, but especially in the bug fixes lists to see if a specific CAR has been remedied in that release.
    - Greg J
    Greg, neither of those lists contain references to issues within Vision Development Module... 
    If you are looking for a similar style list for Vision, the only location these are currently published is in the release notes for each release, such as here:
    http://ftp.ni.com/support/softlib/vision/Vision%20Development%20Module/2010/readme.html
    Also, I found reference to a VDM-specific known issues list here:
    http://zone.ni.com/devzone/cda/tut/p/id/11942
    Eric

Maybe you are looking for

  • Error in receiver SOAP adapter.

    Hi Experts, scenario name is proxy to soap asynchronous interface we are getting the below error from the soap receiver communication channel. -exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException -Adapter

  • SAPscript: Print our contact person in RVORDER01

    Hello gurus, we would like to print information about our contact person (name, telephone and fax number, mail-address) in our order confirmations (form copied from RVORDER01). In our invoices we use &GV_ADDRESS-TITLE_P& &GV_ADDRESS-LASTNAME& 'GT_ADD

  • Timer class and javax.......

    Hi, Downloaded the latest java version to d:\download folder. The downloaded file has the name " j2re-1.4.2_03-wndows-i586-p.exe ". The file size was about 14.53MB. Double clicking the same installed j2re1.4.2_03 in "C:\Program Files\java\j2re1.4.2_0

  • Setting default values for item in opportunity mgmt(crmd_bus2000111)

    Hi All, I need to set default values for the field Fiscal Quarter in item level using BADI CRM_CUSTOMER_I_BADI .This Field is created using EEW. The default value is like if the date is nov-2007 the value for this fiscal period is FQ4-2007 . Any clue

  • IOS 5: Completed reminders still show up in Notification screen

    My iPhone 4 shows completed reminders correctly in the Reminders app, that is to say, in the Completed tab. However, the completed reminder still appears in Notifications, when I swipe my finger down, even though the reminder is completed. That can't