The problem was happening because when you're not over one of the treeview items, it reads the header and the header text isn't in the $var1 array so it comes back with $iIndex = -1.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Share this post

Link to post

Share on other sites

BrewManNH 1,037

BrewManNH 1,037

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Share this post

Link to post

Share on other sites

Jayson 0

Jayson 0

Hi again, I ran into another problem/bug?.. Well i'm not sure but i'll explain.

When I am filling the treeview by my ini loaded in array theres only 2 parts working the [A ...] & [AREA ...] subitem displaying tooltip correctly even on duplicated one.

DB.ini

[A ...]
HREF=URL you are linking to.
NAME=Name a section of the page.
TARGET=_blank | _parent | _self | _top | window name
TITLE=Suggested title for the document to be opened.
onclick=Script to run when the user clicks on this anchor.
onmouseover=When the mouse is over the link.
onmouseout=When the mouse is no longer over the link.
[ADDRESS]
address=t
[APP ...]
app=t
[APPLET ...]
CODE=The applet to run.
CODEBASE=Path to the applet class
WIDTH=Width of the applet
HEIGHT=Height of the applet
ALIGN=LEFT | RIGHT | TOP | MIDDLE | BOTTOM | BASELINE
VSPACE=vertical space between applet and surrounding text
HSPACE=horizontal space between applet and surrounding text
BORDER=empty space surrounding the applet
NAME=name of applet for reference by other applets
ARCHIVE=a compressed collection of applet components
MAYSCRIPT=If Java can use Javascript
[AREA ...]
HREF=URL you are linking to
ALT=alternate text if the image isn't displayed
SHAPE=RECT | CIRCLE | POLY | DEFAULT
COORDS=coordinates for the link area shape
TITLE=Short description of the area
TARGET=what frame to go to
NOHREF=this area is not a link
onclick=script action when the user clicks this area
onmouseover=t
onmouseout=t
[A ...]
HREF=URL you are linking to.
NAME=Name a section of the page.
TARGET=_blank | _parent | _self | _top | window name
TITLE=Suggested title for the document to be opened.
onclick=Script to run when the user clicks on this anchor.
onmouseover=When the mouse is over the link.
onmouseout=When the mouse is no longer over the link.
[ADDRESS]
address=t
[APP ...]
app=t
[APPLET ...]
CODE=The applet to run.
CODEBASE=Path to the applet class
WIDTH=Width of the applet
HEIGHT=Height of the applet
ALIGN=LEFT | RIGHT | TOP | MIDDLE | BOTTOM | BASELINE
VSPACE=vertical space between applet and surrounding text
HSPACE=horizontal space between applet and surrounding text
BORDER=empty space surrounding the applet
NAME=name of applet for reference by other applets
ARCHIVE=a compressed collection of applet components
MAYSCRIPT=If Java can use Javascript
[AREA ...]
HREF=URL you are linking to
ALT=alternate text if the image isn't displayed
SHAPE=RECT | CIRCLE | POLY | DEFAULT
COORDS=coordinates for the link area shape
TITLE=Short description of the area
TARGET=what frame to go to
NOHREF=this area is not a link
onclick=script action when the user clicks this area
onmouseover=t
onmouseout=t
[A ...]
HREF=URL you are linking to.
NAME=Name a section of the page.
TARGET=_blank | _parent | _self | _top | window name
TITLE=Suggested title for the document to be opened.
onclick=Script to run when the user clicks on this anchor.
onmouseover=When the mouse is over the link.
onmouseout=When the mouse is no longer over the link.
[ADDRESS]
address=t
[APP ...]
app=t
[APPLET ...]
CODE=The applet to run.
CODEBASE=Path to the applet class
WIDTH=Width of the applet
HEIGHT=Height of the applet
ALIGN=LEFT | RIGHT | TOP | MIDDLE | BOTTOM | BASELINE
VSPACE=vertical space between applet and surrounding text
HSPACE=horizontal space between applet and surrounding text
BORDER=empty space surrounding the applet
NAME=name of applet for reference by other applets
ARCHIVE=a compressed collection of applet components
MAYSCRIPT=If Java can use Javascript
[AREA ...]
HREF=URL you are linking to
ALT=alternate text if the image isn't displayed
SHAPE=RECT | CIRCLE | POLY | DEFAULT
COORDS=coordinates for the link area shape
TITLE=Short description of the area
TARGET=what frame to go to
NOHREF=this area is not a link
onclick=script action when the user clicks this area
onmouseover=t
onmouseout=t

Your original code was only getting the last value of $var1 when it came out of the TV building loop so that is why it wouldn't show tooltips for all of the elements in the TV. I created a new array to grab the current contents of $var1 during each loop and then added the new contents the next time through the loop until it finished. The only thing I didn't account for is if you have elements with the same names, you will get the wrong tooltips because the array search will only return the first item found. You will see that with the tooltip from the onmouseover in section A... will show up for every onmouseover element you have in the treeview, as an example.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.