Inheritance: NSObject
 public virtual void SetMenuForSegment(NSMenu menu, int seg)
 {
     id segment = _items.ObjectAtIndex(seg);
     ((NSSegmentItem)segment).Menu = menu;
 }
Beispiel #2
0
 public NSPoint LocationForSubmenu(NSMenu aSubmenu)
 {
     throw new NotImplementedException();
 }
 public virtual void SetMenuForSegment(NSMenu menu, int seg)
 {
     ((NSSegmentedCell)_cell).SetMenuForSegment(menu, seg);
 }
        public override id InitWithCoder(NSCoder aDecoder)
        {
            id self = this;

            if (aDecoder.AllowsKeyedCoding)
            {
                if (aDecoder.ContainsValueForKey(@"NSSegmentItemLabel"))
                    Label = (NSString)aDecoder.DecodeObjectForKey(@"NSSegmentItemLabel");
                if (aDecoder.ContainsValueForKey(@"NSSegmentItemImage"))
                    Image = (NSImage)aDecoder.DecodeObjectForKey(@"NSSegmentItemImage");
                if (aDecoder.ContainsValueForKey(@"NSSegmentItemMenu"))
                    Menu = (NSMenu)aDecoder.DecodeObjectForKey(@"NSSegmentItemMenu");
                if (aDecoder.ContainsValueForKey(@"NSSegmentItemEnabled"))
                    _enabled = aDecoder.DecodeBoolForKey(@"NSSegmentItemEnabled");
                else if (aDecoder.ContainsValueForKey(@"NSSegmentItemDisabled"))
                    _enabled = !aDecoder.DecodeBoolForKey(@"NSSegmentItemDisabled");
                else
                    _enabled = true;
                if (aDecoder.ContainsValueForKey(@"NSSegmentItemSelected"))
                    _selected = aDecoder.DecodeBoolForKey(@"NSSegmentItemSelected");
                if (aDecoder.ContainsValueForKey(@"NSSegmentItemWidth"))
                    _width = aDecoder.DecodeFloatForKey(@"NSSegmentItemWidth");
                if (aDecoder.ContainsValueForKey(@"NSSegmentItemTag"))
                    _tag = aDecoder.DecodeIntForKey(@"NSSegmentItemTag");
            }
            else
            {
                _label = (NSString)aDecoder.DecodeObject();
                _image = (NSImage)aDecoder.DecodeObject();
                _menu = (NSMenu)aDecoder.DecodeObject();
                aDecoder.DecodeValueOfObjCType<bool>(ref _enabled);
                aDecoder.DecodeValueOfObjCType<bool>(ref _selected);
                aDecoder.DecodeValueOfObjCType<float>(ref _width);
                aDecoder.DecodeValueOfObjCType<int>(ref _tag);
            }

            return self;
        }