PXSourceList class reference
NSOutlineView | |
Available in Mac OS X v10.5 and later | |
PXSourceList.h |
Overview
PXSourceList
is a subclass of NSOutlineView
that uses Source List styling similar to that used by applications such as iTunes, Mail and iCal.
Unlike NSOutlineView
, a PXSourceList
object operates with only one column and does not display a header.
Like NSOutlineView
and NSTableView
, a PXSourceList
object does not store its own data, but retrieves values from a weakly referenced data source (see the PXSourceListDataSource
protocol). A PXSourceList
object can also have a delegate, to which it sends messages when certain events occur (see the PXSourceListDelegate
protocol and the NSObject(PXSourceListNotifications)
category for more information).
Tasks
Source List Layout
-
iconSize
property Returns the icon size for items in the Source List.
Delegate and Data Source
-
dataSource
property -
delegate
property
Working with Groups
-
- numberOfGroups
Returns the number of Group items in the Source List. -
- isGroupItem:
Returns whether an item in the Source List is a group item or not. -
- isGroupAlwaysExpanded:
Returns whether a group is displayed as always expanded.
Working with Badges
-
- itemHasBadge:
Returns whether an item displays a badge. -
- badgeValueForItem:
Returns the badge value for a particular item.
Instance Methods
numberOfGroups
Returns the number of Group items in the Source List.
- (NSUInteger)numberOfGroups
Return Value
An integer value for the number of Groups items in the Source List.
Discussion
"Group" items are defined as items at level 0 in the Source List hierarchy. They are displayed in a dark blue font and are not selectable. Group items can additionally be displayed as always expanded, so that their immediate children are never hidden from view.
Availability
Available in Mac OS X v10.5 and later
See Also
Declared In
PXSourceList.h
isGroupItem:
Returns whether an item in the Source List is a group item or not.
- (BOOL)isGroupItem:(id)item
Parameters
- item
An item in the Source List that you want to check.
Return Value
A boolean value specifying whether item
is a group item or not
Discussion
"Group" items are defined as items at level 0 in the Source List hierarchy. They are displayed in a dark blue font and are not selectable. Group items can additionally be displayed as always expanded, so that their immediate children are never hidden from view.
Availability
Available in Mac OS X v10.5 and later
See Also
Declared In
PXSourceList.h
isGroupAlwaysExpanded:
Returns whether a group is displayed as always expanded.
- (BOOL)isGroupAlwaysExpanded:(id)group
Parameters
- group
A group item in the Source List that you want to check.
Return Value
A boolean value specifying whether group
is always expanded
Discussion
A group that is displayed as always expanded displays no disclosure triangle, and its direct children are always shown.
Availability
Available in Mac OS X v10.5 and later
See Also
Declared In
PXSourceList.h
itemHasBadge:
Returns whether an item displays a badge.
- (BOOL)itemHasBadge:(id)item
Parameters
- item
The item that displays the badge
Return Value
A boolean value specifying whether item
displays a badge
Discussion
An item that displays a badge has a number (the badge value) displayed in a rounded-rectangle to the right-hand side of the cell.
Availability
Available in Mac OS X v10.5 and later
See Also
Declared In
PXSourceList.h
badgeValueForItem:
Returns the badge value for a particular item.
- (NSInteger)badgeValueForItem:(id)item
Parameters
- item
The item that you want to check
Return Value
An integer value of the badge value for item
. If item
does not display a badge, returns NSNotFound
.
Availability
Available in Mac OS X v10.5 and later
See Also
Declared In
PXSourceList.h
Properties
iconSize
Returns the icon size for items in the Source List.
@property NSSize iconSize
Discussion
This icon size is used for all icons in the Source List. If you are using different icon sizes between icons, then set this to the largest icon size – rows with icons that are smaller than this will be centred in the enlarged frame, and not stretched.
If the icon size you set is greater than the row height used by the Source List (with -rowHeight
), then iconSize
will be constrained to the size of the row height, with the width scaled in proportion.
The default value is 16.0 x 16.0 pixels
Availability
Available in Mac OS X v10.5 and later
Declared In
PXSourceList.h
dataSource
@property id dataSource
Discussion
The receiver maintains a weak reference to the data source.
In the way that the data source is set by the Source List, sending -dataSource
to the Source List will cause the Source List instance to be returned. This is, unfortunately, due to how the data source is handled by the Source List.
Availability
Available in Mac OS X v10.5 and later
Declared In
PXSourceList.h
delegate
@property id delegate
Discussion
The receiver maintains a weak reference to the delegate.
In the way that the delegate is set by the Source List, sending -delegate
to the Source List will cause the Source List instance to be returned. This is, unfortunately, due to how the delegate is handled by the Source List.
Availability
Available in Mac OS X v10.5 and later
Declared In
PXSourceList.h