HierMenus CENTRAL: HierMenus In Progress. Menu Placement and the Top Left Corner (1/2)
When TLC Isn't Enough
D.M Ragle, December 11, 2003
A common question asked by HM implementors is how to position the menus based not on the TLC of the menu, but instead based on one of the other coordinates. For example, in designs that pop up menus from the lower portion of the screen, the bottom left corner might be more appropriate. And for designs that pop up menus from the right edge of the screen (common in pages where right-to-left directionality is employed, see Bulletin 9 for more HM-specific information), top right corner positioning is called for. Though HM does not directly support such positioning schemes, using the coordinates-as-expressions feature described above in combination with a small amount of custom code that we will provide in this article will allow you to provide coordinates relative to the menu corner most appropriate for your specific design.
Which Corner is Which?
As mentioned above, top level menus in HierMenus can be positioned
top left corner of the menu (each coordinate can be retrieved via a separate function).
For permanently displayed menus, such coordinates are a required element of your menu
configurations. For pop up menus they are optional, as all top-level pop up menus assume
the current location of the mouse for the position of the top left corner of the menu.
of HM 4.0.10), this means that the following two menu configurations will behave
HM_Array1 = [ [120, // menu width , // left_position ], // top_position ["Experts","/experts/",1,0,0], ["Contents","/index2.html",1,0,0] ] HM_Array2 = [ [120, // menu width "mouse_x_position", // left_position "mouse_y_position"], // top_position ["Experts","/experts/",1,0,0], ["Contents","/index2.html",1,0,0] ]
Created: December 11, 2003
Revised: December 11, 2003