Mercurial > projects > dstep
diff dstep/appkit/NSComboBoxCell.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children | b9de51448c6b |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dstep/appkit/NSComboBoxCell.d Sun Jan 03 22:06:11 2010 +0100 @@ -0,0 +1,233 @@ +/** + * Copyright: Copyright (c) 2009 Jacob Carlborg. + * Authors: Jacob Carlborg + * Version: Initial created: Sep 24, 2009 + * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) + */ +module dstep.appkit.NSComboBoxCell; + +import dstep.appkit.NSButtonCell; +import dstep.appkit.NSTableView; +import dstep.appkit.NSTextFieldCell; +import dstep.applicationservices.coregraphics.CGBase; +import dstep.foundation.NSArray; +import dstep.foundation.NSGeometry; +import dstep.foundation.NSObjCRuntime; +import dstep.foundation.NSString; +import dstep.objc.bridge.Bridge; +import dstep.objc.objc; + +class NSComboBoxCell : NSTextFieldCell +{ + mixin (ObjcWrap); + + bool hasVerticalScroller () + { + return invokeObjcSelf!(bool, "hasVerticalScroller"); + } + + void setHasVerticalScroller (bool flag) + { + return invokeObjcSelf!(void, "setHasVerticalScroller:", bool)(flag); + } + + NSSize intercellSpacing () + { + return invokeObjcSelf!(NSSize, "intercellSpacing"); + } + + void setIntercellSpacing (NSSize aSize) + { + return invokeObjcSelf!(void, "setIntercellSpacing:", NSSize)(aSize); + } + + CGFloat itemHeight () + { + return invokeObjcSelf!(CGFloat, "itemHeight"); + } + + void setItemHeight (CGFloat itemHeight) + { + return invokeObjcSelf!(void, "setItemHeight:", CGFloat)(itemHeight); + } + + NSInteger numberOfVisibleItems () + { + return invokeObjcSelf!(NSInteger, "numberOfVisibleItems"); + } + + void setNumberOfVisibleItems (NSInteger visibleItems) + { + return invokeObjcSelf!(void, "setNumberOfVisibleItems:", NSInteger)(visibleItems); + } + + void setButtonBordered (bool flag) + { + return invokeObjcSelf!(void, "setButtonBordered:", bool)(flag); + } + + bool isButtonBordered () + { + return invokeObjcSelf!(bool, "isButtonBordered"); + } + + void reloadData () + { + return invokeObjcSelf!(void, "reloadData"); + } + + void noteNumberOfItemsChanged () + { + return invokeObjcSelf!(void, "noteNumberOfItemsChanged"); + } + + void setUsesDataSource (bool flag) + { + return invokeObjcSelf!(void, "setUsesDataSource:", bool)(flag); + } + + bool usesDataSource () + { + return invokeObjcSelf!(bool, "usesDataSource"); + } + + void scrollItemAtIndexToTop (NSInteger index) + { + return invokeObjcSelf!(void, "scrollItemAtIndexToTop:", NSInteger)(index); + } + + void scrollItemAtIndexToVisible (NSInteger index) + { + return invokeObjcSelf!(void, "scrollItemAtIndexToVisible:", NSInteger)(index); + } + + void selectItemAtIndex (NSInteger index) + { + return invokeObjcSelf!(void, "selectItemAtIndex:", NSInteger)(index); + } + + void deselectItemAtIndex (NSInteger index) + { + return invokeObjcSelf!(void, "deselectItemAtIndex:", NSInteger)(index); + } + + NSInteger indexOfSelectedItem () + { + return invokeObjcSelf!(NSInteger, "indexOfSelectedItem"); + } + + NSInteger numberOfItems () + { + return invokeObjcSelf!(NSInteger, "numberOfItems"); + } + + bool completes () + { + return invokeObjcSelf!(bool, "completes"); + } + + void setCompletes (bool completes) + { + return invokeObjcSelf!(void, "setCompletes:", bool)(completes); + } + + NSString completedString (NSString string) + { + return invokeObjcSelf!(NSString, "completedString:", NSString)(string); + } + + Object dataSource () + { + return invokeObjcSelf!(Object, "dataSource"); + } + + void setDataSource (Object aSource) + { + return invokeObjcSelf!(void, "setDataSource:", Object)(aSource); + } + + void addItemWithObjectValue (Object object) + { + return invokeObjcSelf!(void, "addItemWithObjectValue:", Object)(object); + } + + void addItemsWithObjectValues (NSArray objects) + { + return invokeObjcSelf!(void, "addItemsWithObjectValues:", NSArray)(objects); + } + + void insertItemWithObjectValue (Object object, NSInteger index) + { + return invokeObjcSelf!(void, "insertItemWithObjectValue:atIndex:", Object, NSInteger)(object, index); + } + + void removeItemWithObjectValue (Object object) + { + return invokeObjcSelf!(void, "removeItemWithObjectValue:", Object)(object); + } + + void removeItemAtIndex (NSInteger index) + { + return invokeObjcSelf!(void, "removeItemAtIndex:", NSInteger)(index); + } + + void removeAllItems () + { + return invokeObjcSelf!(void, "removeAllItems"); + } + + void selectItemWithObjectValue (Object object) + { + return invokeObjcSelf!(void, "selectItemWithObjectValue:", Object)(object); + } + + Object itemObjectValueAtIndex (NSInteger index) + { + return invokeObjcSelf!(Object, "itemObjectValueAtIndex:", NSInteger)(index); + } + + Object objectValueOfSelectedItem () + { + return invokeObjcSelf!(Object, "objectValueOfSelectedItem"); + } + + NSInteger indexOfItemWithObjectValue (Object object) + { + return invokeObjcSelf!(NSInteger, "indexOfItemWithObjectValue:", Object)(object); + } + + NSArray objectValues () + { + return invokeObjcSelf!(NSArray, "objectValues"); + } +} + +const TNSComboBoxCellDataSource = ` + + NSInteger numberOfItemsInComboBoxCell (NSComboBoxCell comboBoxCell) + { + return invokeObjcSelf!(NSInteger, "numberOfItemsInComboBoxCell:", NSComboBoxCell)(comboBoxCell); + } + + Object comboBoxCell (NSComboBoxCell aComboBoxCell, NSInteger index) + { + return invokeObjcSelf!(Object, "comboBoxCell:objectValueForItemAtIndex:", NSComboBoxCell, NSInteger)(aComboBoxCell, index); + } + + NSUInteger comboBoxCell (NSComboBoxCell aComboBoxCell, NSString string) + { + return invokeObjcSelf!(NSUInteger, "comboBoxCell:indexOfItemWithStringValue:", NSComboBoxCell, NSString)(aComboBoxCell, string); + } + + NSString comboBoxCell (NSComboBoxCell aComboBoxCell, NSString uncompletedString) + { + return invokeObjcSelf!(NSString, "comboBoxCell:completedString:", NSComboBoxCell, NSString)(aComboBoxCell, uncompletedString); + } + + //mixin ObjcBindMethod!(numberOfItemsInComboBoxCell, "numberOfItemsInComboBoxCell:"); + //mixin ObjcBindMethod!(comboBoxCell, "comboBoxCell:objectValueForItemAtIndex:"); + //mixin ObjcBindMethod!(comboBoxCell, "comboBoxCell:indexOfItemWithStringValue:"); + //mixin ObjcBindMethod!(comboBoxCell, "comboBoxCell:completedString:"); + +`; +