Mercurial > projects > dwt-mac
diff dwt/internal/cocoa/NSButtonCell.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 8b48be5454ce |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwt/internal/cocoa/NSButtonCell.d Sat Aug 09 17:00:02 2008 +0200 @@ -0,0 +1,333 @@ +/******************************************************************************* + * Copyright (c) 2007 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 + * + * Port to the D Programming language: + * Jacob Carlborg <jacob.carlborg@gmail.com> + *******************************************************************************/ +module dwt.internal.cocoa.NSButtonCell; + +import dwt.internal.cocoa.CGFloat; +import dwt.internal.cocoa.NSActionCell; +import dwt.internal.cocoa.NSAttributedString; +import dwt.internal.cocoa.NSColor; +import dwt.internal.cocoa.NSEvent; +import dwt.internal.cocoa.NSFont; +import dwt.internal.cocoa.NSImage; +import dwt.internal.cocoa.NSInteger; +import dwt.internal.cocoa.NSRect; +import dwt.internal.cocoa.NSSound; +import dwt.internal.cocoa.NSString; +import dwt.internal.cocoa.NSView; +import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; + +public class NSButtonCell : NSActionCell +{ + + public this () + { + super(); + } + + public this (objc.id id) + { + super(id); + } + + public NSImage alternateImage () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_alternateImage); + return result !is null ? new NSImage(result) : null; + } + + public NSString alternateMnemonic () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_alternateMnemonic); + return result !is null ? new NSString(result) : null; + } + + public NSUInteger alternateMnemonicLocation () + { + return OS.objc_msgSend(this.id, OS.sel_alternateMnemonicLocation); + } + + public NSString alternateTitle () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_alternateTitle); + return result !is null ? new NSString(result) : null; + } + + public NSAttributedString attributedAlternateTitle () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedAlternateTitle); + return result !is null ? new NSAttributedString(result) : null; + } + + public NSAttributedString attributedTitle () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedTitle); + return result !is null ? new NSAttributedString(result) : null; + } + + public NSColor backgroundColor () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColor); + return result !is null ? new NSColor(result) : null; + } + + public objc.id bezelStyle () + { + return OS.objc_msgSend(this.id, OS.sel_bezelStyle); + } + + public void drawBezelWithFrame (NSRect frame, NSView controlView) + { + OS.objc_msgSend(this.id, OS.sel_drawBezelWithFrame_1inView_1, frame, controlView !is null ? controlView.id : null); + } + + public void drawImage (NSImage image, NSRect frame, NSView controlView) + { + OS.objc_msgSend(this.id, OS.sel_drawImage_1withFrame_1inView_1, image !is null ? image.id : null, frame, + controlView !is null ? controlView.id : null); + } + + public NSRect drawTitle (NSAttributedString title, NSRect frame, NSView controlView) + { + NSRect result; + OS.objc_msgSend_stret(result, this.id, OS.sel_drawTitle_1withFrame_1inView_1, title !is null ? title.id : null, frame, + controlView !is null ? controlView.id : null); + return result; + } + + public void getPeriodicDelay (float* delay, float* interval) + { + OS.objc_msgSend(this.id, OS.sel_getPeriodicDelay_1interval_1, delay, interval); + } + + public objc.id gradientType () + { + return OS.objc_msgSend(this.id, OS.sel_gradientType); + } + + public NSInteger highlightsBy () + { + return OS.objc_msgSend(this.id, OS.sel_highlightsBy); + } + + public bool imageDimsWhenDisabled () + { + return OS.objc_msgSend(this.id, OS.sel_imageDimsWhenDisabled) !is null; + } + + public objc.id imagePosition () + { + return OS.objc_msgSend(this.id, OS.sel_imagePosition); + } + + public objc.id imageScaling () + { + return OS.objc_msgSend(this.id, OS.sel_imageScaling); + } + + public bool isOpaque () + { + return OS.objc_msgSend(this.id, OS.sel_isOpaque) !is null; + } + + public bool isTransparent () + { + return OS.objc_msgSend(this.id, OS.sel_isTransparent) !is null; + } + + public NSString keyEquivalent () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_keyEquivalent); + return result !is null ? new NSString(result) : null; + } + + public NSFont keyEquivalentFont () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_keyEquivalentFont); + return result !is null ? new NSFont(result) : null; + } + + public NSUInteger keyEquivalentModifierMask () + { + return OS.objc_msgSend(this.id, OS.sel_keyEquivalentModifierMask); + } + + public void mouseEntered (NSEvent event) + { + OS.objc_msgSend(this.id, OS.sel_mouseEntered_1, event !is null ? event.id : null); + } + + public void mouseExited (NSEvent event) + { + OS.objc_msgSend(this.id, OS.sel_mouseExited_1, event !is null ? event.id : null); + } + + public void performClick (id sender) + { + OS.objc_msgSend(this.id, OS.sel_performClick_1, sender !is null ? sender.id : null); + } + + public void setAlternateImage (NSImage image) + { + OS.objc_msgSend(this.id, OS.sel_setAlternateImage_1, image !is null ? image.id : null); + } + + public void setAlternateMnemonicLocation (NSUInteger location) + { + OS.objc_msgSend(this.id, OS.sel_setAlternateMnemonicLocation_1, location); + } + + public void setAlternateTitle (NSString aString) + { + OS.objc_msgSend(this.id, OS.sel_setAlternateTitle_1, aString !is null ? aString.id : null); + } + + public void setAlternateTitleWithMnemonic (NSString StringWithAmpersand) + { + OS.objc_msgSend(this.id, OS.sel_setAlternateTitleWithMnemonic_1, StringWithAmpersand !is null ? StringWithAmpersand.id : null); + } + + public void setAttributedAlternateTitle (NSAttributedString obj) + { + OS.objc_msgSend(this.id, OS.sel_setAttributedAlternateTitle_1, obj !is null ? obj.id : null); + } + + public void setAttributedTitle (NSAttributedString obj) + { + OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, obj !is null ? obj.id : null); + } + + public void setBackgroundColor (NSColor color) + { + OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null); + } + + public void setBezelStyle (objc.id bezelStyle) + { + OS.objc_msgSend(this.id, OS.sel_setBezelStyle_1, bezelStyle); + } + + public void setButtonType (objc.id aType) + { + OS.objc_msgSend(this.id, OS.sel_setButtonType_1, aType); + } + + public void setFont (NSFont fontObj) + { + OS.objc_msgSend(this.id, OS.sel_setFont_1, fontObj !is null ? fontObj.id : null); + } + + public void setGradientType (objc.id type) + { + OS.objc_msgSend(this.id, OS.sel_setGradientType_1, type); + } + + public void setHighlightsBy (NSInteger aType) + { + OS.objc_msgSend(this.id, OS.sel_setHighlightsBy_1, aType); + } + + public void setImageDimsWhenDisabled (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setImageDimsWhenDisabled_1, flag); + } + + public void setImagePosition (objc.id aPosition) + { + OS.objc_msgSend(this.id, OS.sel_setImagePosition_1, aPosition); + } + + public void setImageScaling (objc.id scaling) + { + OS.objc_msgSend(this.id, OS.sel_setImageScaling_1, scaling); + } + + public void setKeyEquivalent (NSString aKeyEquivalent) + { + OS.objc_msgSend(this.id, OS.sel_setKeyEquivalent_1, aKeyEquivalent !is null ? aKeyEquivalent.id : null); + } + + public void setKeyEquivalentFont_ (NSFont fontObj) + { + OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentFont_1, fontObj !is null ? fontObj.id : null); + } + + public void setKeyEquivalentFont_size_ (NSString fontName, CGFloat fontSize) + { + OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentFont_1size_1, fontName !is null ? fontName.id : null, fontSize); + } + + public void setKeyEquivalentModifierMask (NSUInteger mask) + { + OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentModifierMask_1, mask); + } + + public void setPeriodicDelay (float delay, float interval) + { + OS.objc_msgSend(this.id, OS.sel_setPeriodicDelay_1interval_1, delay, interval); + } + + public void setShowsBorderOnlyWhileMouseInside (bool show) + { + OS.objc_msgSend(this.id, OS.sel_setShowsBorderOnlyWhileMouseInside_1, show); + } + + public void setShowsStateBy (NSInteger aType) + { + OS.objc_msgSend(this.id, OS.sel_setShowsStateBy_1, aType); + } + + public void setSound (NSSound aSound) + { + OS.objc_msgSend(this.id, OS.sel_setSound_1, aSound !is null ? aSound.id : null); + } + + public void setTitle (NSString aString) + { + OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString !is null ? aString.id : null); + } + + public void setTitleWithMnemonic (NSString StringWithAmpersand) + { + OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, StringWithAmpersand !is null ? StringWithAmpersand.id : null); + } + + public void setTransparent (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setTransparent_1, flag); + } + + public bool showsBorderOnlyWhileMouseInside () + { + return OS.objc_msgSend(this.id, OS.sel_showsBorderOnlyWhileMouseInside) !is null; + } + + public NSInteger showsStateBy () + { + return OS.objc_msgSend(this.id, OS.sel_showsStateBy); + } + + public NSSound sound () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_sound); + return result !is null ? new NSSound(result) : null; + } + + public NSString title () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_title); + return result !is null ? new NSString(result) : null; + } + +}