How to add tooltip to images?

How to add tooltips to images?

OK, here is a more robust, more generic (any node) implementation.
It would be nice if I could find a way to automatically insert the tooltips in the scene, but at time of node with tooltip creation, scene doesn't exist yet... Should have a post-layout event, perhaps. Or I can do that once on the onMouseEntered event, but then I have to find a way to get the scene holding a given node. Tried to iterate on Parents, but I can't cast a Parent to a Scene?
Anyway, here is the new code:
Tooltip.fx
public class Tooltip extends CustomNode
  public var text: String;
  public var fill: Paint = Color.web('#EEFF00');
  public var stroke: Paint = Color.GREEN;
  var label: Label; // Make public to access textOverrun, textWrap, etc.?
  var back: Rectangle;
  override function create(): Node
    label = Label
      text: text
    back = Rectangle
      x: -2, y: -1
      width:  label.width + 4
      height: label.height + 2
      fill:   fill
      stroke: stroke
    Group
      content: [ back, label ]
  init
    visible = false;
    layoutInfo.managed = false;
WithTooltip.fx
public mixin class WithTooltip
  /** The tooltip to display. */
  public var tooltip: Tooltip;
  // We display the tooltip after a while being over the node
  var tooltipTL = Timeline
    keyFrames: KeyFrame
      time: 750ms
      action: function ()
//~         println("visible {%.0f tooltip.boundsInParent.minX} {%.0f tooltip.boundsInParent.minY}");
        tooltip.visible = true;
  var baseMouseMoved;
  var baseMouseEntered;
  var baseMouseExited;
  postinit
    var tooltipNode = this as Node;
    baseMouseMoved = tooltipNode.onMouseMoved;
    tooltipNode.onMouseMoved = function (evt: MouseEvent): Void
      if (not tooltip.visible)
        tooltip.translateX = evt.sceneX;
        tooltip.translateY = evt.sceneY - 20;
      baseMouseMoved(evt);
    baseMouseEntered = tooltipNode.onMouseEntered;
    tooltipNode.onMouseEntered = function (evt: MouseEvent): Void
//~       println("onMouseEntered: {%.0f evt.sceneX} {%.0f evt.sceneY}");
      tooltipTL.playFromStart();
      baseMouseEntered(evt);
    baseMouseExited = tooltipNode.onMouseExited;
    tooltipNode.onMouseExited = function (evt: MouseEvent): Void
//~       println("onMouseExited");
      tooltipTL.stop();
      tooltip.visible = false;
      baseMouseExited(evt);
SomeStage.fx
class ImageWithTooltip extends ImageView, WithTooltip
var earthTT = Tooltip { text: "Mother Earth" }
var earth = ImageWithTooltip
     image: Image { url: "{__DIR__}earth.png" }
     tooltip: earthTT;
var mapTT = Tooltip { text: "General map of France" }
var map = ImageWithTooltip
     image: Image { url: "{__DIR__}map.jpg", width: 200, preserveRatio: true }
     tooltip: mapTT;
// Put the ImageWithTooltip nodes in layout if needed, put the Tooltip nodes at the end of the scene (on top, out of any layout).

Similar Messages

  • HOW TO ADD TEXT TO IMAGES

    how do you add text to images in Aperture?

    the user can superimpose text (inc. metadata) anywhere: on the image, in the border, over both.
    Learn something new every single day...
    Regards
    TD

  • How to add tooltip on dashboard

    Hi all,
    How can I add tooltip on Dashboard (shown in picture)? I have tried this by adding Comment on dashboard while creating it. But It did not show comment just name of dashboard in tootip.
    http://img686.imageshack.us/img686/5295/tooltip.png
    Thanks all

    Hi
    Add description in Description field, of properties for dashboard.
    Regards
    Kishore Guggilla

  • How to add Tooltip to the Iview name.

    hi all,
         I have to add tooltips to the iview name. When I bring the mouse over the iview
         name a message should display as the tooltip describing the purpose of the
         iview I am not able to found the tooltip option in the iview properties.
         Is there any coding involved for tooltips option or any other options available.
         Please guide me. Looking for the fast reply.
         Thanks in advance.
    Ponnusamy.P

    hi Deepti,
         When I gave the descripition, tool tip appears in the
         Content Admin -> Portal Content -> (Under the folder I have created the Iview).
         But the tool tips should appear in the iview when I display that iview to the end
         user.How to make that possible.
    Thanks
    Ponnusamy P

  • How to add audio to image sequence?

    I've imported a Photoshop image sequence into FCP X 10.1.1.  Dropped it on the timeline, created a compound clip.  So far I can't figure out how to add audio of any kind.  I've tried starting over, making sure properties had audio setting enabled.  No change though.  No matter what I try, no audio tab in the inspector.  What am I missing?
    Thanks,
    Michael

    Are you importing an audio file that is seperate? Otherwise it is attached to your video. in the timeline, choose expand audio & video. You can import almost any format. Import it into the same event that you are in - a song from your desktop or from your folder where you copied all your contents from your camera card or music from ITunes (in which case you use the audio tab on the far right of the timeline UNDER THE INSPECTOR).
    How did you import your media?:
    Help?

  • How to add two different images on photoshop cs5?

    I was learning about the layers and masks and i seen that i have to have two images under each others under the layer option pannel, i tried many times to add images but it always shows in two different pannels as the folloing image I want to add two different images in this pannel to make any changes i want
    Thank you.
    image

    When you click on that icon Photoshop will add a revail all white layer mask and it will be the Photoshop target. Begin painting with black over the image part you wish to hide. Should you paint away something you want change to white paint and paint it back. Lower the brush opacity to fade in and out the image part.
    If you use ALT+Click on that icon a hide all black layer mask will be added as the current taget and hide all of the layer paint with whits to show.

  • How to add styles to image in XML view ?

    Is it possible to add styles to Images in XML view ?
    <Image alt="alternate text " src = " " />
    I tried adding sytle= "align : right " but its not working. I just want to align this element in the view to the right.

    Hi Micheal,
    Pleas see the below code.
    View:
    <core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
      controllerName="testing.imageXml" xmlns:html="http://www.w3.org/1999/xhtml">
      <Page title="Image">
      <content>
      <Image id="img1" alt="alttextimage" src="images/img1.jpg" />
      </content>
      </Page>
    </core:View>
    Controller:
    onBeforeRendering: function() {
      this.getView().byId("img1").addStyleClass("myimage");
    Index.html :
    <!DOCTYPE HTML>
    <html>
      <head>
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
      <script src="resources/sap-ui-core.js"
      id="sap-ui-bootstrap"
      data-sap-ui-libs="sap.m,sap.ui.commons"
      data-sap-ui-theme="sap_bluecrystal">
      </script>
      <script>
      sap.ui.localResources("testing");
      var app = new sap.m.App({initialPage:"idhome1"});
      var page = sap.ui.view({id:"idhome1", viewName:"testing.imageXml", type:sap.ui.core.mvc.ViewType.XML});
      app.addPage(page);
      app.placeAt("content");
      </script>
      <style>
      .myimage{float:right !important; width:300px; height:200px;}
      </style>
      </head>
      <body class="sapUiBody" role="application">
      <div id="content"></div>
      </body>
    </html>
    Output :
    Regards,
    KK

  • How to add, JS and image files in portalapp.xml

    Hi All,
    I was trying to implement multiple level hover detailed navigation in iview for which I got couple of css scripts from web which include javascripts.
    I placed these files in respective folders and their reference in header.jsp but when the iview is rendered in browser the reference is changing to .htm
    So please help me out how to place these script / image files in PAR file and their reference in portalapp.xml & header.jsp.
    Thanks in advance,
    Sai Krishna.

    1) The CSS file you have , save as "jsp" file and please place in the jsp folder.
    suppose your jsp is header.jsp and your css file is header_style.jsp
    include the css jsp - header_style.jsp in header.jsp like
    <%-- an include clause for css file --%>
    <%@ include file="header_style.jsp" %>
    2) All your images , please place in the "images" folder.
    3) To access the images use like below: in CSS file (jsp)
    in header_style.jsp
    yourimage: url(<%=mimeUrl%>/images/Border.gif);
    in header.jsp
    <%
    String mimeUrl = componentRequest.getWebResourcePath();
    %>
    4) more info for creating the hover menu read this blog
    https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4913
    Hope this will help you.

  • How to add link and image in oaf iprocurement stores page?

    Hi Every1,
    I have requirement to in iprocurement stores page. Already there are certain links ( a meaning full image+link ), by click on image or link it will take you to the
    required page.
    I need to add one more like that.
    How can i do this ?
    I know thru personalizations we can add links to the page, but how can i add image to that link. so that click of anyone will take to the req page.
    Thanks,
    Arun Peddi

    Hi,
    Here is one way of putting an image in the header:
    <fo:layout-master-set>
        <fo:simple-page-master master-name="my-page">     
          <fo:region-body margin="1in"/>
          <fo:region-before extent="1in" background-color="silver" />
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="my-page">
         <fo:static-content flow-name="xsl-region-before">
             <fo:block height="150px" width="1024px" background-color="white" >
                 <fo:external-graphic src="http://localhost:9000/web-determinations9000/images/Header.jpg">
                 </fo:external-graphic>
            </fo:block>
        </fo:static-content>
        <fo:flow flow-name="xsl-region-body">
        </fo:flow>
      </fo:page-sequence>One good XSL:FO refernce: http://www.learn-xsl-fo-tutorial.com
    Hope this helps.
    Thanks,
    Aakarsh
    Edited by: aakarsh on Apr 6, 2011 6:40 AM

  • How to add a file (image) to a saved book?

    I saved my book in LR.
    It shows up as a collection.
    How can I add an image to it?
    The folder from where I made the book doesn't show the created book anymore.

    Very simple solution:
    In Library module R-click on the book collection in question - a dialog box opens, select 'Set as Target Collection'.
    A '+' sign will then become visible next to the name of that collection.
    Then find the image that you want to add to that book and select it by clicking on it.
    Press 'B' as a shortcut to add that image to the collection.
    You are done!
    Tony Jay

  • Spry Photo Gallery - How to add links to images

    I was wondering if any one knew how I could add individual
    links to images on the spry Photo Gallery—An XML-based photo
    gallery. I need each image to have its own individual link when
    clicked on. Any assistance would be most helpful.

    Hi,
    In the dashboard --> edit option u can see dashboard object here u can see folder ...by this folder u just include dashboard page other wise in the catalog share folder u need create each and evry module pre planned folder then save it each dashboard pages to relevent module folder.
    THanks
    Deva

  • How to add a 3D image / layer to a flat image

    I'm new to 3D and have been given an assignment to add a 3D object to the flat image of a building facade. The building is a three story medical centre and the 3D object needs to demonstrate what a new elevator with advertising on three sides would potentially look like.
    Any suggestions or help in this regard would be greatly appreciated.
    I was trying to do this with CS4 extended, but have downloaded the CS6 Extended Trial version, if this can be done in CS6 then I can motivate to purchase the upgrade.
    Thanks
    Robin

    The elevator is nothing more than a box. So your job is quite easy in that you have the choice of using a true 3d object or fake it by skewing the 2d objects until it looks like it is a 3d box.
    Either way applying textures to a 3d object or clipping an image to the 2d object will result in the same illusion.
    Its up to you to decide on how much detail is needed and what will you need to learn to get that result. If you go the extra step and go the 3d route, you will find that the end result is much quicker minus the learning curve because it is much easier to align object to make it look correct.
    CS6's 3d tools now include extrusion so the handle for the elevator is easier to create since it starts with a 2d ellipse.
    Where you will have trouble is the mounts for the handle. Because photoshop does not have a way to manipulate the mesh to form it's shape.
    This can be done using a 3rd party app. There are some free ones available on the net. The most popular for free at the moment is Blender. It will do anything you need for your project. Including esporting it as an obj file which can then be imported into photoshop.
    If all you need is a box with the ads on the inside then photoshop CS6 can do it. Just slice the front so it does not show then replace the textures for each side. Done.

  • Anyone know how to add audio without image and still use autoplay feature?

    Does anyone know how I can add audio to a webpage without having to add an image and still be able to use the autoplay feature? Adding as hyperlink doesn't accomplish what I'm after. Thanks in advance for the education!

    You can use the "hidden" song file method...
    http://roddymckay.com/Satellite/CatchTheTide.html
    You don't have to hide it completely if you don't want to - just reduce it to a small dot.

  • How to add a remote image to a specific row

    Hello together,
    I try to build a table like that one from the AppStore.
    What I did was to create my own UITableViewCell and defined the space for images and text.
    Now I call this in the "cellForRowAtIndexPath" method.
    The Problem is, that I have to download the images from the web.
    So I threaded it that the table will not block (threadForImageLoading-method)
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    DetailCell *cell = (DetailCell *)[tableView dequeueReusableCellWithIdentifier:@"DetailCell"];
    if (cell == nil) {
    cell = [[[DetailCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"DetailCell"] autorelease];
    NSString *editString = [resultsArray objectAtIndex:indexPath.row];
    NSRange start = [editString rangeOfString:@" ["];
    NSString *place = [editString substringToIndex:start.location];
    NSString *dist = [editString substringFromIndex:start.location + 2];
    cell.distance.text = dist;
    cell.description.text = place;
    [NSThread detachNewThreadSelector:@selector(threadForImageLoading:) toTarget:self withObject:cell];
    return cell;
    - (void) threadForImageLoading:(DetailCell *) tableCell
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSData * imageLink;
    imageLink = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Californiablank_map.svg/298px-California_blankmap.svg.png"]];
    tableCell.imageFace.image = [UIImage imageWithData:imageLink];
    tableCell.contentMode = UIViewContentModeScaleAspectFill;
    [imageLink release];
    [pool release];
    I test it here with an fixed URL-String because I do not know how I can put more that one parameters to my method "threadForImageLoading". In my opinion I just can use one parameter ("withObject:").
    This cannot be but unfortunately I didn`t find the right usage to use more than one parameter.
    But the main question is: Is it enough to have the "tableCell" in the threadForImageLoading-method that every picture is placed at the correct row?
    Thanks alot for helping,
    Stephan

    TRY THIS
    GraphicConverter

  • How to add different background image for submenu items???

    Hi all,
    I'm pretty new to web design and CSS in particular. Here's my problem...
    I've got a Spry horizontal menu bar (untouched as yet), and I want to have a different background image for my submenu items than that of my menu items. From searching the internet I think that I need to apply a class to the submenu item (please correct me if I am wrong).
    How would I go about doing this and how would I assign the class to just the submenu items?
    Also ideally I want to have my first and last menu items to have rounded corners on one side (therefore making a rounded edge menu bar), is it possible to have a different background image for individual menu items? If so, how?
    Really appreciate any help!

    Thanks for the link! I've managed to sort the background issue, and it seems to be working fine!
    Just one little issue left to tackle...
    I want my text to be centered in my top menu items BUT aligned left in my drop down menu items. I have managed this but the text hugs the left hand side. I've tried adding a little margin to the left but that doesn't seem to affect anything???
    Here's my CSS... Any ideas which class I should be targeting or why adding the margin isn't working would save my tearing the rest of my hair out! thanks! (screenshot attached).
    @charset "UTF-8";
    /* SpryMenuBarHorizontal.css - Revision: Spry Preview Release 1.4 */
    /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
    LAYOUT INFORMATION: describes box model, positioning, z-order
    /* The outermost container of the Menu Bar, an auto width box with no margin or padding */
    ul.MenuBarHorizontal
        margin: 0;
        padding: 0;
        list-style-type: none;
        cursor: default;
        width: auto;
    /* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
    ul.MenuBarActive
        z-index: 1000;
    /* Menu item containers, position children relative to this container and are a fixed width */
    ul.MenuBarHorizontal li
        margin: 0;
        list-style-type: none;
        position: relative;
        text-align: left;
        cursor: pointer;
        width: 120px;
        float: left;
        height: 24px;
        padding-top: 0;
        padding-right: 0;
        padding-bottom: 0;
        padding-left: 0;
        background-repeat: repeat-x;
        background-color: #333333;
        background-image: url(../images/navbar_bg.jpg);
        border-right-width: 1px;
        border-left-width: 1px;
        border-right-style: solid;
        border-left-style: solid;
        border-right-color: #000000;
        border-left-color: #666666;
    ul.MenuBarHorizontal li li
        list-style-type: none;
        position: relative;
        text-align: left;
        cursor: pointer;
        width: auto;
        float: left;
        height: 24px;
        background-color: #333333;
        background-image: none;
        padding: 0;
        margin: 0;
        left: -1px;
    ul.MenuBarHorizontal li li a
        list-style-type: none;
        position: relative;
        text-align: left;
        cursor: pointer;
        float: left;
        height: 24px;
        background-image: none;
        font-size: 12px;
        font-weight: normal;
        border: 0px 0 0;
        width: 120px;
        font-family: Geneva, Arial, Helvetica, sans-serif;
        padding: 0;
        margin: 0;
    /* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
    ul.MenuBarHorizontal ul
        margin: 0;
        list-style-type: none;
        font-size: 100%;
        z-index: 1020;
        cursor: default;
        width: 120px;
        position: absolute;
        left: -1000em;
        height: 24px;
        padding-top: 0;
        padding-right: 0;
        padding-bottom: 0;
        padding-left: 0;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
        left: auto;
    /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
    ul.MenuBarHorizontal ul ul
        position: absolute;
        height: 24px;
        width: 120px;
        margin-top: -5%;
        margin-right: 0;
        margin-bottom: 0;
        margin-left: 95%;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
        left: auto;
        top: 0;
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarHorizontal li a
        display: block;
        cursor: pointer;
        text-decoration: none;
        font-style: normal;
        text-transform: capitalize;
        text-align: center;
        white-space: normal;
        padding: 0px;
        height: 24px;
        font-family: Geneva, Arial, Helvetica, sans-serif;
        font-size: 12px;
        font-weight: bold;
        color: #FFFFFF;
        line-height: 20px;
        margin: 0px;
    /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
    ul.MenuBarHorizontal li a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
        background-color: #000000;
        background-image: url(../images/navbar_bg_hover.jpg);
        background-repeat: repeat-x;
        line-height: 22px;
    ul.MenuBarHorizontal li li a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
        background-color: #000000;
        background-image: none;
        background-repeat: repeat-x;
        width: 120px;
        font-family: Geneva, Arial, Helvetica, sans-serif;
        font-size: 12px;
        font-weight: bold;
        color: #FFFFFF;
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenu
        background-repeat: repeat-x;
        background-position: 95% 50%;
        background-color: #333333;
        background-image: url(../images/navbar_bg.jpg);
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
        background-repeat: repeat-x;
        background-position: 95% 50%;
        background-color: #000000;
        background-image: url(../images/navbar_bg_hover.jpg);
    BROWSER HACKS: the hacks below should not be changed unless you are an expert
    /* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
    ul.MenuBarHorizontal iframe
        position: absolute;
        z-index: 1010;
    /* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
    @media screen, projection
        ul.MenuBarHorizontal li.MenuBarItemIE
        display: inline;
        f\loat: left;

Maybe you are looking for