Mercurial > projects > dwt-mac
diff dwt/internal/cocoa/NSProgressIndicator.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | f565d3a95c0a |
children |
line wrap: on
line diff
--- a/dwt/internal/cocoa/NSProgressIndicator.d Tue Oct 21 15:20:04 2008 +0200 +++ b/dwt/internal/cocoa/NSProgressIndicator.d Mon Dec 01 17:07:00 2008 +0100 @@ -1,180 +1,76 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Corporation - initial API and implementation + * IBM Corporation - initial API and implementation * * Port to the D programming language: - * Jacob Carlborg <jacob.carlborg@gmail.com> + * Jacob Carlborg <doob@me.com> *******************************************************************************/ module dwt.internal.cocoa.NSProgressIndicator; -import dwt.internal.cocoa.id; -import dwt.internal.cocoa.NSDate : NSTimeInterval; -import dwt.internal.cocoa.NSCell : NSControlTint, NSControlSize; +import dwt.dwthelper.utils; +import cocoa = dwt.internal.cocoa.id; import dwt.internal.cocoa.NSView; import dwt.internal.cocoa.OS; import objc = dwt.internal.objc.runtime; -enum NSProgressIndicatorStyle -{ - NSProgressIndicatorBarStyle = 0, - NSProgressIndicatorSpinningStyle = 1 +public class NSProgressIndicator : NSView { + +public this() { + super(); +} + +public this(objc.id id) { + super(id); +} + +public this(cocoa.id id) { + super(id); +} + +public double doubleValue() { + return OS.objc_msgSend_fpret(this.id, OS.sel_doubleValue); +} + +public double maxValue() { + return OS.objc_msgSend_fpret(this.id, OS.sel_maxValue); +} + +public double minValue() { + return OS.objc_msgSend_fpret(this.id, OS.sel_minValue); } -alias NSProgressIndicatorStyle.NSProgressIndicatorBarStyle NSProgressIndicatorBarStyle; -alias NSProgressIndicatorStyle.NSProgressIndicatorSpinningStyle NSProgressIndicatorSpinningStyle; - -public class NSProgressIndicator : NSView -{ - - public this () - { - super(); - } - - public this (objc.id id) - { - super(id); - } - - public void animate (id sender) - { - OS.objc_msgSend(this.id_, OS.sel_animate_1, sender !is null ? sender.id_ : null); - } - - public NSTimeInterval animationDelay () - { - return cast(NSTimeInterval) OS.objc_msgSend_fpret(this.id_, OS.sel_animationDelay); - } - - public NSControlSize controlSize () - { - return cast(NSControlSize) OS.objc_msgSend(this.id_, OS.sel_controlSize); - } +public void setDoubleValue(double doubleValue) { + OS.objc_msgSend(this.id, OS.sel_setDoubleValue_, doubleValue); +} - public NSControlTint controlTint () - { - return cast(NSControlTint) OS.objc_msgSend(this.id_, OS.sel_controlTint); - } - - public double doubleValue () - { - return OS.objc_msgSend_fpret(this.id_, OS.sel_doubleValue); - } - - public void incrementBy (double delta) - { - OS.objc_msgSend(this.id_, OS.sel_incrementBy_1, delta); - } - - public bool isBezeled () - { - return OS.objc_msgSend(this.id_, OS.sel_isBezeled) !is null; - } +public void setIndeterminate(bool flag) { + OS.objc_msgSend(this.id, OS.sel_setIndeterminate_, flag); +} - public bool isDisplayedWhenStopped () - { - return OS.objc_msgSend(this.id_, OS.sel_isDisplayedWhenStopped) !is null; - } - - public bool isIndeterminate () - { - return OS.objc_msgSend(this.id_, OS.sel_isIndeterminate) !is null; - } - - public double maxValue () - { - return OS.objc_msgSend_fpret(this.id_, OS.sel_maxValue); - } - - public double minValue () - { - return OS.objc_msgSend_fpret(this.id_, OS.sel_minValue); - } +public void setMaxValue(double newMaximum) { + OS.objc_msgSend(this.id, OS.sel_setMaxValue_, newMaximum); +} - public void setAnimationDelay (NSTimeInterval delay) - { - OS.objc_msgSend(this.id_, OS.sel_setAnimationDelay_1, delay); - } - - public void setBezeled (bool flag) - { - OS.objc_msgSend(this.id_, OS.sel_setBezeled_1, flag); - } - - public void setControlSize (NSControlSize size) - { - OS.objc_msgSend(this.id_, OS.sel_setControlSize_1, size); - } - - public void setControlTint (NSControlSize tint) - { - OS.objc_msgSend(this.id_, OS.sel_setControlTint_1, tint); - } +public void setMinValue(double newMinimum) { + OS.objc_msgSend(this.id, OS.sel_setMinValue_, newMinimum); +} - public void setDisplayedWhenStopped (bool isDisplayed) - { - OS.objc_msgSend(this.id_, OS.sel_setDisplayedWhenStopped_1, isDisplayed); - } - - public void setDoubleValue (double doubleValue) - { - OS.objc_msgSend(this.id_, OS.sel_setDoubleValue_1, doubleValue); - } - - public void setIndeterminate (bool flag) - { - OS.objc_msgSend(this.id_, OS.sel_setIndeterminate_1, flag); - } - - public void setMaxValue (double newMaximum) - { - OS.objc_msgSend(this.id_, OS.sel_setMaxValue_1, newMaximum); - } +public void setUsesThreadedAnimation(bool threadedAnimation) { + OS.objc_msgSend(this.id, OS.sel_setUsesThreadedAnimation_, threadedAnimation); +} - public void setMinValue (double newMinimum) - { - OS.objc_msgSend(this.id_, OS.sel_setMinValue_1, newMinimum); - } - - public void setStyle (NSProgressIndicatorStyle style) - { - OS.objc_msgSend(this.id_, OS.sel_setStyle_1, style); - } - - public void setUsesThreadedAnimation (bool threadedAnimation) - { - OS.objc_msgSend(this.id_, OS.sel_setUsesThreadedAnimation_1, threadedAnimation); - } - - public void sizeToFit () - { - OS.objc_msgSend(this.id_, OS.sel_sizeToFit); - } +public void sizeToFit() { + OS.objc_msgSend(this.id, OS.sel_sizeToFit); +} - public void startAnimation (id sender) - { - OS.objc_msgSend(this.id_, OS.sel_startAnimation_1, sender !is null ? sender.id_ : null); - } - - public void stopAnimation (id sender) - { - OS.objc_msgSend(this.id_, OS.sel_stopAnimation_1, sender !is null ? sender.id_ : null); - } - - public NSProgressIndicatorStyle style () - { - return cast(NSProgressIndicatorStyle) OS.objc_msgSend(this.id_, OS.sel_style); - } - - public bool usesThreadedAnimation () - { - return OS.objc_msgSend(this.id_, OS.sel_usesThreadedAnimation) !is null; - } +public void startAnimation(cocoa.id sender) { + OS.objc_msgSend(this.id, OS.sel_startAnimation_, sender !is null ? sender.id : null); +} }