summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-02-13 17:50:43 +0100
committerjmoenig <jens@moenig.org>2014-02-13 17:50:43 +0100
commit03b69769bea849923864ea636d44a3a01c690789 (patch)
treefe1760ad09886cc56457420f8a625c2d2bd3b369
parent2c7d747bfc65882ae27c81d226484b98e1894a1c (diff)
downloadsnap-yow-03b69769bea849923864ea636d44a3a01c690789.tar.gz
snap-yow-03b69769bea849923864ea636d44a3a01c690789.zip
GUI: Use new vector prompter for stage dimensions
also take out previous experimental code and make this new feature an official one
-rw-r--r--gui.js65
-rwxr-xr-xhistory.txt1
2 files changed, 14 insertions, 52 deletions
diff --git a/gui.js b/gui.js
index 2445aa3..0f4f2eb 100644
--- a/gui.js
+++ b/gui.js
@@ -2067,20 +2067,10 @@ IDE_Morph.prototype.settingsMenu = function () {
'Zoom blocks...',
'userSetBlocksScale'
);
- if (shiftClicked) {
- menu.addItem(
- 'Stage width...',
- 'userSetStageWidth',
- null,
- new Color(100, 0, 0)
- );
- menu.addItem(
- 'Stage height...',
- 'userSetStageHeight',
- null,
- new Color(100, 0, 0)
- );
- }
+ menu.addItem(
+ 'Stage size...',
+ 'userSetStageSize'
+ );
menu.addLine();
addPreference(
'Blurred shadows',
@@ -3487,52 +3477,23 @@ IDE_Morph.prototype.setBlocksScale = function (num) {
// IDE_Morph stage size manipulation
-IDE_Morph.prototype.userSetStageWidth = function () {
- new DialogBoxMorph(
- this,
- this.setStageWidth,
- this
- ).prompt(
- "Stage width",
- StageMorph.prototype.dimensions.x.toString(),
- this.world(),
- null, // pic
- null, // choices
- null, // read only
- true // numeric
- );
-};
-
-IDE_Morph.prototype.userSetStageHeight = function () {
+IDE_Morph.prototype.userSetStageSize = function () {
new DialogBoxMorph(
this,
- this.setStageHeight,
+ this.setStageExtent,
this
- ).prompt(
- "Stage height",
- StageMorph.prototype.dimensions.y.toString(),
+ ).promptVector(
+ "Stage size",
+ StageMorph.prototype.dimensions,
+ new Point(480, 360),
+ 'Stage width',
+ 'Stage height',
this.world(),
null, // pic
- null, // choices
- null, // read only
- true // numeric
+ null // msg
);
};
-IDE_Morph.prototype.setStageWidth = function (num) {
- this.setStageExtent(new Point(
- num,
- (StageMorph.prototype.dimensions.y)
- ));
-};
-
-IDE_Morph.prototype.setStageHeight = function (num) {
- this.setStageExtent(new Point(
- (StageMorph.prototype.dimensions.x),
- num
- ));
-};
-
IDE_Morph.prototype.setStageExtent = function (aPoint) {
var myself = this,
world = this.world(),
diff --git a/history.txt b/history.txt
index cd555bc..80596a9 100755
--- a/history.txt
+++ b/history.txt
@@ -2101,3 +2101,4 @@ ______
* GUI, Store: constrain minimum stage size to 480 x 180
* GUI: Fixed #322, #324
* Widgets: new “promptVector” dialog box feature
+* GUI: Use new vector prompter for stage dimensions