sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Tooltips?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 339 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      rickgraham
      last edited by

      (this is the second time I typed this as the first time, Sketchucation and my Safari threw up, but that is another post)

      Is there a way of adding tooltips to a ruby? The reason why I ask is because I have amassed quite a number of rubies and if I don't use a lot of them regularly I forget what is what.

      I don't want to upset anyone, but some of the names given on their rubies well, are confusing to me. Like I said if I use them regularly, then I do know what they are. Some direct examples in my plugins pulldown are: Contour Lines, Contours, and Lsystem.

      What I propose is that if I can hover over the plugin ruby name, a tooltip will appear that gives a short description of what the ruby is. Or even the bottom of the screen will tell me what it does, or a text box will appear, something. Is this something that is doable? And if so, is the code easily modified so that a layman such as I can change it to add it?

      Thanks for your consideration.

      Rick

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        Possible.

        The nature of the API encourages Toolbars to have tooltips and status text; but this is often overlooked on menu entries. (Not sure if menu items can use the tooltips, but can use the status text.)

        Toolbar items and menu items are really similar, but are often handled differently based on poor examples and habits.

        The "correct" way to add items to both toolbars and menus is to use a Command. Since Toolbar items require images, we are forced into using the Command class to populate the Toolbar. But for a menu, it is easier to add the method directly, but at the cost of the status text.

        At any rate, all plugin-ins should probably be using Commands to for both Toolbar items and Menu items. The following snippet shows an example of adding the same Command to both a Toolbar and a Menu. To modify existing plugins, you may need to create a new Command. Search the Plugin code for the menu section (typically near the end of the file) and you may need to add code similar to the following:

        cmd = UI;;Command.new("Say Hello") { UI.messagebox("Hello!") }
        cmd.tooltip = "Displays Hello Messagebox"
        cmd.status_bar_text = "Displays Hello Messagebox"
        # toolbar commands need images, menu commands do not
        # cmd.large_icon = 'c;\path\to\image_24x24px.png'
        # cmd.small_icon = 'c;\path\to\image_16x16px.png'
        
        tb = UI;;Toolbar.new("My Toolbar")
        tb.add_item(cmd)
        
        UI.menu("Plugins").add_item(cmd)
        
        

        Hi

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by

          Did I help, or just confuse you? πŸ˜„

          Hi

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement