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

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] 
DirArray.h
[View DirArray.h] 
DirArray.m
[View DirArray.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/
 
LazyScrollDir.iconheader
 
LazyScrollDir.nib/
 
LazyScrollDir.tiff
 
LazyScrollDir_main.m
[View LazyScrollDir_main.m] 
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/
 
TODO.txt
[View TODO.txt] 

README.rtf

LazyScrollDir
By Paul S. McCarthy and Eric Sunshine
Copyright ©1995-1997 by Paul S. McCarthy and Eric Sunshine
July 8, 1997

Overview

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


Notable Features

Lazy Mode
This program illustrates how to use a lazy mode MiscTableScroll.  In lazy mode the data-delegate is responsible for supplying the cells that the MiscTableScroll will display.  In this example, the data-delegate also supplies information (such as stringValue, intValue, tag, etc.) during sorting as a speed optimization.

This program allocates a single cell for each column.  When the MiscTableScroll requests a cell for some column and row, the data-delegate takes the cell it allocated for that column, fills it with information from that row, and returns it.  As a side-effect of this, time-consuming operations like fetching a file's icon can be delayed until it is actually needed.  Likewise retrieval of group and owner names from NetInfo (also time-consuming) is delayed until display or sort time.

This contrasts sharply with eager mode, in which all cells are created and filled immediately.  Lazy mode is useful for exceptionally large data sets or data sets for which data retrieval is very time-consuming.  Eager mode, however, is usually easier to program.

Color
The example shows how to use color with the MiscTableScroll.  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.

When the highlight directories switch is 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.

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.