Scrolling Menus

This section will describe scrolling menus and how to use the mechanism with other elements.

Creating a Large Menu

You might wonder what happens if you create a menu with a lot of commands on it, such that all the items won't fit on the screen at once. will provide a scrolling mechanism that will allow you to scroll through the items.

If the available space is too small, arrows will appear on each end of the menu. If you move the mouse over the arrows, the menu will scroll up and down. If the available space is large enough, the arrows will not appear. Note that the exact behavior of the scrolling will depend on the current theme.

This behavior is automatic. You do not have to do anything in order to get scrolling menus. It will apply to menus on menubars, in popups or menulists. It is implemented using an ref_arrowscrollboxarrowscrollbox element. This element can be used to create a scrolling box with arrows.

The ref_arrowscrollboxarrowscrollbox can be used anywhere a regular box can be used. You don't have to use it in menus. It is always a vertical box and may contain any elements inside it. You could use it to implement a list when you don't want it to be a drop-down.

The following example shows how to create a scrolling list of buttons (you will need to resize the window to see the arrow buttons):

Example 5.4.1: /ex_5_4_1.xul.txt'>Source "examples/ex_5_4_1.xulONCLICKwindow.open('examples/ex_5_4_1.xul','xulex','chrome,resizable'); return false;View
<arrowscrollbox orientverticalflex1 <button labelRed/ <button labelBlue/ <button labelGreen/ <button labelYellow/ <button labelOrange/ <button labelSilver/ <button labelLavender/ <button labelGold/ <button labelTurquoise/ <button labelPeach/ <button labelMaroon/ <button labelBlack/ </arrowscrollbox

If you try this example, it will first open at full size. However, if you shrink the of the window, the scroll arrows will appear. Making the window larger again will cause the arrows to disappear.

You can set a CSS max- property on the ref_arrowscrollboxarrowscrollbox to limit the size of the scrolling box and thus make the arrows appear all the time.

The arrowscrollbox is mainly useful in menus and popups however.


Bhopal news
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
freelance web designer india ecommerce web developer | Ecommerce web design, software developer india | Web hosting India Windows hosting | India web hosting Windows hosting India | India software developer | web designer india