Re: monitor mouse events but not capture them

2014-06-10 Thread Tom Eugelink
Looking at PopupWindow; that is an abstract class and I'm not finding much examples on how to use it. Maybe extending PopupControl would be a better choice. Been looking at the ContextMenu source code (which is extending PopupControl), but it is somewhat mysterious how those MenuItems get

Re: monitor mouse events but not capture them

2014-06-10 Thread Tomas Mikula
What about using Popup, which is a subclass of PopupWindow? You just need to populate its content popup.getContent().addAll(Node...); and then show it at the right position, relative to any node popup.show(canvas, x, y); Tomas On Jun 10, 2014 8:49 AM, Tom Eugelink t...@tbee.org wrote:

Re: monitor mouse events but not capture them

2014-06-10 Thread Tomas Mikula
Since talk is cheap, I slightly reworked your code (not using PopupWindow) and it seems to work. CircularPopupMenu: https://github.com/TomasMikula/jfxtras-labs/blob/8.0/src/main/java/jfxtras/labs/scene/menu/CirclePopupMenu1.java Sample:

Re: monitor mouse events but not capture them

2014-06-10 Thread Tomas Mikula
Just because I wanted to make minimal changes to your code, which was already using StackPane. Yes, Popup would remove the need for a StackPane. On Tue, Jun 10, 2014 at 3:52 PM, Tom Eugelink t...@tbee.org wrote: You're way ahead of me. Why use stackpane and not popup as suggested? Wouldn't

Re: monitor mouse events but not capture them

2014-06-10 Thread Tom Eugelink
Thanks for all the help, you've given me a lot of helpful tips. I already was working on a popup based version and I see you ran into the same problems as I did (initial popup had no width for the circularPane, etc), the difference is that I bind the menu to Stage, since I do not envision

Re: monitor mouse events but not capture them

2014-06-10 Thread Tomas Mikula
Somehow I didn't get your previous email that you are quoting now. Listening to MOUSE_MOVED events on the Scene seemed to work for me. Didn't it work for you? You may as well install the menu to a Scene instead of a Node. That will also simplify listening to scene's events, because you don't have

Re: monitor mouse events but not capture them

2014-06-10 Thread Tom Eugelink
My internet provider has problems sending to GMail addresses. For me it worked to register to scene.getRoot(). I like registering to a node, because it allows to install different menu's to different nodes, but still do the most common approach of install a single menu to the top level pane.

Re: monitor mouse events but not capture them

2014-06-10 Thread Tom Eugelink
Placed a new version in GIT, tests are green as well. I'm quite pleased with the improvements. Going to take a peek at CornerMenu to see if it makes sense to refactor it also. Tom

monitor mouse events but not capture them

2014-06-09 Thread Tom Eugelink
Hi all, Maybe someone has solved this already, so I thought I pop the question. Currently I'm working on CirclePopupMenu; a menu that is supposed to pop up on any place in a scene when a certain (usually the middle or right) mouse button is pressed. Right now CirclePopupMenu requires a

Re: monitor mouse events but not capture them

2014-06-09 Thread Martin Sladecek
Hi Tom, have you tried .addEventFilter() method? It receives the Event before the controls underneath the canvas, in the capturing phase. If you don't consume the Event, it should pass down to the controls. For more on the topic, see http://docs.oracle.com/javafx/2/events/processing.htm or

Re: monitor mouse events but not capture them

2014-06-09 Thread Martin Sladecek
Just looked at the code and it seems Canvas does pick on bounds independently of the pickOnBounds value. There's currently no logic for picking only when over an opaque pixel ( worth filing a JIRA issue maybe?). This makes Canvas to consume everything as it's always picked instead of some

Re: monitor mouse events but not capture them

2014-06-09 Thread Tom Eugelink
Hm, maybe I chose bad words; I'm not using Canvas, but just a Pane. Since the Pane is only used to draw the menu on when it need to appear, I'm calling it the canvas pane, as in what is painted on. On 2014-6-9 9:46, Martin Sladecek wrote: Just looked at the code and it seems Canvas does

Re: monitor mouse events but not capture them

2014-06-09 Thread Martin Sladecek
OK, so to avoid further confusion, you have a PopupWindow with a Pane and you want to capture Events on the Pane and sent those events to the underlying controls (in a parent window) if those events are not relevant to that popup? Thanks, -Martin On 06/09/2014 10:07 AM, Tom Eugelink wrote:

Re: monitor mouse events but not capture them

2014-06-09 Thread Tom Eugelink
No, I require a StackPane, to which a special canvas Pane is added. And on that Pane a circular shaped menu is placed. The separate pane prevents conflicting with other nodes that may be drawn, the stack pane makes sure the menu is on top. See the blog post about both corner menu and circle

Re: monitor mouse events but not capture them

2014-06-09 Thread Tomas Mikula
Hi Tom, I am in favor of the menu being a PopupWindow, but alternatively, could your canvas be a Group instead of a Pane? The code would look like this: StackPane stack = new StackPane(); Group canvas = new Group(); canvas.setManaged(false); stack.setOnMousePressed(e - {