ui/cocoa/toolbar.m

changeset 23
decc6bf584aa
parent 14
e2fd132ab781
child 25
78ae3efe463f
equal deleted inserted replaced
22:bcf880b29bc3 23:decc6bf584aa
137 NSMutableArray *i = [[NSMutableArray alloc] 137 NSMutableArray *i = [[NSMutableArray alloc]
138 initWithCapacity:[allowedItems count] + 3]; 138 initWithCapacity:[allowedItems count] + 3];
139 [i addObject: NSToolbarFlexibleSpaceItemIdentifier]; 139 [i addObject: NSToolbarFlexibleSpaceItemIdentifier];
140 [i addObject: NSToolbarSpaceItemIdentifier]; 140 [i addObject: NSToolbarSpaceItemIdentifier];
141 [i addObject: NSToolbarSeparatorItemIdentifier]; 141 [i addObject: NSToolbarSeparatorItemIdentifier];
142 for(id item in allowedItems) {
143 [i addObject: item];
144 }
142 145
143 return i; 146 return i;
144 } 147 }
145 148
146 - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { 149 - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar {
147 return defaultItems; 150 return defaultItems;
148 } 151 }
149 152
150 - (NSToolbarItem *) toolbar:(NSToolbar*)toolbar 153 - (NSToolbarItem *) toolbar:(NSToolbar*)toolbar
151 itemForItemIdentifier:(NSString*)identifier 154 itemForItemIdentifier:(NSString*)identifier
152 willBeInsertedIntoToolbar:(BOOL)flag 155 willBeInsertedIntoToolbar:(BOOL)flag
153 { 156 {
154 Protocol *item = @protocol(UiToolItem); 157 Protocol *item = @protocol(UiToolItem);
155 item = [items objectForKey: identifier]; 158 item = [items objectForKey: identifier];

mercurial