Mercurial > projects > dwt-addons
comparison dwtx/draw2d/widgets/MultiLineLabel.d @ 103:2d6540440fe6
Replace static ctors with lazy init.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 03 Aug 2008 17:01:51 +0200 |
parents | 95307ad235d9 |
children |
comparison
equal
deleted
inserted
replaced
102:0de61c6f08ca | 103:2d6540440fe6 |
---|---|
47 * @author hudsonr | 47 * @author hudsonr |
48 */ | 48 */ |
49 public final class MultiLineLabel : FigureCanvas { | 49 public final class MultiLineLabel : FigureCanvas { |
50 | 50 |
51 private TextFlow textFlow; | 51 private TextFlow textFlow; |
52 static const Border MARGIN; | 52 private static Border MARGIN_; |
53 static Border MARGIN(){ | |
54 if( MARGIN_ is null ){ | |
55 synchronized( MultiLineLabel.classinfo ){ | |
56 if( MARGIN_ is null ){ | |
57 MARGIN_ = new MarginBorder(2); | |
58 } | |
59 } | |
60 } | |
61 return MARGIN_; | |
62 } | |
63 | |
53 private Image image; | 64 private Image image; |
54 | |
55 static this(){ | |
56 MARGIN = new MarginBorder(2); | |
57 } | |
58 | 65 |
59 class FocusableViewport : Viewport { | 66 class FocusableViewport : Viewport { |
60 this() { | 67 this() { |
61 super(true); | 68 super(true); |
62 setFocusTraversable(true); | 69 setFocusTraversable(true); |