Mercurial > projects > dwt-mac
comparison dwt/widgets/ExpandBar.d @ 90:c7f7f4d7091a
All widgets are ported
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Tue, 30 Dec 2008 18:54:31 +0100 |
parents | 51015bbcb4c6 |
children | 63a09873578e |
comparison
equal
deleted
inserted
replaced
89:8e3c85e1733d | 90:c7f7f4d7091a |
---|---|
26 import dwt.graphics.GC; | 26 import dwt.graphics.GC; |
27 import dwt.graphics.Point; | 27 import dwt.graphics.Point; |
28 import dwt.graphics.Rectangle; | 28 import dwt.graphics.Rectangle; |
29 | 29 |
30 import dwt.widgets.Composite; | 30 import dwt.widgets.Composite; |
31 import dwt.widgets.Control; | |
32 import dwt.widgets.Display; | |
31 import dwt.widgets.Event; | 33 import dwt.widgets.Event; |
32 import dwt.widgets.ExpandItem; | 34 import dwt.widgets.ExpandItem; |
33 import dwt.widgets.Listener; | 35 import dwt.widgets.Listener; |
34 import dwt.widgets.ScrollBar; | 36 import dwt.widgets.ScrollBar; |
35 import dwt.widgets.TypedListener; | 37 import dwt.widgets.TypedListener; |
353 if (items [i] is item) return i; | 355 if (items [i] is item) return i; |
354 } | 356 } |
355 return -1; | 357 return -1; |
356 } | 358 } |
357 | 359 |
358 void layoutItems (int index, bool setScrollbar) { | 360 void layoutItems (int index, bool setScrollbar_) { |
359 if (index < itemCount) { | 361 if (index < itemCount) { |
360 int y = spacing - yCurrentScroll; | 362 int y = spacing - yCurrentScroll; |
361 for (int i = 0; i < index; i++) { | 363 for (int i = 0; i < index; i++) { |
362 ExpandItem item = items [i]; | 364 ExpandItem item = items [i]; |
363 if (item.expanded) y += item.height; | 365 if (item.expanded) y += item.height; |
368 item.setBounds (spacing, y, 0, 0, true, false); | 370 item.setBounds (spacing, y, 0, 0, true, false); |
369 if (item.expanded) y += item.height; | 371 if (item.expanded) y += item.height; |
370 y += item.getHeaderHeight() + spacing; | 372 y += item.getHeaderHeight() + spacing; |
371 } | 373 } |
372 } | 374 } |
373 if (setScrollbar) setScrollbar (); | 375 if (setScrollbar_) setScrollbar (); |
374 } | 376 } |
375 | 377 |
376 /** | 378 /** |
377 * Removes the listener from the collection of listeners who will | 379 * Removes the listener from the collection of listeners who will |
378 * be notified when items in the receiver are expanded or collapsed. | 380 * be notified when items in the receiver are expanded or collapsed. |