ftp.nice.ch/pub/next/developer/resources/classes/misckit/MiscKit.1.10.0.s.gnutar.gz#/MiscKit/Examples/ScrollDir

Align.HCentered.VCentered.tiff
 
Align.HCentered.VTop.tiff
 
Align.HLeft.VCentered.tiff
 
Align.HLeft.VTop.tiff
 
Defaults.h
[View Defaults.h] 
Defaults.m
[View Defaults.m] 
DirController.h
[View DirController.h] 
DirController.m
[View DirController.m] 
DirWindow.h
[View DirWindow.h] 
DirWindow.m
[View DirWindow.m] 
DirWindow.nib/
 
HISTORY.txt
[View HISTORY.txt] 
Info.nib/
 
Lock.insecure.tiff
 
Lock.secure.tiff
 
Makefile
 
Makefile.postamble
 
Makefile.preamble
 
NameCache.h
[View NameCache.h] 
NameCache.m
[View NameCache.m] 
PACKAGE_NUMBER
 
PB.gdbinit
 
PB.project
 
Pagination.HAuto.VAuto.tiff
 
Pagination.HAuto.VClip.tiff
 
Pagination.HAuto.VFit.tiff
 
Pagination.HClip.VAuto.tiff
 
Pagination.HClip.VClip.tiff
 
Pagination.HClip.VFit.tiff
 
Pagination.HFit.VAuto.tiff
 
Pagination.HFit.VClip.tiff
 
Pagination.HFit.VFit.tiff
 
README.rtf
[View README.rtf] 
SD_PageLayout.h
[View SD_PageLayout.h] 
SD_PageLayout.m
[View SD_PageLayout.m] 
SD_PageLayout.nib/
 
ScrollDir.iconheader
 
ScrollDir.nib/
 
ScrollDir.tiff
 
ScrollDir_main.m
[View ScrollDir_main.m] 

README.rtf

ScrollDir
By Paul S. McCarthy and Eric Sunshine
Copyright ©1995-1997 by Paul S. McCarthy and Eric Sunshine
January 12, 1997

Overview

This program demonstrates the use of the MiscTableScroll object in eager mode by acting as a simple directory browser.  Basic operations such as open, delete, rename, and change directory can be performed on the listed files and directories.


Notable Features

Eager Mode
This example uses an eager mode MiscTableScroll which creates and fills all cells immediately.  This differs from a lazy mode MiscTableScroll where the data-delegate is responsible for managing the cells.  Eager mode is useful for fairly small data sets and data sets for which data retrieval time is small.  Eager mode is usually easier to program than lazy mode.

Color
The example shows how cells can inherit color from the MiscTableScroll itself, as well as maintain their own colors independently.  Color swatches can be dragged from the Color Panel and dropped onto the browser window.  The background of the MiscTableScroll is set to the color of the dropped swatch.  All cells which inherit their color from the MiscTableScroll implicitly take the same background color.  All cells which have had their color set explicitly retain their own color.

The highlight directories switch on the browser window demonstrates that cells can maintain their own colors instead of inheriting them.  When toggled on the rows for directories are highlighted in a color independent of the MiscTableScroll.

Font
When the MiscTableScroll is first-responder, the Font Panel can be used to change its font.  Cells which inherit their font from the MiscTableScroll display the newly selected font.

Users Preferences
This program demonstrates how to save and restore the user's column order and width preferences.  Additionally, all other user preferences -- font, color, switch settings, and window size -- are also saved and restored.

Sorting
A switch on the browser window controls whether or not rows are automatically sorted as columns are rearranged.  This demonstrates the very powerful built-in sorting capability of MiscTableScroll.  Sorting can be fine-tuned right in the nib file by adjusting the criteria on a column-by-column basis.  For instance, columns may contribute stringValue, title, intValue, tag, etc. to the row-wise comparisons.

Icon Display
One column in the browser displays the file's icon.  This demonstrates how to use icon columns in addition to text columns.

Image Dragging
MiscTableScroll allows images to be dragged directly out cells.  In this example, the file's icon can be dragged directly from the directory browser into any other application which accepts dragged filenames, such as File Viewer, Mail, Edit, etc.  A button controls whether or not the scaled or full-size image is used during the dragging operation.  This illustrates how the delegate can optionally substitute an image in place of the one already contained in the cell.

Text Editing
MiscTableScroll supports in-cell text editing.  This example program uses the editing feature to allow the user to rename files.  Double-clicking with the mouse on the file name in the Name column initiates editing.

Buttons
This example illustrates how to use ButtonCells with the MiscTableScroll.  One column contains a ButtonCell configured as a toggle switch.  It displays a padlock in either a locked or unlocked state and clicking on it toggles its state.  The padlock indicates whether or not the file can be renamed.  When unlocked, renaming is allowed, and double-clicking on the file name in the Name column initiates an edit session.  When locked, renaming is not allowed.  If you do not have permission to rename a file the browser displays a locked icon and disables the ButtonCell.

Saving (Exporting)
MiscTableScroll can export its contents in dBASEIII (.dbf) format and also a number of ASCII formats via the Save menu item on the Directory menu.

Name Caching
NetInfo is notoriously slow.  Translation of user and group numbers into their text equivalents is sped up by caching the results of calls to getpwuid and getgrgid (both of which ultimately consult NetInfo).

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.