Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Adding context menus to SVG fields
Adding context menus to SVG fields [message #1027614] Wed, 27 March 2013 07:23 Go to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 573
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 14:39 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 232
Registered: September 2011
Senior 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 06:59 Go to previous messageGo to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 573
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 07: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 07:38 Go to previous message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 573
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: Sat Apr 20 06:12:16 GMT 2024

Powered by FUDForum. Page generated in 0.03389 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top