comparison dwt/layout/FillData.d @ 40:fbe68c33eeee

Sync layout with dwt-linux
author Frank Benoit <benoit@tionex.de>
date Tue, 07 Oct 2008 14:41:31 +0200
parents 380af2bdd8e5
children
comparison
equal deleted inserted replaced
39:43be986a1372 40:fbe68c33eeee
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de>
10 *******************************************************************************/ 12 *******************************************************************************/
11 module dwt.layout.FillData; 13 module dwt.layout.FillData;
12
13 import dwt.dwthelper.utils;
14 14
15 import dwt.DWT; 15 import dwt.DWT;
16 import dwt.graphics.Point; 16 import dwt.graphics.Point;
17 import dwt.widgets.Control; 17 import dwt.widgets.Control;
18 18
19 class FillData { 19 class FillData {
20 20
21 int defaultWidth = -1, defaultHeight = -1; 21 int defaultWidth = -1, defaultHeight = -1;
22 int currentWhint, currentHhint, currentWidth = -1, currentHeight = -1; 22 int currentWhint, currentHhint, currentWidth = -1, currentHeight = -1;
23 23
24 Point computeSize (Control control, int wHint, int hHint, bool flushCache) { 24 Point computeSize (Control control, int wHint, int hHint, bool flushCache_) {
25 if (flushCache) flushCache(); 25 if (flushCache_) flushCache();
26 if (wHint is DWT.DEFAULT && hHint is DWT.DEFAULT) { 26 if (wHint is DWT.DEFAULT && hHint is DWT.DEFAULT) {
27 if (defaultWidth is -1 || defaultHeight is -1) { 27 if (defaultWidth is -1 || defaultHeight is -1) {
28 Point size = control.computeSize (wHint, hHint, flushCache); 28 Point size = control.computeSize (wHint, hHint, flushCache_);
29 defaultWidth = size.x; 29 defaultWidth = size.x;
30 defaultHeight = size.y; 30 defaultHeight = size.y;
31 } 31 }
32 return new Point(defaultWidth, defaultHeight); 32 return new Point(defaultWidth, defaultHeight);
33 } 33 }
34 if (currentWidth is -1 || currentHeight is -1 || wHint !is currentWhint || hHint !is currentHhint) { 34 if (currentWidth is -1 || currentHeight is -1 || wHint !is currentWhint || hHint !is currentHhint) {
35 Point size = control.computeSize (wHint, hHint, flushCache); 35 Point size = control.computeSize (wHint, hHint, flushCache_);
36 currentWhint = wHint; 36 currentWhint = wHint;
37 currentHhint = hHint; 37 currentHhint = hHint;
38 currentWidth = size.x; 38 currentWidth = size.x;
39 currentHeight = size.y; 39 currentHeight = size.y;
40 } 40 }