-
-
Save cleverca22/ae4bdcde92da16d222e91b6df35905b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ************************************************************************ | |
Copyright: | |
License: | |
Authors: | |
************************************************************************ */ | |
qx.Class.define("installer.MakePartition", | |
{ | |
extend : qx.ui.window.Window, | |
construct: function (device, start, size) { | |
this.base(arguments, "Create Partition"); | |
this.setLayout(new qx.ui.layout.VBox(10)); | |
this.setModal(false); | |
this.setShowMaximize(false); | |
this.setShowMinimize(false); | |
this.device = device; | |
this.start = start; | |
this.size = size; | |
this.createFields(); | |
}, | |
members: { | |
createFields: function () { | |
var form = new qx.ui.form.Form(); | |
var pre = new qx.ui.form.Spinner(0, 0, this.size); | |
pre.setRequired(true); | |
pre.addListener("changeValue", function (e) { | |
size.setMaximum(this.size - (pre.getValue() + post.getValue())); | |
}, this) | |
form.add(pre, "Space before"); | |
var size = new qx.ui.form.Spinner(0, this.size, this.size); | |
size.setRequired(true); | |
form.add(size, "Size"); | |
var post = new qx.ui.form.Spinner(0, 0, this.size); | |
post.setRequired(true); | |
post.addListener("changeValue", function (e) { | |
size.setMaximum(this.size - (pre.getValue() + post.getValue())); | |
}, this) | |
form.add(post, "Space after"); | |
var formView = new qx.ui.form.renderer.Single(form); | |
this.add(formView); | |
var create = new qx.ui.form.Button("Create"); | |
create.addListener("execute", function (e) { | |
console.log(pre.getValue(), size.getValue(), post.getValue()); | |
}); | |
this.add(create); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment