Up

NSBrowser

Authors

Scott Christley (scottc@net-community.com)
Felipe A. Rodriguez (far@ix.netcom.com)
Franck Wolff (wolff@cybercable.fr)
Mirko Viviani (mirko.viviani@rccr.cremona.it)
Fred Kiefer (FredKiefer@gmx.de)
Control to display and select from hierarchal lists

Copyright: (C) 1996, 1997, 2002 Free Software Foundation, Inc.


Contents -

  1. Software documentation for the NSBrowser class
  2. Software documentation for the NSBrowser(GNUstepExtensions) category
  3. Software documentation for the NSObject(NSBrowserDelegate) informal protocol

Software documentation for the NSBrowser class

NSBrowser : NSControl

Declared in:
AppKit/NSBrowser.h
Conforms to:
NSCoding
Standards:

Description forthcoming.


Instance Variables

Method summary

cellClass 

+ (Class) cellClass;

Returns the NSBrowserCell class (regardless of whether a setCellClass: message has been sent to a particular instance). This method is not meant to be used by applications.


acceptsArrowKeys 

- (BOOL) acceptsArrowKeys;

Returns YES if the arrow keys are enabled.


addColumn 

- (void) addColumn;

Adds a column to the right of the last column.


allowsBranchSelection 

- (BOOL) allowsBranchSelection;

Returns whether the user can select branch items when multiple selection is enabled.


allowsEmptySelection 

- (BOOL) allowsEmptySelection;

Returns whether there can be nothing selected.


allowsMultipleSelection 

- (BOOL) allowsMultipleSelection;

Returns whether the user can select multiple items.


cellPrototype 

- (id) cellPrototype;

Returns the NSBrowser's prototype NSCell instance.


columnOfMatrix: 

- (int) columnOfMatrix: (NSMatrix*)matrix;

Returns the column number in which matrix is located.


delegate 

- (id) delegate;

Returns the NSBrowser's delegate.


displayAllColumns 

- (void) displayAllColumns;

Updates the NSBrowser to display all loaded columns.


displayColumn: 

- (void) displayColumn: (int)column;

Updates the NSBrowser to display the column with the given index.


doClick: 

- (void) doClick: (id)sender;

Responds to (single) mouse clicks in a column of the NSBrowser.


doDoubleClick: 

- (void) doDoubleClick: (id)sender;

Responds to double-clicks in a column of the NSBrowser.


doubleAction 

- (SEL) doubleAction;

Returns the NSBrowser's double-click action method.


drawTitle: inRect: ofColumn: 

- (void) drawTitle: (NSString*)title inRect: (NSRect)aRect ofColumn: (int)column;

Draws the title for the column at index column within the rectangle defined by aRect.


drawTitleOfColumn: inRect: 

- (void) drawTitleOfColumn: (int)column inRect: (NSRect)aRect;

Description forthcoming.


firstVisibleColumn 

- (int) firstVisibleColumn;

Returns the index of the first visible column.


frameOfColumn: 

- (NSRect) frameOfColumn: (int)column;

Returns the rectangle containing the column at index column.


frameOfInsideOfColumn: 

- (NSRect) frameOfInsideOfColumn: (int)column;

Returns the rectangle containing the column at index column,


hasHorizontalScroller 

- (BOOL) hasHorizontalScroller;

Returns whether an NSScroller is used to scroll horizontally.


isLoaded 

- (BOOL) isLoaded;

Returns whether column zero is loaded.


isTitled 

- (BOOL) isTitled;

Returns whether columns display titles.


lastColumn 

- (int) lastColumn;

Returns the index of the last column loaded.


lastVisibleColumn 

- (int) lastVisibleColumn;

Returns the index of the last visible column.


loadColumnZero 

- (void) loadColumnZero;

Loads column zero; unloads previously loaded columns.


loadedCellAtRow: column: 

- (id) loadedCellAtRow: (int)row column: (int)column;

Loads if necessary and returns the NSCell at row in column.


matrixClass 

- (Class) matrixClass;

Returns the class of NSMatrix used in the NSBrowser's columns.


matrixInColumn: 

- (NSMatrix*) matrixInColumn: (int)column;

Returns the matrix located in the column identified by index column.


maxVisibleColumns 

- (int) maxVisibleColumns;

Returns the maximum number of visible columns.


minColumnWidth 

- (int) minColumnWidth;

Returns the minimum column width in pixels.


numberOfVisibleColumns 

- (int) numberOfVisibleColumns;

Returns the number of columns visible.


path 

- (NSString*) path;

Returns the browser's current path.


pathSeparator 

- (NSString*) pathSeparator;

Returns the path separator. The default is "/".


pathToColumn: 

- (NSString*) pathToColumn: (int)column;

Returns a string representing the path from the first column up to, but not including, the column at index column.


reloadColumn: 

- (void) reloadColumn: (int)column;

Reloads column if it is loaded; sets it as the last column. Reselects previously selected cells, if they remain.


reusesColumns 

- (BOOL) reusesColumns;

Returns YES if NSMatrix objects aren't freed when their columns are unloaded.


scrollColumnToVisible: 

- (void) scrollColumnToVisible: (int)column;

Scrolls to make the column at index column visible.


scrollColumnsLeftBy: 

- (void) scrollColumnsLeftBy: (int)shiftAmount;

Scrolls columns left by shiftAmount columns.


scrollColumnsRightBy: 

- (void) scrollColumnsRightBy: (int)shiftAmount;

Scrolls columns right by shiftAmount columns.


scrollViaScroller: 

- (void) scrollViaScroller: (NSScroller*)sender;

Scrolls columns left or right based on an NSScroller.


selectAll: 

- (void) selectAll: (id)sender;

Selects all NSCells in the last column of the NSBrowser.


selectRow: inColumn: 

- (void) selectRow: (int)row inColumn: (int)column;

Selects the cell at index row in the column identified by index column.


selectedCell 

- (id) selectedCell;

Returns the last (rightmost and lowest) selected NSCell.


selectedCellInColumn: 

- (id) selectedCellInColumn: (int)column;

Returns the last (lowest) NSCell that's selected in column.


selectedCells 

- (NSArray*) selectedCells;

Returns all cells selected in the rightmost column.


selectedColumn 

- (int) selectedColumn;

Returns the index of the last column with a selected item.


selectedRowInColumn: 

- (int) selectedRowInColumn: (int)column;

Returns the row index of the selected cell in the column specified by index column.


sendAction 

- (BOOL) sendAction;

Sends the action message to the target. Returns YES upon success, NO if no target for the message could be found.


sendsActionOnArrowKeys 

- (BOOL) sendsActionOnArrowKeys;

Returns NO if pressing an arrow key only scrolls the browser, YES if it also sends the action message specified by setAction:.


separatesColumns 

- (BOOL) separatesColumns;

Returns whether columns are separated by bezeled borders.


setAcceptsArrowKeys: 

- (void) setAcceptsArrowKeys: (BOOL)flag;

Enables or disables the arrow keys as used for navigating within and between browsers.


setAllowsBranchSelection: 

- (void) setAllowsBranchSelection: (BOOL)flag;

Sets whether the user can select branch items when multiple selection is enabled.


setAllowsEmptySelection: 

- (void) setAllowsEmptySelection: (BOOL)flag;

Sets whether there can be nothing selected.


setAllowsMultipleSelection: 

- (void) setAllowsMultipleSelection: (BOOL)flag;

Sets whether the user can select multiple items.


setCellClass: 

- (void) setCellClass: (Class)classId;

Sets the class of NSCell used in the columns of the NSBrowser.


setCellPrototype: 

- (void) setCellPrototype: (NSCell*)aCell;

Sets the NSCell instance copied to display items in the columns of NSBrowser.


setDelegate: 

- (void) setDelegate: (id)anObject;

Sets the delegate of the receiver. If not nil, the delegate must either be passive and respond to [NSObject -browser:numberOfRowsInColumn:] or be active and respond to [NSObject -browser:createRowsForColumn:inMatrix:] but not both. If the delegate is active it must also respond to [NSObject -browser:willDisplayCell:atRow:column:] . If the delegate is not nil but does not meet these conditions, an NSBrowserIllegalDelegateException will be raised.


setDoubleAction: 

- (void) setDoubleAction: (SEL)aSelector;

Sets the NSBrowser's double-click action to aSelector.


setHasHorizontalScroller: 

- (void) setHasHorizontalScroller: (BOOL)flag;

Sets whether an NSScroller is used to scroll horizontally.


setLastColumn: 

- (void) setLastColumn: (int)column;

Sets the last column to column.


setMatrixClass: 

- (void) setMatrixClass: (Class)classId;

Sets the matrix class (NSMatrix or an NSMatrix subclass) used in the NSBrowser's columns.


setMaxVisibleColumns: 

- (void) setMaxVisibleColumns: (int)columnCount;

Sets the maximum number of columns displayed.


setMinColumnWidth: 

- (void) setMinColumnWidth: (int)columnWidth;

Sets the minimum column width in pixels.


setPath: 

- (BOOL) setPath: (NSString*)path;

Parses path and selects corresponding items in the NSBrowser columns.

This is the primary mechanism for programmatically updating the selection of a browser. It should result in the browser cells corresponding to the components being selected, and the browser columns up to the end of path (and just beyond if the last selected cell's [NSBrowserCell -isLeaf] returns YES).
It does not result in the browsers action being sent to its target, just in a change to the browser selection and display.

If path begins with the -pathSeparator then it is taken to be absolute and the first component in it is expected to denote a cell in column zero. Otherwise it is taken to be relative to the currently selected column.

Empty components (ie where a -pathSeparator occurs immediately after another or at the end of path) are simply ignored.

The receivers delegate is asked to select each cell in turn using the -browser:selectCellWithString:inColumn: method (if it implements it). If this call to the delegate returns NO then the attempt to set the path fails.
If the delegate does not implement the method, the browser attempts to locate and select the cell itsself, and the method fails if it is unable to locate the cell by matching its [NSCell -stringValue] with the component of the path.

The method returns YES if path contains no components or if a cell corresponding to the path was found. Otherwise it returns NO.


setPathSeparator: 

- (void) setPathSeparator: (NSString*)aString;

Sets the path separator to newString.


setReusesColumns: 

- (void) setReusesColumns: (BOOL)flag;

If flag is YES, prevents NSMatrix objects from being freed when their columns are unloaded, so they can be reused.


setSendsActionOnArrowKeys: 

- (void) setSendsActionOnArrowKeys: (BOOL)flag;

Sets whether pressing an arrow key will cause the action message to be sent (in addition to causing scrolling).


setSeparatesColumns: 

- (void) setSeparatesColumns: (BOOL)flag;

Sets whether to separate columns with bezeled borders.


setTakesTitleFromPreviousColumn: 

- (void) setTakesTitleFromPreviousColumn: (BOOL)flag;

Sets whether the title of a column is set to the string value of the selected NSCell in the previous column.


setTitle: ofColumn: 

- (void) setTitle: (NSString*)aString ofColumn: (int)column;

Sets the title of the column at index column to aString.


setTitled: 

- (void) setTitled: (BOOL)flag;

Sets whether columns display titles.


takesTitleFromPreviousColumn 

- (BOOL) takesTitleFromPreviousColumn;

Returns YES if the title of a column is set to the string value of the selected NSCell in the previous column.


tile 

- (void) tile;

Adjusts the various subviews of NSBrowser-scrollers, columns, titles, and so on-without redrawing. Your code shouldn't send this message. It's invoked any time the appearance of the NSBrowser changes.


titleFrameOfColumn: 

- (NSRect) titleFrameOfColumn: (int)column;

Returns the bounds of the title frame for the column at index column.


titleHeight 

- (float) titleHeight;

Returns the height of column titles.


titleOfColumn: 

- (NSString*) titleOfColumn: (int)column;

Returns the title displayed for the column at index column.


updateScroller 

- (void) updateScroller;

Updates the horizontal scroller to reflect column positions.


validateVisibleColumns 

- (void) validateVisibleColumns;

Invokes delegate method browser:isColumnValid: for visible columns.




Instance Variables for NSBrowser Class

_acceptsAlphaNumericalKeys

@protected BOOL _acceptsAlphaNumericalKeys;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_acceptsArrowKeys

@protected BOOL _acceptsArrowKeys;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_action

@protected SEL _action;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_allowsBranchSelection

@protected BOOL _allowsBranchSelection;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_allowsEmptySelection

@protected BOOL _allowsEmptySelection;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_allowsMultipleSelection

@protected BOOL _allowsMultipleSelection;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_alphaNumericalLastColumn

@protected int _alphaNumericalLastColumn;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_browserCellPrototype

@protected id _browserCellPrototype;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_browserColumns

@protected NSMutableArray* _browserColumns;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_browserDelegate

@protected id _browserDelegate;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_browserMatrixClass

@protected id _browserMatrixClass;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_charBuffer

@protected NSString* _charBuffer;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_columnSize

@protected NSSize _columnSize;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_doubleAction

@protected SEL _doubleAction;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_firstVisibleColumn

@protected int _firstVisibleColumn;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_hasHorizontalScroller

@protected BOOL _hasHorizontalScroller;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_horizontalScroller

@protected NSScroller* _horizontalScroller;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_isLoaded

@protected BOOL _isLoaded;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_isTitled

@protected BOOL _isTitled;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_lastColumnLoaded

@protected int _lastColumnLoaded;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_lastKeyPressed

@protected NSTimeInterval _lastKeyPressed;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_lastVisibleColumn

@protected int _lastVisibleColumn;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_maxVisibleColumns

@protected int _maxVisibleColumns;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_minColumnWidth

@protected float _minColumnWidth;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_passiveDelegate

@protected BOOL _passiveDelegate;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_pathSeparator

@protected NSString* _pathSeparator;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_reusesColumns

@protected BOOL _reusesColumns;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_scrollerRect

@protected NSRect _scrollerRect;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_sendsActionOnAlphaNumericalKeys

@protected BOOL _sendsActionOnAlphaNumericalKeys;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_sendsActionOnArrowKeys

@protected BOOL _sendsActionOnArrowKeys;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_separatesColumns

@protected BOOL _separatesColumns;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_skipUpdateScroller

@protected BOOL _skipUpdateScroller;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_takesTitleFromPreviousColumn

@protected BOOL _takesTitleFromPreviousColumn;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_target

@protected id _target;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.





Software documentation for the NSBrowser(GNUstepExtensions) category

NSBrowser(GNUstepExtensions)

Declared in:
AppKit/NSBrowser.h
Standards:

Description forthcoming.

Method summary

acceptsAlphaNumericalKeys 

- (BOOL) acceptsAlphaNumericalKeys;

Returns YES if the alphanumerical keys are enabled.


sendsActionOnAlphaNumericalKeys 

- (BOOL) sendsActionOnAlphaNumericalKeys;

Returns NO if pressing an arrow key only scrolls the browser, YES if it also sends the action message specified by setAction:.


setAcceptsAlphaNumericalKeys: 

- (void) setAcceptsAlphaNumericalKeys: (BOOL)flag;

Enables or disables the arrow keys as used for navigating within and between browsers.


setSendsActionOnAlphaNumericalKeys: 

- (void) setSendsActionOnAlphaNumericalKeys: (BOOL)flag;

Sets whether pressing an arrow key will cause the action message to be sent (in addition to causing scrolling).


Software documentation for the NSObject(NSBrowserDelegate) informal protocol

NSObject(NSBrowserDelegate)

Declared in:
AppKit/NSBrowser.h
Standards:

Description forthcoming.

Method summary

browser: createRowsForColumn: inMatrix: 

- (void) browser: (NSBrowser*)sender createRowsForColumn: (int)column inMatrix: (NSMatrix*)matrix;

Description forthcoming.


browser: isColumnValid: 

- (BOOL) browser: (NSBrowser*)sender isColumnValid: (int)column;

Returns YES iff


browser: numberOfRowsInColumn: 

- (int) browser: (NSBrowser*)sender numberOfRowsInColumn: (int)column;

Description forthcoming.


browser: selectCellWithString: inColumn: 

- (BOOL) browser: (NSBrowser*)sender selectCellWithString: (NSString*)title inColumn: (int)column;

Description forthcoming.


browser: selectRow: inColumn: 

- (BOOL) browser: (NSBrowser*)sender selectRow: (int)row inColumn: (int)column;

Description forthcoming.


browser: titleOfColumn: 

- (NSString*) browser: (NSBrowser*)sender titleOfColumn: (int)column;

Description forthcoming.


browser: willDisplayCell: atRow: column: 

- (void) browser: (NSBrowser*)sender willDisplayCell: (id)cell atRow: (int)row column: (int)column;

Description forthcoming.


browserDidScroll: 

- (void) browserDidScroll: (NSBrowser*)sender;

Description forthcoming.


browserWillScroll: 

- (void) browserWillScroll: (NSBrowser*)sender;

Description forthcoming.



Up