Mercurial > projects > dwt-mac
comparison dwt/layout/FillLayout.d @ 7:e831403a80a9
Add 'cast' to casts
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 14:30:35 +0200 |
parents | 1a8b3cb347e0 |
children | a9ab4c738ed8 |
comparison
equal
deleted
inserted
replaced
6:b903c16b6f48 | 7:e831403a80a9 |
---|---|
142 if (hHint !is DWT.DEFAULT) height = hHint; | 142 if (hHint !is DWT.DEFAULT) height = hHint; |
143 return new Point (width, height); | 143 return new Point (width, height); |
144 } | 144 } |
145 | 145 |
146 Point computeChildSize (Control control, int wHint, int hHint, bool flushCache) { | 146 Point computeChildSize (Control control, int wHint, int hHint, bool flushCache) { |
147 FillData data = (FillData)control.getLayoutData (); | 147 FillData data = cast(FillData)control.getLayoutData (); |
148 if (data is null) { | 148 if (data is null) { |
149 data = new FillData (); | 149 data = new FillData (); |
150 control.setLayoutData (data); | 150 control.setLayoutData (data); |
151 } | 151 } |
152 Point size = null; | 152 Point size = null; |
154 size = data.computeSize (control, wHint, hHint, flushCache); | 154 size = data.computeSize (control, wHint, hHint, flushCache); |
155 } else { | 155 } else { |
156 // TEMPORARY CODE | 156 // TEMPORARY CODE |
157 int trimX, trimY; | 157 int trimX, trimY; |
158 if (control instanceof Scrollable) { | 158 if (control instanceof Scrollable) { |
159 Rectangle rect = ((Scrollable) control).computeTrim (0, 0, 0, 0); | 159 Rectangle rect = (cast(Scrollable) control).computeTrim (0, 0, 0, 0); |
160 trimX = rect.width; | 160 trimX = rect.width; |
161 trimY = rect.height; | 161 trimY = rect.height; |
162 } else { | 162 } else { |
163 trimX = trimY = control.getBorderWidth () * 2; | 163 trimX = trimY = control.getBorderWidth () * 2; |
164 } | 164 } |
169 return size; | 169 return size; |
170 } | 170 } |
171 | 171 |
172 protected bool flushCache (Control control) { | 172 protected bool flushCache (Control control) { |
173 Object data = control.getLayoutData(); | 173 Object data = control.getLayoutData(); |
174 if (data !is null) ((FillData)data).flushCache(); | 174 if (data !is null) (cast(FillData)data).flushCache(); |
175 return true; | 175 return true; |
176 } | 176 } |
177 | 177 |
178 String getName () { | 178 String getName () { |
179 String string = getClass ().getName (); | 179 String string = getClass ().getName (); |