ILScopeBar class reference
NSObject | |
ILScopeBar.h |
Overview
ILScopebar
is a NSView
subclass for a scope bar like the one finder uses in it's search. It is different from MGScopebar and apple's scope bar because instead of grouping, it consolidates all the items that don't fit into a menu at the end of it.
Tasks
Properties
-
overflowButton
property -
cutoffIndex
property -
selectedItem
property -
selectedIndex
property -
delegate
property -
dataSource
property
Displaying the Scope Bar
Getting Item Info
-
- frameForItemAtIndex:
-
- indexOfItem:
-
- titleOfItemAtIndex:
-
- itemCount
-
- imageForItemAtIndex:
-
- tagForItemAtIndex:
-
- items
Instance methods
title
- (NSString *)title
Return value
Returns the datasource's titleForMethod:
method. If not implemented, returns nil.
Discussion
The title that gets displayed at the left side of the scope bar.
See also
Declared in
ILScopeBar.h
attributedTitle
- (NSAttributedString *)attributedTitle
Return value
Returns an NSAttributed
string used when drawing the title.
See also
Declared in
ILScopeBar.h
reload
- (void)reload
Discussion
Rearranges the items and recreates the overflow button.
See also
Declared in
ILScopeBar.h
rearrangeItems
- (void)rearrangeItems
Discussion
Removes all of the items from the bar and overflow button and then recreates them in their appropriate position.
See also
Declared in
ILScopeBar.h
createOverflowButton
- (void)createOverflowButton
Discussion
Releases and recreates the overflow button.
See also
Declared in
ILScopeBar.h
frameForItemAtIndex:
- (NSRect)frameForItemAtIndex:(NSInteger) idx
Return value
Returns a newly generated frame for the item.
Discussion
To get the actual frame of the item, use the scope bar's subviews and objectAtIndex:
Warning
Value may not be exact.
See also
Declared in
ILScopeBar.h
indexOfItem:
- (NSInteger)indexOfItem:(id) item
Return value
Index of the specified item.
Warning
If the item isn't in the Scope Bar's items
array, returns NSNotFound
Declared in
ILScopeBar.h
titleOfItemAtIndex:
- (NSString *)titleOfItemAtIndex:(NSInteger) idx
Return value
Returns the value returned by the data source, nil if the data source doesn't implement it or if the data source hasn't been defined.
Discussion
Calls the data source method, titleOfItemInScopeBar:atIndex:
See also
Declared in
ILScopeBar.h
itemCount
- (NSInteger)itemCount
Return value
Returns the value returned by the data source, 0 if the data source doesn't implement it or if the data source hasn't been defined.
Discussion
Calls the data source method, numberOfItemsInScopeBar:
See also
Declared in
ILScopeBar.h
imageForItemAtIndex:
- (NSImage *)imageForItemAtIndex:(NSInteger) idx
Return value
Returns the value returned by the data source, nil if the data source doesn't implement it or if the data source hasn't been defined.
Discussion
Calls the data source method, imageOfItemInScopeBar:atIndex:
See also
Declared in
ILScopeBar.h
tagForItemAtIndex:
- (NSInteger)tagForItemAtIndex:(NSInteger) idx
Return value
Returns the value returned by the data source, 0 if the data source doesn't implement it or if the data source hasn't been defined.
Discussion
Calls the data source method, tagOfItemInScopeBar:atIndex:
See also
Declared in
ILScopeBar.h
items
- (NSArray *)items
Return value
Returns the list of the scopebar's subviews filtered by the classes NSButton
or NSMenuItem
Warning
If there are any unexpected subviews in items, they will be in this list or be removed and released on the next reload
call.
Declared in
ILScopeBar.h
Properties
overflowButton
@property NSPopUpButton *overflowButton
Discussion
ILScopeBar
uses NSPopUpButton to display it's overflow menu.
See also
Declared in
ILScopeBar.h
cutoffIndex
@property NSInteger cutoffIndex
Return value
Returns the index of which the scope bar's items cut off.
Discussion
If every item fits, returns the last index of the items.
See also
Declared in
ILScopeBar.h
selectedItem
@property id selectedItem
Return value
Returns an NSButton
or NSMenuItem
depending upon if the item is in the overflow menu.
See also
Declared in
ILScopeBar.h
selectedIndex
@property NSInteger selectedIndex
Return value
Returns the index of the selected item.
See also
Declared in
ILScopeBar.h
delegate
@property IBOutlet id delegate
Discussion
The delegate could implement the option ILScopeBarDelegate
Protocol methods.
See also
Declared in
ILScopeBar.h
dataSource
@property IBOutlet id dataSource
Discussion
The datasource to use for the scope bar.
Warning
The datasource must implement the ILScopeBarDataSource
protocol required methods.
See also
Declared in
ILScopeBar.h