|
Post by rich357 on Jun 22, 2009 14:55:32 GMT -5
If you want a simple little multilevel navgation menu, similar to the javascript "slideout", then give this puppy a try.
I have found that in setting the key value is the trick to this. So what I came up with is quite easy. As setkey("") will accept strings, use "words" seperated by a space or delimiter. Then use word$ to check the value.
As you progress through a level, just check the next word value.
Since parent1 is not equal to parent2, then you can use child1 how ever many times you want in any other parent level.
[start]
cls
button #b1,"parent 1",[start] #b1 setkey("parent1")
a$=word$(EventKey$,1) if a$="parent1" then
button #b2,"child 1",[start] #b2 setkey("parent1 child1")
b$=word$(EventKey$,2) if b$="child1" then button #b3,"grand child 1",[start] end if
end if
print button #b1,"parent 2",[start] #b1 setkey("parent2")
if a$="parent2" then
button #b2,"child 1",[start] #b2 setkey("parent2 child1")
b$=word$(EventKey$,2) if b$="child1" then button #b3,"grand child 1",[start] end if
end if
wait
|
|