Bill,

It is good to see that you are making some fairly rapid progress with this.
How far away from a complete solution are you?  And do you think you
will be able to achieve it?

For the tooltip placement, have a look at the attached demo app in
this old thread.
http://apache-pivot-users.399431.n3.nabble.com/tooltip-not-in-main-window-tp2396170p2425236.html
It places tooltips in an external, undecorated OS window, freeing them
from the restriction of being kept within the bounds of the main host
frame.
I imagine you could use a similar technique to control the placement
and scaling of tooltips (without going as far as creating new OS
windows).

Chris


On 23 July 2011 07:05, Bill van Melle <[email protected]> wrote:
> So now the most significant thing that doesn't work that I care about
> is tooltip placement.  I don't see any way to get that without
> modifying Pivot sources.  The most straightforward way would seem to
> be to modify Component#mapPointToAncestor and add a new Container
> method that I can override.
>
> ---- Component.java ----
>
>  public Point mapPointToAncestor(Container ancestor, int x, int y) {
>    return mapPointToAncestor(ancestor, new Point(x, y));
>  }
>
>  public Point mapPointToAncestor(Container ancestor, Point location) {
>    if (location == null) {
>      throw new IllegalArgumentException();
>    }
>
>    if (ancestor == null) {
>      throw new IllegalArgumentException("ancestor is null");
>    }
>
>    Component component = this;
>
>    if (component != ancestor) {
>        Container container = parent;
>        while (container != null) {
>            location = container.mapChildPointToContainer(component, location);
>            if (container == ancestor)
>                break;
>            component = container;
>            container = container.getParent();
>        }
>    }
>    return location;
>  }
>
> ---- Container.java ----
>
>  public Point mapChildPointToContainer(Component child, Point location) {
>    return location.translate(child.getX(), child.getY());
>  }
>
> ---- end ----
>
> Unlike the current mapPointToAncestor, this one conses, but maybe it's
> not used in any place that cares so much about performance?  For
> completeness, you'd also need to change mapPointFromAncestor in a
> similar way.
>
> I've tested the above, and it does what I want, more or less (the
> tooltip isn't scaled, but maybe it's just as well).  As a bonus,
> ListButton and CalendarButton pop up in the correct place, though also
> not scaled (weird in the case of ListButton anyway).  But I'm guessing
> you'd prefer not to make a change like this so deep in the system only
> to allow an incomplete implementation of ScalePane to work.  So I
> invite other suggestions.
>

Reply via email to