I want to build a menubar with buttons and pulldown in a wrapper (red background)
- How can I valign in middle the item pulldown (List) in closed condition? And stand at this position when I open the list?
- How can I see a vertical scrollbar? The count of the items is 8 and viewNum is 5. noScale has no effect.
- How can I achive, that onMouseLeave the pulldown is close?
In index.d.ts in export class List extends missing pulldownToggle?: boolean, noScale?: boolean
let container = new Container(0, 0, 900, 800).pos(100,100);
new Rectangle(700, 100, "#f99").addTo(container); // show menu size (as menuBarWrapper) and set background color
let menuBarWrapper = new Wrapper({
width: 700,
height: 100,
align: LEFT,
spacingH: 10,
valignInner: TOP
}).addTo(container);
let button1 = new Button({
label: new Label({text: "ok", bold: true, align: "center", color: "#444"}),
width: AUTO,
autoPaddingH: 20
})
let data = {
"MONSTERS":["Ghost", "Ghoul", "Vampire", "Werewolf", "Skeleton1", "Skeleton2", "Skeleton3", "Skeleton4"]
}
let pulldown = new List({
list: {menu:data, bloom:true, whither:true},
pulldown:true,
pulldownToggle: true,
viewNum: 5,
// height: 200,
noScale: true,
});
let button2 = new Button({
label: new Label({text: "PPP", bold: true, align: "center", color: "#000"}),
width: AUTO,
autoPaddingH: 20
})
let objs = [];
objs.push(button1, pulldown, button2)
menuBarWrapper.add(objs)