File: programming/cocoa/UKFilePathView.zip/UKFilePathView.m


//
//  UKFilePathView.m
//  Shovel
//
//  Created by Uli Kusterer on Thu Mar 25 2004.
//  Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
//
 
#import "UKFilePathView.h"
#import "UKGraphics.h"
// Means "none".
		noDisplayNames = NO;	// Show display names by default.
"<None>", @"default UKFilePathView placeholder""foo"// Draw border and make sure text is vertically centered:
// If no path specified, show "none":
// Build the display path and list our icons:
'/'"/""/"// We're showing display names?
"/Volumes"// Calculate width of displayed path:
// If it's wider than our box, start taking components out of the middle:
// Replace the middle-most entry with an ellipsis ("..."):
// Remove "...".
// Remove empty icon for ellipsis.
// Remove empty path for ellipsis.
""// Still wider?
	{
		// Remove final two components so we only show file icon and name:
// Draw components that are left:
//NSLog(@"%d %@ (%@)", (int)exists, currName, thePath );
"PathArrow.tiff"// 5 secs should be enough.
""// Upon a click, we shortly toggle from display to file names and back:
"""Contextual Menu""Reveal in Finder",@"UKFilePathView contextual menu item""""Show Real File Names",@"UKFilePathView contextual menu item"""// ---------------------------------------------------------- 
// - types:
// ---------------------------------------------------------- 
// ---------------------------------------------------------- 
// - setTypes:
// ---------------------------------------------------------- 
// ---------------------------------------------------------- 
// - canChooseFiles:
// ---------------------------------------------------------- 
// ---------------------------------------------------------- 
// - setCanChooseFiles:
// ---------------------------------------------------------- 
// ---------------------------------------------------------- 
// - canChooseDirectories:
// ---------------------------------------------------------- 
// ---------------------------------------------------------- 
// - setCanChooseDirectories:
// ---------------------------------------------------------- 
// ---------------------------------------------------------- 
// - treatsFilePackagesAsDirectories:
// ---------------------------------------------------------- 
// ---------------------------------------------------------- 
// - setTreatsFilePackagesAsDirectories:
// ---------------------------------------------------------- 
// ---------------------------------------------------------- 
// - action:
// ---------------------------------------------------------- 
// ---------------------------------------------------------- 
// - setAction:
// ---------------------------------------------------------- 
// ---------------------------------------------------------- 
// - target:
// ---------------------------------------------------------- 
// ---------------------------------------------------------- 
// - setTarget:
// ---------------------------------------------------------- 
 

This code uses the PclZip Zip File reading code, which is subject to the GNU LGPL. It also uses the GeSHi syntax highlighter, subject to the GPL. Ask if you want this for your own web site, it's free.