From 97b3e0ea1d8c3cf2274ccf9cf15a02ce6c10073c Mon Sep 17 00:00:00 2001 From: bdew Date: Sun, 26 Jan 2014 02:17:18 +0200 Subject: [PATCH] added WidgetMultipane --- .../lib/gui/widgets/WidgetMultipane.scala | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/net/bdew/lib/gui/widgets/WidgetMultipane.scala diff --git a/src/net/bdew/lib/gui/widgets/WidgetMultipane.scala b/src/net/bdew/lib/gui/widgets/WidgetMultipane.scala new file mode 100644 index 0000000..ff76efd --- /dev/null +++ b/src/net/bdew/lib/gui/widgets/WidgetMultipane.scala @@ -0,0 +1,24 @@ +/* + * Copyright (c) bdew, 2013 - 2014 + * https://github.com/bdew/bdlib + * + * This mod is distributed under the terms of the Minecraft Mod Public + * License 1.0, or MMPL. Please check the contents of the license located in + * https://raw.github.com/bdew/bdlib/master/MMPL-1.0.txt + */ + +package net.bdew.lib.gui.widgets + +import net.bdew.lib.gui.{Point, Rect} +import scala.collection.mutable +import org.lwjgl.opengl.GL11 + +abstract class WidgetMultipane(rect: Rect) extends WidgetSubcontainer(rect) { + def getActivePane: BaseWidget + + def addPane[T <: BaseWidget](w: T): T = { + w.init(this) + return w + } + override def activeWidgets = super.activeWidgets ++: List(getActivePane) +}