comparison dwt/widgets/Scrollable.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 060cdd4457aa
comparison
equal deleted inserted replaced
6:b903c16b6f48 7:e831403a80a9
112 NSSize size = new NSSize(); 112 NSSize size = new NSSize();
113 size.width = width; 113 size.width = width;
114 size.height = height; 114 size.height = height;
115 int border = hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder; 115 int border = hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder;
116 size = NSScrollView.frameSizeForContentSize(size, (style & DWT.H_SCROLL) !is 0, (style & DWT.V_SCROLL) !is 0, border); 116 size = NSScrollView.frameSizeForContentSize(size, (style & DWT.H_SCROLL) !is 0, (style & DWT.V_SCROLL) !is 0, border);
117 width = (int)size.width; 117 width = cast(int)size.width;
118 height = (int)size.height; 118 height = cast(int)size.height;
119 NSRect frame = scrollView.contentView().frame(); 119 NSRect frame = scrollView.contentView().frame();
120 x -= frame.x; 120 x -= frame.x;
121 y -= frame.y; 121 y -= frame.y;
122 } 122 }
123 return new Rectangle (x, y, width, height); 123 return new Rectangle (x, y, width, height);
172 */ 172 */
173 public Rectangle getClientArea () { 173 public Rectangle getClientArea () {
174 checkWidget(); 174 checkWidget();
175 if (scrollView !is null) { 175 if (scrollView !is null) {
176 NSSize size = scrollView.contentSize(); 176 NSSize size = scrollView.contentSize();
177 return new Rectangle(0, 0, (int)size.width, (int)size.height); 177 return new Rectangle(0, 0, cast(int)size.width, cast(int)size.height);
178 } else { 178 } else {
179 NSRect rect = view.bounds(); 179 NSRect rect = view.bounds();
180 return new Rectangle(0, 0, (int)rect.width, (int)rect.height); 180 return new Rectangle(0, 0, cast(int)rect.width, cast(int)rect.height);
181 } 181 }
182 } 182 }
183 183
184 /** 184 /**
185 * Returns the receiver's horizontal scroll bar if it has 185 * Returns the receiver's horizontal scroll bar if it has
250 // if (isVisibleHBar) hHeight = outMetric [0]; 250 // if (isVisibleHBar) hHeight = outMetric [0];
251 // if (isVisibleVBar) vWidth = outMetric [0]; 251 // if (isVisibleVBar) vWidth = outMetric [0];
252 // int width, height; 252 // int width, height;
253 // CGRect rect = new CGRect (); 253 // CGRect rect = new CGRect ();
254 // OS.HIViewGetBounds (scrolledHandle, rect); 254 // OS.HIViewGetBounds (scrolledHandle, rect);
255 // width = (int) rect.width; 255 // width = cast(int) rect.width;
256 // height = (int) rect.height; 256 // height = cast(int) rect.height;
257 // Rect inset = inset (); 257 // Rect inset = inset ();
258 // width = Math.max (0, width - vWidth - inset.left - inset.right); 258 // width = Math.max (0, width - vWidth - inset.left - inset.right);
259 // height = Math.max (0, height - hHeight - inset.top - inset.bottom); 259 // height = Math.max (0, height - hHeight - inset.top - inset.bottom);
260 // setBounds (handle, inset.left, inset.top, width, height, true, true, false); 260 // setBounds (handle, inset.left, inset.top, width, height, true, true, false);
261 // if (isVisibleHBar) { 261 // if (isVisibleHBar) {