Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Popup Menu Position (Read 3719 times)
mikelear
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Jun 5th, 2007
Popup Menu Position
Jun 13th, 2007 at 8:04am
Print Post  
I'm trying to add a JPopupMenu to my Diagram so users can Right Click on an entity and see a PopuMenu appear. The problem I have is positioning the popup menu. I'm using a FlowChartAdapter and placing the code in itemClicked. I'm display the popupMenu using show(Component,x,y) but if i try and pass either the tables x,y using getItem and then getBounds it's not correct and neither is it using the ItemMouseEvent getPosition. Any suggestions would be grately appreciated.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Popup Menu Position
Reply #1 - Jun 13th, 2007 at 8:10am
Print Post  
You could convert the table's logical coordinates to device ones using the FlowChart.docToDevice method and show the popup menu at the found device point. The DirTree example shows a popup menu when a folder box is clicked, so you might take a look at the code there.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mikelear
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Jun 5th, 2007
Re: Popup Menu Position
Reply #2 - Jun 13th, 2007 at 10:48am
Print Post  
Hi Stoyan

Thanks for your help. I useds the DirTree demo like you sugested and used the getMousePosition as you do in there and it works fine. Thanks again
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint