Liberty BASIC Community Forum
« Tooltips »

Welcome Guest. Please Login or Register.
Feb 18th, 2018, 3:34pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Tooltips  (Read 93 times)
twebb96
New Member
Image


member is offline

Avatar




PM


Posts: 6
xx Tooltips
« Thread started on: Feb 1st, 2018, 1:14pm »

Hi Again all. Is there a way to make tooltips for non tools. I have a series of small bitmaps, displayed in a graphic box. I would like, if possible, that when you hover over an image it would pop up a tooltip with the name of the image. I have already accomplished this with a window popup, but when the tip comes up the main screen changes color because it loses focus. That is really annoying. Thanks in advance. Anton
« Last Edit: Feb 1st, 2018, 1:15pm by twebb96 » User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is online

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5655
xx Re: Tooltips
« Reply #1 on: Feb 2nd, 2018, 05:51am »

There will be other strategies, this relies on a grid of same sized images. If they are of variable size you will need to keep an positional array and check what image you are on.


Code:
    nomainwin
    WindowWidth = 600
    WindowHeight = 600
    UpperLeftX = Int((DisplayWidth - WindowWidth) /2)
    UpperLeftY = Int((DisplayHeight - WindowHeight) /2)
    graphicbox #main.g, 10, 10, 520, 520
    open "Graphicbox Names" for Window as #main
    #main.g "trapclose [quit]"
    #main.g "down ; fill black ; backcolor blue"

    'dummy up some names
    dim name$(25)
    for n= 0 to 25
        name$(n)="Image "+str$(n)
    next

    'draw some dummy images in a grid
    for x= 10 to 500 step 100
        for y = 10 to 500 step 100
            #main.g "place ";x;" ";y;" ; boxfilled ";x+50;" ";y+50
        next
    next

    'take a copy of how it looks
    #main.g "flush one"

    'set up for checking mouse
    #main.g "backcolor black ; color white"
    #main.g "when mouseMove [check]"
    wait

    [check]
    'where is the mouse?
    x=MouseX
    y=MouseY
    'where in the grid?
    xx=int(x/100)
    yy=int(y/100)
    z=xx+5*yy
    'near enough the image?
    if x>xx*100+25 and x<xx*100+75 and y>yy*100+25 and y<yy*100+75 then
        'draw the name
        #main.g "discard ; redraw one"
        #main.g "place ";x;" ";y;" ;\";name$(z)
    else
        'remove any old name and redisplay
        #main.g "discard ; redraw one"
    end if

    wait

    [quit]
    close #main
    end

 
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls