Inherits from NSView
Conforms to NSSplitViewDelegate
Declared in CNSplitViewToolbar.h

Overview

CNSplitViewToolbar is a flexible and easy to use anchored button bar that will be placed on the bottom or top edge of a spcified split view divider.

Tasks

Configuring the toolbar behavior

  •   height

    Property that specifies the height of the toolbar.

    property
  •   anchorEdge

    Property that specifies the edge the toolbar will be attached to.

    property
  •   itemDelimiterEnabled

    Property that indicates wheter a delimiter between toolbar items should be displayed.

    property
  •   contentAlign

    Property that specifies the alignment of all toolbar items.

    property

Toolbar and Item handling

Properties

anchorEdge

Property that specifies the edge the toolbar will be attached to.

@property (nonatomic, assign) CNSplitViewToolbarEdge anchorEdge

Discussion

The value of this property is passed through from CNSplitView and should never called manually.

Declared In

CNSplitViewToolbar.h

contentAlign

Property that specifies the alignment of all toolbar items.

@property (assign, nonatomic) CNSplitViewToolbarContentAlign contentAlign

Discussion

There are two possible values specified in an enum for this property.

typedef enum {
    CNSplitViewToolbarContentAlignItemDirected = 0,
    CNSplitViewToolbarContentAlignCentered
} CNSplitViewToolbarContentAlign;

CNSplitViewToolbarContentAlignItemDirected
The item alignment follows the value of the [CNSplitViewToolbarButton toolbarButtonAlign] of each item.

CNSplitViewToolbarContentAlignCentered
The value of the [CNSplitViewToolbarButton toolbarButtonAlign] of each item will be ignored and all items are centered.

Declared In

CNSplitViewToolbar.h

height

Property that specifies the height of the toolbar.

@property (nonatomic, assign) CGFloat height

Declared In

CNSplitViewToolbar.h

itemDelimiterEnabled

Property that indicates wheter a delimiter between toolbar items should be displayed.

@property (assign, nonatomic, getter=isItemDelimiterEnabled) BOOL itemDelimiterEnabled

Parameters

itemDelimiterEnabled

YES the item delimiter should be visible, otherwise NO.

Declared In

CNSplitViewToolbar.h

Instance Methods

addItem:align:

Adds an item to the CNSplitViewToolbar with the specified itemAlign.

- (void)addItem:(id)theItem align:(CNSplitViewToolbarItemAlign)itemAlign

Parameters

theItem

A NSControl subclass eg. NSButton, NSSlider etc.

itemAlign

The horizontal alignment of the item.

Discussion

An item sould be any subclass of NSControl (buttons, text fields, slider, popup buttons etc.). You can specify the item alignment by using values of this enum:

typedef enum {
    CNSplitViewToolbarItemAlignLeft = 0,
    CNSplitViewToolbarItemAlignRight
} CNSplitViewToolbarItemAlign;

CNSplitViewToolbarItemAlignLeft
The item will be left aligned.

CNSplitViewToolbarItemAlignRight
The item will be right aligned.

Note: Dependent of the contentAlign property the item alignment may be ignored. It only take effect if contentAlign is set to CNSplitViewToolbarContentAlignItemDirected. Otherwise the items will be centered.

Declared In

CNSplitViewToolbar.h

disable

Disable all receivers items.

- (void)disable

Declared In

CNSplitViewToolbar.h

enable

Enable all receivers items.

- (void)enable

Declared In

CNSplitViewToolbar.h

removeAllItems

Removes all placed items.

- (void)removeAllItems

Declared In

CNSplitViewToolbar.h

removeItem:

Removes a given CNAnchoredButton.

- (void)removeItem:(id)theItem

Parameters

button

A present CNAnchoredButton object that should be removed.

Declared In

CNSplitViewToolbar.h