Mercurial > projects > dwt-linux
comparison dwt/custom/ViewFormLayout.d @ 152:17f8449522fd
overloads second walkthrough
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 31 Jan 2008 23:19:20 +0100 |
parents | 0f12f6bb9739 |
children | 96b14a31d9b3 |
comparison
equal
deleted
inserted
replaced
151:29cb72deba3d | 152:17f8449522fd |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2005 IBM Corporation and others. | 2 * Copyright (c) 2000, 2005 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
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 |
28 * | 28 * |
29 * @see ViewForm | 29 * @see ViewForm |
30 */ | 30 */ |
31 class ViewFormLayout : Layout { | 31 class ViewFormLayout : Layout { |
32 | 32 |
33 protected Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) { | 33 protected override Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) { |
34 ViewForm form = cast(ViewForm)composite; | 34 ViewForm form = cast(ViewForm)composite; |
35 Control left = form.topLeft; | 35 Control left = form.topLeft; |
36 Control center = form.topCenter; | 36 Control center = form.topCenter; |
37 Control right = form.topRight; | 37 Control right = form.topRight; |
38 Control content = form.content; | 38 Control content = form.content; |
104 return rect.width; | 104 return rect.width; |
105 } | 105 } |
106 return c.getBorderWidth () * 2; | 106 return c.getBorderWidth () * 2; |
107 } | 107 } |
108 | 108 |
109 protected bool flushCache(Control control) { | 109 protected override bool flushCache(Control control) { |
110 Object data = control.getLayoutData(); | 110 Object data = control.getLayoutData(); |
111 if ( auto ld = cast(CLayoutData)data ) ld.flushCache(); | 111 if ( auto ld = cast(CLayoutData)data ) ld.flushCache(); |
112 return true; | 112 return true; |
113 } | 113 } |
114 | 114 |
115 protected void layout(Composite composite, bool flushCache) { | 115 protected override void layout(Composite composite, bool flushCache) { |
116 ViewForm form = cast(ViewForm)composite; | 116 ViewForm form = cast(ViewForm)composite; |
117 Control left = form.topLeft; | 117 Control left = form.topLeft; |
118 Control center = form.topCenter; | 118 Control center = form.topCenter; |
119 Control right = form.topRight; | 119 Control right = form.topRight; |
120 Control content = form.content; | 120 Control content = form.content; |