Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Adding context menus to SVG fields
Adding context menus to SVG fields [message #1027614] Wed, 27 March 2013 03:23 Go to next message
Urs Beeli is currently offline Urs Beeli
Messages: 322
Registered: October 2012
Location: Bern, Switzerland
Senior Member
We are looking at using SVG fields to display some of the more complex graphical elements. Among other things, we'll need to have context menus not only for the SVG field as such, but for specific elements drawn in the SVG field.

Using execHyperlink() I am able to use SvgFieldEvent.getURL() to find out which of my drawn elements was clicked. However, I've been unable to find out if the click on the element was done using the left or right mouse button. Is there any way to determine this?

Furthermore, how would I go about creating and showing a dynamic context/popup menu in execHyperlink()?

I've tried adding a menu extending from AbstractMenu to the SVG field (as I would do for any other field) but have not been succesful. Does the SVG field just not support context menus? Or do I need to add additional code to make that work?

Thanks for any pointers.
Re: Adding context menus to SVG fields [message #1027876 is a reply to message #1027614] Wed, 27 March 2013 10:39 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias Villiger
Messages: 78
Registered: September 2011
Member
Hi Urs,

Afaik the svg field does not support context menus on specific svg elements. This is because currently I don't know way to distinguish between the right and the left mouse button.
This is why we have not implemented a context menu for the calendar field in the RAP UI which is based on SVG too. Instead we created a normal svg item which shows a context menu on a left click.

You can find this as an example in 'org.eclipse.scout.svg.ui.rap.calendarfield.RwtScoutCalendarField' which makes use of the SVG documents stored and handled in the plugin 'org.eclipse.scout.rt.ui.svg.calendar'.

maybe this helps you

kind regards
m
Re: Adding context menus to SVG fields [message #1031769 is a reply to message #1027876] Tue, 02 April 2013 02:59 Go to previous messageGo to next message
Urs Beeli is currently offline Urs Beeli
Messages: 322
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Matthias

When I use Ctrl-Shift-T (Open Type) I can't seem to find RwtScoutCalendarField. (My SDK is currently Scout 3.8.1, my target uses M5 (haven't yet made the switch to M6)).

I did find a link using google to (https://dev.eclipse.org/svnroot/technology/org.eclipse.scout/scout.rt/branches/3.8/org.eclipse.scout.svg.ui.rap/src/org/eclipse/scout/svg/ui/rap/calendarfield/RwtScoutCalendarField.java) so I'll have a look at the class to look at how you solved this, however, I am curious why that class couldn't be found in my setup? Do I need to add the plugin you mentioned to my target?

[Updated on: Tue, 02 April 2013 03:02]

Report message to a moderator

Re: Adding context menus to SVG fields [message #1031790 is a reply to message #1031769] Tue, 02 April 2013 03:38 Go to previous message
Urs Beeli is currently offline Urs Beeli
Messages: 322
Registered: October 2012
Location: Bern, Switzerland
Senior Member
I've just had a look at the classes involved in RwtScoutCalendarField. Do I understand this correctly, that I need to create a custom control, if I want to add a context menu to an SVG field? Or is there a way to show a context menu in the execClicked() and/or execHyperlink() methods of an AbstractSvgField?
Previous Topic:Is possible to create a dynamic PageView and Form ?
Next Topic:How can I pass additional variables to injectFieldsInternal()
Goto Forum:
  


Current Time: Thu Aug 21 14:22:36 EDT 2014

Powered by FUDForum. Page generated in 0.02877 seconds