How to display a seperate right click menu for each item of a tree control?

Hi I want to display a specific right click menu when a particular tree item is selected. I know how to create a menu and how to display it. I am using the function GetLabelFromIndex() to get the active tree item and then compare the label and based on the result display a manu for that item. Now my problem is that when I use the above function in the EVENT_RIGHT_CLICK it gives me the error "the Index passed is out of range" while using the same function with the same arguments in EVENT_SELECTION_CHANGE it gives no error...below is the part of my code
case EVENT_RIGHT_CLICK:
GetLabelFromIndex(panelHandle, PANEL_TREE, eventData2, label1);
//The function gives the stated error here
if(eventData1)//after it I compare the result and display the menu
case EVENT_SELECTION_CHANGE:
GetLabelFromIndex (panelHandle, PANEL_TREE, eventData2, label1);
//The function works fine here
if (eventData1)
 If any one have any idea whats going on or alternate way of doing this Please share knowledge...Thanks
If you are young work to Learn, not to earn.

Hi,
one possible approach of solving this problem is looking closer at the error message: The error "the Index passed is out of range" tells you that something is wrong with the index, either it is too small or too large So why don't you set a breakpoint and check the index value, it might be useful information...
The other hint is to check the meaning of eventdata2 (using the help): It is different for different events! For the event_right_click it gives the horizontal mouse position, not the index as event_selection_change does...

Similar Messages

  • How can I modify the "right click" menu of a table control?

    Hello,
      How can I modify the "right click menu" of a table control. I would like to be able to remove the ability to add or delete columns and maybe other selections. I want to keep the ability to
    add or delete rows

    Hi Andy,
    Dialog & User Interface VIs -> Menu functions
    Never used them, eh?

  • How to display more than one column with for each

    Hi guys,
    how to display more than one column with for each like below?
    for each
    Item1
    Item2
    Item3
    Item4
    Item5
    Item6
    Item7
    Item8
    Item9
    Item10
    End for each
    for each          
    Item1     Item2     Item3
    Item4     Item5     Item6
    Item7     Item8     Item9
    Item10          
    End for each

    Take a look at this to see if the solution provided would work for you: https://blogs.oracle.com/xmlpublisher/entry/multi_column_row_woes
    Won't you have more than 10 records in your data file ? If you are going to have only 10 items then you may be able to use position() function to limit it to 3 each..
    Take a look at this: https://blogs.oracle.com/xmlpublisher/entry/turning_rows_into_columns
    Thanks,
    Bipuser

  • How to display right-click menu for JPanel?

    Hi...
    I am developing an application to display a JWindow in the screen along with a TrayIcon in the system-tray area. There should be a right-click menu in both the tray icon and JWindow for further options.
    I am able to create a JPopupMenu for tray icon. On right-clicking on the tray icon, the menu is being displayed. But not able to do the same for the JWindow. I am able to capture the right-click mouse event, but not able to display the menu.
    This is how I am displaying the menu for the tray icon
    PopupMenu  popupmenu = new PopupMenu();
    MenuItem  menuitem1 = new MenuItem("Exit");
    menuitem1.addActionListener(new ActionListener()
        public void actionPerformed(ActionEvent exx)
            System.exit(0);
    popupmenu.add(menuitem1);
    trayicon = new TrayIcon(Toolkit.getDefaultToolkit().getImage("./images/Icon.gif"),"Right-click for more options",popupmenu);For displaying the menu in the JPanel, I am using the following snippet...
        public class MyMouseListener extends MouseAdapter
            public class MyMouseListener() {}
            @Override
            public void mouseClicked(MouseEvent e)
                if (e.getButton() == MouseEvent.BUTTON3)
                   System.out.println("Clicked");
                   jp.setComponentPopupMenu(popupmenu);
        }Can anyone please help me to do this??
    Thanks in Advance...

    Hi,
    PFA the code I am using...
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class DisplayStrip extends JWindow implements MouseListener, MouseMotionListener
         Point location;
         MouseEvent pressed;
        JPanel jp ;
        JLabel jl ;
        JPopupMenu popupmenu ;
         public DisplayStrip()
              addMouseListener( this );
              addMouseMotionListener( this );
         public void mousePressed(MouseEvent me)
              pressed = me;
         public void mouseClicked(MouseEvent e) {}
         public void mouseReleased(MouseEvent e) {}
         public void mouseDragged(MouseEvent me)
              location = getLocation(location);
              int x = location.x - pressed.getX() + me.getX();
              int y = location.y - pressed.getY() + me.getY();
              setLocation(x, y);
         public void mouseMoved(MouseEvent e) {}
         public void mouseEntered(MouseEvent e) {}
         public void mouseExited(MouseEvent e) {}
         public void DisplayStripRun()
              setSize(100, 10);
              setAlwaysOnTop(true);
            jp = new JPanel();
              jp.setBackground(Color.GREEN);
              jp.addMouseListener(new MyMouseListener());
              jl = new JLabel();
              jl.setText("Right-click Here");
              jp.add(jl);
              add(jp);
              setVisible(true);
              pack();
              popupmenu = new JPopupMenu();
              JMenuItem menuitem = new JMenuItem("Exit");
              menuitem.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent exx)
                        System.exit(0);
              popupmenu.add(menuitem);
         public static void main(String args[])
              DisplayStrip ds = new DisplayStrip();
              ds.DisplayStripRun();
        public class MyMouseListener extends MouseAdapter
            //public class MyMouseListener() {}
            @Override
            public void mouseClicked(MouseEvent e)
                if (e.getButton() == MouseEvent.BUTTON3)
                   System.out.println("Right clicked");
                   jp.setComponentPopupMenu(popupmenu);
                   popupmenu.setVisible(true);
    }

  • How to get rid of right click menu?

    I like to mouse over a hyperlink in a web page and select "open in a new tab". The right click menu jumps in the way. I don't like or use the right click menu. How do I stop it from stopping me? As a side note, the reason I like "open in a new tab" is that some websites will open on the same page and in some events the back button will not return you to that page. I find the new tab very helpful and the right click menu a pain in the ---.
    Win 8.1
    Firefox - newest
    Alternatively, is there a way to add "open in a new tab" to the menu that gets in the way?
    I was trying to open "Sign Up/Sign In" in a new tab.
    Completely irrelevant to my question, but since you see my tabs, I was watching Jon Stewart on Hulu. He was raving about the Katy Perry Superbowl show. I wanted to see what he was talking about. I don't give a flying crap in the rain about the Stupor Bowl.

    The right-click menu is context-sensitive. When you right-click a link, you should have the option to open in a new tab, new window, or new private window. (In a private window, "new window" is not displayed.) The menu in your screen shot would normally appear if you clicked a blank area of the page without a link directly under the mouse pointer.
    I can't think of any built-in way to get the Open in New Tab command just mousing over a hyperlink. Do you have an add-on that does that automatically for you? If so, I wonder whether it might need an update?

  • How do I make a feature request for Firefox? Need for "Keep this website" in right-click menu for History viewing.

    During my daily Firefox sessions (w/over 300 RSS feeds), I commonly visit about 50 web sites. At the end of a session I may only want to keep one or a few history entries and have to manually delete the rest. I always keep one in particular.
    It would be infinitely easier if the capability of "Keep this Site" option were available in the right-click menu which would mean deleting the remainder of the history entries not marked to be kept, in conjunction with the History delete options in Firefox Preferences.
    Note: This is a real User need I have, and possibly many others would like the versatility.

    You can click the star in the location bar to bookmark a site that you want to keep.
    *https://support.mozilla.com/kb/how-do-i-use-bookmarks

  • How to add a new right-click menu entry in Nautilus file browser?

    I want to add a couple of new context menu entries to Nautilus File Browser.
    So when I e.g. right-click in View Pane on a file "foobar.conf" an menu entry "edit with gedit" should appear (among the other default entries).
    When clicked the file "foobar.conf" should be passed to gedit (and gedit editor opened).
    How can I achieve this?
    Under Ubuntu there are nautilus-actions but when I try to install them in Solaris with
    pkg install nautilus-actions
    then this package is not found.
    How else can I create my own context menues?
    I would appreciate to have one script with all my context menus, which when run add them all in one step.

    To manage selected files or directories, you can use specific Nautilus variables like NAUTILUS_SCRIPT_SELECTED_FILE_PATHS.
    For more details and which variables exist, please read the content of the following URL :
    Nautilus File Manager Scripts: Questions and Answers

  • How can I add custom right-click-menu to column headers in JTable?

    Can anyone point me to a topic on how to customize a popup menu for column headers in JTable? Specifically, I want to add things like "auto-size column" and "hide column".
    Thanks,
    Matt

    Right-click on your table.  Then go to Advanced->Runtime Shortcut Menu->Edit.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Does "Distribute content" on the right click menu for a OSD Task sequence also REDISTRIBUTE packages?

    I have a task sequence with quite a few packages that have already been distributed. But that same task sequence has far more that have never been distributed.
    When you Right click a SCCM OSD Task sequence and select "Distribute Content", does it also redistribute content that's already been distributed to existing DP's, or just the packages that have never been distributed?

    Hi,
    You can only select DP's that don't have the Packages required by the Task Seqeunce so no you cannot use it to update the DP's
    Regards,
    Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • Removing "Open With [Program]" from Right-Click menu

    I was looking around for Applications that could play .avi files and I found Perian  so decided to install it. After installing it I quickly found that it didn't work with all of my .avi files and after some further reading realized that Perian is no longer supported and apparently does not work with QT 10. I decided to uninstall it and use VLC player instead. After uninstalling Perian and removing it from the "System Properties" it looks like it's still showing up in the right-click menu for .avi files.
    My question is how do I remove this from being an option whenever I right-click an .avi file? Perian is no longer installed and I don't want to see it as an option.
    Thanks in advance

    This is probably because all the associated files have not been removed and it is still in the LaunchServices cache. To be sure you remove all associated files may require re-installing the app and using AppCleaner  to trash it and it's supporting files.
    Then, you may also need to clear LaunchServices caches
    Launch /Utilities/Terminal and copy & paste this at the prompt to rebuild LaunchServices: (be sure to copy the entire line it's a scroll)
    Code:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    Then press return. Wait until terminal returns to the command line. Quit Terminal. After that, log out and back in or restart. Let us know

  • Is there any way of removing the browser buttons from the right click menu?

    Recently when I right-click on a web page, there are browser buttons (forward, backward, refresh, bookmarks) on the right-click menu for some inexplicable reason. I mean, its kind of absurd that anyone would put browser buttons there, considering the real browser buttons literally right there at the top of the window, and I guess that kinda bugs me.
    Anyway, how did I get rid of them? There doesn't seem to be any way to do so in the customize window, and I've been looking for an add-on but don't really know what to search for. Does anyone know?
    Where did those come from anyway? They weren't there a week ago, and I'm pretty sure these things don't normally just pop up out of nowhere. If nobody knows, its really not important. The important thing is getting rid of them. Thanks!

    That was a new feature in Firefox 32, which was released back in September. Use this UserStyle to get rid of those buttons and restore the text menu items.
    https://userstyles.org/styles/104945/fx-32-context-menu-full-text
    ''You'll need the Stylish extension to be able to install UserStyles.''
    https://addons.mozilla.org/en-US/firefox/addon/stylish/

  • How to display images for right click menu items

    I am trying to display some image to the left of my right click menu items.I have searched the help but did't find anything wich can add an image to the menu items. If anyone knows how to do it, Please share 
    Thank to all.
    If you are young work to Learn, not to earn.

    Hi Mr,
    you should have searched the topic 'Programming with Menu Bars'
    Use the ATTR_SHOW_IMAGES attribute to add a column in the menu in which images can be placed. Then use the ATTR_ITEM_BITMAP attribute to specify an image to use for a submenu or menu item

  • I was on facebook and deleted an icon by using the right-click menu but then all my pictures and all profile pictures, could no longer be seen. I was able to view them in Explorer so this is something I did in Firefox. How can I unblock a site?'

    '''I was on facebook and deleted an icon by using the right-click menu but then all my pictures and all profile pictures, could no longer be seen. I was able to view them in Explorer so this is something I did in Firefox. How can I unblock a site?'''

    If you select that right-click context menu entry then you block all images from that domain and not one specific image, so do not use that.
    * Check the exceptions in Tools > Options > Content: Load Images > Exceptions (e.g. sphotos.ak.fbcdn.net)
    You can use these steps to check if images are blocked:
    * Open the web page that has the images missing in a browser tab.
    * Click the website favicon ([[Site Identity Button]]) on the left end of the location bar.
    * Click the "More Information" button to open the "Page Info" window with the Security tab selected (also accessible via "Tools > Page Info").
    * Go to the <i>Media</i> tab of the "Tools > Page Info" window.
    * Select the first image link and scroll down through the list with the Down arrow key.
    * If an image in the list is grayed and there is a check-mark in the box "<i>Block Images from...</i>" then remove that mark to unblock the images from that domain.

  • How do I add entries to PCManFM's right-click menu? [SOLVED]

    Hello there,
    Is there a way to customize PCManFM right-click menu? I'd like to add custom entries, for instance:
    right click a folder and choose "Start slideshow" to get the following command executed: "qiv -smt <selected_folder>"
    Can this be done? How?
    This could be a system-wide setting or a user setting, I don't really care.
    Thanks for any guidance.
    Last edited by brazzmonkey (2009-03-16 20:42:36)

    Inxsible wrote:Yup that's what I am doing, but on selecting an app from the All Applications tab, it creates a .desktop file in my home folder under the .local folder. The next time you try to go into the Open With menu, Geany (or any other app - that I selected from the All Applications list) shows up twice.
    Well , I'm not sure what's the problem here . I only see this when I attach a media player(e.g mplayer) to different file formats . PcManFM seems to insist on creating a .desktop file for each association but I don't see duplicate entries in the menu .
    ~/.local/share/applications$ ls | grep mplayer
    mplayer-usercreated-1-usercustom-0.desktop
    mplayer-usercreated-1-usercustom-1.desktop
    mplayer-usercreated-1-usercustom-2.desktop
    mplayer-usercreated-1-usercustom-3-usercustom-0-usercustom-0.desktop
    mplayer-usercreated-1-usercustom-3-usercustom-0.desktop
    mplayer-usercreated-1-usercustom-3.desktop
    mplayer-usercreated-1.desktop
    smplayer-usercustom-0-usercustom-0-usercustom-0-usercustom-0.desktop
    smplayer-usercustom-0-usercustom-0-usercustom-0-usercustom-1.desktop
    smplayer-usercustom-0-usercustom-0-usercustom-0.desktop
    Last edited by Nezmer (2009-03-16 22:50:28)

  • How do I get the old right click menu back after updating to 7.0.1?

    I want the old commands back in the right click menu rather than the new ones.

    There was a bit of a change between Firefox 3.6 and earlier versions, and Firefox 4.0 and later versions, as far as context menus, but I don't see any difference is the web pages I have viewed as far as any missing items - using a default Profile in Firefox 3.6.23, 4.0.1, 5.0.1, 6.0.2 and 7.0.1 versions. The information provided is too ambiguous to provide an exact answer.
    Try the Firefox SafeMode to see how it works there. <br />
    ''A troubleshooting mode, which disables most Add-ons.'' <br />
    ''(If you're not using it, switch to the Default Theme.)''
    * You can open the Firefox 4/5/6/7 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    If it is good in the Firefox SafeMode, your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

Maybe you are looking for

  • 27' Imac version 10.8.2 webcam doesn't work on any softwares: photo booth, skype, ichat...!

    I got the new imac 27 inch 3.2 GHZ last week, the version is 10.8.2. I tried to use photo booth, skype and other softwares for webcam, but none of them work. They just turned black and stopped there. How can I do to test it or it's obviously broken?

  • Air capsule cleaning takes hours

    Ever since buying my MB Pro retina and 2TB Air capsule the time machine backup and especially the cleaning part take hours. The listing below took about 6 hrs to delete 119mb. It always seems to have problems cleaning the inProgress file but thats th

  • JMS distrubuted topic and jms inbound adapter

    Hi, We are building a HA application using precise recovery using JMS. FOr that we want to create a distributed JMS Topic (ckustered JMS Topic). As we understand things, when a JMS subscriber subscribes to a distributed Topic it is actually wired to

  • How to exit the audio player (e.g. radio) on Lumia...

    I got to the point where I just gave up. I start a music player (Nokia Music) but can see no way of closing this app. The only way I found to shut down the music is to pause it, but it still hangs in the background.  Any suggestions? 

  • Modify Query at runtime

    Hi everyone, I use Forms 6i to connect to a non-Oracle data source. Just wondering, can we modify the select query at runtime? I read the online help for the pre-select trigger. In the "Usage Notes", it says "Use a Pre-Select trigger to prepare a que