Mercurial > projects > dwt-linux
diff dwt/widgets/Tray.d @ 47:f646579f309c
Tray, Tooltip, TrayItem, Item
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 11 Jan 2008 08:34:26 +0100 |
parents | ffa3c27c4328 |
children | 8cec8f536af3 |
line wrap: on
line diff
--- a/dwt/widgets/Tray.d Fri Jan 11 07:11:08 2008 +0100 +++ b/dwt/widgets/Tray.d Fri Jan 11 08:34:26 2008 +0100 @@ -9,14 +9,12 @@ * IBM Corporation - initial API and implementation *******************************************************************************/ module dwt.widgets.Tray; + import dwt.widgets.Display; -class Tray{ - public this( Display, int ); - void dispose(); -} - -/++ -import dwt.*; +import dwt.widgets.Widget; +import dwt.widgets.TrayItem; +import dwt.SWT; +import dwt.dwthelper.System; /** * Instances of this class represent the system tray that is part @@ -36,13 +34,14 @@ * * @since 3.0 */ -public class Tray extends Widget { +public class Tray : Widget { int itemCount; - TrayItem [] items = new TrayItem [4]; + TrayItem [] items; -Tray (Display display, int style) { - if (display == null) display = Display.getCurrent (); - if (display == null) display = Display.getDefault (); +this (Display display, int style) { + items = new TrayItem [4]; + if (display is null) display = Display.getCurrent (); + if (display is null) display = Display.getDefault (); if (!display.isValidThread ()) { error (SWT.ERROR_THREAD_INVALID_ACCESS); } @@ -51,7 +50,7 @@ void createItem (TrayItem item, int index) { if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE); - if (itemCount == items.length) { + if (itemCount is items.length) { TrayItem [] newItems = new TrayItem [items.length + 4]; System.arraycopy (items, 0, newItems, 0, items.length); items = newItems; @@ -63,10 +62,10 @@ void destroyItem (TrayItem item) { int index = 0; while (index < itemCount) { - if (items [index] == item) break; + if (items [index] is item) break; index++; } - if (index == itemCount) return; + if (index is itemCount) return; System.arraycopy (items, index + 1, items, index, --itemCount - index); items [itemCount] = null; } @@ -130,11 +129,11 @@ return result; } -void releaseChildren (boolean destroy) { - if (items != null) { +void releaseChildren (bool destroy) { + if (items !is null) { for (int i=0; i<items.length; i++) { TrayItem item = items [i]; - if (item != null && !item.isDisposed ()) { + if (item !is null && !item.isDisposed ()) { item.release (false); } } @@ -145,8 +144,7 @@ void releaseParent () { super.releaseParent (); - if (display.tray == this) display.tray = null; + if (display.tray is this) display.tray = null; } } -++/ \ No newline at end of file