more migrations in gui.js

pull/95/head
jmoenig 2020-04-16 14:27:33 +02:00
rodzic 6a0fc1802e
commit 066eb201a1
1 zmienionych plików z 6 dodań i 31 usunięć

Wyświetl plik

@ -1211,7 +1211,6 @@ IDE_Morph.prototype.createPalette = function (forSearching) {
this.palette.toolBar.padding = 1; this.palette.toolBar.padding = 1;
// this.palette.toolBar.hint = 'Cancel'; // this.palette.toolBar.hint = 'Cancel';
this.palette.toolBar.labelShadowColor = new Color(140, 140, 140); this.palette.toolBar.labelShadowColor = new Color(140, 140, 140);
this.palette.toolBar.drawNew();
this.palette.toolBar.fixLayout(); this.palette.toolBar.fixLayout();
this.palette.add(this.palette.toolBar); this.palette.add(this.palette.toolBar);
*/ */
@ -1803,8 +1802,6 @@ IDE_Morph.prototype.fixLayout = function (situation) {
flag, flag,
maxPaletteWidth; maxPaletteWidth;
Morph.prototype.trackChanges = false;
if (situation !== 'refreshPalette') { if (situation !== 'refreshPalette') {
// controlBar // controlBar
this.controlBar.setPosition(this.logo.topRight()); this.controlBar.setPosition(this.logo.topRight());
@ -1902,9 +1899,6 @@ IDE_Morph.prototype.fixLayout = function (situation) {
this.corral.fixLayout(); this.corral.fixLayout();
} }
} }
Morph.prototype.trackChanges = true;
this.changed();
}; };
IDE_Morph.prototype.setProjectName = function (string) { IDE_Morph.prototype.setProjectName = function (string) {
@ -3774,7 +3768,9 @@ IDE_Morph.prototype.popupMediaImportDialog = function (folderName, items) {
if (isSound) { if (isSound) {
icon = new SoundIconMorph(new Sound(new Audio(), item.name)); icon = new SoundIconMorph(new Sound(new Audio(), item.name));
} else { } else {
icon = new CostumeIconMorph(new Costume(turtle.image, item.name)); icon = new CostumeIconMorph(
new Costume(turtle.getImage(), item.name)
);
} }
icon.isDraggable = false; icon.isDraggable = false;
icon.userMenu = nop; icon.userMenu = nop;
@ -3823,7 +3819,6 @@ IDE_Morph.prototype.popupMediaImportDialog = function (folderName, items) {
dialog.popUp(world); dialog.popUp(world);
dialog.setExtent(new Point(400, 300)); dialog.setExtent(new Point(400, 300));
dialog.setCenter(world.center()); dialog.setCenter(world.center());
dialog.drawNew();
handle = new HandleMorph( handle = new HandleMorph(
dialog, dialog,
@ -4215,13 +4210,13 @@ IDE_Morph.prototype.exportScriptsPicture = function () {
// collect all script pics // collect all script pics
this.sprites.asArray().forEach(function (sprite) { this.sprites.asArray().forEach(function (sprite) {
pics.push(sprite.image); pics.push(sprite.getImage());
pics.push(sprite.scripts.scriptsPicture()); pics.push(sprite.scripts.scriptsPicture());
sprite.customBlocks.forEach(function (def) { sprite.customBlocks.forEach(function (def) {
pics.push(def.scriptsPicture()); pics.push(def.scriptsPicture());
}); });
}); });
pics.push(this.stage.image); pics.push(this.stage.getImage());
pics.push(this.stage.scripts.scriptsPicture()); pics.push(this.stage.scripts.scriptsPicture());
this.stage.customBlocks.forEach(function (def) { this.stage.customBlocks.forEach(function (def) {
pics.push(def.scriptsPicture()); pics.push(def.scriptsPicture());
@ -4899,7 +4894,6 @@ IDE_Morph.prototype.saveFileAs = function (
world world
); );
dialog.fixLayout(); dialog.fixLayout();
dialog.drawNew();
} }
}; };
@ -5167,7 +5161,6 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) {
this.isAppMode = isNil(appMode) ? !this.isAppMode : appMode; this.isAppMode = isNil(appMode) ? !this.isAppMode : appMode;
Morph.prototype.trackChanges = false;
if (this.isAppMode) { if (this.isAppMode) {
this.wasSingleStepping = Process.prototype.enableSingleStepping; this.wasSingleStepping = Process.prototype.enableSingleStepping;
if (this.wasSingleStepping) { if (this.wasSingleStepping) {
@ -5221,7 +5214,7 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) {
// update undrop controls // update undrop controls
this.currentSprite.scripts.updateToolbar(); this.currentSprite.scripts.updateToolbar();
} }
this.setExtent(this.world().extent()); // resume trackChanges this.setExtent(this.world().extent());
}; };
IDE_Morph.prototype.toggleStageSize = function (isSmall, forcedRatio) { IDE_Morph.prototype.toggleStageSize = function (isSmall, forcedRatio) {
@ -5477,15 +5470,6 @@ IDE_Morph.prototype.userSetBlocksScale = function () {
sample.add(shield); sample.add(shield);
action = function (num) { action = function (num) {
/*
var c;
blck.setScale(num);
blck.drawNew();
blck.setSpec(blck.blockSpec);
c = blck.inputs()[0];
c.setScale(num);
c.nestedBlock(scrpt);
*/
scrpt.blockSequence().forEach(function (block) { scrpt.blockSequence().forEach(function (block) {
block.setScale(num); block.setScale(num);
block.setSpec(block.blockSpec); block.setSpec(block.blockSpec);
@ -8858,7 +8842,6 @@ WardrobeMorph.prototype.updateList = function () {
y = this.top() + 5, y = this.top() + 5,
padding = 4, padding = 4,
toolsPadding = 5, toolsPadding = 5,
oldFlag = Morph.prototype.trackChanges,
oldPos = this.contents.position(), oldPos = this.contents.position(),
icon, icon,
txt, txt,
@ -8866,8 +8849,6 @@ WardrobeMorph.prototype.updateList = function () {
cambutton; cambutton;
this.changed(); this.changed();
oldFlag = Morph.prototype.trackChanges;
Morph.prototype.trackChanges = false;
this.contents.destroy(); this.contents.destroy();
this.contents = new FrameMorph(this); this.contents = new FrameMorph(this);
@ -8965,7 +8946,6 @@ WardrobeMorph.prototype.updateList = function () {
this.contents.setPosition(oldPos); this.contents.setPosition(oldPos);
this.adjustScrollBars(); this.adjustScrollBars();
Morph.prototype.trackChanges = oldFlag;
this.changed(); this.changed();
this.updateSelection(); this.updateSelection();
@ -9321,15 +9301,12 @@ JukeboxMorph.prototype.updateList = function () {
x = this.left() + 5, x = this.left() + 5,
y = this.top() + 5, y = this.top() + 5,
padding = 4, padding = 4,
oldFlag = Morph.prototype.trackChanges,
icon, icon,
txt, txt,
ide = this.sprite.parentThatIsA(IDE_Morph), ide = this.sprite.parentThatIsA(IDE_Morph),
recordButton; recordButton;
this.changed(); this.changed();
oldFlag = Morph.prototype.trackChanges;
Morph.prototype.trackChanges = false;
this.contents.destroy(); this.contents.destroy();
this.contents = new FrameMorph(this); this.contents = new FrameMorph(this);
@ -9379,9 +9356,7 @@ JukeboxMorph.prototype.updateList = function () {
}); });
this.soundsVersion = this.sprite.sounds.lastChanged; this.soundsVersion = this.sprite.sounds.lastChanged;
Morph.prototype.trackChanges = oldFlag;
this.changed(); this.changed();
this.updateSelection(); this.updateSelection();
}; };