File:  [mozdev] / chimera / NSToolbarAdditions.m
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Feb 26 11:49:01 2002 UTC (15 years, 8 months ago) by macserv
Branches: MAIN
CVS tags: HEAD
Checking in the underlying prefs structure, and a prefPane, also fir structural integrity.  Also including a couple categories to extend a couple Cocoa objects, and some project changes to support building with the bundled prefPanes.  Also, added a contrib directory to house user contributed artifacts.  To come soon: more prefPanes, and the colorized icon store, with pref-generated notifications to be picked up by toolbars.

#import "NSToolbarAdditions.h"
#import <Foundation/Foundation.h>

@implementation NSToolbar (NSToolbarCustomizableAdditions)
- (BOOL) alwaysCustomizableByDrag {
    return (BOOL) _tbFlags.clickAndDragPerformsCustomization;
}

- (void) setAlwaysCustomizableByDrag:(BOOL) flag {
	_tbFlags.clickAndDragPerformsCustomization = (unsigned int) flag & 1;
}

- (BOOL) showsContextMenu {
	return (BOOL) ! _tbFlags.showsNoContextMenu;
}

- (void) setShowsContextMenu:(BOOL) flag {
	_tbFlags.showsNoContextMenu = (unsigned int) ! flag & 1;
}

- (unsigned int) indexOfFirstMovableItem {
	return (unsigned int) _tbFlags.firstMoveableItemIndex;
}

- (void) setIndexOfFirstMovableItem:(unsigned int) anIndex {
	_tbFlags.firstMoveableItemIndex = (unsigned int) anIndex & 0x3F;
}
@end

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>