Page 177 - DCAP408_WEB_PROGRAMMING
P. 177
Unit 10: Menus
“This is menu 3”, “It is quite a long menu”, “so it should also be”, Notes
“positioned so the top”, “edge is right under the”, “logo, but the
bottom”,
“edge may come close to”, “the bottom of the picture,”, “or may even
go below it.”,
“If you size and scroll the”, “window to try to force the”, “bottom
of the menu off below”,
“the bottom of the screen,”, “it will reposition itself”, “by
obscuring the logo.”
);
makeLayer (“arrow4”, “”,
“This is menu 4”, “It should be long enough”, “to be aligned with
the”,
“bottom of the picture, but”, “probably won’t reach the”, “logo.”
);
This looks like the menu definitions in the Customizing Flyout Menus section, except for the
line which defines a new position default. Let’s first look at the logic of what the line is doing,
and then describe the syntax.
1. The Flyouts will use the default positioning rules to put the top-left corner of the menu
near the top-right corner of the arrow image.
2. The IMG|m=m rule tells the Flyout code to compute the vertical middle of both the arrow
image and the menu, and position the menu so they are the same.
3. The picture|b>b rule says to compute the bottom of the image named picture and of the
menus, and make sure the bottom of the picture is positioned lower than (has a larger
number, representing the Y position) the bottom of the menu. If not, then move the menu
up so they align.
4. The logo|b-6<t rule will compute 6 pixels above the bottom of the image named logo and
the top of the menu, and make sure 6 pixels above the bottom of the logo is positioned
higher than (has a smaller number, again representing the Y position) the top of the menu.
If not, move the menu down so they align.
5. Make sure the menu is on the screen. First check horizontally, moving first to the left if it’s
off the right of the window, then to the right to make sure the left of the menu is visible.
Do the same vertically, first checking the bottom, then the top.
The way these rules are ordered means that the preference is for the menus to be aligned with
the middle of the arrow, the next preference is that they not go below the picture, but the
greatest preference is they not cover up the logo.
Task Discuss how Flyout Menus are positioned?
Self Assessment
Fill in the blanks:
12. Before you start coding, take some time to review the program’s features to make a
properly designed and categorized ..........................
LOVELY PROFESSIONAL UNIVERSITY 171