Commits

Anonymous committed 5a079f4

simplify ThemeSuport using self types

  • Participants
  • Parent commits a39c045

Comments (0)

Files changed (1)

File src/de/matthiasmann/twlscala/twlinternal/ThemeSupport.scala

 
 import de.matthiasmann.twl.{Widget=>TWLWidget, Event=>TWLEvent}
 
-trait ThemeSupport extends TWLWidget {
+trait ThemeSupport extends TWLWidget { this:TWLWidget =>
     def theme = getTheme
     def theme_= (t:String) { setTheme(t) }
     def visible = isVisible
     lazy val contents = new WidgetContent(this)
     var actions:PartialFunction[Action, Boolean] = TWL.emptyActions
 
-    def getTheme:String
-    def setTheme(t:String)
-    def isVisible:Boolean
-    def setVisible(b:Boolean)
-    def isClip:Boolean
-    def setClip(b:Boolean)
-    def setCanAcceptKeyboardFocus(b:Boolean)
-    def getX:Int
-    def getY:Int
-    def getWidth:Int
-    def getHeight:Int
-    def getInnerWidth:Int
-    def getInnerHeight:Int
-    def getMinWidth:Int
-    def getMinHeight:Int
-    def getMaxWidth:Int
-    def getMaxHeight:Int
-    def setSize(w:Int, h:Int):Boolean
-    def setPosition(x:Int, y:Int):Boolean
-    def setInnerSize(w:Int, h:Int):Boolean
-    def setMinSize(w:Int, h:Int)
-    def setMaxSize(w:Int, h:Int)
-    def getPreferredWidth:Int
-    def getPreferredHeight:Int
-    def getTooltipContent:AnyRef
-    def setTooltipContent(t:AnyRef)
     protected override def handleKeyStrokeAction(action:String, event:TWLEvent):Boolean = {
         def invoke(action:Action) = actions.isDefinedAt(action) && actions(action)
         if((actions ne TWL.emptyActions) && (event.getType match {