Menu on right-click for numeric control

Hello,
is there a way to program a "menu on right-click" for a control (e.g. numeric), like there is for table controls?
I'm working with CVI 8.0.1 
Thanks & Best Regards,
Greg

Yes, every control can be added a popup menu with a few instructions.
Design the menu nar in the UIR editor; do not associate it to any panel
Load the menu bar when needed with the line menuHandle = LoadMenuBar (0, "myfile.uir", menuBar): by passing 0 as the panel handle it will not be associated to any of them
In the numeric callback add these instructions:
     switch (event) {
        case EVENT_RIGHT_CLICK:
            // Context menu
           choice = RunPopupMenu (menuHandle, menuBar_Menu, panel, eventData1, eventData2, 0, 0, 0, 0);
            switch (choice) {
                 case menuBar_menu_item1:
                          // menu item handling code
                          break;
            break;
Passing eventData parameters to RunPopupMenu function ensures that the menu is displayed at the mouse position.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?

Similar Messages

  • Pop up menu on right clicking an image?

    Hello,
    I am new to LabWindows/CVI. 
    Requirement: "To get a pop-up menu on right clicking on image"
    Right now, I display my images in window numbers (0 - 15). Is it possible to be able to get a pop-up menu on right clicking an image window. If yes, how? If not, could you please suggest other methods to achieve this task? Should I display the image in a separate parent panel for example? How could I do this?
    Any help would be great.
    Cheers

    I would use the code generator for right click event. then fill it up with whatever code you want under right click case. You can access these when you double click your UIR file, then on the top of the page click Code\Preferences\Default... then choose desired events for picture then go to Code\Generate\all callbacks and skip through the ones you don't want to be replaced.

  • How do I change my mouse to right click for copy and paste

    How do I change my mouse to right click for copy and paste?

    OK, what mouse are you using?  Brand, model?  Your right click should register as a right click unless that has been overridden by a preference pane.  If your Mouse preference pane looks like this, your right click should be the equivalent of a control-left-click on a Mac.

  • Update to 6.01 has resulted in extreme slow down when I right click for context menus? Tried usual fixes (new profile, cleaned cache).

    After updating to latest version for Osx, I noticed that when right clicking for context menus, enormous lag occurs. It has made it almost impossible to be productive. Any ideas?

    Thanks for your response and sorry for the delay in my rep[ly.
    Today I tested the Linux-64 version (Firefox 33) from the link you suggested. There weren't any install instructions or a README, but based on the file-system layout I guess it just needs to be extracted. I downloaded and extracted to my Downloads directory and ran the executable via command-line as my user (not root).
    Firefox popped up right away, but it was not usable for at least 30s. It asked to import from Chrome which I did (no errors). Every click on the top bar (address bar search, buttons to the right of search, bookmarks toolbar) resulted in a dimming un-dimming sequence of @7s, after which nothing (couldn't focus in the address bar, occasionally the bookmark menu would appear, but was not functional). Basically, it's un-usable.
    As I mentioned in an earlier reply, I am having similar problems with Komodo which is apparently also Mozilla based.
    Are there any logs I could tail and post that might help track this down?
    Not sure what to do at this point.

  • Displaying a context menu on right click on rich tree

    Please see the code below. I want to display a context menu on right click on a rich tree.
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:rich="http://richfaces.org/rich">
        <style>
            .col1{ width:50%; vertical-align:top;
        </style>
        <h:form>   
            <h:panelGrid columns="1" width="100%" columnClasses="col1">
                 <rich:tree style="width:300px" nodeSelectListener="#{simpleTreeBean.processSelection}"
                    switchType="client"
                    value="#{simpleTreeBean.treeNode}" var="item" id="item">
                    <rich:componentControl event="onClick" for="menu" operation="show">
                    <f:param value="#{item.data}" name="send" />
                </rich:componentControl>
                </rich:tree>
                </h:panelGrid>
            <a4j:outputPanel ajaxRendered="true">
                <rich:panel>
                    <f:facet name="header">Last Menu Action</f:facet>
                    <h:outputText escape="false" value="Right Click :  #{simpleTreeBean.nodeTitle}" id="selectedNode" />
                    <br/>
                </rich:panel>      
            </a4j:outputPanel>
                 <rich:contextMenu event="oncontextmenu" actionListener="#{SimpleTreeBean.processCurrElement}" attached="true" id="menu" submitMode="ajax">
                <rich:menuItem ajaxSingle="true">
                <b> #{simpleTreeBean.nodeTitle}</b> Send To
                    <a4j:actionparam name="det" assignTo="#{ddmenu.current}" value=" #{simpleTreeBean.nodeTitle}"/>
                </rich:menuItem>
            </rich:contextMenu>
        </h:form>
    </ui:composition> With this code, i need left click at first then right click, then it will show the selected node. I want to get the value of the node title on right click. Please help me with it. The SimpleTreeBean code:
    package com.dW;
    import java.awt.event.ActionEvent;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Properties;
    import javax.faces.FacesException;
    import javax.faces.context.ExternalContext;
    import javax.faces.context.FacesContext;
    import org.richfaces.component.UITree;
    import org.richfaces.event.NodeSelectedEvent;
    import org.richfaces.model.TreeNode;
    import org.richfaces.model.TreeNodeImpl;
    public class SimpleTreeBean
        private TreeNode rootNode = null;
        private String nodeTitle;
        private static final String DATA_PATH = "images/simpleTreeData.properties";
        private void addNodes(String path, TreeNode node, Properties properties) {
            boolean end = false;
            int counter = 1;
            while (!end) {
                String key = path != null ? path + '.' + counter : String.valueOf(counter);
                String value = properties.getProperty(key);
                if (value != null) {
                    TreeNodeImpl nodeImpl = new TreeNodeImpl();
                    nodeImpl.setData(value);
                    node.addChild(new Integer(counter), nodeImpl);
                    addNodes(key, nodeImpl, properties);
                    counter++;
                } else {
                    end = true; } }  }
        private void loadTree() {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExternalContext externalContext = facesContext.getExternalContext();
            InputStream dataStream = externalContext.getResourceAsStream(DATA_PATH);
            try {
                Properties properties = new Properties();
                properties.load(dataStream);
                rootNode = new TreeNodeImpl();
                addNodes(null, rootNode, properties);
            } catch (IOException e) {
                throw new FacesException(e.getMessage(), e);
            } finally {
                if (dataStream != null) {
                    try {
                        dataStream.close();
                    } catch (IOException e) {
                        externalContext.log(e.getMessage(), e);
        public TreeNode getTreeNode() {
            if (rootNode == null) {
                loadTree();
            return rootNode;
        public void processSelection(NodeSelectedEvent event) {
            UITree tree = (UITree) event.getComponent();
            nodeTitle = (String) tree.getRowData();
        public void processCurrElement(ActionEvent event) {
            UITree tree = (UITree)event.getSource();
            nodeTitle = (String)tree.getRowData();
            System.out.println(nodeTitle);
        public String getNodeTitle() {
            return nodeTitle;
        public void setNodeTitle(String nodeTitle) {
            this.nodeTitle = nodeTitle;
    }

    Hi,
    Do you have a solution for this? Looking for exactly the same.
    As far as I have it at the moment I have the backing object added to the attributes of the node:
    <a4j:support event="oncontextmenu"
                                         oncomplete="#{rich:component('foldersContextMenu')}.doShow(event, {})"
                                         actionListener="#{customerBean.buildContextMenu}" reRender="foldersContextMenu, selectedNode">
                                <f:setPropertyActionListener value="#{item}" target="#{customerBean.nodeTitle}"/>
                                <f:attribute name="node" value="#{item}"/>
                            </a4j:support>This allows me to get the object in the backing bean:
    public void buildContextMenu(ActionEvent event) {
            UIComponent component = event.getComponent();
            log.info("component: " + component.getId());
            Category node = (Category) component.getAttributes().get("node");
            log.debug("node : " + node);But how I translate that to setting this as the current node is causing me problems.
    Thanks
    Jon

  • I can't left click to select or right click for menus. This works in IE, what do I need to do to get this to work in firefox?

    I don't understand why this doesn't work. My OS is vista. The right click for menus stopped working several months ago, so I have been using IE when I need that. The left click to select stopped working 2 days ago. So now firefox is unusable unless I can figure out why it is doing this.

    -> click Firefox button and click Exit
    -> Start Firefox in Safe Mode (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    https://support.mozilla.com/kb/Safe+Mode
    -> Firefox Safe Mode window will open. DON'T SELECT ANY OPTIONS, just click Continue in Safe Mode
    Check and tell if its working while you are in Safe Mode.

  • How do you right click for skype features on an Micosoft Surface Tablet to block a contact

    how do you right click for skype features on an Micosoft Surface Tablet to block a contact

    Go to Settings>General>Restrictions and turn on Restrions for Safari and also hide the App store to prevent purchasing apps like another browser
    iOS: Understanding Restrictions

  • JSF Popup Menu on right click

    Hi ,
    I want to popup menu on right click of any component(say tree).I searched on the net and found the tomahawk <t:popup> component.
    This component popup the menu when mouse pointer enter in to the component but I don't want this behavior.
    I want to popup the menu only when I right click on the component.
    This is sample program
    <t:popup id="a"
    styleClass="popup"
    closePopupOnExitingElement="true"
    closePopupOnExitingPopup="true"
    displayAtDistanceX="10"
    displayAtDistanceY="10" >
    <h:outputText id="oa" value="#{country.name}"/>
    <f:facet name="popup">
    <h:panelGroup>
    <h:panelGrid columns="1" >
    <h:outputText value="#{country.cities}"/>
    </h:panelGrid>
    </h:panelGroup>
    </f:facet>
    </t:popup>
    DO you have any component like this ? Or any other way to do like this ?
    Thanks in Advance,
    KK

    I wrote a component a while back that does something similar to what you want. You'd probably need to fix it up and add any features that you need that it doesn't already have. It pops up a menu on a right-click, it allows you to provide a facet to supply the contents of the menu. I doubt I made sure it works in IE or any browser other than Firefox... so there may be JS issues. It has some other component dependencies you might want to remove also. I could get it to the point where you could try it out and fix it up if you want, but I won't have time until next week.
    Ken Paulsen
    https://jsftemplating.dev.java.net

  • Why can't i delete songs from older i-pod touch, delete feature greyed out and right click or holding control and clicking do not offer delete option

    Why can't i delete songs from older i-pod touch, delete feature greyed out and right click or holding control and clicking do not offer delete option in I-tunes. I've tried using both a Mac Book and PC with newer and older versions of I-tunes.

    It sounds like you are try to delete the songs by connecting the iPod to other than the computer from which the songs were synced. You can only delete songs synced to an an older iPod (pre iOS 5) by connecting the iPod to its syncing computer and unsync them.
    If you want to change syncing computers see:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • "Toast it" appearing in menu when right clicking

    The words "Toast it" appears in menu when right clicking an icon but Toast has been uninstalled. How can I remove it please?

    Try this previous discussion:
    https://discussions.apple.com/message/12533120#12533120
    Re: "Toast It" wont go from contextual menu

  • I just pluged in my Apple TV and I can't get passed the initial page that ask what language.  My remote won't pair.  holding the menu and right button for 6 sec

    I just pluged in my Apple TV and I can't get passed the initial page that ask what language.  My remote won't pair.  holding the menu and right button for 6 sec

    Welcome to the Apple Community.
    Your Apple TV may have become paired with another remote. Hold the remote close to and pointed at the Apple TV, hold down the menu and Rewind buttons together for 6 seconds or until you see a broken chain icon on screen.

  • Set initial value for numerical control

    Hello LV users,
    I have a VI that is used to initialize some experimental equiptment. It passes on a cluster of ten or so numerical control DBL integers as parameters. Everytime I open the programe the values are reset back to zero and I have to enter the values back in. Is there any way to set default values for  the controls so I do not have to change them everytime I open the program.
    Thanks 
    Solved!
    Go to Solution.

    Wowden,
    If you want to set default values for multiple numeric control's in your cluster in one go, 
    -Type in the desired default values
    - Right click on your cluster, browse to 'data operations'
    - Choose 'Make current values default. 
     Similarly, if you need to set defaults for  multiple clusters or multiple controls on your front panel,
    - Choose 'Edit' in the menu 
    - Choose "make current values default' (This sets defaults for all controls/constants etc. in one go)
    RaVI

  • Right click for copy/paset on signed applet not working

    Hi Guys,
    I have an application which runs forms containing different controls like text fields, text areas etc. The forms are rendered in applets in Windowos 7. After upgrading to JRE1.7u45 the right click menu containing copy/paste options which used to appear when any right click done inside textfield or other control has disappeared except for textarea controls. Interestingly the right click is working inside TextArea but not in other controls.
    My Applet is digitally signed(Verisign) and all permissions set. I have also tried accessClipboard permission in my .java.policy file to no avail.
    My applet code is rather old. We tried to upgrade JDK to 1.7u45 to compile and sign the JAR but we got few errors so we used JDK 1.3 to compile the JAR and 1.7u45 to sign the JAR file. Can this be a cause for right click menu not working?
    Please suggest/advise on this.
    Thanks,

    Hi Guys,
    I have an application which runs forms containing different controls like text fields, text areas etc. The forms are rendered in applets in Windowos 7. After upgrading to JRE1.7u45 the right click menu containing copy/paste options which used to appear when any right click done inside textfield or other control has disappeared except for textarea controls. Interestingly the right click is working inside TextArea but not in other controls.
    My Applet is digitally signed(Verisign) and all permissions set. I have also tried accessClipboard permission in my .java.policy file to no avail.
    My applet code is rather old. We tried to upgrade JDK to 1.7u45 to compile and sign the JAR but we got few errors so we used JDK 1.3 to compile the JAR and 1.7u45 to sign the JAR file. Can this be a cause for right click menu not working?
    Please suggest/advise on this.
    Thanks,

  • How to get a pop-up menu on right click of JTree?

    hi
    My application consists of a JTree.I am having a 2 root nodes each one have some child nodes.in the first root node what i want is on right click of child node i have to display one option that is enabled and on the second root node what i want is on right click of child node i have to display one option that is disabled..
    how to do that
    thanks for your reply in advance,

    When you are creating your nodes, do node.setUserObject(objectName);
    and on right click, do something like this
    if (e.isPopupTrigger() == true) {
             selPath = tree.getPathForLocation(e.getX(), e.getY());
          try {
             // If Right Click, Select the Node
             Object[] selectedPath = selPath.getPath();
             DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) selectedPath[selectedPath.length - 1];
             try {
                dataObject = (MyObject) selectedNode.getUserObject(); // Set the Data Object
             } catch (ClassCastException ex) {
                                      ex.printStackTrace();
             // Check for the right click on Framework Node
             if (dataObject.getClass().isInstance(new MyObject()) == true) {
                // Disable the pop-up menu
    ....

  • Disable right click for all users in a certain group

    I would like to disable the right click function for all users in a particular group, regardless of which computer is the domain they log in to. Is there any way to do this? Thanks.

    1. Create a new group policy and link it to the OU with the users you want to be affected.
    2. Edit the new policy - In the left pane navigate to:
    User Configuration \ Administrative Templates \ Windows Components \ Windows Explorer
    3. Enable the setting Remove Windows Explorer's Default Context Menu.
    Please let me know if you succeeded.
    Regards, Liran.

Maybe you are looking for