sorry for the perhaps simple question, but I hadn't seen it anywhere. What's the syntax to implement keypress trapping for the menus?
Thanks in advance.
Help using keypress
i had seen that.. maybe i just misunderstand how the module works. for example: Can you assign it so when i hit 's', it would open up a particular menu? Or you just tab to the menu and can then navigate it.
Or what about being able to hit a key, give focus to the menu, and then use the arrow keys to navigate it? Sounds like it might involve some scripting on my end?
Or what about being able to hit a key, give focus to the menu, and then use the arrow keys to navigate it? Sounds like it might involve some scripting on my end?
Ok... update time
I modified my javascript method to do
So when i hit the correct key combination, "mymenu" correctly pops up, and the first item (itemref of 33) is selected, and I can then key through the menus using the keypress module.... HOWEVER there is one problem...
the menu is declared (abbreviated) as
The menu i pop'ed up (mymenu) appears underneath the main horizontal menu so the first item is obscured by the horizontal bar. If I click and open "mymenu" first, close it, and THEN use my javascript method above, everything renders correctly. The only thing I can figure is some internal milonic method sets some values for display that the popup() function does not.
Any thoughts?

I modified my javascript method to do
Code: Select all
function pressed(){
popup("mymenu");
_popi(33);
}
the menu is declared (abbreviated) as
Code: Select all
<div>
with(milonic=new menuname("main")){
alwaysvisible=1;
orientation="horizontal";
style=barMenuStyle;
top=66;
left=10;
aI("showmenu=mymenu";);
aI("text=other items";);
}
with(milonic=new menuname("mymenu")){
style=mainStyle;
overflow="scroll";
left=56;top=66;
aI("text=Item Ref 33";);
aI("text=Other items";);
}
drawMenus();
</div>
Any thoughts?
Hi,
I'm sorry I don't have any thoughts on it. I know that for actual pop up menus you can set position, if these are just regular showmenu, then they should just automatically drop right below the horizontal menu. Maybe the info on the pop menus would give you some direction?
http://milonic.com/menu_methods.php
It's down toward the bottom of the page.
Ruth
I'm sorry I don't have any thoughts on it. I know that for actual pop up menus you can set position, if these are just regular showmenu, then they should just automatically drop right below the horizontal menu. Maybe the info on the pop menus would give you some direction?
http://milonic.com/menu_methods.php
It's down toward the bottom of the page.
Ruth
Yes, I understood what you meant, the first item of the submenu is hidden by the horizontal menu, right?Shap5202 wrote:The menu i pop'ed up (mymenu) appears underneath the main horizontal menu so the first item is obscured by the horizontal bar. If I click and open "mymenu" first, close it, and THEN use my javascript method above, everything renders correctly
OK, here's what I think is happening...not for any knowledge of the programming on position but because it seems logical based on the different things the program does as to submenu position.
1. With a horizontal main menu, subOffsetTop does not 'function' any submenu automatically opens at the 'bottom' of the horizontal menu.
2. The menu gets the position of the sub based on the position of the parent item.
3. When you use the keypress and your function to open the submenu BEFORE it has been opened by the mouse and therefore has found its position based on the internal programming and the position of the parent item it doesn't have a position figured for it.
4. With pop menus, when you open them, [this is more or less what you're doing with your function is opening the submenu as a pop up] when you open them using the pop function and just the menu name they will open based on the position set in the data file, however since the subOffsetTop isn't an active function with submenus opening from first level horizontal menus in essense there is no position set in the data file.
5. You can set offsets of pop ups if say it's opening based on an image on the page i.e. ("menuname","imagename",10,-10); Of course you don't have an image, but what I was wondering is if you could just eliminate the iamge part and include the offset part and see if that fixed your problem.
Now, having written all that, it may be totally wrong because I don't know programming, nor functions, it is just what seems logical based on what I do know about the spos and gpos from the methods and functions page, so put "I think" after each one of my statements and suggestions

Ruth