add API procedure, Michael review

pull/29/head
brianharvey 2016-12-29 23:44:02 -08:00
rodzic 954b2f828f
commit e4f8751fce
3 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -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(

Wyświetl plik

@ -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];
});

Wyświetl plik

@ -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) {