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


//
//  UKFilePathView.h
//  Shovel
//
//  Created by Uli Kusterer on Thu Mar 25 2004.
//  Copyright (c) 2004 M. Uli Kusterer. All rights reserved.
//
 
#import <AppKit/AppKit.h>
 
 
/*
	An NSView that displays a file path. This looks kind of like how Sherlock
	displays the location of a file. Basically you get each folder's display
	name with its icon in front of it, and little grey triangles between
	them, and you get the icon of the file or folder at the end and its display
    name.
	
	If the path is too long, this takes items out of the middle and displays
	an ellipsis character (...) instead.
	
	You can also right-click or control-click on this to get a contextual menu
	that contains "Reveal in Finder" and "Show Real Names" menu choices. Real
	names displays the actual path, starting with "/", and using the actual
	file names instead of their display names. As a shortcut, double-clicking
	this view is the same as "Reveal in Finder".
	
	This needs:
		- PathArrow.tiff (for the little triangle)
		- UKGraphics.h/.m (for drawing the bezel around the view)
*/// The path to be displayed.
// Show actual names, not display names.
// Handed on directly to the open panel.
// Handed on directly to the open panel.
// Handed on directly to the open/save panels.
// Handed on directly to the open panel.
// A placeholder to show when path is NIL. Defaults to "none".
// same as filePath.
// same as setFilePath.
// UI for changing value:
// NSOpenPanel. Chooses existing files.
// NSSavePanel. Lets the user specify name and location for new files.
// Sets the file path to NIL.
 
// Getters/setters for the NSOpenPanel properties:
// Getters/setters for NSOpenPanel/NSSavePanel properties:
// What to display instead of items that had to be left out because there wasn't room:
#define UK_PATH_ELLIPSIS			@"..."
 
// Some constants we use for this view's metrics:
#define UK_PATH_NAME_LEFT_MARGIN	4
#define UK_PATH_NAME_RIGHT_MARGIN	4
#define UK_PATH_NAME_TOP_MARGIN		2
#define UK_PATH_NAME_BOTTOM_MARGIN  2
#define UK_PATH_NAME_TOTAL_VMARGIN  (UK_PATH_NAME_TOP_MARGIN +UK_PATH_NAME_BOTTOM_MARGIN)
#define UK_PATH_NAME_TOTAL_HMARGIN  (UK_PATH_NAME_LEFT_MARGIN +UK_PATH_NAME_RIGHT_MARGIN)
#define UK_PATH_ARROW_IMG_WIDTH		16
#define UK_PATH_ICON_IMG_WIDTH		16
#define UK_PATH_ICON_NAME_HDISTANCE 2
 
 
 
 

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.