X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTWidget.java;h=d6864db746316659ef5d3ed4fed3cc76b0934d6a;hb=a83fea2bae838f4b9bbf59ce3832e0e67be41378;hp=2a92d09d25c429a6afe916f80f055a54156e5a2e;hpb=34a42e784bf1238c6bb2847c52d7c841fcfdef5f;p=fanfix.git diff --git a/src/jexer/TWidget.java b/src/jexer/TWidget.java index 2a92d09..d6864db 100644 --- a/src/jexer/TWidget.java +++ b/src/jexer/TWidget.java @@ -547,6 +547,21 @@ public abstract class TWidget implements Comparable { this(parent, true); } + /** + * Protected constructor. + * + * @param parent parent widget + * @param x column relative to parent + * @param y row relative to parent + * @param width width of widget + * @param height height of widget + */ + protected TWidget(final TWidget parent, final int x, final int y, + final int width, final int height) { + + this(parent, true, x, y, width, height); + } + /** * Protected constructor used by subclasses that are disabled by default. * @@ -561,6 +576,31 @@ public abstract class TWidget implements Comparable { parent.addChild(this); } + /** + * Protected constructor used by subclasses that are disabled by default. + * + * @param parent parent widget + * @param enabled if true assume enabled + * @param x column relative to parent + * @param y row relative to parent + * @param width width of widget + * @param height height of widget + */ + protected TWidget(final TWidget parent, final boolean enabled, + final int x, final int y, final int width, final int height) { + + this.enabled = enabled; + this.parent = parent; + this.window = parent.window; + children = new LinkedList(); + parent.addChild(this); + + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + /** * Add a child widget to my list of children. We set its tabOrder to 0 * and increment the tabOrder of all other children. @@ -723,7 +763,7 @@ public abstract class TWidget implements Comparable { if ((children.size() == 0) // TODO // || (cast(TTreeView)this) - // || (cast(TText)this) + || (this instanceof TText) ) { // Defaults: