This behavior provides horizontal menu bar - top level container for popup menus.
Default style system of the engine does not provide default styling of menu bars. If your application needs menu bars use {sdk}/samples/menu/std-menu.css as a prototype.
No elements has this behavior applied by default. {sdk}/samples/menu/std-menu.css assumes that top level menu is defined by <ul id="menu-bar"> element.
Example of menu declaration in Sciter:
<ul id="menu-bar">
<li>
<caption>File</caption>
<menu>
<li id="file-open">Open File <span.accesskey>Ctrl+O</span></li>
<hr>
<li id="file-save">Save File <span.accesskey>Ctrl+S</span></li>
<li id="file-save-as">Save File as ...<span.accesskey>Ctrl+Shift+S</span></li>
</menu>
<li>
...
</ul>
behavior:menu-bar is not using any specific attributes.
No specific methods.
:owns-popup state flag is set on menu owner element ( menuOwnerElement above ) when menu is shown;:popup - is set on the <menu> element when it is shown.N/A
onControlEvent handler
var edit = $(input#some);
edit.onControlEvent = function(evt)
{
switch(evt.type) {
case Event.MENU_ITEM_CLICK: /* evt.target is the menu item */ break;
}
}
on() subscriptionvar edit = $(input#some);
edit.on("click", "li#file-open", function(evt) {
// 'this' here is that li#file-open item
});
include "decorators.tis"; @click @on "li#file-open" :: ... event handling code ...;