replaced property name for “enabled” with “isDisabled” for PushButtons

upd4.1
Jens Mönig 2017-09-25 11:45:07 +02:00
rodzic 251db7d473
commit 7ed29240c8
2 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -3648,6 +3648,7 @@ Fixes:
------
* GUI, Symbols: added “visible stepping” toggle button to the control bar
* fixed camera retina issues, thanks, Bernat!!
* Widgets: inverted property name for “enabled” to “isDisabled” for PushButtons
v4.1 Features:

Wyświetl plik

@ -168,7 +168,7 @@ PushButtonMorph.prototype.init = function (
this.hint = hint || null;
this.template = template || null; // for pre-computed backbrounds
// if a template is specified, its background images are used as cache
this.enabled = true;
this.isDisabled = false;
// initialize inherited properties:
TriggerMorph.uber.init.call(this);
@ -205,11 +205,10 @@ PushButtonMorph.prototype.mouseDownLeft = function () {
};
PushButtonMorph.prototype.mouseClickLeft = function () {
if (this.enabled) {
PushButtonMorph.uber.mouseClickLeft.call(this);
if (this.label) {
this.label.setCenter(this.center());
}
if (this.isDisabled) {return; }
PushButtonMorph.uber.mouseClickLeft.call(this);
if (this.label) {
this.label.setCenter(this.center());
}
};
@ -485,7 +484,7 @@ PushButtonMorph.prototype.createLabel = function () {
// PushButtonMorph states
PushButtonMorph.prototype.disable = function () {
this.enabled = false;
this.isDisabled = true;
this.forAllChildren(function (child) {
child.alpha = 0.3;
});
@ -493,7 +492,7 @@ PushButtonMorph.prototype.disable = function () {
};
PushButtonMorph.prototype.enable = function () {
this.enabled = true;
this.isDisabled = false;
this.forAllChildren(function (child) {
child.alpha = 1;
});