kopia lustrzana https://github.com/backface/turtlestitch
add API procedure, Michael review
rodzic
954b2f828f
commit
e4f8751fce
|
@ -7558,12 +7558,11 @@ InputSlotMorph.prototype.dropDownMenu = function (enableKeyboard) {
|
|||
menu.addLine();
|
||||
// } else if (key.indexOf('§_def') === 0) {
|
||||
// menu.addItem(choices[key].blockInstance(), choices[key]);
|
||||
} else if (key.charAt(key.length - 1) == '{') {
|
||||
} else if (key[key.length - 1] == '{') {
|
||||
// Submenu
|
||||
// 0x25ba = Unicode "BLACK RIGHT-POINTING POINTER"
|
||||
// (not to be confused with "black right-pointing TRIANGLE")
|
||||
menu.addItem(key.substring(0,key.length - 1).
|
||||
concat(String.fromCharCode(0x25ba)),
|
||||
menu.addItem(key.substring(0,key.length - 1) + '\u25ba',
|
||||
choices[key]);
|
||||
menuStack.push(menu);
|
||||
menu = new MenuMorph(
|
||||
|
|
3
byob.js
3
byob.js
|
@ -299,8 +299,7 @@ CustomBlockDefinition.prototype.dropDownMenuOf = function (inputName) {
|
|||
var pair = line.split('='),
|
||||
unique = pair[0];
|
||||
if (unique == '~' || unique == '}') {
|
||||
unique = unique.concat(gensym.toString());
|
||||
gensym++;
|
||||
unique += gensym++;
|
||||
};
|
||||
dict[unique] = isNil(pair[1]) ? unique : pair[1];
|
||||
});
|
||||
|
|
|
@ -7519,6 +7519,10 @@ MenuMorph.prototype.addLine = function (width) {
|
|||
this.items.push([0, width || 1]);
|
||||
};
|
||||
|
||||
MenuMorph.prototype.addSubmenu = function (key, submenu) {
|
||||
this.addItem(key, key, , , , , , submenu);
|
||||
|
||||
|
||||
MenuMorph.prototype.createLabel = function () {
|
||||
var text;
|
||||
if (this.label !== null) {
|
||||
|
|
Ładowanie…
Reference in New Issue