MiscKit2/ 40755 1750 1750 0 6757724441 12421 5ustar sunshinesunshineMiscKit2/Palettes/ 40755 1750 1750 0 6757227245 14202 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/ 40755 1750 1750 0 6757365627 17233 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/Framework/ 40755 1750 1750 0 6757227360 21157 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/Framework/Documentation/ 40755 1750 1750 0 6757227321 23765 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/Framework/Documentation/MiscTableCell.rtf100444 1750 1750 203450 6757227321 27304 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\ftech Symbol;\f2\fswiss Helvetica;\f3\fmodern Courier;\f4\fmodern Ohlfs;} \paperw16220 \paperh9600 \margl120 \margr0 {\colortbl;\red0\green0\blue0;} \f0\b0\i0\ulnone\ql\fs24\fi0\li0\gray0\fc0\cf0\up0\dn0 Version 2.0, Copyright \f1 \f0 1995, 1996, 1997, 1999 by Paul S. McCarthy and Eric Sunshine. All Rights Reserved.\ Paul S. McCarthy and Eric Sunshine -- May 3, 1999\ \ \f2\b\fs52\li1460\fc1\cf1 MiscTableCell \fs56\fc0\cf0 \ \pard\tx4880\fs80\li1460\fc0\cf0 \ \pard\tx4220\fs24\fi-2720\li4220\fc0\cf0 Inherits From: \f0\b0\fs28 NSCell : NSObject\ \fs20 \ \f2\b\fs24\fi-2740 Conforms To: \f0\b0\fs28 NSCoding (NSObject), \ \fi0 NSCopying (NSObject),\ NSObject (NSObject)\ \fs20 \ \f2\b\fs24\fi-2740 Declared In: \f0\b0\fs28 MiscTableCell.h\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx4220\f2\b\fs24\fi-2740\li4220\fc0\cf0 Java Class: \f0\b0\fs28 org.misckit.yellow.application.TableScroll.Cell\ \pard\f2\b\fs16\li1360\fc0\cf0 \ \ \ \fs28\fi-1020\li1200\fc1\cf1 Class Description\ \fs16\fi0\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f0\b0\fs28\li1500\fc0\cf0 This is the cell class used by MiscTableScroll to display either text or an image. This class provides a tag and separate text and background colors for normal and selected states. Finally, it supports the concept of an \i owner \i0 , and inherited font and color values.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f2\b\fs24\li1500\fc1\cf1 Owner and Inheritence of Colors and Font\ \f0\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This class implements the concept of an \i owner \i0 . An owner provides the default font and colors used by the cells that it owns. This makes it fast and easy to change the appearance of an entire table: set the font and colors of the owner, and all of the cells that it owns automatically inherit the new font and colors. However, you can also set font and color values for individual cells. Values that you explicitly set supercede values implicitly inherited from the owner. You can use this feature to emphasize special cells while still using inherited values for normal cells.\ \pard\tx2480\tx2860\tx3240\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f0\b0\fs28\li1500\fc0\cf0 Another benefit of inherited values is reduced memory usage. Inherited values don't have to be stored in the individual cells. They just ask their owner for the current value whenever it is needed. This can lead to significant savings in large tables. \ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \f2\b\fs16\li1360 \ \fs24\li1500\fc1\cf1 Owner drawing\ \f0\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc1\cf1 This class also supports a specialized concept of delegated drawing. The MiscTableScroll class will draw cells that respond with YES to the \f3\fs24 -ownerDraw \f0\fs28 message. This enables the MiscTableScroll object to eliminate many redundant font and color setting operations, greatly improving drawing performance. See the description of owner drawing in MiscTableScroll for a more detailed discussion.\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \f2\b\fs16\li1360 \ \fs24\li1500\fc1\cf1 Extensible Memory Management\ \f0\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 To minimize memory usage, storage for optional items is allocated on an as-needed basis. Memory is allocated only for the values that are actually set. If no optional items are set, then no extra memory at all is allocated.\ \pard\tx2480\tx2860\tx3240\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f0\b0\fs28\li1500\fc0\cf0 The optional allocation scheme is extensible. Subclasses of MiscTableCell can extend this allocation scheme by appending their own dynamic variables to the end of the list used by this class. There is a strict ordering for the information stored in the variable length data. This ordering is enumerated by the \i tc1_flags \i0 . Subclasses should append their data after the last of the information stored by this class. Methods are provided to determine whether or not a piece of information is stored in the data field as well as for finding its address. Convenience methods for extracting a given piece of information complete the interface.\ \pard\tx2480\tx2860\tx3240\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f0\b0\fs28\li1500\fc0\cf0 The methods which return the address of the piece of data in \i tc1_data \i0 are dynamic in nature. For instance, text color is stored prior to background color in \i tc1_data \i0 so if both text color and background color have been set then the address of the storage for the background color will follow the text color. However, if text color is never set that is it is inherited from the owner and the background color has been set then the address of the background color will be at a different location. If text color gets set later then the storage for background color is shifted up to make room for the text color. Ergo, the strict ordering is maintained.\ \pard\tx2480\tx2860\tx3240\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f0\b0\fs28\li1500\fc0\cf0 For example, code to locate the address of the selected background color is stored in the cell would look like this:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2880\tx3240\f3\fs24\li2520\fc1\cf1 - (unsigned int)tc1SelectBackgroundColorPos\ \{\ unsigned int pos = [self tc1SelectedTextColorPos];\ if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR_H)\ pos += [self tc1SelectedTextColorLen];\ return pos;\ \}\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc1\cf1 Since the selected background color is stored following the selected text color it first determines the location of the selected text color then adds the length of the selected text color to that address if the selected text color is in fact being stored locally. The actual shifting of the dynamic memory is done in the \f3\fs24 -setUseOwner \f0\fs28 ... methods. For instance:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2160\tx2520\tx2880\tx3240\f3\fs24\li1800\fc1\cf1 - (void)setUseOwnerSelectedBackgroundColor:(BOOL)flag\ \{\ if ([self useOwnerSelectedBackgroundColor] != flag)\ \{\ unsigned int const pos = [self tc1SelectedBackgroundColorPos];\ unsigned int const len = [self tc1SelectedBackgroundColorLen];\ if (flag)\ \{\ [[self selectedBackgroundColor] release];\ [self tc1DeleteDataPos:pos len:len];\ tc1_flags &= ~(MISC_TC1_SELF_BACKGROUND_COLOR_H);\ \}\ else // (!flag)\ \{\ NSColor* color = [[[self class] defaultSelectedBackgroundColor] retain];\ [self tc1InsertData:&color pos:pos len:len];\ tc1_flags |= MISC_TC1_SELF_BACKGROUND_COLOR_H;\ \}\ \}\ \}\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc1\cf1 Finally, the \f3\fs24 -setSelectedBackgroundColor: \f0\fs28 method makes room for the data and then stores it:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2160\tx2520\tx2880\tx3240\f3\fs24\li1800\fc1\cf1 - (void)setSelectedBackgroundColor:(NSColor*)c\ \{\ NSColor** p;\ [self setUseOwnerSelectedBackgroundColor:NO];\ p = [self tc1SelectedBackgroundColorPtr];\ [*p autorelease];\ *p = [c retain];\ \}\ \pard\tx2480\tx2860\tx3240\f0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc1\cf1 A subclass adding more data to the end of \i tc1_data \i0 would provide similar methods. Its counterpart to \f3\fs24 -tc1SelectedBackgroundColorPos \f0\i\fs28 \i0 would first call \f3\fs24 -tc1SelectedBackgroundColorPos \f0\i\fs28 \i0 to determine its address and then add the correct offset returned by \f3\fs24 -tc1SelectedBackgroundColorLen \f0\fs28 as appropriate.\ \fs14\fc0\cf0 \ \fs56 \ \pard\f2\b\fs28\fi-1020\li1200\fc1\cf1 Instance Variables \f0\b0\fs24\fc0\cf0 [Objective-C] \f2\b\fs28\fc1\cf1 \ \fs16\fi0\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f0\b0\fs28\li1500\fc0\cf0 id \b owner \b0 ;\ int \b tag \b0 ;\ unsigned \b tc1_flags \b0 ;\ void* \b tc1_data \b0 ;\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \ \ \pard\tx4320\fs28\li1500\fc0\cf0 owner The owner of this cell; queried for font and color information.\ \fs16 \ \fs28 tag A general purpose slot for your use.\ \fs16 \ \fs28 tc1_flags Bit flags describing the contents of \i tc1_data \i0 .\ \fs16 \ \fs28 tc1_data Variable length data which is allocated only as needed for storage of color values.\ \pard\tx3600\tx3980\tx4340\fs14\li1500\fc0\cf0 \ \fs56 \ \pard\f2\b\fs28\fi-1020\li1200\fc1\cf1 Method Types\ \fs16\fi0\li1360\fc0\cf0 \ \pard\tx6080\tx11280\f0\b0\fs28\fi-4840\li6320\fc1\cf1 Initializing, freeing, and copying initImageCell:\ \pard\tx11280\fi-240\li6320\fc1\cf1 initTextCell:\ dealloc\ copyWithZone:\ \pard\tx6140\tx9660\tx10180\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx6080\tx11280\f0\b0\fs28\fi-4840\li6320\fc1\cf1 Drawing drawInteriorWithFrame:inView:\ \pard\tx11280\fi-240\li6320\fc1\cf1 drawWithFrame:inView:\ isOpaque\ bgColor\ fgColor\ setSelected:\ isSelected\ ownerDraw\ setOwnerDraw:\ \pard\tx6140\tx9660\tx10180\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx6080\tx11280\f0\b0\fs28\fi-4840\li6320\fc1\cf1 Tag manipulation setTag:\ \pard\tx11280\fi-240\li6320\fc1\cf1 tag\ \pard\tx6140\tx9660\tx10180\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx6080\tx11280\f0\b0\fs28\fi-4840\li6320\fc1\cf1 Font manipulation font\ \pard\tx11280\fi-240\li6320\fc1\cf1 setFont:\ \pard\tx6140\tx9660\tx10180\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx6080\tx11280\f0\b0\fs28\fi-4840\li6320\fc1\cf1 Setting and querying colors + defaultBackgroundColor\ \pard\tx11280\fi-240\li6320\fc1\cf1 + defaultFont\ + defaultSelectedBackgroundColor\ + defaultSelectedTextColor\ + defaultTextColor\ backgroundColor\ selectedBackgroundColor\ selectedTextColor\ setBackgroundColor:\ setSelectedBackgroundColor:\ setSelectedTextColor:\ setTextColor:\ textColor\ \pard\tx6140\tx9660\tx10180\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx6080\tx11280\f0\b0\fs28\fi-4840\li6320\fc1\cf1 Setting and querying owner owner\ \pard\tx11280\fi-240\li6320\fc1\cf1 setOwner:\ \pard\tx6140\tx9660\tx10180\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx6080\tx11280\f0\b0\fs28\fi-4840\li6320\fc1\cf1 Colors and owner inheritence setOwnerBackgroundColor:\ \pard\tx11280\fi-240\li6320\fc1\cf1 setOwnerFont:\ setOwnerSelectedBackgroundColor:\ setOwnerSelectedTextColor:\ setOwnerTextColor:\ setUseOwnerBackgroundColor:\ setUseOwnerFont:\ setUseOwnerSelectedBackgroundColor:\ setUseOwnerSelectedTextColor:\ setUseOwnerTextColor:\ useOwnerBackgroundColor\ useOwnerFont\ useOwnerSelectedBackgroundColor\ useOwnerSelectedTextColor\ useOwnerTextColor\ \pard\tx6140\tx9660\tx10180\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx6080\tx11280\f0\b0\fs28\fi-4840\li6320\fc1\cf1 Archiving initWithCoder:\ \pard\tx11280\fi-240\li6320\fc1\cf1 encodeWithCoder:\ \pard\tx6140\tx9660\tx10180\f2\b\fs16\li1360\fc0\cf0 \ \pard\tx6080\tx11280\f0\b0\fs28\fi-4840\li6320\fc1\cf1 Extensible conditional allocations tc1BackgroundColorLen\ \pard\tx11280\fi-240\li6320\fc1\cf1 tc1BackgroundColorPos\ tc1BackgroundColorPtr\ tc1DataSize\ tc1DeleteDataPos:len:\ tc1DestroyData\ tc1Flags\ tc1SelectedBackgroundColorLen\ tc1SelectedBackgroundColorPos\ tc1SelectedBackgroundColorPtr\ tc1SelectedTextColorLen\ tc1SelectedTextColorPos\ tc1SelectedTextColorPtr\ tc1InsertData:pos:len:\ tc1TextColorLen\ tc1TextColorPos\ tc1TextColorPtr\ \fs70\fc0\cf0 \ \pard\f2\b\fs28\fi-1020\li1200\fc1\cf1 Class Methods\ \fs16\fi0\li1360\fc0\cf0 \ \pard\tx8260\fs28\li1500\fc0\cf0 defaultBackgroundColor\ \pard\f0\b0\fi-620\li2520\fc0\cf0 + (NSColor*) \b defaultBackgroundColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 static NSColor \b defaultBackgroundColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \f3\fs24\fc1\cf1 [NSColor controlBackgroundColor] \f0\fs28\fc0\cf0 as the default background color. This is the color which is returned by \f3\fs24\fc1\cf1 -backgroundColor \f0\fs28\fc0\cf0 if a custom color has not been set for this cell and no owner has been set or the owner does not respond to the \f3\fs24\fc1\cf1 -backgroundColor \f0\fs28\fc0\cf0 message. This is also the color used upon receipt of a \f3\fs24\fc1\cf1 -setUseOwnerBackgroundColor:NO \f0\b\fs28\fc0\cf0 \b0 message. Subclasses should override this method if this color is inappropriate.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \f0\fs28 backgroundColor, + defaultSelectedBackgroundColor, + defaultSelectedTextColor, +defaultTextColor, setBackgroundColor:, setUseOwnerBackgroundColor: \b0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 defaultFont\ \pard\f0\b0\fi-620\li2520\fc0\cf0 + (NSFont*) \b defaultFont \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 static NSFont \b defaultFont \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the user-font at point-size 12.0 as the default font. This is the font which is used when initializing the cell as a text cell with \b \f3\b0\fs24\fc1\cf1 initTextCell: \f0\fs28\fc0\cf0 . Subclasses should override this method if this value is inappropriate.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 font, initTextCell:, setFont: \b0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 defaultSelectedBackgroundColor\ \pard\f0\b0\fi-620\li2520\fc0\cf0 + (NSColor*) \b defaultSelectedBackgroundColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 static NSColor \b defaultSelectedBackgroundColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \f3\fs24\fc1\cf1 [NSColor selectedControlColor] \f0\fs28\fc0\cf0 as the default selected background color. This is the color which is returned by \f3\fs24\fc1\cf1 -selectedBackgroundColor \f0\fs28\fc0\cf0 if a custom color has not been set for this cell and no owner has been set or the owner does not respond to the \f3\fs24\fc1\cf1 -selectedBackgroundColor \f0\fs28\fc0\cf0 message. This is also the color used upon receipt of a \f3\fs24\fc1\cf1 -setUseOwnerSelectedBackgroundColor:NO \f0\b\fs28\fc0\cf0 \b0 message. Subclasses should override this method if this color is inappropriate.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 + defaultBackgroundColor, + defaultSelectedTextColor, + defaultTextColor, selectedBackgroundColor, setSelectedBackgroundColor:, setUseOwnerSelectedBackgroundColor: \b0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 defaultSelectedTextColor\ \pard\f0\b0\fi-620\li2520\fc0\cf0 + (NSColor*) \b defaultSelectedTextColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 static NSColor \b defaultSelectedTextColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \f3\fs24\fc1\cf1 [NSColor selectedControlTextColor] \f0\fs28\fc0\cf0 as the default selected text color. This is the color which is returned by \f3\fs24\fc1\cf1 -selectedTextColor \f0\fs28\fc0\cf0 if a custom color has not been set for this cell and no owner has been set or the owner does not respond to the \f3\fs24\fc1\cf1 -selectedTextColor \f0\fs28\fc0\cf0 message. This is also the color used upon receipt of a \f3\fs24\fc1\cf1 -setUseOwnerSelectedTextColor:NO \f0\b\fs28\fc0\cf0 \b0 message. Subclasses should override this method if this color is inappropriate.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 + defaultBackgroundColor, + defaultSelectedBackgroundColor, + defaultTextColor, selectedTextColor, setSelectedBackgroundColor:, setUseOwnerSelectedBackgroundColor:\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 defaultTextColor\ \pard\f0\b0\fi-620\li2520\fc0\cf0 + (NSColor*) \b defaultTextColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 static NSColor \b defaultTextColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \f3\fs24\fc1\cf1 [NSColor controlTextColor] \f0\fs28\fc0\cf0 as the default text color. This is the color which is returned by \f3\fs24\fc1\cf1 -textColor \f0\fs28\fc0\cf0 if a custom color has not been set for this cell and no owner has been set or the owner does not respond to the \f3\fs24\fc1\cf1 -textColor \f0\fs28\fc0\cf0 message. This is also the color used upon receipt of a \f3\fs24\fc1\cf1 -setUseOwnerTextColor:NO \f0\b\fs28\fc0\cf0 \b0 message. Subclasses should override this method if this color is inappropriate.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 + defaultBackgroundColor, +defaultSelectedBackgroundColor, + defaultSelectedTextColor, setSelectedBackgroundColor:, setUseOwnerSelectedBackgroundColor:, textColor\ \pard\tx11280\b0\fs70\fi-240\li6320\fc0\cf0 \ \pard\f2\b\fs28\fi-1020\li1200\fc1\cf1 Instance Methods\ \fs16\fi0\li1360\fc0\cf0 \ \pard\tx8260\fs28\li1500\fc0\cf0 backgroundColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (NSColor*) \b backgroundColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSColor \b backgroundColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the color that is used to draw the background of the cell in its normal (unselected) state. This is the color which has been set with \b \f3\b0\fs24\fc1\cf1 setBackgroundColor: \f0\fs28\fc0\cf0 if it was ever called. If not, and the owner has been set and responds to \b \f3\b0\fs24\fc1\cf1 backgroundColor \f0\fs28\fc0\cf0 then it is queried and that color is returned. If both of the above fail then the value from \b + \f3\b0\fs24\fc1\cf1 defaultBackgroundColor \f0\fs28\fc0\cf0 is returned.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 + defaultBackgroundColor, selectedBackgroundColor, selectedTextColor, setBackgroundColor:, textColor\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 bgColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (NSColor*) \b bgColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 protected NSColor \b bgColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method is used by cells that draw themselves rather than letting the owner draw them. It returns the color that is used to fill the background of the cell during drawing. If the cell \f3\fs24\fc1\cf1 -isSelected \f0\fs28\fc0\cf0 , then this method returns the value from \f3\fs24\fc1\cf1 -selectedBackgroundColor \f0\fs28\fc0\cf0 , otherwise it returns the value from \f3\fs24\fc1\cf1 -backgroundColor \f0\fs28\fc0\cf0 . Subclasses should override this method if they have different criteria for determining the cell's background color during drawing.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 backgroundColor, fgColor, selectedBackgroundColor, isSelected\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 copyWithZone:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (id) \b copyWithZone: \b0 (NSZone*) \i zone \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Allocates, initializes, and returns a copy of the receiving cell. The copy is allocated from \i zone \i0 and is assigned the same contents as the receiver.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 copyWithZone: \b0 (NSCopying) \b , initImageCell:, initTextCell:\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 dealloc\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b dealloc \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Frees the memory used by the cell.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 copyWithZone:, initImageCell:, initTextCell:\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 drawInteriorWithFrame:inView:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b drawInteriorWithFrame: \b0 (NSRect) \i cellFrame \i0 \b\fi0 inView: \b0 (NSView*) \i controlView \i0\fs24\fi-620 [Objective-C] \fs28\fi0 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b drawInteriorWithFrameInView \b0 (NSRect \i cellFrame \i0\fc1\cf1 , \fi0\fc0\cf0 NSView \fi-620 \i\fi0 controlView \i0\fi-620\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28\fi0 \ \fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Draws the inside of the cell, but not the border, in \i cellFrame \i0 within \i controlView \i0 . \i cellFrame \i0 should be the same rectangle passed to \f3\fs24\fc1\cf1 -drawWithFrame:inView: \f0\fs28\fc0\cf0 . The PostScript focus must be locked on \i controlView \i0 when this message is sent.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 - \f2\fc0\cf0 drawInteriorWithFrame \f0\fc1\cf1 :inView: \fc0\cf0 \b0 (NSCell), \b\fc1\cf1 - \fc0\cf0 drawWithFrame \fc1\cf1 :inView:, - lockFocus \b0\fc0\cf0 (NSView) \fs16 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\f0\fs28\li1500\fc0\cf0 drawWithFrame \f2 :inView:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b drawWithFrame: \b0 (NSRect) \i cellFrame \i0 \b\fi0 inView: \b0 (NSView*) \i controlView \i0\fs24\fi-620 [Objective-C] \fs28\fi0 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b drawWithFrameInView \b0 (NSRect \i cellFrame \i0\fc1\cf1 , \fi0 N \fc0\cf0 SView \fi-620 \i\fi0 controlView \i0\fi-620\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28\fi0 \ \fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Displays the cell in \i cellFrame \i0 within \i controlView \i0 . The PostScript focus must be locked on \i controlView \i0 when this message is sent. Draws the border of the cell, then invokes \f3\fs24\fc1\cf1 drawInteriorWithFrame:inView: \f0\fs28\fc0\cf0 .\ \pard\tx2480\tx2860\tx3240\fs14\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f1\b0 - \f0 \b drawInteriorWithFrame:inView: \b0 , \b drawWithFrame:inView: \b0 \fc1\cf1 (NSCell) \fc0\cf0 , \f1 - \f0 \b lockFocus \b0 (NSView)\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 encodeWithCoder:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b encodeWithCoder: \b0 (NSCoder*) \i encoder \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Encodes the receiver using \i encoder \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 fgColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (NSColor*) \b fgColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 protected NSColor \b fgColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method is used by cells that draw themselves rather than letting the owner draw them. It returns the color that is used for the text in the cell during drawing. If the cell \f3\fs24\fc1\cf1 -isSelected \f0\fs28 , then this method returns the value from \f3\fs24 -selectedTextColor \f0\fs28 , otherwise it returns the value from \f3\fs24 -textColor \f0\fs28 . \fc0\cf0 Subclasses should override this method if they have different criteria for determining the cell's text color during drawing.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 bgColor, selectedTextColor, isSelected, textColor\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 font\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (NSFont*) \b font \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSFont \b font \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the Font used to display text in the cell. Returns \b nil \b0 if the receiver isn't a text-type cell.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 + defaultFont, setFont:\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 initImageCell:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (id) \b initImageCell: \b0 (NSImage*) \i image \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\b\fi-620\li2520\fc0\cf0 Cell \b0 (NSImage \i\fc1\cf1 image \i0 ) \fs24\fc0\cf0 [Java constructor] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Prepare a newly allocated cell that will display \i image \i0 . Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 initTextCell:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (id) \b initTextCell: \b0 (NSString*) \i text \i0\fs24 [Objective-C] \fs28 \ \pard\tx7140\b\fi-620\li2520\fc0\cf0 Cell \b0 (String \i text \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java constructor] \fs28 \ \fs16\fi-380\li2480 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Prepare a newly allocated cell that will display \i text \i0 . The font and colors will use inherited or default values until explicitly set. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 initWithCoder:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (id) \b initWithCoder: \b0 (NSCoder*) \i decoder \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Initializes a newly allocated instance from data in \i decoder \i0 . Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 isOpaque\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (BOOL) \b isOpaque \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc1\cf1 boolean \b\fc0\cf0 isOpaque \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns NO if the cell uses the owner's background color, or YES if it does not.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 isSelected\ \pard\tx7140\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (BOOL) \b isSelected \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc1\cf1 boolean \pard\tx7140\b\fi-620\li2520\fc0\cf0 isSelected \pard\tx2480\tx2860\tx3240\b0\fi-620\li2520\fc1\cf1 () \pard\tx7140\fs24\fi-620\li2520\fc0\cf0 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the cell's MISC_TC1_IS_SELECTED flag.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 bgColor \f2\b0\fc0\cf0 , \f0\b\fc1\cf1 fgColor, setSelected: \b0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 owner\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (id) \b owner \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b owner \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the \i owner \i0 of the cell, or \b nil \b0 if there is none.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\pard\tx8260\fs28\li1500\fc1\cf1{\NeXTHelpMarker15337 \markername ownerDraw;} }\pard\tx8260\f2\b\i0\ulnone\fs28\li1500\fc1\cf1 ownerDraw\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (BOOL) \b ownerDraw \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc1\cf1 boolean \b\fc0\cf0 ownerDraw \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc1\cf1 Returns YES if the owner should perform the actual drawing for this cell, otherwise NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedBackgroundColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (NSColor*) \b selectedBackgroundColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSColor \b selectedBackgroundColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the color that is used to draw the background of the cell in its selected state. This is the color which has been set with \b \f3\b0\fs24\fc1\cf1 setSelectedBackgroundColor: \f0\fs28\fc0\cf0 if it was ever called. If not, and the owner has been set and responds to \b \f3\b0\fs24\fc1\cf1 selectedBackgroundColor \f0\fs28\fc0\cf0 then it is queried and that color is returned. If both of the above fail then the value from \f3\fs24\fc1\cf1 +defaultSelectedBackgroundColor \f0\fs28\fc0\cf0 is returned.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 backgroundColor, + defaultSelectedBackgroundColor, selectedTextColor, setSelectedBackgroundColor:, textColor \b0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedTextColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (NSColor*) \b selectedTextColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSColor \b selectedTextColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the color that is used to draw the text in the cell in its selected state. This is the color which has been set with \b \f3\b0\fs24\fc1\cf1 setSelectedTextColor: \f0\fs28\fc0\cf0 if it was ever called. If not, and the owner has been set and responds to \b \f3\b0\fs24\fc1\cf1 selectedTextColor \f0\fs28\fc0\cf0 then it is queried and that color is returned. If both of the above fail then the value from \f3\fs24\fc1\cf1 +defaultSelectedTextColor \f0\fs28\fc0\cf0 is returned.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \f0\fs28 backgroundColor, + defaultSelectedTextColor, selectedBackgroundColor, setSelectedTextColor:, textColor \b0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setBackgroundColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setBackgroundColor: \b0 (NSColor*) \i c \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setBackgroundColor \b0 (NSColor \i c \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the color that the cell will use to fill its background. This color will override any inherited value.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setFont:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setFont: \b0 (NSFont*) \i font \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setFont \b0 (NSFont \i font \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the font of a text cell to \i font \i0 . This will override any inherited value.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setOwner:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setOwner: \b0 (id) \i obj \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setOwner \b0 (Object \i obj \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \i owner \i0 of the cell to \i obj \i0 . The cell will inherit font and color values from \i obj \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setOwnerBackgroundColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setOwnerBackgroundColor: \b0 (NSColor*) \i c \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setOwnerBackgroundColor \b0 (NSColor \i c \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the cell that the owner's \i backgroundColor \i0 value has changed to \i c \b . \b0\i0 The current implementation does nothing, since inherited owner values are not stored in the cells. However, the MiscTableScroll class tests for, and sends this message in preference to the \f3\fs24\fc1\cf1 -setBackgroundColor: \f0\fs28\fc0\cf0 message when the table distributes colors to the cells, so that cells can distinguish between cell-specific color assignments and global color assignments.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ {\pard\tx8260\fs28\li1500\fc1\cf1{\NeXTHelpMarker17922 \markername setOwnerDraw;} }\pard\tx8260\f2\b\i0\ulnone\fs28\li1500\fc1\cf1 setOwnerDraw:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setOwnerDraw: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setOwnerDraw \b0 (boolean \i flag \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc1\cf1 Sets a flag indicating whether or not the owner should perform the drawing for this object. The default value for MiscTableCell objects is YES.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setOwnerFont:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setOwnerFont: \b0 (NSFont*) \i font \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setOwnerFont \b0 (NSFont \i font \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the cell that the owner's \i font \i0 value has changed to \i font \i0 . If the cell is using the font value inherited from its \i owner \i0 , it will change its font in response to this message. Otherwise, it will ignore the message. The MiscTableScroll class tests for, and sends this message in preference to the \f3\fs24\fc1\cf1 -setFont: \f0\fs28\fc0\cf0 message when the table distributes fonts to the cells, so that cells can distinguish between cell-specific font assignments and global font assignments.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setOwnerSelectedBackgroundColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setOwnerSelectedBackgroundColor: \b0 (NSColor*) \i c \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setOwnerSelectedBackgroundColor \b0 (NSColor \i c \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the cell that the owner's \i selectedBackgroundColor \i0 value has changed to \i c \b . \b0\i0 The current implementation does nothing, since inherited owner values are not stored in the cells. However, the MiscTableScroll class tests for, and sends this message in preference to the \f3\fs24\fc1\cf1 -setSelectedBackgroundColor: \f0\fs28\fc0\cf0 message when the table distributes colors to the cells, so that cells can distinguish between cell-specific color assignments and global color assignments.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setOwnerSelectedTextColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setOwnerSelectedTextColor: \b0 (NSColor*) \i c \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setOwnerSelectedTextColor \b0 (NSColor \i c \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the cell that the owner's \i\fc1\cf1 selectedTextColor \i0\fc0\cf0 value has changed to \i c \b . \b0\i0 The current implementation does nothing, since inherited owner values are not stored in the cells. However, the MiscTableScroll class tests for, and sends this message in preference to the \f3\fs24\fc1\cf1 -setSelectedTextColor: \f0\fs28\fc0\cf0 message when the table distributes colors to the cells, so that cells can distinguish between cell-specific color assignments and global color assignments.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setOwnerTextColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setOwnerTextColor: \b0 (NSColor*) \i c \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setOwnerTextColor: \b0 (NSColor \i c \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the cell that the owner's \i textColor \i0 value has changed to \i c \b . \b0\i0 The current implementation does nothing, since inherited owner values are not stored in the cells. However, the MiscTableScroll class tests for, and sends this message in preference to the \f3\fs24\fc1\cf1 -setTextColor: \f0\fs28\fc0\cf0 message when the table distributes colors to the cells, so that cells can distinguish between cell-specific color assignments and global color assignments.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setSelected:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setSelected: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSelected \b0 (boolean \i flag \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the cell's MISC_TC1_IS_SELECTED flag.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 bgColor \f2\b0\fc0\cf0 , \f0\b\fc1\cf1 fgColor, isSelected \b0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setSelectedBackgroundColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setSelectedBackgroundColor: \b0 (NSColor*) \i c \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSelectedBackgroundColor \b0 (NSColor \i c \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the color that will be used to fill the background of a text cell when the cell is selected. This will override any inherited value.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setSelectedTextColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setSelectedTextColor: \b0 (NSColor*) \i c \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSelectedTextColor \b0 (NSColor \i c \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the color that will be used to draw the text of a text cell. This will override any inherited value.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setTag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setTag: \b0 (int) \i x \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setTag \b0 (int \i x \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the cell's \i tag \i0 value to \i x \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \f0\fs28 tag\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setTextColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setTextColor: \b0 (NSColor*) \i c \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setTextColor \b0 (NSColor \i c \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Causes the cell to render its text with the color, \i c \i0 . This overrides any \i textColor \i0 value inherited from the \i owner \i0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setUseOwnerBackgroundColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setUseOwnerBackgroundColor: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setUseOwnerBackgroundColor \b0 (boolean \i flag \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If \i flag \i0 is YES, the cell will discard any \i backgroundColor \i0 value that it is currently storing, and begin using the backgroundColor value provided by the \i owner \i0 . If the owner has not been set, or the owner does not respond to the \f3\fs24\fc1\cf1 -backgroundColor \f0\fs28\fc0\cf0 message, then the value returned by \f3\fs24\fc1\cf1 +defaultBackgroundColor \f0\fs28\fc0\cf0 will be used. If \i flag \i0 is NO, the cell will make room to store a \i backgroundColor \i0 value, and initialize it to the value returned by the \f3\fs24\fc1\cf1 +defaultBackgroundColor \f0\fs28\fc0\cf0 method.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setUseOwnerFont:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setUseOwnerFont: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setUseOwnerFont \b0 (boolean \i flag \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If \i flag \i0 is YES, the cell will use the \i font \i0 value inherited from its \i owner \i0 . If \i flag \i0 is NO, the cell will continue using its current font, or fonts set via the \f3\fs24\fc1\cf1 -setFont: \f0\fs28\fc0\cf0 message rather than the font inherited from the owner. This method also updates the \f3\fs24\fc1\cf1 MISC_TC1_SELF_FONT \f0\fs28\fc0\cf0 bit of the \i tc1_flags \i0 bit mask.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setUseOwnerSelectedBackgroundColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setUseOwnerSelectedBackgroundColor: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setUseOwnerSelectedBackgroundColor \b0\fc1\cf1 (boolean \i\fc0\cf0 flag \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If \i flag \i0 is YES, the cell will discard any \i selectedBackgroundColor \i0 value that it is currently storing, and begin using the \i selectedBackgroundColor \i0 value provided by the \i owner \i0 . If the owner has not been set, or the owner does not respond to the \f3\fs24\fc1\cf1 -selectedBackgroundColor \f0\fs28\fc0\cf0 message, then the value returned by \f3\fs24\fc1\cf1 +defaultSelectedBackgroundColor \f0\fs28\fc0\cf0 will be used. If \i flag \i0 is NO, the cell will make room to store a \i selectedBackgroundColor \i0 value, and initialize it to the value returned by the \f3\fs24\fc1\cf1 +defaultSelectedBackgroundColor \f0\fs28\fc0\cf0 method.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setUseOwnerSelectedTextColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setUseOwnerSelectedTextColor: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setUseOwnerSelectedTextColor \b0 (boolean \i flag \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If \i flag \i0 is YES, the cell will discard any \i selectedTextColor \i0 value that it is currently storing, and begin using the \i selectedTextColor \i0 value provided by the \i owner \i0 . If the owner has not been set, or the owner does not respond to the \f3\fs24\fc1\cf1 -selectedTextColor \f0\fs28\fc0\cf0 message, then the value returned by \f3\fs24\fc1\cf1 +defaultSelectedTextColor \f0\fs28\fc0\cf0 will be used. If \i flag \i0 is NO, the cell will make room to store a \i selectedTextColor \i0 value, and initialize it to the value returned by the \f3\fs24\fc1\cf1 +defaultSelectedTextColor \f0\fs28\fc0\cf0 method.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setUseOwnerTextColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setUseOwnerTextColor: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setUseOwnerTextColor \b0 (boolean \i flag \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If \i flag \i0 is YES, the cell will discard any \i textColor \i0 value that it is currently storing, and begin using the \i textColor \i0 value provided by the \i owner \i0 . If the owner has not been set, or the owner does not respond to the \f3\fs24\fc1\cf1 -textColor \f0\fs28\fc0\cf0 message, then the value returned by \f3\fs24\fc1\cf1 +defaultTextColor \f0\fs28\fc0\cf0 will be used. If \i flag \i0 is NO, the cell will make room to store a \i textColor \i0 value, and initialize it to the value returned by the \f3\fs24\fc1\cf1 +defaultTextColor \f0\fs28\fc0\cf0 method.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc1\cf1 tableScroll:retireAtRow:column: \fc0\cf0 \ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (id) \b tableScroll: \b0\fc1\cf1 (MiscTableScroll*) \i scroll \b\i0\fc0\cf0 retireAtRow: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 column: \b0\fc1\cf1 (int) \i col \i0\fs24\fc0\cf0 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b tableScrollRetireAtLocation \b0\fc1\cf1 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 MiscTableCell's implementation of the MiscTableScroll call-back method. This method is called whenever the cell is removed from active use by the MiscTableScroll as the result of any of the methods that reduce the number of active rows (ex: \f3\fs24\fc1\cf1 -renewRows: \f0\fs28\fc0\cf0 , \f3\fs24\fc1\cf1 -empty \f0\fs28\fc0\cf0 , etc.). The current implementation clears the string value of the cell. Unfortunately, since the overhead of performing these reset operations is quite high, the behavior of this method might change in the future. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc1\cf1 tableScroll:reviveAtRow:column: \fc0\cf0 \ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (id) \b tableScroll: \b0\fc1\cf1 (MiscTableScroll*) \i scroll \b\i0\fc0\cf0 reviveAtRow: \b0\fc1\cf1 (int) \i row \b\i0\fc0\cf0 column: \b0\fc1\cf1 (int) \i col \i0\fs24\fc0\cf0 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b tableScrollReviveAtLocation \b0\fc1\cf1 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 MiscTableCell's implementation of the MiscTableScroll call-back method. This method is called whenever the cell is brought into active use by the MiscTableScroll as the result of any of the methods that expand the number of active rows (ex: \f3\fs24\fc1\cf1 -renewRows: \f0\fs28\fc0\cf0 , \f3\fs24\fc1\cf1 -addRow \f0\fs28\fc0\cf0 , etc.). This method sets \i scroll \i0 as the \i owner \i0 of the cell, then ensures that all attributes are set to the \i use-owner \i0 values. Unfortunately, since the overhead of performing these initializations is quite high, the behavior of this method might change in the future. Returns \b self \b0 .\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tag\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (int) \b tag \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b tag \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the cell's \i tag \i0 value.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 setTag:\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1BackgroundColorLen\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (unsigned int) \b tc1BackgroundColorLen \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the length of the \i backgroundColor \i0 value in the variable-length \i tc1_data \i0 field. This is currently sizeof(NSColor*).\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1BackgroundColorPos\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (unsigned int) \b tc1BackgroundColorPos \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current offset of the \i backgroundColor \i0 value in the variable-length \i tc1_data \i0 field. This value changes whenever preceeding values are added or removed.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1BackgroundColorPtr\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (NSColor**) \b tc1BackgroundColorPtr \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns a pointer to the \i backgroundColor \i0 value in the variable-length \i tc1_data \i0 field which is, itself, an NSColor*. The value returned is only valid if \f3\fs24\fc1\cf1 -useOwnerBackgroundColor \f0\fs28\fc0\cf0 returns NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1DataSize\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (unsigned int) \b tc1DataSize \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current total size of the variable-length \i tc1_data \i0 field. This value changes as optional values are added and removed.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1DeleteDataPos:len:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b tc1DeleteDataPos: \b0 (unsigned int) \i pos \i0 \b\fi0 len: \b0 (unsigned int) \i len \i0\fs24\fi-620 [Objective-C] \fs28\fi0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Deletes \i len \i0 bytes at offset \i pos \i0 from the variable-length \i tc1_data \i0 field. All following data is shifted down by \i len \i0 bytes. This method is called internally whenever an optional value no longer needs to be stored because the inherited value from the owner is going to be used.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \f0\fs28 tc1InsertData:pos:len: \b0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1DestroyData\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b tc1DestroyData \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method is provided as a hook for subclasses that need to perform special actions (destructors) before the variable-length \i tc1_data \i0 field is freed. The MiscTableCell implementation of this class clears the \i tc1_flags \i0 bit mask to zero.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 tc1FreeData\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1Flags\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (unsigned int) \b tc1Flags \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current value of the \i tc1_flags \i0 field. This is a bit-mask indicating which optional values are currently stored in the variable-length \i tc1_data \i0 field. The flags also indicate whether or not the corresponding values inherited from the owner are used, since any value that has been set (and stored) in the cell overrides the inherited value. The values of the individual bits are declared in \f3\fs24\fc1\cf1 MiscTableCell.h \f0\fs28\fc0\cf0 as follows:\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \pard\tx7920\tx9520\f3\fs24\fi-2420\li4320\fc1\cf1 #define MISC_TC1_HAS_TAG (1 << 0) /* obsolete */\ #define MISC_TC1_SELF_FONT (1 << 1)\ #define MISC_TC1_SELF_TEXT_COLOR (1 << 2)\ #define MISC_TC1_SELF_BACKGROUND_COLOR (1 << 3)\ #define MISC_TC1_SELF_TEXT_COLOR_H (1 << 4)\ #define MISC_TC1_SELF_BACKGROUND_COLOR_H (1 << 5)\ #define MISC_TC1_IS_SELECTED (1 << 6)\ #define MISC_TC1_SELF_DRAW (1 << 7) /* !ownerDraw */\ #define MISC_TC1_LAST_BIT (1 << 7)\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1FreeData\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b tc1FreeData \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Frees the variable-length \i tc1_data \i0 variable. This method is invoked from within the \f3\fs24\fc1\cf1 -dealloc \f0\fs28\fc0\cf0 method, and also within the \f3\fs24\fc1\cf1 -initWithCoder: \f0\fs28\fc0\cf0 method.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \f0\fs28 tc1DestroyData \b0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1InsertData:pos:len:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void*) \b tc1InsertData: \b0 (void const*) \i data \i0 \b\fi0 pos: \b0 (unsigned int) \i pos \i0 \b len: \b0 (unsigned int) \i len \i0\fs24\fi-620 [Objective-C] \fs28\fi0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Inserts \i data \i0 at offset \i pos \i0 in the variable-length \i tc1_data \i0 field, shifting all following data by \i len \i0 bytes. This method is used internally to allocate the storage for optional values that do not already have storage allocated.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \f0\fs28 tc1DeleteDataPos:len: \b0\fs16\fc0\cf0 \ \pard\tx7140\f2\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1SelectedBackgroundColorLen\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (unsigned int) \b tc1SelectedBackgroundColorLen \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the length of the \i selectedBackgroundColor \i0 value in the variable-length \i tc1_data \i0 field. This is currently sizeof(NSColor*).\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1SelectedBackgroundColorPos\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (unsigned int) \b tc1SelectedBackgroundColorPos \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current offset of the \i selectedBackgroundColor \i0 value in the variable-length \i tc1_data \i0 field. This value changes whenever preceeding values are added or removed.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1SelectedBackgroundColorPtr\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (NSColor**) \b tc1SelectedBackgroundColorPtr \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns a pointer to the \i selectedBackgroundColor \i0 value in the variable-length \i tc1_data \i0 field which is, itself, an NSColor*. The value returned is only valid if \f3\fs24\fc1\cf1 -useOwnerSelectedBackgroundColor \f0\fs28\fc0\cf0 returns NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1SelectedTextColorLen\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (unsigned int) \b tc1SelectedTextColorLen \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the length of the \i selectedTextColor \i0 value in the variable-length \i tc1_data \i0 field. This is currently sizeof(NSColor*).\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1SelectedTextColorPos\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (unsigned int) \b tc1SelectedTextColorPos \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current offset of the \i selectedTextColor \i0 value in the variable-length \i tc1_data \i0 field. This value changes whenever preceeding values are added or removed.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1SelectedTextColorPtr\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (NSColor**) \b tc1SelectedTextColorPtr \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns a pointer to the \i selectedTextColor \i0 value in the variable-length \i tc1_data \i0 field which is, itself, an NSColor*. The value returned is only valid if \f3\fs24\fc1\cf1 -useOwnerSelectedTextColor \f0\fs28\fc0\cf0 returns NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1TextColorLen\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (unsigned int) \b tc1TextColorLen \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the length of the \i textColor \i0 value in the variable-length \i tc1_data \i0 field. This is currently sizeof(NSColor*).\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1TextColorPos\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (unsigned int) \b tc1TextColorPos \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current offset of the \i textColor \i0 value in the variable-length \i tc1_data \i0 field. This offset changes as other values are set or cleared.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tc1TextColorPtr\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (NSColor**) \b tc1TextColorPtr \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns a pointer to the location of the \i textColor \i0 value stored in the variable-length \i tc1_data \i0 field which is, itself, an NSColor*. The value returned is only valid if \f3\fs24\fc1\cf1 -useOwnerTextColor \f0\fs28\fc0\cf0 returns NO.\ \pard\tx7140\f2\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 textColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (NSColor*) \b textColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSColor \b textColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the color that is used to draw the text in the cell in its normal (unselected) state. This is the color which has been set with \b \f3\b0\fs24\fc1\cf1 setTextColor: \f0\fs28\fc0\cf0 if it was ever called. If not, and the owner has been set and responds to \b \f3\b0\fs24\fc1\cf1 textColor \f0\fs28\fc0\cf0 then it is queried and that color is returned. If both of the above fail then the value from \f3\fs24\fc1\cf1 +defaultTextColor \f0\fs28\fc0\cf0 is returned.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 backgroundColor, + defaultTextColor, selectedBackgroundColor, selectedTextColor, setTextColor:\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 useOwnerBackgroundColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (BOOL) \b useOwnerBackgroundColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc1\cf1 boolean \b\fc0\cf0 useOwnerBackgroundColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the cell uses the \i backgroundColor \i0 inherited from its \i owner \i0 , otherwise NO.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \f0\fs28 setBackgroundColor:, setUseOwnerBackgroundColor:\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 useOwnerFont\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (BOOL) \b useOwnerFont \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc1\cf1 boolean \b\fc0\cf0 useOwnerFont \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the cell uses the \i font \i0 inherited from its \i owner \i0 , otherwise NO.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \fs28\fc0\cf0 \f0\fc1\cf1 setFont:, setUseOwnerFont:\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 useOwnerSelectedBackgroundColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (BOOL) \b useOwnerSelectedBackgroundColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc1\cf1 boolean \b\fc0\cf0 useOwnerSelectedBackgroundColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the cell uses the \i selectedBackgroundColor \i0 inherited from its \i owner \i0 , otherwise NO.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \f0\fs28 setSelectedBackgroundColor:, setUseOwnerSelectedBackgroundColor:\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 useOwnerSelectedTextColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (BOOL) \b useOwnerSelectedTextColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc1\cf1 boolean \b\fc0\cf0 useOwnerSelectedTextColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the cell uses the \i selectedTextColor \i0 inherited from its \i owner \i0 , otherwise NO.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \f0\fs28 setSelectedTextColor:, setUseOwnerSelectedTextColor:\ \pard\tx7140\f2\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 useOwnerTextColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (BOOL) \b useOwnerTextColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc1\cf1 boolean \b\fc0\cf0 useOwnerTextColor \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the cell uses the \i textColor \i0 value inherited from its \i owner \i0 , otherwise NO.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f2\b\fs24\fi-1300\li2800\fc1\cf1 See also: \f0\fs28 setTextColor:, setUseOwnerTextColor:\ \pard\tx11280\b0\fs70\fi-240\li6320\fc0\cf0 \ \pard\f2\b\fs28\fi-1020\li1200\fc1\cf1 Constants and Defined Types \f0\b0\fs24\fc0\cf0 [Objective-C] \f2\b\fs28\fc1\cf1 \ \fs16\fi0\li1360\fc0\cf0 \ \pard\tx7560\f3\b0\fs24\li1500\fc1\cf1 #define MISC_TC1_HAS_TAG (1 << 0) /* obsolete */\ #define MISC_TC1_SELF_FONT (1 << 1)\ #define MISC_TC1_SELF_TEXT_COLOR (1 << 2)\ #define MISC_TC1_SELF_BACKGROUND_COLOR (1 << 3)\ #define MISC_TC1_SELF_TEXT_COLOR_H (1 << 4)\ #define MISC_TC1_SELF_BACKGROUND_COLOR_H (1 << 5)\ #define MISC_TC1_IS_SELECTED (1 << 6)\ #define MISC_TC1_SELF_DRAW (1 << 7) /* !ownerDraw */\ #define MISC_TC1_LAST_BIT (1 << 7)\ } MiscKit2/Palettes/MiscTableScroll/Framework/Documentation/MiscTableScroll.rtf100444 1750 1750 1714763 6757227322 27723 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f3\fnil Times-Roman;\f1\ftech Symbol;\f0\fswiss Helvetica;\f4\fmodern Courier;\f2\fmodern Ohlfs;} \paperw16160 \paperh11220 \margl120 \margr120 {\colortbl;\red0\green0\blue0;} \f3\b0\i0\ulnone\ql\fs24\fi0\li0\gray0\fc0\cf0\up0\dn0 Release 2.0 Copyright \f1 \f3 1995, 1996, 1997, 1998, 1999 by Paul S. McCarthy and Eric Sunshine All Rights Reserved.\ Paul S. McCarthy and Eric Sunshine -- August 20, 1999\ \pard\tx2480\tx2860\tx3240\fc0\cf0 \ \pard\f0\b\fs52\li1460\fc0\cf0 MiscTableScroll\ \pard\tx4880\fs80\li1460\fc0\cf0 \ \pard\tx4220\fs24\fi-2720\li4220\fc0\cf0 Inherits From: \fs28 \f3\b0 NSScrollView : NSView : NSResponder : NSObject\ \fs20 \ \f0\b\fs24\fi-2740 Conforms To: \f3\b0\fs28 NSCoding (NSObject)\ \fs20\fi-2720 \ \f0\b\fs24 Declared In: \f3\b0\fs28 MiscTableScroll.h\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx4220\f0\b\fs24\fi-2740\li4220\fc0\cf0 Java Class: \f3\b0\fs28 org.misckit.yellow.application.TableScroll\ \pard\tx4880\f0\b\fs16\li1360\fc0\cf0 \ \ \ \pard\fs28\fi-1020\li1200\fc0\cf0 Class Description\ \fs16\fi0\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 This class provides a convenient and powerful user-interface object for displaying and manipulating tabular data. The appearance and behavior is similar to NSTableView but is functionally superior. Although it inherits from NSScrollView, the programmatic interface is similar to the NSMatrix class.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 User Interface Highlights\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Scrollable matrix.\ Column and row titles.\ Columns and rows can be resized.\ Columns and rows can be dragged (rearranged).\ Automatically sorts rows when columns are rearranged.\ Direct user control of sort direction (ascending vs. descending).\ Incremental search.\ In-cell text editing.\ Exports contents as ASCII, ASCII-delimited, or dBASE.\ Keyboard & mouse control.\ Interacts with the Pasteboard, Font Panel, and Services.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Programmatic Highlights\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Accessible from Objective-C and Java.\ Each column and row can have its own size.\ Each cell can have its own color and font or inherit them from the table.\ Each column can have its own cell-type.\ Lazy-mode for large or expensive-to-generate data sets.\ Full control over selection.\ Built-in sort support.\ Built-in image-dragging support.\ Smart memory management.\ Delegate methods for most features.\ Simple indexed access to rows and columns.\ Easy-to-use text-cell editing.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Delegates and Notifications\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Both a \i delegate \i0 and a \i dataDelegate \i0 can be assigned to MiscTableScroll. Internally MiscTableScroll treats the delegates identically. The distinction between the two is conceptual and provides a convenient mechanism for programmers to cleanly compartmentalize specific object behavior. Conceptually the \i dataDelegate \i0 provides data to MiscTableScroll upon request with methods such as \f4\fs24 -tableScroll:intValueAtRow:column: \f3\fs28 and its cousins. The \i delegate \i0 , on the other hand, responds to messages which control or observe the behavior of MiscTableScroll, such as \f4\fs24 -tableScroll:canEdit:atRow:column: \f3\fs28 or \f4\fs24 -tableScrollSlotDragged: \f3\fs28 . This compartmentalization of functionality allows programmers to create a clean division between an object which strictly manages data from one which manages higher level behavior. For most applications, however, it is generally sufficient to have a single object which handles all such functionality and assign it as the \i delegate \i0 . In very simple cases even the \i delegate \i0 may be unnecessary.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 MiscTableScroll also posts notifications to the application's default notification center. Any object may register to receive one or more of the notifications posted by MiscTableScroll by sending \f4\fs24 -addObserver:selector:name:object: \f3\fs28 to the default notification center. MiscTableScroll automatically registers its delegates to receive these notifications if the delegates respond to the appropriate messages. For instance, if the \i delegate \i0 responds to \f4\fs24 -tableScrollTextColorChanged: \f3\fs28 , then it will automatically be registered to receive \f4\fs24 MiscTableScrollTextColorChangedNotification \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Standard delegate messages are only sent to one of the delegates even if both implement a particular message. MiscTableScroll first checks the \i delegate \i0 and then the \i dataDelegate \i0 , and sends the message to the first object which responds to it. Notifications, on the other hand, are sent to each delegate which responds to the appropriate notification message.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Similarities between Rows and Columns -- Slots and Borders\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Rows and columns are treated equally wherever it is practical and desirable to do so. Almost every action and option that is available for columns is also available for rows and vice versa. \i Slot \i0 is the generic term for a single column or row. \i Border \i0 is the generic term for row or column orientation. \i Size \i0 is the generic term for width or height. Most methods come in two flavors: a row/column specific flavor that uses \i row \i0 or \i column \i0 as part of the name; and a generic flavor that has a \i border \i0 argument and (when needed) a \i slot \i0 argument. Here are some examples:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx5400\f3\b0\ul\fs28\li2160\fc0\cf0 Generic \ulnone \ul Specific \ulnone \ - border:setSlotTitlesOn: - setColumnTitlesOn:\ - setRowTitlesOn:\ - border:setSlot:size: - setColumn:size:\ - setRow:size:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Differences between Rows and Columns\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 There are some differences between rows and columns. This object is designed to maximize the efficiency of displaying many rows of data. Hence, it is faster to add and remove rows than columns. You should set up all your columns in InterfaceBuilder, or while the table is empty, then add and remove rows afterwards. Rows are cached for re-use with the \f4\fs24 -renewRows: \f3\fs28 method. This makes it very fast to change the contents of the table on a row-oriented basis. Despite the row-oriented bias, column-oriented operations can be performed at any time; they will just be slower than the corresponding row-oriented operations. This behavior is intrinsic to the implementation, it cannot be changed.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Cell-prototypes are only used for columns. This behavior can only be changed by subclassing.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Selection in the body of a table is done on a row-wise basis. This behavior can be changed programmatically via the \f4\fs24 -setSelectsByRows: \f3\fs28 method.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 There are numerous default settings which differ between columns and rows. Most of these options can be changed in InterfaceBuilder; all of them can be changed programmatically. Here is a summary of the defaults which differ between rows and columns:\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \pard\tx5040\tx7200\tx10820\ul\li2160\fc0\cf0 Option \ulnone \ul Column Default \ulnone \ul Row Default \ulnone \ modifier drag NO YES\ uniform size NO YES\ user sizeable YES NO\ user draggable YES NO\ titles displayed YES NO\ title mode Custom Auto-Numbered\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Slot Sizing\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Uniform size is the simplest sizing mode. When you set the uniform size of a border to any non-zero value, all slots in that border will have the same (uniform) size. Setting the uniform size of a border to zero enables slots to have individual sizes. By default, rows are uniform size, columns are not.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 If uniform sizing is not set for a border, the following sizing information is maintained for each slot in the border:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\f3\b0\fs28\li2160\fc0\cf0 target size\ minimum size\ maximum size\ adjusted size\ user-sizeable-flag\ autosize-flag\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Target size is the desired size for a particular slot. Minimum and maximum sizes are the lower and upper bounds for the size of a slot. Adjusted size is the final display size of the slot after all other factors have been taken into account. When a slot is marked as user-sizeable, the user will be able to resize the slot (subject to further conditions described below). The adjusted size of autosize slots will be increased if needed to prevent a "gap" from appearing when the table is smaller than the display region. The flag values are mutually independent, but user-sizeable and autosize do not mix well. They cause bizarre, counter-intuitive behavior on narrow tables in wide views.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Users resize columns by dragging the right-hand edge of the column's title cell to the desired width. Likewise, users resize rows by dragging the bottom edge of the row's title cell to the desired height. The cursor changes to a horizontal or vertical resize cursor whenever the cursor is over one of the resizing areas. When users resize a slot, they are setting the target size for the slot on non-uniform-size borders. On uniform-size borders, they are setting the new uniform-size for the border.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 All of the following conditions must be met to enable the user to resize a particular slot:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\f3\b0\fs28\fi-440\li2600\fc0\cf0 (a) The title cells must be displayed ( \f4\fs24 -border:setSlotTitlesOn:YES \f3\fs28 )\ (b) The border in question must allow user-sizing of slots ( \f4\fs24 -border:setSizeableSlots:YES \f3\fs28 )\ (c) The border must be uniform-size ( \f4\fs24 -setBorder:uniformSizeSlots: \f3\fs28 ) or the slot in question must be user-sizeable ( \f4\fs24 -border:setSlot:sizeable:YES \f3\fs28 ).\ (d) There must be some room to grow or shrink between the slot's current adjusted size and the slot's minimum and maximum sizes.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 All of these conditions are met by default for new columns, unless you explicitly disable one of the global options for column sizing.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Slot Dragging and Indexing -- Visual vs. Physical\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Dragging and sizing are independent of each other. You can have borders that are not sizeable in any way, but are still draggable, and vice versa. You can also have borders that are both draggable and sizeable, or neither draggable nor sizeable.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Users drag slots by dragging the title cells until the leading edge is over the desired new location and "dropping" the slot there. For example, the left edge of the cell shows you where the column will end up when dragging a column to the left. Likewise, the right edge is used when the column is dragged to the right. This makes it possible to clearly see the new location without guessing.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Dragging must be enabled for that border. By default, columns are dragged with an unmodified drag, and they are selected with a command-drag. By default, rows are selected with an unmodified drag, and they are dragged with a command-drag. By default, dragging is enabled for columns, but not for rows.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 If slot-dragging is enabled for a border then an internal mapping vector is maintained which translates the original physical position of the slot to its current visual position. All programmer-interface methods and all delegate call-back methods use the original physical position of the slot so you can ignore the current visual ordering in your programs. If you need or want to examine the current visual ordering, you can do so with the \f4\fs24 -border:slotPosition: \f3\fs28 and \f4\fs24 -border:slotAtPosition: \f3\fs28 methods.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Keyboard Operations\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 MiscTableScroll provides keyboard control over almost all functions. Keyboard equivalents are available for scrolling, selection, and performing actions (simulating double-click). This class displays a dashed rectangle around the slot which is currently the focus of keyboard operations. Display of the cursor can be disabled and re-enabled with calls to the methods \f4\fs24 -disableCursor \f3\fs28 and \f4\fs24 -enableCursor \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 MiscTableScroll instances can be linked into the next-key-view chain just like all other Views. This can be done directly in InterfaceBuilder \f1 \f3 , or programmatically via \f4\fs24 -nextKeyView \f3\i\fs28 , \f4\i0\fs24 -setNextKeyView: \f3\fs28 , and related functions.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 The keyboard \i cursor \i0 can be moved with the standard arrow keys as well as the editing keys on the numeric keypad, including the page-up, page-down, home, and end keys -- as well as the \i real \i0 page-up, page-down, home, and end on keyboards which actually supply these keys. For functions which do not normally appear on any keyboard -- such as page-left and page-right -- modified arrow-keys can be used. Please refer to the following table:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3780\tx5760\b0\ul\fs24\li2160\fc0\cf0 Key() \ulnone\fc1\cf1 \ul\fc0\cf0 Action \ulnone\fc1\cf1 \ul\fc0\cf0 Action Modified()\ \ulnone space select slot select slot\ return perform action perform action\ up-arrow up page-up\ down-arrow down page-down\ left-arrow left page-left\ right-arrow right page-right\ page-up page-up top-edge\ page-down page-down bottom-edge\ home top-edge left-edge\ end bottom-edge right-edge\ enter(*) perform action perform action\ insert(*) select slot select slot\ \pard\tx2480\tx2860\tx3240\b\fs16\li1360\fc0\cf0 \ \pard\tx2520\tx3720\tx4260\tx4800\tx5320\b0\fs24\fi-360\li2520\fc0\cf0 () These functions are recognized when generated from both the standard editing keys as well as those on the numeric keypad.\ \pard\tx2480\tx2860\tx3240\b\fs16\li1360\fc0\cf0 \ \pard\tx2520\tx3720\tx4260\tx4800\tx5320\b0\fs24\fi-360\li2520\fc0\cf0 () Modified actions are produced by holding down a modifier while typing the primary key. Any of Shift, Control, or Alt can be used to produce a modified action -- and all have the same affect. So, for instance, one can generate a page-left from any of ctrl-left-arrow, shift-left-arrow, or alt-left-arrow.\ \pard\tx2480\tx2860\tx3240\b\fs16\li1360\fc0\cf0 \ \pard\tx2520\tx3720\tx4260\tx4800\tx5320\b0\fs24\fi-360\li2520\fc0\cf0 (*) Applicable to the numeric keypad only.\ \pard\tx2480\tx2860\tx3240\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Keys which perform the \i select-slot \i0 function simulate a single mouse-click. Keys which perform \i perform-action \i0 simulate a double mouse-click. When performing a \i select-slot \i0 via the keyboard, one can use the same modifier keys one uses when selecting via the mouse. In other words, one can use shift-single-click to select multiple slots (one at a time) with the mouse. Likewise one can use shift-space to select multiple slots (one at a time) with the keyboard.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Selection Modes\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Three selection modes are supported: List, Highlight, and Radio. Unlike NSMatrix, this class treats the different selection modes as uniformly as possible (see \i Mouse Tracking \i0 below). Methods such as \f4\fs24 -selectionMode \f3\fs28 and \f4\fs24 -setSelectionMode: \f3\fs28 allow direct control over the mode.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Methods such as \f4\fs24 -hasRowSelection \f3\i\fs28 , \f4\i0\fs24 -numberOfSelectedRows \f3\i\fs28 , \f4\i0\fs24 -rowIsSelected: \f3\i\fs28 , \i0 as well as the border and slot variations allow selection querying, while methods such as \f4\fs24 -selectedRows \f3\i\fs28 , \f4\i0\fs24 -selectedRowTags \f3\i\fs28 , \f4\i0\fs24 -selectRows: \f3\i\fs28 , \i0 and \f4\fs24 -selectRowsWithTags: \f3\fs28 along with their variations allow batch-oriented selection modification.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Mouse Tracking\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 The manner in which MiscTableScroll performs mouse-tracking is different from the manner in which NSMatrix does so. This class gives the cells the opportunity to track the mouse in \i all \i0 selection modes, whereas NSMatrix allows the cells to participate in mouse-tracking in all \i but \i0 List mode. NSMatrix make a special case of List mode, and in addition to the mouse-tracking difference it also modifies the cells' \i state \i0 variables in this mode. In all other modes NSMatrix allows the cell's mouse-tracking methods to manipulate the \i state \i0 rather than doing so itself. MiscTableScroll, on the other hand, treats all selection modes uniformly. It always highlights a cell via its \i highlight \i0 flag and \i never \i0 alters the cell's \i state \i0 -- instead it leaves alteration of \i state \i0 to the cell's mouse-tracking methods.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Upon receipt of a \f4\fs24 -mouseDown: \f3\fs28 , this class gives the cell at the mouse-down location an opportunity to track the mouse by invoking its \f4\fs24 -trackMouse:inRect:ofView:untilMouseUp: \f3\fs28 method. That method normally tracks the mouse until either a mouse-up event in which case it returns YES, or until the mouse leaves the cell-frame in which case it returns NO. If \f4\fs24 -trackMouse:inRect:ofView:untilMouseUp: \f3\fs28 returns NO, then MiscTableScroll goes into its own modal-responder loops, continues tracking the mouse itself, and updates the selection appropriately until a mouse-up event. Only the cell under the mouse-down event is given a chance to participate in tracking -- after that no other cells are offered the opportunity.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Image Dragging\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 MiscTableScroll has built in support for dragging images directly out of cells using the standard AppKit dragging services. Dragging is enabled by implementing a few simple methods in the delegate or dataDelegate. Two required methods are \f4\fs24 -tableScroll:allowDragOperationAtRow:column: \f3\fs28 and \f4\fs24 -tableScroll:preparePasteboard:forDragOperationAtRow:column: \f3\fs28 . Each method is passed a pointer to the MiscTableScroll and the cell's physical coordinates. The first method gives the delegate or dataDelegate a chance to allow or veto the drag operation. The second method is responsible for declaring types and, possibly, providing data for the pasteboard.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 A third delegate method \f4\fs24 -tableScroll:imageForDragOperationAtRow:column: \f3\fs28 is required for non-image cells and optional for cells which contain an image. This method allows the delegate or dataDelegate to supply an image for dragging. If the cell from which dragging is taking place contains its own image, then this method need not be implemented or can return 0, in which case the cell's own image is used by default.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Other methods allow the delegate or dataDelegate to respond to the standard dragging source protocol methods. \f0\b\fs16 \ \pard\tx2480\tx2860\tx3240\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 As usual, when dealing with pasteboards, keep in mind that if a non-nil \i owner \i0 is specified \i , \i0 the NSPasteboard will retain it. Only upon the initiation of another dragging operation will the owner receive the \f4\fs24 -pasteboardChangedOwner: \f3\fs28 message and be released. Therefore the \i owner \i0 needs to remain in a valid state, along with any necessary data, even after completion of the drag operation.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Prototype Cells\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Each column maintains a prototype cell which is used when new rows are created. When new rows are created, a \f4\fs24 -copyWithZone: \f3\fs28 message is sent to the prototype cell for each column, and the new copy of the prototype cell is put into the new row. This means that all prototype cells must implement the \f4\fs24 -copyWithZone: \f3\fs28 method appropriately. Generally this implies performing a \i deep \i0 copy.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 The prototype cell can be one of the built-in types (text, icon, or button), it can be supplied by the delegate, or you can set it programmatically. If you set a prototype cell programmatically, the MiscTableScroll object will retain the prototype cell, and will release it when it is finished with it. If the delegate provides the prototype cell, the delegate retains ownership -- the MiscTableScroll object will neither retain nor release prototype cells provided by the delegate.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Represented Objects\ \f3\b0\fs16\li2100 \ \fs28\li1500 Represented objects are objects which slots and cells may represent. By setting a represented object for a slot or cell you make an association between that object and the slot or cell in question. For instance, you might have a table in which each row represents a font, and lists its name as well as associated information such as its style, italic angle, and underline position. As a convenience you could set each row's represented object, using \f4\fs24 -setRow:representedObject: \f3\fs28 , to the actual NSFont which is described by that row. When a user selects one of the rows, the represented NSFont can be retrieved easily with \f4\fs24 -rowRepresentedObject: \f3\fs28 . A represented object can also be associated with the entire table.\ \f0\b\fs16\li1360 \ \f3\b0\fs28\li1500 The represented object functions as a more specific form of \i tag \i0 that allows you to associate any object, not just an integer, with the table, slot, or cell. This feature is solely for the developer's convenience. MiscTableScroll itself does not access the represented object, except to retain, release, archive and restore it.\ \fs16\li2100 \ \ \f0\b\fs24\li1500 Cell Owner and Inherited Font and Color Attributes\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 The MiscTableScroll class implements an informal \i owner \i0 protocol with the cells that it manages. The MiscTableCell class implements the other side this informal protocol. This protocol enables the cells to specify that they want to inherit their font and color attributes from their owner. In this case, the owner is the MiscTableScroll object. This makes it possible to propagate global \i default \i0 font and color attributes to all such cells easily and efficiently. At the same time, individual cells can use custom font and color attributes which will override the global default inherited values. Cells that use the inherited values do not need to store copies of those inherited values. Only cells that use custom values need to remember and store their own custom values. See the documentation for the MiscTableCell class for more details.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Cell Owner and Owner-Draw\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Another feature of the informal \i owner \i0 protocol is a specialized notion of delegated drawing. All cells that respond YES to the \f4\fs24 -ownerDraw \f3\fs28 message are drawn by the MiscTableScroll rather than drawing themselves. Since the MiscTableScroll object typically manages many cells with similar font and color attributes, the MiscTableScroll object can eliminate large amounts of redundant font and color setting PostScript code. Likewise, contiguous cells with the same background colors have all of their backgrounds drawn with a single PostScript operator rather than several. The built-in drawing mechanism also eliminates a lot of very expensive clipping path operations by simply not drawing partial characters that would be clipped. (You can force the partially visible text to be displayed with the \f4\fs24 -setDrawsClippedText:YES \f3\fs28 message.) Any object used as a cell in an instance of MiscTableScroll object can take advantage of these facilities as long as the cell consists of plain (single font) text with a single (optional) image, and does not have borders or other drawing requirements. This results in a very considerable improvement in drawing performance -- especially noticable on older, slower CPUs. \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Lazy vs. Eager\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 In general, eager mode is much easier to use than lazy mode. In eager mode, you can usually take advantage of the cells themselves to store the data that you are retrieving and displaying. Even complex data types can be stored by allocating the record and assigning it as the \i represented object \i0 for the row or cell. By contrast, lazy mode forces you to manage all the storage yourself. In eager mode, the MiscTableScroll object allocates and manages a dense matrix of cells, which you fill in with data as needed. In lazy mode, the MiscTableScroll object does not manage any cells at all. You are responsible for implementing \f4\fs24 -tableScroll:cellAtRow:column: \f3\fs28 to provide the MiscTableScroll object with a cell whenever it needs one. In lazy mode, you generally want to implement many of the \f4\fs24 -tableScroll:...ValueAtRow:column: \f3\fs28 methods to improve performance.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Usage Tips\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 For simple, flexible and maintainable access to the columns of the table scroll, you should declare an \b enum \b0 which identifies the columns in the MiscTableScroll, for instance:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\li2100 enum\ \{\ PHOTO_SLOT,\ LAST_NAME_SLOT,\ FIRST_NAME_SLOT,\ AGE_SLOT\ \};\ \f3\fs28 \ \pard\tx3600\tx3980\tx4340\li1500\fc0\cf0 Then you use the enumeration identifiers whenever you need to specify a column. Using an enumeration this way lets you add, remove and shuffle the slots just by updating the enum declaration, rather than searching through the code to find all the places that need to be fixed. It also makes your code more readable.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 There are two standard patterns for putting the data into eager (non-lazy) MiscTableScroll objects: \f4\fs24 -renewRows: \f3\fs28 and \f4\fs24 -addRow \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\fs28\li1500\fc0\cf0 -renewRows \b0 :\ When you know the number of rows in advance, it is most efficient to use the \f4\fs24 -renewRows: \f3\fs28 method to tell the MiscTableScroll object the number of rows that you will need. Your code will usually be structured as follows:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\li2100 int row;\ int const nrows = [dataSource count];\ \ [tableScroll \b renewRows \b0 :nrows];\ \b for \b0 (row = 0; row < nrows; row++)\ \{\ id item = [dataSource itemAtRow:row];\ [tableScroll setRow:row representedObject:item];\ [[tableScroll cellAtRow:row column:LAST_NAME_SLOT] setStringValue:[item lastName]];\ [[tableScroll cellAtRow:row column:AGE_SLOT] setIntValue:[item age]];\ //... and so on ...\ \}\ \ if ([tableScroll autoSortRows])\ [tableScroll sortRows];\ \f0\b\fs16\li1360 \ \pard\tx3600\tx3980\tx4340\f3\fs28\li1500\fc0\cf0 -addRow \b0 \ When you do not know the final number of rows in advance, your code will usually be structured as follows:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\li2100 id item;\ int row = 0;\ [tableScroll \b empty \b0 ];\ \ \b while \b0 ((item = [self getNextItem]) != 0)\ \{\ [tableScroll \b addRow \b0 ];\ [tableScroll setRow:row representedObject:item];\ [[tableScroll cellAtRow:row column:LAST_NAME_SLOT] setStringValue:[item lastName]];\ [[tableScroll cellAtRow:row column:AGE_SLOT] setIntValue:[item age]];\ //... and so on ...\ row++;\ \}\ \ [tableScroll \b sizeToCells \b0 ];\ \ if ([tableScroll autoSortRows])\ [tableScroll sortRows];\ \f0\b\fs16\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 A common programming mistake is forgetting to call \f4\fs24 -sizeToCells \f3\fs28 . You must call \f4\fs24 -sizeToCells \f3\fs28 after you have finished adding rows so that the MiscTableScroll can update the frames of its various subviews. If you forget to call \f4\fs24 -sizeToCells \f3\fs28 , the MiscTableScroll will appear to be empty when it is displayed.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Smart Memory Management\ \f3\b0\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 The MiscTableScroll class implements \i smart \i0 memory management. It does not allocate support structures until and unless they are needed. For example, since rows are uniform-size by default, the MiscTableScroll will not allocate the array of sizing-info structures until and unless you make the rows non-uniform size. In a complimentary fashion, if you make the columns uniform size, the MiscTableScroll object will release the sizing-info array for the columns. Similarly, custom titles must be stored in an array. However, no other title-mode requires this array, and the array will only exist for borders that have custom titles. Likewise, the visual-to-physical mapping vector that supports user-draggable slots is only created when the first slot is actually moved. Even if the draggable option is turned on, you will not incur the memory overhead until the option is used. The net result of all this is that you only pay for the features that you use. \ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 On the other hand, you do pay for the features that you do use. These extra features exact a price in storage and cpu. You should be careful about using them for rows when you expect thousands of rows.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 The MiscTableScroll class is designed to provide high-quality, consistent, flexible behavior to the user while supporting a wide range of load requirements -- from dozens of rows to hundreds of thousands of rows. Smart memory management is an important element in achieving that goal.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \ \f0\b\fs24\li1500 Java\ \fs16\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 As of MacOS/X Server (DR2), MiscTableScroll and its supporting classes are accessible from Java. The framework classes are exposed to Java with these names:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx2340\tx4680\tx9180\f3\b0\ul\fs24\fi-2780\li4680\fc0\cf0 Objective-C \ulnone \ul Java\ \f4\ulnone MiscTableScroll org.misckit.yellow.application.TableScroll\ MiscTableCell org.misckit.yellow.application.TableScroll.Cell\ MiscExporter org.misckit.yellow.application.TableScroll.Exporter\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 A number of informal interfaces are also provided which define methods which the delegate or data-delegate may implement. The interfaces are said to be \i informal \i0 since the delegate need only implement the methods which it requires. Provided that the implementations of these methods use the correct signatures, they will be dispatched as needed by MiscTableScroll. There is no need for the delegate to explicitly state, in Java terminology, that it \i implements \i0 an interface. The methods defined in these interfaces are described later in this document in the sections \i Methods Implemented by the Delegate \i0 , \i Delegate Methods for Dragging Source Operations \i0 , and \i Methods Implemented by Cell Subclasses \i0 . The exposed interfaces are:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx2340\tx5400\tx9180\f4\b0\fs24\fi-2420\li4320\fc0\cf0 org.misckit.yellow.application.TableScroll.Delegate\ org.misckit.yellow.application.TableScroll.Notifications\ org.misckit.yellow.application.TableScroll.DataSource\ org.misckit.yellow.application.TableScroll.DataCell\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Some Objective-C methods, such as \f4\fs24 -getRow:column:forPoint: \f3\fs28 and \f4\fs24 -getRow:column:ofCell: \f3\fs28 return row and column values by reference. Since Java does not support the return of multiple values from a single method invocation, the Java counterparts \f4\fs24 locationForPoint() \f3\fs28 and \f4\fs24 locationOfCell() \f3\fs28 return a simple wrapper object, \f4\fs24 org.misckit.yellow.application.TableScroll.Location \f3\fs28 , which defines two public integer fields, \f4\fs24 row \f3\fs28 and \f4\fs24 column \f3\fs28 . The actual definition of \f4\fs24 Location \f3\fs28 is presented later in the \i Constants and Defined Classes \i0 section. Constants which are exported by the framework, such as \f4\fs24 TableScrollSlotDraggedNotification \f3\fs28 , \f4\fs24 MAX_PIXELS_SIZE \f3\fs28 , and \f4\fs24 BORDER_COLUMN \f3\fs28 , are also presented in that section.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 In general, the names of Java methods are identical or nearly identical to their Objective-C counterparts, but with extra punctuation stripped away. Here are some examples:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx2340\tx6660\tx9180\f3\b0\ul\fs24\fi-4760\li6660\fc0\cf0 Objective-C \ulnone \ul Java\ \f4\ulnone -addRow addRow()\ -setDelegate: setDelegate(java.lang.Object)\ -cellAtRow:column: cellAtLocation(int,int)\ -setColumn:minSize: setColumnMinSize(int,float)\ -border:setSlot:minSize: setSlotMinSize(int,int,float)\ -selectRow: selectRow(int)\ -selectRow:byExtendingSelection: selectRow(int,boolean)\ -setColumnSizes: setColumnSizes(com.apple.yellow.foundation.NSArray)\ -setColumnSizesFromString: setColumnSizes(String)\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Familiarity with the use of MiscTableScroll from Objective-C translates easily to Java. To illustrate, here is a Java translation of a previously presented Objective-C code fragment from the \i Usage Tips \i0 section.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\li2100 int row = 0;\ tableScroll.empty();\ \ while ((item = getNextItem()) != null) \{\ tableScroll.addRow();\ tableScroll.setRowRepresentedObject(row,item);\ tableScroll.cellAtLocation(row,LAST_NAME_SLOT).setStringValue(item.lastName());\ tableScroll.cellAtLocation(row,AGE_SLOT).setIntValue(item.age());\ //... and so on ...\ row++;\ \}\ \ tableScroll.sizeToCells();\ \ if (tableScroll.autoSortRows())\ tableScroll.sortRows();\ \f0\b\fs16\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 The resources which allow MiscTableScroll to be accessed from Java are located within the MiscTableScroll framework. In particular, these resources consist of a dynamically loaded library, \f4\fs24 MiscTableScrollJava \f3\fs28 , and the compiled Java byte-code (the . \f4\fs24 class \f3\fs28 files). To use MiscTableScroll from Java in a project, it is necessary to provide the correct search path to ensure that these resources can be properly located within the framework at both compilation time and execution time.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Follow these steps to use MiscTableScroll in a Java project:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx2380\tx2860\tx3240\f3\b0\fs28\fi-280\li2380\fc0\cf0 1. Add \f4\fs24 MiscTableScroll.framework \f3\fs28 to the project's \i Framework \i0 list.\ 2. Add the \f4\fs24 MiscTableScrollJava \f3\fs28 dynamically linked library to the project's \i Libraries \i0 list.\ 3. Add the library's path to the project's \i Library Search Order \i0 list.\ 4. In \f4\fs24 Makefile.preamble \f3\fs28 , ensure that the definition of \f4\fs24 CLASSPATH \f3\fs28 includes the \f4\fs24 Resources/Java \f3\fs28 directory within the MiscTableScroll framework.\ 5. Add a \f4\fs24 CustomInfo.plist \f3\fs28 file to the project which defines configuration options which allow the application to locate the compiled Java byte-code and dynamically linked library at execution time, as discussed below.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 The dynamically linked library, which is added to the project in step 2, is located within the framework's \f4\fs24 Resource \f3\fs28 directory. On Mach it is named \f4\fs24\fc1\cf1 libMiscTableScrollJava.dylib \f3\fs28\fc0\cf0 . On Microsoft Windows it is named \f4\fs24\fc1\cf1 MiscTableScrollJava.lib \f3\fs28\fc0\cf0 . On Windows, an additional file, \f4\fs24\fc1\cf1 MiscTableScrollJava.dll \f3\fs28\fc0\cf0 is also installed in the standard \f4\fs24\fc1\cf1 Excutables \f3\fs28\fc0\cf0 directory along with other framework executable files. The \f4\fs24\fc1\cf1 Executables \f3\fs28\fc0\cf0 directory must be mentioned in the Windows \f4\fs24\fc1\cf1 PATH \f3\fs28\fc0\cf0 environment variable. At minimum, when adding entries to the project's \i Library Search Order \i0 in step 3, these paths should probably be included:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\fi-240\li2340 $(NEXT_ROOT)/$(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Resources\ $(NEXT_ROOT)/Network/Library/Frameworks/MiscTableScroll.framework/Resources\ \f0\b\fs16\fi0\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 The Java compiler needs to know the location of the compiled byte-code (. \f4\fs24 class \f3\fs28 files) when the project is built. The \f4\fs24 CLASSPATH \f3\fs28 environment variable can be used to convey this information to the Java compiler. A convenient way to ensure that \f4\fs24 CLASSPATH \f3\fs28 includes the path to MiscTableScroll's byte-code is to insert the following code into the project's \f4\fs24 Makefile.preamble \f3\fs28 , as instructed in step 4. This sample code should work for the most common cases where MiscTableScroll is installed in one of the standard locations.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\li2100 #------------------------------------------------------------------------------\ # Makefile.preamble\ #------------------------------------------------------------------------------\ # Ensure that the Java directory within the MiscTableScroll framework is\ # included in the class-path passed to the Java compiler.\ #------------------------------------------------------------------------------\ CLASSPATH = $(subst $(THINAIR) $(THINAIR),:,$(strip \\\ $(NEXT_ROOT)/$(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Resources/Java \\\ $(NEXT_ROOT)/Network/Library/Frameworks/MiscTableScroll.framework/Resources/Java \\\ $(shell javaconfig DefaultClasspath)))\ \f0\b\fs16\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 The \f4\fs24 CustomInfo.plist \f3\fs28 , which is added in step 5, is used to address a number of Java issues relevant at execution time. When the project is built, the \f4\fs24 CustomInfo.plist \f3\fs28 file is automatically merged into the generated \f4\fs24 Info.plist \f3\fs28 file which is placed into the application wrapper. Among other uses, \f4\fs24 Info.plist \f3\fs28 is loaded into the running application early during its execution and provides a convenient place to put configuration options which affect the application's behavior.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 When the compiled application is executed, the Java engine must be able to locate the compiled MiscTableScroll byte-code (. \f4\fs24 class \f3\fs28 files). To ensure that the engine can locate the byte-code, add an \f4\fs24 NSJavaUserPath \f3\fs28 entry to \f4\fs24 CustomInfo.plist \f3\fs28 which specifies the location of the MiscTableScroll Java resources. Here is a definition of \f4\fs24 NSJavaUserPath \f3\fs28 for use in \f4\fs24 CustomInfo.plist \f3\fs28 which works in most cases when MiscTableScroll is installed in one of the standard locations:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\li2100 NSJavaUserPath = (\ /Local/Library/Frameworks/MiscTableScroll.framework/Resources/Java,\ /Apple/Local/Library/Frameworks/MiscTableScroll.framework/Resources/Java,\ /Network/Library/Frameworks/MiscTableScroll.framework/Resources/Java\ );\ \f0\b\fs16\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Likewise, the Java engine must be able to locate the dynamically linked library at execution time. The library path specified in step 3 provides the linker with the means to locate the library at build time, however the Java engine does not have access to this information when the application is finally executed. To ensure that the Java engine can locate the library as well, an \f4\fs24 NSJavaLibraryPath \f3\fs28 entry may be added to \f4\fs24 CustomInfo.plist \f3\fs28 . Here is a definition of \f4\fs24 NSJavaLibraryPath \f3\fs28 which works in most cases:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\li2100 NSJavaLibraryPath = (\ /Local/Library/Frameworks/MiscTableScroll.framework/Resources,\ /Network/Library/Frameworks/MiscTableScroll.framework/Resources\ );\ \f0\b\fs16\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 As a convenience, MiscTableScroll can be configured to automatically update the library search path instead of manually specifying it via \f4\fs24 NSJavaLibraryPath \f3\fs28 . To do so, add an entry for \f4\fs24 MiscTableScrollAddLibrarySearchPaths \f3\fs28 with a value of \f4\fs24 Yes \f3\fs28 to \f4\fs24 CustomInfo.plist \f3\fs28 . MiscTableScroll will then automatically update the library search path to include all standard \i library \i0 directories as returned by a call to \f4\fs24 NSPathUtilities.searchPathForDirectoriesInDomains() \f3\fs28 . The default value of \f4\fs24 MiscTableScrollAddLibrarySearchPaths \f3\fs28 is \f4\fs24 No \f3\fs28 . To enable this option in \f4\fs24 CustomInfo.plist \f3\fs28 , specify:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\li2100 MiscTableScrollAddLibrarySearchPaths = Yes;\ \f0\b\fs16\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 Finally, a restriction in the Objective-C to Java bridge prevents Java programs from correctly accessing MiscTableScroll when the default Java security manager is in use. To work around this limitation, it is necessary to install the \f4\fs24 NullSecurityManager \f3\fs28 early in the application's execution. It is typically sufficient to perform this task in a static initializer within the application's controlling Java class. For instance:\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\li2100 static \{\ try \{\ com.apple.security.NullSecurityManager.installSystemSecurityManager();\ \} catch (Exception e) \{\}\ \}\ \f0\b\fs16\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 As a convenience, MiscTableScroll can be configured to automatically install the \f4\fs24 NullSecurityManager \f3\fs28 on the application's behalf, instead of having to do so manually. To enable this option, add an entry for \f4\fs24 MiscTableScrollUseNullSecurityManager \f3\fs28 with a value of \f4\fs24 Yes \f3\fs28 to \f4\fs24 CustomInfo.plist \f3\fs28 . Its default value is \f4\fs24 No \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\li2100 MiscTableScrollUseNullSecurityManager = Yes;\ \f0\b\fs16\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 For most projects the following sample \f4\fs24 CustomInfo.plist \f3\fs28 should be sufficient to enable use of MiscTableScroll from Java. It can be copied, verbatim, into the project's \f4\fs24 CustomInfo.plist \f3\fs28 file.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \f4\b0\fs24\li2100 // CustomInfo.plist\ \{\ MiscTableScrollUseNullSecurityManager = Yes;\ MiscTableScrollAddLibrarySearchPaths = Yes;\ NSJavaUserPath = (\ /Local/Library/Frameworks/MiscTableScroll.framework/Resources/Java,\ /Apple/Local/Library/Frameworks/MiscTableScroll.framework/Resources/Java,\ /Network/Library/Frameworks/MiscTableScroll.framework/Resources/Java\ );\ \}\ \f3\fs16 \ \ \f0\b\fs24\li1500 Errors\ \fs16\li1360 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 The only exception currently raised by MiscTableScroll is NSInternalInconsistencyException. This exception is raised when MiscTableScroll detects an internal inconsistency. This is typically indicative of a bug within this class.\ \pard\tx2480\tx2860\tx3240\f0\b\fs16\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\b0\fs28\li1500\fc0\cf0 This exception is also currently raised when an out-of-range slot index is passed as an argument to a method which can not sensibly handle the bad index. For instance, there is no sensible value which \f4\fs24 -rowTag: \f3\fs28 can return when given a bad index, hence it raises an exception. On the other hand no exception is raised by \f4\fs24 -selectRow: \f3\fs28 since it can simply ignore the bad index. \ \fs14 \ \fs56 \ \pard\f0\b\fs28\fi-1020\li1200\fc0\cf0 Method Types\ \fs16\fi0\li1360 \ \pard\tx6080\tx11280\f3\b0\fs28\fi-4840\li6320\fc0\cf0 Creating and destroying instances initWithFrame:\ \pard\tx11280\fi-240\li6320\fc0\cf0 dealloc\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Delegates setDelgate:\ \pard\tx11280\fi-240\li6320\fc0\cf0 delegate\ setDataDelegate:\ dataDelegate\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Transmitting action setTarget:\ \pard\tx11280\fi-240\li6320\fc0\cf0 target\ setDoubleTarget:\ doubleTarget\ setAction:\ action\ setDoubleAction:\ doubleAction\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 sendAction:to:forAllCells:\ sendAction:to:\ sendAction\ sendDoubleAction\ sendActionIfEnabled\ sendDoubleActionIfEnabled\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 isTrackingMouse\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 clickedSlot:\ clickedRow\ clickedColumn\ clickedCell\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Enabling and disabling setEnabled:\ \pard\tx11280\fi-240\li6320\fc0\cf0 isEnabled\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Selection setSelectionMode:\ \pard\tx11280\fi-240\li6320\fc0\cf0 selectionMode\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:slotIsSelected:\ rowIsSelected:\ columnIsSelected:\ cellIsSelectedAtRow:column:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 selectedSlot:\ selectedRow\ selectedColumn\ selectedCell\ selectedSlotTags:\ selectedRowTags\ selectedColumnTags\ selectedSlots:\ selectedRows\ selectedColumns\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:selectSlot:byExtendingSelection:\ border:selectSlot:\ selectRow:byExtendingSelection:\ selectRow:\ selectColumn:byExtendingSelection:\ selectColumn:\ border:selectSlotsWithTags:byExtendingSelection:\ border:selectSlotsWithTags:\ selectRowsWithTags:byExtendingSelection:\ selectRowsWithTags:\ selectColumnsWithTags:byExtendingSelection:\ selectColumnsWithTags:\ border:selectSlots:byExtendingSelection:\ border:selectSlots:\ selectRows:byExtendingSelection:\ selectRows:\ selectColumns:byExtendingSelection:\ selectColumns:\ selectAllSlots:\ selectAllRows\ selectAllColumns\ selectAll:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:deselectSlot:\ deselectRow:\ deselectColumn:\ border:deselectSlotsWithTags:\ deselectRowsWithTags:\ deselectColumnsWithTags:\ border:deselectSlots:\ deselectRows:\ deselectColumns:\ clearSlotSelection:\ clearRowSelection\ clearColumnSelection\ clearSelection\ deselectAll:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 hasSlotSelection:\ hasRowSelection\ hasColumnSelection\ hasMultipleSlotSelection:\ hasMultipleRowSelection\ hasMultipleColumnSelection\ numberOfSelectedSlots:\ numberOfSelectedRows\ numberOfSelectedColumns\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 setSelectsByRows:\ selectsByRows\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 selectionChanged\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Keyboard cursor border:setCursorSlot:\ \pard\tx11280\fi-240\li6320\fc0\cf0 clearCursorSlot:\ cursorSlot:\ hasValidCursorSlot:\ clearCursor\ clearCursorColumn\ clearCursorRow\ cursorColumn\ cursorRow\ disableCursor\ enableCursor\ hasValidCursorColumn\ hasValidCursorRow\ isCursorEnabled\ setCursorColumn:\ setCursorRow:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Incremental search incrementalSearch:\ \pard\tx11280\fi-240\li6320\fc0\cf0 doIncrementalSearch:column:\ getIncrementalSearchColumn:\ doGetIncrementalSearchColumn:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Scrolling scrollCellToVisibleAtRow:column:\ \pard\tx11280\fi-240\li6320\fc0\cf0 scrollColumnToVisible:\ scrollRowToVisible:\ scrollSelectionToVisible\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setFirstVisibleSlot:\ border:setLastVisibleSlot:\ border:slotIsVisible:\ firstVisibleSlot:\ lastVisibleSlot:\ numberOfVisibleSlots:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 columnIsVisible:\ firstVisibleColumn\ lastVisibleColumn\ numberOfVisibleColumns\ setFirstVisibleColumn:\ setLastVisibleColumn:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 rowIsVisible:\ firstVisibleRow\ lastVisibleRow\ numberOfVisibleRows\ setFirstVisibleRow:\ setLastVisibleRow:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Titles border:setSlotTitlesOn:\ \pard\tx11280\fi-240\li6320\fc0\cf0 setColumnTitlesOn:\ setRowTitlesOn:\ slotTitlesOn:\ columnTitlesOn\ rowTitlesOn\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSlotTitleMode:\ setColumnTitleMode:\ setRowTitleMode:\ slotTitleMode:\ columnTitleMode\ rowTitleMode\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSlot:title:\ setColumn:title:\ setRow:title:\ border:slotTitle:\ columnTitle:\ rowTitle:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 cornerTitle\ setCornerTitle:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Sizing border:setUniformSizeSlots:\ \pard\tx11280\fi-240\li6320\fc0\cf0 border:setMinUniformSizeSlots:\ border:setMaxUniformSizeSlots:\ setUniformSizeColumns:\ setMinUniformSizeColumns:\ setMaxUniformSizeColumns:\ setUniformSizeRows:\ setMinUniformSizeRows:\ setMaxUniformSizeRows:\ uniformSizeSlots:\ minUniformSizeSlots:\ maxUniformSizeSlots:\ uniformSizeColumns\ minUniformSizeColumns\ maxUniformSizeColumns\ uniformSizeRows\ minUniformSizeRows\ maxUniformSizeRows\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSizeableSlots:\ setSizeableColumns:\ setSizeableRows:\ sizeableSlots:\ sizeableColumns:\ sizeableRows:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSlot:size:\ setColumn:size:\ setRow:size:\ border:slotSize:\ columnSize:\ rowSize:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSlot:minSize:\ setColumn:minSize:\ setRow:minSize:\ border:slotMinSize:\ columnMinSize:\ rowMinSize:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSlot:maxSize:\ setColumn:maxSize:\ setRow:maxSize:\ border:slotMaxSize:\ columnMaxSize:\ rowMaxSize:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:slotAdjustedSize:\ columnAdjustedSize:\ rowAdjustedSize:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSlot:autosize:\ setColumn:autosize:\ setRow:autosize:\ border:slotIsAutosize:\ columnIsAutosize:\ rowIsAutosize:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSlot:sizeable:\ setColumn:sizeable:\ setRow:sizeable:\ border:slotIsSizeable:\ columnIsSizeable:\ rowIsSizeable:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 constrainSize\ totalSize:\ totalHeight\ totalWidth\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:slotResized:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSlotTitlesSize:\ slotTitlesSize:\ setColumnTitlesHeight:\ columnTitlesHeight\ setRowTitlesWidth:\ rowTitlesWidth\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 sizeToCells\ sizeToFit\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Dragging border:setDraggableSlots:\ \pard\tx11280\fi-240\li6320\fc0\cf0 setDraggableColumns:\ setDraggableRows:\ draggableSlots:\ draggableColumns\ draggableRows\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setModifierDragSlots:\ setModifierDragColumns:\ setModifierDragRows:\ modifierDragSlots:\ modifierDragColumns\ modifierDragRows\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:moveSlot:toSlot:\ moveColumn:toColumn:\ moveRow:toRow:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:slotAtPosition:\ columnAtPosition:\ rowAtPosition:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:slotPosition:\ columnPosition:\ rowPosition:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:physicalToVisual:\ border:visualToPhysical:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:slotDragged:toSlot:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Inserting and deleting numberOfSlots:\ \pard\tx11280\fi-240\li6320\fc0\cf0 numberOfColumns\ numberOfRows\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 addSlot:\ addColumn\ addRow\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:insertSlot:\ insertColumn:\ insertRow:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:removeSlot:\ removeColumn:\ removeRow:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 empty\ emptyAndReleaseCells\ renewRows:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Cell prototypes border:setSlot:cellType:\ \pard\tx11280\fi-240\li6320\fc0\cf0 setColumn:cellType:\ setRow:cellType:\ border:slotCellType:\ columnCellType:\ rowCellType:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSlot:cellPrototype:\ setColumn:cellPrototype:\ setRow:cellPrototype:\ border:slotCellPrototype:\ columnCellPrototype:\ rowCellPrototype:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Tags tag\ \pard\tx11280\fi-240\li6320\fc0\cf0 setTag:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSlot:tag:\ setColumn:tag:\ setRow:tag:\ border:slotTag:\ columnTag:\ rowTag:\ tagAtRow:column:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Represented Objects representedObject\ \pard\tx11280\fi-240\li6320\fc0\cf0 setRepresentedObject:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:setSlot:representedObject:\ setColumn:representedObject:\ setRow:representedObject:\ border:slotRepresentedObject:\ columnRepresentedObject:\ rowRepresentedObject:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Drawing drawCellAtRow:column:\ \pard\tx11280\fi-240\li6320\fc0\cf0 border:drawSlot:\ drawRow:\ drawColumn:\ border:drawSlotTitle:\ drawRowTitle:\ drawColumnTitle:\ selectionChanged\ cellFrameAtRow:column:\ documentClipRect\ drawsClippedText\ setDrawsClippedText:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Editing and first responder abortEditing\ \pard\tx11280\fi-240\li6320\fc0\cf0 suspendEditing\ resumeEditing\ isEditing\ getPreviousEditRow:column:\ getNextEditRow:column:\ getNext:editRow:column:\ edit:atRow:column:\ canEdit:atRow:column:\ editIfAble:atRow:column:\ editCellAtRow:column:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 textDidBeginEditing:\ textDidChange:\ textDidEndEditing:\ textShouldBeginEditing:\ textShouldEndEditing:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 didBecomeFirstResponder\ didResignFirstResponder\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Data control setLazy:\ \pard\tx11280\fi-240\li6320\fc0\cf0 isLazy\ cellAtRow:column:\ bufferCount\ empty\ emptyAndReleaseCells\ sizeToCells\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 addSlot:\ border:insertSlot:\ border:removeSlot:\ numberOfSlots:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 addColumn\ insertColumn:\ removeColumn:\ numberOfColumns\ \fs16 \ \fs28 addRow\ insertRow:\ removeRow:\ numberOfRows\ renewRows:\ \fs16 \ \fs28 doRetireCell:atRow:column:\ doReviveCell:atRow:column:\ retireCell:atRow:column:\ reviveCell:atRow:column:\ \fs16 \ \fs28 tagAtRow:column:\ intValueAtRow:column:\ floatValueAtRow:column:\ doubleValueAtRow:column:\ stringValueAtRow:column:\ titleAtRow:column:\ stateAtRow:column:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Sorting autoSortColumns\ \pard\tx11280\fi-240\li6320\fc0\cf0 autoSortRows\ autoSortSlots:\ border:setAutoSortSlots:\ border:setSlot:sortDirection:\ border:setSlot:sortFunction:\ border:setSlot:sortType:\ border:setSlotSortVector:\ border:slotDragged:toSlot:\ border:slotResized:\ border:slotSortDirection:\ border:slotSortFunction:\ border:slotSortReversed:\ border:slotSortType:\ border:sortSlot:\ slotSortVector:\ columnSortDirection:\ columnSortFunction:\ columnSortType:\ columnSortVector\ compareSlotFunction\ rowSortDirection:\ rowSortFunction:\ rowSortType:\ rowSortVector\ setAutoSortColumns:\ setAutoSortRows:\ setColumn:sortDirection:\ setColumn:sortFunction:\ setColumn:sortType:\ setColumnSortVector:\ setCompareSlotFunction:\ setRow:sortDirection:\ setRow:sortFunction:\ setRow:sortType:\ setRowSortVector:\ sortColumn:\ sortColumns\ sortRow:\ sortRows\ sortSlots:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 slotsAreSorted:\ rowsAreSorted\ columnsAreSorted\ border:slotIsSorted:\ columnIsSorted:\ rowIsSorted:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 border:compareSlots::\ border:compareSlots::info:\ compareColumns::\ compareColumns::info:\ compareRows::\ compareRows::info:\ \pard\tx9660\tx10180\fs16\fi-520\li6640\fc0\cf0 \ \pard\tx11280\fs28\fi-240\li6320\fc0\cf0 sortInfoInit:border:\ sortInfoDone:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Font + defaultFont\ \pard\tx11280\fi-240\li6320\fc0\cf0 font\ setFont:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Color backgroundColor\ \pard\tx11280\fi-240\li6320\fc0\cf0 color\ + defaultBackgroundColor\ + defaultSelectedBackgroundColor\ + defaultSelectedTextColor\ + defaultTextColor\ selectedBackgroundColor\ selectedTextColor\ setBackgroundColor:\ setColor:\ setSelectedBackgroundColor:\ setSelectedTextColor:\ setTextColor:\ textColor\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Multicast makeCellsPerformSelector:\ \pard\tx11280\fi-240\li6320\fc0\cf0 makeCellsPerformSelector:selectedOnly:\ makeCellsPerformSelector:with:\ makeCellsPerformSelector:with:selectedOnly:\ makeCellsPerformSelector:with:with:\ makeCellsPerformSelector:with:with:selectedOnly:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Finding border:slotWithTag:\ \pard\tx11280\fi-240\li6320\fc0\cf0 border:slotWithRepresentedObject:\ cellWithTag:\ cellWithRepresentedObject:\ columnWithTag:\ columnWithRepresentedObject:\ rowWithTag:\ rowWithRepresentedObject:\ getRow:column:ofCell:\ getRow:column:ofCellWithTag:\ getRow:column:ofCellWithRepresentedObject:\ getRow:column:forPoint:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Save / restore border:setSlotOrder:\ \pard\tx11280\fi-240\li6320\fc0\cf0 border:setSlotOrderFromString:\ slotOrder:\ slotOrderAsString:\ border:setSlotSizes:\ border:setSlotSizesFromString:\ slotSizes:\ slotSizesAsString:\ columnOrder\ columnOrderAsString\ columnSizes\ columnSizesAsString\ rowOrder\ rowOrderAsString\ rowSizes\ rowSizesAsString\ setColumnOrder:\ setColumnOrderFromString:\ setColumnSizes:\ setColumnSizesFromString:\ setRowOrder:\ setRowOrderFromString:\ setRowSizes:\ setRowSizesFromString:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Pasteboard and services copy:\ \pard\tx11280\fi-240\li6320\fc0\cf0 cut:\ builtinCanWritePboardType:\ builtinReadSelectionFromPasteboard:\ builtinRegisterServicesTypes\ builtinValidRequestorForSendType:returnType:\ builtinStringForPboardType:\ builtinWriteSelectionToPasteboard:types:\ canWritePboardType:\ readSelectionFromPasteboard:\ registerServicesTypes\ validRequestorForSendType:returnType:\ stringForNSStringPboardType\ stringForNSTabularTextPboardType\ stringForPboardType:\ writeSelectionToPasteboard:types:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Printing print:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Methods implemented by delegate tableScroll:abortEditAtRow:column:\ \pard\tx11280\fi-240\li6320\fc0\cf0 tableScroll:allowDragOperationAtRow:column:\ tableScrollBackgroundColorChanged:\ tableScroll:border:slotPrototype:\ tableScroll:border:slotTitle:\ tableScrollBufferCount:\ tableScroll:canEdit:atRow:column:\ tableScroll:canWritePboardType:\ tableScroll:cellAtRow:column:\ tableScrollChangeFont:\ tableScrollDidBecomeFirstResponder:\ tableScrollDidEdit:\ tableScrollDidPrint:\ tableScrollDidResignFirstResponder:\ tableScroll:draggingSourceOperationMaskForLocal:\ tableScroll:doubleValueAtRow:column:\ tableScroll:floatValueAtRow:column:\ tableScrollFontChanged:\ tableScroll:getIncrementalSearchColumn:\ tableScrollIgnoreModifierKeysWhileDragging:\ tableScroll:imageForDragOperationAtRow:column:\ tableScroll:intValueAtRow:column:\ tableScroll:preparePasteboard:forDragOperationAtRow:column:\ tableScroll:readSelectionFromPasteboard:\ tableScrollRegisterServicesTypes:\ tableScroll:retireCell:atRow:column:\ tableScroll:reviveCell:atRow:column:\ tableScrollSelectedBackgroundColorChanged:\ tableScrollSelectedTextColorChanged:\ tableScroll:setStringValue:atRow:column:\ tableScroll:shouldDelayWindowOrderingForEvent:\ tableScrollSlotDragged:\ tableScrollSlotResized:\ tableScrollSlotSortReversed:\ tableScroll:stateAtRow:column:\ tableScroll:stringForPboardType:\ tableScroll:stringValueAtRow:column:\ tableScroll:tagAtRow:column:\ tableScrollTextColorChanged:\ tableScroll:titleAtRow:column:\ tableScroll:validRequestorForSendType:returnType:\ tableScrollWillEdit:\ tableScrollWillPrint:\ tableScrollWillPrintPageFooter:\ tableScrollWillPrintPageHeader:\ tableScroll:writeSelectionToPasteboard:types:\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc0\cf0 Methods implemented by cells tableScroll:retireAtRow:column:\ \pard\tx11280\fi-240\li6320\fc0\cf0 tableScroll:reviveAtRow:column:\ \fs70 \ \pard\f0\b\fs28\fi-1020\li1200\fc0\cf0 Class Methods\ \fs16\fi0\li1360 \ \pard\tx8260\fs28\li1500\fc0\cf0 defaultBackgroundColor\ \pard\f3\b0\fi-620\li2520\fc0\cf0 + (NSColor*) \b defaultBackgroundColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 static NSColor \b defaultBackgroundColor \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \f4\fs24 [NSColor controlBackgroundColor] \f3\fs28 . This is the default background color for new MiscTableScroll objects.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 defaultFont\ \pard\f3\b0\fi-620\li2520\fc0\cf0 + (NSFont*) \b defaultFont \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 static NSFont \b defaultFont \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the user's preferred font at 12pt size. This is the default font for new MiscTableScroll objects.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 defaultSelectedBackgroundColor\ \pard\f3\b0\fi-620\li2520\fc0\cf0 + (NSColor*) \b defaultSelectedBackgroundColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 static NSColor \b defaultSelectedBackgroundColor \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \f4\fs24 [NSColor selectedControlColor] \f3\fs28 . This is the default selected background color for new MiscTableScroll objects.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 defaultSelectedTextColor\ \pard\f3\b0\fi-620\li2520\fc0\cf0 + (NSColor*) \b defaultSelectedTextColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 static NSColor \b defaultSelectedTextColor \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \f4\fs24 [NSColor selectedControlTextColor] \f3\fs28 . This is the default selected text color for new MiscTableScroll objects.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 defaultTextColor\ \pard\f3\b0\fi-620\li2520\fc0\cf0 + (NSColor*) \b defaultTextColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 static NSColor \b defaultTextColor \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \f4\fs24 [NSColor controlTextColor] \f3\fs28 . This is the default text color for new MiscTableScroll objects.\ \pard\tx11280\fs70\fi-240\li6320\fc0\cf0 \ \pard\f0\b\fs28\fi-1020\li1200\fc0\cf0 Instance Methods\ \fs16\fi0\li1360 \ \pard\tx8260\fs28\li1500\fc0\cf0 abortEditing\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b abortEditing \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b abortEditing \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Abort cell editing. Does not go though the normal \f4\fs24 -control:textShouldEndEditing: \f3\fs28 validation method, nor does it go through the \f4\fs24 -controlTextDidEndEditing: \f3\fs28 method.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 action\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (SEL) \b action \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSSelector \b action \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the action associated with a single click\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 addColumn\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b addColumn \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b addColumn \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Appends a new column. See \b Usage Tips \b0 in the introduction for a more complete discussion. Equivalent to: \f4\fs24 -addSlot:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 addRow\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b addRow \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b addRow \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Appends a new row to the table. If you know how many rows you will need in advance, you should use \f4\fs24 -renewRows: \f3\fs28 instead; it will be faster. If you do not know the number of rows in advance, use this method. This method is faster than \f4\fs24 -insertColumn: \f3\fs28 . Internally, the table pre-allocates rows with a geometric growth pattern so there are only a logarithmic number of allocations. See \b Usage Tips \b0 in the introduction for a more complete discussion. Equivalent to: \f4\fs24 -addSlot:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\li1500\fc0\cf0 This method does no drawing, nor does it update the frames of the various subviews. (This enhances performance when adding hundreds or thousands of rows.) After you have finished adding rows, you must call \f4\fs24 -sizeToCells \f3\fs28 so that the MiscTableScroll can update the frames of the various subviews.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 addSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b addSlot: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b addSlot \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Appends a new row or column to the table. Appending rows is fast (geometric growth, logarithmic allocations, no shifting). Appending columns is slower (linear growth, linear allocations, lots of shifting). See \b Usage Tips \b0 in the introduction for a more complete discussion.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -renewRows: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 autoSortColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b autoSortColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b autoSortColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether columns will be automatically sorted when the user drags rows. Equivalent to \f4\fs24 -autoSortSlots:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 autoSortRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b autoSortRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b autoSortRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether rows will be automatically sorted when the user drags columns. Equivalent to \f4\fs24 -autoSortSlots:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 autoSortSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b autoSortSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b autoSortSlots \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not slots on the given border will be automatically sorted when the user drags (rearranges) slots on the other border.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 backgroundColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSColor*) \b backgroundColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSColor \b backgroundColor \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current background color for the MiscTableScroll object. The background color is used as the background color of unselected cells in the table body as well as the \i exposure color \i0 for areas not covered by cells.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:compareSlots::\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b border: \b0 (MiscBorderType) \i border \i0 \b compareSlots: \b0 (int) \i slot1 \b\i0 : \b0 (int) \i slot2 \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b compareSlots \b0 (int \i border \i0 , int \i slot1 \i0 , \i \i0 int \i slot2 \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method compares two slots. Returns a value less than zero if \i slot1 \i0 should sort before \i slot2 \i0 , zero if \i slot1 \i0 should sort equally with \i slot2 \i0 , or greater than zero if \i slot1 \i0 should sort after \i slot2 \i0 . It calls \f4\fs24 -sortInfoInit:border: \f3\fs28 to compute the sorting information, then calls \f4\fs24 -border:compareSlots::info: \f3\fs28 , and finally cleans up with \f4\fs24 -slotInfoDone: \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:compareSlots::info:, -border:slotIsSorted:, -border:sortSlot: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:compareSlots::info:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b border: \b0 (MiscBorderType) \i border \i0 \b compareSlots: \b0 (int) \i slot1 \b\i0 : \b0 (int) \i slot2 \i0 \b info: \b0 (MiscSlotSortInfo*) \i sortInfo \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method compares two slots, given a pointer to the precomputed sorting information. If you call this method, you are responsible for initializing \i sortInfo \i0 by calling \f4\fs24 -sortInfoInit:border: \f3\fs28 , and then releasing the resources by calling \f4\fs24 -sortInfoDone: \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:compareSlots::, -sortInfoDone:, -sortInfoInit:border: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:deselectSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b deselectSlot: \b0 (MiscCoord_P) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b deselectSlot \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Deselects the indicated slot.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:deselectSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b deselectSlots: \b0 (NSArray*) \i slots \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b deselectSlots \b0 (int \i border \i0 , NSArray \i slots \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Deselects each slot in \i slots \i0 . Each element in \i slots \i0 is an NSNumber in Objective-C, and a java.lang.Integer in Java.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:deselectSlotsWithTags:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b deselectSlotsWithTags: \b0 (NSArray*) \i tags \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b deselectSlotsWithTags \b0 (int \i border \i0 , NSArray \i tags \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Deselects all slots whose tag value can be found in \i tags \i0 . Each element in \i tags \i0 is an NSNumber in Objective-C, and a java.lang.Integer in Java.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:drawSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b drawSlot: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b drawSlot \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Draws a single row or column. This method locks focus on the view if needed.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -drawCellAtRow:column:, -drawColumn:, -drawRow:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:drawSlotTitle:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b drawSlotTitle: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b drawSlotTitle \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Draws the title cell for a single row or column. This method locks focus on the view if needed. You should never need to call this method in normal use, though it might be useful for subclasses.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -drawColumnTitle:, -drawRowTitle: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:insertSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b insertSlot: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b insertSlot \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Inserts a single row or column at the indicated position. Position is a zero-based index. The slot is inserted at physical index \i slot \i0 , and also at visual index \i slot \i0 . This method performs linear allocation, and is slower than the corresponding \f4\fs24 -addRow \f3\fs28 method when adding new rows to a table.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:moveSlot:toSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b moveSlot: \b0 (int) \i from_slot \i0 \b toSlot: \b0 (int) \i to_slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b moveSlotToSlot \b0 (int \i border \i0 , int \i from_slot \i0 , int \i to_slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This is equivalent to the user dragging a slot from \i from_slot \i0 to \i to_slot \i0 . Both \i from_slot \i0 and \i to_slot \i0 are zero-based indexes into the current visual ordering of the slots.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:physicalToVisual:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b border: \b0 (MiscBorderType) \i border \i0 \b physicalToVisual: \b0 (NSArray*) \i slots \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b physicalToVisual \b0 (int \i border \i0 , NSArray \i slots \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method accepts an array of \i physical \i0 (original) slot numbers, and returns an array containing the corresponding \i visual \i0 (current) slot numbers. This is accomplished via a succession of calls to \f4\fs24 -border:slotPosition: \f3\fs28 . Each element in \i slots \i0 is an NSNumber in Objective-C, and a java.lang.Integer in Java.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotPosition:, -border:visualToPhysical: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:removeSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b removeSlot: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b removeSlot \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Removes a single row or column. All cells are released and other internal resources for the slot are deallocated immediately. If you are just emptying the table so that you can refill it with new data, use \f4\fs24 -renewRows: \f3\fs28 or \f4\fs24 -empty \f3\fs28 instead since these methods cache the cells for later re-use. See \b Usage Tips \b0 in the introduction for a more complete discussion.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -empty, -emptyAndReleaseCells, -renewRows:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:selectSlot:byExtendingSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b selectSlot: \b0 (MiscCoord_P) \i slot \i0 \b byExtendingSelection: \b0 (BOOL) \i extendSelection \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectSlot \b0 (int \i border \i0 , int \i slot \i0 , boolean \i extendSelection \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Selects the indicated slot. If \i extendSelection \i0 is YES then does not clear the previous selection, hence \i slot \i0 is added to the existing selection. If \i extendSelection \i0 is NO then the previous selection is cleared.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:selectSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b selectSlot: \b0 (MiscCoord_P) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectSlot \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border: \i border \i0 selectSlot: \i slot \i0 byExtendingSelection:NO \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \pard\tx8260\li1500\fc0\cf0 \ \fs28 border:selectSlots:byExtendingSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b selectSlots: \b0 (NSArray*) \i slots \i0 \b byExtendingSelection: \b0 (BOOL) \i extendSelection \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectSlots \b0 (int \i border \i0 , NSArray \i slots \i0 , boolean \i extendSelection \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Selects each slot in \i slots \i0 . Each element in \i slots \i0 is an NSNumber in Objective-C, and a java.lang.Integer in Java. If \i extendSelection \i0 is YES then does not clear the previous selection, hence \i slots \i0 are added to the existing selection. If \i extendSelection \i0 is NO then the previous selection is cleared.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:selectSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b selectSlots: \b0 (NSArray*) \i slots \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectSlots \b0 (int \i border \i0 , NSArray \i slots \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border: \i border \i0 selectSlots: \i slots \i0 byExtendingSelection:NO \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:selectSlotsWithTags:byExtendingSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b selectSlotsWithTags: \b0 (NSArray*) \i tags \i0 \b byExtendingSelection: \b0 (BOOL) \i extendSelection \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectSlotsWithTags \b0 (int \i border \i0 , NSArray \i tags \i0 , boolean \i extendSelection \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Selects all slots whose tag value can be found in \i tags \i0 . Each element in \i tags \i0 is an NSNumber in Objective-C, and a java.lang.Integer in Java. If \i extendSelection \i0 is YES then does not clear the previous selection, hence the slots found in \i tags \i0 are added to the existing selection. If \i extendSelection \i0 is NO then the previous selection is cleared. This method is useful in conjunction with \f4\fs24 -selectedSlotTags: \f3\fs28 to save and restore the user's selection when you have tag values that uniquely identify the slots.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:selectSlotsWithTags:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b selectSlotsWithTags: \b0 (NSArray*) \i tags \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectSlotsWithTags \b0 (int \i border \i0 , NSArray \i tags \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border: \i border \i0 selectSlotsWithTags: \i tags \i0 byExtendingSelection:NO \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setAutoSortSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setAutoSortSlots: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setAutoSortSlots \b0 (int \i border \i0 , boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Instructs the MiscTableScroll object whether or not to automatically sort the slots in border \i border \i0 , when the user drags a slot from the other border. For example, when you tell the MiscTableScroll object to auto-sort rows, the rows will be automatically sorted every time the user drags a column to a new position. AutoSort is off by default.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setCursorSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setCursorSlot: \b0 (MiscCoord_P) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setCursorSlot \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the keyboard cursor to \i slot \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setDraggableSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setDraggableSlots: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setDraggableSlots \b0 (int \i border \i0 , boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Enables or disables reordering of the slots. To let the user drag slots, the titles must be displayed, and the slots must be draggable.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setModifierDragSlots:, -border:setSizeableSlots:, -border:setSlotTitlesOn: \f0\fs24 \ \pard\tx7140\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setFirstVisibleSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setFirstVisibleSlot: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setFirstVisibleSlot \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Scrolls the table so that \i slot \i0 is the first slot displayed if possible. \f0\b\fs16 \ \pard\tx7140\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setLastVisibleSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setLastVisibleSlot: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setLastVisibleSlot \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Scrolls the table so that \i slot \i0 is the last slot displayed if possible. \f0\b\fs16 \ \pard\tx7140\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setMaxUniformSizeSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setMaxUniformSizeSlots: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setMaxUniformSizeSlots \b0 (int \i border \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the upper bound for user-sizing of a uniform-sized border, \i border \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setMinUniformSizeSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setMinUniformSizeSlots: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setMinUniformSizeSlots \b0 (int \i border \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the lower bound for user-sizing of a uniform-sized border, \i border \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setModifierDragSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setModifierDragSlots: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setModifierDragSlots \b0 (int \i border \i0 , boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This option controls whether an unmodified mouse-down initiates selection, or slot-dragging. When \i flag \i0 is YES, an unmodified mouse-down initiates selection, and the user must hold down the command-key to drag a slot. When \i flag \i0 is NO, an unmodified mouse-down initiates dragging, and the user must hold down the command-key to select a slot. By default, columns are dragged with an unmodified mouse-down and selected when the command-key modifier is used. By default, rows behave the other way; an unmodified mouse-down initiates selection, and a command-key modifier must be used to initiate dragging.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSizeableSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSizeableSlots: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSizeableSlots \b0 (int \i border \i0 , boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Enables or disables user-sizing of the slots. Many conditions must be met to enable the user to resize a particular slot. See \b Slot Sizing \b0 in the introduction for details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:autosize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b autosize: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotAutosize \b0 (int \i border \i0 , int \i slot \i0 , boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Enables or disables \i autosizing \i0 for a particular slot. When YES, the slot will be adjusted proportionately with all other \i autosize \i0 slots in the border to meet global minimum or maximum size restrictions for the border as a whole. Currently, this only has effect for columns in narrow tables displayed in wide NSScrollViews. See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:cellPrototype:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b cellPrototype: \b0 (id) \i cell \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotCellPrototype \b0 (int \i border \i0 , int \i slot \i0 , NSCell \i cell \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Set the cell prototype for a slot. Currently, only column cell prototypes are used. When new rows are allocated for the table, the cell prototype from each column is sent a \f4\fs24 -copyWithZone: \f3\fs28 message. The newly created cell is placed into the newly created row. Thus all prototype cells must implement the \f4\fs24 -copyWithZone: \f3\fs28 message appropriately. (In general, this implies making a \i deep \i0 copy.) The MiscTableScroll retains \i cell \i0 when this method is invoked and releases it when it is no longer needed.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:cellType: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:cellType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b cellType: \b0 (MiscTableCellStyle) \i type \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotCellType \b0 (int \i border \i0 , int \i slot \i0 , int \i type \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the type of cell that will be used for a particular slot. Currently, only column cell types have any effect; row cell types are ignored. The cell type, \i type \i0 , can be any of the following:\ \pard\f4\fs24\li3600\fc0\cf0 \ \pard\tx2340\tx5760\tx9180\f3\ul\fi-3860\li5760\fc0\cf0 Objective-C \ulnone \ul Java\ \f4\ulnone MISC_TABLE_CELL_TEXT CELL_TYPE_TEXT\ MISC_TABLE_CELL_IMAGE CELL_TYPE_IMAGE\ MISC_TABLE_CELL_BUTTON CELL_TYPE_BUTTON\ MISC_TABLE_CELL_CALLBACK CELL_TYPE_CALLBACK\ \pard\li3600\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\fs28\li1500\fc0\cf0 When this method is called, the MiscTableScroll object will create a prototype cell for the indicated slot of the indicated type. \f4\fs24 MISC_TABLE_CELL_TEXT \f3\fs28 creates a text-cell; \f4\fs24 MISC_TABLE_CELL_IMAGE \f3\fs28 creates an image-cell; \f4\fs24 MISC_TABLE_CELL_BUTTON \f3\fs28 creates a button-cell; and \f4\fs24 MISC_TABLE_CELL_CALLBACK \f3\fs28 instructs the MiscTableScroll object to ask the delegate for the for the prototype cell. \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:cellPrototype: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:maxSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b maxSize: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotMaxSize \b0 (int \i border \i0 , int \i slot \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the maximum size for \i slot \i0 . The \i size \i0 argument is in units of screen pixels. See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:minSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b minSize: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotMinSize \b0 (int \i border \i0 , int \i slot \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the minimum size for \i slot \i0 . The \i size \i0 argument is in units of screen pixels. See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:representedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b representedObject: \b0 (id) \i object \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotRepresentedObject \b0 (int \i border \i0 , int \i slot \i0 , Object \i object \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the represented object for \i slot \i0 to \i object \i0 . Releases the old represented object if any and then retains \i object \i0 . See \b Represented Objects \b0 in the introduction for more details.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:tag: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:size:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b size: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotSize \b0 (int \i border \i0 , int \i slot \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \i target \i0 size for \i slot \i0 . The \i size \i0 argument is in units of screen pixels. See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:sizeable:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b sizeable: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotSizeable \b0 (int \i border \i0 , int \i slot \i0 , boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \i user-sizeable \i0 flag for \i slot \i0 . When \i flag \i0 is YES, the user will be able to resize the slot. When \i flag \i0 is NO, the user will not be able to resize the slot. There are many conditions which must be met for a user to be able to resize a slot. See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:sortDirection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b sortDirection: \b0 (MiscSortDirection) \i dir \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotSortDirection \b0 (int \i border \i0 , int \i slot \i0 , int \i dir \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether \i slot \i0 should be sorted in ascending or descending order. \i dir \i0 must be one of the following two values:\ \pard\f4\fs24\li3600\fc0\cf0 \ \pard\tx2340\tx5400\tx9180\f3\ul\fi-3500\li5400\fc0\cf0 Objective-C \ulnone \ul Java\ \f4\ulnone MISC_SORT_ASCENDING SORT_ORDER_ASCENDING\ MISC_SORT_DESCENDING SORT_ORDER_DESCENDING\ \pard\tx2480\tx2860\tx3240\f3\fs28\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\li1500\fc0\cf0 All other values are ignored.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:sortType:, -border:setSlot:sortFunction:, -border:slotSortDirection: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:sortFunction \f3\b0 : \f0\b \ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i b \i0 \b setSlot: \b0 (int) \i n \i0 \b sortFunction \b0 :(MiscCompareEntryFunc) \i func \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Makes \i func \i0 the cell-to-cell comparison routine for the cells in slot \i n \i0 . The function, \i func \i0 , must match the following prototype from \f4\fs24 MiscTableTypes.h \f3\fs28 :\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \pard\tx4320\f4\fs24\li2160\fc0\cf0 typedef int (*MiscCompareEntryFunc)\ ( int r1, int c1, int r2, int c2,\ MiscEntrySortInfo const* entry_info,\ MiscSlotSortInfo* sort_info );\ \pard\tx2480\tx2860\tx3240\f3\fs28\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\li1500\fc0\cf0 The function is given the coordinates of the two cells, and two pointers to structures containing additional sorting information. The function should return an integer that is: (a) less than zero if the cell at (r1,c1) should sort before the cell at (r2,c2), (b) equal to zero if the two cells should sort equally, or (c) greater than zero if the cell at (r1,c1) should sort after the cell at (r2,c2).\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\li1500\fc0\cf0 The sort direction (ascending or descending) is applied to the value returned by the cell-to-cell comparison function by the slot-to-slot comparison function. So if you supply a custom cell-to-cell comparison function you should ignore the sort direction for that slot. You should always return the \i ascending \i0 sort-order value.\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\li1500\fc0\cf0 Use this method when you need to perform custom sorting that the built-in sort-types cannot accommodate.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:sortDirection:, -border:setSlot:sortType:, -border:slotSortFunction: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:sortType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b sortType: \b0 (MiscSortType) \i type \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotSortType \b0 (int \i border \i0 , int \i slot \i0 , int \i type \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the type of sorting to be used by the built-in cell-to-cell comparison function for cells in \i slot \i0 . The sort \i type \i0 must be one of the following values:\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \pard\tx2340\tx6660\tx9180\ul\fs24\fi-4760\li6660\fc0\cf0 Objective-C \ulnone \ul Java\ \f4\ulnone MISC_SORT_STRING_CASE_INSENSITIVE SORT_STRING_CASE_INSENSITIVE\ MISC_SORT_STRING_CASE_SENSITIVE SORT_STRING_CASE_SENSITIVE\ MISC_SORT_INT SORT_INT\ MISC_SORT_UNSIGNED_INT SORT_UNSIGNED_INT\ MISC_SORT_TAG SORT_TAG\ MISC_SORT_UNSIGNED_TAG SORT_UNSIGNED_TAG\ MISC_SORT_FLOAT SORT_FLOAT\ MISC_SORT_DOUBLE SORT_DOUBLE\ MISC_SORT_SKIP SORT_SKIP\ MISC_SORT_TITLE_CASE_INSENSITIVE SORT_TITLE_CASE_INSENSITIVE\ MISC_SORT_TITLE_CASE_SENSITIVE SORT_TITLE_CASE_SENSITIVE\ MISC_SORT_STATE SORT_STATE\ MISC_SORT_UNSIGNED_STATE SORT_UNSIGNED_STATE\ \pard\tx2480\tx2860\tx3240\f3\fs28\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\li1500\fc0\cf0 All other values are ignored. Each of the types is described below.\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f4\fs24\li1500\fc0\cf0 MISC_SORT_STRING_CASE_INSENSITIVE\ MISC_SORT_STRING_CASE_SENSITIVE \fs10 \fs24 \ \pard\f3\fs16\li2100\fc0\cf0 \ \fs28\li2160 The cells are compared as strings. The string values are retrieved using the \f4\fs24 -stringValueAtRow:column: \f3\fs28 message. \f4\fs24 MISC_SORT_STRING_CASE_INSENSITIVE \f3\fs28 is the default sort-type.\ \fs16\li2100 \ \pard\tx3600\tx3980\tx4340\f4\fs24\li1500\fc0\cf0 MISC_SORT_INT\ MISC_SORT_UNSIGNED_INT\ \pard\f3\fs16\li2100\fc0\cf0 \ \fs28\li2160 The cells are compared as integers. The integer values are retrieved using the \f4\fs24 -intValueAtRow:column: \f3\fs28 message. \f4\fs24 \ \f3\fs16\li2100 \ \pard\tx3600\tx3980\tx4340\f4\fs24\li1500\fc0\cf0 MISC_SORT_TAG\ MISC_SORT_UNSIGNED_TAG\ \pard\f3\fs16\li2100\fc0\cf0 \ \fs28\li2160 The cells are compared as integers. The integer values are retrieved using the \f4\fs24 -tagAtRow:column: \f3\fs28 message. This feature is useful for sorting that is handled "behind-the-scenes". For example, if the slot holds date information, you can put a numeric representation of the date (such as that obtained with \f4\fs24 -[NSDate timeIntervalSinceReferenceDate] \f3\fs28 ) into the cell's tag, and format the string value any way you wish. The slot will sort correctly regardless of the display format. It is also useful for slots that hold keywords from an ordered set of values, like the following enumeration:\ \fs16\li2100 \ \f4\fs24\li2160 enum Severity \{ Notice, Warning, Error, Fatal \};\ \f3\fs16\li2100 \ \fs28\li2160 Sorting these alphabetically does not make sense, but if you put the enum value into the tag of the cell, you can sort them correctly. This sort type also makes it possible to sort slots that hold icons.\ \fs16\li2100 \ \pard\tx3600\tx3980\tx4340\f4\fs24\li1500\fc0\cf0 MISC_SORT_FLOAT\ \pard\f3\fs16\li2100\fc0\cf0 \ \fs28\li2160 The cells are compared as single-precision floating point numbers. The values are retrieved using the \f4\fs24 -floatValueAtRow:column: \f3\fs28 message.\ \fs16\li2100 \ \pard\tx3600\tx3980\tx4340\f4\fs24\li1500\fc0\cf0 MISC_SORT_DOUBLE\ \pard\f3\fs16\li2100\fc0\cf0 \ \fs28\li2160 The cells are compared as double-precision floating point numbers. The values are retrieved using the \f4\fs24 -doubleValueAtRow:column: \f3\fs28 message.\ \fs16\li2100 \ \pard\tx3600\tx3980\tx4340\f4\fs24\li1500\fc0\cf0 MISC_SORT_SKIP\ \pard\tx2480\tx2860\tx3240\f3\fs16\li2100\fc0\cf0 \ \pard\fs28\li2160\fc0\cf0 The cells are not compared. All cells in slots with the \f4\fs24 MISC_SORT_SKIP \f3\fs28 sort-type are considered equal. This can be used for slots that should not affect the sorting.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f4\fs24\li1500\fc0\cf0 MISC_SORT_TITLE_CASE_INSENSITIVE\ MISC_SORT_TITLE_CASE_SENSITIVE \fs10 \fs24 \ \pard\tx2480\tx2860\tx3240\f3\fs16\li2100\fc0\cf0 \ \pard\fs28\li2160\fc0\cf0 The cells are compared as strings. The string values are retrieved using the \f4\fs24 -titleAtRow:column: message \f3\fs28 . This is provided to support NSButtonCells.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f4\fs24\li1500\fc0\cf0 MISC_SORT_STATE\ MISC_SORT_UNSIGNED_STATE\ \pard\tx2480\tx2860\tx3240\f3\fs16\li2100\fc0\cf0 \ \pard\fs28\li2160\fc0\cf0 The cells are compared as integers. The integer values are retrieved using the \f4\fs24 -stateAtRow:column: \f3\fs28 message. This is provided to support NSButtonCells. \f4\fs24 \ \pard\tx2480\tx2860\tx3240\f3\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:sortDirection:, -border:setSlot:sortFunction:, -border:slotSortType: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:tag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b tag: \b0 (int) \i tag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotTag \b0 (int \i border \i0 , int \i slot \i0 , int \i tag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the tag for \i slot \i0 to \i tag \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:representedObject: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlot:title:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlot: \b0 (int) \i slot \i0 \b title: \b0 (NSString*) \i title \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotTitle \b0 (int \i border \i0 , int \i slot \i0 , String \i title) \i0\fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the title for \i slot \i0 to \i title \i0 . This method only works for borders with custom titles (that is, \f4\fs24 -border: \i border \i0 setSlotTitleMode:MISC_CUSTOM_TITLE \f3\fs28 ). If the border does not have custom titles, the request is silently ignored.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlotTitleMode: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlotOrder:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlotOrder: \b0 (NSArray*) \i list \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setSlotOrder \b0 (int \i border \i0 , NSArray \i list \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Rearranges the slots to match the order specified by \i list \i0 . Each element in \i list \i0 is an NSNumber in Objective-C, and a java.lang.Integer in Java. The list is organized in the \i physical \i0 (original) order of the slots. Each value in the list is the new \i visual \i0 position for the corresponding slot. In other words, \i list \i0 is a physical to visual mapping. This is useful for restoring the user's slot-order preference.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\i\fs28\li1500\fc0\cf0 List \i0 also encodes the sort direction. Negative values set the slot sort direction to descending. Positive values set the slot sort direction to ascending. Negative values are formed by using the 'C' bitwise complement operator (~). \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 When \i list \i0 is nil or an empty array, the slots are "unsorted" -- they are returned to their original physical order, and are reset to ascending sort-direction.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES on success, NO on failure.\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlotOrderFromString:, -border:setSlotSizes:, -slotOrder: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlotOrderFromString:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlotOrderFromString: \b0 (NSString*) \i s \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setSlotOrder \b0 (int \i border \i0 , String \i s \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This is a convenience method which invokes \f4\fs24 -border:setSlotOrder: \f3\fs28 using an \f4\fs24 NSArray \f3\fs28 constructed from \i s \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlotOrder:, -border:setSlotSizes:, -slotOrder: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlotSizes:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlotSizes: \b0 (NSArray*) \i list \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setSlotSizes \b0 (int \i border \i0 , NSArray \i list \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the sizes of all slots to the values in \i list \i0 . Each element in \i list \i0 is an NSNumber in Objective-C, and a java.lang.Integer in Java. List is organized in \i physical \i0 (original) slot order. Each value is the size of the corresponding slot. This method is useful for restoring the user's slot size preferences. Returns \b YES \b0 on success, \b NO \b0 on failure.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlotOrder:, -border:setSlotSizesFromString:, -slotSizes: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlotSizesFromString:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlotSizesFromString: \b0 (NSString*) \i s \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setSlotSizes \b0 (int \i border \i0 , String \i s \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This is a convenience method which invokes \f4\fs24 -border:setSlotSizes: \f3\fs28 using an \f4\fs24 NSArray \f3\fs28 constructed from \i s \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlotOrder:, -border:setSlotSizes:, -slotSizes:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlotSortVector:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlotSortVector: \b0 (NSArray*) \i v \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotSortVector \b0 (int \i border \i0 , NSArray \i v \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the order in which slots are considered when sorting. Each value in \i v \i0 is the \i physical \i0 (original) position of a slot. The elements of \i v \i0 are each an NSNumber in Objective-C, and a java.lang.Integer in Java. The slots will be compared in the order that they appear in \i v \i0 . Use the one's complement (bitwise negation with the tilde, `~', operator) to reverse the sort direction (ascending / descending) of a slot. The current \i visual \i0 slot order is used by default; use this method to specify a different ordering. This method turns off auto-sort for the other border. That is, setting a \i slotSortVector \i0 for the columns turns off auto-sort for the rows. The auto-sort facility automatically sorts the table whenever a slot is dragged, so setting a slot sort vector invalidates the premise on which auto-sort works.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -slotSortVector \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlotTitleMode:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlotTitleMode: \b0 (MiscTableTitleMode) \i mode \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotTitleMode \b0 (int \i border \i0 , int \i mode \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \i title-mode \i0 for a border. The \i mode \i0 can be any of the following:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx5040\tx7560\ul\fs24\fi-3140\li5040\fc0\cf0 Objective-C \ulnone \ul Java \ulnone \ul Description\ \f4\ulnone MISC_NO_TITLE, TITLE_NONE \f3 No titles on row/column cells. \f4 \ MISC_NUMBER_TITLE, TITLE_NUMBER \f3 Titles are sequential numbers. \f4 \ MISC_ALPHA_TITLE, TITLE_ALPHA \f3 Titles are sequential alphabetics. \f4 \ MISC_CUSTOM_TITLE, TITLE_CUSTOM \f3 Titles are user-supplied strings. \f4 \ MISC_DELEGATE_TITLE TITLE_DELEGATE \f3 Ask the delegate for titles. \f4 \ \pard\tx2480\tx2860\tx3240\f3\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -tableScroll:border:slotTitle: \b0 (delegate method) \b \ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlotTitlesOn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlotTitlesOn: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setSlotTitlesOn \b0 (int \i border \i0 , boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Determines whether titles will be displayed. When \i flag \i0 is YES, the titles will be displayed. When \i flag \i0 is NO, the titles will not be displayed. The titles must be displayed to let the user resize and drag slots. See \b Slot Sizing \b0 in the introduction for more details. Returns YES if the titles were changed, NO otherwise. For example, if this function is called to turn on the column titles, but the column titles are already on, the function will do nothing and return NO. The function will only return YES if the titles were actually turned on or off by the call.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setSlotTitlesSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setSlotTitlesSize: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSlotTitlesSize \b0 (int \i border \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 For column titles, sets their height. For row titles, sets their width.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:setUniformSizeSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b setUniformSizeSlots: \b0 (float) \i uniform_size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setUniformSizeSlots \b0 (int \i border \i0 , float \i uniform_size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets or clears the \i uniform-size \i0 for a border. If \i uniform_size \i0 is zero, then each slot on that border will be able to have individually varying sizes. If \i uniform_size \i0 is non-zero, then every slot on that border will have the size, \i uniform_size \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotAdjustedSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b border: \b0 (MiscBorderType) \i border \i0 \b slotAdjustedSize: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b slotAdjustedSize \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current display size of \i slot \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotAtPosition:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b border: \b0 (MiscBorderType) \i border \i0 \b slotAtPosition: \b0 (int) \i pos \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b slotAtPosition \b0 (int \i border \i0 , int \i pos \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the original physical position of the slot in visual position \i pos \i0 . This is the visual-to-physical conversion routine.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:moveSlot:toSlot:, -border:slotPosition: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotCellPrototype:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b border: \b0 (MiscBorderType) \i border \i0 \b slotCellPrototype: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b slotCellPrototype \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the cell prototype for \i slot \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:cellPrototype:, -border:setSlot:cellType: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotCellType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscTableCellStyle) \b border: \b0 (MiscBorderType) \i border \i0 \b slotCellType: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b slotCellType \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the cell type for \i slot \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:cellPrototype:, -border:setSlot:cellType: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotDragged:toSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b slotDragged: \b0 (int) \i from_pos \i0 \b toSlot: \b0 (int) \i to_pos \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 protected void \b slotDraggedToSlot \b0 (int \i border \i0 , int \i from_pos \i0 , int \i to_pos \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Internal method, invoked whenever the user drags a slot to a new position. Posts \f4\fs24 MiscTableScrollSlotDraggedNotification \f3\fs28 to the default notification center. Can be useful in subclasses to recognize a user-initiated slot drag event.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotIsAutosize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b border: \b0 (MiscBorderType) \i border \i0 \b slotIsAutosize: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b slotIsAutosize \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the state of the autosize flag for \i slot \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotIsSelected:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b border: \b0 (MiscBorderType) \i border \i0 \b slotIsSelected: \b0 (MiscCoord_P) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b slotIsSelected \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if \i slot \i0 is selected, else NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotIsSizeable:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b border: \b0 (MiscBorderType) \i border \i0 \b slotIsSizeable: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b slotIsSizeable \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the state of the user-sizeable flag for \i slot \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotIsSorted:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b border: \b0 (MiscBorderType) \i border \i0 \b slotIsSorted: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b slotIsSorted \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method compares \i slot \i0 with its neighbors. It returns YES if these slots are sorted relative to each other. It returns NO if any of these slots are out of order with respect to the others. This method can be useful for determining whether or not the table must be resorted when you are changing values in the table.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:sortSlot:, -slotsAreSorted:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotIsVisible:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b border: \b0 (MiscBorderType) \i border \i0 \b slotIsVisible: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b slotIsVisible \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if any part of \i slot \i0 is visible in the scrolling display. Returns NO otherwise.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotMaxSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b border: \b0 (MiscBorderType) \i border \i0 \b slotMaxSize: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b slotMaxSize \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the maximum size for \i slot \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotMinSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b border: \b0 (MiscBorderType) \i border \i0 \b slotMinSize: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b slotMinSize \b0 (int \i border, \i0 int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the minimum size for \i slot \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotPosition:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b border: \b0 (MiscBorderType) \i border \i0 \b slotPosition: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b slotPosition \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current \i visual \i0 position of the slot whose original \i physical \i0 position was \i slot \i0 . This is the physical-to-visual conversion routine.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:moveSlot:toSlot:, -border:slotAtPosition: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotRepresentedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b border: \b0 (MiscBorderType) \i border \i0 \b slotRepresentedObject: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b slotRepresentedObject \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the represented object associated with \i slot \i0 , or nil if no object has been associated with \i slot \i0 . See \b Represented Objects \b0 in the introduction for more details.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotTag: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotResized:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b slotResized: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 protected void \b slotResized \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Internal method called whenever the user resizes a slot. Posts \f4\fs24 MiscTableScrollSlotResizedNotification \f3\fs28 to the default notification center. Can be useful in subclasses to recognize user-initiated slot resizing.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b border: \b0 (MiscBorderType) \i border \i0 \b slotSize: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b slotSize \b0 (int \i border \i0 , int \i slot) \i0\fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the target size for \i slot \i0 . See \b Slot Sizing \b0 in the introduction for more details.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotSortDirection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscSortDirection) \b border: \b0 (MiscBorderType) \i border \i0 \b slotSortDirection: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b slotSortDirection \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the sort direction (ascending or descending) for \i slot \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotSortFunction \f3\b0 : \f0\b \ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCompareEntryFunc) \b border: \b0 (MiscBorderType) \i border \i0 \b slotSortFunction \b0 :(int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the custom sort function for slot \i slot \i0 , if any, otherwise it returns 0.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotSortReversed:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b border: \b0 (MiscBorderType) \i border \i0 \b slotSortReversed: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 protected void \b slotSortReversed \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Internal method, invoked whenever the user reverses the sort direction of a slot. Posts \f4\fs24 MiscTableScrollSlotSortReversedNotification \f3\fs28 to the default notification center. Can be useful in subclasses to recognize a user-initiated sort reverse event.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotSortType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscSortType) \b border: \b0 (MiscBorderType) \i border \i0 \b slotSortType: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b slotSortType \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the sort type of \i slot \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotTag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b border: \b0 (MiscBorderType) \i border \i0 \b slotTag: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b slotTag \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the tag value associated with \i slot \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotRepresentedObject: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotTitle:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b border: \b0 (MiscBorderType) \i border \i0 \b slotTitle: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b slotTitle \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the title for \i slot \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotWithRepresentedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b border: \b0 (MiscBorderType) \i border \i0 \b slotWithRepresentedObject: \b0 (id) \i object \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b slotWithRepresentedObject \b0 (int \i border \i0 , Object \i object \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the index of the first slot whose represented object is \i object \i0 , or -1 if no match was found. Equality between \i object \i0 and each slot's represented object is tested with \f4\fs24 -isEqual: \f3\fs28 . See \b Represented Objects \b0 in the introduction for more details.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotWithTag: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:slotWithTag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b border: \b0 (MiscBorderType) \i border \i0 \b slotWithTag: \b0 (int) \i tag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b slotWithTag \b0 (int \i border \i0 , int \i tag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the index of the first slot whose tag is \i tag \i0 , or -1 if no match was found.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotWithRepresentedObject: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:sortSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b border: \b0 (MiscBorderType) \i border \i0 \b sortSlot: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b sortSlot \b0 (int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Re-sorts a single slot. This method can be used to restore the sort order after a single slot has been added or changed in such a way that it might not be in the correct sort position. The results are unpredictable if the other slots are not already sorted. Returns YES if the slot sorted to a new visual location, otherwise returns NO.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -sortSlots:, -sortColumn:, -sortRow: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 border:visualToPhysical:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b border: \b0 (MiscBorderType) \i border \i0 \b visualToPhysical: \b0 (NSArray*) \i list \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b visualToPhysical \b0 (int \i border \i0 , NSArray \i list \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method accepts an array in which each element is a \i visual \i0 (current) slot index, and returns an array containing the corresponding \i physical \i0 (original) slot indexes. This is accomplished via a succession of calls to \f4\fs24 -border:slotAtPosition: \f3\fs28 . Each element in \i list \i0 is an NSNumber in Objective-C, and a java.lang.Integer in Java. \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotAtPosition:, -border:slotPosition: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 bufferCount\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b bufferCount \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b bufferCount \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method is only meaningful for lazy tables. If the \i delegate \i0 or \i dataDelegate \i0 provide multiple buffers for responding to \f4\fs24 -tableScroll:cellAtRow:column: \f3\fs28 , they are encouraged to respond to \f4\fs24 -tableScrollBufferCount: \f3\fs28 with the number of buffers that they provide. If the \i delegate \i0 and \i dataDelegate \i0 do not respond, a default value of one (1) is returned, which indicates that all values from a call to \f4\fs24 -cellAtRow:column: \f3\fs28 must be copied before making a second call to \f4\fs24 -cellAtRow:column: \f3\fs28 . This method is called internally during \f4\fs24 -sortInfoInit:border: \f3\fs28 to determine whether copying must be performed during sorting. \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -isLazy, -setLazy:, -tableScrollBufferCount: \b0 (delegate method) \b , -tableScroll:cellAtRow:column: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 builtinCanWritePboardType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b builtinCanWritePboardType: \b0 (NSString*) \i type \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b builtinCanWritePboardType \b0 (String \i type \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 The built-in method for determining which data types can be placed on the pasteboard. This method returns YES for \f4\fs24 NSStringPboardType \f3\fs28 and \f4\fs24 NSTabularTextPboardType \f3\fs28 . Override this method in your subclass if you will provide additional pasteboard datatypes. This method is called from \f4\fs24 -canWritePboardType: \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -canWritePboardType: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 builtinReadSelectionFromPasteboard:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b builtinReadSelectionFromPasteboard: \b0 (NSPasteboard*) \i pboard \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b builtinReadSelectionFromPasteboard \b0 (NSPasteboard \i pboard \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method merely returns NO. The current implementation of MiscTableScroll never reads anything from the pasteboard. Override this method in your subclass if you want to read data from the pasteboard. This method is called from \f4\fs24 -readSelectionFromPasteboard: \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -readSelectionFromPasteboard: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 builtinRegisterServicesTypes\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b builtinRegisterServicesTypes \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b builtinRegisterServicesTypes \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method sends \f4\fs24 -registerServicesMenuSendTypes:returnTypes: \f3\fs28 to NSApp. It registers \f4\fs24 NSTabularTextPboardType \f3\fs28 and \f4\fs24 NSStringPboardType \f3\fs28 send types, and no return types. Override this method in your subclass if you want to send or return different data types. Called from \f4\fs24 -registerServicesTypes \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -registerServicesTypes, -registerServicesMenuSendTypes:returnTypes: \b0 (NSApplication) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 builtinValidRequestorForSendType:returnType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b builtinValidRequestorForSendType: \b0 (NSString*) \i sendType \i0 \b returnType: \b0 (NSString*) \i returnType \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b builtinValidRequestorForTypes \b0 (String \i sendType \i0 , String \i returnType \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method returns \b self \b0 if \i sendType \i0 is either \f4\fs24 NSTabularTextPboardType \f3\fs28 or \f4\fs24 NSStringPboardType \f3\fs28 , and \i returnType \i0 is nil, and there is a selection, otherwise it returns the value from a call to \f4\fs24 [super validRequestorForSendType: \f3\i\fs28 sendType \f4\fs24 \i0 returnType: \f3\i\fs28 returnType \f4\i0\fs24 ] \f3\fs28 . Override this method if your subclass can handle different combinations. Called from \f4\fs24 -validRequestorForSendType:returnType: \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -validRequestorForSendType:returnType:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 builtinStringForPboardType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b builtinStringForPboardType: \b0 (NSString*) \i type \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b builtinStringForPboardType \b0 (String \i type \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If \i type \i0 is \f4\fs24 NSStringPboardType \f3\fs28 , then \f4\fs24 -stringForNSStringPboardType \f3\fs28 is called, else if \i type \i0 is \f4\fs24 NSTabularTextPboardType \f3\fs28 , then \f4\fs24 -stringForNSTabularTextPboardType \f3\fs28 is called. Otherwise it does nothing. Override this method in your subclass if you can write additional datatypes to the pasteboard. Called from \f4\fs24 -writeSelectionToPasteboard:types: \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -writeSelectionToPasteboard:types: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 builtinWriteSelectionToPasteboard:types:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b builtinWriteSelectionToPasteboard: \b0 (NSPasteboard*) \i pboard \i0 \b types: \b0 (NSArray*) \i types \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b builtinWriteSelectionToPasteboardOfType \b0 (NSPasteboard \i pboard \i0 , NSArray \i types \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Writes all of the types that can be written to the pasteboard. Each entry in \i types \i0 is tested with \f4\fs24 -canWritePboardType: \f3\fs28 . If the result is YES, and there is a selection, it is passed on to \f4\fs24 -writeSelectionToPasteboard:types: \f3\fs28 . The data is written immediately, the MiscTableScroll object does not register a pasteboard owner. Override this method in your subclass if you need different behavior. Called from \f4\fs24 -writeSelectionToPasteboard:types: \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -canWritePboardType:, -writeSelectionToPasteboard:types:, -writeSelectionToPasteboard:types: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 canEdit:atRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b canEdit: \b0 (NSEvent*) \i event \b\i0 atRow: \b0 (MiscCoord_P) \i row \b\i0 column: \b0 (MiscCoord_P) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b canEditAtLocation \b0 (NSEvent \i event \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Determines whether or not the cell at \i row \i0 , \i col \i0 can be edited. Attempts to send \f4\fs24 -tableScroll:canEdit:atRow:column: \f3\fs28 to the \i delegate \i0 , the \i dataDelegate \i0 , or the cell at \i row \i0 , \i col \i0 , in that order. The result is taken from the first of these three to respond to \f4\fs24 -tableScroll:canEdit:atRow:column: \f3\fs28 and is returned to the caller of \f4\fs24 -canEdit:atRow:column: \f3\fs28 . If none of the three respond, then MiscTableScroll applies its own criteria to determine if editing is allowed. If the cell is not both enabled and editable then NO is returned. If \i event \i0 is nil or represents a double-click by the mouse then YES is returned, otherwise NO.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 It is valid to specify nil for \i event \i0 when editing needs to be invoked for a non-mouse-down event. (For instance, \f4\fs24 -getNext:editRow:column: \f3\fs28 operates in this fashion.) If \i event \i0 is not nil then it should point at a mouse-down event.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -isEditable \b0 (NSCell), \b -isEnabled \b0 (NSCell) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 canWritePboardType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b canWritePboardType: \b0 (NSString*) \i type \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b canWritePboardType \b0 (String \i type \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Responds to queries from \f4\fs24 -builtinWriteSelectionToPasteboard:types: \f3\fs28 . First it gives the \i delegate \i0 an opportunity to answer via \f4\fs24 -tableScroll:canWritePboardType: \f3\fs28 . If the \i delegate \i0 does not respond to that message, it gives the \i dataDelegate \i0 an opportunity to answer the same message. If neither object responds, the built-in implementation, \f4\fs24 -builtinCanWritePboardType: \f3\fs28 is called. Called from \f4\fs24 -builtinWriteSelectionToPasteboard:types: \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -builtinCanWritePboardType:, -builtinWriteSelectionToPasteboard:types:, -tableScroll:canWritePboardType: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 cellAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b cellAtRow: \b0 (int) \i row \i0 \b column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b cellAtLocation \b0 (int \i row \i0 , int \i col) \i0\fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns a pointer to the cell located at \i row \i0 , \i col \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 cellFrameAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSRect) \b cellFrameAtRow: \b0 (int) \i row \i0 \b column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSRect \b cellFrameAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the frame of the cell at the specified coordinates. If \i row \i0 or \i col \i0 are out of bounds, then returns the empty rectangle. < FIXME: Currently the returned rectangle also includes the intercell grid lines which are below and to the right of the cell. >\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 cellIsSelectedAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b cellIsSelectedAtRow: \b0 (MiscCoord_P) \i row \i0 \b column: \b0 (MiscCoord_P) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b cellIsSelectedAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the cell at \i row \i0 , \i col \i0 is selected.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 cellWithRepresentedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b cellWithRepresentedObject: \b0 (id) \i object \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b cellWithRepresentedObject \b0 (Object \i object \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the first cell in the body of the table with a represented object equal to \i object \i0 , or nil if no match was found. Equality between \i object \i0 and each cell's represented object is tested with \f4\fs24 -isEqual: \f3\fs28 . See \b Represented Objects \b0 in the introduction for more details.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 - cellWithTag:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 cellWithTag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b cellWithTag: \b0 (int) \i tag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b cellWithTag \b0 (int \i tag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the first cell in the body of the table with \i tag \i0 , otherwise nil.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 - cellWithRepresentedObject:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 changeFont:\ \pard\tx7140\fs6\fi-380\li2480\fc0\cf0 \ \pard\f1\b0\fs28\fi-620\li2520\fc0\cf0 - \f3 (void) \b changeFont: \b0 (id) \i sender \i0\fs24 [Objective-C] \i\fs28 \ \pard\tx2480\tx2860\tx3240\i0\fi-620\li2520\fc0\cf0 void \b changeFont \b0 (Object \i sender \i0 ) \fs24 [Java] \i\fs28 \ \i0\fs14\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Changes the font of the MiscTableScroll object as well all cells which inherit it. The NSFontManager sends the \f4\fs24 -changeFont: \f3\fs28 message whenever the user changes the font using either the NSFontPanel or the Font menu. This method changes the font by sending \f4\fs24 -convertFont: \f3\fs28 to the \i sender \i0 , which is presumed to be an NSFontManager or similarly capable object, and then passes the returned font to \f4\fs24 -setFont: \f3\fs28 . This method posts \f4\fs24 MiscTableScrollChangeFontNotification \f3\fs28 to the default notification center after \f4\fs24 -setFont: \f3\fs28 posts \f4\fs24 MiscTableScrollFontChangedNotification \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 - setFont:, tableScrollChangeFont: \b0 (delegate method) \b , tableScrollFontChanged: \b0 (delegate method) \b \ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clearColumnSelection\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b clearColumnSelection \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b clearColumnSelection \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -clearSlotSelection:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clearCursor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b clearCursor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b clearCursor \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 [self clearCursorColumn] \f3\fs28 and \f4\fs24 [self clearCursorRow] \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clearCursorColumn\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b clearCursorColumn \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b clearCursorColumn \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the column border's keyboard cursor slot to -1, effectively hiding it until it is next set to a valid position.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clearCursorRow\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b clearCursorRow \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b clearCursorRow \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the row border's keyboard cursor slot to -1, effectively hiding it until it is next set to a valid position.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clearCursorSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b clearCursorSlot: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b clearCursorSlot \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the border's keyboard cursor slot to -1, effectively hiding it until it is next set to a valid position.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clearRowSelection\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b clearRowSelection \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b clearRowSelection \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -clearSlotSelection:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clearSelection\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b clearSelection \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b clearSelection \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 [self clearRowSelection] \f3\fs28 and \f4\fs24 [self clearColumnSelection] \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clearSlotSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b clearSlotSelection: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b clearSlotSelection \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Deselects all slots that were selected in \i border \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clickedCell\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b clickedCell \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b clickedCell \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 During mouse-tracking, returns the cell underneath the mouse, otherwise returns the cell which was under the mouse when tracking ended. This method only really makes sense for eager-mode MiscTableScroll objects since a unique cell inhabits each row & column position, whereas in lazy-mode only one cell typically exists per column.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 clickedSlot:, clickedColumn, clickedRow, isTrackingMouse \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clickedColumn\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCoord_P) \b clickedColumn \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b clickedColumn \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 During mouse-tracking, returns the column underneath the mouse, otherwise returns the column which was under the mouse when tracking ended.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 clickedSlot:, clickedCell, clickedRow, isTrackingMouse \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clickedRow\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCoord_P) \b clickedRow \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b clickedRow \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 During mouse-tracking, returns the row underneath the mouse, otherwise returns the row which was under the mouse when tracking ended.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 clickedSlot:, clickedCell, clickedColumn, isTrackingMouse \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 clickedSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCoord_P) \b clickedSlot: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b clickedSlot \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 During mouse-tracking, returns the slot underneath the mouse, otherwise returns the slot which was under the mouse when tracking ended.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 clickedCell, clickedColumn, clickedRow, isTrackingMouse \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 color\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSColor*) \b color \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSColor \b color \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -backgroundColor \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnAdjustedSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b columnAdjustedSize: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b columnAdjustedSize \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current display width of \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotAdjustedSize: \i col \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotAdjustedSize: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnAtPosition:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b columnAtPosition: \b0 (int) \i pos \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b columnAtPosition \b0 (int \i pos \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the original \i physical \i0 position of the column at the current \i visual \i0 position \i pos \i0 . This is the visual-to-physical conversion routine. Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotAtPosition: \i pos \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotAtPosition:, -border:slotPosition:, -columnPosition: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnCellPrototype:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b columnCellPrototype: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b columnCellPrototype \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the cell prototype for column \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotCellPrototype: \i col \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:cellPrototype:, -border:slotCellPrototype: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnCellType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscTableCellStyle) \b columnCellType: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b columnCellType \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the cell type for column \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotCellType: \i col \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:cellType:, -border:slotCellType: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnIsAutosize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b columnIsAutosize: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b columnIsAutosize \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the state of the \i autosize \i0 flag for column \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotIsAutosize: \i col \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:autosize:, -border:slotIsAutosize: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnIsSelected:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b columnIsSelected: \b0 (MiscCoord_P) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b columnIsSelected \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if column \i col \i0 is selected, else NO. Equivalent to \f4\fs24 -border:MISC_COL_BORDER slotIsSelected: \i col. \f3\i0\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnIsSizeable:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b columnIsSizeable: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b columnIsSizeable \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the state of the \i user-sizeable \i0 flag for column \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotIsSizeable: \i col \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:sizeable:, -border:slotIsSizeable: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnIsSorted:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b columnIsSorted: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b columnIsSorted \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if \i col \i0 is sorted relative to its neighboring columns. Returns NO otherwise. Equivalent to \f4\fs24 -border:MISC_COL_BORDER slotIsSorted: \i col \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnIsVisible:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b columnIsVisible: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b columnIsVisible \b0 (int \i col) \i0\fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if any part of \i col \i0 is visible in the scrolling display. Returns NO otherwise. Equivalent to \f4\fs24 -border:MISC_COL_BORDER slotIsVisible: \i col \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnMaxSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b columnMaxSize: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b columnMaxSize \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the maximum size for column \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotMaxSize: \i col \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:maxSize:, -border:slotMaxSize:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnMinSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b columnMinSize: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b columnMinSize \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the minimum size for column \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotMinSize: \i col \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:minSize:, -border:slotMinSize: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnOrder\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b columnOrder \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b columnOrder \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to \f4\fs24 -slotOrder:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnOrderAsString\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b columnOrderAsString \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b columnOrderAsString \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to \f4\fs24 slotOrderAsString:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnPosition:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b columnPosition: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b columnPosition \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current \i visual \i0 position of the column whose original \i physical \i0 position is \i pos \i0 . This is the physical-to-visual conversion routine. Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotPosition: \i pos \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:moveSlot:toSlot:, -border:slotAtPosition:, -border:slotPosition:, -columnAtPosition:, -moveColumn:toColumn: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnRepresentedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b columnRepresentedObject: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b columnRepresentedObject \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the represented object for column \i col \i0 . See \b Represented Objects \b0 in the introduction for more details. Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotRepresentedObject: \i col \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -columnTag: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnsAreSorted\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b columnsAreSorted \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b columnsAreSorted \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if all columns are sorted. Equivalent to \f4\fs24 -slotsAreSorted:MISC_COL_BORDER \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -columnIsSorted:, -slotsAreSorted: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b columnSize: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b columnSize \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the target size for column \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotSize: \i col \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:size:, -border:slotSize: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnSizes\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b columnSizes \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b columnSizes \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 slotSizes:MISC_COL_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnSizesAsString\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b columnSizesAsString \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b columnSizesAsString \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to \f4\fs24 -slotSizesAsString:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnSortDirection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscSortDirection) \b columnSortDirection: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b columnSortDirection \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the sort direction (ascending or descending) of \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotSortDirection: \i col \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnSortFunction:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCompareEntryFunc) \b columnSortFunction \b0 :(int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotSortFunction: \i col \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnSortType: \f3\b0\fs24 \f0\b\fs28 \ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscSortType) \b columnSortType: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b columnSortType \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to \f4\fs24 -border:MISC_COL_BORDER slotSortType: \f3\i\fs28 col \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnSortVector\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b columnSortVector \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b columnSortVector \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -slotSortVector:MISC_COL_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnTag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b columnTag: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b columnTag \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the tag for column \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotTag: \i col \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -columnRepresentedObject: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnTitle:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b columnTitle: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b columnTitle \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the title for column \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotTitle: \i col \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnTitleMode\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscTableTitleMode) \b columnTitleMode \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b columnTitleMode \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the \i title-mode \i0 for column \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotTitleMode: \i col \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnTitlesHeight\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b columnTitlesHeight \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b columnTitlesHeight \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -slotTitlesSize:MISC_COL_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnTitlesOn\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b columnTitlesOn \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b columnTitlesOn \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not column titles are displayed. Equivalent to: \f4\fs24 -slotTitlesOn:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnWithRepresentedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b columnWithRepresentedObject: \b0 (id) \i object \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b columnWithRepresentedObject \b0 (Object \i object \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the index of the first column with a represented object equal to \i object \i0 , or -1 if no match was found. Equality between \i object \i0 and each column's represented object is tested with \f4\fs24 -isEqual: \f3\fs28 . See \b Represented Objects \b0 in the introduction for more details. Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotWithRepresentedObject: \i object \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -columnWithTag: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 columnWithTag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b columnWithTag: \b0 (int) \i tag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b columnWithTag \b0 (int \i tag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the index of the first column with tag \i tag \i0 , or -1 if no columns have tag \i tag \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER slotWithTag: \i tag \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -columnWithRepresentedObject: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 compareColumns::\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b compareColumns: \b0 (int) \i col1 \b\i0 : \b0 (int) \i col2 \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b compareColumns \b0 (int \i col1 \i0 , int \i col2 \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Compares two columns. Equivalent to \f4\fs24 -border:MISC_COL_BORDER compareSlots: \i col1 \i0 : \i col2 \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 compareColumns::info:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b compareColumns: \b0 (int) \i col1 \b\i0 : \b0 (int) \i col2 \i0 \b info: \b0 (MiscSlotSortInfo* \i )sortInfo \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Compares two columns. Equivalent to \f4\fs24 -border:MISC_COL_BORDER compareSlots: \i col1 \i0 : \i col2 \i0 info: \i sortInfo \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 compareRows::\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b compareRows: \b0 (int) \i row1 \b\i0 : \b0 (int) \i row2 \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b compareRows \b0 (int \i row1 \i0 , \i row2 \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Compares two columns. Equivalent to \f4\fs24 -border:MISC_ROW_BORDER compareSlots: \i row1 \i0 : \i row2 \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 compareRows::info:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b compareRows: \b0 (int) \i row1 \b\i0 : \b0 (int) \i row2 \i0 \b info: \b0 (MiscSlotSortInfo* \i )sortInfo \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Compares two columns. Equivalent to \f4\fs24 -border:MISC_ROW_BORDER compareSlots: \i row1 \i0 : \i row2 \i0 info: \i sortInfo \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 compareSlotFunction\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCompareSlotFunc) \b compareSlotFunction \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the slot comparison function.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 constrainSize\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b constrainSize \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b constrainSize \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Internal method that checks and applies new slot counts and min total size constraints to update the frames of the components of the MiscTableScroll object.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 copy:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b copy: \b0 (id) \i sender \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b copy \b0 (Object \i sender \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Copies the selection to the pasteboard. Calls \f4\fs24 -writeSelectionToPasteboard:types: \f3\fs28 , with \f4\fs24 NSTabularTextPboardType \f3\fs28 and \f4\fs24 NSStringPboardType \f3\fs28 for types that should be written. Override this method in your subclass if you want to write different datatypes to the pasteboard.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -writeSelectionToPasteboard:types: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 cornerTitle\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b cornerTitle \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b cornerTitle \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the title for the corner cell.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 cursorColumn\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCoord_P) \b cursorColumn \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b cursorColumn \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the column that the column keyboard cursor is on. Meaningless if tracking is by rows.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 cursorRow\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCoord_P) \b cursorRow \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b cursorRow \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the row that the row keyboard cursor is on. Meaningless if tracking is by columns.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 cursorSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCoord_P) \b cursorSlot: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b cursorSlot \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the index of the slot that the keyboard cursor is currently on, or -1 if the keyboard cursor is not on any slot.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 cut:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b cut: \b0 (id) \i sender \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b cut \b0 (Object \i sender \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 [self copy: \i sender \i0 ] \f3\fs28 . Nothing is deleted.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 dataDelegate\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b dataDelegate \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b dataDelegate \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the data delegate of the MiscTableScroll object.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -setDataDelegate\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 dealloc\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b dealloc \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Destroys the MiscTableScroll object, reclaiming all resources allocated by it.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 delegate\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b delegate \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b delegate \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the delegate of the MiscTableScroll object.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -setDelegate \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 deselectAll:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b deselectAll: \b0 (id) \i sender \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b deselectAll \b0 (Object \i sender \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 [self clearSelection] \f3\fs28 followed by \f4\fs24 [self sendActionIfEnabled] \f3\fs28 . \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 deselectColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b deselectColumn: \b0 (MiscCoord_P) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b deselectColumn \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER deselectSlot: \i col \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 deselectColumns:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b deselectColumns: \b0 (NSArray*) \i cols \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b deselectColumns \b0 (NSArray \i cols \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER deselectSlots: \f3\i\fs28 cols \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 deselectColumnsWithTags:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b deselectColumnsWithTags: \b0 (NSArray*) \i tags \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b deselectColumnsWithTags \b0 (NSArray \i tags \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER deselectSlotsWithTags: \i tags \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 deselectRow:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b deselectRow: \b0 (MiscCoord_P) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b deselectRow \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER deselectSlot: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 deselectRows:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b deselectRows: \b0 (NSArray*) \i rows \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b deselectRows \b0 (NSArray \i rows \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER deselectSlots: \f3\i\fs28 rows \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 deselectRowsWithTags:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b deselectRowsWithTags: \b0 (NSArray*) \i tags \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b deselectRowsWithTags \b0 (NSArray \i tags \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER deselectSlotsWithTags: \i tags \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 didBecomeFirstResponder\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b didBecomeFirstResponder \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 protected void \b didBecomeFirstResponder \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Internal method, invoked by the \i documentView \i0 's \f4\fs24\fc1\cf1 -becomeFirstResponder \f3\fs28\fc0\cf0 method whenever it becomes first responder. The document view is an instance of the private class MiscTableView. Sends \f4\fs24\fc1\cf1 -setSelectedFont:isMultiple: \f3\fs28\fc0\cf0 to the shared NSFontManager with the current font setting, and then posts \f4\fs24 MiscTableScrollDidBecomeFirstResponderNotification \f3\fs28 to the default notification center. Subclasses which need to perform additional processing when the document view becomes first responder may wish to override this method.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 didResignFirstResponder\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b didResignFirstResponder \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 protected void \b didResignFirstResponder \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Internal method, invoked by the \i documentView \i0 's \f4\fs24\fc1\cf1 -resignFirstResponder \f3\fs28\fc0\cf0 method whenever it resigns first responder. The document view is an instance of the private class MiscTableView. Posts \f4\fs24 MiscTableScrollDidResignFirstResponderNotification \f3\fs28 to the default notification center. Subclasses which need to perform additional processing when the document view resigns first responder may wish to override this method.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 disableCursor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b disableCursor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b disableCursor \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Inhibits display of the keyboard cursor. Calls to this method nest and should be balanced by calls to \f4\fs24 -enableCursor \f3\fs28 . The keyboard cursor is a dashed rectangle drawn around a row or column indicating which slot keyboard actions will affect. See the discussion of \b Keyboard Operations \b0 at the beginning of this document for further information.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 isCursorEnabled, enableCursor \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 documentClipRect\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSRect) \b documentClipRect \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSRect \b documentClipRect \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the frame of the NSClipView which contains the document view.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 doGetIncrementalSearchColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b doGetIncrementalSearchColumn: \b0 (int*) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Built-in method to choose the incremental search column. Returns YES if incremental search should be enabled and sets * \i col \i0 to the physical index of the column that should be searched, otherwise returns NO. To enable incremental search via this function, autoSortRows must be YES; the first sorting column must be string-based (stringValue or title); and there cannot be a custom sort function for the column. This method works appropriately for normal tables, as long as autoSortRows is turned on. Whenever the user drags a string-based column to the first position, incremental search will be enabled. Non-sorting (skip) columns are ignored. You can override this behavior by implementing the \f4\fs24 -tableScroll:getIncrementalSearchColumn: \f3\fs28 method in your delegate.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -incrementalSearch:, -tableScroll:getIncrementalSearchColumn: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 doIncrementalSearch:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b doIncrementalSearch: \b0 (NSEvent*) \i event \b\i0 column: \b0 (int) \i column \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b doIncrementalSearch \b0 (NSEvent \i event \i0 , int \i column \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Built-in method that performs incremental search. \i Event \i0 must be the key-down event that invoked incremental searching. \i Column \i0 must be the column that will be searched. The table must be sorted in \i column \i0 order (ascending or descending). The sort-type for \i col \i0 must be string-based ( \f4\fs24 -stringValue \f3\fs28 or \f4\fs24 -title \f3\fs28 ). \i Column \i0 cannot have a custom sort function. You are responsible for ensuring that the table is sorted in \i column \i0 order. This method runs a modal event loop, processing keystrokes and scrolling the table appropriately. Returns YES if \i column \i0 was acceptable and \i event \i0 was processed. Returns NO if \i column \i0 failed any of the tests mentioned.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -incrementalSearch:, -tableScroll:getIncrementalSearchColumn: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 doRetireCell:atRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b doRetireCell: \b0 (id) \i cell \i0 \b atRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b doRetireCellAtLocation \b0 (NSCell \i cell \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This built-in implementation tries to recover storage before the cell is idled. An attempt is made to send the following messages to the cell in this order: \f4\fs24 -setTitle:@"" \f3\fs28 , \f4\fs24 -setStringValue:@"" \f3\fs28 . If the cell responds to a message, that message is sent, otherwise the next message is tried. Override this method in your subclass if you need to do different processing when cells are retired to the cache. Called from: \f4\fs24 -retireCell:atRow:column: \f3\fs28 . Returns \i cell \i0 . \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 doReviveCell:atRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b doReviveCell: \b0 (id) \i cell \i0 \b atRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b doReviveCellAtLocation \b0 (NSCell \i cell \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method tries to reset the cell so that it will " \f4\fs24 useOwner \f3\fs28 ..." values for font, textColor, backgroundColor, selectedTextColor, and selectedBackgroundColor. It tries to set the MiscTableScroll object as the \i owner \i0 of the cell. Then it tries to initialize the font, textColor, backgroundColor, selectedTextColor, and selectedBackgroundColor by first trying the " \f4\fs24 setOwner \f3\fs28 ..." value method, and then trying the straight " \f4\fs24 set \f3\fs28 ..." method if the cell does not respond to the " \f4\fs24 setOwner \f3\fs28 ..." version. Override this method in your subclass if you need different behavior when a cell is brought into active service. Called from \f4\fs24 -reviveCell:atRow:column: \f3\fs28 . Returns \i cell \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 doubleAction\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (SEL) \b doubleAction \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSSelector \b doubleAction \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the selector message that is sent to the \i doubleTarget \i0 on a double-click event.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 doubleTarget\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b doubleTarget \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b doubleTarget \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns a pointer to the object which will receive the \i doubleAction \i0 message on a double-click event.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 doubleValueAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (double) \b doubleValueAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 double \b doubleValueAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the value of sending a \f4\fs24 -doubleValue \f3\fs28 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f4\fs24 -tableScroll:doubleValueAtRow:column: \f3\fs28 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f4\fs24 -tableScroll:doubleValueAtRow:column: \f3\fs28 message, then the cell is retrieved via \f4\fs24 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f4\fs24 -doubleValue \f3\fs28 message, that value is returned; otherwise, zero is returned.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -isLazy, -setLazy:, -tableScroll:doubleValueAtRow:column: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 draggableColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b draggableColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b draggableColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not the user will be allowed to drag (rearrange) the columns. Equivalent to: \f4\fs24 -draggableSlots:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 draggableRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b draggableRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b draggableRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not the user will be allowed to drag (rearrange) the rows. Equivalent to: \f4\fs24 -draggableSlots:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 draggableSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b draggableSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx3600\tx3980\tx4340\fi-620\li2520\fc0\cf0 boolean \b draggableSlots \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li1500 \ \fs28 Indicates whether or not the user will be allowed to drag (rearrange) the slots on this border. To enable the user to drag slots, the slots must be draggable, and the titles must be displayed.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 drawCellAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b drawCellAtRow: \b0 (int) \i row \i0 \b column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b drawCellAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Instructs the MiscTableScroll object to redraw the cell at position \i row \i0 , \i col \i0 . This should be called whenever the contents of a single cell are changed and the screen should be updated to reflect the new state. This method will lock focus on the view if needed.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: -border:drawSlot:, \f3\fs28 -display \b0 (View) \b , -drawColumn:, -drawRow: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 drawsClippedText\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b drawsClippedText \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b drawsClippedText \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the MiscTableScroll object will use clipping rectangles and draw partially visible text. Returns NO if the MiscTableScroll object will simply not draw partially visible text that would require clipping rectangles.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 drawColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b drawColumn: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b drawColumn \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Instructs the MiscTableScroll object to redraw all the cells in column \i col \i0 . This method will lock focus on the view if needed.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -drawCellAtRow:column: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 drawColumnTitle:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b drawColumnTitle: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b drawColumnTitle \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Draws the title for column \i col \i0 . This method will lock focus on the view if needed. You should never need to call this method in normal use, though it might be useful for subclasses.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \pard\tx8260\li1500\fc0\cf0 \ \fs28 drawRow:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b drawRow: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b drawRow \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Instructs the MiscTableScroll object to redraw all the cells in row \i row \i0 . This method will lock focus on the view if needed.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -drawCellAtRow:column: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 drawRowTitle:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b drawRowTitle: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b drawRowTitle \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Draws the title for row \i row \i0 . This method will lock focus on the view if needed. You should never need to call this method in normal use, though it might be useful for subclasses.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 edit:atRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b edit: \b0 (NSEvent*) \i event \b\i0 atRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b editAtLocation \b0 (NSEvent \i event \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posts \f4\fs24 MiscTableScrollWillEditNotification \f3\fs28 to the default notificiation center and then initiates editing at \i row, col \i0 . It is valid to specify NULL for \i event \i0 when editing needs to be invoked for a non-mouse-down event. If \i event \i0 is non-NULL then it should be the mouse-down event which initiates editing.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 editCellAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b editCellAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b editCellAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Clears the selection, then selects the row (or column, if tracking by columns) of the cell, and invokes: \f4\fs24 -edit:0 atRow: \i row column \i0 : \i co \f3\fs28 l \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -selectsByRows \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 editIfAble:atRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b editIfAble: \b0 (NSEvent*) \i event \b\i0 atRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b editIfAbleAtLocation \b0 (NSEvent \i event \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 -canEdit:atRow:column: \f3\fs28 , and then calls \f4\fs24 -edit:atRow:column: \f3\fs28 if YES was returned. Returns YES if editing was initiated, and NO if not. \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 empty\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b empty \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b empty \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Resets the number of rows in the MiscTableScroll to zero. Does not deallocate the rows, nor does it affect the number of columns. The rows are retained in the cache for future use. See \b Usage Tips \b0 in the introduction for more details.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -addRow, -border:removeSlot:, -removeRow:, -emptyAndReleaseCells, -renewRows: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 emptyAndReleaseCells\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b emptyAndReleaseCells \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b emptyAndReleaseCells \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Resets the number of rows in the MiscTableScroll to zero; releases all cells stored in the cache, and deallocates all cache resources. Does not affect the number of columns.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -addRow, -border:removeSlot:, -removeRow:, -empty, -renewRows: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 enableCursor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b enableCursor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b enableCursor \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Re-enables display of the keyboard cursor after a call to \f4\fs24 -disableCursor \f3\fs28 . Calls to this method should be made to balance previous calls to \f4\fs24 -disableCursor \f3\fs28 . The keyboard cursor is a dashed rectangle drawn around a row or column indicating which slot keyboard actions will affect. See the discussion of \b Keyboard Operations \b0 at the beginning of this document for further information.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 disableCursor, isCursorEnabled \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 finishEditing\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b finishEditing \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b finishEditing \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If cell editing is in progress, then this method attempts to finish it. This method invokes the normal edit termination routines, and the \f4\fs24 -control:textShouldEndEditing: \f3\fs28 validation method gets an opportunity to veto the new value. Returns YES if no cell editing was in progress to start with, or if the editing session terminated successfully. Returns NO if the new cell value was rejected.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 firstVisibleColumn\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b firstVisibleColumn \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b firstVisibleColumn \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -firstVisibleSlot:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 firstVisibleRow\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b firstVisibleRow \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b firstVisibleRow \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -firstVisibleSlot:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 firstVisibleSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b firstVisibleSlot: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b firstVisibleSlot \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the physical coordinate of the first fully visible slot, if any. If there are two partially visible slots, it returns the physical coordinate of the \i last \i0 slot. If there is one partially visible slot, it returns the physical coordinate of that slot. If there are no slots (the MiscTableScroll is empty), it returns -1.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 floatValueAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b floatValueAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b floatValueAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the value of sending a \f4\fs24 -floatValue \f3\fs28 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f4\fs24 -tableScroll:floatValueAtRow:column: \f3\fs28 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f4\fs24 -tableScroll:doubleValueAtRow:column: \f3\fs28 message, then the cell is retrieved via \f4\fs24 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f4\fs24 -floatValue \f3\fs28 message, that value is returned; otherwise, zero is returned.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -isLazy, -setLazy:, -tableScroll:floatValueAtRow:column: \b0 (delegate method) \b \ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 font\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSFont*) \b font \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSFont \b font \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current font for the MiscTableScroll object. The current font is used to initialize new cells in the table.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 getIncrementalSearchColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b getIncrementalSearchColumn: \b0 (int*) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method is responsible for determining whether incremental searching should be enabled, and identifying the column on which the table is sorted. If the \i delegate \i0 responds to \f4\fs24 -tableScroll:getIncrementalSearchColumn: \f3\fs28 , then it is called, otherwise, the \i dataDelegate \i0 is tried. If neither object responds, the built-in \f4\fs24 -doGetIncrementalSearchColumn: \f3\fs28 method is called. Returns YES if incremental searching should be enabled, otherwise NO.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -doGetIncrementalSearchColumn:, -incrementalSearch:, -tableScroll:getIncrementalSearchColumn: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 getNext:editRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b getNext: \b0 (BOOL) \i forward \b\i0 editRow: \b0 (int*) \i row \b\i0 column: \b0 (int*) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 TableScroll.Location \b nextEditLocation \b0 (boolean \i forward \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 When \i forward \i0 is YES, this method returns the coordinates of the next cell that is editable as determined by \f4\fs24 -canEdit:atRow:column: \f3\fs28 . When \i forward \i0 is NO, this method returns the coordinates of the nearest previous cell that is editable. The search order is based on the visual order of slots in the MiscTableScroll. Normally this method is used by assigning the physical coordinates of the cell that is currently being edited to \i row \i0 and \i col \i0 . The method then searches for the next/previous cell that is editable and updates the values of \i row \i0 and \i col \i0 to the coordinates of the next/previous editable cell. This method is used in the \f4\fs24 -textDidEndEditing: \f3\fs28 method to find the next / previous cell when the user presses TAB / SHIFT-TAB to terminate cell editing. \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 For Objective-C, returns YES if a new editable cell was found. Returns NO if there are no other editable cells. For Java, returns a TableScroll.Location if a new editable cell was found. Returns null if there are no other editable cells. TableScroll.Location is a simple class which contains public \i row \i0 and \i column \i0 members.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 getNextEditRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b getNextEditRow: \b0 (int*) \i row \b\i0 column: \b0 (int*) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 TableScroll.Location \b nextEditLocation \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -getNext:YES editRow:row column:col \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 getPreviousEditRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b getPreviousEditRow: \b0 (int*) \i row \b\i0 column: \b0 (int*) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 TableScroll.Location \b previousEditLocation \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -getNext:NO editRow:row column:col \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 getRow:column:forPoint:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b getRow: \b0 (int*) \i row \b\i0 column: \b0 (int*) \i col \b\i0 forPoint: \b0 (NSPoint) \i point \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 TableScroll.Location \b locationForPoint \b0 (NSPoint \i point \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calculates the physical slot row and column coordinates for a \i point \i0 , which must be in the coordinate system of the receiving MiscTableScroll object.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 For Objective-C, if \i point \i0 is outside and left of the MiscTableScroll, or there are no columns, then \i col \i0 is set to -1. If \i point \i0 is outside and right of the MiscTableScroll, \i col \i0 is set to the last valid column index. Out of range values are handled similarly for \i row \i0 . Returns YES unless \i point \i0 was out of bounds, in which case NO is returned.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 For Java, returns a TableScroll.Location containing the \i row \i0 and \i column \i0 of the cell underneath \i point \i0 unless it is out of bounds, in which case null is returned.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 getRow:column:ofCell:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b getRow: \b0 (int*) \i row \i0 \b column: \b0 (int*) \i col \b\i0 ofCell: \b0 (NSCell*) \i cell \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 TableScroll.Location \b locationOfCell \b0 (NSCell \i cell \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Finds the location of \i cell \i0 in the MiscTableScroll object. For Objective-C, if \i cell \i0 is found, \i row \i0 and \i col \i0 are set to the coordinates of the cell in the table and the method returns YES. If \i cell \i0 is not found, \i row \i0 and \i col \i0 are set to -1, and the method returns NO. For Java, returns a TableScroll.Location if \i cell \i0 is found. If \i cell \i0 is not found, the method returns null. TableScroll.Location is a simple class which contains public \i row \i0 and \i column \i0 members.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 getRow:column:ofCellWithRepresentedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b getRow: \b0 (int*) \i row \i0 \b column: \b0 (int*) \i col \b\i0 ofCellWithRepresentedObject: \b0 (id) \i object \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 TableScroll.Location \b locationOfCellWithRepresentedObject \b0 (Object \i object \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 For Objective-C, assigns the coordinates to \i row \i0 and \i col \i0 of the first cell in the table with a represented object which equals \i object \i0 and returns YES. If no cell in the table has represented object equal to \i object \i0 , \i row \i0 and \i col \i0 are set to -1, and NO is returned. For Java, returns a TableScroll.Location containing the \i row \i0 and \i column \i0 of the first cell in the table with a represented object which equals \i object \i0 . If no cell in the table has an equal represented object, returns nil. Equality between \i object \i0 and each cell's represented object is tested with \f4\fs24 -isEqual: \f3\fs28 . See \b Represented Objects \b0 in the introduction for more details.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 getRow:column:ofCellWithTag: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 getRow:column:ofCellWithTag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b getRow: \b0 (int*) \i row \i0 \b column: \b0 (int*) \i col \b\i0 ofCellWithTag: \b0 (int) \i tag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 TableScroll.Location \b locationOfCellWithTag \b0 (int \i tag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 For Objective-C, assigns the coordinates to \i row \i0 and \i col \i0 of the first cell in the table with tag \i tag \i0 and returns YES. If no cell in the table has tag \i tag \i0 , \i row \i0 and \i col \i0 are set to -1, and NO is returned. For Java, returns a TableScroll.Location containing the \i row \i0 and \i column \i0 of the first cell in the table with tag \i tag \i0 . If no cell in the table has tag \i tag \i0 , returns null.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 getRow:column:ofCellWithRepresentedObject: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 hasColumnSelection\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b hasColumnSelection \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b hasColumnSelection \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if any columns are selected, otherwise NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 hasMultipleColumnSelection\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b hasMultipleColumnSelection \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b hasMultipleColumnSelection \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if more than one column is selected, otherwise NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 hasMultipleRowSelection\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b hasMultipleRowSelection \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b hasMultipleRowSelection \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if more than one row is selected, otherwise NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 hasMultipleSlotSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b hasMultipleSlotSelection: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b hasMultipleSlotSelection \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if more than one slot is selected, otherwise NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 hasRowSelection\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b hasRowSelection \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b hasRowSelection \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if any rows are selected, otherwise NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 hasSlotSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b hasSlotSelection: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b hasSlotSelection \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if at least one slot is selected, otherwise NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 hasValidCursorColumn\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b hasValidCursorColumn \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b hasValidCursorColumn \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the column keyboard cursor has a valid position in the body of the table, otherwise NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 hasValidCursorRow\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b hasValidCursorRow \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b hasValidCursorRow \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the row keyboard cursor has a valid position in the body of the table, otherwise NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 hasValidCursorSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b hasValidCursorSlot: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b hasValidCursorSlot: \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the keyboard cursor is positioned on a valid slot, otherwise NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 incrementalSearch:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b incrementalSearch: \b0 (NSEvent*) \i event \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b incrementalSearch \b0 (NSEvent \i event \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Invokes incremental searching if \i event \i0 is an appropriate keyboard event to start incremental search, and if \f4\fs24 -getIncrementalSearchColumn: \f3\fs28 determines that incremental searching should be enabled. Returns YES if incremental searching was invoked (and \i event \i0 was processed), otherwise returns NO. This method should be called from within a \f4\fs24 -keyDown: \f3\fs28 method.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -doIncrementalSearch:col, -getIncrementalSearchColumn:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 initWithFrame:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b initWithFrame: \b0 (NSRect) \i frameRect \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\b\fi-620\li2520\fc0\cf0 TableScroll \b0 (NSRect \i frameRect \i0 ) \fs24 [Java constructor] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Initializes a newly allocated MiscTableScroll object. This is the designated initializer for this class. The newly allocated object will have the following properties set by default: \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 insertColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b insertColumn: \b0 (int) \i pos \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b insertColumn \b0 (int \i pos \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Inserts a new column at position \i pos \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER insertSlot: \i pos \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \pard\tx8260\li1500\fc0\cf0 \ \fs28 insertRow:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b insertRow: \b0 (int) \i pos \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b insertRow \b0 (int \i pos \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Inserts a new row at position \i pos \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER insertSlot: \i pos \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 intValueAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b intValueAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b intValueAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the value of sending a \f4\fs24 -intValue \f3\fs28 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f4\fs24 -tableScroll:intValueAtRow:column: \f3\fs28 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f4\fs24 -tableScroll:doubleValueAtRow:column: \f3\fs28 message, then the cell is retrieved via \f4\fs24 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f4\fs24 -intValue \f3\fs28 message, that value is returned; otherwise, zero is returned.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -isLazy, -setLazy:, -tableScroll:intValueAtRow:column: \b0 (delegate method) \b \ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 isCursorEnabled\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b isCursorEnabled \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b isCursorEnabled \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether cursor display is enabled or disabled. See the discussion of \b Keyboard Operations \b0 at the beginning of this document for further information.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 disableCursor, enableCursor \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 isEditing\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b isEditing \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b isEditing \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if a cell editing session is in progress.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 isEnabled\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b isEnabled \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b isEnabled \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not the MiscTableScroll object is enabled for user interaction.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 isLazy\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b isLazy \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b isLazy \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not the MiscTableScroll object is using \i lazy-mode \i0 memory management.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 isTrackingMouse\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b isTrackingMouse \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b isTrackingMouse \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the mouse is currently being tracked by a cell, else NO. Technically, this method returns YES after the cell which will track the mouse has been highlighted, and NO after it has been unhighlighted. The cell which is tracking the mouse can be accessed via \f4\fs24 -clickedCell \f3\fs28 , \f4\fs24 -clickedColumn \f3\fs28 , or \f4\fs24 -clickedRow \f3\fs28 . Although setting a Cell's \i highlight \i0 flag is sufficient during mouse tracking in eager-mode, it is not sufficient in lazy-mode. Therefore MiscTableScroll uses this method in lazy-mode to determine when a cell should be drawn highlighted. You should rarely need to call this method, though it might be useful in subclasses.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 clickedCell, clickedColumn, clickedRow, clickedSlot: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 lastVisibleColumn\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b lastVisibleColumn \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b lastVisibleColumn \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -lastVisibleSlot:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 lastVisibleRow\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b lastVisibleRow \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b lastVisibleRow \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -lastVisibleSlot:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 lastVisibleSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b lastVisibleSlot: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b lastVisibleSlot \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the physical coordinate of the last fully visible slot, if any. If there are two partially visible slots, it returns the physical coordinate of the \i first \i0 slot. If there is one partially visible slot, it returns the physical coordinate of that slot. If there are no visible slots (the MiscTableScroll is empty), it returns -1.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 makeCellsPerformSelector:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b makeCellsPerformSelector: \b0 (SEL) \i aSel \i0\fs24 [Objective-C] \fs28 \ int \b makeCellsPerformSelector \b0 (NSSelector \i aSel \i0 ) \fs24 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 [self makeCellsPerformSelector: \i aSel \i0 selectedOnly:NO] \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 makeCellsPerformSelector:selectedOnly:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b makeCellsPerformSelector: \b0 (SEL) \i aSel \i0 \b selectedOnly: \b0 (BOOL) \i selectedOnly \i0\fs24 [Objective-C] \fs28 \ int \b makeCellsPerformSelector \b0 (NSSelector \i aSel \i0 , boolean \i selectedOnly \i0 ) \fs24 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 [self makeCellsPerformSelector: \i aSel \i0 with:0 with:0 selectedOnly: \i flag \i0 ] \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 makeCellsPerformSelector:with:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b makeCellsPerformSelector: \b0 (SEL) \i aSel \i0 \b with: \b0 (id) \i arg1 \i0\fs24 [Objective-C] \fs28 \ int \b makeCellsPerformSelector \b0 (NSSelector \i aSel \i0 , Object \i arg1 \i0 ) \fs24 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 [self makeCellsPerformSelector: \i aSel \i0 with: \i arg1 \i0 selectedOnly:NO] \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 makeCellsPerformSelector:with:selectedOnly:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b makeCellsPerformSelector: \b0 (SEL) \i aSel \i0 \b with: \b0 (id) \i arg1 \i0 \b selectedOnly: \b0 (BOOL) \i selectedOnly \i0\fs24 [Objective-C] \fs28 \ int \b makeCellsPerformSelector \b0 (NSSelector \i aSel \i0 , Object \i arg1 \i0 , boolean \i selectedOnly \i0 ) \fs24 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 [self makeCellsPerformSelector: \i aSel \i0 with: \i arg1 \i0 with:0 selectedOnly: \i flag \i0 ] \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 makeCellsPerformSelector:with:with:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b makeCellsPerformSelector: \b0 (SEL) \i aSel \i0 \b with: \b0 (id) \i arg1 \i0 \b with: \b0 (id) \i arg2 \i0\fs24 [Objective-C] \fs28 \ int \b makeCellsPerformSelector \b0 (NSSelector \i aSel \i0 , Object \i arg1 \i0 , Object \i arg2 \i0 ) \fs24 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 [self makeCellsPerformSelector: \i aSel \i0 with: \i arg1 \i0 with: \i arg2 \i0 selectedOnly:NO] \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 makeCellsPerformSelector:with:with:selectedOnly:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b makeCellsPerformSelector: \b0 (SEL) \i aSel \i0 \b with: \b0 (id) \i arg1 \i0 \b with: \b0 (id) \i arg2 \i0 \b selectedOnly: \b0 (BOOL) \i selectedOnly \i0\fs24 [Objective-C] \fs28 \ int \b makeCellsPerformSelector \b0 (NSSelector \i aSel \i0 , Object \i arg1 \i0 , Object \i arg2 \i0 , boolean \i selectedOnly \i0 ) \fs24 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sends the message \i aSel \i0 to the cells in the table. When \i selectedOnly \i0 is YES, the message is sent only to selected cells. When \i selectedOnly \i0 is NO, the message is sent to all cells. First the cell is tested with \f4\fs24 -respondsToSelector: \i aSel \f3\i0\fs28 . If the cell responds to the message, then the message is sent. Then the return value from the call is inspected. If the cell returns any non-zero value, the process continues. The first cell that returns 0 stops the process. The process also terminates when all cells have been processed. This method returns the number of cells that returned non-zero values. \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 maxUniformSizeColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b maxUniformSizeColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b maxUniformSizeColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -maxUniformSizeSlots:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 maxUniformSizeRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b maxUniformSizeRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b maxUniformSizeRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -maxUniformSizeSlots:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 maxUniformSizeSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b maxUniformSizeSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b maxUniformSizeSlots \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current upper bound for user-sizing of uniform-sized border, \i border \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 minUniformSizeColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b minUniformSizeColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b minUniformSizeColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -minUniformSizeSlots:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 minUniformSizeRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b minUniformSizeRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b minUniformSizeRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -minUniformSizeSlots:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 minUniformSizeSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b minUniformSizeSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b minUniformSizeSlots: \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current lower bound for user-sizing of uniform-sized border, \i border \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 modifierDragColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b modifierDragColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b modifierDragColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not the command-key must be held down to drag columns. It is NO by default. Equivalent to: \f4\fs24 -modifierDragSlots:MISC_COL_BORDER \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setModifierDragSlots:,-modifierDragSlots: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 modifierDragRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b modifierDragRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b modifierDragRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not the command-key must be held down to drag rows. It is YES by default. Equivalent to: \f4\fs24 -modifierDragSlots:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setModifierDragSlots:,-modifierDragSlots: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 modifierDragSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b modifierDragSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b modifierDragSlots \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not the command-key must be held down to drag the slots on this border.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 moveColumn:toColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b moveColumn: \b0 (int) \i from_pos \i0 \b toColumn: \b0 (int) \i to_pos \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b moveColumnToColumn \b0 (int \i from_pos \i0 , int \i to_pos \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Moves the column at visual position \i from_pos \i0 to visual position \i to_pos \i0 . Equivalent to \f4\fs24 -border:MISC_COL_BORDER moveSlot: \i from_pos \i0 toSlot: \i to_pos \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 moveRow:toRow:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b moveRow: \b0 (int) \i from_pos \i0 \b toRow: \b0 (int) \i to_pos \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b moveRowToRow \b0 (int \i from_pos \i0 , int \i to_pos \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Moves the row at visual position \i from_pos \i0 to visual position \i to_pos \i0 . Equivalent to \f4\fs24 -border:MISC_ROW_BORDER moveSlot: \i from_pos \i0 toSlot: \i to_pos \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 numberOfColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b numberOfColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b numberOfColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the number of columns in the MiscTableScroll object. Equivalent to: \f4\fs24 -numberOfSlots:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 numberOfRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b numberOfRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b numberOfRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the number of rows in the MiscTableScroll object. This is the number of \i active \i0 rows currently being displayed. The MiscTableScroll object performs caching on a row-oriented basis. There may be additional rows allocated, and stored in the cache. Equivalent to: \f4\fs24 -numberOfSlots:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 numberOfSelectedColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b numberOfSelectedColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b numberOfSelectedColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the number of selected columns.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 numberOfSelectedRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b numberOfSelectedRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b numberOfSelectedRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the number of selected rows.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 numberOfSelectedSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b numberOfSelectedSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b numberOfSelectedSlots \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the number of slots that are selected.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 numberOfSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b numberOfSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b numberOfSlots \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the number of slots for the border \i border \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -addSlot:, -border:removeSlot:, -border:insertSlot:, -numberOfColumns, -numberOfRows \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 numberOfVisibleColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b numberOfVisibleColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b numberOfVisibleColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the number of columns visible in the scrolling display. A column is visible if any part of the column (even a single pixel) appears in the scrolling display. Equivalent to: \f4\fs24 -numberOfVisibleSlots:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 numberOfVisibleRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b numberOfVisibleRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b numberOfVisibleRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the number of rows visible in the scrolling display. A row is visible if any part of the row (even a single pixel) appears in the scrolling display. Equivalent to: \f4\fs24 -numberOfVisibleSlots:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 numberOfVisibleSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b numberOfVisibleSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b numberOfVisibleSlots \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the number of slots visible in the scrolling display. A slot is visible if any part of the slot (even a single pixel) appears in the scrolling display.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 print:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b print: \b0 (id) \i sender \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b print \b0 (Object \i sender \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Prints the MiscTableScroll object, including row and column titles if they are turned on. This method posts \f4\fs24 MiscTableScrollWillPrintNotification \f3\fs28 and \f4\fs24 MiscTableScrollDidPrintNotification \f3\fs28 to the default notification center to bracket the actual printing. You can implement the corresponding delegate methods to perform special operations before and after printing.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 readSelectionFromPasteboard:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b readSelectionFromPasteboard: \b0 (NSPasteboard*) \i pboard \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b readSelectionFromPasteboard \b0 (NSPasteboard \i pboard \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method is invoked when a service returns some data. If the \i delegate \i0 responds to the \f4\fs24 -tableScroll:readSelectionFromPasteboard: \f3\fs28 message, it is sent to the \i delegate \i0 . If not, then the \i dataDelegate \i0 is given the opportunity. If neither responds to the message, \f4\fs24 -builtinReadSelectionFromPasteboard: \f3\fs28 is called. Returns the results of the subroutine that was called. Override this method in your subclass if you need different behavior.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -builtinReadSelectionFromPasteboard:, -tableScroll:readSelectionFromPasteboard: \b0 (delegate method) \b , -readSelectionFromPasteboard: \b0 (NSServicesRequests) \b , -writeSelectionToPasteboard:types: \b0 (NSServicesRequests) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 registerServicesTypes\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b registerServicesTypes \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b registerServicesTypes \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If the \i delegate \i0 responds to the \f4\fs24 -tableScrollRegisterServicesTypes: \f3\fs28 message, the message is sent to the \i delegate \i0 . If not, the \i dataDelegate \i0 is tried. If neither responds to the message, \f4\fs24 -builtinRegisterServicesTypes \f3\fs28 is called. This method is invoked when an instance of MiscTableScroll object is initialized. Override this method in your subclass if you need different behavior.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -builtinRegisterServicesTypes, -tableScrollRegisterServicesTypes: \b0 (delegate method) \f0\b \f3\b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 removeColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b removeColumn: \b0 (int) \i n \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b removeColumn \b0 (int \i n \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Deletes column \i n \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER removeSlot: \i n \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 removeRow:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b removeRow: \b0 (int) \i n \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b removeRow \b0 (int \i n \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Deletes row \i n \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER removeSlot: \i n \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 renewRows:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b renewRows: \b0 (int) \i count \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b renewRows \b0 (int \i count \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the number of active rows in the MiscTableScroll object to \i count \i0 ; does not affect the number of columns. This is the fastest way to change the size of a MiscTableScroll object when you know the number of rows in advance. See \b Usage Tips \b0 in the introduction for more details.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -addRow, -addSlot:, -border:removeSlot:, -border:insertSlot:, -removeRow:, -empty, -emptyAndReleaseCells, -insertRow: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 representedObject\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b representedObject \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b representedObject \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the represented object of the MiscTableScroll.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotRepresentedObject:, -columnRepresentedObject:, -rowRepresentedObject:, -setRepresentedObject:, -tag \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 resumeEditing:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b resumeEditing \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b resumeEditing \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Resumes a cell editing session that was suspended by \f4\fs24 -suspendEditing \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 retireCell:atRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b retireCell: \b0 (id) \i cell \i0 \b atRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b retireCellAtLocation \b0 (NSCell \i cell \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Internal method called whenever a cell is being removed from active use. The method must return \i cell \i0 , or a suitable replacement object to place in the cache. This method provides an opportunity to substitute a different object for \i cell \i0 before it is placed in the cache. This method also provides an opportunity to reclaim storage when a cell is no longer active. If the \i delegate \i0 responds to the \f4\fs24 -tableScroll:retireCell:atRow:column: \f3\fs28 message, it is sent to the \i delegate \i0 . If not, the \i dataDelegate \i0 is tried. If the \i dataDelegate \i0 also does not respond to the message, the cell itself is checked. If none of these objects responds to the message, a built-in default method, \f4\fs24 -doRetireCell:atRow:column: \f3\fs28 is called. Override this method in your subclass if you need different behavior.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -doRetireCell:atRow:column:, -tableScroll:retireCell:atRow:column: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 reviveCell:atRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b reviveCell: \b0 (id) \i cell \i0 \b atRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b reviveCellAtLocation \b0 (NSCell \i cell \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Internal method called whenever a cell is is being moved into active use. This method is applied to both newly created cells returned by the \f4\fs24 -copyWithZone: \f3\fs28 method of the column's cell prototype and cells retrieved from the cache. If the \i delegate \i0 responds to the \f4\fs24 -tableScroll:reviveCell:atRow:column: \f3\fs28 message, it is sent to the \i delegate \i0 . If not, the \i dataDelegate \i0 is checked. If neither the \i delegate \i0 nor the \i dataDelegate \i0 respond to the message, the cell itself is checked. If none of these objects respond to the message, a built-in default method \f4\fs24 -doReviveCell:atRow:column: \f3\fs28 is called. Override this method in your subclass if you need different behavior.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -doReviveCell:atRow:column:, -tableScroll:reviveCell:atRow:column: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowAdjustedSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b rowAdjustedSize: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b rowAdjustedSize \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current display height of \i row \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotAdjustedSize: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowAtPosition:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b rowAtPosition: \b0 (int) \i pos \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b rowAtPosition \b0 (int \i pos \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the original \i physical \i0 position of the row at the current \i visual \i0 position \i pos \i0 . This is the visual-to-physical conversion routine. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotAtPosition: \i pos \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowCellPrototype:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b rowCellPrototype: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b rowCellPrototype \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the cell prototype for row \i row \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotCellPrototype: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowCellType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscTableCellStyle) \b rowCellType: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b rowCellType \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the cell type for row \i row \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotCellType: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowIsAutosize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b rowIsAutosize: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b rowIsAutosize \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the state of the \i autosize \i0 flag for row \i row \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotIsAutosize: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowIsSelected:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b rowIsSelected: \b0 (MiscCoord_P) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b rowIsSelected \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if \i row \i0 is selected, otherwise NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowIsSizeable:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b rowIsSizeable: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b rowIsSizeable \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the state of the \i user-sizeable \i0 flag for row \i row \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotIsSizeable: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowIsSorted:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b rowIsSorted: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b rowIsSorted \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if \i row \i0 is sorted relative to its neighboring rows. Returns NO otherwise. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotIsSorted: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowIsVisible:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b rowIsVisible: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b rowIsVisible \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if any part of \i row \i0 is visible in the scrolling display. Returns NO otherwise. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotIsVisible: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowMaxSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b rowMaxSize: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b rowMaxSize \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the maximum size for row \i row \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotMaxSize: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowMinSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b rowMinSize: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b rowMinSize \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the minimum size for row \i row \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotMinSize: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowOrder\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b rowOrder \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b rowOrder \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: - \f4\fs24 slotOrder:MISC_ROW_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowOrderAsString\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b rowOrderAsString \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b rowOrderAsString \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -slotOrderAsString:MISC_ROW_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowPosition:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b rowPosition: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b rowPosition \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current \i visual \i0 position of the row whose original \i physical \i0 position is \i row \i0 . This is the physical-to-visual conversion routine. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotPosition: \f3\i\fs28 row \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowRepresentedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b rowRepresentedObject: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b rowRepresentedObject \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the represented object for row \i row \i0 . See \b Represented Objects \b0 in the introduction for more details. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotRepresentedObject: \i row \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -rowTag: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowsAreSorted\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b rowsAreSorted \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b rowsAreSorted \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if all rows are sorted. Equivalent to \f4\fs24 -slotsAreSorted:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b rowSize: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b rowSize \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the target size for row \i row \i0 . For the actual current display size, use \b -rowAdjustedSize: \b0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotSize: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowSizes\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b rowSizes \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b rowSizes \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -slotSizes:MISC_ROW_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowSizesAsString\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b rowSizesAsString \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b rowSizesAsString \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -slotSizesAsString:MISC_ROW_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowSortDirection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscSortDirection) \b rowSortDirection: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b rowSortDirection \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotSortDirection: \f3\i\fs28 row \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowSortFunction:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCompareEntryFunc) \b rowSortFunction \b0 :(int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotSortFunction: \f3\i\fs28 row \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowSortType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscSortType) \b rowSortType: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b rowSortType \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotSortType: \f3\i\fs28 row \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowSortVector\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b rowSortVector \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b rowSortVector \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -slotSortVector:MISC_ROW_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowTag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b rowTag: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b rowTag \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the tag for row \i row \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotTag: \i row \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -rowRepresentedObject: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowTitle:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b rowTitle: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b rowTitle \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the title for row \i row \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotTitle: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowTitleMode\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscTableTitleMode) \b rowTitleMode \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b rowTitleMode \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the title-mode for row \i row \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotTitleMode: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowTitlesOn\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b rowTitlesOn \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b rowTitlesOn \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not row titles are displayed. Equivalent to: \f4\fs24 -slotTitlesOn:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowTitlesWidth\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b rowTitlesWidth \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b rowTitlesWidth \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -slotTitlesSize:MISC_ROW_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowWithRepresentedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b rowWithRepresentedObject: \b0 (id) \i object \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b rowWithRepresentedObject \b0 (Object \i object \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the index of the first row with a represented object equal to \i object \i0 , or -1 if no match is found. Equality between \i object \i0 and each row's represented object is tested with \f4\fs24 -isEqual: \f3\fs28 . See \b Represented Objects \b0 in the introduction for more details. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotWithRepresentedObject: \i object \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -rowWithTag: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 rowWithTag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b rowWithTag: \b0 (int) \i tag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b rowWithTag \b0 (int \i tag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the index of the first row with tag \i tag \i0 , or -1 if no row has tag \i tag \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER slotWithTag: \i tag \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -rowWithRepresentedObject: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 scrollCellToVisibleAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b scrollCellToVisibleAtRow: \b0 (int) \i row \i0 \b column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b scrollCellToVisibleAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Scrolls the display as necessary until the cell at position \i row \i0 , \i col \i0 is visible.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 scrollColumnToVisible:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b scrollColumnToVisible: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b scrollColumnToVisible \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Scrolls the display as necessary until \i col \i0 is visible.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 scrollRowToVisible:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b scrollRowToVisible: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b scrollRowToVisible \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Scrolls the display as necessary until \i row \i0 is visible.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 scrollSelectionToVisible\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b scrollSelectionToVisible \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b scrollSelectionToVisible \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Scrolls the display as necessary until the selection is visible.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectAll:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectAll: \b0 (id) \i sender \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectAll \b0 (Object \i sender \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 [self selectAllRows] \f3\fs28 followed by \f4\fs24 [self sendActionIfEnabled] \f3\fs28 . \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectAllColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectAllColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectAllColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectAllSlots:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectAllRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectAllRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectAllRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectAllSlots:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectAllSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectAllSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectAllSlots \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Selects all the slots in \i border \i0 . Does not send the action to the target.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -selectAll: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectColumn:byExtendingSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectColumn: \b0 (MiscCoord_P) \i col \i0 \b byExtendingSelection: \b0 (BOOL) \i extendSelection \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectColumn \b0 (int \i col \i0 , boolean \i extendSelection \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER selectSlot: \i col \i0 byExtendingSelection \i : \f3\fs28 extendSelection \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectColumn: \b0 (MiscCoord_P) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectColumn \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectColumn: \i col \i0 byExtendingSelection:NO \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectColumns:byExtendingSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectColumns: \b0 (NSArray*) \i cols \i0 \b byExtendingSelection: \b0 (BOOL) \i extendSelection \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectColumns \b0 (NSArray \i cols \i0 , \i extendSelection \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER selectSlots: \f3\i\fs28 cols \f4\i0\fs24 byExtendingSelection: \f3\i\fs28 extendSelection \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectColumns:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectColumns: \b0 (NSArray*) \i cols \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectColumns \b0 (NSArray \i cols \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectColumns: \f3\i\fs28 cols \f4\i0\fs24 byExtendingSelection:NO \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectColumnsWithTags:byExtendingSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectColumnsWithTags: \b0 (NSArray*) \i tags \i0 \b byExtendingSelection: \b0 (BOOL) \i extendSelection \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectColumnsWithTags \b0 (NSArray \i tags \i0 , boolean \i extendSelection \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER selectSlotsWithTags: \i tags \i0 byExtendingSelection: \f3\i\fs28 extendSelection \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectColumnsWithTags:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectColumnsWithTags: \b0 (NSArray*) \i tags \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectColumnsWithTags \b0 (NSArray \i tags \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectColumnsWithTags: \i tags \i0 byExtendingSelection:NO \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedBackgroundColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSColor*) \b selectedBackgroundColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSColor \b selectedBackgroundColor \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current selectedBackgroundColor.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedCell\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b selectedCell \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b selectedCell \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the cell at the intersection of \f4\fs24 -selectedColumn \f3\fs28 and \f4\fs24 -selectedRow \f3\fs28 or nil if there is no selected cell. This method really only has meaning in eager-mode, though it can be used in lazy-mode as well.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedColumn\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCoord_P) \b selectedColumn \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b selectedColumn \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectedSlot:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b selectedColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b selectedColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectedSlots:MISC_COL_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedColumnTags\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b selectedColumnTags \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b selectedColumnTags \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectedSlotTags:MISC_COL_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedRow\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCoord_P) \b selectedRow \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b selectedRow \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectedSlot:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b selectedRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b selectedRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectedSlots:MISC_ROW_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedRowTags\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b selectedRowTags \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b selectedRowTags \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectedSlotTags:MISC_ROW_BORDER. \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedSlot:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscCoord_P) \b selectedSlot: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b selectedSlot \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the index of the currently selected slot, or -1 if no slots are selected.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b selectedSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b selectedSlots \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns an array of indexes of all currently selected slots. Each element in the returned array is an NSNumber in Objective-C, and a java.lang.Integer in Java.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedSlotTags:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b selectedSlotTags: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b selectedSlotTags \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns an array of tags of all currently selected slots. Each element in the returned array is an NSNumber in Objective-C, and a java.lang.Integer in Java. This method is useful in conjunction with \f4\fs24 -border:selectSlotsWithTags: \f3\fs28 to save and restore the user's selection when you have tags that uniquely identify the slots.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectedTextColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSColor*) \b selectedTextColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSColor \b selectedTextColor \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current selectedTextColor.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectionChanged\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectionChanged \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectionChanged \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Invalidates those portions of the display which need to be redrawn in order to reflect the current selection. When the selection is modified programmatically or via user-interaction this method is called automatically to reflect the new selection. You need never call this method directly, but subclasses may want to override it.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectionMode\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscSelectionMode) \b selectionMode \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b selectionMode \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current setting of the selection mode.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectRow:byExtendingSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectRow: \b0 (MiscCoord_P) \i row \i0 \b byExtendingSelection: \b0 (BOOL) \i extendSelection \i0\fs24 [Objective-C] \fs28 \ void \b selectRow \b0 (int \i row \i0 , boolean \i extendSelection \i0 ) \fs24 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER selectSlot: \i row \i0 byExtendingSelection: \f3\i\fs28 extendSelection \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectRow:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectRow: \b0 (MiscCoord_P) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectRow \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectRow: \i row \i0 byExtendingSelection:NO \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectRows:byExtendingSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectRows: \b0 (NSArray*) \i rows \i0 \b byExtendingSelection: \b0 (BOOL) \i extendSelection \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectRows \b0 (NSArray \i rows \i0 , boolean \i extendSelection \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER selectSlots: \f3\i\fs28 rows \f4\i0\fs24 byExtendingSelection: \f3\i\fs28 extendSelection \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectRows:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectRows: \b0 (NSArray*) \i rows \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectRows \b0 (NSArray \i rows \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectRows: \f3\i\fs28 rows \f4\i0\fs24 byExtendingSelection:NO \f3\fs28 . \fs24 \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 border:selectSlots:, selectColumns:, selectRows:byExtendingSelection: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectRowsWithTags:byExtendingSelection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectRowsWithTags: \b0 (NSArray*) \i tags \i0 \b byExtendingSelection: \b0 (BOOL) \i extendSelection \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectRowsWithTags \b0 (NSArray \i tags \i0 , boolean \i extendSelection \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER selectSlotsWithTags: \i tags \i0 byExtendingSelection: \f3\i\fs28 extendSelection \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 border:selectSlotsWithTags:, selectColumnsWithTags:, selectRowsWithTags: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectRowsWithTags:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b selectRowsWithTags: \b0 (NSArray*) \i tags \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b selectRowsWithTags \b0 (NSArray \i tags \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -selectRowsWithTags: \i tags \i0 byExtendingSelection:NO \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 border:selectSlotsWithTags:, selectColumnsWithTags:, selectRowsWithTags:byExtendingSelection: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 selectsByRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b selectsByRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b selectsByRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the mouse is tracked for selection on a row-wise basis. Returns NO if the selection is on a column-wise basis.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 setSelectsByRows: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sendAction\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b sendAction \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b sendAction \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sends the \i action \i0 message to the \i target \i0 object. Implemented via \f4\fs24 -sendAction:to: \f3\fs28 . Returns \b \b0 YES if the action is successfully sent, otherwise returns NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sendAction:to:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b sendAction: \b0 (SEL) \i aSelector \i0 \b to: \b0 (id) \i anObject \i0\fs24 [Objective-C] \fs28 \ boolean \b sendActionToTarget \b0 (NSSelector \i aSelector, \i0 Object \i anObject \i0 ) \fs24 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Uses the NSApplication class's \f4\fs24 -sendAction:to:from: \f3\fs28 method to send the message \i aSelector \i0 to the object \i anObject \i0 from the MiscTableScroll object itself. Returns \b \b0 YES if the action is successfully sent, otherwise returns NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sendAction:to:forAllCells:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b sendAction: \b0 (SEL) \i aSelector \i0 \b to: \b0 (id) \i anObject \i0 \b forAllCells: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ void \b sendActionToTargetForAllCells \b0 (NSSelector \i aSelector \i0 , Object \i anObject, \i0 boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Iterates through all the cells in the table if flag is YES, or just the selected cells if flag is NO, sending \i aSelector \i0 to \i anObject \i0 for each. Iteration begins with the cell in the upper-left corner of the table, proceeding through the appropriate entries in the first row, then on to the next. \i aSelector \i0 must represent a method that takes a single argument, which is the \f4\fs24 id \f3\fs28 of the current cell in the iteration. \i aSelector \i0 's return value must be \f4\fs24 BOOL \f3\fs28 . If \i aSelector \i0 returns NO for any cell, the iteration terminates immediately, without sending the message to the remaining cells. If it returns YES, iteration continues with the next cell.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sendActionIfEnabled\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b sendActionIfEnabled \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b sendActionIfEnabled \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If \f4\fs24 [self isEnabled] \f3\fs28 returns YES then \f4\fs24 [self sendAction] \f3\fs28 is called. Returns \b \b0 YES if the action is successfully sent, otherwise returns NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sendDoubleAction\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b sendDoubleAction \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b sendDoubleAction \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sends the \i doubleAction \i0 message to the \i doubleTarget \i0 object. Returns \b \b0 YES if the action is successfully sent, otherwise returns NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sendDoubleActionIfEnabled\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b sendDoubleActionIfEnabled \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b sendDoubleActionIfEnabled \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If \f4\fs24 [self isEnabled] \f3\fs28 returns YES then \f4\fs24 [self sendDoubleAction] \f3\fs28 is called. Returns \b \b0 YES if the action is successfully sent, otherwise returns NO.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setAction:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setAction: \b0 (SEL) \i new_sel \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setAction \b0 (NSSelector \i new_sel \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the action method to \i new_sel \i0 . The action message is sent to the \i target \i0 upon a single mouse click. The argument of an action method is the table scroll.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setAutoSortColumns:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setAutoSortColumns: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setAutoSortColumns \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setAutoSortSlots: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setAutoSortRows:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setAutoSortRows: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setAutoSortRows \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setAutoSortSlots: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setBackgroundColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setBackgroundColor: \b0 (NSColor*) \i value \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setBackgroundColor \b0 (NSColor \i value \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \i backgroundColor \i0 . The \i backgroundColor \i0 is used to initialize new cells, and also to paint the background of areas that are not covered by cells of the table. By default, this is the value returned by \f4\fs24 +defaultBackgroundColor \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 +defaultBackgroundColor \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColor: \b0 (NSColor*) \i value \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColor \b0 (NSColor \i value \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -setBackgroundColor: \i value \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:autosize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b autosize: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnAutosize \b0 (int \i col \i0 , boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the autosize flag for column \i col \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 autosize: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:cellPrototype:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b cellPrototype: \b0 (id) \i cell \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnCellPrototype \b0 (int \i col \i0 , NSCell \i cell \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the cell prototype for column \i col \i0 to \i cell \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 cellPrototype: \i cell \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:cellType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b cellType: \b0 (MiscTableCellStyle) \i type \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnCellType \b0 (int \i col \i0 , int \i type \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the cell type for column \i col \i0 to \i type \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 cellType: \i type \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:maxSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b maxSize: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnMaxSize \b0 (int \i col \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the maximum size of column \i col \i0 to \i size \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 maxSize: \i size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:minSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b minSize: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnMinSize \b0 (int \i col \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the minimum size of column \i col \i0 to \i size \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 minSize: \i size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:representedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b representedObject: \b0 (id) \i object \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnRepresentedObject \b0 (int \i col \i0 , Object \i object \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the represented object for column \i col \i0 to \i object \i0 . Releases the old represented object if any and then retains \i object \i0 . See \b Represented Objects \b0 in the introduction for more details. Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 representedObject: \i object \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -setColumn:tag: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:size:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b size: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnSize \b0 (int \i col \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the target size of column \i col \i0 to \i size \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 size: \i size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:sizeable:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b sizeable: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnSizeable \b0 (int \i col \i0 , boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \i user-sizeable \i0 flag for column \i col \i0 to \i flag \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 sizeable: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:sortDirection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b sortDirection: \b0 (MiscSortDirection) \i dir \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnSortDirection \b0 (int \i col \i0 , int \i dir \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 sortDirection: \i dir \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:sortFunction:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b sortFunction \b0 :(MiscCompareEntryFunc) \i x \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 sortFunction: \i x \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:sortType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b sortType: \b0 (MiscSortType) \i type \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnSortType \b0 (int \i col \i0 , int \i type \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 sortType: \i type \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:tag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b tag: \b0 (int) \i tag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnTag \b0 (int \i col \i0 , int \i tag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the tag for column \i col \i0 to \i tag \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 tag: \i tag \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -setColumn:representedObject: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumn:title:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumn: \b0 (int) \i col \i0 \b title: \b0 (NSString*) \i title \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnTitle \b0 (int \i col \i0 , String \i title \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the title for column \i col \i0 to \i title \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlot: \i col \i0 title: \i title \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumnOrder:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b setColumnOrder: \b0 (NSArray*) \i list \i0\fs24 [Objective-C] \fs28 \ boolean \b setColumnOrder \b0 (NSArray \i list \i0 ) \fs24 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlotOrder: \i list \f3\i0\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumnOrderFromString:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b setColumnOrderFromString: \b0 (NSString*) \i s \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setColumnOrder \b0 (String \i s \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlotOrderFromString: \i s \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumnSizes:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b setColumnSizes: \b0 (NSArray*) \i list \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setColumnSizes \b0 (NSArray \i list \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlotSizes: \i list \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumnSizesFromString:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b setColumnSizesFromString: \b0 (NSString*) \i s \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setColumnSizes \b0 (String \i s \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlotSizesFromString:s \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumnSortVector:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumnSortVector: \b0 (NSArray*) \i v \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnSortVector \b0 (NSArray \i v \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlotSortVector: \i v \f3\i0\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumnTitleMode:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumnTitleMode: \b0 (MiscTableTitleMode) \i mode \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnTitleMode \b0 (int \i mode \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \i title-mode \i0 for column \i s \i0 to \i mode \i0 . Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlotTitleMode: \i mode \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumnTitlesHeight:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setColumnTitlesHeight: \b0 (float) \i height \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnTitlesHeight \b0 (float \i height \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlotTitlesSize: \f3\i\fs28 height \f4\i0\fs24 . \f3\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setColumnTitlesOn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b setColumnTitlesOn: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setColumnTitlesOn \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Turns the column titles on or off. When \i flag \i0 is YES, column titles will be displayed. When \i flag \i0 is NO, column titles will not be displayed. Column titles are displayed by default. Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSlotTitlesOn: \f3\i\fs28 flag \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setCompareSlotFunction:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setCompareSlotFunction \b0 :(MiscCompareSlotFunc) \i f \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Makes \i f \i0 the slot comparison function to be used for sorting. It must conform to the following prototype from \f4\fs24 MiscTableTypes.h \f3\fs28 :\ \pard\tx2480\tx2860\tx3240\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f4\fs24\li1500\fc0\cf0 typedef int (*MiscCompareSlotFunc)( int slot1, int slot2, MiscSlotSortInfo* );\ \pard\tx2480\tx2860\tx3240\f3\fs28\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\li1500\fc0\cf0 The function must return an integer value which is: (a) less than zero if \i slot1 \i0 should come before \i slot2 \i0 , or (b) equal to zero if \i slot1 \i0 should sort equally with \i slot2 \i0 , or (c) greater than zero if \i slot1 \i0 should come after \i slot2 \i0 . This function is responsible for comparing the cells of the two slots in the order defined by the \i slotSortVector \i0 , or visual order if no explicit \i slotSortVector \i0 has been set. This function is also responsible for applying the sort direction to the individual cell-wise comparisons. This function is also responsible for calling user-installed custom slot sorting functions, or interpreting and applying the sort-type for slots that do not have a custom function. The default, built-in implementation of this function is \f4\fs24 MiscDefaultCompareSlotFunc \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:sortDirection:, -border:setSlot:sortFunction:, -border:setSlot:sortType:, -border:setSlotSortVector:, -compareSlotFunction, -sortInfoDone:, -sortInfoInit:border: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setCornerTitle:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setCornerTitle: \b0 (NSString*) \i s \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setCornerTitle \b0 (String \i s \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the title for the corner cell.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setCursorColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setCursorColumn: \b0 (MiscCoord_P) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setCursorColumn \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setCursorSlot: \i col \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setCursorRow:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setCursorRow: \b0 (MiscCoord_P) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setCursorRow \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setCursorSlot: \i row \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setDataDelegate:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setDataDelegate: \b0 (id) \i obj \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setDataDelegate \b0 (Object \i obj \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Makes \i obj \i0 the data delegate for the MiscTableScroll object. Does not retain \i obj \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -setDelegate:, -setLazy:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setDelegate:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setDelegate: \b0 (id) \i obj \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setDelegate \b0 (Object \i obj \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Makes \i obj \i0 the delegate for the MiscTableScroll object. Does not retain \i obj \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -setDataDelegate: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setDoubleAction:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setDoubleAction: \b0 (SEL) \i new_sel \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setDoubleAction \b0 (NSSelector \i new_sel \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the double-action method to \i new_sel \i0 . The double-action message is sent to the \i doubleTarget \i0 upon a double mouse click. The argument of an action method is the table scroll.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setDoubleTarget:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setDoubleTarget: \b0 (id) \i obj \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setDoubleTarget \b0 (Object \i obj \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Makes \i obj \i0 the \i doubleTarget \i0 of the MiscTableScroll object. Does not retain \i obj \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setDraggableColumns:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setDraggableColumns: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setDraggableColumns \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Enables or disables \i user-dragging \i0 of columns. When \i flag \i0 is YES, columns will be user-draggable. When \i flag \i0 is NO, columns will not be user-draggable. The column titles must be displayed to enable the user to drag columns. Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setDraggableSlots: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setDraggableRows:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setDraggableRows: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setDraggableRows \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Enables or disables \i user-dragging \i0 of rows. When \i flag \i0 is YES, rows will be user-draggable. When \i flag \i0 is NO, rows will not be user-draggable. The row titles must be displayed to enable the user to drag rows. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setDraggableSlots: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \pard\tx8260\li1500\fc0\cf0 \ \fs28 setDrawsClippedText:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setDrawsClippedText: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setDrawsClippedText \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 When \i flag \i0 is YES, the MiscTableScroll object will use clipping rectangles to draw partially visible text in cells that respond YES to the \f4\fs24 -ownerDraw \f3\fs28 message. When \i flag \i0 is NO, the MiscTableScroll object will simply not draw partially visible text that would require clipping rectangles for cells that respond YES to the \f4\fs24 -ownerDraw \f3\fs28 message. This is a drawing performance optimization. The clipping rectangles are quite slow (especially noticable on older, slower CPUs). Drawing clipped text is disabled by default. You must send this message with \i flag \i0 equal to YES to enable partially visible text to be drawn. If the new setting is different than the existing setting, \f4\fs24 [self setNeedsDisplay:YES] \f3\fs28 is called.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setEnabled:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setEnabled: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setEnabled \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Enables or disables user-interaction with the MiscTableScroll object. The only feature affected by this flag is the dispatch of the \i action \i0 and \i doubleAction \i0 . When \i flag \i0 is YES, \i action \i0 and \i doubleAction \i0 are sent as appropriate. When \i flag \i0 is NO, neither messsage is sent. All other operations are unaffected and remain available. These include, pasteboard and service operations, selection, column reordering & sizing, etc.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setFirstVisibleColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setFirstVisibleColumn: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setFirstVisibleColumn \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setFirstVisibleSlot: \i col \f3\i0\fs28 . \f0\b\fs16 \ \pard\tx7140\fi-380\li2480\fc0\cf0 \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setFirstVisibleRow:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setFirstVisibleRow: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setFirstVisibleRow \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setFirstVisibleSlot: \i row \f3\i0\fs28 . \f0\b\fs16 \ \pard\tx7140\fi-380\li2480\fc0\cf0 \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setFont:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setFont: \b0 (NSFont*) \i newFont \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setFont \b0 (NSFont \i newFont \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the font for the MiscTableScroll object. The font is used to initialize new cells in the table. If rows are uniformly sized, the uniform row size is adjusted proportionately based on the sizes of the old font and the new font. Then all the cells are updated. If the cells respond to the \f4\fs24 -setOwnerFont: \f3\fs28 message, that message is sent. Otherwise the \f4\fs24 -setFont: \f3\fs28 message is tried. Then \f4\fs24 MiscTableScrollFontChangedNotification \f3\fs28 is posted to the default notification center. Finally, the display is invalidated.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -tableScrollFontChanged: \b0 (delegate method) \b , -setOwnerFont: \b0 (MiscTableCell) \b , -setFont: \b0 (NSCell, MiscTableCell) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setLastVisibleColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setLastVisibleColumn: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setLastVisibleColumn \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setLastVisibleSlot: \i col \f3\i0\fs28 . \f0\b\fs16 \ \pard\tx7140\fi-380\li2480\fc0\cf0 \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setLastVisibleRow:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setLastVisibleRow: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setLastVisibleRow \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setLastVisibleSlot: \i row \f3\i0\fs28 . \f0\b\fs16 \ \pard\tx7140\fi-380\li2480\fc0\cf0 \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setLazy:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setLazy: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setLazy \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Enables or disables lazy-mode memory management. When \i flag \i0 is YES, the MiscTableScroll object will use lazy-mode memory management, asking the \i delegate \i0 , and then if necessary the \i dataDelegate \i0 to provide the cells in the body of the table. When \i flag \i0 is NO, the MiscTableScroll object will use eager-mode memory management, maintaining a dense, 2-D array of cell pointers, one pointer for each cell in the table, and caching cells on a row-wise basis. MiscTableScroll uses eager-mode memory management by default. See \b Usage Tips \b0 , and \b Lazy vs. Eager \b0 , in the introduction for more details.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -dataDelegate, -isLazy, -setDataDelegate: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setMaxUniformSizeColumns:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setMaxUniformSizeColumns: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setMaxUniformSizeColumns \b0 (float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setMaxUniformSizeSlots: \i size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setMaxUniformSizeRows:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setMaxUniformSizeRows: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setMaxUniformSizeRows \b0 (float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setMaxUniformSizeSlots: \i size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setMinUniformSizeColumns:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setMinUniformSizeColumns: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setMinUniformSizeColumns \b0 (float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setMinUniformSizeSlots: \i size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setMinUniformSizeRows:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setMinUniformSizeRows: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setMinUniformSizeRows \b0 (float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setMinUniformSizeSlots: \i size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setModifierDragColumns:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setModifierDragColumns: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setModifierDragColumns \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets whether or not the command-key must be held down to drag columns. By default, columns require the command-key to perform selection. Equivalent to \f4\fs24 -border:MISC_COL_BORDER setModifierDragSlots: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setModifierDragRows:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setModifierDragRows: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setModifierDragRows \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets whether or not the command-key must be held down to drag rows. By default, rows do not require the command-key to perform selection. Equivalent to \f4\fs24 -border:MISC_ROW_BORDER setModifierDragSlots: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRepresentedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRepresentedObject: \b0 (id) \i object \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRepresentedObject \b0 (Object \i object \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the represented object of the MiscTableScroll \i object \i0 . Releases the old represented object if any and then retains \i object \i0 . See \b Represented Objects \b0 in the introduction for more details.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:representedObject:, -representedObject, -setColumn:representedObject:, -setRow:representedObject:, -setTag:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:autosize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b autosize: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowAutosize \b0 (int \i row \i0 , boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \i autosize \i0 flag for row \i row \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 autosize: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:cellPrototype:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b cellPrototype: \b0 (id) \i cell \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowCellPrototype \b0 (int \i row \i0 , NSCell \i cell \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the cell prototype for row \i row \i0 to \i cell \i0 . Currently, only column cell prototypes are used. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 cellPrototype: \i cell \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:cellType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b cellType: \b0 (MiscTableCellStyle) \i type \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowCellType \b0 (int \i row \i0 , int \i type \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the cell type for row \i row \i0 to \i type \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 cellType: \i type \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:maxSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b maxSize: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowMaxSize \b0 (int \i row \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the maximum size of row \i row \i0 to \i size \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 maxSize: \i size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:minSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b minSize: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowMinSize \b0 (int \i row \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the minimum size of row \i row \i0 to \i size \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 minSize: \i size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:representedObject:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b representedObject: \b0 (id) \i object \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowRepresentedObject \b0 (int \i row \i0 , Object \i object \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the represented object for row \i row \i0 to \i object \i0 . Releases the old represented object if any and then retains \i object \i0 . See \b Represented Objects \b0 in the introduction for more details. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 representedObject: \i object \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -setRow:tag: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:size:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b size: \b0 (float) \i size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowSize \b0 (int \i row \i0 , float \i size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the target size of row \i row \i0 to \i size \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 size: \i size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:sizeable:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b sizeable: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowSizeable \b0 (int \i row \i0 , boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the user-sizeable flag for row \i row \i0 to \i flag \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 sizeable: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:sortDirection:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b sortDirection: \b0 (MiscSortDirection) \i dir \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowSortDirection \b0 (int \i row \i0 , int \i dir \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 sortDirection: \i dir \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:sortFunction:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b sortFunction \b0 :(MiscCompareEntryFunc) \i x \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 sortFunction: \i x \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:sortType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b sortType: \b0 (MiscSortType) \i type \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowSortType \b0 (int \i row \i0 , int \i type \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 sortType: \i type \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:tag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b tag: \b0 (int) \i tag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowTag \b0 (int \i row \i0 , int \i tag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the tag for row \i row \i0 to \i tag \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 tag: \i tag \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -setRow:representedObject: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRow:title:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRow: \b0 (int) \i row \i0 \b title: \b0 (NSString*) \i title \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowTitle \b0 (int \i row \i0 , String \i title \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the title for row \i row \i0 to \i title \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlot: \i row \i0 title: \i title \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRowOrder:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b setRowOrder: \b0 (NSArray*) \i list \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setRowOrder \b0 (NSArray \i list \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlotOrder: \i list \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRowOrderFromString:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b setRowOrderFromString: \b0 (NSString*) \i s \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setRowOrder \b0 (String \i s \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlotOrderFromString: \i s \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRowSizes:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b setRowSizes: \b0 (NSArray*) \i list \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setRowSizes \b0 (NSArray \i list \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlotSizes: \i list \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRowSizesFromString:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b setRowSizesFromString: \b0 (NSString*) \i s \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b setRowSizes \b0 (String \i s \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlotSizesFromString: \i s \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRowSortVector:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRowSortVector: \b0 (NSArray) \i v \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowSortVector \b0 (NSArray \i v \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlotSortVector: \i v \f3\i0\fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRowTitleMode:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRowTitleMode: \b0 (MiscTableTitleMode) \i mode \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowTitleMode \b0 (int \i mode \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the title-mode for rows to \i mode \i0 . Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlotTitleMode: \i mode \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRowTitlesOn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b setRowTitlesOn: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ boolean \b setRowTitlesOn \b0 (boolean \i flag) \i0\fs24 [Java] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Turns the row titles on or off. When \i flag \i0 is YES, row titles will be displayed. When \i flag \i0 is NO, row titles will not be displayed. Row titles are not displayed by default. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlotTitlesOn: \f3\i\fs28 flag \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setRowTitlesWidth:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setRowTitlesWidth: \b0 (float) \i width \i0\fs24 [Objective-C] \fs28 \ \pard\tx3600\tx3980\tx4340\fi-620\li2520\fc0\cf0 void \b setRowTitlesWidth \b0 (float \i width \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li1500 \ \fs28 Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSlotTitlesSize: \f3\i\fs28 width \i0 . \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setSelectedBackgroundColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setSelectedBackgroundColor: \b0 (NSColor*) \i value \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSelectedBackgroundColor \b0 (NSColor \i value \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \i selectedBackgroundColor \i0 for the MiscTableScroll object. The \i selectedBackgroundColor \i0 is used to initialize new cells added to the table. This information is propagated to the cells of the table as follows. If the cells respond to the \f4\fs24 -setOwnerSelectedBackgroundColor: \f3\fs28 message, that message is sent, else if the cells respond to the \f4\fs24 -setSelectedBackgroundColor: \f3\fs28 message, that message is sent instead. If the cells do not respond to either of these messages, no message is sent to the cell. Finally, the display is invalidated.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -setSelectedBackgroundColor: \b0 (MiscTableCell) \b , -setOwnerSelectedBackgroundColor: \b0 (MiscTableCell) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setSelectedTextColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setSelectedTextColor: \b0 (NSColor*) \i value \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSelectedTextColor \b0 (NSColor \i value \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \i selectedTextColor \i0 for the MiscTableScroll object. The \i selectedTextColor \i0 is used to initialize new cells added to the table. This message is also propagated to the existing cells of the table as follows. If the cells respond to the \f4\fs24 -setOwnerSelectedTextColor: \f3\fs28 message, that message is sent, else if the cells respond to the \f4\fs24 -setSelectedTextColor: \f3\fs28 message, that message is sent. If the cells do not respond to either of these messages, no message is sent to the cell. Finally, the display is invalidated.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -setSelectedTextColor: \b0 (MiscTableCell) \b , -setOwnerSelectedTextColor: \b0 (MiscTableCell) \b \ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setSelectionMode:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setSelectionMode: \b0 (MiscSelectionMode) \i mode \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSelectionMode \b0 (int \i mode \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the selection mode for the MiscTableScroll object. The selection \i mode \i0 can be any of the following:\ \pard\f4\fs24\li3600\fc0\cf0 \ \pard\tx2340\tx5040\tx9180\f3\ul\fi-3140\li5040\fc0\cf0 Objective-C \ulnone \ul Java\ \f4\ulnone MISC_LIST_MODE SELECTION_MODE_LIST\ MISC_RADIO_MODE SELECTION_MODE_RADIO\ MISC_HIGHLIGHT_MODE SELECTION_MODE_HIGHLIGHT\ \pard\li3600\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f3\fs28\li1500\fc0\cf0 The modes each correspond to the similarly named selection modes declared in the NSMatrix class. MiscTableScroll extends the highlight mode selection by implementing the Alternate-key modifier in the same fashion that it works in list mode.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setSelectsByRows:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setSelectsByRows: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSelectsByRows \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the orientation by which the mouse is tracked for selection. If \i flag \i0 is YES then selection is performed on a row-wise basis. If \i flag \i0 is NO then selection is performed on a column-wise basis.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 selectsByRows \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setSizeableColumns:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setSizeableColumns: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSizeableColumns \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Enables or disables user-sizing of columns. Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setSizeableSlots: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setSizeableRows:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setSizeableRows: \b0 (BOOL) \i flag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setSizeableRows \b0 (boolean \i flag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Enables or disables user-sizing of rows. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setSizeableSlots: \i flag \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setTag:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setTag: \b0 (int) \i tag \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setTag \b0 (int \i tag \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \b tag \b0 of the MiscTableScroll object to \i tag \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:tag:, -setColumn:tag:, -setRepresentedObject:, -setRow:tag:, -tag\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setTarget:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setTarget: \b0 (id) \i obj \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setTarget \b0 (Object \i obj \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Makes \i obj \i0 the object which will receive the \i action \i0 message whenever there is a single mouse-click on the body of the table. Does not retain \i obj \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setTextColor:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setTextColor: \b0 (NSColor*) \i value \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setTextColor \b0 (NSColor \i value \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets the \i textColor \i0 for the MiscTableScroll object. The \i textColor \i0 is used to initialize new cells added to the table. The message is propagated to existing cells as follows. If the cell responds to the \f4\fs24 -setOwnerTextColor: \f3\fs28 message, that message is sent, else if the cell responds to the \f4\fs24 -setTextColor: \f3\fs28 message, that message is sent. If the cell does not respond to either of these messages, no message is sent to the cell. Finally, the display is invalidated.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -setOwnerTextColor: \b0 (MiscTableCell) \b , -setTextColor: \b0 (NSCell, MiscTableCell) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setUniformSizeColumns:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setUniformSizeColumns: \b0 (float) \i uniform_size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setUniformSizeColumns \b0 (float \i uniform_size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets or clears the \i uniform-size \i0 property for columns. When \i uniform_size \i0 is a non-zero value, all columns will have the same, fixed (uniform) size. When \i uniform_size \i0 is zero, each column can be assigned sizes individually. By default, columns are not uniformly sized. Equivalent to: \f4\fs24 -border:MISC_COL_BORDER setUniformSizeSlots: \i uniform_size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 setUniformSizeRows:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b setUniformSizeRows: \b0 (float) \i uniform_size \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setUniformSizeRows \b0 (float \i uniform_size \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sets or clears the \i uniform-size \i0 property for rows. When \i uniform_size \i0 is a non-zero value, all rows will have the same, fixed (uniform) size. When \i uniform_size \i0 is zero, each row can be assigned sizes individually. By default, row are uniformly sized. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER setUniformSizeSlots: \i uniform_size \f3\i0\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sizeableColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b sizeableColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b sizeableColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not columns can be resized by the user. Equivalent to: \f4\fs24 -sizeableSlots:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sizeableRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b sizeableRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b sizeableRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not rows can be resized by the user. Equivalent to: \f4\fs24 -sizeableSlots:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sizeableSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b sizeableSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b sizeableSlots \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not the user can resize the slots on border \i border \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sizeToCells\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b sizeToCells \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b sizeToCells \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Instructs the MiscTableScroll object to adjust the frames of its subviews.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -addRow \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sizeToFit\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b sizeToFit \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b sizeToFit \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calculates the size of every cell in the MiscTableScroll object using \f4\fs24 -cellSize \f3\fs28 . Then uses the maximum size for each slot to set the size of the slot. For uniform-size borders, the size is set to the maximum size of all slots. Finally, this method calls \f4\fs24 -sizeToCells \f3\fs28 to finish the process of updating the frames of all the subviews.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 slotsAreSorted:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b slotsAreSorted: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b slotsAreSorted \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns YES if the slots are sorted, NO otherwise.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotIsSorted:, -border:sortSlot:, -sortSlots: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 slotOrder:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b slotOrder: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b slotOrder \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns an array of numbers containing the current slot order. The list is organized in \i physical \i0 (original) slot order. Each value in the list is the current \i visual \i0 position of the corresponding slot. In other words, returns the physical to visual mapping. This method is useful for saving the user's slot order preference. Each element in the returned array is an NSNumber in Objective-C, and a java.lang.Integer in Java.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 The returned list of numbers also encodes the sort direction. Negative values indicate slots that are sorted in descending order. The negative value is computed by using the 'C' bitwise complement operator (~).\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlotOrder:, -border:setSlotSizes:, -slotOrderAsString: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 slotOrderAsString:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b slotOrderAsString: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b slotOrderAsString \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns a string representation of the array returned by \f4\fs24 -slotOrder: \f3\fs28 . This is useful for saving and restoring user slot order preferences.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlotOrder:, -slotOrder: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 slotSizes:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b slotSizes: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b slotSizes \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns an array containing the sizes of all slots. The list is organized in \i physical \i0 (original) slot order. The values are the sizes of the corresponding slot. Each element in \i \i0 the returned array is an NSNumber in Objective-C, and a java.lang.Integer in Java. This method is useful for saving the user's slot size preferences.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlotSizes:, -slotOrder:, -slotSizesAsString:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 slotSizesAsString:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b slotSizesAsString: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b slotSizesAsString \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns a string representation of the array returned by \f4\fs24 -slotSizes: \f3\fs28 . This is useful for saving and restoring user slot size preferences.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -slotSizes:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 slotSortVector\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSArray*) \b slotSortVector: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSArray \b slotSortVector \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current \i slotSortVector \i0 for \i border. \i0 Each element in the returned array is an NSNumber in Objective-C, and a java.lang.Integer in Java.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlotSortVector: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 slotTitleMode:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (MiscTableTitleMode) \b slotTitleMode: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b slotTitleMode \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the title-mode for \i border \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 slotTitlesOn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b slotTitlesOn: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b slotTitlesOn \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Indicates whether or not the titles for \i border \i0 are displayed.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 slotTitlesSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b slotTitlesSize: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b slotTitlesSize \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns either the height of column titles or the width of row titles, based upon \i border \i0 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sortColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b sortColumn: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b sortColumn \b0 (int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Re-sorts a single column. Equivalent to: \f4\fs24 -border:MISC_COL_BORDER sortSlot: \i col \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:sortSlot:, -sortSlots: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sortColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b sortColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b sortColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -sortSlots:MISC_COL_BORDER \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -sortSlots: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sortInfoDone:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b sortInfoDone: \b0 (MiscSlotSortInfo*) \i sortInfo \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method reclaims temporary storage held in the \i sortInfo \i0 structure. You must call this method whenever you are finished using a \i sortInfo \i0 object.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -sortInfoInit:border: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sortInfoInit:border:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b sortInfoInit: \b0 (MiscSlotSortInfo*) \i sortInfo \i0 \b border: \b0 (MiscBorderType) \i b \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method precomputes the sorting information needed by the sorting methods. If you call any of the sorting methods that accept an \f4\fs24 info: \f3\fs28 argument, you must initialize the \i sortInfo \i0 structure by calling this method first. After you have finished using the \i sortInfo \i0 structure, you must reclaim the storage by passing the \i sortInfo \i0 structure to \f4\fs24 -sortInfoDone: \f3\fs28 . NOTE: The \i sortInfo \i0 structure stores the current sorting information for the table. Any changes made to the sorting environment after the \i sortInfo \i0 structure has been initialized will not affect the contents of the \i sortInfo \i0 structure, and therefore will not affect comparisons made using the \i sortInfo \i0 structure. Actions that affect the sorting environment include: rearranging columns/rows, installing a slotSortVector, installing a custom slot comparison function, changing the sort-type or sort-direction of a slot. Actions which alter the structure of the "other" border (like removing columns/rows) can potentially cause catastrophic failures.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:compareSlots::info: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sortRow:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b sortRow: \b0 (int) \i row \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b sortRow \b0 (int \i row \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Re-sorts a single row. Equivalent to: \f4\fs24 -border:MISC_ROW_BORDER sortSlot: \i row \f3\i0\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:sortSlot:, -sortSlots: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sortRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b sortRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b sortRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -sortSlots:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -sortSlots:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 sortSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b sortSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b sortSlots \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sorts the slots in \i border \i0 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:sortDirection:, -border:setSlot:sortFunction:, -border:setSlot:sortType:, -border:setSlotSortVector:, -setCompareSlotFunction: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 stateAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b stateAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b stateAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the value of sending a \f4\fs24 -state \f3\fs28 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f4\fs24 -tableScroll:stateAtRow:column: \f3\fs28 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f4\fs24 -tableScroll:doubleValueAtRow:column: \f3\fs28 message, then the cell is retrieved via \f4\fs24 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f4\fs24 -state \f3\fs28 message, that value is returned; otherwise, zero is returned.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -isLazy, -setLazy:, -state \b0 (NSButtonCell) \b , -tableScroll:stateAtRow:column: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 stringForNSStringPboardType\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b stringForNSStringPboardType \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b stringForNSStringPboardType \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns a string of the selected cells as ASCII text. Columns are separated by tab characters (ASCII decimal 9). Rows are terminated with newline characters (ASCII decimal 10). The text is retrieved from the cells by first trying the \f4\fs24 -title \f3\fs28 message. If the cell does not respond to the \f4\fs24 -title \f3\fs28 message, then the \f4\fs24 -stringValue \f3\fs28 message is tried. Each tab character in the text retrieved from the cell is replaced with a single space character (ASCII decimal 32) before the text is written to string. The selection is written in the current ( \i visual \i0 ) ordering. Called from \f4\fs24 -builtinStringForPboardType: \f3\fs28 , and \f4\fs24 -stringForNSTabularTextPBoardType \f3\b\fs28 . \b0 Override this method in your subclass if you want different behavior.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -builtinStringForPboardType:, -stringForNSTabularTextPboardType \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 stringForNSTabularTextPboardType\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b stringForNSTabularTextPboardType \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b stringForNSTabularTextPboardType \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Calls \f4\fs24 [self stringForNSStringPboardType] \f3\fs28 . Called from \f4\fs24 -builtinStringForPboardType: \f3\fs28 . Override this method in your subclass if you want different behavior.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -builtinStringForPboardType:, -stringForNSStringPboardType \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 stringValueAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b stringValueAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b stringValueAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the value of sending a \f4\fs24 -stringValue \f3\fs28 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f4\fs24 -tableScroll:stringValueAtRow:column: \f3\fs28 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f4\fs24 -tableScroll:doubleValueAtRow:column: \f3\fs28 message, then the cell is retrieved via \f4\fs24 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f4\fs24 -stringValue \f3\fs28 message, that value is returned; otherwise, zero (a NULL pointer) is returned. NOTE: If you are using NSButtonCells, you probably want \f4\fs24 -titleAtRow:column: \f3\fs28 , not this method.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -isLazy, -setLazy:, -tableScroll:stringValueAtRow:column: \b0 (delegate method) \b , -titleAtRow:column: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 suspendEditing\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b suspendEditing \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b suspendEditing \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Internal method that temporarily suspends the current cell editing session (if any), while slots are being resized or rearranged. The editing session is resumed by \f4\fs24 -resumeEditing \f3\fs28 . These calls nest. These methods do nothing if cell editing is not in progress.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tag\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b tag \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b tag \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the \i tag \i0 of the MiscTableScroll object.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotTag:, -columnTag:, -representedObject, -rowTag:, -setTag: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tagAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b tagAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b tagAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the value of sending a \f4\fs24 -tag \f3\fs28 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f4\fs24 -tableScroll:tagAtRow:column: \f3\fs28 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f4\fs24 -tableScroll:doubleValueAtRow:column: \f3\fs28 message, then the cell is retrieved via \f4\fs24 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f4\fs24 -tag \f3\fs28 message, that value is returned; otherwise, zero is returned.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -isLazy, -setLazy:, -tableScroll:tagAtRow:column: \b0 (delegate method) \b \ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 target\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b target \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b target \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns a pointer to the object which receives the \i action \i0 message on a single mouse-click event.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 textColor\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSColor*) \b textColor \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSColor \b textColor \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the current textColor.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 textDidBeginEditing:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b textDidBeginEditing: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b textDidBeginEditing \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posts \f4\fs24 NSControlTextDidBeginEditingNotification \f3\fs28 to the default notification center, which the delegates are automatically registered to receive.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 NSControlTextDidBeginEditingNotification \b0 (NSControl notification) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 textDidChange:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b textDidChange: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b textDidChange \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posts \f4\fs24 NSControlTextDidChangeNotification \f3\fs28 to the default notification center, which the delegates are automatically registered to receive.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 NSControlTextDidChangeNotification \b0 (NSControl notification) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 textDidEndEditing:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b textDidEndEditing: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b textDidEndEditing \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Invoked by the NSText object, when text editing ends. If the text changed then attempts to set the cell's new value by sending \f4\fs24 -tableScroll:setStringValue:atRow:column: \f3\fs28 to the \i delegate \i0 or \i dataDelegate \i0 . If neither responds, then sends \f4\fs24 -setStringValue: \f3\fs28 to the cell instead. It then posts \f4\fs24 MiscTableScrollDidEditNotification \f3\fs28 to the default notification center, sorts the data if auto-sorting is enabled, and finally posts \f4\fs24 NSControlTextDidEndEditingNotification, \f3\fs28 which the delegates are automatically registered to receive. Lastly, it checks to see if one of \i return \i0 , \i tab \i0 , or \i shift-tab \i0 caused the editing to end. If the cause was return, then the action is sent to the target, else if it was tab or shift-tab, then \f4\fs24 -getNext:editRow:column: \f3\fs28 is invoked to determine which cell should be edited next and editing is initiated for that cell using \f4\fs24 -editCellAtRow:column: \f3\fs28 . If no cell is eligible for editing, then \f4\fs24 -selectNextKeyView: \f3\fs28 or \f4\fs24 -selectPreviousKeyView: \f3\fs28 is sent to the window as appropriate.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 You should never need to call this method manually, though subclasses may want to override it.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 NSControlTextDidEndEditingNotification \b0 (NSControl notification) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 textShouldBeginEditing:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b textShouldBeingEditing: \b0 (NSText*) \i sender \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b textShouldBeingEditing \b0 (NSText \i sender \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Invoked automatically during editing to determine if it is okay to edit the cell. Sends \f4\fs24 -control:textShouldBeginEditing: \f3\fs28 to the \i delegate \i0 or \i dataDelegate \i0 . If neither responds then returns YES.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 control:textShouldBeginEditing: \b0 (NSControl delegate), \b textShouldBeginEditing: \b0 (NSText delegate) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 textShouldEndEditing:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b textShouldEndEditing: \b0 (NSText*) \i sender \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b textShouldEndEditing \b0 (NSText \i sender \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Invoked automatically during editing to determine if it is okay to end editing. Sends \f4\fs24 -control:textShouldEndEditing: \f3\fs28 to the \i delegate \i0 or \i dataDelegate \i0 . If neither responds then returns YES.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 control:textShouldEndEditing: \b0 (NSControl delegate), \f0\b\fs24 \f3\fs28 textShouldEndEditing: \b0 (NSText delegate)\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 titleAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b titleAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b titleAtLocation \b0 (int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the value of sending a \f4\fs24 -title \f3\fs28 message to the cell at \i row \i0 , \i col \i0 . If the table is lazy, the \i delegate \i0 , and then the \i dataDelegate \i0 are given the opportunity to reply to the \f4\fs24 -tableScroll:titleAtRow:column: \f3\fs28 message. This gives lazy tables an opportunity to return this information directly, without the overhead of preparing and formatting a cell. If the table is not lazy, or the \i delegate \i0 and \i dataDelegate \i0 do not respond to the \f4\fs24 -tableScroll:titleAtRow:column: \f3\fs28 message, then the cell is retrieved via \f4\fs24 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f4\fs24 -title \f3\fs28 message, that value is returned; otherwise, zero (a NULL pointer) is returned. NOTE: NSButtonCell implements the \f4\fs24 -stringValue \f3\fs28 message by formatting the integer value of its state as a string. To retrieve the text label displayed on the button, you must use the \f4\fs24 -title \f3\fs28 method.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -isLazy, -setLazy:, -tableScroll:titleAtRow:column: \b0 (delegate method) \b , -title \b0 (NSButtonCell) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 totalHeight\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b totalHeight \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b totalHeight \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -totalSize:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 totalSize:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b totalSize: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b totalSize \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the total display size. The sum of \f4\fs24 -border: \i border \i0 slotAdjustedSize: \f3\fs28 for all slots on the border.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:slotAdjustedSize: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 totalWidth\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b totalWidth \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b totalWidth \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Equivalent to: \f4\fs24 -totalSize:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 uniformSizeColumns\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b uniformSizeColumns \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b uniformSizeColumns \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the uniform size for columns. If columns are not being sized uniformly, this method will return zero. Any non-zero value indicates the size that all columns have the same size as the value returned by this method. By default, columns are not uniformly sized. Equivalent to: \f4\fs24 -uniformSizeSlots:MISC_COL_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 uniformSizeRows\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b uniformSizeRows \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b uniformSizeRows \b0 () \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the uniform size for rows. If rows are not being sized uniformly, this method will return zero. Any non-zero value indicates the size that all rows have the same size as the value returned by this method. Rows are uniformly sized by default. Equivalent to: \f4\fs24 -uniformSizeSlots:MISC_ROW_BORDER \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 uniformSizeSlots:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b uniformSizeSlots: \b0 (MiscBorderType) \i border \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b uniformSizeSlots: \b0 (int \i border \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns the uniform size for slots in \i border \i0 . If slots are not being sized uniformly, this method will return zero. Any non-zero value indicates the size that all slots have the same size as the value returned by this method.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 validRequestorForSendType:returnType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b validRequestorForSendType: \b0 (NSString*) \i sendType \i0 \b returnType: \b0 (NSString*) \i returnType \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b validRequestorForTypes \b0 (String \i sendType \i0 , String \i returnType \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method is called by the services system to update the services menu. If the \i delegate \i0 responds to the \f4\fs24 -tableScroll:validRequestorForSendType:returnType: \f3\fs28 message, it is sent to the \i delegate \i0 . If not, the \i dataDelegate \i0 is checked. If neither object responds, \f4\fs24 -builtinValidRequestorForSendType:returnType: \f3\fs28 is called. Override this method in your subclass if you need different behavior. Returns the result of the called method.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -builtinValidRequestorForSendType:returnType:, -tableScroll:validRequestorForSendType:returnType: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 writeSelectionToPasteboard:types:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b writeSelectionToPasteboard: \b0 (NSPasteboard*) \i pboard \i0 \b types: \b0 (NSArray*) \i types \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b writeSelectionToPasteboardOfTypes \b0 (NSPasteboard \i pboard \i0 , NSArray \i types \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This method is responsible for writing data to the pasteboard. If the \i delegate \i0 responds to \f4\fs24 -tableScroll:writeSelectionToPasteboard:types: \f3\fs28 , the message is sent to the \i delegate \i0 . If not, the \i dataDelegate \i0 is tried. If neither object responds to the message, the default method, \f4\fs24 -builtinStringForPboardType: \f3\fs28 , is called. Called from \f4\fs24 -builtinWriteSelectionToPasteboard:types: \f3\fs28 . Override this method in your subclass if you want different behavior.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -builtinStringForPboardType:, -builtinWriteSelectionToPasteboard:types:, -tableScroll:writeSelectionToPasteboard:types: \b0 (delegate method) \b , -readSelectionFromPasteboard: \b0 (NSServicesRequests) \b , -writeSelectionToPasteboard:types: \b0 (NSServicesRequests) \fs16 \ \pard\tx11280\fs70\fi-240\li6320\fc0\cf0 \ \pard\f0\b\fs28\fi-1020\li1200\fc0\cf0 Methods Implemented by Cell Subclasses\ \pard\tx7140\fs16\li1360\fc0\cf0 \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:retireAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b retireAtRow: \b0 (int) \i row \i0 \b column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b tableScrollRetireAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If neither the \i delegate \i0 nor the \i dataDelegate \i0 respond to \f4\fs24 -tableScroll:retireCell:atRow:column: \f3\fs28 then the MiscTableScroll tries sending this message to the cell itself to give it the opportunity to perform special handling when it is being retired from active use and returned to the cache. Must return \b self \b0 , or a suitable replacement object for storage in the cache.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -retireCell:atRow:column:, -tableScroll:retireCell:atRow:column: \b0 (delegate method) \b \ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:reviveAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b reviveAtRow: \b0 (int) \i row \i0 \b column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b tableScrollReviveAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If neither the \i delegate \i0 nor the \i dataDelegate \i0 respond to \f4\fs24 -tableScroll:reviveCell:atRow:column: \f3\fs28 then the MiscTableScroll tries sending this message to the cell itself to give it the opportunity to perform special handling when it is being brought into use for the first time, or is being retrieved from the cache for reuse.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -reviveCell:AtRow:column:, -tableScroll:reviveCell:atRow:column: \b0 (delegate method) \fs16 \ \pard\tx11280\fs70\fi-240\li6320\fc0\cf0 \ \pard\f0\b\fs28\fi-1020\li1200\fc0\cf0 Methods Implemented by the Delegate\ \pard\tx7140\fs16\li1360\fc0\cf0 \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:abortEditAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b abortEditAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollAbortEditAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Notifies the delegate that a cell editing session has been aborted. This means that the normal \f4\fs24 -control:textShouldEndEditing: \f3\fs28 validation did not take place.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 Cell Editing \b0 (Introduction) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollBackgroundColorChanged:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollBackgroundColorChanged: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollBackgroundColorChanged \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the delegate that MiscTableScroll responded to a \f4\fs24 -setBackgroundColor: \f3\fs28 message that actually changed the background color. The \i notification \i0 is \f4\fs24 MiscTableScrollBackgroundColorChangedNotification \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:border:slotPrototype:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b border: \b0 (MiscBorderType) \i border \i0 \b slotPrototype: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollSlotPrototype \b0 (TableScroll \i scroll \i0 , int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sent to the \i delegate \i0 whenever the MiscTableScroll object needs the prototype cell for a column which has the \f4\fs24 MISC_TABLE_CELL_CALLBACK \f3\fs28 cell type. If the \i delegate \i0 does not respond to the message, the \i dataDelegate \i0 is tried.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlot:cellType: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:border:slotTitle:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b border: \b0 (MiscBorderType) \i border \i0 \b slotTitle: \b0 (int) \i slot \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b tableScrollSlotTitle \b0 (TableScroll \i scroll \i0 , int \i border \i0 , int \i slot \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sent to the \i delegate \i0 whenever the MiscTableScroll object needs a title for a border which has the \f4\fs24 MISC_DELEGATE_TITLE \f3\fs28 title mode. If the \i delegate \i0 does not respond to the message, the \i dataDelegate \i0 is tried.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -border:setSlotTitleMode: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollBufferCount:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b tableScrollBufferCount: \b0 (MiscTableScroll*) \i scroll \i0\fs24 [Objective-C] \fs28 \ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-620\li2520\fc0\cf0 int \b tableScrollBufferCount \b0 (MiscTableScroll \i scroll \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Gives the \i delegate \i0 and \i dataDelegate \i0 of a lazy-mode MiscTableScroll the opportunity to report the number of buffers used for each slot. This information can be used to optimize-away string copying during sorting. This is a micro- optimization for sorting lazy-mode tables based on string values.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Sorting retrieves the values of two cells from the same slot to compare them. In eager mode, it is sufficient to perform the comparison in a manner similar to this:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \f2\fs20\li1800 [[cell1 stringValue] isEqualToString:[cell2 stringValue]] \f3\fs28 \ \fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 However, it is common for lazy-mode delegates to simply recycle a single cell to handle the \f4\fs24 -tableScroll:cellAtRow:column: \f3\fs28 message. In that case, the first value is no longer valid when the second value is retrieved, so the MiscTableScroll object needs to copy the first value before retrieving the second value. By default, the MiscTableScroll object makes the pessimistic (but safe) assumption that it needs to copy the first string value before retrieving the second string value. Sophisticated delegates can eliminate this copy operation if they provide at least two buffers for each slot, or if they implement the string retrieval methods ( \f4\fs24 -tableScroll:stringValueAtRow:column: \f3\fs28 and/or \f4\fs24 -tableScroll:titleAtRow:column: \f3\fs28 ) in a way that makes it possible to retrieve a second string value from the same slot without invalidating the previous string value retrieved from that slot.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If the value returned is greater than or equal to two (2), the string values will not be copied.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -bufferCount \f0\b0\fs24 \ \pard\tx7140\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:canEdit:atRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b canEdit: \b0 (NSEvent*) \i event \b\i0 atRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b tableScrollCanEditAtLocation \b0 (TableScroll \i scroll \i0 , NSEvent \i event \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Gives the \i delegate \i0 the opportunity to decide whether or not an editing session should be started for the cell at \i row \i0 , \i col \i0 . This method is invoked from both a \f2\fs20 -mouseDown: \f3\fs28 event, in which case \i event \i0 is the mouse-down event itself, and also from keyboard events in which case \i event \i0 is 0. This message is sent both on single-click events and multi-click events. It is the responsibility of the \i delegate \i0 to decide whether or not editing should begin. If the \i delegate \i0 returns YES, an editing session will begin for the cell. If the \i delegate \i0 returns NO, no editing session will begin. This message is tested with the \i delegate \i0 , \i dataDelegate \i0 and the cell itself. The first object that responds to the message decides the outcome. If none of those objects respond to the message, the default behavior will allow editing only on a double-click or keyboard event, and only if the cell is both editable and enabled.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 Cell Editing \b0 (Introduction) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:canWritePboardType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b canWritePboardType: \b0 (NSString*) \i type \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b tableScrollCanWritePboardType \b0 (TableScroll \i scroll \i0 , String \i type \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to select which datatypes will be written to the pasteboard. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is given the opportunity.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -canWritePboardType: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:cellAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b cellAtRow: \b0 (int) \i row \i0 \b column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b tableScrollCellAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If the table scroll is in \i lazy \i0 mode this message is sent first to the \i delegate \i0 and then to the \i dataDelegate \b\i0 \b0 (if \i delegate \i0 does not respond) whenever the cell at \i row \i0 , \i col \i0 is needed. You must implement this method in either the \i delegate \i0 or the \i dataDelegate \i0 whenever you use a MiscTableScroll in lazy mode. The table scroll does not manage the cells for itself in lazy mode; the \i delegate \i0 or the \i dataDelegate \i0 must.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 setLazy:, isLazy\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollChangeFont:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollChangeFont: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollChangeFont \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the delegate that \f2\fs20 -changeFont: \f3\fs28 received a new font that is different than the current font. The NSFontManager sends the \f2\fs20 -changeFont: \f3\fs28 message whenever the user changes the font using either the Font Panel or the Font menu. This is distinguished from programmatic changes via the \f2\fs20 -setFont: \f3\fs28 method so that you can record user preferences. This notification message is sent after the font change has been applied, but before the new font is displayed. The \i notification \i0 is \f4\fs24 MiscTableScrollChangeFontNotification \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -changeFont:, -setFont:, -tableScrollFontChanged: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollDidBecomeFirstResponder:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollDidBecomeFirstResponder: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollDidBecomeFirstResponder \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the delegate that MiscTableScroll's \i documentView \i0 became first responder. The \i notification \i0 is \f4\fs24 MiscTableScrollDidBecomeFirstResponderNotification \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollDidEdit:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollDidEdit: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollDidEditAtLocation \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the delegate that a cell-editing session terminated, and whether or not the value in the cell changed. This is a notification only. The \i delegate \i0 is not given any veto power at this point. Veto power is available in the \f2\fs20 -control:textShouldEndEditing: \f3\fs28 (NSControl) delegate message. This notification is sent after both \f2\fs20 -tableScroll:abortEdit:atRow:column: \f3\fs28 and \f2\fs20 -tableScroll:setStringValue:atRow:column: \f3\fs28 , so it is sent in all cases when cell editing terminates, regardless of the reason. The \i notification \i0 is \f4\fs24 MiscTableScrollDidEditNotification \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -tableScrollWillEdit: \b0 (delegate method) \b , Cell Editing \b0 (Introduction) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollDidPrint:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollDidPrint: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollDidPrint \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the delegate that a printing session terminated. This notification is sent from \f4\fs24 -print: \f3\fs28 after printing has completed. This gives the delegate the opportunity to peform post-print cleanup, such as restoring global NSPrintInfo values. The \i notification \i0 is \f4\fs24 MiscTableScrollDidPrintNotification \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -tableScrollWillPrint: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollDidResignFirstResponder:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollDidResignFirstResponder: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollDidResignFirstResponder \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the delegate that MiscTableScroll's \i documentView \i0 resigned first responder. The \i notification \i0 is \f4\fs24 MiscTableScrollDidResignFirstResponderNotification \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:doubleValueAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (double) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b doubleValueAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 double \b tableScrollDoubleValueAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f2\fs20 -doubleValueAtRow:column: \f3\fs28 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f2\fs20 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f2\fs20 -doubleValue \f3\fs28 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f4\fs24 double \f3\fs28 values.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -doubleValueAtRow:column:, -isLazy, -setLazy: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:floatValueAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (float) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b floatValueAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 float \b tableScrollFloatValueAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f2\fs20 -floatValueAtRow:column: \f3\fs28 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f2\fs20 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f2\fs20 -floatValue \f3\fs28 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f4\fs24 float \f3\fs28 values.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -floatValueAtRow:column:, -isLazy, -setLazy: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollFontChanged:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollFontChanged: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollFontChanged \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the delegate that \f2\fs20 -setFont: \f3\fs28 received a new font that is different than the current font. This notification message is sent after all font changes, both user-initiated and programmatic. The notification is sent after the font change has been applied, but before the new font is displayed. The \i notification \i0 is \f4\fs24 MiscTableScrollFontChangedNotification \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -changeFont:, -setFont:, -tableScrollChangeFont: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:getIncrementalSearchColumn:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b getIncrementalSearchColumn: \b0 (int*) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 First the \i delegate \i0 and then the \i dataDelegate \i0 is tested for response to this message whenever a keystroke is received that could start incremental searching. If the \i delegate \i0 responds, the message is sent to the \i delegate \i0 . Otherwise, if the \i dataDelegate \i0 responds, the message is sent to the \i dataDelegate \i0 . Return YES if incremental searching should be enabled, and set * \i col \i0 to the physical index of the column that the table is sorted on, otherwise return NO. The delegates have the opportunity to decide whether or not incremental searching should be enabled, and indicate which column the table is sorted on. If you want to enable incremental searching and you do not use the auto-sort facilities, then you must implement this method to tell the MiscTableScroll object which column the table is sorted on. The table must be sorted in \i col \i0 order (ascending or descending). \f2\fs20 -doIncrementalSearch:column: \f3\fs28 calls \f4\fs24 [self border:MISC_COL_BORDER slotSortType: \i col \i0 ] \f3\fs28 to determine the sort-type. The sort-type for \i col \i0 must be one of the string-based sort-types: \f4\fs24 MISC_SORT_STRING_CASE_INSENSITIVE \f3\fs28 , \f4\fs24 MISC_SORT_STRING_CASE_SENSITIVE \f3\fs28 , \f4\fs24 MISC_SORT_TITLE_CASE_INSENSITIVE \f3\fs28 or \f4\fs24 MISC_SORT_TITLE_CASE_SENSITIVE \f3\fs28 . \i Col \i0 must not have a custom sort function. You are responsible for ensuring that the table is sorted in \i col \i0 order. \f2\fs20 -doIncrementalSearch:column: \f3\fs28 calls \f4\fs24 [self border:MISC_COL_BORDER slotSortDirection: \i col \i0 ] \f3\fs28 to determine the sort-direction. If the table is sorted in the other direction, use the complement of the column's physical index ( \i ~col \i0 ).\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -doGetIncrementalSearchColumn:, -doIncrementalSearch:column:, -getIncrementalSearchColumn:, -incrementalSearch: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:intValueAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b intValueAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b tableScrollIntValueAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f2\fs20 -intValueAtRow:column: \f3\fs28 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f2\fs20 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f2\fs20 -intValue \f3\fs28 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f4\fs24 int \f3\fs28 values.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -intValueAtRow:column:, -isLazy, -setLazy:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:readSelectionFromPasteboard:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b readSelectionFromPasteboard: \b0 (id) \i pboard \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b tableScrollReadSelectionFromPasteboard \b0 (TableScroll \i scroll \i0 , NSPasteboard \i pboard \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to take over the process of reading data from the pasteboard. If the \i delegate \i0 does not respond to this message, the dataDelegate is tried. The delegate should return YES if the data was successfully read from the pasteboard, else it should return NO.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -readSelectionFromPasteboard:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollRegisterServicesTypes:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollRegisterServicesTypes: \b0 (MiscTableScroll*) \i scroll \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollRegisterServicesTypes \b0 (TableScroll \i scroll \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If the \i delegate \i0 responds to this message, the delegate has the opportunity to register different datatypes with the services system. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is tried.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -registerServicesTypes: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:retireCell:atRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b retireCell: \b0 (id) \i cell \b\i0 atRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b tableScrollRetireCellAtLocation \b0 (TableScroll \i scroll \i0 , NSCell \i cell \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to perform special handling of cells that are being retired to the cache. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is tried. If the \i dataDelegate \i0 does not respond either, the cell itself is tried (with \f2\fs20 -tableScroll:retireAtRow:column: \f3\fs28 ). Must return \i cell \i0 , or a suitable replacement object for storage in the cache.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -retireCell:atRow:column: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:reviveCell:atRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b reviveCell: \b0 (id) \i cell \i0 \b atRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSCell \b tableScrollReviveCellAtLocation \b0 (TableScroll \i scroll \i0 , NSCell \i cell \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to perform special handling of cells that are being brought into use for the first time, or are being retrieved from the cache for reuse. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is tried. If the \i dataDelegate \i0 does not respond either, the cell itself is tried (with \f2\fs20 -tableScroll:reviveAtRow:column: \f3\fs28 ).\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -reviveCell:atRow:column: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollSelectedBackgroundColorChanged:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollSelectedBackgroundColorChanged: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollSelectedBackgroundColorChanged \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the delegate that MiscTableScroll received a \f2\fs20 -setSelectedBackgroundColor: \f3\fs28 message that actually changed the selected background color. The \i notification \i0 is \f4\fs24 MiscTableScrollSelectedBackgroundColorChangedNotification \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollSelectedTextColorChanged:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollSelectedTextColorChanged: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollSelectedTextColorChanged \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the delegate that MiscTableScroll received a \f2\fs20 -setSelectedTextColor: \f3\fs28 message that actually changed the text color. The \i notification \i0 is \f4\fs24 MiscTableScrollSelectedTextColorChangedNotification \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:setStringValue:atRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b setStringValue: \b0 (NSString*) \i s \b\i0 atRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b tableScrollSetStringValueAtLocation \b0 (TableScroll \i scroll \i0 , String \i s \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This message is sent from within \f2\fs20 -textDidEndEditing: \f3\fs28 when a cell editing session has successfully finished (not aborted) and the string value for the cell was actually changed. This method provides the delegate with an after-the-fact veto option. If the \i delegate \i0 returns NO, then the MiscTableScroll object assumes that the change was rejected, and that the cell retains its previous contents. If the \i delegate \i0 returns YES, then the MiscTableScroll object assumes that the delegate stored the new string value into the appropriate cell, and that slot needs to have its sort position reevaluated. This method is optional for delegates of eager MiscTableScroll objects. This method is mandatory for delegates of lazy MiscTableScroll objects that allow cell editing. If the \i delegate \i0 implements this method, the \i delegate \i0 is responsible for setting the string value in the appropriate cell in the MiscTableScroll object. \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 Cell Editing \b0 (Introduction) \b \ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollSlotDragged:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollSlotDragged: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollSlotDragged \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the \i delegate \i0 whenever the user drags a slot to a new position. The \i notification \i0 is \f4\fs24 MiscTableScrollSlotDraggedNotification \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollSlotResized:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollSlotResized: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollSlotResized \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the \i delegate \i0 whenever the user resizes a slot. The \i notification \i0 is \f4\fs24 MiscTableScrollSlotResizedNotification \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollSlotSortReversed:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollSlotSortReversed: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollSlotSortReversed \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the \i delegate \i0 whenever the user reverses the sort direction of a slot. The \i notification \i0 is \f4\fs24 MiscTableScrollSlotSortReversedNotification \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:stateAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b stateAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C]\ \pard\tx2480\tx2860\tx3240\fs28\fi-620\li2520\fc0\cf0 int \b tableScrollStateAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f2\fs20 -stateAtRow:column: \f3\fs28 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f2\fs20 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f2\fs20 -state \f3\fs28 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f4\fs24 state \f3\fs28 values.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -stateAtRow:column:, -isLazy, -setLazy:, -state \b0 (NSButtonCell) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:stringValueAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b stringValueAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b tableScrollStringValueAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f2\fs20 -stringValueAtRow:column: \f3\fs28 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f2\fs20 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f2\fs20 -stringValue \f3\fs28 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f4\fs24 string \f3\fs28 values.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -stringValueAtRow:column:, -isLazy, -setLazy:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:tagAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (int) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b tagAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b tableScrollTagAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f2\fs20 -tagAtRow:column: \f3\fs28 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f2\fs20 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f2\fs20 -tag \f3\fs28 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f4\fs24 tag \f3\fs28 values.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -tagAtRow:column:, -isLazy, -setLazy:\ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollTextColorChanged:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollTextColorChanged: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollTextColorChanged \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the delegate that MiscTableScroll received a \f2\fs20 -setTextColor: \f3\fs28 message that actually changed the text color. The \i notification \i0 is \f4\fs24 MiscTableScrollTextColorChangedNotification \f3\fs28 .\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:titleAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSString*) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b titleAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 String \b tableScrollTitleAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Lazy tables send this message to the \i delegate \i0 and then the \i dataDelegate \i0 to retrieve the value for \f2\fs20 -titleAtRow:column: \f3\fs28 . If the \i delegate \i0 or \i dataDelegate \i0 respond to this message, that value is returned. If neither responds to the message, or if the table is not lazy, the cell is retrieved via \f2\fs20 -cellAtRow:column: \f3\fs28 . If the cell responds to the \f2\fs20 -title \f3\fs28 message, that value is returned; otherwise zero is returned. This method gives lazy tables the opportunity to provide the information content of cells without the overhead of preparing and formatting a cell. You should implement this method in your \i delegate \i0 or \i dataDelegate \i0 if you have any slots that contain \f4\fs24 title \f3\fs28 values.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -cellAtRow:column:, -stringValueAtRow:column:, -isLazy, -setLazy:, -title \b0 (NSButtonCell) \b \ \pard\tx7140\f0\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:validRequestorForSendType:returnType:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (id) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b validRequestorForSendType: \b0 (NSString*) \i sendType \i0 \b returnType: \b0 (NSString*) \i returnType \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 Object \b tableScrollValidRequestorForTypes \b0 (TableScroll \i scroll \i0 , String \i sendType \i0 , String \i returnType \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to interact with the services system using different combinations of send and return types than the MiscTableScroll object alone normally does. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is tried.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -validRequestorForSendType:returnType: \b0\fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollWillEdit:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollWillEdit: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollWillEdit \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the \i delegate \i0 that a cell editing session is about to start. This is a notification only. There is no veto option associated with this message. A veto option is provided with \f2\fs20 -tableScroll:canEdit:atRow:column: \f3\fs28 . This notification, and its counterpart, \f2\fs20 -tableScrollDidEdit: \f3\fs28 , bracket cell editing sessions for delegates that want to perform extra operations before and after cell editing sessions without interfering with any of the begin/end decisions. The \i notification \i0 is \f4\fs24 MiscTableScrollWillEditNotification \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -tableScrollDidEdit:, Cell Editing \b0 (Introduction) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollWillPrint:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollWillPrint: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollWillPrint \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Informs the delegate that a printing session is about to start. This is a notification only. There is no veto option associated with this message. This notification is sent from \f4\fs24 -print: \f3\fs28 before the NSPrintPanel is presented to the user. This notification, and its counterpart, \f2\fs20 -tableScrollDidPrint: \f3\fs28 , bracket printing sessions for delegates that want to perform extra operations before and after printing sessions. This method is useful for pre-print setup operations like overriding global NSPrintInfo settings. The \i notification \i0 is \f4\fs24 MiscTableScrollWillPrintNotification \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -tableScrollDidPrint: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollWillPrintPageFooter:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollWillPrintPageFooter: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollWillPrintPageFooter \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 The \i notification \i0 is \f4\fs24 MiscTableScrollWillPrintPageFooterNotification \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -tableScrollWillPrintPageHeader: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollWillPrintPageHeader:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScrollWillPrintPageHeader: \b0 (NSNotification*) \i notification \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollWillPrintPageHeader \b0 (NSNotification \i notification \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 The \i notification \i0 is \f4\fs24 MiscTableScrollWillPrintPageHeaderNotification \f3\fs28 .\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -tableScrollWillPrintPageFooter: \b0 (delegate method) \fs16 \ \pard\tx7140\f0\b\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:writeSelectionToPasteboard:types:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b writeSelectionToPasteboard: \b0 (NSPasteboard*) \i pboard \i0 \b types: \b0 (NSArray*) \i types \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b tableScrollWriteSelectionToPasteboardOfTypes \b0 (TableScroll \i scroll \i0 , NSPasteboard \i pboard \i0 , NSArray \i types \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 If the \i delegate \i0 responds to this message, the \i delegate \i0 has the opportunity to completely take over the writing of data to the pasteboard. If the \i delegate \i0 does not respond, the \i dataDelegate \i0 is tried.\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2780\tx3280\tx3760\f0\b\fs24\fi-1300\li2800\fc0\cf0 See also: \f3\fs28 -writeSelectionToPasteboard:types:\ \pard\tx11280\b0\fs70\fi-240\li6320\fc0\cf0 \ \pard\f0\b\fs28\fi-1020\li1200\fc0\cf0 Delegate Methods for Dragging Source Operations\ \pard\tx7140\fs16\li1360\fc0\cf0 \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:allowDragOperationAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b allowDragOperationAtRow: \b0 (int) \i row \b\i0 column \i : \b0\i0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b tableScrollAllowDragOperationAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This message is sent to the \i delegate \i0 or the \i dataDelegate \b\i0 \b0 if necessary by the MiscTableScroll to determine whether or not dragging an image from a cell should be allowed. The appropriate delegate should return YES if dragging the image from the cell at \i row \i0 and \i col \i0 is allowed, or NO if it is not.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:draggingSourceOperationMaskForLocal:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSDraggingOperation) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b draggingSourceOperationMaskForLocal: \b0 (BOOL) \i isLocal \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b tableScrollDraggingSourceOperationMask \b0 (TableScroll \i scroll \i0 , boolean \i isLocal \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This message is sent to the \i delegate \i0 or the \i dataDelegate \i0 if necessary in order to give the delegate a chance to respond to NSDraggingSource's \f2\fs20 -draggingSourceOperationMaskForLocal: \f3\fs28 method. If the delegate does not implement this method, then MiscTableScroll returns \f2\fs20 NSDragOperationGeneric \f3\fs28 by default.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScrollIgnoreModifierKeysWhileDragging:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b tableScrollIgnoreModifierKeysWhileDragging: \b0 (MiscTableScroll*) \i scroll \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b tableScrollIgnoreModifierKeysWhileDragging \b0 (TableScroll \i scroll \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This message is sent to the \i delegate \i0 or the \i dataDelegate \i0 if necessary in order to give the delegate a chance to respond to NSDraggingSource's \f2\fs20 -ignoreModifierKeysWhileDragging \f3\fs28 method. If the delegate does not implement this method, then MiscTableScroll returns YES by default.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:imageForDragOperationAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (NSImage*) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b imageForDragOperationAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 NSImage \b tableScrollImageForDragOperationAtLocation \b0 (TableScroll \i scroll \i0 , int \i row \i0 , int \i col \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This message is sent to the \i delegate \i0 or the \i dataDelegate \i0 if necessary to give the delegate a chance to provide the image used for the dragging operation. This method is required for non-image cells. It is optional for image cells, in which case, if the \i delegate \i0 does not implement it or if it returns 0, then the image stored in the cell is used for dragging instead.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:preparePasteboard:forDragOperationAtRow:column:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (void) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b preparePasteboard: \b0 (NSPasteboard*) \i pb \i0 \b forDragOperationAtRow: \b0 (int) \i row \b\i0 column: \b0 (int) \i col \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b tableScrollPreparePasteboardForDragOperationAtLocation \b0 (TableScroll \i scroll \i0 , NSPasteboard \i pb \i0 , int \i row \i0 , int \i col) \i0\fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This message is sent to the \i delegate \i0 or the \i dataDelegate \i0 if necessary in order to have the NSPasteboard \i pb \i0 prepared for the dragging operation. The appropriate delegate \i must \i0 send a \f2\fs20 -declareTypes:num:owner: \f3\fs28 message to the NSPasteboard followed by appropriate \f2\fs20 -set \f3\fs28 ... \f2\fs20 :forType: \f3\fs28 or \f2\fs20 -write \f3\fs28 ... messages if needed. Extra precaution should be taken when declaring a non-null pasteboard \i owner \i0 as discussed in the \b Image Dragging \b0 section of this document.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 tableScroll:shouldDelayWindowOrderingForEvent:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f3 (BOOL) \b tableScroll: \b0 (MiscTableScroll*) \i scroll \i0 \b shouldDelayWindowOrderingForEvent: \b0 (NSEvent*) \i event \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 boolean \b tableScrollShouldDelayWindowOrderingForEvent \b0 (TableScroll \i scroll \i0 , NSEvent \i event \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 This message is sent to the \i delegate \i0 or the \i dataDelegate \i0 if necessary in order to give the delegate a chance to respond to NSView's - \f2\fs20 shouldDelayWindowOrderingForEvent: \f3\fs28 method. This method is only invoked if the delegate's \f2\fs20 -tableScroll:allowDragOperationAtRow:column: \f3\fs28 method indicates that the cell under the mouse is a potential a dragging source. If the delegate does not implement this method, then this method returns YES by default.\ \pard\tx11280\fs70\fi-240\li6320\fc0\cf0 \ \pard\f0\b\fs28\fi-1020\li1200\fc0\cf0 Notifications\ \pard\tx7140\fs16\li1360\fc0\cf0 \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollBackgroundColorChangedNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollBackgroundColorChangedNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever \f4\fs24 -setBackgroundColor: \f3\fs28 is invoked with a color different than the current background color. The notification object is the MiscTableScroll in which the color changed. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx3960\tx6840\ul\fs24\fi-4940\li6840\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"Color" \f2\fs20 NSColor \f3\fs24 The new color. \f4 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollChangeFontNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollChangeFontNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever \f2\fs20 -changeFont: \f3\fs28 is invoked with a new font is that different than the current font. The NSFontManager sends the \f2\fs20 -changeFont: \f3\fs28 message whenever the user changes the font using either the Font Panel or the Font menu. This is distinguished from programmatic changes via the \f2\fs20 -setFont: \f3\fs28 method so that you can record user preferences. This notification message is sent after the font change has been applied, but before the new font is displayed. The notification object is the MiscTableScroll in which the font changed. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx3960\tx6840\ul\fs24\fi-4940\li6840\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"OldFont" NSFont \f3 The old font. \f4 \ @"NewFont" NSFont \f3 The new font. \f4 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollDidBecomeFirstResponderNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollDidBecomeFirstResponderNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever MiscTableScroll's \i documentView \i0 becomes first responder. The notification object is the MiscTableScroll which contains the document view.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollDidEditNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollDidEditNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever a cell-editing session terminated. This notification is sent after both \f2\fs20 -tableScroll:abortEdit:atRow:column: \f3\fs28 and \f2\fs20 -tableScroll:setStringValue:atRow:column: \f3\fs28 , so it is sent in all cases when cell editing terminates, regardless of the reason. The notification object is the MiscTableScroll in which cell editing occurred. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx3960\tx6840\ul\fs24\fi-4940\li6840\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"Changed" NSNumber -boolValue \f3 YES if the text changed, NO if it did not. \f4 \ @"Row" NSNumber -intValue \f3 The cell's row. \fs28 \ \f4\fs24 @"Column" NSNumber -intValue \f3 The cell's column. \fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollDidPrintNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollDidPrintNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever a printing session terminates. This notification is sent from \f4\fs24 -print: \f3\fs28 after printing has completed and gives the listener an opportunity to peform post-print cleanup, such as restoring global NSPrintInfo values. The notification object is the MiscTableScroll in which printing occurred.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollDidResignFirstResponderNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollDidResignFirstResponderNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever MiscTableScroll's \i documentView \i0 resigns first responder. The notification object is the MiscTableScroll which contains the document view.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollFontChangedNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollFontChangedNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever \f2\fs20 -setFont: \f3\fs28 is invoked with a new font that is different than the current font. This notification message is sent after all font changes, both user-initiated and programmatic. The notification is sent after the font change has been applied, but before the new font is displayed. The notification object is the MiscTableScroll in which the font changed. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx3960\tx6840\ul\fs24\fi-4940\li6840\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"OldFont" NSFont \f3 The old font. \f4 \ @"NewFont" NSFont \f3 The new font. \f4 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollSelectedBackgroundColorChangedNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollSelectedBackgroundColorChangedNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever \f2\fs20 -setSelectedBackgroundColor: \f3\fs28 is invoked with a color different than the current selected background color. The notification object is the MiscTableScroll in which the color changed. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx3960\tx6840\ul\fs24\fi-4940\li6840\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"Color" \f2\fs20 NSColor \f3\fs24 The new color. \f4 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollSelectedTextColorChangedNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollSelectedTextColorChangedNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever \f2\fs20 -setSelectedTextColor: \f3\fs28 is invoked with a color differnet than the current text color. The notification object is the MiscTableScroll in which the color changed. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx3960\tx6840\ul\fs24\fi-4940\li6840\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"Color" \f2\fs20 NSColor \f3\fs24 The new color. \f4 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollSlotDraggedNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollSlotDraggedNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever the user drags a slot to a new position. The notification object is the MiscTableScroll in which the slot was dragged. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx3960\tx6840\ul\fs24\fi-4940\li6840\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"Border" NSNumber -intValue \f3 The slot's border; either \f4 MISC_COL_BORDER \f3 or \f4 MISC_ROW_BORDER \f3 . \f4 \ @"OldSlot" NSNumber -intValue \f3 The old slot position. \fs28 \ \f4\fs24 @"NewSlot" NSNumber -intValue \f3 The new slot position. \fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollSlotResizedNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollSlotResizedNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever the user resizes a slot. The notification object is the MiscTableScroll in which the slot was resized. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx3960\tx6840\ul\fs24\fi-4940\li6840\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"Border" NSNumber -intValue \f3 The slot's border; either \f4 MISC_COL_BORDER \f3 or \f4 MISC_ROW_BORDER \f3 . \f4 \ @"Slot" NSNumber -intValue \f3 The slot. \fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollSlotSortReversedNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollSlotSortReversedNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever the user reverses the sort direction of a slot. The notification object is the MiscTableScroll in which the slot sort was reversed. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx3960\tx6840\ul\fs24\fi-4940\li6840\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"Border" NSNumber -intValue \f3 The slot's border; either \f4 MISC_COL_BORDER \f3 or \f4 MISC_ROW_BORDER \f3 . \f4 \ @"Slot" NSNumber -intValue \f3 The slot. \fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollTextColorChangedNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollTextColorChangedNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever \f2\fs20 -setTextColor: \f3\fs28 is invoked with a color different than the current text color. The notification object is the MiscTableScroll in which the color changed. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx3960\tx6840\ul\fs24\fi-4940\li6840\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"Color" \f2\fs20 NSColor \f3\fs24 The new color. \f4 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollWillEditNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollWillEditNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever a cell editing session is about to start. This notification, and its counterpart, \f2\fs20 MiscTableScrollDidEditNotification \f3\fs28 , bracket cell editing sessions. The notification object is the MiscTableScroll in which cell editing will occur. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx3960\tx6840\ul\fs24\fi-4940\li6840\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"Row" NSNumber -intValue \f3 The cell's row. \fs28 \ \f4\fs24 @"Column" NSNumber -intValue \f3 The cell's column. \fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollWillPrintNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollWillPrintNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Posted whenever a printing session is about to start. This notification is sent from \f4\fs24 -print: \f3\fs28 before the NSPrintPanel is presented to the user. This notification, and its counterpart, \f2\fs20 MiscTableScrollDidPrintNotification \f3\fs28 , bracket printing sessions. This notification may be useful for pre-print setup operations like overriding global NSPrintInfo settings. The notification object is the MiscTableScroll in which printing will occur.\ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollWillPrintPageFooterNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollWillPrintPageFooterNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 The notification object is the MiscTableScroll which will print the page footer. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx5400\tx8640\ul\fs24\fi-6740\li8640\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"View" NSView \f3 The footer. \fs28 \ \f4\fs24 @"PageWidth" NSNumber -floatValue \f3 The paper width from NSPrintInfo. \fs28 \ \f4\fs24 @"PageHeight" NSNumber -floatValue \f3 The paper height from NSPrintInfo. \fs28 \ \f4\fs24 @"PrintRectX" NSNumber -floatValue \f3 The document-view's X coordinate. \fs28 \ \f4\fs24 @"PrintRectY" NSNumber -floatValue \f3 The document-view's Y coordinate. \fs28 \ \f4\fs24 @"PrintRectWidth" NSNumber -floatValue \f3 The document-view's width. \fs28 \ \f4\fs24 @"PrintRectHeight" NSNumber -floatValue \f3 The document-view's height. \fs28 \ \f4\fs24 @"FirstPrintRow" NSNumber -intValue \f3 One's complement if started on previous page. \fs28 \ \f4\fs24 @"LastPrintRow" NSNumber -intValue \f3 One's complement if ends on later page. \fs28 \ \f4\fs24 @"FirstPrintColumn" NSNumber -intValue \f3 One's complement if started on previous page. \fs28 \ \f4\fs24 @"LastPrintColumn" NSNumber -intValue \f3 One's complement if ends on later page. \fs28 \ \f4\fs24 @"PrintPage" NSNumber -intValue \f3 Current page; 1 <= PrintPage <= NumberOfPrintPages. \fs28 \ \f4\fs24 @"PrintRow" NSNumber -intValue \f3 Current row; 1 <= PrintRow <= NumberOfPrintRows. \fs28 \ \f4\fs24 @"PrintColumn" NSNumber -intValue \f3 Current column; 1 <= PrintColumn <= NumberOfPrintColumns. \fs28 \ \f4\fs24 @"NumberOfPrintPages" NSNumber -intValue \f3 Number of pages that will be printed. \fs28 \ \f4\fs24 @"NumberOfPrintRows" NSNumber -intValue \f3 Number of rows that will be printed. \fs28 \ \f4\fs24 @"NumberOfPrintColumns" NSNumber -intValue \f3 Number of columns that will be printed. \fs28 \ \f4\fs24 @"ScaleFactor" NSNumber -doubleValue \f3 The scale factor from NSPrintInfo. \fs28 \ \f4\fs24 @"IsScaled" NSNumber -boolValue \f3 Flag indicating if scaling is enabled. \fs28 \ \pard\tx7140\f0\b\fs16\fi-380\li2480\fc0\cf0 \ \ \ \ \pard\tx8260\fs28\li1500\fc0\cf0 MiscTableScrollWillPrintPageHeaderNotification \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ TableScrollWillPrintPageHeaderNotification \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx2480\tx2860\tx3240\f3\b0\fs16\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 The notification object is the MiscTableScroll which will print the page header. The \f2\fs20 userInfo \f3\fs28 dictionary contains these keys and values:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx5400\tx8640\ul\fs24\fi-6740\li8640\fc0\cf0 Key \ulnone \ul Value \ulnone \ul Description\ \f4\ulnone @"View" NSView \f3 The header. \fs28 \ \f4\fs24 @"PageWidth" NSNumber -floatValue \f3 The paper width from NSPrintInfo. \fs28 \ \f4\fs24 @"PageHeight" NSNumber -floatValue \f3 The paper height from NSPrintInfo. \fs28 \ \f4\fs24 @"PrintRectX" NSNumber -floatValue \f3 The document-view's X coordinate. \fs28 \ \f4\fs24 @"PrintRectY" NSNumber -floatValue \f3 The document-view's Y coordinate. \fs28 \ \f4\fs24 @"PrintRectWidth" NSNumber -floatValue \f3 The document-view's width. \fs28 \ \f4\fs24 @"PrintRectHeight" NSNumber -floatValue \f3 The document-view's height. \fs28 \ \f4\fs24 @"FirstPrintRow" NSNumber -intValue \f3 One's complement if started on previous page. \fs28 \ \f4\fs24 @"LastPrintRow" NSNumber -intValue \f3 One's complement if ends on later page. \fs28 \ \f4\fs24 @"FirstPrintColumn" NSNumber -intValue \f3 One's complement if started on previous page. \fs28 \ \f4\fs24 @"LastPrintColumn" NSNumber -intValue \f3 One's complement if ends on later page. \fs28 \ \f4\fs24 @"PrintPage" NSNumber -intValue \f3 Current page; 1 <= PrintPage <= NumberOfPrintPages. \fs28 \ \f4\fs24 @"PrintRow" NSNumber -intValue \f3 Current row; 1 <= PrintRow <= NumberOfPrintRows. \fs28 \ \f4\fs24 @"PrintColumn" NSNumber -intValue \f3 Current column; 1 <= PrintColumn <= NumberOfPrintColumns. \fs28 \ \f4\fs24 @"NumberOfPrintPages" NSNumber -intValue \f3 Number of pages that will be printed. \fs28 \ \f4\fs24 @"NumberOfPrintRows" NSNumber -intValue \f3 Number of rows that will be printed. \fs28 \ \f4\fs24 @"NumberOfPrintColumns" NSNumber -intValue \f3 Number of columns that will be printed. \fs28 \ \f4\fs24 @"ScaleFactor" NSNumber -doubleValue \f3 The scale factor from NSPrintInfo. \fs28 \ \f4\fs24 @"IsScaled" NSNumber -boolValue \f3 Flag indicating if scaling is enabled. \fs28 \ \pard\tx11280\fs70\fi-240\li6320\fc0\cf0 \ \pard\f0\b\fs28\fi-1020\li1200\fc0\cf0 Constants and Defined Types \f3\b0\fs24 [Objective-C] \f0\b\fs28 \ \pard\tx7140\fs16\li1360\fc0\cf0 \ \pard\tx5400\f4\b0\fs24\li1500\fc0\cf0 extern NSString* const MiscTableScrollSlotDraggedNotification;\ extern NSString* const MiscTableScrollSlotSortReversedNotification;\ extern NSString* const MiscTableScrollSlotResizedNotification;\ extern NSString* const MiscTableScrollChangeFontNotification;\ extern NSString* const MiscTableScrollFontChangedNotification;\ extern NSString* const MiscTableScrollBackgroundColorChangedNotification;\ extern NSString* const MiscTableScrollSelectedBackgroundColorChangedNotification;\ extern NSString* const MiscTableScrollSelectedTextColorChangedNotification;\ extern NSString* const MiscTableScrollTextColorChangedNotification;\ extern NSString* const MiscTableScrollWillPrintNotification;\ extern NSString* const MiscTableScrollDidPrintNotification;\ extern NSString* const MiscTableScrollWillPrintPageHeaderNotification;\ extern NSString* const MiscTableScrollWillPrintPageFooterNotification;\ extern NSString* const MiscTableScrollWillEditNotification;\ extern NSString* const MiscTableScrollDidEditNotification;\ \pard\tx6480\li2100\fc0\cf0 \ \pard\tx5400\li1500\fc0\cf0 typedef int MiscPixels;\ typedef int MiscCoord_V; // Visual coordinate.\ typedef int MiscCoord_P; // Physical coordinate.\ \ #define MISC_MIN_PIXELS_SIZE ((MiscPixels) 10)\ #define MISC_MAX_PIXELS_SIZE ((MiscPixels) 0x7FFF0000)\ \pard\tx6480\li2100\fc0\cf0 \ \pard\tx5400\li1500\fc0\cf0 typedef enum\ \{\ MISC_COL_BORDER,\ MISC_ROW_BORDER\ \} MiscBorderType;\ \pard\tx6480\li2100\fc0\cf0 \ \pard\tx5400\li1500\fc0\cf0 #define MISC_MAX_BORDER MISC_ROW_BORDER\ #defineMISC_OTHER_BORDER(B) \\\ (B == MISC_ROW_BORDER ? MISC_COL_BORDER : MISC_ROW_BORDER)\ \pard\tx6480\li2100\fc0\cf0 \ \ \pard\tx5400\li1500\fc0\cf0 typedef struct\ \{\ NSSize page_size; // [NSPrintInfo paperSize]\ NSRect print_rect; // MiscTableView rect.\ MiscCoord_V first_print_row;// one's comp if started on prev page.\ MiscCoord_V last_print_row; // one's comp if ends on later page.\ MiscCoord_V first_print_col;// one's comp if started on prev page.\ MiscCoord_V last_print_col; // one's comp if ends on later page.\ int print_page; // 1 <= print_page <= num_print_pages\ int print_row; // 1 <= print_row <= num_print_rows\ int print_col; // 1 <= print_col <= num_print_cols\ int num_print_pages;\ int num_print_rows;\ int num_print_cols;\ double scale_factor;\ BOOL is_scaled;\ \} MiscTablePrintInfo;\ \pard\tx6480\li2100\fc0\cf0 \ \ \pard\tx5400\li1500\fc0\cf0 typedef enum\ \{\ MISC_NO_TITLE, // No titles on row/col cells.\ MISC_NUMBER_TITLE, // Titles are sequential numbers.\ MISC_ALPHA_TITLE, // Titles are sequential alphabetics...\ MISC_CUSTOM_TITLE, // Titles are user-supplied strings...\ MISC_DELEGATE_TITLE // Ask the delegate for titles.\ \} MiscTableTitleMode;\ \ #define MISC_MAX_TITLE MISC_DELEGATE_TITLE\ \pard\tx6480\li2100\fc0\cf0 \ \ \pard\tx5400\li1500\fc0\cf0 typedef enum\ \{\ MISC_LIST_MODE,\ MISC_RADIO_MODE,\ MISC_HIGHLIGHT_MODE\ \} MiscSelectionMode;\ \ #define MISC_MAX_MODE MISC_HIGHLIGHT_MODE\ \pard\tx6480\li2100\fc0\cf0 \ \ \pard\tx5400\li1500\fc0\cf0 typedef enum\ \{\ MISC_TABLE_CELL_TEXT,\ MISC_TABLE_CELL_IMAGE,\ MISC_TABLE_CELL_BUTTON,\ MISC_TABLE_CELL_CALLBACK\ \} MiscTableCellStyle;\ \ #define MISC_TABLE_CELL_MAX MISC_TABLE_CELL_CALLBACK\ \pard\tx6480\li2100\fc0\cf0 \ \ \pard\tx6120\li1500\fc0\cf0 #define MISC_SIZING_SPRINGY_BIT (1 << 0) // Adjusts for global limits.\ #define MISC_SIZING_USER_BIT (1 << 1) // User can resize.\ \pard\tx6480\li2100\fc0\cf0 \ \ \pard\tx5400\li1500\fc0\cf0 typedef enum\ \{\ MISC_NUSER_NSPRINGY_SIZING,\ MISC_NUSER_SPRINGY_SIZING,\ MISC_USER_NSPRINGY_SIZING,\ MISC_USER_SPRINGY_SIZING,\ \} MiscTableSizing;\ \ #define MISC_MAX_SIZING MISC_USER_SPRINGY_SIZING\ \pard\tx6480\li2100\fc0\cf0 \ \ \pard\tx5400\li1500\fc0\cf0 typedef enum\ \{\ MISC_SORT_ASCENDING,\ MISC_SORT_DESCENDING\ \} MiscSortDirection;\ \ #define MISC_SORT_DIR_MAX MISC_SORT_DESCENDING\ #defineMISC_OTHER_DIRECTION(D) \\\ ((D) == MISC_SORT_DESCENDING ? \\\ MISC_SORT_ASCENDING : MISC_SORT_DESCENDING)\ \pard\tx6480\li2100\fc0\cf0 \ \ \pard\tx7200\li1500\fc0\cf0 typedef enum // Selector used to get data:\ \{\ MISC_SORT_STRING_CASE_INSENSITIVE, // -stringValue\ MISC_SORT_STRING_CASE_SENSITIVE, // -stringValue\ MISC_SORT_INT, // -intValue\ MISC_SORT_UNSIGNED_INT, // -intValue\ MISC_SORT_TAG, // -tag\ MISC_SORT_UNSIGNED_TAG, // -tag\ MISC_SORT_FLOAT, // -floatValue\ MISC_SORT_DOUBLE, // -doubleValue\ MISC_SORT_SKIP, // Don't compare cells in this slot.\ MISC_SORT_TITLE_CASE_INSENSITIVE, // -title\ MISC_SORT_TITLE_CASE_SENSITIVE, // -title\ MISC_SORT_STATE, // -state\ MISC_SORT_UNSIGNED_STATE, // -state\ \} MiscSortType;\ \ \pard\tx5760\li1500\fc0\cf0 #define MISC_SORT_TYPE_MAX MISC_SORT_UNSIGNED_STATE\ #define MISC_SORT_CUSTOM ((MiscSortType)(int(MISC_SORT_TYPE_MAX) + 1))\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0\cf0 \ \ \pard\tx3600\li1500\fc0\cf0 @class MiscTableScroll;\ \ typedef struct MiscEntrySortInfo MiscEntrySortInfo;\ typedef struct MiscSlotSortInfo MiscSlotSortInfo;\ \pard\tx5040\li2100\fc0\cf0 \ \pard\tx3600\li1500\fc0\cf0 typedef int (*MiscCompareEntryFunc)\ ( int r1, int c1, int r2, int c2, \ MiscEntrySortInfo const* entry_info,\ MiscSlotSortInfo* sort_info );\ \ typedef int (*MiscCompareSlotFunc)\ ( int slot1, int slot2, MiscSlotSortInfo* );\ \ extern int MiscDefaultCompareSlotFunc\ ( int slot1, int slot2, MiscSlotSortInfo* );\ \pard\tx5040\li2100\fc0\cf0 \ \pard\tx2160\li1500\fc0\cf0 #define MISC_TS_TYPE_AT( TYPE, NAME ) \\\ typedef TYPE (*MISC_TS_##NAME##_AT)(id,SEL,id,int r,int c, ...);\ \pard\tx3600\li1500\fc0\cf0 \ \pard\tx7020\li1500\fc0\cf0 MISC_TS_TYPE_AT( int, INT ) // MISC_TS_INT_AT\ MISC_TS_TYPE_AT( float, FLOAT ) // MISC_TS_FLOAT_AT\ MISC_TS_TYPE_AT( double, DOUBLE ) // MISC_TS_DOUBLE_AT\ MISC_TS_TYPE_AT( char const*, STRING ) // MISC_TS_STRING_AT\ \pard\tx5040\li2100\fc0\cf0 \ \pard\tx2160\tx5040\li1500\fc0\cf0 typedef union\ \{\ MISC_TS_INT_AT i;\ MISC_TS_FLOAT_AT f;\ MISC_TS_DOUBLE_AT d;\ MISC_TS_STRING_AT s;\ \} MISC_TS_VAL_AT_FUNC;\ \pard\tx5040\li2100\fc0\cf0 \ \pard\tx3600\li1500\fc0\cf0 #define MISC_TS_TYPE_VAL( TYPE, NAME ) \\\ typedef TYPE (*MISC_TS_##NAME##_VAL)(id,SEL);\ \pard\tx5040\li2100\fc0\cf0 \ \pard\tx7200\li1500\fc0\cf0 MISC_TS_TYPE_VAL( int, INT ) // MISC_TS_INT_VAL\ MISC_TS_TYPE_VAL( float, FLOAT ) // MISC_TS_FLOAT_VAL\ MISC_TS_TYPE_VAL( double, DOUBLE ) // MISC_TS_DOUBLE_VAL\ MISC_TS_TYPE_VAL( char const*, STRING ) // MISC_TS_STRING_VAL\ \pard\tx5040\li2100\fc0\cf0 \ \pard\tx2160\tx5040\li1500\fc0\cf0 typedef union\ \{\ MISC_TS_INT_VAL i;\ MISC_TS_FLOAT_VAL f;\ MISC_TS_DOUBLE_VAL d;\ MISC_TS_STRING_VAL s;\ \} MISC_TS_VAL_FUNC;\ \pard\tx3220\tx6500\li2100\fc0\cf0 \ \ \pard\tx3600\li1500\fc0\cf0 // *** WARNING ***\ // The sizes of these structures are likely to change between versions.\ // *** WARNING ***\ \pard\tx5040\li2100\fc0\cf0 \ \pard\tx2160\li1500\fc0\cf0 struct MiscEntrySortInfo\ \{\ int slot;\ int ascending;\ MISC_TS_VAL_AT_FUNC value_func;\ id value_target;\ SEL value_sel;\ id value_obj;\ IMP cell_at_func;\ id cell_class;\ SEL cell_sel;\ MISC_TS_VAL_FUNC cell_func;\ MiscSortType sort_type;\ MiscCompareEntryFunc compare_func;\ \};\ \ \ struct MiscSlotSortInfo\ \{\ MiscTableScroll* table_scroll;\ NSZone* zone;\ MiscBorderType border_type;\ int num_entries;\ MiscEntrySortInfo const* entry_info;\ BOOL need_copy;\ \};\ \pard\tx11280\f3\fs70\fi-240\li6320\fc0\cf0 \ \pard\f0\b\fs28\fi-1020\li1200\fc0\cf0 Constants and Defined Classes \f3\b0\fs24 [Java] \f0\b\fs28 \ \pard\tx7140\fs16\li1360\fc0\cf0 \ \pard\tx5400\f4\b0\fs24\li1500\fc0\cf0 // Notifications.\ public static final String TableScrollSlotDraggedNotification;\ public static final String TableScrollSlotSortReversedNotification;\ public static final String TableScrollSlotResizedNotification;\ public static final String TableScrollChangeFontNotification;\ public static final String TableScrollFontChangedNotification;\ public static final String TableScrollBackgroundColorChangedNotification;\ public static final String TableScrollSelectedBackgroundColorChangedNotification;\ public static final String TableScrollSelectedTextColorChangedNotification;\ public static final String TableScrollTextColorChangedNotification;\ public static final String TableScrollWillPrintNotification;\ public static final String TableScrollDidPrintNotification;\ public static final String TableScrollWillPrintPageHeaderNotification;\ public static final String TableScrollWillPrintPageFooterNotification;\ public static final String TableScrollWillEditNotification;\ public static final String TableScrollDidEditNotification;\ \ // Slot size restrictions.\ public static final int MIN_PIXELS_SIZE = 10;\ public static final int MAX_PIXELS_SIZE = 0x7FFF0000;\ \ // Borders.\ public static final int BORDER_COLUMN = 0;\ public static final int BORDER_ROW = 1;\ \ // Title mode.\ public static final int TITLE_NONE = 0;\ public static final int TITLE_NUMBER = 1;\ public static final int TITLE_ALPHA = 2;\ public static final int TITLE_CUSTOM = 3;\ public static final int TITLE_DELEGATE = 4;\ \ // Selection mode.\ public static final int SELECTION_MODE_LIST = 0;\ public static final int SELECTION_MODE_RADIO = 1;\ public static final int SELECTION_MODE_HIGHLIGHT = 2;\ \ // Cell style.\ public static final int CELL_TYPE_TEXT = 0;\ public static final int CELL_TYPE_IMAGE = 1;\ public static final int CELL_TYPE_BUTTON = 2;\ public static final int CELL_TYPE_CALLBACK = 3;\ \ // Sort direction.\ public static final int SORT_ORDER_ASCENDING = 0;\ public static final int SORT_ORDER_DESCENDING = 1;\ \ // Sort type.\ public static final int SORT_STRING_CASE_INSENSITIVE = 0;\ public static final int SORT_STRING_CASE_SENSITIVE = 1;\ public static final int SORT_INT = 2;\ public static final int SORT_UNSIGNED_INT = 3;\ public static final int SORT_TAG = 4;\ public static final int SORT_UNSIGNED_TAG = 5;\ public static final int SORT_FLOAT = 6;\ public static final int SORT_DOUBLE = 7;\ public static final int SORT_SKIP = 8;\ public static final int SORT_TITLE_CASE_INSENSITIVE = 9;\ public static final int SORT_TITLE_CASE_SENSITIVE = 10;\ public static final int SORT_STATE = 11;\ public static final int SORT_UNSIGNED_STATE = 12;\ \ // Cell coordinate wrapper.\ public static class Location implements Cloneable \{\ public final int row, column;\ public String toString();\ \}\ \}\ } MiscKit2/Palettes/MiscTableScroll/Framework/Documentation/MiscExporter.rtf100444 1750 1750 32373 6757227321 27251 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\ftech Symbol;\f2\fswiss Helvetica;\f3\fmodern Courier;\f4\fmodern Ohlfs;} \paperw16220 \paperh8500 \margl120 \margr0 {\colortbl;\red0\green0\blue0;} \f0\b0\i0\ulnone\ql\fs24\fi0\li0\gray0\fc1\cf1\up0\dn0 Version 2.0, Copyright \f1\fc0\cf0 \f0\fc1\cf1 1996, 1997, 1999 by Paul S. McCarthy and Eric Sunshine. All Rights Reserved.\ \fc0\cf0 Paul S. McCarthy and Eric Sunshine -- May 3, 1999\ \pard\tx2480\tx2860\tx3240\fc0\cf0 \ \pard\f2\b\fs52\li1460\fc1\cf1 MiscExporter\ \pard\tx4880\fs48\li1460\fc0\cf0 \ \pard\tx4220\fs24\fi-2720\li4220\fc0\cf0 Inherits From: \f0\b0\fs28 NSObject \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx4220\f2\b\fs24\fi-2740\li4220\fc0\cf0 Declared In: \f0\b0\fs28\fc1\cf1 MiscExporter.h \fc0\cf0 \ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx4220\f2\b\fs24\fi-2740\li4220\fc0\cf0 Java Class: \f0\b0\fs28 org.misckit.yellow.application.TableScroll.Exporter\ \fs20 \ \ \pard\f2\b\fs28\fi-1020\li1200\fc1\cf1 Class Description\ \fs16\fi0\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f0\b0\fs28\li1500\fc1\cf1 This class provides an easy means to export the contents of an instance of MiscTableScroll in the following output formats:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx1800\tx3360\tx3740\fs28\fi-300\li1800\fc0\cf0 ASCII fixed field widths\ ASCII tab separated fields\ ASCII delimited (quoted fields, comma-separated)\ dBASEIII (dbf)\ \pard\tx3600\tx3980\tx4340\fs14\li1500\fc0\cf0 \ \fs56 \ \pard\f2\b\fs28\fi-1020\li1200\fc1\cf1 Instance Variables \f0\b0\fs24\fc0\cf0 [Objective-C] \f2\b\fs28\fc1\cf1 \ \fs16\fi0\li1360\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\f0\b0\fs28\li1500\fc0\cf0 MiscTableScroll \b *tableScroll \b0 ;\ MiscExportFormat \b exportFormat \b0 ;\ MiscExportTitleMode \b rowTitleMode \b0 ;\ MiscExportTitleMode \b columnTitleMode \b0 ;\ MiscExportGridMode \b rowGrid \b0 ;\ MiscExportGridMode \b columnGrid \b0 ;\ \pard\tx6140\tx9660\tx10180\fs16\fi-4040\li6140\fc0\cf0 \ \ \pard\tx4320\fs28\li1500\fc0\cf0 tableScroll The table scroll object to export.\ \fs16 \ \fs28 exportFormat Output format.\ \fs16 \ \fs28 rowTitleMode Row title option setting.\ \fs16 \ \fs28 columnTitleMode Column title option setting.\ \fs16 \ \fs28 rowGrid Row grid option setting.\ \fs16 \ \fs28 columnGrid Column grid option setting.\ \pard\tx3600\tx3980\tx4340\fs14\li1500\fc0\cf0 \ \fs56 \ \pard\f2\b\fs28\fi-1020\li1200\fc1\cf1 Method Types\ \fs16\fi0\li1360\fc0\cf0 \ \pard\tx6080\tx11280\f0\b0\fs28\fi-4840\li6320\fc1\cf1 Initializing + commonInstance\ \pard\tx11280\fi-240\li6320\fc1\cf1 init\ \fs10\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc1\cf1 Exporting exportTableScroll:\ \pard\tx11280\fi-240\li6320\fc1\cf1 exportTableScroll:toFilename:\ \fs10\fc0\cf0 \ \pard\tx6080\tx11280\fs28\fi-4840\li6320\fc1\cf1 Setting and getting attributes getColumnExportGridMode\ \pard\tx11280\fi-240\li6320\fc1\cf1 getColumnExportTitleMode\ getExportFormat\ getRowExportGridMode\ getRowExportTitleMode\ setColumnExportGridMode:\ setColumnExportTitleMode:\ setExportFormat:\ setRowExportGridMode:\ setRowExportTitleMode:\ \pard\f2\b\fs16\li1360\fc0\cf0 \ \ \ \ \ \fs28\fi-1020\li1200\fc1\cf1 Class Methods\ \fs16\fi0\li1360\fc0\cf0 \ \pard\tx8260\fs28\li1500\fc0\cf0 commonInstance\ \pard\f0\b0\fi-620\li2520\fc0\cf0 + (MiscExporter*) \b commonInstance \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 static MiscExporter \b commonInstance \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns a pointer to a single shared instance, which can be used from anywhere.\ \fs14 \ \fs46 \ \pard\f2\b\fs28\fi-1020\li1200\fc1\cf1 Instance Methods\ \fs16\fi0\li1360\fc0\cf0 \ \pard\tx8260\fs28\li1500\fc0\cf0 exportTableScroll:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (int) \b exportTableScroll: \b0 (MiscTableScroll*) \i ts \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b exportTableScroll \b0 (TableScroll* \i ts \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Runs the NSSavePanel with an accessory view for the user to choose the output filename and other options for exporting the MiscTableScroll, \i ts \i0 . You can pre-initialize the MiscExporter object with any settings that you choose, but the user will be able to override your pre-set values via the accessory view on the NSSavePanel. Returns zero (0) on success, minus one (-1) if the user pressed "Cancel" at the save panel, or the MiscTableScroll has no columns, or \i errno \i0 if there was an error opening or closing the file.\ \fs14 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 exportTableScroll:toFilename:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (int) \b exportTableScroll: \b0 (MiscTableScroll*) \i ts \i0 \b\fi0 toFilename: \b0 (NSString*) \i\fc1\cf1 filenam \fc0\cf0 e \i0\fs24\fi-620 [Objective-C] \fs28\fi0 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b exportTableScroll \b0 (TableScroll* \i ts \i0\fc1\cf1 , \fi0 S \fc0\cf0 tring \fi-620 \i\fi0\fc1\cf1 filenam \fc0\cf0 e \i0\fi-620 ) \fs24 [Java] \fs28\fi0 \ \fs16\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Uses the current option settings and exports the MiscTableScroll, \i ts \i0 , to \i filename \i0 , over-writing the file if it is present. This method does not run the NSSavePanel. Returns zero (0) on success, minus one (-1) if \i ts \i0 is NULL or has no columns, or \i errno \i0 if there was an error opening or closing the file.\ \fs14 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 getColumnExportGridMode\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (MiscExportGridMode) \b getColumnExportGridMode \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b getColumnExportGridMode \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \i columnGrid \i0 .\ \fs14 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 getColumnExportTitleMode\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (MiscExportTitleMode) \b getColumnExportTitleMode \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b getColumnExportTitleMode \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \i columnTitleMode \i0 .\ \fs14 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 getExportFormat\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (MiscExportFormat) \b getExportFormat \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b getExportFormat \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \i exportFormat \i0 .\ \fs14 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 getRowExportGridMode\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (MiscExportGridMode) \b getRowExportGridMode \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b getRowExportGridMode \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \i rowGrid \i0 .\ \fs14 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 getRowExportTitleMode\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (MiscExportTitleMode) \b getRowExportTitleMode \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 int \b getRowExportTitleMode \b0\fc1\cf1 () \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Returns \i rowTitle \i0 .\ \fs14 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 init\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (id) \b init \b0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\b\fi-620\li2520\fc0\cf0 Exporter \b0\fc1\cf1 () \fs24\fc0\cf0 [Java constructor] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Initializes a newly allocated MiscExporter object. The default settings are:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx4320\tx9520\f3\fs24\fi-2420\li4320\fc0\cf0 exportFormat MISC_EXPORT_ASCII_FIXED\ rowTitleMode MISC_EXPORT_TITLES_OFF\ columnTitleMode MISC_EXPORT_TITLES_ON\ rowGrid MISC_EXPORT_GRID_OFF\ columnGrid MISC_EXPORT_GRID_LINE\ \pard\tx2480\tx2860\tx3240\f0\fs28\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\li1500\fc0\cf0 Returns \b self \b0 .\ \fs14 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 setColumnExportGridMode:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setColumnExportGridMode: \b0 (MiscExportGridMode) \i gridMode \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnExportGridMode \b0 (int \i gridMode \i0 ) \fs24 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Assigns \i gridMode \i0 to \i columnGrid \i0 . Column grid mode controls the lines/spaces between columns in fixed-width ASCII output format. The available values are:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx6120\tx8640\ul\fs24\fi-2420\li4320\fc1\cf1 Objective-C \ulnone \ul Java \ulnone \ul Description\ \f3\ulnone MISC_EXPORT_GRID_OFF GRID_OFF \f0 No grid \f3 \ MISC_EXPORT_GRID_LINE GRID_LINE \f0 Lines, col-grid='|', row-grid='-' \f3 \ MISC_EXPORT_GRID_SPACE GRID_SPACE \f0 Spaces col-grid=' ', row-grid=' ' \f3 \ \pard\tx2480\tx2860\tx3240\f0\fs28\li2100\fc0\cf0 \ \pard\tx3600\tx3980\tx4340\li1500\fc0\cf0 Grid mode only affects \f3\fs24\fc1\cf1 MISC_EXPORT_ASCII_FIXED \f0\fs28\fc0\cf0 export format. The other output formats do not produce a grid of any kind under any circumstances.\ \fs14 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 setColumnExportTitleMode:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setColumnExportTitleMode: \b0 (MiscExportTitleMode) \i titleMode \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setColumnExportTitleMode \b0 (int \i titleMode \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Assigns \i titleMode \i0 to \i columnTitle \i0 . Column title mode controls whether or not titles are included in the output for all ASCII formats, and controls the formatting of the titles for fixed-width ASCII output format. Column title mode has no impact on dBASEIII (.dbf) output format. The available values are:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx6120\tx8640\ul\fs24\fi-2420\li4320\fc1\cf1 Objective-C \ulnone \ul Java \ulnone \ul Description\ \f3\ulnone MISC_EXPORT_TITLES_OFF TITLES_OFF \f0 No titles. \f3 \ MISC_EXPORT_TITLES_ON TITLES_ON \f0 Full width, expand column if needed. \f3 \ MISC_EXPORT_TITLES_WRAP TITLES_WRAP \f0 Wrap titles within data width. \f3 \ MISC_EXPORT_TITLES_TRUNCATE TITLES_TRUNCATE \f0 Truncate titles to data width. \f3 \ \pard\tx3600\tx3980\tx4340\f0\fs14\li1500\fc0\cf0 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 setExportFormat:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setExportFormat: \b0 (MiscExportFormat) \i format \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setExportFormat \b0 (int \i format \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Assigns \i format \i0 to \i exportFormat \i0 . The available values are:\ \pard\tx2480\tx2860\tx3240\fs16\li2100\fc0\cf0 \ \pard\tx2340\tx6120\tx8640\ul\fs24\fi-2420\li4320\fc1\cf1 Objective-C \ulnone \ul Java\ \f3\ulnone MISC_EXPORT_ASCII_FIXED FORMAT_ASCII_FIXED\ MISC_EXPORT_ASCII_TAB FORMAT_ASCII_TAB\ MISC_EXPORT_ASCII_DELIMITED FORMAT_ASCII_DELIMITED\ MISC_EXPORT_DBF FORMAT_DBF\ \pard\tx3600\tx3980\tx4340\f0\fs14\li1500\fc0\cf0 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 setRowExportGridMode:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setRowExportGridMode: \b0 (MiscExportGridMode) \i gridMode \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowExportGridMode \b0 (int \i gridMode \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Assigns \i gridMode \i0 to \i rowGrid \i0 . See \f3\fs24\fc1\cf1 -setColumnExportGridMode: \f0\fs28\fc0\cf0 .\ \fs14 \ \fs46 \ \pard\tx8260\f2\b\fs28\li1500\fc0\cf0 setRowExportTitleMode:\ \pard\f1\b0\fi-620\li2520\fc0\cf0 - \f0 (void) \b setRowExportTitleMode: \b0 (MiscExportTitleMode) \i titleMode \i0\fs24 [Objective-C] \fs28 \ \pard\tx2480\tx2860\tx3240\fi-620\li2520\fc0\cf0 void \b setRowExportTitleMode \b0 (int \i titleMode \i0\fc1\cf1 ) \fs24\fc0\cf0 [Java] \fs28 \ \fs16\fi0\li2100 \ \pard\tx3600\tx3980\tx4340\fs28\li1500\fc0\cf0 Assigns \i titleMode \i0 to \i rowTitleMode \i0 . Turning on titles will include physical row numbers if no explicit row titles have been set for the MiscTableScroll object. Row titles are either on or off. \f3\fs24\fc1\cf1 MISC_EXPORT_TITLES_OFF \f0\fs28 turns the titles off. Any other value turns them on. The other formatting values do not affect row titles. See \f3\fs24 -setColumnExportTitleMode: \f0\fs28 . \fc0\cf0 \ } MiscKit2/Palettes/MiscTableScroll/Framework/English.lproj/ 40755 1750 1750 0 6757227322 23673 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/Framework/English.lproj/MiscExporterAccessoryView-macintosh.nib/ 40755 1750 1750 0 6743450730 33554 5ustar sunshinesunshine././@LongLink 0 0 0 156 0 10710 Lustar rootwheelMiscKit2/Palettes/MiscTableScroll/Framework/English.lproj/MiscExporterAccessoryView-macintosh.nib/classes.nibMiscKit2/Palettes/MiscTableScroll/Framework/English.lproj/MiscExporterAccessoryView-macintosh.nib/c100444 1750 1750 1240 6757227322 34015 0ustar sunshinesunshine{ IBClasses = ( {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = MiscExporterAccessoryView; LANGUAGE = ObjC; OUTLETS = { colGridBox = id; colGridPop = id; colTitleBox = id; colTitlePop = id; formatBox = id; formatPop = id; rowGridBox = id; rowGridPop = id; rowTitleBox = id; rowTitlePop = id; window = id; }; SUPERCLASS = NSObject; } ); IBVersion = 1; }././@LongLink 0 0 0 156 0 10710 Lustar rootwheelMiscKit2/Palettes/MiscTableScroll/Framework/English.lproj/MiscExporterAccessoryView-macintosh.nib/objects.nibMiscKit2/Palettes/MiscTableScroll/Framework/English.lproj/MiscExporterAccessoryView-macintosh.nib/o100444 1750 1750 6642 6757227322 34044 0ustar sunshinesunshine streamtyped@NSIBObjectDataNSObjectNSCustomObject)@@NSString+MiscExporterAccessoryViewi(NSMenui@@@ OtherViewsNSMutableArrayNSArray NSMenuItemA i@@IIi@@@@:i@OffNSCustomResource)NSImageNSMenuCheckmarkNSMenuMixedState_popUpItemAction:NSPopUpButtonCellNSMenuItemCell NSButtonCell> NSActionCellNSCell>ii@@@@NSFont[28c]Charcoalf ci: NSPopUpButtonNSButton NSControl)NSView) NSResponderNSBox) @@@@fffffffficc@ ssii@@@@@K@i@i< OtherViewsß ASCII-Fixedß ASCII-TabßASCII-DelimitedßdBASE III (.DBF)_++ff@@cccFormatЙҙ``ҒԶK@…< OtherViews֟OffՒ֟OnՒ֟WrapՒ֟TruncateՒ``В1j+j+ Row Titles``咅綁K@…< OtherViewsOff蒅On蒅Wrap蒅Truncate蒅``㒅j+j+ Column Titles``K@…< OtherViewsOffLineSpace``pj+j+ Column Grid p1j+j+Row Grid````K@…<LineSpaceЖÖ㺖 NSWindowTemplate) iiffffi@@@@@c"xpExporter AccessoryNSWindowViewffff к֖ÖԖ֖ҖÖ֖Ö֖ք PopUpList섘݄21ʄ22򄘘3 2̄3ۄ1 File's Owner1Ä PopUpList߄32Ȅ1 1Window PopUpList鄘 PopUpList PopUpList NSMutableSetNSSetINSNibOutletConnectorNSNibConnector@@@ colGridBox. colGridPop.ㄘ colTitleBox.焘 colTitlePop. formatBox. formatPop. rowGridBox. rowGridPop.Є rowTitleBox.Ԅ rowTitlePop.window.Ԅ nextKeyView.ԸF.F.F.F9@i;-EJTŸ:)¼9J3G$5H+,¾•ANEPIS 9=L7I 1FºCO ·1;K#?HR*! ±6GQ<>&'( 7@ B¸4AC?MUMiscKit2/Palettes/MiscTableScroll/Framework/English.lproj/MiscExporterAccessoryView.nib/ 40755 1750 1750 0 6722775726 31605 5ustar sunshinesunshine././@LongLink 0 0 0 145 0 10706 Lustar rootwheelMiscKit2/Palettes/MiscTableScroll/Framework/English.lproj/MiscExporterAccessoryView.nib/data.classesMiscKit2/Palettes/MiscTableScroll/Framework/English.lproj/MiscExporterAccessoryView.nib/data.classe100444 1750 1750 720 6757227323 33755 0ustar sunshinesunshine"FirstResponder" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSObject; }; "MiscExporterAccessoryView" = { ACTIONS = {}; OUTLETS = { colGridBox = id; colGridPop = id; colTitleBox = id; colTitlePop = id; formatBox = id; formatPop = id; rowGridBox = id; rowGridPop = id; rowTitleBox = id; rowTitlePop = id; window = id; }; SUPERCLASS = NSObject; }; MiscKit2/Palettes/MiscTableScroll/Framework/English.lproj/MiscExporterAccessoryView.nib/objects.nib100444 1750 1750 10170 6757227323 34033 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+MiscExporterAccessoryViewi-NSMenuTemplate) ffccc@@@@' OtherViews NSPopUpListNSMatrix< NSControl)NSView) NSResponder @@@@ffffffffR<R<icc@#iiii:::ffffi@@@@@ NSMenuItem NSMenuCell NSButtonCell9 NSActionCellNSCell<R(NSMutableArrayNSArrayii@@@@OffNSFont[20c] Helveticaf ci: ssIi@@@@@@Line@Space@NSColorffNSButton}YY NSPopUpButtonNSBox)` ASCII-FixedpopUp:' OtherViews NSPopUpListPP(Ĭȱ@ ASCII-Tabȱ@ASCII-Delimitedȱ@dBASE III (.DBF)ȱ@ʆ}YY±@NSCustomResource)NSImageNXpopupӖԄNXpopupH:_++ff@@cccFormatڙܙ``ܒ`Off' OtherViews NSPopUpListZPZPZ(ଅ䱁@On䱁@Wrap䱁@Truncate䱁@憄}YYޱ@օ``ڒ1j+j+ Row Titles``򒅒`Off' OtherViews NSPopUpListRPRPR(@On@Wrap@Truncate@}YY@օ``𒅒j+j+ Column Titles```Off' OtherViews NSPopUpListR<R<R( @Line@Space@}YY @օ``pj+j+ Column Grid ܁܁p1j+j+Row Grid`````@օ䖺–䖾𼖯NSWindowTemplate) iiffffi@@@@@c"܁pxExporter AccessoryNSWindowViewffffŖȖ ޖȖږ Ȗڼ Ȗܖ File's Owner PopUpList PopUpListWindowń PopUpList PopUpListᄘ PopUpList NSMutableSetNSSetINSIBOutletConnector NSIBConnector@@@ colGridBox0Õ colGridPop0Õ colTitleBox0Õ􄘘 colTitlePop0Õ formatBox0Մ formatPop0Õ rowGridBox0Õ rowGridPop0Õڄ rowTitleBox0Õބ rowTitlePop0Õwindow0ބ nextKeyView0޺H0÷H0 H0 H>@iEO @ĝ8AM9I$3F?LĹ1>"JR ('=<ı7LTĺ4# Ī:%ĕ& CN!/EKS ;Ję;ķ67Hį9GPAIQ5G?=KC B ,)ļ*+ ľUMiscKit2/Palettes/MiscTableScroll/Framework/MiscBorderCell.h100444 1750 1750 4053 6757227324 24256 0ustar sunshinesunshine#ifndef __MiscBorderCell_h #define __MiscBorderCell_h //============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscBorderCell.h // // Cell class used by MiscBorderView to manage column headings and row // labels for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscBorderCell.h,v 1.5 98/03/29 23:38:20 sunshine Exp $ // $Log: MiscBorderCell.h,v $ // Revision 1.5 98/03/29 23:38:20 sunshine // v138.1: Now derived from NSTableHeaderCell rather than NSTextFieldCell // so that it knows how to correctly draw and color itself on all platforms // rather than only being able to draw itself in a NextStep-like fashion. // // Revision 1.4 97/03/23 05:45:42 sunshine // v125.4: Worked around OPENSTEP 4.1 bug where -setupFieldEditorAttributes: // never gets called, so text was not drawing white. Worked around problem by // subclassing from NSTextFieldCell rather than NSCell. This way color can // be set with -setTextColor:. //----------------------------------------------------------------------------- extern "Objective-C" { #import } class NSImage; @interface MiscBorderCell : NSTableHeaderCell { NSImage* toggleImage; } - (void)setToggleImage:(NSImage*)image; @end #endif // __MiscBorderCell_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscBorderView.M100444 1750 1750 137103 6757227324 24321 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscBorderView.M // // View class for the row/column borders on a MiscTableView. // Supports resizing, dragging. // // NOTE: *COORDS* // COORDINATE SYSTEM RULES: // // 1) The BorderView and the TableView must *NOT* be scaled or rotated. // There is no reason to do so, and supporting this unnecessary // capability is complicated and slow. The entire TableScroll // can be scaled and/or rotated, but the BorderView and // TableView subviews should not be scaled and/or rotated // relative to the TableScroll. // // 2) This means that the only coordinate transformations that are // necessary when converting coordinates between the BorderView, // TableView and/or TableScroll are simple translations. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscBorderView.M,v 1.30 99/06/14 23:11:13 sunshine Exp $ // $Log: MiscBorderView.M,v $ // Revision 1.30 99/06/14 23:11:13 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Method renamed: -moveSlotFrom:to: --> -moveSlot:toSlot: // Method renamed: -slotDraggedFrom:to: --> -slotDragged:toSlot: // No longer uses PostScript "instance drawing" during slot resizing. Now // uses NSWindow's new -cacheImageInRect: & -restoreCachedImage: instead. // Handling of cursor rectangles changed in MacOS/X Server DR2. They fixed a // problem where small, adjacent, non-overlapping rectangles were not handled // properly in earlier versions of the AppKit. Unfortunately their fix broke // the our work-around for earlier versions. Now our fix is conditionally // compiled in on platforms which require it. // // Revision 1.29 1998/05/13 14:50:17 sunshine // v139.1: Worked around AppKit problem where it sends -mouseDown: events to // this view even though they are out of bounds. // // Revision 1.28 98/03/29 23:41:40 sunshine // v138.1: Fixed v134.1 bug: No longer suspends/resumes editing when border // view is used to change slot selection. This broke relationship where one // and only selected slot was the one containing the edit session. // Fixed to account for new MiscBorderCell implementation which requires that // cell's highlight flag change rather than state in order to show selection. // Moved MISC_FRAME_HEIGHT & MISC_FRAME_WIDTH into MiscTableScrollPrivate.h // since MiscTableBorder.cc also needs access to those values. //----------------------------------------------------------------------------- #import "MiscBorderView.h" #import "MiscBorderCell.h" #import "MiscGeometry.h" #import "MiscHighlightTracker.h" #import "MiscListTracker.h" #import "MiscRadioTracker.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import "MiscTableView.h" #import "MiscTableWell.h" #import #import #import extern "Objective-C" { #import #import #import #import #import #import #import #import #import } extern "C" { #import #import #import #import // memset(). #import // FILENAME_MAX } static float MIN_TOGGLE_WIDTH = 5; static float TOGGLE_WIDTH = 5; int const MISC_RESIZE_EPSILON = 4; static NSCursor* horzCursor = 0; static NSCursor* vertCursor = 0; static NSCursor* dragCursor = 0; static NSCursor* reverseCursor = 0; static NSImage* sortAscendImage = 0; static NSImage* sortAscendHImage = 0; static NSImage* sortDescendImage = 0; static NSImage* sortDescendHImage = 0; static BOOL sendingPeriodicEvents = NO; static inline MiscPixels dmin( MiscPixels a, MiscPixels b ) { return (a < b ? a : b); } static inline MiscPixels dmax( MiscPixels a, MiscPixels b ) { return (a > b ? a : b); } //----------------------------------------------------------------------------- // Prior to MacOS/X Server DR2, the AppKit did not handle small, adjacent // cursor rectangles properly. In some cases, depending upon the movement // direction of the mouse, such a cursor rectangle was frequently ignored. To // work around the problem, the rectangles were overlapped. As of DR2, // overlapping rectangles are improperly handled and often ignored depending // upon the direction of mouse movement. The following patch uses overlapping // rectangles prior to DR2, and non-overlapping rectangles for DR2 and later. // // *FIXME* The current patch only fixes cursor rectangles for horizontal mouse // movement on DR2. Specifically, the current patch only keeps the toggle and // resize rectangles from overlapping. However, both rectangles still overlap // the drag rectangle. Consequently the resulting cursor rectangles do not // work with vertical mouse movement. //----------------------------------------------------------------------------- #if defined(NS_TARGET_MAJOR) && (NS_TARGET_MAJOR < 5) #define MISC_BROKEN_CURSOR_RECTS MISC_RESIZE_EPSILON #else #define MISC_BROKEN_CURSOR_RECTS 0 #endif //---------------------------------------------------------------------------- // stopTimer //---------------------------------------------------------------------------- static inline void stopTimer() { if (sendingPeriodicEvents) { [NSEvent stopPeriodicEvents]; sendingPeriodicEvents = NO; } } //---------------------------------------------------------------------------- // startTimer //---------------------------------------------------------------------------- static inline void startTimer() { if (!sendingPeriodicEvents) { sendingPeriodicEvents = YES; [NSEvent startPeriodicEventsAfterDelay:0.1 withPeriod:0.1]; } } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscBorderView //----------------------------------------------------------------------------- // + imageNamed: //----------------------------------------------------------------------------- + (id)imageNamed:(NSString*)name { NSImage* image = [NSImage imageNamed:name]; if (image == 0) { NSString* path = [[NSBundle bundleForClass:self] pathForImageResource:name]; if (path != 0) { image = [[[NSImage alloc] initByReferencingFile:path] autorelease]; [image setName:name]; } } return image; } //----------------------------------------------------------------------------- // + cursorWithImage:hot: //----------------------------------------------------------------------------- + (NSCursor*)cursorWithImage:(NSString*)name hot:(NSPoint)pt { NSImage* image = [self imageNamed:name]; return [[[NSCursor alloc] initWithImage:image hotSpot:pt] autorelease]; } //----------------------------------------------------------------------------- // + cursorWithImage: //----------------------------------------------------------------------------- + (NSCursor*)cursorWithImage:(NSString*)name { return [self cursorWithImage:name hot:NSMakePoint( 8, 8 )]; } //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (void)initialize { if (horzCursor == 0) { horzCursor = [[self cursorWithImage:@"MiscHorzResizeCursor"] retain]; vertCursor = [[self cursorWithImage:@"MiscVertResizeCursor"] retain]; dragCursor = [[self cursorWithImage:@"MiscSlotDragCursor"] retain]; reverseCursor = [[self cursorWithImage:@"MiscReverseCursor" hot:NSMakePoint( 4, 0 )] retain]; sortAscendImage = [[self imageNamed:@"MiscSortAscend"] retain]; sortAscendHImage = [[self imageNamed:@"MiscSortAscendH"] retain]; sortDescendImage = [[self imageNamed:@"MiscSortDescend"] retain]; sortDescendHImage = [[self imageNamed:@"MiscSortDescendH"] retain]; TOGGLE_WIDTH = [sortAscendImage size].width; if (TOGGLE_WIDTH < MIN_TOGGLE_WIDTH) TOGGLE_WIDTH = MIN_TOGGLE_WIDTH; } } //----------------------------------------------------------------------------- // TYPE VARIATIONS //----------------------------------------------------------------------------- - (MiscPixels)frameHeight { NSRect rect = [self frame]; return (MiscPixels) (isHorz ? rect.size.height : rect.size.width); } - (void)setFrameHeight:(MiscPixels)x { NSRect rect = [self frame]; if (isHorz) rect.size.height = x; else rect.size.width = x; [self setFrame:rect]; } - (NSCursor*)cursor { return isHorz ? horzCursor : vertCursor; } - (MiscBorderType)borderType { return isHorz ? MISC_COL_BORDER : MISC_ROW_BORDER; } - (MiscTableBorder*)otherBorder { return [scroll border:MISC_OTHER_BORDER([self borderType])]; } - (void)clearOtherBorder { [self otherBorder]->selectNone(); } - (id)cellAtRow:(MiscCoord_P)row column:(MiscCoord_P)col { return isHorz ? [scroll cellAtRow:row column:col] : [scroll cellAtRow:col column:row]; } //----------------------------------------------------------------------------- // - changeFrameIfNeeded // FIXME: The frame updates need to be untangled. All requests should // go through the table-scroll object. Implementations should only // update themselves, not other objects. //----------------------------------------------------------------------------- - (void)changeFrameIfNeeded { MiscRect_O r( isHorz, [self frame] ); MiscPixels const my_width = r.getWidth_O(); MiscPixels const i_width = info->totalSize(); if (my_width != i_width) { [[self window] invalidateCursorRectsForView:self]; r.setWidth_O( i_width ); [self setFrameSize:r]; [[scroll documentView] adjustSize]; } } //----------------------------------------------------------------------------- // - setPos:width: //----------------------------------------------------------------------------- - (void)setPos:(MiscCoord_V)pos width:(MiscPixels)size { MiscCoord_P pPos = info->visualToPhysical(pos); [scroll border:[self borderType] setSlot:pPos size:(float)size]; [[self window] invalidateCursorRectsForView:self]; [scroll setNeedsDisplay:YES]; } //----------------------------------------------------------------------------- // - initWithFrame:scroll:info:type: //----------------------------------------------------------------------------- - (id)initWithFrame:(NSRect)frameRect scroll:(MiscTableScroll*)i_scroll info:(MiscTableBorder*)i_info type:(MiscBorderViewType)type { NSZone* const z = [self zone]; [super initWithFrame:NSZeroRect]; togglePos = -1; isHorz = (type == MISC_COL_BORDER_VIEW); scroll = i_scroll; info = i_info; theCell = [[MiscBorderCell allocWithZone:z] initTextCell:@"Kilroy"]; oldSel = new( NSZoneMalloc(z,sizeof(*oldSel)) ) MiscSparseSet; [self setSelectionMode:[scroll selectionMode]]; MiscRect_O myFrame( isHorz, frameRect ); myFrame.setWidth_O( i_info->totalSize() ); myFrame.setHeight_O( (isHorz ? MISC_FRAME_HEIGHT : MISC_FRAME_WIDTH) ); [self setFrame:myFrame]; return self; } //----------------------------------------------------------------------------- // - dealloc //----------------------------------------------------------------------------- - (void)dealloc { [theCell release]; [tracker release]; if (oldSel != 0) { oldSel->MiscSparseSet::~MiscSparseSet(); NSZoneFree( [self zone], oldSel ); } [super dealloc]; } //----------------------------------------------------------------------------- // - isFlipped //----------------------------------------------------------------------------- - (BOOL)isFlipped { return YES; } //----------------------------------------------------------------------------- // - isOpaque //----------------------------------------------------------------------------- - (BOOL)isOpaque { return YES; } //============================================================================= // CONVERSIONS //============================================================================= //----------------------------------------------------------------------------- // - range::fromRect: // Returns by reference the range of visual slots contained in rect. // rMin is inclusive, rMax is exclusive. //----------------------------------------------------------------------------- - (void)range:(MiscCoord_V*)rMin :(MiscCoord_V*)rMax fromRect:(NSRect)rect { MiscRect_O r( isHorz, rect ); *rMin = info->visualForOffset( r.getX_O() ); *rMax = info->visualForOffset( r.getMaxX_O() - 1 ) + 1; } //----------------------------------------------------------------------------- // - rectForPos: //----------------------------------------------------------------------------- - (NSRect)rectForPos:(MiscCoord_V)pos { MiscRect_O r( isHorz, [self bounds] ); r.setX_O( info->getOffset(pos) ); r.setWidth_O( info->effectiveSize(pos) ); return r; } //============================================================================= // DRAWING //============================================================================= //----------------------------------------------------------------------------- // - getVisibleRange:: // // Returns by reference the range of visual slots contained in the visible // rectangle. rMin is inclusive, rMax is exclusive. //----------------------------------------------------------------------------- - (void)getVisibleRange:(MiscCoord_V*)rMin :(MiscCoord_V*)rMax { id v = [self superview]; NSRect visRect = [v documentVisibleRect]; [self range:rMin:rMax fromRect:visRect]; } //----------------------------------------------------------------------------- // drewPos: // // Keeps the old selection sets up to date whenever we draw a cell. This // way -selectionChanged has valid data to work from. //----------------------------------------------------------------------------- - (void)drewPos:(MiscCoord_V)slot { BOOL isSelected = info->isSelected( slot ); if (isSelected != oldSel->contains(slot)) { if (isSelected) oldSel->add( slot ); else oldSel->remove( slot ); } } //----------------------------------------------------------------------------- // - drawPos:inRect:controlView: //----------------------------------------------------------------------------- - (void)drawPos:(MiscCoord_V)pos inRect:(NSRect)r controlView:(NSView*)v { NSImage* img = 0; if ([scroll autoSortSlots:MISC_OTHER_BORDER([self borderType])]) if (info->isSortable(pos)) if (info->getSortDirection(pos) == MISC_SORT_DESCENDING) img = togglePos == pos ? sortDescendHImage : sortDescendImage; else img = togglePos == pos ? sortAscendHImage : sortAscendImage; [theCell setToggleImage:img]; [theCell setStringValue:info->getTitle(pos)]; BOOL const need_off = !info->isSelected(pos); // Forces "real" boolean BOOL const is_off = ![theCell isHighlighted]; // in order to compare them. if (need_off != is_off) [theCell highlight:!need_off withFrame:r inView:v]; else [theCell drawWithFrame:r inView:v]; } //----------------------------------------------------------------------------- // - drawPos:updateSel: //----------------------------------------------------------------------------- - (void)drawPos:(MiscCoord_V)pos updateSel:(BOOL)updateSel { if (0 <= pos && pos < info->count()) { NSRect rect = [self rectForPos:pos]; [self drawPos:pos inRect:rect controlView:self]; if (updateSel) [self drewPos:pos]; } } //----------------------------------------------------------------------------- // - drawPos: //----------------------------------------------------------------------------- - (void)drawPos:(MiscCoord_V)pos { [self drawPos:pos updateSel:YES]; } //----------------------------------------------------------------------------- // - drawRect: //----------------------------------------------------------------------------- - (void)drawRect:(NSRect)rect { MiscCoord_V pos_min; MiscCoord_V pos_max; [self range:&pos_min:&pos_max fromRect:rect]; for (MiscCoord_V pos = pos_min; pos < pos_max; pos++) [self drawPos:pos]; } //----------------------------------------------------------------------------- // - drawSlot: [public] //----------------------------------------------------------------------------- - (void)drawSlot:(MiscCoord_V)n { MiscCoord_V rMin, rMax; [self getVisibleRange:&rMin:&rMax]; if (rMin <= n && n < rMax) [self setNeedsDisplayInRect:[self rectForPos:n]]; } //============================================================================= // SELECTION //============================================================================= //----------------------------------------------------------------------------- // - setSelectionMode: //----------------------------------------------------------------------------- - (void)setSelectionMode:(MiscSelectionMode)mode { NSZone* const z = [self zone]; if (tracker) [tracker release]; switch (mode) { case MISC_LIST_MODE: tracker = [MiscListTracker allocWithZone:z]; break; case MISC_RADIO_MODE: tracker = [MiscRadioTracker allocWithZone:z]; break; case MISC_HIGHLIGHT_MODE: tracker = [MiscHighlightTracker allocWithZone:z]; break; } [tracker initBorder:info]; } //----------------------------------------------------------------------------- // - selectionChanged //----------------------------------------------------------------------------- - (void)selectionChanged { MiscSparseSet const& newSel = info->selectionSet(); MiscCoord_V rMin, rMax; [self getVisibleRange:&rMin:&rMax]; for (MiscCoord_V i = rMin; i < rMax; i++) if (oldSel->contains(i) != newSel.contains(i)) [self setNeedsDisplayInRect:[self rectForPos:i]]; *oldSel = newSel; } //----------------------------------------------------------------------------- // - resetSelection //----------------------------------------------------------------------------- - (void)resetSelection { *oldSel = info->selectionSet(); } //----------------------------------------------------------------------------- // - selectPos: //----------------------------------------------------------------------------- - (void)selectPos:(MiscCoord_V)pos { info->selectOne( pos ); [scroll selectionChanged]; } //============================================================================= // CURSOR MANAGEMENT //============================================================================= //----------------------------------------------------------------------------- // - toggleRect:forPos:visible: //----------------------------------------------------------------------------- - (BOOL)toggleRect:(NSRect*)nsrect forPos:(MiscCoord_V)pos visible:(NSRect)vis { MiscPixels const pos_width = info->effectiveSize(pos); if (pos_width > 0) { *nsrect = [self rectForPos:pos]; nsrect->origin.x += nsrect->size.width - (TOGGLE_WIDTH + MISC_RESIZE_EPSILON); nsrect->size.width = TOGGLE_WIDTH + MISC_BROKEN_CURSOR_RECTS; *nsrect = NSIntersectionRect( vis, *nsrect ); return !NSIsEmptyRect( *nsrect ); } return NO; } //----------------------------------------------------------------------------- // - resizeRect:forPos:visible: //----------------------------------------------------------------------------- - (BOOL)resizeRect:(NSRect*)nsrect forPos:(MiscCoord_V)pos visible:(NSRect)vis { MiscPixels const pos_width = info->effectiveSize(pos); if (pos_width > 0) { MiscPixels const pos_offset = info->getOffset(pos); MiscPixels const min_x = pos_offset + pos_width - MISC_RESIZE_EPSILON; MiscRect_O r( isHorz, [self bounds] ); r.setX_O( min_x ); r.setWidth_O( MISC_RESIZE_EPSILON ); *nsrect = NSIntersectionRect( vis, r ); return !NSIsEmptyRect( *nsrect ); } return NO; } //----------------------------------------------------------------------------- // - resetCursorRects //----------------------------------------------------------------------------- - (void)resetCursorRects { BOOL const draggable = info->isDraggable(); BOOL const sizeable = info->isSizeable(); NSRect vis = [self visibleRect]; if (draggable && !info->isModifierDrag()) [self addCursorRect:vis cursor:dragCursor]; if ([scroll autoSortSlots:MISC_OTHER_BORDER([self borderType])]) { MiscCoord_V min_pos, max_pos; [self getVisibleRange:&min_pos:&max_pos]; int const count = info->count(); if (0 <= min_pos && min_pos < count) { NSRect rect; int const lim = (max_pos <= count) ? max_pos : count; for (MiscCoord_V pos = min_pos; pos < lim; pos++) if (info->isSortable(pos) && [self toggleRect:&rect forPos:pos visible:vis]) [self addCursorRect:rect cursor:reverseCursor]; } } if (sizeable) { BOOL const uniform = info->isUniformSize(); NSCursor* const resizeCursor = [self cursor]; MiscCoord_V min_pos, max_pos; [self getVisibleRange:&min_pos:&max_pos]; int const count = info->count(); if (0 <= min_pos && min_pos < count) { NSRect rect; int const lim = (max_pos <= count) ? max_pos : count; for (MiscCoord_V pos = min_pos; pos < lim; pos++) if ((uniform || info->isSizeable(pos)) && [self resizeRect:&rect forPos:pos visible:vis]) [self addCursorRect:rect cursor:resizeCursor]; } } } //============================================================================= // MOUSE-TRACKING //============================================================================= //----------------------------------------------------------------------------- // - posForMousePt: //----------------------------------------------------------------------------- - (MiscCoord_V)posForMousePt:(NSPoint)p { MiscPixels pix = MiscPoint_O( isHorz, p ).getX_O(); MiscRect_O r( isHorz, [self bounds] ); return (pix < r.getMaxX_O() ? info->visualForOffset(pix) : info->count()); } //============================================================================= // RESIZING //============================================================================= //----------------------------------------------------------------------------- // drawTransitoryRect:inView: //----------------------------------------------------------------------------- - (void)drawTransitoryRect:(NSRect)r inView:(NSView*)v { NSWindow* const w = [self window]; [w cacheImageInRect:[v convertRect:r toView:0]]; NSRectFill(r); [w flushWindow]; } //----------------------------------------------------------------------------- // eraseTransitoryRect //----------------------------------------------------------------------------- - (void)eraseTransitoryRect { NSWindow* const w = [self window]; [w restoreCachedImage]; [w discardCachedImage]; [w flushWindow]; } //----------------------------------------------------------------------------- // - resizeEvent:x:deltaX:minX:maxX: //----------------------------------------------------------------------------- - (int)resizeEvent:(NSEvent*)p x:(MiscPixels)x deltaX:(MiscPixels)deltaX minX:(MiscPixels)minX maxX:(MiscPixels)maxX { NSRect nsDocFrame = [scroll documentClipRect]; NSRect nsClipFrame = [[self superview] frame]; MiscRect_O docFrame( isHorz, nsDocFrame ); MiscRect_O clipFrame( isHorz, nsClipFrame ); MiscPixels const minDrawX = clipFrame.getX_O(); // Scroll coords. MiscPixels const maxDrawX = clipFrame.getMaxX_O(); // Scroll coords. unsigned int const WANTED = (NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSPeriodicMask); x += deltaX; MiscPixels draw_x; // Scroll coords. MiscRect_O line( isHorz ); line.setX_O( x - 1 ); line.setY_O( 0 ); line.setWidth_O( 2 ); line.setHeight_O( clipFrame.getHeight_O() + docFrame.getHeight_O() - 1 ); line = [scroll convertPoint:line fromView:self]; draw_x = line.getX_O(); BOOL did_scroll = NO; BOOL in_bounds = (minDrawX <= draw_x && draw_x <= maxDrawX); [scroll lockFocus]; [[NSColor blackColor] set]; if (in_bounds) [self drawTransitoryRect:line inView:scroll]; startTimer(); NSEvent* lastEvent = [p copy]; for (;;) { p = [[self window] nextEventMatchingMask:WANTED]; if (p == 0 || [p type] == NSLeftMouseUp) break; else if ([p type] == NSPeriodic) { NSPoint mousePt = [scroll convertPoint:[lastEvent locationInWindow] fromView:0]; MiscPixels const mousePtX = MiscPoint_O( isHorz,mousePt ).getX_O(); if (mousePtX < minDrawX || maxDrawX < mousePtX) { [self eraseTransitoryRect]; [self autoscroll:lastEvent]; did_scroll = YES; } } else { [lastEvent release]; lastEvent = [p copy]; } NSPoint new_loc = [self convertPoint:[lastEvent locationInWindow] fromView:0]; MiscPixels mouseX = MiscPoint_O( isHorz, new_loc ).getX_O(); MiscPixels new_x = (mouseX + deltaX); if (new_x < minX) new_x = minX; else if (new_x >= maxX) new_x = maxX - 1; BOOL const did_move = (new_x != x); if (did_move || did_scroll) { if (in_bounds && !did_scroll) [self eraseTransitoryRect]; if (did_move) { x = new_x; line.setX_O( x - 1 ); line.setY_O( 0 ); line = [scroll convertPoint:line fromView:self]; draw_x = line.getX_O(); in_bounds = (minDrawX <= draw_x && draw_x <= maxDrawX); } if (in_bounds) [self drawTransitoryRect:line inView:scroll]; did_scroll = NO; } } [lastEvent release]; stopTimer(); if (in_bounds) [self eraseTransitoryRect]; [scroll unlockFocus]; x -= deltaX; return x; } //----------------------------------------------------------------------------- // - resizeEvent:inPos:atX:deltaX:finalWidth: //----------------------------------------------------------------------------- - (BOOL)resizeEvent:(NSEvent*)p inPos:(MiscCoord_V)pos atX:(MiscPixels)x_origin deltaX:(MiscPixels)delta_x finalWidth:(MiscPixels*)finalWidth { MiscPixels const org_x = info->getOffset(pos); MiscPixels const min_x = org_x + info->effectiveMinSize(pos); MiscPixels const max_x = org_x + info->getMaxSize(pos) + 1; MiscPixels const curr_x = [self resizeEvent:p x:x_origin deltaX:delta_x minX:min_x maxX:max_x]; MiscPixels final_delta = curr_x - x_origin; if (final_delta != 0) { *finalWidth = info->effectiveSize(pos) + final_delta; return YES; } return NO; } //----------------------------------------------------------------------------- // - inResizeZone:forPos:atX:deltaX: //----------------------------------------------------------------------------- - (BOOL)inResizeZone:(NSPoint)pt forPos:(MiscCoord_V*)pos atX:(MiscPixels*)pos_x deltaX:(MiscPixels*)delta_x { if (info->isSizeable()) { MiscCoord_V const plim = info->count(); MiscPixels x = MiscPoint_O( isHorz, pt ).getX_O(); MiscCoord_V p = info->visualForOffset(x); if (0 <= p && p < plim) { BOOL const uniform = info->isUniformSize(); MiscPixels max_x = info->getOffset(p) + info->effectiveSize(p); MiscPixels delta = max_x - x; if (0 <= delta && delta <= MISC_RESIZE_EPSILON) { do { p++; } while (p < plim && info->effectiveSize(p) <= 0); p--; if (0 <= p && p < plim && (uniform || info->isSizeable(p))) { *pos = p; *pos_x = x; *delta_x = delta; return YES; } } } } return NO; } //----------------------------------------------------------------------------- // - adjustSize //----------------------------------------------------------------------------- - (void)adjustSize { [self changeFrameIfNeeded]; } //============================================================================= // DRAGGING //============================================================================= //----------------------------------------------------------------------------- // draw_view // Draw a view hierarchy without calling lockFocus so that it can be // drawn onto a different window. Used for drawing the drag cache // window. //----------------------------------------------------------------------------- static void draw_view( NSView* v, NSRect r ) { // FIXME: maybe clip, maybe manually transform graphics state coord matrix. [v drawRect:r]; NSArray* subs = [v subviews]; unsigned int lim = (subs ? [subs count] : 0); for (unsigned int i = 0; i < lim; i++) { NSView* sub = (NSView*)[subs objectAtIndex:i]; NSRect subFrame = NSIntersectionRect( r, [sub frame] ); if (!NSIsEmptyRect( subFrame )) { subFrame = [sub convertRect:subFrame fromView:v]; draw_view( sub, subFrame ); } } } //----------------------------------------------------------------------------- // - dragCacheForPos: // // NOTE *COORDS* // The TableScroll, BorderView, and TableView all share the the same // scaling and rotation. Also, the coordinate system of the TableView // is always anchored at the same "X" offset as the BorderView, so that // (orientation corrected) "X" coordinates and widths can be exchanged // between the two views without further adjustments. //----------------------------------------------------------------------------- - (NSImage*)dragCacheForPos:(MiscCoord_V)pos { NSImage* cache = [[NSImage allocWithZone:[self zone]] init]; MiscTableView* tableView = (MiscTableView*) [scroll documentView]; NSRect nsBorder = [self rectForPos:pos]; NSRect nsTable = [tableView visibleRect]; MiscRect_O oBorder( isHorz, nsBorder ); MiscRect_O oTable( isHorz, nsTable ); MiscSize_O oCache( isHorz ); oCache.setWidth_O( oBorder.getWidth_O() ); oCache.setHeight_O( oBorder.getHeight_O() + oTable.getHeight_O() ); NSSize nsCache = oCache; [cache setSize:nsCache]; if (oTable.getX_O() <= oBorder.getX_O() && // Is entire slot oBorder.getMaxX_O() <= oTable.getMaxX_O()) // visible? { MiscRect_O oScroll( isHorz ); oScroll.setX_O( oBorder.getX_O() ); oScroll.setY_O( oBorder.getY_O() ); oScroll.setWidth_O( oBorder.getWidth_O() ); oScroll.setHeight_O( oCache.getHeight_O() ); NSRect nsScroll = [scroll convertRect:oScroll fromView:self]; [scroll lockFocus]; NSBitmapImageRep* rep = [[[NSBitmapImageRep allocWithZone:[self zone]] initWithFocusedViewRect:nsScroll] autorelease]; [scroll unlockFocus]; [cache addRepresentation:rep]; } else { [cache setFlipped:YES]; [cache lockFocus]; oTable.setX_O( oBorder.getX_O() ); // NOTE *COORDS* oTable.setWidth_O( oBorder.getWidth_O() ); nsTable = oTable; MiscPoint_O oDelta( isHorz, nsTable.origin ); oDelta.setY_O( oDelta.getY_O() - oBorder.getHeight_O() ); NSPoint delta = oDelta; NSView* focusView = [NSView focusView]; [focusView translateOriginToPoint:NSMakePoint( -delta.x, -delta.y )]; draw_view( tableView, nsTable ); [focusView translateOriginToPoint:NSMakePoint( delta.x, delta.y )]; [focusView translateOriginToPoint: NSMakePoint( -nsBorder.origin.x, -nsBorder.origin.y )]; draw_view( self, nsBorder ); [focusView translateOriginToPoint: NSMakePoint( nsBorder.origin.x, nsBorder.origin.y )]; [cache unlockFocus]; } return [cache autorelease]; } //----------------------------------------------------------------------------- // - getVisibleCacheMin:max: //----------------------------------------------------------------------------- - (NSImage*)getVisibleCacheMin:(MiscPixels*)pMin max:(MiscPixels*)pMax { MiscRect_O rDoc( isHorz, [[scroll documentView] visibleRect] ); MiscRect_O rVis( isHorz, [self visibleRect] ); *pMin = rVis.getX_O(); *pMax = rVis.getMaxX_O(); rDoc = [scroll convertRect:rDoc fromView:[scroll documentView]]; rVis = [scroll convertRect:rVis fromView:self]; MiscRect_O r( isHorz ); r.setX_O( rVis.getX_O() ); r.setY_O( rVis.getY_O() ); r.setWidth_O( rVis.getWidth_O() ); r.setHeight_O( rVis.getHeight_O() + rDoc.getHeight_O() ); [scroll lockFocus]; NSBitmapImageRep* rep = [[NSBitmapImageRep allocWithZone:[self zone]] initWithFocusedViewRect:r]; [scroll unlockFocus]; NSImage* cache = [[NSImage allocWithZone:[self zone]] initWithSize:r]; [cache addRepresentation:rep]; return [cache autorelease]; } //----------------------------------------------------------------------------- // - setWells::forPos: //----------------------------------------------------------------------------- - (void)setWells:(MiscTableWell**)w1 :(MiscTableWell**)w2 forPos:(MiscCoord_V)pos { NSZone* const z = [self zone]; MiscTableView* doc = [scroll documentView]; MiscRect_O rDoc( isHorz, [doc visibleRect] ); MiscRect_O rClip( isHorz, [[self superview] frame] ); MiscRect_O r( isHorz ); r.setX_O( info->getOffset(pos) ); r.setWidth_O( info->effectiveSize(pos) ); r.setHeight_O( rClip.getHeight_O() ); *w1 = [[MiscTableWell allocWithZone:z] initWithFrame:r]; [self addSubview:*w1]; r.setY_O( rDoc.getY_O() ); r.setHeight_O( rDoc.getHeight_O() ); *w2 = [[MiscTableWell allocWithZone:z] initWithFrame:r]; [doc addSubview:*w2]; [*w1 display]; [*w2 display]; } //----------------------------------------------------------------------------- // - clearWells:: //----------------------------------------------------------------------------- - (void)clearWells:(MiscTableWell**)w1 :(MiscTableWell**)w2 { [*w1 removeFromSuperview]; [*w2 removeFromSuperview]; [*w1 release]; [*w2 release]; *w1 = 0; *w2 = 0; // NOTE: Does not need display here. Everything will get displayed later. } //----------------------------------------------------------------------------- // - offsetFromEvent: //----------------------------------------------------------------------------- - (float)offsetFromEvent:(NSEvent*)ev { NSPoint mLoc = [self convertPoint:[ev locationInWindow] fromView:0]; return MiscPoint_O( isHorz, mLoc ).getX_O(); } //----------------------------------------------------------------------------- // - calcDrop::: //----------------------------------------------------------------------------- - (MiscCoord_V)calcDrop:(MiscCoord_V)fromPos :(NSPoint)mouseDownPt :(NSPoint)mouseUpPt { MiscCoord_V toPos = fromPos; MiscPixels const start_pos = MiscPoint_O( isHorz, mouseDownPt ).getX_O(); MiscPixels const end_pos = MiscPoint_O( isHorz, mouseUpPt ).getX_O(); MiscPixels const delta_pos = (end_pos - start_pos); MiscPixels const SLOP = 4; if (delta_pos < -SLOP || SLOP < delta_pos) { MiscPixels const start_ofs = info->getOffset( fromPos ); MiscPixels drop_pos = start_ofs + delta_pos; if (delta_pos < 0) drop_pos += SLOP; else drop_pos += info->effectiveSize(fromPos) - SLOP; toPos = info->visualForOffset( drop_pos ); if (toPos < 0) toPos = 0; } return toPos; } //----------------------------------------------------------------------------- // - dragEvent:inPos: //----------------------------------------------------------------------------- - (MiscCoord_V)dragEvent:(NSEvent*)event inPos:(MiscCoord_V)pos { int const WANTED = (NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSPeriodicMask); NSPoint mouseDownPt = [self convertPoint:[event locationInWindow] fromView:0]; NSPoint mouseUpPt = mouseDownPt; NSWindow* win = [self window]; [scroll disableCursor]; [win flushWindow]; [win disableFlushWindow]; NSImage* dragCache = [[self dragCacheForPos:pos] retain]; MiscTableWell *w1, *w2; [self setWells:&w1 :&w2 forPos:pos]; MiscPixels pMin,pMax; NSImage* visCache = [[self getVisibleCacheMin:&pMin max:&pMax] retain]; MiscSize_O size( isHorz, [dragCache size] ); MiscPixels pLoc = info->getOffset( pos ); MiscPixels delta = MiscPixels( [self offsetFromEvent:event] - pLoc ); NSEvent* lastEvent = [event copy]; [scroll lockFocus]; for (;;) { MiscPoint_O pt( isHorz ); MiscRect_O rDrag( isHorz ); MiscPixels const w = size.getWidth_O(); MiscPixels const dw = dmin( dmin( dmin(w, pMax - pMin), pMax - pLoc), pLoc + w - pMin ); BOOL const shouldDraw = (dw > 0); if (shouldDraw) { if (isHorz) { pt.setX( dmax( pLoc, pMin ) ); pt.setY( size.getHeight_O() ); if (pLoc < pMin) rDrag.setX( pMin - pLoc ); } else { pt.setX( 0 ); pt.setY( dmax( pLoc, pMin ) + dw ); if (pLoc + w >= pMax) rDrag.setY( pLoc + w - pMax ); } pt = [scroll convertPoint:pt fromView:self]; rDrag.setWidth_O( dw ); rDrag.setHeight_O( size.getHeight_O() ); [dragCache compositeToPoint:pt fromRect:rDrag operation:NSCompositeCopy]; } [win enableFlushWindow]; [win flushWindow]; event = [[self window] nextEventMatchingMask:WANTED]; [win disableFlushWindow]; if (shouldDraw) { NSSize s = [visCache size]; MiscPixels xTarg; if (isHorz) { xTarg = (pLoc < pMin ? 0 : pLoc - pMin); } else { if (pLoc < pMin) xTarg = MiscPixels(s.height) - dw; else if (pLoc < pMax) xTarg = pMax - pLoc - dw; else xTarg = 0; } MiscRect_O rVis( isHorz ); rVis.setX_O( xTarg ); rVis.setWidth_O( rDrag.getWidth_O() ); rVis.setHeight_O( rDrag.getHeight_O() ); [visCache compositeToPoint:pt fromRect:rVis operation:NSCompositeCopy]; } if (event == 0) break; else if ([event type] == NSLeftMouseUp) { mouseUpPt = [self convertPoint:[event locationInWindow] fromView:0]; break; } else if ([event type] != NSPeriodic) { [lastEvent release]; lastEvent = [event copy]; } MiscPixels mLoc = MiscPixels( [self offsetFromEvent:lastEvent] ); if ((mLoc < pMin && pMin > 0.0) || (mLoc > pMax && pMax < MiscRect_O( isHorz, [self bounds] ).getMaxX_O())) { [self autoscroll:lastEvent]; [visCache release]; visCache = [[self getVisibleCacheMin:&pMin max:&pMax] retain]; mLoc = MiscPixels( [self offsetFromEvent:lastEvent] ); startTimer(); } else { stopTimer(); } pLoc = mLoc - delta; if (pLoc < pMin - size.getWidth_O()) pLoc = pMin - size.getWidth_O(); else if (pLoc > pMax) pLoc = pMax; } [lastEvent release]; stopTimer(); [scroll unlockFocus]; [self clearWells:&w1 :&w2]; [visCache release]; [dragCache release]; MiscCoord_V const toPos = [self calcDrop:pos :mouseDownPt :mouseUpPt]; if (toPos != pos) { [scroll border:[self borderType] moveSlot:pos toSlot:toPos]; [win invalidateCursorRectsForView:self]; [scroll border:[self borderType] slotDragged:pos toSlot:toPos]; [self setNeedsDisplay:YES]; [[scroll documentView] setNeedsDisplay:YES]; } else { // Need to redisplay the slot that the wells were covering. MiscBorderType const b = [self borderType]; int const phys_pos = [scroll border:b slotAtPosition:toPos]; [scroll border:b drawSlotTitle:phys_pos]; [scroll border:b drawSlot:phys_pos]; } [scroll enableCursor]; [scroll displayIfNeeded]; [win enableFlushWindow]; [win flushWindow]; return toPos; } //----------------------------------------------------------------------------- // - awaitDragEvent:inPos: //----------------------------------------------------------------------------- - (MiscCoord_V)awaitDragEvent:(NSEvent*)event inPos:(MiscCoord_V)pos { MiscCoord_V toPos = pos; int const WANTED = (NSLeftMouseUpMask | NSLeftMouseDraggedMask); float const SLOP = 2.0; NSWindow* win = [self window]; NSEvent* mouseDown = [event copy]; NSPoint origLoc = [mouseDown locationInWindow]; for (;;) { NSEvent* p = [win nextEventMatchingMask:WANTED untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:NO]; if (p == 0) break; else if ([p type] == NSLeftMouseUp) { [win nextEventMatchingMask:NSLeftMouseUpMask]; break; } else // ([p type] == NSLeftMouseDragged) { NSPoint newLoc = [p locationInWindow]; if (newLoc.x > origLoc.x + SLOP || newLoc.y > origLoc.y + SLOP || newLoc.x < origLoc.x - SLOP || newLoc.y < origLoc.y - SLOP) { [scroll suspendEditing]; toPos = [self dragEvent:mouseDown inPos:pos]; [scroll resumeEditing]; break; } else [win nextEventMatchingMask:NSLeftMouseDraggedMask]; } } [mouseDown release]; return toPos; } //============================================================================= // TOGGLE SORT DIRECTION //============================================================================= //----------------------------------------------------------------------------- // - toggleRectForPos: //----------------------------------------------------------------------------- - (NSRect)toggleRectForPos:(MiscCoord_V)pos { NSRect r = [self rectForPos:pos]; float const w = TOGGLE_WIDTH + MISC_RESIZE_EPSILON; r.origin.x = floor( r.origin.x + r.size.width - w ); r.size.width = w; return r; } //----------------------------------------------------------------------------- // - inToggleZone:forPos: //----------------------------------------------------------------------------- - (BOOL)inToggleZone:(NSPoint)pt forPos:(MiscCoord_V)pos { if ([scroll autoSortSlots:MISC_OTHER_BORDER([self borderType])] && info->isSortable(pos)) { NSRect r = [self toggleRectForPos:pos]; return r.origin.x <= pt.x && pt.x <= (r.origin.x + r.size.width); } return NO; } //----------------------------------------------------------------------------- // - toggleEvent:forPos: //----------------------------------------------------------------------------- - (void)toggleEvent:(NSEvent*)p forPos:(MiscCoord_V)pos { BOOL was_in_zone = YES; BOOL is_in_zone = YES; NSRect toggleZone = [self toggleRectForPos:pos]; NSWindow* win = [self window]; togglePos = pos; [self lockFocus]; [self drawPos:pos]; [win flushWindow]; for (;;) { p = [win nextEventMatchingMask: (NSLeftMouseUpMask | NSLeftMouseDraggedMask)]; NSPoint new_loc = [p locationInWindow]; new_loc = [self convertPoint:new_loc fromView:0]; is_in_zone = NSPointInRect( new_loc, toggleZone ); if (was_in_zone != is_in_zone) { was_in_zone = is_in_zone; togglePos = (is_in_zone ? pos : -1); [self drawPos:pos]; [win flushWindow]; } if ([p type] == NSLeftMouseUp) break; } togglePos = -1; [self unlockFocus]; if (is_in_zone) { MiscBorderType const bt = [self borderType]; MiscSortDirection dir = info->getSortDirection( pos ); dir = MISC_OTHER_DIRECTION( dir ); MiscCoord_P p_pos = info->visualToPhysical( pos ); [scroll border:bt setSlot:p_pos sortDirection:dir]; [scroll border:bt slotSortReversed:p_pos]; [self setNeedsDisplayInRect:[self rectForPos:pos]]; [scroll displayIfNeeded]; } } //============================================================================= // SELECTION //============================================================================= //----------------------------------------------------------------------------- // - adjustCursor: //----------------------------------------------------------------------------- - (void)adjustCursor:(MiscCoord_V)p { if (p < 0) p = 0; else if (p >= info->count()) p = info->count() - 1; [scroll border:[self borderType] setCursorSlot:info->visualToPhysical(p)]; } //----------------------------------------------------------------------------- // - selectionEvent:fromPos: //----------------------------------------------------------------------------- - (void)selectionEvent:(NSEvent*)p fromPos:(MiscCoord_V)pos { unsigned int const WANTED = (NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSPeriodicMask); BOOL doubleClicked = ([p clickCount] > 1); [scroll disableCursor]; [self clearOtherBorder]; [tracker mouseDown:p atPos:pos]; [scroll selectionChanged]; [scroll displayIfNeeded]; startTimer(); NSEvent* lastEvent = [p copy]; for(;;) { p = [[self window] nextEventMatchingMask:WANTED]; if (p == 0 || [p type] == NSLeftMouseUp) break; else if ([p type] == NSPeriodic) [self autoscroll:lastEvent]; else { [lastEvent release]; lastEvent = [p copy]; } NSPoint new_loc = [lastEvent locationInWindow]; new_loc = [self convertPoint:new_loc fromView:0]; MiscCoord_V new_pos = [self posForMousePt:new_loc]; if (new_pos != pos) { pos = new_pos; [tracker mouseDragged:p atPos:pos]; [scroll selectionChanged]; [scroll displayIfNeeded]; } } [lastEvent release]; stopTimer(); [tracker mouseUp:p atPos:pos]; [scroll selectionChanged]; [self adjustCursor:pos]; [scroll enableCursor]; [[self window] flushWindow]; [scroll displayIfNeeded]; if ([scroll isEnabled]) { [scroll sendAction]; if (doubleClicked) [scroll sendDoubleAction]; } } //============================================================================= // MOUSE-EVENTS //============================================================================= //----------------------------------------------------------------------------- // - acceptsFirstMouse: //----------------------------------------------------------------------------- - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { return YES; } //----------------------------------------------------------------------------- // - mouseDown: // // NOTE: *OUT-OF-BOUNDS* // The AppKit allows up to 3 pixels of slop on double-clicks even when // the new location is outside the bounds of the view receiving the // original click. They send the second event to the original view, but // they do not coerce the location to the same location as the original // event. Our code assumes all mouseDown: events are located within // the bounds of our view, so reject all events outside our bounds. //----------------------------------------------------------------------------- - (void)mouseDown:(NSEvent*)p { NSRect const r = [self bounds]; NSPoint const evpt = [self convertPoint:[p locationInWindow] fromView:0]; if (evpt.x >= 0 && evpt.x < r.size.width && // NOTE *OUT-OF-BOUNDS* evpt.y >= 0 && evpt.y <= r.size.height) { MiscCoord_V pos = [self posForMousePt:evpt]; MiscPixels x, delta_x; if ([self inResizeZone:evpt forPos:&pos atX:&x deltaX:&delta_x]) { [scroll suspendEditing]; MiscPixels finalWidth; BOOL doit; doit = [self resizeEvent:p inPos:pos atX:x deltaX:delta_x finalWidth:&finalWidth]; if (doit) { if (info->isUniformSize()) { [scroll border:[self borderType] setUniformSizeSlots:finalWidth]; [[self window] invalidateCursorRectsForView:self]; [scroll setNeedsDisplay:YES]; } else [self setPos:pos width:finalWidth]; [scroll border:[self borderType] slotResized:pos]; } [scroll resumeEditing]; } else if ([self inToggleZone:evpt forPos:pos]) { [scroll suspendEditing]; [self toggleEvent:p forPos:pos]; [scroll resumeEditing]; } else if (info->isDraggable() && (info->isModifierDrag() == (([p modifierFlags] & NSCommandKeyMask) != 0))) { [self awaitDragEvent:p inPos:pos]; } else { NSParameterAssert( tracker != 0 ); // End cell editing. [[self window] makeFirstResponder:[scroll documentView]]; [self selectionEvent:p fromPos:pos]; } } } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscBorderView.h100444 1750 1750 5122 6757227324 24307 0ustar sunshinesunshine#ifndef __MiscBorderView_h #define __MiscBorderView_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscBorderView.h // // View class for the row/column borders on a MiscTableView. // Supports resizing, dragging. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscBorderView.h,v 1.10 97/04/15 08:53:49 sunshine Exp $ // $Log: MiscBorderView.h,v $ // Revision 1.10 97/04/15 08:53:49 sunshine // v0.125.8: Added "MiscTableScroll/" prefix to #import to facilitate new // framework organization. Consequently, removed the -inlineImageNamed: hack. // // Revision 1.9 97/03/20 19:12:32 sunshine // v123.1: Changed order of methods for NEXTSTEP 3.3 TableScroll consistency. // // Revision 1.8 97/03/10 10:11:39 sunshine // v113.1: Added -setFrameHeight:. Added missing (id) to -initWithFrame:. //----------------------------------------------------------------------------- extern "Objective-C" { #import } #import class MiscSparseSet; class MiscTableBorder; @class MiscBorderCell, MiscMouseTracker, MiscTableScroll, MiscTableView; enum MiscBorderViewType { MISC_COL_BORDER_VIEW, MISC_ROW_BORDER_VIEW }; @interface MiscBorderView : NSView { MiscTableScroll* scroll; MiscTableBorder* info; MiscBorderCell* theCell; MiscMouseTracker* tracker; MiscSparseSet* oldSel; MiscCoord_V togglePos; BOOL isHorz; } - (id)initWithFrame:(NSRect)frameRect scroll:(MiscTableScroll*)scroll info:(MiscTableBorder*)info type:(MiscBorderViewType)type; - (void)dealloc; - (MiscPixels)frameHeight; - (void)setFrameHeight:(MiscPixels)x; - (void)adjustSize; - (void)setSelectionMode:(MiscSelectionMode)mode; - (void)selectionChanged; - (void)resetSelection; - (void)drawSlot:(MiscCoord_V)x; @end #endif // __MiscBorderView_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscColView.M100444 1750 1750 3300 6757227324 23550 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscColView.M // // View class for the column headings on an MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscColView.M,v 1.2 96/04/30 05:38:21 sunshine Exp $ // $Log: MiscColView.M,v $ // Revision 1.2 96/04/30 05:38:21 sunshine // Ported to OpenStep 4.0 for Mach PR2. // //----------------------------------------------------------------------------- #import "MiscColView.h" @implementation MiscColView //----------------------------------------------------------------------------- // - initWithFrame:scroll:info: //----------------------------------------------------------------------------- - initWithFrame: (NSRect) frameRect scroll: (MiscTableScroll*) i_scroll info: (MiscTableBorder*) i_info { [super initWithFrame:frameRect scroll:i_scroll info:i_info type:MISC_COL_BORDER_VIEW]; return self; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscColView.h100444 1750 1750 2750 6757227325 23614 0ustar sunshinesunshine#ifndef __MiscColView_h #define __MiscColView_h //============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscColView.h // // View class for the column headings on an MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscColView.h,v 1.2 96/04/30 05:38:22 sunshine Exp $ // $Log: MiscColView.h,v $ // Revision 1.2 96/04/30 05:38:22 sunshine // Ported to OpenStep 4.0 for Mach PR2. // //----------------------------------------------------------------------------- #import "MiscBorderView.h" @interface MiscColView : MiscBorderView { } - initWithFrame: (NSRect) frameRect scroll: (MiscTableScroll*) scroll info: (MiscTableBorder*) info; @end #endif // __MiscColView_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscColorList.h100444 1750 1750 4150 6757227325 24152 0ustar sunshinesunshine#ifndef __MiscColorList_h #define __MiscColorList_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscColorList.h // // An extensible array of colors that can act as a color palette to // reduce the storage overhead of storing a lot of colors. Also // useful for speeding color comparisons in some cases. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscColorList.h,v 1.2 96/12/30 03:09:44 sunshine Exp $ // $Log: MiscColorList.h,v $ // Revision 1.2 96/12/30 03:09:44 sunshine // v104.1: Ported to OPENSTEP 4.1 (gamma). // // Revision 1.1 96/08/30 14:51:51 sunshine // Extensible array of colors acting as a color palette. //----------------------------------------------------------------------------- extern "Objective-C" { #import } @class NSMutableArray; struct MiscColorList { private: NSMutableArray* colors; MiscColorList( MiscColorList const& ) {} // No copy constructor. void operator=( MiscColorList const& ) {} // No assign operator. public: MiscColorList(); ~MiscColorList(); int count() const { return [colors count]; } void empty() { [colors removeAllObjects]; } NSColor* nth( int n ) const { return [colors objectAtIndex:n]; } NSColor* operator[]( int n ) const { return nth(n); } int store( NSColor* ); }; #endif // __MiscColorList_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscCornerView.M100444 1750 1750 5125 6757227325 24273 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscCornerView.M // // View class that covers the gap in the upper left corner when a // MiscTableScroll has both row and column titles turned on. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscCornerView.M,v 1.4 98/03/22 13:30:10 sunshine Exp $ // $Log: MiscCornerView.M,v $ // Revision 1.4 98/03/22 13:30:10 sunshine // v133.1: MiscNullView --> MiscCornerView. Added -title, -setTitle:. // // Revision 1.3 96/04/30 05:38:37 sunshine // Ported to OpenStep 4.0 for Mach PR2. //----------------------------------------------------------------------------- #import "MiscCornerView.h" #import "MiscBorderCell.h" extern "Objective-C" { #import } @implementation MiscCornerView - (BOOL)isFlipped { return YES; } - (BOOL)isOpaque { return YES; } - (NSString*)title { return [theCell stringValue]; } - (void)setTitle:(NSString*)s { [theCell setStringValue:s]; } //----------------------------------------------------------------------------- // - initWithFrame: //----------------------------------------------------------------------------- - (id)initWithFrame:(NSRect)frameRect { [super initWithFrame:frameRect]; theCell = [[MiscBorderCell allocWithZone:[self zone]] initTextCell:@""]; return self; } //----------------------------------------------------------------------------- // - dealloc //----------------------------------------------------------------------------- - (void)dealloc { [theCell release]; [super dealloc]; } //----------------------------------------------------------------------------- // - drawRect: //----------------------------------------------------------------------------- - (void)drawRect:(NSRect)rect { [theCell drawWithFrame:[self bounds] inView:self]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscDrawList.cc100444 1750 1750 17365 6757227342 24162 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscDrawList.cc // // An extensible array of specifications for drawing cell contents. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscDrawList.cc,v 1.9 98/03/29 23:43:01 sunshine Exp $ // $Log: MiscDrawList.cc,v $ // Revision 1.9 98/03/29 23:43:01 sunshine // v138.1: #import was missing "MiscTableScroll/" for public header. // // Revision 1.8 98/03/22 13:20:33 sunshine // v133.1: Added draw_clipped_text flag. // // Revision 1.7 97/06/18 10:25:56 sunshine // v125.9: highlightTextColor --> selectedTextColor //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscDrawList.h" #include "MiscLineWrapper.h" #include extern "Objective-C" { #import #import #import #import // NSLeftTextAlignment } extern "C" { #include #include } //----------------------------------------------------------------------------- // get_char_wrap //----------------------------------------------------------------------------- inline static bool get_char_wrap( id cell ) { return ![cell wraps]; } //----------------------------------------------------------------------------- // append //----------------------------------------------------------------------------- void MiscDrawList::append( NSRect frame_rect, id cell, BOOL lit, NSColor* default_text_color, NSFont* default_font ) { NSString* txt = 0; NSImage* img = 0; if (cell != 0) { if ([cell respondsToSelector:@selector(image)]) img = [cell image]; if (img == 0) if ([cell respondsToSelector:@selector(title)]) txt = [cell title]; else if ([cell respondsToSelector:@selector(stringValue)]) txt = [cell stringValue]; if (img != 0 || (txt != 0 && [txt length] != 0)) { if (num_recs >= max_recs) { max_recs += max_recs; recs = (Rec*) realloc( recs, max_recs * sizeof(*recs) ); } Rec& r = recs[ num_recs++ ]; if (img != 0) { r.image = [img retain]; r.image_rect = [cell imageRectForBounds:frame_rect]; } else r.image = 0; if (txt != 0 && [txt length] != 0) { r.text = [txt copy]; r.text_rect = [cell titleRectForBounds:frame_rect]; r.font = 0; if ([cell respondsToSelector:@selector(font)]) r.font = [cell font]; if (r.font == 0) r.font = default_font; [r.font retain]; NSColor* color; if (lit && [cell respondsToSelector:@selector(selectedTextColor)]) color = [cell selectedTextColor]; else if ([cell respondsToSelector:@selector(textColor)]) color = [cell textColor]; else color = default_text_color; r.text_color = color_list.store( color ); int flags; if ([cell respondsToSelector:@selector(alignment)]) flags = ([cell alignment] << 1); else flags = (NSLeftTextAlignment << 1); if (get_char_wrap( cell )) flags |= 1; r.flags = flags; } else { r.text = 0; r.font = 0; r.text_color = -1; } } } } //----------------------------------------------------------------------------- // Rec::draw_image //----------------------------------------------------------------------------- void MiscDrawList::Rec::draw_image() { NSPoint p; p.x = image_rect.origin.x; p.y = image_rect.origin.y + image_rect.size.height; NSRect r; r.origin.x = 0; r.origin.y = 0; r.size = [image size]; float const dx = image_rect.size.width - r.size.width; if (dx < 0) r.size.width = image_rect.size.width; else if (dx > 0) p.x = floor( p.x + dx / 2 ); float const dy = image_rect.size.height - r.size.height; if (dy < 0) r.size.height = image_rect.size.height; else if (dy > 0) p.y = floor( p.y - dy / 2 ); [image compositeToPoint:p fromRect:r operation:NSCompositeSourceOver]; } //----------------------------------------------------------------------------- // Rec::draw_text //----------------------------------------------------------------------------- void MiscDrawList::Rec::draw_text( MiscLineWrapper& lw ) const { lw.setText( text ); lw.setRect( text_rect ); lw.setCharWrap( flags & 1 ); lw.setAlignment( flags >> 1 ); lw.draw(); } //----------------------------------------------------------------------------- // draw_images //----------------------------------------------------------------------------- void MiscDrawList::draw_images() { for (int i = 0; i < num_recs; i++) { Rec& r = recs[i]; if (r.image != 0) r.draw_image(); } } //----------------------------------------------------------------------------- // draw_text //----------------------------------------------------------------------------- void MiscDrawList::draw_text() { MiscLineWrapper lw; lw.setNoPartialLines( !draw_clipped_text ); for (int i = 0; i < num_recs; i++) // For each font... { if (recs[i].font != 0) { NSFont* const font = recs[i].font; NSFont* screenFont = 0; if ([[NSDPSContext currentContext] isDrawingToScreen] && (screenFont = [font screenFont]) != 0) { [screenFont set]; lw.setFont( screenFont ); } else { [font set]; lw.setFont( font ); } for (int j = i; j < num_recs; j++) // For each font-color pair... { if (recs[j].text_color >= 0) { int const color_id = recs[j].text_color; [color_list[ color_id ] set]; for (int k = j; k < num_recs; k++) // For each record... { Rec& r = recs[k]; if (r.font == font && r.text_color == color_id) { r.font = 0; // Mark record "used". r.text_color = -1; r.draw_text( lw ); } } } } } } } //----------------------------------------------------------------------------- // draw //----------------------------------------------------------------------------- void MiscDrawList::draw() { if (num_recs > 0) { draw_images(); draw_text(); empty(); } } //----------------------------------------------------------------------------- // empty //----------------------------------------------------------------------------- void MiscDrawList::empty() { for (int i = 0; i < num_recs; i++) { Rec const& r = recs[i]; if (r.text != 0) [r.text release]; if (r.font != 0) [r.font release]; if (r.image != 0) [r.image release]; } num_recs = 0; } //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscDrawList::~MiscDrawList() { empty(); free( recs ); } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- MiscDrawList::MiscDrawList( bool b ) { num_recs = 0; max_recs = 16; recs = (Rec*) malloc( max_recs * sizeof( *recs ) ); draw_clipped_text = b; } MiscKit2/Palettes/MiscTableScroll/Framework/MiscCornerView.h100444 1750 1750 3274 6757227325 24331 0ustar sunshinesunshine#ifndef __MiscCornerView_h #define __MiscCornerView_h //============================================================================= // // Copyright (C) 1995-1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscCornerView.h // // View class that covers the gap in the upper left corner when a // MiscTableScroll has both row and column titles turned on. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscCornerView.h,v 1.3 98/03/22 13:29:57 sunshine Exp $ // $Log: MiscCornerView.h,v $ // Revision 1.3 98/03/22 13:29:57 sunshine // v133.1: MiscNullView --> MiscCornerView. Added -title, -setTitle:. // // Revision 1.2 96/04/30 05:38:38 sunshine // Ported to OpenStep 4.0 for Mach PR2. //----------------------------------------------------------------------------- extern "Objective-C" { #import } @class MiscBorderCell; @interface MiscCornerView : NSView { MiscBorderCell* theCell; } - (NSString*)title; - (void)setTitle:(NSString*)s; @end #endif // __MiscCornerView_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscDelegateFlags.h100444 1750 1750 12376 6757227325 24760 0ustar sunshinesunshine#ifndef __MiscDelegateFlags_h #define __MiscDelegateFlags_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscDelegateFlags.h // // Flags indicating which selectors a delegate responds to. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscDelegateFlags.h,v 1.11 99/06/15 02:33:25 sunshine Exp $ // $Log: MiscDelegateFlags.h,v $ // Revision 1.11 99/06/15 02:33:25 sunshine // v140.1: Many delegate messages changed to notification style messages. // Added delegate messages for becoming and resigning first responder. // Renamed: DEL_WILL_EDIT_AT to DEL_WILL_EDIT, DEL_DID_EDIT_AT to DEL_DID_EDIT // For better OpenStep conformance, renamed: -tableScroll:getISearchColumn: to // -tableScrollGetIncrementalSearchColumn:. // // Revision 1.10 1998/03/29 23:42:18 sunshine // v138.1: Added -tableScroll:shouldDelayWindowOrderingForEvent:. // // Revision 1.9 98/03/23 07:46:41 sunshine // v134.1: Eliminated -tableScroll:edit:atRow:column:. //----------------------------------------------------------------------------- #include "bool.h" extern "Objective-C" { #import } class MiscDelegateFlags { public: enum Selector { DEL_SLOT_DRAGGED, // tableScrollSlotDragged: DEL_SLOT_REVERSED, // tableScrollSlotSortReversed: DEL_SLOT_RESIZED, // tableScrollSlotResized: DEL_CHANGE_FONT, // tableScrollChangeFont: DEL_FONT_CHANGED, // tableScrollFontChanged: DEL_BACK_COLOR_CHANGED, // tableScrollBackgroundColorChanged: DEL_BACK_SEL_COLOR_CHANGED, // tableScrollSelectedBackgroundColo... DEL_TEXT_COLOR_CHANGED, // tableScrollTextColorChanged: DEL_TEXT_SEL_COLOR_CHANGED, // tableScrollSelectedTextColorChang... DEL_GET_ISEARCH_COL, // tableScroll:getISearchColumn: DEL_BUFFER_COUNT, // tableScrollBufferCount: DEL_SLOT_PROTOTYPE, // tableScroll:border:slotPrototype: DEL_SLOT_TITLE, // tableScroll:border:slotTitle: DEL_CELL_AT, // tableScroll:cellAtRow:column: DEL_REVIVE_CELL, // tableScroll:reviveCell:atRow:column: DEL_RETIRE_CELL, // tableScroll:retireCell:atRow:column: DEL_TAG_AT, // tableScroll:tagAtRow:column: DEL_INT_VALUE_AT, // tableScroll:intValueAtRow:column: DEL_FLOAT_VALUE_AT, // tableScroll:floatValueAtRow:column: DEL_DOUBLE_VALUE_AT, // tableScroll:doubleValueAtRow:column: DEL_STRING_VALUE_AT, // tableScroll:stringValueAtRow:column: DEL_TITLE_AT, // tableScroll:titleAtRow:column: DEL_STATE_AT, // tableScroll:stateAtRow:column: DEL_REGISTER_SERVICE_TYPES, // tableScrollRegisterServicesTypes: DEL_VALID_REQUESTOR, // tableScroll:validRequestorForSend... DEL_CAN_WRITE_PB_TYPE, // tableScroll:canWritePboardType: DEL_STRING_FOR_PB_TYPE, // tableScroll:stringForPboardType: DEL_WRITE_SEL_TO_PB_TYPES, // tableScroll:writeSelectionToPaste... DEL_READ_SEL_FROM_PB, // tableScroll:readSelectionFromPast... DEL_ALLOW_DRAG, // tableScroll:allowDragOperationAtR... DEL_PREPARE_PB_FOR_DRAG, // tableScroll:preparePasteboard:for... DEL_IMAGE_FOR_DRAG, // tableScroll:imageForDragOperation... DEL_DRAG_OP_MASK, // tableScroll:draggingSourceOperati... DEL_DRAG_IGNORE_MODIFIERS, // tableScrollIgnoreModifierKeysWhil... DEL_DRAG_DELAY_WIN_ORDERING, // tableScroll:shouldDelayWindowOrde... DEL_WILL_PRINT, // tableScrollWillPrint: DEL_DID_PRINT, // tableScrollDidPrint: DEL_PRINT_PAGE_HEADER, // tableScrollWillPrintPageHeader: DEL_PRINT_PAGE_FOOTER, // tableScrollWillPrintPageFooter: DEL_CAN_EDIT_AT, // tableScroll:canEdit:atRow:column: DEL_SET_STRINGVALUE_AT, // tableScroll:setStringValue:atRow:... DEL_ABORT_EDIT_AT, // tableScroll:abortEditAtRow:column: DEL_WILL_EDIT, // tableScrollWillEdit: DEL_DID_EDIT, // tableScrollDidEdit: DEL_TEXT_DID_END, // controlTextDidEndEditing: DEL_TEXT_DID_CHANGE, // controlTextDidBeginEditing: DEL_TEXT_DID_GET_KEYS, // controlTextDidChange: DEL_TEXT_WILL_CHANGE, // control:textShouldBeginEditing: DEL_TEXT_WILL_END, // control:textShouldEndEditing: DEL_DID_BECOME_FIRST_RESP, // tableScrollDidBecomeFirstResponder: DEL_DID_RESIGN_FIRST_RESP, // tableScrollDidResignFirstResponder: MAX_DEL_ENUM, BAD_DEL_ENUM = -1 }; private: int const SET_SIZE = ((MAX_DEL_ENUM - 1) / 8) + 1; unsigned char set[ SET_SIZE ]; public: MiscDelegateFlags( id delegate = 0 ) { setDelegate( delegate ); } void setDelegate( id delegate ); bool respondsTo( Selector ) const; static SEL selToObjc( Selector ); static Selector objcToSel( SEL ); // Returns BAD_DEL_ENUM if not found. }; #endif // __MiscDelegateFlags_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscDrawList.h100444 1750 1750 5025 6757227326 23774 0ustar sunshinesunshine#ifndef __MiscDrawList_h #define __MiscDrawList_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1995-1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscDrawList.h // // An extensible array of specifications for drawing cell contents. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscDrawList.h,v 1.3 98/03/22 13:20:22 sunshine Exp $ // $Log: MiscDrawList.h,v $ // Revision 1.3 98/03/22 13:20:22 sunshine // v133.1: Added draw_clipped_text flag. // // Revision 1.2 96/12/30 03:10:10 sunshine // v104.1: Ported to OPENSTEP 4.1 (gamma). // // Revision 1.1 96/08/30 14:52:40 sunshine // An extensible array of specifications for drawing cell contents. //----------------------------------------------------------------------------- #include "MiscColorList.h" #include extern "Objective-C" { #import } @class NSColor, NSFont, NSImage; class MiscLineWrapper; struct MiscDrawList { public: struct Rec { NSRect text_rect; NSRect image_rect; NSString* text; NSFont* font; NSImage* image; int text_color; int flags; // (alignment << 1) | (char_wrap) void draw_image(); void draw_text( MiscLineWrapper& ) const; }; private: MiscColorList color_list; int num_recs; int max_recs; Rec* recs; bool draw_clipped_text; MiscDrawList( MiscDrawList const& ) {} // No copy constructor. void operator=( MiscDrawList const& ) {} // No assign operator. void draw_images(); void draw_text(); public: MiscDrawList( bool i_draw_clipped_text ); ~MiscDrawList(); int count() const { return num_recs; } void empty(); void append( NSRect frame_rect, id cell, BOOL is_highlighted, NSColor* default_text_color, NSFont* default_font ); void draw(); }; #endif // __MiscDrawList_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscGeometry.cc100444 1750 1750 5573 6757227342 24202 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscGeometry.cc // // *NOTE* The methods in this file were moved here from the interface // file in order to work around a bug in the PPC compiler for Rhapsody // DR1. The compiler would crash with an "internal compiler error" each // time it got to the code where these methods convert a float to an int. // Moving the methods to the implementation file (so that they are no // longer inline) keeps the compiler from crashing. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscGeometry.cc,v 1.2 98/03/30 09:44:03 sunshine Exp $ // $Log: MiscGeometry.cc,v $ // Revision 1.2 98/03/30 09:44:03 sunshine // v138.1: Worked around Rhapsody DR1, PPC "internal compiler error" bug. // // Revision 1.1 96/05/05 10:53:55 sunshine // Geometric type structures which know their border orientation. //----------------------------------------------------------------------------- #ifdef __GNUC__ # pragma implementation #endif #import "MiscGeometry.h" //----------------------------------------------------------------------------- // MiscPoint_O //----------------------------------------------------------------------------- MiscPoint_O::MiscPoint_O( bool is_horz, NSPoint p ) : MiscOrientation(is_horz),x(MiscPixels(p.x)),y(MiscPixels(p.y)) {} MiscPoint_O::MiscPoint_O( MiscBorderType b, NSPoint p ) : MiscOrientation(b),x(MiscPixels(p.x)),y(MiscPixels(p.y)) {} MiscPoint_O& MiscPoint_O::operator=( NSPoint p ) { x = MiscPixels( p.x ); y = MiscPixels( p.y ); return *this; } //----------------------------------------------------------------------------- // MiscSize_O //----------------------------------------------------------------------------- MiscSize_O::MiscSize_O( bool is_horz, NSSize p ) : MiscOrientation(is_horz), width(MiscPixels(p.width)),height(MiscPixels(p.height)) {} MiscSize_O::MiscSize_O( MiscBorderType b, NSSize p ) : MiscOrientation(b), width(MiscPixels(p.width)),height(MiscPixels(p.height)) {} MiscSize_O& MiscSize_O::operator=( NSSize s ) { width = MiscPixels( s.width ); height = MiscPixels( s.height ); return *this; } MiscKit2/Palettes/MiscTableScroll/Framework/MiscExporter.M100444 1750 1750 17212 6757227326 24041 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporter.M // // Object that exports the contents of an MiscTableScroll in // various useful formats. // // TODO: // * Genericize for use with Matrix, DBTableView. // * Add more export formats: rtf0, Lotus 1-2-3, Quattro, Excel, etc. // * Maybe provide option for line terminators. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporter.M,v 1.7 98/03/29 23:43:56 sunshine Exp $ // $Log: MiscExporter.M,v $ // Revision 1.7 98/03/29 23:43:56 sunshine // v138.1: #import was missing "MiscTableScroll/" for public header. // Interface to MiscExporterAccessoryView changed slightly. // // Revision 1.6 97/04/01 07:46:13 sunshine // v0.125.5: Ported to OPENSTEP 4.2 prerelease for NT. // No longer sends -close and -makeKeyAndOrderFront: messages to NSSavePanel // since it doesn't respond to them under NT. // // Revision 1.5 97/03/10 10:27:31 sunshine // v113.1: For OpenStep conformance, many 'col' methods rename to 'column'. //----------------------------------------------------------------------------- #import "MiscExporterPrivate.h" #import "MiscExporterAccessoryView.h" #import extern "Objective-C" { #import } extern "C" { #import } //============================================================================= // MiscExporter //============================================================================= @implementation MiscExporter - (MiscExportFormat)getExportFormat { return exportFormat; } - (MiscExportTitleMode)getRowExportTitleMode { return rowTitleMode; } - (MiscExportTitleMode)getColumnExportTitleMode { return columnTitleMode; } - (MiscExportGridMode)getRowExportGridMode { return rowGrid; } - (MiscExportGridMode)getColumnExportGridMode { return columnGrid; } - (void)setExportFormat:(MiscExportFormat)x { exportFormat = x; } - (void)setRowExportTitleMode:(MiscExportTitleMode)x { rowTitleMode = x; } - (void)setColumnExportTitleMode:(MiscExportTitleMode)x { columnTitleMode = x; } - (void)setRowExportGridMode:(MiscExportGridMode)x { rowGrid = x; } - (void)setColumnExportGridMode:(MiscExportGridMode)x { columnGrid = x; } //----------------------------------------------------------------------------- // rowTitleCharWidth: //----------------------------------------------------------------------------- - (int)rowTitleCharWidth:(int)nrows { int max_width = 0; if (rowTitleMode != MISC_EXPORT_TITLES_OFF) for (int r = 0; r < nrows; r++) { int const len = [row_title( r, tableScroll ) length]; if (max_width < len) max_width = len; } return max_width; } //----------------------------------------------------------------------------- // makeColMap: //----------------------------------------------------------------------------- - (int*)makeColMap:(int)ncols { int* col_map = (int*) malloc( ncols * sizeof(*col_map) ); for (int c = 0; c < ncols; c++) col_map[c] = col_at( c, tableScroll ); return col_map; } //----------------------------------------------------------------------------- // exportToFile: //----------------------------------------------------------------------------- - (void)exportToFile:(FILE*)fp { switch (exportFormat) { default: case MISC_EXPORT_ASCII_FIXED: [self exportFixed:fp]; break; case MISC_EXPORT_ASCII_TAB: [self exportTab:fp]; break; case MISC_EXPORT_ASCII_DELIMITED:[self exportDelimited:fp]; break; case MISC_EXPORT_DBF: [self exportDBF:fp]; break; } } //----------------------------------------------------------------------------- // exportToFilename: //----------------------------------------------------------------------------- - (int)exportToFilename:(NSString*)nm { int rc = 0; FILE* fp = fopen( [nm lossyCString], "wb" ); if (fp == 0) rc = errno; else { [self exportToFile:fp]; rc = fclose( fp ); } return rc; } //----------------------------------------------------------------------------- // createAccessoryView //----------------------------------------------------------------------------- - (MiscExporterAccessoryView*)createAccessoryView { return [[[MiscExporterAccessoryView alloc] initWithFormat:exportFormat rowTitle:rowTitleMode colTitle:columnTitleMode rowGrid:rowGrid colGrid:columnGrid] autorelease]; } //----------------------------------------------------------------------------- // getValuesFromAccessoryView: //----------------------------------------------------------------------------- - (void)getValuesFromAccessoryView:(MiscExporterAccessoryView*)accessory { [self setExportFormat:[accessory format]]; [self setRowExportTitleMode:[accessory rowTitleMode]]; [self setColumnExportTitleMode:[accessory columnTitleMode]]; [self setRowExportGridMode:[accessory rowGrid]]; [self setColumnExportGridMode:[accessory colGrid]]; } //----------------------------------------------------------------------------- // exportTableScroll: //----------------------------------------------------------------------------- - (int)exportTableScroll:(MiscTableScroll*)ts { int rc = -1; if (ts != 0 && [ts numberOfColumns] > 0) { tableScroll = ts; NSSavePanel* panel = [NSSavePanel savePanel]; MiscExporterAccessoryView* accessory = [self createAccessoryView]; [panel setDelegate:self]; [panel setAccessoryView:[accessory view]]; if ([panel runModal] == NSOKButton) { [self getValuesFromAccessoryView:accessory]; NSString* name = [panel filename]; if ((rc = [self exportToFilename:name]) != 0) NSRunAlertPanel( @"Error", @"Cannot open %@.\n%s", @"OK", nil, nil, name, strerror(rc)); } [panel setAccessoryView:0]; [panel setDelegate:0]; } return rc; } //----------------------------------------------------------------------------- // exportTableScroll:toFilename: //----------------------------------------------------------------------------- - (int)exportTableScroll:(MiscTableScroll*)ts toFilename:(NSString*)nm { int rc = -1; if (nm != 0 && ts != 0 && [ts numberOfColumns] > 0) { tableScroll = ts; rc = [self exportToFilename:nm]; } return rc; } //----------------------------------------------------------------------------- // init //----------------------------------------------------------------------------- - (id)init { [super init]; rowTitleMode = MISC_EXPORT_TITLES_ROW_DEFAULT; columnTitleMode = MISC_EXPORT_TITLES_COL_DEFAULT; rowGrid = MISC_EXPORT_GRID_ROW_DEFAULT; columnGrid = MISC_EXPORT_GRID_COL_DEFAULT; return self; } //----------------------------------------------------------------------------- // + commonInstance //----------------------------------------------------------------------------- + (MiscExporter*)commonInstance { static MiscExporter* obj = 0; if (obj == 0) obj = [[self alloc] init]; return obj; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscLineWrapper.cc100444 1750 1750 35244 6757227342 24655 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscLineWrapper.h // // A C++ object for calculating line breaks in text. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscLineWrapper.cc,v 1.4 97/04/04 04:57:34 sunshine Exp $ // $Log: MiscLineWrapper.cc,v $ // Revision 1.4 97/04/04 04:57:34 sunshine // 0.125.6: Removed unused header. // // Revision 1.3 96/12/30 06:30:23 sunshine // v105.1: Line height is now based purely on point size. No longer uses the // broken NeXT bounding box. // // Revision 1.2 96/12/30 03:11:28 sunshine // v104.1: Ported to OPENSTEP 4.1 (gamma). //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscLineWrapper.h" extern "Objective-C" { #import // NSLeftTextAlignment #import } extern "C" { #include #include #include #include } float const MiscLineWrapper::DEFAULT_LEFT_MARGIN = 2.0; float const MiscLineWrapper::DEFAULT_TOP_MARGIN = 0.0; float const MiscLineWrapper::DEFAULT_RIGHT_MARGIN = 2.0; float const MiscLineWrapper::DEFAULT_BOTTOM_MARGIN = 0.0; //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscLineWrapper::~MiscLineWrapper() { free( text ); free( lines ); } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- MiscLineWrapper::MiscLineWrapper() { text_len = 0; text_max = 1024; text = (char*) malloc( text_max ); font = 0; alignment = NSLeftTextAlignment; num_lines = 0; max_lines = 16; lines = (Line*) malloc( max_lines * sizeof(*lines) ); rect.origin.x = 0; rect.origin.y = 0; rect.size.width = 0; rect.size.height = 0; left_margin = DEFAULT_LEFT_MARGIN; top_margin = DEFAULT_TOP_MARGIN; right_margin = DEFAULT_RIGHT_MARGIN; bottom_margin = DEFAULT_BOTTOM_MARGIN; ascender = 0; descender = 0; line_height = 0; char_wrap = false; no_partial = false; needs_wrap = false; } //----------------------------------------------------------------------------- // setCharWrap //----------------------------------------------------------------------------- void MiscLineWrapper::setCharWrap( bool b ) { if (char_wrap != b) { char_wrap = b; needs_wrap = true; } } //----------------------------------------------------------------------------- // setRect //----------------------------------------------------------------------------- void MiscLineWrapper::setRect( NSRect r ) { r.origin.x = floor( r.origin.x + left_margin ); r.origin.y = floor( r.origin.y + top_margin ); r.size.width = floor( r.size.width - (left_margin + right_margin) ); r.size.height = floor( r.size.height - (top_margin + bottom_margin) ); if (r.size.width != rect.size.width) needs_wrap = true; rect = r; } //----------------------------------------------------------------------------- // setLeftMargin //----------------------------------------------------------------------------- void MiscLineWrapper::setLeftMargin( float f ) { if (left_margin != f) { rect.origin.x = floor( rect.origin.x - left_margin + f ); left_margin = f; needs_wrap = true; } } //----------------------------------------------------------------------------- // setTopMargin //----------------------------------------------------------------------------- void MiscLineWrapper::setTopMargin( float f ) { if (top_margin != f) { rect.origin.y = floor( rect.origin.y - top_margin + f ); top_margin = f; needs_wrap = true; } } //----------------------------------------------------------------------------- // setRightMargin //----------------------------------------------------------------------------- void MiscLineWrapper::setRightMargin( float f ) { if (right_margin != f) { rect.size.width = floor( rect.size.width - right_margin + f ); right_margin = f; needs_wrap = true; } } //----------------------------------------------------------------------------- // setBottomMargin //----------------------------------------------------------------------------- void MiscLineWrapper::setBottomMargin( float f ) { if (bottom_margin != f) { rect.size.height = floor( rect.size.height - bottom_margin + f ); bottom_margin = f; needs_wrap = true; } } //----------------------------------------------------------------------------- // setText //----------------------------------------------------------------------------- void MiscLineWrapper::setText( NSString* str ) { char const* t = [str lossyCString]; // FIXME: Not Unicode compliant if (t == 0 || *t == 0) { if (text_len != 0) needs_wrap = true; text_len = 0; } else { int len = strlen( t ); if (len >= MAX_TEXT_LENGTH) len = MAX_TEXT_LENGTH - 1; if (len != text_len || strncmp( t, text, len ) != 0) { len++; // Include space for null byte. if (text_max < len) { while (text_max < len) text_max += text_max; text = (char*) realloc( text, text_max ); } len--; // Don't include null byte in length. memcpy( text, t, len ); text[ len ] = '\0'; text_len = len; needs_wrap = true; } } } //----------------------------------------------------------------------------- // setFont //----------------------------------------------------------------------------- void MiscLineWrapper::setFont( NSFont* f ) { if (font != f) { [font autorelease]; font = [f retain]; float const LINE_SPACING = 1.20; needs_wrap = true; ascender = ceil( [font ascender] ); descender = ceil( - [font descender] ); line_height = ceil( [font pointSize] * LINE_SPACING ); } } //----------------------------------------------------------------------------- // setAlignment //----------------------------------------------------------------------------- void MiscLineWrapper::setAlignment( int a ) { if (a != NSCenterTextAlignment && a != NSRightTextAlignment) a = NSLeftTextAlignment; if (alignment != a) { alignment = a; needs_wrap = true; } } //----------------------------------------------------------------------------- // calc_width //----------------------------------------------------------------------------- float MiscLineWrapper::calc_width( int i, int lim ) const { float w = 0; if ([font isFixedPitch]) { int const TAB_STOPS = 8; int n = 0; for (int j = i; j < lim; j++) if (text[j] == '\t' && alignment == NSLeftTextAlignment) n += TAB_STOPS - (n & (TAB_STOPS - 1)); else n++; w = n * [font widthOfString:@"W"]; } else { float const space_width = [font widthOfString:@" "]; float const TAB_SIZE = 8 * space_width; float sz = [font pointSize]; float const* widths = [font widths]; BOOL const is_screen_font = (font == [font screenFont]); for ( ; i < lim; i++) { unsigned char c = (unsigned char) text[i]; if (c == '\t') if (alignment == NSLeftTextAlignment) w = (floor(w / TAB_SIZE) + 1.0) * TAB_SIZE; else w += space_width; else { float cw = widths[c]; if (!is_screen_font) cw *= sz; w += cw; } } } return w; } //----------------------------------------------------------------------------- // wrap_segment // Wrap a line segment from the text. Line segments are determined by // explicit newlines in the text. // // NOTE *1* // This case arises when a single character is wider than the width of // the rectangle. Force the character onto the line even though it // exceeds the rectangle width. Otherwise, the character will never // be consumed, and we will go into an infinite loop. //----------------------------------------------------------------------------- void MiscLineWrapper::wrap_segment( int seg_start, int seg_end ) { bool do_char_wrap = char_wrap && alignment == NSLeftTextAlignment; float max_width = rect.size.width; do { if (num_lines >= max_lines) { max_lines += max_lines; lines = (Line*) realloc( lines, max_lines * sizeof(*lines) ); } Line& line = lines[ num_lines++ ]; line.width = 0; line.start = seg_start; int white_start = seg_start; int black_start = seg_start; int black_end = seg_start; while (black_start < seg_end) { while (black_start < seg_end && !isgraph( text[ black_start ] )) black_start++; if (black_start < seg_end) { black_end = black_start; while (black_end < seg_end && isgraph( text[ black_end ] )) black_end++; float black_width = calc_width( seg_start, black_end ); if (black_width <= max_width) // Word fits on line. { line.width = black_width; white_start = black_end; black_start = black_end; } else // Word does not fit. { // Line is empty. Split word. if (do_char_wrap || white_start == seg_start) { while (black_end > black_start && black_width > max_width) black_width = calc_width(seg_start,--black_end); if (black_end == seg_start) { black_end++; // NOTE *1* black_width = calc_width( seg_start, black_end ); } if (black_end > black_start) line.width = black_width; // else there are preceeding whitespace characters on // the line. The width remains zero, and we move the // whole word to the next line. white_start = black_end; black_start = black_end; } // else line is not empty, move word to next line. break; // *** BREAK *** finish line } } } line.len = white_start - seg_start; // Trailing spaces not included seg_start = black_start; } while (seg_start < seg_end); } //----------------------------------------------------------------------------- // do_wrap //----------------------------------------------------------------------------- void MiscLineWrapper::do_wrap() { int line_start = 0; int line_end; num_lines = 0; while (line_start < text_len) { line_end = line_start; while (line_end < text_len) if (text[line_end++] == '\n') break; wrap_segment( line_start, line_end ); line_start = line_end; } } //----------------------------------------------------------------------------- // wrap //----------------------------------------------------------------------------- void MiscLineWrapper::wrap() { if (needs_wrap) { needs_wrap = false; do_wrap(); } } //----------------------------------------------------------------------------- // dump //----------------------------------------------------------------------------- void MiscLineWrapper::dump() const { for (int i = 0; i < num_lines; i++) { Line& line = lines[i]; fprintf( stderr, "%2d: w=%g (%.*s)\n", i, line.width, line.len, text + line.start ); } } //----------------------------------------------------------------------------- // width_check //----------------------------------------------------------------------------- bool MiscLineWrapper::width_check() const { for (int i = 0; i < num_lines; i++) if (lines[i].width > rect.size.width) return true; return false; } //----------------------------------------------------------------------------- // has_tabs //----------------------------------------------------------------------------- bool MiscLineWrapper::has_tabs( Line const& line ) const { int i = line.start; int const lim = i + line.len; for ( ; i < lim; i++) if (text[i] == '\t') return true; return false; } //----------------------------------------------------------------------------- // draw //----------------------------------------------------------------------------- void MiscLineWrapper::draw( float x, float y, int start, int len ) { int const lim = start + len; char const save_ch = text[ lim ]; text[ lim ] = '\0'; PSmoveto( x, y ); PSshow( text + start ); text[ lim ] = save_ch; } //----------------------------------------------------------------------------- // draw_tabs // Need to draw tab-separated segments. //----------------------------------------------------------------------------- void MiscLineWrapper::draw_tabs( float x0, float y, Line const& line ) { int const i0 = line.start; int const lim = i0 + line.len; int i = i0; while (i < lim) { while (i < lim && text[i] == '\t') i++; int j = i; while (i < lim && text[i] != '\t') i++; int const n = i - j; if (n > 0) { float x = x0; if (j > i0) x += calc_width( i0, j ); draw( x, y, j, n ); } } } //----------------------------------------------------------------------------- // draw //----------------------------------------------------------------------------- void MiscLineWrapper::draw() { wrap(); float const wmax = rect.size.width; float const x0 = rect.origin.x; float const xmax = x0 + wmax; float x = x0; float const y0 = rect.origin.y; float const ymax = y0 + rect.size.height; float y = y0 + line_height - descender; bool did_clip = false; if (width_check()) { did_clip = true; PSgsave(); NSRectClip( rect ); } for (int i = 0; i < num_lines; i++, y += line_height) { bool is_partial = y + descender >= ymax; if (is_partial && (no_partial || y - ascender >= ymax)) break; Line const& line = lines[i]; if (line.len > 0) { if (is_partial && !did_clip) { did_clip = true; PSgsave(); NSRectClip( rect ); } x = x0; if (line.width < wmax) if (alignment == NSCenterTextAlignment) x = floor( x0 + (wmax - line.width) / 2 ); else if (alignment == NSRightTextAlignment) x = floor( xmax - line.width ); if (alignment == NSLeftTextAlignment && has_tabs( line )) draw_tabs( x, y, line ); else draw( x, y, line.start, line.len ); } } if (did_clip) PSgrestore(); } MiscKit2/Palettes/MiscTableScroll/Framework/MiscExporter.h100444 1750 1750 10123 6757227326 24066 0ustar sunshinesunshine#ifndef __MiscExporter_h #define __MiscExporter_h //============================================================================= // // Copyright (C) 1996-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporter.h // // Object that exports the contents of an MiscTableScroll in // various useful formats. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporter.h,v 1.5 97/04/15 08:57:36 sunshine Exp $ // $Log: MiscExporter.h,v $ // Revision 1.5 97/04/15 08:57:36 sunshine // v0.125.8: Added "MiscTableScroll/" prefix to #import to facilitate new // framework organization. // // Revision 1.4 97/03/10 10:27:52 sunshine // v113.1: For OpenStep conformance, many 'col' methods rename to 'column'. // // Revision 1.3 97/02/07 13:53:31 sunshine // v108: Ported to OPENSTEP 4.1 (gamma). //----------------------------------------------------------------------------- #import MISC_TS_EXTERN_BEGIN( "Objective-C" ) #import MISC_TS_EXTERN_END @class MiscTableScroll; typedef enum { MISC_EXPORT_ASCII_FIXED, MISC_EXPORT_ASCII_TAB, MISC_EXPORT_ASCII_DELIMITED, MISC_EXPORT_DBF } MiscExportFormat; #define MISC_EXPORT_FORMAT_FIRST MISC_EXPORT_ASCII_FIXED #define MISC_EXPORT_FORMAT_LAST MISC_EXPORT_DBF #define MISC_EXPORT_FORMAT_DEFAULT MISC_EXPORT_ASCII_FIXED typedef enum // For ASCII formats only. { MISC_EXPORT_TITLES_OFF, // No titles. MISC_EXPORT_TITLES_ON, // Full width, expand column if needed. MISC_EXPORT_TITLES_WRAP, // Wrap titles within data width. MISC_EXPORT_TITLES_TRUNCATE, // Truncate titles to data width. } MiscExportTitleMode; #define MISC_EXPORT_TITLES_FIRST MISC_EXPORT_TITLES_OFF #define MISC_EXPORT_TITLES_LAST MISC_EXPORT_TITLES_TRUNCATE #define MISC_EXPORT_TITLES_ROW_DEFAULT MISC_EXPORT_TITLES_OFF #define MISC_EXPORT_TITLES_COL_DEFAULT MISC_EXPORT_TITLES_ON typedef enum { MISC_EXPORT_GRID_OFF, // No grid MISC_EXPORT_GRID_LINE, // Lines, col-grid='|', row-grid='-' MISC_EXPORT_GRID_SPACE, // Spaces col-grid=' ', row-grid=' ' } MiscExportGridMode; #define MISC_EXPORT_GRID_FIRST MISC_EXPORT_GRID_OFF #define MISC_EXPORT_GRID_LAST MISC_EXPORT_GRID_SPACE #define MISC_EXPORT_GRID_ROW_DEFAULT MISC_EXPORT_GRID_OFF #define MISC_EXPORT_GRID_COL_DEFAULT MISC_EXPORT_GRID_LINE @interface MiscExporter : NSObject { MiscTableScroll* tableScroll; // Defaults MiscExportFormat exportFormat; // MISC_EXPORT_ASCII_FIXED MiscExportTitleMode rowTitleMode; // MISC_EXPORT_TITLES_OFF MiscExportTitleMode columnTitleMode;// MISC_EXPORT_TITLES_ON MiscExportGridMode rowGrid; // MISC_EXPORT_GRID_OFF MiscExportGridMode columnGrid; // MISC_EXPORT_GRID_LINE } - (id)init; - (int)exportTableScroll:(MiscTableScroll*)ts; // Run SavePanel. - (int)exportTableScroll:(MiscTableScroll*)ts toFilename:(NSString*)name; - (void)setExportFormat:(MiscExportFormat)exportFormat; - (void)setRowExportTitleMode:(MiscExportTitleMode)rowTitleMode; - (void)setColumnExportTitleMode:(MiscExportTitleMode)columnTitleMode; - (void)setRowExportGridMode:(MiscExportGridMode)rowExportGridMode; - (void)setColumnExportGridMode:(MiscExportGridMode)columnExportGridMode; - (MiscExportFormat)getExportFormat; - (MiscExportTitleMode)getRowExportTitleMode; - (MiscExportTitleMode)getColumnExportTitleMode; - (MiscExportGridMode)getRowExportGridMode; - (MiscExportGridMode)getColumnExportGridMode; + (MiscExporter*)commonInstance; @end #endif // __MiscExporter_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscExporterASCII.M100444 1750 1750 40105 6757227326 24607 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporterASCII.M // // Routines that export the contents of an MiscTableScroll to // various ASCII text formats. // // TODO: // * Genericize for use with Matrix, DBTableView. // * Maybe provide option for line terminators. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporterASCII.M,v 1.4 98/03/29 23:44:11 sunshine Exp $ // $Log: MiscExporterASCII.M,v $ // Revision 1.4 98/03/29 23:44:11 sunshine // v138.1: #import was missing "MiscTableScroll/" for public header. // // Revision 1.3 97/03/11 05:33:04 sunshine // v114.1: colGrid --> columnGrid, colTitleMode --> columnTitleMode // // Revision 1.2 97/02/07 13:53:28 sunshine // v108: Ported to OPENSTEP 4.1 (gamma). //----------------------------------------------------------------------------- #import "MiscExporterPrivate.h" #import #import "bool.h" extern "Objective-C" { #import #import } extern "C" { #import } //============================================================================= // UTILITY ROUTINES //============================================================================= //----------------------------------------------------------------------------- // colgrid //----------------------------------------------------------------------------- inline static void colgrid( MiscExportGridMode grid, FILE* fp, char ch = '|' ) { if (grid == MISC_EXPORT_GRID_LINE) fputc( ch, fp ); else if (grid == MISC_EXPORT_GRID_SPACE) fputc( ' ', fp ); } //----------------------------------------------------------------------------- // endline //----------------------------------------------------------------------------- inline static void endline( MiscExportGridMode grid, FILE* fp, char ch = '|' ) { colgrid( grid, fp, ch ); fputc( '\n', fp ); } //----------------------------------------------------------------------------- // rowTitleHeader //----------------------------------------------------------------------------- inline static void rowTitleHeader( int len, MiscExportGridMode grid, FILE* fp ) { if (len > 0) { colgrid( grid, fp ); pad( len, fp ); } } //----------------------------------------------------------------------------- // rowgrid //----------------------------------------------------------------------------- static void rowgrid( MiscExportGridMode row_grid, MiscExportGridMode col_grid, int row_title_width, int ncols, int const* widths, FILE* fp ) { if (row_grid != MISC_EXPORT_GRID_OFF) { char row_grid_ch = ' '; char col_grid_ch = ' '; if (row_grid == MISC_EXPORT_GRID_LINE) { row_grid_ch = '-'; if (col_grid == MISC_EXPORT_GRID_LINE) col_grid_ch = '+'; } else if (col_grid == MISC_EXPORT_GRID_LINE) col_grid_ch = '|'; if (row_title_width > 0) { colgrid( col_grid, fp, col_grid_ch ); repchar( row_title_width, row_grid_ch, fp ); } int const* w = widths; for (int c = 0; c < ncols; c++,w++) { colgrid( col_grid, fp, col_grid_ch ); repchar( *w, row_grid_ch, fp ); } endline( col_grid, fp, col_grid_ch ); } } //----------------------------------------------------------------------------- // cell_alignment //----------------------------------------------------------------------------- static int cell_alignment( id cell ) { int rc = NSLeftTextAlignment; if (cell != 0 && [cell respondsToSelector:@selector(alignment)]) rc = [cell alignment]; return rc; } //----------------------------------------------------------------------------- // cell_str //----------------------------------------------------------------------------- static NSString* cell_str( id cell ) { NSString* s = @""; if (cell != 0 && [cell respondsToSelector:@selector(stringValue)]) s = [cell stringValue]; return s; } //============================================================================= // CHAR FILTER //============================================================================= //----------------------------------------------------------------------------- // MiscCharFilter // Base class for the output character filters. // Base class is unfiltered. //----------------------------------------------------------------------------- class MiscCharFilter { protected: FILE* fp; char const* s; int len; int pos; public: MiscCharFilter( FILE* f ): fp(f), s(0), len(0), pos(0) {} virtual ~MiscCharFilter(); virtual char nextChar(); void reset( char const* t, int n ) { s = t; len = n; pos = 0; } void reset( char const* t ) { s = t; len = safe_strlen(s); pos = 0; } void reset( NSString* t ) { reset( [t lossyCString] ); } void reset() { pos = 0; } int length() const { return len; } bool done() const { return pos >= len; } bool more() const { return pos < len; } virtual void write(); void write( int field_width ); void left( int field_width ); void center( int field_width ); void right( int field_width ); static void pad( int n, FILE* f, char ch=' ' ); void pad( int n, char ch=' ' ) { pad( n, fp, ch ); } }; MiscCharFilter::~MiscCharFilter() {} char MiscCharFilter::nextChar() { char c = '\0'; if (pos < len) c = s[pos++]; return c; } void MiscCharFilter::pad( int n, FILE* fp, char ch ) { while (n-- > 0) fputc( ch, fp ); } void MiscCharFilter::write() { while (more()) fputc( nextChar(), fp ); } void MiscCharFilter::write( int w ) { while (w-- > 0) fputc( nextChar(), fp ); } void MiscCharFilter::left( int w ) { int const delta = w - length(); if (delta <= 0) write( w ); else { write(); pad( delta ); } } void MiscCharFilter::center( int w ) { int const delta = w - length(); if (delta <= 0) write( w ); else { int const left_pad = (delta >> 1); int const right_pad = delta - left_pad; pad( left_pad ); write(); pad( right_pad ); } } void MiscCharFilter::right( int w ) { int const delta = w - length(); if (delta <= 0) write( w ); else { pad( delta ); write(); } } //----------------------------------------------------------------------------- // MiscTabFilter // Output character filter for the ASCII fixed and tab-separated formats // Converts tabs, carriage-returns and newlines into space characters. //----------------------------------------------------------------------------- class MiscTabFilter : public MiscCharFilter { public: MiscTabFilter( FILE* f ): MiscCharFilter(f) {} virtual char nextChar(); }; char MiscTabFilter::nextChar() { char c = '\0'; if (pos < len) { c = s[pos++]; if (c == '\t' || c == '\n' || c == '\r') c = ' '; } return c; } //----------------------------------------------------------------------------- // MiscDelimFilter // Output character filter for the ASCII delimited format. // Converts carriage-returns and newlines into space characters. // Converts double-quote characters into single quote characters. //----------------------------------------------------------------------------- class MiscDelimFilter : public MiscCharFilter { public: MiscDelimFilter( FILE* f ): MiscCharFilter(f) {} virtual char nextChar(); virtual void write(); }; char MiscDelimFilter::nextChar() { char c = '\0'; if (pos < len) { c = s[pos++]; if (c == '\n' || c == '\r') c = ' '; else if (c == '"') c = '\''; } return c; } void MiscDelimFilter::write() { if (s != 0) { fputc( '"', fp ); MiscCharFilter::write(); fputc( '"', fp ); } } //============================================================================= // MiscExporter(ASCII) //============================================================================= @implementation MiscExporter(ASCII) //----------------------------------------------------------------------------- // fixedWidths::: //----------------------------------------------------------------------------- - (int*)fixedWidths:(int)nrows :(int)ncols :(int const*)map { int* const widths = (int*) calloc( ncols, sizeof(*widths) ); for (int r = 0; r < nrows; r++) { int* w = widths; for (int c = 0; c < ncols; c++,w++) { int const len = safe_strlen( str_at(r, map[c], tableScroll) ); if (*w < len) *w = len; } } return widths; } //----------------------------------------------------------------------------- // fixedHeadersOn::::: //----------------------------------------------------------------------------- - (void)fixedHeadersOn:(int)row_title_width :(int)ncols :(int const*)map :(int*)widths :(FILE*)fp { int c; int* wp = widths; for (c = 0; c < ncols; c++,wp++) { int const len = safe_strlen( col_title(map[c], tableScroll) ); if (*wp < len) *wp = len; } rowgrid( rowGrid, columnGrid, row_title_width, ncols, widths, fp ); rowTitleHeader( row_title_width, columnGrid, fp ); MiscTabFilter filt( fp ); int const* w = widths; for (c = 0; c < ncols; c++,w++) { colgrid( columnGrid, fp ); filt.reset( col_title( map[c], tableScroll ) ); filt.center( *w ); } endline( columnGrid, fp ); } //----------------------------------------------------------------------------- // fixedHeadersWrap::::: //----------------------------------------------------------------------------- - (void)fixedHeadersWrap:(int)row_title_width :(int)ncols :(int const*)map :(int*)widths :(FILE*)fp { int c; int max_lines = 1; int* wp = widths; for (c = 0; c < ncols; c++,wp++) { int const len = safe_strlen( col_title(map[c], tableScroll) ); if (len > *wp) { if (*wp == 0) *wp = 1; int const num_lines = (len + (*wp - 1)) / *wp; if (max_lines < num_lines) max_lines = num_lines; } } rowgrid( rowGrid, columnGrid, row_title_width, ncols, widths, fp ); MiscTabFilter filt( fp ); for (int i = 0; i < max_lines; i++) { rowTitleHeader( row_title_width, columnGrid, fp ); int const* w = widths; for (c = 0; c < ncols; c++,w++) { colgrid( columnGrid, fp ); NSString* const s = col_title( map[c], tableScroll ); char const* const cs = [s lossyCString]; int const len = safe_strlen( cs ); bool skip = true; if (len > 0) { int const num_lines = (len + (*w - 1)) / *w; int const first_line = max_lines - num_lines; if (i >= first_line) { skip = false; if (len < *w) { filt.reset( cs, len ); filt.center( *w ); } else { int const start_pos = (i - first_line) * *w; filt.reset( cs + start_pos, len - start_pos ); filt.left( *w ); } } } if (skip) filt.pad( *w ); } endline( columnGrid, fp ); } } //----------------------------------------------------------------------------- // fixedHeadersTrunc::::: //----------------------------------------------------------------------------- - (void)fixedHeadersTrunc:(int)row_title_width :(int)ncols :(int const*)map :(int const*)widths :(FILE*)fp { rowgrid( rowGrid, columnGrid, row_title_width, ncols, widths, fp ); rowTitleHeader( row_title_width, columnGrid, fp ); MiscTabFilter filt(fp); int const* w = widths; for (int c = 0; c < ncols; c++,w++) { colgrid( columnGrid, fp ); filt.reset( col_title( map[c], tableScroll ) ); filt.center( *w ); } endline( columnGrid, fp ); } //----------------------------------------------------------------------------- // fixedHeaders::::: //----------------------------------------------------------------------------- - (void)fixedHeaders:(int)row_title_width :(int)ncols :(int const*)map :(int*)widths :(FILE*)fp { switch (columnTitleMode) { default: case MISC_EXPORT_TITLES_ON: [self fixedHeadersOn:row_title_width:ncols:map:widths:fp]; break; case MISC_EXPORT_TITLES_WRAP: [self fixedHeadersWrap:row_title_width:ncols:map:widths:fp]; break; case MISC_EXPORT_TITLES_TRUNCATE: [self fixedHeadersTrunc:row_title_width:ncols:map:widths:fp]; break; case MISC_EXPORT_TITLES_OFF: break; } if (columnTitleMode != MISC_EXPORT_TITLES_OFF) rowgrid( MISC_EXPORT_GRID_LINE, columnGrid, row_title_width, ncols, widths, fp ); } //----------------------------------------------------------------------------- // exportFixed: [public] //----------------------------------------------------------------------------- - (void)exportFixed:(FILE*)fp { int const nrows = [tableScroll numberOfRows]; int const ncols = [tableScroll numberOfColumns]; int* col_map = [self makeColMap:ncols]; int* widths = [self fixedWidths:nrows:ncols:col_map]; int const row_title_width = [self rowTitleCharWidth:nrows]; [self fixedHeaders:row_title_width:ncols:col_map:widths:fp]; MiscTabFilter filt(fp); for (int r = 0; r < nrows; r++) { int const pr = row_at( r, tableScroll ); if (row_title_width > 0) { colgrid( columnGrid, fp ); filt.reset( row_title( pr, tableScroll ) ); filt.center( row_title_width ); } int const* w = widths; for (int c = 0; c < ncols; c++,w++) { colgrid( columnGrid, fp ); id cell = cell_at( pr, col_map[c], tableScroll ); filt.reset( cell_str( cell ) ); switch (cell_alignment( cell )) { default: case NSLeftTextAlignment: filt.left( *w ); break; case NSRightTextAlignment: filt.right( *w ); break; case NSCenterTextAlignment: filt.center( *w ); break; } } endline( columnGrid, fp ); rowgrid( rowGrid, columnGrid, row_title_width, ncols, widths, fp ); } free( widths ); free( col_map ); } //----------------------------------------------------------------------------- // exportDelimited: //----------------------------------------------------------------------------- - (void)exportDelimited:(FILE*)fp :(MiscCharFilter*)filt :(char) separator { int const nrows = [tableScroll numberOfRows]; int const ncols = [tableScroll numberOfColumns]; BOOL const row_titles = (rowTitleMode != MISC_EXPORT_TITLES_OFF); int* col_map = [self makeColMap:ncols]; if (columnTitleMode != MISC_EXPORT_TITLES_OFF) { if (row_titles) { NSString* rt = @"Row Titles"; filt->reset( rt ); filt->write(); fputc( separator, fp ); } for (int c = 0; c < ncols; c++) { if (c > 0) fputc( separator, fp ); filt->reset( col_title( col_map[c], tableScroll ) ); filt->write(); } fputc( '\n', fp ); } for (int r = 0; r < nrows; r++) { int const pr = row_at( r, tableScroll ); if (row_titles) { filt->reset( row_title( pr, tableScroll ) ); filt->write(); fputc( separator, fp ); } for (int c = 0; c < ncols; c++) { if (c > 0) fputc( separator, fp ); filt->reset( str_at( pr, col_map[c], tableScroll ) ); filt->write(); } fputc( '\n', fp ); } free( col_map ); } //----------------------------------------------------------------------------- // exportTab: [public] //----------------------------------------------------------------------------- - (void)exportTab:(FILE*)fp { MiscTabFilter filt( fp ); [self exportDelimited:fp:&filt:'\t']; } //----------------------------------------------------------------------------- // exportDelimited: [public] //----------------------------------------------------------------------------- - (void)exportDelimited:(FILE*)fp { MiscDelimFilter filt( fp ); [self exportDelimited:fp:&filt:',']; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscExporterAccessoryView.M100444 1750 1750 10332 6757227326 26544 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporterAccessoryView.M // // Object that exports the contents of an MiscTableScroll in // various useful formats. // // BUGS: // * Enable / disable save controls based on format. // TODO: // * Add more export formats: rtf0, Lotus 1-2-3, Quattro, Excel, etc. // * Maybe provide option for line terminators. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporterAccessoryView.M,v 1.4 98/03/29 23:45:25 sunshine Exp $ // $Log: MiscExporterAccessoryView.M,v $ // Revision 1.4 98/03/29 23:45:25 sunshine // v138.1: Accessory view is now loaded from a nib rather than constructed // programatically. Control titles are no longer compiled in. // // Revision 1.3 97/03/10 10:28:49 sunshine // v113.1: For OpenStep conformance, many 'col' methods rename to 'column'. // // Revision 1.2 97/02/07 13:53:25 sunshine // v108: Ported to OPENSTEP 4.1 (gamma). //----------------------------------------------------------------------------- #import "MiscExporterAccessoryView.h" extern "Objective-C" { #import #import #import } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscExporterAccessoryView - (NSView*)view { return [window contentView]; } - (MiscExportFormat)format { return MiscExportFormat( [[formatPop selectedItem] tag] ); } - (MiscExportTitleMode)rowTitleMode; { return MiscExportTitleMode( [[rowTitlePop selectedItem] tag] ); } - (MiscExportTitleMode)columnTitleMode; { return MiscExportTitleMode( [[colTitlePop selectedItem] tag] ); } - (MiscExportGridMode)rowGrid; { return MiscExportGridMode( [[rowGridPop selectedItem] tag] ); } - (MiscExportGridMode)colGrid; { return MiscExportGridMode( [[colGridPop selectedItem] tag] ); } //----------------------------------------------------------------------------- // - select:itemWithTag: -- If 'tag' not found then selects item 0. //----------------------------------------------------------------------------- - (void)select:(NSPopUpButton*)popup itemWithTag:(int)tag { unsigned int i = [popup numberOfItems]; NSParameterAssert( i != 0 ); while (i-- > 1) if (tag == [[popup itemAtIndex:i] tag]) break; [popup selectItemAtIndex:i]; } //----------------------------------------------------------------------------- // -initWithFormat:rowTitle:colTitle:rowGrid:colGrid: //----------------------------------------------------------------------------- - (MiscExporterAccessoryView*) initWithFormat:(MiscExportFormat)format rowTitle:(MiscExportTitleMode)rowTitle colTitle:(MiscExportTitleMode)colTitle rowGrid:(MiscExportGridMode)rowGrid colGrid:(MiscExportGridMode)colGrid { [super init]; [NSBundle loadNibNamed:@"MiscExporterAccessoryView" owner:self]; [self select:formatPop itemWithTag:format ]; [self select:rowTitlePop itemWithTag:rowTitle]; [self select:colTitlePop itemWithTag:colTitle]; [self select:rowGridPop itemWithTag:rowGrid ]; [self select:colGridPop itemWithTag:colGrid ]; return self; } //----------------------------------------------------------------------------- // -dealloc //----------------------------------------------------------------------------- - (void)dealloc { [window release]; [super dealloc]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscExporterAccessoryView.h100444 1750 1750 5170 6757227327 26564 0ustar sunshinesunshine#ifndef __MiscExporterAccessoryView_h #define __MiscExporterAccessoryView_h //============================================================================= // // Copyright (C) 1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporterAccessoryView.h // // SavePanel accessory view for use by the MiscExporter class. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporterAccessoryView.h,v 1.5 98/03/29 23:45:29 sunshine Exp $ // $Log: MiscExporterAccessoryView.h,v $ // Revision 1.5 98/03/29 23:45:29 sunshine // v138.1: Accessory view is now loaded from a nib rather than constructed // programatically. Control titles are no longer compiled in. // // Revision 1.4 97/04/15 08:57:51 sunshine // v0.125.8: Added "MiscTableScroll/" prefix to #import to facilitate new // framework organization. // // Revision 1.3 97/03/10 10:28:46 sunshine // v113.1: For OpenStep conformance, many 'col' methods rename to 'column'. //----------------------------------------------------------------------------- extern "Objective-C" { #import } #import @class NSBox, NSPopUpButton, NSView, NSWindow; @interface MiscExporterAccessoryView : NSObject { NSWindow* window; NSPopUpButton* formatPop; NSPopUpButton* rowTitlePop; NSPopUpButton* colTitlePop; NSPopUpButton* rowGridPop; NSPopUpButton* colGridPop; NSBox* formatBox; NSBox* rowTitleBox; NSBox* colTitleBox; NSBox* rowGridBox; NSBox* colGridBox; } - (MiscExporterAccessoryView*) initWithFormat:(MiscExportFormat)format rowTitle:(MiscExportTitleMode)rowTitle colTitle:(MiscExportTitleMode)colTitle rowGrid:(MiscExportGridMode)rowGrid colGrid:(MiscExportGridMode)colGrid; - (void)dealloc; - (NSView*)view; - (MiscExportFormat)format; - (MiscExportTitleMode)rowTitleMode; - (MiscExportTitleMode)columnTitleMode; - (MiscExportGridMode)rowGrid; - (MiscExportGridMode)colGrid; @end #endif // __MiscExporterAccessoryView_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscExporterDBF.M100444 1750 1750 52043 6757227327 24357 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporterDBF.M // // Routines to export MiscTableScrolls in dBASE III (.DBF) format. // // TODO: // Provide some public means to set the "AMERICAN_DATE" and the // locale-specific characters. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporterDBF.M,v 1.3 97/04/01 07:47:22 sunshine Exp $ // $Log: MiscExporterDBF.M,v $ // Revision 1.3 97/04/01 07:47:22 sunshine // v0.125.5: Removed unused argument. No longer shadows variable in // -dbfAnalyze:::. // // Revision 1.2 97/02/07 13:53:18 sunshine // v108: Ported to OPENSTEP 4.1 (gamma). // // Revision 1.1 96/09/25 11:55:17 zarnuk // Exports the contents of table scroll in dBASEIII .dbf format. //----------------------------------------------------------------------------- #import "MiscExporterPrivate.h" #import "bool.h" extern "C" { #import #import // time(), localtime(), strftime() } char const DECIMAL_CHAR = '.'; // American value. char const DATE_CHAR = '/'; // American value. char const TIME_CHAR = ':'; // American value. bool const AMERICAN_DATE = true; // mm/dd/yy vs. dd/mm/yy int const DBF_NUM_FLDS_MAX = 1022; // Max # fields. int const DBF_REC_LEN_MAX = 0x7fff; // Max record length. int const DBF_FLD_NAME_MAX = 10; int const DBF_CHAR_LEN_MAX = 254; int const DBF_DATE_WIDTH = 8; // "YYYYMMDD" int const DBF_TIME_WIDTH = 5; // "HH:MM" int const DBF_NUMERIC_LEN_MAX = 19; // Max length for "N" fields. static char const DBF_NULL_DATE_STR[] = " "; static char const DBF_NULL_TIME_STR[] = " "; struct DBFHeader { unsigned char version; unsigned char update_yr; unsigned char update_mon; unsigned char update_day; unsigned char num_recs[4]; // little-endian long int unsigned char hdr_len[2]; // little-endian short int unsigned char rec_len[2]; // little-endian short int char fill[20]; }; struct DBFFieldDef { char name[ DBF_FLD_NAME_MAX + 1 ]; char type; // Char, Numeric, Logical, Date, Memo. char fill[4]; unsigned char fld_len; unsigned char num_decimals; char fill2[14]; }; enum DBFDataType { DBF_TYPE_CHAR, // Non-structured type. DBF_TYPE_NUMERIC, // Numeric values only. DBF_TYPE_DATE, // Date values only. DBF_TYPE_DATETIME // Date-time values only. }; #define DBF_BIT_CHAR (1 << DBF_TYPE_CHAR) #define DBF_BIT_NUMERIC (1 << DBF_TYPE_NUMERIC) #define DBF_BIT_DATE (1 << DBF_TYPE_DATE) #define DBF_BIT_DATETIME (1 << DBF_TYPE_DATETIME) static char const DBF_TYPE_CODE[] = "CNDD"; struct DBFInfo { DBFDataType type; // Final data type. unsigned int mask; // All candidate types. int max_width; // Max width for this column. int max_left; // Left of decimal for numeric. int max_right; // Right of decimal for numeric. }; struct DBFDateTime { int year; int month; int day; int hour; int minute; int second; }; //----------------------------------------------------------------------------- // dbf_field_name // Make sure all field names conform to DBF field name rules. //----------------------------------------------------------------------------- static int dbf_field_name( char* buff, NSString* str ) { int len = 0; char const* s = (str != 0 ? [str lossyCString] : 0); if (s != 0) { bool in_gap = true; for (; len < DBF_FLD_NAME_MAX && *s != 0; s++) { char const c = toupper(*s); if ('A' <= c && c <= 'Z') { in_gap = false; buff[len++] = c; } else if ('0' <= c && c <= '9') { in_gap = false; if (len == 0) // Cannot start with digit. buff[len++] = 'F'; buff[len++] = c; } else if (!in_gap) { in_gap = true; buff[len++] = '_'; } } if (in_gap && len > 0) // Remove trailing underline. len--; } if (len == 0) { char const DEFAULT_FIELD_NAME[] = "FIELD"; strcpy( buff, DEFAULT_FIELD_NAME ); len = sizeof( DEFAULT_FIELD_NAME ) - 1; } buff[ len ] = '\0'; return len; } //----------------------------------------------------------------------------- // adjust_name // Adjust this field name to try to avoid a collision with other // field names. Performs the adjustment by appending a counter to // the end of the name. If the counter does not fit in the space // following the field name, the field name's "core" length is // trimmed back to allow more space for the counter. Returns the // new "core" length for the field. //----------------------------------------------------------------------------- static int adjust_name( char* name, int core_len, int counter ) { char buff[ 16 ]; sprintf( buff, "%d", counter ); int buff_len = strlen( buff ); if (core_len + buff_len > DBF_FLD_NAME_MAX) core_len = DBF_FLD_NAME_MAX - buff_len; strcpy( name + core_len, buff ); return core_len; } //----------------------------------------------------------------------------- // collision // Does this field name collide with any preceeding field name? //----------------------------------------------------------------------------- static BOOL collision( DBFFieldDef const* flds, DBFFieldDef const* flds_lim ) { char const* const name = flds_lim->name; for ( ; flds < flds_lim; flds++) if (strcmp( flds->name, name ) == 0) return YES; return NO; } //----------------------------------------------------------------------------- // set_field_name //----------------------------------------------------------------------------- static void set_field_name( NSString* s, DBFFieldDef* fld, DBFFieldDef* flds ) { int slen = dbf_field_name( fld->name, s ); int num_tries = 0; while (collision( flds, fld )) slen = adjust_name( fld->name, slen, ++num_tries ); } //----------------------------------------------------------------------------- // set_field //----------------------------------------------------------------------------- static void set_field( NSString* s, DBFFieldDef* fld, DBFFieldDef* flds, DBFInfo const* ip ) { set_field_name( s, fld, flds ); fld->type = DBF_TYPE_CODE[ ip->type ]; fld->fld_len = (unsigned char) ip->max_width; if (ip->type == DBF_TYPE_NUMERIC) fld->num_decimals = ip->max_right; } //----------------------------------------------------------------------------- // set_time_field //----------------------------------------------------------------------------- static void set_time_field( NSString* s, DBFFieldDef* fld, DBFFieldDef* flds, DBFInfo const* ) { set_field_name( s, fld, flds ); fld->type = DBF_TYPE_CODE[ DBF_TYPE_CHAR ]; fld->fld_len = DBF_TIME_WIDTH; } //----------------------------------------------------------------------------- // skip_whitespace //----------------------------------------------------------------------------- inline static char const* skip_whitespace( char const* s ) { if (s != 0) for (; *s != 0 && isspace(*s); s++) /*empty*/; return s; } //----------------------------------------------------------------------------- // dbf_is_numeric //----------------------------------------------------------------------------- static bool dbf_is_numeric( NSString* str, DBFInfo* ip ) { bool neg = false; int left_len = 0; int right_len = 0; char const* s = [str lossyCString]; if (*s == '\0') // Empty string, treat as null. return true; if (*s == '-') { s++; neg = true; } else if (*s == '+') s++; s = skip_whitespace( s ); while ('0' <= *s && *s <= '9') { s++; left_len++; } if (*s == DECIMAL_CHAR) { s++; while ('0' <= *s && *s <= '9') { s++; right_len++; } } s = skip_whitespace( s ); if (*s == '\0' && (left_len > 0 || right_len > 0)) { if (left_len == 0) left_len++; if (neg) left_len++; if (ip->max_left < left_len) ip->max_left = left_len; if (ip->max_right < right_len) ip->max_right = right_len; return true; } return false; } //----------------------------------------------------------------------------- // dbf_parse_time //----------------------------------------------------------------------------- static DBFDataType dbf_parse_time( NSString* str, DBFDateTime& dt ) { char const* s = [str lossyCString]; DBFDataType type = DBF_TYPE_CHAR; if ('0' <= *s && *s <= '9') { int hour = 0; do { hour = hour * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (*s == TIME_CHAR) { s++; if ('0' <= *s && *s <= '9') { int minute = 0; int second = 0; do { minute = minute * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (*s == TIME_CHAR) // seconds are optional. { s++; second = -1; if ('0' <= *s && *s <= '9') { second = 0; do { second = second * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (*s == TIME_CHAR || *s == DECIMAL_CHAR) { s++; // fractions of seconds ignored. while ('0' <= *s && *s <= '9') s++; } } } s = skip_whitespace(s); if (*s == '\0' && 0 <= hour && hour <= 23 && 0 <= minute && minute <= 59 && 0 <= second && second <= 59) { dt.hour = hour; dt.minute = minute; dt.second = second; type = DBF_TYPE_DATETIME; } } } } return type; } //----------------------------------------------------------------------------- // dbf_parse_date //----------------------------------------------------------------------------- static DBFDataType dbf_parse_date( NSString* str, DBFDateTime& dt ) { char const* s = [str lossyCString]; memset( &dt, 0, sizeof(dt) ); DBFDataType type = DBF_TYPE_CHAR; if (*s == '\0') type = DBF_TYPE_DATE; else if ('0' <= *s && *s <= '9') { int month = 0; do { month = month * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (*s == DATE_CHAR) { s++; if ('0' <= *s && *s <= '9') { int day = 0; do { day = day * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (*s == DATE_CHAR) { s++; if ('0' <= *s && *s <= '9') { int year = 0; do { year = year * 10 + *s - '0'; s++; } while ('0' <= *s && *s <= '9'); if (!AMERICAN_DATE) { int tmp = month; month = day; day = tmp; } if (1 <= month && month <= 12 && 1 <= day && day <= 31 && ((0 <= year && year < 100) || (1700 < year && year < 3000))) { if (year < 100) { time_t t; time(&t); struct tm const* tm = localtime(&t); int tm_year = tm->tm_year + 1900; year += 1900; while ((tm_year - year) > 90) year += 100; } dt.year = year; dt.month = month; dt.day = day; s = skip_whitespace(s); if (*s == '\0') type = DBF_TYPE_DATE; else { NSString* tm = [NSString stringWithCString:s]; type = dbf_parse_time( tm, dt ); } } } } } } } return type; } //============================================================================= // MiscExporter //============================================================================= @implementation MiscExporter(DBF) //----------------------------------------------------------------------------- // dbfAnalyze::: //----------------------------------------------------------------------------- - (DBFInfo*)dbfAnalyze:(int)nrows :(int)ncols :(int const*)map { int c; DBFDateTime datetime; DBFInfo* const info = (DBFInfo*) calloc( ncols, sizeof(*info) ); for (c = 0; c < ncols; c++) info[c].mask = (DBF_BIT_NUMERIC | DBF_BIT_DATE | DBF_BIT_DATETIME); for (int r = 0; r < nrows; r++) { DBFInfo* ip = info; for (c = 0; c < ncols; c++,ip++) { NSString* const s = str_at( r, map[c], tableScroll ); if (s != 0 && [s length] > 0) { int const len = [s length]; if (ip->max_width < len) ip->max_width = len; unsigned int mask = ip->mask; if (mask & DBF_BIT_NUMERIC) { if (!dbf_is_numeric( s, ip )) mask &= ~DBF_BIT_NUMERIC; } if (mask & (DBF_BIT_DATE | DBF_BIT_DATETIME)) { switch (dbf_parse_date( s, datetime )) { default: case DBF_TYPE_CHAR: case DBF_TYPE_NUMERIC: mask &= ~(DBF_BIT_DATE | DBF_BIT_DATETIME); break; case DBF_TYPE_DATETIME: mask &= ~DBF_BIT_DATE; break; case DBF_TYPE_DATE: break; } } ip->mask = mask; } } } DBFInfo* ip = info; for (c = 0; c < ncols; c++,ip++) { DBFDataType type = DBF_TYPE_CHAR; unsigned int const mask = ip->mask; if (mask & DBF_BIT_DATE) { type = DBF_TYPE_DATE; ip->max_width = DBF_DATE_WIDTH; } else if (mask & DBF_BIT_DATETIME) { type = DBF_TYPE_DATETIME; ip->max_width = DBF_DATE_WIDTH; } else if (mask & DBF_BIT_NUMERIC) { type = DBF_TYPE_NUMERIC; int width = ip->max_left; if (ip->max_right > 0) width += ip->max_right + 1; if (width > DBF_NUMERIC_LEN_MAX) { type = DBF_TYPE_CHAR; if (width > DBF_CHAR_LEN_MAX) width = DBF_CHAR_LEN_MAX; } ip->max_width = width; } else if (ip->max_width > DBF_CHAR_LEN_MAX) ip->max_width = DBF_CHAR_LEN_MAX; ip->type = type; } return info; } //----------------------------------------------------------------------------- // dbfFields::::: // Set the names of the Field definitions. // Make sure all field names conform to DBF field name rules. // Make sure all field names are unique within the DBF length limits. //----------------------------------------------------------------------------- - (void)dbfFields:(int)row_title_width :(DBFFieldDef*)flds :(int)ncols :(int const*)map :(DBFInfo const*)info { DBFFieldDef* fld = flds; if (row_title_width > 0) { strcpy( fld->name, "ROW_TITLE" ); fld->type = DBF_TYPE_CODE[ DBF_TYPE_CHAR ]; fld->fld_len = (unsigned char) row_title_width; fld++; } DBFInfo const* ip = info; for (int c = 0; c < ncols; c++,fld++,ip++) { NSString* const s = col_title( map[c], tableScroll ); set_field( s, fld, flds, ip ); if (ip->type == DBF_TYPE_DATETIME) set_time_field( s, ++fld, flds, ip ); } } //----------------------------------------------------------------------------- // dbfHeader:::: //----------------------------------------------------------------------------- - (int)dbfHeader:(int)row_title_width :(int)nrows :(int)ncols :(int const*)map :(DBFInfo const*)info :(FILE*)fp { BOOL const rowTitlesOn = (row_title_width > 0); int rec_len = 1; // All records have a one-byte flag. int nflds = 0; int ntime = 0; // Number of extra time fields. if (rowTitlesOn) { rec_len += row_title_width; nflds++; } DBFInfo const* ip = info; for (int i = 0; i < ncols; i++,ip++) { if (ip->type == DBF_TYPE_DATETIME) { if (nflds + 1 < DBF_NUM_FLDS_MAX && rec_len <= DBF_REC_LEN_MAX - DBF_DATE_WIDTH - DBF_TIME_WIDTH) { rec_len += DBF_DATE_WIDTH + DBF_TIME_WIDTH; nflds += 2; ntime++; } else break; // Either get both in, or neither. } else if (nflds < DBF_NUM_FLDS_MAX && rec_len + ip->max_width < DBF_REC_LEN_MAX) { rec_len += ip->max_width; nflds++; } } int const nbytes = sizeof(DBFHeader) + (nflds * sizeof(DBFFieldDef)) + 1; DBFHeader* hdr = (DBFHeader*) calloc( 1, nbytes ); DBFFieldDef* flds = (DBFFieldDef*)(hdr + 1); time_t t; time( &t ); struct tm const* tm = localtime( &t ); hdr->version = 0x03; hdr->update_yr = (unsigned char) ((tm->tm_year) & 0x0ff); hdr->update_mon = (unsigned char) ((tm->tm_mon + 1) & 0x0ff); hdr->update_day = (unsigned char) ((tm->tm_mday) & 0x0ff); int n = nrows; hdr->num_recs[0] = (unsigned char) (n & 0x0ff); n = n >> 8; hdr->num_recs[1] = (unsigned char) (n & 0x0ff); n = n >> 8; hdr->num_recs[2] = (unsigned char) (n & 0x0ff); n = n >> 8; hdr->num_recs[3] = (unsigned char) (n & 0x0ff); n = nbytes; hdr->hdr_len[0] = (unsigned char) (n & 0x0ff); n = n >> 8; hdr->hdr_len[1] = (unsigned char) (n & 0x0ff); n = rec_len; hdr->rec_len[0] = (unsigned char) (n & 0x0ff); n = n >> 8; hdr->rec_len[1] = (unsigned char) (n & 0x0ff); ncols = (rowTitlesOn ? nflds - 1 : nflds) - ntime; [self dbfFields:row_title_width:flds:ncols:map:info]; flds[nflds].name[0] = '\r'; fwrite( hdr, nbytes, 1, fp ); free( hdr ); return ncols; } //----------------------------------------------------------------------------- // dbf_put_char //----------------------------------------------------------------------------- static void dbf_put_char( NSString* str, int width, FILE* fp ) { char const* s = [str lossyCString]; if (s == 0) pad( width, fp ); else { int const len = strlen( s ); int const delta = width - len; if (delta > 0) { fwrite( s, len, 1, fp ); pad( delta, fp ); } else fwrite( s, width, 1, fp ); } } //----------------------------------------------------------------------------- // dbf_put_numeric //----------------------------------------------------------------------------- static void dbf_put_numeric( NSString* str, DBFInfo const* ip, FILE* fp ) { if (str == 0) { if (ip->max_left > 1) pad( ip->max_left - 1, fp ); fputc( '0', fp ); if (ip->max_right > 0) { fputc( '.', fp ); repchar( ip->max_right, '0', fp ); } } else { bool neg = false; int right_len = 0; char const* s = [str lossyCString]; s = skip_whitespace(s); if (*s == '-') { s++; neg = true; } else if (*s == '+') s++; s = skip_whitespace(s); char const* const left_part = s; while ('0' <= *s && *s <= '9') s++; int const left_len = (s - left_part); char const* right_part = s; if (*s == DECIMAL_CHAR) { s++; right_part++; while ('0' <= *s && *s <= '9') s++; right_len = (s - right_part); } int left_pad = ip->max_width - left_len; if (left_len == 0) left_pad--; // Room for required '0'. if (ip->max_right > 0) // Room for decimal and fraction. left_pad -= ip->max_right + 1; if (neg) left_pad--; // Room for '-'. pad( left_pad, fp ); if (neg) fputc( '-', fp ); if (left_len <= 0) fputc( '0', fp ); else fwrite( left_part, 1, left_len, fp ); if (ip->max_right > 0) { fputc( '.', fp ); if (right_len > 0) fwrite( right_part, 1, right_len, fp ); if (right_len < ip->max_right) repchar( ip->max_right - right_len, '0', fp ); } } } //----------------------------------------------------------------------------- // dbf_put_date //----------------------------------------------------------------------------- static void dbf_put_date( NSString* str, DBFInfo const* ip, FILE* fp ) { char const* s = (str != 0 ? [str lossyCString] : 0); s = skip_whitespace(s); if (s == 0 || *s == 0) { fputs( DBF_NULL_DATE_STR, fp ); if (ip->type == DBF_TYPE_DATETIME) fputs( DBF_NULL_TIME_STR, fp ); } else { char buff[ 64 ]; DBFDateTime dt; dbf_parse_date( str, dt ); sprintf( buff, "%04d%02d%02d", dt.year, dt.month, dt.day ); fputs( buff, fp ); if (ip->type == DBF_TYPE_DATETIME) { sprintf( buff, "%02d:%02d", dt.hour, dt.minute ); fputs( buff, fp ); } } } //----------------------------------------------------------------------------- // exportDBF: //----------------------------------------------------------------------------- - (void)exportDBF:(FILE*)fp { int const nrows = [tableScroll numberOfRows]; int const tcols = [tableScroll numberOfColumns]; int* col_map = [self makeColMap:tcols]; DBFInfo* info = [self dbfAnalyze:nrows:tcols:col_map]; int row_title_width = [self rowTitleCharWidth:nrows]; if (row_title_width > DBF_CHAR_LEN_MAX) row_title_width = DBF_CHAR_LEN_MAX; int const ncols = [self dbfHeader:row_title_width:nrows:tcols:col_map:info:fp]; for (int r = 0; r < nrows; r++) { int const pr = row_at( r, tableScroll ); fputc( ' ', fp ); if (row_title_width > 0) dbf_put_char( row_title( pr, tableScroll ), row_title_width, fp ); DBFInfo const* ip = info; for (int c = 0; c < ncols; c++,ip++) { NSString* const s = str_at( pr, col_map[c], tableScroll ); switch (ip->type) { case DBF_TYPE_CHAR: dbf_put_char( s, ip->max_width, fp ); break; case DBF_TYPE_NUMERIC: dbf_put_numeric( s, ip, fp ); break; case DBF_TYPE_DATE: case DBF_TYPE_DATETIME: dbf_put_date( s, ip, fp ); break; } } } fputc( '\x1a', fp ); // Terminating Control-Z. free( info ); free( col_map ); } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscExporterPrivate.h100444 1750 1750 7366 6757227327 25421 0ustar sunshinesunshine#ifndef __MiscExporterPrivate_h #define __MiscExporterPrivate_h //============================================================================= // // Copyright (C) 1996-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscExporterPrivate.h // // Private, internal communication and utility routines for the // MiscExporter class. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscExporterPrivate.h,v 1.4 97/04/15 08:58:07 sunshine Exp $ // $Log: MiscExporterPrivate.h,v $ // Revision 1.4 97/04/15 08:58:07 sunshine // v0.125.8: Added "MiscTableScroll/" prefix to #import to facilitate new // framework organization. // // Revision 1.3 97/03/10 10:29:16 sunshine // v113.1: For OpenStep conformance, many 'col' methods renamed to 'column'. // // Revision 1.2 97/02/07 13:53:11 sunshine // v108: Ported to OPENSTEP 4.1 (gamma). //----------------------------------------------------------------------------- #import #import extern "Objective-C" { #import } extern "C" { #import #import } @interface MiscExporter(Private) - (int*)makeColMap:(int)ncols; - (int)rowTitleCharWidth:(int) nrows; @end @interface MiscExporter(ASCII) - (void)exportFixed:(FILE*)fp; - (void)exportTab:(FILE*)fp; - (void)exportDelimited:(FILE*)fp; @end @interface MiscExporter(DBF) - (void)exportDBF:(FILE*)fp; @end //----------------------------------------------------------------------------- // safe_strlen //----------------------------------------------------------------------------- inline static int safe_strlen( NSString* s ) { return (s != 0 ? [s length] : 0); } //----------------------------------------------------------------------------- // safe_strlen //----------------------------------------------------------------------------- inline static int safe_strlen( char const* s ) { return (s != 0 ? strlen(s) : 0); } //----------------------------------------------------------------------------- // repchar //----------------------------------------------------------------------------- inline static void repchar( int rep, char c, FILE* fp ) { for (int i = 0; i < rep; i++) fputc( c, fp ); } //----------------------------------------------------------------------------- // pad //----------------------------------------------------------------------------- inline static void pad( int len, FILE* fp ) { repchar( len, ' ', fp ); } inline static int row_at( int visual_pos, id obj ) { return [obj rowAtPosition:visual_pos]; } inline static int col_at( int visual_pos, id obj ) { return [obj columnAtPosition:visual_pos]; } inline static id cell_at( int r, int c, id obj ) { return [obj cellAtRow:r column:c]; } inline static NSString* str_at( int r, int c, id obj ) { return [obj stringValueAtRow:r column:c]; } inline static NSString* col_title( int c, id obj ) { return [obj columnTitle:c]; } inline static NSString* row_title( int r, id obj ) { return [obj rowTitle:r]; } #endif // __MiscExporterPrivate_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscGeometry.h100444 1750 1750 16424 6757227327 24064 0ustar sunshinesunshine#ifndef __MiscGeometry_h #define __MiscGeometry_h #ifdef __GNUC__ # pragma interface #endif //============================================================================= // // Copyright (C) 1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscGeometry.h // // Geometric types (point, size, rectangle) which understand and can // adjust for orientation (horizontal or vertical). Orientation is // specified upon creation and can not be changed thereafter. // // Method names with the "_O" suffix take orientation into consideration, // whereas methods lacking this suffix do not. // // Methods dealing with NeXT geometric structures do not apply orientation // adjustments. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscGeometry.h,v 1.4 98/03/30 09:43:59 sunshine Exp $ // $Log: MiscGeometry.h,v $ // Revision 1.4 98/03/30 09:43:59 sunshine // v138.1: Worked around Rhapsody DR1, PPC "internal compiler error" bug. // // Revision 1.3 98/03/29 23:45:48 sunshine // v138.1: #import was missing "MiscTableScroll/" for public header. // // Revision 1.2 96/05/07 02:06:10 sunshine // Ported to OpenStep 4.0 for Mach PR2. //----------------------------------------------------------------------------- #include #include "bool.h" extern "C" { #import } class MiscOrientation { private: bool horizontal; public: bool isHorz() const { return horizontal; } bool isVert() const { return !isHorz(); } MiscBorderType border() const { return isHorz() ? MISC_COL_BORDER : MISC_ROW_BORDER; } MiscOrientation( bool is_horz ) : horizontal(is_horz) {} MiscOrientation( MiscBorderType b ) : horizontal( b == MISC_COL_BORDER ) {} }; class MiscPoint_O : public virtual MiscOrientation { private: MiscPixels x; MiscPixels y; public: MiscPixels getX() const { return x; } MiscPixels getY() const { return y; } MiscPixels getX_O() const { return isHorz() ? x : y; } MiscPixels getY_O() const { return isHorz() ? y : x; } void setX( MiscPixels n ) { x = n; } void setY( MiscPixels n ) { y = n; } void setX_O( MiscPixels n ) { (isHorz() ? x : y) = n; } void setY_O( MiscPixels n ) { (isHorz() ? y : x) = n; } MiscPoint_O& operator=( MiscPoint_O const& p ) { setX_O( p.getX_O() ); setY_O( p.getY_O() ); return *this; } bool operator==( MiscPoint_O const& p ) const { return isHorz() == p.isHorz() && getX_O() == p.getX_O() && getY_O() == p.getY_O(); } bool operator!=( MiscPoint_O const& p ) const { return !operator==(p); } NSPoint nsPoint() const { return NSMakePoint( x, y ); } operator NSPoint() const { return nsPoint(); } MiscPoint_O& operator=( NSPoint ); MiscPoint_O( bool is_horz, MiscPixels _x = 0, MiscPixels _y = 0 ) : MiscOrientation(is_horz),x(_x),y(_y) {} MiscPoint_O( MiscBorderType b, MiscPixels _x = 0, MiscPixels _y = 0 ) : MiscOrientation(b),x(_x),y(_y) {} MiscPoint_O( MiscPoint_O const& p ) : MiscOrientation(p.isHorz()),x(p.getX_O()),y(p.getY_O()) {} MiscPoint_O( bool is_horz, NSPoint ); MiscPoint_O( MiscBorderType b, NSPoint ); }; class MiscSize_O : public virtual MiscOrientation { private: MiscPixels width; MiscPixels height; public: MiscPixels getWidth() const { return width; } MiscPixels getHeight() const { return height; } MiscPixels getWidth_O() const { return isHorz() ? width : height; } MiscPixels getHeight_O() const { return isHorz() ? height : width; } void setWidth( MiscPixels w ) { width = w; } void setHeight( MiscPixels h ) { height = h; } void setWidth_O( MiscPixels w ) { (isHorz() ? width : height) = w; } void setHeight_O( MiscPixels h ) { (isHorz() ? height : width) = h; } MiscSize_O& operator=( MiscSize_O const& p ) { setWidth_O( p.getWidth_O() ); setHeight_O( p.getHeight_O() ); return *this; } bool operator==( MiscSize_O const& p ) const { return isHorz() == p.isHorz() && getWidth_O() == p.getWidth_O() && getHeight_O() == p.getHeight_O(); } bool operator!=( MiscSize_O const& p ) const { return !operator==(p); } NSSize nsSize() const { return NSMakeSize( width, height ); } operator NSSize() const { return nsSize(); } MiscSize_O& operator=( NSSize ); MiscSize_O( bool is_horz, MiscPixels w = 0, MiscPixels h = 0 ) : MiscOrientation(is_horz),width(w),height(h) {} MiscSize_O( MiscBorderType b, MiscPixels w = 0, MiscPixels h = 0 ) : MiscOrientation(b),width(w),height(h) {} MiscSize_O( MiscSize_O const& p ) : MiscOrientation(p.isHorz()), width(p.getWidth_O()),height(p.getHeight_O()) {} MiscSize_O( bool is_horz, NSSize ); MiscSize_O( MiscBorderType b, NSSize ); }; class MiscRect_O : public MiscPoint_O, public MiscSize_O { public: MiscPixels getMaxX() const { return getX() + getWidth(); } MiscPixels getMaxY() const { return getY() + getHeight(); } MiscPixels getMaxX_O() const { return getX_O() + getWidth_O(); } MiscPixels getMaxY_O() const { return getY_O() + getHeight_O(); } MiscRect_O& operator=( MiscPoint_O const& p ) { MiscPoint_O::operator=( p ); return *this; } MiscRect_O& operator=( MiscSize_O const& p ) { MiscSize_O::operator=( p ); return *this; } MiscRect_O& operator=( MiscRect_O const& r ) { MiscPoint_O::operator=(r); MiscSize_O::operator=(r); return *this; } bool operator==( MiscRect_O const& r ) const { return MiscPoint_O::operator==(r) && MiscSize_O::operator==(r); } bool operator!=( MiscRect_O const& r ) const { return !operator==(r); } NSRect nsRect() const { NSRect r = { nsPoint(), nsSize() }; return r; } operator NSRect() const { return nsRect(); } MiscRect_O& operator=( NSPoint p ) { MiscPoint_O::operator=(p); return *this; } MiscRect_O& operator=( NSSize s ) { MiscSize_O::operator=(s); return *this; } MiscRect_O& operator=( NSRect r ) { MiscPoint_O::operator=( r.origin ); MiscSize_O::operator=( r.size ); return *this; } MiscRect_O( bool is_horz, MiscPixels x = 0, MiscPixels y = 0, MiscPixels w = 0, MiscPixels h = 0 ) : MiscOrientation(is_horz), MiscPoint_O(is_horz,x,y),MiscSize_O(is_horz,w,h) {} MiscRect_O( MiscBorderType b, MiscPixels x = 0, MiscPixels y = 0, MiscPixels w = 0, MiscPixels h = 0 ) : MiscOrientation(b),MiscPoint_O(b,x,y),MiscSize_O(b,w,h) {} MiscRect_O( MiscRect_O const& r ) : MiscOrientation(r.isHorz()),MiscPoint_O(r),MiscSize_O(r) {} MiscRect_O( bool is_horz, NSRect r ) : MiscOrientation(is_horz), MiscPoint_O(is_horz,r.origin),MiscSize_O(is_horz,r.size) {} MiscRect_O( MiscBorderType b, NSRect r ) : MiscOrientation(b), MiscPoint_O(b,r.origin),MiscSize_O(b,r.size) {} }; #endif // __MiscGeometry_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscRectList.h100444 1750 1750 4015 6757227332 23767 0ustar sunshinesunshine#ifndef __MiscRectList_h #define __MiscRectList_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRectList.h // // An extensible array of rectangles for rendering a whole list // of rectangles with a single trip to the display server. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRectList.h,v 1.2 96/12/30 03:12:14 sunshine Exp $ // $Log: MiscRectList.h,v $ // Revision 1.2 96/12/30 03:12:14 sunshine // v104.1: Ported to OPENSTEP 4.1 (gamma). // // Revision 1.1 96/08/30 14:57:29 sunshine // An extensible array of rectangles for rendering a whole list // of rectangles with a single trip to the display server //----------------------------------------------------------------------------- extern "Objective-C" { #import // NSRect } @class NSColor; struct MiscRectList { private: int num_rects; int max_rects; NSRect* rects; MiscRectList( MiscRectList const& ) {} // No copy constructor. void operator=( MiscRectList const& ) {} // No assign operator. public: MiscRectList(); ~MiscRectList(); int count() const { return num_rects; } void empty() { num_rects = 0; } void append( NSRect r ); void draw( NSColor* c ); }; #endif // __MiscRectList_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscRectList.cc100444 1750 1750 5527 6757227343 24140 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRectList.h // // An extensible array of rectangles for rendering a whole list // of rectangles with a single trip to the display server. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRectList.cc,v 1.2 96/12/30 03:12:17 sunshine Exp $ // $Log: MiscRectList.cc,v $ // Revision 1.2 96/12/30 03:12:17 sunshine // v104.1: Ported to OPENSTEP 4.1 (gamma). // // Revision 1.1 96/08/30 14:57:26 sunshine // An extensible array of rectangles for rendering a whole list // of rectangles with a single trip to the display server //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscRectList.h" extern "Objective-C" { #import } extern "C" { #include // malloc(), realloc(), free() } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- MiscRectList::MiscRectList() { num_rects = 0; max_rects = 16; rects = (NSRect*) malloc( max_rects * sizeof(*rects) ); } //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscRectList::~MiscRectList() { free( rects ); } //----------------------------------------------------------------------------- // append //----------------------------------------------------------------------------- void MiscRectList::append( NSRect r ) { if (num_rects >= max_rects) { max_rects += max_rects; rects = (NSRect*) realloc( rects, max_rects * sizeof(*rects) ); } rects[ num_rects++ ] = r; } //----------------------------------------------------------------------------- // draw //----------------------------------------------------------------------------- void MiscRectList::draw( NSColor* c ) { if (num_rects > 0) { [c set]; NSRectFillList( rects, num_rects ); empty(); } } MiscKit2/Palettes/MiscTableScroll/Framework/MiscHighlightTracker.h100444 1750 1750 3721 6757227330 25462 0ustar sunshinesunshine#ifndef __MiscHighlightTracker_h #define __MiscHighlightTracker_h //============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscHighlightTracker.h // // Highlight-mode selection tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscHighlightTracker.h,v 1.3 96/05/07 02:12:47 sunshine Exp $ // $Log: MiscHighlightTracker.h,v $ // Revision 1.3 96/05/07 02:12:47 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. // // Revision 1.2 96/04/30 05:38:27 sunshine // Ported to OpenStep 4.0 for Mach PR2. //----------------------------------------------------------------------------- #import "MiscListTracker.h" @interface MiscHighlightTracker : MiscListTracker { BOOL extending; MiscCoord_V lastPos; } - (void) mouseDown:(NSEvent*) event atPos: (MiscCoord_V) pos; - (void) mouseDragged:(NSEvent*) event atPos: (MiscCoord_V) pos; - (void) mouseUp:(NSEvent*) event atPos: (MiscCoord_V) pos; @end #endif // __MiscHighlightTracker_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscLineWrapper.h100444 1750 1750 10140 6757227330 24500 0ustar sunshinesunshine#ifndef __MiscLineWrapper_h #define __MiscLineWrapper_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1996-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscLineWrapper.h // // A C++ object for calculating line breaks in text. // // NOTE *PARTIAL* // "Partial" lines are lines that do not fit completely within the // height of the drawing rectangle. For example, if you have 3 lines // of text, but the drawing rectangle is only 2.5 lines tall, the // third line of text is a partial line. The caller can decide // whether or not to draw these partial lines. Default behavior draws // partial lines. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscLineWrapper.h,v 1.2 96/12/30 03:11:26 sunshine Exp $ // $Log: MiscLineWrapper.h,v $ // Revision 1.2 96/12/30 03:11:26 sunshine // v104.1: Ported to OPENSTEP 4.1 (gamma). // // Revision 1.1 96/08/30 14:56:41 sunshine // A C++ object for calculating line breaks in text. //----------------------------------------------------------------------------- #include extern "Objective-C" { #import #import // NSRect } extern "C" { #include // INT_MAX } class MiscLineWrapper { public: int const MAX_TEXT_LENGTH = (INT_MAX / 2); static float const DEFAULT_LEFT_MARGIN; static float const DEFAULT_TOP_MARGIN; static float const DEFAULT_RIGHT_MARGIN; static float const DEFAULT_BOTTOM_MARGIN; struct Line { float width; int start; int len; }; private: int text_len; int text_max; char* text; NSFont* font; int alignment; int num_lines; int max_lines; Line* lines; NSRect rect; float left_margin; float top_margin; float right_margin; float bottom_margin; float ascender; float descender; float line_height; bool char_wrap; bool no_partial; // NOTE *PARTIAL* bool needs_wrap; MiscLineWrapper( MiscLineWrapper const& ) {} // No copy constructor. void operator=( MiscLineWrapper const& ) {} // No assign operator. void do_wrap(); void wrap_segment( int seg_start, int seg_end ); float calc_width( int start_pos, int lim ) const; bool width_check() const; bool has_tabs( Line const& line ) const; void draw( float x, float y, int start, int len ); void draw_tabs( float x, float y, Line const& line ); public: MiscLineWrapper(); ~MiscLineWrapper(); void setText( NSString* ); void setFont( NSFont* ); void setRect( NSRect ); void setLeftMargin( float ); void setTopMargin( float ); void setRightMargin( float ); void setBottomMargin( float ); void setAlignment( int ); void setCharWrap( bool ); void setNoPartialLines( bool b ) { no_partial = b; } char const* getText() const { return text; } NSFont* getFont() const { return font; } NSRect const& getRect() const { return rect; } float getLeftMargin() const { return left_margin; } float getTopMargin() const { return top_margin; } float getRightMargin() const { return right_margin; } float getBottomMargin() const { return bottom_margin; } int getAlignment() const { return alignment; } bool getCharWrap() const { return char_wrap; } bool getNoPartialLines() const { return no_partial; } bool needsWrap() const { return needs_wrap; } int numLines() const { return num_lines; } Line const& lineAt( int i ) const { return lines[i]; } void wrap(); void draw(); void dump() const; }; #endif // __MiscLineWrapper_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscListTracker.M100444 1750 1750 6677 6757227330 24450 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscListTracker.M // // List-mode selection tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscListTracker.M,v 1.5 96/12/30 09:12:37 sunshine Exp $ // $Log: MiscListTracker.M,v $ // Revision 1.5 96/12/30 09:12:37 sunshine // v107.1: All access to the selection now goes through MiscTableBorder. // // Revision 1.4 96/12/30 03:11:54 sunshine // v104.1: Selected-slot was removed from SparseSet and promoted to // TableBorder. // // Revision 1.3 96/05/07 02:13:05 sunshine // Fixed bug: Was unable to shift-drag to deselect range of slots. // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. //----------------------------------------------------------------------------- #import "MiscListTracker.h" #import "MiscSparseSet.h" #import "MiscTableBorder.h" @implementation MiscListTracker //----------------------------------------------------------------------------- // mouseDown:atPos: //----------------------------------------------------------------------------- - (void) mouseDown:(NSEvent*) event atPos:(MiscCoord_V)pos { deselecting = NO; if ([event modifierFlags] & NSShiftKeyMask) { deselecting = border->isSelected( pos ); border->toggle( pos ); anchor = pos; } else if ([event modifierFlags] & NSAlternateKeyMask) { int selected_slot = border->selectedSlot(); if (!border->goodPos( selected_slot )) selected_slot = pos; border->select( selected_slot, pos ); anchor = selected_slot; border->setSelectedSlot( pos ); } else { border->selectOne( pos ); anchor = pos; } } //----------------------------------------------------------------------------- // mouseDragged:atPos: //----------------------------------------------------------------------------- - (void) mouseDragged:(NSEvent*) event atPos:(MiscCoord_V)pos { if (pos < 0) pos = 0; if (pos >= border->count()) pos = border->count() - 1; if (deselecting) border->unselect( anchor, pos ); else { int selected_slot = border->selectedSlot(); if (pos != selected_slot) { border->unselect( anchor, selected_slot ); border->select( anchor, pos ); } } border->setSelectedSlot( pos ); } //----------------------------------------------------------------------------- // mouseUp:atPos: //----------------------------------------------------------------------------- - (void) mouseUp:(NSEvent*) event atPos:(MiscCoord_V)pos { } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscHorzResizeCursor.tiff100444 1750 1750 512 6757227310 26213 0ustar sunshinesunshineMM* < <0<0 0<0 << ?? *2:B(RH@@ ' 'MiscKit2/Palettes/MiscTableScroll/Framework/MiscRectColorList.cc100444 1750 1750 7305 6757227343 25133 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRectColorList.h // // An extensible array of rectangles and colors for rendering a whole // list of rectangles with a single trip to the display server. // // NOTE *1* // The rects[] array also provides storage space for the temporary // rectangle array needed by NSRectFillList(), so there is always // capacity to hold a copy of the entire rectangle list. Allocating // the two arrays together like this reduces the overhead costs, and // reduces memory fragmentation. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRectColorList.cc,v 1.2 96/12/30 03:12:22 sunshine Exp $ // $Log: MiscRectColorList.cc,v $ // Revision 1.2 96/12/30 03:12:22 sunshine // v104.1: Ported to OPENSTEP 4.1 (gamma). // // Revision 1.1 96/08/30 14:57:10 sunshine // An extensible array of rectangles and colors for rendering a whole // list of rectangles with a single trip to the display server. //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscRectColorList.h" extern "C" { #include #include // malloc(), realloc(), free() } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- MiscRectColorList::MiscRectColorList() { num_rects = 0; max_rects = 16; // NOTE *1* rects = (NSRect*) malloc( max_rects * sizeof(*rects) * 2 ); colors = (int*) malloc( max_rects * sizeof(*colors) ); } //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscRectColorList::~MiscRectColorList() { free( rects ); free( colors ); } //----------------------------------------------------------------------------- // append //----------------------------------------------------------------------------- void MiscRectColorList::append( NSRect r, NSColor* c ) { if (num_rects >= max_rects) { max_rects += max_rects; // NOTE *1* rects = (NSRect*) realloc( rects, max_rects * sizeof(*rects) * 2 ); colors = (int*) realloc( colors, max_rects * sizeof(*colors) ); } rects[ num_rects ] = r; colors[ num_rects ] = color_list.store( c ); num_rects++; } //----------------------------------------------------------------------------- // draw //----------------------------------------------------------------------------- void MiscRectColorList::draw() { int const num_colors = color_list.count(); if (num_colors > 0) { NSRect* const v = rects + num_rects; // NOTE *1* for (int i = 0; i < num_colors; i++) { int vj = 0; for (int j = 0; j < num_rects; j++) if (colors[j] == i) v[vj++] = rects[j]; [color_list[i] set]; NSRectFillList( v, vj ); } empty(); } } MiscKit2/Palettes/MiscTableScroll/Framework/MiscListTracker.h100444 1750 1750 3757 6757227330 24477 0ustar sunshinesunshine#ifndef __MiscListTracker_h #define __MiscListTracker_h //============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscListTracker.h // // List-mode selection tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscListTracker.h,v 1.3 96/05/07 02:13:09 sunshine Exp $ // $Log: MiscListTracker.h,v $ // Revision 1.3 96/05/07 02:13:09 sunshine // Fixed bug: Was unable to shift-drag to deselect range of slots. // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. // // Revision 1.2 96/04/30 05:38:31 sunshine // Ported to OpenStep 4.0 for Mach PR2. //----------------------------------------------------------------------------- #import "MiscMouseTracker.h" @interface MiscListTracker : MiscMouseTracker { MiscCoord_V anchor; BOOL deselecting; } - (void) mouseDown:(NSEvent*) event atPos: (MiscCoord_V) pos; - (void) mouseDragged:(NSEvent*) event atPos: (MiscCoord_V) pos; - (void) mouseUp:(NSEvent*) event atPos: (MiscCoord_V) pos; @end #endif // __MiscListTracker_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscMouseTracker.M100444 1750 1750 6464 6757227331 24620 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscMouseTracker.M // // Abstract class defining selection behavior based upon mouse tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscMouseTracker.M,v 1.4 96/12/30 09:12:52 sunshine Exp $ // $Log: MiscMouseTracker.M,v $ // Revision 1.4 96/12/30 09:12:52 sunshine // v107.1: All access to the selection now goes through MiscTableBorder. // // Revision 1.3 96/05/07 02:12:42 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. // // Revision 1.2 96/04/30 05:38:33 sunshine // Ported to OpenStep 4.0 for Mach PR2. //----------------------------------------------------------------------------- #import "MiscMouseTracker.h" #import "MiscSparseSet.h" #import "MiscTableBorder.h" @implementation MiscMouseTracker //----------------------------------------------------------------------------- // initBorder: //----------------------------------------------------------------------------- - (id) initBorder:(MiscTableBorder*)b { [super init]; border = b; border->selectNone(); return self; } //----------------------------------------------------------------------------- // subclassResponsibility: //----------------------------------------------------------------------------- - (void) subclassResponsibility:(SEL)s { [NSException raise:NSInvalidArgumentException format:@"*** Subclass responsibility: %s", sel_getName(s)]; } //----------------------------------------------------------------------------- // mouseDown:atPos: //----------------------------------------------------------------------------- - (void) mouseDown:(NSEvent*) event atPos:(MiscCoord_V)pos { [self subclassResponsibility:_cmd]; } //----------------------------------------------------------------------------- // mouseDragged:atPos: //----------------------------------------------------------------------------- - (void) mouseDragged:(NSEvent*) event atPos:(MiscCoord_V)pos { [self subclassResponsibility:_cmd]; } //----------------------------------------------------------------------------- // mouseUp:atPos: //----------------------------------------------------------------------------- - (void) mouseUp:(NSEvent*) event atPos:(MiscCoord_V)pos { [self subclassResponsibility:_cmd]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscMouseTracker.h100444 1750 1750 4450 6757227331 24644 0ustar sunshinesunshine#ifndef __MiscMouseTracker_h #define __MiscMouseTracker_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscMouseTracker.h // // Abstract class defining selection behavior based upon mouse tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscMouseTracker.h,v 1.5 97/04/15 09:01:46 sunshine Exp $ // $Log: MiscMouseTracker.h,v $ // Revision 1.5 97/04/15 09:01:46 sunshine // v0.125.8: Added "MiscTableScroll/" prefix to #import to facilitate new // framework organization. Added implicit (id) type. // // Revision 1.4 96/12/30 09:12:50 sunshine // v107.1: All access to the selection now goes through MiscTableBorder. // // Revision 1.3 96/05/07 02:12:37 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. //----------------------------------------------------------------------------- extern "Objective-C" { #import } #import class MiscTableBorder; @class NSEvent; @interface MiscMouseTracker : NSObject { MiscTableBorder* border; } - (id)initBorder:(MiscTableBorder*)border; - (void)mouseDown:(NSEvent*)event atPos:(MiscCoord_V)pos; - (void)mouseDragged:(NSEvent*)event atPos:(MiscCoord_V)pos; - (void)mouseUp:(NSEvent*)event atPos:(MiscCoord_V)pos; @end #endif // __MiscMouseTracker_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscRadioTracker.M100444 1750 1750 6647 6757227331 24571 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRadioTracker.M // // Radio-mode selection tracking. // // NOTE *1* // We emulate Matrix behavior here. In radio mode if the mouse // goes up and the shift-key is held down then the cell is // deselected. Since keyboard events are treated like mouse // events we do the same for keyUp events -- however since we // don't actually receive keyUp events, we also perform special // checking for the shift-key modifier in -mouseDown: when the // event is a keyboard event. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRadioTracker.M,v 1.5 96/12/30 09:13:09 sunshine Exp $ // $Log: MiscRadioTracker.M,v $ // Revision 1.5 96/12/30 09:13:09 sunshine // v107.1: All access to the selection now goes through MiscTableBorder. // // Revision 1.4 96/12/30 03:12:01 sunshine // v104.1: Selected-slot was removed from SparseSet and promoted to // TableBorder. // // Revision 1.3 96/05/07 02:12:34 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. //----------------------------------------------------------------------------- #import "MiscRadioTracker.h" #import "MiscSparseSet.h" #import "MiscTableBorder.h" @implementation MiscRadioTracker //----------------------------------------------------------------------------- // mouseDown:atPos: //----------------------------------------------------------------------------- - (void) mouseDown:(NSEvent*) event atPos:(MiscCoord_V)pos { if ([event type] == NSKeyDown && // NOTE *1* ([event modifierFlags] & NSShiftKeyMask) != 0 && border->hasSelection() && pos == border->selectedSlot()) border->selectNone(); else border->selectOne( pos ); } //----------------------------------------------------------------------------- // mouseDragged:atPos: //----------------------------------------------------------------------------- - (void) mouseDragged:(NSEvent*) event atPos:(MiscCoord_V)pos { if (border->goodPos(pos)) border->selectOne( pos ); else border->selectNone(); } //----------------------------------------------------------------------------- // mouseUp:atPos: //----------------------------------------------------------------------------- - (void) mouseUp:(NSEvent*) event atPos:(MiscCoord_V)pos { if (([event modifierFlags] & NSShiftKeyMask) != 0 && // NOTE *1* border->goodPos(pos) && border->isSelected(pos)) border->selectNone(); } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscRadioTracker.h100444 1750 1750 3606 6757227331 24614 0ustar sunshinesunshine#ifndef __MiscRadioTracker_h #define __MiscRadioTracker_h //============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRadioTracker.h // // Radio-mode selection tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRadioTracker.h,v 1.3 96/05/07 02:12:26 sunshine Exp $ // $Log: MiscRadioTracker.h,v $ // Revision 1.3 96/05/07 02:12:26 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. // // Revision 1.2 96/04/30 05:38:40 sunshine // Ported to OpenStep 4.0 for Mach PR2. //----------------------------------------------------------------------------- #import "MiscMouseTracker.h" @interface MiscRadioTracker : MiscMouseTracker { } - (void) mouseDown:(NSEvent*) event atPos: (MiscCoord_V) pos; - (void) mouseDragged:(NSEvent*) event atPos: (MiscCoord_V) pos; - (void) mouseUp:(NSEvent*) event atPos: (MiscCoord_V) pos; @end #endif // __MiscRadioTracker_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscTracer.cc100444 1750 1750 4004 6757227344 23615 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTracer.h // // Simple C++ class that helps generate function enter/exit // trace messages. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTracer.cc,v 1.2 98/03/23 07:48:25 sunshine Exp $ // $Log: MiscTracer.cc,v $ // Revision 1.2 98/03/23 07:48:25 sunshine // v134.1: Ported from NEXTSTEP to OPENSTEP/Rhapsody. // // Revision 1.1 97/12/22 22:00:33 zarnuk // v134: Utility class to create function enter/exit messages. //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscTracer.h" extern "Objective-C" { #include #include } int MiscTracer::TRACE_DEPTH = 0; //----------------------------------------------------------------------------- // dump //----------------------------------------------------------------------------- void MiscTracer::dump( char const* s ) const { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSMutableString* pad = [NSMutableString string]; for (int i = 0; i < TRACE_DEPTH; i++) [pad appendString:@" "]; NSLog( @"%@%s %s", pad, s, msg ); [pool release]; } MiscKit2/Palettes/MiscTableScroll/Framework/MiscRectColorList.h100444 1750 1750 4247 6757227332 24775 0ustar sunshinesunshine#ifndef __MiscRectColorList_h #define __MiscRectColorList_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRectColorList.h // // An extensible array of rectangles and colors for rendering a whole // list of rectangles with a single trip to the display server. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRectColorList.h,v 1.2 96/12/30 03:12:20 sunshine Exp $ // $Log: MiscRectColorList.h,v $ // Revision 1.2 96/12/30 03:12:20 sunshine // v104.1: Ported to OPENSTEP 4.1 (gamma). // // Revision 1.1 96/08/30 14:57:12 sunshine // An extensible array of rectangles and colors for rendering a whole // list of rectangles with a single trip to the display server. //----------------------------------------------------------------------------- #include "MiscColorList.h" extern "Objective-C" { #import // NSRect } struct MiscRectColorList { private: MiscColorList color_list; int num_rects; int max_rects; NSRect* rects; int* colors; MiscRectColorList( MiscRectColorList const& ) {} // No copy constructor void operator=( MiscRectColorList const& ) {} // No assign operator public: MiscRectColorList(); ~MiscRectColorList(); int count() const { return num_rects; } void empty() { color_list.empty(); num_rects = 0; } void append( NSRect r, NSColor* c ); void draw(); }; #endif // __MiscRectColorList_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscRowView.M100444 1750 1750 3273 6757227332 23612 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRowView.M // // View class for the row labels on an MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRowView.M,v 1.2 96/04/30 05:38:41 sunshine Exp $ // $Log: MiscRowView.M,v $ // Revision 1.2 96/04/30 05:38:41 sunshine // Ported to OpenStep 4.0 for Mach PR2. // //----------------------------------------------------------------------------- #import "MiscRowView.h" @implementation MiscRowView //----------------------------------------------------------------------------- // - initWithFrame:scroll:info: //----------------------------------------------------------------------------- - initWithFrame: (NSRect) frameRect scroll: (MiscTableScroll*) i_scroll info: (MiscTableBorder*) i_info { [super initWithFrame:frameRect scroll:i_scroll info:i_info type:MISC_ROW_BORDER_VIEW]; return self; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscSparseSet.cc100444 1750 1750 31024 6757227343 24327 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscSparseSet.cc // // This object implements a sparse set. The set is represented by an // array of ranges kept in sorted ascending order. Each range is // separated from neighboring ranges by a gap of at least one value. // In other words, ranges do not overlap, and they do not "touch" each // other. The upper and lower bounds in each range are inclusive. A // range might contain a single value. In that case, both the upper and // lower bounds will have the same value. There are no empty ranges. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscSparseSet.cc,v 1.11 97/04/04 04:57:49 sunshine Exp $ // $Log: MiscSparseSet.cc,v $ // Revision 1.11 97/04/04 04:57:49 sunshine // 0.125.6: Removed unused header. // // Revision 1.10 97/04/01 07:47:58 sunshine // v0.125.5: Fixed comparisons between signed and unsigned integers. // // Revision 1.9 97/03/20 16:31:18 sunshine // v119.1: Removed unnecessary loop from shiftDownAt() //----------------------------------------------------------------------------- #ifdef __GNUC__ # pragma implementation #endif #import "MiscSparseSet.h" extern "C" { #import #import #import } unsigned int const INITIAL_CAPACITY = 16; //----------------------------------------------------------------------------- // sort //----------------------------------------------------------------------------- static inline void sort( int& low, int& high ) { if (high < low) { int t = low; low = high; high = t; } } //============================================================================= // IMPLEMENTATION //============================================================================= //----------------------------------------------------------------------------- // dump //----------------------------------------------------------------------------- void MiscSparseSet::dump( char const* msg ) const { fprintf( stderr, "(SPARSE-SET %s (", msg ); int last_hi = -1; bool corrupt = false; for (unsigned int i = 0; i < num_ranges; i++) { Range const& r = ranges[i]; if (r.lo <= last_hi) corrupt = true; last_hi = r.hi; fprintf( stderr, "%s%d", (i != 0 ? " " : ""), r.lo ); if (r.lo != r.hi) fprintf( stderr, "-%d", r.hi ); } fprintf( stderr, "))%s\n", corrupt ? " *** CORRUPT ***" : "" ); } //----------------------------------------------------------------------------- // expand(uint) //----------------------------------------------------------------------------- void MiscSparseSet::expand( unsigned int new_capacity ) { if (max_ranges < new_capacity) { max_ranges = new_capacity; int const BYTES = max_ranges * sizeof(*ranges); if (ranges == 0) ranges = (Range*) malloc( BYTES ); else ranges = (Range*) realloc( ranges, BYTES ); } } //----------------------------------------------------------------------------- // expand //----------------------------------------------------------------------------- inline void MiscSparseSet::expand() { if (num_ranges >= max_ranges) expand( max_ranges == 0 ? INITIAL_CAPACITY : max_ranges << 1 ); } //----------------------------------------------------------------------------- // coerce //----------------------------------------------------------------------------- int MiscSparseSet::coerce( int x ) const { if (isEmpty()) x = -1; else { int i = bsearch( x ); if (i < 0) { i = ~i; x = (i > 0 ? ranges[i-1].hi : ranges[i].lo); } } return x; } //----------------------------------------------------------------------------- // bsearch //----------------------------------------------------------------------------- int MiscSparseSet::bsearch( int x ) const { int lo = 0; int hi = numRanges() - 1; while (lo <= hi) { int const mid = (lo + hi) >> 1; Range const& r = ranges[mid]; if (x > r.hi) lo = mid + 1; else if (x < r.lo) hi = mid - 1; else return mid; } return ~lo; } //----------------------------------------------------------------------------- // insertAt //----------------------------------------------------------------------------- void MiscSparseSet::insertAt( unsigned int i, int lo, int hi ) { expand(); Range* const p = ranges + i; if (i < num_ranges) memmove( p + 1, p, (num_ranges - i) * sizeof(*ranges) ); num_ranges++; p->lo = lo; p->hi = hi; } //----------------------------------------------------------------------------- // deleteAt //----------------------------------------------------------------------------- void MiscSparseSet::deleteAt( unsigned int i, unsigned int n ) { num_ranges -= n; if (i < num_ranges) { Range* const p = ranges + i; memmove( p, p + n, (num_ranges - i) * sizeof(*ranges)); } } //----------------------------------------------------------------------------- // add -- singleton //----------------------------------------------------------------------------- void MiscSparseSet::add( int x ) { int i = bsearch( x ); if (i < 0) // else, (i >= 0) already in an existing range. { int action = 0; i = ~i; if (i > 0 && ranges[i-1].hi == x - 1) action |= 1; if (i < int(num_ranges) && ranges[i].lo == x + 1) action |= 2; switch (action) { case 0: insertAt( i, x, x ); break; case 1: ranges[i-1].hi = x; break; case 2: ranges[i].lo = x; break; case 3: ranges[i-1].hi = ranges[i].hi; deleteAt(i,1); break; } } } //----------------------------------------------------------------------------- // add -- range //----------------------------------------------------------------------------- void MiscSparseSet::add( int lo, int hi ) { if (lo == hi) add( lo ); else { sort( lo, hi ); int ilo = bsearch( lo - 1 ); int ihi = bsearch( hi + 1 ); if (ilo == ihi) { if (ilo < 0) // else both are in same existing range. insertAt( ~ilo, lo, hi ); } else { // Convert to good node coords. int nlo = ilo; if (nlo < 0) nlo = ~nlo; // round up int nhi = ihi; if (nhi < 0) nhi = ~nhi - 1; // round down if (nlo != nhi) { Range const& t = ranges[nhi]; if (hi < t.hi) hi = t.hi; deleteAt( nlo + 1, nhi - nlo ); } Range& r = ranges[nlo]; if (r.lo > lo) r.lo = lo; if (r.hi < hi) r.hi = hi; } } } //----------------------------------------------------------------------------- // remove -- singleton // NOTE *1*: Can't use 'r.hi' here since insertAt() may have called realloc(). //----------------------------------------------------------------------------- void MiscSparseSet::remove( int x ) { int const i = bsearch( x ); if (i >= 0) // else, (i < 0) already in a "gap". { int action = 0; Range& r = ranges[i]; if (r.lo == x) action |= 1; // Trim below. if (r.hi == x) action |= 2; // Trim above. switch (action) { case 0: insertAt( i + 1, x + 1, r.hi ); ranges[i].hi = x - 1; break; // NOTE *1* case 1: r.lo = x + 1; break; case 2: r.hi = x - 1; break; case 3: deleteAt( i, 1 ); break; } } } //----------------------------------------------------------------------------- // remove -- range //----------------------------------------------------------------------------- void MiscSparseSet::remove( int lo, int hi ) { if (lo == hi) remove( lo ); else { sort( lo, hi ); lo--; hi++; int ilo = bsearch( lo ); int ihi = bsearch( hi ); if (ilo == ihi) { if (ilo >= 0) // else both in the same "gap". { Range& r = ranges[ilo]; int const t = r.hi; r.hi = lo; insertAt( ilo + 1, hi, t ); } } else { if (ilo >= 0) { ranges[ilo].hi = lo; ilo++; } else ilo = ~ilo; if (ihi >= 0) ranges[ihi].lo = hi; else ihi = ~ihi; if (ihi > ilo) deleteAt( ilo, ihi - ilo ); } } } //----------------------------------------------------------------------------- // Constructor [Copy] //----------------------------------------------------------------------------- MiscSparseSet::MiscSparseSet( MiscSparseSet const& s ) : num_ranges(s.num_ranges), max_ranges(s.num_ranges), ranges(0) { if (max_ranges > 0) { int const BYTES = max_ranges * sizeof(*ranges); ranges = (Range*) malloc( BYTES ); memcpy( ranges, s.ranges, BYTES ); } } //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscSparseSet::~MiscSparseSet() { if (ranges != 0) free( ranges ); } //----------------------------------------------------------------------------- // operator= //----------------------------------------------------------------------------- MiscSparseSet& MiscSparseSet::operator=( MiscSparseSet const& s ) { if (&s != this) { if (s.isEmpty()) empty(); else { expand( s.num_ranges ); num_ranges = s.num_ranges; memcpy( ranges, s.ranges, num_ranges * sizeof(*ranges) ); } } return *this; } //----------------------------------------------------------------------------- // operator== //----------------------------------------------------------------------------- bool MiscSparseSet::operator==( MiscSparseSet const& s ) const { return (&s == this || (num_ranges == s.num_ranges && (num_ranges == 0 || memcmp( ranges, s.ranges, num_ranges * sizeof(*ranges) ) == 0))); } //----------------------------------------------------------------------------- // toggle //----------------------------------------------------------------------------- void MiscSparseSet::toggle( int x ) { if (contains( x )) remove( x ); else add( x ); } //----------------------------------------------------------------------------- // shiftUpAt //----------------------------------------------------------------------------- void MiscSparseSet::shiftUpAt( int x ) { for (unsigned int i = num_ranges; i-- > 0; ) { Range& r = ranges[i]; if (r.hi >= x) { r.hi++; if (r.lo >= x) r.lo++; } else break; } if (contains(x)) remove(x); // Newly inserted slots are not selected. } //----------------------------------------------------------------------------- // shiftDownAt //----------------------------------------------------------------------------- void MiscSparseSet::shiftDownAt( int x ) { if (contains(x)) remove(x); int i; for (i = num_ranges; i-- > 0; ) { Range& r = ranges[i]; if (r.hi > x) { r.hi--; if (r.lo > x) r.lo--; } else break; } if (i >= 0 && i + 1 < int(num_ranges) && ranges[i].hi + 1 == ranges[i + 1].lo) { ranges[i].hi = ranges[i+1].hi; // Collapse adjacent range. deleteAt( i + 1, 1 ); } } //----------------------------------------------------------------------------- // count //----------------------------------------------------------------------------- unsigned int MiscSparseSet::count() const { unsigned int total = 0; Range const* p = ranges; Range const* const plim = p + num_ranges; for ( ; p < plim; p++) total += p->hi - p->lo + 1; return total; } //----------------------------------------------------------------------------- // getRangeAt //----------------------------------------------------------------------------- void MiscSparseSet::getRangeAt( unsigned int i, int& lo, int& hi ) const { lo = hi = -1; if (i < num_ranges) { lo = ranges[i].lo; hi = ranges[i].hi; } } //----------------------------------------------------------------------------- // getTotalRange //----------------------------------------------------------------------------- void MiscSparseSet::getTotalRange( int& lo, int& hi ) const { lo = hi = -1; if (num_ranges > 0) { lo = ranges[ 0 ].lo; hi = ranges[ num_ranges - 1 ].hi; } } MiscKit2/Palettes/MiscTableScroll/Framework/MiscRowView.h100444 1750 1750 2743 6757227332 23646 0ustar sunshinesunshine#ifndef __MiscRowView_h #define __MiscRowView_h //============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscRowView.h // // View class for the row labels on an MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscRowView.h,v 1.2 96/04/30 05:38:42 sunshine Exp $ // $Log: MiscRowView.h,v $ // Revision 1.2 96/04/30 05:38:42 sunshine // Ported to OpenStep 4.0 for Mach PR2. // //----------------------------------------------------------------------------- #import "MiscBorderView.h" @interface MiscRowView : MiscBorderView { } - initWithFrame: (NSRect) frameRect scroll: (MiscTableScroll*) scroll info: (MiscTableBorder*) info; @end #endif // __MiscRowView_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscSparseSet.h100444 1750 1750 7014 6757227332 24151 0ustar sunshinesunshine#ifndef __MiscSparseSet_h #define __MiscSparseSet_h #ifdef __GNUC__ # pragma interface #endif //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscSparseSet.h // // This object implements a sparse set. The set is represented by an // array of ranges kept in sorted ascending order. Each range is // separated from neighboring ranges by a gap of at least one value. // In other words, ranges do not overlap, and they do not "touch" each // other. The upper and lower bounds in each range are inclusive. A // range might contain a single value. In that case, both the upper and // lower bounds will have the same value. There are no empty ranges. // // NOTE *1* // coerce(x) will return x if x is a member of the set. Otherwise, it // will return the closest previous member of the set, if any. Otherwise // it will return the closest following member of the set. Otherwise // it will return -1 if the set is empty. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscSparseSet.h,v 1.5 96/12/30 09:13:42 sunshine Exp $ // $Log: MiscSparseSet.h,v $ // Revision 1.5 96/12/30 09:13:42 sunshine // v107.1: Added coerce(). // // Revision 1.4 96/12/30 03:12:49 sunshine // v104.1: Removed "cursor" wart. Now this is a simple generic class. // // Revision 1.3 96/04/30 05:38:43 sunshine // Ported to OpenStep 4.0 for Mach PR2. //----------------------------------------------------------------------------- #include "bool.h" class MiscSparseSet { private: struct Range { int lo; int hi; }; unsigned int num_ranges; unsigned int max_ranges; Range* ranges; void expand( unsigned int new_capacity ); void expand(); int bsearch( int x ) const; void insertAt( unsigned int i, int lo, int hi ); void deleteAt( unsigned int i, unsigned int n ); public: MiscSparseSet():num_ranges(0),max_ranges(0),ranges(0){} MiscSparseSet( MiscSparseSet const& ); ~MiscSparseSet(); MiscSparseSet& operator=( MiscSparseSet const& ); bool operator==( MiscSparseSet const& ) const; bool operator!=( MiscSparseSet const& s ) const { return !operator==(s); } bool contains( int x ) const { return (bsearch( x ) >= 0); } bool isEmpty() const { return (num_ranges == 0); } void empty() { num_ranges = 0; } unsigned int count() const; // # elments in set void add( int lo, int hi ); // add a range void add( int x ); void remove( int lo, int hi ); // remove a range void remove( int x ); void toggle( int x ); void shiftUpAt( int x ); void shiftDownAt( int x ); int coerce( int x ) const; // NOTE *1* unsigned int numRanges() const { return num_ranges; } void getRangeAt( unsigned int i, int& lo, int& hi ) const; void getTotalRange( int& lo, int& hi ) const; void dump( char const* msg ) const; }; #endif // __MiscSparseSet_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscSortAscend.tiff100444 1750 1750 336 6757227312 24764 0ustar sunshinesunshineMM* :1:"! ?????? (R ' 'MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableBorder.h100444 1750 1750 42401 6757227333 24445 0ustar sunshinesunshine#ifndef __MiscTableBorder_h #define __MiscTableBorder_h #ifdef __GNUC__ # pragma interface #endif //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableBorder.h // // Structure describing border of an MiscTableView. // // NOTE: Many of the sub-arrays in an MiscTableBorder are conditional. // They are not guaranteed to be allocated for every instance. They are // only allocated when the caller tries to store a value in them. Doing // a "set" creates the array, even if the value is the default value. // // "Springy" grow when the total size exceeds the global min total size. // // NOTE *1* These methods return true if the new value is different than // the old value, and the display needs updating. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableBorder.h,v 1.20 99/06/15 02:39:50 sunshine Exp $ // $Log: MiscTableBorder.h,v $ // Revision 1.20 99/06/15 02:39:50 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Added support for slot-wise "represented objects". // Fixed bug: Incorrect clearCursor() implementation did nothing at all. // // Revision 1.19 1998/03/29 23:47:14 sunshine // v138.1: #import was missing "MiscTableScroll/" for public header. // // Revision 1.18 98/03/23 21:39:55 sunshine // v137.1: Added clearSortDirection(). //----------------------------------------------------------------------------- #include #include "MiscSparseSet.h" #include "MiscTableUtil.h" @class NSArray, NSCell, NSCoder; struct MiscTableSlot { MiscPixels offset; // Offset of this slot. MiscPixels adj_size; // Size adjusted for springy-ness. MiscPixels size; // Target size. MiscPixels min_size; // Minimum size. MiscPixels max_size; // Maximum size. MiscTableSizing sizing; // Sizing options. bool isSpringy() const { return ::isSpringy(sizing); } void initWithCoder( NSCoder*, int ver ); void encodeWithCoder( NSCoder* ); }; class MiscTableBorder { private: MiscBorderType type; // Row / Col. MiscTableScroll* owner; MiscTableSlot def_slot; // Default slot configuration. int max_slots; // Capacity. Allocation size of arrays. int num_slots; // Active number of rows/cols. MiscTableSlot* slots; // Indexed by visual coords. MiscCoord_P* v2p; // Visual -> Physical coord map. MiscCoord_V* p2v; // Physical -> Visual coord map. int def_tag; // Default tag value. int* tags; // Indexed by physical coords. id* rep_objs; // Indexed by physical coords. MiscPixels min_uniform_size;// Limits for user resizing. MiscPixels max_uniform_size;// MiscPixels uniform_size; // 0 = not uniform. MiscPixels min_total_size; // Min size for the entire border. int num_springy; // Number of "springy" slots. MiscTableTitleMode title_mode; NSString** titles; // Indexed by physical coords. MiscTableCellStyle def_style; MiscTableCellStyle* styles; // Indexed by physical coords. id* prototypes; // Indexed by physical coords. MiscCompareEntryFunc* sort_funcs;//Indexed by physical coords. int* sort_info; // ((sort_type << 1) | sort_dir) MiscSparseSet selection; // Selection (visual coordinates). MiscCoord_V selected_slot; // Selected slot. MiscCoord_V cursor; // Keyboard cursor. MiscCoord_V clicked_slot; // Clicked slot. bool selectable; // User can select slot-titles. bool sizeable; // User can resize slots. bool draggable; // User can rearrange slots. bool modifier_drag; // Use modifier key to drag slots. bool needs_recalc; // Offset values are "stale". void global_grow( MiscPixels ); void init_slot( MiscCoord_V, MiscCoord_P ); void destroy_slot( MiscCoord_V, MiscCoord_P ); void do_shift( void*, int, int, int ); void do_shift( MiscCoord_V, MiscCoord_V ); void* do_remap( void*, int, MiscCoord_V const* ); void do_remap( MiscCoord_V const* ); MiscCoord_V find_slot_for_offset( MiscPixels ); void perform_recalc(); void do_recalc(); void recalc_if_needed(); int alloc_size( int rec_size ); void* do_alloc( int ); void* do_alloc_init( int ); void* do_realloc( void*, int ); void do_realloc(); void do_delete( void*, int, int ); void do_delete( MiscCoord_V, MiscCoord_P ); void do_insert( void*, int, int ); void do_insert( MiscCoord_V, MiscCoord_P ); void alloc_slots(); void alloc_vmap(); void alloc_titles(); void dealloc_titles(); void alloc_tags(); void alloc_represented_objects(); void alloc_styles(); void alloc_prototypes(); id new_prototype( MiscCoord_P ); void alloc_sort_funcs(); void alloc_sort_info(); NSArray* selected_slots( bool do_tags ) const; void select_slots( NSArray*, bool clear, bool set ); void select_tags( NSArray*, bool clear, bool set ); public: MiscTableBorder( MiscBorderType ); ~MiscTableBorder(); MiscTableScroll* getOwner() const { return owner; } void setOwner( MiscTableScroll* x ) { owner = x; } int count() const { return num_slots; } int capacity() const { return max_slots; } void setCount( int ); void setCapacity( int ); void freeExtraCapacity(); void empty(); void emptyAndFree() { empty(); freeExtraCapacity(); } bool goodPos( int x ) const { return 0 <= x && x < count(); } int numSpringy() const { return num_springy; } MiscTableSlot const* getSlots() const { return slots; } MiscCoord_V const* getP2VMap() const { return p2v; } MiscCoord_P const* getV2PMap() const { return v2p; } void setSlotSizes( MiscPixels const* ); bool setP2VMap( MiscCoord_P const* ); bool setV2PMap( MiscCoord_V const* ); bool good_map( int const* map, bool onescomp ) const; void swapSlots( MiscCoord_P, MiscCoord_P ); MiscBorderType getType() const { return type; } bool isColBorder() const { return type == MISC_COL_BORDER; } bool isRowBorder() const { return type == MISC_ROW_BORDER; } bool isSelectable() const { return selectable; } bool isSizeable() const { return sizeable; } bool isDraggable() const { return draggable; } bool isModifierDrag() const { return modifier_drag; } bool isUniformSize() const { return uniform_size != 0; } MiscPixels getMinUniformSize() const { return min_uniform_size; } MiscPixels getMaxUniformSize() const { return max_uniform_size; } MiscPixels getUniformSize() const { return uniform_size; } MiscTableTitleMode getTitleMode() const { return title_mode; } void setType( MiscBorderType ); void setDraggable( bool x ) { draggable = x; } void setModifierDrag( bool x ) { modifier_drag = x; } void setSelectable( bool x ) { selectable = x; } void setSizeable( bool x ) { sizeable = x; } void setMinUniformSize( MiscPixels x ) { min_uniform_size = x; } void setMaxUniformSize( MiscPixels x ) { max_uniform_size = x; } bool setUniformSize( MiscPixels ); // NOTE *1* bool setTitleMode( MiscTableTitleMode ); // NOTE *1* MiscPixels totalSize(); MiscPixels getMinTotalSize() const { return min_total_size; } void setMinTotalSize( MiscPixels ); MiscCoord_P visualToPhysical( MiscCoord_V x ) const { return (x >= 0 && v2p != 0) ? v2p[x] : (MiscCoord_P)x; } MiscCoord_V physicalToVisual( MiscCoord_P x ) const { return (x >= 0 && p2v != 0) ? p2v[x] : (MiscCoord_V)x; } void visualToPhysical( MiscSparseSet const&, MiscSparseSet& ) const; void physicalToVisual( MiscSparseSet const&, MiscSparseSet& ) const; MiscCoord_V visualForOffset( MiscPixels ); bool needsRecalc() const { return needs_recalc; } void recalcOffsets(); void moveFromTo( MiscCoord_V, MiscCoord_V ); void insertAt( MiscCoord_V, MiscCoord_P ); void add() { insertAt(count(),count()); } void deleteAt( MiscCoord_V ); void deleteAt_P( MiscCoord_P x ){ deleteAt( physicalToVisual(x) ); } MiscPixels getOffset( MiscCoord_V ); MiscPixels getOffset_P( MiscCoord_P x ) { return getOffset( physicalToVisual(x) ); } MiscPixels effectiveSize( MiscCoord_V ); MiscPixels effectiveSize_P( MiscCoord_P x ) { return effectiveSize( physicalToVisual(x) ); } MiscPixels effectiveMinSize( MiscCoord_V ); MiscPixels effectiveMinSize_P( MiscCoord_P x ) { return effectiveMinSize( physicalToVisual(x) ); } MiscPixels getSize( MiscCoord_V ) const; // target size. MiscPixels getSize_P( MiscCoord_P x ) const { return getSize( physicalToVisual(x) ); } void setSize( MiscCoord_V, MiscPixels ); void setSize_P( MiscCoord_P x, MiscPixels y ) { setSize( physicalToVisual(x), y ); } MiscPixels getMinSize( MiscCoord_V ) const; MiscPixels getMinSize_P( MiscCoord_P x ) const { return getMinSize( physicalToVisual(x) ); } void setMinSize( MiscCoord_V, MiscPixels ); void setMinSize_P( MiscCoord_P x, MiscPixels y ) { setMinSize( physicalToVisual(x), y ); } MiscPixels getMaxSize( MiscCoord_V ) const; MiscPixels getMaxSize_P( MiscCoord_P x ) const { return getMaxSize( physicalToVisual(x) ); } void setMaxSize( MiscCoord_V, MiscPixels ); void setMaxSize_P( MiscCoord_P x, MiscPixels y ) { setMaxSize( physicalToVisual(x), y ); } MiscTableSizing getSizing( MiscCoord_V ) const; MiscTableSizing getSizing_P( MiscCoord_P x ) const { return getSizing( physicalToVisual(x) ); } void setSizing( MiscCoord_V, MiscTableSizing ); void setSizing_P( MiscCoord_P x, MiscTableSizing y ) { setSizing( physicalToVisual(x), y ); } bool isSortable( MiscCoord_V x ) const { return getSortFunc(x) != 0 || getSortType(x) != MISC_SORT_SKIP; } bool isSortable_P( MiscCoord_P x ) const { return isSortable( physicalToVisual(x) ); } bool isFixed( MiscCoord_V x ) const { return ::isFixed(getSizing(x)); } bool isFixed_P( MiscCoord_P x ) const { return ::isFixed(getSizing_P(x)); } bool isSpringy( MiscCoord_V x ) const { return ::isSpringy(getSizing(x)); } bool isSpringy_P( MiscCoord_P x ) const { return ::isSpringy(getSizing_P(x)); } void setSpringy( MiscCoord_V x, bool b ) { setSizing( x, ::setSpringy(getSizing(x),b) ); } void setSpringy_P( MiscCoord_P x, bool y ) { setSpringy( physicalToVisual(x), y ); } bool isSizeable( MiscCoord_V x ) const { return ::isSizeable(getSizing(x)); } bool isSizeable_P( MiscCoord_P x ) const { return ::isSizeable(getSizing_P(x)); } void setSizeable( MiscCoord_V x, bool b ) { setSizing( x, ::setSizeable(getSizing(x),b) ); } void setSizeable_P( MiscCoord_P x, bool y ) { setSizeable( physicalToVisual(x), y ); } int getTag_P( MiscCoord_P ) const; int getTag( MiscCoord_V x ) const { return getTag_P( visualToPhysical(x) ); } void setTag_P( MiscCoord_P, int ); void setTag( MiscCoord_V x, int y ) { setTag_P( visualToPhysical(x), y ); } id getRepresentedObject_P( MiscCoord_P ) const; id getRepresentedObject( MiscCoord_V x ) const { return getRepresentedObject_P( visualToPhysical(x) ); } void setRepresentedObject_P( MiscCoord_P, id ); void setRepresentedObject( MiscCoord_V x, id y ) { setRepresentedObject_P( visualToPhysical(x), y ); } NSString* getTitle_P( MiscCoord_P ) const; NSString* getTitle( MiscCoord_V x ) const { return getTitle_P( visualToPhysical(x) ); } bool setTitle_P( MiscCoord_P, NSString* ); // NOTE *1* bool setTitle( MiscCoord_V x, NSString* y ) // NOTE *1* { return setTitle_P( visualToPhysical(x), y ); } MiscTableCellStyle getStyle_P( MiscCoord_P ) const; MiscTableCellStyle getStyle( MiscCoord_V x ) const { return getStyle_P( visualToPhysical(x) ); } void setStyle_P( MiscCoord_P, MiscTableCellStyle ); void setStyle( MiscCoord_V x, MiscTableCellStyle y ) { setStyle_P( visualToPhysical(x), y ); } id getPrototype_P( MiscCoord_V ); id getPrototype( MiscCoord_V x ) { return getPrototype_P( visualToPhysical(x) ); } void setPrototype_P( MiscCoord_P, id ); void setPrototype( MiscCoord_V x, id y ) { setPrototype_P( visualToPhysical(x), y ); } MiscCompareEntryFunc getSortFunc_P( MiscCoord_P ) const; MiscCompareEntryFunc getSortFunc( MiscCoord_V x ) const { return getSortFunc_P( visualToPhysical(x) ); } void setSortFunc_P( MiscCoord_P, MiscCompareEntryFunc ); void setSortFunc( MiscCoord_V x, MiscCompareEntryFunc y ) { setSortFunc_P( visualToPhysical(x), y ); } MiscSortDirection getSortDirection_P( MiscCoord_P ) const; MiscSortDirection getSortDirection( MiscCoord_V x ) const { return getSortDirection_P( visualToPhysical(x) ); } void setSortDirection_P( MiscCoord_P, MiscSortDirection ); void setSortDirection( MiscCoord_V x, MiscSortDirection y ) { setSortDirection_P( visualToPhysical(x), y ); } void clearSortDirection(); // Set all slots to ascending. MiscSortType getSortType_P( MiscCoord_P ) const; MiscSortType getSortType( MiscCoord_V x ) const { return getSortType_P( visualToPhysical(x) ); } void setSortType_P( MiscCoord_P, MiscSortType ); void setSortType( MiscCoord_V x, MiscSortType y ) { setSortType_P( visualToPhysical(x), y ); } // DEFAULT VALUES ARE USED TO INITIALIZE NEW SLOTS. MiscPixels getDefaultSize() const { return def_slot.size; } MiscPixels getDefaultMinSize() const { return def_slot.min_size; } MiscPixels getDefaultMaxSize() const { return def_slot.min_size; } MiscTableSizing getDefaultSizing() const { return def_slot.sizing; } int getDefaultTag() const { return def_tag; } MiscTableCellStyle getDefaultStyle() const{ return def_style; } void setDefaultSize( MiscPixels x ) { needs_recalc = true; def_slot.size = x; } void setDefaultMinSize( MiscPixels x ) { needs_recalc = true; def_slot.min_size = x; } void setDefaultMaxSize( MiscPixels x ) { needs_recalc = true; def_slot.max_size = x; } void setDefaultSizing( MiscTableSizing x ) { needs_recalc = true; def_slot.sizing = x; } void setDefaultTag( int x ) { def_tag = x; } void setDefaultStyle( MiscTableCellStyle x ) { def_style = x; } // SELECTION MiscSparseSet const& selectionSet() const { return selection; } bool hasSelection() const { return !selection.isEmpty(); } bool hasMultipleSelection() const; unsigned int numSelected() const { return selection.count(); } MiscCoord_V selectedSlot() const { return selected_slot; } void clearSelectedSlot() { selected_slot = -1; } void setSelectedSlot( MiscCoord_V x ) { selected_slot = selection.coerce(x);} void fixSelectedSlot() { setSelectedSlot(selectedSlot()); } bool isSelected( MiscCoord_V x ) const { return selection.contains(x);} void toggle( MiscCoord_V x ) {selection.toggle(x); setSelectedSlot(x);} void select( MiscCoord_V x ) {selection.add(x); setSelectedSlot(x);} void select( MiscCoord_V lo, MiscCoord_V hi ) { selection.add(lo,hi); setSelectedSlot(hi); } void unselect( MiscCoord_V x ) { selection.remove(x); fixSelectedSlot(); } void unselect( MiscCoord_V lo, MiscCoord_V hi ) { selection.remove(lo,hi); fixSelectedSlot(); } void selectOne( MiscCoord_V x ) { selection.empty(); select(x); } void selectAll() { if (count() > 0) { selection.add( 0, count() - 1 ); setSelectedSlot( count() - 1 ); } } void selectNone() { selection.empty(); clearSelectedSlot(); } void selectSlots( NSArray* l, bool extend ) // Physical coords. { select_slots( l, !extend, true ); } NSArray* selectedSlots() const { return selected_slots( false ); } void selectTags( NSArray* l, bool extend ) { select_tags( l, !extend, true ); } NSArray* selectedTags() const { return selected_slots( true ); } void unselectSlots( NSArray* l ) // Physical coords. { select_slots( l, false, false ); } void unselectTags( NSArray* l ) { select_tags( l, false, false ); } // KEYBOARD CURSOR MiscCoord_V getCursor() const { return cursor; } void setCursor( MiscCoord_V c ) { if (c >= 0 && c < count()) cursor = c; } void clearCursor() { cursor = -1; } bool hasValidCursor() const { return cursor >= 0 && cursor < count(); } // CLICKED SLOT MiscCoord_V clickedSlot() const { return clicked_slot; } void setClickedSlot( MiscCoord_V s ) { clicked_slot = s; } void clearClickedSlot() { setClickedSlot(-1); } // PHYSICAL-COORDINATE CONVENIENCE METHODS. MiscCoord_P selectedSlot_P() const { return visualToPhysical(selected_slot); } void setSelectedSlot_P( MiscCoord_P x ) { setSelectedSlot( physicalToVisual(x) ); } void toggle_P( MiscCoord_P x ) { toggle( physicalToVisual(x) ); } void select_P( MiscCoord_P x ) { select( physicalToVisual(x) ); } void unselect_P( MiscCoord_P x ){ unselect( physicalToVisual(x) ); } bool isSelected_P( MiscCoord_P x ) const { return isSelected( physicalToVisual(x) ); } void selectOne_P( MiscCoord_P x ) { selectOne(physicalToVisual(x)); } void setCursor_P( MiscCoord_P x ) { setCursor(physicalToVisual(x)); } MiscCoord_P getCursor_P() const { return visualToPhysical(getCursor()); } MiscCoord_P clickedSlot_P() const { return visualToPhysical( clickedSlot() ); } void setClickedSlot_P( MiscCoord_P x ) { setClickedSlot( physicalToVisual(x) ); } // ARCHIVING SUPPORT. void encodeWithCoder( NSCoder* ); void initWithCoder( NSCoder*, int ver ); void initWithCoder_v1( NSCoder*, int ver ); void initWithCoder_v2( NSCoder*, int ver ); }; #endif // __MiscTableBorder_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableCell.M100444 1750 1750 107100 6757227333 24072 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableCell.M // // Default cell class used by MiscTableScroll to display text. // // NOTE *OPENSTEP-4.x* // OPENSTEP 4.x converts NSImageCellType cells to NSTextCellType // cells upon receipt of -setFont: which is not the behavior that we want // (nor expect since in previous NEXTSTEP versions -setFont: left the // cell alone if it was not NX_TEXTCELL). // // NOTE *SET-OWNER-VALUE* // We must implement these methods so that MiscTableScroll will call // these methods instead of the explicit instance -setXxx methods. // However, we don't need to do any work. We will ask the owner for // it's value whenever we need it. // // FIXME: optional-allocation stuff does not address alignment requirements. // FIXME: automate most of the optional-allocation stuff. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableCell.M,v 1.22 99/06/15 02:44:46 sunshine Exp $ // $Log: MiscTableCell.M,v $ // Revision 1.22 99/06/15 02:44:46 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Now uses NSColor's system-colors rather than hard-coded gray, black, white. // // Revision 1.21 97/06/22 10:20:57 sunshine // v127.1: Now scrollable by default; making setup for editable slots simpler. // Fixed bug: Was making allocation from wrong zone in -copyWithZone:. // // Revision 1.20 97/06/18 10:24:02 sunshine // v125.9: Color-related methods changed name: "highlight" --> "selected". //----------------------------------------------------------------------------- #import #import #import "MiscTableView.h" #import "MiscTableScrollPrivate.h" extern "Objective-C" { #import // NSEventTrackingRunLoopMode #import #import #import } extern "C" { #import // floor() #import } #define MISC_TC_VERSION_0 0 // Conditional tag. #define MISC_TC_VERSION_1 1 // Tag became unconditional. #define MISC_TC_VERSION_1000 1000 // First OpenStep version (4.0 PR2). #define MISC_TC_VERSION MISC_TC_VERSION_1000 //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscTableCell //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (void)initialize { if (self == [MiscTableCell class]) { [self setVersion:MISC_TC_VERSION]; } } //----------------------------------------------------------------------------- // + defaultFont //----------------------------------------------------------------------------- + (NSFont*)defaultFont { return [NSFont userFontOfSize:12.0]; } //----------------------------------------------------------------------------- // initTextCell: // NOTE *1* -[NSCell initTextCell:] invokes -setStringValue: which // invokes -setFont:. This means that this cell will get an explicit // -setFont call before we finish initialization, and we need to // restore the useOwnerFont setting. //----------------------------------------------------------------------------- - (id)initTextCell:(NSString*)s { [super initTextCell:s]; // NOTE *1* [self setBordered:NO]; [self setWraps:NO]; [self setAlignment:NSLeftTextAlignment]; [self setScrollable:YES]; [self setUseOwnerFont:YES]; // NOTE *1* [self setOwnerFont:[[self class] defaultFont]]; return self; } //----------------------------------------------------------------------------- // initImageCell: //----------------------------------------------------------------------------- - (id)initImageCell:(NSImage*)s { [super initImageCell:s]; [self setBordered:NO]; return self; } //----------------------------------------------------------------------------- // isOpaque //----------------------------------------------------------------------------- - (BOOL)isOpaque { return !([self isSelected] ? [self useOwnerSelectedBackgroundColor] : [self useOwnerBackgroundColor]); } //----------------------------------------------------------------------------- // setSelected: //----------------------------------------------------------------------------- - (void)setSelected:(BOOL)flag { if (flag) tc1_flags |= MISC_TC1_IS_SELECTED; else tc1_flags &= ~MISC_TC1_IS_SELECTED; } //----------------------------------------------------------------------------- // isSelected //----------------------------------------------------------------------------- - (BOOL)isSelected { return ((tc1_flags & MISC_TC1_IS_SELECTED) != 0); } //----------------------------------------------------------------------------- // tag //----------------------------------------------------------------------------- - (int)tag { return tag; } //----------------------------------------------------------------------------- // setTag: //----------------------------------------------------------------------------- - (void)setTag:(int)x { tag = x; } //----------------------------------------------------------------------------- // owner //----------------------------------------------------------------------------- - (id)owner { return owner; } //----------------------------------------------------------------------------- // setOwner: //----------------------------------------------------------------------------- - (void)setOwner:(id)obj { if (obj != owner) { owner = obj; if (owner != 0) { if ([owner respondsToSelector:@selector(font)]) [self setOwnerFont:[owner font]]; } } } //----------------------------------------------------------------------------- // font //----------------------------------------------------------------------------- - (NSFont*)font { return [super font]; } //----------------------------------------------------------------------------- // setFont: //----------------------------------------------------------------------------- - (void)setFont:(NSFont*)fontObj { if ([self type] == NSTextCellType) // NOTE *OPENSTEP-4.x* { [self setUseOwnerFont:NO]; [super setFont:fontObj]; } } //----------------------------------------------------------------------------- // tc1Data //----------------------------------------------------------------------------- - (void*)tc1Data { return tc1_data; } //============================================================================= // TC1 MANIPULATION //============================================================================= //----------------------------------------------------------------------------- // tc1Flags //----------------------------------------------------------------------------- - (unsigned int)tc1Flags { return tc1_flags; } //----------------------------------------------------------------------------- // tc1DataSize //----------------------------------------------------------------------------- - (unsigned int)tc1DataSize { unsigned int size = 0; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR) size += [self tc1TextColorLen]; if (tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR) size += [self tc1BackgroundColorLen]; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR_H) size += [self tc1SelectedTextColorLen]; if (tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR_H) size += [self tc1SelectedBackgroundColorLen]; return size; } //----------------------------------------------------------------------------- // tc1TextColorPos //----------------------------------------------------------------------------- - (unsigned int)tc1TextColorPos { return 0; } //----------------------------------------------------------------------------- // tc1BackgroundColorPos //----------------------------------------------------------------------------- - (unsigned int)tc1BackgroundColorPos { unsigned int pos = [self tc1TextColorPos]; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR) pos += [self tc1TextColorLen]; return pos; } //----------------------------------------------------------------------------- // tc1SelectedTextColorPos //----------------------------------------------------------------------------- - (unsigned int)tc1SelectedTextColorPos { unsigned int pos = [self tc1BackgroundColorPos]; if (tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR) pos += [self tc1BackgroundColorLen]; return pos; } //----------------------------------------------------------------------------- // tc1SelectedBackgroundColorPos //----------------------------------------------------------------------------- - (unsigned int)tc1SelectedBackgroundColorPos { unsigned int pos = [self tc1SelectedTextColorPos]; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR_H) pos += [self tc1SelectedTextColorLen]; return pos; } //----------------------------------------------------------------------------- // tc1TextColorLen //----------------------------------------------------------------------------- - (unsigned int)tc1TextColorLen { return sizeof(NSColor*); } //----------------------------------------------------------------------------- // tc1BackgroundColorLen //----------------------------------------------------------------------------- - (unsigned int)tc1BackgroundColorLen { return sizeof(NSColor*); } //----------------------------------------------------------------------------- // tc1SelectedTextColorLen //----------------------------------------------------------------------------- - (unsigned int)tc1SelectedTextColorLen { return sizeof(NSColor*); } //----------------------------------------------------------------------------- // tc1SelectedBackgroundColorLen //----------------------------------------------------------------------------- - (unsigned int)tc1SelectedBackgroundColorLen { return sizeof(NSColor*); } //----------------------------------------------------------------------------- // tc1TextColorPtr //----------------------------------------------------------------------------- - (NSColor**)tc1TextColorPtr { return (NSColor**)((char*)tc1_data + [self tc1TextColorPos]); } //----------------------------------------------------------------------------- // tc1BackgroundColorPtr //----------------------------------------------------------------------------- - (NSColor**)tc1BackgroundColorPtr { return (NSColor**)((char*)tc1_data + [self tc1BackgroundColorPos]); } //----------------------------------------------------------------------------- // tc1SelectedTextColorPtr //----------------------------------------------------------------------------- - (NSColor**)tc1SelectedTextColorPtr { return (NSColor**)((char*)tc1_data + [self tc1SelectedTextColorPos]); } //----------------------------------------------------------------------------- // tc1SelectedBackgroundColorPtr //----------------------------------------------------------------------------- - (NSColor**)tc1SelectedBackgroundColorPtr { return (NSColor**)((char*)tc1_data + [self tc1SelectedBackgroundColorPos]); } //----------------------------------------------------------------------------- // tc1InsertData:len:pos: //----------------------------------------------------------------------------- - (void*)tc1InsertData:(void const*)data pos:(unsigned int)pos len:(unsigned int)len { if (len > 0) { unsigned int const old_size = [self tc1DataSize]; unsigned int const new_size = old_size + len; if (old_size == 0) tc1_data = NSZoneMalloc( [self zone], new_size ); else { tc1_data = NSZoneRealloc( [self zone], tc1_data, new_size ); if (pos < old_size) memmove( (char*) tc1_data + pos + len, // Destination (char*) tc1_data + pos, // Source old_size - pos ); // # bytes. } if (data != 0) memcpy( (char*) tc1_data + pos, data, len ); else memset( (char*) tc1_data + pos, 0, len ); return (void*)((char*) tc1_data + pos ); } return 0; } //----------------------------------------------------------------------------- // tc1DeleteDataPos:len: //----------------------------------------------------------------------------- - (void)tc1DeleteDataPos:(unsigned int)pos len:(unsigned int)len { if (len > 0) { unsigned int const old_size = [self tc1DataSize]; unsigned int const new_size = old_size - len; if (new_size == 0) { NSZoneFree( [self zone], tc1_data ); tc1_data = 0; } else { if (pos < new_size) memmove( (char*) tc1_data + pos, // Destination (char*) tc1_data + pos + len, // Source new_size - pos ); // # bytes tc1_data = NSZoneRealloc( [self zone], tc1_data, new_size ); } } } //============================================================================= // *OWNER* CONTROLS //============================================================================= //----------------------------------------------------------------------------- // useOwnerFont //----------------------------------------------------------------------------- - (BOOL)useOwnerFont { return ((tc1_flags & MISC_TC1_SELF_FONT) == 0); } //----------------------------------------------------------------------------- // useOwnerTextColor //----------------------------------------------------------------------------- - (BOOL)useOwnerTextColor { return ((tc1_flags & MISC_TC1_SELF_TEXT_COLOR) == 0); } //----------------------------------------------------------------------------- // useOwnerBackgroundColor //----------------------------------------------------------------------------- - (BOOL)useOwnerBackgroundColor { return ((tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR) == 0); } //----------------------------------------------------------------------------- // useOwnerSelectedTextColor //----------------------------------------------------------------------------- - (BOOL)useOwnerSelectedTextColor { return ((tc1_flags & MISC_TC1_SELF_TEXT_COLOR_H) == 0); } //----------------------------------------------------------------------------- // useOwnerSelectedBackgroundColor //----------------------------------------------------------------------------- - (BOOL)useOwnerSelectedBackgroundColor { return ((tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR_H) == 0); } //----------------------------------------------------------------------------- // setUseOwnerFont: //----------------------------------------------------------------------------- - (void)setUseOwnerFont:(BOOL)flag { if ([self useOwnerFont] != flag) { if (flag) { tc1_flags &= ~(MISC_TC1_SELF_FONT); if (owner != 0 && [owner respondsToSelector:@selector(font)]) [self setOwnerFont:[owner font]]; } else // (!flag) { tc1_flags |= MISC_TC1_SELF_FONT; } } } //----------------------------------------------------------------------------- // setUseOwnerTextColor: //----------------------------------------------------------------------------- - (void)setUseOwnerTextColor:(BOOL)flag { if ([self useOwnerTextColor] != flag) { unsigned int const pos = [self tc1TextColorPos]; unsigned int const len = [self tc1TextColorLen]; if (flag) { [[self textColor] release]; [self tc1DeleteDataPos:pos len:len]; tc1_flags &= ~(MISC_TC1_SELF_TEXT_COLOR); } else // (!flag) { NSColor* color = [[[self class] defaultTextColor] retain]; [self tc1InsertData:&color pos:pos len:len]; tc1_flags |= MISC_TC1_SELF_TEXT_COLOR; } } } //----------------------------------------------------------------------------- // setUseOwnerBackgroundColor: //----------------------------------------------------------------------------- - (void)setUseOwnerBackgroundColor:(BOOL)flag { if ([self useOwnerBackgroundColor] != flag) { unsigned int const pos = [self tc1BackgroundColorPos]; unsigned int const len = [self tc1BackgroundColorLen]; if (flag) { [[self backgroundColor] release]; [self tc1DeleteDataPos:pos len:len]; tc1_flags &= ~(MISC_TC1_SELF_BACKGROUND_COLOR); } else // (!flag) { NSColor* color = [[[self class] defaultBackgroundColor] retain]; [self tc1InsertData:&color pos:pos len:len]; tc1_flags |= MISC_TC1_SELF_BACKGROUND_COLOR; } } } //----------------------------------------------------------------------------- // setUseOwnerSelectedTextColor: //----------------------------------------------------------------------------- - (void)setUseOwnerSelectedTextColor:(BOOL)flag { if ([self useOwnerSelectedTextColor] != flag) { unsigned int const pos = [self tc1SelectedTextColorPos]; unsigned int const len = [self tc1SelectedTextColorLen]; if (flag) { [[self selectedTextColor] release]; [self tc1DeleteDataPos:pos len:len]; tc1_flags &= ~(MISC_TC1_SELF_TEXT_COLOR_H); } else // (!flag) { NSColor* color = [[[self class] defaultSelectedTextColor] retain]; [self tc1InsertData:&color pos:pos len:len]; tc1_flags |= MISC_TC1_SELF_TEXT_COLOR_H; } } } //----------------------------------------------------------------------------- // setUseOwnerSelectedBackgroundColor: //----------------------------------------------------------------------------- - (void)setUseOwnerSelectedBackgroundColor:(BOOL)flag { if ([self useOwnerSelectedBackgroundColor] != flag) { unsigned int const pos = [self tc1SelectedBackgroundColorPos]; unsigned int const len = [self tc1SelectedBackgroundColorLen]; if (flag) { [[self selectedBackgroundColor] release]; [self tc1DeleteDataPos:pos len:len]; tc1_flags &= ~(MISC_TC1_SELF_BACKGROUND_COLOR_H); } else // (!flag) { NSColor* color = [[[self class] defaultSelectedBackgroundColor] retain]; [self tc1InsertData:&color pos:pos len:len]; tc1_flags |= MISC_TC1_SELF_BACKGROUND_COLOR_H; } } } //----------------------------------------------------------------------------- // setOwnerFont: //----------------------------------------------------------------------------- - (void)setOwnerFont:(NSFont*)fontObj { if ([self type] == NSTextCellType) // NOTE *OPENSTEP-4.x* if ([self useOwnerFont]) [super setFont:fontObj]; } //----------------------------------------------------------------------------- // setOwner values... NOTE *SET-OWNER-VALUE* //----------------------------------------------------------------------------- - (void)setOwnerTextColor:(NSColor*)pcolor {} - (void)setOwnerBackgroundColor:(NSColor*)pcolor {} - (void)setOwnerSelectedTextColor:(NSColor*)pcolor {} - (void)setOwnerSelectedBackgroundColor:(NSColor*)pcolor {} //============================================================================= // COLOR MANIPULATION //============================================================================= //----------------------------------------------------------------------------- // +defaultBackgroundColor //----------------------------------------------------------------------------- + (NSColor*)defaultBackgroundColor { return [NSColor controlBackgroundColor]; } //----------------------------------------------------------------------------- // backgroundColor //----------------------------------------------------------------------------- - (NSColor*)backgroundColor { if ([self useOwnerBackgroundColor]) { if (owner != 0 && [owner respondsToSelector:@selector(backgroundColor)]) return [owner backgroundColor]; return [[self class] defaultBackgroundColor]; } return *[self tc1BackgroundColorPtr]; } //----------------------------------------------------------------------------- // setBackgroundColor //----------------------------------------------------------------------------- - (void)setBackgroundColor:(NSColor*)c { NSColor** p; [self setUseOwnerBackgroundColor:NO]; p = [self tc1BackgroundColorPtr]; [*p autorelease]; *p = [c retain]; } //----------------------------------------------------------------------------- // +defaultSelectedBackgroundColor //----------------------------------------------------------------------------- + (NSColor*)defaultSelectedBackgroundColor { return [NSColor selectedControlColor]; } //----------------------------------------------------------------------------- // selectedBackgroundColor //----------------------------------------------------------------------------- - (NSColor*)selectedBackgroundColor { if ([self useOwnerSelectedBackgroundColor]) { if (owner && [owner respondsToSelector:@selector(selectedBackgroundColor)]) return [owner selectedBackgroundColor]; return [[self class] defaultSelectedBackgroundColor]; } return *[self tc1SelectedBackgroundColorPtr]; } //----------------------------------------------------------------------------- // setSelectedBackgroundColor //----------------------------------------------------------------------------- - (void)setSelectedBackgroundColor:(NSColor*)c { NSColor** p; [self setUseOwnerSelectedBackgroundColor:NO]; p = [self tc1SelectedBackgroundColorPtr]; [*p autorelease]; *p = [c retain]; } //----------------------------------------------------------------------------- // +defaultTextColor //----------------------------------------------------------------------------- + (NSColor*)defaultTextColor { return [NSColor controlTextColor]; } //----------------------------------------------------------------------------- // textColor //----------------------------------------------------------------------------- - (NSColor*)textColor { if ([self useOwnerTextColor]) { if (owner != 0 && [owner respondsToSelector:@selector(textColor)]) return [owner textColor]; return [[self class] defaultTextColor]; } return *[self tc1TextColorPtr]; } //----------------------------------------------------------------------------- // setTextColor //----------------------------------------------------------------------------- - (void)setTextColor:(NSColor*)c { NSColor** p; [self setUseOwnerTextColor:NO]; p = [self tc1TextColorPtr]; [*p autorelease]; *p = [c retain]; } //----------------------------------------------------------------------------- // +defaultSelectedTextColor //----------------------------------------------------------------------------- + (NSColor*)defaultSelectedTextColor { return [NSColor selectedControlTextColor]; } //----------------------------------------------------------------------------- // selectedTextColor //----------------------------------------------------------------------------- - (NSColor*)selectedTextColor { if ([self useOwnerSelectedTextColor]) { if (owner != 0 && [owner respondsToSelector:@selector(selectedTextColor)]) return [owner selectedTextColor]; return [[self class] defaultSelectedTextColor]; } return *[self tc1SelectedTextColorPtr]; } //----------------------------------------------------------------------------- // setSelectedTextColor //----------------------------------------------------------------------------- - (void)setSelectedTextColor:(NSColor*)c { NSColor** p; [self setUseOwnerSelectedTextColor:NO]; p = [self tc1SelectedTextColorPtr]; [*p autorelease]; *p = [c retain]; } //============================================================================= // DRAWING //============================================================================= //----------------------------------------------------------------------------- // ownerDraw //----------------------------------------------------------------------------- - (BOOL)ownerDraw { return !(tc1_flags & MISC_TC1_SELF_DRAW); } //----------------------------------------------------------------------------- // setOwnerDraw: //----------------------------------------------------------------------------- - (void)setOwnerDraw:(BOOL)flag { if (flag) tc1_flags &= ~(MISC_TC1_SELF_DRAW); else // (!flag) tc1_flags |= MISC_TC1_SELF_DRAW; } //----------------------------------------------------------------------------- // bgColor //----------------------------------------------------------------------------- - (NSColor*)bgColor { return [self isSelected] ? [self selectedBackgroundColor] : [self backgroundColor]; } //----------------------------------------------------------------------------- // fgColor //----------------------------------------------------------------------------- - (NSColor*)fgColor { return [self isSelected] ? [self selectedTextColor] : [self textColor]; } //----------------------------------------------------------------------------- // setUpFieldEditorAttributes: //----------------------------------------------------------------------------- - (NSText*)setUpFieldEditorAttributes:(NSText*)textObject { [super setUpFieldEditorAttributes:textObject]; [textObject setTextColor:[self fgColor]]; [textObject setBackgroundColor:[self bgColor]]; return textObject; } //----------------------------------------------------------------------------- // drawInteriorWithFrame:inView: // // NOTE *1*: Our superclass (NSCell) swaps white with gray when highlighted. // Since we supply our own highlight colors, we need to subvert NSCell's // normal behavior in order to prevent it from munging our colors. //----------------------------------------------------------------------------- - (void)drawInteriorWithFrame:(NSRect)rect inView:(NSView*)controlView { if ([self isOpaque]) { [[self bgColor] set]; NSRectFill( rect ); } BOOL const wasHighlighted = [self isHighlighted]; // NOTE *1* [self setCellAttribute:NSCellHighlighted to:0]; [super drawInteriorWithFrame:rect inView:controlView]; [self setCellAttribute:NSCellHighlighted to:wasHighlighted];// NOTE *1* } //----------------------------------------------------------------------------- // drawWithFrame:inView: //----------------------------------------------------------------------------- - (void)drawWithFrame:(NSRect)rect inView:(NSView*)aView { [self drawInteriorWithFrame:rect inView:aView]; } //----------------------------------------------------------------------------- // highlight:withFrame:inView: // // No need to do any actual drawing since this class does not display // itself differently when highlighted. //----------------------------------------------------------------------------- - (void)highlight:(BOOL)flag withFrame:(NSRect)rect inView:(NSView *)aView { if (flag != [self isHighlighted]) [self setCellAttribute:NSCellHighlighted to:flag]; } //============================================================================= // REVIVE / RETIRE //============================================================================= //----------------------------------------------------------------------------- // tableScroll:reviveAtRow:column: // // NOTE *1* // This is a performance-critical method. Therefore, the owner font // setting code has been completely in-lined here. Furthermore, since // the owner's font may have changed after the cell was retired, we // latch the owner's current font unconditionally here. //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)scroll reviveAtRow:(int)row column:(int)col { unsigned int const MASK = MISC_TC1_SELF_DRAW | MISC_TC1_SELF_TEXT_COLOR | MISC_TC1_SELF_BACKGROUND_COLOR | MISC_TC1_SELF_TEXT_COLOR_H | MISC_TC1_SELF_BACKGROUND_COLOR_H; owner = scroll; tc1_flags &= ~(MISC_TC1_SELF_FONT); [super setFont:[scroll font]]; // NOTE *1* if (tc1_flags & MASK) { if (tc1_flags & MISC_TC1_SELF_DRAW) [self setOwnerDraw:YES]; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR) [self setUseOwnerTextColor:YES]; if (tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR) [self setUseOwnerBackgroundColor:YES]; if (tc1_flags & MISC_TC1_SELF_TEXT_COLOR_H) [self setUseOwnerSelectedTextColor:YES]; if (tc1_flags & MISC_TC1_SELF_BACKGROUND_COLOR_H) [self setUseOwnerSelectedBackgroundColor:YES]; } return self; } //----------------------------------------------------------------------------- // tableScroll:retireAtRow:column: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)scroll retireAtRow:(int)row column:(int)col { if ([self type] == NSTextCellType) [self setStringValue:@""]; return self; } //============================================================================= // ALLOCATION / DEALLOCATION //============================================================================= //----------------------------------------------------------------------------- // tc1DestroyData //----------------------------------------------------------------------------- - (void)tc1DestroyData { if (![self useOwnerTextColor]) [[self textColor] release]; if (![self useOwnerBackgroundColor]) [[self backgroundColor] release]; if (![self useOwnerSelectedTextColor]) [[self selectedTextColor] release]; if (![self useOwnerSelectedBackgroundColor]) [[self selectedBackgroundColor] release]; tc1_flags = 0; } //----------------------------------------------------------------------------- // tc1FreeData //----------------------------------------------------------------------------- - (void)tc1FreeData { if (tc1_data != 0) { NSZoneFree( [self zone], tc1_data ); tc1_data = 0; } } //----------------------------------------------------------------------------- // dealloc //----------------------------------------------------------------------------- - (void)dealloc { [self tc1DestroyData]; [self tc1FreeData]; [super dealloc]; } //----------------------------------------------------------------------------- // copyWithZone: //----------------------------------------------------------------------------- - (id)copyWithZone:(NSZone*)zone { MiscTableCell* clone = [super copyWithZone:zone]; if (tc1_data != 0) { unsigned int const size = [self tc1DataSize]; void* p = NSZoneMalloc( zone, size ); memcpy( p, tc1_data, size ); clone->tc1_data = p; if (![clone useOwnerTextColor]) *[clone tc1TextColorPtr] = [[self textColor] retain]; if (![clone useOwnerBackgroundColor]) *[clone tc1BackgroundColorPtr] = [[self backgroundColor] retain]; if (![clone useOwnerSelectedTextColor]) *[clone tc1SelectedTextColorPtr] = [[self selectedTextColor] retain]; if (![clone useOwnerSelectedBackgroundColor]) *[clone tc1SelectedBackgroundColorPtr] = [[self selectedBackgroundColor] retain]; } return clone; } //============================================================================= // ARCHIVING //============================================================================= //----------------------------------------------------------------------------- // initWithCoder_v0: //----------------------------------------------------------------------------- - (void)initWithCoder_v0:(NSCoder*)aDecoder { unsigned int x; owner = [[aDecoder decodeObject] retain]; [aDecoder decodeValueOfObjCType:@encode(unsigned int) at:&x]; if (x & MISC_TC1_HAS_TAG) [aDecoder decodeValueOfObjCType:@encode(int) at:&tag]; else tag = 0; if (x & MISC_TC1_SELF_TEXT_COLOR) [self setTextColor:[aDecoder decodeNXColor]]; if (x & MISC_TC1_SELF_BACKGROUND_COLOR) [self setBackgroundColor:[aDecoder decodeNXColor]]; if (x & MISC_TC1_SELF_TEXT_COLOR_H) [self setSelectedTextColor:[aDecoder decodeNXColor]]; if (x & MISC_TC1_SELF_BACKGROUND_COLOR_H) [self setSelectedBackgroundColor:[aDecoder decodeNXColor]]; } //----------------------------------------------------------------------------- // initWithCoder_v1: //----------------------------------------------------------------------------- - (void)initWithCoder_v1:(NSCoder*)aDecoder { unsigned int x; owner = [[aDecoder decodeObject] retain]; [aDecoder decodeValueOfObjCType:@encode(int) at:&tag]; [aDecoder decodeValueOfObjCType:@encode(unsigned int) at:&x]; if (x & MISC_TC1_SELF_TEXT_COLOR) [self setTextColor:[aDecoder decodeNXColor]]; if (x & MISC_TC1_SELF_BACKGROUND_COLOR) [self setBackgroundColor:[aDecoder decodeNXColor]]; if (x & MISC_TC1_SELF_TEXT_COLOR_H) [self setSelectedTextColor:[aDecoder decodeNXColor]]; if (x & MISC_TC1_SELF_BACKGROUND_COLOR_H) [self setSelectedBackgroundColor:[aDecoder decodeNXColor]]; } //----------------------------------------------------------------------------- // initWithCoder_v1000: //----------------------------------------------------------------------------- - (void)initWithCoder_v1000:(NSCoder*)aDecoder { unsigned int x; owner = [[aDecoder decodeObject] retain]; [aDecoder decodeValueOfObjCType:@encode(int) at:&tag]; [aDecoder decodeValueOfObjCType:@encode(unsigned int) at:&x]; if (x & MISC_TC1_SELF_TEXT_COLOR) [self setTextColor:[aDecoder decodeObject]]; if (x & MISC_TC1_SELF_BACKGROUND_COLOR) [self setBackgroundColor:[aDecoder decodeObject]]; if (x & MISC_TC1_SELF_TEXT_COLOR_H) [self setSelectedTextColor:[aDecoder decodeObject]]; if (x & MISC_TC1_SELF_BACKGROUND_COLOR_H) [self setSelectedBackgroundColor:[aDecoder decodeObject]]; } //----------------------------------------------------------------------------- // initWithCoder: //----------------------------------------------------------------------------- - (id)initWithCoder:(NSCoder*)aDecoder { [super initWithCoder:aDecoder]; [self tc1DestroyData]; [self tc1FreeData]; unsigned int const ver = [aDecoder versionForClassName:[[MiscTableCell class] description]]; switch (ver) { case MISC_TC_VERSION_0: [self initWithCoder_v0: aDecoder]; break; case MISC_TC_VERSION_1: [self initWithCoder_v1: aDecoder]; break; case MISC_TC_VERSION_1000: [self initWithCoder_v1000:aDecoder]; break; default: [NSException raise:NSGenericException format:@"Cannot read: unknown version %d", ver]; break; } return self; } //----------------------------------------------------------------------------- // encodeWithCoder: //----------------------------------------------------------------------------- - (void)encodeWithCoder:(NSCoder*)aCoder { [super encodeWithCoder:aCoder]; [aCoder encodeConditionalObject:owner]; [aCoder encodeValueOfObjCType:@encode(int) at:&tag]; [aCoder encodeValueOfObjCType:@encode(unsigned int) at:&tc1_flags]; if (![self useOwnerTextColor]) [aCoder encodeObject:[self textColor]]; if (![self useOwnerBackgroundColor]) [aCoder encodeObject:[self backgroundColor]]; if (![self useOwnerSelectedTextColor]) [aCoder encodeObject:[self selectedTextColor]]; if (![self useOwnerSelectedBackgroundColor]) [aCoder encodeObject:[self selectedBackgroundColor]]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscSortDescend.tiff100444 1750 1750 336 6757227313 25135 0ustar sunshinesunshineMM*88*???? ? (R ' 'MiscKit2/Palettes/MiscTableScroll/Framework/MiscSortDescendH.tiff100444 1750 1750 336 6757227313 25245 0ustar sunshinesunshineMM** ???? ? (R ' 'MiscKit2/Palettes/MiscTableScroll/Framework/MiscVertResizeCursor.tiff100444 1750 1750 512 6757227313 26214 0ustar sunshinesunshineMM* 00 ????0 0?? *2:B(RH@@ ' 'MiscKit2/Palettes/MiscTableScroll/Framework/MiscBorderCell.M100444 1750 1750 11732 6757227323 24244 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscBorderCell.M // // Cell class used by MiscBorderView to manage column headings and row // labels for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscBorderCell.M,v 1.7 98/03/29 23:38:17 sunshine Exp $ // $Log: MiscBorderCell.M,v $ // Revision 1.7 98/03/29 23:38:17 sunshine // v138.1: Now derived from NSTableHeaderCell rather than NSTextFieldCell // so that it knows how to correctly draw and color itself on all platforms // rather than only being able to draw itself in a NextStep-like fashion. // // Revision 1.6 97/03/23 05:45:38 sunshine // v125.4: Worked around OPENSTEP 4.1 bug where -setupFieldEditorAttributes: // never gets called, so text was not drawing white. Worked around problem by // subclassing from NSTextFieldCell rather than NSCell. This way color can // be set with -setTextColor:. //----------------------------------------------------------------------------- #import "MiscBorderCell.h" extern "Objective-C" { #import #import } int const RESIZE_WIDTH = 4; // Resize zone to right of "toggle" image. @implementation MiscBorderCell //----------------------------------------------------------------------------- // -setToggleImage: //----------------------------------------------------------------------------- - (void)setToggleImage:(NSImage*)p { if (p != toggleImage) { [toggleImage release]; toggleImage = [p retain]; } } //----------------------------------------------------------------------------- // -initBorderCell //----------------------------------------------------------------------------- - (void)initBorderCell { toggleImage = 0; [self setBordered:YES]; [self setWraps:NO]; [self setAlignment:NSCenterTextAlignment]; } //----------------------------------------------------------------------------- // -initTextCell: //----------------------------------------------------------------------------- - (id)initTextCell:(NSString*)s { [super initTextCell:s]; [self initBorderCell]; return self; } //----------------------------------------------------------------------------- // -initImageCell: //----------------------------------------------------------------------------- - (id)initImageCell:(NSImage*)p { [super initImageCell:p]; [self initBorderCell]; return self; } //----------------------------------------------------------------------------- // -cellSizeForBounds: //----------------------------------------------------------------------------- - (NSSize)cellSizeForBounds:(NSRect)aRect { NSSize s = [super cellSizeForBounds:aRect]; if (toggleImage != 0) s.width += [toggleImage size].width; return s; } //----------------------------------------------------------------------------- // -drawInteriorWithFrame:inView: -- Assumes the view is flipped. //----------------------------------------------------------------------------- - (void)drawInteriorWithFrame:(NSRect)r inView:(NSView*)v { if (toggleImage != 0) { NSSize sz = [toggleImage size]; NSPoint pt = { NSMaxX(r) - RESIZE_WIDTH, NSMaxY(r) }; float const max_height = floor( NSHeight(r) ); float const max_width = floor( NSWidth(r) - RESIZE_WIDTH ); BOOL const too_high = sz.height > max_height; BOOL const too_wide = sz.width > max_width; if (too_high || too_wide) { NSRect q = { {0,0}, {sz.width, sz.height} }; if (too_high) { q.size.height = max_height; q.origin.y = floor( (sz.height - max_height) / 2 ); } else { // Center image vertically. pt.y = floor( pt.y - ((max_height - sz.height) / 2) ); } if (too_wide) { q.size.width = max_width; q.origin.x = floor( (sz.width - max_width) / 2 ); } sz = q.size; pt.x -= sz.width; [toggleImage compositeToPoint:pt fromRect:q operation:NSCompositeSourceOver]; } else { // Center image vertically. pt.y = floor( pt.y - ((max_height - sz.height) / 2) ); pt.x -= sz.width; [toggleImage compositeToPoint:pt operation:NSCompositeSourceOver]; } r.size.width -= (sz.width + RESIZE_WIDTH); } [super drawInteriorWithFrame:r inView:v]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscHighlightTracker.M100444 1750 1750 6027 6757227330 25431 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscHighlightTracker.M // // Highlight-mode selection tracking. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscHighlightTracker.M,v 1.5 96/12/30 09:12:19 sunshine Exp $ // $Log: MiscHighlightTracker.M,v $ // Revision 1.5 96/12/30 09:12:19 sunshine // v107.1: All access to the selection now goes through MiscTableBorder. // // Revision 1.4 96/12/30 03:11:11 sunshine // v104.1: Selected-slot was removed from SparseSet and promoted to // TableBorder. // // Revision 1.3 96/05/07 02:12:49 sunshine // For OpenStep conformance, keyboard events are now treated the same as // mouse events (i.e. one must use the same modifiers with keyboard events // as one does with mouse events rather than the behavior being different // for keyboard events). Ditched -keyDown:atPos: method. //----------------------------------------------------------------------------- #import "MiscHighlightTracker.h" #import "MiscSparseSet.h" #import "MiscTableBorder.h" @implementation MiscHighlightTracker //----------------------------------------------------------------------------- // mouseDown:atPos: //----------------------------------------------------------------------------- - (void) mouseDown:(NSEvent*) event atPos:(MiscCoord_V)pos { extending = (([event modifierFlags] & NSAlternateKeyMask) != 0); if (extending) { [super mouseDown: event atPos: pos]; } else { border->toggle( pos ); lastPos = pos; } } //----------------------------------------------------------------------------- // mouseDragged:atPos: //----------------------------------------------------------------------------- - (void) mouseDragged:(NSEvent*) event atPos:(MiscCoord_V)pos { if (extending) { [super mouseDragged: event atPos: pos]; } else { if (border->goodPos( lastPos )) border->toggle( lastPos ); if (border->goodPos( pos )) border->toggle( pos ); lastPos = pos; } } //----------------------------------------------------------------------------- // mouseUp:atPos: //----------------------------------------------------------------------------- - (void) mouseUp:(NSEvent*) event atPos:(MiscCoord_V)pos { if (extending) [super mouseUp: event atPos: pos]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableCell.h100444 1750 1750 13501 6757227333 24106 0ustar sunshinesunshine#ifndef __MiscTableCell_h #define __MiscTableCell_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableCell.h // // Default cell class used by MiscTableScroll to display text. // // NOTE: // By default, new cells are initialized to useOwner... everything. // // Calling any of the -setFont:, -setTextColor:, -setBackgroundColor: // -setSelectedTextColor:, or -setSelectedBackgroundColor: // methods implicitly turns off the corresponding "useOwner" value. In // the case of colors, this also causes space to be allocated to store // the corresponding color. // // Calling any of the -setOwnerFont:, -setOwnerTextColor:, or // -setOwnerBackgroundColor: methods do *NOT* set these values in the // owner, and do not necessarily make any changes in the object. They // are primarily notification messages. They give the cell the ability // to distinguish between cell-specific -setXxx messages and ones that // are propagated globally by the owner. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableCell.h,v 1.13 97/06/22 10:19:56 sunshine Exp $ // $Log: MiscTableCell.h,v $ // Revision 1.13 97/06/22 10:19:56 sunshine // v127.1: Applied v0.127 NEXTSTEP 3.3 diffs. // // Revision 1.12 97/06/18 10:24:28 sunshine // v125.9: Color-related methods changed name: "highlight" --> "selected". // // Revision 1.11 97/04/15 09:02:17 sunshine // v0.125.8: Added "MiscTableScroll/" prefix to #import to facilitate new // framework organization. //----------------------------------------------------------------------------- #import MISC_TS_EXTERN_BEGIN( "Objective-C" ) #import MISC_TS_EXTERN_END @class NSImage, NSPasteboard; @class MiscTableScroll; #define MISC_TC1_HAS_TAG (1 << 0) // Obsolete. #define MISC_TC1_SELF_FONT (1 << 1) #define MISC_TC1_SELF_TEXT_COLOR (1 << 2) #define MISC_TC1_SELF_BACKGROUND_COLOR (1 << 3) #define MISC_TC1_SELF_TEXT_COLOR_H (1 << 4) #define MISC_TC1_SELF_BACKGROUND_COLOR_H (1 << 5) #define MISC_TC1_IS_SELECTED (1 << 6) #define MISC_TC1_SELF_DRAW (1 << 7) // !ownerDraw #define MISC_TC1_LAST_BIT (1 << 7) @interface MiscTableCell : NSCell { id owner; int tag; unsigned int tc1_flags; void* tc1_data; } - (id)initTextCell:(NSString*)s; - (id)initImageCell:(NSImage*)s; - (void)dealloc; - (id)copyWithZone:(NSZone*)zone; - (id)initWithCoder:(NSCoder*)coder; - (void)encodeWithCoder:(NSCoder*)coder; - (void)drawInteriorWithFrame:(NSRect)r inView:(NSView*)v; - (void)drawWithFrame:(NSRect)r inView:(NSView*)v; - (void)highlight:(BOOL)flag withFrame:(NSRect)r inView:(NSView*)v; - (BOOL)isOpaque; - (void)setSelected:(BOOL)flag; - (BOOL)isSelected; - (int)tag; - (void)setTag:(int)tag; - (id)owner; - (void)setOwner:(id)obj; - (NSFont*)font; - (void)setFont:(NSFont*)obj; // Turns off -useOwnerFont - (NSColor*)textColor; - (NSColor*)backgroundColor; - (NSColor*)selectedBackgroundColor; - (NSColor*)selectedTextColor; - (void)setTextColor:(NSColor*)c; // All -set..Color: turn off equivalent - (void)setBackgroundColor:(NSColor*)c; // -useOwner...Color flags. - (void)setSelectedTextColor:(NSColor*)c; - (void)setSelectedBackgroundColor:(NSColor*)c; - (BOOL)ownerDraw; - (BOOL)useOwnerFont; - (BOOL)useOwnerTextColor; - (BOOL)useOwnerBackgroundColor; - (BOOL)useOwnerSelectedTextColor; - (BOOL)useOwnerSelectedBackgroundColor; - (void)setOwnerDraw:(BOOL)flag; - (void)setUseOwnerFont:(BOOL)flag; - (void)setUseOwnerTextColor:(BOOL)flag; - (void)setUseOwnerBackgroundColor:(BOOL)flag; - (void)setUseOwnerSelectedTextColor:(BOOL)flag; - (void)setUseOwnerSelectedBackgroundColor:(BOOL)flag; - (void)setOwnerFont:(NSFont*)obj; - (void)setOwnerTextColor:(NSColor*)c; - (void)setOwnerBackgroundColor:(NSColor*)c; - (void)setOwnerSelectedTextColor:(NSColor*)c; - (void)setOwnerSelectedBackgroundColor:(NSColor*)c; - (void*)tc1Data; - (unsigned int)tc1Flags; - (unsigned int)tc1DataSize; - (unsigned int)tc1TextColorPos; - (unsigned int)tc1BackgroundColorPos; - (unsigned int)tc1SelectedTextColorPos; - (unsigned int)tc1SelectedBackgroundColorPos; - (unsigned int)tc1TextColorLen; - (unsigned int)tc1BackgroundColorLen; - (unsigned int)tc1SelectedTextColorLen; - (unsigned int)tc1SelectedBackgroundColorLen; - (NSColor**)tc1TextColorPtr; - (NSColor**)tc1BackgroundColorPtr; - (NSColor**)tc1SelectedTextColorPtr; - (NSColor**)tc1SelectedBackgroundColorPtr; - (void*)tc1InsertData:(void const*)data pos:(unsigned int)pos len:(unsigned int)len; - (void)tc1DeleteDataPos:(unsigned int)pos len:(unsigned int)len; - (void)tc1DestroyData; - (void)tc1FreeData; - (NSColor*)fgColor; // Returns appropriate color based upon -isSelected. - (NSColor*)bgColor; // Returns appropriate color based upon -isSelected. + (NSFont*)defaultFont; + (NSColor*)defaultTextColor; + (NSColor*)defaultBackgroundColor; + (NSColor*)defaultSelectedTextColor; + (NSColor*)defaultSelectedBackgroundColor; - (id)tableScroll:(MiscTableScroll*)scroll reviveAtRow:(int)row column:(int)col; - (id)tableScroll:(MiscTableScroll*)scroll retireAtRow:(int)row column:(int)col; @end #endif // __MiscTableCell_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableBorder.cc100444 1750 1750 104267 6757227343 24635 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableBorder.cc // // Structure describing border of an MiscTableView. // // NOTE: many of the sub-arrays in an MiscTableBorder are conditional. // They are not guaranteed to be allocated for every instance. They are // only allocated when the caller tries to store a value in them. // // FIXME: Optimization: separate slot-offset calculations from // resizing calculations. Many situations only require an offset- // update, not a full size recalc. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableBorder.cc,v 1.30 99/06/15 02:41:05 sunshine Exp $ // $Log: MiscTableBorder.cc,v $ // Revision 1.30 99/06/15 02:41:05 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Added support for slot-wise "represented objects". // Fixed bug: setPrototype_P() failed to retain the new prototype. // // Revision 1.29 1998/03/29 23:47:03 sunshine // v138.1: #import was missing "MiscTableScroll/" for public headers. // Now uses MISC_FRAME_HEIGHT rather than hard-coded "18". // // Revision 1.28 98/03/23 21:39:45 sunshine // v137.1: Added clearSortDirection(). //----------------------------------------------------------------------------- #ifdef __GNUC__ # pragma implementation #endif #include "MiscTableBorder.h" #include "MiscTableScrollPrivate.h" #include "MiscTableUtil.h" #include #include extern "Objective-C" { #import #import #import } extern "C" { #include // floor() #include #include } #define MISC_SWAP(T,V,X,Y)\ if ((V) != 0) { T const t = (V)[X]; (V)[X] = (V)[Y]; (V)[Y] = t; } #define MISC_SIZE_CHECK(X)\ do {\ NSCParameterAssert( 0 <= X );\ NSCParameterAssert( X <= MISC_MAX_PIXELS_SIZE );\ } while(0) #define MISC_RANGE_CHECK(X)\ NSCParameterAssert( 0 <= X ); NSCParameterAssert( X < num_slots ) #define MISC_RANGE_CHECK_1(X)\ NSCParameterAssert( 0 <= X ); NSCParameterAssert( X <= num_slots ) #define MISC_SLOT_MEMBER(X,M) ((slots != 0) ? slots[X].M : def_slot.M) #define MISC_SET_SLOT_MEMBER(X,N,M)\ do {\ needs_recalc = true;\ if (slots == 0) alloc_slots();\ slots[X].M = N;\ } while (0) #define MISC_MAP(M,I) (((M) != 0) ? (M)[I] : I) #define MISC_DEF_SORT_DIR MISC_SORT_ASCENDING #define MISC_DEF_SORT_TYPE MISC_SORT_STRING_CASE_INSENSITIVE #define MISC_DEF_SORT_INFO ((MISC_DEF_SORT_TYPE << 1) | \ (MISC_DEF_SORT_DIR & 1)) //----------------------------------------------------------------------------- // global_grow //----------------------------------------------------------------------------- void MiscTableBorder::global_grow( MiscPixels total_size ) { MiscPixels offset = 0; MiscPixels deficit = min_total_size - total_size; MiscPixels const adj = deficit / num_springy; int nextra = (int) (deficit - adj * num_springy); for (int i = 0; i < num_slots; i++) { MiscTableSlot& r = slots[i]; if (r.isSpringy()) { MiscPixels delta = adj; if (nextra > 0) { nextra--; delta++; } r.adj_size = r.size + delta; } r.offset = offset; offset += r.adj_size; } } //----------------------------------------------------------------------------- // perform_recalc //----------------------------------------------------------------------------- void MiscTableBorder::perform_recalc() { MISC_SIZE_CHECK( min_total_size ); int i; MiscPixels total_size = 0; if (slots == 0) alloc_slots(); for (i = 0; i < num_slots; i++) { MiscTableSlot& r = slots[i]; NSCParameterAssert( 0 <= r.min_size ); NSCParameterAssert( r.min_size <= r.size ); NSCParameterAssert( r.size <= r.max_size ); NSCParameterAssert( r.max_size <= MISC_MAX_PIXELS_SIZE ); r.offset = total_size; r.adj_size = r.size; total_size += r.adj_size; } if (total_size < min_total_size && num_springy > 0) global_grow( total_size ); } //----------------------------------------------------------------------------- // do_recalc //----------------------------------------------------------------------------- void MiscTableBorder::do_recalc() { needs_recalc = false; if (uniform_size == 0 && num_slots > 0) perform_recalc(); } //----------------------------------------------------------------------------- // recalc_if_needed //----------------------------------------------------------------------------- inline void MiscTableBorder::recalc_if_needed() { if (needs_recalc) do_recalc(); } //----------------------------------------------------------------------------- // recalcOffsets //----------------------------------------------------------------------------- void MiscTableBorder::recalcOffsets() { needs_recalc = true; recalc_if_needed(); } //----------------------------------------------------------------------------- // alloc_size //----------------------------------------------------------------------------- inline int MiscTableBorder::alloc_size( int rec_size ) { return rec_size * max_slots; } //----------------------------------------------------------------------------- // do_alloc //----------------------------------------------------------------------------- void* MiscTableBorder::do_alloc( int size ) { return malloc( alloc_size(size) ); } //----------------------------------------------------------------------------- // do_alloc_init //----------------------------------------------------------------------------- void* MiscTableBorder::do_alloc_init( int size ) { int const nbytes = alloc_size( size ); void* const p = malloc( nbytes ); memset( p, 0, nbytes ); return p; } //----------------------------------------------------------------------------- // do_realloc //----------------------------------------------------------------------------- void* MiscTableBorder::do_realloc( void* p, int size ) { if (p != 0) { if (max_slots != 0) { p = realloc( p, max_slots * size ); } else { free( p ); p = 0; } } return p; } //----------------------------------------------------------------------------- // do_realloc //----------------------------------------------------------------------------- void MiscTableBorder::do_realloc() { slots = (MiscTableSlot*) do_realloc( slots, sizeof(*slots) ); v2p = (MiscCoord_P*) do_realloc( v2p, sizeof(*v2p) ); p2v = (MiscCoord_V*) do_realloc( p2v, sizeof(*p2v) ); tags = (int*) do_realloc( tags, sizeof(*tags) ); rep_objs = (id*) do_realloc( rep_objs, sizeof(*rep_objs) ); titles = (NSString**) do_realloc( titles, sizeof(*titles) ); styles = (MiscTableCellStyle*) do_realloc( styles, sizeof(*styles) ); prototypes = (id*) do_realloc( prototypes, sizeof(*prototypes) ); sort_funcs = (MiscCompareEntryFunc*) do_realloc( sort_funcs, sizeof(*sort_funcs) ); sort_info = (int*) do_realloc(sort_info,sizeof(*sort_info)); } //----------------------------------------------------------------------------- // freeExtraCapacity //----------------------------------------------------------------------------- void MiscTableBorder::freeExtraCapacity() { if (max_slots > num_slots) { max_slots = num_slots; do_realloc(); } } //----------------------------------------------------------------------------- // setCapacity //----------------------------------------------------------------------------- void MiscTableBorder::setCapacity( int x ) { if (max_slots < x) { max_slots = x; do_realloc(); } } //----------------------------------------------------------------------------- // empty //----------------------------------------------------------------------------- void MiscTableBorder::empty() { setCount(0); selectNone(); clearCursor(); clearClickedSlot(); } //----------------------------------------------------------------------------- // DELETE //----------------------------------------------------------------------------- void MiscTableBorder::destroy_slot( MiscCoord_V x, MiscCoord_P p ) { if (isSpringy(x)) num_springy--; if (rep_objs != 0 && rep_objs[p] != 0) [rep_objs[p] release]; if (titles != 0 && titles[p] != 0) [titles[p] release]; if (prototypes != 0 && prototypes[p] != 0) [prototypes[p] release]; } void MiscTableBorder::do_delete( void* p, int n, int i ) { if (p != 0) memmove( p + i * n, p + (i + 1) * n, (num_slots - i) * n ); } void MiscTableBorder::do_delete( MiscCoord_V x, MiscCoord_P p ) { if (x < num_slots) { do_delete( slots, sizeof(*slots), x ); do_delete( v2p, sizeof(*v2p), x ); } if (p < num_slots) { do_delete( tags, sizeof(*tags), p ); do_delete( rep_objs, sizeof(*rep_objs), p ); do_delete( titles, sizeof(*titles), p ); do_delete( styles, sizeof(*styles), p ); do_delete( prototypes, sizeof(*prototypes), p ); do_delete( sort_funcs, sizeof(*sort_funcs), p ); do_delete( sort_info, sizeof(*sort_info), p ); do_delete( p2v, sizeof(*p2v), p ); } } void MiscTableBorder::deleteAt( MiscCoord_V x ) { MISC_RANGE_CHECK( x ); selection.shiftDownAt( x ); if (num_slots <= 1 || num_slots <= getCursor() + 1) clearCursor(); if (num_slots <= 1 || num_slots <= clickedSlot() + 1) clearClickedSlot(); needs_recalc = true; MiscCoord_P const p = visualToPhysical(x); destroy_slot( x, p ); num_slots--; do_delete( x, p ); if (v2p != 0) { for (int i = 0; i < num_slots; i++) { if (v2p[i] >= p) v2p[i]--; if (p2v[i] >= x) p2v[i]--; } } fixSelectedSlot(); } //----------------------------------------------------------------------------- // INSERT //----------------------------------------------------------------------------- void MiscTableBorder::init_slot( MiscCoord_V x, MiscCoord_P p ) { if (def_slot.isSpringy()) num_springy++; if (slots != 0) slots[x] = def_slot; if (tags != 0) tags[p] = def_tag; if (rep_objs != 0) rep_objs[p] = 0; if (titles != 0) titles[p] = 0; if (styles != 0) styles[p] = def_style; if (prototypes != 0) prototypes[p] = 0; if (sort_funcs != 0) sort_funcs[p] = 0; if (sort_info != 0) sort_info[p] = MISC_DEF_SORT_INFO; if (v2p != 0) { v2p[x] = p; p2v[p] = x; } } void MiscTableBorder::do_insert( void* p, int n, int i ) { if (p != 0) memmove( p + (i + 1) * n, p + i * n, (num_slots - i) * n ); } void MiscTableBorder::do_insert( MiscCoord_V x, MiscCoord_P p ) { if (x < num_slots) { do_insert( slots, sizeof(*slots), x ); do_insert( v2p, sizeof(*v2p), x ); } if (p < num_slots) { do_insert( titles, sizeof(*titles), p ); do_insert( tags, sizeof(*tags), p ); do_insert( rep_objs, sizeof(*rep_objs), p ); do_insert( styles, sizeof(*styles), p ); do_insert( prototypes, sizeof(*prototypes), p ); do_insert( sort_funcs, sizeof(*sort_funcs), p ); do_insert( sort_info, sizeof(*sort_info), p ); do_insert( p2v, sizeof(*p2v), p ); } } void MiscTableBorder::insertAt( MiscCoord_V x, MiscCoord_P p ) { MISC_RANGE_CHECK_1( x ); needs_recalc = true; if (num_slots >= max_slots) setCapacity( max_slots + 1 ); do_insert( x, p ); if (v2p != 0) { for (int i = 0; i < num_slots; i++) { if (p2v[i] >= x) p2v[i]++; if (v2p[i] >= p) v2p[i]++; } } init_slot( x, p ); num_slots++; selection.shiftUpAt( x ); if (selected_slot >= x) selected_slot++; if (hasValidCursor() && cursor >= x) cursor++; if (clicked_slot >= x) clicked_slot++; } //----------------------------------------------------------------------------- // do_shift //----------------------------------------------------------------------------- void MiscTableBorder::do_shift( void* p, int n, int i, int j ) { if (p != 0) if (i < j) memmove( p + i * n, p + (i + 1) * n, (j - i) * n ); else memmove( p + (j + 1) * n, p + j * n, (i - j) * n ); } //----------------------------------------------------------------------------- // do_shift //----------------------------------------------------------------------------- void MiscTableBorder::do_shift( MiscCoord_V from, MiscCoord_V to ) { do_shift( slots, sizeof(*slots), from, to ); do_shift( v2p, sizeof(*v2p), from, to ); } //----------------------------------------------------------------------------- // alloc_vmap //----------------------------------------------------------------------------- void MiscTableBorder::alloc_vmap() { p2v = (MiscCoord_V*) do_alloc( sizeof(*p2v) ); v2p = (MiscCoord_P*) do_alloc( sizeof(*v2p) ); for (int i = 0; i < num_slots; i++) { p2v[i] = i; v2p[i] = i; } } //----------------------------------------------------------------------------- // moveFromTo //----------------------------------------------------------------------------- void MiscTableBorder::moveFromTo( MiscCoord_V from, MiscCoord_V to ) { MISC_RANGE_CHECK( from ); MISC_RANGE_CHECK( to ); bool const was_cursor = (cursor == from); bool const was_clicked_slot = (clicked_slot == from); bool const was_selected_slot = (selected_slot == from); bool const was_selected = selection.contains( from ); selection.shiftDownAt( from ); needs_recalc = true; MiscCoord_P const p = visualToPhysical( from ); MiscTableSlot const tmp_slot = slots ? slots[from] : def_slot; if (p2v == 0) alloc_vmap(); do_shift( from, to ); if (from < to) { for (int i = 0; i < num_slots; i++) if (from < p2v[i] && p2v[i] <= to) p2v[i]--; if (!was_cursor && from <= cursor && cursor >= to) cursor--; } else { for (int i = 0; i < num_slots; i++) if (to <= p2v[i] && p2v[i] < from) p2v[i]++; if (!was_cursor && from <= cursor && cursor >= to) cursor++; } p2v[p] = to; v2p[to] = p; if (slots != 0) slots[to] = tmp_slot; selection.shiftUpAt( to ); if (was_selected) selection.add( to ); if (was_selected_slot) setSelectedSlot( to ); if (was_clicked_slot) setClickedSlot( to ); if (was_cursor) cursor = to; } //----------------------------------------------------------------------------- // setCount //----------------------------------------------------------------------------- void MiscTableBorder::setCount( int x ) { setP2VMap(0); if (num_slots != x) { needs_recalc = true; int const old_slots = num_slots; num_slots = x; setCapacity( x ); // Only increases capacity, never decreases. if (old_slots < num_slots) { for (int i = old_slots; i < num_slots; i++) init_slot( i, i ); } else { NSCParameterAssert( old_slots <= max_slots ); num_slots = old_slots; for (int i = x; i < old_slots; i++) destroy_slot( i, visualToPhysical(i) ); num_slots = x; selection.remove( num_slots, old_slots ); if (selectedSlot() >= num_slots) fixSelectedSlot(); if (cursor >= num_slots) clearCursor(); if (clicked_slot >= num_slots) clearClickedSlot(); } } } //----------------------------------------------------------------------------- // good_map // 'map' is a good map if all the values are in-range, and no value // is repeated. A null map represents a normal sequential series. // 'onescomp' interprets negative values as the one's complement of a // slot number. //----------------------------------------------------------------------------- bool MiscTableBorder::good_map( int const* map, bool onescomp ) const { bool answer = true; int const lim = count(); if (lim > 0) { if (map != 0) { bool* seen = (bool*) calloc( sizeof(bool), lim ); for (int i = 0; i < lim; i++) { int x = map[i]; if (onescomp && x < 0) x = ~x; if ((unsigned int) x < (unsigned int)lim && !seen[i]) seen[i] = true; else { answer = false; break; } } free( seen ); } } return answer; } //----------------------------------------------------------------------------- // do_remap //----------------------------------------------------------------------------- void* MiscTableBorder::do_remap( void* p, int n, MiscCoord_V const* new_p2v ) { if (p != 0) { void* t = do_alloc( n ); for (int i = 0; i < num_slots; i++) memcpy( t + MISC_MAP(new_p2v,i) * n, p + MISC_MAP(p2v,i) * n, n ); free( p ); p = t; } return p; } //----------------------------------------------------------------------------- // do_remap //----------------------------------------------------------------------------- void MiscTableBorder::do_remap( MiscCoord_V const* new_p2v ) { if (num_slots > 0) slots = (MiscTableSlot*) do_remap( slots, sizeof(*slots), new_p2v ); } //----------------------------------------------------------------------------- // setP2VMap //----------------------------------------------------------------------------- bool MiscTableBorder::setP2VMap( MiscCoord_V const* new_p2v ) { if (good_map( (int const*) new_p2v, false )) { if (new_p2v != 0 || p2v != 0) { MiscSparseSet p_sel; visualToPhysical( selection, p_sel ); MiscCoord_P const p_selSlot = (selected_slot >= 0 ? visualToPhysical(selected_slot) : -1); needs_recalc = true; do_remap( new_p2v ); if (p2v == 0) { p2v = (MiscCoord_V*) do_alloc( sizeof(*p2v) ); v2p = (MiscCoord_P*) do_alloc( sizeof(*v2p) ); } if (new_p2v != 0 && p2v != 0) { for (int i = 0; i < num_slots; i++) v2p[new_p2v[i]] = i; memcpy( p2v, new_p2v, num_slots * sizeof(*p2v) ); } else if (new_p2v == 0) { free( p2v ); p2v = 0; free( v2p ); v2p = 0; } physicalToVisual( p_sel, selection ); selected_slot = (p_selSlot >= 0 ? physicalToVisual(p_selSlot) : -1); } return true; } return false; } //----------------------------------------------------------------------------- // setV2PMap //----------------------------------------------------------------------------- bool MiscTableBorder::setV2PMap( MiscCoord_P const* new_v2p ) { if (good_map( (int const*) new_v2p, false )) { if (new_v2p != 0 || v2p != 0) { if (new_v2p != 0) { MiscCoord_V* new_p2v = (MiscCoord_V*) malloc( sizeof(*new_p2v) * num_slots ); for (int i = 0; i < num_slots; i++) new_p2v[new_v2p[i]] = i; setP2VMap( new_p2v ); free( new_p2v ); } else setP2VMap( 0 ); } return true; } return false; } //----------------------------------------------------------------------------- // swapSlots //----------------------------------------------------------------------------- void MiscTableBorder::swapSlots( MiscCoord_P x, MiscCoord_P y ) { MISC_SWAP( MiscTableSlot, slots, x, y ) MISC_SWAP( int, tags, x, y ) MISC_SWAP( id, rep_objs, x, y ) MISC_SWAP( NSString*, titles, x, y ) MISC_SWAP( MiscTableCellStyle, styles, x, y ) MISC_SWAP( id, prototypes, x, y ) MISC_SWAP( MiscCompareEntryFunc, sort_funcs, x, y ) MISC_SWAP( int, sort_info, x, y ) do_recalc(); // offsets only. } //----------------------------------------------------------------------------- // setUniformSize //----------------------------------------------------------------------------- bool MiscTableBorder::setUniformSize( MiscPixels x ) { bool const changed = (uniform_size != x); if (changed) { needs_recalc = true; if (uniform_size == 0) // New, non-zero uniform size. { if (slots != 0) { free( slots ); slots = 0; } num_springy = 0; min_total_size = 0; } uniform_size = x; } return changed; } //----------------------------------------------------------------------------- // TOTAL SIZE //----------------------------------------------------------------------------- MiscPixels MiscTableBorder::totalSize() { if (num_slots == 0) return 0; else if (uniform_size != 0) return (uniform_size * num_slots); else { recalc_if_needed(); return getOffset( num_slots - 1 ) + effectiveSize( num_slots - 1 ); } } void MiscTableBorder::setMinTotalSize( MiscPixels x ) { if (min_total_size != x) { min_total_size = x; MISC_SIZE_CHECK( min_total_size ); needs_recalc = true; } } //----------------------------------------------------------------------------- // EFFECTIVE SIZE //----------------------------------------------------------------------------- MiscPixels MiscTableBorder::effectiveSize( MiscCoord_V x ) { MISC_RANGE_CHECK( x ); if (uniform_size != 0) return uniform_size; recalc_if_needed(); return MISC_SLOT_MEMBER( x, adj_size ); } MiscPixels MiscTableBorder::effectiveMinSize( MiscCoord_V x ) { MISC_RANGE_CHECK( x ); if (uniform_size != 0) return min_uniform_size; recalc_if_needed(); MiscTableSlot const& r = slots[x]; MiscPixels slot_min = r.min_size; MiscPixels global_min = min_total_size; for (int i = 0; i < num_slots; i++) { if (i != x) { MiscTableSlot& t = slots[i]; if (t.isSpringy()) global_min -= t.max_size; else global_min -= t.size; } } if (slot_min < global_min) slot_min = global_min; if (slot_min > r.adj_size) slot_min = r.adj_size; return slot_min; } //----------------------------------------------------------------------------- // alloc_slots //----------------------------------------------------------------------------- void MiscTableBorder::alloc_slots() { NSCParameterAssert( slots == 0 ); slots = (MiscTableSlot*) do_alloc( sizeof(*slots) ); for (int i = 0; i < num_slots; i++) slots[i] = def_slot; } //----------------------------------------------------------------------------- // OFFSETS //----------------------------------------------------------------------------- MiscCoord_V MiscTableBorder::find_slot_for_offset( MiscPixels x ) { NSCParameterAssert( num_slots > 0 ); int lo = 0; int hi = num_slots - 1; while (lo <= hi) { int const mid = (lo + hi) >> 1; if (slots[mid].offset <= x) lo = mid + 1; else hi = mid - 1; } if (lo > 0 && (lo >= num_slots || slots[lo].offset > x)) lo--; return lo; } MiscCoord_V MiscTableBorder::visualForOffset( MiscPixels x ) { MiscCoord_V i = -1; if (x >= 0 && num_slots > 0) { if (uniform_size != 0) { i = (MiscCoord_V) (x / uniform_size); } else { recalc_if_needed(); i = find_slot_for_offset( x ); } } if (i >= num_slots) i = num_slots - 1; return i; } MiscPixels MiscTableBorder::getOffset( MiscCoord_V x ) { if (num_slots == 0) return 0; MISC_RANGE_CHECK( x ); if (uniform_size != 0) return uniform_size * x; recalc_if_needed(); return MISC_SLOT_MEMBER( x, offset ); } //----------------------------------------------------------------------------- // SIZE //----------------------------------------------------------------------------- MiscPixels MiscTableBorder::getSize( MiscCoord_V x ) const { if (num_slots == 0) return 0; MISC_RANGE_CHECK( x ); if (uniform_size != 0) return uniform_size; return MISC_SLOT_MEMBER( x, size ); } void MiscTableBorder::setSize( MiscCoord_V x, MiscPixels n ) { MISC_RANGE_CHECK( x ); if (uniform_size == 0) MISC_SET_SLOT_MEMBER( x, n, size ); } MiscPixels MiscTableBorder::getMinSize( MiscCoord_V x ) const { MISC_RANGE_CHECK( x ); if (uniform_size != 0) return uniform_size; return MISC_SLOT_MEMBER( x, min_size ); } void MiscTableBorder::setMinSize( MiscCoord_V x, MiscPixels n ) { MISC_RANGE_CHECK( x ); if (uniform_size == 0) MISC_SET_SLOT_MEMBER( x, n, min_size ); } MiscPixels MiscTableBorder::getMaxSize( MiscCoord_V x ) const { MISC_RANGE_CHECK( x ); if (uniform_size != 0) return max_uniform_size; return MISC_SLOT_MEMBER( x, max_size ); } void MiscTableBorder::setMaxSize( MiscCoord_V x, MiscPixels n ) { MISC_RANGE_CHECK( x ); if (uniform_size == 0) MISC_SET_SLOT_MEMBER( x, n, max_size ); } //----------------------------------------------------------------------------- // SIZING //----------------------------------------------------------------------------- MiscTableSizing MiscTableBorder::getSizing( MiscCoord_V x ) const { MISC_RANGE_CHECK( x ); if (uniform_size != 0) return MISC_NUSER_NSPRINGY_SIZING; return MISC_SLOT_MEMBER( x, sizing ); } void MiscTableBorder::setSizing( MiscCoord_V x, MiscTableSizing n ) { MISC_RANGE_CHECK( x ); MISC_ENUM_CHECK( n, MISC_MAX_SIZING ); if (uniform_size == 0) { bool was_springy = ::isSpringy(getSizing(x)); bool is_springy = ::isSpringy(n); if (was_springy != is_springy) { if (was_springy) num_springy--; else num_springy++; needs_recalc = true; } MISC_SET_SLOT_MEMBER( x, n, sizing ); } } //----------------------------------------------------------------------------- // TITLES //----------------------------------------------------------------------------- void MiscTableBorder::dealloc_titles() { if (titles != 0) { for (int i = 0; i < num_slots; i++) if (titles[i] != 0) [titles[i] release]; free( titles ); titles = 0; } } void MiscTableBorder::alloc_titles() { titles = (NSString**) do_alloc_init( sizeof(*titles) ); } bool MiscTableBorder::setTitle_P( MiscCoord_P x, NSString* s ) { bool changed = false; if (getTitleMode() == MISC_CUSTOM_TITLE) { MISC_RANGE_CHECK( x ); NSString* const t = (titles ? titles[x] : 0); if (t != 0 || s != 0) { if (t == 0 || s == 0 || ![t isEqualToString:s]) { if (t != 0) [t autorelease]; if (titles == 0) alloc_titles(); titles[x] = [s copy]; changed = true; } } } return changed; } static inline void prepend_char( NSMutableString* s, char const c ) { NSString* cs = [NSString stringWithCString:&c length:1]; [s insertString:cs atIndex:0]; } static NSString* alpha_title( int x ) { NSMutableString* s = [[[NSMutableString alloc] init] autorelease]; if (x >= 26) { do { prepend_char( s, (x % 26) + 'A' ); x /= 26; } while (x >= 26); x--; } prepend_char( s, x + 'A' ); return s; } NSString* MiscTableBorder::getTitle_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); NSString* s = @""; switch (title_mode) { case MISC_NO_TITLE: break; case MISC_NUMBER_TITLE: s = [[NSNumber numberWithInt:x + 1] description]; break; case MISC_ALPHA_TITLE: s = alpha_title(x); break; case MISC_CUSTOM_TITLE: s = (titles != 0) ? (titles[x] != 0 ? titles[x] : @"") : @""; break; case MISC_DELEGATE_TITLE: s = [owner border:type getDelegateSlotTitle:x]; break; } return s; } bool MiscTableBorder::setTitleMode( MiscTableTitleMode x ) { MISC_ENUM_CHECK( x, MISC_MAX_TITLE ); bool const changed = (title_mode != x); if (changed) { dealloc_titles(); title_mode = x; } return changed; } //----------------------------------------------------------------------------- // TAGS //----------------------------------------------------------------------------- void MiscTableBorder::alloc_tags() { tags = (int*) do_alloc_init( sizeof(*tags) ); if (def_tag != 0) for (int i = 0; i < num_slots; i++) tags[i] = def_tag; } void MiscTableBorder::setTag_P( MiscCoord_P x, int n ) { MISC_RANGE_CHECK( x ); if (tags == 0) alloc_tags(); tags[x] = n; } int MiscTableBorder::getTag_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); return (tags != 0) ? tags[x] : def_tag; } //----------------------------------------------------------------------------- // REPRESENTED OBJECTS //----------------------------------------------------------------------------- void MiscTableBorder::alloc_represented_objects() { rep_objs = (id*) do_alloc_init( sizeof(*rep_objs) ); } void MiscTableBorder::setRepresentedObject_P( MiscCoord_P x, id n ) { MISC_RANGE_CHECK( x ); if (rep_objs == 0) alloc_represented_objects(); if (rep_objs[x] != 0) [rep_objs[x] autorelease]; rep_objs[x] = [n retain]; } id MiscTableBorder::getRepresentedObject_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); return (rep_objs != 0) ? rep_objs[x] : 0; } //----------------------------------------------------------------------------- // STYLES //----------------------------------------------------------------------------- void MiscTableBorder::alloc_styles() { styles = (MiscTableCellStyle*) do_alloc_init( sizeof(*styles) ); if ((int) def_style != 0) for (int i = 0; i < num_slots; i++) styles[i] = def_style; } void MiscTableBorder::setStyle_P( MiscCoord_P x, MiscTableCellStyle n ) { MISC_RANGE_CHECK( x ); MISC_ENUM_CHECK( n, MISC_TABLE_CELL_MAX ); if (styles == 0) alloc_styles(); styles[x] = n; } MiscTableCellStyle MiscTableBorder::getStyle_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); return (styles != 0) ? styles[x] : def_style; } //----------------------------------------------------------------------------- // PROTOTYPES //----------------------------------------------------------------------------- void MiscTableBorder::alloc_prototypes() { prototypes = (id*) do_alloc_init( sizeof(*prototypes) ); } id MiscTableBorder::new_prototype( MiscCoord_P x ) { NSZone* const zone = [owner zone]; id p = 0; switch (getStyle_P(x)) { case MISC_TABLE_CELL_TEXT: p = [[MiscTableCell allocWithZone:zone] initTextCell:@""]; break; case MISC_TABLE_CELL_IMAGE: p = [[MiscTableCell allocWithZone:zone] initImageCell: [[NSImage alloc] initWithSize:NSZeroSize]]; break; case MISC_TABLE_CELL_BUTTON: p = [[NSButtonCell allocWithZone:zone] initTextCell:@""]; break; case MISC_TABLE_CELL_CALLBACK: p = [[owner border:type getDelegateSlotPrototype:x] retain]; break; } return [p autorelease]; } id MiscTableBorder::getPrototype_P( MiscCoord_P x ) { MISC_RANGE_CHECK( x ); if (prototypes == 0) alloc_prototypes(); id p = prototypes[x]; if (p == 0) p = prototypes[x] = [new_prototype(x) retain]; return p; } void MiscTableBorder::setPrototype_P( MiscCoord_P x, id n ) { MISC_RANGE_CHECK( x ); if (prototypes == 0) alloc_prototypes(); if (prototypes[x] != 0) [prototypes[x] autorelease]; prototypes[x] = [n retain]; } //----------------------------------------------------------------------------- // SORT FUNCTIONS //----------------------------------------------------------------------------- void MiscTableBorder::alloc_sort_funcs() { sort_funcs = (MiscCompareEntryFunc*) do_alloc_init( sizeof(*sort_funcs) ); } void MiscTableBorder::setSortFunc_P( MiscCoord_P x, MiscCompareEntryFunc n ) { MISC_RANGE_CHECK( x ); if (sort_funcs == 0) alloc_sort_funcs(); sort_funcs[x] = n; } MiscCompareEntryFunc MiscTableBorder::getSortFunc_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); return (sort_funcs != 0) ? sort_funcs[x] : 0; } //----------------------------------------------------------------------------- // SORT INFO (TYPE + DIR) //----------------------------------------------------------------------------- void MiscTableBorder::alloc_sort_info() { sort_info = (int*) do_alloc_init( sizeof(*sort_info) ); } void MiscTableBorder::setSortType_P( MiscCoord_P x, MiscSortType n ) { MISC_RANGE_CHECK( x ); MISC_ENUM_CHECK( n, MISC_SORT_TYPE_MAX ); if (sort_info == 0) alloc_sort_info(); int const z = sort_info[x]; // Preserve direction. sort_info[x] = ((n << 1) | (z & 1)); } MiscSortType MiscTableBorder::getSortType_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); return (sort_info != 0) ? MiscSortType( sort_info[x] >> 1 ) : MISC_SORT_STRING_CASE_INSENSITIVE; } void MiscTableBorder::setSortDirection_P( MiscCoord_P x, MiscSortDirection n ) { MISC_RANGE_CHECK( x ); MISC_ENUM_CHECK( n, MISC_SORT_DIR_MAX ); if (sort_info == 0) alloc_sort_info(); int const z = sort_info[x]; // Preserve type. sort_info[x] = ((z & ~1) | (n & 1)); } MiscSortDirection MiscTableBorder::getSortDirection_P( MiscCoord_P x ) const { MISC_RANGE_CHECK( x ); return (sort_info != 0) ? MiscSortDirection( sort_info[x] & 1 ) : MISC_SORT_ASCENDING; } void MiscTableBorder::clearSortDirection() // Set all slots to ascending. { if (sort_info != 0) { int const* const plim = sort_info + count(); for (int* p = sort_info; p < plim; p++) *p &= ~1; } } //----------------------------------------------------------------------------- // DESTRUCTOR / CONSTRUCTOR //----------------------------------------------------------------------------- MiscTableBorder::~MiscTableBorder() { emptyAndFree(); } MiscTableBorder::MiscTableBorder( MiscBorderType x ) { MISC_ENUM_CHECK( x, MISC_MAX_BORDER ); memset( this, 0, sizeof(*this) ); type = x; clearSelectedSlot(); clearCursor(); clearClickedSlot(); if (type == MISC_ROW_BORDER) { uniform_size = MISC_FRAME_HEIGHT; def_slot.offset = 0; def_slot.size = uniform_size; def_slot.min_size = 10; def_slot.max_size = MISC_MAX_PIXELS_SIZE; def_slot.sizing = MISC_NUSER_NSPRINGY_SIZING; title_mode = MISC_NUMBER_TITLE; draggable = false; modifier_drag = true; sizeable = false; selectable = true; } else { def_slot.offset = 0; def_slot.size = 80; def_slot.min_size = 10; def_slot.max_size = MISC_MAX_PIXELS_SIZE; def_slot.sizing = MISC_USER_NSPRINGY_SIZING; uniform_size = 0; title_mode = MISC_CUSTOM_TITLE; draggable = true; modifier_drag = false; sizeable = true; selectable = false; } min_uniform_size = MISC_MIN_PIXELS_SIZE; max_uniform_size = MISC_MAX_PIXELS_SIZE; } MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableUtil.h100444 1750 1750 4753 6757227337 24141 0ustar sunshinesunshine#ifndef __MiscTableUtil_h #define __MiscTableUtil_h //============================================================================= // // Copyright (C) 1995-1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableUtil.h // // Common inline functions used by the MiscTableScroll object. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableUtil.h,v 1.4 98/03/29 23:57:54 sunshine Exp $ // $Log: MiscTableUtil.h,v $ // Revision 1.4 98/03/29 23:57:54 sunshine // v138.1: #import was missing "MiscTableScroll/" for public header. // // Revision 1.3 98/03/22 13:13:55 sunshine // v133.1: Eliminated data-sizing. // // Revision 1.2 97/11/23 07:39:45 sunshine // v130.1: Added MISC_ENUM_CHECK. //----------------------------------------------------------------------------- #include #include "bool.h" extern "Objective-C" { #import } inline MiscBorderType otherBorder( MiscBorderType t ) { return (t == MISC_COL_BORDER) ? MISC_ROW_BORDER : MISC_COL_BORDER; } inline bool isFixed( MiscTableSizing x ) { return x == MISC_NUSER_NSPRINGY_SIZING; } inline bool isSpringy( MiscTableSizing x ) { return (((int)x) & MISC_SIZING_SPRINGY_BIT) != 0; } inline bool isSizeable( MiscTableSizing x ) { return (((int)x) & MISC_SIZING_USER_BIT) != 0; } inline MiscTableSizing setAttribute( MiscTableSizing x, int bit, bool b ) { return (MiscTableSizing) (b ? ((int)x | bit) : ((int)x & ~bit)); } inline MiscTableSizing setSpringy( MiscTableSizing x, bool b ) { return setAttribute( x, MISC_SIZING_SPRINGY_BIT, b ); } inline MiscTableSizing setSizeable( MiscTableSizing x, bool b ) { return setAttribute( x, MISC_SIZING_USER_BIT, b ); } #define MISC_ENUM_CHECK(E,N)\ NSCParameterAssert((unsigned int)(E) <= (unsigned int)(N)) #endif // __MiscTableUtil_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableViewPS.psw100444 1750 1750 3361 6757227344 24753 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableViewPS.psw // // Fill rectangles with a "dash" pattern. Useful for drawing dotted // outlines which frame focused cells. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // MISC_TV_initps //----------------------------------------------------------------------------- defineps MISC_TV_initps() 7 dict dup begin /PatternType 1 def /PaintType 1 def /TilingType 1 def /BBox [0 0 2 2] def /XStep 2 def /YStep 2 def /PaintProc { begin 0 setgray 0 0 1 1 rectfill 1 1 1 1 rectfill end } def end matrix makepattern userdict exch /MISC_TV_dottedpattern exch put endps //----------------------------------------------------------------------------- // MISC_TV_dashedrects //----------------------------------------------------------------------------- defineps MISC_TV_dashedrects( float rects[n]; int n ) gsave MISC_TV_dottedpattern setpattern rects rectfill grestore endps MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScroll.M100444 1750 1750 177614 6757227334 24473 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScroll.M // // ScrollView class that displays a 2-D table of cells. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScroll.M,v 1.47 99/06/15 06:08:02 sunshine Exp $ // $Log: MiscTableScroll.M,v $ // Revision 1.47 99/06/15 06:08:02 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. Exposed to Java. // Fixed bug: -sizeToFit was not taking intercell grid spacing into account. // Fixed bug: -sizeToFit was incorrectly checking if cells responded to // -cellSize: rather than -cellSize. Consequently sizing failed completely. // Fixed bug: When registering delegate to receive standard control-text- // editing notifications, was incorrectly specifying MiscTableView as sender // even though MiscTableScroll actually sends them. Consequently delegates // were never receiving these notifications. // Fixed bug: -changeFont: was sending -convertFont: directly to the shared // NSFontManager rather than the "sender" as documented. // Removed unnecessary header #imports. // Added support for represented object: // -representedObject, -setRepresentedObject: // -border:slotRepresentedObject:, -border:setSlot:representedObject: // -columnRepresentedObject:, -setColumn:representedObject: // -rowRepresentedObject:, -setRow:representedObject: // -border:slotWithRepresentedObject: // -columnWithRepresentedObject: // -rowWithRepresentedObject: // -cellWithRepresentedObject: // -getRow:column:ofCellWithRepresentedObject: // For clarity and better OpenStep conformance, renamed: // -drawClippedText --> -drawsClippedText // -setDrawClippedText: --> -setDrawsClippedText: // -...ISearchColumn: --> -...IncrementalSearchColumn: // -select...:byExtension: --> -select...:byExtendingSelection: // -select{Slot|Row|Column}Tags: --> -select{Slots|Rows|Columns}WithTags: // -deselect{Slot|Row|Column}Tags: --> -deselect{Slots|Rows|Columns}WithTags: // -trackBy: --> setSelectsByRows: // -trackingBy --> selectsByRows // -tracking --> -isTrackingMouse // -stringForNSTabularTextPBoardType --> -stringForNSTabularTextPboardType // Renamed variable: tracking --> trackingMouse // Renamed variable: drawClippedText --> drawsClippedText // Java exposure requires a one-to-one mapping between Objective-C selectors // and Java methods. AppKit already has a method for moving columns around, // so MiscTableScroll has to match that name. For consistency renamed other // similar methods as well: // -border:moveSlotFrom:to: --> -border:moveSlot:toSlot: // -moveColumnFrom:to: --> -moveColumn:toColumn: // -moveRowFrom:to: --> moveRow:toRow: // -border:slotDraggedFrom:to: --> border:slotDragged:toSlot: // Added MiscTableScroll-specific notifications which are sent to the default // notification center in place of sending certain old-style delegate // messages. The delegates are automatically registered to listen for any // notifications which they can receive. Consequently renamed numerous // delegate messages to handle notifications: // -tableScroll:border:slotDraggedFrom:to: --> -tableScrollSlotDragged: // -tableScroll:border:slotResized: --> -tableScrollSlotResized: // -tableScroll:border:slotSortReversed: --> -tableScrollSlotSortReversed: // -tableScroll:changeFont:to: --> -tableScrollChangeFont: // -tableScroll:fontChangedFrom:to: --> -tableScrollFontChanged: // -tableScroll:...ColorChangedTo: --> -tableScroll...ColorChanged: // -tableScroll:willPrint: --> -tableScrollWillPrint: // -tableScroll:didPrint: --> -tableScrollDidPrint: // -tableScroll:willPrintPageHeader:info: --> -tableScrollWillPrintPageHeader: // -tableScroll:willPrintPageFooter:info: --> -tableScrollWillPrintPageFooter: // -tableScroll:willEditAtRow:column: --> -tableScrollWillEdit: // -tableScroll:didEdit:atRow:column: --> -tableScrollDidEdit: // Added -didBecomeFirstResponder & -didResignFirstResponder. These are sent // by MiscTableView to MiscTableScroll at appropriate times. When becoming // first responder, -didBecomeFirstResponder notifies NSFontManager of the // current font setting and sends the did-become-first-responder notification. // -didResignFirstResponder sends the did-resign-first-responder notification. // Added new delegate messages -tableScrollDidBecomeFirstResponder: and // -tableScrollDidResignFirstResponder:. // Return type of -numberOfSelected{Slots|Rows|Columns} changed from (unsigned // int) to (int) to be consistent with other similarly named methods. Also, // since Java only deals with signed numbers, unsigned int would have been // promoted to eight bytes on the Java side with is undesirable. // // Revision 1.46 1998/03/29 23:53:12 sunshine // v138.1: Removed useless 'if' from -borderSetSlotOrder:. // Fixed bug: Wasn't checking -canDraw before applying -lockFocus in: // -drawCellAtRow:column:, -drawRow:, -drawColumn:, -drawSlotTitle:. // Now uses NSColor's "system" colors for text, background, selected text, // selected background by default. // Worked around OPENSTEP 4.2 for NT bug where compiler crashes when sending // a message to 'super' from within a category. Bug afflicted // MiscTableScrollIO.M. // // Revision 1.45 98/03/23 21:41:42 sunshine // v137.1: -border:setSlotOrder: now accepts a null pointer or empty list to // "unsort" the slots. //----------------------------------------------------------------------------- #import #import #import "MiscColView.h" #import "MiscCornerView.h" #import "MiscRowView.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import "MiscTableView.h" #import extern "Objective-C" { #import #import #import #import // Control-text notifications #import #import #import } typedef MiscDelegateFlags DF; #define MISC_STRINGIFY(Q) #Q #define MISC_NOTIFICATION(Q) NSString* const MiscTableScroll##Q##Notification \ = @MISC_STRINGIFY(MiscTableScroll##Q##Notification) MISC_NOTIFICATION( SlotDragged ); MISC_NOTIFICATION( SlotSortReversed ); MISC_NOTIFICATION( SlotResized ); MISC_NOTIFICATION( ChangeFont ); MISC_NOTIFICATION( FontChanged ); MISC_NOTIFICATION( BackgroundColorChanged ); MISC_NOTIFICATION( SelectedBackgroundColorChanged ); MISC_NOTIFICATION( SelectedTextColorChanged ); MISC_NOTIFICATION( TextColorChanged ); MISC_NOTIFICATION( WillPrint ); MISC_NOTIFICATION( DidPrint ); MISC_NOTIFICATION( WillPrintPageHeader ); MISC_NOTIFICATION( WillPrintPageFooter ); MISC_NOTIFICATION( WillEdit ); MISC_NOTIFICATION( DidEdit ); MISC_NOTIFICATION( DidBecomeFirstResponder ); MISC_NOTIFICATION( DidResignFirstResponder ); #undef MISC_NOTIFICATION #undef MISC_STRINGIFY //----------------------------------------------------------------------------- // Delegate Notifications //----------------------------------------------------------------------------- static NSArray* DEL_NOTIFICATIONS = 0; // Array of MiscNotification objects. @interface MiscNotification : NSObject { DF::Selector selector; NSString* name; } + (MiscNotification*)notificationWithSelector:(DF::Selector)s name:(NSString*)n; - (id)initWithSelector:(DF::Selector)s name:(NSString*)n; - (void)dealloc; - (DF::Selector)selector; - (NSString*)name; @end @implementation MiscNotification + (MiscNotification*)notificationWithSelector:(DF::Selector)s name:(NSString*)n { return [[[self alloc] initWithSelector:s name:n] autorelease]; } - (id)initWithSelector:(DF::Selector)s name:(NSString*)n { [super init]; selector = s; name = [n retain]; return self; } - (void)dealloc { [name release]; [super dealloc]; } - (DF::Selector)selector { return selector; } - (NSString*)name { return name; } @end //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscTableScroll - (int)tag { return tag; } - (void)setTag:(int)x { tag = x; } - (id)representedObject { return representedObject; } - (void)setRepresentedObject:(id)p { if (p != representedObject) { [representedObject release]; representedObject = [p retain]; } } //----------------------------------------------------------------------------- // + registerNotifications //----------------------------------------------------------------------------- + (void)registerNotifications { #define NOTIFY(X,Y) \ [MiscNotification notificationWithSelector:(DF::DEL_ ## X) \ name:Y ## Notification] #define TX_NOTIFY(X,Y) NOTIFY(X, NSControlText ## Y) #define MY_NOTIFY(X,Y) NOTIFY(X, MiscTableScroll ## Y) DEL_NOTIFICATIONS = [[NSArray arrayWithObjects: MY_NOTIFY( SLOT_DRAGGED, SlotDragged ), MY_NOTIFY( SLOT_REVERSED, SlotSortReversed ), MY_NOTIFY( SLOT_RESIZED, SlotResized ), MY_NOTIFY( CHANGE_FONT, ChangeFont ), MY_NOTIFY( FONT_CHANGED, FontChanged ), MY_NOTIFY( BACK_COLOR_CHANGED, BackgroundColorChanged ), MY_NOTIFY( BACK_SEL_COLOR_CHANGED, SelectedBackgroundColorChanged ), MY_NOTIFY( BACK_SEL_COLOR_CHANGED, SelectedTextColorChanged ), MY_NOTIFY( TEXT_COLOR_CHANGED, TextColorChanged ), MY_NOTIFY( WILL_PRINT, WillPrint ), MY_NOTIFY( DID_PRINT, DidPrint ), MY_NOTIFY( PRINT_PAGE_HEADER, WillPrintPageHeader ), MY_NOTIFY( PRINT_PAGE_FOOTER, WillPrintPageFooter ), MY_NOTIFY( WILL_EDIT, WillEdit ), MY_NOTIFY( DID_EDIT, DidEdit ), TX_NOTIFY( TEXT_DID_END, DidEndEditing ), TX_NOTIFY( TEXT_DID_CHANGE, DidBeginEditing ), TX_NOTIFY( TEXT_DID_GET_KEYS, DidChange ), MY_NOTIFY( DID_BECOME_FIRST_RESP, DidBecomeFirstResponder ), MY_NOTIFY( DID_RESIGN_FIRST_RESP, DidResignFirstResponder ), 0] retain]; #undef TX_NOTIFY #undef MY_NOTIFY #undef NOTIFY } //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (void)initialize { if (self == [MiscTableScroll class]) { [self setVersion:MISC_TS_VERSION]; [self registerNotifications]; } } //----------------------------------------------------------------------------- // Multicast Messages //----------------------------------------------------------------------------- - (void)sendAction:(SEL)aSel to:(id)obj forAllCells:(BOOL)flag { int const rlim = num_rows; int const clim = num_cols; for (int r = 0; r < rlim; r++) for (int c = 0; c < clim; c++) if (flag || [self cellIsSelectedAtRow:r column:c]) if (![obj performSelector:aSel withObject:[self cellAtRow:r column:c]]) break; } - (int)makeCellsPerformSelector:(SEL)s with:(id)p1 with:(id)p2 selectedOnly:(BOOL)f { int count = 0; int const rlim = num_rows; int const clim = num_cols; for (int r = 0; r < rlim; r++) for (int c = 0; c < clim; c++) if (!f || [self cellIsSelectedAtRow:r column:c]) { id cell = [self cellAtRow:r column:c]; if ([cell respondsToSelector:s]) if ([cell performSelector:s withObject:p1 withObject:p2]) count++; else return count; } return count; } - (int)makeCellsPerformSelector:(SEL)aSel with:(id)p1 selectedOnly:(BOOL)flag { return [self makeCellsPerformSelector:aSel with:p1 with:0 selectedOnly:flag]; } - (int)makeCellsPerformSelector:(SEL)aSel selectedOnly:(BOOL)flag { return [self makeCellsPerformSelector:aSel with:0 with:0 selectedOnly:flag]; } - (int)makeCellsPerformSelector:(SEL)aSel { return [self makeCellsPerformSelector:aSel selectedOnly:NO]; } - (int)makeCellsPerformSelector:(SEL)aSel with:(id)p1 { return [self makeCellsPerformSelector:aSel with:p1 selectedOnly:NO]; } - (int)makeCellsPerformSelector:(SEL)aSel with:(id)p1 with:(id)p2 { return [self makeCellsPerformSelector:aSel with:p1 with:p2 selectedOnly:NO];} //----------------------------------------------------------------------------- // FINDING CELLS //----------------------------------------------------------------------------- - (int)border:(MiscBorderType)b slotWithTag:(int)x { int const lim = (int) [self numberOfSlots:b]; for (int i = 0; i < lim; i++) if ([self border:b slotTag:i] == x) return i; return -1; } - (int)columnWithTag:(int)x { return [self border:MISC_COL_BORDER slotWithTag:x]; } - (int)rowWithTag:(int)x { return [self border:MISC_ROW_BORDER slotWithTag:x]; } - (int)border:(MiscBorderType)b slotWithRepresentedObject:(id)x { int const lim = (int) [self numberOfSlots:b]; for (int i = 0; i < lim; i++) if ([x isEqual:[self border:b slotRepresentedObject:i]]) return i; return -1; } - (int)columnWithRepresentedObject:(id)x { return [self border:MISC_COL_BORDER slotWithRepresentedObject:x]; } - (int)rowWithRepresentedObject:(id)x { return [self border:MISC_ROW_BORDER slotWithRepresentedObject:x]; } - (BOOL)getRow:(int*)row column:(int*)col ofCell:(NSCell*)cell { int const NRows = [self numberOfRows]; int const NCols = [self numberOfColumns]; for (int r = 0; r < NRows; r++) for (int c = 0; c < NCols; c++) if ([self cellAtRow:r column:c] == cell) { *row = r; *col = c; return YES; } *row = -1; *col = -1; return NO; } - (BOOL)getRow:(int*)row column:(int*)col ofCellWithTag:(int)x { int const NRows = [self numberOfRows]; int const NCols = [self numberOfColumns]; for (int r = 0; r < NRows; r++) for (int c = 0; c < NCols; c++) { id const cell = [self cellAtRow:r column:c]; if (cell && [cell respondsToSelector:@selector(tag)] && [cell tag] == x) { *row = r; *col = c; return YES; } } *row = -1; *col = -1; return NO; } - (id)cellWithTag:(int)x { int r, c; return ([self getRow:&r column:&c ofCellWithTag:x] ? [self cellAtRow:r column:c] : 0); } - (BOOL)getRow:(int*)row column:(int*)col ofCellWithRepresentedObject:(id)x { int const NRows = [self numberOfRows]; int const NCols = [self numberOfColumns]; for (int r = 0; r < NRows; r++) for (int c = 0; c < NCols; c++) { id const cell = [self cellAtRow:r column:c]; if (cell && [cell respondsToSelector:@selector(representedObject)] && [x isEqual:[cell representedObject]]) { *row = r; *col = c; return YES; } } *row = -1; *col = -1; return NO; } - (id)cellWithRepresentedObject:(id)x { int r, c; return ([self getRow:&r column:&c ofCellWithRepresentedObject:x] ? [self cellAtRow:r column:c] : 0); } //----------------------------------------------------------------------------- // - documentClipRect //----------------------------------------------------------------------------- - (NSRect)documentClipRect { return [[self contentView] frame]; } //----------------------------------------------------------------------------- // Delegate Stuff //----------------------------------------------------------------------------- - (void)registerDelegateNotifications:(id)del flags:(MiscDelegateFlags const*)flags { NSNotificationCenter* const nc = [NSNotificationCenter defaultCenter]; for (unsigned int i = [DEL_NOTIFICATIONS count]; i-- > 0; ) { MiscNotification* const n = [DEL_NOTIFICATIONS objectAtIndex:i]; DF::Selector const s = [n selector]; if (flags->respondsTo(s)) [nc addObserver:del selector:flags->selToObjc(s) name:[n name] object:self]; } } - (void)cancelDelegateNotifications:(id)del flags:(MiscDelegateFlags const*)flags { NSNotificationCenter* const nc = [NSNotificationCenter defaultCenter]; for (unsigned int i = [DEL_NOTIFICATIONS count]; i-- > 0; ) { MiscNotification* const n = [DEL_NOTIFICATIONS objectAtIndex:i]; if (flags->respondsTo( [n selector] )) [nc removeObserver:del name:[n name] object:self]; } } - (void)replaceDelegate:(id*)old_del with:(id)new_del flags:(MiscDelegateFlags*)flags { if (*old_del != 0) [self cancelDelegateNotifications:*old_del flags:flags]; *old_del = new_del; flags->setDelegate( new_del ); if (new_del != 0) [self registerDelegateNotifications:new_del flags:flags]; } - (id)delegate { return delegate; } - (id)dataDelegate { return dataDelegate; } - (void)setDelegate:(id)obj { [self replaceDelegate:&delegate with:obj flags:delegateFlags]; } - (void)setDataDelegate:(id)obj { [self replaceDelegate:&dataDelegate with:obj flags:dataDelegateFlags]; } - (id)responsibleDelegate:(DF::Selector)cmd { id del = 0; if (delegate != 0 && delegateFlags->respondsTo(cmd)) del = delegate; else if (dataDelegate != 0 && dataDelegateFlags->respondsTo(cmd)) del = dataDelegate; return del; } //----------------------------------------------------------------------------- // - freeBorder: //----------------------------------------------------------------------------- - (void)freeBorder:(MiscBorderInfo*)p { [p->view removeFromSuperview]; [p->view release]; [p->clip removeFromSuperview]; [p->clip release]; delete p->border; } //----------------------------------------------------------------------------- // - dealloc //----------------------------------------------------------------------------- - (void)dealloc { NSWindow* win = [self window]; if (win != 0 && [win firstResponder] == tableView) [win makeFirstResponder:win]; [self emptyAndReleaseCells]; [cornerView removeFromSuperview]; [cornerView release]; [tableView removeFromSuperview]; [tableView release]; [self freeBorder:&colInfo]; [self freeBorder:&rowInfo]; if (delegate != 0) [self cancelDelegateNotifications:delegate flags:delegateFlags]; if (dataDelegate != 0) [self cancelDelegateNotifications:dataDelegate flags:dataDelegateFlags]; delete delegateFlags; delete dataDelegateFlags; [representedObject release]; [super dealloc]; } //----------------------------------------------------------------------------- // - totalSize / totalWidth / totalHeight //----------------------------------------------------------------------------- - (float)totalSize:(MiscBorderType)b { return (float) info[b]->border->totalSize(); } - (float)totalWidth { return [self totalSize:MISC_COL_BORDER]; } - (float)totalHeight { return [self totalSize:MISC_ROW_BORDER]; } //----------------------------------------------------------------------------- // - constrainSize //----------------------------------------------------------------------------- - (void)constrainSize { MiscTableBorder* b; NSRect r = [self documentClipRect]; b = colInfo.border; if (b->numSpringy() != 0) b->setMinTotalSize( (MiscPixels) r.size.width ); b = rowInfo.border; if (b->numSpringy() != 0) b->setMinTotalSize( (MiscPixels) r.size.height ); [rowInfo.view adjustSize]; [colInfo.view adjustSize]; [tableView adjustSize]; } //----------------------------------------------------------------------------- // - sizeToCells //----------------------------------------------------------------------------- - (void)sizeToCells { [self constrainSize]; } //----------------------------------------------------------------------------- // set_sizes //----------------------------------------------------------------------------- static void set_sizes( MiscTableBorder* b, float const* v, float lim ) { int const n = b->count(); if (!b->isUniformSize()) { for (int i = 0; i < n; i++) { MiscPixels x = (MiscPixels) v[i]; MiscPixels const xmin = b->getMinSize_P(i); MiscPixels const xmax = b->getMaxSize_P(i); if (x < xmin) x = xmin; if (x > xmax) x = xmax; b->setSize_P( i, (MiscPixels) x ); } } else if (lim != 0) b->setUniformSize( (MiscPixels) lim ); } //----------------------------------------------------------------------------- // - sizeToFit //----------------------------------------------------------------------------- - (void)sizeToFit { float const BORDER_THICKNESS = 1; float* const vw = (float*)calloc( (num_rows + num_cols), sizeof(*vw) ); float* const vh = vw + num_cols; float max_h = 0; float max_w = 0; for (int r = 0; r < num_rows; r++) { float h = 0; for (int c = 0; c < num_cols; c++) { id const cell = [self cellAtRow:r column:c]; if (cell != 0 && [cell respondsToSelector:@selector(cellSize)]) { NSSize sz = [cell cellSize]; sz.width = ceil( sz.width + BORDER_THICKNESS ); sz.height = ceil( sz.height + BORDER_THICKNESS ); if (vw[c] < sz.width) vw[c] = sz.width; if (max_w < sz.width) max_w = sz.width; if (h < sz.height) h = sz.height; } } if (vh[r] < h) vh[r] = h; if (max_h < h) max_h = h; } set_sizes( colInfo.border, vw, max_w ); set_sizes( rowInfo.border, vh, max_h ); free( vw ); [self sizeToCells]; } //----------------------------------------------------------------------------- // - setFrameSize: //----------------------------------------------------------------------------- - (void)setFrameSize:(NSSize)s { [super setFrameSize:s]; [self constrainSize]; } //----------------------------------------------------------------------------- // - forwardBGColor //----------------------------------------------------------------------------- - (void)forwardBGColor { [super setBackgroundColor:backgroundColor]; [colInfo.clip setBackgroundColor:backgroundColor]; [rowInfo.clip setBackgroundColor:backgroundColor]; } //----------------------------------------------------------------------------- // - initBorder:type: //----------------------------------------------------------------------------- - (void)initBorder:(MiscBorderInfo*)p type:(MiscBorderType)type { NSZone* const z = [self zone]; if (p->border == 0) p->border = new( NSZoneMalloc(z,sizeof(*(p->border))) ) MiscTableBorder( type ); p->border->setOwner( self ); if (type == MISC_COL_BORDER) p->view = [[MiscColView allocWithZone:z] initWithFrame:NSZeroRect scroll:self info:p->border]; else p->view = [[MiscRowView allocWithZone:z] initWithFrame:NSZeroRect scroll:self info:p->border]; p->clip = [[NSClipView allocWithZone:z] initWithFrame:NSZeroRect]; [p->clip setDocumentView:p->view]; if (p->isOn) { [self addSubview:p->clip]; [[self window] invalidateCursorRectsForView:p->view]; } } //----------------------------------------------------------------------------- // - doInit:cornerTitle: //----------------------------------------------------------------------------- - (void)doInit:(int)ver cornerTitle:(NSString*)s { editInfo.editing = NO; trackingMouse = NO; [self setBorderType:NSBezelBorder]; [super setHasHorizontalScroller:YES]; [super setHasVerticalScroller:YES]; info[ MISC_COL_BORDER ] = &colInfo; info[ MISC_ROW_BORDER ] = &rowInfo; [self initBorder:&colInfo type:MISC_COL_BORDER]; [self initBorder:&rowInfo type:MISC_ROW_BORDER]; NSZone* const z = [self zone]; delegateFlags = new( NSZoneMalloc(z,sizeof(*delegateFlags)) ) MiscDelegateFlags; dataDelegateFlags = new( NSZoneMalloc(z,sizeof(*dataDelegateFlags)) ) MiscDelegateFlags; tableView = [[MiscTableView allocWithZone:z] initWithFrame:NSZeroRect scroll:self colInfo:colInfo.border rowInfo:rowInfo.border]; cornerView = [[MiscCornerView allocWithZone:z] initWithFrame:NSZeroRect]; [self setCornerTitle:s]; if (colInfo.isOn && rowInfo.isOn) [self addSubview:cornerView]; [self setDocumentView:tableView]; [self tile]; [self constrainSize]; [self forwardBGColor]; [self registerServicesTypes]; } //----------------------------------------------------------------------------- // - initWithFrame: //----------------------------------------------------------------------------- - (id)initWithFrame:(NSRect)frameRect { [super initWithFrame:frameRect]; tag = 0; enabled = YES; delegate = 0; dataDelegate = 0; representedObject = 0; colInfo.border = 0; colInfo.isOn = YES; rowInfo.border = 0; rowInfo.isOn = NO; id classObj = [self class]; font = [[classObj defaultFont] retain]; textColor = [[classObj defaultTextColor] retain]; backgroundColor = [[classObj defaultBackgroundColor] retain]; selectedTextColor = [[classObj defaultSelectedTextColor] retain]; selectedBackgroundColor = [[classObj defaultSelectedBackgroundColor] retain]; [self doInit:MISC_TS_VERSION cornerTitle:@""]; return self; } //----------------------------------------------------------------------------- // - setFrame: //----------------------------------------------------------------------------- - (void)setFrame:(NSRect)frameRect { [super setFrame:frameRect]; [self constrainSize]; } //----------------------------------------------------------------------------- // - tile //----------------------------------------------------------------------------- - (void)tile { static NSClipView* dummy = 0; if (dummy == 0) dummy = [[NSClipView alloc] initWithFrame:NSZeroRect]; NSClipView* const old = [self contentView]; _contentView = dummy; [super tile]; _contentView = old; NSRect docRect = [dummy frame]; if (colInfo.isOn != rowInfo.isOn) // One on, one off. { MiscBorderInfo& b = (colInfo.isOn ? colInfo : rowInfo); NSRectEdge const edge = (colInfo.isOn ? NSMinYEdge : NSMinXEdge); float height = [b.view frameHeight]; NSRect rect; NSDivideRect( docRect, &rect, &docRect, height, edge ); [b.clip setFrame:rect]; [[self contentView] setFrame:docRect]; [[self window] invalidateCursorRectsForView:b.view]; } else if (colInfo.isOn && rowInfo.isOn) // Both on. { float colHeight = [colInfo.view frameHeight]; float rowWidth = [rowInfo.view frameHeight]; NSRect gapRect; NSRect colRect; NSRect rowRect; NSDivideRect( docRect, &colRect, &docRect, colHeight, NSMinYEdge ); NSDivideRect( colRect, &gapRect, &colRect, rowWidth, NSMinXEdge ); NSDivideRect( docRect, &rowRect, &docRect, rowWidth, NSMinXEdge ); [cornerView setFrame:gapRect]; [colInfo.clip setFrame:colRect]; [rowInfo.clip setFrame:rowRect]; [[self contentView] setFrame:docRect]; [[self window] invalidateCursorRectsForView:colInfo.view]; [[self window] invalidateCursorRectsForView:rowInfo.view]; } else // Both off. { [[self contentView] setFrame:docRect]; } } //----------------------------------------------------------------------------- // - reflectScroll: //----------------------------------------------------------------------------- - (void)reflectScrolledClipView:(NSClipView*)aView { if (aView == [self contentView]) // only reflect position of contentView [super reflectScrolledClipView:aView]; } //----------------------------------------------------------------------------- // - scrollClip:to: //----------------------------------------------------------------------------- - (void)scrollClipView:(NSClipView*)aClipView toPoint:(NSPoint)aPoint { if (aClipView == [self contentView]) // contentView only. { NSRect rect; NSWindow* win = [self window]; [win disableFlushWindow]; [aClipView scrollToPoint:aPoint]; // Scroll content if (colInfo.isOn) { rect = [colInfo.clip bounds]; // Maybe scroll col headings. if (rect.origin.x != aPoint.x) { rect.origin.x = aPoint.x; [colInfo.clip scrollToPoint:rect.origin]; [[self window] invalidateCursorRectsForView:colInfo.view]; } } if (rowInfo.isOn) { rect = [rowInfo.clip bounds]; // Maybe scroll row labels. if (rect.origin.y != aPoint.y) { rect.origin.y = aPoint.y; [rowInfo.clip scrollToPoint:rect.origin]; [[self window] invalidateCursorRectsForView:rowInfo.view]; } } [win enableFlushWindow]; [win flushWindow]; } else { BOOL ok = YES; NSView* const cv = [self contentView]; NSRect rect = [cv bounds]; if (aClipView == (id)colInfo.clip) rect.origin.x = aPoint.x; else if (aClipView == (id)rowInfo.clip) rect.origin.y = aPoint.y; else ok = NO; if (ok) { [self scrollClipView:cv toPoint:rect.origin]; [self reflectScrolledClipView:cv]; } } } //----------------------------------------------------------------------------- // First Responder notifications //----------------------------------------------------------------------------- - (void)didBecomeFirstResponder { [[NSFontManager sharedFontManager] setSelectedFont:[self font] isMultiple:NO]; [[NSNotificationCenter defaultCenter] postNotificationName:MiscTableScrollDidBecomeFirstResponderNotification object:self userInfo:0]; } - (void)didResignFirstResponder { [[NSNotificationCenter defaultCenter] postNotificationName:MiscTableScrollDidResignFirstResponderNotification object:self userInfo:0]; } //----------------------------------------------------------------------------- // Border stuff //----------------------------------------------------------------------------- - (NSString*)border:(MiscBorderType)b getDelegateSlotTitle:(int)slot { id del = [self responsibleDelegate:DF::DEL_SLOT_TITLE]; if (del != 0) return [del tableScroll:self border:b slotTitle:slot]; NSString* s = @""; return s; } - (id)border:(MiscBorderType)b getDelegateSlotPrototype:(int)s { id del = [self responsibleDelegate:DF::DEL_SLOT_PROTOTYPE]; if (del != 0) return [del tableScroll:self border:b slotPrototype:s]; return 0; } - (void)border:(MiscBorderType)b slotDragged:(int)fromPos toSlot:(int)toPos { MiscBorderType const ob = otherBorder(b); if ([self autoSortSlots:ob]) { int const slot = [self border:b slotAtPosition:toPos]; if ([self border:b slotSortType:slot] != MISC_SORT_SKIP || [self border:b slotSortFunction:slot] != 0) [self sortSlots:ob]; // Don't resort if it doesn't affect ordering. } [[NSNotificationCenter defaultCenter] postNotificationName:MiscTableScrollSlotDraggedNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:b], @"Border", [NSNumber numberWithInt:fromPos], @"OldSlot", [NSNumber numberWithInt:toPos], @"NewSlot", 0]]; } - (void)border:(MiscBorderType)b slotSortReversed:(int)n { MiscBorderType const ob = otherBorder(b); if ([self autoSortSlots:ob]) [self sortSlots:ob]; // Assume it affects sorting. int const phys = [self border:b slotAtPosition:n]; [[NSNotificationCenter defaultCenter] postNotificationName:MiscTableScrollSlotSortReversedNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:b], @"Border", [NSNumber numberWithInt:phys], @"Slot", 0]]; } - (void)border:(MiscBorderType)b slotResized:(int)n { int const phys = [self border:b slotAtPosition:n]; [[NSNotificationCenter defaultCenter] postNotificationName:MiscTableScrollSlotResizedNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:b], @"Border", [NSNumber numberWithInt:phys], @"Slot", 0]]; } //----------------------------------------------------------------------------- // Target / Action //----------------------------------------------------------------------------- - (id)target { return target; } - (void)setTarget:(id)obj { target = obj; } - (id)doubleTarget { return doubleTarget; } - (void)setDoubleTarget:(id)obj { doubleTarget = obj; } - (SEL)action { return action; } - (void)setAction:(SEL)new_sel { action = new_sel; } - (void)setDoubleAction:(SEL)new_sel { doubleAction = new_sel; } - (SEL)doubleAction { return doubleAction; } - (BOOL)sendAction:(SEL)aSel to:(id)obj { if (aSel == 0) aSel = action; if (obj == 0) obj = target; return [NSApp sendAction:aSel to:obj from:self]; } - (BOOL)sendAction { return [self sendAction:action to:target]; } - (BOOL)sendDoubleAction { return [self sendAction:doubleAction to:doubleTarget]; } - (BOOL)sendActionIfEnabled { if ([self isEnabled]) { [self sendAction]; return YES; } return NO; } - (BOOL)sendDoubleActionIfEnabled { if ([self isEnabled]) { [self sendDoubleAction]; return YES; } return NO; } //----------------------------------------------------------------------------- // FONT //----------------------------------------------------------------------------- + (NSFont*)defaultFont { return [NSFont userFontOfSize:12.0]; } - (NSFont*)font { return font; } static double get_height( NSFont* font ) { double const LINE_SPACING = 1.20; double const size = [font pointSize]; return size * LINE_SPACING; } - (void)setFont:(NSFont*)newFont { if (![newFont isEqual:font]) { NSFont* oldFont = [font autorelease]; font = [newFont retain]; float old_size = [self uniformSizeRows]; if (old_size != 0) { // FIXME: Handle this better. Different cell-types will have // different amounts of "fixed-size" border stuff. float const BORDER_THICKNESS = 1; old_size -= BORDER_THICKNESS; float const new_size = floor( 0.5 + (double(old_size) * (get_height( newFont ) / get_height( oldFont )))); if (new_size != old_size) [self setUniformSizeRows:(new_size + BORDER_THICKNESS)]; } // FIXME: Set font in all existing prototype cells. // WARNING: Currently, just asking the border for a prototype // in a given slot allocates and initializes an array of prototypes. if (![self isLazy]) // Eager beaver sets all cells now. { int const NRows = num_rows; int const NCols = num_cols; for (int r = 0; r < NRows; r++) { for (int c = 0; c < NCols; c++) { id cell = [self cellAtRow:r column:c]; if (cell != 0) { if ([cell respondsToSelector:@selector(setOwnerFont:)]) [cell setOwnerFont:newFont]; else if ([cell respondsToSelector:@selector(setFont:)]) [cell setFont:newFont]; } } } } [[NSNotificationCenter defaultCenter] postNotificationName:MiscTableScrollFontChangedNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys: oldFont, @"OldFont", newFont, @"NewFont", 0]]; [self setNeedsDisplay:YES]; } } - (void)changeFont:(id)sender { NSFont* newFont = [sender convertFont:[sender selectedFont]]; if (newFont != 0 && ![newFont isEqual:font]) { [self suspendEditing]; NSFont* oldFont = [[font retain] autorelease]; [self setFont:newFont]; [[NSNotificationCenter defaultCenter] postNotificationName:MiscTableScrollChangeFontNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys: oldFont, @"OldFont", newFont, @"NewFont", 0]]; if (editInfo.editing) [editInfo.cell setFont:newFont]; [self resumeEditing]; } } //----------------------------------------------------------------------------- // COLOR // // The following macros expand into the implementations for these functions. // Their names are listed so they can be found when searched for. // setBackgroundColor:, setTextColor:, setSelectedBackgroundColor:, // setSelectedTextColor: //----------------------------------------------------------------------------- + (NSColor*)defaultBackgroundColor { return [NSColor controlBackgroundColor];} + (NSColor*)defaultTextColor { return [NSColor controlTextColor]; } + (NSColor*)defaultSelectedBackgroundColor { return [NSColor selectedControlColor]; } + (NSColor*)defaultSelectedTextColor { return [NSColor selectedControlTextColor]; } - (NSColor*)backgroundColor { return backgroundColor; } - (NSColor*)textColor { return textColor; } - (NSColor*)selectedBackgroundColor { return selectedBackgroundColor; } - (NSColor*)selectedTextColor { return selectedTextColor; } - (void)setColor:(NSColor*)value { [self setBackgroundColor:value]; } - (NSColor*)color { return [self backgroundColor]; } - (void)setColor:(NSColor*)x // New color value var:(NSColor**)v // Instance variable for the color sel1:(SEL)sel1 // "setOwner...Color:" message for cell sel2:(SEL)sel2 // "set...Color:" message for cell notification:(NSString*)notification // "...ColorChangedNotification" { if (![x isEqual:*v]) { [*v autorelease]; *v = [x retain]; if (v == &backgroundColor) [self forwardBGColor]; if (![self isLazy]) { int const NRows = num_rows; int const NCols = num_cols; for (int r = 0; r < NRows; r++) for (int c = 0; c < NCols; c++) { id cell = [self cellAtRow:r column:c]; if (cell != 0) { if ([cell respondsToSelector:sel1]) (*[cell methodForSelector:sel1])( cell, sel1, x ); else if ([cell respondsToSelector:sel2]) (*[cell methodForSelector:sel2])( cell, sel2, x ); } } } [[NSNotificationCenter defaultCenter] postNotificationName:notification object:self userInfo: [NSDictionary dictionaryWithObjectsAndKeys:x, @"Color", 0]]; [self setNeedsDisplay:YES]; } } #define MISC_SET_COLOR_FUNC(LNAME,CNAME)\ - (void)set##CNAME##Color:(NSColor*)value\ { [self setColor:value\ var:& LNAME##Color\ sel1:@selector(setOwner##CNAME##Color:)\ sel2:@selector(set##CNAME##Color:)\ notification:MiscTableScroll##CNAME##ColorChangedNotification]; } MISC_SET_COLOR_FUNC( background, Background ) MISC_SET_COLOR_FUNC( text, Text ) MISC_SET_COLOR_FUNC( selectedBackground, SelectedBackground ) MISC_SET_COLOR_FUNC( selectedText, SelectedText ) #undef MISC_SET_COLOR_FUNC //============================================================================= // SAVE / RESTORE //============================================================================= - (NSString*)stringFromIntArray:(NSArray*)array { NSMutableString* s = [[[NSMutableString alloc] init] autorelease]; for (int i = 0, lim = [array count]; i < lim; i++) { if (i > 0) [s appendString:@" "]; [s appendString:[[array objectAtIndex:i] stringValue]]; } return s; } - (NSArray*)intArrayFromString:(NSString*)s { NSMutableArray* array = [NSMutableArray array]; NSScanner* scanner = [NSScanner scannerWithString:s]; int i; while (![scanner isAtEnd]) if ([scanner scanInt:&i]) [array addObject:[NSNumber numberWithInt:i]]; return array; } //----------------------------------------------------------------------------- // SLOT ORDER //----------------------------------------------------------------------------- - (NSArray*)slotOrder:(MiscBorderType)b { NSMutableArray* array = [NSMutableArray array]; MiscTableBorder const* const bp = info[b]->border; MiscCoord_P const* const vmap = bp->getP2VMap(); int const lim = bp->count(); for (int i = 0; i < lim; i++) { int v = (vmap ? vmap[i] : i); if (bp->getSortDirection(v) == MISC_SORT_DESCENDING) v = ~v; [array addObject:[NSNumber numberWithInt:v]]; } return array; } - (NSArray*)columnOrder { return [self slotOrder:MISC_COL_BORDER]; } - (NSArray*)rowOrder { return [self slotOrder:MISC_ROW_BORDER]; } - (BOOL)border:(MiscBorderType)b setSlotOrder:(NSArray*)array { BOOL ret = NO; MiscTableBorder* const bp = info[b]->border; if (array != 0 && [array count] != 0) { unsigned int const lim = bp->count(); if ([array count] == lim) { unsigned int const nbytes = lim * sizeof(int) + lim * sizeof(bool); int* const map = (int*) malloc( nbytes ); NSParameterAssert( map != 0 ); bool* const desc = (bool*) (map + lim); for (unsigned int i = 0; i < lim; i++) { int const j = [[array objectAtIndex:i] intValue]; map[i] = (desc[i] = (j < 0)) ? ~j : j; } if (bp->setP2VMap( map )) { for (unsigned int i = 0; i < lim; i++) { MiscSortDirection const dir = (desc[i] ? MISC_SORT_DESCENDING : MISC_SORT_ASCENDING); if (dir != bp->getSortDirection( map[i] )) bp->setSortDirection( map[i], dir ); } MiscBorderType const ob = otherBorder(b); if ([self autoSortSlots:ob]) [self sortSlots:ob]; ret = YES; } free( map ); } } else { bp->setP2VMap(0); bp->clearSortDirection(); ret = YES; } return ret; } - (BOOL)setColumnOrder:(NSArray*)list { return [self border:MISC_COL_BORDER setSlotOrder:list]; } - (BOOL)setRowOrder:(NSArray*)list { return [self border:MISC_ROW_BORDER setSlotOrder:list]; } - (NSString*)slotOrderAsString:(MiscBorderType)b { return [self stringFromIntArray:[self slotOrder:b]]; } - (NSString*)columnOrderAsString; { return [self slotOrderAsString:MISC_COL_BORDER]; } - (NSString*)rowOrderAsString { return [self slotOrderAsString:MISC_ROW_BORDER]; } - (BOOL)border:(MiscBorderType)b setSlotOrderFromString:(NSString*)s { return [self border:b setSlotOrder:[self intArrayFromString:s]]; } - (BOOL)setColumnOrderFromString:(NSString*)s { return [self border:MISC_COL_BORDER setSlotOrderFromString:s]; } - (BOOL)setRowOrderFromString:(NSString*)s { return [self border:MISC_ROW_BORDER setSlotOrderFromString:s]; } //----------------------------------------------------------------------------- // SLOT SIZES //----------------------------------------------------------------------------- - (NSArray*)slotSizes:(MiscBorderType)b { NSMutableArray* array = [NSMutableArray array]; MiscTableBorder const* const bp = info[b]->border; int const lim = bp->count(); for (int i = 0; i < lim; i++) [array addObject:[NSNumber numberWithInt:(int)bp->getSize_P(i)]]; return array; } - (NSArray*)columnSizes { return [self slotSizes:MISC_COL_BORDER]; } - (NSArray*)rowSizes { return [self slotSizes:MISC_ROW_BORDER]; } - (BOOL)border:(MiscBorderType)b setSlotSizes:(NSArray*)array { BOOL ret = NO; if (array != 0) { MiscTableBorder* const bp = info[b]->border; unsigned int const lim = bp->count(); if ([array count] == lim) { for (unsigned int i = 0; i < lim; i++) { MiscPixels const min_size = MiscPixels( [self border:b slotMinSize:i] ); MiscPixels const max_size = MiscPixels( [self border:b slotMaxSize:i] ); MiscPixels s = MiscPixels([[array objectAtIndex:i] intValue]); if (s < min_size) s = min_size; else if (s > max_size) s = max_size; bp->setSize_P( i, s ); } [self constrainSize]; ret = YES; } } return ret; } - (BOOL)setColumnSizes:(NSArray*)list { return [self border:MISC_COL_BORDER setSlotSizes:list]; } - (BOOL)setRowSizes:(NSArray*)list { return [self border:MISC_ROW_BORDER setSlotSizes:list]; } - (NSString*)slotSizesAsString:(MiscBorderType)b { return [self stringFromIntArray:[self slotSizes:b]]; } - (NSString*)columnSizesAsString { return [self slotSizesAsString:MISC_COL_BORDER]; } - (NSString*)rowSizesAsString { return [self slotSizesAsString:MISC_ROW_BORDER]; } - (BOOL)border:(MiscBorderType)b setSlotSizesFromString:(NSString*)s { return [self border:b setSlotSizes:[self intArrayFromString:s]]; } - (BOOL)setColumnSizesFromString:(NSString*)s { return [self border:MISC_COL_BORDER setSlotSizesFromString:s]; } - (BOOL)setRowSizesFromString:(NSString*)s { return [self border:MISC_ROW_BORDER setSlotSizesFromString:s]; } //----------------------------------------------------------------------------- // Border Views //----------------------------------------------------------------------------- - (MiscCornerView*)cornerView { return cornerView; } - (NSString*)cornerTitle { return [cornerView title]; } - (void)setCornerTitle:(NSString*)s { [cornerView setTitle:s]; } - (BOOL)setBorder:(MiscBorderType)type on:(BOOL)on { MiscBorderInfo& b = *(info[type]); if (b.isOn != on) { BOOL const other_border_is_on = info[otherBorder(type)]->isOn; b.isOn = on; if (on) { if (other_border_is_on) [self addSubview:cornerView]; [self addSubview:b.clip]; NSRect r = [b.clip bounds]; NSRect c = [[self contentView] bounds]; if (type == MISC_COL_BORDER) { if (r.origin.x != c.origin.x) { r.origin.x = c.origin.x; [b.clip scrollToPoint:r.origin]; } } else { if (r.origin.y != c.origin.y) { r.origin.y = c.origin.y; [b.clip scrollToPoint:r.origin]; } } } else { [b.clip removeFromSuperview]; if (other_border_is_on) [cornerView removeFromSuperview]; } [self tile]; [self constrainSize]; [self setNeedsDisplay:YES]; return YES; } return NO; } //----------------------------------------------------------------------------- // SLOT methods //----------------------------------------------------------------------------- - (MiscTableBorder*)border:(MiscBorderType)b { return info[b]->border; } - (BOOL)border:(MiscBorderType)b setSlotTitlesOn:(BOOL)on_off { return [self setBorder:b on:on_off]; } - (BOOL)slotTitlesOn:(MiscBorderType)b { return info[b]->isOn; } - (MiscTableTitleMode)slotTitleMode:(MiscBorderType)b { return info[b]->border->getTitleMode(); } - (void)border:(MiscBorderType)b setSlotTitleMode:(MiscTableTitleMode)x { MiscBorderInfo* const ip = info[b]; if (ip->border->setTitleMode(x) && ip->isOn && ip->border->count() > 0) [ip->view setNeedsDisplay:YES]; } - (float)slotTitlesSize:(MiscBorderType)b { return info[b]->isOn ? [info[b]->view frameHeight] : 0; } - (void)border:(MiscBorderType)b setSlotTitlesSize:(float)x { [info[b]->view setFrameHeight:(MiscPixels)floor(x)]; [self tile]; } - (void)border:(MiscBorderType)b moveSlot:(int)fromPos toSlot:(int)toPos { info[b]->border->moveFromTo( fromPos, toPos ); [self selectionChanged]; } - (int)border:(MiscBorderType)b slotPosition:(int)n { return info[b]->border->physicalToVisual(n); } - (int)border:(MiscBorderType)b slotAtPosition:(int)n { return info[b]->border->visualToPhysical(n); } - (NSArray*)border:(MiscBorderType)b physicalToVisual:(NSArray*)p_array { NSMutableArray* v_array = [NSMutableArray array]; for (unsigned int i = 0, lim = [p_array count]; i < lim; i++) { MiscCoord_P const p = [[p_array objectAtIndex:i] intValue]; MiscCoord_V const v = [self border:b slotPosition:p]; [v_array addObject:[NSNumber numberWithInt:v]]; } return v_array; } - (NSArray*)border:(MiscBorderType)b visualToPhysical:(NSArray*)v_array { NSMutableArray* p_array = [NSMutableArray array]; for (unsigned int i = 0, lim = [v_array count]; i < lim; i++) { MiscCoord_V const v = [[v_array objectAtIndex:i] intValue]; MiscCoord_P const p = [self border:b slotAtPosition:v]; [p_array addObject:[NSNumber numberWithInt:p]]; } return p_array; } - (BOOL)sizeableSlots:(MiscBorderType)b { return info[b]->border->isSizeable(); } - (BOOL)draggableSlots:(MiscBorderType)b { return info[b]->border->isDraggable(); } - (BOOL)modifierDragSlots:(MiscBorderType)b { return info[b]->border->isModifierDrag(); } - (float)uniformSizeSlots:(MiscBorderType)b { return (float) info[b]->border->getUniformSize(); } - (float)minUniformSizeSlots:(MiscBorderType)b { return (float) info[b]->border->getMinUniformSize(); } - (float)maxUniformSizeSlots:(MiscBorderType)b { return (float) info[b]->border->getMaxUniformSize(); } - (float)border:(MiscBorderType)b slotAdjustedSize:(int)n { return (float) info[b]->border->effectiveSize_P(n); } - (float)border:(MiscBorderType)b slotSize:(int)n { return (float) info[b]->border->getSize_P(n); } - (float)border:(MiscBorderType)b slotMinSize:(int)n { return (float) info[b]->border->getMinSize_P(n); } - (float)border:(MiscBorderType)b slotMaxSize:(int)n { return (float) info[b]->border->getMaxSize_P(n); } - (BOOL)border:(MiscBorderType)b slotIsSizeable:(int)n { return info[b]->border->isSizeable_P(n); } - (BOOL)border:(MiscBorderType)b slotIsAutosize:(int)n { return info[b]->border->isSpringy_P(n); } - (NSString*)border:(MiscBorderType)b slotTitle:(int)n { return info[b]->border->getTitle_P(n); } - (int)border:(MiscBorderType)b slotTag:(int)n { return info[b]->border->getTag_P(n); } - (id)border:(MiscBorderType)b slotRepresentedObject:(int)n { return info[b]->border->getRepresentedObject_P(n); } - (MiscTableCellStyle)border:(MiscBorderType)b slotCellType:(int)n { return info[b]->border->getStyle_P(n); } - (id)border:(MiscBorderType)b slotCellPrototype:(int)n { return info[b]->border->getPrototype_P(n); } - (void)border:(MiscBorderType)b setSizeableSlots:(BOOL)flag { info[b]->border->setSizeable( flag ); } - (void)border:(MiscBorderType)b setDraggableSlots:(BOOL)flag { info[b]->border->setDraggable( flag ); } - (void)border:(MiscBorderType)b setModifierDragSlots:(BOOL)flag { info[b]->border->setModifierDrag( flag ); } - (void)border:(MiscBorderType)b setUniformSizeSlots:(float)uniform_size { MiscBorderInfo* const ip = info[b]; if (ip->border->setUniformSize((MiscPixels)floor(uniform_size))) { [self constrainSize]; if (b == MISC_ROW_BORDER) { float const scr_size = uniform_size != 0 ? uniform_size : ip->border->getDefaultSize(); [self setLineScroll:scr_size]; [self setPageScroll:scr_size]; } [self setNeedsDisplay:YES]; } } - (void)border:(MiscBorderType)b setMinUniformSizeSlots:(float)size { info[b]->border->setMinUniformSize( (MiscPixels)floor(size) ); } - (void)border:(MiscBorderType)b setMaxUniformSizeSlots:(float)size { info[b]->border->setMaxUniformSize( (MiscPixels)floor(size) ); } - (void)border:(MiscBorderType)b setSlot:(int)n size:(float)size { info[b]->border->setSize_P( n, (MiscPixels)floor(size) ); [self constrainSize]; } - (void)border:(MiscBorderType)b setSlot:(int)n minSize:(float)size { info[b]->border->setMinSize_P( n, (MiscPixels)floor(size) ); [self constrainSize]; } - (void)border:(MiscBorderType)b setSlot:(int)n maxSize:(float)size { info[b]->border->setMaxSize_P( n, (MiscPixels)floor(size) ); [self constrainSize]; } - (void)border:(MiscBorderType)b setSlot:(int)n sizeable:(BOOL)flag { info[b]->border->setSizeable_P( n, flag ); } - (void)border:(MiscBorderType)b setSlot:(int)n autosize:(BOOL)flag { info[b]->border->setSpringy_P( n, flag ); [self constrainSize]; } - (void)border:(MiscBorderType)b setSlot:(int)n title:(NSString*)title { MiscBorderInfo* const ip = info[b]; if (ip->border->setTitle_P( n, title ) && ip->isOn) [ip->view setNeedsDisplay:YES]; } - (void)border:(MiscBorderType)b setSlot:(int)n tag:(int)x { info[b]->border->setTag_P( n, x ); } - (void)border:(MiscBorderType)b setSlot:(int)n representedObject:(id)x { info[b]->border->setRepresentedObject_P( n, x ); } - (void)border:(MiscBorderType)b setSlot:(int)n cellType:(MiscTableCellStyle)type { info[b]->border->setStyle_P(n,type); } - (void)border:(MiscBorderType)b setSlot:(int)n cellPrototype:(id)p { info[b]->border->setPrototype_P(n,p); } //----------------------------------------------------------------------------- // COLUMN methods //----------------------------------------------------------------------------- - (MiscTableBorder*)columnBorder { return colInfo.border; } - (BOOL)columnTitlesOn { return [self slotTitlesOn:MISC_COL_BORDER]; } - (BOOL)setColumnTitlesOn:(BOOL)x { return [self setBorder:MISC_COL_BORDER on:x]; } - (MiscTableTitleMode)columnTitleMode { return [self slotTitleMode:MISC_COL_BORDER]; } - (void)setColumnTitleMode:(MiscTableTitleMode)x { [self border:MISC_COL_BORDER setSlotTitleMode:x]; } - (float)columnTitlesHeight { return [self slotTitlesSize:MISC_COL_BORDER]; } - (void)setColumnTitlesHeight:(float)x { [self border:MISC_COL_BORDER setSlotTitlesSize:x]; } - (MiscBorderView*)colTitles { return ([self columnTitlesOn] ? colInfo.view : 0); } - (void)moveColumn:(int)fromPos toColumn:(int)toPos { [self border:MISC_COL_BORDER moveSlot:fromPos toSlot:toPos]; } - (int)columnPosition:(int)n { return [self border:MISC_COL_BORDER slotPosition:n]; } - (int)columnAtPosition:(int)n { return [self border:MISC_COL_BORDER slotAtPosition:n]; } - (BOOL)sizeableColumns { return [self sizeableSlots:MISC_COL_BORDER]; } - (BOOL)draggableColumns { return [self draggableSlots:MISC_COL_BORDER]; } - (BOOL)modifierDragColumns { return [self modifierDragSlots:MISC_COL_BORDER]; } - (float)uniformSizeColumns { return [self uniformSizeSlots:MISC_COL_BORDER]; } - (float)minUniformSizeColumns { return [self minUniformSizeSlots:MISC_COL_BORDER]; } - (float)maxUniformSizeColumns { return [self maxUniformSizeSlots:MISC_COL_BORDER]; } - (float)columnAdjustedSize:(int)n { return [self border:MISC_COL_BORDER slotAdjustedSize:n]; } - (float)columnSize:(int)n { return [self border:MISC_COL_BORDER slotSize:n]; } - (float)columnMinSize:(int)n { return [self border:MISC_COL_BORDER slotMinSize:n]; } - (float)columnMaxSize:(int)n { return [self border:MISC_COL_BORDER slotMaxSize:n]; } - (BOOL)columnIsSizeable:(int)n { return [self border:MISC_COL_BORDER slotIsSizeable:n]; } - (BOOL)columnIsAutosize:(int)n { return [self border:MISC_COL_BORDER slotIsAutosize:n]; } - (NSString*)columnTitle:(int)n { return [self border:MISC_COL_BORDER slotTitle:n]; } - (int)columnTag:(int)n { return [self border:MISC_COL_BORDER slotTag:n]; } - (id)columnRepresentedObject:(int)n { return [self border:MISC_COL_BORDER slotRepresentedObject:n]; } - (MiscTableCellStyle)columnCellType:(int)n { return [self border:MISC_COL_BORDER slotCellType:n]; } - (id)columnCellPrototype:(int)n { return [self border:MISC_COL_BORDER slotCellPrototype:n]; } - (void)setSizeableColumns:(BOOL)flag { [self border:MISC_COL_BORDER setSizeableSlots:flag]; } - (void)setDraggableColumns:(BOOL)flag { [self border:MISC_COL_BORDER setDraggableSlots:flag]; } - (void)setModifierDragColumns:(BOOL)flag { [self border:MISC_COL_BORDER setModifierDragSlots:flag]; } - (void)setUniformSizeColumns:(float)size { [self border:MISC_COL_BORDER setUniformSizeSlots:size]; } - (void)setMinUniformSizeColumns:(float)size { [self border:MISC_COL_BORDER setMinUniformSizeSlots:size]; } - (void)setMaxUniformSizeColumns:(float)size { [self border:MISC_COL_BORDER setMaxUniformSizeSlots:size]; } - (void)setColumn:(int)n size:(float)size { [self border:MISC_COL_BORDER setSlot:n size:size]; } - (void)setColumn:(int)n minSize:(float)size { [self border:MISC_COL_BORDER setSlot:n minSize:size]; } - (void)setColumn:(int)n maxSize:(float)size { [self border:MISC_COL_BORDER setSlot:n maxSize:size]; } - (void)setColumn:(int)n sizeable:(BOOL)flag { [self border:MISC_COL_BORDER setSlot:n sizeable:flag]; } - (void)setColumn:(int)n autosize:(BOOL)flag { [self border:MISC_COL_BORDER setSlot:n autosize:flag]; } - (void)setColumn:(int)n title:(NSString*)title { [self border:MISC_COL_BORDER setSlot:n title:title]; } - (void)setColumn:(int)n tag:(int)x { [self border:MISC_COL_BORDER setSlot:n tag:x]; } - (void)setColumn:(int)n representedObject:(id)x { [self border:MISC_COL_BORDER setSlot:n representedObject:x]; } - (void)setColumn:(int)n cellType:(MiscTableCellStyle)x { [self border:MISC_COL_BORDER setSlot:n cellType:x]; } - (void)setColumn:(int)n cellPrototype:(id)p { [self border:MISC_COL_BORDER setSlot:n cellPrototype:p]; } //----------------------------------------------------------------------------- // ROW methods //----------------------------------------------------------------------------- - (MiscTableBorder*)rowBorder { return rowInfo.border; } - (BOOL)rowTitlesOn { return [self slotTitlesOn:MISC_ROW_BORDER]; } - (BOOL)setRowTitlesOn:(BOOL)x { return [self setBorder:MISC_ROW_BORDER on:x]; } - (MiscTableTitleMode)rowTitleMode { return [self slotTitleMode:MISC_ROW_BORDER]; } - (void)setRowTitleMode:(MiscTableTitleMode)x { [self border:MISC_ROW_BORDER setSlotTitleMode:x]; } - (float)rowTitlesWidth { return [self slotTitlesSize:MISC_ROW_BORDER]; } - (void)setRowTitlesWidth:(float)x { [self border:MISC_ROW_BORDER setSlotTitlesSize:x]; } - (MiscBorderView*)rowTitles { return ([self rowTitlesOn] ? rowInfo.view : 0); } - (void)moveRow:(int)fromPos toRow:(int)toPos { [self border:MISC_ROW_BORDER moveSlot:fromPos toSlot:toPos]; } - (int)rowPosition:(int)n { return [self border:MISC_ROW_BORDER slotPosition:n]; } - (int)rowAtPosition:(int)n { return [self border:MISC_ROW_BORDER slotAtPosition:n]; } - (BOOL)sizeableRows { return [self sizeableSlots:MISC_ROW_BORDER]; } - (BOOL)draggableRows { return [self draggableSlots:MISC_ROW_BORDER]; } - (BOOL)modifierDragRows { return [self modifierDragSlots:MISC_ROW_BORDER]; } - (float)uniformSizeRows { return [self uniformSizeSlots:MISC_ROW_BORDER]; } - (float)minUniformSizeRows { return [self minUniformSizeSlots:MISC_ROW_BORDER]; } - (float)maxUniformSizeRows { return [self maxUniformSizeSlots:MISC_ROW_BORDER]; } - (float)rowAdjustedSize:(int)n { return [self border:MISC_ROW_BORDER slotAdjustedSize:n]; } - (float)rowSize:(int)n { return [self border:MISC_ROW_BORDER slotSize:n]; } - (float)rowMinSize:(int)n { return [self border:MISC_ROW_BORDER slotMinSize:n]; } - (float)rowMaxSize:(int)n { return [self border:MISC_ROW_BORDER slotMaxSize:n]; } - (BOOL)rowIsSizeable:(int)n { return [self border:MISC_ROW_BORDER slotIsSizeable:n]; } - (BOOL)rowIsAutosize:(int)n { return [self border:MISC_ROW_BORDER slotIsAutosize:n]; } - (NSString*)rowTitle:(int)n { return [self border:MISC_ROW_BORDER slotTitle:n]; } - (int)rowTag:(int)n { return [self border:MISC_ROW_BORDER slotTag:n]; } - (id)rowRepresentedObject:(int)n { return [self border:MISC_ROW_BORDER slotRepresentedObject:n]; } - (MiscTableCellStyle)rowCellType:(int)n { return [self border:MISC_ROW_BORDER slotCellType:n]; } - (id)rowCellPrototype:(int)n { return [self border:MISC_ROW_BORDER slotCellPrototype:n]; } - (void)setSizeableRows:(BOOL)flag { [self border:MISC_ROW_BORDER setSizeableSlots:flag]; } - (void)setDraggableRows:(BOOL)flag { [self border:MISC_ROW_BORDER setDraggableSlots:flag]; } - (void)setModifierDragRows:(BOOL)flag { [self border:MISC_ROW_BORDER setModifierDragSlots:flag]; } - (void)setUniformSizeRows:(float)size { [self border:MISC_ROW_BORDER setUniformSizeSlots:size]; } - (void)setMinUniformSizeRows:(float)size { [self border:MISC_ROW_BORDER setMinUniformSizeSlots:size]; } - (void)setMaxUniformSizeRows:(float)size { [self border:MISC_ROW_BORDER setMaxUniformSizeSlots:size]; } - (void)setRow:(int)n size:(float)size { [self border:MISC_ROW_BORDER setSlot:n size:size]; } - (void)setRow:(int)n minSize:(float)size { [self border:MISC_ROW_BORDER setSlot:n minSize:size]; } - (void)setRow:(int)n maxSize:(float)size { [self border:MISC_ROW_BORDER setSlot:n maxSize:size]; } - (void)setRow:(int)n sizeable:(BOOL)flag { [self border:MISC_ROW_BORDER setSlot:n sizeable:flag]; } - (void)setRow:(int)n autosize:(BOOL)flag { [self border:MISC_ROW_BORDER setSlot:n autosize:flag]; } - (void)setRow:(int)n title:(NSString*)title { [self border:MISC_ROW_BORDER setSlot:n title:title]; } - (void)setRow:(int)n tag:(int)x { [self border:MISC_ROW_BORDER setSlot:n tag:x]; } - (void)setRow:(int)n representedObject:(id)x { [self border:MISC_ROW_BORDER setSlot:n representedObject:x]; } - (void)setRow:(int)n cellType:(MiscTableCellStyle)x { [self border:MISC_ROW_BORDER setSlot:n cellType:x]; } - (void)setRow:(int)n cellPrototype:(id)p { [self border:MISC_ROW_BORDER setSlot:n cellPrototype:p]; } //----------------------------------------------------------------------------- // DRAWING // FIXME: This should all be routed through the -display::: mechanism // so that the lockFocus can be done automatically, and so that // subviews will have an opportunity to draw themselves. //----------------------------------------------------------------------------- - (void)drawCellAtRow:(int)row column:(int)col { if ([tableView canDraw]) { [tableView lockFocus]; [tableView drawCellAtRow:row column:col]; [tableView unlockFocus]; [[self window] flushWindow]; } } - (void)drawRow:(int)row { if ([tableView canDraw]) { [tableView lockFocus]; [tableView drawRow:row]; [tableView unlockFocus]; [[self window] flushWindow]; } } - (void)drawColumn:(int)col { if ([tableView canDraw]) { [tableView lockFocus]; [tableView drawColumn:col]; [tableView unlockFocus]; [[self window] flushWindow]; } } - (void)border:(MiscBorderType)b drawSlot:(int)n { if (b == MISC_COL_BORDER) [self drawColumn:n]; else [self drawRow:n]; } - (void)border:(MiscBorderType)b drawSlotTitle:(int)n // physical position. { MiscBorderInfo* const ip = info[b]; if (ip->isOn) // visual position. { MiscBorderView* const v = ip->view; if ([v canDraw]) { [v lockFocus]; [v drawSlot:[self border:b slotPosition:n]]; [v unlockFocus]; [[self window] flushWindow]; } } } - (void)drawRowTitle:(int)n { [self border:MISC_ROW_BORDER drawSlotTitle:n]; } - (void)drawColumnTitle:(int)n { [self border:MISC_COL_BORDER drawSlotTitle:n]; } - (BOOL)drawsClippedText { return drawsClippedText; } - (void)setDrawsClippedText:(BOOL)x { if (drawsClippedText != x) { drawsClippedText = x; [self setNeedsDisplay:YES]; } } //----------------------------------------------------------------------------- // VISIBLE / SCROLLING //----------------------------------------------------------------------------- - (void)scrollCellToVisibleAtRow:(int)row column:(int)col { [tableView scrollCellToVisibleAtRow:row column:col]; } - (void)scrollRowToVisible:(int)row { [tableView scrollRowToVisible:row]; } - (void)scrollColumnToVisible:(int)col { [tableView scrollColumnToVisible:col]; } - (void)scrollSelectionToVisible { if ([self hasRowSelection]) [self scrollRowToVisible:[self selectedRow]]; else if ([self hasColumnSelection]) [self scrollColumnToVisible:[self selectedColumn]]; } - (int)numberOfVisibleSlots:(MiscBorderType)b { return [tableView numberOfVisibleSlots:b]; } - (int)firstVisibleSlot:(MiscBorderType)b { return [tableView firstVisibleSlot:b]; } - (int)lastVisibleSlot:(MiscBorderType)b { return [tableView lastVisibleSlot:b]; } - (BOOL)border:(MiscBorderType)b slotIsVisible:(int)n { return [tableView border:b slotIsVisible:n]; } - (void)border:(MiscBorderType)b setFirstVisibleSlot:(int)n { [tableView border:b setFirstVisibleSlot:n]; } - (void)border:(MiscBorderType)b setLastVisibleSlot:(int)n { [tableView border:b setLastVisibleSlot:n]; } - (int)numberOfVisibleColumns { return [self numberOfVisibleSlots:MISC_COL_BORDER]; } - (int)firstVisibleColumn { return [self firstVisibleSlot:MISC_COL_BORDER]; } - (int)lastVisibleColumn { return [self lastVisibleSlot:MISC_COL_BORDER]; } - (BOOL)columnIsVisible:(int)n { return [self border:MISC_COL_BORDER slotIsVisible:n]; } - (void)setFirstVisibleColumn:(int)n { [self border:MISC_COL_BORDER setFirstVisibleSlot:n]; } - (void)setLastVisibleColumn:(int)n { [self border:MISC_COL_BORDER setLastVisibleSlot:n]; } - (int)numberOfVisibleRows { return [self numberOfVisibleSlots:MISC_ROW_BORDER]; } - (int)firstVisibleRow { return [self firstVisibleSlot:MISC_ROW_BORDER]; } - (int)lastVisibleRow { return [self lastVisibleSlot:MISC_ROW_BORDER]; } - (BOOL)rowIsVisible:(int)n { return [self border:MISC_ROW_BORDER slotIsVisible:n]; } - (void)setFirstVisibleRow:(int)n { [self border:MISC_ROW_BORDER setFirstVisibleSlot:n]; } - (void)setLastVisibleRow:(int)n { [self border:MISC_ROW_BORDER setLastVisibleSlot:n]; } //----------------------------------------------------------------------------- // *FIXME* // OPENSTEP 4.2 Objective-C++ compiler for NT (final release) crashes // whenever a message is sent to 'super' from within a category. This // bug also afflicts the 4.2 (prerelease) compiler for Mach and NT. // Work around it by providing stub methods in the main (non-category) // implementation which merely forward the appropriate message to 'super' // on behalf of the categories. Though ugly, it works, is very // localized, and simple to remove when the bug is finally fixed. //----------------------------------------------------------------------------- - (id)superInitWithCoder:(NSCoder*)coder { return [super initWithCoder:coder]; } - (void)superEncodeWithCoder:(NSCoder*)coder { [super encodeWithCoder:coder]; } - (void)superKeyDown:(NSEvent*)p { [super keyDown:p]; } - (id)superValidRequestorForSendType:(NSString*)s returnType:(NSString*)r { return [super validRequestorForSendType:s returnType:r]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableBorderSel.cc100444 1750 1750 12410 6757227344 25246 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableBorderSel.cc // // Selection management methods for the MiscTableBorder class. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableBorderSel.cc,v 1.2 97/11/24 03:03:48 sunshine Exp $ // $Log: MiscTableBorderSel.cc,v $ // Revision 1.2 97/11/24 03:03:48 sunshine // v132.1: MiscTableBorder_sel --> MiscTableBorderSel // // Revision 1.1 97/11/23 07:36:07 sunshine // v130.1: Selection management routines for MiscTableBorder. //----------------------------------------------------------------------------- #include "MiscTableBorder.h" extern "Objective-C" { #import } //----------------------------------------------------------------------------- // visualToPhysical // Used to save the selection before sorting. //----------------------------------------------------------------------------- void MiscTableBorder::visualToPhysical( MiscSparseSet const& vset, MiscSparseSet& pset ) const { pset.empty(); unsigned int const lim = vset.numRanges(); for (unsigned int i = 0; i < lim; i++) { int lo, hi; vset.getRangeAt( i, lo, hi ); for ( ; lo <= hi; lo++) pset.add( visualToPhysical( lo ) ); } } //----------------------------------------------------------------------------- // physicalToVisual // Used to restore the selection after sorting. //----------------------------------------------------------------------------- void MiscTableBorder::physicalToVisual( MiscSparseSet const& pset, MiscSparseSet& vset ) const { vset.empty(); unsigned int const lim = pset.numRanges(); for (unsigned int i = 0; i < lim; i++) { int lo, hi; pset.getRangeAt( i, lo, hi ); for ( ; lo <= hi; lo++) vset.add( physicalToVisual( lo ) ); } } //----------------------------------------------------------------------------- // hasMultipleSelection //----------------------------------------------------------------------------- bool MiscTableBorder::hasMultipleSelection() const { MiscCoord_V lo, hi; selection.getTotalRange( lo, hi ); return hi > lo; } //----------------------------------------------------------------------------- // selected_slots //----------------------------------------------------------------------------- NSArray* MiscTableBorder::selected_slots( bool do_tags ) const { NSMutableArray* array = [NSMutableArray array]; for (unsigned int i = 0, lim = selection.numRanges(); i < lim; i++) { MiscCoord_V lo, hi; selection.getRangeAt( i, lo, hi ); for ( ; lo <= hi; lo++) { int n = (do_tags ? getTag(lo) : visualToPhysical(lo)); [array addObject:[NSNumber numberWithInt:n]]; } } return array; } //----------------------------------------------------------------------------- // select_slots //----------------------------------------------------------------------------- void MiscTableBorder::select_slots( NSArray* list, bool clear, bool set ) { if (clear) selectNone(); int const lim = [list count]; if (lim > 0) { MiscCoord_V last_selected = -1; for (int i = lim; i-- > 0; ) { MiscCoord_P const p_slot = [[list objectAtIndex:i] intValue]; if (goodPos( p_slot )) { MiscCoord_V const v_slot = physicalToVisual( p_slot ); if (v_slot > last_selected) last_selected = v_slot; if (set) selection.add( v_slot ); else selection.remove( v_slot ); } } if (set && last_selected != -1) setSelectedSlot( last_selected ); else fixSelectedSlot(); } } //----------------------------------------------------------------------------- // select_tags //----------------------------------------------------------------------------- void MiscTableBorder::select_tags( NSArray* list, bool clear, bool set ) { if (clear) selectNone(); unsigned int const M = [list count]; if (M > 0) { MiscCoord_V last_selected = -1; unsigned int i; int* const v0 = (int*)malloc( M * sizeof(*v0) ); int const* const vM = v0 + M; for (i = 0; i < M; i++) v0[i] = [[list objectAtIndex:i] intValue]; unsigned int const N = count(); for (i = 0; i < N; i++) { int const t = getTag(i); // MiscCoord_V for (int const* v = v0; v < vM; v++) if (*v == t) { if (int(i) > last_selected) last_selected = (MiscCoord_V)i; if (set) selection.add(i); else selection.remove(i); break; } } free( v0 ); if (set && last_selected != -1) setSelectedSlot( last_selected ); else fixSelectedSlot(); } } MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableConnector.M100444 1750 1750 16376 6757227333 25143 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableConnector.M // // A custom sublcass of the Interface Builder NSNibControlConnector // that works for doubleTarget & doubleAction. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableConnector.M,v 1.8 99/06/15 02:49:47 sunshine Exp $ // $Log: MiscTableConnector.M,v $ // Revision 1.8 99/06/15 02:49:47 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // As of MacOS/X Server DR2, nib connector classes are now published; we now // conditionally declare connector classes based on platform; NSIBConnector // in AppKit was renamed to NSNibConnector. // Now uses NSStringFromClass() in place of +[NSObject description]. // // Revision 1.7 1997/06/18 10:21:04 sunshine // v125.9: Worked around Objective-C++ compiler crash in OPENSTEP 4.2 for NT // when sending message to 'super' from within a category in a permanent // fashion. // // Revision 1.6 97/04/15 09:06:59 sunshine // v0.125.8: Hacked around OPENSTEP 4.2 (prerelease) compiler bug. Compiler // crashes if a message is sent to 'super' from within a category. // Temporarily moved affected code from MiscTableConnector.M to this file. //----------------------------------------------------------------------------- #import "MiscTableConnector.h" extern "Objective-C" { #import Ivar object_setInstanceVariable( id, char const* name, void const* ); } int const MISC_CONN_VERSION_0 = 0; // First NEXTSTEP 3.3 version. int const MISC_CONN_VERSION_1000 = 1000; // First OpenStep version (4.0 PR2) int const MISC_CONN_VERSION = MISC_CONN_VERSION_1000; @interface NSNibConnector(MiscTableConnector_42NT) // See *FIXME* OPENSTEP 4.2 for NT at bottom of file. - (id)initSource:(id)src destination:(id)dst label:(id)lbl; @end #if defined(MISC_OLD_IB_CONNECTORS) @interface NSNibConnector(MiscTableConnector) - (NSString*)label; @end @implementation NSIBConnector(MiscTableConnector) - (NSString*)label { return label; } @end #endif // MISC_OLD_IB_CONNECTORS //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscTableConnector //----------------------------------------------------------------------------- // +initialize //----------------------------------------------------------------------------- + (void)initialize { if (self == [MiscTableConnector class]) [self setVersion:MISC_CONN_VERSION]; } //----------------------------------------------------------------------------- // -dealloc //----------------------------------------------------------------------------- - (void)dealloc { [outletName release]; [actionName release]; [super dealloc]; } //----------------------------------------------------------------------------- // -readCStringWithCoder: //----------------------------------------------------------------------------- - (NSString*)readCStringWithCoder:(NSCoder*)decoder { NSString* ret = @""; char* s = 0; [decoder decodeValueOfObjCType:@encode(char*) at:&s]; if (s != 0) { ret = [NSString stringWithCString:s]; NSZoneFree( [decoder objectZone], s ); } return ret; } //----------------------------------------------------------------------------- // -initWithCoder_v0: //----------------------------------------------------------------------------- - (void)initWithCoder_v0:(NSCoder*)decoder { outletName = [[self readCStringWithCoder:decoder] retain]; actionName = [[self readCStringWithCoder:decoder] retain]; [self readCStringWithCoder:decoder]; // Duplicate "label" no longer needed. } //----------------------------------------------------------------------------- // -initWithCoder_v1000: //----------------------------------------------------------------------------- - (void)initWithCoder_v1000:(NSCoder*)decoder { outletName = [[decoder decodeObject] retain]; actionName = [[decoder decodeObject] retain]; } //----------------------------------------------------------------------------- // -initWithCoder: //----------------------------------------------------------------------------- - (id)initWithCoder:(NSCoder*)decoder { self = [super initWithCoder:decoder]; unsigned int const ver = [decoder versionForClassName: NSStringFromClass( [MiscTableConnector class] )]; switch (ver) { case MISC_CONN_VERSION_0: [self initWithCoder_v0: decoder]; break; case MISC_CONN_VERSION_1000: [self initWithCoder_v1000:decoder]; break; default: [NSException raise:NSGenericException format:@"Cannot read: unknown version %d", ver]; break; } return self; } //----------------------------------------------------------------------------- // -setInstanceVariable:of:to: //----------------------------------------------------------------------------- - (void)setInstanceVariable:(NSString*)var of:(id)obj to:(id)val { if (var != 0 && [var length] > 0) object_setInstanceVariable( obj, [var cString], val ); } //----------------------------------------------------------------------------- // -establishConnection //----------------------------------------------------------------------------- - (void)establishConnection { id const src = [self source]; id const dst = [self destination]; if (src != 0 && dst != 0 && [outletName length] > 0) { [self setInstanceVariable:outletName of:src to:dst]; if ([actionName length] > 0 && [[self label] length] > 0) { SEL aSel = NSSelectorFromString([self label]); if (aSel != 0) [self setInstanceVariable:actionName of:src to:(id)aSel]; } } } //----------------------------------------------------------------------------- // *FIXME* // OPENSTEP 4.2 Objective-C++ compiler for NT (final release) crashes // whenever a message is sent to 'super' from within a category. This // bug also afflicts the 4.2 (prerelease) compiler for Mach and NT. // Work around it by providing stub methods in the main (non-category) // implementation which merely forward the appropriate message to 'super' // on behalf of the categories. Though ugly, it works, is very // localized, and simple to remove when the bug is finally fixed. //----------------------------------------------------------------------------- - (id)superInitSource:(id)s destination:(id)d label:(NSString*)l { return [super initSource:s destination:d label:l]; } - (void)superEncodeWithCoder:(NSCoder*)c { [super encodeWithCoder:c]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableConnector.h100444 1750 1750 4343 6757227334 25146 0ustar sunshinesunshine#ifndef __MiscTableConnector_h #define __MiscTableConnector_h //============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableConnector.h // // A custom sublcass of the Interface Builder NSNibControlConnector // that works for doubleTarget & doubleAction. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableConnector.h,v 1.5 99/06/15 02:45:59 sunshine Exp $ // $Log: MiscTableConnector.h,v $ // Revision 1.5 99/06/15 02:45:59 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Imported header name changed: NSIBConnector.h --> NSNibConnector.h. // Parent class name changed: NSIBControlConnector --> NSNibControlConnector. // // Revision 1.4 1997/06/18 10:21:46 sunshine // v125.9: Worked around Objective-C++ compiler crash in OPENSTEP 4.2 for NT // when sending message to 'super' from within a category in a permanent // fashion. //----------------------------------------------------------------------------- #import "NSNibConnector.h" @interface MiscTableConnector : NSNibControlConnector { NSString* outletName; // Name of the "target" outlet. NSString* actionName; // Name of the "action" variable. } - (id)initWithCoder:(NSCoder*)coder; - (void)dealloc; - (void)establishConnection; // See implementation for explanation of the following methods. - (id)superInitSource:(id)src destination:(id)dest label:(NSString*)label; - (void)superEncodeWithCoder:(NSCoder*)coder; @end #endif // __MiscTableConnector_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScroll.h100444 1750 1750 111302 6757227334 24504 0ustar sunshinesunshine#ifndef __MiscTableScroll_h #define __MiscTableScroll_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // // // ScrollView class that displays a 2-D table of cells. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScroll.h,v 1.32 99/06/15 05:58:56 sunshine Exp $ // $Log: MiscTableScroll.h,v $ // Revision 1.32 99/06/15 05:58:56 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. Exposed to Java. // Added support for represented object: // -representedObject, -setRepresentedObject: // -border:slotRepresentedObject:, -border:setSlot:representedObject: // -columnRepresentedObject:, -setColumn:representedObject: // -rowRepresentedObject:, -setRow:representedObject: // -border:slotWithRepresentedObject: // -columnWithRepresentedObject: // -rowWithRepresentedObject: // -cellWithRepresentedObject: // -getRow:column:ofCellWithRepresentedObject: // For clarity and better OpenStep conformance, renamed: // -drawClippedText --> -drawsClippedText // -setDrawClippedText: --> -setDrawsClippedText: // -...ISearchColumn: --> -...IncrementalSearchColumn: // -select...:byExtension: --> -select...:byExtendingSelection: // -select{Slot|Row|Column}Tags: --> -select{Slots|Rows|Columns}WithTags: // -deselect{Slot|Row|Column}Tags: --> -deselect{Slots|Rows|Columns}WithTags: // -trackBy: --> setSelectsByRows: // -trackingBy --> selectsByRows // -tracking --> -isTrackingMouse // -stringForNSTabularTextPBoardType --> -stringForNSTabularTextPboardType // Renamed variable: tracking --> trackingMouse // Renamed variable: drawClippedText --> drawsClippedText // Java exposure requires a one-to-one mapping between Objective-C selectors // and Java methods. AppKit already has a method for moving columns around, // so MiscTableScroll has to match that name. For consistency renamed other // similar methods as well: // -border:moveSlotFrom:to: --> -border:moveSlot:toSlot: // -moveColumnFrom:to: --> -moveColumn:toColumn: // -moveRowFrom:to: --> moveRow:toRow: // -border:slotDraggedFrom:to: --> border:slotDragged:toSlot: // Added MiscTableScroll-specific notifications which are sent to the default // notification center in place of sending certain old-style delegate // messages. The delegates are automatically registered to listen for any // notifications which they can receive. Consequently renamed numerous // delegate messages to handle notifications: // -tableScroll:border:slotDraggedFrom:to: --> -tableScrollSlotDragged: // -tableScroll:border:slotResized: --> -tableScrollSlotResized: // -tableScroll:border:slotSortReversed: --> -tableScrollSlotSortReversed: // -tableScroll:changeFont:to: --> -tableScrollChangeFont: // -tableScroll:fontChangedFrom:to: --> -tableScrollFontChanged: // -tableScroll:...ColorChangedTo: --> -tableScroll...ColorChanged: // -tableScroll:willPrint: --> -tableScrollWillPrint: // -tableScroll:didPrint: --> -tableScrollDidPrint: // -tableScroll:willPrintPageHeader:info: --> -tableScrollWillPrintPageHeader: // -tableScroll:willPrintPageFooter:info: --> -tableScrollWillPrintPageFooter: // -tableScroll:willEditAtRow:column: --> -tableScrollWillEdit: // -tableScroll:didEdit:atRow:column: --> -tableScrollDidEdit: // Added -didBecomeFirstResponder & -didResignFirstResponder. These are sent // by MiscTableView to MiscTableScroll at appropriate times. When becoming // first responder, -didBecomeFirstResponder notifies NSFontManager of the // current font setting and sends the did-become-first-responder notification. // -didResignFirstResponder sends the did-resign-first-responder notification. // Added new delegate messages -tableScrollDidBecomeFirstResponder: and // -tableScrollDidResignFirstResponder:. // Return type of -numberOfSelected{Slots|Rows|Columns} changed from (unsigned // int) to (int) to be consistent with other similarly named methods. Also, // since Java only deals with signed numbers, unsigned int would have been // promoted to eight bytes on the Java side with is undesirable. // Added two new categories to MiscTableScroll: DataSource & Notifications. // Moved data-source related delegate messages into DataSource and // notification related messages into Notifications. These categories are // required by the Java bridging tools in order to expose the contained // methods as members of a Java "interface". // Page header and footer are now strongly typed as NSView* rather than id. // Strong typing extends more cleanly to the Java side. // // Revision 1.31 1998/03/29 23:54:21 sunshine // v138.1: Added -tableScroll:shouldDelayWindowOrderingForEvent:. // Worked around OPENSTEP 4.2 for NT bug where compiler crashes when // sending a message to 'super' from within a category. //----------------------------------------------------------------------------- #import MISC_TS_EXTERN_BEGIN( "Objective-C" ) #import MISC_TS_EXTERN_END MISC_TS_CLASS_DEF( MiscTableBorder ); MISC_TS_CLASS_DEF( MiscDelegateFlags ); @class MiscTableScroll, MiscTableView, MiscBorderView, MiscCornerView; @class NSCell, NSClipView, NSFont, NSText; typedef struct MiscCellEditInfo { BOOL editing; // Is editing in progress? MiscCoord_P row; // Coords of edited cell. MiscCoord_P col; NSText* editor; // Field editor. id cell; // Temporary editing cell. int suspended; // Suspend/resume counter. } MiscCellEditInfo; typedef struct MiscBorderInfo { MiscTableBorder* border; MiscBorderView* view; NSClipView* clip; NSArray* sort_vector; BOOL isOn; BOOL autoSort; } MiscBorderInfo; @interface MiscTableScroll : NSScrollView { @private MiscTableView* tableView; MiscBorderInfo* info[2]; // { &colInfo, &rowInfo } MiscBorderInfo colInfo; MiscBorderInfo rowInfo; MiscCornerView* cornerView; NSFont* font; NSColor* textColor; NSColor* backgroundColor; NSColor* selectedTextColor; NSColor* selectedBackgroundColor; id delegate; id dataDelegate; MiscDelegateFlags* delegateFlags; MiscDelegateFlags* dataDelegateFlags; id target; id doubleTarget; SEL action; SEL doubleAction; int tag; MiscCompareEntryFunc sort_entry_func; MiscCompareSlotFunc sort_slot_func; MiscSelectionMode mode; int num_cols; // Currently active number of int num_rows; // columns and rows. int max_rows; // Highwater mark for Cell allocations. int max_cells; id* cells; NSView* pageHeader; NSView* pageFooter; MiscCellEditInfo editInfo; BOOL trackingMouse; BOOL enabled; BOOL lazy; BOOL drawsClippedText; id representedObject; } - (id)initWithFrame:(NSRect)frameRect; - (void)dealloc; // DELEGATE / TAG ------------------------------------------------------------- - (id)delegate; - (void)setDelegate:(id)obj; - (id)dataDelegate; - (void)setDataDelegate:(id)obj; - (int)tag; - (void)setTag:(int)x; - (id)representedObject; - (void)setRepresentedObject:(id)object; // TARGET / ACTION ------------------------------------------------------------ - (id)target; - (void)setTarget:(id)obj; - (id)doubleTarget; - (void)setDoubleTarget:(id)obj; - (SEL)action; - (void)setAction:(SEL)new_sel; - (SEL)doubleAction; - (void)setDoubleAction:(SEL)new_sel; - (BOOL)sendAction:(SEL)theAction to:(id)theTarget; - (BOOL)sendAction; - (BOOL)sendActionIfEnabled; - (BOOL)sendDoubleAction; - (BOOL)sendDoubleActionIfEnabled; // FONT ----------------------------------------------------------------------- - (NSFont*)font; - (void)setFont:(NSFont*)newFont; - (void)changeFont:(id)sender; + (NSFont*)defaultFont; // COLOR ---------------------------------------------------------------------- - (NSColor*)backgroundColor; - (void)setBackgroundColor:(NSColor*)value; // Sent to all cells. - (NSColor*)textColor; - (void)setTextColor:(NSColor*)value; // Sent to all cells. - (NSColor*)selectedBackgroundColor; - (void)setSelectedBackgroundColor:(NSColor*)value; // Sent to all cells. - (NSColor*)selectedTextColor; - (void)setSelectedTextColor:(NSColor*)value; // Sent to all cells. - (void)setColor:(NSColor*)value; // Alias for -setBackgroundColor: - (NSColor*)color; // Alias for -backgroundColor + (NSColor*)defaultBackgroundColor; + (NSColor*)defaultTextColor; + (NSColor*)defaultSelectedBackgroundColor; + (NSColor*)defaultSelectedTextColor; // SLOT ORDER ----------------------------------------------------------------- - (NSArray*)slotOrder:(MiscBorderType)b; - (NSArray*)columnOrder; - (NSArray*)rowOrder; - (BOOL)border:(MiscBorderType)b setSlotOrder:(NSArray*)list; - (BOOL)setColumnOrder:(NSArray*)list; - (BOOL)setRowOrder:(NSArray*)list; - (NSString*)slotOrderAsString:(MiscBorderType)b; - (NSString*)columnOrderAsString; - (NSString*)rowOrderAsString; - (BOOL)border:(MiscBorderType)b setSlotOrderFromString:(NSString*)s; - (BOOL)setColumnOrderFromString:(NSString*)s; - (BOOL)setRowOrderFromString:(NSString*)s; // SLOT SIZES ----------------------------------------------------------------- - (NSArray*)slotSizes:(MiscBorderType)b; - (NSArray*)columnSizes; - (NSArray*)rowSizes; - (BOOL)border:(MiscBorderType)b setSlotSizes:(NSArray*)list; - (BOOL)setColumnSizes:(NSArray*)list; - (BOOL)setRowSizes:(NSArray*)list; - (NSString*)slotSizesAsString:(MiscBorderType)b; - (NSString*)columnSizesAsString; - (NSString*)rowSizesAsString; - (BOOL)border:(MiscBorderType)b setSlotSizesFromString:(NSString*)s; - (BOOL)setColumnSizesFromString:(NSString*)s; - (BOOL)setRowSizesFromString:(NSString*)s; // MULTICAST MESSAGES --------------------------------------------------------- - (void)sendAction:(SEL)aSelector to:(id)anObject forAllCells:(BOOL)flag; - (int)makeCellsPerformSelector:(SEL)aSel selectedOnly:(BOOL)flag; - (int)makeCellsPerformSelector:(SEL)aSel with:(id)arg1 selectedOnly:(BOOL)f; - (int)makeCellsPerformSelector:(SEL)aSel with:(id)arg1 with:(id)arg2 selectedOnly:(BOOL)flag; - (int)makeCellsPerformSelector:(SEL)aSel; - (int)makeCellsPerformSelector:(SEL)aSel with:(id)arg1; - (int)makeCellsPerformSelector:(SEL)aSel with:(id)arg1 with:(id)arg2; // FINDING CELLS -------------------------------------------------------------- - (int)border:(MiscBorderType)b slotWithTag:(int)x; - (int)border:(MiscBorderType)b slotWithRepresentedObject:(id)object; - (int)columnWithTag:(int)x; - (int)columnWithRepresentedObject:(id)x; - (int)rowWithTag:(int)x; - (int)rowWithRepresentedObject:(id)x; - (id)cellWithTag:(int)x; - (id)cellWithRepresentedObject:(id)x; - (BOOL)getRow:(int*)row column:(int*)col ofCellWithTag:(int)x; - (BOOL)getRow:(int*)row column:(int*)col ofCellWithRepresentedObject:(id)obj; - (BOOL)getRow:(int*)row column:(int*)col ofCell:(NSCell*)cell; // TOTAL SIZE ----------------------------------------------------------------- - (float)totalSize:(MiscBorderType)b; - (float)totalWidth; - (float)totalHeight; - (void)constrainSize; // Applies constraints, updates views. // CORNER VIEW ---------------------------------------------------------------- - (NSString*)cornerTitle; - (void)setCornerTitle:(NSString*)s; // SLOTS ---------------------------------------------------------------------- - (MiscTableBorder*)border:(MiscBorderType)b; - (BOOL)slotTitlesOn:(MiscBorderType)b; - (BOOL)border:(MiscBorderType)b setSlotTitlesOn:(BOOL)on_off; // -border:setTitlesOn: Returns YES if changed. - (MiscTableTitleMode)slotTitleMode:(MiscBorderType)b; - (void)border:(MiscBorderType)b setSlotTitleMode:(MiscTableTitleMode)x; - (float)slotTitlesSize:(MiscBorderType)b; - (void)border:(MiscBorderType)b setSlotTitlesSize:(float)x; - (void)border:(MiscBorderType)b moveSlot:(int)fromPos toSlot:(int)toPos; - (int)border:(MiscBorderType)b slotPosition:(int)slot; - (int)border:(MiscBorderType)b slotAtPosition:(int)pos; - (NSArray*)border:(MiscBorderType)b physicalToVisual:(NSArray*)list; - (NSArray*)border:(MiscBorderType)b visualToPhysical:(NSArray*)list; - (BOOL)sizeableSlots:(MiscBorderType)b; - (BOOL)draggableSlots:(MiscBorderType)b; - (BOOL)modifierDragSlots:(MiscBorderType)b; - (float)uniformSizeSlots:(MiscBorderType)b; - (float)minUniformSizeSlots:(MiscBorderType)b; - (float)maxUniformSizeSlots:(MiscBorderType)b; - (float)border:(MiscBorderType)b slotAdjustedSize:(int)slot; - (float)border:(MiscBorderType)b slotSize:(int)slot; - (float)border:(MiscBorderType)b slotMinSize:(int)slot; - (float)border:(MiscBorderType)b slotMaxSize:(int)slot; - (BOOL)border:(MiscBorderType)b slotIsSizeable:(int)slot; - (BOOL)border:(MiscBorderType)b slotIsAutosize:(int)slot; - (NSString*)border:(MiscBorderType)b slotTitle:(int)slot; - (int)border:(MiscBorderType)b slotTag:(int)slot; - (id)border:(MiscBorderType)b slotRepresentedObject:(int)slot; - (MiscTableCellStyle)border:(MiscBorderType)b slotCellType:(int)slot; - (id)border:(MiscBorderType)b slotCellPrototype:(int)slot; - (void)border:(MiscBorderType)b setSizeableSlots:(BOOL)flag; - (void)border:(MiscBorderType)b setDraggableSlots:(BOOL)flag; - (void)border:(MiscBorderType)b setModifierDragSlots:(BOOL)flag; - (void)border:(MiscBorderType)b setUniformSizeSlots:(float)uniform_size; - (void)border:(MiscBorderType)b setMinUniformSizeSlots:(float)size; - (void)border:(MiscBorderType)b setMaxUniformSizeSlots:(float)size; - (void)border:(MiscBorderType)b setSlot:(int)n size:(float)size; - (void)border:(MiscBorderType)b setSlot:(int)n minSize:(float)size; - (void)border:(MiscBorderType)b setSlot:(int)n maxSize:(float)size; - (void)border:(MiscBorderType)b setSlot:(int)n sizeable:(BOOL)flag; - (void)border:(MiscBorderType)b setSlot:(int)n autosize:(BOOL)flag; - (void)border:(MiscBorderType)b setSlot:(int)n title:(NSString*)title; - (void)border:(MiscBorderType)b setSlot:(int)n tag:(int)tag; - (void)border:(MiscBorderType)b setSlot:(int)n representedObject:(id)object; - (void)border:(MiscBorderType)b setSlot:(int)n cellType:(MiscTableCellStyle)t; - (void)border:(MiscBorderType)b setSlot:(int)n cellPrototype:(id)cell; // COLS ----------------------------------------------------------------------- - (MiscTableBorder*)columnBorder; - (BOOL)columnTitlesOn; - (BOOL)setColumnTitlesOn:(BOOL)on_off; // Returns YES if changed. - (MiscTableTitleMode)columnTitleMode; - (void)setColumnTitleMode:(MiscTableTitleMode)x; - (float)columnTitlesHeight; - (void)setColumnTitlesHeight:(float)x; - (void)moveColumn:(int)fromPos toColumn:(int)toPos; - (int)columnPosition:(int)col; - (int)columnAtPosition:(int)pos; - (float)uniformSizeColumns; - (float)minUniformSizeColumns; - (float)maxUniformSizeColumns; - (BOOL)sizeableColumns; - (BOOL)draggableColumns; - (BOOL)modifierDragColumns; - (float)columnAdjustedSize:(int)col; - (float)columnSize:(int)col; - (float)columnMinSize:(int)col; - (float)columnMaxSize:(int)col; - (BOOL)columnIsSizeable:(int)col; - (BOOL)columnIsAutosize:(int)col; - (NSString*)columnTitle:(int)col; - (int)columnTag:(int)col; - (id)columnRepresentedObject:(int)col; - (MiscTableCellStyle)columnCellType:(int)col; - (id)columnCellPrototype:(int)col; - (void)setSizeableColumns:(BOOL)flag; - (void)setDraggableColumns:(BOOL)flag; - (void)setModifierDragColumns:(BOOL)flag; - (void)setUniformSizeColumns:(float)uniform_size; - (void)setMinUniformSizeColumns:(float)size; - (void)setMaxUniformSizeColumns:(float)size; - (void)setColumn:(int)col size:(float)size; - (void)setColumn:(int)col minSize:(float)size; - (void)setColumn:(int)col maxSize:(float)size; - (void)setColumn:(int)col sizeable:(BOOL)flag; - (void)setColumn:(int)col autosize:(BOOL)flag; - (void)setColumn:(int)col title:(NSString*)title; - (void)setColumn:(int)col tag:(int)tag; - (void)setColumn:(int)col representedObject:(id)object; - (void)setColumn:(int)col cellType:(MiscTableCellStyle)type; - (void)setColumn:(int)col cellPrototype:(id)cell; - (int)numberOfVisibleColumns; - (int)firstVisibleColumn; - (int)lastVisibleColumn; - (BOOL)columnIsVisible:(int)n; - (void)setFirstVisibleColumn:(int)n; - (void)setLastVisibleColumn:(int)n; // ROWS ----------------------------------------------------------------------- - (MiscTableBorder*)rowBorder; - (BOOL)rowTitlesOn; - (BOOL)setRowTitlesOn:(BOOL)on_off; - (MiscTableTitleMode)rowTitleMode; - (void)setRowTitleMode:(MiscTableTitleMode)x; - (float)rowTitlesWidth; - (void)setRowTitlesWidth:(float)x; - (void)moveRow:(int)fromPos toRow:(int)toPos; - (int)rowPosition:(int)row; - (int)rowAtPosition:(int)pos; - (BOOL)sizeableRows; - (BOOL)draggableRows; - (BOOL)modifierDragRows; - (float)uniformSizeRows; - (float)minUniformSizeRows; - (float)maxUniformSizeRows; - (float)rowAdjustedSize:(int)row; - (float)rowSize:(int)row; - (float)rowMinSize:(int)row; - (float)rowMaxSize:(int)row; - (BOOL)rowIsSizeable:(int)row; - (BOOL)rowIsAutosize:(int)row; - (NSString*)rowTitle:(int)row; - (int)rowTag:(int)row; - (id)rowRepresentedObject:(int)row; - (MiscTableCellStyle)rowCellType:(int)row; - (id)rowCellPrototype:(int)row; - (void)setSizeableRows:(BOOL)flag; - (void)setDraggableRows:(BOOL)flag; - (void)setModifierDragRows:(BOOL)flag; - (void)setUniformSizeRows:(float)uniform_size; - (void)setMinUniformSizeRows:(float)size; - (void)setMaxUniformSizeRows:(float)size; - (void)setRow:(int)row size:(float)size; - (void)setRow:(int)row minSize:(float)size; - (void)setRow:(int)row maxSize:(float)size; - (void)setRow:(int)row sizeable:(BOOL)flag; - (void)setRow:(int)row autosize:(BOOL)flag; - (void)setRow:(int)row title:(NSString*)title; - (void)setRow:(int)row tag:(int)tag; - (void)setRow:(int)row representedObject:(id)object; - (void)setRow:(int)row cellType:(MiscTableCellStyle)type; - (void)setRow:(int)row cellPrototype:(id)cell; - (int)numberOfVisibleRows; - (int)firstVisibleRow; - (int)lastVisibleRow; - (BOOL)rowIsVisible:(int)n; - (void)setFirstVisibleRow:(int)n; - (void)setLastVisibleRow:(int)n; // DRAWING -------------------------------------------------------------------- - (NSRect)documentClipRect; - (void)drawCellAtRow:(int)row column:(int)col; // Physical coords - (void)drawRow:(int)row; // Physical coords - (void)drawColumn:(int)col; // Physical coords - (void)border:(MiscBorderType)b drawSlot:(int)n; - (int)numberOfVisibleSlots:(MiscBorderType)b; - (int)firstVisibleSlot:(MiscBorderType)b; - (int)lastVisibleSlot:(MiscBorderType)b; - (BOOL)border:(MiscBorderType)b slotIsVisible:(int)n; - (void)border:(MiscBorderType)b setFirstVisibleSlot:(int)n; - (void)border:(MiscBorderType)b setLastVisibleSlot:(int)n; - (void)scrollCellToVisibleAtRow:(int)row column:(int)col; // Physical coords - (void)scrollRowToVisible:(int)row; // Physical coord - (void)scrollColumnToVisible:(int)col; // Physical coord - (void)scrollSelectionToVisible; - (void)border:(MiscBorderType)b drawSlotTitle:(int)n; - (void)drawRowTitle:(int)n; - (void)drawColumnTitle:(int)n; - (void)sizeToCells; - (void)sizeToFit; - (BOOL)drawsClippedText; - (void)setDrawsClippedText:(BOOL)x; // INTERNAL COMMUNICATIONS ON USER-ACTIONS FOR SUBCLASSES ONLY ---------------- // Protected: BorderView -> TableScroll - (void)border:(MiscBorderType)b slotDragged:(int)fromPos toSlot:(int)toPos; - (void)border:(MiscBorderType)b slotSortReversed:(int)n; - (void)border:(MiscBorderType)b slotResized:(int)n; // Protected: TableView -> TableScroll - (void)didBecomeFirstResponder; - (void)didResignFirstResponder; // OPENSTEP 4.2/NT COMPILER BUG WORK-AROUND; DO NOT USE THESE METHODS --------- // See implementation for an explanation. - (id)superInitWithCoder:(NSCoder*)coder; - (void)superEncodeWithCoder:(NSCoder*)coder; - (void)superKeyDown:(NSEvent*)p; - (id)superValidRequestorForSendType:(NSString*)s returnType:(NSString*)r; @end // SELECTION ------------------------------------------------------------------ @interface MiscTableScroll(Selection) - (MiscSelectionMode)selectionMode; - (void)setSelectionMode:(MiscSelectionMode)x; - (BOOL)hasSlotSelection:(MiscBorderType)b; - (BOOL)hasRowSelection; - (BOOL)hasColumnSelection; - (BOOL)hasMultipleSlotSelection:(MiscBorderType)b; - (BOOL)hasMultipleRowSelection; - (BOOL)hasMultipleColumnSelection; - (int)numberOfSelectedSlots:(MiscBorderType)b; - (int)numberOfSelectedRows; - (int)numberOfSelectedColumns; - (BOOL)border:(MiscBorderType)b slotIsSelected:(MiscCoord_P)slot; - (BOOL)rowIsSelected:(MiscCoord_P)row; - (BOOL)columnIsSelected:(MiscCoord_P)col; - (BOOL)cellIsSelectedAtRow:(MiscCoord_P)row column:(MiscCoord_P)col; - (MiscCoord_P)selectedSlot:(MiscBorderType)b; - (MiscCoord_P)selectedRow; - (MiscCoord_P)selectedColumn; - (id)selectedCell; - (NSArray*)selectedSlotTags:(MiscBorderType)b; - (NSArray*)selectedRowTags; - (NSArray*)selectedColumnTags; - (NSArray*)selectedSlots:(MiscBorderType)b; - (NSArray*)selectedRows; - (NSArray*)selectedColumns; - (void)border:(MiscBorderType)b selectSlot:(MiscCoord_P)slot byExtendingSelection:(BOOL)flag; - (void)border:(MiscBorderType)b selectSlot:(MiscCoord_P)slot; - (void)selectRow:(MiscCoord_P)row byExtendingSelection:(BOOL)flag; - (void)selectRow:(MiscCoord_P)row; - (void)selectColumn:(MiscCoord_P)col byExtendingSelection:(BOOL)flag; - (void)selectColumn:(MiscCoord_P)col; - (void)border:(MiscBorderType)b selectSlotsWithTags:(NSArray*)tags byExtendingSelection:(BOOL)flag; - (void)border:(MiscBorderType)b selectSlotsWithTags:(NSArray*)tags; - (void)selectRowsWithTags:(NSArray*)tags byExtendingSelection:(BOOL)flag; - (void)selectRowsWithTags:(NSArray*)tags; - (void)selectColumnsWithTags:(NSArray*)tags byExtendingSelection:(BOOL)flag; - (void)selectColumnsWithTags:(NSArray*)tags; - (void)border:(MiscBorderType)b selectSlots:(NSArray*)slots byExtendingSelection:(BOOL)flag; - (void)border:(MiscBorderType)b selectSlots:(NSArray*)slots; - (void)selectRows:(NSArray*)rows byExtendingSelection:(BOOL)flag; - (void)selectRows:(NSArray*)rows; - (void)selectColumns:(NSArray*)cols byExtendingSelection:(BOOL)flag; - (void)selectColumns:(NSArray*)cols; - (void)selectAllSlots:(MiscBorderType)b; - (void)selectAllRows; - (void)selectAllColumns; - (void)selectAll:(id)sender; // -selectAllRows and sends action to target. - (void)border:(MiscBorderType)b deselectSlot:(MiscCoord_P)slot; - (void)deselectRow:(MiscCoord_P)row; - (void)deselectColumn:(MiscCoord_P)col; - (void)border:(MiscBorderType)b deselectSlotsWithTags:(NSArray*)tags; - (void)deselectRowsWithTags:(NSArray*)tags; - (void)deselectColumnsWithTags:(NSArray*)tags; - (void)border:(MiscBorderType)b deselectSlots:(NSArray*)slots; - (void)deselectRows:(NSArray*)rows; - (void)deselectColumns:(NSArray*)cols; - (void)clearSlotSelection:(MiscBorderType)b; - (void)clearRowSelection; - (void)clearColumnSelection; - (void)clearSelection; - (void)deselectAll:(id)sender; // -clearSelection and sends action to target. - (void)selectionChanged; // Subclasses may want to override. // MOUSE & KEYBOARD TRACKING (SELECTION ORIENTATION) -------------------------- - (void)setSelectsByRows:(BOOL)flag; - (BOOL)selectsByRows; - (BOOL)isTrackingMouse; - (MiscCoord_P)clickedSlot:(MiscBorderType)b; - (MiscCoord_P)clickedRow; - (MiscCoord_P)clickedColumn; - (id)clickedCell; // KEYBOARD CURSOR ------------------------------------------------------------ - (MiscCoord_P)cursorSlot:(MiscBorderType)b; - (MiscCoord_P)cursorRow; - (MiscCoord_P)cursorColumn; - (void)border:(MiscBorderType)b setCursorSlot:(MiscCoord_P)slot; - (void)setCursorRow:(MiscCoord_P)row; - (void)setCursorColumn:(MiscCoord_P)col; - (void)clearCursorSlot:(MiscBorderType)b; - (void)clearCursorRow; - (void)clearCursorColumn; - (void)clearCursor; - (BOOL)hasValidCursorSlot:(MiscBorderType)b; - (BOOL)hasValidCursorRow; - (BOOL)hasValidCursorColumn; - (void)disableCursor; // Can nest. - (void)enableCursor; - (BOOL)isCursorEnabled; // ENABLED -------------------------------------------------------------------- - (BOOL)isEnabled; - (void)setEnabled:(BOOL)flag; @end // SORTING -------------------------------------------------------------------- @interface MiscTableScroll(Sort) - (MiscCompareSlotFunc)compareSlotFunction; - (void)setCompareSlotFunction:(MiscCompareSlotFunc)f; - (void)sortInfoInit:(MiscSlotSortInfo*)ip border:(MiscBorderType)b; - (void)sortInfoDone:(MiscSlotSortInfo*)ip; // Slots - (BOOL)autoSortSlots:(MiscBorderType)b; - (void)border:(MiscBorderType)b setAutoSortSlots:(BOOL)flag; - (NSArray*)slotSortVector:(MiscBorderType)b; - (void)border:(MiscBorderType)b setSlotSortVector:(NSArray*)v; - (void)sortSlots:(MiscBorderType)b; - (BOOL)slotsAreSorted:(MiscBorderType)b; - (BOOL)border:(MiscBorderType)b sortSlot:(int)n; - (BOOL)border:(MiscBorderType)b slotIsSorted:(int)n; - (int)border:(MiscBorderType)b compareSlots:(int)slot1 :(int)slot2 info:(MiscSlotSortInfo*)ip; - (int)border:(MiscBorderType)b compareSlots:(int)slot1 :(int)slot2; - (MiscCompareEntryFunc)border:(MiscBorderType)b slotSortFunction:(int)n; - (MiscSortDirection)border:(MiscBorderType)b slotSortDirection:(int)n; - (MiscSortType)border:(MiscBorderType)b slotSortType:(int)n; - (void)border:(MiscBorderType)b setSlot:(int)n sortFunction:(MiscCompareEntryFunc)x; - (void)border:(MiscBorderType)b setSlot:(int)n sortDirection:(MiscSortDirection)x; - (void)border:(MiscBorderType)b setSlot:(int)n sortType:(MiscSortType)x; // Cols - (BOOL)autoSortColumns; - (void)setAutoSortColumns:(BOOL)flag; - (NSArray*)columnSortVector; - (void)setColumnSortVector:(NSArray*)v; - (void)sortColumns; - (BOOL)columnsAreSorted; - (BOOL)sortColumn:(int)n; - (BOOL)columnIsSorted:(int)n; - (int)compareColumns:(int)c1 :(int)c2 info:(MiscSlotSortInfo*)ip; - (int)compareColumns:(int)c1 :(int)c2; - (MiscCompareEntryFunc)columnSortFunction:(int)n; - (MiscSortDirection)columnSortDirection:(int)n; - (MiscSortType)columnSortType:(int)n; - (void)setColumn:(int)n sortFunction:(MiscCompareEntryFunc)x; - (void)setColumn:(int)n sortDirection:(MiscSortDirection)x; - (void)setColumn:(int)n sortType:(MiscSortType)x; // Rows - (BOOL)autoSortRows; - (void)setAutoSortRows:(BOOL)flag; - (NSArray*)rowSortVector; - (void)setRowSortVector:(NSArray*)v; - (void)sortRows; - (BOOL)rowsAreSorted; - (BOOL)sortRow:(int)n; - (BOOL)rowIsSorted:(int)n; - (int)compareRows:(int)r1 :(int)r2 info:(MiscSlotSortInfo*)ip; - (int)compareRows:(int)r1 :(int)r2; - (MiscCompareEntryFunc)rowSortFunction:(int)n; - (MiscSortDirection)rowSortDirection:(int)n; - (MiscSortType)rowSortType:(int)n; - (void)setRow:(int)n sortFunction:(MiscCompareEntryFunc)x; - (void)setRow:(int)n sortDirection:(MiscSortDirection)x; - (void)setRow:(int)n sortType:(MiscSortType)x; @end // DATA MANIPULATION ---------------------------------------------------------- @interface MiscTableScroll(Data) - (BOOL)isLazy; - (void)setLazy:(BOOL)flag; - (id)cellAtRow:(int)row column:(int)col; // Lazy mode tables that perform multiple-buffering: - (int)bufferCount; // Lazy mode asks delegate/dataDelegate first then uses cellAtRow:column: // Eager mode goes straight to cellAtRow:column: - (int)tagAtRow:(int)row column:(int)col; - (int)intValueAtRow:(int)row column:(int)col; - (float)floatValueAtRow:(int)row column:(int)col; - (double)doubleValueAtRow:(int)row column:(int)col; - (NSString*)stringValueAtRow:(int)row column:(int)col; // For ButtonCells. - (NSString*)titleAtRow:(int)row column:(int)col; - (int)stateAtRow:(int)row column:(int)col; // Invoke delegate methods if possible. - (id)reviveCell:(id)cell atRow:(int)row column:(int)col; - (id)retireCell:(id)cell atRow:(int)row column:(int)col; // Builtin default implementation. - (id)doReviveCell:(id)cell atRow:(int)row column:(int)col; - (id)doRetireCell:(id)cell atRow:(int)row column:(int)col; - (void)addSlot:(MiscBorderType)b; - (void)border:(MiscBorderType)b insertSlot:(int)pos; - (void)border:(MiscBorderType)b removeSlot:(int)pos; - (int)numberOfSlots:(MiscBorderType)b; - (void)addColumn; - (void)insertColumn:(int)pos; - (void)removeColumn:(int)pos; - (int)numberOfColumns; - (void)addRow; - (void)insertRow:(int)pos; - (void)removeRow:(int)pos; - (int)numberOfRows; - (void)renewRows:(int)count; - (void)empty; // [self renewRows:0]; - (void)emptyAndReleaseCells; @end // READ / WRITE --------------------------------------------------------------- @interface MiscTableScroll(IO) - (void)awakeFromNib; - (id)initWithCoder:(NSCoder*)coder; - (void)encodeWithCoder:(NSCoder*)coder; @end // PASTEBOARD SUPPORT --------------------------------------------------------- @interface MiscTableScroll(Pasteboard) - (void)copy:(id)sender; - (void)cut:(id)sender; - (id)validRequestorForSendType:(NSString*)s returnType:(NSString*)r; - (id)builtinValidRequestorForSendType:(NSString*)s returnType:(NSString*)r; - (BOOL)canWritePboardType:(NSString*)type; - (BOOL)builtinCanWritePboardType:(NSString*)type; - (BOOL)writeSelectionToPasteboard:(NSPasteboard*)pboard types:(NSArray*)types; - (BOOL)builtinWriteSelectionToPasteboard:(NSPasteboard*)pboard types:(NSArray*)types; - (NSString*)stringForPboardType:(NSString*)type; - (NSString*)builtinStringForPboardType:(NSString*)type; - (NSString*)stringForNSStringPboardType; - (NSString*)stringForNSTabularTextPboardType; - (BOOL)readSelectionFromPasteboard:(NSPasteboard*)pboard; - (BOOL)builtinReadSelectionFromPasteboard:(NSPasteboard*)pboard; - (void)builtinRegisterServicesTypes; - (void)registerServicesTypes; @end // INCREMENTAL SEARCH --------------------------------------------------------- @interface MiscTableScroll(IncrementalSearch) - (BOOL)incrementalSearch:(NSEvent*)p; - (BOOL)doIncrementalSearch:(NSEvent*)p column:(int)col; - (BOOL)getIncrementalSearchColumn:(int*)col; - (BOOL)doGetIncrementalSearchColumn:(int*)col; @end // KEYBOARD EVENTS ------------------------------------------------------------ @interface MiscTableScroll(Keyboard) - (void)keyDown:(NSEvent*)event; @end // EDITING -------------------------------------------------------------------- @interface MiscTableScroll(Edit) - (NSRect)cellFrameAtRow:(int)row column:(int)col; // Physical coords - (BOOL)getRow:(int*)row column:(int*)col forPoint:(NSPoint)point; // Physical. - (BOOL)getPreviousEditRow:(MiscCoord_P*)p_row column:(MiscCoord_P*)p_col; - (BOOL)getNextEditRow:(MiscCoord_P*)p_row column:(MiscCoord_P*)p_col; - (BOOL)getNext:(BOOL)foreward editRow:(MiscCoord_P*)p_row column:(MiscCoord_P*)p_col; - (BOOL)isEditing; - (BOOL)finishEditing; // Normal, conditional termination. - (BOOL)abortEditing; // Forcibly abort the editing session. - (void)suspendEditing; // Temporary suspension while resizing. - (void)resumeEditing; // Resume editing after resizing. - (void)textDidEndEditing:(NSNotification*)notification; - (void)textDidBeginEditing:(NSNotification*)notification; - (void)textDidChange:(NSNotification*)notification; - (BOOL)textShouldBeginEditing:(NSText*)sender; - (BOOL)textShouldEndEditing:(NSText*)sender; - (void)edit:(NSEvent*)ev atRow:(MiscCoord_P)row column:(MiscCoord_P)col; - (BOOL)canEdit:(NSEvent*)ev atRow:(MiscCoord_P)row column:(MiscCoord_P)col; - (BOOL)editIfAble:(NSEvent*)ev atRow:(MiscCoord_P)row column:(MiscCoord_P)col; - (void)editCellAtRow:(MiscCoord_P)row column:(MiscCoord_P)col; @end // PRINTING ------------------------------------------------------------------- @interface MiscTableScroll(Print) - (void)print:(id)sender; - (MiscTablePrintInfo const*)getPrintInfo; - (NSView*)getPageHeader; - (NSView*)getPageFooter; - (void)setPageHeader:(NSView*)obj; - (void)setPageFooter:(NSView*)obj; @end // DELEGATE PROTOCOL ---------------------------------------------------------- @interface NSObject(MiscTableScrollDelegate) - (BOOL)tableScroll:(MiscTableScroll*)scroll getIncrementalSearchColumn:(int*)col; - (id)tableScroll:(MiscTableScroll*)scroll border:(MiscBorderType)b slotPrototype:(int)slot; - (NSString*)tableScroll:(MiscTableScroll*)scroll border:(MiscBorderType)b slotTitle:(int)slot; - (BOOL)tableScroll:(MiscTableScroll*)scroll allowDragOperationAtRow:(int)row column:(int)col; - (void)tableScroll:(MiscTableScroll*)scroll preparePasteboard:(NSPasteboard*)pb forDragOperationAtRow:(int)row column:(int)col; - (NSImage*)tableScroll:(MiscTableScroll*)scroll imageForDragOperationAtRow:(int)row column:(int)col; - (unsigned int)tableScroll:(MiscTableScroll*)scroll draggingSourceOperationMaskForLocal:(BOOL)isLocal; - (BOOL)tableScrollIgnoreModifierKeysWhileDragging:(MiscTableScroll*)scroll; - (BOOL)tableScroll:(MiscTableScroll*)scroll shouldDelayWindowOrderingForEvent:(NSEvent*)event; - (void)tableScrollRegisterServicesTypes:(MiscTableScroll*)scroll; - (id)tableScroll:(MiscTableScroll*)scroll validRequestorForSendType:(NSString*)sendType returnType:(NSString*)returnType; - (BOOL)tableScroll:(MiscTableScroll*)scroll canWritePboardType:(NSString*)type; - (NSString*)tableScroll:(MiscTableScroll*)scroll stringForPboardType:(NSString*)type; - (BOOL)tableScroll:(MiscTableScroll*)scroll writeSelectionToPasteboard:(NSPasteboard*)pboard types:(NSArray*)types; - (BOOL)tableScroll:(MiscTableScroll*)scroll readSelectionFromPasteboard:(NSPasteboard*)pboard; - (BOOL)tableScroll:(MiscTableScroll*)scroll canEdit:(NSEvent*)ev atRow:(int)row column:(int)col; - (void)tableScroll:(MiscTableScroll*)scroll edit:(NSEvent*)ev atRow:(int)row column:(int)col; - (void)tableScroll:(MiscTableScroll*)scroll abortEditAtRow:(int)row column:(int)col; @end // DELEGATE NOTIFICATIONS PROTOCOL -------------------------------------------- @interface NSObject(MiscTableScrollNotifications) - (void)tableScrollSlotDragged:(NSNotification*)n; - (void)tableScrollSlotSortReversed:(NSNotification*)n; - (void)tableScrollSlotResized:(NSNotification*)n; - (void)tableScrollChangeFont:(NSNotification*)n; - (void)tableScrollFontChanged:(NSNotification*)n; - (void)tableScrollBackgroundColorChanged:(NSNotification*)n; - (void)tableScrollSelectedBackgroundColorChanged:(NSNotification*)n; - (void)tableScrollSelectedTextColorChanged:(NSNotification*)n; - (void)tableScrollTextColorChanged:(NSNotification*)n; - (void)tableScrollWillPrint:(NSNotification*)n; - (void)tableScrollDidPrint:(NSNotification*)n; - (void)tableScrollWillPrintPageHeader:(NSNotification*)n; - (void)tableScrollWillPrintPageFooter:(NSNotification*)n; - (void)tableScrollWillEdit:(NSNotification*)n; - (void)tableScrollDidEdit:(NSNotification*)n; - (void)tableScrollDidBecomeFirstResponder:(NSNotification*)n; - (void)tableScrollDidResignFirstResponder:(NSNotification*)n; @end // DATA DELEGATE PROTOCOL ----------------------------------------------------- @interface NSObject(MiscTableScrollDataSource) - (int)tableScrollBufferCount:(MiscTableScroll*)scroll; - (id)tableScroll:(MiscTableScroll*)scroll cellAtRow:(int)row column:(int)col; - (id)tableScroll:(MiscTableScroll*)scroll reviveCell:(id)cell atRow:(int)row column:(int)col; - (id)tableScroll:(MiscTableScroll*)scroll retireCell:(id)cell atRow:(int)row column:(int)col; - (int)tableScroll:(MiscTableScroll*)scroll tagAtRow:(int)row column:(int)col; - (int)tableScroll:(MiscTableScroll*)scroll intValueAtRow:(int)row column:(int)col; - (float)tableScroll:(MiscTableScroll*)scroll floatValueAtRow:(int)row column:(int)col; - (double)tableScroll:(MiscTableScroll*)scroll doubleValueAtRow:(int)row column:(int)col; - (NSString*)tableScroll:(MiscTableScroll*)scroll stringValueAtRow:(int)row column:(int)col; - (NSString*)tableScroll:(MiscTableScroll*)scroll titleAtRow:(int)row column:(int)col; - (int)tableScroll:(MiscTableScroll*)scroll stateAtRow:(int)row column:(int)col; - (BOOL)tableScroll:(MiscTableScroll*)scroll setStringValue:(NSString*)s atRow:(int)row column:(int)col; @end // DATA CELL PROTOCOL --------------------------------------------------------- @interface NSObject(MiscTableScrollDataCell) - (id)tableScroll:(MiscTableScroll*)scroll reviveAtRow:(int)row column:(int)col; - (id)tableScroll:(MiscTableScroll*)scroll retireAtRow:(int)row column:(int)col; @end // NOTIFICATIONS -------------------------------------------------------------- #define MISC_NOTIFICATION(Q) \ MISC_TABLE_SCROLL_EXTERN NSString* const MiscTableScroll##Q##Notification MISC_NOTIFICATION( SlotDragged ); MISC_NOTIFICATION( SlotSortReversed ); MISC_NOTIFICATION( SlotResized ); MISC_NOTIFICATION( ChangeFont ); MISC_NOTIFICATION( FontChanged ); MISC_NOTIFICATION( BackgroundColorChanged ); MISC_NOTIFICATION( SelectedBackgroundColorChanged ); MISC_NOTIFICATION( SelectedTextColorChanged ); MISC_NOTIFICATION( TextColorChanged ); MISC_NOTIFICATION( WillPrint ); MISC_NOTIFICATION( DidPrint ); MISC_NOTIFICATION( WillPrintPageHeader ); MISC_NOTIFICATION( WillPrintPageFooter ); MISC_NOTIFICATION( WillEdit ); MISC_NOTIFICATION( DidEdit ); MISC_NOTIFICATION( DidBecomeFirstResponder ); MISC_NOTIFICATION( DidResignFirstResponder ); #undef MISC_NOTIFICATION #endif // __MiscTableScroll_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScrollData.M100444 1750 1750 55022 6757227334 25231 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollData.M // // The (DATA) category of MiscTableScroll. Implements the management // of the cells of the table. // // FIXME *SEL* // The current selection architecture is imposing undesirable overhead // on a *highly* used function, -cellAt::. We need to come up with a // better way to handle this. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollData.M,v 1.24 99/06/15 03:23:10 sunshine Exp $ // $Log: MiscTableScrollData.M,v $ // Revision 1.24 99/06/15 03:23:10 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Method renamed: tracking --> isTrackingMouse // // Revision 1.23 1997/06/18 10:08:53 sunshine // v125.9: Renamed methods containing: "buff" --> "buffer" // Color-related methods "highlight" --> "selected". // // Revision 1.22 97/04/15 09:07:40 sunshine // v0.125.8: Added "MiscTableScroll/" prefix to #import to facilitate new // framework organization. //----------------------------------------------------------------------------- #import #import #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" extern "Objective-C" { #import #import } extern "C" { #import #import #import } #define EAGER_CELL_AT(R,C) (cells[ (R) * num_cols + (C) ]) @implementation MiscTableScroll(DATA) //----------------------------------------------------------------------------- // - lazyCellAtRow:column: //----------------------------------------------------------------------------- - (id)lazyCellAtRow:(int)row column:(int)col { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_CELL_AT]; if (del != 0) { id c = [del tableScroll:self cellAtRow:row column:col]; if (c != 0 && [c respondsToSelector:@selector(setCellAttribute:to:)]) [c setCellAttribute:NSCellHighlighted to:([self isTrackingMouse] && row == [self clickedRow] && col == [self clickedColumn])]; return c; } return 0; } //----------------------------------------------------------------------------- // - eagerCellAtRow:column: //----------------------------------------------------------------------------- - (id)eagerCellAtRow:(int)row column:(int)col { return EAGER_CELL_AT( row, col ); } //----------------------------------------------------------------------------- // - cellAtRow:column: //----------------------------------------------------------------------------- - (id)cellAtRow:(int)row column:(int)col { id cell = 0; if ((unsigned int) row < (unsigned int) num_rows && (unsigned int) col < (unsigned int) num_cols) { if (!lazy) cell = EAGER_CELL_AT( row, col ); else cell = [self lazyCellAtRow:row column:col]; if ([cell respondsToSelector:@selector(setSelected:)]) // FIXME: *SEL* { MiscCoord_V vr = rowInfo.border->physicalToVisual(row); MiscCoord_V vc = colInfo.border->physicalToVisual(col); [cell setSelected:colInfo.border->selectionSet().contains(vc) || rowInfo.border->selectionSet().contains(vr)]; } } return cell; } //----------------------------------------------------------------------------- // tagAtRow:column:, intValueAtRow:column:, floatValueAtRow:column:, // doubleValueAtRow:column:, stringValueAtRow:column:, titleAtRow:column:, // stateAtRow:column: //----------------------------------------------------------------------------- #define MISC_CELL_VAL( DATA_TYPE, NAME, CMD )\ - (DATA_TYPE)NAME##AtRow:(int)r column:(int)c\ {\ id del = [self responsibleDelegate:MiscDelegateFlags::DEL_##CMD##_AT];\ if (del != 0)\ return [del tableScroll:self NAME##AtRow:r column:c];\ id cell = (!lazy ? EAGER_CELL_AT(r,c) : [self lazyCellAtRow:r column:c]);\ if (cell != 0 && [cell respondsToSelector:@selector(NAME)])\ return [cell NAME];\ return 0;\ } MISC_CELL_VAL( int, tag, TAG ) // tagAtRow:column: MISC_CELL_VAL( int, intValue, INT_VALUE ) // intValueAtRow:col... MISC_CELL_VAL( float, floatValue, FLOAT_VALUE ) // floatValueAtRow:c... MISC_CELL_VAL( double, doubleValue, DOUBLE_VALUE ) // doubleValueAtRow:... MISC_CELL_VAL( NSString*, stringValue, STRING_VALUE ) // stringValueAtRow:... MISC_CELL_VAL( int, state, STATE ) // stateAtRow:column: MISC_CELL_VAL( NSString*, title, TITLE ) // titleAtRow:column: #undef MISC_CELL_VAL //----------------------------------------------------------------------------- // - bufferCount // For lazy-mode tables that perform multiple-buffering. This can // avoid copying when accessing more than one cell at a time (such // as during sorting.) //----------------------------------------------------------------------------- - (int)bufferCount { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_BUFFER_COUNT]; if (del != 0) return [del tableScrollBufferCount:self]; return 1; } //----------------------------------------------------------------------------- // - expandIfNeeded //----------------------------------------------------------------------------- - (void)expandIfNeeded { int const num_cells = max_rows * num_cols; if (num_cells > max_cells) { NSZone* const z = [self zone]; int const nbytes = num_cells * sizeof(*cells); if (max_cells == 0) cells = (id*) NSZoneMalloc( z, nbytes ); else cells = (id*) NSZoneRealloc( z, cells, nbytes ); max_cells = num_cells; } } //----------------------------------------------------------------------------- // - extendMaxRows: //----------------------------------------------------------------------------- - (void)extendMaxRows:(int)new_max { int const old_max = max_rows; max_rows = new_max; [self expandIfNeeded]; NSZone* const z = [self zone]; MiscTableBorder* const bp = colInfo.border; id* p = cells + old_max * num_cols; for (int r = old_max; r < new_max; r++) for (int c = 0; c < num_cols; c++) *p++ = [bp->getPrototype_P(c) copyWithZone:z]; } //----------------------------------------------------------------------------- // - lazyInsertColumn: //----------------------------------------------------------------------------- - (void)lazyInsertColumn:(int)n { colInfo.border->insertAt(n,n); // FIXME: Check this. num_cols++; } //----------------------------------------------------------------------------- // - eagerInsertColumn: //----------------------------------------------------------------------------- - (void)eagerInsertColumn:(int)n { NSParameterAssert( 0 <= n ); NSParameterAssert( n <= num_cols ); NSParameterAssert( 0 < num_cols ); // lazyInsert must increment num_cols. if (max_rows > 0 || num_rows > 0) { if (max_rows == 0) max_rows = num_rows; [self expandIfNeeded]; int const num_new = num_cols; int const num_old = num_cols - 1; if (num_old > 0) // Shift old, existing cells. { int const frag = num_old - n; // #cols right of insert col. id* src = cells + (max_rows * num_old) - frag; id* dst = cells + (max_rows * num_new) - frag; if (frag > 0) // Last partial row. memmove( dst, src, frag * sizeof(*dst) ); int const nbytes = num_old * sizeof(*dst); src -= num_old; dst -= num_new; while (src > cells) // All full rows. { memmove( dst, src, nbytes ); src -= num_old; dst -= num_new; } } int row = 0; NSZone* const z = [self zone]; id const proto = colInfo.border->getPrototype_P(n); id* const plim = cells + (max_rows * num_new); id* p = cells + n; while (p < plim) // Initialize cells in new column. { *p = [self reviveCell:[proto copyWithZone:z] atRow:row++ column:n]; p += num_new; } } } //----------------------------------------------------------------------------- // - insertColumn: //----------------------------------------------------------------------------- - (void)insertColumn:(int)n { if (0 <= n && n <= num_cols) { [self lazyInsertColumn:n]; if (!lazy) [self eagerInsertColumn:n]; [self constrainSize]; [self resetSelection]; [self setNeedsDisplay:YES]; } } //----------------------------------------------------------------------------- // - addColumn //----------------------------------------------------------------------------- - (void)addColumn { [self insertColumn:num_cols]; } //----------------------------------------------------------------------------- // - lazyRemoveColumn: //----------------------------------------------------------------------------- - (void)lazyRemoveColumn:(int)n { colInfo.border->deleteAt_P(n); num_cols--; } //----------------------------------------------------------------------------- // - eagerRemoveColumn: //----------------------------------------------------------------------------- - (void)eagerRemoveColumn:(int)n { NSParameterAssert( 0 < num_cols ); NSParameterAssert( 0 <= n ); NSParameterAssert( n < num_cols ); if (max_rows > 0) { int const num_old = num_cols; int const num_new = num_cols - 1; id* dst = cells + n; id* src = dst + 1; id* const dst_lim = cells + (num_old * max_rows); int row = 0; while (dst < dst_lim) // Destroy deleted cells. { if (row < num_rows) [[self retireCell:*dst atRow:row++ column:n] release]; else [*dst release]; dst += num_old; } if (num_new > 0) // Shift remaining columns. { dst = cells + n; int const nbytes = num_new * sizeof(*dst); id* const src_lim = cells + (max_rows - 1) * num_old + n; while (src < src_lim) { memmove( dst, src, nbytes ); dst += num_new; src += num_old; } if (n < num_new) // Shift last partial row. memmove( dst, src, (num_new - n) * sizeof(*dst) ); } else // (num_new <= 0) { max_rows = 0; } } } //----------------------------------------------------------------------------- // - removeColumn: //----------------------------------------------------------------------------- - (void)removeColumn:(int)n { if (0 <= n && n < num_cols) { if (!lazy) [self eagerRemoveColumn:n]; [self lazyRemoveColumn:n]; [self constrainSize]; [self resetSelection]; [self setNeedsDisplay:YES]; } } //----------------------------------------------------------------------------- // - numberOfColumns //----------------------------------------------------------------------------- - (int)numberOfColumns { return num_cols; } //----------------------------------------------------------------------------- // - lazyInsertRow: //----------------------------------------------------------------------------- - (void)lazyInsertRow:(int)n { rowInfo.border->insertAt(n,n); // FIXME. Check this. num_rows++; } //----------------------------------------------------------------------------- // - eagerInsertRow: //----------------------------------------------------------------------------- - (void)eagerInsertRow:(int)n { NSParameterAssert( 0 < num_rows ); // lazy-insert must increment num_rows NSParameterAssert( 0 <= n ); NSParameterAssert( n < num_rows ); if (num_cols > 0) { max_rows++; // Incremental growth. NSParameterAssert( num_rows <= max_rows ); [self expandIfNeeded]; int const old_max = max_rows - 1; id* p = cells + n * num_cols; if (n < old_max) // Shift other rows. { id* src = p; id* dst = src + num_cols; memmove( dst, src, (old_max - n) * num_cols * sizeof(*dst) ); } NSZone* const z = [self zone]; MiscTableBorder* const bp = colInfo.border; for (int c = 0; c < num_cols; c++) // Initialize new cells. *p++ = [self reviveCell:[bp->getPrototype_P(c) copyWithZone:z] atRow:n column:c]; } } //----------------------------------------------------------------------------- // - insertRow: //----------------------------------------------------------------------------- - (void)insertRow:(int)n { if (0 <= n && n <= num_rows) { [self lazyInsertRow:n]; if (!lazy) [self eagerInsertRow:n]; [self constrainSize]; [self resetSelection]; [self setNeedsDisplay:YES]; } } //----------------------------------------------------------------------------- // - eagerAddRow //----------------------------------------------------------------------------- - (void)eagerAddRow { // Lazy insertRow: must increment num_rows. NSParameterAssert( 0 < num_rows ); if (num_cols > 0) { if (num_rows >= max_rows) { NSParameterAssert( num_rows < (INT_MAX >> 1) ); int n = (max_rows != 0 ? max_rows : 16); while (n < num_rows) n <<= 1; [self extendMaxRows:n]; } int const r = num_rows - 1; id* p = cells + (num_cols * r); for (int c = 0; c < num_cols; c++) *p++ = [self reviveCell:*p atRow:r column:c]; } } //----------------------------------------------------------------------------- // - addRow // // NOTE: We explicitly do NOT -constrainSize here, because we expect that the // user will call this routine many times successively. //----------------------------------------------------------------------------- - (void)addRow { [self lazyInsertRow:num_rows]; if (!lazy) [self eagerAddRow]; } //----------------------------------------------------------------------------- // - lazyRemoveRow: //----------------------------------------------------------------------------- - (void)lazyRemoveRow:(int)n { rowInfo.border->deleteAt_P(n); num_rows--; } //----------------------------------------------------------------------------- // - eagerRemoveRow: //----------------------------------------------------------------------------- - (void)eagerRemoveRow:(int)n { NSParameterAssert( 0 < num_rows ); NSParameterAssert( 0 <= n ); NSParameterAssert( n < num_rows ); if (num_cols > 0) { NSParameterAssert( num_rows <= max_rows ); max_rows--; id* const dst = cells + (n * num_cols ); id* p = dst; id* const plim = p + num_cols; int col = 0; while (p < plim) // Destroy the cells. { [[self retireCell:*p atRow:n column:col++] release]; p++; } if (n < max_rows) memmove( dst, plim, (max_rows - n) * num_cols * sizeof(*dst) ); } } //----------------------------------------------------------------------------- // - removeRow: //----------------------------------------------------------------------------- - (void)removeRow:(int)n { if (0 <= n && n < num_rows) { if (!lazy) [self eagerRemoveRow:n]; [self lazyRemoveRow:n]; [self constrainSize]; [self resetSelection]; [self setNeedsDisplay:YES]; } } //----------------------------------------------------------------------------- // - numberOfRows //----------------------------------------------------------------------------- - (int)numberOfRows { return num_rows; } //----------------------------------------------------------------------------- // - lazyRenewRows: //----------------------------------------------------------------------------- - (void)lazyRenewRows:(int)n { rowInfo.border->setCount(n); num_rows = n; } //----------------------------------------------------------------------------- // - eagerRenewRows: //----------------------------------------------------------------------------- - (void)eagerRenewRows:(int)n { NSParameterAssert( 0 <= n ); if (num_cols > 0) { int const old_num_rows = num_rows; int const new_num_rows = n; if (n > max_rows) [self extendMaxRows:n]; if (old_num_rows < new_num_rows) // Growing { id* p = cells + old_num_rows * num_cols; for (int r = old_num_rows; r < new_num_rows; r++) for (int c = 0; c < num_cols; c++) *p++ = [self reviveCell:*p atRow:r column:c]; } else if (old_num_rows > new_num_rows) // Shrinking { id* p = cells + new_num_rows * num_cols; for (int r = new_num_rows; r < old_num_rows; r++) for (int c = 0; c < num_cols; c++) *p++ = [self retireCell:*p atRow:r column:c]; } } } //----------------------------------------------------------------------------- // - renewRows: //----------------------------------------------------------------------------- - (void)renewRows:(int)n { [self clearSelection]; if (0 <= n && n != num_rows) { if (!lazy) [self eagerRenewRows:n]; [self lazyRenewRows:n]; } [self constrainSize]; [self setNeedsDisplay:YES]; } //----------------------------------------------------------------------------- // - empty //----------------------------------------------------------------------------- - (void)empty { [self renewRows:0]; } //----------------------------------------------------------------------------- // - releaseCells //----------------------------------------------------------------------------- - (void)releaseCells { if (max_rows > 0 && num_cols > 0) { id* p = cells; id* const plim = p + (max_rows * num_cols); while (p < plim) [*p++ release]; } if (cells != 0) NSZoneFree( [self zone], cells ); cells = 0; max_cells = 0; max_rows = 0; } //----------------------------------------------------------------------------- // - emptyAndReleaseCells //----------------------------------------------------------------------------- - (void)emptyAndReleaseCells { [self empty]; [self releaseCells]; } //----------------------------------------------------------------------------- // - setLazy: //----------------------------------------------------------------------------- - (void)setLazy:(BOOL)flag { if (lazy != flag) { lazy = flag; if (lazy) [self emptyAndReleaseCells]; else [self eagerRenewRows:num_rows]; } } //----------------------------------------------------------------------------- // - isLazy //----------------------------------------------------------------------------- - (BOOL)isLazy { return lazy; } //----------------------------------------------------------------------------- // Generic Slot methods //----------------------------------------------------------------------------- - (void)addSlot:(MiscBorderType)b { if (b == MISC_COL_BORDER) [self addColumn]; else [self addRow]; } - (void)border:(MiscBorderType)b insertSlot:(int)n { if (b == MISC_COL_BORDER) [self insertColumn:n]; else [self insertRow:n]; } - (void)border:(MiscBorderType)b removeSlot:(int)n { if (b == MISC_COL_BORDER) [self removeColumn:n]; else [self removeRow:n]; } - (int)numberOfSlots:(MiscBorderType)b { return (b == MISC_COL_BORDER) ? [self numberOfColumns] : [self numberOfRows]; } //----------------------------------------------------------------------------- // REVIVE //----------------------------------------------------------------------------- - (id)doReviveCell:(id)cell atRow:(int)row column:(int)col { if (cell != 0) { if ([cell respondsToSelector:@selector(setOwner:)]) [cell setOwner:self]; if ([cell respondsToSelector:@selector(setUseOwnerFont:)]) [cell setUseOwnerFont:YES]; if ([cell respondsToSelector:@selector(setUseOwnerTextColor:)]) [cell setUseOwnerTextColor:YES]; if ([cell respondsToSelector:@selector(setUseOwnerBackgroundColor:)]) [cell setUseOwnerBackgroundColor:YES]; if ([cell respondsToSelector: @selector(setUseOwnerSelectedTextColor:)]) [cell setUseOwnerSelectedTextColor:YES]; if ([cell respondsToSelector: @selector(setUseOwnerSelectedBackgroundColor:)]) [cell setUseOwnerSelectedBackgroundColor:YES]; if ([cell respondsToSelector:@selector(setOwnerFont:)]) [cell setOwnerFont:[self font]]; else if ([cell respondsToSelector:@selector(setFont:)]) [cell setFont:[self font]]; if ([cell respondsToSelector:@selector(setOwnerTextColor:)]) [cell setOwnerTextColor:[self textColor]]; else if ([cell respondsToSelector:@selector(setTextColor:)]) [cell setTextColor:[self textColor]]; if ([cell respondsToSelector:@selector(setOwnerBackgroundColor:)]) [cell setOwnerBackgroundColor:[self backgroundColor]]; else if ([cell respondsToSelector:@selector(setBackgroundColor:)]) [cell setBackgroundColor:[self backgroundColor]]; if ([cell respondsToSelector:@selector(setOwnerSelectedTextColor:)]) [cell setOwnerSelectedTextColor:[self selectedTextColor]]; else if ([cell respondsToSelector:@selector(setSelectedTextColor:)]) [cell setSelectedTextColor:[self selectedTextColor]]; if ([cell respondsToSelector: @selector(setOwnerSelectedBackgroundColor:)]) [cell setOwnerSelectedBackgroundColor: [self selectedBackgroundColor]]; else if ([cell respondsToSelector: @selector(setSelectedBackgroundColor:)]) [cell setSelectedBackgroundColor:[self selectedBackgroundColor]]; } return cell; } - (id)reviveCell:(id)cell atRow:(int)row column:(int)col { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_REVIVE_CELL]; if (del != 0) return [del tableScroll:self reviveCell:cell atRow:row column:col]; if (cell != 0 && [cell respondsToSelector: @selector(tableScroll:reviveAtRow:column:)]) return [cell tableScroll:self reviveAtRow:row column:col]; return [self doReviveCell:cell atRow:row column:col]; } //----------------------------------------------------------------------------- // RETIRE //----------------------------------------------------------------------------- - (id)doRetireCell:(id)cell atRow:(int)row column:(int)col { if ([cell respondsToSelector:@selector(setTitle:)]) [cell setTitle:@""]; else if ([cell respondsToSelector:@selector(setStringValue:)]) [cell setStringValue:@""]; return cell; } - (id)retireCell:(id)cell atRow:(int)row column:(int)col { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_RETIRE_CELL]; if (del != 0) return [del tableScroll:self retireCell:cell atRow:row column:col]; if (cell != 0 && [cell respondsToSelector: @selector(tableScroll:retireAtRow:column:)]) return [cell tableScroll:self retireAtRow:row column:col]; return [self doRetireCell:cell atRow:row column:col]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScrollEdit.M100444 1750 1750 41072 6757227334 25245 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollEdit.M // // Text cell editing support for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollEdit.M,v 1.9 99/06/15 03:28:11 sunshine Exp $ // $Log: MiscTableScrollEdit.M,v $ // Revision 1.9 99/06/15 03:28:11 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Now posts new text will-edit & did-edit notifications instead of sending // messages to the delegates directly. // Fixed bug: Was only sending NSControlTextDidEndNotification if one of the // delegates implemented the corresponding delegate method. This was // incorrect since it is possible that some other object may be listening for // the notification as well. It is now sent in all cases. // Method renamed: trackingBy --> selectsByRows // No longer unnecessarily imports . // // Revision 1.8 1998/03/29 23:56:01 sunshine // v138.1: Now uses NSColor's "system" colors for editing. // Fixed bug: Was sending NSControlTextDidChangeNotification in // -textDidBeginEditing: rather than NSControlTextDidBeginEditingNotification. // // Revision 1.7 98/03/23 07:48:00 sunshine // v134.1: Added -suspendEditing / -resumeEditing. Eliminated delegate // -tableScroll:edit:atRow:column: methods. //----------------------------------------------------------------------------- #import "MiscTableScrollPrivate.h" #import "MiscTableBorder.h" #import "MiscTableView.h" extern "Objective-C" { #import #import #import } typedef MiscDelegateFlags DF; @implementation MiscTableScroll(Edit) - (BOOL)isEditing { return editInfo.editing; } //----------------------------------------------------------------------------- // cellFrameAtRow:column: //----------------------------------------------------------------------------- - (NSRect)cellFrameAtRow:(int)row column:(int)col { return [self convertRect:[tableView cellFrameAtRow:row column:col] fromView:tableView]; } //----------------------------------------------------------------------------- // getRow:andCol:forPoint: //----------------------------------------------------------------------------- - (BOOL)getRow:(int*)row column:(int*)col forPoint:(NSPoint)point { return [tableView getRow:row column:col forPoint:[tableView convertPoint:point fromView:self]]; } //----------------------------------------------------------------------------- // - resendTextNotification:as: //----------------------------------------------------------------------------- - (void)resendTextNotification:(NSNotification*)n as:(NSString*)name { [[NSNotificationCenter defaultCenter] postNotificationName:name object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys: [n object], @"NSFieldEditor", 0]]; } //----------------------------------------------------------------------------- // postDidEditNotificationAtRow:column:changed: //----------------------------------------------------------------------------- - (void)postDidEditNotificationAtRow:(int)r column:(int)c changed:(BOOL)changed { [[NSNotificationCenter defaultCenter] postNotificationName:MiscTableScrollDidEditNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:changed], @"Changed", [NSNumber numberWithInt:r], @"Row", [NSNumber numberWithInt:c], @"Column", 0]]; } //----------------------------------------------------------------------------- // forceEditorDirty: // Unlike the NEXTSTEP 3.x Text system which *always* sends // -textWillEnd:, OPENSTEP 4.x only sends -textShouldEndEditing: if the // text was indeed edited. However, -suspendEditing & -resumeEditing // work by ending the old edit session and beginning a new one (without // the informing the delegate or the cell). The problem is that by // ending the old edit session, the text system loses the knowledge that // the user had changed the text, and consequently -textShouldEndEditing: // may not be called. This "hack" works around the problem by forcing // the text system to flag itself as dirty. (FIXME: The text is always // forced dirty even if the old session was not dirty. This errs on the // side of safety, though.) //----------------------------------------------------------------------------- - (void)forceEditorDirty:(NSText*)editor { [editor replaceCharactersInRange:NSMakeRange(0,0) withString:@"x"]; [editor setSelectedRange:NSMakeRange(0,1)]; [editor delete:0]; } //----------------------------------------------------------------------------- // setupFieldEditor: //----------------------------------------------------------------------------- - (void)setupFieldEditor:(NSText*)editor { [editor setDrawsBackground:YES]; [editor setBackgroundColor:[NSColor textBackgroundColor]]; [editor setTextColor:[NSColor textColor]]; [editor setNeedsDisplay:YES]; } //----------------------------------------------------------------------------- // resumeEditing //----------------------------------------------------------------------------- - (void)resumeEditing { if (editInfo.editing && --editInfo.suspended == 0) { int const row = editInfo.row; int const col = editInfo.col; NSText* const editor = [[self window] fieldEditor:YES forObject:self]; editInfo.editor = [editor retain]; id const cell = editInfo.cell; NSRect rect = [tableView cellInsideAtRow:row column:col]; [tableView scrollRectToVisible:rect]; [cell selectWithFrame:rect inView:tableView editor:editor delegate:self start:0 length:0]; [self setupFieldEditor:editor]; [self forceEditorDirty:editor]; [editor selectAll:0]; [self setClickedRow:row column:col]; } } //----------------------------------------------------------------------------- // suspendEditing //----------------------------------------------------------------------------- - (void)suspendEditing { if (editInfo.editing && editInfo.suspended++ == 0) { id const cell = editInfo.cell; NSText* const editor = editInfo.editor; NSString* const s = [[[editor string] copy] autorelease]; [editor setDelegate:0]; // Prevent -textDidEndEditing: invocation. [cell endEditing:editor]; [cell setStringValue:s]; [editor release]; editInfo.editor = 0; } } //----------------------------------------------------------------------------- // cleanupEditing //----------------------------------------------------------------------------- - (void)cleanupEditing { [editInfo.cell release]; editInfo.cell = 0; [editInfo.editor release]; editInfo.editor = 0; editInfo.editing = NO; editInfo.suspended = 0; } //----------------------------------------------------------------------------- // finishEditing //----------------------------------------------------------------------------- - (BOOL)finishEditing { NSWindow* win = [self window]; if ([self isEditing] && [win makeFirstResponder:win]) [win endEditingFor:editInfo.editor]; return ![self isEditing]; } //----------------------------------------------------------------------------- // abortEditing //----------------------------------------------------------------------------- - (BOOL)abortEditing { BOOL const rc = editInfo.editing; if (rc) { editInfo.editing = NO; int const r = editInfo.row; int const c = editInfo.col; if (editInfo.editor != 0) [editInfo.cell endEditing:editInfo.editor]; [self cleanupEditing]; id d; if ((d = [self responsibleDelegate:DF::DEL_ABORT_EDIT_AT]) != 0) [d tableScroll:self abortEditAtRow:r column:c]; [self postDidEditNotificationAtRow:r column:c changed:NO]; [self drawCellAtRow:r column:c]; } return rc; } //----------------------------------------------------------------------------- // getNext:editRow:column: //----------------------------------------------------------------------------- - (BOOL)getNext:(BOOL)foreward editRow:(MiscCoord_P*)p_row column:(MiscCoord_P*)p_col { MiscCoord_P pr = *p_row; MiscCoord_P pc = *p_col; MiscTableBorder const* const br = rowInfo.border; MiscTableBorder const* const bc = colInfo.border; MiscCoord_V const v_row = br->physicalToVisual( pr ); // Start pos. MiscCoord_V const v_col = bc->physicalToVisual( pc ); MiscCoord_V vr = v_row; MiscCoord_V vc = v_col; do { if (foreward) { if (++vc >= num_cols) { vc = 0; if (++vr >= num_rows) vr = 0; pr = br->visualToPhysical( vr ); } } else { if (--vc < 0) { vc = num_cols - 1; if (--vr < 0) vr = num_rows - 1; pr = br->visualToPhysical( vr ); } } if (vc == v_col && vr == v_row) // Wrapped to start pos. return NO; pc = bc->visualToPhysical( vc ); } while (![self canEdit:0 atRow:pr column:pc]); *p_row = pr; *p_col = pc; return YES; } //----------------------------------------------------------------------------- // getPreviousEditRow:column: //----------------------------------------------------------------------------- - (BOOL)getPreviousEditRow:(MiscCoord_P*)p_row column:(MiscCoord_P*)p_col { return [self getNext:NO editRow:p_row column:p_col]; } //----------------------------------------------------------------------------- // getNextEditRow:column: //----------------------------------------------------------------------------- - (BOOL)getNextEditRow:(MiscCoord_P*)p_row column:(MiscCoord_P*)p_col { return [self getNext:YES editRow:p_row column:p_col]; } //----------------------------------------------------------------------------- // textDidEndEditing: //----------------------------------------------------------------------------- - (void)textDidEndEditing:(NSNotification*)n { id d; NSText* theText = [n object]; int const why = [[[n userInfo] objectForKey:@"NSTextMovement"] intValue]; editInfo.editing = NO; NSString* s = [[[theText string] copy] autorelease]; [editInfo.cell endEditing:editInfo.editor]; int const r = editInfo.row; int const c = editInfo.col; NSString* t = [self stringValueAtRow:r column:c]; BOOL changed = ![s isEqualToString:t]; if (changed) { if ((d = [self responsibleDelegate:DF::DEL_SET_STRINGVALUE_AT]) != 0) changed = [d tableScroll:self setStringValue:s atRow:r column:c]; else [[self cellAtRow:r column:c] setStringValue:s]; } [self cleanupEditing]; [self postDidEditNotificationAtRow:r column:c changed:changed]; [self drawCellAtRow:r column:c]; if (changed) { if ([self autoSortRows]) [self sortRow:r]; if ([self autoSortColumns]) [self sortColumn:c]; } [self resendTextNotification:n as:NSControlTextDidEndEditingNotification]; if ([self responsibleDelegate:DF::DEL_TEXT_DID_END] == 0) { MiscCoord_P row = (MiscCoord_P)r; MiscCoord_P col = (MiscCoord_P)c; switch (why) { case NSReturnTextMovement: [[self window] makeFirstResponder:tableView]; [self sendAction]; break; case NSTabTextMovement: if ([self getNext:YES editRow:&row column:&col]) [self editCellAtRow:row column:col]; else [[self window] selectNextKeyView:self]; break; case NSBacktabTextMovement: if ([self getNext:NO editRow:&row column:&col]) [self editCellAtRow:row column:col]; else [[self window] selectPreviousKeyView:self]; break; // FIXME: CTRL-TAB => nextText, CTRL-SHIFT-TAB => previousText default: break; } } } //----------------------------------------------------------------------------- // textDidBeginEditing: //----------------------------------------------------------------------------- - (void)textDidBeginEditing:(NSNotification*)n { [self resendTextNotification:n as:NSControlTextDidBeginEditingNotification]; } //----------------------------------------------------------------------------- // textDidChange: //----------------------------------------------------------------------------- - (void)textDidChange:(NSNotification*)n { [self resendTextNotification:n as:NSControlTextDidChangeNotification]; } //----------------------------------------------------------------------------- // textShouldBeginEditing: //----------------------------------------------------------------------------- - (BOOL)textShouldBeginEditing:(NSText*)text { id d = [self responsibleDelegate:DF::DEL_TEXT_WILL_CHANGE]; if (d != 0) return [d control:(NSControl*)self textShouldBeginEditing:text]; return YES; } //----------------------------------------------------------------------------- // textShouldEndEditing: //----------------------------------------------------------------------------- - (BOOL)textShouldEndEditing:(NSText*)text { id d = [self responsibleDelegate:DF::DEL_TEXT_WILL_END]; if (d != 0) return [d control:(NSControl*)self textShouldEndEditing:text]; return YES; } //----------------------------------------------------------------------------- // edit:atRow:column: // NOTE *1*: Must set color *after* cell initiates editing, else cell will // install its own colors making text selection invisible. //----------------------------------------------------------------------------- - (void)edit:(NSEvent*)ev atRow:(MiscCoord_P)row column:(MiscCoord_P)col { [[NSNotificationCenter defaultCenter] postNotificationName:MiscTableScrollWillEditNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:row], @"Row", [NSNumber numberWithInt:col], @"Column", 0]]; id const cell = [[self cellAtRow:row column:col] copyWithZone:[self zone]]; id const editor = [[self window] fieldEditor:YES forObject:self]; editInfo.editing = YES; editInfo.row = row; editInfo.col = col; editInfo.editor = [editor retain]; editInfo.cell = [cell retain]; NSRect const rect = [tableView cellInsideAtRow:row column:col]; [tableView scrollRectToVisible:rect]; if (ev != 0) [cell editWithFrame:rect inView:tableView editor:editor delegate:self event:ev]; else [cell selectWithFrame:rect inView:tableView editor:editor delegate:self start:0 length:[[cell stringValue] length]]; [self setupFieldEditor:editor]; // NOTE *1* } //----------------------------------------------------------------------------- // canEdit:atRow:column: //----------------------------------------------------------------------------- - (BOOL)canEdit:(NSEvent*)ev atRow:(MiscCoord_P)row column:(MiscCoord_P)col { id d = [self responsibleDelegate:DF::DEL_CAN_EDIT_AT]; if (d != 0) return [d tableScroll:self canEdit:ev atRow:row column:col]; id const cell = [self cellAtRow:row column:col]; if ([cell respondsToSelector:@selector(tableScroll:canEdit:atRow:column:)]) return [cell tableScroll:self canEdit:ev atRow:row column:col]; return (ev == 0 || [ev clickCount] == 2) && [cell respondsToSelector:@selector(isEditable)] && [cell respondsToSelector:@selector(isEnabled)] && [cell isEditable] && [cell isEnabled]; } //----------------------------------------------------------------------------- // editIfAble:atRow:column: //----------------------------------------------------------------------------- - (BOOL)editIfAble:(NSEvent*)ev atRow:(MiscCoord_P)row column:(MiscCoord_P)col { if ([self canEdit:ev atRow:row column:col]) { [self edit:ev atRow:row column:col]; return YES; } return NO; } //----------------------------------------------------------------------------- // editCellAtRow:column: //----------------------------------------------------------------------------- - (void)editCellAtRow:(MiscCoord_P)row column:(MiscCoord_P)col { [self clearSelection]; if ([self selectsByRows]) { [self selectRow:row]; [self setCursorRow:row]; } else { [self selectColumn:col]; [self setCursorColumn:col]; } [self setClickedRow:row column:col]; [self edit:0 atRow:row column:col]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScrollIO.M100444 1750 1750 30267 6757227335 24674 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollIO.M // // Input and Output (IO) methods for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollIO.M,v 1.4 99/08/20 06:05:58 sunshine Exp $ // $Log: MiscTableScrollIO.M,v $ // Revision 1.4 99/08/20 06:05:58 sunshine // 140.1: Now archives the represented-object only if it conforms to the // NSCoding protocol. // // Revision 1.3 99/06/15 03:29:33 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Instance variable renamed: drawClippedText --> drawsClippedText // Now archives new "represented object". Incremented class version number. // // Revision 1.2 1998/03/29 23:56:48 sunshine // v138.1: #import was missing "MiscTableScroll/" for public header. // Worked around OPENSTEP 4.2 for NT bug where compiler crashes when // sending a message to 'super' from within a category. //----------------------------------------------------------------------------- #import #import #import "MiscCornerView.h" #import "MiscDelegateFlags.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import "MiscTableView.h" #import extern "Objective-C" { #import } @implementation MiscTableScroll(IO) //----------------------------------------------------------------------------- // - awakeFromNib //----------------------------------------------------------------------------- - (void)awakeFromNib { delegateFlags->setDelegate( [self delegate] ); dataDelegateFlags->setDelegate( [self dataDelegate] ); } //----------------------------------------------------------------------------- // - readString:isCString: //----------------------------------------------------------------------------- - (NSString*)readString:(NSCoder*)decoder isCString:(BOOL)isCString { NSString* s = @""; if (!isCString) s = [decoder decodeObject]; else { char* cstr = 0; [decoder decodeValueOfObjCType:@encode(char*) at:&cstr]; if (cstr != 0) { s = [NSString stringWithCString:cstr]; NSZoneFree( [decoder objectZone], cstr ); } } return s; } //----------------------------------------------------------------------------- // - read:selector: //----------------------------------------------------------------------------- - (SEL)read:(int)ver selector:(NSCoder*)decoder { SEL cmd = 0; BOOL const isCString = (ver < MISC_TS_VERSION_1000); NSString* s = [self readString:decoder isCString:isCString]; if (![s isEqualToString:@""]) cmd = NSSelectorFromString(s); return cmd; } //----------------------------------------------------------------------------- // - read:cornerTitle:globalInfo: // NOTE: Cannot unarchive sort_entry_func and sort_slot_func because they // are function addresses. //----------------------------------------------------------------------------- - (NSString*)read:(int)ver cornerTitleAndGlobalInfo:(NSCoder*)decoder { [decoder decodeValueOfObjCType:@encode(int) at:&tag]; [decoder decodeValueOfObjCType:@encode(BOOL) at:&enabled]; [decoder decodeValueOfObjCType:@encode(BOOL) at:&lazy]; if (ver < MISC_TS_VERSION_2 || (ver >= MISC_TS_VERSION_1000 && ver < MISC_TS_VERSION_1002)) drawsClippedText = NO; else [decoder decodeValueOfObjCType:@encode(BOOL) at:&drawsClippedText]; [decoder decodeValueOfObjCType:@encode(MiscSelectionMode) at:&mode]; font = [[decoder decodeObject] retain]; if (ver < MISC_TS_VERSION_1000) { textColor = [[decoder decodeNXColor] retain]; backgroundColor = [[decoder decodeNXColor] retain]; selectedTextColor = [[decoder decodeNXColor] retain]; selectedBackgroundColor = [[decoder decodeNXColor] retain]; id nextText = [decoder decodeObject]; id previousText = [decoder decodeObject]; [self setNextKeyView:nextText]; [previousText setNextKeyView:self]; } else { textColor = [[decoder decodeObject] retain]; backgroundColor = [[decoder decodeObject] retain]; selectedTextColor = [[decoder decodeObject] retain]; selectedBackgroundColor = [[decoder decodeObject] retain]; } delegate = [decoder decodeObject]; dataDelegate= [decoder decodeObject]; target = [decoder decodeObject]; doubleTarget= [decoder decodeObject]; action = [self read:ver selector:decoder]; doubleAction= [self read:ver selector:decoder]; representedObject = (ver < MISC_TS_VERSION_1003) ? 0 : [[decoder decodeObject] retain]; NSString* s = @""; if ((ver >= MISC_TS_VERSION_2 && ver < MISC_TS_VERSION_1000) || ver >= MISC_TS_VERSION_1002) s = [self readString:decoder isCString:(ver < MISC_TS_VERSION_1000)]; return s; } //----------------------------------------------------------------------------- // - read:border:decoder: //----------------------------------------------------------------------------- - (void)read:(int)ver border:(MiscBorderInfo*)p decoder:(NSCoder*)decoder { if (p->sort_vector != 0) { [p->sort_vector release]; p->sort_vector = 0; } if (ver >= MISC_TS_VERSION_1001) { p->sort_vector = [[decoder decodeObject] retain]; } else { int n; [decoder decodeValueOfObjCType:@encode(int) at:&n]; if (n > 0) { NSMutableArray* a = [[NSMutableArray allocWithZone:[self zone]] init]; for (int i = 0; i < n; i++) { int j; [decoder decodeValueOfObjCType:@encode(int) at:&j]; [a addObject:[NSNumber numberWithInt:j]]; } p->sort_vector = a; } } [decoder decodeValueOfObjCType:@encode(BOOL) at:&(p->isOn)]; [decoder decodeValueOfObjCType:@encode(BOOL) at:&(p->autoSort)]; if (ver < MISC_TS_VERSION_2 || (ver >= MISC_TS_VERSION_1000 && ver < MISC_TS_VERSION_1002)) { BOOL b; [decoder decodeValueOfObjCType:@encode(BOOL) at:&b]; // obsolete. [decoder decodeValueOfObjCType:@encode(BOOL) at:&b]; } if (p->border == 0) p->border = new( NSZoneMalloc( [self zone], sizeof(*(p->border)) ) ) MiscTableBorder( MISC_ROW_BORDER ); p->border->initWithCoder( decoder, ver ); } //----------------------------------------------------------------------------- // - read:cells: // FIXME: What happens when a non-empty non-lazy TableScroll reads the data // from a lazy, empty one. Does the memory get freed? //----------------------------------------------------------------------------- - (void)read:(int)ver cells:(NSCoder*)decoder { [decoder decodeValueOfObjCType:@encode(int) at:&num_cols]; [decoder decodeValueOfObjCType:@encode(int) at:&num_rows]; if (lazy) { max_rows = 0; // No rows have been allocated. max_cells = 0; cells = 0; } else // (!lazy) { max_rows = num_rows; max_cells = max_rows * num_cols; if (max_cells == 0) cells = 0; else { int const nbytes = max_cells * sizeof(*cells); cells = (id*) NSZoneMalloc( [self zone], nbytes ); id* p = cells; for (int r = 0; r < num_rows; r++) for (int c = 0; c < num_cols; c++) *p++ = [[decoder decodeObject] retain]; } } } //----------------------------------------------------------------------------- // - initWithCoder: //----------------------------------------------------------------------------- - (id)initWithCoder:(NSCoder*)decoder { [self superInitWithCoder:decoder]; NSString* class_name = [[MiscTableScroll class] description]; int const ver = [decoder versionForClassName:class_name]; if (((unsigned int)ver) > ((unsigned int)MISC_TS_VERSION)) [NSException raise:NSGenericException format: @"%@: old library (version %d), can't -read: new object (version %d)", class_name, MISC_TS_VERSION, ver ]; NSString* s = [self read:ver cornerTitleAndGlobalInfo:decoder]; [self read:ver border:&colInfo decoder:decoder]; [self read:ver border:&rowInfo decoder:decoder]; [self read:ver cells:decoder]; [self doInit:ver cornerTitle:s]; return self; } //----------------------------------------------------------------------------- // - writeSelector:encoder: //----------------------------------------------------------------------------- - (void)writeSelector:(SEL)cmd encoder:(NSCoder*)encoder { NSString* str = @""; if (cmd != 0) str = NSStringFromSelector( cmd ); [encoder encodeObject:str]; } //----------------------------------------------------------------------------- // - writeGlobalInfo: // NOTE: Cannot archive sort_entry_func and sort_slot_func because they // are function addresses. //----------------------------------------------------------------------------- - (void)writeGlobalInfo:(NSCoder*)encoder { [encoder encodeValueOfObjCType:@encode(int) at:&tag]; [encoder encodeValueOfObjCType:@encode(BOOL) at:&enabled]; [encoder encodeValueOfObjCType:@encode(BOOL) at:&lazy]; [encoder encodeValueOfObjCType:@encode(BOOL) at:&drawsClippedText]; [encoder encodeValueOfObjCType:@encode(MiscSelectionMode) at:&mode]; [encoder encodeObject:font]; [encoder encodeObject:textColor]; [encoder encodeObject:backgroundColor]; [encoder encodeObject:selectedTextColor]; [encoder encodeObject:selectedBackgroundColor]; [encoder encodeConditionalObject:delegate]; [encoder encodeConditionalObject:dataDelegate]; [encoder encodeConditionalObject:target]; [encoder encodeConditionalObject:doubleTarget]; [self writeSelector:action encoder:encoder]; [self writeSelector:doubleAction encoder:encoder]; [encoder encodeObject:(representedObject != 0 && [representedObject conformsToProtocol:@protocol(NSCoding)] ? representedObject : 0)]; [encoder encodeObject:[self cornerTitle]]; } //----------------------------------------------------------------------------- // - writeBorder:encoder: //----------------------------------------------------------------------------- - (void)writeBorder:(MiscBorderInfo*)p encoder:(NSCoder*)encoder { [encoder encodeObject:p->sort_vector]; [encoder encodeValueOfObjCType:@encode(BOOL) at:&(p->isOn)]; [encoder encodeValueOfObjCType:@encode(BOOL) at:&(p->autoSort)]; p->border->encodeWithCoder( encoder ); } //----------------------------------------------------------------------------- // - writeCells: //----------------------------------------------------------------------------- - (void)writeCells:(NSCoder*)encoder { [encoder encodeValueOfObjCType:@encode(int) at:&num_cols]; [encoder encodeValueOfObjCType:@encode(int) at:&num_rows]; if (!lazy) for (int r = 0; r < num_rows; r++) for (int c = 0; c < num_cols; c++) [encoder encodeObject:[self cellAtRow:r column:c]]; } //----------------------------------------------------------------------------- // - encodeWithCoder: //----------------------------------------------------------------------------- - (void)encodeWithCoder:(NSCoder*)encoder { // Ensure that subviews are NOT archived. if (colInfo.isOn) [colInfo.clip removeFromSuperview]; if (rowInfo.isOn) [rowInfo.clip removeFromSuperview]; if (rowInfo.isOn && colInfo.isOn) [cornerView removeFromSuperview]; [tableView removeFromSuperview]; [self superEncodeWithCoder:encoder]; [self writeGlobalInfo:encoder]; [self writeBorder:&colInfo encoder:encoder]; [self writeBorder:&rowInfo encoder:encoder]; [self writeCells:encoder]; // Restore state. [self setDocumentView:tableView]; if (colInfo.isOn) [self addSubview:colInfo.clip]; if (rowInfo.isOn) [self addSubview:rowInfo.clip]; if (rowInfo.isOn && colInfo.isOn) [self addSubview:cornerView]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScrollISearch.M100444 1750 1750 35606 6757227335 25705 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollIncSearch.M // // Incremental searching methods for MiscTableScroll. // // FIXME *1*: Need to handle Unichars. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollISearch.M,v 1.15 99/06/15 03:31:19 sunshine Exp $ // $Log: MiscTableScrollISearch.M,v $ // Revision 1.15 99/06/15 03:31:19 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Method renamed: trackingBy --> selectsByRows // Methods renamed: ...ISearchColumn: --> ...IncrementalSearchColumn: // // Revision 1.14 1998/03/30 01:02:39 sunshine // v138.1: Ported back to OPENSTEP 4.1. Compiler was complaining about // using enumeral and non-enumeral in conditional expression. // // Revision 1.13 98/03/23 11:12:16 sunshine // v136.1: Applied v0.136 NEXTSTEP 3.3 diffs. //----------------------------------------------------------------------------- #import #import "MiscBorderCell.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import "MiscTableView.h" extern "Objective-C" { #import #import } static float const ISEARCH_TIMEOUT = 2.5; // seconds enum MiscKeyAction { MISC_KEY_IGNORE, // Ignore this event, get next. MISC_KEY_SPACE, // Space character, not valid as first char. MISC_KEY_APPEND, // Append a character to the template. MISC_KEY_EXPAND, // Expand common-prefix. MISC_KEY_DELETE, // Delete the last character from template. MISC_KEY_CLEAR, // Clear (empty) the template. MISC_KEY_SELECT, // Stop, Select the first entry. MISC_KEY_EXECUTE, // Stop, Select and perform double action. MISC_KEY_STOP, // Stop, don't select, consume keystroke. MISC_KEY_ABORT, // Stop, don't select, don't consume. }; //----------------------------------------------------------------------------- // Feedback //----------------------------------------------------------------------------- class MISC_IS_Feedback { private: MiscTableScroll* scroll; BOOL drawn; MiscBorderCell* cell; NSRect drawRect; void init_cell(); public: MISC_IS_Feedback( MiscTableScroll* s ) : scroll(s),drawn(NO),cell(0) {} ~MISC_IS_Feedback() { if (cell != 0) [cell release]; } void draw( NSString* str ); void erase(); }; void MISC_IS_Feedback::init_cell() { if (cell == 0) { cell = [[MiscBorderCell allocWithZone:[scroll zone]] initTextCell:@""]; [cell setAlignment:NSLeftTextAlignment]; } } void MISC_IS_Feedback::erase() { if (drawn) { drawn = NO; [scroll displayRect:drawRect]; } } void MISC_IS_Feedback::draw( NSString* str ) { init_cell(); [cell setStringValue:str]; NSSize size = [cell cellSize]; NSRect clipFrame = [scroll documentClipRect]; NSRect r = NSMakeRect( NSMinX(clipFrame), NSMaxY(clipFrame) - size.height, size.width, size.height ); r = NSIntersectionRect( clipFrame, r ); [scroll lockFocus]; [cell drawWithFrame:r inView:scroll]; [scroll unlockFocus]; drawn = YES; drawRect = r; } //----------------------------------------------------------------------------- // classify_event //----------------------------------------------------------------------------- static MiscKeyAction classify_event(NSEvent* p) { int const BAD_FLAGS = (NSCommandKeyMask | NSHelpKeyMask | NSControlKeyMask); MiscKeyAction rc = MISC_KEY_ABORT; unichar const K_DEL = '\x7f'; NSEventType type = [p type]; if ([p type] == NSKeyDown) { if (([p modifierFlags] & BAD_FLAGS) == 0) { unichar const ch = [[p charactersIgnoringModifiers] characterAtIndex:0]; if (ch == K_DEL || ch == '\b') rc = MISC_KEY_DELETE; else if (ch == '\t') rc = MISC_KEY_EXPAND; else if (ch > ' ' && ch < K_DEL) // FIXME *1* rc = MISC_KEY_APPEND; else if (ch == ' ') rc = MISC_KEY_SPACE; } } else if (type == NSKeyUp || type == NSFlagsChanged) { rc = MISC_KEY_IGNORE; } return rc; } //----------------------------------------------------------------------------- // map // Conditionally apply a mapping vector to an index value. //----------------------------------------------------------------------------- inline static int map( int const* a, int x ) { return a ? a[x] : x; } //----------------------------------------------------------------------------- // DATA RETRIEVAL AND COMPARE SUPPORT //----------------------------------------------------------------------------- typedef NSString* (*Datafunc)( id obj, SEL cmd, MiscCoord_P row, MiscCoord_P col ); struct MiscSortTypeInfo { SEL const* data_sel; // Selector to use to retrieve string. BOOL fold_case; // Case insensitive compare? }; #define SEL_STRV &@selector(stringValueAtRow:column:) #define SEL_TITL &@selector(titleAtRow:column:) static MiscSortTypeInfo SORT_TYPE_INFO[ MISC_SORT_TYPE_MAX + 1 ] = { { SEL_STRV, YES }, // MISC_SORT_STRING_CASE_INSENSITIVE { SEL_STRV, NO }, // MISC_SORT_STRING_CASE_SENSITIVE { 0, NO }, // MISC_SORT_INT { 0, NO }, // MISC_SORT_UNSIGNED_INT { 0, NO }, // MISC_SORT_TAG { 0, NO }, // MISC_SORT_UNSIGNED_TAG { 0, NO }, // MISC_SORT_FLOAT { 0, NO }, // MISC_SORT_DOUBLE { 0, NO }, // MISC_SORT_SKIP { SEL_TITL, YES }, // MISC_SORT_TITLE_CASE_INSENSITIVE { SEL_TITL, NO }, // MISC_SORT_TITLE_CASE_SENSITIVE { 0, NO }, // MISC_SORT_STATE { 0, NO }, // MISC_SORT_UNSIGNED_STATE }; #undef SEL_STRV #undef SEL_TITL //----------------------------------------------------------------------------- // MISC_IS_bsearch //----------------------------------------------------------------------------- static int MISC_IS_bsearch( MiscCoord_V lo, MiscCoord_V hi, BOOL upper_bound, BOOL descending, MiscTableScroll* scroll, NSString* buff, MiscCoord_P col, MiscCoord_P const* v2p, Datafunc data_func, SEL data_sel, unsigned int cmp_mask ) { int const buff_len = [buff length]; while (lo <= hi) { MiscCoord_V const mid = (lo + hi) >> 1; MiscCoord_P const row = map( v2p, mid ); NSString* s = (*data_func)( scroll, data_sel, row, col ); if (s == 0) s = @""; int const s_len = [s length]; NSRange r = NSMakeRange( 0, s_len < buff_len ? s_len : buff_len ); int cmp = [s compare:buff options:cmp_mask range:r]; if (descending) cmp = -cmp; if (cmp < 0 || upper_bound && cmp == 0) lo = mid + 1; else hi = mid - 1; } return (upper_bound ? hi : lo); } //----------------------------------------------------------------------------- // peek_event //----------------------------------------------------------------------------- inline static NSEvent* peek_event( float timeout ) { return [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate dateWithTimeIntervalSinceNow:timeout] inMode:NSDefaultRunLoopMode dequeue:NO]; } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscTableScroll(IncrementalSearch) //----------------------------------------------------------------------------- // -doIncrementalSearch:column: FIXME *1* //----------------------------------------------------------------------------- - (BOOL)doIncrementalSearch:(NSEvent*)p column:(int)col { BOOL handled = YES; // Event was handled here. BOOL descending = NO; if (col < 0) { col = ~col; descending = YES; } if ([self border:MISC_COL_BORDER slotSortDirection:col] == MISC_SORT_DESCENDING) descending = !descending; MiscSortType type = [self border:MISC_COL_BORDER slotSortType:col]; MiscSortTypeInfo const& INFO = SORT_TYPE_INFO[type]; unsigned int const cmp_mask = INFO.fold_case ? (unsigned int)NSCaseInsensitiveSearch : 0; if (INFO.data_sel == 0 || [self border:MISC_COL_BORDER slotSortFunction:col] != 0) return NO; // *** RETURN *** SEL const data_sel = *(INFO.data_sel); Datafunc const data_func = (Datafunc) [self methodForSelector:data_sel]; MiscCoord_P const* const v2p = rowInfo.border->getV2PMap(); MISC_IS_Feedback feedback( self ); MiscKeyAction ka; int const MARGIN = 2; int const BUFF_MAX = 61; int buff_len = 0; char margin[ MARGIN + BUFF_MAX + 1 ]; char* buff = margin + MARGIN; MiscCoord_V first_stk[ BUFF_MAX + 1 ], last_stk[ BUFF_MAX + 1 ]; MiscCoord_V first = 0, last = [self numberOfRows] - 1; MiscCoord_V prev_first = -1; BOOL update_cursor = ([self selectsByRows]); BOOL changed = NO; for (int i = 0; i < MARGIN; i++) margin[i] = ' '; float delay = 0.25; first_stk[0] = first; last_stk [0] = last; ka = classify_event( p ); while (1) { [NSCursor setHiddenUntilMouseMoves:YES]; switch (ka) { case MISC_KEY_IGNORE: break; case MISC_KEY_SPACE: case MISC_KEY_APPEND: if (buff_len < BUFF_MAX && first <= last) { unichar ch = [[p characters] characterAtIndex:0]; buff[ buff_len++ ] = char( ch ); buff[ buff_len ] = '\0'; NSString* s = [NSString stringWithCString:buff]; MiscCoord_V const new_first = MISC_IS_bsearch( first, last, NO, descending, self, s, col, v2p, data_func, data_sel, cmp_mask ); MiscCoord_V const new_last = MISC_IS_bsearch( new_first, last, YES, descending, self, s, col, v2p, data_func, data_sel, cmp_mask ); if (new_first <= new_last) { first = new_first; last = new_last; first_stk[ buff_len ] = first; last_stk [ buff_len ] = last; changed = YES; } else // Do not add "invalid" characters. { buff[ --buff_len ] = '\0'; if (ka == MISC_KEY_SPACE) { ka = MISC_KEY_SELECT; goto finished; // *** GOTO *** } else if (buff_len == 0) { // Couldn't even add 1st char, handled = NO; // so don't go modal. goto finished; // *** GOTO *** } else NSBeep(); } } else NSBeep(); break; case MISC_KEY_EXPAND: { if (first <= last) { NSString* s1 = (*data_func)( self, data_sel, map( v2p, first ), col ); NSString* s2 = (*data_func)( self, data_sel, map( v2p, last ), col ); NSString* s = [s1 commonPrefixWithString:s2 options:cmp_mask]; int i = [s length];; if (i > buff_len) { for (int j = buff_len + 1; j <= i; j++) { first_stk[j] = first; last_stk[j] = last; } buff_len = i; strncpy( buff, [s cString], buff_len ); buff[ buff_len ] = '\0'; changed = YES; } } } break; case MISC_KEY_DELETE: if (buff_len > 0) { buff[ --buff_len ] = '\0'; first = first_stk[ buff_len ]; last = last_stk[ buff_len ]; changed = YES; } else goto finished; // *** GOTO *** break; case MISC_KEY_CLEAR: case MISC_KEY_SELECT: case MISC_KEY_EXECUTE: case MISC_KEY_STOP: case MISC_KEY_ABORT: goto finished; // *** GOTO *** } if ((p = peek_event( delay )) == 0) { if (changed) { changed = NO; NSWindow* win = [self window]; [win disableFlushWindow]; feedback.erase(); if (prev_first != first) { prev_first = first; MiscCoord_P const r = map( v2p, first ); [self border:MISC_ROW_BORDER setFirstVisibleSlot:r]; if (update_cursor) [self border:MISC_ROW_BORDER setCursorSlot:r]; [self displayIfNeeded]; } NSString* s = [NSString stringWithCString:margin]; feedback.draw( s ); [win enableFlushWindow]; [win flushWindow]; if (buff_len == 0) break; // *** BREAK *** } if ((p = peek_event( ISEARCH_TIMEOUT )) == 0) break; // *** BREAK *** inactivity timeout. } delay = 0.0; ka = classify_event( p ); if (ka != MISC_KEY_ABORT) // "Eat" the event. [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate dateWithTimeIntervalSinceNow:ISEARCH_TIMEOUT] inMode:NSDefaultRunLoopMode dequeue:YES]; } finished: feedback.erase(); if (ka==MISC_KEY_SELECT || ka==MISC_KEY_EXECUTE) { MiscCoord_P const phys_first = map( v2p, first ); if (prev_first != first) { [self border:MISC_ROW_BORDER setFirstVisibleSlot:phys_first]; if (update_cursor) [self border:MISC_ROW_BORDER setCursorSlot:phys_first]; } if (update_cursor) [self keyboardSelect:p]; if ([self isEnabled]) { [self sendAction]; if (ka == MISC_KEY_EXECUTE) [self sendDoubleAction]; } } return handled; } //----------------------------------------------------------------------------- // -doGetIncrementalSearchColumn: // Default implementation. If auto-sort-rows is on, and the first // non-skip column is string-based, use that column, else fail. //----------------------------------------------------------------------------- - (BOOL)doGetIncrementalSearchColumn:(int*)col { if ([self autoSortRows]) { int const lim = colInfo.border->count(); int const* v2p = colInfo.border->getV2PMap(); for (int i = 0; i < lim; i++) { int const j = map( v2p, i ); if ([self border:MISC_COL_BORDER slotSortFunction:j] != 0) return NO; MiscSortType const t = [self border:MISC_COL_BORDER slotSortType:j]; if (t != MISC_SORT_SKIP) { *col = j; return (SORT_TYPE_INFO[t].data_sel != 0); } } } return NO; } //----------------------------------------------------------------------------- // -getIncrementalSearchColumn: //----------------------------------------------------------------------------- - (BOOL)getIncrementalSearchColumn:(int*)col { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_GET_ISEARCH_COL]; if (del != 0) return [del tableScroll:self getIncrementalSearchColumn:col]; return [self doGetIncrementalSearchColumn:col]; } //----------------------------------------------------------------------------- // -incrementalSearch: //----------------------------------------------------------------------------- - (BOOL)incrementalSearch:(NSEvent*)p { if ([self numberOfRows] > 0 && [self numberOfColumns] > 0) { MiscKeyAction const ka = classify_event( p ); if (ka == MISC_KEY_APPEND) { int col; if ([self getIncrementalSearchColumn:&col]) return [self doIncrementalSearch:p column:col]; } } return NO; // Event was not handled here. } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScrollKB.M100444 1750 1750 25326 6757227335 24661 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollKB.M // // Keyboard event handling for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollKB.M,v 1.8 99/06/15 03:32:16 sunshine Exp $ // $Log: MiscTableScrollKB.M,v $ // Revision 1.8 99/06/15 03:32:16 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Method renamed: trackingBy --> selectsByRows // // Revision 1.7 1997/06/18 10:50:46 sunshine // v125.9: Worked around Objective-C++ compiler crash in OPENSTEP 4.2 for NT // when sending message to 'super' from within a category. // // Revision 1.6 97/04/15 09:08:47 sunshine // v0.125.8: Added "MiscTableScroll/" prefix to #import to facilitate new // framework organization. //----------------------------------------------------------------------------- #import #import "MiscTableView.h" enum KB_Action { ACT_IGNORE, ACT_SELECT, ACT_PERFORM, ACT_LEFT, ACT_RIGHT, ACT_UP, ACT_DOWN, ACT_PAGE_LEFT, ACT_PAGE_RIGHT, ACT_PAGE_UP, ACT_PAGE_DOWN, ACT_LEFT_EDGE, ACT_RIGHT_EDGE, ACT_TOP_EDGE, ACT_BOT_EDGE, ACT_NUM_ACTIONS }; enum { K_RETURN = '\r', K_SPACE = ' ' , K_LEFT = NSLeftArrowFunctionKey, K_UP = NSUpArrowFunctionKey, K_RIGHT = NSRightArrowFunctionKey, K_DOWN = NSDownArrowFunctionKey, K_KP_LEFT = '4', K_KP_UP = '8', K_KP_RIGHT = '6', K_KP_DOWN = '2', K_KP_PAGE_UP = '9', K_KP_PAGE_DOWN = '3', K_KP_HOME = '7', K_KP_END = '1', K_KP_INSERT = '0', K_KP_ENTER = 0x03, K_PAGE_UP = NSPageUpFunctionKey, K_PAGE_DOWN = NSPageDownFunctionKey, K_HOME = NSHomeFunctionKey, K_END = NSEndFunctionKey, }; //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscTableScroll(Keyboard) //----------------------------------------------------------------------------- // - keyboardSelect: //----------------------------------------------------------------------------- - (void)keyboardSelect:(NSEvent*)p { [tableView keyboardSelect:p]; [self clearSlotSelection: // Clear *other* border. [tableView selectsByRows] ? MISC_COL_BORDER : MISC_ROW_BORDER]; [self selectionChanged]; [self sendActionIfEnabled]; } //----------------------------------------------------------------------------- // goFirstSlot: //----------------------------------------------------------------------------- - (void)goFirstSlot:(MiscBorderType)b { if ([self numberOfSlots:b] > 0) { int const s = [self border:b slotAtPosition:0]; NSWindow* const w = [self window]; [w disableFlushWindow]; [self border:b setCursorSlot:s]; [self border:b setFirstVisibleSlot:s]; [w enableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // goLastSlot //----------------------------------------------------------------------------- - (void)goLastSlot:(MiscBorderType)b { int const n = [self numberOfSlots:b]; if (n > 0) { int s = [self border:b slotAtPosition:(n - 1)]; NSWindow* const w = [self window]; [w disableFlushWindow]; [self border:b setCursorSlot:s]; [self border:b setLastVisibleSlot:s]; [w enableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // goPrevPage: //----------------------------------------------------------------------------- - (void)goPrevPage:(MiscBorderType)b { if ([self numberOfSlots:b] > 0) { int sFirst = [self firstVisibleSlot:b]; int const sLast = [self lastVisibleSlot:b]; int const v = [self border:b slotPosition:sFirst]; if (sFirst == sLast && v > 0) sFirst = [self border:b slotAtPosition:(v - 1)]; NSWindow* const w = [self window]; [w disableFlushWindow]; [self border:b setLastVisibleSlot:sFirst]; if (b == ([self selectsByRows] ? MISC_ROW_BORDER : MISC_COL_BORDER)) [self border:b setCursorSlot:[self firstVisibleSlot:b]]; [w enableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // goNextPage: //----------------------------------------------------------------------------- - (void)goNextPage:(MiscBorderType)b { int const lim = [self numberOfSlots:b]; if (lim > 0) { int const sFirst = [self firstVisibleSlot:b]; int sLast = [self lastVisibleSlot:b]; int const v = [self border:b slotPosition:sLast]; if (sFirst == sLast && v < lim - 1) sLast = [self border:b slotAtPosition:(v + 1)]; NSWindow* const w = [self window]; [w disableFlushWindow]; [self border:b setFirstVisibleSlot:sLast]; if (b == ([self selectsByRows] ? MISC_ROW_BORDER : MISC_COL_BORDER)) [self border:b setCursorSlot:[self lastVisibleSlot:b]]; [w enableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // - classifyFunctionKey: //----------------------------------------------------------------------------- - (KB_Action)classifyFunctionKey:(NSEvent*)p { KB_Action deed = ACT_IGNORE; switch ([[p charactersIgnoringModifiers] characterAtIndex:0]) { case K_LEFT: deed = ACT_LEFT; break; case K_RIGHT: deed = ACT_RIGHT; break; case K_UP: deed = ACT_UP; break; case K_DOWN: deed = ACT_DOWN; break; case K_PAGE_UP: deed = ACT_PAGE_UP; break; case K_PAGE_DOWN: deed = ACT_PAGE_DOWN; break; case K_HOME: deed = ACT_TOP_EDGE; break; case K_END: deed = ACT_BOT_EDGE; break; } return deed; } //----------------------------------------------------------------------------- // - classifyOtherKey: //----------------------------------------------------------------------------- - (KB_Action)classifyOtherKey:(NSEvent*)p { KB_Action deed = ACT_IGNORE; switch ([[p charactersIgnoringModifiers] characterAtIndex:0]) { case K_SPACE: deed = ACT_SELECT; break; case K_RETURN: deed = ACT_PERFORM; break; } return deed; } //----------------------------------------------------------------------------- // - classifyNumericPadKey: //----------------------------------------------------------------------------- - (KB_Action)classifyNumericPadKey:(NSEvent*)p { KB_Action deed = ACT_IGNORE; unichar const charCode = [[p charactersIgnoringModifiers] characterAtIndex:0]; if (charCode == K_KP_ENTER) deed = ACT_PERFORM; else if ('0' <= charCode && charCode <= '9') { static KB_Action const ACTS[] = { ACT_SELECT, // KP 0 (insert) ACT_BOT_EDGE, // KP 1 (end) ACT_DOWN, // KP 2 (arrow down) ACT_PAGE_DOWN, // KP 3 (page down) ACT_LEFT, // KP 4 (arrow left) ACT_IGNORE, // KP 5 ACT_RIGHT, // KP 6 (arrow right) ACT_TOP_EDGE, // KP 7 (home) ACT_UP, // KP 8 (arrow up) ACT_PAGE_UP // KP 9 (page up) }; deed = ACTS[ charCode - '0' ]; } return deed; } //----------------------------------------------------------------------------- // - classifyFlags:forAction: //----------------------------------------------------------------------------- - (KB_Action)classifyFlags:(int)flags forAction:(KB_Action)deed { static KB_Action const MODIFIED_ACTIONS[ ACT_NUM_ACTIONS ] = { //-- Becomes... Was... --// ACT_IGNORE, // ACT_IGNORE ACT_SELECT, // ACT_SELECT ACT_PERFORM, // ACT_PERFORM ACT_PAGE_LEFT, // ACT_LEFT ACT_PAGE_RIGHT, // ACT_RIGHT ACT_PAGE_UP, // ACT_UP ACT_PAGE_DOWN, // ACT_DOWN ACT_PAGE_LEFT, // ACT_PAGE_LEFT ACT_PAGE_RIGHT, // ACT_PAGE_RIGHT ACT_PAGE_LEFT, // ACT_PAGE_UP ACT_PAGE_RIGHT, // ACT_PAGE_DOWN ACT_LEFT_EDGE, // ACT_LEFT_EDGE ACT_RIGHT_EDGE, // ACT_RIGHT_EDGE ACT_LEFT_EDGE, // ACT_TOP_EDGE ACT_RIGHT_EDGE // ACT_BOT_EDG }; int const FLAGS = NSControlKeyMask | NSAlternateKeyMask | NSShiftKeyMask; if ((flags & FLAGS) != 0) return MODIFIED_ACTIONS[ deed ]; return deed; } //----------------------------------------------------------------------------- // - classifyKeyDown: //----------------------------------------------------------------------------- - (KB_Action)classifyKeyDown:(NSEvent*)p { KB_Action deed = ACT_IGNORE; unsigned int const flags = [p modifierFlags]; if ((flags & NSCommandKeyMask) == 0) { if ((flags & NSFunctionKeyMask) != 0) deed = [self classifyFunctionKey:p]; else if ((flags & NSNumericPadKeyMask) != 0) deed = [self classifyNumericPadKey:p]; else deed = [self classifyOtherKey:p]; if (deed != ACT_IGNORE) deed = [self classifyFlags:flags forAction:deed]; } return deed; } //----------------------------------------------------------------------------- // - keyDown: //----------------------------------------------------------------------------- - (void)keyDown:(NSEvent*)p { KB_Action deed = [self classifyKeyDown:p]; BOOL handled = (deed != ACT_IGNORE); if (handled) { switch (deed) { case ACT_SELECT: [self keyboardSelect:p]; break; case ACT_PERFORM: [self sendDoubleActionIfEnabled]; break; case ACT_UP: [tableView moveCursorBy:-1]; break; case ACT_DOWN: [tableView moveCursorBy: 1]; break; case ACT_LEFT: [tableView moveCursorBy:-1]; break; case ACT_RIGHT: [tableView moveCursorBy: 1]; break; case ACT_PAGE_LEFT: [self goPrevPage: MISC_COL_BORDER]; break; case ACT_PAGE_RIGHT:[self goNextPage: MISC_COL_BORDER]; break; case ACT_PAGE_UP: [self goPrevPage: MISC_ROW_BORDER]; break; case ACT_PAGE_DOWN: [self goNextPage: MISC_ROW_BORDER]; break; case ACT_LEFT_EDGE: [self goFirstSlot:MISC_COL_BORDER]; break; case ACT_RIGHT_EDGE:[self goLastSlot: MISC_COL_BORDER]; break; case ACT_TOP_EDGE: [self goFirstSlot:MISC_ROW_BORDER]; break; case ACT_BOT_EDGE: [self goLastSlot: MISC_ROW_BORDER]; break; default: handled = NO; break; } } if (!handled && ![self incrementalSearch:p]) [self superKeyDown:p]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScrollPB.M100444 1750 1750 27764 6757227335 24676 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollPB.M // // Pasteboard and services support for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollPB.M,v 1.10 99/06/15 03:33:07 sunshine Exp $ // $Log: MiscTableScrollPB.M,v $ // Revision 1.10 99/06/15 03:33:07 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Renamed: stringForNSTabularPBoardType --> stringForNSTabularPboardType // // Revision 1.9 1997/06/18 10:06:23 sunshine // v125.9: Worked around Objective-C++ compiler crash in OPENSTEP 4.2 for NT // when sending message to 'super' from within a category. // numSelected{Rows|Cols} --> numberOfSelected{Rows|Cols} // // Revision 1.8 97/04/15 09:08:59 sunshine // v0.125.8: Added "MiscTableScroll/" prefix to #import to facilitate new // framework organization. //----------------------------------------------------------------------------- #import #import "MiscTableScrollPrivate.h" extern "Objective-C" { #import #import #import } #define MISC_PB_FIELD_SEPARATOR @"\t" #define MISC_PB_RECORD_TERMINATOR @"\n" @implementation MiscTableScroll(Pasteboard) //----------------------------------------------------------------------------- // - sortSel:border: //----------------------------------------------------------------------------- - (NSArray*)sortSel:(NSArray*)sel_list border:(MiscBorderType)b { return [self border:b visualToPhysical: [[self border:b physicalToVisual:sel_list] sortedArrayUsingSelector:@selector(compare:)]]; } //----------------------------------------------------------------------------- // - builtinRegisterServicesTypes // // FIXME: Deal with these also: // returnTypes[*] = NSRTFPboardType // returnTypes[*] = NSFontPboardType // returnTypes[*] = NSColorPboardType //----------------------------------------------------------------------------- - (void)builtinRegisterServicesTypes { NSArray* sendTypes = [NSArray arrayWithObjects: NSTabularTextPboardType, NSStringPboardType, 0]; NSArray* returnTypes = [NSArray array]; [NSApp registerServicesMenuSendTypes:sendTypes returnTypes:returnTypes]; } //----------------------------------------------------------------------------- // - registerServicesTypes //----------------------------------------------------------------------------- - (void)registerServicesTypes { id del = [self responsibleDelegate: MiscDelegateFlags::DEL_REGISTER_SERVICE_TYPES]; if (del != 0) [del tableScrollRegisterServicesTypes:self]; else [self builtinRegisterServicesTypes]; } //----------------------------------------------------------------------------- // - builtinValidRequestorForSendType:returnType: //----------------------------------------------------------------------------- - (id)builtinValidRequestorForSendType:(NSString*)t_send returnType:(NSString*)t_return { if (t_return == 0 && // We only send stuff, we never take stuff. ([t_send isEqualToString:NSTabularTextPboardType] || [t_send isEqualToString:NSStringPboardType]) && ([self hasRowSelection] || [self hasColumnSelection])) return self; return [self superValidRequestorForSendType:t_send returnType:t_return]; } //----------------------------------------------------------------------------- // - validRequestorForSendType:returnType: //----------------------------------------------------------------------------- - (id)validRequestorForSendType:(NSString*)t_send returnType:(NSString*)t_return { id del = [self responsibleDelegate:MiscDelegateFlags::DEL_VALID_REQUESTOR]; if (del != 0) return [del tableScroll:self validRequestorForSendType:t_send returnType:t_return]; return [self builtinValidRequestorForSendType:t_send returnType:t_return]; } //----------------------------------------------------------------------------- // - builtinReadSelectionFromPasteboard: //----------------------------------------------------------------------------- - (BOOL)builtinReadSelectionFromPasteboard:(NSPasteboard*)pboard { return NO; } //----------------------------------------------------------------------------- // - readSelectionFromPasteboard: //----------------------------------------------------------------------------- - (BOOL)readSelectionFromPasteboard:(NSPasteboard*)pb { id del = [self responsibleDelegate: MiscDelegateFlags::DEL_READ_SEL_FROM_PB]; if (del != 0) return [del tableScroll:self readSelectionFromPasteboard:pb]; return [self builtinReadSelectionFromPasteboard:pb]; } //----------------------------------------------------------------------------- // - builtinCanWritePboardType: //----------------------------------------------------------------------------- - (BOOL)builtinCanWritePboardType:(NSString*)type { return ([type isEqualToString:NSStringPboardType] || [type isEqualToString:NSTabularTextPboardType]); } //----------------------------------------------------------------------------- // - canWritePboardType: //----------------------------------------------------------------------------- - (BOOL)canWritePboardType:(NSString*)type { id del = [self responsibleDelegate: MiscDelegateFlags::DEL_CAN_WRITE_PB_TYPE]; if (del != 0) return [del tableScroll:self canWritePboardType:type]; return [self builtinCanWritePboardType:type]; } //----------------------------------------------------------------------------- // - stringForNSStringPboardTypeAtRow:column: //----------------------------------------------------------------------------- - (NSString*)stringForNSStringPboardTypeAtRow:(int)row column:(int)col { NSString* s = 0; id cell = [self cellAtRow:row column:col]; if (cell != 0) { if ([cell respondsToSelector:@selector(title)]) s = [cell title]; else if ([cell respondsToSelector:@selector(stringValue)]) s = [cell stringValue]; } if (s == 0) s = @""; else { NSRange r = { 0, 0 }; NSMutableString* ms = [[s mutableCopy] autorelease]; for (;;) { r = [ms rangeOfString:MISC_PB_FIELD_SEPARATOR options:0 range:(NSRange){ r.location, [s length] - r.location }]; if (r.length == 0) break; else [ms replaceCharactersInRange:r withString:@" "]; } s = ms; } return s; } //----------------------------------------------------------------------------- // - stringForNSStringPboardType //----------------------------------------------------------------------------- - (NSString*)stringForNSStringPboardType { NSMutableString* s = [[[NSMutableString allocWithZone:[self zone]] init] autorelease]; unsigned int i, i_lim; MiscCoord_V j, j_lim; MiscCoord_P row, col; if ([self numberOfSelectedRows] > 0) { NSArray* sel_list = [self sortSel:[self selectedRows] border:MISC_ROW_BORDER]; i_lim = [sel_list count]; j_lim = (MiscCoord_V) [self numberOfColumns]; for (i = 0; i < i_lim; i++) { row = (MiscCoord_P) [[sel_list objectAtIndex:i] intValue]; for (j = 0; j < j_lim; j++) { if (j > 0) [s appendString:MISC_PB_FIELD_SEPARATOR]; col = [self columnAtPosition:j]; [s appendString: [self stringForNSStringPboardTypeAtRow:row column:col]]; } [s appendString:MISC_PB_RECORD_TERMINATOR]; } } else if ([self numberOfSelectedColumns] > 0) { NSArray* sel_list = [self sortSel:[self selectedColumns] border:MISC_COL_BORDER]; i_lim = [sel_list count]; j_lim = (MiscCoord_V) [self numberOfRows]; for (j = 0; j < j_lim; j++) { row = [self rowAtPosition:j]; for (i = 0; i < i_lim; i++) { if (i > 0) [s appendString:MISC_PB_FIELD_SEPARATOR]; col = (MiscCoord_P) [[sel_list objectAtIndex:i] intValue]; [s appendString: [self stringForNSStringPboardTypeAtRow:row column:col]]; } [s appendString:MISC_PB_RECORD_TERMINATOR]; } } return s; } //----------------------------------------------------------------------------- // - stringForNSTabularTextPboardType //----------------------------------------------------------------------------- - (NSString*)stringForNSTabularTextPboardType { return [self stringForNSStringPboardType]; } //----------------------------------------------------------------------------- // - builtinStringForPboardType: //----------------------------------------------------------------------------- - (NSString*)builtinStringForPboardType:(NSString*)type { NSString* s = @""; if ([type isEqualToString:NSStringPboardType]) s = [self stringForNSStringPboardType]; else if ([type isEqualToString:NSTabularTextPboardType]) s = [self stringForNSTabularTextPboardType]; return s; } //----------------------------------------------------------------------------- // - stringForPboardType: //----------------------------------------------------------------------------- - (NSString*)stringForPboardType:(NSString*)t { id del = [self responsibleDelegate: MiscDelegateFlags::DEL_STRING_FOR_PB_TYPE]; if (del != 0) return [del tableScroll:self stringForPboardType:t]; else return [self builtinStringForPboardType:t]; } //----------------------------------------------------------------------------- // - builtinWriteSelectionToPasteboard:types: //----------------------------------------------------------------------------- - (BOOL)builtinWriteSelectionToPasteboard:(NSPasteboard*)pboard types:(NSArray*)original_types { BOOL result = NO; NSMutableArray* types = [NSMutableArray array]; if (original_types != 0) { for (unsigned int i = 0, lim = [original_types count]; i < lim; i++) { id t = [original_types objectAtIndex:i]; if ([self canWritePboardType:t]) [types addObject:t]; } } unsigned int const nTypes = [types count]; if (nTypes > 0 && ([self hasRowSelection] || [self hasColumnSelection])) { [pboard declareTypes:types owner:0]; for (unsigned int i = 0; i < nTypes; i++) { NSString* s = [types objectAtIndex:i]; [pboard setString:[self stringForPboardType:s] forType:s]; } result = YES; } return result; } //----------------------------------------------------------------------------- // - writeSelectionToPasteboard:types: //----------------------------------------------------------------------------- - (BOOL)writeSelectionToPasteboard:(NSPasteboard*)pboard types:(NSArray*)types { id del = [self responsibleDelegate: MiscDelegateFlags::DEL_WRITE_SEL_TO_PB_TYPES]; if (del != 0) return [del tableScroll:self writeSelectionToPasteboard:pboard types:types]; return [self builtinWriteSelectionToPasteboard:pboard types:types]; } //----------------------------------------------------------------------------- // - copy: //----------------------------------------------------------------------------- - (void)copy:(id)sender { NSArray* types = [NSArray arrayWithObjects: NSTabularTextPboardType, NSStringPboardType, 0]; [self writeSelectionToPasteboard:[NSPasteboard generalPasteboard] types:types]; } //----------------------------------------------------------------------------- // - cut: //----------------------------------------------------------------------------- - (void)cut:(id)sender { [self copy:sender]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScrollPrint.M100444 1750 1750 11137 6757227336 25455 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollPrint.M // // Printing support for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollPrint.M,v 1.4 99/06/15 03:34:42 sunshine Exp $ // $Log: MiscTableScrollPrint.M,v $ // Revision 1.4 99/06/15 03:34:42 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Page header and footer are now strongly typed as NSView rather than id. // The strong typing extends to the Java environment more cleanly. // // Revision 1.3 1997/03/20 19:15:15 sunshine // v123.1: Fixed bug: Delegate methods -tableScrollWillPrint: & // -tableScrollDidPrint: were getting subverted when -print: was sent // to first-responder (which is the MiscTableView, not the MiscTableScroll). // Connecting Print... item to first-responder in IB can cause this. // Was fixed by sending them in MiscTableViewPrint.M rather than here. // // Revision 1.2 97/02/09 07:41:03 sunshine // v110: Ported to OPENSTEP 4.1 (gamma). //----------------------------------------------------------------------------- #import "MiscTableScrollPrivate.h" #import "MiscDelegateFlags.h" #import "MiscTableView.h" #import "MiscBorderView.h" extern "Objective-C" { #import #import #import } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscTableScroll(Print) - (NSView*)getPageHeader { return pageHeader; } - (NSView*)getPageFooter { return pageFooter; } - (void)setPageHeader:(NSView*)obj { pageHeader = obj; } - (void)setPageFooter:(NSView*)obj { pageFooter = obj; } - (MiscTablePrintInfo const*)getPrintInfo { return [tableView getPrintInfo]; } //----------------------------------------------------------------------------- // dumpPrintInfo: //----------------------------------------------------------------------------- - (void)dumpPrintInfo:(NSPrintInfo*)pinfo { fprintf( stderr, "printInfo=%p\n", pinfo ); fprintf( stderr, "paperType:[%s]\n", [[pinfo paperName] cString] ); fprintf( stderr, "paperSize:%s\n", [NSStringFromSize([pinfo paperSize]) cString] ); fprintf( stderr, "margins: left=%g right=%g top=%g bottom=%g\n", [pinfo leftMargin], [pinfo rightMargin], [pinfo topMargin], [pinfo bottomMargin] ); fprintf( stderr, "scalingFactor=%g\n", [[[pinfo dictionary] objectForKey:NSPrintScalingFactor] floatValue] ); fprintf( stderr, "orientation=%d\n", (int)[pinfo orientation] ); fprintf( stderr, "isHorizontallyCentered=%d\n", (int)[pinfo isHorizontallyCentered] ); fprintf( stderr, "isVerticallyCentered=%d\n", (int)[pinfo isVerticallyCentered] ); fprintf( stderr, "horizontalPagination=%d\n", [pinfo horizontalPagination] ); fprintf( stderr, "verticalPagination=%d\n", [pinfo verticalPagination] ); fprintf( stderr, "isAllPages=%d\n", (int)[[[pinfo dictionary] objectForKey:NSPrintAllPages] boolValue] ); fprintf( stderr, "firstPage=%d\n", [[[pinfo dictionary] objectForKey:NSPrintFirstPage] intValue] ); fprintf( stderr, "lastPage=%d\n", [[[pinfo dictionary] objectForKey:NSPrintLastPage] intValue] ); fprintf( stderr, "copies=%d\n", [[[pinfo dictionary] objectForKey:NSPrintCopies] intValue] ); fprintf( stderr, "pagesPerSheet=%d\n", [[[pinfo dictionary] objectForKey:NSPrintPagesPerSheet] intValue] ); fprintf( stderr, "reversePageOrder=%d\n", [[[pinfo dictionary] objectForKey:NSPrintReversePageOrder] boolValue]); // There are also job features... } //----------------------------------------------------------------------------- // print: //----------------------------------------------------------------------------- - (void)print:(id)sender { [tableView print:sender]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScrollPrivate.h100444 1750 1750 7131 6757227336 26005 0ustar sunshinesunshine#ifndef __MiscTableScrollPrivate_h #define __MiscTableScrollPrivate_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollPrivate.h // // Methods used within the Table Scroll palette but which are not // exported with the *public* interface. // // NOTE *1* // The OPENSTEP 4.1 (gamma) Objective-C++ compiler neglects to define the // macro __PRETTY_FUNCTION__ which is used by the macro NSCAssert() and // its cousins, so we have to fake it up. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollPrivate.h,v 1.12 99/06/15 03:35:59 sunshine Exp $ // $Log: MiscTableScrollPrivate.h,v $ // Revision 1.12 99/06/15 03:35:59 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Represented object support was added, so incremented class version number. // Renamed method: setTracking: --> setIsTrackingMouse: // // Revision 1.11 1998/03/29 23:57:26 sunshine // v138.1: Moved MISC_FRAME_HEIGHT & MISC_FRAME_WIDTH here from MiscBorderView // since MiscTableBorder needs to access them as well. // // Revision 1.10 98/03/22 13:14:50 sunshine // v133.1: Broke off IO category of TableScroll. Migrated some version // related declarations here. Added access to the cornerView. //----------------------------------------------------------------------------- #import #import "MiscDelegateFlags.h" #if defined(NX_CURRENT_COMPILER_RELEASE) && NX_CURRENT_COMPILER_RELEASE <= 400 # define __PRETTY_FUNCTION__ "" /* NOTE 1 */ #endif #define MISC_TS_VERSION_0 0 // Initial version #define MISC_TS_VERSION_1 1 // MiscSortType was 0..8, now 0..12 #define MISC_TS_VERSION_2 2 // Overhauled border archive format. #define MISC_TS_VERSION_1000 1000 // First OpenStep version (4.0 PR2) #define MISC_TS_VERSION_1001 1001 // Sort vector: (int*) ->> (NSArray) #define MISC_TS_VERSION_1002 1002 // Overhauled border archive format. #define MISC_TS_VERSION_1003 1003 // Added representedObject. #define MISC_TS_VERSION MISC_TS_VERSION_1003 #define MISC_FRAME_HEIGHT 20 #define MISC_FRAME_WIDTH 46 @interface MiscTableScroll (PrivateInternal) - (id)responsibleDelegate:(MiscDelegateFlags::Selector)cmd; // Private: border -> scroll - (NSString*) border:(MiscBorderType)b getDelegateSlotTitle:(int)slot; - (id) border:(MiscBorderType)b getDelegateSlotPrototype:(int)s; // TableScroll(IncrementalSearch) -> TableScroll(Keyboard) - (void) keyboardSelect:(NSEvent*)p; - (MiscBorderView*)rowTitles; - (MiscBorderView*)colTitles; - (MiscCornerView*)cornerView; - (void)setIsTrackingMouse:(BOOL)flag; - (void)setClickedRow:(MiscCoord_P)r column:(MiscCoord_P)c; - (void)clearClicked; // Reset stale-old-selection in Table & Border views. - (void)resetSelection; // TableScroll(IO) -> TableScroll - (void)doInit:(int)ver cornerTitle:(NSString*)s; @end #endif // __MiscTableScrollPrivate_h MiscKit2/Palettes/MiscTableScroll/Framework/Makefile100444 1750 1750 7424 6757227345 22724 0ustar sunshinesunshine# # Generated by the NeXT Project Builder. # # NOTE: Do NOT change this file -- Project Builder maintains it. # # Put all of your customizations in files called Makefile.preamble # and Makefile.postamble (both optional), and Makefile will include them. # NAME = MiscTableScroll PROJECTVERSION = 2.7 PROJECT_TYPE = Framework LANGUAGE = English LOCAL_RESOURCES = MiscExporterAccessoryView-macintosh.nib\ MiscExporterAccessoryView.nib GLOBAL_RESOURCES = MiscHorzResizeCursor.tiff MiscReverseCursor.tiff\ MiscSlotDragCursor.tiff MiscSortAscend.tiff\ MiscSortAscendH.tiff MiscSortDescend.tiff\ MiscSortDescendH.tiff MiscVertResizeCursor.tiff\ Documentation MiscTableScroll-3.3-4.x.tops CCFILES = MiscColorList.cc MiscDelegateFlags.cc MiscDrawList.cc\ MiscGeometry.cc MiscLineWrapper.cc MiscRectColorList.cc\ MiscRectList.cc MiscSparseSet.cc MiscTableBorder.cc\ MiscTableBorderIO.cc MiscTableBorderSel.cc MiscTracer.cc CAPMFILES = MiscBorderCell.M MiscBorderView.M MiscColView.M\ MiscCornerView.M MiscExporter.M MiscExporterAccessoryView.M\ MiscExporterASCII.M MiscExporterDBF.M MiscHighlightTracker.M\ MiscListTracker.M MiscMouseTracker.M MiscRadioTracker.M\ MiscRowView.M MiscTableCell.M MiscTableConnector.M\ MiscTableScroll.M MiscTableScrollData.M\ MiscTableScrollEdit.M MiscTableScrollIO.M\ MiscTableScrollISearch.M MiscTableScrollKB.M\ MiscTableScrollPB.M MiscTableScrollPrint.M\ MiscTableScrollSel.M MiscTableScrollSort.M\ MiscTableScrollSymbols.M MiscTableView.M\ MiscTableViewCursor.M MiscTableViewDrag.M\ MiscTableViewPrint.M MiscTableWell.M HFILES = bool.h MiscBorderCell.h MiscBorderView.h MiscColorList.h\ MiscColView.h MiscCornerView.h MiscDelegateFlags.h\ MiscDrawList.h MiscExporter.h MiscExporterAccessoryView.h\ MiscExporterPrivate.h MiscGeometry.h MiscHighlightTracker.h\ MiscLineWrapper.h MiscListTracker.h MiscMouseTracker.h\ MiscRadioTracker.h MiscRectColorList.h MiscRectList.h\ MiscRowView.h MiscSparseSet.h MiscTableBorder.h\ MiscTableCell.h MiscTableConnector.h MiscTableScroll.h\ MiscTableScrollPrivate.h MiscTableTypes.h MiscTableUtil.h\ MiscTableView.h MiscTableViewPrivate.h MiscTableWell.h\ MiscTracer.h new.h NSNibConnector.h PSWFILES = MiscTableViewPS.psw OTHERSRCS = Makefile.preamble Makefile Makefile.postamble MAKEFILEDIR = $(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles CURRENTLY_ACTIVE_VERSION = YES DEPLOY_WITH_VERSION_NAME = B CODE_GEN_STYLE = DYNAMIC MAKEFILE = framework.make NEXTSTEP_INSTALLDIR = $(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks WINDOWS_INSTALLDIR = $(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks LIBS = DEBUG_LIBS = $(LIBS) PROF_LIBS = $(LIBS) NEXTSTEP_PB_CFLAGS = -DMISC_TABLE_SCROLL_BUILDING -Werror -Wwrite-strings WINDOWS_PB_CFLAGS = -DMISC_TABLE_SCROLL_BUILDING -Werror -Wwrite-strings FRAMEWORKS = -framework AppKit -framework Foundation PUBLIC_HEADERS = MiscExporter.h MiscTableCell.h MiscTableScroll.h\ MiscTableTypes.h PROJECT_HEADERS = MiscExporter.h MiscTableCell.h MiscTableScroll.h\ MiscTableTypes.h MiscTableBorder.h\ MiscTableConnector.h NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc WINDOWS_OBJCPLUS_COMPILER = $(DEVDIR)/gcc PDO_UNIX_OBJCPLUS_COMPILER = $(NEXTDEV_BIN)/gcc NEXTSTEP_JAVA_COMPILER = /usr/bin/javac WINDOWS_JAVA_COMPILER = $(JDKBINDIR)/javac.exe PDO_UNIX_JAVA_COMPILER = $(NEXTDEV_BIN)/javac include $(MAKEFILEDIR)/platform.make -include Makefile.preamble include $(MAKEFILEDIR)/$(MAKEFILE) -include Makefile.postamble -include Makefile.dependencies MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScrollSel.M100444 1750 1750 32525 6757227336 25110 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollSel.M // // Selection management methods for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollSel.M,v 1.3 99/06/15 03:43:53 sunshine Exp $ // $Log: MiscTableScrollSel.M,v $ // Revision 1.3 99/06/15 03:43:53 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // For clarity and better OpenStep conformance, these methods were renamed: // trackingBy --> selectsByRows // trackBy: --> setSelectsByRows: // tracking --> isTrackingMouse // setTracking; --> setIsTrackingMouse: // select...:byExtension: --> select...:byExtendingSelection: // select{Slot|Row|Column}Tags: --> select{Slots|Rows|Columns}WithTags: // deselect{Slot|Row|Column}Tags: --> deselect{Slots|Rows|Columns}WithTags: // Changed return type of -numberOfSelected{Slots|Rows|Columns} from // (unsigned int) to (int) to agree with other -numberOf... methods. Also, // since Java only deals with signed numbers, the unsigned ints would have // been promoted to eight byte values on the Java side which is undesirable. // // Revision 1.2 1998/03/29 23:57:42 sunshine // v138.1: #import was missing "MiscTableScroll/" for public header. //----------------------------------------------------------------------------- #import #import "MiscColView.h" #import "MiscRowView.h" #import "MiscTableView.h" #import "MiscTableBorder.h" @implementation MiscTableScroll(Selection) //----------------------------------------------------------------------------- // Enabled //----------------------------------------------------------------------------- - (BOOL)isEnabled { return enabled; } - (void)setEnabled:(BOOL)flag { enabled = flag; } //----------------------------------------------------------------------------- // Selection //----------------------------------------------------------------------------- - (void)selectionChanged { [rowInfo.view selectionChanged]; [colInfo.view selectionChanged]; [tableView selectionChanged]; } - (void)resetSelection { [tableView resetSelection]; [rowInfo.view resetSelection]; [colInfo.view resetSelection]; } - (void)setSelectsByRows:(BOOL)flag { [tableView setSelectsByRows:flag]; } - (BOOL)selectsByRows { return [tableView selectsByRows]; } - (BOOL)isTrackingMouse { return trackingMouse; } - (void)setIsTrackingMouse:(BOOL)flag { trackingMouse = flag; } - (MiscSelectionMode)selectionMode { return mode; } - (void)setSelectionMode:(MiscSelectionMode)x { if (x != mode) { [self clearSelection]; mode = x; [colInfo.view setSelectionMode:mode]; [rowInfo.view setSelectionMode:mode]; [tableView setSelectionMode:mode]; } } - (id)selectedCell { MiscCoord_P const col = [self selectedColumn]; MiscCoord_P const row = [self selectedRow]; return (col >= 0 && row >= 0) ? [self cellAtRow:row column:col] : 0; } - (BOOL)hasSlotSelection:(MiscBorderType)b { return info[b]->border->hasSelection(); } - (BOOL)hasRowSelection { return [self hasSlotSelection:MISC_ROW_BORDER]; } - (BOOL)hasColumnSelection { return [self hasSlotSelection:MISC_COL_BORDER]; } - (BOOL)hasMultipleSlotSelection:(MiscBorderType)b { return info[b]->border->hasMultipleSelection(); } - (BOOL)hasMultipleRowSelection { return [self hasMultipleSlotSelection:MISC_ROW_BORDER]; } - (BOOL)hasMultipleColumnSelection { return [self hasMultipleSlotSelection:MISC_COL_BORDER]; } - (int)numberOfSelectedSlots:(MiscBorderType)b { return info[b]->border->numSelected(); } - (int)numberOfSelectedRows { return [self numberOfSelectedSlots:MISC_ROW_BORDER]; } - (int)numberOfSelectedColumns { return [self numberOfSelectedSlots:MISC_COL_BORDER]; } - (BOOL)border:(MiscBorderType)b slotIsSelected:(MiscCoord_P)slot { MiscTableBorder const* bp = info[b]->border; return bp->goodPos( slot ) && bp->isSelected_P( slot ); } - (BOOL)rowIsSelected:(MiscCoord_P)row { return [self border:MISC_ROW_BORDER slotIsSelected:row]; } - (BOOL)columnIsSelected:(MiscCoord_P)col { return [self border:MISC_COL_BORDER slotIsSelected:col]; } - (BOOL)cellIsSelectedAtRow:(MiscCoord_P)r column:(MiscCoord_P)c { return ([self rowIsSelected:r] || [self columnIsSelected:c]); } - (MiscCoord_P)selectedSlot:(MiscBorderType)b { return info[b]->border->selectedSlot_P(); } - (MiscCoord_P)selectedRow { return [self selectedSlot:MISC_ROW_BORDER]; } - (MiscCoord_P)selectedColumn { return [self selectedSlot:MISC_COL_BORDER]; } - (NSArray*)selectedSlotTags:(MiscBorderType)b { return info[b]->border->selectedTags(); } - (NSArray*)selectedRowTags { return [self selectedSlotTags:MISC_ROW_BORDER]; } - (NSArray*)selectedColumnTags { return [self selectedSlotTags:MISC_COL_BORDER]; } - (NSArray*)selectedSlots:(MiscBorderType)b { return info[b]->border->selectedSlots(); } - (NSArray*)selectedRows { return [self selectedSlots:MISC_ROW_BORDER]; } - (NSArray*)selectedColumns { return [self selectedSlots:MISC_COL_BORDER]; } - (void)border:(MiscBorderType)b selectSlot:(MiscCoord_P)p_slot byExtendingSelection:(BOOL)extend { BOOL changed = NO; MiscTableBorder* const ob = info[ MISC_OTHER_BORDER(b) ]->border; if (ob->hasSelection()) { ob->selectNone(); changed = YES; } MiscTableBorder* const bp = info[b]->border; if (!extend && bp->numSelected() > 0) { bp->selectNone(); changed = YES; } if (bp->goodPos( p_slot )) { MiscCoord_V const v_slot = bp->physicalToVisual( p_slot ); if (!bp->isSelected( v_slot )) { if (mode == MISC_RADIO_MODE) bp->selectOne( v_slot ); else bp->select( v_slot ); changed = YES; } } if (changed) [self selectionChanged]; } - (void)border:(MiscBorderType)b selectSlot:(MiscCoord_P)p_slot { [self border:b selectSlot:p_slot byExtendingSelection:NO]; } - (void)selectRow:(MiscCoord_P)r byExtendingSelection:(BOOL)f { [self border:MISC_ROW_BORDER selectSlot:r byExtendingSelection:f]; } - (void)selectRow:(MiscCoord_P)row { [self selectRow:row byExtendingSelection:NO]; } - (void)selectColumn:(MiscCoord_P)c byExtendingSelection:(BOOL)f { [self border:MISC_COL_BORDER selectSlot:c byExtendingSelection:f]; } - (void)selectColumn:(MiscCoord_P)col { [self selectColumn:col byExtendingSelection:NO]; } - (void)border:(MiscBorderType)b selectSlotsWithTags:(NSArray*)tags byExtendingSelection:(BOOL)extend { info[b]->border->selectTags( tags, extend ); [self selectionChanged]; } - (void)border:(MiscBorderType)b selectSlotsWithTags:(NSArray*)tags { [self border:b selectSlotsWithTags:tags byExtendingSelection:NO]; } - (void)selectRowsWithTags:(NSArray*)tags byExtendingSelection:(BOOL)flag { [self border:MISC_ROW_BORDER selectSlotsWithTags:tags byExtendingSelection:flag]; } - (void)selectRowsWithTags:(NSArray*)tags { [self selectRowsWithTags:tags byExtendingSelection:NO]; } - (void)selectColumnsWithTags:(NSArray*)tags byExtendingSelection:(BOOL)flag { [self border:MISC_COL_BORDER selectSlotsWithTags:tags byExtendingSelection:flag]; } - (void)selectColumnsWithTags:(NSArray*)tags { [self selectColumnsWithTags:tags byExtendingSelection:NO]; } - (void)border:(MiscBorderType)b selectSlots:(NSArray*)slots byExtendingSelection:(BOOL)extend { info[b]->border->selectSlots( slots, extend ); [self selectionChanged]; } - (void)border:(MiscBorderType)b selectSlots:(NSArray*)slots { [self border:b selectSlots:slots byExtendingSelection:NO]; } - (void)selectRows:(NSArray*)r byExtendingSelection:(BOOL)f { [self border:MISC_ROW_BORDER selectSlots:r byExtendingSelection:f]; } - (void)selectRows:(NSArray*)rows { [self selectRows:rows byExtendingSelection:NO]; } - (void)selectColumns:(NSArray*)c byExtendingSelection:(BOOL)f { [self border:MISC_COL_BORDER selectSlots:c byExtendingSelection:f]; } - (void)selectColumns:(NSArray*)cols { [self selectColumns:cols byExtendingSelection:NO]; } - (void)selectAllSlots:(MiscBorderType)b { if (mode == MISC_LIST_MODE || mode == MISC_HIGHLIGHT_MODE) { info[b]->border->selectAll(); [self selectionChanged]; } } - (void)selectAllRows { [self selectAllSlots:MISC_ROW_BORDER]; } - (void)selectAllColumns { [self selectAllSlots:MISC_COL_BORDER]; } - (void)selectAll:(id)sender { [self selectAllRows]; [self sendActionIfEnabled]; } - (void)border:(MiscBorderType)b deselectSlot:(MiscCoord_P)p_slot { MiscTableBorder* const bp = info[b]->border; if (bp->goodPos( p_slot )) { MiscCoord_V const v_slot = bp->physicalToVisual( p_slot ); if (bp->isSelected( v_slot )) { bp->unselect( v_slot ); [self selectionChanged]; } } } - (void)deselectRow:(MiscCoord_P)row { [self border:MISC_ROW_BORDER deselectSlot:row]; } - (void)deselectColumn:(MiscCoord_P)col { [self border:MISC_COL_BORDER deselectSlot:col]; } - (void)border:(MiscBorderType)b deselectSlotsWithTags:(NSArray*)tags { info[b]->border->unselectTags( tags ); [self selectionChanged]; } - (void)deselectRowsWithTags:(NSArray*)tags { [self border:MISC_ROW_BORDER deselectSlotsWithTags:tags]; } - (void)deselectColumnsWithTags:(NSArray*)tags { [self border:MISC_COL_BORDER deselectSlotsWithTags:tags]; } - (void)border:(MiscBorderType)b deselectSlots:(NSArray*)slots { info[b]->border->unselectSlots( slots ); [self selectionChanged]; } - (void)deselectRows:(NSArray*)rows { [self border:MISC_ROW_BORDER deselectSlots:rows]; } - (void)deselectColumns:(NSArray*)cols { [self border:MISC_COL_BORDER deselectSlots:cols]; } - (void)clearSlotSelection:(MiscBorderType)b { info[b]->border->selectNone(); [self selectionChanged]; } - (void)clearRowSelection { [self clearSlotSelection:MISC_ROW_BORDER]; } - (void)clearColumnSelection { [self clearSlotSelection:MISC_COL_BORDER]; } - (void)clearSelection { [self clearRowSelection]; [self clearColumnSelection]; } - (void)deselectAll:(id)sender { [self clearSelection]; [self sendActionIfEnabled]; } //----------------------------------------------------------------------------- // Clicked slot stuff //----------------------------------------------------------------------------- - (MiscCoord_P)clickedSlot:(MiscBorderType)b { return info[b]->border->clickedSlot_P(); } - (MiscCoord_P)clickedRow { return [self clickedSlot:MISC_ROW_BORDER]; } - (MiscCoord_P)clickedColumn { return [self clickedSlot:MISC_COL_BORDER]; } - (id)clickedCell { MiscCoord_P const r = [self clickedRow]; MiscCoord_P const c = [self clickedColumn]; return (r >= 0 && c >= 0 ? [self cellAtRow:r column:c] : 0); } - (void)border:(MiscBorderType)b setClickedSlot:(MiscCoord_P)n { info[b]->border->setClickedSlot_P(n); } - (void)setClickedRow:(MiscCoord_P)r column:(MiscCoord_P)c { [self border:MISC_ROW_BORDER setClickedSlot:r]; [self border:MISC_COL_BORDER setClickedSlot:c]; } - (void)borderClearClickedSlot:(MiscBorderType)b { info[b]->border->clearClickedSlot(); } - (void)clearClicked { [self borderClearClickedSlot:MISC_ROW_BORDER]; [self borderClearClickedSlot:MISC_COL_BORDER]; } //----------------------------------------------------------------------------- // Keyboard cursor stuff //----------------------------------------------------------------------------- - (void)reflectCursor { [tableView reflectCursor]; } - (MiscCoord_P)cursorSlot:(MiscBorderType)b { return info[b]->border->getCursor_P(); } - (MiscCoord_P)cursorRow { return [self cursorSlot:MISC_ROW_BORDER]; } - (MiscCoord_P)cursorColumn { return [self cursorSlot:MISC_COL_BORDER]; } - (void)border:(MiscBorderType)b setCursorSlot:(MiscCoord_P)slot { info[b]->border->setCursor_P( slot ); [self reflectCursor]; } - (void)setCursorRow:(MiscCoord_P)row { [self border:MISC_ROW_BORDER setCursorSlot:row]; } - (void)setCursorColumn:(MiscCoord_P)col { [self border:MISC_COL_BORDER setCursorSlot:col]; } - (void)clearCursorSlot:(MiscBorderType)b { info[b]->border->clearCursor(); [self reflectCursor]; } - (void)clearCursorRow { [self clearCursorSlot:MISC_ROW_BORDER]; } - (void)clearCursorColumn { [self clearCursorSlot:MISC_COL_BORDER]; } - (void)clearCursor { [self clearCursorRow]; [self clearCursorColumn]; } - (BOOL)hasValidCursorSlot:(MiscBorderType)b { return info[b]->border->hasValidCursor(); } - (BOOL)hasValidCursorRow { return [self hasValidCursorSlot:MISC_ROW_BORDER]; } - (BOOL)hasValidCursorColumn { return [self hasValidCursorSlot:MISC_COL_BORDER]; } - (BOOL)isCursorEnabled { return [tableView isCursorEnabled]; } - (void)disableCursor { if ([self isCursorEnabled] && [tableView shouldDrawCursor]) [tableView eraseCursor]; [tableView disableCursor]; [self displayIfNeeded]; } - (void)enableCursor { [tableView enableCursor]; if ([self isCursorEnabled] && [tableView shouldDrawCursor]) [tableView drawCursor]; [self displayIfNeeded]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScrollSort.M100444 1750 1750 113072 6757227336 25331 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollSort.M // // Sorting support for MiscTableScroll. // // FIXME: OPTIMIZATION -- Explore other sorting algorithms: // MergeSort, Radix-Exchange, Distribution-Counting. // HeapSort: explored -- usually makes twice as many comparisons. // Binary Insertion Sort (bsort): explored -- *way* fewer comparisons, // but memmove() overhead slaughters performance. // // FIXME: OPTIMIZATION -- Explore calling -isSorted before actually sorting // the table. This might save a lot of work when there are unique // columns near the left, and the user is dragging columns near the // right. ** Exploring ** Seems to improve overall performance for // quicksort(), not necessary with bsort(). // // FIXME: OPTIMIZATION -- Explore giving the programmer some means to mark // columns as "unique". Whenever the from- and to- positions of a // column-drag operation are to the right of a "unique" column, resorting // can be suppressed. Extra sort-information does not need to be // pre-computed for columns to the right of the "unique" column. // // FIXME: OPTIMIZATION -- When sorting a column of integers, allocate an // array and fill it with the values so that we don't have to retrieve // the values several times while the sort is in progress. Same thing // for string pointers if we can give the user some way to indicate // that the strings are stable for the duration of the sort. // // FIXME: OPTIMIZATION -- Most of the sorting and comparing uses one record // repeatedly while comparing it to others. Find some way to cache // the values from that record so they don't have to be fetched // repeatedly. // // FIXME: OPTIMIZATION -- Consider re-using the sort info objects at least to // avoid allocating and freeing entry_info[] and buff[] all the time. // Consider embedding one of them right in the table-scroll itself. // // LOSER: OPTIMIZATION -- Don't make a function call to do the comparisons // unless the user has installed a custom sort function. Use a big // switch statement. (This eliminates one function call per comparison.) // *** I tried this. It was actually a little bit slower than the *** // *** current design. *** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollSort.M,v 1.20 99/06/15 03:44:38 sunshine Exp $ // $Log: MiscTableScrollSort.M,v $ // Revision 1.20 99/06/15 03:44:38 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Method renamed: border:moveSlotFrom:to: --> border:moveSlot:toSlot: // // Revision 1.19 1998/03/23 11:12:33 sunshine // v136.1: Applied v0.136 NEXTSTEP 3.3 diffs. // // Revision 1.18 97/06/18 10:03:38 sunshine // v125.9: buffCount --> bufferCount //----------------------------------------------------------------------------- #import #import #import "MiscBorderView.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import "MiscTableView.h" extern "C" { #import } #ifndef USE_BSORT // Use binary insertion sort. #define USE_BSORT 0 #endif #ifndef SORTING_STATS // Gather and print some statistics. #define SORTING_STATS 0 #endif //============================================================================= // CELL-VALUE ACCESS //============================================================================= //----------------------------------------------------------------------------- // cell_str //----------------------------------------------------------------------------- static inline NSString* cell_str( int r, int c, MiscEntrySortInfo const* p, MiscSlotSortInfo* q, BOOL make_copy ) { NSString* t = (*(p->value_func.s))( p->value_target, p->value_sel, p->value_obj, r, c, p, q ); if (make_copy) t = [t copy]; else [t retain]; return t; } //----------------------------------------------------------------------------- // cell_int //----------------------------------------------------------------------------- static inline int cell_int( int r, int c, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { return (*(p->value_func.i))( p->value_target, p->value_sel, p->value_obj, r, c, p, q ); } //----------------------------------------------------------------------------- // cell_float //----------------------------------------------------------------------------- static inline float cell_float( int r, int c, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { return (*(p->value_func.f))( p->value_target, p->value_sel, p->value_obj, r, c, p, q ); } //----------------------------------------------------------------------------- // cell_double //----------------------------------------------------------------------------- static inline double cell_double( int r, int c, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { return (*(p->value_func.d))( p->value_target, p->value_sel, p->value_obj, r, c, p, q ); } //============================================================================= // CELL COMPARISON FUNCTIONS //============================================================================= //----------------------------------------------------------------------------- // cmp_istr //----------------------------------------------------------------------------- static int cmp_istr( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo* q ) { NSString* const s1 = [cell_str( r1,c1,p,q,q->need_copy ) autorelease]; NSString* const s2 = [cell_str( r2,c2,p,q,NO ) autorelease]; return [s1 caseInsensitiveCompare:s2]; } //----------------------------------------------------------------------------- // cmp_str //----------------------------------------------------------------------------- static int cmp_str( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo* q ) { NSString* const s1 = [cell_str( r1,c1,p,q,q->need_copy ) autorelease]; NSString* const s2 = [cell_str( r2,c2,p,q,NO ) autorelease]; return [s1 compare:s2]; } //----------------------------------------------------------------------------- // cmp_int //----------------------------------------------------------------------------- static int cmp_int( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { int const x1 = cell_int(r1,c1,p,q); int const x2 = cell_int(r2,c2,p,q); if (x1 < x2) return -1; if (x1 > x2) return 1; return 0; } //----------------------------------------------------------------------------- // cmp_uint //----------------------------------------------------------------------------- static int cmp_uint( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { unsigned int const x1 = (unsigned int) cell_int(r1,c1,p,q); unsigned int const x2 = (unsigned int) cell_int(r2,c2,p,q); if (x1 < x2) return -1; if (x1 > x2) return 1; return 0; } //----------------------------------------------------------------------------- // cmp_float //----------------------------------------------------------------------------- static int cmp_float( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { float const x1 = cell_float(r1,c1,p,q); float const x2 = cell_float(r2,c2,p,q); if (x1 < x2) return -1; if (x1 > x2) return 1; return 0; } //----------------------------------------------------------------------------- // cmp_double //----------------------------------------------------------------------------- static int cmp_double( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* p, MiscSlotSortInfo const* q ) { double const x1 = cell_double(r1,c1,p,q); double const x2 = cell_double(r2,c2,p,q); if (x1 < x2) return -1; if (x1 > x2) return 1; return 0; } //----------------------------------------------------------------------------- // cmp_skip //----------------------------------------------------------------------------- static int cmp_skip( int,int,int,int, MiscEntrySortInfo const*, MiscSlotSortInfo const*) { return 0; } //----------------------------------------------------------------------------- // COMPARE_FUNC[] //----------------------------------------------------------------------------- static MiscCompareEntryFunc const COMPARE_FUNC[ MISC_SORT_TYPE_MAX + 1 ] = { cmp_istr, // MISC_SORT_STRING_CASE_INSENSITIVE cmp_str, // MISC_SORT_STRING_CASE_SENSITIVE cmp_int, // MISC_SORT_INT cmp_uint, // MISC_SORT_UNSIGNED_INT cmp_int, // MISC_SORT_TAG cmp_uint, // MISC_SORT_UNSIGNED_TAG cmp_float, // MISC_SORT_FLOAT cmp_double, // MISC_SORT_DOUBLE cmp_skip, // MISC_SORT_SKIP cmp_istr, // MISC_SORT_TITLE_CASE_INSENSITIVE cmp_str, // MISC_SORT_TITLE_CASE_SENSITIVE cmp_int, // MISC_SORT_STATE cmp_uint, // MISC_SORT_UNSIGNED_STATE }; //============================================================================= // SLOT-COMPARE //============================================================================= #if(SORTING_STATS) static unsigned long int NUM_COMPARES = 0; #endif //----------------------------------------------------------------------------- // MiscDefaultCompareSlotFunc //----------------------------------------------------------------------------- int MiscDefaultCompareSlotFunc( int slot1, int slot2, MiscSlotSortInfo* info ) { int rc = 0; MiscEntrySortInfo const* p = info->entry_info; MiscEntrySortInfo const* const plim = p + info->num_entries; if (info->border_type == MISC_COL_BORDER) // Row-wise compare { for ( ; p < plim; p++) { #if(SORTING_STATS) NUM_COMPARES++; #endif int const col = p->slot; if ((rc = (*(p->compare_func))(slot1,col,slot2,col,p,info)) != 0) return (p->ascending ? rc : -rc); } } else // Col-wise compare { for ( ; p < plim; p++) { #if(SORTING_STATS) NUM_COMPARES++; #endif int const row = p->slot; if ((rc = (*(p->compare_func))(row,slot1,row,slot2,p,info)) != 0) return (p->ascending ? rc : -rc); } } return 0; } //============================================================================= // QSORT //============================================================================= #if(USE_BSORT) static void bsort( int a[], int N, MiscCompareSlotFunc f, MiscSlotSortInfo* info ) { #if(SORTING_STATS) time_t const t0 = time(0); clock_t const c0 = clock(); NUM_COMPARES = 0; #endif int lo, mid, hi; for (int i = 1; i < N; i++) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; int v = a[i]; hi = i - 1; if ((*f)(a[hi],v,info) > 0) { lo = 0; while (lo <= hi) { mid = (lo + hi) >> 1; if ((*f)(a[mid],v,info) <= 0) lo = mid + 1; else hi = mid - 1; } int* lim = a + lo; int* src = a + i; int* dst = src + 1; do { *(--dst) = *(--src); } while (src != lim); *src = v; // memmove( a + lo + 1, a + lo, (i - lo) * sizeof(*a) ); // a[lo] = v; } [pool release]; } #if(SORTING_STATS) clock_t const c1 = clock(); time_t const t1 = time(0); NSLog( @"bsort: %d ticks %d seconds %lu compares", (c1 - c0), (t1 - t0), NUM_COMPARES ); #endif } #else //----------------------------------------------------------------------------- // swap //----------------------------------------------------------------------------- inline static void swap( int x, int y, int a[] ) { int t = a[x]; a[x] = a[y]; a[y] = t; } //----------------------------------------------------------------------------- // do_qsort //----------------------------------------------------------------------------- static void do_qsort( int a[], int N, MiscCompareSlotFunc f, MiscSlotSortInfo* info ) { #if(SORTING_STATS) time_t const t0 = time(0); clock_t const c0 = clock(); NUM_COMPARES = 0; #endif int const STACK_MAX = 64; // log_base_2(ULNG_MAX) * 2 int stk[ STACK_MAX ]; int top = 0; int left = 0; int right = N - 1; int i,j,n; for (;;) { while (right > left) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; n = (right - left) + 1; // right,left bounds are inclusive. if (n >= 8) { int mid = (left + right) >> 1; if ((*f)(a[left],a[right],info) > 0) swap(left,right,a); if ((*f)(a[mid], a[right],info) > 0) swap(mid,right,a); if ((*f)(a[left],a[mid], info) > 0) swap(left,mid,a); // if (n == 3) break; right--; swap(mid,right,a); int v = a[right]; i = left; j = right; for (;;) { while ((*f)(a[++i],v,info) < 0) /* empty */; while ((*f)(a[--j],v,info) > 0) /* empty */; if (i >= j) break; swap( i, j, a ); } swap( i, right, a ); right++; if (i - left > right - i) { stk[top++] = left; stk[top++] = i-1; left = i+1; } else { stk[top++] = i+1; stk[top++] = right; right = i-1; } } else // (n < 3) { if (n > 1) { for (i = left + 1; i <= right; i++) { int const v = a[i]; j = i; while (--j >= left && (*f)(a[j],v,info) > 0) a[j+1] = a[j]; a[++j] = v; } } break; } [pool release]; } if (top == 0) break; right = stk[--top]; left = stk[--top]; } #if(SORTING_STATS) clock_t const c1 = clock(); time_t const t1 = time(0); NSLog( @"qsort: %d ticks %d seconds %lu compares", (c1 - c0), (t1 - t0), NUM_COMPARES ); #endif } #endif @implementation MiscTableScroll(Sort) //----------------------------------------------------------------------------- // MISC_INDIRECT // Indirect value-access methods. For lazy-mode tables where the // delegate and dataDelegate do not provide the corresponding // tableScroll:valueAtRow:column: method. We retrieve the cell from the // delegate or dataDelegate via the tableScroll:cellAtRow:column: method, // then we ask the cell for the value. //----------------------------------------------------------------------------- #define MISC_INDIRECT( DATA_TYPE, NAME, SUFFIX, FUNC_TYPE ) \ - (DATA_TYPE)indirect:obj NAME##AtRow:(int)row column:(int)col \ :(MiscEntrySortInfo*)p :(MiscSlotSortInfo*)q \ { \ id cell = (*(p->cell_at_func))( obj, \ @selector(tableScroll:cellAtRow:column:), \ self, row, col ); \ if (cell != 0) \ { \ if (p->cell_class == (id)cell->isa) \ { \ if (p->cell_func.SUFFIX != 0) \ return (*(p->cell_func.SUFFIX))( cell, p->cell_sel ); \ } \ else \ { \ p->cell_class = (id)cell->isa; \ if ([cell respondsToSelector:p->cell_sel]) \ { \ p->cell_func.SUFFIX = (MISC_TS_##FUNC_TYPE##_VAL) \ [cell methodForSelector:p->cell_sel]; \ if (p->cell_func.SUFFIX != 0) \ return (*(p->cell_func.SUFFIX))( cell, p->cell_sel ); \ } \ else \ p->cell_func.SUFFIX = 0; \ } \ } \ return 0; \ } MISC_INDIRECT( int, tag, i, INT ) // tagAtRow:column: MISC_INDIRECT( int, intValue, i, INT ) // intValueAtRow:column: MISC_INDIRECT( float, floatValue, f, FLOAT ) // floatValueAtRow:column: MISC_INDIRECT( double, doubleValue, d, DOUBLE ) // doubleValueAtRow:column: MISC_INDIRECT( NSString*, stringValue,s,STRING) // stringValueAtRow:column: MISC_INDIRECT( int, state, i, INT ) // stateAtRow:column: MISC_INDIRECT( NSString*, title, s, STRING ) // titleAtRow:column: //----------------------------------------------------------------------------- // MISC_DIRECT // Direct value-access methods for eager-mode tables. These cover // routines match the correct prototype for sorting, and skip some // of the intervening overhead. //----------------------------------------------------------------------------- #define MISC_DIRECT( DATA_TYPE, NAME, SUFFIX, FUNC_TYPE ) \ - (DATA_TYPE)direct:dummyObj NAME##AtRow:(int)row column:(int)col \ :(MiscEntrySortInfo*)p :(MiscSlotSortInfo*)q \ { \ id cell = cells[ row * num_cols + col ]; \ if (p->cell_class == (id)cell->isa) \ { \ if (p->cell_func.SUFFIX != 0) \ return (*(p->cell_func.SUFFIX))( cell, p->cell_sel ); \ } \ else \ { \ p->cell_class = (id)cell->isa; \ if ([cell respondsToSelector:p->cell_sel]) \ { \ p->cell_func.SUFFIX = (MISC_TS_##FUNC_TYPE##_VAL) \ [cell methodForSelector:p->cell_sel]; \ if (p->cell_func.SUFFIX != 0) \ return (*(p->cell_func.SUFFIX))( cell, p->cell_sel ); \ } \ else \ p->cell_func.SUFFIX = 0; \ } \ return 0; \ } MISC_DIRECT( int, tag, i, INT ) // tagAtRow:column: MISC_DIRECT( int, intValue, i, INT ) // intValueAtRow:column: MISC_DIRECT( float, floatValue, f, FLOAT ) // floatValueAtRow:column: MISC_DIRECT( double, doubleValue, d, DOUBLE ) // doubleValueAtRow:column: MISC_DIRECT( NSString*, stringValue, s, STRING) // stringValueAtRow:column: MISC_DIRECT( int, state, i, INT ) // stateAtRow:column: MISC_DIRECT( NSString*, title, s, STRING ) // titleAtRow:column: //----------------------------------------------------------------------------- // copy_info //----------------------------------------------------------------------------- static void copy_info( MiscEntrySortInfo& info, MiscEntrySortInfo const& x ) { info.value_target = x.value_target; info.value_sel = x.value_sel; info.value_obj = x.value_obj; info.value_func.i = x.value_func.i; info.cell_at_func = x.cell_at_func; info.cell_class = x.cell_class; info.cell_sel = x.cell_sel; info.cell_func.i = x.cell_func.i; } //----------------------------------------------------------------------------- // set_info //----------------------------------------------------------------------------- static void set_info( MiscEntrySortInfo* info, id targ, SEL aSel, id obj, SEL cell_sel ) { info->value_target = targ; info->value_sel = aSel; info->value_obj = obj; info->value_func.i = (MISC_TS_INT_AT)[targ methodForSelector:aSel]; info->cell_at_func = [obj methodForSelector:@selector(tableScroll:cellAtRow:column:)]; info->cell_class = 0; info->cell_sel = cell_sel; info->cell_func.i = 0; } //----------------------------------------------------------------------------- // MISC_INFO_INIT // Precompute which objects and messages to use to retrieve the values // for a particular type of data. //----------------------------------------------------------------------------- #define MISC_INFO_INIT( NAME, CMD ) \ - (BOOL)sortInfoInit_##NAME:(MiscEntrySortInfo*)p \ { \ id del; \ BOOL ok = YES; \ del = [self responsibleDelegate:MiscDelegateFlags::DEL_##CMD##_AT]; \ if (del != 0) \ set_info( p,del,@selector(tableScroll:NAME##AtRow:column:),self,0 ); \ else if (!lazy) \ set_info( p, self, @selector(direct:NAME##AtRow:column: : :), 0, \ @selector(NAME) ); \ else \ { \ del = [self responsibleDelegate:MiscDelegateFlags::DEL_CELL_AT]; \ if (del != 0) \ set_info(p,self,@selector(indirect:NAME##AtRow:column: : :),del, \ @selector(NAME)); \ else \ ok = NO; \ } \ return ok; \ } MISC_INFO_INIT( tag, TAG ) // sortInfoInit_tag: MISC_INFO_INIT( intValue, INT_VALUE ) // sortInfoInit_intValue: MISC_INFO_INIT( floatValue, FLOAT_VALUE ) // sortInfoInit_floatValue: MISC_INFO_INIT( doubleValue, DOUBLE_VALUE ) // sortInfoInit_doubleValue: MISC_INFO_INIT( stringValue, STRING_VALUE ) // sortInfoInit_stringValue: MISC_INFO_INIT( state, STATE ) // sortInfoInit_state: MISC_INFO_INIT( title, TITLE ) // sortInfoInit_title: //----------------------------------------------------------------------------- // - sortValueInfoInit:type: //----------------------------------------------------------------------------- - (BOOL)sortValueInfoInit:(MiscEntrySortInfo*)p type:(MiscSortType)type { BOOL ok = NO; switch (type) { case MISC_SORT_STRING_CASE_INSENSITIVE: case MISC_SORT_STRING_CASE_SENSITIVE: ok = [self sortInfoInit_stringValue:p]; break; case MISC_SORT_INT: case MISC_SORT_UNSIGNED_INT: ok = [self sortInfoInit_intValue:p]; break; case MISC_SORT_TAG: case MISC_SORT_UNSIGNED_TAG: ok = [self sortInfoInit_tag:p]; break; case MISC_SORT_FLOAT: ok = [self sortInfoInit_floatValue:p]; break; case MISC_SORT_DOUBLE: ok = [self sortInfoInit_doubleValue:p]; break; case MISC_SORT_TITLE_CASE_INSENSITIVE: case MISC_SORT_TITLE_CASE_SENSITIVE: ok = [self sortInfoInit_title:p]; break; case MISC_SORT_STATE: case MISC_SORT_UNSIGNED_STATE: ok = [self sortInfoInit_state:p]; break; default: case MISC_SORT_SKIP: break; } return ok; } //----------------------------------------------------------------------------- // - compareSlotFunction //----------------------------------------------------------------------------- - (MiscCompareSlotFunc)compareSlotFunction { return sort_slot_func ? sort_slot_func : MiscDefaultCompareSlotFunc; } //----------------------------------------------------------------------------- // - setCompareSlotFunction: //----------------------------------------------------------------------------- - (void)setCompareSlotFunction:(MiscCompareSlotFunc)f { sort_slot_func = (f ? f : MiscDefaultCompareSlotFunc); } //----------------------------------------------------------------------------- // - sortInfoInit:border: // // NOTE *VAL-INFO* // The val_info[] array holds the index of the first entry for each // sort-type. This is used so that the value-access information only // needs to be computed once. Later entries can use the value-access // information already computed for previous entries of the same // sort-type. If there is no method to retrieve the data for a given // sort-type, then the entry is marked with VAL_INFO_ERROR, and all // entries with that sort-type will be excluded from the final // entry_info[] array. //----------------------------------------------------------------------------- - (void)sortInfoInit:(MiscSlotSortInfo*)ip border:(MiscBorderType)b { MiscBorderType const ob = MISC_OTHER_BORDER(b); MiscTableBorder* const obp = info[ob]->border; NSZone* const z = [self zone]; ip->table_scroll = self; ip->zone = z; ip->border_type = ob; ip->num_entries = 0; ip->entry_info = 0; ip->need_copy = lazy && ([self bufferCount] < 2); int M; // Number of "cols". NSArray* v = [self slotSortVector:ob]; if (v != 0) M = [v count]; else { M = obp->count(); if (M > 0) { int const* pMap = obp->getV2PMap(); NSMutableArray* a = [NSMutableArray array]; for (int i = 0; i < M; i++) { int n = (pMap != 0 ? pMap[i] : i); [a addObject:[NSNumber numberWithInt:n]]; } v = a; } } if (M > 0) { unsigned int const sz = M * sizeof( MiscEntrySortInfo ); MiscEntrySortInfo* ep = (MiscEntrySortInfo*) NSZoneMalloc( z, sz ); if (ep != 0) { ip->num_entries = M; ip->entry_info = ep; int const VAL_INFO_BLANK = -1; int const VAL_INFO_ERROR = -2; int val_info[ MISC_SORT_TYPE_MAX + 1 ]; // NOTE *VAL-INFO* for (int k = 0; k <= (int) MISC_SORT_TYPE_MAX; k++) val_info[k] = VAL_INFO_BLANK; int j = 0; for (int i = 0; i < M; i++) { MiscEntrySortInfo& r = ep[j]; int n = (v ? [[v objectAtIndex:i] intValue] : i); BOOL was_neg = (n < 0); if (was_neg) n = ~n; r.slot = n; if ([self border:ob slotSortDirection:n]==MISC_SORT_DESCENDING) was_neg = !was_neg; r.ascending = !was_neg; if ((r.compare_func = [self border:ob slotSortFunction:n])==0) { MiscSortType t = [self border:ob slotSortType:n]; if ((unsigned int)t <= (unsigned int)MISC_SORT_TYPE_MAX && t != MISC_SORT_SKIP) { r.sort_type = t; r.compare_func = COMPARE_FUNC[t]; int* vi = val_info + (int)t; if (*vi == VAL_INFO_BLANK) { if ([self sortValueInfoInit:&r type:t]) *vi = j; else *vi = VAL_INFO_ERROR; } else if (*vi != VAL_INFO_ERROR) copy_info( r, ep[ *vi ] ); if (*vi != VAL_INFO_ERROR) j++; // Keep this slot. } } else { r.sort_type = MISC_SORT_CUSTOM; j++; // Keep this slot. } } ip->num_entries = j; // Number of non-skip slots. } else { [NSException raise:NSMallocException format:@"%d bytes requested", sz]; } } } //----------------------------------------------------------------------------- // - sortInfoDone: //----------------------------------------------------------------------------- - (void)sortInfoDone:(MiscSlotSortInfo*)ip { if (ip->entry_info != 0) { // Cast off const-ness. NSZoneFree( ip->zone, (MiscEntrySortInfo*) ip->entry_info ); ip->entry_info = 0; } } //----------------------------------------------------------------------------- // - slots:areSorted:func:info: //----------------------------------------------------------------------------- - (BOOL)slots:(int const*)v2p areSorted:(int)N func:(MiscCompareSlotFunc)func info:(MiscSlotSortInfo*)ip { if (v2p == 0) { for (int i = 1; i < N; i++) if ((*func)( i-1, i, ip ) > 0) return NO; } else { for (int i = 1; i < N; i++) if ((*func)( v2p[i-1], v2p[i], ip ) > 0) return NO; } return YES; } #if(USE_BSORT) //----------------------------------------------------------------------------- // - sortSlots: //----------------------------------------------------------------------------- - (void)sortSlots:(MiscBorderType)b { MiscTableBorder* const bp = info[b]->border; int const N = bp->count(); if (N > 1) { MiscCompareSlotFunc func = [self compareSlotFunction]; MiscSlotSortInfo data; [self sortInfoInit:&data border:b]; if (data.num_entries > 0) { NSZone* const z = [self zone]; int* const new_v2p = (int*) NSZoneMalloc(z,N*sizeof(int)); if (new_v2p != 0) { for (int j = 0; j < N; j++) new_v2p[j] = j; bsort( new_v2p, N, func, &data ); bp->setV2PMap( new_v2p ); NSZoneFree( z, new_v2p ); [self resetSelection]; [self setNeedsDisplay:YES]; } else { [self error:"Memory allocation failure.\n" ]; } } [self sortInfoDone:&data]; } } #else //----------------------------------------------------------------------------- // - sortSlots: //----------------------------------------------------------------------------- - (void)sortSlots:(MiscBorderType)b { MiscTableBorder* const bp = info[b]->border; int const N = bp->count(); if (N > 1) { MiscCompareSlotFunc func = [self compareSlotFunction]; MiscSlotSortInfo data; [self sortInfoInit:&data border:b]; if (data.num_entries > 0) { int const* const old_v2p = bp->getV2PMap(); if (![self slots:old_v2p areSorted:N func:func info:&data]) { NSZone* const z = [self zone]; unsigned int const sz = N * sizeof(int); int* const new_v2p = (int*) NSZoneMalloc( z, sz ); if (new_v2p != 0) { for (int j = 0; j < N; j++) new_v2p[j] = j; do_qsort( new_v2p, N, func, &data ); bp->setV2PMap( new_v2p ); NSZoneFree( z, new_v2p ); [self resetSelection]; [self setNeedsDisplay:YES]; } else { [NSException raise:NSMallocException format:@"%d bytes requested", sz]; } } } [self sortInfoDone:&data]; } } #endif - (void)sortColumns { [self sortSlots:MISC_COL_BORDER]; } - (void)sortRows { [self sortSlots:MISC_ROW_BORDER]; } //----------------------------------------------------------------------------- // - slotsAreSorted: //----------------------------------------------------------------------------- - (BOOL)slotsAreSorted:(MiscBorderType)b { BOOL sorted = YES; MiscTableBorder* const border = info[b]->border; int const N = border->count(); // Number of "rows". if (N > 1) { MiscSlotSortInfo data; [self sortInfoInit:&data border:b]; if (data.num_entries > 0) { sorted = [self slots:border->getV2PMap() areSorted:N func:[self compareSlotFunction] info:&data]; } [self sortInfoDone:&data]; } return sorted; } - (BOOL)columnsAreSorted { return [self slotsAreSorted:MISC_COL_BORDER]; } - (BOOL)rowsAreSorted { return [self slotsAreSorted:MISC_ROW_BORDER]; } //----------------------------------------------------------------------------- // - border:compareSlots::info: //----------------------------------------------------------------------------- - (int)border:(MiscBorderType)b compareSlots:(int)slot1 :(int)slot2 info:(MiscSlotSortInfo*)ip { return (*[self compareSlotFunction])( slot1, slot2, ip ); } - (int)compareColumns:(int)c1 :(int)c2 info:(MiscSlotSortInfo*)ip { return [self border:MISC_COL_BORDER compareSlots:c1:c2 info:ip]; } - (int)compareRows:(int)r1 :(int)r2 info:(MiscSlotSortInfo*)ip { return [self border:MISC_ROW_BORDER compareSlots:r1:r2 info:ip]; } //----------------------------------------------------------------------------- // - border:compareSlots:: //----------------------------------------------------------------------------- - (int)border:(MiscBorderType)b compareSlots:(int)slot1 :(int)slot2 { int rc = 0; MiscSlotSortInfo sort_info; [self sortInfoInit:&sort_info border:b]; if (sort_info.num_entries > 0) rc = [self border:b compareSlots:slot1:slot2 info:&sort_info]; [self sortInfoDone:&sort_info]; return rc; } - (int)compareColumns:(int)c1 :(int)c2 { return [self border:MISC_COL_BORDER compareSlots:c1:c2]; } - (int)compareRows:(int)r1 :(int)r2 { return [self border:MISC_ROW_BORDER compareSlots:r1:r2]; } //----------------------------------------------------------------------------- // - border:sortSlot: // NOTE *1* If the destination is at a higher index than the source, // then the destination index needs to be decremented by one to // reflect the fact that the contents of the "from" slot will be // removed, (and all following slots will be shifted down by one // position) before the insertion will take place. //----------------------------------------------------------------------------- - (BOOL)border:(MiscBorderType)b sortSlot:(int)pslot { BOOL moved = NO; int const N = [self numberOfSlots:b]; // Number of "rows" if (N > 1) { MiscSlotSortInfo sort_info; [self sortInfoInit:&sort_info border:b]; if (sort_info.num_entries > 0) { MiscCompareSlotFunc func = [self compareSlotFunction]; int const vslot = [self border:b slotPosition:pslot]; int const prev = (vslot > 0 ? [self border:b slotAtPosition:vslot - 1] : -1); int const next = (vslot < N - 1 ? [self border:b slotAtPosition:vslot + 1] : N); int adjust = 0; // NOTE *1* int lo = vslot; int hi = vslot - 1; if (prev >= 0 && (*func)( pslot, prev, &sort_info ) < 0) { lo = 0; hi = vslot - 2; } else if (next < N && (*func)( pslot, next, &sort_info) > 0) { adjust = -1; // NOTE *1* lo = vslot + 1; hi = N - 1; } while (lo <= hi) // Binary search. { int const mid = (lo + hi) >> 1; int const n = [self border:b slotAtPosition:mid]; int const cmp = (*func)( pslot, n, &sort_info ); if (cmp < 0) hi = mid - 1; else lo = mid + 1; } if (lo != vslot) { [self border:b moveSlot:vslot toSlot:lo + adjust]; // *1* [self setNeedsDisplay:YES]; moved = YES; } } [self sortInfoDone:&sort_info]; } return moved; } - (BOOL)sortColumn:(int)n { return [self border:MISC_COL_BORDER sortSlot:n]; } - (BOOL)sortRow:(int)n { return [self border:MISC_ROW_BORDER sortSlot:n]; } //----------------------------------------------------------------------------- // - border:slotIsSorted: //----------------------------------------------------------------------------- - (BOOL)border:(MiscBorderType)b slotIsSorted:(int)pslot { BOOL sorted = YES; int const N = [self numberOfSlots:b]; // Number of "rows". if (N > 1) { MiscSlotSortInfo data; [self sortInfoInit:&data border:b]; if (data.num_entries > 0) { MiscCompareSlotFunc func = [self compareSlotFunction]; int const vslot = [self border:b slotPosition:pslot]; int const prev = (vslot > 0 ? [self border:b slotAtPosition:vslot - 1] : -1); int const next = (vslot < N - 1 ? [self border:b slotAtPosition:vslot + 1] : N); if (prev >= 0 && (*func)( prev, pslot, &data ) > 0) sorted = NO; else if (next < N && (*func)( pslot, next, &data ) > 0) sorted = NO; } [self sortInfoDone:&data]; } return sorted; } - (BOOL)columnIsSorted:(int)n { return [self border:MISC_COL_BORDER slotIsSorted:n]; } - (BOOL)rowIsSorted:(int)n { return [self border:MISC_ROW_BORDER slotIsSorted:n]; } //----------------------------------------------------------------------------- // autoSort //----------------------------------------------------------------------------- - (BOOL)autoSortSlots:(MiscBorderType)b { return info[b]->autoSort; } - (void)border:(MiscBorderType)b setAutoSortSlots:(BOOL)flag { if (info[b]->autoSort != flag) { info[b]->autoSort = flag; MiscBorderInfo const* const ip = info[ MISC_OTHER_BORDER(b) ]; if (ip->isOn) { [[self window] invalidateCursorRectsForView:ip->view]; [ip->view setNeedsDisplay:YES]; } } } - (BOOL)autoSortColumns { return [self autoSortSlots:MISC_COL_BORDER]; } - (void)setAutoSortColumns:(BOOL)flag { [self border:MISC_COL_BORDER setAutoSortSlots:flag]; } - (BOOL)autoSortRows { return [self autoSortSlots:MISC_ROW_BORDER]; } - (void)setAutoSortRows:(BOOL)flag { [self border:MISC_ROW_BORDER setAutoSortSlots:flag]; } //----------------------------------------------------------------------------- // Sort Vector //----------------------------------------------------------------------------- - (NSArray*)slotSortVector:(MiscBorderType)b { return info[b]->sort_vector; } - (void)border:(MiscBorderType)b setSlotSortVector:(NSArray*)v { MiscBorderInfo* const ip = info[b]; if (ip->sort_vector != 0) [ip->sort_vector autorelease]; if (v == 0 || [v count] == 0) ip->sort_vector = 0; else { ip->sort_vector = [v retain]; [self border:MISC_OTHER_BORDER(b) setAutoSortSlots:NO]; } } - (NSArray*)columnSortVector { return [self slotSortVector:MISC_COL_BORDER]; } - (void)setColumnSortVector:(NSArray*)v { [self border:MISC_COL_BORDER setSlotSortVector:v]; } - (NSArray*)rowSortVector { return [self slotSortVector:MISC_ROW_BORDER]; } - (void)setRowSortVector:(NSArray*)v { [self border:MISC_ROW_BORDER setSlotSortVector:v]; } //----------------------------------------------------------------------------- // Sort Function //----------------------------------------------------------------------------- - (MiscCompareEntryFunc)border:(MiscBorderType)b slotSortFunction:(int)n { return info[b]->border->getSortFunc_P(n); } - (void)border:(MiscBorderType)b setSlot:(int)n sortFunction:(MiscCompareEntryFunc)x { info[b]->border->setSortFunc_P(n,x); } - (MiscCompareEntryFunc)columnSortFunction:(int)n { return [self border:MISC_COL_BORDER slotSortFunction:n]; } - (void)setColumn:(int)n sortFunction:(MiscCompareEntryFunc)x { [self border:MISC_COL_BORDER setSlot:n sortFunction:x]; } - (MiscCompareEntryFunc)rowSortFunction:(int)n { return [self border:MISC_ROW_BORDER slotSortFunction:n]; } - (void)setRow:(int)n sortFunction:(MiscCompareEntryFunc)x { [self border:MISC_ROW_BORDER setSlot:n sortFunction:x]; } //----------------------------------------------------------------------------- // Sort Direction //----------------------------------------------------------------------------- - (MiscSortDirection)border:(MiscBorderType)b slotSortDirection:(int)n { return info[b]->border->getSortDirection_P(n); } - (void)border:(MiscBorderType)b setSlot:(int)n sortDirection:(MiscSortDirection)x { if ((unsigned int)x <= (unsigned int)MISC_SORT_DIR_MAX && x != info[b]->border->getSortDirection_P(n)) { info[b]->border->setSortDirection_P(n,x); MiscBorderInfo const* const ip = info[MISC_OTHER_BORDER(b)]; if (ip->isOn && ip->autoSort) { // FIXME: Just draw the part needed. [ip->view setNeedsDisplay:YES]; } } } - (MiscSortDirection)columnSortDirection:(int)n { return [self border:MISC_COL_BORDER slotSortDirection:n]; } - (void)setColumn:(int)n sortDirection:(MiscSortDirection)x { [self border:MISC_COL_BORDER setSlot:n sortDirection:x]; } - (MiscSortDirection)rowSortDirection:(int)n { return [self border:MISC_ROW_BORDER slotSortDirection:n]; } - (void)setRow:(int)n sortDirection:(MiscSortDirection)x { [self border:MISC_ROW_BORDER setSlot:n sortDirection:x]; } //----------------------------------------------------------------------------- // Sort Type //----------------------------------------------------------------------------- - (MiscSortType)border:(MiscBorderType)b slotSortType:(int)n; { return info[b]->border->getSortType_P(n); } - (void)border:(MiscBorderType)b setSlot:(int)n sortType:(MiscSortType)x { if ((unsigned int)x <= (unsigned int)MISC_SORT_TYPE_MAX) info[b]->border->setSortType_P(n,x); } - (MiscSortType)columnSortType:(int)n { return [self border:MISC_COL_BORDER slotSortType:n]; } - (void)setColumn:(int)n sortType:(MiscSortType)x { [self border:MISC_COL_BORDER setSlot:n sortType:x]; } - (MiscSortType)rowSortType:(int)n { return [self border:MISC_ROW_BORDER slotSortType:n]; } - (void)setRow:(int)n sortType:(MiscSortType)x { [self border:MISC_ROW_BORDER setSlot:n sortType:x]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScrollSymbols.M100444 1750 1750 4037 6757227336 25772 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollSymbols.M // // A work around for a bug in the Objective-C++ compiler for YellowBox // and OpenStep for Windows. By defining MISC_TABLE_SCROLL_EXPORTING, // this file tells Windows which variables to export from the DLL by // applying the __declspec(dllexport) directive to all symbols declared // with MISC_TABLE_SCROLL_EXTERN in the imported header files. Actual // definition of the exported variables is performed elsewhere as // appropriate for each symbol. This file merely provides the Microsoft // linker with the names of the symbols to export from the DLL. See // MiscTableTypes.h and Notes/DLL-EXPORT.txt for a full discussion. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollSymbols.M,v 1.1 99/06/15 03:47:06 sunshine Exp $ // $Log: MiscTableScrollSymbols.M,v $ // Revision 1.1 99/06/15 03:47:06 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // A work-around for an Objective-C++ compiler bug on Windows. Tells the // linker which variables should be exported from the framework's DLL. // //----------------------------------------------------------------------------- #define MISC_TABLE_SCROLL_EXPORTING #import MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableTypes.h100444 1750 1750 50326 6757227337 24345 0ustar sunshinesunshine#ifndef __MiscTableTypes_h #define __MiscTableTypes_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // // // Common types used for the MiscTableScroll object. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableTypes.h,v 1.13 99/06/15 03:54:33 sunshine Exp $ // $Log: MiscTableTypes.h,v $ // Revision 1.13 99/06/15 03:54:33 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Added macros for exporting variables from the framework's DLL: // MISC_TABLE_SCROLL_EXTERN, MISC_TABLE_SCROLL_PRIVATE_EXTERN, // MISC_TABLE_SCROLL_BUILDING, & MISC_TABLE_SCROLL_EXPORTING. // These macros are used to export new MiscTableScroll notifications. // Worked around Objective-C++ compiler bug on Windows where export of // symbols resulted in linker failing to initialize other unrelated variables. // Fixed bug: Was not using extern "C" to export MiscDefaultCompareFunc(). // Thus C and Objective-C clients were unable to access the function. // No longer #imports unportable . // Now #imports rather than . // // Revision 1.12 1998/03/22 13:14:10 sunshine // v133.1: Eliminated data-sizing. // // Revision 1.11 97/06/18 10:03:06 sunshine // v125.9: MISC_TABLE_CELL_ICON --> MISC_TABLE_CELL_IMAGE. //----------------------------------------------------------------------------- #ifdef __cplusplus # define MISC_TS_EXTERN_BEGIN(X) extern X { # define MISC_TS_EXTERN_END } # define MISC_TS_CLASS_DEF(X) class X #else # define MISC_TS_EXTERN_BEGIN(X) # define MISC_TS_EXTERN_END # define MISC_TS_CLASS_DEF(X) typedef struct X X #endif MISC_TS_EXTERN_BEGIN( "Objective-C" ) #import MISC_TS_EXTERN_END //----------------------------------------------------------------------------- // Platform-specific definitions for exporting variables and functions. // // Use the two EXTERN macros for exporting symbols. The macro should be used // as part of the declaration of the symbol in the interface file in place of // the standard "extern" declaration. Nothing special is required for the // definition of the symbol in the implementation file other than ensuring that // it is not declared "static". // // MISC_TABLE_SCROLL_EXTERN // Export as public symbol to clients of framework. // MISC_TABLE_SCROLL_PRIVATE_EXTERN // Export as private symbol for use within framework. // // Use the BUILDING and EXPORTING macros to correctly finalize export of // public symbols. There is an Objective-C++ compiler bug in YellowBox and // OpenStep 4.2 for Windows which results in a failure to initialize some // static, constant, file-global variables within the framework if a // __declspec(dllexport) appears in the compilation (even from a header file). // Specifically, the compiler incorrectly places the affected variables into a // ".drectve" section within the object file, instead of an ".rdata" section // where they belong. Since the linker discards .drectve sections before // producing the final output, these variables are never initialized and the // program crashes. The Objective-C compiler does not contain this bug, which // explains why the problem does not affect the AppKit or Foundation // frameworks. See Notes/DLL-EXPORT.txt for a detailed discussion. // // To work around this problem, it is necessary to use __declspec(dllexport) // only in files which do not otherwise contain variables needing // initialization, since the initialization may not occur on account of this // bug. The simplest solution is to create a file which exists only for the // purpose of exporting variables which are declared and defined elsewhere in // the framework. // // These macros should be defined at the appropriate times as discussed below. // The value of the macro is not relevant and may be the empty string. It is // safe to define these macros across all platforms, though they impact only // Windows. Clients of the framework should not define either of these // macros. // // MISC_TABLE_SCROLL_BUILDING // Must be defined when building the framework itself. Typically this is // done in the Makefile by passing the -D directive to the compiler. // MISC_TABLE_SCROLL_EXPORTING // Generally should be defined in a single implementation file which does // not define or provide any variables of its own. Typically this file // is empty except for two lines. One line #defines this macro, and the // other #includes the header file or files which declare the exported // variables. The actual definitions of the variables should be // elsewhere. // // To illustrate with a fictional framwork, MyFramework, which exports the // symbol MyFrameworkNotification, its header file might look like this: // // /* MyFramework.h */ // MISC_TABLE_SCROLL_EXTERN NSString* const MyFrameworkNotification; // // The implementation of MyFramework should be compiled with the macro // MISC_TABLE_SCROLL_BUILDING defined by the Makefile, using a -D directive. // The implementation file which actually defines MyFrameworkNotification // might look like this: // // /* MyFramework.M */ // NSString* const MyFrameworkNotification = @"MyFrameworkNotification"; // // Finally, a file which exists only to tell Windows which variables should be // exported from the DLL might look like this. It contains only two lines, a // #define and an #include. // // /* MyFrameworkSymbols.M */ // #define MISC_TABLE_SCROLL_EXPORTING // #include // //----------------------------------------------------------------------------- #if defined(__MACH__) #if defined(__cplusplus) #define MISC_TABLE_SCROLL_EXTERN extern "C" #define MISC_TABLE_SCROLL_PRIVATE_EXTERN __private_extern__ #else #define MISC_TABLE_SCROLL_EXTERN extern #define MISC_TABLE_SCROLL_PRIVATE_EXTERN __private_extern__ #endif #elif defined(SOLARIS) #if defined(__cplusplus) #define MISC_TABLE_SCROLL_EXTERN extern "C" #define MISC_TABLE_SCROLL_PRIVATE_EXTERN extern "C" #else #define MISC_TABLE_SCROLL_EXTERN extern #define MISC_TABLE_SCROLL_PRIVATE_EXTERN extern #endif #elif defined(WIN32) #if defined(MISC_TABLE_SCROLL_EXPORTING) #define MISC_TABLE_SCROLL_DECLSPEC __declspec(dllexport) #elif defined(MISC_TABLE_SCROLL_BUILDING) #define MISC_TABLE_SCROLL_DECLSPEC #else #define MISC_TABLE_SCROLL_DECLSPEC __declspec(dllimport) #endif #if defined(__cplusplus) #define MISC_TABLE_SCROLL_EXTERN extern "C" MISC_TABLE_SCROLL_DECLSPEC #define MISC_TABLE_SCROLL_PRIVATE_EXTERN extern #else #define MISC_TABLE_SCROLL_EXTERN MISC_TABLE_SCROLL_DECLSPEC extern #define MISC_TABLE_SCROLL_PRIVATE_EXTERN extern #endif #endif //----------------------------------------------------------------------------- // Types & Constants //----------------------------------------------------------------------------- typedef int MiscPixels; typedef int MiscCoord_V; // Visual coordinate. typedef int MiscCoord_P; // Physical coordinate. #define MISC_MIN_PIXELS_SIZE ((MiscPixels) 10) #define MISC_MAX_PIXELS_SIZE ((MiscPixels) 0x7FFF0000) typedef enum { MISC_COL_BORDER, MISC_ROW_BORDER } MiscBorderType; #define MISC_MAX_BORDER MISC_ROW_BORDER #define MISC_OTHER_BORDER(B) \ (B == MISC_ROW_BORDER ? MISC_COL_BORDER : MISC_ROW_BORDER) typedef struct { NSSize page_size; // [NSPrintInfo paperSize] NSRect print_rect; // MiscTableView rect. MiscCoord_V first_print_row;// one's comp if started on prev page. MiscCoord_V last_print_row; // one's comp if ends on later page. MiscCoord_V first_print_col;// one's comp if started on prev page. MiscCoord_V last_print_col; // one's comp if ends on later page. int print_page; // 1 <= print_page <= num_print_pages int print_row; // 1 <= print_row <= num_print_rows int print_col; // 1 <= print_col <= num_print_cols int num_print_pages; int num_print_rows; int num_print_cols; double scale_factor; BOOL is_scaled; } MiscTablePrintInfo; typedef enum { MISC_NO_TITLE, // No titles on row/col cells. MISC_NUMBER_TITLE, // Titles are sequential numbers. MISC_ALPHA_TITLE, // Titles are sequential alphabetics... MISC_CUSTOM_TITLE, // Titles are user-supplied strings... MISC_DELEGATE_TITLE // Ask the delegate for titles. } MiscTableTitleMode; #define MISC_MAX_TITLE MISC_DELEGATE_TITLE typedef enum { MISC_LIST_MODE, MISC_RADIO_MODE, MISC_HIGHLIGHT_MODE } MiscSelectionMode; #define MISC_MAX_MODE MISC_HIGHLIGHT_MODE typedef enum { MISC_TABLE_CELL_TEXT, MISC_TABLE_CELL_IMAGE, MISC_TABLE_CELL_BUTTON, MISC_TABLE_CELL_CALLBACK } MiscTableCellStyle; #define MISC_TABLE_CELL_MAX MISC_TABLE_CELL_CALLBACK #define MISC_SIZING_SPRINGY_BIT (1 << 0) // Adjusts for global limits. #define MISC_SIZING_USER_BIT (1 << 1) // User can resize. typedef enum { MISC_NUSER_NSPRINGY_SIZING, MISC_NUSER_SPRINGY_SIZING, MISC_USER_NSPRINGY_SIZING, MISC_USER_SPRINGY_SIZING, } MiscTableSizing; #define MISC_MAX_SIZING MISC_USER_SPRINGY_SIZING typedef enum { MISC_SORT_ASCENDING, MISC_SORT_DESCENDING } MiscSortDirection; #define MISC_SORT_DIR_MAX MISC_SORT_DESCENDING #define MISC_OTHER_DIRECTION(D)\ ((D) == MISC_SORT_DESCENDING ? \ MISC_SORT_ASCENDING : MISC_SORT_DESCENDING) typedef enum // Selector used to get data: { MISC_SORT_STRING_CASE_INSENSITIVE, // 0 -stringValue MISC_SORT_STRING_CASE_SENSITIVE, // 1 -stringValue MISC_SORT_INT, // 2 -intValue MISC_SORT_UNSIGNED_INT, // 3 -intValue MISC_SORT_TAG, // 4 -tag MISC_SORT_UNSIGNED_TAG, // 5 -tag MISC_SORT_FLOAT, // 6 -floatValue MISC_SORT_DOUBLE, // 7 -doubleValue MISC_SORT_SKIP, // 8 Don't compare cells in this slot. MISC_SORT_TITLE_CASE_INSENSITIVE, // 9 -title MISC_SORT_TITLE_CASE_SENSITIVE, // 10 -title MISC_SORT_STATE, // 11 -state MISC_SORT_UNSIGNED_STATE, // 12 -state } MiscSortType; #define MISC_SORT_TYPE_MAX MISC_SORT_UNSIGNED_STATE #define MISC_SORT_CUSTOM ((MiscSortType)(int(MISC_SORT_TYPE_MAX) + 1)) @class MiscTableScroll; typedef struct MiscEntrySortInfo MiscEntrySortInfo; typedef struct MiscSlotSortInfo MiscSlotSortInfo; //----------------------------------------------------------------------------- // MiscCompareEntryFunc // // Compare two cells, given the coordinates of the cells, and a pointer // to the sorting information structure. This is the prototype for // custom sort functions that you write, and install with // -border:setSlot:sortFunction:, -setColumn:sortFunction:, // or -setRow:sortFunction:. // // Returns: // < 0 if (table[r1][c1] < table[r2][c2]) // = 0 if (table[r1][c1] = table[r2][c2]) // > 0 if (table[r1][c1] > table[r2][c2]) // // When sorting rows: // info->border_type == MISC_COL_BORDER, col1 == col2 // // When sorting columns: // info->border_type == MISC_ROW_BORDER, row1 == row2 // // Always return the result of an "ascending" comparison. The // caller is responsible for choosing the sort direction. // // WARNING: // If info->need_copy is YES, you must copy the information from // the first cell *BEFORE* accessing the second cell. (This happens // with lazy tables that provide only a single buffer.) Failure to // do so will result in catastrophic worst-case performance and will // not sort the table. //----------------------------------------------------------------------------- typedef int (*MiscCompareEntryFunc) ( int r1, int c1, int r2, int c2, MiscEntrySortInfo const* entry_info, MiscSlotSortInfo* sort_info ); //----------------------------------------------------------------------------- // MiscCompareSlotFunc // // Compare two entire slots (usually rows) from the table. // // Returns: // < 0 if (table.b[slot1] < table.b[slot2]) // = 0 if (table.b[slot1] = table.b[slot2]) // > 0 if (table.b[slot1] > table.b[slot2]) // // The default version, MiscDefaultComareSlotFunc(), compares the // slots, one entry at a time, using the sorting information // structure. // // You can install a customized replacement via -setCompareSlotFunction: // // This routine is responsible for honoring the slot-sort-vector (order // in which columns/rows are visited), applying the sort-direction // (ascending/descending), and calling user-installed custom // slot-sort-funcs. //----------------------------------------------------------------------------- typedef int (*MiscCompareSlotFunc) ( int slot1, int slot2, MiscSlotSortInfo* ); MISC_TABLE_SCROLL_EXTERN int MiscDefaultCompareSlotFunc( int, int, MiscSlotSortInfo* ); //----------------------------------------------------------------------------- // MiscSlotSortInfo // // This structure provides the sorting information used by the // MiscDefaultCompareSlotFunc() function. This structure is properly // intialized by the -sortInfoInit:border: method, and storage is // reclaimed by the -sortInfoDone: method. The initialization and // cleanup is handled automatically by the sorting and comparison // methods that do NOT accept an "info" argument. You are responsible // for calling -sortInfoInit:border: and -sortInfoDone: when you call // any of the methods that DO accept an 'info' argument. // // Order in which entries are visited: // If you have installed a slot-sort-vector for the "other" border, that // will determine the order in which entries are compared. If you have // not installed a slot-sort-vector, the current visual order is used. // This information is stored in num_entries and entry_info[].slot // // Sort direction: // Each entry (slot from the "other" border) has a sort direction which // is either ascending or descending. This is the basis for determining // the sort direction of an entry. In addition, if you have installed // a slot-sort-vector, and any of the elements of that slot-sort-vector // are negative, they will reverse the sort direction of that entry. // (If the sort-direction for the entry is ascending, a negative index // will cause that entry to be sorted in descending order. If the // sort-direction for the entry is descending, a negative index will // cause that entry to be sorted in ascending order.) This information // is stored in entry_info[].ascending. // // Comparison function: // If you have installed a custom comparison function for the entry // (slot from the "other" border), your custom comparison function will // be used. Otherwise, an internal comparison function will be selected // based on the "sort-type" for the entry. The address of the function // is stored in entry_info[].compare_func. // // struct MiscSlotSortInfo // // table_scroll The MiscTableScroll being used. // // zone This is [table_scroll zone]. The zone that // is used for allocation of the entry_info[] // buff[] arrays. // // border_type The "other" border. When rows are being // compared, this is MISC_COL_BORDER. When // comparing columns, this is MISC_ROW_BORDER. // // num_entries The number of entries that will be compared. // Normally, this is the number of slots in // the "border_type" border (usually, the number // of columns). This can be different if you // have installed a slot-sort-vector. // // entry_info An array of sorting information for each // entry in a slot. This information is // precomputed in -sortInfoInit:border: for // use by MiscDefaultCompareSlotFunc(). // // need_copy Flag indicating whether information from the // the first entry (cell) must be copied before // accessing the second entry (cell). This is // YES when table_scroll is lazy and supplies // only a single buffer. // // struct MiscEntrySortInfo // // slot The original (physical) index of the slot that // this entry corresponds to. // // ascending Sort direction: 1=ascending, 0=descending. // // value_func The address of the function that will be // value_target called to get the values for the comparison. // value_sel The function must match the argument pattern // of the -tableScroll:intValueAtRow:column: // method, but the data-type of the return value // depends on the sort-type of the slot. The // -sortInfoInit:border: method determines which // object will supply the values for the slot // (value_target), and which message should be // used to retrieve the value (value_sel). Then // it calls [value_target methodFor:value_sel] to // get the address of the function (value_func). // The value_func is called directly during // sorting, rather than going through the normal // Objective-C dispatch. // // value_obj The object that will be passed as the // 'tableScroll:' argument to the 'value_func' // function. This is usually the table scroll // itself. // // cell_at_func Address of the tableScroll:cellAtRow:column: // function. // cell_class Last cell class seen in this slot. // cell_sel Selector to extract value (intValue,etc.) // cell_func Address of the cell's cell_sel function. // // sort_type The sort-type for this slot. // // compare_func Comparison function to use for this slot. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // MISC_TS_TYPE_AT // This macro generates a function prototype typedef that describes the // methods used to retrieve the values for comparison during sorting. // The macro is used to generate function prototypes for each data-type // that can be compared. These prototypes describe the arguments passed // to a function that has the same format as the following standard // delegate message: // - (int) tableScroll:(MiscTableScroll*)tableScroll // intValueAtRow:(int)row column:(int)col // The data-type for the return value is different for each of the // data-types. //----------------------------------------------------------------------------- #define MISC_TS_TYPE_AT( TYPE, NAME ) \ typedef TYPE (*MISC_TS_##NAME##_AT)(id,SEL,id,int r,int c, ...); MISC_TS_TYPE_AT( int, INT ) // MISC_TS_INT_AT MISC_TS_TYPE_AT( float, FLOAT ) // MISC_TS_FLOAT_AT MISC_TS_TYPE_AT( double, DOUBLE ) // MISC_TS_DOUBLE_AT MISC_TS_TYPE_AT( NSString*, STRING ) // MISC_TS_STRING_AT typedef union { MISC_TS_INT_AT i; MISC_TS_FLOAT_AT f; MISC_TS_DOUBLE_AT d; MISC_TS_STRING_AT s; } MISC_TS_VAL_AT_FUNC; //----------------------------------------------------------------------------- // MISC_TS_TYPE_VAL // This macro generates a function prototype typedef that describes // the value-access methods for a cell. They match the following // pattern: // - (int) intValue // The data-type for the return value is different for each. //----------------------------------------------------------------------------- #define MISC_TS_TYPE_VAL( TYPE, NAME ) \ typedef TYPE (*MISC_TS_##NAME##_VAL)(id,SEL); MISC_TS_TYPE_VAL( int, INT ) // MISC_TS_INT_VAL MISC_TS_TYPE_VAL( float, FLOAT ) // MISC_TS_FLOAT_VAL MISC_TS_TYPE_VAL( double, DOUBLE ) // MISC_TS_DOUBLE_VAL MISC_TS_TYPE_VAL( NSString*, STRING ) // MISC_TS_STRING_VAL typedef union { MISC_TS_INT_VAL i; MISC_TS_FLOAT_VAL f; MISC_TS_DOUBLE_VAL d; MISC_TS_STRING_VAL s; } MISC_TS_VAL_FUNC; // *** WARNING *** // The sizes of these structures are likely to change between versions. // *** WARNING *** struct MiscEntrySortInfo { int slot; int ascending; MISC_TS_VAL_AT_FUNC value_func; id value_target; SEL value_sel; id value_obj; IMP cell_at_func; id cell_class; SEL cell_sel; MISC_TS_VAL_FUNC cell_func; MiscSortType sort_type; MiscCompareEntryFunc compare_func; }; struct MiscSlotSortInfo { MiscTableScroll* table_scroll; NSZone* zone; MiscBorderType border_type; int num_entries; MiscEntrySortInfo const* entry_info; BOOL need_copy; }; #endif // __MiscTableTypes_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableView.M100444 1750 1750 103654 6757227337 24143 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableView.M // // General-purpose 2-D display object that works with the // MiscTableScroll to provide row/column sizing and dragging. // // This object is responsible for drawing, mouse and keyboard // events in the content portion of the display. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableView.M,v 1.40 99/06/15 04:01:11 sunshine Exp $ // $Log: MiscTableView.M,v $ // Revision 1.40 99/06/15 04:01:11 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // For clarity these methods were renamed: // drawClippedText --> drawsClippedText // trackBy: --> setSelectsByRows: // trackingBy --> selectsByRows // setTracking: --> setIsTrackingMouse: // // Revision 1.39 1998/05/13 14:50:13 sunshine // v139.1: Worked around AppKit problem where it sends -mouseDown: events to // this view even though they are out of bounds. // // Revision 1.38 98/03/29 23:58:32 sunshine // v138.1: Now uses NSColor's "system" color for grid rather than "gray". //----------------------------------------------------------------------------- #import "MiscTableViewPrivate.h" #import "MiscColorList.h" #import "MiscDrawList.h" #import "MiscGeometry.h" #import "MiscHighlightTracker.h" #import "MiscListTracker.h" #import "MiscRadioTracker.h" #import "MiscRectColorList.h" #import "MiscRectList.h" #import "MiscSparseSet.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" #import #import #import extern "Objective-C" { #import #import // Control-text notifications #import #import } extern "C" { #import // floor() } //----------------------------------------------------------------------------- // dump_map //----------------------------------------------------------------------------- // static void dump_map( NSString* label, int const* map, int nc, int nr ) // { // fprintf( stderr, "%s nc=%d, nr=%d\n", [label lossyCString], nc, nr ); // int const* p = map; // for (int r = 0; r < nr; r++) // { // for (int c = 0; c < nc; c++, p++) // fprintf( stderr, " %d", *p ); // fprintf( stderr, "\n" ); // } // } //----------------------------------------------------------------------------- // extract_rect // Extract a contiguous rectangular group of cells to be drawn from // this boolean map of cells that need drawing. // // 1) Find the first cell that needs to be drawn (c0,r0). // 2) Include all contiguous following cells on the same row // that also need to be drawn (cN,r0). // 3) Include all contiguous following rows in which (c0..cN) // all need to be drawn. // 4) Clear the flags from the map to indicate that these cells // do not need to be drawn again. //----------------------------------------------------------------------------- static int extract_rect( int* map, int nc, int nr, MiscCoord_V& c0, MiscCoord_V& r0, MiscCoord_V& cN, MiscCoord_V& rN ) { int* p = map; int* plim = p + (nc * nr); while (p < plim && *p == 0) p++; if (p >= plim) return 0; // *** RETURN *** int rc = *p; int r, c; int const n = p - map; r0 = n / nc; c0 = n % nc; c = c0; while (c < nc && *p == rc) { c++; p++; } cN = c - 1; int const num_cols = (c - c0); r = r0; do { p -= num_cols; memset( p, 0, num_cols * sizeof(*p) ); if (++r >= nr) break; p += nc; plim = p + num_cols; while (p < plim && *p == rc) p++; } while (p >= plim); rN = r - 1; return rc; } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation MiscTableView //----------------------------------------------------------------------------- // scroll //----------------------------------------------------------------------------- - (id)scroll { return [self enclosingScrollView]; } //----------------------------------------------------------------------------- // - initWithFrame:scroll:colInfo:rowInfo: // // NOTE *1*: Default behavior is to take keyboard-cursor information from // the row-border. //----------------------------------------------------------------------------- - (id)initWithFrame:(NSRect)rect scroll:(MiscTableScroll*)scroll colInfo:(MiscTableBorder*)i_col_border rowInfo:(MiscTableBorder*)i_row_border { NSZone* const z = [self zone]; rect.size.width = i_col_border->totalSize(); rect.size.height = i_row_border->totalSize(); [super initWithFrame:rect]; colBorder = i_col_border; rowBorder = i_row_border; trackerBorder = MISC_ROW_BORDER; // NOTE *1* oldColSel = new( NSZoneMalloc(z,sizeof(*oldColSel)) ) MiscSparseSet; oldRowSel = new( NSZoneMalloc(z,sizeof(*oldRowSel)) ) MiscSparseSet; [self setSelectionMode:[scroll selectionMode]]; inhibitCursor = 0; cursorSlot = -1; return self; } //----------------------------------------------------------------------------- // - dealloc //----------------------------------------------------------------------------- - (void)dealloc { [[self scroll] abortEditing]; [tracker release]; NSZone* const z = [self zone]; if (oldColSel != 0) { oldColSel->MiscSparseSet::~MiscSparseSet(); NSZoneFree( z, oldColSel ); } if (oldRowSel != 0) { oldRowSel->MiscSparseSet::~MiscSparseSet(); NSZoneFree( z, oldRowSel ); } [super dealloc]; } //----------------------------------------------------------------------------- // - isFlipped //----------------------------------------------------------------------------- - (BOOL)isFlipped { return YES; } //----------------------------------------------------------------------------- // - isOpaque //----------------------------------------------------------------------------- - (BOOL)isOpaque { return YES; } //----------------------------------------------------------------------------- // - acceptsFirstMouse: //----------------------------------------------------------------------------- - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { return YES; } //----------------------------------------------------------------------------- // - acceptsFirstResponder //----------------------------------------------------------------------------- - (BOOL)acceptsFirstResponder { return YES; } //----------------------------------------------------------------------------- // - adjustSize //----------------------------------------------------------------------------- - (void)adjustSize { [self setFrameSize: NSMakeSize( colBorder->totalSize(), rowBorder->totalSize() )]; } //============================================================================= // TYPE VARIATIONS //============================================================================= - (MiscTableBorder*)borderFor:(MiscBorderType)b { return (b == MISC_ROW_BORDER ? rowBorder : colBorder); } - (MiscTableBorder*)otherBorder:(MiscBorderType)b { return [self borderFor:MISC_OTHER_BORDER(b)]; } //============================================================================= // FRAMES //============================================================================= //----------------------------------------------------------------------------- // - cellFrameAtRow:column: -- Physical coords //----------------------------------------------------------------------------- - (NSRect)cellFrameAtRow:(MiscCoord_P)row column:(MiscCoord_P)col { if (row < 0 || row >= rowBorder->count() || col < 0 || col >= colBorder->count()) return NSMakeRect( 0, 0, 0, 0 ); else { MiscCoord_V v_row = rowBorder->physicalToVisual( row ); MiscCoord_V v_col = colBorder->physicalToVisual( col ); return NSMakeRect( colBorder->getOffset(v_col), rowBorder->getOffset(v_row), colBorder->effectiveSize(v_col), rowBorder->effectiveSize(v_row) ); } } //----------------------------------------------------------------------------- // - cellInsideAtRow:column: -- Actual cell frame inside border lines //----------------------------------------------------------------------------- - (NSRect)cellInsideAtRow:(MiscCoord_P)row column:(MiscCoord_P)col { NSRect r = [self cellFrameAtRow:row column:col]; if (!NSIsEmptyRect(r)) { r.size.width--; r.size.height--; } return r; } //----------------------------------------------------------------------------- // - getSlotFrameAt:from: -- Physical coords //----------------------------------------------------------------------------- - (NSRect)getSlotFrameAt:(MiscCoord_P)pslot from:(MiscBorderType)bdr { MiscTableBorder* const b = [self borderFor:bdr]; if (pslot < 0 || pslot >= b->count()) return NSZeroRect; else { MiscCoord_V vslot = b->physicalToVisual( pslot ); MiscRect_O ro( bdr, [self bounds] ); ro.setX_O( b->getOffset(vslot) ); ro.setWidth_O( b->effectiveSize(vslot) ); return (NSRect)ro; } } //----------------------------------------------------------------------------- // - getSlotInsideAt:from: -- Physical coords //----------------------------------------------------------------------------- - (NSRect)getSlotInsideAt:(MiscCoord_P)slot from:(MiscBorderType)bdr { NSRect r = [self getSlotFrameAt:slot from:bdr]; if (!NSIsEmptyRect(r)) { r.size.width--; r.size.height--; } return r; } //----------------------------------------------------------------------------- // - getRow:column:forPoint: //----------------------------------------------------------------------------- - (BOOL)getRow:(int*)row column:(int*)col forPoint:(NSPoint)pt { if (NSPointInRect( pt, [self bounds] )) { MiscCoord_V const vr = rowBorder->visualForOffset( (MiscPixels)pt.y ); MiscCoord_V const vc = colBorder->visualForOffset( (MiscPixels)pt.x ); *row = rowBorder->visualToPhysical( vr ); *col = colBorder->visualToPhysical( vc ); return YES; } return NO; } //============================================================================= // VISIBLE / SCROLLING STUFF //============================================================================= //----------------------------------------------------------------------------- // - firstVisibleSlot: -- Physical coord //----------------------------------------------------------------------------- - (int)firstVisibleSlot:(MiscBorderType)bdr { MiscCoord_P ret = -1; MiscTableBorder* const b = [self borderFor:bdr]; int const lim = b->count(); if (lim > 0) { MiscRect_O r( bdr, [self visibleRect] ); MiscPixels const vorg = r.getX_O(); MiscPixels const vlim = r.getMaxX_O(); MiscCoord_V v = b->visualForOffset( vorg ); if (v < lim - 1 && b->getOffset(v) < vorg && b->getOffset(v+1) < vlim) v++; // First slot whose leading edge is visible ret = b->visualToPhysical( v ); } return ret; } //----------------------------------------------------------------------------- // - lastVisibleSlot: -- Physical coord //----------------------------------------------------------------------------- - (int)lastVisibleSlot:(MiscBorderType)bdr { MiscCoord_P ret = -1; MiscTableBorder* const b = [self borderFor:bdr]; if (b->count() > 0) { MiscRect_O r( bdr, [self visibleRect] ); MiscPixels const vorg = r.getX_O(); MiscPixels const vlim = r.getMaxX_O(); MiscCoord_V v = b->visualForOffset( vlim ); if (v > 0 && b->getOffset(v) + b->effectiveSize(v) > vlim && b->getOffset(v-1) + b->effectiveSize(v-1) > vorg) v--; // Last slot whose trailing edge is visible ret = b->visualToPhysical( v ); } return ret; } //----------------------------------------------------------------------------- // - numberOfVisibleSlots: //----------------------------------------------------------------------------- - (int)numberOfVisibleSlots:(MiscBorderType)bdr { MiscTableBorder* const b = [self borderFor:bdr]; if (b->count() > 0) { MiscRect_O r( bdr, [self visibleRect] ); MiscPixels const vorg = r.getX_O(); MiscPixels const vlim = r.getMaxX_O(); MiscCoord_V const first = b->visualForOffset( vorg ); MiscCoord_V const last = b->visualForOffset( vlim ); return last - first + 1; } return 0; } //----------------------------------------------------------------------------- // - border:slotIsVisible: -- Physical coord //----------------------------------------------------------------------------- - (BOOL)border:(MiscBorderType)bdr slotIsVisible:(int)n { MiscTableBorder* const b = [self borderFor:bdr]; if (b->count() > 0) { MiscCoord_V const x = b->physicalToVisual(n); MiscPixels const xorg = b->getOffset(x); MiscPixels const xlim = xorg + b->effectiveSize(x); MiscRect_O r( bdr, [self visibleRect] ); MiscPixels const vorg = r.getX_O(); MiscPixels const vlim = r.getMaxX_O(); return xorg <= vlim && xlim >= vorg; } return NO; } //----------------------------------------------------------------------------- // - border:setFirstVisibleSlot: -- Physical coord //----------------------------------------------------------------------------- - (void)border:(MiscBorderType)bdr setFirstVisibleSlot:(int)n { MiscTableBorder* const b = [self borderFor:bdr]; int const num_slots = b->count(); if (0 <= n && n < num_slots) { MiscCoord_V const x = b->physicalToVisual(n); MiscPixels const xorg = b->getOffset(x); MiscRect_O r( bdr, [[self superview] bounds] ); r.setX_O( xorg ); [self scrollPoint:r]; } } //----------------------------------------------------------------------------- // - border:setLastVisibleSlot: -- Physical coord //----------------------------------------------------------------------------- - (void)border:(MiscBorderType)bdr setLastVisibleSlot:(int)n { MiscTableBorder* const b = [self borderFor:bdr]; int const num_slots = b->count(); if (0 <= n && n < num_slots) { MiscPixels const vwidth = MiscRect_O( bdr, [self visibleRect] ).getWidth_O(); MiscCoord_V const x = b->physicalToVisual(n); MiscPixels const vorg = b->getOffset(x) + b->effectiveSize(x) - vwidth; MiscRect_O r( bdr, [[self superview] bounds] ); r.setX_O( vorg ); [self scrollPoint:r]; } } //============================================================================= // SCROLLING //============================================================================= //----------------------------------------------------------------------------- // - scrollCellToVisibleAtRow:column: -- Physical coords //----------------------------------------------------------------------------- - (void)scrollCellToVisibleAtRow:(int)row column:(int)col { [self scrollRectToVisible:[self cellFrameAtRow:row column:col]]; } //----------------------------------------------------------------------------- // - border:scrollToVisible: -- Physical coord //----------------------------------------------------------------------------- - (void)border:(MiscBorderType)bdr scrollToVisible:(MiscCoord_P)pslot { MiscTableBorder* const b = [self borderFor:bdr]; MiscCoord_V const vslot = b->physicalToVisual( pslot ); NSRect v = [self visibleRect]; MiscRect_O r( bdr, v ); r.setX_O( b->getOffset(vslot) ); r.setWidth_O( b->effectiveSize(vslot) ); [self scrollRectToVisible:r]; } //----------------------------------------------------------------------------- // - scrollRowToVisible: -- Physical coord //----------------------------------------------------------------------------- - (void)scrollRowToVisible:(int)row { [self border:MISC_ROW_BORDER scrollToVisible:row]; } //----------------------------------------------------------------------------- // - scrollColToVisible: -- Physical coord //----------------------------------------------------------------------------- - (void)scrollColumnToVisible:(int)col { [self border:MISC_COL_BORDER scrollToVisible:col]; } //============================================================================= // DRAWING //============================================================================= //----------------------------------------------------------------------------- // - cMin:cMax:rMin:rMax:forRect: //----------------------------------------------------------------------------- - (void)cMin:(MiscCoord_V*)cmin cMax:(MiscCoord_V*)cmax rMin:(MiscCoord_V*)rmin rMax:(MiscCoord_V*)rmax forRect:(NSRect)nsrect { *cmin = colBorder->visualForOffset( (MiscPixels) nsrect.origin.x ); *cmax = colBorder->visualForOffset( (MiscPixels) (nsrect.origin.x + nsrect.size.width) - 1 ); *rmin = rowBorder->visualForOffset( (MiscPixels) nsrect.origin.y ); *rmax = rowBorder->visualForOffset( (MiscPixels) (nsrect.origin.y + nsrect.size.height) - 1 ); } //----------------------------------------------------------------------------- // - drawRect: //----------------------------------------------------------------------------- - (void)drawRect:(NSRect)nsrect { BOOL const need_clip = ([[self subviews] count] != 0); if (need_clip) { PSgsave(); NSRectClip( nsrect ); } MiscCoord_V c, cmin, cmax, c0, cN; MiscCoord_V r, rmin, rmax, r0, rN; [self cMin:&cmin cMax:&cmax rMin:&rmin rMax:&rmax forRect:nsrect]; if (cmin >= 0 && cmax >= 0 && rmin >= 0 && rmax >= 0) { MiscColorList cl; id const scroll = [self scroll]; int const NORM_COLOR = cl.store([scroll backgroundColor]) + 1; int const HIGH_COLOR = cl.store([scroll selectedBackgroundColor]) + 1; int const nc = (cmax - cmin) + 1; int const nr = (rmax - rmin) + 1; int* map = (int*) calloc( nc * nr, sizeof(*map) ); int* p = map; for (r = rmin; r <= rmax; r++) // Transparent and ownerDraw { // cell backgrounds. MiscCoord_P const pr = rowBorder->visualToPhysical(r); BOOL const row_lit = rowBorder->isSelected(r); for (c = cmin; c <= cmax; c++,p++) { MiscCoord_P const pc = colBorder->visualToPhysical(c); BOOL const lit = row_lit || colBorder->isSelected(c); id cell = [scroll cellAtRow:pr column:pc]; if (cell == 0 || ![cell isOpaque]) *p = lit ? HIGH_COLOR : NORM_COLOR; else if ([cell respondsToSelector:@selector(ownerDraw)] && [cell ownerDraw]) { if (lit && [cell respondsToSelector: @selector(selectedBackgroundColor)]) *p = cl.store( [cell selectedBackgroundColor] ) + 1; else if ([cell respondsToSelector: @selector(backgroundColor)]) *p = cl.store( [cell backgroundColor] ) + 1; else *p = lit ? HIGH_COLOR : NORM_COLOR; } } } MiscRectColorList rcl; NSRect rect; int color; while ((color = extract_rect( map, nc, nr, c0, r0, cN, rN )) != 0) { c0 += cmin; cN += cmin; r0 += rmin; rN += rmin; MiscPixels const x0 = colBorder->getOffset( c0 ); MiscPixels const y0 = rowBorder->getOffset( r0 ); MiscPixels const xN = colBorder->getOffset( cN ) + colBorder->effectiveSize( cN ); MiscPixels const yN = rowBorder->getOffset( rN ) + rowBorder->effectiveSize( rN ); rect.origin.x = x0; rect.origin.y = y0; rect.size.width = (xN - x0); rect.size.height = (yN - y0); rcl.append( rect, cl[ color - 1 ] ); } free( map ); MiscPixels x,y; MiscPixels const ix0 = colBorder->getOffset( cmin ); MiscPixels const iy0 = rowBorder->getOffset( rmin ); MiscPixels const ixN = colBorder->getOffset( cmax ) + colBorder->effectiveSize( cmax ); MiscPixels const iyN = rowBorder->getOffset( rmax ) + rowBorder->effectiveSize( rmax ); MiscRectList grid_rl; // Grid drawing list. y = iy0; // Horizontal grid lines. rect.origin.x = floor( (float) ix0 ); rect.size.width = floor( (float) (ixN - ix0) ); rect.size.height = 1; for (r = rmin; r <= rmax; r++) { MiscPixels const h = rowBorder->effectiveSize(r); y += h - 1; rect.origin.y = floor( (float) y ); grid_rl.append( rect ); y++; } x = ix0; // Vertical grid lines. rect.origin.y = floor( (float) iy0 ); rect.size.width = 1; rect.size.height = floor( (float) (iyN - iy0) ); for (c = cmin; c <= cmax; c++) { MiscPixels const w = colBorder->effectiveSize(c); x += w - 1; rect.origin.x = floor( (float) x ); grid_rl.append( rect ); x++; } rcl.draw(); grid_rl.draw( [NSColor gridColor] ); NSColor* const fgColor = [scroll textColor]; NSColor* const hfgColor = [scroll selectedTextColor]; NSFont* const fnt = [scroll font]; MiscDrawList dl( [scroll drawsClippedText] ); y = iy0; // Cell contents. for (r = rmin; r <= rmax; r++) { MiscCoord_P const pr = rowBorder->visualToPhysical(r); BOOL const row_lit = rowBorder->isSelected(r); MiscPixels const h = rowBorder->effectiveSize(r); rect.origin.y = floor( (float) y ); rect.size.height = floor( (float) (h - 1) ); x = ix0; for (c = cmin; c <= cmax; c++) { MiscCoord_P const pc = colBorder->visualToPhysical(c); BOOL const lit = row_lit || colBorder->isSelected(c); MiscPixels const w = colBorder->effectiveSize(c); rect.origin.x = x; rect.size.width = (w - 1); id cell = [scroll cellAtRow:pr column:pc]; if (cell == 0 || [cell respondsToSelector:@selector(ownerDraw)] && [cell ownerDraw]) { dl.append( rect, cell, lit, (lit ? hfgColor : fgColor), fnt ); } else [cell drawWithFrame:rect inView:self]; x += w; } y += h; } dl.draw(); if ([self shouldDrawCursor]) [self drawCursorClipTo:NSMakeRect(ix0, iy0, ixN - ix0, iyN - iy0)]; } if (need_clip) PSgrestore(); } //----------------------------------------------------------------------------- // - drawCellAtRow:column: -- Physical coords //----------------------------------------------------------------------------- - (void)drawCellAtRow:(int)row column:(int)col { [self drawRect:[self cellFrameAtRow:row column:col]]; } //----------------------------------------------------------------------------- // - drawRow: -- Physical coord //----------------------------------------------------------------------------- - (void)drawRow:(int)row { if ([self canDraw] && row >= 0 && row < rowBorder->count()) { MiscCoord_V const vRow = rowBorder->physicalToVisual(row); MiscPixels const offset = rowBorder->getOffset(vRow); MiscPixels const size = rowBorder->effectiveSize(vRow); NSRect r = [self visibleRect]; if (offset + size >= NSMinY(r) && offset < NSMaxY(r)) { r.origin.y = rowBorder->getOffset(vRow); r.size.height = rowBorder->effectiveSize(vRow); [self setNeedsDisplayInRect:r]; } } } //----------------------------------------------------------------------------- // - drawColumn: -- Physical coord //----------------------------------------------------------------------------- - (void)drawColumn:(int)col { if ([self canDraw] && col >= 0 && col < colBorder->count()) { MiscCoord_V const vCol = colBorder->physicalToVisual(col); MiscPixels const offset = colBorder->getOffset(vCol); MiscPixels const size = colBorder->effectiveSize(vCol); NSRect r = [self visibleRect]; if (offset + size >= NSMinX(r) && offset < NSMaxX(r)) { r.origin.x = colBorder->getOffset(vCol); r.size.width = colBorder->effectiveSize(vCol); [self setNeedsDisplayInRect:r]; } } } //============================================================================= // SELECTION //============================================================================= //----------------------------------------------------------------------------- // - setSelectionMode: //----------------------------------------------------------------------------- - (void)setSelectionMode:(MiscSelectionMode)mode { NSZone* const z = [self zone]; if (tracker != 0) [tracker release]; switch (mode) { case MISC_LIST_MODE: tracker = [MiscListTracker allocWithZone:z]; break; case MISC_RADIO_MODE: tracker = [MiscRadioTracker allocWithZone:z]; break; case MISC_HIGHLIGHT_MODE: tracker = [MiscHighlightTracker allocWithZone:z]; break; } [tracker initBorder:[self borderFor:trackerBorder]]; } //----------------------------------------------------------------------------- // - selectionChanged //----------------------------------------------------------------------------- - (void)selectionChanged { MiscSparseSet const& newColSel = colBorder->selectionSet(); MiscSparseSet const& newRowSel = rowBorder->selectionSet(); MiscCoord_V cmin, cmax; MiscCoord_V rmin, rmax; NSRect vis = [self visibleRect]; [self cMin:&cmin cMax:&cmax rMin:&rmin rMax:&rmax forRect:vis]; for (MiscCoord_V r = rmin; r <= rmax; r++) { BOOL rowWasOn = oldRowSel->contains(r); BOOL rowIsOn = newRowSel.contains(r); for (MiscCoord_V c = cmin; c <= cmax; c++) { BOOL wasOn = rowWasOn || oldColSel->contains(c); BOOL isOn = rowIsOn || newColSel.contains(c); if (isOn != wasOn) { [self setNeedsDisplayInRect: NSMakeRect( colBorder->getOffset(c), rowBorder->getOffset(r), colBorder->effectiveSize(c), rowBorder->effectiveSize(r) )]; } } } *oldColSel = newColSel; *oldRowSel = newRowSel; } //----------------------------------------------------------------------------- // - resetSelection //----------------------------------------------------------------------------- - (void)resetSelection { *oldColSel = colBorder->selectionSet(); *oldRowSel = rowBorder->selectionSet(); } //----------------------------------------------------------------------------- // - setSelectsByRows: //----------------------------------------------------------------------------- - (void)setSelectsByRows:(BOOL)flag { trackerBorder = (flag ? MISC_ROW_BORDER : MISC_COL_BORDER); } //----------------------------------------------------------------------------- // - selectsByRows //----------------------------------------------------------------------------- - (BOOL)selectsByRows { return (trackerBorder == MISC_ROW_BORDER); } //============================================================================= // MOUSE TRACKING //============================================================================= //----------------------------------------------------------------------------- // - constrainSlot:inBorder: //----------------------------------------------------------------------------- - (MiscCoord_V)constrainSlot:(MiscCoord_V)s inBorder:(MiscTableBorder*)b { if (s < 0) s = 0; else if (s >= b->count()) s = b->count() - 1; return s; } //----------------------------------------------------------------------------- // - displayNewSelection //----------------------------------------------------------------------------- - (void)displayNewSelection { id const scroll = [self scroll]; [scroll selectionChanged]; [scroll displayIfNeeded]; } //----------------------------------------------------------------------------- // - sendAction:to: // // NOTE *1*: Conforms to Control's -sendAction:to: which does *not* send // any message if the "action" is null. //----------------------------------------------------------------------------- - (BOOL)sendAction:(SEL)cmd to:(id)obj { if (cmd != 0) // NOTE *1* return [NSApp sendAction:cmd to:obj from:[self scroll]]; return NO; } //----------------------------------------------------------------------------- // - setClickedCellFromEvent: //----------------------------------------------------------------------------- - (void)setClickedCellFromEvent:(NSEvent*)e { NSPoint const p = [self convertPoint:[e locationInWindow] fromView:0]; NSRect b = [self bounds]; MiscCoord_V const v_row = (p.y < NSMaxY(b) ? rowBorder->visualForOffset( (MiscPixels)p.y ) : -1); MiscCoord_V const v_col = (p.x < NSMaxX(b) ? colBorder->visualForOffset( (MiscPixels)p.x ) : -1); MiscCoord_P const p_row = rowBorder->visualToPhysical( v_row ); MiscCoord_P const p_col = colBorder->visualToPhysical( v_col ); [[self scroll] setClickedRow:p_row column:p_col]; } //----------------------------------------------------------------------------- // - cellTrackMouse:atRow:column: //----------------------------------------------------------------------------- - (BOOL)cellTrackMouse:(NSEvent*)p atRow:(MiscCoord_V)v_row column:(MiscCoord_V)v_col { BOOL upInCell = NO; MiscCoord_P const p_col = colBorder->visualToPhysical( v_col ); MiscCoord_P const p_row = rowBorder->visualToPhysical( v_row ); NSRect r = [self cellInsideAtRow:p_row column:p_col]; id const scroll = [self scroll]; id cell = [scroll cellAtRow:p_row column:p_col]; [scroll setClickedRow:p_row column:p_col]; if ([scroll editIfAble:p atRow:p_row column:p_col]) upInCell = YES; else if ([self canPerformDragAtRow:p_row column:p_col withEvent:p]) upInCell = [self awaitDragEvent:p atRow:p_row column:p_col inRect:r]; else if ([cell isEnabled]) { NSWindow* win = [self window]; [self lockFocus]; [scroll setIsTrackingMouse:YES]; [cell setCellAttribute:NSCellHighlighted to:1]; [scroll drawCellAtRow:p_row column:p_col]; [win flushWindow]; upInCell = [cell trackMouse:p inRect:r ofView:self untilMouseUp:[[cell class] prefersTrackingUntilMouseUp]]; [scroll setIsTrackingMouse:NO]; [cell setCellAttribute:NSCellHighlighted to:0]; [scroll drawCellAtRow:p_row column:p_col]; [self unlockFocus]; [win flushWindow]; } return upInCell; } //----------------------------------------------------------------------------- // - mouseDown: // // NOTE: *OUT-OF-BOUNDS* // The AppKit allows up to 3 pixels of slop on double-clicks even when // the new location is outside the bounds of the view receiving the // original click. They send the second event to the original view, but // they do not coerce the location to the same location as the original // event. Our code assumes all mouseDown: events are located within // the bounds of our view, so reject all events outside our bounds. //----------------------------------------------------------------------------- - (void)mouseDown:(NSEvent*)p { unsigned int const WANTED = (NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSPeriodicMask); id const scroll = [self scroll]; BOOL const doubleClicked = ([p clickCount] > 1); NSPoint evpt = [self convertPoint:[p locationInWindow] fromView:0]; float const x = evpt.x; // NOTE *OUT-OF-BOUNDS* float const y = evpt.y; NSRect const r = [self bounds]; if (x >= 0 && x < r.size.width && y >= 0 && y < r.size.height) { MiscCoord_V const v_col = colBorder->visualForOffset((MiscPixels)x); MiscCoord_V const v_row = rowBorder->visualForOffset((MiscPixels)y); NSParameterAssert( v_col >= 0 ); NSParameterAssert( v_row >= 0 ); NSParameterAssert( v_col < colBorder->count() ); NSParameterAssert( v_row < rowBorder->count() ); MiscCoord_V slot = (trackerBorder == MISC_COL_BORDER ? v_col : v_row); MiscTableBorder* const b = [self borderFor:trackerBorder]; [self eraseCursor]; [self disableCursor]; [tracker mouseDown:p atPos:slot]; [self otherBorder:trackerBorder]->selectNone(); [self displayNewSelection]; BOOL mouseUpInCell = NO; if ([scroll isEnabled]) mouseUpInCell = [self cellTrackMouse:p atRow:v_row column:v_col]; if (!mouseUpInCell) { [NSEvent startPeriodicEventsAfterDelay:0.1 withPeriod:0.1]; NSEvent* lastEvent = [p copy]; for (;;) { p = [[self window] nextEventMatchingMask:WANTED]; if (p == 0 || [p type] == NSLeftMouseUp) break; else if ([p type] == NSPeriodic) [self autoscroll:lastEvent]; else { [lastEvent release]; lastEvent = [p copy]; } NSPoint const new_loc = [self convertPoint:[lastEvent locationInWindow] fromView:0]; MiscPixels const offset = MiscPoint_O( trackerBorder, new_loc ).getX_O(); MiscCoord_V const new_slot = offset < MiscRect_O(trackerBorder,[self bounds]).getMaxX_O() ? b->visualForOffset(offset) : b->count(); if (new_slot != slot) { slot = new_slot; [tracker mouseDragged:p atPos:slot]; [self displayNewSelection]; } } [lastEvent release]; [NSEvent stopPeriodicEvents]; [self setClickedCellFromEvent:p]; } [tracker mouseUp:p atPos:slot]; [self displayNewSelection]; [scroll border:trackerBorder setCursorSlot: b->visualToPhysical([self constrainSlot:slot inBorder:b])]; [self enableCursor]; if ([self shouldDrawCursor]) [self drawCursor]; [[self window] flushWindow]; if ([scroll isEnabled]) { [scroll sendAction]; if (doubleClicked && ![scroll isEditing]) // FIXME: not right [scroll sendDoubleAction]; } } } //----------------------------------------------------------------------------- // *FIXME* // OPENSTEP 4.2 Objective-C++ compiler for NT (final release) crashes // whenever a message is sent to 'super' from within a category. This // bug also afflicts the 4.2 (prerelease) compiler for Mach and NT. // Work around it by providing stub methods in the main (non-category) // implementation which merely forward the appropriate message to 'super' // on behalf of the categories. Though ugly, it works, is very // localized, and simple to remove when the bug is finally fixed. //----------------------------------------------------------------------------- - (void)superPrint:(id)sender { [super print:sender]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableView.h100444 1750 1750 12477 6757227337 24160 0ustar sunshinesunshine#ifndef __MiscTableView_h #define __MiscTableView_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableView.h // // General-purpose 2-D display object that works with the // MiscTableScroll to provide row/column sizing and dragging. // // This object is responsible for drawing, mouse and keyboard // events in the content portion of the display. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableView.h,v 1.18 99/06/15 03:56:30 sunshine Exp $ // $Log: MiscTableView.h,v $ // Revision 1.18 99/06/15 03:56:30 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Methods renamed: trackBy: to setSelectsByRows:, trackingBy to selectsByRows // Page header and footer are now strongly typed as NSView rather than id. // The strong typing extends to the Java environment more cleanly. // // Revision 1.17 1998/03/22 13:13:03 sunshine // v133.1: Now prints corner view. // // Revision 1.16 97/11/23 07:41:24 sunshine // v130.1: Broke off MiscTableViewDrag.M and MiscTableViewCursor.M //----------------------------------------------------------------------------- extern "Objective-C" { #import } #import @class MiscBorderView, MiscCornerView, MiscMouseTracker, MiscTableScroll; @class NSCell, NSText; class MiscSparseSet; class MiscTableBorder; struct MiscTSPageBreak { MiscPixels offset; MiscPixels size; MiscCoord_V first; // One's comp if started on earlier page. MiscCoord_V last; // One's comp if ends on later page. }; struct MiscTSPageImages { NSImage* page_header; NSImage* page_footer; NSImage* col_titles; NSImage* row_titles; NSImage* corner_view; }; struct MiscTablePages { MiscTablePrintInfo info; MiscTSPageBreak* col_breaks; MiscTSPageBreak* row_breaks; MiscTSPageImages* images; NSView* pageHeader; NSView* pageFooter; MiscBorderView* colTitles; MiscBorderView* rowTitles; MiscCornerView* cornerView; float page_header_height; float page_footer_height; float col_titles_height; float row_titles_width; }; @interface MiscTableView : NSView { MiscTableBorder* colBorder; MiscTableBorder* rowBorder; MiscBorderType trackerBorder; MiscMouseTracker* tracker; MiscSparseSet* oldColSel; MiscSparseSet* oldRowSel; MiscTablePages* pages; unsigned int inhibitCursor; MiscCoord_V cursorSlot; } - (id)initWithFrame:(NSRect)r scroll:(MiscTableScroll*)s colInfo:(MiscTableBorder*)colBorder rowInfo:(MiscTableBorder*)rowBorder; - (void)adjustSize; - (id)scroll; - (NSRect)cellInsideAtRow:(MiscCoord_P)row column:(MiscCoord_P)col; - (NSRect)cellFrameAtRow:(int)row column:(int)col; // Physical coords - (BOOL)getRow:(int*)row column:(int*)col // Physical coords forPoint:(NSPoint)point; - (void)drawCellAtRow:(int)row column:(int)col; // Physical coords - (void)drawRow:(int)row; // Physical coord - (void)drawColumn:(int)col; // Physical coord - (void)scrollCellToVisibleAtRow:(int)row column:(int)col; // Physical coords - (void)scrollRowToVisible:(int)row; // Physical coord - (void)scrollColumnToVisible:(int)col; // Physical coord - (int)numberOfVisibleSlots:(MiscBorderType)b; // All physical coords. - (int)firstVisibleSlot:(MiscBorderType)b; - (int)lastVisibleSlot:(MiscBorderType)b; - (BOOL)border:(MiscBorderType)b slotIsVisible:(int)n; - (void)border:(MiscBorderType)b setFirstVisibleSlot:(int)n; - (void)border:(MiscBorderType)b setLastVisibleSlot:(int)n; - (void)setSelectionMode:(MiscSelectionMode)mode; - (void)selectionChanged; - (void)resetSelection; - (void)setSelectsByRows:(BOOL)flag; - (BOOL)selectsByRows; - (BOOL)sendAction:(SEL)cmd to:(id)obj; - (void)mouseDown:(NSEvent*)event; - (void)superPrint:(id)sender; // See implementation for explanation. @end // KEYBOARD CURSOR ------------------------------------------------------------ @interface MiscTableView(Cursor) - (void)reflectCursor; - (void)disableCursor; // Can nest. - (void)enableCursor; - (BOOL)isCursorEnabled; - (void)drawCursor; - (void)eraseCursor; - (BOOL)shouldDrawCursor; - (void)keyboardSelect:(NSEvent*)p; - (void)moveCursorBy:(int)delta; @end // PRINTING ------------------------------------------------------------------- @interface MiscTableView(Print) - (void)print:(id)sender; - (BOOL)knowsPagesFirst:(int*)first last:(int*)last; - (NSRect)rectForPage:(int)n; - (NSPoint)locationOfPrintRect:(NSRect)rect; - (void)drawPageBorderWithSize:(NSSize)size; - (MiscTablePrintInfo const*)getPrintInfo; @end #endif // __MiscTableView_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableViewCursor.M100444 1750 1750 26562 6757227340 25315 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableViewCursor.M // // Keyboard cursor methods for MiscTableView. // // FIXME: The PostScript pattern used to draw the dotted "keyboard focus" // rectangle gets "out-of-phase" as this view scrolls. Consequently it // does not tile correctly. The Adobe Purple Book section 10.4.4 implies // that the pattern has to be recreated each time the view changes. (I // forsee using -initGState for this.) As an alternative, consider using // NSDottedFrameRect() which is available under OPENSTEP 4.2, but not 4.1. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableViewCursor.M,v 1.3 99/06/15 04:03:27 sunshine Exp $ // $Log: MiscTableViewCursor.M,v $ // Revision 1.3 99/06/15 04:03:27 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Sends new -didBecomeFirstResponder & -didResignFirstResponder messages to // owning MiscTableScroll. No longer notifies NSFontManager when becoming // first responder. MiscTableScroll is now responsible for that. // // Revision 1.2 98/03/29 23:59:05 sunshine // v138.1: #import was missing "MiscTableScroll/" for public header. //----------------------------------------------------------------------------- #import #import "MiscTableViewPrivate.h" #import "MiscTableBorder.h" #import "MiscMouseTracker.h" extern "Objective-C" { #import } extern "C" { #import "MiscTableViewPS.h" #import // floor() } int const NUM_EDGES = 4; // 4 edges to draw per focus rectangle int const NUM_COORDS = 4; // 4 coords per rectangle (x,y,w,h) int const MAX_COORDS = NUM_EDGES * NUM_COORDS; // 16 coords per 4 rects //----------------------------------------------------------------------------- // init_pswrap //----------------------------------------------------------------------------- static inline void init_pswrap() { static initialized = NO; if (!initialized) { initialized = YES; MISC_TV_initps(); } } @implementation MiscTableView(Cursor) //============================================================================= // CURSOR DRAWING //============================================================================= - (BOOL)isCursorEnabled { return (inhibitCursor == 0); } - (void)disableCursor { inhibitCursor++; } - (void)enableCursor { inhibitCursor--; } //----------------------------------------------------------------------------- // - shouldDrawCursor //----------------------------------------------------------------------------- - (BOOL)shouldDrawCursor { NSWindow* w = [self window]; return ([self isCursorEnabled] && [self canDraw] && [w isKeyWindow] && [w firstResponder] == self); } //----------------------------------------------------------------------------- // - getCursorSlot //----------------------------------------------------------------------------- - (MiscCoord_V)getCursorSlot { MiscTableBorder* const b = [self borderFor:trackerBorder]; MiscCoord_V vslot = b->getCursor(); int const lim = b->count(); if (lim > 0 && (vslot < 0 || vslot >= lim)) { vslot = b->selectedSlot(); if (vslot < 0) vslot = b->physicalToVisual([self firstVisibleSlot:trackerBorder]); NSParameterAssert( 0 <= vslot ); NSParameterAssert( vslot < lim ); b->setCursor( vslot ); } return vslot; } //----------------------------------------------------------------------------- // - getCursorFrame: //----------------------------------------------------------------------------- - (NSRect)getCursorFrame:(NSRect)clip { NSRect ret = NSZeroRect; if (rowBorder->count() > 0 && colBorder->count() > 0) { MiscTableBorder* const b = [self borderFor:trackerBorder]; MiscCoord_P const pslot = b->visualToPhysical( [self getCursorSlot] ); if (pslot >= 0) { NSRect r = [self getSlotInsideAt:pslot from:trackerBorder]; if (NSIntersectsRect( r, clip )) ret = r; } } return ret; } //----------------------------------------------------------------------------- // - getCursorEdges:clipTo: // // Compute rectangles for drawing which make up the edges of the "focus // frame". Each edge is composed of values from the focus frame, // possibly including its: X, Y, MAXX, MAXY. //----------------------------------------------------------------------------- - (int)getCursorEdges:(NSRect*)edges clipTo:(NSRect)clip { struct TV_Lines { char xs, maxxs, xc, ys, maxys, yc, ws, wc, hs, hc; }; static TV_Lines const LINES[ NUM_EDGES ] = { { 1, 0, 0, 1, 0, 0, 1, 0, 0, 1 }, // top { 1, 0, 0, 0, 1, -1, 1, 0, 0, 1 }, // bottom { 1, 0, 0, 1, 0, 1, 0, 1, 1, -2 }, // left { 0, 1, -1, 1, 0, 1, 0, 1, 1, -2 }, // right }; NSRect* edge = edges; NSRect rCursor = [self getCursorFrame:clip]; if (!NSIsEmptyRect( rCursor )) { for (int i = 0; i < NUM_EDGES; i++) { TV_Lines const& l = LINES[i]; NSRect r = NSMakeRect( l.xs * NSMinX(rCursor) + l.maxxs * NSMaxX(rCursor) + l.xc, l.ys * NSMinY(rCursor) + l.maxys * NSMaxY(rCursor) + l.yc, l.ws * NSWidth(rCursor) + l.wc, l.hs * NSHeight(rCursor) + l.hc ); r = NSIntersectionRect( clip, r ); if (!NSIsEmptyRect(r)) *edge++ = r; } } return (edge - edges); } //----------------------------------------------------------------------------- // - getCursorCoords:clipTo: //----------------------------------------------------------------------------- - (int)getCursorCoords:(float*)coords clipTo:(NSRect)in_clip { int num_coords = 0; NSRect clip; if (NSIsEmptyRect( in_clip )) clip = [self visibleRect]; else clip = in_clip; NSRect edges[ NUM_EDGES ]; int const num_edges = [self getCursorEdges:edges clipTo:clip]; if (num_edges > 0) { float* p = coords; for (int i = 0; i < num_edges; i++) { NSRect const& edge = edges[i]; *p++ = NSMinX( edge ); *p++ = NSMinY( edge ); *p++ = NSWidth( edge ); *p++ = NSHeight( edge ); } num_coords = num_edges * NUM_COORDS; } return num_coords; } //----------------------------------------------------------------------------- // - drawCursorCoords:count: //----------------------------------------------------------------------------- - (void)drawCursorCoords:(float const*)coords count:(int)n { init_pswrap(); BOOL needsFocus = ([NSView focusView] != self); if (needsFocus) [self lockFocus]; MISC_TV_dashedrects( coords, n ); if (needsFocus) [self unlockFocus]; } //----------------------------------------------------------------------------- // - drawCursorClipTo: //----------------------------------------------------------------------------- - (void)drawCursorClipTo:(NSRect)clip { if ([self isCursorEnabled]) { float coords[ MAX_COORDS ]; int const num_coords = [self getCursorCoords:coords clipTo:clip]; if (num_coords > 0) { [self drawCursorCoords:coords count:num_coords]; cursorSlot = [self borderFor:trackerBorder]->getCursor(); } } } //----------------------------------------------------------------------------- // - drawCursor //----------------------------------------------------------------------------- - (void)drawCursor { [self drawCursorClipTo:NSZeroRect]; } //----------------------------------------------------------------------------- // - eraseCursor //----------------------------------------------------------------------------- - (void)eraseCursor { if ([self isCursorEnabled]) { MiscTableBorder* const b = [self borderFor:trackerBorder]; if (cursorSlot >= 0 && cursorSlot < b->count()) { [self disableCursor]; MiscCoord_P s = b->visualToPhysical( cursorSlot ); if (trackerBorder == MISC_COL_BORDER) [self drawColumn:s]; else [self drawRow:s]; [self enableCursor]; cursorSlot = -1; } } } //----------------------------------------------------------------------------- // - becomeFirstResponder //----------------------------------------------------------------------------- - (BOOL)becomeFirstResponder { NSWindow* win = [self window]; if (win && [win isKeyWindow]) { if ([self shouldDrawCursor]) { [self drawCursor]; [win flushWindow]; } [[self scroll] didBecomeFirstResponder]; } return YES; } //----------------------------------------------------------------------------- // - resignFirstResponder //----------------------------------------------------------------------------- - (BOOL)resignFirstResponder { [self eraseCursor]; [[self window] flushWindow]; [[self scroll] didResignFirstResponder]; return YES; } //----------------------------------------------------------------------------- // - becomeKeyWindow //----------------------------------------------------------------------------- - (void)becomeKeyWindow { if ([self shouldDrawCursor]) { [self drawCursor]; [[self window] flushWindow]; } [[NSFontManager sharedFontManager] setSelectedFont:[[self scroll] font] isMultiple:NO]; } //----------------------------------------------------------------------------- // - resignKeyWindow //----------------------------------------------------------------------------- - (void)resignKeyWindow { [self eraseCursor]; [[self window] flushWindow]; } //----------------------------------------------------------------------------- // - reflectCursor //----------------------------------------------------------------------------- - (void)reflectCursor { if ([self shouldDrawCursor]) { NSWindow* w = [self window]; [w disableFlushWindow]; [self eraseCursor]; [self drawCursor]; [w enableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // - moveCursorBy: //----------------------------------------------------------------------------- - (void)moveCursorBy:(int)delta { MiscTableBorder* const b = [self borderFor:trackerBorder]; int const lim = b->count(); if (lim > 0) { MiscCoord_V slot = b->getCursor() + delta; if (slot < 0) slot = lim - 1; else if (slot >= lim) slot = 0; b->setCursor( slot ); NSWindow* const w = [self window]; [w disableFlushWindow]; [self reflectCursor]; [self border:trackerBorder scrollToVisible:b->visualToPhysical(slot)]; [w enableFlushWindow]; [w flushWindow]; } } //----------------------------------------------------------------------------- // - keyboardSelect: //----------------------------------------------------------------------------- - (void)keyboardSelect:(NSEvent*)p { [tracker mouseDown:p atPos:[self borderFor:trackerBorder]->getCursor()]; } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableViewDrag.M100444 1750 1750 23075 6757227340 24711 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableViewDrag.M // // Image dragging methods for MiscTableView. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableViewDrag.M,v 1.2 98/03/29 23:59:48 sunshine Exp $ // $Log: MiscTableViewDrag.M,v $ // Revision 1.2 98/03/29 23:59:48 sunshine // v138.1: #import was missing "MiscTableScroll/" for public header. // Implemented -shouldDelayWindowOrderingForEvent: // // Revision 1.1 97/11/23 07:41:42 sunshine // v130.1: Image dragging methods. //----------------------------------------------------------------------------- #import "MiscTableViewPrivate.h" #import "MiscTableScrollPrivate.h" #import extern "Objective-C" { #import #import #import #import } extern "C" { #import // floor() } typedef MiscDelegateFlags DF; @implementation MiscTableView(Drag) //============================================================================= // IMAGE DRAGGING //============================================================================= static inline float absval( float x ) { return (x < 0 ? -x : x ); } static inline BOOL isSlop( NSEvent* e1, NSEvent* e2, float const slop ) { NSPoint const p1 = [e1 locationInWindow]; NSPoint const p2 = [e2 locationInWindow]; return (absval(p1.x - p2.x) <= slop && absval(p1.y - p2.y) <= slop); } //----------------------------------------------------------------------------- // draggingSourceOperationMaskForLocal: //----------------------------------------------------------------------------- - (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)flag { id const scroll = [self scroll]; id const d = [scroll responsibleDelegate:DF::DEL_DRAG_OP_MASK]; if (d != 0) return [d tableScroll:scroll draggingSourceOperationMaskForLocal:flag]; return NSDragOperationGeneric; } //----------------------------------------------------------------------------- // ignoreModifierKeysWhileDragging //----------------------------------------------------------------------------- - (BOOL)ignoreModifierKeysWhileDragging { id const scroll = [self scroll]; id const d = [scroll responsibleDelegate:DF::DEL_DRAG_IGNORE_MODIFIERS]; if (d != 0) return [d tableScrollIgnoreModifierKeysWhileDragging:scroll]; return YES; } //----------------------------------------------------------------------------- // shouldDelayWindowOrderingForEvent: //----------------------------------------------------------------------------- - (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent*)e { BOOL delay = NO; NSPoint const p = [self convertPoint:[e locationInWindow] fromView:0]; MiscCoord_P r,c; if ([self getRow:&r column:&c forPoint:p] && [self canPerformDragAtRow:r column:c withEvent:e]) { id const scroll = [self scroll]; id d = [scroll responsibleDelegate:DF::DEL_DRAG_DELAY_WIN_ORDERING]; if (d != 0) delay = [d tableScroll:scroll shouldDelayWindowOrderingForEvent:e]; else delay = YES; } return delay; } //----------------------------------------------------------------------------- // getDragImageAtRow:column: //----------------------------------------------------------------------------- - (NSImage*)getDragImageAtRow:(MiscCoord_P)row column:(MiscCoord_P)col { NSImage* i = 0; id const scroll = [self scroll]; id const d = [scroll responsibleDelegate:DF::DEL_IMAGE_FOR_DRAG]; if (d != 0) i = [d tableScroll:scroll imageForDragOperationAtRow:row column:col]; if (i == 0) { NSCell* cell = (NSCell*)[scroll cellAtRow:row column:col]; if ([cell type] == NSImageCellType) i = [cell image]; } return i; } //----------------------------------------------------------------------------- // calcOrigin:andOffset:forImage:inRect:atRow:column:downEvent:dragEvent: // // Compute the origin of the image and the offset of the mouse for dragging // via NSView's -dragImage:at:offset:... method. There are two cases: // // CASE *1*: The image being dragged fits exactly in the cell's image area. // In this case drag from the point where the mouse went down inside the // image's boundry. This give the visual impression of lifting the image // exactly from where it is sitting; without it jumping to some other // location. // CASE *2*: The image is a different size than the cell's image area. In // this case just center the image under the mouse. //----------------------------------------------------------------------------- - (void)calcOrigin:(NSPoint*)origin andOffset:(NSSize*)offset forImage:(NSImage*)image inRect:(NSRect)rect atRow:(MiscCoord_P)row column:(MiscCoord_P)col downEvent:(NSEvent*)downEvent dragEvent:(NSEvent*)dragEvent { offset->width = 0; offset->height = 0; NSSize image_s = [image size]; id cell = [[self scroll] cellAtRow:row column:col]; NSRect image_r = [cell imageRectForBounds:rect]; if (image_s.width == image_r.size.width && // CASE *1* image_s.height == image_r.size.height) { *origin = image_r.origin; if ([self isFlipped]) origin->y += image_r.size.height; if (dragEvent != 0 && [dragEvent type] == NSLeftMouseDragged) { NSPoint ptDrag = [dragEvent locationInWindow]; NSPoint ptDown = [downEvent locationInWindow]; offset->width = ptDrag.x - ptDown.x; offset->height = ptDrag.y - ptDown.y; } } else // CASE *2* { *origin = [self convertPoint:[downEvent locationInWindow] fromView:0]; origin->x -= floor( image_s.width / 2 ); origin->y -= floor( image_s.height / 2 ) * ([self isFlipped] ? -1 : 1); } } //----------------------------------------------------------------------------- // prepareDragPasteboard:atRow:column: //----------------------------------------------------------------------------- - (void)prepareDragPasteboard:(NSPasteboard*)pb atRow:(MiscCoord_P)row column:(MiscCoord_P)col { id const scroll = [self scroll]; id const d = [scroll responsibleDelegate:DF::DEL_PREPARE_PB_FOR_DRAG]; if (d != 0) [d tableScroll:scroll preparePasteboard:pb forDragOperationAtRow:row column:col]; } //----------------------------------------------------------------------------- // performDrag:atRow:column:inRect:dragEvent: //----------------------------------------------------------------------------- - (BOOL)performDrag:(NSEvent*)mouseDown atRow:(MiscCoord_P)row column:(MiscCoord_P)col inRect:(NSRect)r dragEvent:(NSEvent*)dragEvent { BOOL ret = NO; NSImage* i = [self getDragImageAtRow:row column:col]; if (i != 0) { NSPoint origin; NSSize offset; [self calcOrigin:&origin andOffset:&offset forImage:i inRect:r atRow:row column:col downEvent:mouseDown dragEvent:dragEvent]; NSPasteboard* pb = [NSPasteboard pasteboardWithName:NSDragPboard]; [self prepareDragPasteboard:pb atRow:row column:col]; [self dragImage:i at:origin offset:offset event:mouseDown pasteboard:pb source:self slideBack:YES]; ret = YES; } return ret; } //----------------------------------------------------------------------------- // awaitDragEvent:atRow:column: //----------------------------------------------------------------------------- - (BOOL)awaitDragEvent:(NSEvent*)mouseDown atRow:(MiscCoord_P)row column:(MiscCoord_P)col inRect:(NSRect)rect { float const DELAY = 0.25; float const SLOP = 4.0; unsigned int const WANTED = (NSLeftMouseUpMask | NSLeftMouseDraggedMask); BOOL ret = NO; NSEvent* event; NSWindow* win = [self window]; do { event = [win nextEventMatchingMask:WANTED untilDate:[NSDate dateWithTimeIntervalSinceNow:DELAY] inMode:NSEventTrackingRunLoopMode dequeue:NO]; if (event != 0 && [event type] == NSLeftMouseDragged) event = [win nextEventMatchingMask:NSLeftMouseDraggedMask]; } while (event != 0 && [event type] == NSLeftMouseDragged && isSlop( event, mouseDown, SLOP )); if (event == 0 || [event type] == NSLeftMouseDragged) ret = [self performDrag:mouseDown atRow:row column:col inRect:rect dragEvent:event]; return ret; } //----------------------------------------------------------------------------- // canPerformDragAtRow:column:withEvent: //----------------------------------------------------------------------------- - (BOOL)canPerformDragAtRow:(MiscCoord_P)r column:(MiscCoord_P)c withEvent:(NSEvent*)p { id const scroll = [self scroll]; id const d = [scroll responsibleDelegate:DF::DEL_ALLOW_DRAG]; return (d != 0 && [d tableScroll:scroll allowDragOperationAtRow:r column:c] && [scroll responsibleDelegate:DF::DEL_PREPARE_PB_FOR_DRAG] != 0 && ([(NSCell*)[scroll cellAtRow:r column:c] type] == NSImageCellType || [scroll responsibleDelegate:DF::DEL_IMAGE_FOR_DRAG] != 0)); } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableViewPrint.M100444 1750 1750 55212 6757227340 25126 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableViewPrint.M // // Printing support for MiscTableScroll. // // FIXME: Move most of this junk up into table scroll. // FIXME: Separate computing the number of pages from doing all the // other work, so that hopefully, we can do all the other work // only if the user proceeds with a print operation. //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableViewPrint.M,v 1.11 99/07/15 12:38:08 sunshine Exp $ // $Log: MiscTableViewPrint.M,v $ // Revision 1.11 99/07/15 12:38:08 sunshine // v140.1: Fixed bug: Was ignoring scaling factor during printing. The scale // input field moved from the page layout panel to the print panel between // NextStep and OpenStep, which means that as of OpenStep the scaling factor // is only available *after* the print panel has been dismissed, but this code // was not taking that into account. // // Revision 1.10 99/06/15 04:07:10 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Removed unused and buggy -getWidth which was incorrectly testing the // incoming object to see if it responded to -size: when it should have been // testing for response to -size. // Now sends notifications instead of sending delegate message directly. // // Revision 1.9 1998/03/22 13:12:07 sunshine // v133.1: Now prints corner view. //----------------------------------------------------------------------------- #import "MiscTableView.h" #import "MiscBorderView.h" #import "MiscCornerView.h" #import "MiscGeometry.h" #import "MiscTableBorder.h" #import "MiscTableScrollPrivate.h" extern "Objective-C" { #import #import #import #import #import #import } extern "C" { #import // floor() } @implementation MiscTableView(Print) //----------------------------------------------------------------------------- // getPrintInfo //----------------------------------------------------------------------------- - (MiscTablePrintInfo const*)getPrintInfo { return (pages != 0) ? &(pages->info) : 0; } //----------------------------------------------------------------------------- // getHeight: //----------------------------------------------------------------------------- - (float)getHeight:(id)obj { if (obj != 0) { if ([obj respondsToSelector:@selector(frame)]) return [obj frame].size.height; else if ([obj respondsToSelector:@selector(size)]) return [obj size].height; } return 0; } //----------------------------------------------------------------------------- // numPagesForBorder:pageSize: //----------------------------------------------------------------------------- - (int)numPagesForBorder:(MiscBorderType)bt pageSize:(float)scaled_page_size { int npages = 0; // FIXME: Borders with uniform size slots should be much simpler // than this. MiscPixels const page_size = (MiscPixels)floor(scaled_page_size); NSParameterAssert( page_size > 0 ); MiscTableBorder* const border = (bt == MISC_COL_BORDER ? colBorder : rowBorder); MiscPixels sz_sum = 0; MiscCoord_V const numSlots = border->count(); for (MiscCoord_V vslot = 0; vslot < numSlots; vslot++) { MiscPixels sz = border->effectiveSize(vslot); if (sz <= page_size) { sz_sum += sz; if (sz_sum > page_size) { sz_sum = sz; npages++; } } else { if (sz_sum > 0) npages++; npages += sz / page_size; sz_sum = sz % page_size; } } if (sz_sum >= 0) npages++; return npages; } //----------------------------------------------------------------------------- // append //----------------------------------------------------------------------------- static void append( MiscPixels w, MiscTSPageBreak& bk, MiscTSPageBreak bks[], int n, int num_breaks ) { NSCParameterAssert( n < num_breaks ); bk.size = w; bks[ n ] = bk; bk.offset += w; } //----------------------------------------------------------------------------- // border:pageSize:numPages:calcBreaks: //----------------------------------------------------------------------------- - (void)border:(MiscBorderType)bt pageSize:(float)pageSize numPages:(int)nPages clip:(BOOL)do_clip calcBreaks:(MiscTSPageBreak*)bks { MiscPixels const page_size = (MiscPixels)floor(pageSize); // FIXME: Borders with uniform size slots should be much simpler // than this. NSParameterAssert( page_size > 0 ); MiscTableBorder* const border = (bt == MISC_COL_BORDER ? colBorder : rowBorder); MiscTSPageBreak bk; bk.offset = 0; bk.size = 0; bk.first = 0; bk.last = 0; int pg = 0; MiscPixels sz_sum = 0; MiscCoord_V const numSlots = border->count(); for (MiscCoord_V vslot = 0; vslot < numSlots; vslot++) { MiscPixels sz = border->effectiveSize(vslot); if (sz <= page_size) { sz_sum += sz; if (sz_sum > page_size) { bk.last = (vslot - 1); append( sz_sum - sz, bk, bks, pg++, nPages ); if (do_clip) goto clip_exit; bk.first = vslot; sz_sum = sz; } } else { if (sz_sum > 0) { bk.last = (vslot - 1); append( sz_sum, bk, bks, pg++, nPages ); if (do_clip) goto clip_exit; } bk.first = vslot; bk.last = ~vslot; do { append( page_size, bk, bks, pg++, nPages ); if (do_clip) goto clip_exit; bk.first = ~vslot; sz -= page_size; } while (sz > page_size); sz_sum = sz; } } if (sz_sum >= 0) { bk.last = numSlots - 1; append( sz_sum, bk, bks, pg++, nPages ); } clip_exit: NSParameterAssert( pg == nPages ); } //----------------------------------------------------------------------------- // - getImageForView:inRect: // // This method gets called in the middle of MiscTableView's print // operation while the pages are being calculated by -calcPages. // However, -dataWithEPSInsideRect: throws an exception if it is called // while another print operation is already in progress. To work around // this problem, we temporarily set the current print operation to nil. // The reason it is necessary to call -calcPages after initiation of the // print operation is that it needs to know the scaling factor specified // via the print panel. Under NextStep, the scaling factor was specified // via the page layout panel rather than the print panel, and was // therefore accessible without having to initiate a print operation. // Consequently, under NextStep, MiscTableView calls -calcPages before // initiating the print operation, thus avoiding this particular hassle // altogether. //----------------------------------------------------------------------------- - (NSImage*)getImageForView:(NSView*)view inRect:(NSRect)rect { NSPrintOperation* op = [[NSPrintOperation currentOperation] retain]; [NSPrintOperation setCurrentOperation:0]; NSImage* image = [[[NSImage alloc] initWithData: [view dataWithEPSInsideRect:rect]] autorelease]; [NSPrintOperation setCurrentOperation:op]; [op release]; return image; } //----------------------------------------------------------------------------- // - getImageForView: //----------------------------------------------------------------------------- - (NSImage*)getImageForView:(NSView*)view { return [self getImageForView:view inRect:[view bounds]]; } //----------------------------------------------------------------------------- // sendNotification:withView:info: //----------------------------------------------------------------------------- - (void)sendNotification:(NSString*)name withView:(NSView*)view info:(MiscTablePrintInfo const*)info { #define NUMOBJ(TYPE,VAL) [NSNumber numberWith##TYPE:VAL] [[NSNotificationCenter defaultCenter] postNotificationName:name object:[self scroll] userInfo:[NSDictionary dictionaryWithObjectsAndKeys: view, @"View", NUMOBJ(Float,info->page_size.width), @"PageWidth", NUMOBJ(Float,info->page_size.height), @"PageHeight", NUMOBJ(Float,info->print_rect.origin.x), @"PrintRectX", NUMOBJ(Float,info->print_rect.origin.y), @"PrintRectY", NUMOBJ(Float,info->print_rect.size.width), @"PrintRectWidth", NUMOBJ(Float,info->print_rect.size.height), @"PrintRectHeight", NUMOBJ(Int,info->first_print_row), @"FirstPrintRow", NUMOBJ(Int,info->last_print_row), @"LastPrintRow", NUMOBJ(Int,info->first_print_col), @"FirstPrintColumn", NUMOBJ(Int,info->last_print_col), @"LastPrintColumn", NUMOBJ(Int,info->print_page), @"PrintPage", NUMOBJ(Int,info->print_row), @"PrintRow", NUMOBJ(Int,info->print_col), @"PrintColumn", NUMOBJ(Int,info->num_print_pages), @"NumberOfPrintPages", NUMOBJ(Int,info->num_print_rows), @"NumberOfPrintRows", NUMOBJ(Int,info->num_print_cols), @"NumberOfPrintColumns", NUMOBJ(Double,info->scale_factor), @"ScaleFactor", NUMOBJ(Bool,info->is_scaled), @"IsScaled", 0]]; #undef NUMOBJ } //----------------------------------------------------------------------------- // getImages:info: //----------------------------------------------------------------------------- - (void)getImages:(MiscTSPageImages*)img info:(MiscTablePrintInfo const*)info { img->page_header = 0; img->page_footer = 0; img->col_titles = 0; img->row_titles = 0; img->corner_view = 0; if (pages->pageHeader != 0) { [self sendNotification:MiscTableScrollWillPrintPageHeaderNotification withView:pages->pageHeader info:info]; // FIXME: Need to shrink/grow/center/position. img->page_header = [[self getImageForView:pages->pageHeader] retain]; } if (pages->pageFooter != 0) { [self sendNotification:MiscTableScrollWillPrintPageFooterNotification withView:pages->pageFooter info:info]; // FIXME: Need to shrink/grow/center/position. img->page_footer = [[self getImageForView:pages->pageFooter] retain]; } if (pages->colTitles != 0) { NSRect r = info->print_rect; r.origin.y = 0; r.size.height = pages->col_titles_height; img->col_titles = [[self getImageForView:pages->colTitles inRect:r] retain]; } if (pages->rowTitles != 0) { NSRect r = info->print_rect; r.origin.x = 0; r.size.width = pages->row_titles_width; img->row_titles = [[self getImageForView:pages->rowTitles inRect:r] retain]; } if (pages->cornerView != 0) { NSRect r; r.origin.x = 0; r.origin.y = 0; r.size.width = pages->row_titles_width; r.size.height = pages->col_titles_height; img->corner_view = [[self getImageForView:pages->cornerView inRect:r] retain]; } } //----------------------------------------------------------------------------- // calcPages //----------------------------------------------------------------------------- - (void)calcPages { id const scroll = [self scroll]; pages = new MiscTablePages; pages->pageHeader = [scroll getPageHeader]; pages->pageFooter = [scroll getPageFooter]; pages->page_header_height = [self getHeight:pages->pageHeader]; pages->page_footer_height = [self getHeight:pages->pageFooter]; pages->colTitles = [scroll colTitles]; pages->rowTitles = [scroll rowTitles]; if (pages->colTitles != 0 && pages->rowTitles != 0) pages->cornerView = [scroll cornerView]; else pages->cornerView = 0; pages->col_titles_height = [scroll columnTitlesHeight]; pages->row_titles_width = [scroll rowTitlesWidth ]; float scroll_width = [scroll totalWidth]; float scroll_height = [scroll totalHeight]; float total_width = scroll_width + pages->row_titles_width; float total_height = scroll_height + pages->col_titles_height; NSPrintInfo* printInfo = [[NSPrintOperation currentOperation] printInfo]; NSSize const paperSize = [printInfo paperSize]; float page_width = paperSize.width - [printInfo leftMargin] - [printInfo rightMargin]; float page_height = paperSize.height - [printInfo topMargin] - [printInfo bottomMargin] - pages->page_header_height - pages->page_footer_height; int const hPagination = [printInfo horizontalPagination]; int const vPagination = [printInfo verticalPagination]; BOOL hScaled = NO; double hScaler = 1.0; BOOL vScaled = NO; double vScaler = 1.0; BOOL isScaled = NO; double scaleFactor = 1.0; if (hPagination == NSFitPagination && total_width > page_width) { hScaled = YES; hScaler = double(page_width) / double(total_width); } if (vPagination == NSFitPagination && total_height > page_height) { vScaled = YES; vScaler = double(page_height) / double(total_height); } if (hScaled || vScaled) { isScaled = YES; if (vScaler < hScaler) scaleFactor = vScaler; else scaleFactor = hScaler; } float const EPSILON = 0.0001; float pScaler = 1.0; id val = [[printInfo dictionary] objectForKey:NSPrintScalingFactor]; if (val != 0) pScaler = [val floatValue]; if (pScaler < (1.0 - EPSILON) || (1.0 + EPSILON) < pScaler) { if (isScaled) scaleFactor *= pScaler; else { scaleFactor = pScaler; isScaled = YES; } } pages->info.is_scaled = isScaled; pages->info.scale_factor = scaleFactor; float scaled_page_width = page_width; float scaled_page_height = page_height; if (isScaled) { scaled_page_width = double(page_width) / scaleFactor; scaled_page_height = double(page_height) / scaleFactor; } scaled_page_width -= pages->row_titles_width; scaled_page_height -= pages->col_titles_height; //--- Calculate the number of rows/cols/pages ------------------------- int ncols = 1; int nrows = 1; if (hPagination != NSClipPagination && scroll_width > scaled_page_width) ncols = [self numPagesForBorder:MISC_COL_BORDER pageSize:scaled_page_width]; if (vPagination != NSClipPagination && scroll_height > scaled_page_height) nrows = [self numPagesForBorder:MISC_ROW_BORDER pageSize:scaled_page_height]; NSParameterAssert( nrows > 0 ); NSParameterAssert( ncols > 0 ); int const npages = nrows * ncols; //--- Allocate arrays ------------------------------------------------- pages->col_breaks = (MiscTSPageBreak*) malloc( (ncols + nrows) * sizeof(MiscTSPageBreak) ); pages->row_breaks = pages->col_breaks + ncols; MiscTSPageImages* images = (MiscTSPageImages*) malloc( npages * sizeof(*images) ); pages->images = images; //--- Prepare print rectangles and border images ---------------------- [self border:MISC_COL_BORDER pageSize:scaled_page_width numPages:ncols clip:(hPagination == NSClipPagination) calcBreaks:pages->col_breaks]; [self border:MISC_ROW_BORDER pageSize:scaled_page_height numPages:nrows clip:(vPagination == NSClipPagination) calcBreaks:pages->row_breaks]; MiscTablePrintInfo& info = pages->info; info.page_size = paperSize; info.num_print_pages = npages; info.num_print_rows = nrows; info.num_print_cols = ncols; info.scale_factor = scaleFactor; info.is_scaled = isScaled; int pg = 0; MiscTSPageImages* img = images; MiscTSPageBreak const* rbk = pages->row_breaks; for (int r = 0; r < nrows; r++,rbk++) { info.print_rect.origin.y = rbk->offset; info.print_rect.size.height = rbk->size; info.first_print_row = rbk->first; info.last_print_row = rbk->last; MiscTSPageBreak const* cbk = pages->col_breaks; for (int c = 0; c < ncols; c++,cbk++,img++) { info.print_rect.origin.x = cbk->offset; info.print_rect.size.width = cbk->size; info.first_print_col = cbk->first; info.last_print_col = cbk->last; info.print_page = ++pg; [self getImages:img info:&info]; } } } //----------------------------------------------------------------------------- // freePages //----------------------------------------------------------------------------- - (void)freePages { if (pages != 0) { if (pages->col_breaks != 0) { free( pages->col_breaks ); pages->col_breaks = 0; } if (pages->images != 0) { for (int i = pages->info.num_print_pages; i-- > 0; ) { MiscTSPageImages const& img = pages->images[i]; if (img.page_header != 0) [img.page_header release]; if (img.page_footer != 0) [img.page_footer release]; if (img.col_titles != 0) [img.col_titles release]; if (img.row_titles != 0) [img.row_titles release]; if (img.corner_view != 0) [img.corner_view release]; } free( pages->images ); pages->images = 0; } delete pages; pages = 0; } } //----------------------------------------------------------------------------- // print: //----------------------------------------------------------------------------- - (void)print:(id)sender { id const scroll = [self scroll]; [[NSNotificationCenter defaultCenter] postNotificationName: MiscTableScrollWillPrintNotification object:scroll]; [self superPrint:sender]; [self freePages]; [[NSNotificationCenter defaultCenter] postNotificationName: MiscTableScrollDidPrintNotification object:scroll]; } //----------------------------------------------------------------------------- // knowsPagesFirst:last: //----------------------------------------------------------------------------- - (BOOL)knowsPagesFirst:(int*)first last:(int*)last { NSParameterAssert( pages == 0 ); [self calcPages]; *first = 1; *last = pages->info.num_print_pages; return YES; } //----------------------------------------------------------------------------- // rectForPage: //----------------------------------------------------------------------------- - (NSRect)rectForPage:(int)n { NSParameterAssert( pages != 0 ); MiscTablePrintInfo const& info = pages->info; if (0 < n && n <= info.num_print_pages) { n--; int const r = (n / info.num_print_cols); int const c = (n % info.num_print_cols); MiscTSPageBreak const& cbk = pages->col_breaks[c]; MiscTSPageBreak const& rbk = pages->row_breaks[r]; return NSMakeRect( cbk.offset, rbk.offset, cbk.size, rbk.size ); } return NSZeroRect; } //----------------------------------------------------------------------------- // locationOfPrintRect: //----------------------------------------------------------------------------- - (NSPoint)locationOfPrintRect:(NSRect)rect { NSPrintInfo* printInfo = [[NSPrintOperation currentOperation] printInfo]; NSSize const paperSize = [printInfo paperSize]; float ml = [printInfo leftMargin]; float mr = [printInfo rightMargin]; float mt = [printInfo topMargin]; float mb = [printInfo bottomMargin]; float x = 0; float y = 0; float h = paperSize.height; float w = paperSize.width; float rh = rect.size.height; float rw = rect.size.width; float tw = pages->row_titles_width; float th = pages->col_titles_height; float hh = pages->page_header_height; NSParameterAssert( pages != 0 ); MiscTablePrintInfo const& info = pages->info; if (info.is_scaled) { float const k = info.scale_factor; x /= k; y /= k; h /= k; w /= k; ml /= k; mr /= k; mt /= k; mb /= k; } NSPoint pt = NSMakePoint( x + ml + tw, y + h - mt - rh - hh - th ); if ([printInfo isHorizontallyCentered]) { float dx = w - ml - mr - tw - rw; if (dx > 0) pt.x += dx / 2; } if ([printInfo isVerticallyCentered]) { float dy = h - mt - mb - th - rh; if (dy > 0) pt.y -= dy / 2; } return pt; } //----------------------------------------------------------------------------- // drawImage:at: //----------------------------------------------------------------------------- - (void)drawImage:(NSImage*)img at:(NSPoint)pt { NSRect r; r.size = [img size]; r.origin.x = pt.x; r.origin.y = pt.y - r.size.height; [img drawRepresentation:[[img representations] lastObject] inRect:r]; } //----------------------------------------------------------------------------- // drawPageBorderWithSize: //----------------------------------------------------------------------------- - (void)drawPageBorderWithSize:(NSSize)borderSize { NSParameterAssert( pages != 0 ); MiscTablePrintInfo const& info = pages->info; int n = [[NSPrintOperation currentOperation] currentPage] - 1; NSParameterAssert( 0 <= n ); NSParameterAssert( n < info.num_print_pages ); MiscTSPageImages const& img = pages->images[n]; NSPrintInfo* printInfo = [[NSPrintOperation currentOperation] printInfo]; float const ml = [printInfo leftMargin]; float const mr = [printInfo rightMargin]; float const mb = [printInfo bottomMargin]; float const mt = [printInfo topMargin]; NSPoint const page_origin = NSZeroPoint; NSSize const page_size = info.page_size; float bottom = page_origin.y + mb; float top = page_origin.y + page_size.height - mt; float left = page_origin.x + ml; float right = page_origin.x + page_size.width - mr; if (info.is_scaled) { float const k = info.scale_factor; PSscale( k, k ); bottom /= k; top /= k; left /= k; right /= k; } if (img.page_header != 0) { [self drawImage:img.page_header at:NSMakePoint(top, left)]; top -= pages->page_header_height; } if (img.page_footer != 0) { bottom += pages->page_footer_height; [self drawImage:img.page_footer at:NSMakePoint(left, bottom)]; } float dx = 0; float dy = 0; if ([printInfo isHorizontallyCentered]) { int const c = (n % info.num_print_cols); dx = right - left - pages->row_titles_width - pages->col_breaks[c].size; if (dx > 0) dx /= 2; else dx = 0; } if ([printInfo isVerticallyCentered]) { int const r = (n / info.num_print_cols); dy = top - bottom - pages->col_titles_height - pages->row_breaks[r].size; if (dy > 0) dy /= 2; else dy = 0; } if (img.corner_view != 0) { NSPoint pt; pt.x = left + dx; pt.y = top - dy; [self drawImage:img.corner_view at:pt]; } if (img.row_titles != 0) { NSPoint pt; pt.x = left + dx; pt.y = top - pages->col_titles_height - dy; [self drawImage:img.row_titles at:pt]; } if (img.col_titles != 0) { NSPoint pt; pt.x = left + pages->row_titles_width + dx; pt.y = top - dy; [self drawImage:img.col_titles at:pt]; } } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableWell.M100444 1750 1750 3767 6757227340 24072 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableWell.M // // View class that draws a well where a column/row laid before dragging // was started. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableWell.M,v 1.3 98/03/30 00:02:00 sunshine Exp $ // $Log: MiscTableWell.M,v $ // Revision 1.3 98/03/30 00:02:00 sunshine // v138.1: Now uses NSColor's "system" color for well rather than "gray". // // Revision 1.2 96/04/30 05:40:08 sunshine // Ported to OpenStep 4.0 for Mach PR2. //----------------------------------------------------------------------------- #import "MiscTableWell.h" @implementation MiscTableWell - (BOOL)isOpaque { return YES; } //----------------------------------------------------------------------------- // - initWithFrame: //----------------------------------------------------------------------------- - (id)initWithFrame:(NSRect)r { [super initWithFrame:r]; return self; } //----------------------------------------------------------------------------- // - drawRect: //----------------------------------------------------------------------------- - (void)drawRect:(NSRect)r { [[NSColor scrollBarColor] set]; NSRectFill(r); } @end MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableViewPrivate.h100444 1750 1750 3726 6757227340 25462 0ustar sunshinesunshine#ifndef __MiscTableViewPrivate_h #define __MiscTableViewPrivate_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableViewPrivate.h // // Private methods for MiscTableView. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableViewPrivate.h,v 1.1 97/11/23 07:42:07 sunshine Exp $ // $Log: MiscTableViewPrivate.h,v $ // Revision 1.1 97/11/23 07:42:07 sunshine // v130.1: Private table view methods. // //----------------------------------------------------------------------------- #import "MiscTableView.h" @interface MiscTableView(Private) - (MiscTableBorder*)borderFor:(MiscBorderType)b; - (NSRect)getSlotInsideAt:(MiscCoord_P)slot from:(MiscBorderType)bdr; - (void)border:(MiscBorderType)bdr scrollToVisible:(MiscCoord_P)pslot; // CURSOR --------------------------------------------------------------------- - (void)drawCursorClipTo:(NSRect)clip; // DRAGGING ------------------------------------------------------------------- - (BOOL)canPerformDragAtRow:(MiscCoord_P)r column:(MiscCoord_P)c withEvent:(NSEvent*)p; - (BOOL)awaitDragEvent:(NSEvent*)mouseDown atRow:(MiscCoord_P)row column:(MiscCoord_P)col inRect:(NSRect)rect; @end #endif // __MiscTableViewPrivate_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableWell.h100444 1750 1750 3006 6757227341 24110 0ustar sunshinesunshine#ifndef __MiscTableWell_h #define __MiscTableWell_h //============================================================================= // // Copyright (C) 1995, 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableWell.h // // View class that draws a well where a column/row laid before dragging // was started. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableWell.h,v 1.2 96/04/30 05:40:10 sunshine Exp $ // $Log: MiscTableWell.h,v $ // Revision 1.2 96/04/30 05:40:10 sunshine // Ported to OpenStep 4.0 for Mach PR2. // //----------------------------------------------------------------------------- extern "Objective-C" { #import } @interface MiscTableWell : NSView { } - initWithFrame:(NSRect)frameRect; - (BOOL) isOpaque; - (void) drawRect:(NSRect)rect; @end #endif // __MiscTableWell_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscTracer.h100444 1750 1750 3660 6757227341 23463 0ustar sunshinesunshine#ifndef __MiscTracer_h #define __MiscTracer_h #ifdef __GNUC__ #pragma interface #endif //============================================================================= // // Copyright (C) 1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTracer.h // // Simple C++ class that helps generate function enter/exit // trace messages. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTracer.h,v 1.2 98/03/23 07:48:27 sunshine Exp $ // $Log: MiscTracer.h,v $ // Revision 1.2 98/03/23 07:48:27 sunshine // v134.1: Ported from NEXTSTEP to OPENSTEP/Rhapsody. // // Revision 1.1 97/12/22 22:00:23 zarnuk // v134: Utility class to create function enter/exit messages. //----------------------------------------------------------------------------- class MiscTracer { private: static int TRACE_DEPTH; char const* msg; void dump( char const* ) const; public: MiscTracer( char const* s ): msg(s) { dump( "->" ); TRACE_DEPTH += 2; } ~MiscTracer() { TRACE_DEPTH -= 2; dump( "<-" ); } void foo() const {} // compiler muffler static int get_depth() { return TRACE_DEPTH; } }; #ifdef TRACE_ON #define TRACE(X) MiscTracer mcgh_tracer(X); mcgh_tracer.foo(); #else #define TRACE(X) #endif #endif // __MiscTracer_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscColorList.cc100444 1750 1750 4654 6757227342 24320 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscColorList.cc // // An extensible array of colors that can act as a color palette to // reduce the storage overhead of storing a lot of colors. Also // useful for speeding color comparisons in some cases. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscColorList.cc,v 1.2 96/12/30 03:09:47 sunshine Exp $ // $Log: MiscColorList.cc,v $ // Revision 1.2 96/12/30 03:09:47 sunshine // v104.1: Ported to OPENSTEP 4.1 (gamma). // // Revision 1.1 96/08/30 14:51:54 sunshine // Extensible array of colors acting as a color palette. //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscColorList.h" extern "C" { #include // free(), malloc(), realloc() } //----------------------------------------------------------------------------- // Destructor //----------------------------------------------------------------------------- MiscColorList::~MiscColorList() { [colors release]; } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- MiscColorList::MiscColorList() { colors = [[NSMutableArray alloc] init]; } //----------------------------------------------------------------------------- // store //----------------------------------------------------------------------------- int MiscColorList::store( NSColor* c ) { for (int i = count(); i-- > 0; ) if ([c isEqual:nth(i)]) return i; [colors addObject:c]; return (count() - 1); } MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableScroll-3.3-4.x.tops100444 1750 1750 147724 6757227360 26172 0ustar sunshinesunshine/*============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // =============================================================================*/ /*----------------------------------------------------------------------------- ** MiscTableScroll-3.3-4.x.tops ** ** "tops" conversion script to aid porting of NEXTSTEP 3.3 programs that ** use MiscTableScroll to OPENSTEP 4.x. ** ** This script must be run *after* running the standard NeXT supplied ** conversion scripts. ** **----------------------------------------------------------------------------- **----------------------------------------------------------------------------- ** $Id: MiscTableScroll-3.3-4.x.tops,v 1.12 99/06/15 03:21:45 sunshine Exp $ ** $Log: MiscTableScroll-3.3-4.x.tops,v $ ** Revision 1.12 99/06/15 03:21:45 sunshine ** v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. ** Corrected potential bug: Now uses rather than just . ** Downgraded errors to warnings. Dropped many really obvious warnings. ** Many methods were renamed to support Java, new notification-style ** delegate messages, and for better OpenStep conformance and general clarity. ** border:moveSlotFrom:to: --> border:moveSlot:toSlot: ** moveColumnFrom:to: --> moveColumn:toColumn: ** moveRowFrom:to: --> moveRow:toRow: ** slotDraggedFrom:to: --> slotDragged:toSlot: ** select...:byExtension: --> select...:byExtendingSelection: ** select{Slot|Row|Column}Tags: --> select{Slots|Rows|Columns}WithTags: ** deselect{Slot|Row|Column}Tags: --> deselect{Slots|Rows|Columns}WithTags: ** ...ISearchColumn: --> ...IncrementalSearchColumn: ** drawClippedText --> drawsClippedText ** setDrawClippedText: --> setDrawsClippedText: ** trackingBy --> selectsByRows ** trackBy: --> setSelectsByRows: ** tracking --> isTrackingMouse ** stringForNSTabularTextPBoardType --> stringForNSTabularPboardType ** tableScroll:...ColorChangedTo: --> tableScroll...ColorChanged: ** tableScroll:border:slotDraggedFrom:to: --> tableScrollSlotDragged: ** tableScroll:border:slotResized: --> tableScrollSlotResized: ** tableScroll:border:slotSortReversed: --> tableScrollSlotSortReversed: ** tableScroll:changeFont:to: --> tableScrollChangeFont: ** tableScroll:fontChangedFrom:to: --> tableScrollFontChanged: ** tableScroll:didEdit:atRow:column: --> tableScrollDidEdit: ** tableScroll:willEditAtRow:column: --> tableScrollWillEdit: ** tableScroll:willPrintPageHeader:info: --> tableScrollWillPrintPageHeader: ** tableScroll:willPrintPageFooter:info: --> tableScrollWillPrintPageFooter: ** Fixed bug: -selectedTextColorChangedTo: was mis-spelled as ** -selectedTextColorChanagedTo:. ** Added a section which converts old-style delegate messages to notification- ** style delegate messages. The generated code automatically extracts the ** appropriate information from the NSNotification's userInfo dictionary based ** upon the notification's type. ** ** Revision 1.11 1998/03/22 13:18:10 sunshine ** v133.1: Added conversions for: ** -cornerTitle, -setCornerTitle: ** -minUniformSizeCols, setMinUniformSizeCols: ** -maxUniformSizeCols, setMaxUniformSizeCols: ** -makeCellsPerform:... ** Removed obsolete conversions: ** -colDataSize:, -setColDataSize: ** -colExpandsToData, -setCol:expandsToData: **---------------------------------------------------------------------------*/ /** ** Header files moved into MiscTableScroll framework ** MiscExporter.h ** MiscTableCell.h ** MiscTableScroll.h ** MiscTableTypes.h **/ replace "misckit/" with "MiscTableScroll/
" where "
" isOneOf { "MiscExporter.h", "MiscTableCell.h", "MiscTableScroll.h", "MiscTableTypes.h" } /** ** Obsolete MiscIntList replaced with NSArray: ** addInt: --> numberWithInt: & addObject: ** addIntList: --> addObjectsFromArray: ** bsearch: --> numberWithInt: & indexOfObject: ** bsearch:using:data: --> numberWithInt: & indexOfObject: ** initFromString: --> componentsSeparatedByString: ** insertInt:at: --> numberWithInt: & insertObject:atIndex: ** intAt: --> objectAtIndex & intValue ** lsearch: --> numberWithInt: & indexOfObject: ** lsearch:using:data: --> numberWithInt: & indexOfObject: ** readFromString: --> setArray: & componentsSeparatedByString: ** removeIntAt: --> removeObjectAtIndex: ** replaceIntAt:with: --> numberWithInt: & replaceObjectAtIndex:withObject: ** sortUsing:data: --> sortUsingFunction:context: ** writeToString --> description ** writeToString:size: --> description ** writeToString:size:canExpand: --> description **/ replace "[ addInt:]" with "[ addObject:[NSNumber numberWithInt:]]" replace "[ addIntList:]" with "[ addObjectsFromArray:]" replace "[ :]" with "[ indexOfObject:[NSNumber numberWithInt:]]" warning "MiscTableScrollConversion: -[MiscIntList :] obsolete. NSNotFound now indicates failed search rather than -1." where "" isOneOf { "bsearch", "lsearch" } replace "[ : using: data:]" with "[ indexOfObject:[NSNumber numberWithInt:]]" warning "MiscTableScrollConversion: -[MiscIntList :using:data:] obsolete. NSNotFound now indicates failed search rather than -1." where "" isOneOf { "bsearch", "lsearch" } replace "[[MiscIntList :] initFromString:]" with "[[ componentsSeparatedByString:@\" \"] retain]" warning "MiscTableScrollConversion: MiscIntList obsolete. Use NSArray or NSMutableArray instead." where "" isOneOf { "allocFromZone", "allocWithZone" } replace "[[MiscIntList alloc] initFromString:]" with "[[ componentsSeparatedByString:@\" \"] retain]" warning "MiscTableScrollConversion: MiscIntList obsolete. Use NSArray or NSMutableArray instead." replace "[ insertInt: at:]" with "[ insertObject:[NSNumber numberWithInt:] atIndex:]" replace "[ intAt:]" with "[[ objectAtIndex:] intValue]" replace "[ readFromString:]" with "[ setArray:[ componentsSeparatedByString:@\" \"]]" warning "MiscTableScrollConversion: -[MiscIntList readFromString:] obsolete. Use NSArray or NSMutableArray instead." replacemethod "removeIntAt:" with "removeObjectAtIndex:" replace "[ replaceIntAt: with:]" with "[ replaceObjectAtIndex: withObject:[NSNumber numberWithInt:]]" replace "[ sortUsing: data:]" with "[ sortUsingFunction: context:]" error "MiscTableScrollConversion: MiscIntList obsolete. Fix to work with NSMutableArray." replace " = [ writeToString]" with " = [ description]" warning "MiscTableScrollConversion: -[MiscIntList writeToString] replaced with -[NSArray description]." replace " = [ writeToString: size:]" with " = [ description]" warning "MiscTableScrollConversion: -[MiscIntList writeToString:size:] replaced with -[NSArray description]." replace "[ writeToString: size:]" with " = [ description]" warning "MiscTableScrollConversion: -[MiscIntList writeToString:size:] replaced with -[NSArray description]." replace " = [ writeToString: size: canExpand:]" with " = [ description]" warning "MiscTableScrollConversion: -[MiscIntList writeToString:size:canExpand] replaced with -[NSArray description]." replace "[ writeToString: size: canExpand:]" with " = [ description]" warning "MiscTableScrollConversion: -[MiscIntList writeToString:size:canExpand] replaced with -[NSArray description]." /** ** Obsolete data-type: ** MiscIntList --> NSArray **/ replace "MiscIntList" with "NSArray" warning "MiscTableScrollConversion: MiscIntList obsolete. Convert to NSArray or NSMutableArray." /** ** Radical arg changes: MiscIntList --> NSArray ** border:selectedSlots: --> selectedSlots: ** border:selectedTags: --> selectedSlotTags: ** border:slotOrder: --> slotOrder: ** border:slotSizes: --> slotSizes: **/ replace "[ border: :]" with " = [ :]" warning "MiscTableScrollConversion: changed radically: MiscIntList --> NSArray." where ("", "") isOneOf { ("selectedSlots", "selectedSlots"), ("selectedTags", "selectedSlotTags"), ("slotOrder", "slotOrder"), ("slotSizes", "slotSizes") } /** ** Radical arg changes: MiscIntList --> NSArray ** colOrder: --> columnOrder ** colSizes: --> columnSizes ** rowOrder: --> rowOrder ** rowSizes: --> rowSizes ** selectedCols: --> selectedColumns ** selectedColTags: --> selectedColumnTags ** selectedRows: --> selectedRows ** selectedRowTags: --> selectedRowTags **/ replace "[ :]" with " = [ ]" warning "MiscTableScrollConversion: changed radically: MiscIntList --> NSArray." where ("", "") isOneOf { ("colOrder", "columnOrder"), ("colSizes", "columnSizes"), ("rowOrder", "rowOrder"), ("rowSizes", "rowSizes"), ("selectedCols", "selectedColumns"), ("selectedColTags", "selectedColumnTags"), ("selectedRows", "selectedRows"), ("selectedRowTags", "selectedRowTags") } /** ** Minor arg changes: MiscIntList --> NSArray ** border:deselectSlots: --> border:deselectSlots: ** border:deselectTags: --> border:deselectSlotsWithTags: ** border:physicalToVisual: --> border:physicalToVisual: ** border:selectSlots: --> border:selectSlots: ** border:selectSlots:byExtension: --> border:selectSlots:byExtendingSelection: ** border:selectTags: --> border:selectSlotsWithTags: ** border:selectTags:byExtension: --> border:selectSlotsWithTags:byExtendingSelection: ** border:setSlotOrder: --> border:setSlotOrder: ** border:setSlotSizes: --> border:setSlotSizes: ** border:visualToPhysical: --> border:visualToPhysical: ** deselectCols: --> deselectColumns: ** deselectColTags: --> deselectColumnsWithTags: ** deselectRows: --> deselectRows: ** deselectRowTags: --> deselectRowsWithTags: ** selectCols: --> selectColumns: ** selectCols:byExtension: --> selectColumns:byExtendingSelection: ** selectColTags: --> selectColumnsWithTags: ** selectColTags:byExtension: --> selectColumnsWithTags:byExtendingSelection: ** selectRows: --> selectRows: ** selectRows:byExtension: --> selectRows:byExtendingSelection: ** selectRowTags: --> selectRowsWithTags: ** selectRowTags:byExtension: --> selectRowsWithTags:byExtendingSelection: ** setColOrder: --> setColumnOrder: ** setColSizes: --> setColumnSizes: ** setRowOrder: --> setRowOrder: ** setRowSizes: --> setRowSizes: **/ replacemethod "" with "" warning "MiscTableScrollConversion: argument type changed: MiscIntList --> NSArray." where ("", "") isOneOf { ("border:deselectSlots:", "border:deselectSlots:"), ("border:deselectTags:", "border:deselectSlotsWithTags:"), ("border:physicalToVisual:", "border:physicalToVisual:"), ("border:selectSlots:", "border:selectSlots:"), ("border:selectSlots:byExtension:", "border:selectSlots:byExtendingSelection:"), ("border:selectTags:", "border:selectSlotsWithTags:"), ("border:selectTags:byExtension:", "border:selectSlotsWithTags:byExtendingSelection:"), ("border:setSlotOrder:", "border:setSlotOrder:"), ("border:setSlotSizes:", "border:setSlotSizes:"), ("border:visualToPhysical:", "border:visualToPhysical:"), ("deselectCols:", "deselectColumns:"), ("deselectColTags:", "deselectColumnsWithTags:"), ("deselectRows:", "deselectRows:"), ("deselectRowTags:", "deselectRowsWithTags:"), ("selectCols:", "selectColumns:") ("selectCols:byExtension:", "selectColumns:byExtendingSelection:"), ("selectColTags:", "selectColumnsWithTags:"), ("selectColTags:byExtension:", "selectColumnsWithTags:byExtendingSelection:"), ("selectRows:", "selectRows:"), ("selectRows:byExtension:", "selectRows:byExtendingSelection:"), ("selectRowTags:", "selectRowsWithTags:"), ("selectRowTags:byExtension:", "selectRowsWithTags:byExtendingSelection:"), ("setColOrder:", "setColumnOrder:"), ("setColSizes:", "setColumnSizes:"), ("setRowOrder:", "setRowOrder:"), ("setRowSizes:", "setRowSizes:") } /** ** Radical return change: (int const*) --> NSArray ** slotSortVector:len: --> slotSortVector: **/ replace " = [ slotSortVector: len:]" with " = [ slotSortVector:];* = [ count]" error "MiscTableScrollConversion: slotSortVector: changed radically: int array --> NSArray." /** ** Radical arg change: (int const*) --> NSArray ** border:setSlotSortVector:len: --> border:setSlotSortVector: **/ replace "[ border: setSlotSortVector: len:]" with "[ border: setSlotSortVector:]" error "MiscTableScrollConversion: setSlotSortVector: changed radically: int array --> NSArray, argument dropped." /** ** Radical return change: (int const*) --> NSArray ** colSortVectorLen: --> columnSortVector ** rowSortVectorLen: --> rowSortVector **/ replace " = [ :]" with " = [ ];* = [ count]" error "MiscTableScrollConversion: changed radically: int array --> NSArray." where ("", "") isOneOf { ("colSortVectorLen", "columnSortVector"), ("rowSortVectorLen", "rowSortVector") } /** ** Radical arg change: (int const*) --> NSArray ** setColSortVector:len: --> setColumnSortVector: ** setRowSortVector:len: --> setRowSortVector: **/ replace "[ : len:]" with "[ :]" error "MiscTableScrollConversion: changed radically: int array --> NSArray, argument dropped." where ("", "") isOneOf { ("setColSortVector", "setColumnSortVector"), ("setRowSortVector", "setRowSortVector") } /** ** Radical return type change: void --> NSArray ** border:physicalToVisual: ** border:visualToPhysical: **/ replace "[ border: :]" with "NSArray* newArray = [ border: :]" error "MiscTableScrollConversion: border:: now returns an NSArray rather than converting the input array in-place." where "" isOneOf { "physicalToVisual", "visualToPhysical" } /** ** Radical change: String methods: {char*,len} --> NSString ** border:slotOrderAsString:size:canExpand: --> slotOrderAsString: ** border:slotSizesAsString:size:canExpand: --> slotSizesAsString: **/ replace " = [ border: : size: canExpand:]" with " = [ :]" warning "MiscTableScrollConversion: now returns NSString and no longer accepts an input buffer." where "" isOneOf { "slotOrderAsString", "slotSizesAsString" } replace "[ border: : size: canExpand:]" with " = [ :]" warning "MiscTableScrollConversion: now returns NSString and no longer accepts an input buffer." where "" isOneOf { "slotOrderAsString", "slotSizesAsString" } /** ** Radical change: String methods: {char*,len} --> NSString ** colOrderAsString:size:canExpand: --> columnOrderAsString ** colSizesAsString:size:canExpand: --> columnSizesAsString ** rowOrderAsString:size:canExpand: --> rowOrderAsString ** rowSizesAsString:size:canExpand: --> rowSizesAsString **/ replace " = [ : size: canExpand:]" with " = [ ]" warning "MiscTableScrollConversion: now returns NSString and no longer accepts an input buffer." where ("", "") isOneOf { ("colOrderAsString", "columnOrderAsString"), ("colSizesAsString", "columnSizesAsString"), ("rowOrderAsString", "rowOrderAsString"), ("rowSizesAsString", "rowSizesAsString") } replace "[ : size: canExpand:]" with " = [ ]" warning "MiscTableScrollConversion: now returns NSString and no longer accepts an input buffer." where ("", "") isOneOf { ("colOrderAsString", "columnOrderAsString"), ("colSizesAsString", "columnSizesAsString"), ("rowOrderAsString", "rowOrderAsString"), ("rowSizesAsString", "rowSizesAsString") } /** ** Radical change: Mouse tracking: MiscBorderType --> BOOL ** trackingBy --> selectsByRows ** trackBy: --> setSelectsByRows: **/ replace "[ trackingBy]" with "([ selectsByRows] ? MISC_ROW_BORDER : MISC_COL_BORDER)" replace "[ trackBy:MISC_ROW_BORDER]" with "[ setSelectsByRows:YES]" replace "[ trackBy:MISC_COL_BORDER]" with "[ setSelectsByRows:NO]" replace "[ trackBy:]" with "[ setSelectsByRows:( == MISC_ROW_BORDER)]" /** ** Obsolete gray-value methods ** backgroundGray --> backgroundColor ** highlightBackgroundGray --> selectedBackgroundColor ** highlightTextGray --> selectedTextColor ** textGray --> textColor **/ replace "[ ]" with "[[[ ] colorUsingColorSpaceName:NSCalibratedWhiteColorSpace] whiteComponent]" where ("", "") isOneOf { ("backgroundGray", "backgroundColor"), ("highlightBackgroundGray", "selectedBackgroundColor"), ("highlightTextGray", "selectedTextColor"), ("textGray", "textColor") } /** ** Obsolete gray-value methods ** setBackgroundGray --> setBackgroundColor ** setHighlightBackgroundGray --> setSelectedBackgroundColor ** setHighlightTextGray --> setSelectedTextColor ** setTextGray --> setTextColor **/ replace "[ :]" with "[ :[NSColor colorWithCalibratedWhite: alpha:1.0]]" where ("", "") isOneOf { ("setBackgroundGray", "setBackgroundColor"), ("setHighlightBackgroundGray", "setSelectedBackgroundColor"), ("setHighlightTextGray", "setSelectedTextColor"), ("setTextGray", "setTextColor") } /** ** NXRect conversion: ** getDocClipFrame: --> documentClipRect **/ replace "[ getDocClipFrame:]" with "* = [ documentClipRect]" /** ** Name change (for NSMatrix compatibility), return type change: (id) --> (BOOL) ** findCell:row:col: --> getRow:column:ofCell: ** findCellWithTag:row:col: --> getRow:column:ofCellWithTag: ** getRow:andCol:forPoint: --> getRow:column:forPoint: **/ replace "[ : row: col:]" with "[ getRow: column: :]" warning "MiscTableScrollConversion: getRow:column:: now returns BOOL rather than (id)" where ("", "") isOneOf { ("findCellWithTag", "ofCellWithTag"), ("findCell", "ofCell") } replace "[ getRow: andCol: forPoint:]" with "[ getRow: column: forPoint:]" warning "MiscTableScrollConversion: getRow:column:forPoint: now returns BOOL rather than (id)" /** ** Name change (for NSMatrix compatibility), return type change: (id) --> NSRect ** getCellFrame:at:: --> cellFrameAtRow:column: **/ replace "[ getCellFrame: at::]" with "* = [ cellFrameAtRow: column:]" /** ** Simple name change (for OpenStep's new naming conventions): ** addCol --> addColumn ** autoSortCols --> autoSortColumns ** border:deleteSlotAt: --> border:removeSlot: ** border:findSlotWithTag: --> border:slotWithTag: ** border:insertSlotAt: --> border:insertSlot: ** border:moveSlotFrom:to: --> border:moveSlot:toSlot: ** border:selectSlot:byExtension: --> border:selectSlot:byExtendingSelection: ** border:setSlot:sortFunc: --> border:setSlot:sortFunction: ** border:slotDraggedFrom:to: --> border:slotDragged:toSlot: ** border:slotSortFunc: --> border:slotSortFunction: ** buffCount --> bufferCount ** builtinValidRequestorForSendType:andReturnType: ** --> builtinValidRequestorForSendType:returnType: ** canEdit:at:: --> canEdit:atRow:column: ** cellAt:: --> cellAtRow:column: ** cellIsSelected:: --> cellIsSelectedAtRow:column: ** clearColSelection --> clearColumnSelection ** clearCursorCol --> clearCursorColumn ** clickedCol --> clickedColumn ** colAdjustedSize: --> columnAdjustedSize: ** colAtPosition: --> columnAtPosition: ** colBorder --> columnBorder ** colCellPrototype: --> columnCellPrototype: ** colCellType: --> columnCellType: ** colIsAutosize: --> columnIsAutosize: ** colIsSelected: --> columnIsSelected: ** colIsSizeable: --> columnIsSizeable: ** colIsSorted: --> columnIsSorted: ** colIsVisible: --> columnIsVisible: ** colMaxSize: --> columnMaxSize: ** colMinSize: --> columnMinSize: ** colPosition: --> columnPosition: ** colsAreSorted --> columnsAreSorted ** colSize: --> columnSize: ** colSortDirection: --> columnSortDirection: ** colSortFunc: --> columnSortFunction: ** colSortType: --> columnSortType: ** colTag: --> columnTag: ** colTitle: --> columnTitle: ** colTitleMode --> columnTitleMode ** colTitlesHeight --> columnTitlesHeight ** colTitlesOn --> columnTitlesOn ** compareCols:: --> compareColumns:: ** compareCols::info: --> compareColumns::info: ** compareSlotFunc --> compareSlotFunction ** cursorCol --> cursorColumn ** deleteColAt: --> removeColumn: ** deleteRowAt: --> removeRow: ** deselectCol: --> deselectColumn: ** doIncrementalSearch:col: --> doIncrementalSearch:column: ** doRetireCell:at:: --> doRetireCell:atRow:column: ** doReviveCell:at:: --> doReviveCell:atRow:column: ** doubleValueAt:: --> doubleValueAtRow:column: ** draggableCols --> draggableColumns ** drawCellAt:: --> drawCellAtRow:column: ** drawCol: --> drawColumn: ** drawColTitle: --> drawColumnTitle: ** drawClippedText --> drawsClippedText ** edit:at:: --> edit:atRow:column: ** editCellAt:: --> editCellAtRow:column: ** editIfAble:at:: --> editIfAble:atRow:column: ** emptyAndFreeCells --> emptyAndReleaseCells ** findCellWithTag: --> cellWithTag: ** findColWithTag: --> columnWithTag: ** findRowWithTag: --> rowWithTag: ** firstVisibleCol --> firstVisibleColumn ** floatValueAt:: --> floatValueAtRow:column: ** getColExportGridMode --> getColumnExportGridMode ** getColExportTitleMode --> getColumnExportTitleMode ** hasColSelection --> hasColumnSelection ** hasMultipleColSelection --> hasMultipleColumnSelection ** hasValidCursorCol --> hasValidCursorColumn ** insertColAt: --> insertColumn: ** insertRowAt: --> insertRow: ** intValueAt:: --> intValueAtRow:column: ** lastVisibleCol --> lastVisibleColumn ** makeCellsPerform: --> makeCellsPerformSelector: ** makeCellsPerform:selectedOnly: --> makeCellsPerformSelector:selectedOnly: ** makeCellsPerform:with: --> makeCellsPerformSelector:with: ** makeCellsPerform:with:selectedOnly: ** --> makeCellsPerformSelector:with:selectedOnly: ** makeCellsPerform:with:with: --> makeCellsPerformSelector:with:with: ** makeCellsPerform:with:with:selectedOnly: ** --> makeCellsPerformSelector:with:with:selectedOnly: ** maxUniformSizeCols --> maxUniformSizeColumns ** minUniformSizeCols --> minUniformSizeColumns ** modifierDragCols --> modifierDragColumns ** moveColFrom:to: --> moveColumn:toColumn: ** moveRowFrom:to: --> moveRow:toRow: ** numCols --> numberOfColumns ** numRows --> numberOfRows ** numSelectedCols --> numberOfSelectedColumns ** numSelectedRows --> numberOfSelectedRows ** numSlots: --> numberOfSlots: ** numVisibleCols --> numberOfVisibleColumns ** numVisibleRows --> numberOfVisibleRows ** numVisibleSlots: --> numberOfVisibleSlots: ** reenableCursor --> enableCursor ** retireCell:at:: --> retireCell:atRow:column: ** reviveCell:at:: --> reviveCell:atRow:column: ** rowSortFunc: --> rowSortFunction: ** scrollCellToVisible:: --> scrollCellToVisibleAtRow:column: ** scrollColToVisible: --> scrollColumnToVisible: ** scrollSelToVisible --> scrollSelectionToVisible ** selectAllCols --> selectAllColumns ** selectCol: --> selectColumn: ** selectCol:byExtension: --> selectColumn:byExtendingSelection: ** selectedCol --> selectedColumn ** selectRow:byExtension: --> selectRow:byExtendingSelection: ** setAutoSortCols: --> setAutoSortColumns: ** setCol:autosize: --> setColumn:autosize: ** setCol:cellPrototype: --> setColumn:cellPrototype: ** setCol:cellType: --> setColumn:cellType: ** setCol:maxSize: --> setColumn:maxSize: ** setCol:minSize: --> setColumn:minSize: ** setCol:size: --> setColumn:size: ** setCol:sizeable: --> setColumn:sizeable: ** setCol:sortDirection: --> setColumn:sortDirection: ** setCol:sortFunc: --> setColumn:sortFunction: ** setCol:sortType: --> setColumn:sortType: ** setCol:tag: --> setColumn:tag: ** setCol:title: --> setColumn:title: ** setColExportGridMode: --> setColumnExportGridMode: ** setColExportTitleMode: --> setColumnExportTitleMode: ** setColOrderFromString: --> setColumnOrderFromString: ** setColSizesFromString: --> setColumnSizesFromString: ** setColTitleMode: --> setColumnTitleMode: ** setColTitlesHeight: --> setColumnTitlesHeight: ** setColTitlesOn: --> setColumnTitlesOn: ** setCompareSlotFunc: --> setCompareSlotFunction: ** setCursorCol: --> setCursorColumn: ** setDraggableCols: --> setDraggableColumns: ** setDrawClippedText: --> setDrawsClippedText: ** setFirstVisibleCol: --> setFirstVisibleColumn: ** setLastVisibleCol: --> setLastVisibleColumn: ** setMaxUniformSizeCols: --> setMaxUniformSizeColumns: ** setMinUniformSizeCols: --> setMinUniformSizeColumns: ** setModifierDragCols: --> setModifierDragColumns: ** setRow:sortFunc: --> setRow:sortFunction: ** setSizeableCols: --> setSizeableColumns: ** setUniformSizeCols: --> setUniformSizeColumns: ** sizeableCols --> sizeableColumns ** sortCol: --> sortColumn: ** sortCols --> sortColumns ** stateAt:: --> stateAtRow:column: ** stringValueAt:: --> stringValueAtRow:column: ** tagAt:: --> tagAtRow:column: ** titleAt:: --> titleAtRow:column: ** tracking --> isTrackingMouse ** uniformSizeCols --> uniformSizeColumns ** tableScroll:abortEditAt:: --> tableScroll:abortEditAtRow:column: ** tableScroll:allowDragOperationAt:: ** --> tableScroll:allowDragOperationAtRow:column: ** tableScrollBuffCount: --> tableScrollBufferCount: ** tableScroll:canEdit:at:: --> tableScroll:canEdit:atRow:column: ** tableScroll:cellAt:: --> tableScroll:cellAtRow:column: ** tableScroll:doubleValueAt:: --> tableScroll:doubleValueAtRow:column: ** tableScroll:edit:at:: --> tableScroll:edit:atRow:column: ** tableScroll:floatValueAt:: --> tableScroll:floatValueAtRow:column: ** tableScroll:getISearchCol: --> tableScroll:getIncrementalSearchColumn: ** tableScroll:imageForDragOperationAt:: ** --> tableScroll:imageForDragOperationAtRow:column: ** tableScroll:intValueAt:: --> tableScroll:intValueAtRow:column: ** tableScroll:preparePasteboard:forDragOperationAt:: ** --> tableScroll:preparePasteboard:forDragOperationAtRow:column: ** tableScroll:retireAt:: --> tableScroll:retireAtRow:column: ** tableScroll:retireCell:at:: --> tableScroll:retireCell:atRow:column: ** tableScroll:reviveAt:: --> tableScroll:reviveAtRow:column: ** tableScroll:reviveCell:at:: --> tableScroll:reviveCell:atRow:column: ** tableScroll:setStringValue:at:: --> tableScroll:setStringValue:atRow:column: ** tableScroll:stateAt:: --> tableScroll:stateAtRow:column: ** tableScroll:stringValueAt:: --> tableScroll:stringValueAtRow:column: ** tableScroll:tagAt:: --> tableScroll:tagAtRow:column: ** tableScroll:titleAt:: --> tableScroll:titleAtRow:column: ** tableScroll:validRequestorForSendType:andReturnType: ** --> tableScroll:validRequestorForSendType:returnType: **/ replacemethod "" with "" where ("", "") isOneOf { ("addCol", "addColumn"), ("autoSortCols", "autoSortColumns"), ("border:deleteSlotAt:", "border:removeSlot:"), ("border:findSlotWithTag:", "border:slotWithTag:"), ("border:insertSlotAt:", "border:insertSlot:"), ("border:moveSlotFrom:to:", "border:moveSlot:toSlot:"), ("border:selectSlot:byExtension:", "border:selectSlot:byExtendingSelection:"), ("border:setSlot:sortFunc:", "border:setSlot:sortFunction:"), ("border:slotDraggedFrom:to:", "border:slotDragged:toSlot:"), ("border:slotSortFunc:", "border:slotSortFunction:"), ("buffCount", "bufferCount"), ("builtinValidRequestorForSendType:andReturnType:", "builtinValidRequestorForSendType:returnType:"), ("canEdit:at::", "canEdit:atRow:column:"), ("cellAt::", "cellAtRow:column:"), ("cellIsSelected::", "cellIsSelectedAtRow:column:"), ("clearColSelection", "clearColumnSelection"), ("clearCursorCol", "clearCursorColumn"), ("clickedCol", "clickedColumn"), ("colAdjustedSize:", "columnAdjustedSize:"), ("colAtPosition:", "columnAtPosition:"), ("colBorder", "columnBorder"), ("colCellPrototype:", "columnCellPrototype:"), ("colCellType:", "columnCellType:"), ("colIsAutosize:", "columnIsAutosize:"), ("colIsSelected:", "columnIsSelected:"), ("colIsSizeable:", "columnIsSizeable:"), ("colIsSorted:", "columnIsSorted:"), ("colIsVisible:", "columnIsVisible:"), ("colMaxSize:", "columnMaxSize:"), ("colMinSize:", "columnMinSize:"), ("colPosition:", "columnPosition:"), ("colsAreSorted", "columnsAreSorted"), ("colSize:", "columnSize:"), ("colSortDirection:", "columnSortDirection:"), ("colSortFunc:", "columnSortFunction:"), ("colSortType:", "columnSortType:"), ("colTag:", "columnTag:"), ("colTitle:", "columnTitle:"), ("colTitleMode", "columnTitleMode"), ("colTitlesHeight", "columnTitlesHeight"), ("colTitlesOn", "columnTitlesOn"), ("compareCols::", "compareColumns::"), ("compareCols::info:", "compareColumns::info:"), ("compareSlotFunc", "compareSlotFunction"), ("cursorCol", "cursorColumn"), ("deleteColAt:", "removeColumn:"), ("deleteRowAt:", "removeRow:"), ("deselectCol:", "deselectColumn:"), ("doIncrementalSearch:col:", "doIncrementalSearch:column:"), ("doRetireCell:at::", "doRetireCell:atRow:column:"), ("doReviveCell:at::", "doReviveCell:atRow:column:"), ("doubleValueAt::", "doubleValueAtRow:column:"), ("draggableCols", "draggableColumns"), ("drawCellAt::", "drawCellAtRow:column:"), ("drawCol:", "drawColumn:"), ("drawColTitle:", "drawColumnTitle:"), ("drawClippedText", "drawsClippedText"), ("edit:at::", "edit:atRow:column:"), ("editCellAt::", "editCellAtRow:column:"), ("editIfAble:at::", "editIfAble:atRow:column:"), ("emptyAndFreeCells", "emptyAndReleaseCells"), ("findCellWithTag:", "cellWithTag:"), ("findColWithTag:", "columnWithTag:"), ("findRowWithTag:", "rowWithTag:"), ("firstVisibleCol", "firstVisibleColumn"), ("floatValueAt::", "floatValueAtRow:column:"), ("getColExportGridMode", "getColumnExportGridMode"), ("getColExportTitleMode", "getColumnExportTitleMode"), ("hasColSelection", "hasColumnSelection"), ("hasMultipleColSelection", "hasMultipleColumnSelection"), ("hasValidCursorCol", "hasValidCursorColumn"), ("insertColAt:", "insertColumn:"), ("insertRowAt:", "insertRow:"), ("intValueAt::", "intValueAtRow:column:"), ("lastVisibleCol", "lastVisibleColumn"), ("makeCellsPerform:", "makeCellsPerformSelector:"), ("makeCellsPerform:selectedOnly:", "makeCellsPerformSelector:selectedOnly:"), ("makeCellsPerform:with:", "makeCellsPerformSelector:with:"), ("makeCellsPerform:with:selectedOnly:", "makeCellsPerformSelector:with:selectedOnly:"), ("makeCellsPerform:with:with:", "makeCellsPerformSelector:with:with:"), ("makeCellsPerform:with:with:selectedOnly:", "makeCellsPerformSelector:with:with:selectedOnly:"), ("maxUniformSizeCols", "maxUniformSizeColumns"), ("minUniformSizeCols", "minUniformSizeColumns"), ("modifierDragCols", "modifierDragColumns"), ("moveColFrom:to:", "moveColumn:toColumn:"), ("moveRowFrom:to:", "moveRow:toRow:"), ("numCols", "numberOfColumns"), ("numRows", "numberOfRows"), ("numSelectedCols", "numberOfSelectedColumns"), ("numSelectedRows" "numberOfSelectedRows"), ("numSlots:", "numberOfSlots:"), ("numVisibleCols", "numberOfVisibleColumns"), ("numVisibleRows" "numberOfVisibleRows"), ("numVisibleSlots:" "numberOfVisibleSlots:"), ("reenableCursor", "enableCursor"), ("retireCell:at::", "retireCell:atRow:column:"), ("reviveCell:at::", "reviveCell:atRow:column:"), ("rowSortFunc:", "rowSortFunction:"), ("scrollCellToVisible::", "scrollCellToVisibleAtRow:column:"), ("scrollColToVisible:", "scrollColumnToVisible:"), ("scrollSelToVisible", "scrollSelectionToVisible"), ("selectAllCols", "selectAllColumns"), ("selectCol:", "selectColumn:"), ("selectCol:byExtension:", "selectColumn:byExtendingSelection:"), ("selectedCol", "selectedColumn"), ("selectRow:byExtension:", "selectRow:byExtendingSelection:"), ("setAutoSortCols:", "setAutoSortColumns:"), ("setCol:autosize:", "setColumn:autosize:"), ("setCol:cellPrototype:", "setColumn:cellPrototype:"), ("setCol:cellType:", "setColumn:cellType:"), ("setCol:maxSize:", "setColumn:maxSize:"), ("setCol:minSize:", "setColumn:minSize:"), ("setCol:size:", "setColumn:size:"), ("setCol:sizeable:", "setColumn:sizeable:"), ("setCol:sortDirection:", "setColumn:sortDirection:"), ("setCol:sortFunc:", "setColumn:sortFunction:"), ("setCol:sortType:", "setColumn:sortType:"), ("setCol:tag:", "setColumn:tag:"), ("setCol:title:", "setColumn:title:"), ("setColExportGridMode:", "setColumnExportGridMode:"), ("setColExportTitleMode:", "setColumnExportTitleMode:"), ("setColOrderFromString:", "setColumnOrderFromString:"), ("setColSizesFromString:", "setColumnSizesFromString:"), ("setColTitleMode:", "setColumnTitleMode:"), ("setColTitlesHeight:", "setColumnTitlesHeight:"), ("setColTitlesOn:", "setColumnTitlesOn:"), ("setCompareSlotFunc:", "setCompareSlotFunction:"), ("setCursorCol:", "setCursorColumn:"), ("setDraggableCols:", "setDraggableColumns:"), ("setDrawClippedText:", "setDrawsClippedText:"), ("setFirstVisibleCol:", "setFirstVisibleColumn:"), ("setLastVisibleCol:", "setLastVisibleColumn:"), ("setMaxUniformSizeCols:", "setMaxUniformSizeColumns:"), ("setMinUniformSizeCols:", "setMinUniformSizeColumns:"), ("setModifierDragCols:", "setModifierDragColumns:"), ("setRow:sortFunc:", "setRow:sortFunction:"), ("setSizeableCols:", "setSizeableColumns:"), ("setUniformSizeCols:", "setUniformSizeColumns:"), ("sizeableCols", "sizeableColumns"), ("sortCol:", "sortColumn:"), ("sortCols", "sortColumns"), ("stateAt::", "stateAtRow:column:"), ("stringValueAt::", "stringValueAtRow:column:"), ("tagAt::", "tagAtRow:column:"), ("titleAt::", "titleAtRow:column:"), ("tracking", "isTrackingMouse"), ("uniformSizeCols", "uniformSizeColumns"), ("tableScroll:abortEditAt::", "tableScroll:abortEditAtRow:column:"), ("tableScroll:allowDragOperationAt::", "tableScroll:allowDragOperationAtRow:column:"), ("tableScrollBuffCount:", "tableScrollBufferCount:"), ("tableScroll:canEdit:at::", "tableScroll:canEdit:atRow:column:"), ("tableScroll:cellAt::", "tableScroll:cellAtRow:column:"), ("tableScroll:doubleValueAt::", "tableScroll:doubleValueAtRow:column:"), ("tableScroll:edit:at::", "tableScroll:edit:atRow:column:"), ("tableScroll:floatValueAt::", "tableScroll:floatValueAtRow:column:"), ("tableScroll:getISearchCol:", "tableScroll:getIncrementalSearchColumn:"), ("tableScroll:imageForDragOperationAt::", "tableScroll:imageForDragOperationAtRow:column:"), ("tableScroll:intValueAt::", "tableScroll:intValueAtRow:column:"), ("tableScroll:preparePasteboard:forDragOperationAt::", "tableScroll:preparePasteboard:forDragOperationAtRow:column:"), ("tableScroll:retireAt::", "tableScroll:retireAtRow:column:"), ("tableScroll:retireCell:at::", "tableScroll:retireCell:atRow:column:"), ("tableScroll:reviveAt::", "tableScroll:reviveAtRow:column:"), ("tableScroll:reviveCell:at::", "tableScroll:reviveCell:atRow:column:"), ("tableScroll:setStringValue:at::", "tableScroll:setStringValue:atRow:column:"), ("tableScroll:stateAt::", "tableScroll:stateAtRow:column:"), ("tableScroll:stringValueAt::", "tableScroll:stringValueAtRow:column:"), ("tableScroll:tagAt::", "tableScroll:tagAtRow:column:"), ("tableScroll:titleAt::", "tableScroll:titleAtRow:column:"), ("tableScroll:validRequestorForSendType:andReturnType:", "tableScroll:validRequestorForSendType:returnType:") } /** ** Simple name change (for OpenStep's new naming conventions): ** ** 'tops' program from OPENSTEP 4.2 (and earlier) is buggy. In it, ** 'replacemethod' simply fails to recognize method calls which contain an ** ampersand, as in '[scroll getISearchCol:&col]'. We have to use 'replace' ** rather than 'replacemethod' for messages which will likely contain ** ampersands, such as the ones in this section. If not for this bug, these ** methods would have been included in the preceding section. ** ** doGetISearchCol: --> doGetIncrementalSearchColumn: ** getISearchCol: --> getIncrementalSearchColumn: ** getNext:editRow:andCol: --> getNext:editRow:column: ** getNextEditRow:andCol: --> getNextEditRow:column: ** getPreviousEditRow:andCol: --> getPreviousEditRow:column: **/ replace "[ :]" with "[ :]" where ("", "") isOneOf { ("doGetISearchCol", "doGetIncrementalSearchColumn"), ("getISearchCol", "getIncrementalSearchColumn") } replace "[ : andCol:]" with "[ : column:]" where "" isOneOf { "getNextEditRow", "getPreviousEditRow" } replace "[ getNext: editRow: andCol:]" with "[ getNext: editRow: column:]" /** ** Simple name change (for OpenStep's new naming conventions): ** MISC_TABLE_CELL_ICON --> MISC_TABLE_CELL_IMAGE **/ replace "" with "" where ("", "") isOneOf { ("MISC_TABLE_CELL_ICON", "MISC_TABLE_CELL_IMAGE") } /** ** Cleaned up naming conventions (for better internal consistency): ** borderClearCursor: --> clearCursorSlot: ** borderClearSelection: --> clearSlotSelection: ** borderClickedSlot: --> clickedSlot: ** borderCursor: --> cursorSlot: ** borderHasMultipleSelection: --> hasMultipleSlotSelection: ** borderHasSelection: --> hasSlotSelection: ** borderHasValidCursor: --> hasValidCursorSlot: ** borderNumSelectedSlots: --> numberOfSelectedSlots: ** borderSelectAll: --> selectAllSlots: ** borderSelectedSlot: --> selectedSlot: ** border:setCursor: --> border:setCursorSlot: ** border:setTitleMode: --> border:setSlotTitleMode: ** border:setTitlesOn: --> border:setSlotTitlesOn: ** border:setTitlesSize: --> border:setSlotTitlesSize: ** borderTitleMode: --> slotTitleMode: ** borderTitlesOn: --> slotTitlesOn: ** borderTitlesSize: --> slotTitlesSize: ** defaultHighlightBackgroundColor --> defaultSelectedBackgroundColor ** defaultHighlightTextColor --> defaultSelectedTextColor ** highlightBackgroundColor --> selectedBackgroundColor ** highlightBackgroundColor --> selectedBackgroundColor [variable] ** highlightTextColor --> selectedTextColor ** highlightTextColor --> selectedTextColor [variable] ** setHighlightBackgroundColor: --> setSelectedBackgroundColor: ** setHighlightTextColor: --> setSelectedTextColor: ** setOwnerHighlightBackgroundColor: --> setOwnerSelectedBackgroundColor: ** setOwnerHighlightTextColor: --> setOwnerSelectedTextColor: ** setUseOwnerHighlightBackgroundColor: --> setUseOwnerSelectedBackgroundColor: ** setUseOwnerHighlightTextColor: --> setUseOwnerSelectedTextColor: ** tc1HighlightBackgroundColorLen --> tc1SelectedBackgroundColorLen ** tc1HighlightBackgroundColorPos --> tc1SelectedBackgroundColorPos ** tc1HighlightBackgroundColorPtr --> tc1SelectedBackgroundColorPtr ** tc1HighlightTextColorLen --> tc1SelectedTextColorLen ** tc1HighlightTextColorPos --> tc1SelectedTextColorPos ** tc1HighlightTextColorPtr --> tc1SelectedTextColorPtr ** useOwnerHighlightBackgroundColor--> useOwnerSelectedBackgroundColor ** useOwnerHighlightTextColor --> useOwnerSelectedTextColor **/ replacemethod "" with "" where ("", "") isOneOf { ("borderClearCursor:", "clearCursorSlot:"), ("borderClearSelection:", "clearSlotSelection:"), ("borderClickedSlot:" "clickedSlot:") ("borderCursor:", "cursorSlot:"), ("borderHasMultipleSelection:", "hasMultipleSlotSelection:"), ("borderHasSelection:", "hasSlotSelection:"), ("borderHasValidCursor:", "hasValidCursorSlot:"), ("borderNumSelectedSlots:", "numberOfSelectedSlots:"), ("borderSelectAll:", "selectAllSlots:"), ("borderSelectedSlot:", "selectedSlot:"), ("border:setCursor:", "border:setCursorSlot:"), ("border:setTitleMode:", "border:setSlotTitleMode:"), ("border:setTitlesOn:", "border:setSlotTitlesOn:"), ("border:setTitlesSize:" "border:setSlotTitlesSize:"), ("borderTitleMode:", "slotTitleMode:"), ("borderTitlesOn:", "slotTitlesOn:"), ("borderTitlesSize:" "slotTitlesSize:"), ("defaultHighlightBackgroundColor", "defaultSelectedBackgroundColor"), ("defaultHighlightTextColor", "defaultSelectedTextColor"), ("highlightBackgroundColor", "selectedBackgroundColor"), ("highlightTextColor", "selectedTextColor"), ("setHighlightBackgroundColor:", "setSelectedBackgroundColor:"), ("setHighlightTextColor:", "setSelectedTextColor:"), ("setOwnerHighlightBackgroundColor:", "setOwnerSelectedBackgroundColor:"), ("setOwnerHighlightTextColor:", "setOwnerSelectedTextColor:"), ("setUseOwnerHighlightBackgroundColor:","setUseOwnerSelectedBackgroundColor:"), ("setUseOwnerHighlightTextColor:", "setUseOwnerSelectedTextColor:"), ("tc1HighlightBackgroundColorLen", "tc1SelectedBackgroundColorLen"), ("tc1HighlightBackgroundColorPos", "tc1SelectedBackgroundColorPos"), ("tc1HighlightBackgroundColorPtr", "tc1SelectedBackgroundColorPtr"), ("tc1HighlightTextColorLen", "tc1SelectedTextColorLen"), ("tc1HighlightTextColorPos", "tc1SelectedTextColorPos"), ("tc1HighlightTextColorPtr", "tc1SelectedTextColorPtr"), ("useOwnerHighlightBackgroundColor", "useOwnerSelectedBackgroundColor"), ("useOwnerHighlightTextColor", "useOwnerSelectedTextColor") } replace "" with "" where ("", "") isOneOf { ("highlightBackgroundColor", "selectedBackgroundColor"), ("highlightTextColor", "selectedTextColor") } /** ** Radical change: Delegate methods which are now notification targets. ** tableScroll:backgroundColorChangedTo: --> tableScrollBackgroundColorChanged: ** tableScroll:border:slotDraggedFrom:to: --> tableScrollSlotDragged: ** tableScroll:border:slotResized: --> tableScrollSlotResized: ** tableScroll:border:slotSortReversed: --> tableScrollSlotSortReversed: ** tableScroll:changeFont:to: --> tableScrollChangeFont: ** tableScroll:didEdit:at:: --> tableScrollDidEdit: ** tableScroll:fontChangedFrom:to: --> tableScrollFontChanged: ** tableScroll:highlightBackgroundColorChangedTo: --> tableScrollSelectedBackgroundColorChanged: ** tableScroll:highlightTextColorChangedTo: --> tableScrollSelectedTextColorChanged: ** tableScroll:textColorChangedTo: --> tableScrollTextColorChanged: ** tableScroll:willEditAt:: --> tableScrollWillEdit: ** tableScroll:willPrintPageFooter:info: --> tableScrollWillPrintPageFooter: ** tableScroll:willPrintPageHeader:info: --> tableSCrollWillPrintPageHeader: ** tableScrollDidPrint: --> tableScrollDidPrint: ** tableScrollWillPrint: --> tableScrollWillPrint: **/ replacemethod "" with same { replace "" with "NSColor* = (NSColor*)[[notification userInfo] objectForKey:@\"Color\"]; " } where "" isOneOf { "tableScroll:backgroundColorChangedTo:", "tableScroll:highlightBackgroundColorChangedTo:", "tableScroll:highlightTextColorChangedTo:", "tableScroll:textColorChangedTo:" } replacemethod "" with same { replace "" with "NSFont* = (NSFont*)[[notification userInfo] objectForKey:@\"OldFont\"]; NSFont* = (NSFont*)[[notification userInfo] objectForKey:@\"NewFont\"]; " } where "" isOneOf { "tableScroll:changeFont:to:", "tableScroll:fontChangedFrom:to:" } replacemethod "" with same { replace "" with "int = [[[notification userInfo] objectForKey:@\"Slot\"] intValue]; " } where "" isOneOf { "tableScroll:border:slotResized:", "tableScroll:border:slotSortReversed:" } replacemethod "" with same { replace "" with "int = [[[notification userInfo] objectForKey:@\"OldSlot\"] intValue]; int = [[[notification userInfo] objectForKey:@\"NewSlot\"] intValue]; " } where "" isOneOf { "tableScroll:border:slotDraggedFrom:to:" } replacemethod "" with same { replace "" with "MiscBorderType = (MiscBorderType)[[[notification userInfo] objectForKey:@\"Border\"] intValue]; " } where "" isOneOf { "tableScroll:border:slotResized:", "tableScroll:border:slotSortReversed:", "tableScroll:border:slotDraggedFrom:to:" } replacemethod "" with same { replace "" with "int = [[[notification userInfo] objectForKey:@\"Row\"] intValue]; int = [[[notification userInfo] objectForKey:@\"Column\"] intValue]; " } where "" isOneOf { "tableScroll:didEdit:at::", "tableScroll:willEditAt::" } replacemethod "" with same { replace "" with "BOOL = [[[notification userInfo] objectForKey:@\"Changed\"] boolValue]; " } where "" isOneOf { "tableScroll:didEdit:at::" } replacemethod "" with same { replace "" with "NSView* = [[notification userInfo] objectForKey:@\"View\"]; float pageWidth = [[[notification userInfo] objectForKey:@\"PageWidth\"] floatValue]; float pageHeight = [[[notification userInfo] objectForKey:@\"PageHeight\"] floatValue]; float printRectX = [[[notification userInfo] objectForKey:@\"PrintRectX\"] floatValue]; float printRectY = [[[notification userInfo] objectForKey:@\"PrintRectY\"] floatValue]; float printRectWidth = [[[notification userInfo] objectForKey:@\"PrintRectWidth\"] floatValue]; float printRectHeight = [[[notification userInfo] objectForKey:@\"PrintRectHeight\"] floatValue]; MiscCoord_V firstPrintRow = (MiscCoord_V)[[[notification userInfo] objectForKey:@\"FirstPrintRow\"] intValue]; MiscCoord_V lastPrintRow = (MiscCoord_V)[[[notification userInfo] objectForKey:@\"LastPrintRow\"] intValue]; MiscCoord_V firstPrintColumn = (MiscCoord_V)[[[notification userInfo] objectForKey:@\"FirstPrintColumn\"] intValue]; MiscCoord_V lastPrintColumn = (MiscCoord_V)[[[notification userInfo] objectForKey:@\"LastPrintColumn\"] intValue]; int printPage = [[[notification userInfo] objectForKey:@\"PrintPage\"] intValue]; int printRow = [[[notification userInfo] objectForKey:@\"PrintRow\"] intValue]; int printColumn = [[[notification userInfo] objectForKey:@\"PrintColumn\"] intValue]; int numberOfPrintPages = [[[notification userInfo] objectForKey:@\"NumberOfPrintPages\"] intValue]; int numberOfPrintRows = [[[notification userInfo] objectForKey:@\"NumberOfPrintRows\"] intValue]; int numberOfPrintColumns = [[[notification userInfo] objectForKey:@\"NumberOfPrintColumns\"] intValue]; double scaleFactor = [[[notification userInfo] objectForKey:@\"ScaleFactor\"] doubleValue]; BOOL isScaled = [[[notification userInfo] objectForKey:@\"IsScaled\"] boolValue]; " } where "" isOneOf { "tableScroll:willPrintPageFooter:info:", "tableScroll:willPrintPageHeader:info:" } replacemethod "" with "" { replace "" with "(void)" replace "" with "(NSNotification*)" replace "" with "notification" replace "" with "MiscTableScroll* = (MiscTableScroll*)[notification object]; " } within ("") { replace "return self;" with "return;" replace "return (self);" with "return;" } where ("", "") isOneOf { ("tableScroll:backgroundColorChangedTo:", "tableScrollBackgroundColorChanged:"), ("tableScroll:border:slotDraggedFrom:to:", "tableScrollSlotDragged:"), ("tableScroll:border:slotResized:", "tableScrollSlotResized:"), ("tableScroll:border:slotSortReversed:", "tableScrollSlotSortReversed:"), ("tableScroll:changeFont:to:", "tableScrollChangeFont:"), ("tableScroll:didEdit:at::", "tableScrollDidEdit:"), ("tableScroll:fontChangedFrom:to:", "tableScrollFontChanged:"), ("tableScroll:highlightBackgroundColorChangedTo:","tableScrollSelectedBackgroundColorChanged:"), ("tableScroll:highlightTextColorChangedTo:", "tableScrollSelectedTextColorChanged:"), ("tableScroll:textColorChangedTo:", "tableScrollTextColorChanged:"), ("tableScroll:willEditAt::", "tableScrollWillEdit:"), ("tableScroll:willPrintPageFooter:info:", "tableScrollWillPrintPageFooter:"), ("tableScroll:willPrintPageHeader:info:", "tableScrollWillPrintPageHeader:"), ("tableScrollDidPrint:", "tableScrollDidPrint:"), ("tableScrollWillPrint:", "tableScrollWillPrint:") } /** ** Delegate and TableCell methods which now return explicit (id): ** tableScroll:border:slotPrototype: ** tableScroll:cellAtRow:column: ** tableScroll:retireAtRow:column: ** tableScroll:retireCell:atRow:column: ** tableScroll:reviveAtRow:column: ** tableScroll:reviveCell:atRow:column: ** tableScroll:validRequestorForSendType:returnType: **/ replacemethod "" with same { replace "" with "(id)" replace "" with "(MiscTableScroll*)" } where "" isOneOf { "tableScroll:border:slotPrototype:", "tableScroll:cellAtRow:column:", "tableScroll:retireAtRow:column:" "tableScroll:retireCell:atRow:column:", "tableScroll:reviveAtRow:column:", "tableScroll:reviveCell:atRow:column:", "tableScroll:validRequestorForSendType:returnType:", } /** ** Delegate method return changed: (char*) --> NSString ** tableScroll:stringValueAtRow:column: ** tableScroll:titleAtRow:column: **/ replacemethod "" with same { replace "" with "(NSString*)" replace "" with "(MiscTableScroll*)" } where "" isOneOf { "tableScroll:stringValueAtRow:column:", "tableScroll:titleAtRow:column:" } /** ** Delegate method argument changes: (char*) --> NSString ** tableScroll:setStringValue:atRow:column: **/ replacemethod "" with same { replace "" with "(MiscTableScroll*)" replace "" with "(NSString*)" } where "" isOneOf { "tableScroll:setStringValue:atRow:column:", } /** ** Delegate method argument changes: NXAtom --> NSString ** tableScroll:validRequestorForSendType:returnType: **/ replacemethod "" with same { replace "" with "(MiscTableScroll*)" replace "" with "(NSString*)" replace "" with "(NSString*)" } where "" isOneOf { "tableScroll:validRequestorForSendType:returnType:", } /** ** Delegate method argument changes: (NXEvent const*) --> NSEvent ** tableScroll:canEdit:atRow:column: ** tableScroll:edit:atRow:column: **/ replacemethod "" with same { replace "" with "(MiscTableScroll*)" replace "" with "(NSEvent*)" } where "" isOneOf { "tableScroll:canEdit:atRow:column:", "tableScroll:edit:atRow:column:", } /** ** Final clean up. **/ replace "*&" with "" replace "&*" with "" replace "- (void){return;}" with "- (void){}" MiscKit2/Palettes/MiscTableScroll/Framework/MiscReverseCursor.tiff100444 1750 1750 502 6757227310 25521 0ustar sunshinesunshineMM*t $(SFILE_DIR)/$*.c ;\ $(RM) $(SFILE_DIR)/$*.xyz .psw.c: $(blast_unused_pad) .psw.h: $(blast_unused_pad) #****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # forceload.fix (1999-06-09, version 1.1) # # A Makefile.postamble patch which eliminates the NSFramework_forceLoad() # compiler warning generated by YellowBox DR2 on Microsoft Windows. # # Under YellowBox DR2 for Microsoft Windows, Apple tried patching the # system makefile so that it automatically generates source code which # references all the classes in each framework used by a project. The # intention was to make all of the frameworks' symbols available to # loadable bundles even if the main application does not reference the # symbols itself. This is similar to the behavior of the linker's # -all_load switch under Mach. # # However, there are two problems with the DR2 implementation: # # a) It is incomplete and does not generate any framework references at # all; instead it generates a single empty function named # NSFramework_forceload(). # b) The generated function is declared "static" which results in a # compiler warning about an unused function. # # This file (forceload.fix) works around the compiler warning by # disabling generation of NSFramework_forceload() altogether. Since the # function is empty and is never referenced by any other code, this is a # safe operation. # # To use this patch, follow these instructions: # # a) Open the project's top-level Makefile.postamble in a text editor. # b) Append the contents of this file (forceload.fix) to the end of # Makefile.postamble. # c) Clean the project (make clean) and then rebuild it. # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ ifeq "WINDOWS" "$(OS)" GENFORCELOAD=echo // endif MiscKit2/Palettes/MiscTableScroll/Framework/Makefile.preamble100444 1750 1750 4776 6757227274 24522 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # Makefile.preamble # $Id: Makefile.preamble,v 1.16 99/08/20 06:08:39 sunshine Exp $ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Perform post-build & post-installation finalization of the framework. See # Makefile.postamble for the other half of this step. #------------------------------------------------------------------------------ AFTER_BUILD += table-scroll-finalize-build AFTER_INSTALL += table-scroll-finalize-install #------------------------------------------------------------------------------ # Under 4.1 & 4.2 although PB defines CCFILES, CPPFILES, and CXXFILES in the # Makefile, SRCFILES does not actually references them, so the C++ files # don't get compiled. This is patched by assigning them to OTHER_SOURCEFILES # which does get referenced. # # Under 4.1 & 4.2 (prerelease) OFILES does not include any of the C++ object # files, so we manually add them to OTHER_OFILES. Under 4.2 (final), OFILES # *does* refer to them, so we must remove the duplicates lest the linker # complains about linking the same files twice. This is done in the # Makefile.postamble. # # Under 4.1 & 4.2 implicitrules.make neglects to mention the .cpp suffix. #------------------------------------------------------------------------------ .SUFFIXES: .cpp OTHER_SOURCEFILES += $(CCFILES) $(CPPFILES) $(CXXFILES) OTHER_OFILES += $(CCFILES:.cc=.o) $(CPPFILES:.cpp=.o) $(CXXFILES:.cxx=.o) #------------------------------------------------------------------------------ # As of OpenStep 4.2, the compiler (gcc 2.7.2.1) does not accept Objective-C # code in cc files, so we have to force ObjC++ mode manually. #------------------------------------------------------------------------------ OTHER_CCFLAGS += -ObjC++ MiscKit2/Palettes/MiscTableScroll/Framework/NSNibConnector.h100444 1750 1750 6773 6757227341 24263 0ustar sunshinesunshine#ifndef __MiscTableScroll_NSNibConnector_h #define __MiscTableScroll_NSNibConnector_h //============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // NSNibConnector.h // // The declarations of Interface Builder's private connection classes: // NSNibConnector, NSNibOutletConnector, and NSNibControlConnector. // // NOTE // Prior to MacOS/X Server DR2 the names of these classes were named // NSIBConnector, NSIBOutletConnector, and NSIBControlConnector, // respectively. Furthermore, the definitions of these classes were // private. Consequently, for pre DR2 platforms, we also have to provide // definitions for these classes in order to be able to access them. We // use a litle C-macro magic to iron out differences between OpenStep and // MacOS/X Server. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: NSNibConnector.h,v 1.4 99/06/15 04:11:00 sunshine Exp $ // $Log: NSNibConnector.h,v $ // Revision 1.4 99/06/15 04:11:00 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // As of MacOS/X Server DR2, connector classes are public so we no longer have // to supply declarations ourselves. Compilation is conditionalized as // appropriate. Also connector classes changed name in DR2 from // NSIBConnector, NSIBOutletConnector, and NSIBControlConnector to // NSNibConnector, NSNibOutletConnector, and NSNibControlConnector, // respectively. // // Revision 1.3 1997/06/18 09:53:53 sunshine // v125.9: Renamed: IBConnector.h --> NSIBConnector.h. Commented & updated. //----------------------------------------------------------------------------- extern "Objective-C" { #import } #if !defined(FOUNDATION_STATIC_INLINE) // Key off macro new to YellowBox. #define MISC_OLD_IB_CONNECTORS #else #undef MISC_OLD_IB_CONNECTORS #endif #if defined(MISC_OLD_IB_CONNECTORS) #define NSNibConnector NSIBConnector #define NSNibOutletConnector NSIBOutletConnector #define NSNibControlConnector NSIBControlConnector @interface NSNibConnector : NSObject { id source; id destination; NSString* label; } - (id)initWithCoder:(NSCoder*)coder; - (void)encodeWithCoder:(NSCoder*)coder; - (id)source; - (void)setSource:(id)src; - (id)destination; - (void)setDestination:(id)dest; - (NSString*)label; - (void)setLabel:(NSString*)label; - (void)replaceObject:(id)oldObject withObject:(id)newObject; - (id)nibInstantiate; - (void)establishConnection; - (NSString*)nibLabel; - (void)displayConnection; @end @interface NSNibOutletConnector : NSNibConnector - (void)establishConnection; @end @interface NSNibControlConnector : NSNibConnector - (NSString*)nibLabel; - (void)establishConnection; @end #endif // MISC_OLD_IB_CONNECTORS #endif // __MiscTableScroll_NSNibConnector_h MiscKit2/Palettes/MiscTableScroll/Framework/PB.project100444 1750 1750 11727 6757227345 23176 0ustar sunshinesunshine{ CURRENTLY_ACTIVE_VERSION = YES; DEPLOY_WITH_VERSION_NAME = B; DYNAMIC_CODE_GEN = YES; FILESTABLE = { BUNDLES = (); CLASSES = ( MiscBorderCell.M, MiscBorderView.M, MiscColorList.cc, MiscColView.M, MiscCornerView.M, MiscDelegateFlags.cc, MiscDrawList.cc, MiscExporter.M, MiscExporterAccessoryView.M, MiscExporterASCII.M, MiscExporterDBF.M, MiscGeometry.cc, MiscHighlightTracker.M, MiscLineWrapper.cc, MiscListTracker.M, MiscMouseTracker.M, MiscRadioTracker.M, MiscRectColorList.cc, MiscRectList.cc, MiscRowView.M, MiscSparseSet.cc, MiscTableBorder.cc, MiscTableBorderIO.cc, MiscTableBorderSel.cc, MiscTableCell.M, MiscTableConnector.M, MiscTableScroll.M, MiscTableScrollData.M, MiscTableScrollEdit.M, MiscTableScrollIO.M, MiscTableScrollISearch.M, MiscTableScrollKB.M, MiscTableScrollPB.M, MiscTableScrollPrint.M, MiscTableScrollSel.M, MiscTableScrollSort.M, MiscTableScrollSymbols.M, MiscTableView.M, MiscTableViewCursor.M, MiscTableViewDrag.M, MiscTableViewPrint.M, MiscTableWell.M, MiscTracer.cc ); C_FILES = (); DOCUMENTATION = (); FRAMEWORKS = (AppKit.framework, Foundation.framework); FRAMEWORKSEARCH = (); HEADERSEARCH = (); H_FILES = ( bool.h, MiscBorderCell.h, MiscBorderView.h, MiscColorList.h, MiscColView.h, MiscCornerView.h, MiscDelegateFlags.h, MiscDrawList.h, MiscExporter.h, MiscExporterAccessoryView.h, MiscExporterPrivate.h, MiscGeometry.h, MiscHighlightTracker.h, MiscLineWrapper.h, MiscListTracker.h, MiscMouseTracker.h, MiscRadioTracker.h, MiscRectColorList.h, MiscRectList.h, MiscRowView.h, MiscSparseSet.h, MiscTableBorder.h, MiscTableCell.h, MiscTableConnector.h, MiscTableScroll.h, MiscTableScrollPrivate.h, MiscTableTypes.h, MiscTableUtil.h, MiscTableView.h, MiscTableViewPrivate.h, MiscTableWell.h, MiscTracer.h, new.h, NSNibConnector.h ); IMAGES = ( MiscHorzResizeCursor.tiff, MiscReverseCursor.tiff, MiscSlotDragCursor.tiff, MiscSortAscend.tiff, MiscSortAscendH.tiff, MiscSortDescend.tiff, MiscSortDescendH.tiff, MiscVertResizeCursor.tiff ); INTERFACES = ("MiscExporterAccessoryView-macintosh.nib", MiscExporterAccessoryView.nib); LIBS = (); M_FILES = (); OTHER_LINKED = (MiscTableViewPS.psw); OTHER_RESOURCES = (Documentation, "MiscTableScroll-3.3-4.x.tops"); OTHER_SOURCES = (Makefile.preamble, Makefile, Makefile.postamble); PROJECT_HEADERS = ( MiscExporter.h, MiscTableCell.h, MiscTableScroll.h, MiscTableTypes.h, MiscTableBorder.h, MiscTableConnector.h ); PUBLIC_HEADERS = (MiscExporter.h, MiscTableCell.h, MiscTableScroll.h, MiscTableTypes.h); SUBPROJECTS = (); TOOLS = (); }; LANGUAGE = English; LOCALIZABLE_FILES = { "MiscExporterAccessoryView-macintosh.nib" = "MiscExporterAccessoryView-macintosh.nib"; MiscExporterAccessoryView.nib = MiscExporterAccessoryView.nib; }; MAKEFILEDIR = "$(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles"; NEXTSTEP_BUILDTOOL = /bin/gnumake; NEXTSTEP_COMPILEROPTIONS = "-DMISC_TABLE_SCROLL_BUILDING -Werror -Wwrite-strings"; NEXTSTEP_INSTALLDIR = "$(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks"; NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; PDO_UNIX_BUILDTOOL = $NEXT_ROOT/NextDeveloper/bin/make; PDO_UNIX_JAVA_COMPILER = "$(NEXTDEV_BIN)/javac"; PDO_UNIX_OBJCPLUS_COMPILER = "$(NEXTDEV_BIN)/gcc"; PROJECTNAME = MiscTableScroll; PROJECTTYPE = Framework; PROJECTVERSION = 2.7; WINDOWS_BUILDTOOL = ./make.sh; WINDOWS_COMPILEROPTIONS = "-DMISC_TABLE_SCROLL_BUILDING -Werror -Wwrite-strings"; WINDOWS_INSTALLDIR = "$(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks"; WINDOWS_JAVA_COMPILER = "$(JDKBINDIR)/javac.exe"; WINDOWS_OBJCPLUS_COMPILER = "$(DEVDIR)/gcc"; } MiscKit2/Palettes/MiscTableScroll/Framework/bool.h100444 1750 1750 2777 6757227274 22377 0ustar sunshinesunshine#ifndef __bool_h #define __bool_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // bool.h // // A header to supplement NeXT's lack of bool type in their C++ compiler. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: bool.h,v 1.2 97/04/01 08:07:37 sunshine Exp $ // $Log: bool.h,v $ // Revision 1.2 97/04/01 08:07:37 sunshine // v0.125.5: Ported to OPENSTEP 4.2 prerelease for NT. // 'bool' is now a built-in type. // // Revision 1.1 95/09/27 12:21:21 zarnuk // Initial revision //----------------------------------------------------------------------------- #if defined(__NeXT__) && (__GNUC__ < 2 || __GNUC_MINOR__ < 7) typedef char bool; #define false ((bool)0) #define true ((bool)1) #endif #endif // __bool_h MiscKit2/Palettes/MiscTableScroll/Framework/new.h100444 1750 1750 3273 6757227341 22220 0ustar sunshinesunshine#ifndef __MiscTableScroll_new_h #define __MiscTableScroll_new_h //============================================================================= // // Copyright (C) 1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // new.h // // A local version of which defines a default "placement new" // operator. This file is required since is entirely missing // in OPENSTEP 4.2 for Mach, and the one redistributed from Microsoft // in OPENSTEP 4.2 for NT is buggy (and crashes the compilation). // // This file is compatible with OPENSTEP 4.1, and therefore does not // compromise its continued support. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: new.h,v 1.1 97/06/18 09:54:27 sunshine Exp $ // $Log: new.h,v $ // Revision 1.1 97/06/18 09:54:27 sunshine // v125.9: Patch for broken in OPENSTEP 4.2 for Mach and NT. // //----------------------------------------------------------------------------- inline void* operator new( size_t, void* ptr ) { return ptr; } #endif // __MiscTableScroll_new_h MiscKit2/Palettes/MiscTableScroll/Framework/MiscSlotDragCursor.tiff100444 1750 1750 512 6757227311 25627 0ustar sunshinesunshineII* <@s<0000?????? *2:B(RH@@ ' 'MiscKit2/Palettes/MiscTableScroll/Framework/MiscSortAscendH.tiff100444 1750 1750 336 6757227313 25075 0ustar sunshinesunshineMM* *? ????? (R ' 'MiscKit2/Palettes/MiscTableScroll/Framework/MiscDelegateFlags.cc100444 1750 1750 13730 6757227342 25110 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscDelegateFlags.cc // // Flags indicating which selectors a delegate responds to. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscDelegateFlags.cc,v 1.11 99/06/15 02:33:30 sunshine Exp $ // $Log: MiscDelegateFlags.cc,v $ // Revision 1.11 99/06/15 02:33:30 sunshine // v140.1: Many delegate messages changed to notification style messages. // Added delegate messages for becoming and resigning first responder. // Renamed: DEL_WILL_EDIT_AT to DEL_WILL_EDIT, DEL_DID_EDIT_AT to DEL_DID_EDIT // For better OpenStep conformance, renamed: -tableScroll:getISearchColumn: to // -tableScrollGetIncrementalSearchColumn:. // // Revision 1.10 1998/03/29 23:42:21 sunshine // v138.1: Added -tableScroll:shouldDelayWindowOrderingForEvent:. // // Revision 1.9 98/03/23 07:46:45 sunshine // v134.1: Eliminated -tableScroll:edit:atRow:column:. //----------------------------------------------------------------------------- #ifdef __GNUC__ #pragma implementation #endif #include "MiscDelegateFlags.h" extern "Objective-C" { #import } extern "C" { #include // memset() } static inline unsigned int BYTE_NUM( int x ) { return (x / 8); } static inline unsigned int BIT_NUM( int x ) { return (x % 8); } static inline unsigned char BIT_MASK( int x ) { return (1 << BIT_NUM(x)); } #define PSEL(X) &@selector(X) // *** MUST MATCH ENUM IN .h FILE *** static SEL const* const SELECTORS[ MiscDelegateFlags::MAX_DEL_ENUM ] = { PSEL(tableScrollSlotDragged:), PSEL(tableScrollSlotSortReversed:), PSEL(tableScrollSlotResized:), PSEL(tableScrollChangeFont:), PSEL(tableScrollFontChanged:), PSEL(tableScrollBackgroundColorChanged:), PSEL(tableScrollSelectedBackgroundColorChanged:), PSEL(tableScrollTextColorChanged:), PSEL(tableScrollSelectedTextColorChanged:), PSEL(tableScroll:getIncrementalSearchColumn:), PSEL(tableScrollBufferCount:), PSEL(tableScroll:border:slotPrototype:), PSEL(tableScroll:border:slotTitle:), PSEL(tableScroll:cellAtRow:column:), PSEL(tableScroll:reviveCell:atRow:column:), PSEL(tableScroll:retireCell:atRow:column:), PSEL(tableScroll:tagAtRow:column:), PSEL(tableScroll:intValueAtRow:column:), PSEL(tableScroll:floatValueAtRow:column:), PSEL(tableScroll:doubleValueAtRow:column:), PSEL(tableScroll:stringValueAtRow:column:), PSEL(tableScroll:titleAtRow:column:), PSEL(tableScroll:stateAtRow:column:), PSEL(tableScrollRegisterServicesTypes:), PSEL(tableScroll:validRequestorForSendType:returnType:), PSEL(tableScroll:canWritePboardType:), PSEL(tableScroll:stringForPboardType:), PSEL(tableScroll:writeSelectionToPasteboard:types:), PSEL(tableScroll:readSelectionFromPasteboard:), PSEL(tableScroll:allowDragOperationAtRow:column:), PSEL(tableScroll:preparePasteboard:forDragOperationAtRow:column:), PSEL(tableScroll:imageForDragOperationAtRow:column:), PSEL(tableScroll:draggingSourceOperationMaskForLocal:), PSEL(tableScrollIgnoreModifierKeysWhileDragging:), PSEL(tableScroll:shouldDelayWindowOrderingForEvent:), PSEL(tableScrollWillPrint:), PSEL(tableScrollDidPrint:), PSEL(tableScrollWillPrintPageHeader:), PSEL(tableScrollWillPrintPageFooter:), PSEL(tableScroll:canEdit:atRow:column:), PSEL(tableScroll:setStringValue:atRow:column:), PSEL(tableScroll:abortEditAtRow:column:), PSEL(tableScrollWillEdit:), PSEL(tableScrollDidEdit:), PSEL(controlTextDidEndEditing:), PSEL(controlTextDidBeginEditing:), PSEL(controlTextDidChange:), PSEL(control:textShouldBeginEditing:), PSEL(control:textShouldEndEditing:), PSEL(tableScrollDidBecomeFirstResponder:), PSEL(tableScrollDidResignFirstResponder:) }; #undef PSEL //----------------------------------------------------------------------------- // selToObjc //----------------------------------------------------------------------------- SEL MiscDelegateFlags::selToObjc( Selector s ) { return *SELECTORS[s]; } //----------------------------------------------------------------------------- // objcToSel //----------------------------------------------------------------------------- MiscDelegateFlags::Selector MiscDelegateFlags::objcToSel( SEL s ) { for (unsigned int i = 0; i < MAX_DEL_ENUM; i++) if (s == *SELECTORS[i]) return (Selector)i; return BAD_DEL_ENUM; } //----------------------------------------------------------------------------- // setDelegate //----------------------------------------------------------------------------- void MiscDelegateFlags::setDelegate( id d ) { if (d == 0) memset( set, 0, SET_SIZE ); else { for (unsigned int i = 0; i < MAX_DEL_ENUM; i++) { unsigned char& byte = set[ BYTE_NUM(i) ]; unsigned char const mask = BIT_MASK(i); if ([d respondsToSelector:(*SELECTORS[i])]) byte |= mask; else byte &= ~mask; } } } //----------------------------------------------------------------------------- // respondsTo //----------------------------------------------------------------------------- bool MiscDelegateFlags::respondsTo( Selector s ) const { return ((set[ BYTE_NUM(s) ] & BIT_MASK(s)) != 0); } MiscKit2/Palettes/MiscTableScroll/Framework/MiscTableBorderIO.cc100444 1750 1750 35116 6757227343 25041 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableBorderIO.cc // // Read/write routines for the MiscTableBorder class. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableBorderIO.cc,v 1.6 99/08/20 06:06:09 sunshine Exp $ // $Log: MiscTableBorderIO.cc,v $ // Revision 1.6 99/08/20 06:06:09 sunshine // 140.1: Now archives the represented-object only if it conforms to the // NSCoding protocol. // // Revision 1.5 99/06/15 02:43:14 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Added archiving support for new slot-wise "represented objects". // // Revision 1.4 1998/03/22 13:18:47 sunshine // v133.1: Combined sort-dir and sort-type. Eliminated data-sizing entirely. // Eliminated constrain-max functionality. Added min/max uniform size. // Now passes the version to read(). New storage layout. //----------------------------------------------------------------------------- #include "MiscTableBorder.h" #include "MiscTableScrollPrivate.h" #include "MiscTableUtil.h" //----------------------------------------------------------------------------- // decode_bool //----------------------------------------------------------------------------- static inline bool decode_bool( NSCoder* coder ) { char c; [coder decodeValueOfObjCType:@encode(char) at:&c]; return bool(c); } //----------------------------------------------------------------------------- // encode_bool //----------------------------------------------------------------------------- static inline void encode_bool( NSCoder* coder, bool b ) { char const c = b; [coder encodeValueOfObjCType:@encode(char) at:&c]; } //----------------------------------------------------------------------------- // decode_string //----------------------------------------------------------------------------- static NSString* decode_string( NSCoder* coder, bool isCString ) { NSString* s = @""; if (!isCString) s = [coder decodeObject]; else { char* cstr = 0; [coder decodeValueOfObjCType:@encode(char*) at:&cstr]; if (cstr != 0) { s = [NSString stringWithCString:cstr]; NSZoneFree( [coder objectZone], cstr ); } } return s; } //----------------------------------------------------------------------------- // decode_strings //----------------------------------------------------------------------------- static void decode_strings( NSCoder* coder, NSString** strings, int n ) { for (int i = 0; i < n; i++) strings[i] = [[coder decodeObject] retain]; } //----------------------------------------------------------------------------- // decode_c_string_array //----------------------------------------------------------------------------- static void decode_c_string_array( NSCoder* coder, NSString** strings, int n ) { NSZone* const z = [coder objectZone]; char** cstrings = (char**)malloc( sizeof(char*) * n ); [coder decodeArrayOfObjCType:@encode(char*) count:n at:cstrings]; for (int i = 0; i < n; i++) { strings[i] = [[NSString allocWithZone:z] initWithCString:cstrings[i]]; NSZoneFree( z, cstrings[i] ); } free( cstrings ); } //----------------------------------------------------------------------------- // MiscTableSlot::encodeWithCoder //----------------------------------------------------------------------------- void MiscTableSlot::encodeWithCoder( NSCoder* coder ) { [coder encodeValueOfObjCType:@encode(MiscPixels) at:&size]; [coder encodeValueOfObjCType:@encode(MiscPixels) at:&min_size]; [coder encodeValueOfObjCType:@encode(MiscPixels) at:&max_size]; [coder encodeValueOfObjCType:@encode(MiscTableSizing) at:&sizing]; } //----------------------------------------------------------------------------- // encodeWithCoder //----------------------------------------------------------------------------- void MiscTableBorder::encodeWithCoder( NSCoder* coder ) { int i; register unsigned int m = 0; m = (m << 1) | (rep_objs != 0); m = (m << 1) | (prototypes != 0); m = (m << 1) | (titles != 0); m = (m << 1) | (styles != 0); m = (m << 1) | (tags != 0); m = (m << 1) | (sort_info != 0); m = (m << 1) | (p2v != 0); m = (m << 1) | (slots != 0); m = (m << 1) | (modifier_drag != 0); m = (m << 1) | (draggable != 0); m = (m << 1) | (sizeable != 0); m = (m << 1) | (selectable != 0); m = (m << 1) | (type != 0); unsigned int const mbuff = m; [coder encodeValueOfObjCType:@encode(unsigned int) at:&mbuff]; [coder encodeConditionalObject:owner]; def_slot.encodeWithCoder( coder ); [coder encodeValueOfObjCType:@encode(MiscTableCellStyle) at:&def_style]; [coder encodeValueOfObjCType:@encode(int) at:&def_tag]; [coder encodeValueOfObjCType:@encode(MiscTableTitleMode) at:&title_mode]; [coder encodeValueOfObjCType:@encode(MiscPixels) at:&min_uniform_size]; [coder encodeValueOfObjCType:@encode(MiscPixels) at:&max_uniform_size]; [coder encodeValueOfObjCType:@encode(MiscPixels) at:&uniform_size]; [coder encodeValueOfObjCType:@encode(MiscPixels) at:&min_total_size]; [coder encodeValueOfObjCType:@encode(int) at:&num_springy]; [coder encodeValueOfObjCType:@encode(int) at:&num_slots]; if (slots != 0) for (i = 0; i < num_slots; i++) slots[i].encodeWithCoder(coder); if (p2v != 0) [coder encodeArrayOfObjCType:@encode(MiscCoord_V) count:num_slots at:p2v]; if (sort_info != 0) [coder encodeArrayOfObjCType:@encode(int) count:num_slots at:sort_info]; if (tags != 0) [coder encodeArrayOfObjCType:@encode(int) count:num_slots at:tags]; if (styles != 0) [coder encodeArrayOfObjCType:@encode(MiscTableCellStyle) count:num_slots at:styles]; if (titles != 0) for (i = 0; i < num_slots; i++) [coder encodeObject:titles[i]]; if (prototypes != 0) for (i = 0; i < num_slots; i++) [coder encodeObject:prototypes[i]]; if (rep_objs != 0) for (i = 0; i < num_slots; i++) { id const r = rep_objs[i]; [coder encodeObject: r != 0 && [r conformsToProtocol:@protocol(NSCoding)] ? r : 0]; } } //----------------------------------------------------------------------------- // initWithCoder //----------------------------------------------------------------------------- void MiscTableBorder::initWithCoder( NSCoder* coder, int ver ) { if (ver < MISC_TS_VERSION_2 || (ver >= MISC_TS_VERSION_1000 && ver < MISC_TS_VERSION_1002)) initWithCoder_v1( coder, ver ); else initWithCoder_v2( coder, ver ); } //----------------------------------------------------------------------------- // MiscTableSlot::initWithCoder //----------------------------------------------------------------------------- void MiscTableSlot::initWithCoder( NSCoder* coder, int ver ) { [coder decodeValueOfObjCType:@encode(MiscPixels) at:&size]; [coder decodeValueOfObjCType:@encode(MiscPixels) at:&min_size]; [coder decodeValueOfObjCType:@encode(MiscPixels) at:&max_size]; if (ver < MISC_TS_VERSION_2 || (ver >= MISC_TS_VERSION_1000 && ver < MISC_TS_VERSION_1002)) { MiscPixels data_size; unsigned int x; [coder decodeValueOfObjCType:@encode(MiscPixels) at:&data_size]; [coder decodeValueOfObjCType:@encode(MiscTableSizing) at:&x]; sizing = MiscTableSizing( (x & 1) | ((x & 4) >> 1) ); } else [coder decodeValueOfObjCType:@encode(MiscTableSizing) at:&sizing]; MISC_ENUM_CHECK( sizing, MISC_MAX_SIZING ); offset = 0; adj_size = size; } //----------------------------------------------------------------------------- // initWithCoder_v2 //----------------------------------------------------------------------------- void MiscTableBorder::initWithCoder_v2( NSCoder* coder, int ver ) { emptyAndFree(); sort_funcs = 0; // Can't archive function addresses. unsigned int mbuff; [coder decodeValueOfObjCType:@encode(unsigned int) at:&mbuff]; register unsigned int m = mbuff; type = MiscBorderType( m & 1 ); selectable = bool((m >>= 1) & 1); sizeable = bool((m >>= 1) & 1); draggable = bool((m >>= 1) & 1); modifier_drag = bool((m >>= 1) & 1); owner = [coder decodeObject]; def_slot.initWithCoder( coder, ver ); [coder decodeValueOfObjCType:@encode(MiscTableCellStyle) at:&def_style]; [coder decodeValueOfObjCType:@encode(int) at:&def_tag]; [coder decodeValueOfObjCType:@encode(MiscTableTitleMode) at:&title_mode]; [coder decodeValueOfObjCType:@encode(MiscPixels) at:&min_uniform_size]; [coder decodeValueOfObjCType:@encode(MiscPixels) at:&max_uniform_size]; [coder decodeValueOfObjCType:@encode(MiscPixels) at:&uniform_size]; [coder decodeValueOfObjCType:@encode(MiscPixels) at:&min_total_size]; [coder decodeValueOfObjCType:@encode(int) at:&num_springy]; [coder decodeValueOfObjCType:@encode(int) at:&num_slots]; max_slots = num_slots; if ((m >>= 1) & 1) { alloc_slots(); for (int i = 0; i < num_slots; i++) slots[i].initWithCoder( coder, ver ); } if ((m >>= 1) & 1) { alloc_vmap(); [coder decodeArrayOfObjCType:@encode(MiscCoord_V) count:num_slots at:p2v]; for (int i = 0; i < num_slots; i++) v2p[ p2v[i] ] = i; } if ((m >>= 1) & 1) { alloc_sort_info(); [coder decodeArrayOfObjCType:@encode(int) count:num_slots at:sort_info]; } if ((m >>= 1) & 1) { alloc_tags(); [coder decodeArrayOfObjCType:@encode(int) count:num_slots at:tags]; } if ((m >>= 1) & 1) { alloc_styles(); [coder decodeArrayOfObjCType:@encode(MiscTableCellStyle) count:num_slots at:styles]; } if ((m >>= 1) & 1) { alloc_titles(); if (ver < MISC_TS_VERSION_1000) decode_c_string_array( coder, titles, num_slots ); else decode_strings( coder, titles, num_slots ); } if ((m >>= 1) & 1) { alloc_prototypes(); for (int i = 0; i < num_slots; i++) prototypes[i] = [[coder decodeObject] retain]; } if ((m >>= 1) & 1) { alloc_represented_objects(); for (int i = 0; i < num_slots; i++) rep_objs[i] = [[coder decodeObject] retain]; } needs_recalc = true; } //----------------------------------------------------------------------------- // initWithCoder_v1 //----------------------------------------------------------------------------- void MiscTableBorder::initWithCoder_v1( NSCoder* coder, int ver ) { int n; emptyAndFree(); [coder decodeValueOfObjCType:@encode(MiscBorderType) at:&type]; MISC_ENUM_CHECK( type, MISC_MAX_BORDER ); owner = [coder decodeObject]; def_slot.initWithCoder( coder, ver ); [coder decodeValueOfObjCType:@encode(int) at:&num_slots]; max_slots = num_slots; [coder decodeValueOfObjCType:@encode(int) at:&n]; if (n != 0) { alloc_slots(); for (int i = 0; i < num_slots; i++) slots[i].initWithCoder( coder, ver ); } [coder decodeValueOfObjCType:@encode(int) at:&n]; if (n != 0) { alloc_vmap(); for (int i = 0; i < num_slots; i++) [coder decodeValueOfObjCType:@encode(MiscCoord_P) at:&(v2p[i])]; for (int j = 0; j < num_slots; j++) [coder decodeValueOfObjCType:@encode(MiscCoord_V) at:&(p2v[j])]; } [coder decodeValueOfObjCType:@encode(int) at:&def_tag]; [coder decodeValueOfObjCType:@encode(int) at:&n]; if (n != 0) { alloc_tags(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); [coder decodeValueOfObjCType:@encode(int) at:&(tags[j])]; } } [coder decodeValueOfObjCType:@encode(MiscPixels) at:&uniform_size]; [coder decodeValueOfObjCType:@encode(MiscPixels) at:&min_total_size]; MiscPixels max_total_size; // obsolete. [coder decodeValueOfObjCType:@encode(MiscPixels) at:&max_total_size]; [coder decodeValueOfObjCType:@encode(int) at:&num_springy]; [coder decodeValueOfObjCType:@encode(MiscTableTitleMode) at:&title_mode]; MISC_ENUM_CHECK( title_mode, MISC_MAX_TITLE ); [coder decodeValueOfObjCType:@encode(int) at:&n]; if (n != 0) { bool const isCString = (ver < MISC_TS_VERSION_1000); alloc_titles(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); titles[j] = [decode_string( coder, isCString ) retain]; } } [coder decodeValueOfObjCType:@encode(MiscTableCellStyle) at:&def_style]; MISC_ENUM_CHECK( def_style, MISC_TABLE_CELL_MAX ); [coder decodeValueOfObjCType:@encode(int) at:&n]; if (n != 0) { alloc_styles(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); [coder decodeValueOfObjCType:@encode(MiscTableCellStyle) at:&(styles[j])]; MISC_ENUM_CHECK( styles[i], MISC_TABLE_CELL_MAX ); } } [coder decodeValueOfObjCType:@encode(int) at:&n]; if (n != 0) { alloc_prototypes(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); prototypes[j] = [[coder decodeObject] retain]; } } sort_funcs = 0; // Can't archive function addresses. [coder decodeValueOfObjCType:@encode(int) at:&n]; if (n != 0) { alloc_sort_info(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); MiscSortDirection x; [coder decodeValueOfObjCType:@encode(MiscSortDirection) at:&x]; MISC_ENUM_CHECK( x, MISC_SORT_DIR_MAX ); int const z = sort_info[j]; sort_info[j] = ((z & ~1) | (x & 1)); } } [coder decodeValueOfObjCType:@encode(int) at:&n]; if (n != 0) { if (sort_info == 0) alloc_sort_info(); for (int i = 0; i < num_slots; i++) { int const j = visualToPhysical(i); MiscSortType x; [coder decodeValueOfObjCType:@encode(MiscSortType) at:&x]; MISC_ENUM_CHECK( x, MISC_SORT_TYPE_MAX ); int const z = sort_info[j]; sort_info[j] = ((x << 1) | (z & 1)); } } selectable = decode_bool( coder ); sizeable = decode_bool( coder ); draggable = decode_bool( coder ); modifier_drag = decode_bool( coder ); min_uniform_size = MISC_MIN_PIXELS_SIZE; max_uniform_size = MISC_MAX_PIXELS_SIZE; needs_recalc = true; } MiscKit2/Palettes/MiscTableScroll/Java/ 40755 1750 1750 0 6757227346 20107 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/Java/MiscTableScrollJava.m100444 1750 1750 6753 6757227345 24216 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollJava.m // // Private Java implementation which extends MiscTableScroll in order to // properly export it to Java. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollJava.m,v 1.1 99/06/14 18:46:06 sunshine Exp $ // $Log: MiscTableScrollJava.m,v $ // Revision 1.1 99/06/14 18:46:06 sunshine // v140.1: Extensions to MiscTableScroll to support Java exposure. // //----------------------------------------------------------------------------- #import "MiscTableScrollJava.h" //----------------------------------------------------------------------------- // Provide replacements for methods which return, via reference, row & column. // Cheat by using NSRange as a two-value container on the Objective-C side to // avoid having to write "native" type conversion functions. (They already // exist for NSRange.) Each of the overloaded methods returns a BOOL value // indicating whether or not it was able to compute the row & column values. // This return value is encoded into the NSRange by returning {~0,0} upon // failure. These methods are exposed as "private". On the Java side, we // provide "public" Java methods which translate the NSRange into a // TableScroll.Location object and return that to the caller. If the range // indicates a failure then "null" is returned. //----------------------------------------------------------------------------- @implementation MiscTableScroll(JavaExtensions) static NSRange const NULL_RANGE = { ~0, 0 }; - (NSRange)javaNextEditLocationInDirection:(BOOL)forward { int r,c; if ([self getNext:forward editRow:&r column:&c]) return NSMakeRange(r,c); return NULL_RANGE; } - (NSRange)javaNextEditLocation { int r,c; if ([self getNextEditRow:&r column:&c]) return NSMakeRange(r,c); return NULL_RANGE; } - (NSRange)javaPreviousEditLocation { int r,c; if ([self getPreviousEditRow:&r column:&c]) return NSMakeRange(r,c); return NULL_RANGE; } - (NSRange)javaLocationForPoint:(NSPoint)point { int r,c; if ([self getRow:&r column:&c forPoint:point]) return NSMakeRange(r,c); return NULL_RANGE; } - (NSRange)javaLocationOfCell:(NSCell*)cell { int r,c; if ([self getRow:&r column:&c ofCell:cell]) return NSMakeRange(r,c); return NULL_RANGE; } - (NSRange)javaLocationOfCellWithTag:(int)n { int r,c; if ([self getRow:&r column:&c ofCellWithTag:n]) return NSMakeRange(r,c); return NULL_RANGE; } - (NSRange)javaLocationOfCellWithRepresentedObject:(id)p { int r,c; if ([self getRow:&r column:&c ofCellWithRepresentedObject:p]) return NSMakeRange(r,c); return NULL_RANGE; } @end MiscKit2/Palettes/MiscTableScroll/Java/MiscTableScrollJava.sed100444 1750 1750 4310 6757227346 24521 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # MiscTableScrollJava.sed # # Under Windows, the stub file generated by bridget for MiscTableScroll # exports so many symbols that the compiler generates a single line of # assembly which is so long that it overflows the assembler's input # buffer, resulting in a crash. The offending assembler directive looks # like this: # # .ascii " -export:symbol1 -export:symbol2 ... -export:symbolN\0" # # This "sed" script, which is inserted into the build process, breaks up # the problematic line in this fashion: # # .ascii " -export:symbol1" # .ascii " -export:symbol2" # ... # .ascii " -export:symbolN\0" # #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # $Id: MiscTableScrollJava.sed,v 1.1 99/06/14 18:53:47 sunshine Exp $ # $Log: MiscTableScrollJava.sed,v $ # Revision 1.1 99/06/14 18:53:47 sunshine # v140.1: A compilation patch to work around a bug in the compiler for # Windows. MiscTableScrollJava exports so many symbols from the DLL that # the compiler generates a single assembly directive which is too long for # the assemblers input buffer. Consequently the build process aborts. This # script is inserted into the compilation process by the makefile and works # around the problem by breaking the offending line into smaller pieces. # #------------------------------------------------------------------------------ s/[ ]*\.ascii " -export:/-export:/ s/-export:\([^ "]*\)[ "]/ .ascii " -export:\1"\ /g MiscKit2/Palettes/MiscTableScroll/Java/Makefile100444 1750 1750 3502 6757227346 21642 0ustar sunshinesunshine# # Generated by the NeXT Project Builder. # # NOTE: Do NOT change this file -- Project Builder maintains it. # # Put all of your customizations in files called Makefile.preamble # and Makefile.postamble (both optional), and Makefile will include them. # NAME = Java PROJECTVERSION = 2.7 PROJECT_TYPE = Java Wrapper LANGUAGE = English CLASSES = MiscTableScrollJava.m HFILES = MiscTableScrollJava.h JOBS_FILES = MiscTableScrollJava.jobs OTHERSRCS = Makefile Makefile.postamble Makefile.preamble\ MiscTableScrollJava.sed MAKEFILEDIR = $(MAKEFILEPATH)/pb_makefiles CURRENTLY_ACTIVE_VERSION = YES DEPLOY_WITH_VERSION_NAME = A CODE_GEN_STYLE = DYNAMIC MAKEFILE = javawrapper.make NEXTSTEP_INSTALLDIR = $(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Resources WINDOWS_INSTALLDIR = $(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Resources PDO_UNIX_INSTALLDIR = /usr/local/lib LIBS = -lAppKitJava -lFoundationJava DEBUG_LIBS = $(LIBS) PROF_LIBS = $(LIBS) NEXTSTEP_PB_CFLAGS = -Werror WINDOWS_PB_CFLAGS = -Werror FRAMEWORKS = -framework AppKit -framework Foundation\ -framework MiscTableScroll NEXTSTEP_PUBLIC_HEADERS_DIR = $(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Headers WINDOWS_PUBLIC_HEADERS_DIR = $(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Headers PDO_UNIX_PUBLIC_HEADERS_DIR = $(LOCAL_DEVELOPER_DIR)/Headers/$(NAME) NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc WINDOWS_OBJCPLUS_COMPILER = $(DEVDIR)/gcc PDO_UNIX_OBJCPLUS_COMPILER = $(NEXTDEV_BIN)/gcc NEXTSTEP_JAVA_COMPILER = /usr/bin/javac WINDOWS_JAVA_COMPILER = $(JDKBINDIR)/javac.exe PDO_UNIX_JAVA_COMPILER = $(NEXTDEV_BIN)/javac include $(MAKEFILEDIR)/platform.make -include Makefile.preamble include $(MAKEFILEDIR)/$(MAKEFILE) -include Makefile.postamble -include Makefile.dependencies MiscKit2/Palettes/MiscTableScroll/Java/Makefile.postamble100444 1750 1750 13325 6757227346 23653 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # Makefile.postamble # $Id: Makefile.postamble,v 1.1 99/06/14 18:55:24 sunshine Exp $ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # The Java wrapper makefile has a bug where it unnecessarily copies the Java # .class file hierarchy into the main source directory during installation. # The "clean" target also fails to remove this rogue directory. Work around # the problem by faking it into invoking a do-nothing target instead. See # Makefile.preamble for the other half of this work-around. #------------------------------------------------------------------------------ .PHONY: table-scroll-do-not-copy-java-classes table-scroll-do-not-copy-java-classes: #------------------------------------------------------------------------------ # Under Windows, relocate the DLL to the standard Executables directory which # contains DLL files from other frameworks, since this directory is likely to # be named in the user's PATH. See Makefile.preamble also. #------------------------------------------------------------------------------ table-scroll-relocate-dll: $(DSTROOT)$(LIBRARY_DLL_INSTALLDIR) $(RM) -f $(DSTROOT)$(LIBRARY_DLL_INSTALLDIR)/$(notdir $(PRODUCT)) $(CP) $(DSTROOT)$(INSTALLDIR)/$(notdir $(PRODUCT)) \ $(DSTROOT)$(LIBRARY_DLL_INSTALLDIR) $(RM) -f $(DSTROOT)$(INSTALLDIR)/$(notdir $(PRODUCT)) $(DSTROOT)$(LIBRARY_DLL_INSTALLDIR): $(MKDIRS) $@ #------------------------------------------------------------------------------ # Under Windows, the stub file generated by bridget for MiscTableScroll has so # many exported symbols that the compiler generates a single line of assembly # which is so long that it overflows the assembler's input buffer, resulting in # a crash. The offending assembler directive looks like this: # .ascii " -export:symbol1 -export:symbol2 ... -export:symbolN\0" # To work around this problem I devised a "sed" script which breaks the line # apart in this fashion: # .ascii " -export:symbol1" # .ascii " -export:symbol2" # ... # .ascii " -export:symbolN\n" # This patch shuts off the normal .m file to .o file compilation step and # replaces it with a three part process in which the .m file is translated to # assembly, the assembly is fed through sed, and finally sed's output is handed # off to the assembler for translatiion into an .o file. #------------------------------------------------------------------------------ ifeq "WINDOWS" "$(OS)" .SUFFIXES: .sfix # Disable normal .m -> .o rule. %.o : %.m .m.sfix: $(CC) $(ALL_CFLAGS) -S -o $(SFILE_DIR)/$*.sfix $< .sfix.s: $(SED) -f MiscTableScrollJava.sed $< > $(SFILE_DIR)/$*.s endif #****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # forceload.fix (1999-06-09, version 1.1) # # A Makefile.postamble patch which eliminates the NSFramework_forceLoad() # compiler warning generated by YellowBox DR2 on Microsoft Windows. # # Under YellowBox DR2 for Microsoft Windows, Apple tried patching the # system makefile so that it automatically generates source code which # references all the classes in each framework used by a project. The # intention was to make all of the frameworks' symbols available to # loadable bundles even if the main application does not reference the # symbols itself. This is similar to the behavior of the linker's # -all_load switch under Mach. # # However, there are two problems with the DR2 implementation: # # a) It is incomplete and does not generate any framework references at # all; instead it generates a single empty function named # NSFramework_forceload(). # b) The generated function is declared "static" which results in a # compiler warning about an unused function. # # This file (forceload.fix) works around the compiler warning by # disabling generation of NSFramework_forceload() altogether. Since the # function is empty and is never referenced by any other code, this is a # safe operation. # # To use this patch, follow these instructions: # # a) Open the project's top-level Makefile.postamble in a text editor. # b) Append the contents of this file (forceload.fix) to the end of # Makefile.postamble. # c) Clean the project (make clean) and then rebuild it. # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ ifeq "WINDOWS" "$(OS)" GENFORCELOAD=echo // endif MiscKit2/Palettes/MiscTableScroll/Java/Makefile.preamble100444 1750 1750 13533 6757227347 23456 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # Makefile.preamble # $Id: Makefile.preamble,v 1.1 99/06/14 18:55:17 sunshine Exp $ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Subclassers of MiscTableScroll may want to enable INSTALL_JOBS_FILE and # INSTALL_OBJCJAVA_HEADERS in order to expose the subclass to Java. By default # these are not installed. All Java-related resources are installed within # the framework's Resource directory, except for the DLL file on Windows, which # is placed in the standard Executables directory along with other DLL files # from other frameworks, since this directory is likely to be named in the # user's PATH. #------------------------------------------------------------------------------ INSTALL_JOBS_FILE = NO INSTALL_OBJCJAVA_HEADERS = NO JAVA_INSTALL_DIR = $(INSTALLDIR)/Java LIBRARY_LIB_INSTALLDIR = $(INSTALLDIR) LIBRARY_DLL_INSTALLDIR = $(INSTALLDIR)/../../../Executables #------------------------------------------------------------------------------ # The Java wrapper makefile has a bug where it unnecessarily copies the Java # .class file hierarchy into the main source directory during installation. # The "clean" target also fails to remove this rogue directory. Work around # the problem by faking it into invoking a do-nothing target instead. See # Makefile.postamble for the other half of this work-around. #------------------------------------------------------------------------------ COPY_JAVA_CLASSES = table-scroll-do-not-copy-java-classes #------------------------------------------------------------------------------ # The "bridget" tool does not provide an opportunity for us to perform # necessary initialization prior to its attempt to load the generated dynamic # library at run-time. To work around this limitation and allow us to perform # our initialization at an appropriate time, we perform a superclass # redefinitiion hack by defining MISC_BRIDGET_COMPILE. See # MiscTableScrollJava.h for full details. #------------------------------------------------------------------------------ OTHER_BRIDGET_FLAGS += -DMISC_BRIDGET_COMPILE #------------------------------------------------------------------------------ # The "bridget" tool which uses a built-in C-preprocessor (cpp) to parse # header files neglects to provide an architecture definition (one of # __i386__, __ppc__, __m68k__, etc.). This results in a series of warnings # from header files which require knowledge of the architecture. To work # around this problem, we use $(ARCH_CMD) to generate a definition. Note that # this may return an incorrect value during cross-compilation, but it should # not adversely affect bridget since it is only interested in high-level class # interfaces, rather than low-level system implementation details. #------------------------------------------------------------------------------ OTHER_BRIDGET_FLAGS += -D__$(shell $(ARCH_CMD))__ #------------------------------------------------------------------------------ # Wrapped Objective-C methods which use (double) values invoke the macro # NSJVM_INVOKE_DOUBLE from the Apple Java headers. This macro then invokes # SET_DOUBLE from within the Sun JavaVM headers. The SET_DOUBLE macro comes # in two flavors: one for platforms which require doubleword alignment, and # those which do not. Platforms, such as Intel, which do not require # doubleword alignment invoke the second flavor of the macro. Unfortunately, # this flavor generates an unused variable warning. To work around this # problem we define HAVE_ALIGNED_DOUBLES which forces use of the version of # SET_DOUBLE which does not generate a warning. Fortunately it is safe to use # doubleword alignment even on platforms which do not require it. #------------------------------------------------------------------------------ OTHER_CFLAGS += -DHAVE_ALIGNED_DOUBLES #------------------------------------------------------------------------------ # Under Windows, relocate the DLL to the standard Executables directory which # contains DLL files from other frameworks, since this directory is likely to # be named in the user's PATH. See Makefile.postamble also. #------------------------------------------------------------------------------ ifeq "WINDOWS" "$(OS)" AFTER_INSTALL += table-scroll-relocate-dll endif #------------------------------------------------------------------------------ # Under Yellow Box DR2 for Windows, when libtool builds the library, it fails # to locate AppKitJava.h, so we manually tell it where to find the header. # This problem does not exist under MacOS/X Server DR2. #------------------------------------------------------------------------------ ifeq "WINDOWS" "$(OS)" OTHER_LDFLAGS += -I$(NEXT_ROOT)$(SYSTEM_DEVELOPER_DIR)/Java/Headers \ $(VM_INCLUDE_CFLAGS) endif #------------------------------------------------------------------------------ # The javawrapper.make makefile is buggy under YellowBox DR2 for Windows. It # fails to clean up the .lib file which it creates. #------------------------------------------------------------------------------ ifeq "WINDOWS" "$(OS)" OTHER_GARBAGE += $(basename $(notdir $(PRODUCT))).lib endif MiscKit2/Palettes/MiscTableScroll/Java/PB.project100444 1750 1750 3510 6757227346 22072 0ustar sunshinesunshine{ CURRENTLY_ACTIVE_VERSION = YES; DEPLOY_WITH_VERSION_NAME = A; DYNAMIC_CODE_GEN = YES; FILESTABLE = { CLASSES = (MiscTableScrollJava.m); FRAMEWORKS = (AppKit.framework, Foundation.framework, MiscTableScroll.framework); FRAMEWORKSEARCH = (); H_FILES = (MiscTableScrollJava.h); OTHER_LIBS = (AppKitJava, FoundationJava); OTHER_LINKED = (MiscTableScrollJava.jobs); OTHER_RESOURCES = (); OTHER_SOURCES = (Makefile, Makefile.postamble, Makefile.preamble, MiscTableScrollJava.sed); }; LANGUAGE = English; LOCALIZABLE_FILES = {}; MAKEFILEDIR = "$(MAKEFILEPATH)/pb_makefiles"; NEXTSTEP_BUILDTOOL = /bin/gnumake; NEXTSTEP_COMPILEROPTIONS = "-Werror"; NEXTSTEP_INSTALLDIR = "$(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Resources"; NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; NEXTSTEP_PUBLICHEADERSDIR = "$(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Headers"; PDO_UNIX_BUILDTOOL = $NEXT_ROOT/Developer/bin/make; PDO_UNIX_INSTALLDIR = /usr/local/lib; PDO_UNIX_JAVA_COMPILER = "$(NEXTDEV_BIN)/javac"; PDO_UNIX_OBJCPLUS_COMPILER = "$(NEXTDEV_BIN)/gcc"; PDO_UNIX_PUBLICHEADERSDIR = "$(LOCAL_DEVELOPER_DIR)/Headers/$(NAME)"; PROJECTNAME = Java; PROJECTTYPE = "Java Wrapper"; PROJECTVERSION = 2.7; WINDOWS_BUILDTOOL = $NEXT_ROOT/Developer/Executables/make; WINDOWS_COMPILEROPTIONS = "-Werror"; WINDOWS_INSTALLDIR = "$(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Resources"; WINDOWS_JAVA_COMPILER = "$(JDKBINDIR)/javac.exe"; WINDOWS_OBJCPLUS_COMPILER = "$(DEVDIR)/gcc"; WINDOWS_PUBLICHEADERSDIR = "$(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Headers"; } MiscKit2/Palettes/MiscTableScroll/Java/MiscTableScrollJava.h100444 1750 1750 17205 6757227345 24223 0ustar sunshinesunshine#ifndef __MiscTableScrollJava_h #define __MiscTableScrollJava_h //============================================================================= // // Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollJava.h // // Private Java interface which exposes MiscTableScroll to Java. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollJava.h,v 1.2 99/06/30 09:28:05 sunshine Exp $ // $Log: MiscTableScrollJava.h,v $ // Revision 1.2 99/06/30 09:28:05 sunshine // v140.1: Ported to final release of MacOS/X Server. // Prototypes for objc_msgSendSuper_stret() & objc_msgSend_Stret() are now // properly declared for ppc in the system headers. Now we only declare them // manually for DR2. // // Revision 1.1 1999/06/14 18:50:35 sunshine // v140.1: Extensions to MiscTableScroll to support Java exposure. //----------------------------------------------------------------------------- #import #import #import MISC_TS_EXTERN_BEGIN( "Objective-C" ) #import MISC_TS_EXTERN_END //----------------------------------------------------------------------------- // Redefine MiscTableScroll's parent class from bridget's stand-point. There // is certain initialization which must be performed before bridget-generated // code loads MiscTableScrollJava.dylib. In particular the Java TableScroll // provides the client with the option of automatically installing the null // security manager, which is required by the Java run-time in order to // actually make calls across the bridge to the Objective-C MiscTableScroll // class. It further provides the client with the option of adding the // framework directory to the standard Java dynamic-library search path. This // directory must appear in the search path in order for the dynamic library // to be loaded at all. Unfortunately bridget does not provide any mechanism // for performing this initialization prior to the loading of the dynamic // library. Normally we would like to be able to perform our own // initialization in a static initializer, however bridget always inserts its // own static initializer into the generated Java code prior to all other // static initilizers. Since static initializers are executed in order of // appearance in the source file, and since bridget's static initializer, // which attempts to load the dynamic-library, appears before all others, we // have no opportunity to adjust the search path prior to the attempt to load // the library. To work around this problem, and ensure that our // initialization is performed prior to bridget's own initialization, we fake // bridget out by convincing it that MiscTableScroll is subclassed from // TableScrollPrivate rather than NSScrollView. TableScrollPrivate is a small // Java-only class which is implemented in MiscTableScrollJava.jobs. Its // static initializer performs the desired initialization steps as described // above. TableScrollPrivate's initialization code is always executed prior // to that of TableScroll since TableScrollPrivate is TableScroll's // superclass. MISC_BRIDGET_COMPILE, as used below, is only defined by // Makefile.preamble when bridget itself is running, so this superclass // redefinition hack has no adverse effects on "real" code. //----------------------------------------------------------------------------- #if defined(MISC_BRIDGET_COMPILE) @interface MiscTableScroll : TableScrollPrivate - (id)init; @end #endif //----------------------------------------------------------------------------- // In MacOS/X Server DR2 for Mach on PowerPC, there is a bug in the header // file /System/Developer/Java/Headers/java-vm.h. It neglects to declare // objc_msgSendSuper_stret() and objc_msgSend_stret() even though bridget // generates code which uses these functions. The final release of of MacOS/X // Server, however, does not exhibit this problem. In order to work around // the problem in DR2 and pacify the compiler, we must manually declare these // prototypes. In order to detect DR2 we key off the existence of the // __NeXT__ macro which is defined in the DR2 build environment, but not in // MacOS/X Server. //----------------------------------------------------------------------------- #if defined(__NeXT__) && defined(__ppc__) #if defined(__cplusplus) #define JEXPORT JOBJC_EXPORT "Objective-C" #else #define JEXPORT JOBJC_EXPORT #endif JEXPORT id objc_msgSendSuper_stret(); JEXPORT id objc_msgSend_stret(); #undef JEXPORT #endif //----------------------------------------------------------------------------- // Replacements for methods which return row & column by reference in a single // message. Only a single value can be returned from a method in Java. These // stand-in methods provide just such behavior. See the implementation file // for full details. //----------------------------------------------------------------------------- @interface MiscTableScroll(JavaExtensions) - (NSRange)javaNextEditLocationInDirection:(BOOL)forward; - (NSRange)javaNextEditLocation; - (NSRange)javaPreviousEditLocation; - (NSRange)javaLocationForPoint:(NSPoint)point; - (NSRange)javaLocationOfCell:(NSCell*)cell; - (NSRange)javaLocationOfCellWithTag:(int)tag; - (NSRange)javaLocationOfCellWithRepresentedObject:(id)object; @end //----------------------------------------------------------------------------- // Signature fixing for Java. This category is unimplemented. It exists only // to expose the correct type (i.e. NSCell* instead of id). //----------------------------------------------------------------------------- @interface MiscTableScroll(JavaSignatures) - (NSCell*)selectedCell; - (NSCell*)clickedCell; - (NSCell*)cellWithTag:(int)tag; - (NSCell*)cellWithRepresentedObject:(id)object; - (NSCell*)cellAtRow:(int)row column:(int)col; - (NSCell*)tableScroll:(MiscTableScroll*)scroll cellAtRow:(int)r column:(int)c; - (NSCell*)border:(MiscBorderType)b slotCellPrototype:(int)slot; - (void)border:(MiscBorderType)b setSlot:(int)n cellPrototype:(NSCell*)cell; - (NSCell*)columnCellPrototype:(int)col; - (void)setColumn:(int)col cellPrototype:(NSCell*)cell; - (NSCell*)rowCellPrototype:(int)row; - (void)setRow:(int)row cellPrototype:(NSCell*)cell; - (NSCell*)tableScroll:(MiscTableScroll*)scroll border:(MiscBorderType)b slotPrototype:(int)slot; - (NSCell*)reviveCell:(NSCell*)cell atRow:(int)row column:(int)col; - (NSCell*)retireCell:(NSCell*)cell atRow:(int)row column:(int)col; - (NSCell*)doReviveCell:(NSCell*)cell atRow:(int)row column:(int)col; - (NSCell*)doRetireCell:(NSCell*)cell atRow:(int)row column:(int)col; - (NSCell*)tableScroll:(MiscTableScroll*)scroll reviveCell:(NSCell*)cell atRow:(int)row column:(int)col; - (NSCell*)tableScroll:(MiscTableScroll*)scroll retireCell:(NSCell*)cell atRow:(int)row column:(int)col; - (NSCell*)tableScroll:(MiscTableScroll*)scroll reviveAtRow:(int)row column:(int)col; - (NSCell*)tableScroll:(MiscTableScroll*)scroll retireAtRow:(int)row column:(int)col; @end #endif __MiscTableScrollJava_h MiscKit2/Palettes/MiscTableScroll/Java/MiscTableScrollJava.jobs100444 1750 1750 103336 6757227346 24753 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # MiscTableScrollJava.jobs # # A Java-to-Objective-C script file (jobs) which exposes Objective-C # MiscTableScroll, MiscTableCell, and MiscExporter to Java. # # *** WARNING *** # Do not edit this file with WrapIt.app. WrapIt corrupts this script by # failing to generate correct overloads for valid mappings such as # -setRowOrder: & -setRowOrderFromString: to setRowOrder(), etc. It also # corrupts the path which follows the "header" directive. It is safe to view # this script with WrapIt, however modifications must be performed by hand. #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # $Id: MiscTableScrollJava.jobs,v 1.1 99/06/14 18:42:20 sunshine Exp $ # $Log: MiscTableScrollJava.jobs,v $ # Revision 1.1 99/06/14 18:42:20 sunshine # v140.1: A 'jobs' definition which exposes MiscTableScroll, MiscTableCell, # and MiscExporter to Java from Objective-C. # #------------------------------------------------------------------------------ # Name of the Java framework. name MiscTableScrollJava # WrapIt pseudo-comment indicating interfaces and directories that are # exposable. Must appear before header directive. Also see WARNING above. #> exposable directory $LOCAL_LIBRARY_DIR/Frameworks/MiscTableScroll.framework/Headers # WrapIt pseudo-comment indicating the default package name. #> package org.misckit.yellow.application # Source of the Objective-C interfaces specifications. header MiscTableScrollJava.h # Specifications files that are to be imported. import AppKitJava.jobs # Header files that are to be imported in the stub files. stub-import MiscTableScrollJava.h # Mapping of Objective-C types to Java basic types or classes. type MiscBorderType = int MiscCoord_P = int MiscCoord_V = int MiscExportFormat = int MiscExportGridMode = int MiscExportTitleMode = int MiscPixels = int MiscSelectionMode = int MiscSortDirection = int MiscSortType = int MiscTableCellStyle = int MiscTableTitleMode = int # Mapping of Objective-C selectors to Java methods. selector -border:compareSlots:: = compareSlots -border:compareSlots::info: = compareSlots -border:deselectSlot: = deselectSlot -border:deselectSlotsWithTags: = deselectSlotsWithTags -border:deselectSlots: = deselectSlots -border:drawSlot: = drawSlot -border:drawSlotTitle: = drawSlotTitle -border:insertSlot: = insertSlot -border:moveSlot:toSlot: = moveSlotToSlot -border:physicalToVisual: = physicalToVisual -border:removeSlot: = removeSlot -border:selectSlot: = selectSlot -border:selectSlot:byExtendingSelection: = selectSlot -border:selectSlotsWithTags: = selectSlotsWithTags -border:selectSlotsWithTags:byExtendingSelection: = selectSlotsWithTags -border:selectSlots: = selectSlots -border:selectSlots:byExtendingSelection: = selectSlots -border:setAutoSortSlots: = setAutoSortSlots -border:setCursorSlot: = setCursorSlot -border:setDraggableSlots: = setDraggableSlots -border:setFirstVisibleSlot: = setFirstVisibleSlot -border:setLastVisibleSlot: = setLastVisibleSlot -border:setMaxUniformSizeSlots: = setMaxUniformSlotSize -border:setMinUniformSizeSlots: = setMinUniformSlotSize -border:setModifierDragSlots: = setModifierDragSlots -border:setSizeableSlots: = setSizeableSlots -border:setSlot:autosize: = setSlotAutosize -border:setSlot:cellPrototype: = setSlotCellPrototype -border:setSlot:cellType: = setSlotCellType -border:setSlot:maxSize: = setSlotMaxSize -border:setSlot:minSize: = setSlotMinSize -border:setSlot:representedObject: = setSlotRepresentedObject -border:setSlot:size: = setSlotSize -border:setSlot:sizeable: = setSlotSizeable -border:setSlot:sortDirection: = setSlotSortDirection -border:setSlot:sortFunction: = setSlotSortFunction -border:setSlot:sortType: = setSlotSortType -border:setSlot:tag: = setSlotTag -border:setSlot:title: = setSlotTitle -border:setSlotOrder: = setSlotOrder -border:setSlotOrderFromString: = setSlotOrder -border:setSlotSizes: = setSlotSizes -border:setSlotSizesFromString: = setSlotSizes -border:setSlotSortVector: = setSlotSortVector -border:setSlotTitleMode: = setSlotTitleMode -border:setSlotTitlesOn: = setSlotTitlesOn -border:setSlotTitlesSize: = setSlotTitlesSize -border:setUniformSizeSlots: = setUniformSizeSlots -border:slotAdjustedSize: = slotAdjustedSize -border:slotAtPosition: = slotAtPosition -border:slotCellPrototype: = slotCellPrototype -border:slotCellType: = slotCellType -border:slotDraggedFrom:to: = slotDraggedToSlot -border:slotIsAutosize: = slotIsAutosize -border:slotIsSelected: = slotIsSelected -border:slotIsSizeable: = slotIsSizeable -border:slotIsSorted: = slotIsSorted -border:slotIsVisible: = slotIsVisible -border:slotMaxSize: = slotMaxSize -border:slotMinSize: = slotMinSize -border:slotPosition: = slotPosition -border:slotRepresentedObject: = slotRepresentedObject -border:slotResized: = slotResized -border:slotSize: = slotSize -border:slotSortDirection: = slotSortDirection -border:slotSortFunction: = slotSortFunction -border:slotSortReversed: = slotSortReversed -border:slotSortType: = slotSortType -border:slotTag: = slotTag -border:slotTitle: = slotTitle -border:slotWithRepresentedObject: = slotWithRepresentedObject -border:slotWithTag: = slotWithTag -border:sortSlot: = sortSlot -border:visualToPhysical: = visualToPhysical -builtinValidRequestorForSendType:returnType: = builtinValidRequestorForTypes -builtinWriteSelectionToPasteboard:types: = builtinWriteSelectionToPasteboardOfTypes -canEdit:atRow:column: = canEditAtLocation -cellIsSelectedAtRow:column: = cellIsSelectedAtLocation -doRetireCell:atRow:column: = doRetireCellAtLocation -doReviveCell:atRow:column: = doReviveCellAtLocation -doubleValueAtRow:column: = doubleValueAtLocation -edit:atRow:column: = editAtLocation -editCellAtRow:column: = editCellAtLocation -editIfAble:atRow:column: = editIfAbleAtLocation -floatValueAtRow:column: = floatValueAtLocation -intValueAtRow:column: = intValueAtLocation -moveRow:toRow: = moveRowToRow -retireCell:atRow:column: = retireCellAtLocation -reviveCell:atRow:column: = reviveCellAtLocation -setColumn:autosize: = setColumnAutosize -setColumn:cellPrototype: = setColumnCellPrototype -setColumn:cellType: = setColumnCellType -setColumn:maxSize: = setColumnMaxSize -setColumn:minSize: = setColumnMinSize -setColumn:representedObject: = setColumnRepresentedObject -setColumn:size: = setColumnSize -setColumn:sizeable: = setColumnSizeable -setColumn:sortDirection: = setColumnSortDirection -setColumn:sortFunction: = setColumnSortFunction -setColumn:sortType: = setColumnSortType -setColumn:tag: = setColumnTag -setColumn:title: = setColumnTitle -setRow:autosize: = setRowAutosize -setRow:cellPrototype: = setRowCellPrototype -setRow:cellType: = setRowCellType -setRow:maxSize: = setRowMaxSize -setRow:minSize: = setRowMinSize -setRow:representedObject: = setRowRepresentedObject -setRow:size: = setRowSize -setRow:sizeable: = setRowSizeable -setRow:sortDirection: = setRowSortDirection -setRow:sortFunction: = setRowSortFunction -setRow:sortType: = setRowSortType -setRow:tag: = setRowTag -setRow:title: = setRowTitle -stateAtRow:column: = stateAtLocation -stringValueAtRow:column: = stringValueAtLocation -superValidRequestorForSendType:returnType: = superValidRequestorForTypes -tableScroll:abortEditAtRow:column: = tableScrollAbortEditAtLocation -tableScroll:allowDragOperationAtRow:column: = tableScrollAllowDragOperationAtLocation -tableScroll:border:slotPrototype: = tableScrollSlotPrototype -tableScroll:border:slotTitle: = tableScrollSlotTitle -tableScroll:canEdit:atRow:column: = tableScrollCanEditAtLocation -tableScroll:canWritePboardType: = tableScrollCanWritePboardType -tableScroll:cellAtRow:column: = tableScrollCellAtLocation -tableScroll:doubleValueAtRow:column: = tableScrollDoubleValueAtLocation -tableScroll:draggingSourceOperationMaskForLocal: = tableScrollDraggingSourceOperationMask -tableScroll:edit:atRow:column: = tableScrollEditAtLocation -tableScroll:floatValueAtRow:column: = tableScrollFloatValueAtLocation -tableScroll:getIncrementalSearchColumn: = tableScrollGetIncrementalSearchColumn -tableScroll:imageForDragOperationAtRow:column: = tableScrollImageForDragOperationAtLocation -tableScroll:intValueAtRow:column: = tableScrollIntValueAtLocation -tableScroll:preparePasteboard:forDragOperationAtRow:column: = tableScrollPreparePasteboardForDragOperationAtLocation -tableScroll:readSelectionFromPasteboard: = tableScrollReadSelectionFromPasteboard -tableScroll:retireAtRow:column: = tableScrollRetireAtLocation -tableScroll:retireCell:atRow:column: = tableScrollRetireCellAtLocation -tableScroll:reviveAtRow:column: = tableScrollReviveAtLocation -tableScroll:reviveCell:atRow:column: = tableScrollReviveCellAtLocation -tableScroll:setStringValue:atRow:column: = tableScrollSetStringValueAtLocation -tableScroll:shouldDelayWindowOrderingForEvent: = tableScrollShouldDelayWindowOrderingForEvent -tableScroll:stateAtRow:column: = tableScrollStateAtLocation -tableScroll:stringForPboardType: = tableScrollStringForPboardType -tableScroll:stringValueAtRow:column: = tableScrollStringValueAtLocation -tableScroll:tagAtRow:column: = tableScrollTagAtLocation -tableScroll:titleAtRow:column: = tableScrollTitleAtLocation -tableScroll:validRequestorForSendType:returnType: = tableScrollValidRequestorForTypes -tableScroll:writeSelectionToPasteboard:types: = tableScrollWriteSelectionToPasteboardOfTypes -tagAtRow:column: = tagAtLocation -titleAtRow:column: = titleAtLocation # Default mappings of Objective-C selectors to overloaded Java methods. selector -exportTableScroll: = exportTableScroll -exportTableScroll:toFilename: = exportTableScroll -makeCellsPerformSelector: = makeCellsPerformSelector -makeCellsPerformSelector:selectedOnly: = makeCellsPerformSelector -makeCellsPerformSelector:with: = makeCellsPerformSelector -makeCellsPerformSelector:with:selectedOnly: = makeCellsPerformSelector -makeCellsPerformSelector:with:with: = makeCellsPerformSelector -makeCellsPerformSelector:with:with:selectedOnly: = makeCellsPerformSelector -selectColumn: = selectColumn -selectColumn:byExtendingSelection: = selectColumn -selectColumnsWithTags: = selectColumnsWithTags -selectColumnsWithTags:byExtendingSelection: = selectColumnsWithTags -selectColumns: = selectColumns -selectColumns:byExtendingSelection: = selectColumns -selectRow: = selectRow -selectRow:byExtendingSelection: = selectRow -selectRowsWithTags: = selectRowsWithTags -selectRowsWithTags:byExtendingSelection: = selectRowsWithTags -selectRows: = selectRows -selectRows:byExtendingSelection: = selectRows -setColumnOrder: = setColumnOrder -setColumnOrderFromString: = setColumnOrder -setColumnSizes: = setColumnSizes -setColumnSizesFromString: = setColumnSizes -setRowOrder: = setRowOrder -setRowOrderFromString: = setRowOrder -setRowSizes: = setRowSizes -setRowSizesFromString: = setRowSizes # Exposed class interfaces. class MiscExporter = org.misckit.yellow.application.TableScroll.Exporter +commonInstance -exportTableScroll: -exportTableScroll:toFilename: -getColumnExportGridMode -getColumnExportTitleMode -getExportFormat -getRowExportGridMode -getRowExportTitleMode constructor -init -setColumnExportGridMode: -setColumnExportTitleMode: -setExportFormat: -setRowExportGridMode: -setRowExportTitleMode: @{ // Output format. public static final int FORMAT_ASCII_FIXED = 0; public static final int FORMAT_ASCII_TAB = 1; public static final int FORMAT_ASCII_DELIMITED = 2; public static final int FORMAT_DBF = 3; // Title style. public static final int TITLES_OFF = 0; public static final int TITLES_ON = 1; public static final int TITLES_WRAP = 2; public static final int TITLES_TRUNCATE = 3; // Grid style. public static final int GRID_OFF = 0; public static final int GRID_LINE = 1; public static final int GRID_SPACE = 2; @} class MiscTableCell = org.misckit.yellow.application.TableScroll.Cell -backgroundColor protected -bgColor +defaultBackgroundColor +defaultFont +defaultSelectedBackgroundColor +defaultSelectedTextColor +defaultTextColor -drawInteriorWithFrame:inView: -drawWithFrame:inView: protected -fgColor -font -highlight:withFrame:inView: constructor -init constructor -initImageCell: constructor -initTextCell: -isOpaque -isSelected -owner -ownerDraw -selectedBackgroundColor -selectedTextColor -setBackgroundColor: -setFont: -setOwner: -setOwnerBackgroundColor: -setOwnerDraw: -setOwnerFont: -setOwnerSelectedBackgroundColor: -setOwnerSelectedTextColor: -setOwnerTextColor: -setSelected: -setSelectedBackgroundColor: -setSelectedTextColor: -setTag: -setTextColor: -setUseOwnerBackgroundColor: -setUseOwnerFont: -setUseOwnerSelectedBackgroundColor: -setUseOwnerSelectedTextColor: -setUseOwnerTextColor: -tableScroll:retireAtRow:column: -tableScroll:reviveAtRow:column: -tag -textColor -useOwnerBackgroundColor -useOwnerFont -useOwnerSelectedBackgroundColor -useOwnerSelectedTextColor -useOwnerTextColor class MiscTableScroll = org.misckit.yellow.application.TableScroll -abortEditing -action -addColumn -addRow -addSlot: -autoSortColumns -autoSortRows -autoSortSlots: -backgroundColor -border:compareSlots:: -border:deselectSlot: -border:deselectSlots: -border:deselectSlotsWithTags: -border:drawSlot: -border:drawSlotTitle: -border:insertSlot: -border:moveSlot:toSlot: -border:physicalToVisual: -border:removeSlot: -border:selectSlot: -border:selectSlot:byExtendingSelection: -border:selectSlots: -border:selectSlots:byExtendingSelection: -border:selectSlotsWithTags: -border:selectSlotsWithTags:byExtendingSelection: -border:setAutoSortSlots: -border:setCursorSlot: -border:setDraggableSlots: -border:setFirstVisibleSlot: -border:setLastVisibleSlot: -border:setMaxUniformSizeSlots: -border:setMinUniformSizeSlots: -border:setModifierDragSlots: -border:setSizeableSlots: -border:setSlot:autosize: -border:setSlot:cellPrototype: -border:setSlot:cellType: -border:setSlot:maxSize: -border:setSlot:minSize: -border:setSlot:representedObject: -border:setSlot:size: -border:setSlot:sizeable: -border:setSlot:sortDirection: -border:setSlot:sortType: -border:setSlot:tag: -border:setSlot:title: -border:setSlotOrder: -border:setSlotOrderFromString: -border:setSlotSizes: -border:setSlotSizesFromString: -border:setSlotSortVector: -border:setSlotTitleMode: -border:setSlotTitlesOn: -border:setSlotTitlesSize: -border:setUniformSizeSlots: -border:slotAdjustedSize: -border:slotAtPosition: -border:slotCellPrototype: -border:slotCellType: protected -border:slotDragged:toSlot: -border:slotIsAutosize: -border:slotIsSelected: -border:slotIsSizeable: -border:slotIsSorted: -border:slotIsVisible: -border:slotMaxSize: -border:slotMinSize: -border:slotPosition: -border:slotRepresentedObject: protected -border:slotResized: -border:slotSize: -border:slotSortDirection: protected -border:slotSortReversed: -border:slotSortType: -border:slotTag: -border:slotTitle: -border:slotWithRepresentedObject: -border:slotWithTag: -border:sortSlot: -border:visualToPhysical: -bufferCount -builtinCanWritePboardType: -builtinReadSelectionFromPasteboard: -builtinRegisterServicesTypes -builtinStringForPboardType: -builtinValidRequestorForSendType:returnType: -builtinWriteSelectionToPasteboard:types: -canEdit:atRow:column: -canWritePboardType: -cellAtRow:column: -cellFrameAtRow:column: -cellIsSelectedAtRow:column: -cellWithRepresentedObject: -cellWithTag: -changeFont: -clearColumnSelection -clearCursor -clearCursorColumn -clearCursorRow -clearCursorSlot: -clearRowSelection -clearSelection -clearSlotSelection: -clickedCell -clickedColumn -clickedRow -clickedSlot: -color -columnAdjustedSize: -columnAtPosition: -columnCellPrototype: -columnCellType: -columnIsAutosize: -columnIsSelected: -columnIsSizeable: -columnIsSorted: -columnIsVisible: -columnMaxSize: -columnMinSize: -columnOrder -columnOrderAsString -columnPosition: -columnRepresentedObject: -columnsAreSorted -columnSize: -columnSizes -columnSizesAsString -columnSortDirection: -columnSortType: -columnSortVector -columnTag: -columnTitle: -columnTitleMode -columnTitlesHeight -columnTitlesOn -columnWithRepresentedObject: -columnWithTag: -compareColumns:: -compareRows:: -constrainSize -copy: -cornerTitle -cursorColumn -cursorRow -cursorSlot: -cut: -dataDelegate +defaultBackgroundColor +defaultFont +defaultSelectedBackgroundColor +defaultSelectedTextColor +defaultTextColor -delegate -deselectAll: -deselectColumn: -deselectColumns: -deselectColumnsWithTags: -deselectRow: -deselectRows: -deselectRowsWithTags: protected -didBecomeFirstResponder protected -didResignFirstResponder -disableCursor -documentClipRect -doIncrementalSearch:column: -doRetireCell:atRow:column: -doReviveCell:atRow:column: -doubleAction -doubleTarget -doubleValueAtRow:column: -draggableColumns -draggableRows -draggableSlots: -drawCellAtRow:column: -drawsClippedText -drawColumn: -drawColumnTitle: -drawRow: -drawRowTitle: -edit:atRow:column: -editCellAtRow:column: -editIfAble:atRow:column: -empty -emptyAndReleaseCells -enableCursor -finishEditing -firstVisibleColumn -firstVisibleRow -firstVisibleSlot: -floatValueAtRow:column: -font -getPageFooter -getPageHeader -hasColumnSelection -hasMultipleColumnSelection -hasMultipleRowSelection -hasMultipleSlotSelection: -hasRowSelection -hasSlotSelection: -hasValidCursorColumn -hasValidCursorRow -hasValidCursorSlot: -incrementalSearch: constructor -init constructor -initWithFrame: -insertColumn: -insertRow: -intValueAtRow:column: -isCursorEnabled -isEditing -isEnabled -isLazy -isTrackingMouse private -javaLocationForPoint: private -javaLocationOfCell: private -javaLocationOfCellWithRepresentedObject: private -javaLocationOfCellWithTag: private -javaNextEditLocation private -javaNextEditLocationInDirection: private -javaPreviousEditLocation -keyDown: -lastVisibleColumn -lastVisibleRow -lastVisibleSlot: -makeCellsPerformSelector: -makeCellsPerformSelector:selectedOnly: -makeCellsPerformSelector:with: -makeCellsPerformSelector:with:selectedOnly: -makeCellsPerformSelector:with:with: -makeCellsPerformSelector:with:with:selectedOnly: -maxUniformSizeColumns -maxUniformSizeRows -maxUniformSizeSlots: -minUniformSizeColumns -minUniformSizeRows -minUniformSizeSlots: -modifierDragColumns -modifierDragRows -modifierDragSlots: -moveColumn:toColumn: -moveRow:toRow: -numberOfColumns -numberOfRows -numberOfSelectedColumns -numberOfSelectedRows -numberOfSelectedSlots: -numberOfSlots: -numberOfVisibleColumns -numberOfVisibleRows -numberOfVisibleSlots: -print: -readSelectionFromPasteboard: -registerServicesTypes -removeColumn: -removeRow: -renewRows: -representedObject -resumeEditing -retireCell:atRow:column: -reviveCell:atRow:column: -rowAdjustedSize: -rowAtPosition: -rowCellPrototype: -rowCellType: -rowIsAutosize: -rowIsSelected: -rowIsSizeable: -rowIsSorted: -rowIsVisible: -rowMaxSize: -rowMinSize: -rowOrder -rowOrderAsString -rowPosition: -rowRepresentedObject: -rowsAreSorted -rowSize: -rowSizes -rowSizesAsString -rowSortDirection: -rowSortType: -rowSortVector -rowTag: -rowTitle: -rowTitleMode -rowTitlesOn -rowTitlesWidth -rowWithRepresentedObject: -rowWithTag: -scrollCellToVisibleAtRow:column: -scrollColumnToVisible: -scrollRowToVisible: -scrollSelectionToVisible -selectAll: -selectAllColumns -selectAllRows -selectAllSlots: -selectColumn: -selectColumn:byExtendingSelection: -selectColumns: -selectColumns:byExtendingSelection: -selectColumnsWithTags: -selectColumnsWithTags:byExtendingSelection: -selectedBackgroundColor -selectedCell -selectedColumn -selectedColumns -selectedColumnTags -selectedRow -selectedRows -selectedRowTags -selectedSlot: -selectedSlots: -selectedSlotTags: -selectedTextColor -selectionChanged -selectionMode -selectRow: -selectRow:byExtendingSelection: -selectRows: -selectRows:byExtendingSelection: -selectRowsWithTags: -selectRowsWithTags:byExtendingSelection: -selectsByRows -sendAction -sendAction:to: -sendAction:to:forAllCells: -sendActionIfEnabled -sendDoubleAction -sendDoubleActionIfEnabled -setAction: -setAutoSortColumns: -setAutoSortRows: -setBackgroundColor: -setColor: -setColumn:autosize: -setColumn:cellPrototype: -setColumn:cellType: -setColumn:maxSize: -setColumn:minSize: -setColumn:representedObject: -setColumn:size: -setColumn:sizeable: -setColumn:sortDirection: -setColumn:sortType: -setColumn:tag: -setColumn:title: -setColumnOrder: -setColumnOrderFromString: -setColumnSizes: -setColumnSizesFromString: -setColumnSortVector: -setColumnTitleMode: -setColumnTitlesHeight: -setColumnTitlesOn: -setCornerTitle: -setCursorColumn: -setCursorRow: -setDataDelegate: -setDelegate: -setDoubleAction: -setDoubleTarget: -setDraggableColumns: -setDraggableRows: -setDrawsClippedText: -setEnabled: -setFirstVisibleColumn: -setFirstVisibleRow: -setFont: -setLastVisibleColumn: -setLastVisibleRow: -setLazy: -setMaxUniformSizeColumns: -setMaxUniformSizeRows: -setMinUniformSizeColumns: -setMinUniformSizeRows: -setModifierDragColumns: -setModifierDragRows: -setPageFooter: -setPageHeader: -setRepresentedObject: -setRow:autosize: -setRow:cellPrototype: -setRow:cellType: -setRow:maxSize: -setRow:minSize: -setRow:representedObject: -setRow:size: -setRow:sizeable: -setRow:sortDirection: -setRow:sortType: -setRow:tag: -setRow:title: -setRowOrder: -setRowOrderFromString: -setRowSizes: -setRowSizesFromString: -setRowSortVector: -setRowTitleMode: -setRowTitlesOn: -setRowTitlesWidth: -setSelectedBackgroundColor: -setSelectedTextColor: -setSelectionMode: -setSelectsByRows: -setSizeableColumns: -setSizeableRows: -setTag: -setTarget: -setTextColor: -setUniformSizeColumns: -setUniformSizeRows: -sizeableColumns -sizeableRows -sizeableSlots: -sizeToCells -sizeToFit -slotOrder: -slotOrderAsString: -slotsAreSorted: -slotSizes: -slotSizesAsString: -slotSortVector: -slotTitleMode: -slotTitlesOn: -slotTitlesSize: -sortColumn: -sortColumns -sortRow: -sortRows -sortSlots: -stateAtRow:column: -stringForNSStringPboardType -stringForNSTabularTextPboardType -stringForPboardType: -stringValueAtRow:column: -suspendEditing -tag -tagAtRow:column: -target -textColor -textDidBeginEditing: -textDidChange: -textDidEndEditing: -textShouldBeginEditing: -textShouldEndEditing: -titleAtRow:column: -totalHeight -totalSize: -totalWidth -uniformSizeColumns -uniformSizeRows -uniformSizeSlots: -validRequestorForSendType:returnType: -writeSelectionToPasteboard:types: @top{ import com.apple.yellow.application.*; class TableScrollPrivate extends NSScrollView { static { String s; NSDictionary d = NSBundle.mainBundle().infoDictionary(); boolean useNullSecurity = false; boolean addLibraryPaths = false; s = (String)d.objectForKey( "MiscTableScrollUseNullSecurityManager" ); if (s != null) useNullSecurity = s.equalsIgnoreCase( "Yes" ); s = (String)d.objectForKey( "MiscTableScrollAddLibrarySearchPaths" ); if (s != null) addLibraryPaths = s.equalsIgnoreCase( "Yes" ); if (useNullSecurity) { try { com.apple.security.NullSecurityManager. installSystemSecurityManager(); } catch (Exception e) {} } if (addLibraryPaths) { NSArray dirs = NSPathUtilities.searchPathForDirectoriesInDomains( NSPathUtilities.LibraryDirectory, NSPathUtilities.AllDomainsMask, true ); if (dirs != null) { final String sep = java.io.File.separator; java.util.Enumeration e = dirs.objectEnumerator(); while (e.hasMoreElements()) NSRuntime.addPathToLibrarySearchPaths( (String)e.nextElement() + sep + "Frameworks" + sep + "MiscTableScroll.framework" + sep + "Resources" ); } } } protected TableScrollPrivate() { super(); } protected TableScrollPrivate( boolean shouldAllocate, int objcObject ) { super( shouldAllocate, objcObject ); } } @} @{ // Notifications. public static final String TableScrollSlotDraggedNotification = "MiscTableScrollSlotDraggedNotification"; public static final String TableScrollSlotSortReversedNotification = "MiscTableScrollSlotSortReversedNotification"; public static final String TableScrollSlotResizedNotification = "MiscTableScrollSlotResizedNotification"; public static final String TableScrollChangeFontNotification = "MiscTableScrollChangeFontNotification"; public static final String TableScrollFontChangedNotification = "MiscTableScrollFontChangedNotification"; public static final String TableScrollBackgroundColorChangedNotification = "MiscTableScrollBackgroundColorChangedNotification"; public static final String TableScrollSelectedBackgroundColorChangedNotification = "MiscTableScrollSelectedBackgroundColorChangedNotification"; public static final String TableScrollSelectedTextColorChangedNotification = "MiscTableScrollSelectedTextColorChangedNotification"; public static final String TableScrollTextColorChangedNotification = "MiscTableScrollTextColorChangedNotification"; public static final String TableScrollWillPrintNotification = "MiscTableScrollWillPrintNotification"; public static final String TableScrollDidPrintNotification = "MiscTableScrollDidPrintNotification"; public static final String TableScrollWillPrintPageHeaderNotification = "MiscTableScrollWillPrintPageHeaderNotification"; public static final String TableScrollWillPrintPageFooterNotification = "MiscTableScrollWillPrintPageFooterNotification"; public static final String TableScrollWillEditNotification = "MiscTableScrollWillEditNotification"; public static final String TableScrollDidEditNotification = "MiscTableScrollDidEditNotification"; public static final String TableScrollDidBecomeFirstResponderNotification = "MiscTableScrollDidBecomeFirstResponderNotification"; public static final String TableScrollDidResignFirstResponderNotification = "MiscTableScrollDidResignFirstResponderNotification"; // Slot size restrictions. public static final int MIN_PIXELS_SIZE = 10; public static final int MAX_PIXELS_SIZE = 0x7FFF0000; // Borders. public static final int BORDER_COLUMN = 0; public static final int BORDER_ROW = 1; // Title mode. public static final int TITLE_NONE = 0; public static final int TITLE_NUMBER = 1; public static final int TITLE_ALPHA = 2; public static final int TITLE_CUSTOM = 3; public static final int TITLE_DELEGATE = 4; // Selection mode. public static final int SELECTION_MODE_LIST = 0; public static final int SELECTION_MODE_RADIO = 1; public static final int SELECTION_MODE_HIGHLIGHT = 2; // Cell style. public static final int CELL_TYPE_TEXT = 0; public static final int CELL_TYPE_IMAGE = 1; public static final int CELL_TYPE_BUTTON = 2; public static final int CELL_TYPE_CALLBACK = 3; // Sort direction. public static final int SORT_ORDER_ASCENDING = 0; public static final int SORT_ORDER_DESCENDING = 1; // Sort type. public static final int SORT_STRING_CASE_INSENSITIVE = 0; public static final int SORT_STRING_CASE_SENSITIVE = 1; public static final int SORT_INT = 2; public static final int SORT_UNSIGNED_INT = 3; public static final int SORT_TAG = 4; public static final int SORT_UNSIGNED_TAG = 5; public static final int SORT_FLOAT = 6; public static final int SORT_DOUBLE = 7; public static final int SORT_SKIP = 8; public static final int SORT_TITLE_CASE_INSENSITIVE = 9; public static final int SORT_TITLE_CASE_SENSITIVE = 10; public static final int SORT_STATE = 11; public static final int SORT_UNSIGNED_STATE = 12; // Methods which return a two-value (row,column) Location. public static class Location implements Cloneable { public final int row, column; private Location( int r, int c ) { row = r; column = c; } public String toString() { return "(" + row + "," + column + ")"; } public Object clone() throws CloneNotSupportedException { return super.clone(); } } private Location interpretRange( NSRange r ) { if (r.location() >= 0) return new Location( r.location(), r.length() ); return null; } public Location nextEditLocation( boolean forward ) { return interpretRange( this.javaNextEditLocationInDirection(forward) ); } public Location nextEditLocation() { return interpretRange( this.javaNextEditLocation() ); } public Location previousEditLocation() { return interpretRange( this.javaPreviousEditLocation() ); } public Location locationForPoint( NSPoint point ) { return interpretRange( this.javaLocationForPoint(point) ); } public Location locationOfCell( NSCell cell ) { return interpretRange( this.javaLocationOfCell(cell) ); } public Location locationOfCellWithRepresentedObject( Object obj ) { return interpretRange( this.javaLocationOfCellWithRepresentedObject(obj) ); } public Location locationOfCellWithTag( int tag ) { return interpretRange( this.javaLocationOfCellWithTag(tag) ); } @} # Exposed category interfaces. category NSObject(MiscTableScrollDataCell) = org.misckit.yellow.application.TableScroll.DataCell -tableScroll:retireAtRow:column: -tableScroll:reviveAtRow:column: category NSObject(MiscTableScrollDataSource) = org.misckit.yellow.application.TableScroll.DataSource -tableScroll:cellAtRow:column: -tableScroll:doubleValueAtRow:column: -tableScroll:floatValueAtRow:column: -tableScroll:intValueAtRow:column: -tableScroll:retireCell:atRow:column: -tableScroll:reviveCell:atRow:column: -tableScroll:setStringValue:atRow:column: -tableScroll:stateAtRow:column: -tableScroll:stringValueAtRow:column: -tableScroll:tagAtRow:column: -tableScroll:titleAtRow:column: -tableScrollBufferCount: category NSObject(MiscTableScrollDelegate) = org.misckit.yellow.application.TableScroll.Delegate -tableScroll:abortEditAtRow:column: -tableScroll:allowDragOperationAtRow:column: -tableScroll:border:slotPrototype: -tableScroll:border:slotTitle: -tableScroll:canEdit:atRow:column: -tableScroll:canWritePboardType: -tableScroll:draggingSourceOperationMaskForLocal: -tableScroll:edit:atRow:column: -tableScroll:imageForDragOperationAtRow:column: -tableScroll:preparePasteboard:forDragOperationAtRow:column: -tableScroll:readSelectionFromPasteboard: -tableScroll:shouldDelayWindowOrderingForEvent: -tableScroll:stringForPboardType: -tableScroll:validRequestorForSendType:returnType: -tableScroll:writeSelectionToPasteboard:types: -tableScrollIgnoreModifierKeysWhileDragging: -tableScrollRegisterServicesTypes: category NSObject(MiscTableScrollNotifications) = org.misckit.yellow.application.TableScroll.Notifications -tableScrollBackgroundColorChanged: -tableScrollChangeFont: -tableScrollDidBecomeFirstResponder: -tableScrollDidEdit: -tableScrollDidPrint: -tableScrollDidResignFirstResponder: -tableScrollFontChanged: -tableScrollSelectedBackgroundColorChanged: -tableScrollSelectedTextColorChanged: -tableScrollSlotDragged: -tableScrollSlotResized: -tableScrollSlotSortReversed: -tableScrollTextColorChanged: -tableScrollWillEdit: -tableScrollWillPrint: -tableScrollWillPrintPageFooter: -tableScrollWillPrintPageHeader: MiscKit2/Palettes/MiscTableScroll/Notes/ 40755 1750 1750 0 6757227301 20305 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/Notes/BUGS.txt100444 1750 1750 13112 6757227347 21731 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll BUGS // $Id: BUGS.txt,v 1.50 99/06/29 07:12:08 sunshine Exp $ //----------------------------------------------------------------------------- BUGS: ---- - MiscTableScroll's -sizeToFit does not correctly compute sizes for larger or non-standard fonts (probably fonts and sizes which do not have bitmap representations). The size that it computes is usually too short and sometimes too narrow. When it is too narrow, characters get clipped from the right edge of the text. When it is too short the line isn't drawn at all on account of the fact that, by default, TableScroll does not draw partial lines. This is a particularly serious problem. It affects both the NextStep and OpenStep TableScrolls, though the OpenStep version is even more seriously affected since the size returned by -[NSCell cellSize] has even less tolerance than that returned by NextStep's -[Cell calcCellSize:]. This problem essentially makes -sizeToFit a complete washout in any application where the user has control over the font. - When cell editing is in progress in an autosized column, if the window is resized then the column may change size along with it, but the field editor remains at the old size. We forgot to handle this case even though we correctly handle the case where the column is resized manually by the user during editing. - While editing is in progress, if you drag the column being edited, the behavior is inconsistent: 1) If the column was entirely on-screen when the dragging commenced, then the column which you drag around displays the "new" value. 2) If the column was only partially visible when dragging commenced, then the column which you drag around displays the "old" value. This is a consequence of the dragging code which grabs the on-screen image if the column was wholly visible, else draws the slot into the drag cache if it wasn't wholly visible. I (Eric) am not sure as to the correct way to fix this problem. It would be nicest if the "new" value was displayed in the dragged column, however the architecture of TableScroll makes this pretty difficult to achieve. It is also worth noting that the OPENSTEP version has this problem (dragging the "old" value around) in both cases (at least in eager mode). - Text on row titles is still getting clipped when dragged if the row wasn't entirely visible when dragging was initiated. - Incorrect coordinate transformations draw_view() in MiscTableView is *not* transforming the PostScript graphics state. It is doing the appropriate transformation calculations, but never actually applies them to the gstate. Eric took a different approach to drawing a slot for the drag-cache than Pawl's draw_view(). Eric tried using -copyPSCodeInside:to: to create the drag cache. It automatically includes all the subviews (good) and doesn't have the problem with row title-cell text being clipped which draw_view() has (good). However, it thinks it is creating PostScript code for a printer, so it uses printer fonts instead of screen fonts (bad), and it doesn't draw images with alpha (transparency) because it thinks it's going to a printer (bad). - Problems with dragging columns zarnuk says: Dropping a column in the same location that it was dragged out of causes the column to be re-drawn, but does not draw the subviews. - Auto-scrolling broken. Eric broke auto-scrolling during mouse tracking by giving the cell a chance to track the mouse first. Apparently one should be clipping the tracking rect to the visible rect so that the cell's tracking loop exits if the mouse is dragged past the edge of the visible rect. This way TableView will be able to scroll the view as appropriate. (I have noticed this same bug in other classes in the AppKit.) - Resizing 'autosize' slots generates truly bizarre behavior. Needs to be fixed. - TableCell's "extra" data may have alignment problems on HPPA and Sparc. FIXED: ----- v140 - As implemented, MiscTableBorder::clearCursor() is ineffectual. It sends -1 to setCursor() which ignores the invalid (-1) value. v139 - Fixed v1 bug: MiscTableBorder.cc:1094: failed assertion `0 <= x' - Fixed v1 bug: MiscTableBorder.cc:1094: failed assertion `x < num_slots' The AppKit supports up to 3 pixels of slop on a mouseDown event when deciding whether to make it a multi-click event -- even when that is outside the bounds of the receiving view. Our code assumed that a mouseDown event had to be inside the bounds of the view. This bug corrupted the selection set by placing out-of-range values in the selection set. v138 - Calling -lockFocus inappropriately: TableScroll calls -lockFocus in a number of places without first checking -canDraw. This is a bug. My (Eric) very brief inspection located three instances (-drawCellAt::, drawRow:, drawCol:). I suspect that there are more. We need to examine each case individually and fix the broken ones. This is a crasher. - Error "lockFocus sent to a view which is not in a window". Very simple to reproduce: 1) Inspect a table scroll in IB. 2) Type in a column/row title and press tab/enter. Eric sez: This is also caused by using -lockFocus without checking -canDraw. v135 - Fixed v130 bug: The up/down arrow buttons on the inspector were broken. v134 - Current editing updates are lost if the user resizes or drags a column while editing is in progress. MiscKit2/Palettes/MiscTableScroll/Notes/DLL-EXPORT.txt100444 1750 1750 11532 6757227347 22627 0ustar sunshinesunshine//----------------------------------------------------------------------------- // Objective-C++ Compiler DLL Symbol Export Bug on YellowBox and OpenStep 4.2 // $Id: DLL-EXPORT.txt,v 1.1 99/06/14 18:22:58 sunshine Exp $ //----------------------------------------------------------------------------- This file describes a bug in the Objective-C++ compiler for Windows which affects YellowBox and OpenStep 4.2. The bug manifests itself when exporting symbols via __declspec(dllexport). The symptom of the bug is that some static file-global variables may not get initialized. This bug was discovered when notifications were added to MiscTableScroll in version 140.1 and exported via MISC_TABLE_SCROLL_EXPORT which is defined in MiscTableTypes.h. MiscTableScroll promptly began to crash whenever it tried sorting rows (a common occurrence). Investigation quickly revealed that the COMPARE_FUNCS[] array in MiscTableScrollSort.M was filled with NULL pointers. Other affected variables were AMERICAN_DATE and DBF_TYPE_CODE[] in MiscExporterDBF.M. Here is a simple example program which demonstrates the bug: // bugtest.c #include extern __declspec(dllexport) char const* const FOOBAR; static int func1(int n) { return n; } static int func2(int n) { return n * n; } typedef int (*FuncType)(int); static FuncType const FUNCTIONS[] = { func1, func2 }; int main() { printf( "FUNCTIONS[1] = %p\n", FUNCTIONS[1] ); fflush( stdout ); printf( "FUNCTIONS[1](3) = %d\n", FUNCTIONS[1](3) ); return 0; } char const* const FOOBAR = "FOOBAR"; When this program is compiled with the Objective-C compiler, it works correctly: C:\> gcc -ObjC -O -fno-common -Wmost -o bugtest bugtest.c C:\> bugtest FUNCTIONS[1] = 00401008 FUNCTIONS[1](3) = 9 However, when using the Objective-C++ compiler, it crashes: C:\> gcc -ObjC++ -O -fno-common -Wmost -o bugtest bugtest.c C:\> bugtest FUNCTIONS[1] = 00000000 >>> crash <<< The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read". It is clear that the FUNCTIONS[] array is not being initialized and is, in fact, filled with NULL pointers. A peek at the generated assembly explains what is going on. This is an excerpt from the very bottom of the Objective-C++ assembly output: .section .drectve , "s" .ascii " -export:_FOOBAR,data\0" .stabs "FUNCTIONS:S39=ar1;0;1;36",38,0,8,_FUNCTIONS .align 4 _FUNCTIONS: .long _func1__Fi .long _func2__Fi The compiler has incorrectly inserted ".section .drectve" prior to the definition of FUNCTIONS[]. Or stated another way, the compiler has incorrectly located the FUNCTIONS[] array inside the .drectve section. Normally FUNCTIONS[] should be part of the .const section which precedes the .drectve section. The Microsoft documentation states that the .drectve section contains directives for the linker but no actual code or data. The linker actually discards this section before creating the final output file. It is clear, therefore, that the definition of the FUNCTIONS[] array should definitely not be part of the .drectve section, and that it was placed there as a result of a compiler bug. It is interesting to note that simple textual re-organization of the test file eliminates the problem. For instance, if the definition of FOOBAR is moved so that it immediately follows its declaration, then the bug disappears. extern __declspec(dllexport) char const* const FOOBAR; char const* const FOOBAR = "FOOBAR"; Now the generated assembly looks like this: .section .drectve , "s" .ascii " -export:_FOOBAR,data\0" .const .align 4 _FUNCTIONS: .long _func1__Fi .long _func2__Fi One can observe that the compiler has now correctly placed the FUNCTIONS[] table in the .const section where it belongs. Unfortunately manual textual manipulations are risky since there is no obvious pattern which one should follow to avoid the bug. Likewise, such manipulations place an unnecessary burden on the developer who must remember that the problem may pop up at any time, and must also guess when and where such preventive measures should be taken. A better solution is to only use the __declspec(dllexport) directive in files which do not define any other variables at all. In this manner, the compiler should not be able to botch any other important information. Stated more precisely, one or more files should be devoted specifically to the task of informing the Microsoft linker as to which symbols should be exported from the DLL. The declaration and definition of the symbols should be placed elsewhere, as appropriate. This is the approach which was ultimately used for the MiscTableScroll framework. Please consult MiscTableTypes.h and MiscTableScrollSymbols.M to see this technique in practice. MiscKit2/Palettes/MiscTableScroll/Notes/DR2-MOSXS.txt100444 1750 1750 10040 6757227347 22464 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MacOS/X Server versus Rhapsody DR2 // $Id: DR2-MOSXS.txt,v 1.1 99/06/30 09:35:39 sunshine Exp $ //----------------------------------------------------------------------------- This file describes problems encountered while porting MiscTableScroll v140.1 from Rhapsody DR2 to MacOS/X Server for Mach. - Conflicting prototypes for objc_msgSendSuper_stret() & objc_msgSend_stret(). Problem: MiscTableScrollJava.h manually declares these two prototypes since /System/Java/Headers/java-vm.h as shipped with DR2 neglects to do so for PPC targets. As of MacOS/X Server, the declaration of these functions changed (the argument list differs), they have moved to objc-runtime.h, and they are correctly declared for PPC targets. To avoid conflicting prototype errors, MiscTableScrollJava.h must only declare the prototypes on DR2, but not on MacOS/X Server. Resolution: MiscTableScrollJava.h should be conditionalized to only declare these prototypes on DR2. Consequently, it now tests for existence of the macro __NeXT__ which exists in the DR2 compilation environemnt, but not MacOS/X Server. - JavaScrollDir crashes with message sent to freed object. Problem: The example program launches, loads, and displays a directory window correctly but crashes upon activation of the window. The crash results from an attempt by the AppKit to dispatch -respondsToSelector: to a freed object. This crash does not occur on DR2. While researching the problem, I ran across an item in the latest Java release notes on the Apple web site which mentioned that the behavior of the Objective-C to Java bridge changed with regards to pure Java objects which have only a "weak" reference on the Objective-C side. As of MacOS/X Server, the bridge now deallocates the Objective-C proxy object of weakly referenced pure Java objects if the object's proxy has not been retained on the Objective-C side. Weakly referenced objects are actually a common occurrence. For instance a pure Java object as an NSWindow's delegate, is one example. The NSWindow merely maintains a pointer to the Java object's Objective-C proxy, but does not retain it. Consequently the bridge thinks that the proxy is unused and should be deallocated. On DR2, these weakly referenced proxy objects were merely leaked. In the case of JavaScrollDir, DirWindow is a pure Java object which is both the NSWindow's and MiscTableScroll's delegate. Consequently, DirWindow's Objective-C proxy gets freed by the bridge even though NSWindow and MiscTableScroll are still pointing at it. Resolution: To fix the problem some entity on the Objective-C side must retain DirWindow's Objective-C proxy object. A simple way to do this is to store a reference to the DirWindow in an NSArray. As it turns out, DirWindow already maintains a list of active DirWindow objects, named OPEN_DIRS, in a Java Vector object. Simply converting OPEN_DIRS from a Vector to an NSArray will fix the problem by creating a strong reference on the Objective-C side. - InterfaceBuilder complains about obsolete method calls. Problem: InterfaceBuilder complains that the MiscTableScroll connection inspector is making obsolete calls to -outletsOfClass: and -actionsOfClass:. It suggests using -outletNamesOfClass: and -actionNamesOfClass: instead. This warning does not appear on DR2. Evidence strongly indicates that the newer methods have the same input and return types, thus indicating that the methods were simply renamed in MacOS/X Server for clarity. Resolution: Send the new messages to InterfaceBuilder if it responds to them; otherwise send the old. This can be accomplished with a simple test via -respondsToSelector:. Thus the code will work in all environments and choose the most appropriate message for each case. Note that these methods seem not to be published in the InterfaceBuilder headers. Therefore, the connection inspector must manually declare the prototypes (which was the case with the older methods, as well). MiscKit2/Palettes/MiscTableScroll/Notes/HISTORY.txt100444 1750 1750 240057 6757227350 22356 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll HISTORY // $Id: HISTORY.txt,v 1.92 99/06/29 08:00:18 sunshine Exp $ //----------------------------------------------------------------------------- v0.140 1999/06/29 04:15 EDT sunshine@sunshineco.com Synchronized with MiscTableScroll v140.1 for OpenStep. Updated copyright and contact information in README. Renamed abbreviated titles on MiscExporterAccessoryView from "Col Titles" and "Col Grid" to "Column Title" and "Column Grid", respectively. Rewrote MiscExporterAccessoryView so that layout of controls is dynamic, based upon their sizes, rather than using hard-coded coordinates. Removed unused -getWidth: from MiscTableViewPrint.M. Converted the slot list on the inspector from a matrix of buttons to a TableScroll (via CustomView). Reworked the color setting controls on the TableScroll inspector nib. Now provides user with ability to preview color selections by providing two text field which adopt the chosen colors for text and background. One text field previews selected cells, and the other unselected. This configuration also makes better use of window real-estate. Fixed bug: MiscTableBorder::clearCursor() was broken, making it a no-op. Cleaned up Makefile.preamble and Makefile.postamble files. Added copyright notices. Documentation of prototype for -reviveCell:at:: was slightly botched. Documentation for these methods was botched: -changeFont: -setColTitleMode: -setColTitlesHeight: -setRowTitleMode: -borderTitleMode: -tableScroll:highlightBackgroundColorChangedTo: -tableScroll:highlightTextColorChangedTo: -tableScroll:textColorChangedTo: The method summary for -border:slotSortReversed: in the documentation was missing. Documentation for -border:setUniformSizeSlots: made invalid claim about not being able to resize uniform size slots. This restriction was lifted in v133. Explained the for-all-cells portion of -sendAction:to:forAllCells: in documentation. The meaning of "forAllCells" is not clear by itself. Added new "Delegates" section to documentation. Fixed bug: -[MiscTableScroll changeFont:] was sending -convertFont: directly to the shared FontManager rather than "sender" as documented. Now sends the message to "sender", which is assumed to be a FontManager or similarly capable object. Fixed bug: -[MiscTableScroll sizeToFit] wasn't taking intercell grid into account when computing slot sizes. Added facility which informs TableScroll when the TableView changes first responder status. Added methods -didBecomeFirstResponder and -didResignFirstResponder which subclasses may override as needed. TableView sends these messages to TableScroll at the appropriate times. Added delegate methods -tableScrollDidBecomeFirstResponder: and -tableScrollDidResignFirstResponder: Documented new methods. Fixed bug: MiscTableTypes.h was incorrectly exporting MiscDefaultCompareSlotFunc(). It failed to use extern "C" which meant that the name was mangled and inaccessible to Objective-C clients. Significant updates to mcgh2misc scripts. Now filters output of Emacs batch processing so that only important messages are displayed instead of spewing an enormous amount of output. Source and target directories can now be specified on the command line and default to sane values if omitted. Removed requirement that script be run from within MiscTableScroll source directory. No longer copies RCS directories to target. Now files are checked out from source RCS directories directly into target locations. Added usage statement and -help option. Now optionally copies MiscKit license files, if present, into target. Simplified EXPAND() which was doing unnecessary work. WHATS_LOCKED() now takes the directory as an argument instead of assuming the current working directory. Simplified save and rename logic in lisp code. Now disables Emacs auto-save and backup-file creation. Renamed lisp functions and variables to better reflect their actual meaning. Added copyright notice. No longer converts tabs from 8 to 4 characters. This change was motivated by a personal desire to distribute code formatted in a fashion which I prefer. Thus this project will no longer adhere to the MiscKit guideline for 4-character tabs. Created an English.lproj directory and moved the nib files into it. Updated GNUmakefile to handle English.lproj via SRCDIRS. Cleaned up IBConnector.h and added copyright notice. Synchronized pack.sh with OpenStep pack.sh by merging in freeze.sh. Ported back to NextStep 3.2. Had to add -I. directive to OTHER_CFLAGS in Makefile.preamble since the 3.2 makefiles do not recognize the -I directives which are specified via Project Builder in NextStep 3.3. Textually re-ordered inline functions in MiscTableBorder.h to appease compiler which could not deal with isSortable() calling getSortFunc() and getSortType() before they were declared. Compiler complained about signed vs. unsigned comparisons and assignments in MiscExporterDBF.M, MiscSparseSet.cc, MiscTableBorderSel.cc, MiscTableScrollISearch.M, MiscTableScrollSort.M. Changed Files: - freeze.sh * GNUmakefile * IBConnector.h * Makefile * Makefile.{preamble|postamble} * MiscDelegateFlags.{h|cc} * MiscExporterAccessoryView.M * MiscExporterDBF.M * MiscSparseSet.cc * MiscTableBorder.h * MiscTableBorderSel.cc * MiscTableConnector.h * MiscTableScroll.{h|M|rtf} * MiscTableScrollInspector.{h|M|nib} * MiscTableScrollISearch.M * MiscTableScrollSort.M * MiscTableTypes.h * MiscTableViewCursor.M * MiscTableViewPrint.M * MiscTableTypes.h * mcgh2misc.{el|sh} * pack.sh * PB.project * README.rtf + English.lproj > *.nib --> English.lproj/*.nib v0.139 1998/05/11 20:42 EDT zarnuk@zarnuk.com Fixed the MiscTableBorder.cc:1094: failed assertion `0 <= x' bug. Fixed the MiscTableBorder.cc:1094: failed assertion `x < num_slots' bug. These bugs were caused by the fact that the AppKit allows 0-3 pixels' worth of slop on multi-click events -- even when the new location is outside the bounds of the view that recieved the first mouse-down event. Changed Files: * MiscTableView.M * MiscBorderView.M v0.138 1998/03/31 04:07 EST sunshine@sunshineco.com Changes to MiscTableScroll.rtf: - Fixed typographical errors - Clarified -editCellAt:: - Described return value of -borderSetSlotSizes: - Fixed -getNext:editRow:andCol: to refer to -canEdit:at:: - Added missing descriptions for: canEdit:at:: editIfAble:at:: edit:at:: textDidChange: textDidEnd:endChar: textDidGetKeys:isEmpty: textWillChange: textWillEnd: MiscTableBorder::write() was declaring same variable twice. Removed junk/unused -[MiscTableScroll calcWidths:heights:maxW:maxH:]. Removed excess #import's from MiscTableScrollIO.M. MiscTableBorder's setMinUniformSize() & setMaxUniformSize() were declared as returning a value, but neglected to do so. Removed a useless 'if' statement from -[MiscTableScroll border:setSlotOrder:]. Fixed bugs: Methods failed to check -canDraw before sending -lockFocus: -[MiscTableScroll drawCellAt::] -[MiscTableScroll drawCol:] -[MiscTableScroll drawRow:] -[MiscTableScroll drawSlotTitle:] Added -[MiscTableView shouldDelayWindowOrderingForEvent:] to control window ordering during dragging-source operations. Added delegate method -tableScroll:shouldDelayWindowOrderingForEvent: and documented it. README modifications: - Updated email address. - Updated copyright notice. Fixed #import ("..." vs. <...>) in MiscTableViewCursor.M so that it compiles as part of the MiscKit distribution. Fixed v134 bug: -[MiscBorderView mouseDown:] was calling -suspendEditing when border view was used to change selection. This allowed the slot selection to change while allowing editing to continue. This resulted in a high "surprise factor" and was inconsistent in these ways: a) slot selection via MiscTableView always ends editing, b) broke the relation where the slot containing the edit session is the one *and* only selected slot, c) potentially broke the relationship where -clicked{Row|Col} return the slot containing the edit session (for instance, [Lazy]ScrollDir requires this relationship to be true). Fixed mcgh2misc.sh to deal correctly with new MiscAlign{Left|Center|Right} images in MiscTableScrollInspector.nib. Changed Files: * MiscBorderView.M * MiscDelegateFlags.{h|cc} * MiscTableBorder.h * MiscTableBorderIO.cc * MiscTableScroll.{h|M|rtf} * MiscTableScrollIO.M * MiscTableViewCursor.M * MiscTableViewDrag.M * mcgh2misc.sh * README.rtf v0.137 1998/02/25 13:49 EST zarnuk@zarnuk.com border:setSlotOrder: now accepts a null pointer to "unsort" the slots. Changed Files: * MiscTableScroll.{M|rtf} * MiscTableBorder.{cc|h} v0.136 1998/02/19 16:36 EST zarnuk@zarnuk.com Now uses NXOrderStrings for sorting and incremental search. Changed Files: * MiscTableScrollSort.M * MiscTableScrollISearch.M v0.135 1998/02/16 17:53 EST zarnuk@zarnuk.com Fixed v130 bug: inspector -- up/down buttons stopped working. Changed Files: * MiscTableBorder.{cc|h} * MiscTableScrollInspector.M v0.134 1997/12/22 13:50 EST zarnuk@zarnuk.com Fixed bug: current editing updates were lost if columns were dragged or resized while editing was in progress. Added suspendEditing/resumeEditing. Eliminated delegate -tableScroll:edit:at:: methods. Changed Files: * MiscBorderView.M * MiscDelegateFlags.{cc|h} * MiscTableScroll.{h|M|rtf} * MiscTableScrollEdit.M + MiscTracer.{cc|h} v0.133 1997/11/22 13:24 EST zarnuk@zarnuk.com Fixed v1 bug: bad range calculations in MiscBorderView.M Fixed v132 bug: Inspector was not calling sizeToCells after adding rows. Added -sizeToFit. Eliminated the forced requirement for scrollers. Added documentation for the printing methods. Various minor corrections to the documentation. Turned on autoSortRows in the palette. Removed obsolete declaration from MiscTableBorder.h. Combined sort-dir and sort-type in MiscTableBorder. Now passes the version to MiscTableBorder::read(). Bumped the version, new storage layout. Broke-off IO routines from massive MiscTableScroll.M file. Eliminated ill-defined and un-implemented "expands-to-data" feature. I finally implemented this, and discovered that the resulting behavior was horrible. Eliminated constrain-min methods. Functionality retained, but it is now implicit based on the presence or absence of auto-size slots. Their presence was always a requirement anyway. Eliminated constrain-max functionality and methods entirely. This was introduced for symmetry with constrain-min, but it made the resizing calculations in MiscTableBorder considerably more complicated, and could only work by making slots smaller than the sizes specified by the user, and was generally a pretty artificial feature all together. We have never used it at mcgh. Eliminated {get|set}{Min|Max}Total{Size|Height|Width} methods. Unnecessary when auto-sizing is automatic. The internal -constrainSize method, which was called from all over the place was clobbering those values with the values from the size of the frame anyway. Renamed MiscNullView.{h|M} -> MiscCornerView.{h|M} Added -cornerTitle, -setCornerTitle:. User can now resize uniform-size borders. Added -{get|set}{Min|Max}UniformSize{Slots|Rows|Cols} methods. Added -{get|set}DrawClippedText. Corner view now prints. RCS files are now tagged by pack.sh Added cell-alignment control to inspector. Changed Files: + freeze.sh * Makefile + MiscAlign{Center|Left|Right}.tiff * MiscBorderView.M + MiscCornerView.{h|M} * MiscDrawList.{cc|h} - MiscNullView.{h|M} * MiscTableBorder.{cc|h} * MiscTableBorderIO.cc * MiscTableScroll.rtf * MiscTableScroll.{h|M} * MiscTableScrollInspector.{h|M|nib} + MiscTableScrollIO.M * MiscTableScrollPalette.M * MiscTableScrollPrivate.h * MiscTableTypes.h * MiscTableUtil.h * MiscTableView.{h|M} * MiscTableViewPrint.M * pack.sh * PB.project v0.132 1997/11/16 17:58 EST zarnuk@zarnuk.com Restored call to [super tile], but using dummy content view. Renamed MiscTableBorder{_io|_sel}.cc --> *{IO|Sel}.cc Changed Files: * Makefile * MiscTableBorderIO.cc * MiscTableBorderSel.cc * MiscTableScroll.M * PB.project v0.131 1997/11/14 21:22 EST zarnuk@zarnuk.com Fixed printing problems: - orientation (landscape vs. portrait) - pagination (fit vs. auto vs. clip) - centering (horizontal and vertical) - scalingFactor Changed Files: * MiscTableViewPrint.M v0.130 1997/11/14 20:50 EST zarnuk@zarnuk.com Eric: Corrected filenames in README.rtf Restored the executable settings on the shell scripts. Fixed v123 bug -- -border:selectSlot: was infinite recursion. -isSelectable now returns NO when the table is empty. Broke up the massive MiscTableView.M file a little. Broke up the massive MiscTableBorder.cc file somewhat. No longer maintaining so many arrays in visual order in MiscTableBorder. Fixed v1 bug -- -tile was not implemented properly. Fixed v1 bug -- border views were not positioned properly when toggled on. Changed Files: * Makefile * MiscTableBorder.{cc|h} + MiscTableBorder_io.cc + MiscTableBorder_sel.cc * MiscTableScroll.M + MiscTableScrollSel.M * MiscTableView.{h|M} + MiscTableViewCursor.M + MiscTableViewDrag.M + MiscTableViewPrivate.h * MiscTableUtil.h * PB.project * README.rtf * *.sh *********************************************************************** **** MiscKit 2.0.5 Release contains v0.129.1 for OPENSTEP **** *********************************************************************** *********************************************************************** **** MiscKit 2.0.4 Release contains v0.129.1 for OPENSTEP **** *********************************************************************** *********************************************************************** **** MiscKit 1.10.0 Release contains v0.129 for NEXTSTEP **** *********************************************************************** *********************************************************************** **** Released as MiscTableScroll v129.1 for OPENSTEP on 07/13/1997 **** *********************************************************************** *********************************************************************** **** Released as MiscTableScroll v129 for NEXTSTEP on 07/13/1997 **** *********************************************************************** v0.129 1997/07/11 17:49 EDT sunshine@sunshineco.com Fixed wording of "Errors" section. Added a *FIXME* to MiscTableScroll.rtf. Synchronized mcgh2misc with version from OPENSTEP MiscTableScroll v128.1. Fixed wording in README. Changed Files: * MiscTableScroll.rtf * mcgh2misc.sh * README.rtf v0.128 1997/07/01 10:27 EDT sunshine@sunshineco.com Added a README file which details how to build & install the palette. Added missing descriptions for -borderTitlesSize:, -colTitlesHeight, and -rowTitlesWidth to documentation. Fixed bug: Delegate messages for text color and highlighted text color were reversed. Was sending one when it should have been sending other. Published and documented the exception code which MiscTableScroll raises upon an assertion failure. For publication as standalone MiscKit palette, added new targets to Makefile.postamble: install_lib, install_headers, install_docs, install_all. Added new variables to Makefile.preamble to support customization of installation locations. Fixed mcgh2misc script to handle new installation variables in Makefile.preamble. Fixed mcgh2misc script so that new README.rtf doesn't get installed as one of PUB_DOCS. Fixed a number of places in documentation where conversion via mcgh2misc results in poor wording, such as: "an MiscTableScroll" --> "an MiscTableScroll". mcgh2misc conversion script now works off of RCS directory rather than copying entire source tree. Can now convert source tree which includes subdirectories (subprojects and language projects). mcgh2misc now makes the converted files read-only. Can now run mcgh2misc in an incremental fashion. Changed Files: * Makefile.{preamble|postamble} * MiscAssert.cc * MiscDelegateFlags.{h|cc} * MiscExporter.rtf * MiscIntList.rtf * MiscTableCell.rtf * MiscTableScroll.rtf * MiscTableTypes.h * mcgh2misc.sh + README.rtf v0.127 1997/06/10 05:58 EDT sunshine@sunshineco.com MiscTableCell is now scrollable by default thus simplifying creation of editable columns. Fixed bug: -[MiscTableCell copyFromZone:] was making an allocation from the wrong zone. Fixed bug: -getRow:col:forPoint: was incorrectly returning 'self' when point was outside of bounds. Now returns 'nil' in this case to be consistent with Matrix. Updated documentation accordingly. Fixed bug: Wasn't grabbing a copy of the cell when editing was started in lazy mode. Was only latching a reference to cell. If any scrolling occurred while editing was in progress (even the scroll-to-visible which happens when editing starts), the contents of the cell could be blasted -- since typically in lazy mode, a single cell is used for all drawing in a column. The cell is now copied, so its contents are valid throughout the duration of the edit session. Fixed bug: Tabbing from cell to cell during editing wasn't adjusting the keyboard cursor -- it was lagging behind. First responder status is now returned to the TableScroll when cell editing ends via the Return key, rather than reverting uselessly to the window. Fixed bug: Keyboard cursor was being unconditionally drawn when -setCursor{Row|Col}: was called -- even if it shouldn't have been (for instance, if the MiscTableScroll was not first responder, or the cursor had been disabled). Fixed bug: Feedback from incremental-search was drawing outside of the MiscTableScroll's frame. Consequently the portion outside of the frame was not getting erased. Added MiscAssert() macro which throws an exception rather than calling abort(). Thus assertion failures can now be caught and logged, unlike the standard assert(). Modified all source code to use this new macro. Did considerable work on all documentation (MiscTableScroll, MiscTableCell, MiscExporter, MiscIntList): - Added missing -getCellFrame:at::. - Added missing -getRow:andCol:forPoint: to method-list. - Fixed broken vertical formatting in method-list (thus reducing vertical size). - Added a "Methods Implemented by Cell Subclasses" section to MiscTableScroll.rtf and moved descriptions of -tableScroll:retireAt:: and -tableScroll:reviveAt:: there from "Methods Implemented by Delegate" since they are not strictly delegate methods. - Removed many more of the really obvious "See Also" entries. - Unified formatting *throughout*. - Synchronized with OPENSTEP version of each of the MiscTableScroll documents in v125.9. The binary-file pack & unpack scripts no longer error out if tiffs or nibs are non-existent and are synchronized with MiscTableScroll v125.9 for OPENSTEP. Rewrote pack.sh script so that it knows about subprojects and lproj directories (so we can now easily localize if preferred). Now synchronized with MiscTableScroll v125.9 for OPENSTEP. Copied unpack.sh from the MiscTableScroll v125.9 for OPENSTEP whichs knows about subprojects and lproj directories and performs the RCS check-out and .uu file unpacking (so we can now easily localize if preferred). Moved build options from Makefile.preamble into PB.project. Changed Files: * Makefile * Makefile.preamble + MiscAssert.{h|cc} * MiscBorderView.M * MiscExporter.rtf * MiscIntList.rtf * MiscLineWrapper.cc * MiscSparseSet.cc * MiscTableBorder.cc * MiscTableCell.{h|M|rtf} * MiscTableScroll.{M|rtf} * MiscTableScrollData.M * MiscTableScrollEdit.M * MiscTableScrollISearch.M * MiscTableScrollSort.M * MiscTableView.M * MiscTableViewPrint.M * pack.sh * pack_binaries.sh * PB.project + unpack.sh * unpack_binaries.sh v0.126 1997/05/04 18:35 EDT zarnuk@zarnuk.com Fixed several errors in the documentation. Fixed some minor compiler warnings. Changed Files: * MiscDelegateFlags.cc * MiscExporterDBF.M * MiscTableScroll.rtf * MiscTableTypes.h * MiscTableView.M v0.125 1997/03/14 01:32 EST zarnuk@zarnuk.com Fixed v121 bug: fonts were not being restored properly in the -[MiscTableCell tableScroll:reviveAt::] method. Optimized the method slightly. Changed Files: * MiscTableCell.{M|rtf} v0.124 1997/02/12 12:58 EST sunshine@sunshineco.com Added clipping back to -[MiscTableView drawSelf::] so that we don't draw outside of the update rectangles passed in. This way we don't clobber subviews. Changed Files: * MiscTableView.M v0.123 1997/02/11 19:11 EST sunshine@sunshineco.com Added selection methods: -border:selectSlot:byExtension: -selectRow:byExtension: -selectCol:byExtension: -border:selectTags:byExtension: -selectRowTags:byExtension: -selectColTags:byExtension: -border:selectSlots:byExtension: -selectRows:byExtension: -selectCols:byExtension: Following methods no longer 'extend' selection: -border:selectSlot: -selectRow: -selectCol: Added deselection methods: -border:deselectSlot: -deselectRow: -deselectCol: -border:deselectTags: -deselectRowTags: -deselectColTags: -border:deselectSlots: -deselectRows: -deselectCols: -deselectAll: Documented all the new methods. Fixed bug: -border:selectSlots: was not checking for valid slots. It was allowing *any* slot to be added to the selection even if non-existent. (Also affected -selectRows: & -selectCols:.) Fixed bug: Although MiscTableScroll was taking autoDisplay into account in -reflectSelection, neither MiscBorderView nor MiscTableView was. Got rid of -reflectSelection in favor of -selectionChanged since their functionality was identical. Updated documentation accordingly. Published and documented -selectedCell. Cleaned up documentation some more. Inlined a use-owner-font check in MiscTableCell's high-frequency -tableScroll:reviveAt:: method. Removed the unused -putImage:atPoint: method from MiscTableViewPrint.M. Removed the unused -tooSmall method in MiscTableViewPrint.M. Fixed bug: MiscTableViewPrint was leaking every single NXImage that its -getImage... methods created. Removed the unnecessary code in MiscTableView's -drawSelf:: which sets up a clipping rect if there are subviews. It was not needed at all since no drawing of subviews occurs inside of -drawSelf::. Fixed bug: MiscDrawList was using the screen-font unconditionally -- even when printing (not drawing to the screen). Fixed bug: The delegate methods for printing -tableScrollWillPrint: and -tableScroll:didPrint: were getting subverted if the -printPSCode: message was sent to the firstResponder rather than the MiscTableScroll itself. (The firstResponder is really the MiscTableView.) This can easily happen if the Print... item is connected to First Responder in IB. Changed Files: * MiscBorderView.{h|M} * MiscDrawList.cc * MiscTableBorder.{h|cc} * MiscTableCell.M * MiscTableScroll.{h|M|rtf} * MiscTableScrollKB.M * MiscTableScrollPrint.M * MiscTableView.{h|M} * MiscTableViewPrint.M v0.122 1997/02/05 07:08 EST sunshine@sunshineco.com Fixed bug: Although setting cell's highlight flag during mouse tracking is fine for eager-mode, it is insufficient for lazy-mode. Fixed by adding 'tracking' flag which is used in lazy-mode to determine when cell should be drawn highlighted. Updated documentation accordingly. Clarified misleading documentation for -trackBy: and -trackingBy. Changed Files: * MiscTableScroll.{h|M|rtf} * MiscTableData.M * MiscTableScrollPrivate.h * MiscTableView.M v0.121 1997/02/04 08:10 EST sunshine@sunshineco.com Fixed some #import/#include statements (<...> vs. "...") so that the palette once again compiles as part of the MiscKit distribution. Updated to reflect which MiscKit versions contain which MiscTableScroll versions. Changed Files: * MiscDrawList.cc * MiscTableCell.M * MiscTableView.M v0.120 1997/02/04 04:56 EST sunshine@sunshineco.com Fixed bug: -[MiscTableView mouseDown:] was not sending the tracker a -mouseUp:atPos: message if the mouse went up during tracking of the cell in which it originally went down. Thus trackers which have non-empty -mouseUp:atPos: methods were malfunctioning. For instance, this broke deselect by shift-click in MiscRadioTracker. (v113 bug) Fixed bug: When deleting the selected slot, MiscTableBorder::deleteAt() wasn't coercing selectedSlot to a valid value. Instead it was just setting it to -1. This was inconsistent with other parts of the object which ensure that selectedSlot *always* points to a selected slot unless there are none in which case it is set to -1. Fixed bug: MiscTableBorder::moveFromTo() was adjusting the selectedSlot before it ensured that said slot was indeed in the selected-slot set. Since setSelectedSlot() calls MiscSparseSet::coerce(), wasn't necessarily set to what it was presumed to be set as. (Switched the order of the statements around to fix it.) Fixed bug: MiscTableBorder::setCount() was incorrectly setting selectedSlot to -1 rather than coercing it to a valid slot in the selection set. Fixed bug: MiscTableBorder::setCount() was incorrectly clearing the selection when it should have been clearning the cursor. Changed Files: * MiscTableBorder.M * MiscTableView.M v0.119 1997/01/23 22:36 EST sunshine@sunshineco.com Combined -setClickedRow: & -setClickedCol: since they are *always* called in combination. Added -resetSelection to MiscTableScroll and published it in MiscTableScrollPrivate.h. It calls -resetSelection in the border and table views. Fixed bug: The "remembered" selection in border and table views was not being taken into account when adding/removing slots. Hence the next selection reflection via -reflectSelection was incorrect. Removed unnecessary loop in MiscSparseSet::shiftDownAt(). Fixed bug: MiscTableScroll's -border:setUniformSizeSlots: was setting the ScrollView's line-scroll amount to 0 if uniform-size was 0. (This had the effect of making the line-scroll buttons inoperable.) Fixed bug: Cell wasn't scrolled to visible when editing was initiated, so it was possible, with tab and shift-tab, to edit a cell which was not visible. Fixed bug: MiscTableView's -getCursorSlot would crash if the border had a selection but not a selected slot. (This can actually happen if the selected slot gets deleted. Maybe TableBorder should be modified so that it *always* has a selected-slot whenever it has a selection?) Changed Files: * MiscSparseSet.cc * MiscTableScroll.M * MiscTableScrollData.M * MiscTableScrollEdit.M * MiscTableScrollPrivate.h * MiscTableScrollSort.M * MiscTableView.M v0.118 1997/01/22 07:02 EST sunshine@sunshineco.com Fixed bug: MiscSparseSet::remove(int) was not taking into account that insertAt() may have called realloc(). This led to (1) writing to memory which had been freed() by realloc(), and (2) failure to set the 'hi' anchor correctly (it was setting 'hi' in the old freed memory rather than at its new location after realloc()). MiscSparseSet::shiftDown() now folds out newly adjacent ranges. MiscSparseSet::dump() now detects corruption. Changed Files: * MiscSparseSet.cc v0.117 1997/01/22 03:38 EST sunshine@sunshineco.com Fixed bug: MiscIntList's std_cmp() was returning 0 when (x > y). Changed Files: * MiscIntList.{h|M} v0.116 1997/01/12 12:30 EST sunshine@sunshineco.com Fixed bug: MiscTableView's mouse tracking code was not taking non-opaque cells into account when [de]highlighting. Fixed bug: Mouse tracking code was not checking for disabled cell. The icon/image is no longer cleared when retiring cells. Change Files: * MiscTableCell.M * MiscTableScrollData.M * MiscTableView.M v0.115 1997/01/10 08:15 EST sunshine@sunshineco.com Fixed bug: MiscTableCell's -tableScroll:reviveAt:: wasn't latching the owner's font in all cases. It would only latch it if the owner changed or if it was not already using owner-font, but not in the most common case where the owner was the same and it was already using owner-font. (Bug introduced in v0.111.) Changed Files: * MiscTableCell.M v0.114 1997/01/06 05:15 EST sunshine@sunshineco.com Fixed bug introduced in v0.112. MiscTableView's -drawCol: was incorrectly referring to row_border rather than col_border. This bug frequently resulted in crashes (assertion: x < num_slots) during column dragging, as well as the failure to redraw a column if it was dropped back where it started (after the "well" was removed). Fixed messed up wording in documentation from v0.113. Fixed bug: mcgh2misc.sh wasn't publishing MiscExporter.h correctly. Changed Files: * MiscTableScroll.rtf * MiscTableView.M * mcgh2misc.sh v0.113 1996/12/30 16:36 EST zarnuk@zarnuk.com Implemented text-cell editing. Added methods to set the sizes of the borders. Fixed bugs in the "clicked" stuff. Changed Files: * Makefile * MiscBorderView.{h|M} * MiscTableBorder.h * MiscTableScroll.{h|M|rtf} + MiscTableScrollEdit.M * MiscTableView.{h|M} * MiscDelegateFlags.{cc|h} * PB.project v0.112 1996/12/17 21:07 EST sunshine@sunshineco.com Added -borderClickedSlot:, -clickedRow, -clickedCol, and -clickedCell. To conform to OpenStep UI guidelines, keyboard-focuser is now drawn as a non-blinking dotted rectangle. Made physicalToVisual() and visualToPhysical() more robust by having them check for invalid slot rather than having to do so manually every place which calls either one. -drawRow:, -drawCol: no longer do any drawing if outside of visible rect. Changed Files: * Makefile * MiscBorderView.M * MiscTableBorder.{h|cc} - MiscTableFocus.{h|M} - MiscTableFocusPS.psw * MiscTableScroll.{h|M|rtf} * MiscTableScrollKB.M * MiscTableScrollPrivate.h * MiscTableView.{h|M} + MiscTableViewPS.psw * PB.project v0.111 1996/12/16 10:26 EST zarnuk@zarnuk.com Improved performance of methods that add/remove rows from the table scroll. Changed Files: * MiscTableCell.{h|M|rtf} * MiscTableScrollData.M v0.110 1996/10/24 22:50 EDT zarnuk@zarnuk.com NOTE: I tagged the RCS files for v109 with "TableScroll-v109", and the ones for v110 with "TableScroll-v110". Added rough-draft, initial version Printing. Still needs work. Fixed bug: slot resized / reversed delegate messages were sending VISUAL coordinates instead of PHYSICAL coordinates. Fixed bug: New public headers (from v109) were not added to mcgh2misc.sh. Changed Files: * Makefile * mcgh2misc.sh * MiscDelegateFlags.{cc|h} * MiscTableScroll.{h|M} + MiscTableScrollPrint.M * MiscTableScrollPrivate.h * MiscTableTypes.h * MiscTableView.{h|M} + MiscTableViewPrint.M * PB.project v0.109 1996/09/25 09:37 EDT zarnuk@zarnuk.com Added exporter. Slot dragging and resizing no longer clobber the selection. Fixed (mostly) drag-cache drawing for row-borders. (v105 bug). Changed Files: * Makefile * MiscBorderView.M + MiscExporter.{h|M|rtf} + MiscExporterAccessoryView.{h|M} + MiscExporterASCII.M + MiscExporterDBF.M + MiscExporterPrivate.h * PB.project v0.108 1996/09/25 05:06 EDT sunshine@sunshineco.com Ripped all image dragging out of TableCell and promoted it to TableView. Can now drag images from non-NX_ICONCELL cells as well. Delegate now has chance to respond to dragging protocol messages -draggingSourceOperationMaskForLocal:, and -ignoreModifierKeysWhileDragging. Updated documentation accordingly. Fixed bugs: Image origin and mouse offset for dragging were being incorrectly computed. Added *temporary* -getCellInside:at:: to avoid places where the callers of -getCellFrame:at:: had to adjust for the border lines manually. This can be removed when the whole cell-frame / intercell spacing issue is finally resolved. Removed the -scroll hack from TableView which TableCell was using during image dragging. Fixed bug: SparseSet::coerce() was accessing array[-1]. Fixed bug: pack.sh was checking in the PACKAGE_NUMBER file *before* the new version number was recorded. pack.sh no longer redundantly includes PACKAGE_NUMBER with the package since that file now exists in the RCS directory. Changed Files: * MiscDelegateFlags.{h|cc} * MiscSparseSet.cc * MiscTableCell.{h|M|rtf} * MiscTableScroll.{h|rtf} * MiscTableView.{h|M} * pack.sh v0.107 1996/09/19 06:37 EDT zarnuk@zarnuk.com Fixed v104 bug: selectTags was not setting selectedSlot. Fixed v104 bug: alignment of the cell at (0,0) was getting clobbered on a mouseDown: Fixed v105 bug: cursor rects were not getting updated when autosort changed. All access to the selection set now goes through the MiscTableBorder object. Restored pre-v104 "selectedSlot" behavior, so that selected_slot always points to a selected slot if any slots are selected. It is only -1 if there are no selected slots. Changed Files: * MiscBorderView.{h|M} * MiscHighlightTracker.M * MiscListTracker.M * MiscMouseTracker.{h|M} * MiscRadioTracker.M * MiscSparseSet.{cc|h} * MiscTableBorder.{cc|h} * MiscTableScroll.M * MiscTableScrollISearch.M * MiscTableScrollPrivate.h * MiscTableScrollSort.M * MiscTableView.{h|M} v0.106 1996/09/13 17:10 EDT zarnuk@zarnuk.com Fixed v104 bug: slot dragged delegate notification message was botched. Fixing bug: borderSelectedSlot: was not checking for a valid selection before mapping an invalid value through the visual to physical map. Changed Files: * MiscDelegateFlags.cc * MiscTableScroll.M v0.105 1996/09/07 12:00 EDT zarnuk@zarnuk.com Restored -border:slotMovedFrom:to: and -border:slotResized: to the public header so that PCSTableScroll will compile again. Added user-sort-direction-toggling. Fixed v104 bug where text was exceeding column width on some wide columns with a lot of text. New line-height calculations, completely point-size based, ignores broken NeXT font bounding box. Font-change behavior is more predictable from the user's standpoint. Fixed drag-cache drawing. Changed Files: * MiscBorderCell.h * MiscBorderView.{h|M} * MiscDelegateFlags.{h|cc} * MiscDrawList.cc * MiscLineWrapper.cc + MiscReverseCursor.tiff + MiscSort{A|De}scend{H|}.tiff * MiscTableBorder.{cc|h} * MiscTableScroll.{h|M|rtf} * MiscTableScrollPrivate.h * MiscTableTypes.h * PB.project * Makefile * Makefile.postamble v0.104 1996/08/20 15:00 EDT sunshine@sunshineco.com Removed "cursor" from SparseSet making it a simple generic (and more widely useful) class. Added notion of selected-slot to TableBorder. This was the old "cursor" from SparseSet. Implemented -selectedCell in TableScroll (for use during mouse-tracking -- see below). TableScroll now gives cells a chance to participate in mouse tracking using standard -trackMouse:inRect:ofView:. TableCell now supports dragging of images directly out of ICON-style cells during mouse tracking. Delegate/dataDelegate can allow/veto dragging, optionally supply the dragging image (vs. using the one in the cell), and provide the actual data for the dragging pasteboard. Documented support of image dragging in TableCell. Documented mouse tracking behavior in TableScroll. Documented new keyboard control added in v0.103. Documented selection modes. Fixed bug: TableConnInspector's -initScroll:numCols: was not returning a value though it had a non-void return type. Fixed bug: Two MiscGeometry were not returning a value when they should have been. Corrected a few casts. Removed deviant semi-colons from -setColSortVector:len:, -setRowSortVector:len:, and -cursorRect:forPos: implementations. Paul added searching methods to IntList. Paul made optimizations to TableBorder's selectTags() method. Fixed pack.sh so that it checks the PACKAGE_NUMBER into RCS (so that the GNUmakefile can include it in the palette). Updated GNUmakefile so that it includes MiscTableConnector.strings and PACKAGE_NUMBER in the palette. Fixed bug: TableScroll's -border:setSlotSizes: was not respecting min/max slot size. Fixed broken next-text chain in inspector nib. Fixed bug: Setting the min-size greater, or the max-size smaller than the current-size in the inspector would crash IB. Fixed bug: TableScroll's border:selectSlot was checking for selection membership using selectedSlot() rather than slotIsSelected(). Fixed bug: Using space to select from within incremental-search was not going through the normal mouse-tracker, and was therefore short- circuiting selection mode. Added cursor for display over draggable slots. Fixed bug: Cursor rectangles were not being clipped to the visible rectangle, which meant that cursor changes would occur when the cursor was not even over the TableScroll. Moved drawing of "intercell" border from TableCell into TableView. (Cells no longer draw a border around them selves.) *NOTE* This drawing code still needs to be optimized. I did nothing more than relocate the code. (Paul optimized it -- see below.) Added -setSelected and -isSelected to TableCell. TableScroll now uses these methods to indicate that cell is part of the current selection rather than overloading the meaning of state and isHighlighted which have their own use during mouse-tracking. Pulled the *private* parts of the TableScroll interface out of TableScroll.h and placed them in the new unpublished TableScrollPrivate.h. Added MiscDelegateFlags which tracks which selectors the delegates respond to. These are determined and cached *once* when the delegate are set up. Updated all code which deals with delegate and dataDeleate to use simplified MiscDelegateFlags interface. Started implementing text editing. *** Paul's changes *** Created the MiscColorList, MiscRectList and MiscRectColorList C++ classes. Eliminated the convoluted selection-update "optimizations" from MiscTableView.M which were not properly implemented; did not result in any noticable improvement in drawing performance; and which prevented the consolidation of the drawing code. Rewrote -[MiscTableView reflectSelection] to group contiguous cells into rectangles for drawing. Rewrote -[MiscTableView drawRect:] to collapse grid and background drawing into fewer operations. Modified MiscTableCell so that -useOwner[Highlight]BackgroundColor makes the cell transparent, so that the individual cells are not painting their individual backgrounds, unless they have custom background colors. Added -ownerDraw and -setOwnerDraw: to MiscTableCell. MiscTableView now checks for -ownerDraw. New drawing mechanism for table view -- way, *way*, *WAY* faster! Added dump() routine to MiscSparseSet. Now propagates -reflectSelection methods even when drawing is disabled. Eliminated a few unnecessary function calls in BorderView. Changed Files: * MiscBorderCell.M * MiscBorderView.M + MiscColorList.{h|cc} + MiscDelegateFlags.{h|cc} + MiscDrawList.{h|cc} * MiscGeometry.h * MiscHighlightTracker.M * MiscIntList.{h|M|rtf} + MiscLineWrapper.{h|cc} * MiscListTracker.M * MiscRadioTracker.M + MiscRectColorList.{h|cc} + MiscRectList.{h|cc} + MiscSlotDragCursor.tiff * MiscSparseSet.{h|cc} * MiscTableBorder.{h|cc} * MiscTableCell.{h|M|rtf} * MiscTableConnInspector.M * MiscTableScrollISearch.M * MiscTableScroll.{h|M|rtf} * MiscTableScrollData.M * MiscTableScrollInspector.{M|nib} + MiscTableScrollPrivate.h * MiscTableScrollSort.M * MiscTableView.{h|M} * PB.project * Makefile * GNUmakefile * pack.sh v0.103 1996/05/05 11:30 EDT sunshine@sunshineco.com Created MiscGeometry which contains geometric types (point, size, rectangle) which are used by borders and know about their orientation. Removed all of the duplicated "type variation" code from BorderView and TableView and replaced with MiscGeometry. Fixed bug: Wasn't considering border orientation during slot resizing modal loop resulting in failure to auto-scroll in many cases when resizing rows. Fixed bug: Connection inspector was leaking connector objects when breaking connections. Fixed bug: Connection inspector was allowing non-target/action connections to First Responder. Fixed bug: Was crashing when trying to archive a connector whose destination was First Responder. Now connection inspector treats First Responder as a special case. Replaced low-level Post Script drawing code with higher level NeXT drawing functions in BorderView. Replaced 8 trips to the Window Server in BorderCell's -drawSelf:inView: with 1 trip by using NXRectFillListWithGrays. Added all manner of keyboard movement commands: page-up, page-down, home, end, left, right -- for both numeric keypad and editing keypad. TableView's -firstVisibleSlot & -lastVisibleSlot now return the first and last *fully* visible slot if possible. (This results in more symmetric and intuitive page-scrolling via the new movement keys.) Fixed problem: Incremental-search was going into modal event loop even if it couldn't add the very first character. Since it couldn't add the first character, there was no feedback indicating that the modal loop was active. For OpenStep conformance, selection of slots with a keyboard event (via the space bar) is treated the same as selection with the mouse. This means that one now has to use the same modifiers with keyboard- based selection as one uses with mouse-based selection. Added alt-space (0x80) in -keyDown: methods to list of keys which perform "selection" since alt-space is now meaningful with new OpenStep conformance. Fixed bug: Was unable to shift-drag in List mode to deselect a range of slots. Changed Files: * MiscBorderCell.M * MiscBorderView.{h|M} + MiscGeometry.{h|cc} * MiscHighlightTracker.{h|M} * MiscListTracker.{h|M} * MiscMouseTracker.{h|M} * MiscRadioTracker.{h|M} * MiscTableConnInspector.M * MiscTableScrollISearch.M * MiscTableScrollKB.M * MiscTableView.M * PB.project * Makefile v0.102 1996/04/29 16:00 EDT zarnuk@zarnuk.com Moved keyDown: out of MiscTableView and into MiscScrollView. IB Connection Inspector no longer pre-selects an action if there is no existing connection. Slot dragged and resized notification messages are now sent to the dataDelegate also. Eliminated separate (DataDelegate) category, since all messages are now sent to both the delegate and the dataDelegate. Fixed bug introduced in v99 -- toggling lazy-mode in IB on non-empty table-scrolls screwed things up. Fixed some trivial bugs in incremental-search. No longer faked out by changes that leave the buff-length unchanged while drawing is disabled. Now treats case-sensitive expand properly. Changed Files: * MiscTableConnInspector.M * MiscTableScroll.{h|M} * MiscTableScrollInspector.M * MiscTableScrollISearch.M + MiscTableScrollKB.M * MiscTableView.{h|M} * PB.project * Makefile v0.101 1996/04/25 22:00 EDT sunshine@sunshineco.com Replaced low-level Post Script code with higher-level (and portable) NXImage code in BorderView which grabs pixels off the screen. Fixed incorrect prototype specification in TableScroll documentation. Added calcCellSize:inRect: to BorderCell. Added visual feedback to incremental search. Changed Files: * MiscBorderCell.M * MiscBorderView.M * MiscTableScroll.rtf * MiscTableScrollISearch.M v0.100 1996/04/25 00:00 EDT zarnuk@zarnuk.com Added incremental search. -[MiscTableView keyDown:] now forwards unrecognized key strokes to the next responder (as it always should have). Slot sort vector now uses one's complement to indicate reversed direction. Setting a slot sort vector now turns off auto-sort. Changed Files: * Makefile * MiscTableScroll.{h|rtf} * MiscTableScrollSort.M + MiscTableScrollISearch.M * MiscTableView.M * PB.project v0.99 1996/04/23 05:00 EDT zarnuk@zarnuk.com Added {get/set}{first/last}Visible{slot/row/col} routines. Cells are now "retired" before being freed in all cases. Reviewed the documentation. Cleared up many FIXME items. Changed Files: * MiscTableScroll.{h|M|rtf} * MiscTableScrollData.M * MiscTableView.{h|M} v0.98 1996/04/23 03:00 EDT sunshine@sunshineco.com Fixed some memory leaks in the connector and connection-inspector code. Reorganized so that all FoundationKit specific code is contained in connection-inspector object file rather than connector file. This allows nibs to be loaded on 3.2 machines (which don't have Foundation Kit). BorderView now always sends action before sending doubleAction to be consistent with TableView. Removed unused -refresh method from BorderView. Changed Files: * MiscBorderView.{h|M} * MiscTableConnector.{h|M} * MiscTableConnInspector.M v0.97 1996/04/13 05:00 EDT zarnuk@zarnuk.com Created custom IB connection inspector, so that doubleTarget and doubleAction: can be set inside of IB now. Added extern "Objective-C" declaration to MiscTableScrollPalette.h Fixed bug: was not setting cursor in MiscSparseSet::add(). This manifested itself by not setting -selectedRow when -selectRow: was called. Fixed bug: -selectRow: was not honoring radio-mode. Fixed bug: -selectRow: was not clearing the selection on the other border. Fixed bug: toggling titles on/off on IB inspector was not properly enabling/disabling slot controls. Changed Files: + IBConnector.h * MiscSparseSet.cc * MiscTableScroll.M * MiscTableScrollPalette.h * MiscTableScrollInspector.M + MiscTableScrollConnector.{h|M|strings} + MiscTableScrollConnInspector.{h|M|nib} + MiscTableRightArrow.tiff + MiscTableDimple.tiff v0.96 1996/03/30 04:00 EST zarnuk@zarnuk.com Applied Eric's changes to the mcgh -> misc conversion scripts. Fixed some comments in MiscTableBorder.cc Fixed bug in MiscSparseSet::getTotalRange() => affected MiscTableBorder::hasMultipleSelection() => affected -[MiscTableScroll borderHasMultipleSelection:] => affected -[MiscTableScroll hasMultiple{Row|Col}Selection:] Totally revamped MiscSparseSet. Operations are simpler and more efficient. Changed Files: * mcgh2misc.sh * MiscTableBorder.cc * MiscSparseSet.{h|cc} v0.95 1996/03/25 22:00 EST zarnuk@zarnuk.com Fixed bug: border:sortSlot: (sortRow:/sortCol:) was off by one position when sorting a slot from a lower-index position to a higher-index position. This was a crasher when the resulting destination index was beyond the last slot. Modified behavior (not really a bug, per se). MiscTableScroll now sends the single-action message immediately before sending the double-action message on a multi-click event. This enables clients that use the single-action message to adjust controls to reflect any changes in the selection between the first click and the second click before dealing with the double-click event. Changed Files: * MiscTableScrollSort.M * MiscTableView.M ************************************************* **** MiscKit 1.9.0 Release contains v0.94 ******* ************************************************* ************************************************* **** MiscKit 1.8.1 Release contains v0.94 ******* ************************************************* ************************************************* **** MiscKit 1.8.0 Release contains v0.94 ******* ************************************************* ************************************************* **** MiscKit 1.7.1 patch-1 contains v0.94 ******* ************************************************* v0.94 1996/02/18 02:00 EST zarnuk@zarnuk.com Fixed bug introduced in last revision. Was skipping slots that had a custom sort function. Changed Files: * MiscTableScrollSort.M v0.93 1996/02/14 06:00 EST zarnuk@zarnuk.com Created subclass of IBPalette, MiscTableScrollPalette. Removed IB-specific stuff from MiscTableScroll.M Fixed bug where reading a non-empty lazy table caused free to crash. Fixed bug where some pop-ups were inappropriately enabled on the inspector even when there were no slots. MiscIntList.h is no longer #import-ed in the MiscTableScroll header. Did another overhaul on sorting. Even faster now. Fixed bug: slotsAreSorted: (rowsAreSorted,colsAreSorted) was not working properly. It was checking the physical order of the slots, not the visual order. Changed Files: + MiscTableScrollPalette.{h|M} * MiscTableBorder.cc * MiscTableScrollInspector.M * MiscTableScroll.nib * MiscTableScroll.{h|M} * MiscTableScrollData.M * MiscTableScrollPB.M * MiscTableScrollSort.M * MiscTableTypes.h * palette.table * PB.project * Makefile ************************************************* **** MiscKit 1.7.1 Release contains v0.92 ******* ************************************************* v0.92 1996/02/11 23:30 EST sunshine@sunshineco.com Fixed bug where -border:setSlot:sortType: was ignoring sort types "case- sensitive title", "case-insensitive title", "state", and "unsigned state". This cause the default -stringValue variation to be used for those slots -- which is clearly incorrect. Row title width is now larger -- large enough to hold 5-digit numbers. (This still needs to be reworked so as to be sizeable and dynamic.) Changed Files: * MiscTableScrollSort.M * MiscBorderView.M v0.91 1996/01/17 05:30 EST sunshine@sunshineco.com Fixed crasher. Drag cache window was being allocated from the border- view's zone even though the cache window is allocated once and never freed (the pointer is kept in a static variable). When the zone got freed that the border-view was in, the pointer ceased to point at valid memory. Changed Files: * MiscBorderView.M v0.90 1996/01/17 02:15 EST sunshine@sunshineco.com Completely rewrote mcgh2misc conversion scripts. They now also (optionally) handle conversion of example applications. Consequently the mcgh2misc scripts were removed from the example directories. Published -changeFont: in MiscTableScroll.h. Added -changeFont: to documentation. Changed Files: * mcgh2misc.{el|sh} * MiscTableScroll.{h|rtf} v0.89 1996/01/16 21:15 EST zarnuk@zarnuk.com Added PACKAGE_NUMBER to "Other Resources" in Project Builder. -[MiscTableScroll free] now calls [self setAutodisplay:NO] at the beginning to avoid drawing while the object is being freed. Eliminated huge amounts of unnecessary drawing while dragging and dropping slots. Set up for dragging slots is much faster now. Published -selectionChanged. Increased the SLOP factor for calculating drop position when dragging. Must now have leading edge at least 4 pixels into destination slot. Changed Files: * Makefile * MiscBorderView.M * MiscTableScroll.{h|M} * PB.project v0.88 1996/01/14 01:00 EST zarnuk@zarnuk.com Fixed errors in MiscIntList documentation. Fixed bug: lazyCellAt:: was not calling the dataDelegate. Fixed bug: Now ignores "-selectAll:" in radio mode. Applied MiscKit 1.7.0 changes to Makefile.{pre|post}depend Make library target now depends on $(OFILES) so it gets rebuilt when individual files are modified. Now using allocFromZone for everything inside MiscTableScroll.M, MiscTableScrollData.M, MiscTableScrollPB.M, MiscBorderView.M, MiscTableView.M, and MiscNullView.M Fixed bug: Was letting user resize slots 10 pixels beyond max size. which resulted in failed assertion `r.size <= r.max_size'. Fixed bug: Was leaking an MiscIntList with each pasteboard copy operation. Eliminated most of the flicker during resizing. Drop location when dragging slots is now determined by the "leading edge" (left edge when dragging to the left, right edge when dragging to the right, and likewise for up/down). Fixed bug where -selectedRow:n would generate an assertion failure if n was out of range. New delegate notification message: -tableScroll:changeFont:to: is sent only in response to user-initiated font changes (-changeFont:), not programmatic changes (-setFont:). setFont: messages are no longer sent to cells when the table is in lazy mode. Revamped set...Color: methods. set...Color: messages are no longer sent to cells when the table scroll is in lazy mode. Added delegate notification messages for color changes: tableScroll:backgroundColorChangedTo:, tableScroll:highlightBackgroundColorChangedTo:, tableScroll:highlightTextColorChangedTo: tableScroll:textColorChangedTo: Fixed bug: was not freeing cells when table-scroll was freed. Renamed emptyAndFree -> emptyAndFreeCells to clarify function and eliminate ambiguity concerning freeing the table scroll itself. Fixed bug: was leaking memory in -read:cells: when the table being read was empty (which it usually is). An allocation request for zero bytes was actually allocating some memory, which never got freed. Isolated sorting support in MiscTableScroll(Sort) category. Fixed bug: was leaking an MiscTableView with every nib load. MiscBorderView now sets the name of the resize cursor images. Totally revamping sorting. Micro-optimization: does not resort if a "skip" slot is dragged. Added: intValueAt::, floatValueAt::, doubleValueAt::, stringValueAt::, tagAt::, titleAt::, stateAt::, and corresponding delegate messages. Added: buffCount, and tableScrollBuffCount:. MiscTableCell no longer allocates the tag dynamically. Finished a first draft of the MiscTableCell documentation. TODO: version for and table-scroll. Changed Files: * Makefile.{pre|post}depend * MiscBorderView.M * MiscIntList.rtf * MiscNullView.M * MiscTableBorder.{cc|h} * MiscTableCell.{h|M|rtf} * MiscTableScroll.{h|M|rtf} * MiscTableScrollData.M + MiscTableScrollSort.M * MiscTableScrollPB.M * MiscTableView.M ************************************************* **** MiscKit 1.7.0 Release contains v0.87 ******* ************************************************* v0.87 1995/12/19 23:15 EST sunshine@sunshineco.com Fixed bug which crashed IB running on Intel whenever a TableScroll was initialized (such as when displaying the palette). The bug "MiscTableBorder.cc:1107: failed assertion `0 <= min_total_size'" was caused by the contentView having -NaN for the y and height values of its frame. It turns out this was because the frame was being initialized with an argument of zero. It was just "luck" that this bug never showed up on the Motorolla. Changed Files: * MiscTableScroll.M v0.86 1995/12/17 15:30 EST zarnuk@zarnuk.com Added -border:sortSlot:, -sortCol:, -sortRow: Corrected spelling mistakes in documentation. Changed Files: * MiscTableScroll.{h|M} * MiscTableScroll.rtf v0.85 1995/11/12 23:30 EST sunshine@sunshineco.com Fixed bugs where TableBorder selection and cursor methods where not taking invalid coordinates into account, and were calling visual/physical conversion methods with bad values. This fixes a problem where selectedSlot() was returning "random" and possibly out-of-range values. Fixed bug in sample code in documentation: -setRowTag: ->> -setRow:tag:. Changed Files: * MiscTableBorder.{h|cc} * MiscTableScroll.rtf v0.84 1995/11/12 07:00 EST sunshine@sunshineco.com Fixed bug in Makefile.postamble where it was unconditionally referring to m68k_obj rather than $(OFILE_DIR). Changed Files: * Makefile.postamble * BUGS.txt v0.83 1995/10/20 13:30 EDT sunshine@sunshineco.com Fixed mcgh2misc.csh so that it creates a "dummy" Makefile in the "dummy" .subproj directory since NeXT's 'make clean' in the parent directory tries to unconditionally perform 'make clean' in the .subproj too. Changed Files: * mcgh2misc.csh v0.82 1995/10/20 04:00 EDT sunshine@sunshineco.com Modified Makefile.preamble and Makefile.postamble to work correctly in the MiscKit environment. Got rid of the scroll_lib target and added $(LIB_NAME) to OTHER_PRODUCT_DEPENDS which builds library automatically whenever the palette is built. Extended mcgh2misc script so that it goes the whole distance now and creates the entire MiscKit directory structure and deletes files which are not part of the MiscKit distribution -- in addition to converting all the files from mcgh to Misc, as it did in the past. PB.project was still referring to old Palette class. BorderView.M was using "" to include TableScroll.h instead of <>. TableBorder.cc was using "" to include TableScroll.h instead of <>. TableScroll.M was using "" to include TableScroll.h and TableCell.h instead of <>. TableScrollData.M was using "" to include TableScroll.h and TableCell.h instead of <>. TableScrollInspector.M was using "" to include TableScroll.h instead of <>. TableView.M was using "" to include TableScroll.h instead of <>. Pack script now has one-line What's Locked built into it instead of relying on external script. Changed Files: * MiscBorderView.M * MiscTableBorder.cc * MiscTableScroll.M * MiscTableScrollData.M * MiscTableScrollInspector.M * MiscTableView.M * Makefile.preamble * Makefile.postamble * mcgh2misc.csh * pack.sh * PB.project * Makefile * BUGS.txt * TODO.txt v0.81 1995/10/19 03:30 EDT sunshine@sunshineco.com Fixed up FontManager messaging so that it is correctly updated whenever the TableScroll is first responder in a running application. Removed unused -startReadIB, -endReadIB, -startWriteIB, and -endWriteIB. Default slot for columns no longer has 'autosize' turned on. Default palette object now has one 'autosize' column only. Fixed inspector inter-locks and a number of bugs. Now controls are enabled/disabled at more appropriate times. Updated mcgh ->> misc conversion scripts so that they convert header inclusions of the form to . Got rid of mcgh specific installation rules from Makefile.preamble and .postamble (such as /Net/devlibhost/...) since that functionality has been moved to GNUmakefile. Changed Files: * MiscTableBorder.cc * MiscTableScroll.M * MiscTableScrollInspector.M * MiscTableView.M * mcgh2misc.{el|csh} * Makefile.preamble * Makefile.postamble * BUGS.txt * TODO.txt v0.80 1995/10/15 23:15 EDT zarnuk@zarnuk.com Made one complete pass through the documentation. Removed unnecessary "make clean" from the pack.sh script. Changed Files: * MiscTableScroll.rtf * pack.sh v0.79 1995/10/15 03:30 EDT zarnuk@zarnuk.com Filled in some more documentation. Changed Files: * MiscTableScroll.rtf v0.78 1995/10/14 17:00 EDT zarnuk@zarnuk.com Fixed bug: -renewRows: was getting cell prototype from wrong column. Added #defines for max values of enumerations in MiscTableTypes.h Added range-checking asserts on all sets/reads of enumerated values in MiscTableBorder.cc Prototype cells are now allocated from the table-scroll's zone. Fixed problem in -[MiscTableCell initTextCell:] where Cell's implementation of -initTextCell: was calling -setFont:, thus turning off "useOwnerFont". Fixed GNUmakefile to add -I. before other include directories. Changed Files: * MiscTableScrollData.M * MiscTableTypes.h * MiscTableBorder.cc * MiscTableCell.M * GNUmakefile v0.77 1995/10/10 11:00 EDT zarnuk@zarnuk.com Now checks, applies auto-sort when a new slot order is set. Changed Files: * MiscTableScroll.M v0.76 1995/10/09 00:30 EDT zarnuk@zarnuk.com Updated documentation quite a bit. Converted (Cell*) return types to (id). Added: - (int) border:(MiscBorderType)b findSlotWithTag:(int)x; - (int) findColWithTag:(int)x; - (int) findRowWithTag:(int)x; - findCellWithTag:(int)x; - findCellWithTag:(int)x row:(int*)row col:(int*)col; - findCell:cell row:(int*)row col:(int*)col; Changed Files: * MiscBorderView.M * MiscTableBorder.{cc|h} * MiscTableScroll.{h|M|rtf} * MiscTableScrollData.M * MiscTableScrollPB.M * MiscTableTypes.h * MiscTableView.M + pack.sh + pack_binaries.sh + unpack_binaries.sh + PACKAGE_NUMBER v0.75 1995/10/07 15:00 EDT zarnuk@zarnuk.com Just packaged up and moved master directory to charm. v0.74 1995/10/05 07:00 EDT zarnuk@zarnuk.com Fixed: -sortSlots: now checks for count > 1 before proceeding. Fixed: MiscTableBorder::find_slot_for_offset() fixed limit-check. Fixed: MiscTableBorder::setPMap() null-checking. Fixed: -selectAll: now sends action to target. Fixed: MiscTableScroll does a flushWindow after in all public draw methods. Added: sendActionIfEnabled / sendDoubleActionIfEnabled. Changed Files: * MiscTableBorder.cc * MiscTableScroll.{h|M} v0.73 1995/10/05 06:00 EDT sunshine@sunshineco.com Fixed bugs where TableView and BorderView wouldn't always draw selection correctly. Both keep a list of cells which were drawn highlighted last time -reflectSelection was called but that "old list" was not being upkept correctly. The "old list" is used to optimize drawing of the selection in -reflectSelection by only re-drawing the cells whose selection state have changed. Specifically, the problems were: 1) -reflectSelection was updating it even if [self canDraw] returned NO and no drawing occured; whereas it should have been updating it only upon YES. 2) The other drawing methods were not updating the "old list" at all. They would draw a cell (and even if its selection state had changed -reflectSelection would think the cell was still drawn with the old state). Paul added a call to constrainSize in -border:setSlotSizes: in TableScroll. Changed Files: * MiscBorderView.M * MiscTableView.M * MiscTableScroll.M v0.72 1995/10/05 04:00 EDT sunshine@sunshineco.com Fixed bug in TableView and BorderView. Mouse tracking was asking for invalid slot when mouse was beyond extent of view This also fixed the bug where the keyboard cursor didn't jump to the correct cell if the mouseUp was off the end of the view (in either direction). Changed Files: * MiscBorderView.M * MiscTableView.M v0.71 1995/10/04 15:30 EDT zarnuk@zarnuk.com Fixed bug introduced in v0.63 where the standard method of resetting the visual / physical mapping was broken. Fixed up MiscTableBorder::setCount(). Now it always resets the visual / physical mapping, even when the new count is the same as the old count. This will make -renewRows: always reset the mapping, not just when the number of rows has changed. Fixed bug in MiscTableBorder::setVMap() -- was not remapping most of the arrays. Changed Files: * MiscTableBorder.{h|cc} * MiscTableScroll.M v0.70 1995/10/03 23:30 EDT zarnuk@zarnuk.com Fixed bug where Inspector was accessing an object IB had already (silently) freed in -textDidEnd:endChar:. Fixed bug where -scrollCellToVisible:: was screwed up. Eric added more to MiscTableCell.rtf documentation. Changed Files: * MiscTableScrollInspector.{h|M} * MiscTableView.M * MiscTableCell.rtf v0.69 1995/10/03 05:10 EDT zarnuk@zarnuk.com Fixed compile bug in MiscIntList.M Changed Files: * MiscIntList.M v0.68 1995/10/03 05:00 EDT sunshine@sunshineco.com Fixed MiscTableCell so that it implements -copyFromZone: instead of -copy. Fixed MiscTableCell so that it makes all of its own memory allocations from [self zone] instead of the default-malloc-zone. Fixed MiscIntList so that it allocates its Storage array from [self zone] instead of the default-malloc-zone. Implemented copyFromZone:, addIntList:, and initFromString: to MiscIntList. Changed Files: * MiscTableCell.{h|M|rtf} * MiscIntList.{h|M|rtf} v0.67 1995/10/03 04:20 EDT sunshine@sunshineco.com Fixed bug in -read: in MiscTableScroll. It was asking for the typed stream class version using [[self class] name] instead of the correct [[MiscTableScroll class] name]. Changed Files: * MiscTableScroll.M v0.66 1995/10/03 04:00 EDT sunshine@sunshineco.com Added MiscIntList documentation. Added preliminary MiscTableCell documentation. Reverted MiscTableScroll class version number back to zero and removed all of the version-conditional code from -read:. MiscTableScroll now archives action and doubleAction. Fixed bug where MiscIntList was unable to parse negative numbers in -readFromString:. Changed Files: + MiscIntList.rtf + MiscTableCell.rtf * MiscTableScroll.M v0.65 1995/10/03 02:30 EDT zarnuk@zarnuk.com Removed unnecessary custom IBPalette subclass. Changed Files: - MiscTableScrollPalette.{h|M} * Makefile * PB.project * palette.table * MiscTableScroll.nib v0.64 1995/10/01 15:30 EDT sunshine@sunshineco.com Fixed mcgh2misc conversion to handle *.psw files. TableCell now has optional explicit settings for highlighted text and background color rather than using the "reverse-video" scheme (which always turns out being extremely ugly). (The default background color is light-gray once again. Paul hatez it but it is much more consistent with the rest of the AppKit.) TableScroll now publishes methods for setting highlighted text and background colors. TableScroll inspector now allows setting of text, background, and highlighted text and background colors in IB. Fixed bug where color was not working in IB. Problem was lazy mode cell was not getting -setOwner:. Tested cell color settings. They work! Cells which have had colors set manually do not inherit the TableScroll's colors. Changed Files: * mcgh2misc.csh * MiscTableCell.{h|M} * MiscTableScroll.{h|M} * MiscTableScrollData.M * MiscTableScrollInspector.{h|M|nib} v0.63 1995/09/30 19:00 EDT zarnuk@zarnuk.com Added support for saving/restoring preferences... Added -readFromString: -writeToString[:size:[canExpand:]] methods to MiscIntList. Changed Files: * MiscIntList.{h|M} * MiscTableBorder.{h|cc} * MiscTableScroll.{h|M} v0.62 1995/09/29 16:00 EDT zarnuk@zarnuk.com Improved cell stuff: - lazy allocation for tags, colors. - useOwner options for font, colors. Changed Files: * MiscTableCell.{h|M} * MiscTableScroll.{h|M} * MiscTableScrollData.M v0.61 1995/09/29 03:00 EDT zarnuk@zarnuk.com Added preliminary color stuff. MiscTableScrollData updates the frame when rows/columns are inserted/deleted. The Misc GNUmakefile mf.{pre/post}depend files in ".." have been evolving quite a bit. The current PB Makefile is probably out of date. Moved Files: /Net/devlibhost/system/include/mcgh/RCS > MiscIntList.h > MiscTableCell.h > MiscTableScroll.h > MiscTableTypes.h Changed Files: * MiscTableCell.{h|M} * MiscTableScroll.{h|M} * MiscTableScrollData.M v0.60 1995/09/27 09:00 EDT zarnuk@zarnuk.com Checked-in source at Misc in: /Net/devlibhost/system/Source/Palettes/MiscTableScroll/RCS Moved Files: /Net/devlibhost/system/include/MiscTableScroll/RCS > MiscIntList.h > MiscTableCell.h > MiscTableScroll.h > MiscTableTypes.h Changed Files: - NOTES.txt <-- Out-of-date and incorrect. - ARCHITECTURE.txt <-- Out-of-date and incorrect. - MiscTableAdaptor.[hM] <-- Please make sure this doesn't come back! * PB.project This is the second time I've deleted it. * Makefile* v0.59 1995/09/27 03:30 EDT sunshine@sunshineco.com Removed the newly obsolete BorderRange class. It was only used by BorderView. SparseSet now uses (int) internally instead of MiscCoord since MiscCoord is going away. Also this makes it a more general-purpose class. Removed MiscCoord to avoid name conflict with class in GISKit. SparseSet now much a much more concerted effort to supply a meaningful "cursor" by taking an active role in manipulating it. In the past it only assured that it had a valid value. This was done so that methods called by the client of TableScroll can execute -selectRowAt:, for instance, and get a meaningful value from -selectedRow. Previously only mouse-tracking would provide a meaningful value for the selection cursor. Removed MiscTableCell protocol. Now MiscTableCell header is public so clients know what messages it responds to. Changed Files: - MiscBorderRange.{h|cc} * MiscBorderView.M * MiscSparseSet.{h|cc} * MiscTableBorder.{h|cc} * MiscTableTypes.h * mcgh2misc.el * MiscTableAdaptor.{h|M} * MiscTableCell.{h|M} * MiscTableScroll.{h|M} * MiscTableScrollData.M * MiscTableView.M v0.58 1995/09/26 08:00 EDT sunshine@sunshineco.com Compiles under NEXTSTEP 3.3 again. TableView no longer stores the keyboard-cursor. Each border now has the notion of a current keyboard-cursor. Is now much more tightly integrated with slot manipulation -- gets updated as slots are manipulated in border. Caught a few more cases in TableBorder where selection needed to get updated as slots are manipulated. Added methods to TableScroll to allow client to control keyboard cursor programatically. Mouse events now turn off flashing keyboard-cursor during tracking. This is much more aesthetically pleasing especially during dragging, sizing, and selection. Flashing keyboard-cursor now jumps to mouse-up location. Keyboard-cursor and mouse tracking in TableView can now be configured to be either row-wise or column-wise (instead of being hard-coded as row-wise only). Keyboard-cursor now draws correctly after scrolling. It is always drawn within the visibleRect of the TableView, but previously it wasn't getting updated upon scrolling (at which time the visibleRect changes). Using -setImage: in TableCell no longer leaves the 'contents' icon name with its last value. Now every effort is made to install a meaningful value or null if necessary. Changed Files: * MiscTableScrollData.M * MiscTableScroll.{h|M} * MiscBorderView.M * MiscTableBorder.{h|cc} * MiscTableView.{h|M} * MiscTableFocus.M * MiscTableCell.M v0.57 1995/09/25 02:30 EDT zarnuk@zarnuk.com Reversed sense of autoSortSlots. '-autoSortRows' now means autoSort *rows*! Likewise for cols. Fixed inspector to reflect this. Fixed -renewRows so that it actually 'retire's cells now. Fixed the -doRetireCell:at:: method to check -respondsTo: before sending messages and to avoid sending -setStringValue: to icon cells. Selection now gets cleared every time -empty or -renewRows: is called. Selection now gets updated when slots are inserted / deleted / moved. Changed Files: * MiscTableScroll.M * MiscTableScrollData.M * MiscTableScrollInspector.M * MiscTableBorder.{h|cc} * MiscSparseSet.{h|cc} v0.56 1995/09/24 01:00 EDT zarnuk@zarnuk.com Selection methods now update the display if isAutodisplay, else setNeedsDisplay:YES. Added -replaceIntAt:with:, -sort, -sortUsing:data: methods to MiscIntList. Added pasteboard / services stuff... Added -border:visualToPhysical:, -border:physicalToVisual: to MiscTableScroll. Changed Files: * PB.project * MiscTableScroll.{h|M} + MiscTableScrollPB.M + MiscIntList.h * MiscIntList.M v0.55 1995/09/24 04:00 EDT sunshine@sunshineco.com Fixed *lib targets in Makefile.postamble so that they depend on the palette target. Renamed MiscTextCell to MiscTableCell. Added icon functionality to MiscTableCell and fixed MiscTableBorder to use the new icon stuff. Speeded up sorting by making a lot of high frequency functions inline. Added MiscTableCell protocol which all the cells returned by TableScroll respect since we use private cell types internally and do not otherwise specify what messages they respond to. All methods throughout have been converted. v0.54 1995/09/21 00:30 EDT zarnuk@zarnuk.com Added revive/retire methods for data-cells. Font gets fixed in revive. v0.53 1995/09/20 15:16 EDT zarnuk@zarnuk.com Fixed more font stuff... Changing the uniformSize of a border now gets the frame updated. Changing the uniformSize of rows updates the line-scroll and page-scroll values. Display is disabled while fonts are being changed. Removed obsolete MiscTableBorderOwner.* Added libMiscTableScroll.a to OTHER_GARBAGE in Makefile.preamble. v0.52 1995/09/20 06:45 EDT sunshine@sunshineco.com Got rid of abbreviations in selMode, setSelMode:, and reflectSel. They are now selectionMode, setSelectionMode:, and reflectSelection, respectively. Updated documentation. Added all manner of -scroll*ToVisible methods to TableScroll. -scrollCellToVisible::, -scrollRowToVisible:, -scrollColToVisible, -scrollSelToVisible. Fixed Makefile.preamble. It was adding -ObjC++ to CFLAGS. This should not be done since it causes problems with PS-wraps, *plus* it should not be necessary since we are using the proper file extensions .M and .cc. The reason this was done was because the NeXT makefile used for palettes (/NextDeveloper/Makefiles/app/specialrules.make) has a bug in it and does not add the -ObjC++ flag to files with .cc extension. I fixed the problem by overriding their buggy implicit rule for .cc in our local Makefile.postamble. Added keyboard control. Rows can be selected via the keyboard in all selection modes, in a sensible manner. Works but still needs a bit tighter integration with other operations such as mouse tracking, changing num-rows, etc. Added TableFocus class for showing keyboard focus. It displays a blinking dashed box. Keyboard controls are: Arrow keys move selection cursor. Space selects/deselects slot and sends action. Return sends doubleAction. Tab sends -selectText to nextText. Shift-Tab sends -selectText to previousText. v0.51 1995/09/19 07:30 EDT zarnuk@zarnuk.com Added -makeCellsPerform: methods. Fixed -sendAction:to:forAllCells: to match behavior documented in Matrix. Added font stuff. Created new archive version. Added support for reading old versions. v0.50 1995/09/18 15:15 EDT zarnuk@zarnuk.com Sorting was not honoring descending direction. -sortSlots: now generates an error if called re-entrantly. Added delegate call-backs for slot-dragged, slot-resized. Implemented auto-sort. v0.49 1995/09/18 07:45 EDT zarnuk@zarnuk.com Fixed some compilation problems. v0.48 1995/09/15 05:30 EDT sunshine@sunshineco.com Mouse down methods in BorderView and TableView now send action and double action. Added programmatic selection interface. Added MiscIntList to support selection of multiple rows/tags at one time. Modified mouse tracking behavior so that it acts more like Matrix upon double-click. That is, now you can double-click-drag and the double- action is sent upon the mouse-up from the double-click-drag. Fixed 'lib' targets in Makefile.postample to use 'cc -ObjC++ -r -nostdlib' instead of 'ld -r' since ld can't handle multiple architectures. Fixed mcgh ->> Misc conversion scripts to also convert Makefile.*. v0.47 1995/09/14 05:45 EDT zarnuk@zarnuk.com Applied Eric's fix to the -findImageNamed: stuff so that the resize cursors can be found at runtime. Added scroll_lib target to the Makefile.postamble to create the library. Added -sizeToCells method. Added sorting. Added -tag and -setTag: to MiscTextCell. v0.46 1995/09/13 13:45 EDT zarnuk@zarnuk.com Fixed compile problem. v0.45 1995/09/13 03:00 EDT zarnuk@zarnuk.com Plugged memory leak in MiscTableBorder::setCount() when shrinking uniform-size borders that had custom titles or prototype cells. Added -setAutodisplay: Added -border:drawSlot: (counter-part of -drawCol:, -drawRow:). Added -border:drawSlotTitle:, -drawColTitle:, -drawRowTitle: Added -[MiscBorderView drawSlot:]. Fixed up these methods to -update the display: -border:setSlot:title: -setBorderTitleMode: -border:setUniformSizeSlots: Converted all 'col' and 'row' methods to use the generic 'slot' methods. Expanded size of 'size' fields in inspector to accomodate new larger max. Implemented -border:getDelegateSlotTitle: -border:getDelegateSlotPrototype: Fixed up implementation of -sendAction methods. Added {get/set}{slot/col/row}data-size methods. v0.44 1995/09/12 15:30 EDT zarnuk@zarnuk.com Fixed assertion failure min_total_size <= max_total_size. Increased MISC_MAX_PIXELS_SIZE from 0x3FFF -> 0x7FFFF0000 (Note that 0x7FFFFFFE -- (LONG_MAX-1) Had problems from the long -> float -> long conversions. This value seems to be working.) Removed fascist policy of always forcing at least one column to autosize. Re-organized {get/set}{min/max} constrained stuff to be more consistent with the rest of the interface. Added {get/set}{min/max} total-size methods. Added get total-size methods. Published -constrainSize method. v0.43 1995/09/11 04:15 EDT zarnuk@zarnuk.com Fixed botched declarations in MiscTableScroll.h. These were all mis-spelled as "Cols" instead of "Rows". - (BOOL) sizeableRows; - (BOOL) draggableRows; - (BOOL) modifierDragRows; Renamed xxxViewOn methods to xxxTitlesOn. Fleshed out most of the documentation. Added -tag, and -setTag: Added stubs for -sendAction, -sendAction:to:, -sendAction:to:forAllCells:, -sendDoubleAction, -cellIsSelected:: Added -constrain {min/max} {width/height} methods. Added constrain {min/max} constrols to the inspector. Columns are now autosize by default. Eric added outlets to palette nib so connections can be made from Table Scroll to other objects in IB. v0.42 1995/09/10 22:00 EDT sunshine@sunshineco.com Finished mcgh ->> Misc conversion scripts. They now handle nibs, tiffs, and the documentation. Incorporated Paul's changes to the documentation. v0.41 1995/09/10 21:00 EDT sunshine@sunshineco.com Converted back to mcgh from Misc. Added scripts to convert to Misc upon demand. The scripts are currently incomplete since they don't deal with nibs or tiffs. v0.40 1995/09/03 06:00 EDT sunshine@sunshineco.com Changed all prefixes to Misc or MISC_ as appropriate in preparation for inclusion in the MiscKit. Modified copyright notices to mention the MiscKit and its license. Fixed up the two public headers TableScroll.h and TableTypes.h so that they can be included by non-C++ clients (in other words, probably *all* MiscKit users) as well as C++ clients. Started writing preliminary class documentation. Added missing -doubleTarget and -setDoubleTarget: methods. Added a TODO file. v0.39 1995/08/30 23:52 EDT sunshine@sunshineco.com Fixed up the icons on the "up" and "down" buttons on the inspector. They now support both color and gray. Added missing "to-do" stuff to the BUG file. Should make a TODO file. v0.38 1995/08/30 22:17 EDT sunshine@sunshineco.com Fixed bug where drawing got all messed up during auto-scroll when resizing columns/row. Problem was that instance-drawing was ON during auto-scroll. Fixed bug where automatic column/row titles were "reordering" themselves automatically after dragging instead of sticking to original columns/rows. Problem was that visual coordinates were being used in auto-generation instead of physical coordinates. Added copyright notice to all files. Normalized comment headers. v0.37 1995/08/27 04:00 EDT sunshine@sunshineco.com Fixed the problem with list-mode selection where it "leaked" selected cells when you dragged the mouse back and forth very quickly. Fixed the problem where the scrollers and document frame were not being updated when a column/row was resized. MiscKit2/Palettes/MiscTableScroll/Notes/JAVA-BUGS.txt100444 1750 1750 16667 6757227351 22465 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll Java BUGS // $Id: JAVA-BUGS.txt,v 1.3 99/07/15 17:24:13 sunshine Exp $ //----------------------------------------------------------------------------- BUGS: ---- - bridget is not using the correct type (NSCell*) in some of the cell retire and revive methods even though the correct type is specified in MiscTableScrollJava.h in a JavaSignatures category. It appears that the failures are in methods that are mostly in the categories, although even this is not entirely true. I do not yet recognize the failure pattern. - Can not create a MAB binary of the MiscTableScrollJava library since Apple did not ship MAB libraries in /usr/lib/java with MacOS/X Server DR2. FIXED: ----- v140.1 - bridget should be, but is not generating unique names for the methods -javaGetNextEditLocation & -javaGetNextEditLocation:. It incorrectly generates the same name javaNextEditLocationNative() which causes an "already defined" error at compile time. This is a bug in the way bridget generates "native" function names for overloaded method names. It is not distinguishing the colon ":" in the second name. [To fix, I renamed -javaGetNextEditLocation: to -javaGetNextEditLocationInDirection:.] - The Java bridge automatically tries to create mappings for -tableScroll:willPrintPage{Header|Footer}:info: and -tableScroll:getISearchColumn: even though these methods are not exposed to the Java side. Unfortunately it tries exporting all three as tableScroll() which causes run-time warnings. [I turned the will-print delegate messages into notifications -- along with others -- which changed their signature. For instance -tableScrollWillPrintPageHeader: which is exposed uniquely to Java.] - JavaScrollDir's DirWindow.java incorrectly implements tableScrollDraggingSourceOperationMaskForLocal() rather than the correct tableScrollDraggingSourceOperationMask(). - In DirWindow.java, it would be more correct to use Object.class when creating the NSSelector for the lock slot's prototype cell's action rather than this.getClass(). - Methods -builtinValidRequestorForSendType:returnType: is not being exposed with the correct name. - These mappings are absent from 'jobs' file: -setColumnOrderFromString: -> setColumnOrder() -setColumnSizesFromString: -> setColumnSizes() -setRowOrderFromString: -> setRowOrder() -setRowSizesFromString: -> setRowSizes() - Mapping for tableScrollAbortEditAtLocation() is mispelled as tableScrollabortEditAtLocation(). Note lower-case "a". - The install target places an errant "com" directory in the main source directory which "clean" does not remove. This directory should not be copied here in the first place. [I hacked around this bug in the system makefiles by forcing COPY_JAVA_CLASSES to invoke a do-nothing target.] - On Windows, 'make clean' is leaving the .lib file laying around. - The bridget tool generates code which complains about discard of "const" when -Wwrite-strings is used. [To fix I no longer enable this warning.] - Under Windows, the stub file generated by bridget for MiscTableScroll has so many exported symbols that the compiler generates a single line of asembly which is so long that it overflows the assembler's input buffer, resulting in a crash. [I fixed this by writing a "sed" script which breaks the line into smaller chunks, and by patching the makefile to generate assembly files from .m files instead of directly generating .o files from .m files.] - When compiling the Java wrapper for ppc on Mach for DR2, the compiler complains about missing prototypes for built-in functions objc_msgSendSuper_stret() and objc_msgSend_stret(). [It turns out that the Apple header java-vm.h is broken and only defines prototypes for these functions on the Windows platform. Consequently, I patched MiscTableScrollJava.h to define them manually on ppc for Mach.] - JavaScrollDir crashes with message sent to freed object. The example program launches, loads, and displays a directory window correctly but crashes upon activation of the window. The crash results from an attempt by the AppKit to dispatch -respondsToSelector: to a freed object. This crash does not occur on DR2. [While researching the problem, I ran across an item in the latest Java release notes on the Apple web site which mentioned that the behavior of the Objective-C to Java bridge changed with regards to pure Java objects which have only a "weak" reference on the Objective-C side. As of MacOS/X Server, the bridge now deallocates the Objective-C proxy object of weakly referenced pure Java objects if the object's proxy has not been retained on the Objective-C side. Weakly referenced objects are actually a common occurrence. For instance a pure Java object as an NSWindow's delegate, is one example. The NSWindow merely maintains a pointer to the Java object's Objective-C proxy, but does not retain it. Consequently the bridge thinks that the proxy is unused and should be deallocated. On DR2, these weakly referenced proxy objects were merely leaked. In the case of JavaScrollDir, DirWindow is a pure Java object which is both the NSWindow's and MiscTableScroll's delegate. Consequently, DirWindow's Objective-C proxy gets freed by the bridge even though NSWindow and MiscTableScroll are still pointing at it. To fix the problem some entity on the Objective-C side needs to retain DirWindow's Objective-C proxy object. A simple way to do this is to store a reference to the DirWindow in an NSArray. As it turns out, DirWindow already maintains a list of active DirWindow objects, named OPEN_DIRS, in a Java Vector object. Simply converting OPEN_DIRS from a Vector to an NSArray fixes the problem by creating a strong reference on the Objective-C side.] - On MacOS/X Server for Mach, the compiler complains about conflicting prototypes for objc_msgSendSuper_stret() & objc_msgSend_stret(). MiscTableScrollJava.h manually declares these two prototypes since /System/Java/Headers/java-vm.h as shipped with DR2 neglects to do so for PPC targets. As of MacOS/X Server, the declaration of these functions changed (the argument list differs), they have moved to objc-runtime.h, and they are correctly declared for PPC targets. To avoid conflicting prototype errors, MiscTableScrollJava.h must only declare the prototypes on DR2, but not on MacOS/X Server. [To fix, it was necessary to conditionalize MiscTableScrollJava.h an #if directive to only declare these prototypes on DR2. To do so required finding a macro which can be used to distinguish between DR2 and MacOS/X Server.] - The Java bridge does not know anything about NSPopUpList which exists in nibs created with OpenStep 4.x. Whenever such a nib is loaded, the bridge complains about the unknown class. Since TableScroll supports OpenStep in addition to MacOS/X Server, the nibs must remain in this format. Fortunately, the nibs still function properly even though the bridge complains about them. Note that MacOS/X Server nibs which contain pop-up buttons do not exhibit this behavior. [To work around this problem, I added a MOSXS-specific nib, MiscExporterAccessoryView-macintosh.nib, which was generated with the MOSXS Interface Builder.] MiscKit2/Palettes/MiscTableScroll/Notes/JAVA-TODO.txt100444 1750 1750 7301 6757227351 22433 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll Java TODO // $Id: JAVA-TODO.txt,v 1.1 99/06/14 18:26:56 sunshine Exp $ //----------------------------------------------------------------------------- TODO: ---- - Expose the ISearch column queries. They return a BOOL and an int (byref). This should be simple to fix for -getISearchColumn: & -doGetISearchColumn:. A false return value can be encoded as -1 in place of a search column. Introduce a constant on the Java side to represent -1, such as NO_ISEARCH_COLUMN. Fixing -tableScroll:getISearchColumn: is a problem, though. It is not immediately clear as to how this should be handled since the Objective-C code knows nothing about Java, and the delegate might be a Java object. Perhaps the correct solution is to generalize all the methods so that they have a single return value in which NO_ISEARCH_COLUMN encodes a false return. Document this method when it is finally implemented. - Expose sort-info functionality to Java. This will require wrapping the MiscEntrySortInfo & MiscSlotSortInfo structures in a Java object. Then expose these related methods in an appropriate fashion: -sortInfoDone:, -sortInfoInit:border:, -border:compareSlots::info:, -compareColumns::info:, -compareRows::info:. - Expose sort-function functionality to Java. This will require wrapping the MiscCompareEntryFunc function pointer. Then expose these related methods in an appropriate fashion: -compareSlotFunction, -setCompareSlotFunction:, -border:setSlotFunction:, -border:setSlot:sortFunction:, -columnSortFunction:, -setColumn:sortFunction:, -rowSortFunction:, -setRow:sortFunction: DONE: ---- v140.1 - Verify that exported method names match AppKit names where applicable. This is a requirement of the Java bridge since ObjC selectors are not scoped. - Add DataSource Java interface to TableScroll by moving the data-specific methods into an Objective-C category called "DataSource". - It would be best to locate the compiled java code and the java dyld directly in the installed framework, rather than scattered around the filesystem. Figure out the best way to do this while minimizing the work required by client programs to support the configuration. - Expose print-info functionality to Java. This will require wrapping the MiscTablePrintInfo structure in a Java object. Then expose these related methods in an appropriate fashion: -getPrintInfo, -tableScroll:willPrintPageHeader:info:, -tableScroll:willPrintPageFooter:info:. [Instead, I turned the delegate messages into notifications. The printInfo structure is now passed as a series of values in the notification's userInfo dictionary. The delegate can query these as needed when it receives the message.] - Change default behavior of static initializer. Do *not* automatically install null security manager or patch library search list unless client explicitly requests it in CustomInfo.plist. - Update documentation (.rtf) to mention Java. - Can probably expose -makeCellsPerform: and variations using NSSelector. Document it. - Instead of looking up environment variables NEXT_ROOT or APPLE_ROOT for registering common search directories for Java-glue library inside of MiscTableScroll.framework, use NSSearchPathForDirectoriesInDomains() to determine the correct list of library directories. - Expose the new TableScroll notifications to Java. - Verify return type of all -validRequestor... variations for documentation. - Verify return type of TableScroll.action() for documentation. - Verify argument types of -sendAction: variations for documentation. MiscKit2/Palettes/MiscTableScroll/Notes/MACH-NT-4.2.txt100444 1750 1750 26027 6757227351 22525 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll OPENSTEP 4.2 for Mach and NT Port // $Id: MACH-NT-4.2.txt,v 1.7 97/11/23 07:40:32 sunshine Exp $ //----------------------------------------------------------------------------- This file describes the changes to MiscTableScroll needed to get it to compile under OPENSTEP 4.2 prerelease and final release for both Mach and NT. OPENSTEP 4.2 is the first release of OPENSTEP for NT which has a compiler (gcc 2.7.2.1) which supports Objective-C++, so it is the first release which can compile MiscTableScroll for NT. While performing this port bugs were discovered in the OPENSTEP 4.2 prerelease Objective-C++ compiler, makefiles, and headers. All of these bugs have been reported to NeXT. A few of them have been fixed, but most still remain in the final release of 4.2. In order to support 4.2 and consequently NT, I had to work around some particularly serious problems, but fortunately was able to do so without seriously compromising the integrity of the code, even while continuing to support 4.1. It is particularly unfortunate and obnoxious that one of the most serious bugs -- a compiler crash when sending a message to 'super' from within a category -- still exists in the final release of 4.2 for NT even though it was fixed for Mach. What is so odd about this is that NeXT *did* fix the bug in both the the Mach and NT compilers. I know this because NeXT sent the patched compiler to me for both platforms during the prerelease period and I verified that it was indeed fixed. I am at a loss as to why they failed to ship 4.2 for NT with the fixed compiler. //============================================================================= Following is a list of changes which were required to port MiscTableScroll to OPENSTEP 4.2 for both Mach and NT. - Added a file named new.h to the Framework source directory. It contains: -------------------- new.h -------------------------------------------- inline void* operator new( size_t, void* ptr ) { return ptr; } ----------------------------------------------------------------------- This file is required on Mach since NeXT did not supply a at all. In the past, was located in the g++ header directory, but NeXT did not ship libg++ with 4.2 for Mach. I reported this bug to NeXT on 04/03/97 and it was registered as tracker #78207. This file is required on NT since the file which NeXT redistributed from Microsoft tries to include the non-existent file and is missing the default placement new operator as well. I reported this bug to NeXT on 03/28/97 and it was registered as tracker #78067. Fortunately adding a local new.h file gets around both of these problems without compromising support for OPENSTEP 4.1. - Switched from -Wall to -Wmost since the OPENSTEP 4.2 compiler generates warnings which the programmer can not sensibly do anything about when -Wall is used. An example of common code which results in a useless warning is illustrated below: - (void)buttonPressed:(id)sender {} // Warning: usused 'sender' I reported this bug to NeXT on 03/31/97 and it was registered with tracker #78071. On 04/07/97 NeXT responded by saying that they will not fix it for 4.2 and that it *might* get fixed in 5.0. - Had to add a rule to Makefile.postamble to handle bad code generated for psw files. For some unknown reason pswrap generates unused 'pad' variables which result in compiler warnings. I reported this bug to NeXT on 04/01/97 and it was registered with tracker #78091. I worked around this problem by running the source file generated by pswrap through a sed script which deletes the useless 'pad' variable altogether. - Reorganized the code to avoid calls to 'super' from within categories since such calls crash the OPENSTEP 4.2 prerelease Objective-C++ compiler for Mach and NT, as well as the OPENSTEP 4.2 final release compiler for NT. This is an extremely serious problem. I worked around this problem by supplying methods in the main (non-category) implementation which simply forward the appropriate message to 'super'. Categories call these methods rather than calling 'super' directly. Though ugly, it's simple, very localized, and can be easily undone when/if NeXT fixes the problem. I reported this bug to NeXT on 03/31/97 and it was reigstered with tracker #78005. On 04/08/97 they sent me a patched Mach compiler in which this bug had been fixed. On 04/21/97 they sent a patched NT compiler. What is particularly mind-boggling is that although they fixed it on both platforms, they neglected to include the patched compiler in the final release of OPENSTEP 4.2 for NT even though they did include it in the final release of OPENSTEP 4.2 for Mach. - Changed all assert() calls to NSAssert() variations for a couple reasons. The file which NeXT redistributed from Microsoft declares _assert() as accepting non-const buffers (void*) rather than const (char const*), and therefore generates a warning. I reported this bug to NeXT on 03/28/97 and it was registered with tracker #78068. NSAssert() is more portable and it throws exceptions which can be caught by the application in the event that it needs to log the error somewhere other than the default error log. - Moved -Werror and -Wwrite-strings out of the Makefile.preamble and into the PB.project. This allows greater flexibility when trying to handle differences between platforms since the flags can be customized on a per-platform basis rather than across all platforms. - MiscExporter no longer sends -makeKeyAndOrderFont: & -close messages to the NSSavePanel since the NSSavePanel in OPENSTEP for NT, does not respond to these messages. - Worked around "dllimport'ed value used as initializer" error in delegate notification code in MiscTableScroll.M under Windows NT. It was using notification messages exported from the AppKit.dll in a static table. - MiscDelegateFlags.h now includes rather than since the OPENSTEP 4.2 prerelease compiler couldn't grok the keyword 'class' following inclusion of . I have not examined objc.h yet to determine why it was causing this problem. At any rate, NSObject.h is more portable than objc.h across OpenStep implementations. - Had to add "OTHER_CCFLAGS += -ObjC++" to Makefile.preamble in order to allow .cc files to include Objective-C headers and reference Objective-C code. I suppose that the NeXT makefiles rules are correct in the strict sense since they do not use -ObjC++ for cc files automatically. However, this means that pretty much all of our projects will require the addition of this line to the Makefile.preamble. It might just be a better idea for NeXT to fix it *once* in their makefiles or to designate a file extension which stands for "C++ code which includes Objective-C code". I'm not sure what the correct approach is, though I made a number of suggestions when I reported this problem to NeXT on 04/03/97. Their response on 04/07/97 indicates only that there is some internal confusion and that they will "get back" with me on it. [11/23/97 - I still haven't heard back from them, and indeed, the "internal confusion" has failed to diminish even in the final release of 4.2.] - Had to conditionalize the setting of OTHER_OFILES in the Makefile.preamble. Setting OTHER_OFILES was a patch to work around bugs in the OPENSTEP 4.1 and OPENSTEP 4.2 prerelease makefiles which neglected to include any of the .o files from C++ sources. This problem was fixed in the final release of OPENSTEP 4.2, but the patch is still needed for support of 4.1, hence the conditional. - Now that (bool) is a built-in type, had to remove @encode(bool) from MiscTableBorder during archiving and unarchiving since @encode(bool) returns "" in the OPENSTEP 4.2 (gcc 2.7.2.1) compiler. This causes the archivers to raise an exception. I now translate the (bool) into a (char) during coding. This also keeps it compatible with the pre-4.2 faked-up MiscTableScroll (bool) which was just a typedef to (char). I reported this bug to NeXT on 04/03/97 and it was registered with tracker #78228. - Broke the project into Framework and Palette subprojects which are now contained within a top-level aggregate project. This allows the example applications to link correctly by avoiding the following problems: Problem 1: Previously, the Makefile.postamble was creating an 'ld -r' style object file under Mach but this type of object file creation does not seem to be available under Windows. Problem 2: Couldn't convert it to a real library because Windows doesn't have the equivalent of -all_load (that I could find), and consequently unreferenced symbols were not being linked in. This also allowed me to remove the MiscBorderViewInline.M hack which contained hard-coded HEX dumps of the tiff images. Now the image resources are contained within the Framework. - Renamed the executable (dll) file within the Palette to avoid name collision with the executable (dll) file within the Framework. This showed up as a bizarre problem in +[NSBundle load] which kept erroring out so long as the dll files from the Framework and Palette had the same name even though they were contained in *different* directories. I don't know if this is a bug in the Microsoft dll loader or the Objective-C run-time. I worked around it by renaming the palette executable to MiscTableScrollPalette while leaving the wrapper as MiscTableScroll.palette. This was accomplished with a little Makefile magic (redefining INNER_PRODUCT) and by overriding "NSExecutable" via a CustomInfo.plist. I have not reported this problem to NeXT. //============================================================================= v0.125.9 06/18/97 09:00 EDT sunshine Ported to OPENSTEP 4.2 final release for Mach and NT. Required permanent work-around for "sending message to 'super' bug" since it still exists in Objective-C++ compiler for NT. Required work-around for unused 'pad' variable in pswrap generated source. Added permanent local new.h file to combat missing on Mach and buggy on NT. v0.125.8 04/15/97 10:00 EDT sunshine Broke into Framework and Palette subprojects. Worked around +[NSBundle load] problem where it couldn't load the Palette dll file because it had the same name as the Framework dll file. v0.125.7 04/09/97 03:00 EDT sunshine Now creates a library under NT as well. v0.125.6 04/04/97 02:30 EST sunshine Ported to OPENSTEP 4.2 prerelease for Mach. v0.125.5 03/31/97 16:30 EST sunshine Ported to OPENSTEP 4.2 prerelease for NT. MiscKit2/Palettes/MiscTableScroll/Notes/OPENSTEP-BUGS.txt100444 1750 1750 22142 6757227351 23162 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll OPENSTEP BUGS // $Id: OPENSTEP-BUGS.txt,v 1.12 99/07/15 12:38:44 sunshine Exp $ //----------------------------------------------------------------------------- BUGS: ---- - TableScroll is not receiving a -becomeFirstResponder message on Rhapsody DR2 when it is first unarchived from the nib and is the window's "initial first responder". Consequently, it does not have a chance to notify NSFontManager as to the current font setting. (-becomeFirstResponder is correctly sent in other circumstances.) - Cursor rectangles do not work correctly on MacOS/X Server DR2 when mouse moves vertically into rectangles. The problem is the overlapping rectangles. I fixed this problem for horizontal mouse movement already by eliminating some of the overlap on the DR2 platform. The overlapping rectangles are a work-around for buggy cursor rectangles on pre-DR2 platforms which do not handle small adjacent rectangles correctly. - MacOS/X Server DR2 changed the modifier keys used for extending selection. On earlier platforms, shift is used to extend the selection incrementally, and alt is used to extend it by an entire range. With DR2, cmd is now used for incremental selection, and shift extends by range. - LineWrapper isn't handling composed character sequences. In fact, it's using -lossyCString. - LineWrapper::draw() doesn't handle NSAttributedStrings. It assumes that strings will be drawn in a single font entirely. - Incremental-search should be handling composed character sequences and Unicode via NSString. - The -keyDown: method in MiscTableScroll is only considering the first character from the key-down event rather than all of them. - Dragging, resizing, etc. a slot while cell editing is in progress causes the cell to be redrawn with the old contents for the duration of the drag, resize, etc. operation, at which time the new contents are restored. This bug also afflicts the NEXTSTEP MiscTableScroll, but only when dragging the column if it was only partially visible. The MiscTableScroll architecture does not easily lend itself to fixing this problem. NeXT BUGS: --------- - There is a display bug *during* dragging. It appears that the composite operations are messing up the images. For instance, as soon as you pick up a column, the image of the column gets a slightly dithered appearance (that's the best description I can think of). As you drag the visible-cache gets drawn back into the window at the newly exposed areas, and it also has a dithered appearance. This bug occurs on both Mach and NT. Furthermore it also occurs when applications linked with the NEXTSTEP 3.3 version of MiscTableScroll run under OPENSTEP 4.x. This leads me to believe that it is a bug in the window server itself. - OPENSTEP 4.2 prerelease Objective-C++ compiler for both Mach and NT crashes whenever a message is sent to 'super' from within a category. This comes up quite frequently. I reported this bug to NeXT on 03/31/97 and it was registered with tracker #78005. They fixed it in both the Mach and NT compilers and sent me the patched Mach compiler on 04/08/97, and the patched NT compiler on 04/21/97. However, for some reason completely unknown to me, their fix only made it into the 4.2 final release compiler for Mach. The 4.2 final release compiler for NT still contains the bug. Therefore I had to work around this problem in order to support the NT platform by reorganizing the code so as to avoid making such calls. - OPENSTEP 4.2 Objective-C++ compiler for Mach and NT generates warnings about unused variables when the -Wall flag is used even though there is no sensible way to prevent them. This problem comes up frequently, for instance: -(void)foo:(id)sender {}. I worked around the problem by using -Wmost instead. - OPENSTEP 4.2 pswrap generates unused 'pad' variables which result in useless and annoying compiler warnings. - OPENSTEP 4.1 (gamma) Objective-C++ fails to define macro __PRETTY_FUNCTION__ which is used by NSCAssert() and relatives. - tops' "replacemethod" doesn't handle '&' correctly. For instance, the conversion of getRow:col:ofCell: to getRow:column:ofCell: will fail if it is called in this fashion: [matrix getRow:&r col:&c ofCell:cell]. It will succeed, however, if it is called in this (less common) fashion: [matrix getRow:pr col:pc ofCell:cell] - nextText connections are not converted automatically to nextKeyView. Next should have patched their NSIBConnector class to perform this conversion automatically so that they show up in IB correctly (in addition to working correctly when loaded by an application). I don't know what to do about this without having to do a bunch of extra programming, so I'll await word from NeXT about their final release. [This appears to be fixed in 4.1.] - OPENSTEP 4.1 & 4.2 fail to publish object_setInstanceVariable() (which is declared in the old Object.h) or an equivalent function. This is used in -[MiscTableConnector establishConnection]. As a fix I manually declared the function. - MiscBorderCell text is drawn in black rather than white. TableCell text is drawn in black rather than -textColor/-selectedTextColor. This is a known bug in OPENSTEP 4.1 & 4.2 (ref# 52511), -setupFieldEditorAttributes: does not get called for non-editable cells. [I fixed this for now by subclassing from NSTextFieldCell and manually setting the text color.] FIXED: ----- v140.1 - After dragging a TableScroll to a new location on a window in Interface Builder, it appears to enter into a state where one can edit the underlying NSScrollView. The scrollers become active and the TableView itself disappears. It only exits this mode when a different object is clicked. This bug affects MacOS/X Server DR2. [I can no longer reproduce this.] - Mouse cursor custom image is not working properly on MacOS/X Server DR2. For resizeable columns, the "resize" cursor only appears if moving the mouse from left to right. The cursor never appears if moving from right to left. - On MacOS/X Server DR2 and YellowBox DR2, connection inspector is not showing the item which action/doubleAction are connected to in any nib which is loaded by Interface Builder. It does show new connections which are created during the current session, though. This is true for both action and doubleAction. The connection inspector works fine for OpenStep. [Problem was that IBClassData -actionsOfClass: no longer appends colon ":" to returned action names, as it did prior to DR2, yet the action name stored in the NSNibControlConnector includes the colon. The connection inspector was doing a simple string comparision to locate the action in the action list. Fixed by canonicalizing the names before comparing.] - MiscTableScroll crashes during sorting now that notifications are properly exported with __declspec(dllexport). [Problem was a bug in the Objective-C++ compiler for YellowBox and OpenStep 4.2 for Windows where it incorrectly places some variables in a .drectve section in the COFF object file instead of .rdata where they belong. Since the linker discards the .drectve section before producing the final output, these variables were not getting initialized at all. In this case, the static COMPARE_FUNC[] array was not being initialized in MiscTableScrollSort.M. I worked around the problem by changing the way MiscTableTypes.h deals with exported symbols and also added MiscTableScrollSymbols.M which actually tells Windows which symbols should be exported from the DLL.] - On MacOS/X Server, InterfaceBuilder complains that the MiscTableScroll connection inspector is making obsolete calls to -outletsOfClass: and -actionsOfClass:. It suggests using -outletNamesOfClass: and -actionNamesOfClass: instead. This warning does not appear on DR2. Evidence strongly indicates that the newer methods have the same input and return types, thus indicating that the methods were simply renamed in MacOS/X Server for clarity. [Fixed by sending the new messages to InterfaceBuilder if it responds to them; otherwise send the old. This is accomplished via -respondsToSelector:.] - MiscTableView ignores user-specified scaling factor during printing. [Problem was that between NextStep and OpenStep, the AppKit engineers moved the scaling factor input field from the page layout panel to the print panel. Under NextStep, it was possible to grab the scaling factor from the global PrintInfo object even before the print panel was launched, and this is exactly what MiscTableView did. However, as of OpenStep, the scaling factor is not available until the print panel has been dismissed by the user. MiscTableViewPrint.M had not been updated to account for this difference. It was still assuming that the scaling factor was available prior to initiation of the print operation.] MiscKit2/Palettes/MiscTableScroll/Notes/OPENSTEP-HISTORY.txt100444 1750 1750 172254 6757227351 23615 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll OPENSTEP HISTORY // $Id: OPENSTEP-HISTORY.txt,v 1.66 99/08/20 06:11:02 sunshine Exp $ //----------------------------------------------------------------------------- v0.140.1 1999/08/20 04:35 EDT sunshine@sunshineco.com Ported to MacOS/X Server for Mach and Windows. Updated all nibs to latest UI layout guidelines and adjusted all fonts. Updated copyright and contact information in README. Now uses NSStringFromClass() in place of +[NSObject description]. On MacOS/X Server, exposed MiscTableScroll, MiscTableCell, and MiscExporter to Java. Added a Java subproject. Renamed abbreviated titles on MiscExporterAccessoryView from "Col Titles" and "Col Grid" to "Column Title" and "Column Grid", respectively. Cell type popup on TableScroll inspector window now says "Image" rather than "Icon" for better OpenStep conformance. Added make.sh and platform.make to work around differences in the directory structure between MacOS/X Server DR2 and earlier versions of OpenStep. In particular, the location of the system makefiles changed along with the location of the make utility on Windows. As of MacOS/X Server DR2, names of Interface Builder's connector classes changed. Additionally, these classes are now published in the Interface Builder framework, so we no longer need to provide definitions for them ourselves. Consequently NSIBConnector.h and other related files have been conditionalized as appropriate. The classes which were renamed are: NSIBConnector --> NSNibConnector NSIBOutletConnector --> NSNibOutletConnector NSIBControlConnector --> NSNibControlConnector Renamed NSIBConnector.h to NSNibConnector.h. Removed -getWidth: from MiscTableViewPrint.M. It was unused and also buggy. In particular, it was testing the incoming object to see if it responded to -size: when it should have been testing for -size. MiscTableScroll.h declared -moveColumnFrom:(int)pos to:(int)pos. The Java bridging tool generated Java code moveColumnFrom(int pos, int pos). The Java compiler complained heatedly about using 'pos' twice. Therefore renamed the arguments. For better OpenStep conformance, renamed methods which move slots. This was also necessary to support Java since the Java bridge requires a one-to-one mapping of Objective-C selectors to Java method names. AppKit already had a mapping for moving columns, so we now match it. Updated the 'tops' script and documentation to reflect these changes. border:moveSlotFrom:to: --> border:moveSlot:toSlot: moveColumnFrom:to: --> moveColumn:toColumn: moveRowFrom:to: --> moveRow:toRow: slotDraggedFrom:to: --> slotDragged:toSlot: Fixed bug: -[MiscTableScroll sizeToFit] was incorrectly checking cells to see if they respond to -cellSize: rather than -cellSize. Consequently the method completely failed. Added a new DataSource category to MiscTableScroll. This in an informal protocol which the delegate or dataDelegate may conform to. All of the data-related methods which used to be in the Delegate categroy have been moved to the new category. No new methods were added. The DataSource category was defined in order to mimic AppKit categories and AppKit Java interfaces of similar ilk. It is worth noting that the low-level Java bridge does not require that an Objective-C category exists with the same name as a Java interface (in this case DataSource), but the Java bridging tools do expect the corresponding Objective-C category to exist, and since we are using those tools, we need to conform to their requirements. Makefiles now use new $(LOCAL_LIBRARY_DIR) rather than hard-coding $(NEXT_ROOT)/LocalLibrary. LOCAL_LIBRARY_DIR overcomes differences in directory structure between MacOS/X DR2 and earlier OpenStep versions. Added Makefile.postamble patch to eliminate NSFramework_forceLoad() compiler warning generated by makefiles on YellowBox DR2 for Windows. Converted the slot list on the inspector from a matrix of buttons to a TableScroll (via CustomView). Reworked the color setting controls on the TableScroll inspector nib. Now provides user with ability to preview color selections by providing two text field which adopt the chosen colors for text and background. One text field previews selected cells, and the other unselected. This configuration also makes better use of window real-estate. TableScroll "Name" columns on connection inspector now autosize. Previously the widths were hard-coded and filled the scroll view exactly. However as of MacOS/X Server, these sizes were incorrect. Autosizing allows it to look correct in all cases. Added extra comments to MiscTableConnInspector.M. Fixed bug: MiscTableBorder::clearCursor() was broken, making it a no-op. Fixed bug: 'tops' script mis-spelled -selectedTextColorChangedTo as -selectedTextColorChanagedTo. MiscBorderView now uses NSWindow's -cacheImageInRect:, restoreCachedImage, and -discardCachedImage rather than deprecated PSsetinstance() and PShideinstance(). Changed return type of -numberOfSelectedSlots:, -numberOfSelectedRows, and -numberOfSelectedColumns from (unsigned int) to (int) to be consistent with similar methods such as -numberOfRows, -numberOfVisibleRows, etc. This also affects the Java exposure. Since Java uses only signed numbers, (unsigned int) would have been promoted to an 8-byte value on the Java side which is typically inefficient. Framework/Makefile.postamble now ensures that the owner has "write" permission on the installed framework directories. This is necessary since the Java subproject installs its dynamic library and Java .class files inside the framework's Resource directory. Cleaned up each of the Makefile.preamble and .postamble files. Added copyright notices. Fixed bug: Incorrectly registered delegate to watch for standard NSControl text-editing notifications coming from TableView, even though the notifications are posted by the TableScroll; never by the TableView. Consequently, delegate was not receiving these notifications at all. Fixed bug: NSControlTextDidEndEditingNotification was only being sent if at least one of the delegates responded to the respective delegate message. This was incorrect since it is possible that some other object might watch for this notification too. The notification is now sent in all cases. Added MISC_TABLE_SCROLL_EXTERN & MISC_TABLE_SCROLL_PRIVATE_EXTERN to MiscTableTypes.h. These are defined appropriately for all possible OpenStep platforms (Mach, Windows, Solaris, etc.) for exporting variables, such as notification strings, from the framework. For better OPENSTEP conformance, added new notifications. They are published via the new MISC_TABLE_SCROLL_EXTERN macro. MiscTableScrollSlotDraggedNotification MiscTableScrollSlotSortReversedNotification MiscTableScrollSlotResizedNotification MiscTableScrollChangeFontNotification MiscTableScrollFontChangedNotification MiscTableScrollBackgroundColorChangedNotification MiscTableScrollSelectedBackgroundColorChangedNotification MiscTableScrollSelectedTextColorChangedNotification MiscTableScrollTextColorChangedNotification MiscTableScrollWillPrintNotification MiscTableScrollDidPrintNotification MiscTableScrollWillPrintPageHeaderNotification MiscTableScrollWillPrintPageFooterNotification MiscTableScrollWillEditNotification MiscTableScrollDidEditNotification The delegates are automatically registered for the new notifications if appropriate. All such delegate messages are now passed an NSNotification rather than MiscTableScroll. Several messages were renamed in order to facilitate this change. Additional arguments which used to be sent directly with the delegate message are now available within the notification's userInfo dictionary. The 'tops' script and documentation have been altered to reflect these changes. An important benefit of this change is that the delegate messages -tableScroll:willPrintPageHeader:info: & -tableScroll:willPrintPageFooter:info: can now be cleanly exposed to Java. Previously this was not possible since the "info" argument was a raw C-structure which could not be easily exposed over the Java bridge. The affected methods are: tableScroll:backgroundColorChangedTo: --> tableScrollBackgroundColorChanged: tableScroll:border:slotDraggedFrom:to: --> tableScrollSlotDragged: tableScroll:border:slotResized: --> tableScrollSlotResized: tableScroll:border:slotSortReversed: --> tableScrollSlotSortReversed: tableScroll:changeFont:to: --> tableScrollChangeFont: tableScroll:didEdit:atRow:column: --> tableScrollDidEdit: tableScroll:fontChangedFrom:to: --> tableScrollFontChanged: tableScroll:selectedBackgroundColorChangedTo: --> tableScrollSelectedBackgroundColorChanged: tableScroll:selectedTextColorChangedTo: --> tableScrollSelectedTextColorChanged: tableScroll:textColorChangedTo: --> tableScrollTextColorChanged: tableScroll:willEditAtRow:column: --> tableScrollWillEdit: tableScroll:willPrintPageFooter:info: --> tableScrollWillPrintPageFooter: tableScroll:willPrintPageHeader:info: --> tableScrollWillPrintPageHeader: tableScrollDidPrint: --> tableScrollDidPrint: tableScrollWillPrint: --> tableScrollWillPrint: Added a new Notifications category to MiscTableScroll. As with the new DataSource category, this allows for a Notifications interface on the Java side. No new methods were added. Rather existing methods from the Delegate category were moved into this one. Fixed MiscTableCell to use NSColor's "system" colors for its default color scheme instead of hard-coded light-gray, black, and white. Updated all documentation to reflect Java exposure. Method prototype was documented incorrectly for these messages: -border:setSlot:tag: -cellFrameAtRow:column: -reviveCell:atRow:column: -sendDoubleActionIfEnabled -setRowSortVector: -writeSelectionToPasteboard:types: Documentation for these methods was botched: -changeFont: -setColumnTitleMode: -setColumnTitlesHeight: -setRowTitleMode: -slotTitleMode: -tableScrollSelectedBackgroundColorChanged: -tableScrollSelectedTextColorChanged: -tableScrollTextColorChanged: Though documented, method summaries were missing for these methods: -border:slotDragged: -border:slotResized: -border:slotSortReversed: Documentation for -border:setUniformSizeSlots: made invalid claim about not being able to resize uniform size slots. This restriction was lifted in v133.1. Explained the for-all-cells portion of -sendAction:to:forAllCells: in documentation. The meaning of "forAllCells" is not clear by itself. Added new "Delegates and Notifications" section to documentation. Fixed bug: -[MiscTableScroll changeFont:] was sending -convertFont: directly to the shared NSFontManager rather than "sender" as documented. Now sends the message to "sender", which is assumed to be an NSFontManager or similarly capable object. For general clarity and better OpenStep conformance, renamed more methods. Updated documentation, 'tops' script, and 'jobs' script to reflect these changes. Most name changes occurred in batches: ...:byExtension: --> ...:byExtendingSelection: select...Tags: --> select{Slots|Rows|Columns}WithTags: deselect...Tags: --> deselect{Slots|Rows|Columns}WithTags: ...ISearchColumn: --> ...IncrementalSearchColumn: Also renamed these specific methods: drawClippedText --> drawsClippedText setDrawClippedText: --> setDrawsClippedText: trackingBy --> selectsByRows trackBy: --> setSelectsByRows: tracking --> isTrackingMouse stringForNSTabularTextPBoardType --> stringForNSTabularTextPboardType Fixed problem with cursor rectangles introduced by MacOS/X Server DR2. Prior to DR2, the AppKit did not handle small, adjacent cursor rectangles properly. In particular they were often ignored depending upon the direction of movement of the mouse pointer. To work around the problem TableScroll used overlapping rectangles (which appeased the AppKit). However, as of DR2, the AppKit no longer deals well with overlapping rectangles. In particular it often ignores them depending upon the direction of movement of the mouse pointer. The code now conditionally uses overlapped or non-overlapped rectangles based upon the current platform. Added a new "Java" section to MiscTableScroll.rtf which documents use of TableScroll from within a Java project. Discusses the necessary modifications to Makefile.preamble and CustomInfo.plist. Documents new options MiscTableScrollAddLibrarySearchPaths and MiscTableScrollUseNullSecurityManager. Discusses exported classes, interfaces, and naming conventions. Added support for "represented-object". Maintains represented-objects for each slot on each border as well as a single represented-object for the table itself. A represented-object can also be associated with each cell via -[NSCell setRepresentedObject:]. To be consistent with AppKit, represented-objects are archived along with the table, therefore incremented class version number. Updated documentation to reflect new methods. Added "Represented Objects" section to introduction. Updated Java 'jobs' file to expose new methods. The new methods are: -representedObject -setRepresentedObject: -border:slotRepresentedObject: -border:setSlot:representedObject: -columnRepresentedObject: -setColumn:representedObject: -rowRepresentedObject: -setRow:representedObject: -border:slotWithRepresentedObject: -columnWithRepresentedObject: -rowWithRepresentedObject: -cellWithRepresentedObject: -getRow:column:ofCellWithRepresentedObject: Fixed bug: MiscTableBorder::setPrototype_P() failed to retain the new prototype. MiscTableTypes.h no longer imports old-style . Also now imports rather than . Patched makefiles to delete invalid & unnecessary PrivateHeaders symbolic link which system makefiles create within installed framework. Updated README to reflect new MacOS/X Server directory organization and documented Java exposure. Worked around problem with connection inspector in MacOS/X Server and YellowBox DR2 where it was not selecting the method in the action list for action or doubleAction in nibs which were loaded from a file. New connections made in the current edit session displayed properly, though. Problem was that -[IBClassData actionsOfClass:] no longer appends colon ":" to the returned action names, as it did prior to DR2, yet the action name stored in the NSNibControlConnector (after unarchiving) includes the colon. The inspector was performing a simple string comparison to locate the method name in the action list. Fixed by canonicalizing the names before comparison. Fixed bug: -[MiscTableScroll sizeToFit] wasn't taking intercell grid into account when computing slot sizes. Added facility which informs TableScroll when the TableView changes first responder status. Added methods -didBecomeFirstResponder and -didResignFirstResponder which subclasses may override as needed. TableView sends these messages to TableScroll at the appropriate times. Added delegate methods -tableScrollDidBecomeFirstResponder: and -tableScrollDidResignFirstResponder:, and notifications MiscTableScrollDidBecomeFirstResponderNotification and MiscTableScrollDidResignFirstResponderNotification. Documented new methods and notifications and exposed them to Java. Worked around compiler/assembler bug on Windows. The stub file generated by "bridget" for MiscTableScroll exports so many symbols that the compiler generates a single line of assembly which is so long that it overflows the assembler's input buffer, resulting in a crash. The offending assembler directive looks like this: .ascii " -export:symbol1 -export:symbol2 ... -export:symbolN\0" To work around this problem, I devised a "sed" script which breaks the line apart in this fashion: .ascii " -export:symbol1" .ascii " -export:symbol2" ... .ascii " -export:symbolN\0" I then patched the makefile so that it generates assembly files from the .m files instead of directly generating .o files. The assembly file is run through the "sed" script and then passed to the assembler for generation of the final .o file. Fixed bug: MiscTableTypes.h was incorrectly exporting MiscDefaultCompareSlotFunc(). It failed to use extern "C" which meant that the name was mangled and inaccessible to Objective-C clients. Worked around nasty Objective-C++ compiler bug on YellowBox and OpenStep 4.2 which resulted in some static, constant, file-global variables not being initialized. The problem was that the compiler incorrectly placed certain variables (such as COMPARE_FUNC[] from MiscTableScrollSort.M) into the ".drectve" section of the COFF object file instead of the ".rdata" section where they should have been. Since the linker discards the .drectve section before creating the final output file, these variables were never being initialized. Added MiscTableScrollSymbols.M and modified the macros for exporting variables in order to work around the problem. See MiscTableTypes.h and Notes/DLL-EXPORT.txt for a full discussion of the problem. Worked around bug in Apple's /System/Developer/Java/Headers/java-vm.h. It fails to define prototypes for objc_msgSendSuper_stret() and objc_msgSend_stret() on ppc for Mach even though bridget generated code relies on these functions. Note that prototypes for these functions are correctly defined for Windows. To work around the problem I patched MiscTableScrollJava.h to manually define them on ppc for Mach. Significant updates to mcgh2misc scripts. Updated to deal with new Java support. Now handles java, pjava, jobs, and sed files. Converts Java class names from org.misckit to org.misckit. Updated to deal with new platform.make and make.sh. Now filters output of Emacs batch processing so that only important messages are displayed instead of spewing an enormous amount of output. Source and target directories can now be specified on the command line and default to sane values if omitted. Removed requirement that script be run from within MiscTableScroll source directory. No longer copies RCS directories to target. Now files are checked out from source RCS directories directly into target locations. Added usage statement and -help option. Now optionally copies MiscKit license files, if present, into target. Simplified EXPAND() which was doing unnecessary work. WHATS_LOCKED() now takes the directory as an argument instead of assuming the current working directory. Removed unused SETUP_DOCS() and SETUP_HEADERS() functions. Simplified save and rename logic in lisp code. Now disables Emacs auto-save and backup-file creation. Renamed lisp functions and variables to better reflect their actual meaning. Added copyright notice. Worked around method-name change in Interface Builder which occured between DR2 and MacOS/X Server. The methods -actionsOfClass: and -outletsOfClass: were renamed to -actionNamesOfClass: and -outletNamesOfClass:, respectively. Worked around change in Java headers between DR2 and MacOS/X Server. In DR2 there was a bug in java-vm.h in which it neglected to declare objc_msgSendSuper_stret() & objc_msgSend_stret() for PPC hardware even though bridget generates code which calls those functions. To work around this problem, MiscTableScrollJava.h manually declares them for PPC. However, as of MacOS/X Server, these functions have a different prototype (the argument list differs), have moved to objc-runtime.h, and are correctly declared for PPC targets. To avoid a complaints from the compiler about conflicting prototypes, declaration of these functions in MiscTableScrollJava.h had to be protected with an #if directive which only declares them for DR2. Fixed bug: Was ignoring the user-specified scaling factor during printing. Problem was that between NextStep and OpenStep, the AppKit engineers moved the scaling factor input field from the page layout panel to the print panel. Under NextStep, it was possible to grab the scaling factor from the global PrintInfo object even before the print panel was launched, and this is exactly what MiscTableView did. However, as of OpenStep, the scaling factor is not available until the print panel has been dismissed by the user. MiscTableViewPrint.M had not been updated to account for this difference. It was still assuming that the scaling factor was available prior to initiation of the print operation. Thanks go to Juergen Moellenhoff for bringing this bug to my attention. Worked around problem with MiscExporterAccessoryView.nib under Java on MacOS/X Server. Since we still support OpenStep, this nib was created with the OpenStep Interface Builder and contains NSPopUpButtons which archive instances of NSPopUpList. However, as of MacOS/X Server DR2, NSPopUpList is deprecated. The Objective-C AppKit on MacOS/X Server still understands the old NSPopUpList class for compatibility's sake, but it has not been exposed to the Java side. Consequently, when MiscExporterAccessoryView is accessed from a Java application, an exception is thrown (and ignored by the Java bridge) since it does not recognize the NSPopUpList class. To work around this problem, I added a copy of this nib, named MiscExporterAccessoryView-macintosh.nib, which was generated by the MacOS/X Server Interface Builder and is specific to that platform. Patched Makefile.preambles to account for missing .SUFFIX:.cpp directive in system makefiles on OpenStep 4.1 & 4.2. Incremented the project version from "A" to "B" since changes were made which are incompatible with previous versions. Added a warning message to the README telling developers to be aware of renamed delegate messages and their related dangers. Changed Files: + make.sh * Makefile * MiscBorderView.M * MiscDelegateFlags.{h|cc} * MiscExporterAccessoryView.nib + MiscExporterAccessoryView-macintosh.nib * MiscTableBorder.{h|cc} * MiscTableBorderIO.cc * MiscTableCell.M * MiscTableConnector.{h|M} * MiscTableConnInspector.{h|M} * MiscTableScroll-3.3-4.x.tops * MiscTableScroll.{h|M|rtf} * MiscTableScrollCursor.M * MiscTableScrollData.M * MiscTableScrollEdit.M * MiscTableScrollInspector.{h|M|nib} * MiscTableScrollIO.M * MiscTableScrollISearch.M * MiscTableScrollKB.M * MiscTableScrollPB.M * MiscTableScrollPrint.M * MiscTableScrollPrivate.h * MiscTableScrollSel.M * MiscTableScrollSort.M + MiscTableScrollSymbols.M * MiscTableTypes.h * MiscTableView.M * MiscTableViewPrint.M * mcgh2misc.{el|sh} > NSIBConnector.h --> NSNibConnector.h * NSNibConnector.h * PB.project + platform.make * README.rtf + Java/Makefile + Java/Makefile.{preamble|postamble} + Java/MiscTableScrollJava.{h|m|jobs|sed} + Java/PB.project + Notes/DLL-EXPORT.txt + Notes/DR2-MOSXS.txt + Notes/JAVA-BUGS.txt + Notes/JAVA-TODO.txt * {Framework|Palette}/Makefile * {Framework|Palette}/Makefile.{preamble|postamble} * {Framework|Palette}/PB.project v0.139.1 1998/06/13 09:30 EDT sunshine@sunshineco.com Applied v0.139 NEXTSTEP 3.3 diffs. Changed Files: * MiscBorderView.M * MiscTableView.M v0.138.1 1998/03/31 04:19 EST sunshine@sunshineco.com Applied v0.138 NEXTSTEP 3.3 diffs. Fixed up #import of public MiscTableScroll headers. Some imports still used "..." rather than . Others neglected the MiscTableScroll/ prefix. The affected files: - MiscDrawList.cc - MiscExporter.M - MiscExporterASCII.M - MiscGeometry.h - MiscTableBorder.{h|cc} - MiscTableConnInspector.M - MiscTableScrollIO.M - MiscTableScrollPalette.M - MiscTableScrollSel.M - MiscTableUtil.h - MiscTableViewCursor.M - MiscTableViewDrag.M Fixed bug: -[MiscTableScroll textDidBeginEditing:] was mistakingly sending the notification NSControlTextDidChangeNotification instead of NSControlTextDidBeginEditingNotification. Fixed bug: Pressing the "new slot" button on the IB inspector would select & draw the new slot, but fail to redraw the slot which lost selection. Ditched the "alignTitle" field from the IB inspector altogether. The alignment buttons correctly dim when disabled under OPENSTEP/Rhapsody, so this text field was extraneous. This also freed me from having to hard-wire color values for the text's enabled/disabled states. The background of the IB inspector's slot scroll now uses NSColor's "system" color rather than being hard-wired as dark-gray. Construction of the exporter accessory-view is no longer performed programatically by MiscExporterAccessoryView.M. Since MiscTableScroll is now a framework, it is possible to lay out the export controls in a nib, rather than doing so programatically. Consequently, added MiscExporterAccessoryView.nib. This also simplifies localization since control titles are no longer compiled in. Fixed problem: Under Rhapsody, exporter pop-up controls got squashed together since they were smaller than the minimum size enforced by Rhapsody. Fixed colors: Colors are no longer hard-wired into the source code or nibs. NSColor's "system" colors are now used by default in order to conform to color-scheme as defined by each platform (NT, Rhapsody, etc.). This affects the following colors: - text - background - selected text - selected background - edited text - edited background - drag well - grid MiscBorderCell is now derived from NSTableHeaderCell rather than NSTextFieldCell. Consequently it now knows how to correctly draw and color itself on all platforms, whereas the old implementation only knew how to draw itself in a NextStep-like fashion. Moved constants MISC_FRAME_HEIGHT & MISC_FRAME_WIDTH from MiscBorderView.M into MiscTableScrollPrivate.h since the values need to be known by both MiscBorderView.M and MiscTableBorder.cc. Also adjusted the default values to agree with the new MiscBorderCell implementation. Fixed MiscBorderView.M to account for new MiscBorderCell implementation which requires changes to its "highlight" flag rather than "state" in order to reflect "selection". Worked around OPENSTEP 4.2 for Windows bug where compiler crashes when sending a message to 'super' from within a category. This showed up again when MiscTableScrollIO.M was broken out of MiscTableScroll.M in v133.1. Fixed problem where text selection was not visible during editing now that NSColor's "system" colors are used. Problem was that the cell was installing its own colors in the NSTextView. Fixed by setting up the correct colors in the NSTextView after asking the cell to commence editing. Ported MiscTableScrollISearch.M back to OPENSTEP 4.1. Compiler was complaining about "enumeral and non-emumeral type in conditional expression" for 'mask = flag ? NSCaseInsensitiveSearch : 0'. Ported MiscGeometry to the PPC compiler for Rhapsody DR1. The compiler would crash with an "internal compiler error" each time one of the inline methods had to convert a float to an int. Ported mcgh2misc.sh to handle Rhapsody DR1 nib format where data.classes gave way to classes.nib inside nib wrapper. Fixed mcgh2misc.sh to deal correctly with new MiscAlign{Left|Center|Right} images in MiscTableScrollInspector.nib. Changed Files: * MiscBorderCell.{h|M} * MiscBorderView.M * MiscDelegateFlags.{h|cc} * MiscDrawList.cc * MiscExporter.M + MiscExporterAccessoryView.{h|M|nib} * MiscExporterASCII.M * MiscGeometry.{h|cc} * MiscTableBorder.{h|cc} * MiscTableConnInspector.M * MiscTableScroll.{h|M|rtf} * MiscTableScrollEdit.M * MiscTableScrollInspector.{h|M|nib} * MiscTableScrollIO.M * MiscTableScrollISearch.M * MiscTableScrollPalette.M * MiscTableScrollPrivate.h * MiscTableScrolSel.M * MiscTableUtil.h * MiscTableView.M * MiscTableViewCursor.M * MiscTableViewDrag.M * MiscTableWell.M * mcgh2misc.sh v0.137.1 1998/03/23 20:45 EST sunshine@sunshineco.com Applied v0.137 NEXTSTEP 3.3 diffs. Fixed documentation bugs. The set slot order/sizes methods and cousins were listed as returning (void) rather than (BOOL). Changed Files: * MiscTableBorder.{h|cc} * MiscTableScroll.{M|rtf} v0.136.1 1998/03/23 10:00 EST sunshine@sunshineco.com Applied v0.136 NEXTSTEP 3.3 diffs. Changed Files: * MiscTableScrollISearch.M * MiscTableScrollSort.M v0.135.1 1998/03/23 08:30 EST sunshine@sunshineco.com Applied v0.135 NEXTSTEP 3.3 diffs. Fixed alignment buttons on IB Inspector. They weren't lighting correctly. The fix invovled removing the old button matrix from the window and dropping in a new one in Interface Builder. Changed Files: * MiscTableBorder.{h|cc} * MiscTableScrollInspector.{M|nib} v0.134.1 1998/03/23 07:30 EST sunshine@sunshineco.com Applied v0.134 NEXTSTEP 3.3 diffs. Worked around cell editing problems in new -suspendEditing/-resumeEditing resulting from differences between NEXTSTEP and OPENSTEP text systems: 1) textDidEndEditing: was getting called as a side-effect of suspend. This caused many problems since it was a premature invocation. 2) textShouldEndEditing: was *not* getting called if the user a) edited, b) dragged slot, c) ended editing. The problem was that the suspend/resume caused the text system to forget that the user had edited the text in step (a), and consequently -textShouldEndEditing: was not getting called. (Some programs, such as ScrollDir rely heavily upon the invocation of this method, so it was a serious bug.) Changed Files: * MiscBorderView.M * MiscDelegateFlags.{h|cc} * MiscTableScroll.{h|M|rtf} * MiscTableScrollEdit.M + MiscTracer.{h|cc} v0.133.1 1998/03/22 12:00 EST sunshine@sunshineco.com Applied v0.133 NEXTSTEP 3.3 diffs. Added 'tops' conversions for new methods: cornerTitle (char* --> NSString) setCornerTitle: (char* --> NSString) minUniformSizeCols --> minUniformSizeColumns maxUniformSizeCols --> maxUniformSizeColumns setMinUniformSizeCols: --> setMinUniformSizeColumns: setMaxUniformSizeCols: --> setMaxUniformSizeColumns: Added 'tops' conversions for better OPENSTEP conformance: makeCellsPerform:... --> makeCellsPerformSelector:... Removed 'tops' conversions for obsolete methods: colDataSize: colExpandsToData: setCol:dataSize: setCol:expandsToData: Updated README to reflect Rhapsody DR1 support, new email address, etc. Changed Files: * MiscBorderView.M * MiscCornerView.{h|M} * MiscDrawList.{h|cc} > MiscNullView.{h|M} --> MiscCornerView.{h|M} * MiscTableBorder.{h|cc} * MiscTableBorderIO.cc * MiscTableScroll.{h|M|rtf} * MiscTableScrollInspector.{h|M|nib} + MiscTableScrollIO.M * MiscTableScrollPalette.M * MiscTableScrollPrivate.h * MiscTableScroll-3.3-4.x.tops * MiscTableTypes.h * MiscTableUtil.h * MiscTableView.{h|M} * MiscTableViewPrint.M * pack.sh * README.rtf v0.132.1 1997/11/24 04:35 EST sunshine@sunshineco.com Applied v0.132 NEXTSTEP 3.3 diffs. Ported back to OPENSTEP 4.1 by including MiscTableScrollPrivate.h in MiscTableBorderIO.cc in order to define __PRETTY_FUNCTION__. Changed Files: > MiscTableBorder_io.cc --> MiscTableBorderIO.cc > MiscTableBorder_sel.cc --> MiscTableBorderSel.cc * MiscTableBorderIO.cc * MiscTableScroll.M v0.131.1 1997/11/24 02:00 EST sunshine@sunshineco.com Applied v0.131 NEXTSTEP 3.3 diffs. Fixed v1 bug: -[MiscBorderView range:fromRect:] was miscomputing max slot. Changed Files: * MiscBorderView.M * MiscTableViewPrint.M v0.130.1 1997/11/23 07:45 EST sunshine@sunshineco.com Applied v0.130 NEXTSTEP 3.3 diffs. Fixed bug: [MiscIntList addInt:] replacement in 'tops' script was broken. README changes: Fixed package name to conform even more closely to ftp site rules. Windows 95 & NT examples now use C:\ instead of D:\. Added (Windows 95 & NT only) comment to MiscTableScroll.dll note. Changed Files: * MiscTableBorder.{h|cc} + MiscTableBorder_io.cc + MiscTableBorder_sel.cc * MiscTableScroll-3.3-4.x.tops * MiscTableScroll.{h|M} + MiscTableScrollSel.M * MiscTableUtil.h * MiscTableView.{h|M} + MiscTableViewCursor.M + MiscTableViewDrag.M + MiscTableViewPrivate.h * README.rtf v0.129.1 1997/07/11 20:00 EDT sunshine@sunshineco.com Applied v0.129 NEXTSTEP 3.3 diffs. README changes: - Updated package name to conform to ftp site rules. - Updated package name from .tar to .gnutar. - Fixed more wording. - Added description of setting PATH variable under Windows for dll. Changed Files: * README.rtf v0.128.1 1997/07/07 09:00 EDT sunshine@sunshineco.com Applied v0.128 NEXTSTEP 3.3 diffs. Fixed minor errors in MiscTableScroll.rtf. Ported mcgh2misc conversion scripts to OPENSTEP. Added a README describing compilation and installation. Changed Files: * MiscExporter.rtf * MiscTableCell.rtf * MiscTableScroll.rtf * mcgh2misc.{el|sh} + README.rtf v0.127.1 1997/06/22 10:00 EDT sunshine@sunshineco.com Applied v0.127 NEXTSTEP 3.3 diffs. Changed Files: * MiscTableCell.{h|M} * MiscTableScrollEdit.M * MiscTableScrollISearch.M * MiscTableView.M v0.126.1 1997/06/22 08:00 EDT sunshine@sunshineco.com Applied v0.126 NEXTSTEP 3.3 diffs. Fixed install location to be $(NEXT_ROOT)/LocalLibrary for NT. I had inadvertently set it to LocalDeveloper in v0.125.9 (even though the HISTORY entry says otherwise). Changed Files: * Makefile * MiscTableCell.rtf * MiscTableView.M * PB.project v0.125.9 1997/06/18 11:20 EDT sunshine@sunshineco.com Ported MiscTableScroll.rtf to OPENSTEP. Synchronized MiscTableScroll.rtf with v127 for NEXTSTEP 3.3. Minor corrections to MiscTableCell.rtf and MiscExporter.rtf. Renamed tops script so as to be valid for 4.x rather than just 4.1. Tops script now fixes #imports to handle framework structure: --> --> --> --> For better OPENSTEP naming conformance, renamed: numSelectedSlots: --> numberOfSelectedSlots: numSelectedRows --> numberOfSelectedRows numSelectedColumns --> numberOfSelectedColumns; numVisibleSlots: --> numberOfVisibleSlots: numVisibleRows --> numberOfVisibleRows numVisibleColumns --> numberOfVisibleColumns buffCount --> bufferCount tableScrollBuffCount: --> tableScrollBufferCount: borderTitlesSize: --> slotTitlesSize: border:setTitlesSize: --> border:setSlotTitlesSize: borderClickedSlot: --> clickedSlot: cellIsSelected:: --> cellIsSelectedAtRow:column: scrollSelToVisible --> scrollSelectionToVisible MISC_TABLE_CELL_ICON --> MISC_TABLE_CELL_IMAGE Added missing conversion to tops script: clickedCol --> clickedColumn Added missing -slotTitlesSize:, -rowTitlesWidth, and -columnTitlesHeight to documentation. Sorted method lists in tops script. Reorganized somewhat. Added missing MiscIntList conversions to tops script: addInt: --> addObject: addIntList: --> addObjectsFromArray: bsearch: --> indexOfObject: bsearch:using:data: --> indexOfObject: initFromString: --> componentsSeparatedByString: insertInt:at: --> insertObject:atIndex: intAt: --> objectAtIndex & intValue lsearch: --> indexOfObject: lsearch:using:data: --> indexOfObject: readFromString: --> componentsSeparatedByString: removeIntAt: --> removeObjectAtIndex: replaceIntAt:with: --> replaceObjectAtIndex:withObject: sortUsing:data: --> sortUsingFunction:context: writeToString --> description writeToString:size: --> description writeToString:size:canExpand: --> description Pseudo conditionalized setting of OTHER_OFILES in Makefile.preamble. It is needed in OPENSTEP 4.1 and OPENSTEP 4.2 (prerelease) since NeXT's makefiles neglect to add the object files for cc, cpp, and cxx sources to OFILES. However, NeXT finally fixed this bug in OPENSTEP 4.2, which means that we can not add the object files ourself (lest the linker complains about linking the same files twice). As of v104.1 use of "highlight" color is based upon -isSelected rather than -isHighlighted. Consequently the term "highlight" is misleading. Therefore renamed all methods and variables to use the term "selected" rather than "highlight". Updated source and documentation accordingly. Added "highlight" to "selected" conversions to tops script: defaultHighlightBackgroundColor --> defaultSelectedBackgroundColor defaultHighlightTextColor --> defaultSelectedTextColor highlightBackgroundColor --> selectedBackgroundColor highlightTextColor --> selectedTextColor setHighlightBackgroundColor: --> setSelectedBackgroundColor: setHighlightTextColor: --> setSelectedTextColor: setOwnerHighlightBackgroundColor: --> setOwnerSelectedBackgroundColor: setOwnerHighlightTextColor: --> setOwnerSelectedTextColor: setUseOwnerHighlightBackgroundColor: --> setUseOwnerSelectedBackgroundColor: setUseOwnerHighlightTextColor: --> setUseOwnerSelectedTextColor: tableScroll:highlightBackgroundColorChangedTo: --> tableScroll:selectedBackgroundColorChangedTo: tableScroll:highlightTextColorChangedTo: --> tableScroll:selectedTextColorChanagedTo: tc1HighlightBackgroundColorLen --> tc1SelectedBackgroundColorLen tc1HighlightBackgroundColorPos --> tc1SelectedBackgroundColorPos tc1HighlightBackgroundColorPtr --> tc1SelectedBackgroundColorPtr tc1HighlightTextColorLen --> tc1SelectedTextColorLen tc1HighlightTextColorPos --> tc1SelectedTextColorPos tc1HighlightTextColorPtr --> tc1SelectedTextColorPtr useOwnerHighlightBackgroundColor--> useOwnerSelectedBackgroundColor useOwnerHighlightTextColor --> useOwnerSelectedTextColor highlightBackgroundColor --> selectedBackgroundColor [variable] highlightTextColor --> selectedTextColor [variable] Fixed bug: Delegate messages -tableScroll:selectedTextColorChangedTo: and -tableScroll:selectedBackgroundColorChangedTo: were reversed in MiscDelegateFlags (one was sent when the other should have been, and vice-versa). Ported to OPENSTEP 4.2 (final release) for Mach and NT. Added local new.h which declares default placement new() operator since is missing entirely on Mach, and the one redistributed from Microsoft on NT is buggy. Fortunately a local new.h does not compromise support for OPENSTEP 4.1. Renamed IBConnector.h to NSIBConnector.h. Worked around Objective-C++ compiler crasher in OPENSTEP 4.2 (final release) for NT. This bug also afflicts 4.2 (prerelease) for Mach and NT. Whenever a message is sent to 'super' from within a category, the compiler crashes with an "internal compiler error". Work around was to add stub methods in the main (non-category) implementation which merely forward the message to 'super' on behalf of the categories. Though ugly, it works, is very localized, and easily removed when the bug is finally fixed. Bug afflicted MiscTableConnInspector.M, MiscTableViewPrint.M, MiscTableScrollPB.M, MiscTableScrollKB. Worked around 'pswrap' bug where it generates unused 'pad' variables. Overrode implicit 'psw' rule via Makefile.postamble so that it runs a 'sed' script which removes the unused and useless variable altogether. Changed 'install' location on NT to $(NEXT_ROOT)/LocalLibrary. Changed Files: * {Framework|Palette}/Makefile * {Framework|Palette}/Makefile.{preamble|postamble} * {Framework|Palette}/PB.project * MiscDelegateFlags.{h|cc} * MiscDrawList.cc * MiscExporter.rtf * MiscTableBorder.cc * MiscTableCell.{h|M|rtf} * MiscTableConnector.{h|M} * MiscTableConnInspector.M * MiscTableScroll.{h|M|rtf} * MiscTableScroll-3.3-4.x.tops * MiscTableScrollData.M * MiscTableScrollInspector.{h|M|nib} * MiscTableScrollKB.M * MiscTableScrollPB.M * MiscTableScrollSort.M * MiscTableTypes.h * MiscTableView.{h|M} * MiscTableViewPrint.M + new.h * NSIBConnector.h (was IBConnector.h) v0.125.8 1997/04/15 08:00 EDT sunshine@sunshineco.com Considerable restructuring in order to better support Windows NT. Broke into Framework and Palette which are contained within a new top-level aggregate project. Consequently removed the MiscBorderViewInline.M hack which had HEX dumps of the tiffs hard-coded right into it. These are now available as resources within the Framework. Now publishes headers, documentation, tops, and image files in Framework. Prefixed "MiscTableScroll/" to all "#import<>" statements since headers now come out of Framework. Added CustomInfo.plist and mucked around in Makefiles for Palette in order to work around shortcoming in either the dll loader or the Objective-C run-time under Windows NT. +[NSBundle load] was failing when both the Framework's dll and the Palette's dll had the same name (MiscTableScroll.dll) even though they came out of *different* directories. D'oh! Worked around this by renaming the executable to MiscTableScrollPalette.dll while leaving the Palette wrapper named MiscTableScroll.palette. The binary-file pack & unpack scripts no longer error out if tiffs or nibs are non-existent. Rewrote pack.sh script for project archiving so it knows about subprojects and lproj directories. Added an unpack.sh whichs knows about subprojects and lproj directories and performs the RCS check-out and .uu file unpacking. Changed Files: + Notes/ (contains all .txt files) + Framework/ (contains all framework related files) + Palette/ (contains all palette related files) + Scripts/ (contains all .sh & .el files) + Makefile (new top-level aggregate makefile) + PB.project (new top-level aggregate project) * pack.sh + unpack.sh * pack_binaries.sh * unpack_binaries.sh + Palette/CustomInfo.plist * MiscTableConnInspector.M * MiscTableScrollInspector.{h|M} * Palette/Makefile * Palette/Makefile.{preamble|postamble} * Palette/PB.project * MiscBorderView.{h|M} * MiscExporter.h * MiscExporterPrivate.h * MiscMouseTracker.h * MiscTableCell.{h|M} * MiscTableConnector.M * MiscTableScroll.{h|M} * MiscTableScrollData.M * MiscTableScrollISearch.M * MiscTableScrollKB.M * MiscTableScrollPB.M * MiscTableScrollPrivate.h * MiscTableScrollSort.M * MiscTableView.{h|M} * Framework/Makefile * Framework/Makefile.{preamble|postamble} * Framework/PB.project v0.125.7 1997/04/09 03:00 EDT sunshine@sunshineco.com Ported back to OPENSTEP 4.1 (gamma) for Mach. The Objective-C++ compiler (under 4.1) does not pre-define the macro __PRETTY_FUNCTION__ which is used by NSCAssert() and relatives. I had to fake it up by placing a conditional compilation directive in MiscTableScrollPrivate.h. Fixed Makefile.postamble so that it can create libMiscTableScroll.a under NT also. Changed Files: * Makefile.postamble * MiscTableScrollPrivate.h v0.125.6 1997/04/04 05:00 EST sunshine@sunshineco.com Ported (as much as possible) to OPENSTEP 4.2 prerelease for Mach. Added -Werror back to Compiler Flags for the NT platform since this is how it should be in the 'final' package and since this is also a problem on 4.2 prerelease for Mach. Since I don't plan on actually supporting the prerelase (and indeed serious compiler bugs prevent me from doing so), I'm not going to save prerelease-patches in the production package. Fixed crasher during archiving/unarchiving (this happened, for instance, when dragging/dropping MiscTableScroll in IB). The problem showed up with the gcc 2.7.2.1 compiler when 'bool' became a built-in type. It turns out that @encode(bool) returns an empty string which causes the NSCoders to barf. This was fixed by assigning the (bool) to a (char) during coding. This also keeps it compatible with the pre-4.2 (bool) type which we faked up via a typedef to (char). Was using NSArchiver* in a number of places where NSCoder* was more appropriate and consistent with the rest of OPENSTEP. Replaced all assert() calls with NSAssert() variations which are more portable and which throw exceptions (which can be caught and logged). Changed Files: + MACH-NT-4.2.txt * MiscBorderView.M * MiscLineWrapper.cc * MiscSparseSet.cc * MiscTableBorder.{h|cc} * MiscTableScroll.M * MiscTableScrollData.M * MiscTableScrollSort.M * MiscTableView.M * MiscTableViewPrint.M - NT-PORT.txt v0.125.5 1997/04/01 08:00 EST sunshine@sunshineco.com Ported (as much as possible) to OPENSTEP 4.2 prerelease for NT. The palette now compiles and loads in IB, though I had to hack around some pretty serious compiler bugs (and actually ended up commenting out some code necessary for making connections in IB -- though I didn't actually save the hacks in the final package). Dragging an MiscTableScroll to a window in IB produces an error at this point. [Fixed in v0.125.6, was a NeXT bug with @encode(bool).] Moved -Werror and -Wwrite-strings from Makefile.preamble into PB.project since compiler on NT spits out warnings that I can't sensibly avoid. Ergo -Werror was removed for NT, though it is still used for Mach. Adjusted MAKE variable for NT in PB.project ('make' rather than 'gnumake'). MiscExporter no longer sends -makeKeyAndOrderFront: & -close messages to the NSSavePanel since, in OPENSTEP for NT, it does not respond to these messages. MiscExporterDBF was unnecessarily shadowing the variable 'c' in -dbfAnalyze:::. MiscExporterDBF's set_time_field() had an unused argument. Fixed bugs in MiscTableScroll.M: - Some methods were failing to return a value. - Some (void) methods were returning a value. - Comparisons between signed and unsigned integers. - Now cancels delegate notifications in -dealloc. Fixed bug in MiscTableScrollData.M: - Some (void) methods were returning a value. Fixed bug in MiscTableScrollEdit.M: - abortEditing was failing to return a value. Fixed bugs in MiscTableBorder.cc: - Was incorrectly retaining 'owner' and never releasing it, hence leaking the MiscTableScroll. - Comparisons between signed and unsigned integers. Fixed bug in MiscTableView: - As a consequence of auto-release mechanism, MiscTableView was being freed *after* MiscTableScroll, however MiscTableView was still referring to the freed MiscTableScroll via its 'scroll' variable, and trying to send messages to it. (This problem showed up when I fixed the bug where MiscTableBorder was retaining but never releasing its 'owner', as mentioned above.) Worked around "dllimport'ed value used as initializer" error in delegate notification code in MiscTableScroll.M under Windows NT. It was using notification messages exported from the AppKit.dll in a static table. Fixed bug: MiscTableTypes.h was incorrectly declaring MiscDefaultCompareSlotFunc as a pointer to a function rather than an actual external function. Fixed bool.h so that it no longer defines 'bool' for (>= 2.7) compiler since 'bool' is now a built-in type. MiscDelegateFlags.h now includes rather than since the OPENSTEP 4.2 prerelease compiler for NT couldn't grok the keyword 'class' following inclusion of . (I haven't looked closely at objc.h yet to find out why this happened. Anyhow, NSObject.h is more portable than objc.h.) Fixed bugs in MiscDelegateFlags.cc: - objcToSel() was using '=' in conditional rather than '=='. - A meaningless and redundant 'const' was removed from a reference. Eliminated gcc 2.7.2.1 warning about possible uninitialized variable in MiscDrawList::draw_text(). Fixed comparisions between signed and unsigned integers in MiscSparseSet. Added, possibly temporary, -ObjC++ flag to CCFILES in Makefile.postamble. This is required for gcc 2.7.2.1 in order to get it to recognize Objective-C code (which we do have in .cc files). I've reported this problem to NeXT but have not received a reply yet. The problem is that their makefiles now presume that *only* .M files contain Objective-C++, and that .cc files contain only C++. Changed Files: * bool.h * Makefile * Makefile.preamble * MiscDelegateFlags.{h|cc} * MiscDrawList.cc * MiscExporter.M * MiscExporterDBF.M * MiscSparseSet.cc * MiscTableBorder.cc * MiscTableConnInspector.M * MiscTableScroll.M * MiscTableScrollData.M * MiscTableScrollEdit.M * MiscTableTypes.h * MiscTableView.{h|M} * MiscTableViewPrint.M * PB.project v0.125.4 1997/03/23 05:45 EST sunshine@sunshineco.com Ported MiscTableCell.rtf to OPENSTEP. Ported MiscExporter.rtf to OPENSTEP. Worked around OPENSTEP 4.1 bug where -setupFieldEditorAttributes: never gets called -- so MiscBorderCell was not drawing with white text. I worked around the problem by subclassing from NSTextFieldCell rather than NSCell. This way I was able to use -setTextColor: to get the correct color. MiscConnector now uses object_setInstanceVariable() exclusively. It no longer tries to constructs a setter method name out of the outlet name (i.e. outlet='foo', construct='-setFoo:'). v0.125.3 1997/03/21 18:30 EST sunshine@sunshineco.com Fixed bug: -[MiscTableView awaitDragEvent:atRow:column:] was using NSLeftMouseDraggedMask in three places it should have used NSLeftMouseDragged. pack.sh script now creates a package with a filename containing the string "OPENSTEP" so that it is distinguished from the NEXTSTEP version. v0.125.2 1997/03/21 02:00 EST sunshine@sunshineco.com Fixed bugs in -[MiscTableScroll textDidEndEditing:]: - Logic to check if string had been edited was reversed. - String which was extracted from field-editor was only retain'd rather than copy'd. When -[NSCell endEditing:] was called, it emptied the contents of this string before its value could be used. v0.125.1 1997/03/20 19:40 EST sunshine@sunshineco.com Applied v0.125 NEXTSTEP 3.3 diffs. v0.124.1 1997/03/20 19:30 EST sunshine@sunshineco.com Applied v0.124 NEXTSTEP 3.3 diffs. v0.123.1 1997/03/20 19:20 EST sunshine@sunshineco.com Applied v0.123 NEXTSTEP 3.3 diffs. Removed -reflectSelection --> -selectionChanged conversion from 'tops' script since -reflectSelection has been removed from NEXTSTEP 3.3 TableScroll as well. Added new [de]selection methods to 'tops' script: selectCol:byExtension: --> selectColumn:byExtension: border:selectTags:byExtension: --> border:selectSlotTags:byExtension: selectRowTags:byExtension: --> selectRowTags:byExtension: selectColTags:byExtension: --> selectColumnTags:byExtension: border:selectSlots:byExtension: --> border:selectSlots:byExtension: selectRows:byExtension: --> selectRows:byExtension: selectCols:byExtension: --> selectColumns:byExtension: deselectCol: --> deselectColumn: border:deselectTags: --> border:deselectSlotTags: deselectRowTags: --> deselectRowTags: deselectColTags: --> deselectColumnTags: border:deselectSlots: --> border:deselectSlots: deselectRows: --> deselectRows: deselectCols: --> deselectColumns: v0.122.1 1997/03/20 17:50 EST sunshine@sunshineco.com Applied v0.122 NEXTSTEP 3.3 diffs. v0.121.1 1997/03/20 17:10 EST sunshine@sunshineco.com Applied v0.121 NEXTSTEP 3.3 diffs. v0.120.1 1997/03/20 17:00 EST sunshine@sunshineco.com Applied v0.120 NEXTSTEP 3.3 diffs. v0.119.1 1997/03/20 16:40 EST sunshine@sunshineco.com Applied v0.119 NEXTSTEP 3.3 diffs. v0.118.1 1997/03/20 15:35 EST sunshine@sunshineco.com Applied v0.118 NEXTSTEP 3.3 diffs. v0.117.1 1997/03/20 15:25 EST sunshine@sunshineco.com Applied v0.117 NEXTSTEP 3.3 diffs. v0.116.1 1997/03/20 15:15 EST sunshine@sunshineco.com Applied v0.116 NEXTSTEP 3.3 diffs. v0.115.1 1997/03/20 14:50 EST sunshine@sunshineco.com Applied v0.115 NEXTSTEP 3.3 diffs. v0.114.1 1997/03/11 05:30 EST sunshine@sunshineco.com Applied v0.114 NEXTSTEP 3.3 diffs. Fixed v0.113.1 compilation problems in MiscExporterASCII.M. v0.113.1 1997/03/10 01:30 EST sunshine@sunshineco.com Applied v0.113 NEXTSTEP 3.3 diffs. Removed errant semi-colon from -[MiscTableScroll selectCols:]. Added explicit (id) return type to -[MiscBorderView -initWithFrame...]. Added new cell-editing related methods to 'tops' script. For greater OPENSTEP consistency, renamed: reenableCursor --> enableCursor getDocClipFrame --> documentClipRect colOrder --> columnOrder setColOrder: --> setColumnOrder: colOrderAsString --> columnOrderAsString setColOrderFromString: --> setColumnOrderFromString: colSizes --> columnSizes setColSizes: --> setColumnSizes: colSizesAsString --> columnSizesAsString setColSizesFromString: --> setColumnSizesFromString: hasColSelection --> hasColumnSelection hasMultipleColSelection --> hasMultipleColumnSelection numSelectedCols --> numSelectedColumns colIsSelected: --> columnIsSelected: selectedColTags --> selectedColumnTags selectedCols --> selectedColumns selectCol: --> selectColumn: selectColTags: --> selectColumnTags: selectCols: --> selectColumns: selectAllCols --> selectAllColumns clearColSelection --> clearColumnSelection cursorCol --> cursorColumn setCursorCol: --> setCursorColumn: clearCursorCol --> clearCursorColumn hasValidCursorCol --> hasValidCursorColumn colBorder --> columnBorder colTitlesOn --> columnTitlesOn setColTitlesOn: --> setColumnTitlesOn: colTitleMode --> columnTitleMode setColTitleMode: --> setColumnTitleMode: colTitlesHeight --> columnTitlesHeight setColTitlesHeight: --> setColumnTitlesHeight: moveColFrom:to: --> moveColumnFrom:to: colPosition: --> columnPosition: colAtPosition: --> columnAtPosition: uniformSizeCols --> uniformSizeColumns sizeableCols --> sizeableColumns draggableCols --> draggableColumns modifierDragCols --> modifierDragColumns colAdjustedSize: --> columnAdjustedSize: colSize: --> columnSize: colMinSize: --> columnMinSize: colMaxSize: --> columnMaxSize: colDataSize: --> columnDataSize: colIsSizeable: --> columnIsSizeable: colExpandsToData: --> columnExpandsToData: colIsAutosize: --> columnIsAutosize: colTitle: --> columnTitle: colTag: --> columnTag: colCellType: --> columnCellType: colCellPrototype: --> columnCellPrototype: setSizeableCols: --> setSizeableColumns: setDraggableCols: --> setDraggableColumns: setModifierDragCols: --> setModifierDragColumns: setUniformSizeCols: --> setUniformSizeColumns: setCol:size: --> setColumn:size: setCol:minSize: --> setColumn:minSize: setCol:maxSize: --> setColumn:maxSize: setCol:dataSize: --> setColumn:dataSize: setCol:sizeable: --> setColumn:sizeable: setCol:expandsToData: --> setColumn:expandsToData: setCol:autosize: --> setColumn:autosize: setCol:title: --> setColumn:title: setCol:tag: --> setColumn:tag: setCol:cellType: --> setColumn:cellType: setCol:cellPrototype: --> setColumn:cellPrototype: numVisibleCols --> numVisibleColumns firstVisibleCol --> firstVisibleColumn lastVisibleCol --> lastVisibleColumn colIsVisible: --> columnIsVisible: setFirstVisibleCol: --> setFirstVisibleColumn: setLastVisibleCol: --> setLastVisibleColumn: drawCol: --> drawColumn: scrollColToVisible: --> scrollColumnToVisible: drawColTitle: --> drawColumnTitle: autoSortCols --> autoSortColumns setAutoSortCols: --> setAutoSortColumns: colSortVector --> columnSortVector setColSortVector: --> setColumnSortVector: sortCols --> sortColumns colsAreSorted --> columnsAreSorted sortCol: --> sortColumn: colIsSorted: --> columnIsSorted: compareCols::info: --> compareColumns::info: compareCols:: --> compareColumns:: colSortFunc: --> columnSortFunction: colSortDirection: --> columnSortDirection: colSortType: --> columnSortType: setCol:sortFunc: --> setColumn:sortFunction: setCol:sortDirection: --> setColumn:sortDirection: setCol:sortType: --> setColumn:sortType: doIncrementalSearch:col:--> doIncrementalSearch:column: getISearchCol: --> getISearchColumn: doGetISearchCol: --> doGetISearchColumn: compareSlotFunc --> compareSlotFunction setCompareSlotFunc: --> setCompareSlotFunction: border:slotSortFunc: --> border:slotSortFunction: border:setSlot:sortFunc:--> border:setSlot:sortFunction: rowSortFunc: --> rowSortFunction: setRow:sortFunc: --> setRow:sortFunction: setColExportTitleMode: --> setColumnExportTitleMode: setColExportGridMode: --> setColumnExportGridMode: getColExportTitleMode --> getColumnExportTitleMode getColExportGridMode --> getColumnExportGridMode tableScroll:getISearchCol: --> tableScroll:getISearchColumn: v0.112.1 1997/02/09 12:00 EST sunshine@sunshineco.com Applied v0.112 NEXTSTEP 3.3 diffs. Fixed bug: -[MiscBorderView dragEvent:inPos:] was only redrawing itself rather than both itself *and* the MiscTableView after a slot had been dragged to a new position. v0.111.1 1997/02/09 08:40 EST sunshine@sunshineco.com Applied v0.111 NEXTSTEP 3.3 diffs. v0.110.1 1997/02/09 06:00 EST sunshine@sunshineco.com Applied v0.110 NEXTSTEP 3.3 diffs. Removed errant semi-colon and added explicit (id) return type to -[MiscTableCell copyWithZone:]. Fixed bug: MiscDrawList was unconditionally using screen-font -- even for printing. v0.109.1 1997/02/07 10:00 EST sunshine@sunshineco.com Applied v0.109 NEXTSTEP 3.3 diffs. v0.108.1 1996/12/31 07:00 EST sunshine@sunshineco.com Applied v0.108 NEXTSTEP 3.3 diffs. Renamed more methods to be consistent with OPENSTEP specification: border:findSlotWithTag: --> border:slotWithTag: findColWithTag: --> columnWithTag: findRowWithTag: --> rowWithTag: findCellWithTag:row:col:--> getRow:column:ofCellWithTag: findCell:row:col: --> getRow:column:ofCell: Updated tops script accordingly. v0.107.1 1996/12/30 09:00 EST sunshine@sunshineco.com Applied v0.107 NEXTSTEP 3.3 diffs. v0.106.1 1996/12/30 07:00 EST sunshine@sunshineco.com Applied v0.106 NEXTSTEP 3.3 diffs. v0.105.1 1996/12/30 06:30 EST sunshine@sunshineco.com Applied v0.105 NEXTSTEP 3.3 diffs. v0.104.1 1996/12/30 03:00 EST sunshine@sunshineco.com Applied v0.104 NEXTSTEP 3.3 diffs. v0.103.4 1996/12/25 23:30 EST sunshine@sunshineco.com Ported to OPENSTEP 4.1 (gamma). v0.103.3 1996/05/13 08:00 EDT sunshine@sunshineco.com For consistency with other methods, renamed: border:insertSlotAt: --> border:insertSlot: border:removeSlotAt: --> border:removeSlot: Removed rogue code from TableScrollISearch which should have been deleted when v0.102 NEXTSTEP 3.3 diffs were applied. TableScroll.M's -font now returns (NSFont*) rather than (id) to be in agreement with header. Did considerable work on "tops" script. It is now tested and working. Made the following changes: - Internal names are now much more consistent throughout. - Added all of the -set...Gray: variations. - Added conversion for -reflectSelection --> -selectionChanged. - Fixed numerous syntax errors in script itself. - Fixed bug: was adding extra semi-colon after vector access methods which returned a length. - Fixed bug: -border:physicalToVisual and -border:visualToPhysical replacement was not working. - Added missing conversions for -colOrderAsString, -colSizesAsString, -rowOrderAsString:, and -rowSizesAsString. - Fixed bug: -...AsString methods produced "var1 = var2 = [...];" if result was already being assigned to var1. - Fixed bug: wasn't converting andReturnType: --> returnType:. - Added conversions for -border:insertSlot:, border:removeSlot:. - Added missing -cellWithTag: and -cellWithTag:row:col: conversions. - Now converts return type of delegate methods to (void), (id), and (NSString*) as appropriate. Also converts delegate arguments from (NXAtom) to (NSString*) as needed. v0.103.2 1996/05/07 10:00 EDT sunshine@sunshineco.com Fixed bug: TableCell was retaining colors one time too many when unarchiving them. Fixed bug: TableScroll was retaining objects when unarchiving which it never releases: delegate, dataDelegate, target, doubleTarget. For classes which archive themselves, bumped version numbers way up (to 1000) so that NEXTSTEP 3.3 TableScroll has room to grow. Added a few missing explicit (id) for return types and argument types. Added a missing explicit (NSPasteboard*) argument type. Converted slotSortVector from an int array to an NSArray. Under OpenStep, -selectionChanged and -reflectSelection had identical functionality, so dropped -reflectSelection altogether. Renamed the following methods for consistency with other method names: border:selectTags: --> border:selectSlotTags: border:setCursor: --> border:setCursorSlot: border:setTitlesOn: --> border:setSlotTitlesOn: border:setTitleMode: --> border:setSlotTitleMode: Cleaned up tops script considerably. Added rules for new -slotSortVector type. Added extra warnings for trouble spots. v0.103.1 1996/05/07 02:30 EDT sunshine@sunshineco.com Applied v0.103 NEXTSTEP 3.3 diffs. v0.102.1 1996/05/06 04:30 EDT sunshine@sunshineco.com Applied v0.102 NEXTSTEP 3.3 diffs. v0.101.1 1996/04/30 05:30 EDT sunshine@sunshineco.com Ported v0.101 from NEXTSTEP 3.3 to OPENSTEP 4.0 (prerelease 2). MiscKit2/Palettes/MiscTableScroll/Notes/OPENSTEP-TODO.txt100444 1750 1750 17752 6757227352 23203 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll OPENSTEP TODO // $Id: OPENSTEP-TODO.txt,v 1.11 99/06/18 20:09:01 sunshine Exp $ //----------------------------------------------------------------------------- TODO: ---- - Ditch use of PS-wrap on MacOS/X Server if possible since DisplayPostScript is deprecated. Instead use NSDottedFrameRect(). Note that this function is available as of OpenStep 4.2, but not earlier. - Ditch use of all other direct PostScript calls on MacOS/X Server if possible. This will affect MiscLineWrapper, MiscTableView, MiscTableViewPrint at minimum. - Write 3.3 -> 4.x porting document. Describe changes between the versions. Describe major gotchas. Describe tops script. - MISC_FRAME_HEIGHT should be derived at run-time from the height of an MiscBorderCell rather than being hard-coded at compile-time. There is no guarantee that the hard-coded value will be the correct for any given platform. - All of the exporters are merely taking -lossyCString. This may be suitable for ASCII and DBF, but it needs to be reviewed and probably use NSString methods for doing as much of the work as possible. - Exporters are allocating arrays of integers. Should probably upgrade to NSArray of NSNumber. - Rewrite the pasteboard code. Apparently I broke the "subclassibility" when I ported it. Paul says that the methods should be writing to something like an NSData object rather than returning strings so that subclasses can write whatever appropriate data types they may have. Don't just limit it to strings. - Consider making all instance variables completely private by hiding them behind a single _priv instance variable as is done with some of the Foundation and AppKit objects. Now that TableScroll is a framework, this could prevent potential problems with subclasses if/when we need to add or remove instance variables. DONE: ---- v140.1 - Port to MacOS/X Server DR2. - Update all nib files to conform to new UI guidelines; example programs too. - Fix compilation using ProjectUnity so that project compiles on OpenStep 4.2 as well as MacOS/X Server for Mach and Windows. - Expose MiscTableScroll, MiscTableCell, and MiscExporter to Java. - Turn notification-style delegate messages into real notifications in order to be more OPENSTEP compliant and flexible. (Obviously this can't be done for methods which return a value, but it can be done for the others.) Automatically register the delegates as recipients of the new notifications. - Update 'tops' script to reflect delegate messsages which now receive NSNotification. - Ensure that file owner and permissions are correct on all nib files after editing them to conform to latest UI guidelines. - For Java consistency, move notification-style delegate messages into a Notifications category/interface. - Document new notifications. Fix delegate method documentation to indicate that delegate now recieves NSNotifcation for specific messages. - Rename NSIBConnector.h to NSNibConnector.h. - For better OpenStep conformance, rename these methods. Also update 'tops' script, 'jobs' script, and documentation to reflect the changes. border:slotDraggedFrom:to: --> border:slotDragged:toSlot: border:selectSlot:byExtension: --> border:selectSlot:byExtendingSelection: border:selectSlots:byExtension --> border:selectSlots:byExtendingSelection: border:selectSlotTags: --> border:selectSlotsWithTags: border:selectSlotTags:byExtension --> border:selectSlotsWithTags:byExtendingSelection: border:deselectSlotTags: --> border:deselectSlotsWithTags: selectRow:byExtension: --> selectRow:byExtendingSelection: selectRows:byExtension: --> selectRows:byExtendingSelection: selectRowTags: --> selectRowsWithTags: selectRowTags:byExtension: --> selectRowsWithTags:byExtendingSelection: deselectRowTags: --> deselectRowsWithTags: selectColumn:byExtension: --> selectColumn:byExtendingSelection: selectColumns:byExtension: --> selectColumns:byExtendingSelection: selectColumnTags: --> selectColumnsWithTags: selectColumnTags:byExtension: --> selectColumnsWithTags:byExtendingSelection: deselectColumnTags: --> deselectColumnsWithTags: drawClippedText --> drawsClippedText setDrawClippedText: --> setDrawsClippedText: trackingBy --> selectsByRows trackBy: --> setSelectsByRows: tracking --> isTrackingMouse stringForNSTabularTextPBoardType --> stringForNSTabularTextPboardType getISearchColumn: --> getIncrementalSearchColumn: doGetISearchColumn: --> doGetIncrementalSearchColumn: tableScroll:getISearchColumn: --> tableScroll:getIncrementalSearchColumn: - Add "Using TableScroll from Java" section to MiscTableScroll.rtf. - Add support for setting of "represented object". Client should be able to set represented object for the entire TableScroll as well as for each slot. Retain the represented object when set and release it when cleared. Also release it when storage for the represented object array in the border is freed. To be consistent with the AppKit, must also save and restore the represented object during archiving and unarchiving. Add new methods to Java 'jobs' file. Document new methods, and document the fact that the represented object is retained, released, and archived. Add "See Also" entries to -tag and -setTag: which refer to the represented object. Likewise, refer to -tag and -setTag: from the represented object methods. - Verify that new notification variables are properly exported on Windows. - Fix platform.make in all projects. It incorrectly prefixes Windows variables with $(NEXT_ROOT) even though the "real" YellowBox makefiles do not. Also add $(NEXT_ROOT) to all installation directories as appropriate in project files. - Blast the unused & invalid PrivateHeaders link in the installed framework. - Fix README to take directory structure differences into account between MacOS/X Server and OpenStep. Also document new Java exposure. - Before generating final package, fix permissions on *.sh and RCS/*.sh,v files since the execute-bit keeps getting clobbered by Windows. - Remove unused functions from mcgh2misc.sh: SETUP_DOCS(), SETUP_HEADERS(). - Update mcgh2misc scripts to handle new Java exposure. At minimum, need to add "jobs" file to list of files to convert. Also need to include new platform.make and make.sh. Take extra special care with make.sh since normally all *.sh files are blasted by the script. Also convert Java package name from org.misckit to org.misckit. Convert .sed script and .java files inside new Java subproject as well. - Fix mcgh2misc to filter output of Emacs batch processing so that only important messages are displayed. - Fix mcgh2misc to accept source and target directories on the command line. If not specified, use "." for source and "$(HOME)" for target. Remove requirement that script must be run from within MiscTableScroll directory. - Fix mcgh2misc so that it checks out files from source RCS directly into target directories instead of first copying RCS directories to target and only then performing check out. Should be able to remove the copy step altogether. - Fix mcgh2misc to automatically copy MiscKit license files into package. v138.1 - Honor the user's color preferences by taking advantage of the new NSColor "system" color methods. - Change MiscBorderCell so that it more closely matches NSTableHeaderCell aesthetically. v133.1 - Update all -makeCellsPerform: methods to -makeCellsPerformSelector:. Also fix 'tops' script accordingly. v128.1 - Fix mcgh2misc scripts to handle new framework/palette structure as soon as I hear back from Mr. MiscKit about the organization he requires for MiscKit 2.0. [07/07/97 - He has failed to answer the two letters I sent him about this. I'm just going to organize it the way I feel like organizing it.] MiscKit2/Palettes/MiscTableScroll/Notes/SELECTION-NOTES.txt100444 1750 1750 2523 6757227301 23356 0ustar sunshinesunshineSELECTION-NOTES GOAL: Cell-wise and slot-wise selection. STRATEGIES: SparseSet2D PRO + Assuming that the selection is usually a reasonably small number of contiguous regions, this should have considerable storage savings. CON - Complicated. Bit Map PRO + Simple. CON - Storage grows linearly with table size. Can get quite large for large tables. Even though lazy-mode might be able to handle a table with a million rows, the storage requirements for the selection might make it infeasible. - Could be quite slow to initialize / clear when it gets big. - Inserting and deleting rows/cols will be tricky and slow. Use "state" in Cells. PRO + Simple. + More like Matrix. + Storage is already taken care of. + Cells know their own state, so know how to draw themselves. CON - Lazy mode is problematic. Client needs to manage storage for selection. - erik hatez it. SparseSet o One per column o One per row o One for entire grid (index = ((row * NCOLS) + col)) PRO + Use existing code. CON - These techniques can easily get hammered by a single "select column" (or "select row") which results in huge amounts of space being used to store the selection in large tables, thus defeating the entire reason for using them. MiscKit2/Palettes/MiscTableScroll/Notes/TODO.txt100444 1750 1750 12120 6757227352 21730 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableScroll TODO // $Id: TODO.txt,v 1.44 99/06/29 07:56:57 sunshine Exp $ //----------------------------------------------------------------------------- TODO: ---- ** DOCUMENTATION - Usage tips for sorting. - Usage tips for editing. - Common problems ("Gotchas") section. ** KEYBOARD - Add a keyboard equivalent to start text editing in a cell. (Should probably be "return" to maintain symmetry with the mouse double-click. Makes the most sense when cell-wise selection is finally developed and key focus identifies an individual cell instead of an entire slot.) - Consider adding support for up/down keys during editing which would edit the previous and next cells in the current column, respectively. Having done so in Clue.app, we see how extremely nice this feature is. - Upgrade keyboard interaction to mirror OpenStep conventions: Ctrl-tab and Ctrl-Shift-tab when plain tab has other interpretations. ** SELECTION - Cell-wise selection. - Add ability to disable selection -- both for the entire object and for individual slots/cells. - Centralize selection-mode handling during mouse & keyboard tracking. Right now this is spread throughout TableView, BorderView, TableScrollKB, and TableScrollISearch. Each needs to perform selection via either mouse or keyboard, and each reimplements much of the same code. - Need to revamp mouse-tracking, selection. - Allow all cells under mouse to participate in mouse-tracking rather than *only* the first cell under which the mouse went down. - Possibly support single-click-to-edit. This also turned out to be a nice feature in Clue.app. ** DRAGGING - Add dragging-destination support so that images can be dragged-in and dropped on cells. The delegate should get appropriate messages. ** DRAWING - Use display: mechanism to perform drawing. This will fix problems of subviews not getting drawn. - MiscTableView -- route drawRect: through a cell-coordinate oriented -doDrawRange:::: and provide a public -drawRange::: method. Most places where drawing is done in the code, we know the cell coordinates. It does not make sense to convert them to NXRect visual rectangle only to convert it back to cell coordinates. - Fix the handling of the grid. The width for the grid lines should not count as part of the width of the slots. It should be separated from the slots themselves entirely. Move grid drawing out of the *BORDER* cells. (This has already been done for the *table* cells.) - Provide public access / IB methods for selecting grid styles. ** PRINTING - Finish user-supplied page headers/footers. ** FUNCTIONALITY - User should be able to set the width/height of row/col titles, just like resizing normal slots. - Allow copyFont / pasteFont operations. - Add non-anchored incremental search, plus previous/next mechanism. - Add search (find) support. ** INTERFACE BUILDER - Use AltViews / SwapViews in the IB inspector. That panel is way too crowded and we need to add even more stuff. ** MISCELLANEOUS - The C++ MiscTableBorder stuff should be doing its allocations from the table scroll's zone. - Consider adding facilities to automatically save column order and sizes to NeXT defaults (like Window does). - Figure out how icon cells should work precisely. Should they take control of the image display in any way? For instance, if the cell is too small to contain the entire image should it be cropped? Scaled? Not shown? - Subclass hooks for choosing subclass subviews -- make some means for the programmer to choose a different subclass for the table-view, border-view, corner-view. - It has been suggested some methods, such as -deleteRowAt: should throw an exception if the specified row is invalid. This is probably a religious issue, as some people prefer to be very explicit about having to manually check limits, whereas other people prefer that the object be forgiving and simply ignore bad input. On the other hand, there are certainly some cases where ignoring bad input is improper behavior and an exception probably should be thrown in these cases. For instance, there is no sensible value which -tagAtRow: can return when provided with invalid input. Currently it simply returns 0 in this case, but there is no way to determine, from the return value alone, if the row's tag really was 0 or if the row number was simply invalid. DONE: ---- v140 - Stop converting source to 4-space tabs as suggested by the MiscKit guidelines. This decision is motivated by a personal desire to distribute code formatted in a fashion which I prefer. v138 - Dragging-source stuff should also respond to -shouldDelayWindowOrderingForEvent:. Also add a delegate hook. v137 - Add an unsort{Rows|Cols|Slots:} method. (Restore original physical order). border:setSlotOrder: now accepts a null pointer to unsort the slots. v136 - Use NXOrderStrings() for case-insensitive comparisons in MiscTableScroll(Sort) and MiscTableScroll(IncrementalSearch) MiscKit2/Palettes/MiscTableScroll/Palette/ 40755 1750 1750 0 6757227356 20625 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/ 40755 1750 1750 0 6757227352 23337 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableConnInspector.nib/ 40755 1750 1750 0 6137344377 30455 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableConnInspector.nib/objects.nib100444 1750 1750 1365 6757227353 32702 0ustar sunshinesunshine streamtyped@NSIBObjectDataNSObjectNSCustomObject)@@NSString+MiscTableConnInspectoriNSWindowTemplate) iiffffi@@@@@cWb lx@ InspectorNSPanelViewNSView) NSResponder @@@@ffffffffNSMutableArrayNSArray NSCustomView)mmMiscTableScrollmmMiscTableScroll l lffffcInspector Window File's Owner NSMutableSetNSSetINSIBOutletConnector NSIBConnector@@@windowdelegate actionScroll outletScroll @i  MiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableConnInspector.nib/data.classes100444 1750 1750 304 6757227353 33017 0ustar sunshinesunshine"MiscTableConnInspector" = {OUTLETS = (actionScroll, outletScroll); SUPERCLASS = IBInspector; }; "MiscTableScroll" = {SUPERCLASS = NSScrollView; }; "FirstResponder" = {CATEGORY = LocalActions; }; MiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScroll.nib/ 40755 1750 1750 0 6127733445 27124 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScroll.nib/objects.nib100444 1750 1750 1200 6757227353 31340 0ustar sunshinesunshine streamtyped@NSIBObjectDataNSObjectNSCustomObject)@@NSString+MiscTableScrollPaletteiNSView) NSResponder @@@@ffffffffNSMutableArrayNSArray NSCustomView) MiscTableScroll  NSWindowTemplate) iiffffi@@@@@c x` Palette ViewNSPanelViewffffc File's OwnerPalette Window NSMutableSetNSSetINSIBOutletConnector NSIBConnector@@@originalWindow tableScroll@i MiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScroll.nib/data.classes100444 1750 1750 345 6757227353 31476 0ustar sunshinesunshine"MiscTableScrollPalette" = {OUTLETS = (tableScroll); SUPERCLASS = IBPalette; }; "MiscTableScroll" = {OUTLETS = (dataDelegate, delegate, doubleTarget); SUPERCLASS = NSScrollView; }; "FirstResponder" = {CATEGORY = LocalActions; }; MiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScrollInspector.nib/ 40755 1750 1750 0 6757227354 31021 5ustar sunshinesunshineMiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScrollInspector.nib/data.classes100444 1750 1750 3467 6757227353 33415 0ustar sunshinesunshine"FirstResponder" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSObject; }; "MiscTableScroll" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSScrollView; }; "MiscTableScrollInspector" = { ACTIONS = { "doAlign:" = id; "doAutoSort:" = id; "doAutosize:" = id; "doBorder:" = id; "doCellClass:" = id; "doColorBack:" = id; "doColorBackSelected:" = id; "doColorText:" = id; "doColorTextSelected:" = id; "doDelete:" = id; "doDown:" = id; "doDraggable:" = id; "doEnabled:" = id; "doLazy:" = id; "doMode:" = id; "doNew:" = id; "doSizable:" = id; "doSizing:" = id; "doSlot:" = id; "doSortDirection:" = id; "doSortType:" = id; "doTitleMode:" = id; "doTitles:" = id; "doUp:" = id; "doUserSizeable:" = id; }; OUTLETS = { alignMatrix = id; autoSortSwitch = id; autosizeSwitch = id; borderPopUp = id; cellClassPopUp = id; colorBack = id; colorBackSelected = id; colorText = id; colorTextSelected = id; deleteButton = id; downButton = id; draggableSwitch = id; enabledSwitch = id; lazySwitch = id; modePopUp = id; sampleTextNormal = id; sampleTextSelected = id; sizableSwitch = id; sizeField = id; sizeMaxField = id; sizeMinField = id; slotScroll = id; sortDirectionPopUp = id; sortTypePopUp = id; titleField = id; titleModePopUp = id; titlesSwitch = id; uniformSizeField = id; upButton = id; userSizeableSwitch = id; }; SUPERCLASS = IBInspector; }; MiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScrollInspector.nib/GoDown.tiff100444 1750 1750 3016 6706366475 33165 0ustar sunshinesunshineMM*U_"/2?#?2?#/2?"/"?2O#?3O#?2O#?2?#?3?2O3?2O3?2O#?2?3O#O3O4O3O#?3O#?3?CO3O3O3O3O3?3O3_4_D_4O3_4O3O3O4OC_4OC_4OC_4OCOD_4_Do4_D_4_4_4OE_DoD_DoD_D_D_C_DoEoDoEoDoE_D_4_3_U_4ODoEoToEoToEoToEoDoD_C_4O3O3?2?E_EEoUEoUEoEoE_Do4_D_4O3OUoUVoUUoUEoToD_D_4OCOFUVUEoUEoDo4_D_VUVUEoToD_C_VUFUEoDoUUEoDoEoDo (R@ ' ' P8$ JxL. B>-F"p"U V@pd G `Yd @ P! AA$ ¡R'V1 ?0~?ߐYK ?0#YC& U(RBL ' 'MiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScrollInspector.nib/GoUp.tiff100444 1750 1750 3022 6706366474 32636 0ustar sunshinesunshineMM*#?"?#?2?#?2?#?3O#?3O#?3O3?3O3?3O3?3O3?2O4O3O4O3_4O3O#O3O#O3O3O3O4OC_4OC_4OCO3O3O3?2?4O3_4OD_4_D_4_C_4_3_4O3O#O3O3OC_4OC_D_D_D_D_D_C_4OC_3O3O#?2?U_5_DoE_DoE_Do4_D_4_E_ToE_DoE_D_D_C_UEoUoEoDoEoDo4_UoUEoToEoDoD_C_UFUEoUoEoDo4_VUUUEoToD_D_VVUEUEoDo4_VeVUEoDoD_C_fVUFoEoE_Do4_VUUoUoE_DoD_C_U_ (RD ' ' P8$ S\JxUxh/D@;&DF[,e)]5, P! .xCo8Ç1^?%yhb[&2W4ͦSt >U (RHJ ' '././@LongLink 0 0 0 150 0 10702 Lustar rootwheelMiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScrollInspector.nib/MiscAlignLeft.tiffMiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScrollInspector.nib/MiscAlignLeft.100444 1750 1750 502 6706366475 33555 0ustar sunshinesunshineMM* <<  "*2:(RD<< ' '././@LongLink 0 0 0 151 0 10703 Lustar rootwheelMiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScrollInspector.nib/MiscAlignRight.tiffMiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScrollInspector.nib/MiscAlignRight100444 1750 1750 502 6706366475 33662 0ustar sunshinesunshineMM* "*2:(RD<< ' 'MiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScrollInspector.nib/objects.nib100444 1750 1750 25651 6757227354 33270 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+MiscTableScrollInspectoriSNSButton NSControl)NSView) NSResponder @@@@ffffffffNSMutableArrayNSArray%j(EEicc@ NSButtonCell9 NSActionCellNSCell<ii@@@@TitlesNSFont[20c] Helveticaf ci: ssIi@@@@@<@NSCustomResource)NSImageNSSwitchNSHighlightedSwitchjEESizable<@(WW Draggable<@ NSPopUpButtonWhh`ListpopUp:NSMenuTemplate) ffccc@@@@' OtherViews NSPopUpListNSMatrix<h<h<#iiii:::ffffi@@@@@ NSMenuItem NSMenuCellh@Radio@ Highlight@NSColorffɨĆWYY@NXpopupNXpopupH:XMMEnabledЬ<@ NSTextField$zNSTextFieldCell=q@ӄc@@ʪ@@@SystemtextBackgroundColorɆʪ؄controlTextColorʪԒ}!!֥TitleݻچLaa`Text' OtherViewsaPaPa⨅嬁@Image嬁@Button嬁@ Call Back嬁@ɨ熄Aaaଁ@΅Ԓ4VV֥q@80چԒ##֥MinچԒVV֥q@10چԒ##֥MaxچԒVV֥q@ 1234567890چԒ7##֥SizeچBBDelete@ Helvetica BB@GoUpBB @GoDownZX99Lazy <@cc User Sizableȁ`ȁg0ȿȁfȁ9ȁcȁ+ȁpȁȁ-ȁ~ȁ|ȁ1ȁMȱȁhȁAȁ;ȁqȁȁ+KPYȁKF"6ȁcȁȁ{+ȁ~WȁnbT3ȁfȁ]Jȁ"xȁȁxȁaȁeȻ)ȁ%]ȁ<Z# ȁxsNȁ|ȁ_ȁl)Pȁ)ȁdȁwȁ 3/ȁODȁbȁ;ȁ{ȁvȁk_Sȁnȁȁ#'T(0ȁ98ȁpȁȁȁ\ȴ.ȁSȁi&`XȁvAȁ[ȁ ȁmȁwBȁQȁZȁCȷQș4ȁKȁ ȁ!ȁrȁ`ȕȁYȁoȁVȁ7N2ȁ%ȁuȁaȁXȁ9BfGȁg =ȁlȁȁW\^ȁHȁȁkȁ5ȁyȁ'ȁU ȁIȁ ȁȁȁ3/@ȁtȁe^Zȁhȁȁ '[Ȣ ȁ ././@LongLink 0 0 0 152 0 10704 Lustar rootwheelMiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScrollInspector.nib/MiscAlignCenter.tiffMiscKit2/Palettes/MiscTableScroll/Palette/English.lproj/MiscTableScrollInspector.nib/MiscAlignCente100444 1750 1750 502 6706366475 33643 0ustar sunshinesunshineMM*?? "*2:(RD<< ' 'MiscKit2/Palettes/MiscTableScroll/Palette/CustomInfo.plist100444 1750 1750 60 6757227355 24016 0ustar sunshinesunshine{ NSExecutable = MiscTableScrollPalette; } MiscKit2/Palettes/MiscTableScroll/Palette/MiscTableConnInspector.h100444 1750 1750 5503 6757227354 25442 0ustar sunshinesunshine#ifndef __MiscTableConnInspector_h #define __MiscTableConnInspector_h //============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableConnInspector.h // // A custom Interface Builder connection inspector so that the // doubleTarget and doubleAction can be set. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableConnInspector.h,v 1.3 99/06/14 19:25:13 sunshine Exp $ // $Log: MiscTableConnInspector.h,v $ // Revision 1.3 99/06/14 19:25:13 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Nib connector classes changed name in MacOS/X Server from NSIBConnector, // to NSIBOutletConnector, and NSIBControlConnector to NSNibConnector, // NSNibOutletConnector, and NSNibControlConnector, respectively. // The "Name" column on the outlet and action MiscTableScrolls now autosizes // since the old hardcoded size is inappropriate for MacOS/X Server DR. // Worked around problem introduced in MacOS/X Server and YellowBox DR2. // Symptom was that method in action list for action and doubleAction was // not being selected when inspected for nibs which had been loaded from a // file. Problem was that -[IBClassData actionsOfClass:] no longer appends // a colon ":" to returned action names, as it did previously. We were doing // a simple string comparison to locate the name in the action list which // consequently failed. Now canonicalizes names before comparison. // Now uses NSStringFromClass() in place of +[NSObject description]. // Added extra explanatory comments. // // Revision 1.2 1996/04/30 05:38:51 sunshine // Ported to OpenStep 4.0 for Mach PR2. //----------------------------------------------------------------------------- extern "Objective-C" { #import } @class MiscTableScroll, NSArray, NSCharacterSet; @interface MiscTableConnInspector:IBInspector { MiscTableScroll* outletScroll; MiscTableScroll* actionScroll; NSArray* connList; id cursrc; id curdst; id curout; NSCharacterSet* punctuation; } @end #endif // __MiscTableConnInspector_h MiscKit2/Palettes/MiscTableScroll/Palette/MiscTableScrollInspector.M100444 1750 1750 55644 6757227355 26004 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollInspector.M // // Interface Builder inspector for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollInspector.M,v 1.20 99/06/14 19:16:04 sunshine Exp $ // $Log: MiscTableScrollInspector.M,v $ // Revision 1.20 99/06/14 19:16:04 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Converted slot list from a matrix of buttons to MiscTableScroll. // Reworked color controls so that user can preview color combinations. This // is accomplished by the addition of two text fields. One displays the // foreground and background color for unselected slots; the other selected // slots. This configuration makes better use of screen real estate. // // Revision 1.19 1998/03/30 00:06:01 sunshine // v138.1: Ditched unnecessary "align title" text field since under OPENSTEP, // buttons are correctly dimmed when disabled. Consequently I don't have to // worry about figuring out correct enabled/disabled colors for the field. // Fixed bug: Pressing "new slot" would draw and highlight the new cell, but // wouldn't redraw the old selected cell. //----------------------------------------------------------------------------- #import "MiscTableScrollInspector.h" #import "MiscTableBorder.h" #import //============================================================================= // IB-ONLY METHODS FOR MiscTableScroll //============================================================================= @interface MiscTableScroll(IB) - (NSString*)inspectorClassName; - (void)editSelf:(id)sender in:(id)owner; @end @implementation MiscTableScroll(IB) - (NSString*)inspectorClassName { NSString* s = @"MiscTableScrollInspector"; return s; } // Prevent double-click from editing NSScrollView in IB - (void)editSelf:(id)sender in:(id)owner {} @end //============================================================================= // CONVENIENCE CATAGORIES //============================================================================= @interface NSPopUpButton(MiscTableScroll) - (int)popUpTag; - (void)setPopUpTag:(int)new_tag; @end @implementation NSPopUpButton(MiscTableScroll) - (int)popUpTag { return [[self selectedItem] tag]; } - (void)setPopUpTag:(int)new_tag { NSArray* items = [self itemArray]; for (int i = [items count]; i-- > 0; ) { id item = (id)[items objectAtIndex:i]; if ([item tag] == new_tag) { [self selectItemWithTitle:[item title]]; break; } } } @end //============================================================================= // IMPLEMENTATION //============================================================================= @interface MiscTableScrollInspector(Forward) - (void)doSlot:(id)sender; - (void)doTitleMode:(id)sender; @end @implementation MiscTableScrollInspector - (BOOL)wantsButtons { return NO; } - (void)ok:(id)sender { [super ok:sender]; } //----------------------------------------------------------------------------- // initSlotScroll //----------------------------------------------------------------------------- - (void)initSlotScroll { [slotScroll setAutoSortRows:NO]; [slotScroll setSelectionMode:MISC_RADIO_MODE]; [slotScroll setDraggableColumns:NO]; [slotScroll setDelegate:self]; [slotScroll setTarget:self]; [slotScroll setAction:@selector(doSlot:)]; [slotScroll addColumn]; [slotScroll setColumn:0 title:@"Slots"]; [slotScroll setColumn:0 autosize:YES]; } //----------------------------------------------------------------------------- // init //----------------------------------------------------------------------------- - (id)init { [super init]; [NSBundle loadNibNamed:[[self class] description] owner:self]; [self initSlotScroll]; [[upButton cell] setImageDimsWhenDisabled:YES]; [[downButton cell] setImageDimsWhenDisabled:YES]; borderType = MISC_COL_BORDER; dirty = NO; return self; } //----------------------------------------------------------------------------- // setTitleControls //----------------------------------------------------------------------------- - (void)setTitleControls { id o = [self object]; if ([o slotTitlesOn:borderType]) { [titlesSwitch setState:1]; [sizableSwitch setEnabled:YES]; [sizableSwitch setState:border->isSizeable()]; [draggableSwitch setEnabled:YES]; [draggableSwitch setState:border->isDraggable()]; [titleModePopUp setEnabled:YES]; [titleModePopUp setPopUpTag:(int)[o slotTitleMode:borderType]]; } else { [titlesSwitch setState:0]; [sizableSwitch setEnabled:NO]; [sizableSwitch setState:0]; [draggableSwitch setEnabled:NO]; [draggableSwitch setState:0]; [titleModePopUp setEnabled:NO]; [titleModePopUp setPopUpTag:(int)[o slotTitleMode:borderType]]; } [uniformSizeField setEnabled:YES]; [uniformSizeField setIntValue:(int)[o uniformSizeSlots:borderType]]; } //----------------------------------------------------------------------------- // fillScroll //----------------------------------------------------------------------------- - (void)fillScroll { id o = [self object]; numSlots = [o numberOfSlots:borderType]; if (numSlots == 0) [slotScroll empty]; else { [slotScroll renewRows:numSlots]; for (int i = 0; i < numSlots; i++) { int const pslot = [o border:borderType slotAtPosition:i]; [[slotScroll cellAtRow:i column:0] setStringValue:[o border:borderType slotTitle:pslot]]; } } [slotScroll sizeToCells]; if (numSlots > 0) { if (slot < 0) slot = 0; [slotScroll selectRow:slot]; [slotScroll scrollRowToVisible:slot]; } else slot = -1; [slotScroll setNeedsDisplay:YES]; // Needed after pressing "Add". [self doSlot:self]; } //----------------------------------------------------------------------------- // doEnabled: //----------------------------------------------------------------------------- - (void)doEnabled:(id)sender { [[self object] setEnabled:[enabledSwitch state]]; [self ok:sender]; } //----------------------------------------------------------------------------- // doLazy: //----------------------------------------------------------------------------- - (void)doLazy:(id)sender { [[self object] setLazy:[lazySwitch state]]; [self ok:sender]; [self revert:sender]; } //----------------------------------------------------------------------------- // doMode: //----------------------------------------------------------------------------- - (void)doMode:(id)sender { [[self object] setSelectionMode:MiscSelectionMode([modePopUp popUpTag])]; [self ok:sender]; } //----------------------------------------------------------------------------- // doBorder: //----------------------------------------------------------------------------- - (void)doBorder:(id)sender { MiscBorderType bt = MiscBorderType([borderPopUp popUpTag]); if (bt != borderType) { borderType = bt; [self revert:sender]; } } //----------------------------------------------------------------------------- // doTitles: //----------------------------------------------------------------------------- - (void)doTitles:(id)sender { BOOL const isOn = [titlesSwitch state]; [[self object] border:borderType setSlotTitlesOn:isOn]; [self setTitleControls]; [self doSlot:self]; [self ok:sender]; } //----------------------------------------------------------------------------- // doSizable: //----------------------------------------------------------------------------- - (void)doSizable:(id)sender { [[self object] border:borderType setSizeableSlots:[sizableSwitch state]]; [self doSlot:0]; [self ok:sender]; } //----------------------------------------------------------------------------- // doDraggable: //----------------------------------------------------------------------------- - (void)doDraggable:(id)sender { [[self object] border:borderType setDraggableSlots:[draggableSwitch state]]; [self ok:sender]; } //----------------------------------------------------------------------------- // doAutoSort: //----------------------------------------------------------------------------- - (void)doAutoSort:(id)sender { [[self object] border:borderType setAutoSortSlots:[autoSortSwitch state]]; [self ok:sender]; } //----------------------------------------------------------------------------- // doTitleMode: //----------------------------------------------------------------------------- - (void)doTitleMode:(id)sender { [[self object] border:borderType setSlotTitleMode:(MiscTableTitleMode)[titleModePopUp popUpTag]]; [self fillScroll]; [self ok:sender]; } //----------------------------------------------------------------------------- // doDelete: //----------------------------------------------------------------------------- - (void)doDelete:(id)sender { id o = [self object]; [o border:borderType removeSlot:[o border:borderType slotAtPosition:slot]]; [o tile]; [o display]; slot--; numSlots--; if (slot < 0 && numSlots > 0) slot = 0; [self fillScroll]; [self ok:sender]; } //----------------------------------------------------------------------------- // doNew: //----------------------------------------------------------------------------- - (void)doNew:(id)sender { id o = [self object]; [o addSlot:borderType]; [o sizeToCells]; slot = numSlots; [self fillScroll]; [self ok:sender]; } //----------------------------------------------------------------------------- // doUserSizeable: //----------------------------------------------------------------------------- - (void)doUserSizeable:(id)sender { id o = [self object]; [o border:borderType setSlot:[o border:borderType slotAtPosition:slot] sizeable:[userSizeableSwitch state]]; [self ok:sender]; } //----------------------------------------------------------------------------- // doAlign: //----------------------------------------------------------------------------- - (void)doAlign:(id)sender { id o = [self object]; int const pslot = [o border:borderType slotAtPosition:slot]; if ([o border:borderType slotCellType:pslot] == MISC_TABLE_CELL_TEXT) { id const proto = [o border:borderType slotCellPrototype:pslot]; id const cell = [alignMatrix selectedCell]; [proto setAlignment:(NSTextAlignment)[cell tag]]; } [self ok:sender]; } //----------------------------------------------------------------------------- // doAutosize: //----------------------------------------------------------------------------- - (void)doAutosize:(id)sender { id o = [self object]; [o border:borderType setSlot:[o border:borderType slotAtPosition:slot] autosize:[autosizeSwitch state]]; [self ok:sender]; } //----------------------------------------------------------------------------- // doCellClass: //----------------------------------------------------------------------------- - (void)doCellClass:(id)sender { id o = [self object]; int const pslot = [o border:borderType slotAtPosition:slot]; int const old_val = (int)[o border:borderType slotCellType:pslot]; int const new_val = [cellClassPopUp popUpTag]; if (old_val != new_val) { [o border:borderType setSlot:pslot cellType:(MiscTableCellStyle)new_val]; if (new_val == MISC_TABLE_CELL_TEXT) { [alignMatrix setEnabled:YES]; id const cell = [o border:borderType slotCellPrototype:pslot]; [alignMatrix selectCellWithTag:[cell alignment]]; } else if (old_val == MISC_TABLE_CELL_TEXT) [alignMatrix setEnabled:NO]; } [self ok:sender]; } //----------------------------------------------------------------------------- // doSortType: //----------------------------------------------------------------------------- - (void)doSortType:(id)sender { id o = [self object]; [o border:borderType setSlot:[o border:borderType slotAtPosition:slot] sortType:(MiscSortType)[sortTypePopUp popUpTag]]; [self ok:sender]; } //----------------------------------------------------------------------------- // doSortDirection: //----------------------------------------------------------------------------- - (void)doSortDirection:(id)sender { id o = [self object]; [o border:borderType setSlot:[o border:borderType slotAtPosition:slot] sortDirection:(MiscSortDirection)[sortDirectionPopUp popUpTag]]; [self ok:sender]; } //----------------------------------------------------------------------------- // doSlot: //----------------------------------------------------------------------------- - (void)doSlot:(id)sender { slot = [slotScroll selectedRow]; if (slot >= 0) { id o = [self object]; BOOL const titlesOn = [o slotTitlesOn:borderType]; BOOL const notUniform = ([o uniformSizeSlots:borderType] == 0); int pslot = [o border:borderType slotAtPosition:slot]; [deleteButton setEnabled:YES]; [upButton setEnabled:(slot > 0)]; [downButton setEnabled:(slot < numSlots - 1)]; int const ctype = (int)[o border:borderType slotCellType:pslot]; [cellClassPopUp setEnabled:YES]; [cellClassPopUp setPopUpTag:ctype]; [sortTypePopUp setEnabled:YES]; [sortTypePopUp setPopUpTag: (int)[o border:borderType slotSortType:pslot]]; [sortDirectionPopUp setEnabled:YES]; [sortDirectionPopUp setPopUpTag: (int)[o border:borderType slotSortDirection:pslot]]; if (ctype == MISC_TABLE_CELL_TEXT) { [alignMatrix setEnabled:YES]; id const cell = [o border:borderType slotCellPrototype:pslot]; [alignMatrix selectCellWithTag:[cell alignment]]; } else [alignMatrix setEnabled:NO]; [autosizeSwitch setEnabled:notUniform]; [autosizeSwitch setState:[o border:borderType slotIsAutosize:pslot]]; BOOL const enabled = titlesOn && notUniform && [[self object] sizeableSlots:borderType]; [userSizeableSwitch setEnabled:enabled]; [userSizeableSwitch setState: enabled && [o border:borderType slotIsSizeable:pslot]]; [sizeField setEnabled:notUniform]; [sizeField setIntValue:(int)[o border:borderType slotSize:pslot]]; [sizeMinField setEnabled:notUniform]; [sizeMinField setIntValue: (int)[o border:borderType slotMinSize:pslot]]; [sizeMaxField setEnabled:notUniform]; [sizeMaxField setIntValue: (int)[o border:borderType slotMaxSize:pslot]]; [titleField setEnabled:titlesOn && ([o slotTitleMode:borderType] == MISC_CUSTOM_TITLE)]; [titleField setStringValue:[o border:borderType slotTitle:pslot]]; } else { [deleteButton setEnabled:NO]; [upButton setEnabled:NO]; [downButton setEnabled:NO]; [cellClassPopUp setEnabled:NO]; [cellClassPopUp setPopUpTag:0]; [sortTypePopUp setEnabled:NO]; [sortTypePopUp setPopUpTag:0]; [sortDirectionPopUp setEnabled:NO]; [sortDirectionPopUp setPopUpTag:0]; [alignMatrix setEnabled:NO]; [alignMatrix selectCellWithTag:0]; [autosizeSwitch setEnabled:NO]; [autosizeSwitch setState:0]; [userSizeableSwitch setEnabled:NO]; [userSizeableSwitch setState:0]; [sizeField setEnabled:NO]; [sizeField setStringValue:@""]; [sizeMinField setEnabled:NO]; [sizeMinField setStringValue:@""]; [sizeMaxField setEnabled:NO]; [sizeMaxField setStringValue:@""]; [titleField setEnabled:NO]; [titleField setStringValue:@""]; } } //----------------------------------------------------------------------------- // swapSlots:: //----------------------------------------------------------------------------- - (void)swapSlots:(int)from_slot :(int)to_slot { border->swapSlots( from_slot, to_slot ); [[self object] display]; slot = to_slot; [self fillScroll]; [self ok:self]; } //----------------------------------------------------------------------------- // doUp: //----------------------------------------------------------------------------- - (void)doUp:(id)sender { if (slot > 0) [self swapSlots:slot :slot-1]; } //----------------------------------------------------------------------------- // doDown: //----------------------------------------------------------------------------- - (void)doDown:(id)sender { if (slot < numSlots - 1) [self swapSlots:slot :slot+1]; } //----------------------------------------------------------------------------- // getPhysSlot // Get the physical slot-id of the current slot. //----------------------------------------------------------------------------- - (int)getPhysSlot { return [[self object] border:borderType slotAtPosition:slot]; } //----------------------------------------------------------------------------- // controlTextDidBeginEditing: //----------------------------------------------------------------------------- - (void)controlTextDidBeginEditing:(NSNotification*)n { dirty = YES; } //----------------------------------------------------------------------------- // controlTextDidEndEditing: //----------------------------------------------------------------------------- - (void)controlTextDidEndEditing:(NSNotification*)n { if (dirty) { dirty = NO; id o = [self object]; NSTextField* field = [n object]; if (field == titleField) { int const pslot = [self getPhysSlot]; [o border:borderType setSlot:pslot title:[titleField stringValue]]; [[slotScroll cellAtRow:slot column:0] setStringValue:[titleField stringValue]]; [slotScroll setNeedsDisplay:YES]; } else if (field == uniformSizeField) { int old_size = (int)[o uniformSizeSlots:borderType]; int new_size = [uniformSizeField intValue]; if (new_size != 0) { if (new_size < MISC_MIN_PIXELS_SIZE) new_size = MISC_MIN_PIXELS_SIZE; if (new_size > MISC_MAX_PIXELS_SIZE) new_size = MISC_MAX_PIXELS_SIZE; [uniformSizeField setIntValue:new_size]; } if (old_size != new_size) { [o border:borderType setUniformSizeSlots:(float)new_size]; [self ok:self]; [self revert:self]; } } else if (field == sizeField) { int const pslot = [self getPhysSlot]; int i = [sizeField intValue]; int const imin = (int)[o border:borderType slotMinSize:pslot]; int const imax = (int)[o border:borderType slotMaxSize:pslot]; if (i < imin || i > imax) { if (i < imin) i = imin; if (i > imax) i = imax; [sizeField setIntValue:i]; } [o border:borderType setSlot:pslot size:i]; } else if (field == sizeMinField) { int const pslot = [self getPhysSlot]; int const i = (int)[o border:borderType slotSize:pslot]; int imin = [sizeMinField intValue]; int const imax = (int)[o border:borderType slotMaxSize:pslot]; if (imin < MISC_MIN_PIXELS_SIZE) imin = MISC_MIN_PIXELS_SIZE; else if (imin > imax) imin = imax; if (imin > i) // Not an 'else if' imin = i; [sizeMinField setIntValue:imin]; [o border:borderType setSlot:pslot minSize:imin]; } else if (field == sizeMaxField) { int const pslot = [self getPhysSlot]; int const i = (int)[o border:borderType slotSize:pslot]; int const imin = (int)[o border:borderType slotMinSize:pslot]; int imax = [sizeMaxField intValue]; if (imax > MISC_MAX_PIXELS_SIZE) imax = MISC_MAX_PIXELS_SIZE; else if (imax < imin) imax = imin; if (imax < i) // Not an 'else if' imax = i; [sizeMaxField setIntValue:imax]; [o border:borderType setSlot:pslot maxSize:imax]; } [self ok:self]; } } //----------------------------------------------------------------------------- // doColorText: //----------------------------------------------------------------------------- - (void)doColorText:(id)sender { NSColor* const c = [sender color]; [[self object] setTextColor:c]; [sampleTextNormal setTextColor:c]; [self ok:sender]; } //----------------------------------------------------------------------------- // doColorBack: //----------------------------------------------------------------------------- - (void)doColorBack:(id)sender { NSColor* const c = [sender color]; [[self object] setBackgroundColor:c]; [sampleTextNormal setBackgroundColor:c]; [self ok:sender]; } //----------------------------------------------------------------------------- // doColorTextSelected: //----------------------------------------------------------------------------- - (void)doColorTextSelected:(id)sender { NSColor* const c = [sender color]; [[self object] setSelectedTextColor:c]; [sampleTextSelected setTextColor:c]; [self ok:sender]; } //----------------------------------------------------------------------------- // doColorBackSelected: //----------------------------------------------------------------------------- - (void)doColorBackSelected:(id)sender { NSColor* const c = [sender color]; [[self object] setSelectedBackgroundColor:c]; [sampleTextSelected setBackgroundColor:c]; [self ok:sender]; } //----------------------------------------------------------------------------- // -FG::: //----------------------------------------------------------------------------- - (void)FG:(NSColor*)c :(NSTextField*)f :(NSColorWell*)w { [f setTextColor:c]; [w setColor:c]; } //----------------------------------------------------------------------------- // -BG::: //----------------------------------------------------------------------------- - (void)BG:(NSColor*)c :(NSTextField*)f :(NSColorWell*)w { [f setBackgroundColor:c]; [w setColor:c]; } //----------------------------------------------------------------------------- // revert: //----------------------------------------------------------------------------- - (void)revert:(id)sender { dirty = NO; id o = [self object]; [super revert:sender]; border = [o border:borderType]; [autoSortSwitch setState:[o autoSortSlots:borderType]]; [self setTitleControls]; [enabledSwitch setState:[o isEnabled]]; [lazySwitch setState:[o isLazy]]; [modePopUp setPopUpTag:(int) [o selectionMode]]; [self FG:[o textColor ]:sampleTextNormal :colorText ]; [self BG:[o backgroundColor ]:sampleTextNormal :colorBack ]; [self FG:[o selectedTextColor ]:sampleTextSelected:colorTextSelected]; [self BG:[o selectedBackgroundColor]:sampleTextSelected:colorBackSelected]; slot = -1; [self fillScroll]; } @end MiscKit2/Palettes/MiscTableScroll/Palette/MiscTableDimple.tiff100444 1750 1750 406 6757227316 24544 0ustar sunshinesunshineII*8 P8! H7H P8#!L,D`   *(R" ' 'MiscKit2/Palettes/MiscTableScroll/Palette/MiscTableRightArrow.tiff100444 1750 1750 412 6757227316 25417 0ustar sunshinesunshineII*< P0*`ʥV/ Q$V P0~A B`8  *(R" ' 'MiscKit2/Palettes/MiscTableScroll/Palette/MiscTableScrollInspector.h100444 1750 1750 7247 6757227355 26013 0ustar sunshinesunshine#ifndef __MiscTableScrollInspector_h #define __MiscTableScrollInspector_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollInspector.h // // Interface Builder inspector for MiscTableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollInspector.h,v 1.9 99/06/14 19:15:31 sunshine Exp $ // $Log: MiscTableScrollInspector.h,v $ // Revision 1.9 99/06/14 19:15:31 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Converted slot list from a matrix of buttons to MiscTableScroll. // Reworked color controls so that user can preview color combinations. This // is accomplished by the addition of two text fields. One displays the // foreground and background color for unselected slots; the other selected // slots. This configuration makes better use of screen real estate. // // Revision 1.8 1998/03/30 00:06:13 sunshine // v138.1: Ditched unnecessary "align title" text field since under OPENSTEP, // buttons are correctly dimmed when disabled. Consequently I don't have to // worry about figuring out correct enabled/disabled colors for the field. // // Revision 1.7 98/03/22 13:07:57 sunshine // v133.1: Eliminated constrain-max, constrain-min is now implicit based on // presence/absence of auto-size slots. Eliminated data-sizing. // Added alignment control. //----------------------------------------------------------------------------- extern "Objective-C" { #import } #import @class NSButton, NSColorWell, NSMatrix, NSScrollView, NSTextField; @class MiscTableScroll; class MiscTableBorder; @interface MiscTableScrollInspector : IBInspector { NSButton* autosizeSwitch; NSButton* autoSortSwitch; NSPopUpButton* borderPopUp; NSPopUpButton* cellClassPopUp; NSButton* deleteButton; NSButton* downButton; NSButton* draggableSwitch; NSButton* enabledSwitch; NSButton* lazySwitch; NSPopUpButton* modePopUp; NSButton* sizableSwitch; NSPopUpButton* sortTypePopUp; NSPopUpButton* sortDirectionPopUp; NSPopUpButton* titleModePopUp; NSButton* titlesSwitch; NSButton* upButton; NSButton* userSizeableSwitch; NSMatrix* alignMatrix; MiscTableScroll* slotScroll; NSTextField* sizeField; NSTextField* sizeMaxField; NSTextField* sizeMinField; NSTextField* titleField; NSTextField* uniformSizeField; NSColorWell* colorText; NSColorWell* colorTextSelected; NSColorWell* colorBack; NSColorWell* colorBackSelected; NSTextField* sampleTextNormal; NSTextField* sampleTextSelected; int slot; // Currently selected slot, or -1. int numSlots; // Total number of columns. MiscBorderType borderType; MiscTableBorder* border; BOOL dirty; } - (id)init; - (void)ok:(id)sender; - (void)revert:(id)sender; @end #endif // __MiscTableScrollInspector_h MiscKit2/Palettes/MiscTableScroll/Palette/MiscTableScrollPalette.M100444 1750 1750 3751 6757227355 25404 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollPalette.M // // Subclass of IBPalette for the MiscTableScroll palette. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollPalette.M,v 1.6 98/03/30 00:03:24 sunshine Exp $ // $Log: MiscTableScrollPalette.M,v $ // Revision 1.6 98/03/30 00:03:24 sunshine // v138.1: #import was missing "MiscTableScroll/" for public header. // // Revision 1.5 98/03/22 13:07:23 sunshine // v133.1: Turns on auto-sort for rows. // // Revision 1.4 97/03/10 10:41:54 sunshine // v113.1: For OpenStep conformance, -setCol:... renamed to -setColumn:... //----------------------------------------------------------------------------- #import "MiscTableScrollPalette.h" #import @implementation MiscTableScrollPalette //----------------------------------------------------------------------------- // - finishInstantiate //----------------------------------------------------------------------------- - (void)finishInstantiate { [tableScroll addColumn]; [tableScroll addColumn]; [tableScroll setColumn:1 autosize:YES]; [tableScroll setAutoSortRows:YES]; [tableScroll tile]; } @end MiscKit2/Palettes/MiscTableScroll/Palette/MiscTableScrollPalette.h100444 1750 1750 3071 6757227355 25432 0ustar sunshinesunshine#ifndef __MiscTableScrollPalette_h #define __MiscTableScrollPalette_h //============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableScrollPalette.h // // Subclass of IBPalette for the MiscTableScroll palette. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableScrollPalette.h,v 1.4 96/04/30 05:39:58 sunshine Exp $ // $Log: MiscTableScrollPalette.h,v $ // Revision 1.4 96/04/30 05:39:58 sunshine // Ported to OpenStep 4.0 for Mach PR2. // //----------------------------------------------------------------------------- extern "Objective-C" { #import } @class MiscTableScroll; @interface MiscTableScrollPalette : IBPalette { MiscTableScroll* tableScroll; } - (void) finishInstantiate; @end #endif // __MiscTableScrollPalette_h MiscKit2/Palettes/MiscTableScroll/Palette/MiscTableConnector.strings100444 1750 1750 1007 6757227356 26047 0ustar sunshinesunshine//----------------------------------------------------------------------------- // MiscTableConnector.strings // // Describes which outlet names have "action" variables associated with // them. This tells the MiscTableConnector and MiscTableConnInspector // classes which outlets should be handled like the "target" outlets are // handled by the standard IB connection inspector. // //----------------------------------------------------------------------------- { target = "action"; doubleTarget = "doubleAction"; } MiscKit2/Palettes/MiscTableScroll/Palette/Makefile100444 1750 1750 3124 6757227356 22360 0ustar sunshinesunshine# # Generated by the NeXT Project Builder. # # NOTE: Do NOT change this file -- Project Builder maintains it. # # Put all of your customizations in files called Makefile.preamble # and Makefile.postamble (both optional), and Makefile will include them. # NAME = MiscTableScroll PROJECTVERSION = 2.7 PROJECT_TYPE = Palette LANGUAGE = English LOCAL_RESOURCES = MiscTableConnInspector.nib MiscTableScroll.nib\ MiscTableScrollInspector.nib GLOBAL_RESOURCES = MiscTableDimple.tiff MiscTableRightArrow.tiff\ MiscTableScroll.tiff CustomInfo.plist palette.table\ MiscTableConnector.strings CAPMFILES = MiscTableConnInspector.M MiscTableScrollInspector.M\ MiscTableScrollPalette.M HFILES = MiscTableConnInspector.h MiscTableScrollInspector.h\ MiscTableScrollPalette.h OTHERSRCS = Makefile.preamble Makefile Makefile.postamble MAKEFILEDIR = $(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles CODE_GEN_STYLE = DYNAMIC MAKEFILE = palette.make NEXTSTEP_INSTALLDIR = $(NEXT_ROOT)$(LOCAL_DEVELOPER_DIR)/Palettes WINDOWS_INSTALLDIR = $(NEXT_ROOT)$(LOCAL_DEVELOPER_DIR)/Palettes PDO_UNIX_INSTALLDIR = $(HOME)/Library/Palettes LIBS = DEBUG_LIBS = $(LIBS) PROF_LIBS = $(LIBS) NEXTSTEP_PB_CFLAGS = -Werror -Wwrite-strings WINDOWS_PB_CFLAGS = -Werror -Wwrite-strings FRAMEWORKS = -framework MiscTableScroll -framework InterfaceBuilder\ -framework AppKit -framework Foundation include $(MAKEFILEDIR)/platform.make -include Makefile.preamble include $(MAKEFILEDIR)/$(MAKEFILE) -include Makefile.postamble -include Makefile.dependencies MiscKit2/Palettes/MiscTableScroll/Palette/Makefile.postamble100444 1750 1750 12007 6757227356 24365 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # Makefile.postamble # $Id: Makefile.postamble,v 1.15 99/06/14 19:29:24 sunshine Exp $ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Grab the master PACKAGE_NUMBER for this package. See Makefile.preamble for # the other half of this patch. #------------------------------------------------------------------------------ .PHONY: table-scroll-finalize-build stamp-package table-scroll-finalize-build: stamp-package stamp-package: $(RM) -f $(GLOBAL_RESOURCE_DIR)/PACKAGE_NUMBER $(CP) -p $(PRODUCT_ROOT)/PACKAGE_NUMBER $(GLOBAL_RESOURCE_DIR) #------------------------------------------------------------------------------ # Under 4.1 & 4.2 (prerelease) OFILES does not include any of the C++ object # files, so we manually add them to OTHER_OFILES. Under 4.2 (final), OFILES # *does* refer to them, so we must remove the duplicates lest the linker # complains about linking the same files twice. This is done with the $(sort) # function which removes duplicates as a side-effect. See Makefile.preamble # for the other half of this patch. #------------------------------------------------------------------------------ OFILES := $(sort $(OFILES)) #------------------------------------------------------------------------------ # Under OPENSTEP for NT, +[NSBundle load] fails to load the palette dll file if # it has the same name (MiscTableScroll.dll) as the DLL file in the Framework # even though they reside in different directories. (I don't know if the # problem is with the Microsoft DLL loader or the Objective-C run-time.) Work # around the system by renaming the executable (DLL) file within the # MiscTableScroll.palette wrapper. (Also see the CustomInfo.plist which # redefines "NSExecutable" in order to support this.) #------------------------------------------------------------------------------ INNER_PRODUCT = $(PRODUCT)$(VERSION_SUFFIX)/$(PALEXENAME)$(DLL_EXT) #****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # forceload.fix (1999-06-09, version 1.1) # # A Makefile.postamble patch which eliminates the NSFramework_forceLoad() # compiler warning generated by YellowBox DR2 on Microsoft Windows. # # Under YellowBox DR2 for Microsoft Windows, Apple tried patching the # system makefile so that it automatically generates source code which # references all the classes in each framework used by a project. The # intention was to make all of the frameworks' symbols available to # loadable bundles even if the main application does not reference the # symbols itself. This is similar to the behavior of the linker's # -all_load switch under Mach. # # However, there are two problems with the DR2 implementation: # # a) It is incomplete and does not generate any framework references at # all; instead it generates a single empty function named # NSFramework_forceload(). # b) The generated function is declared "static" which results in a # compiler warning about an unused function. # # This file (forceload.fix) works around the compiler warning by # disabling generation of NSFramework_forceload() altogether. Since the # function is empty and is never referenced by any other code, this is a # safe operation. # # To use this patch, follow these instructions: # # a) Open the project's top-level Makefile.postamble in a text editor. # b) Append the contents of this file (forceload.fix) to the end of # Makefile.postamble. # c) Clean the project (make clean) and then rebuild it. # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ ifeq "WINDOWS" "$(OS)" GENFORCELOAD=echo // endif MiscKit2/Palettes/MiscTableScroll/Palette/Makefile.preamble100444 1750 1750 6164 6757227356 24155 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # Makefile.preamble # $Id: Makefile.preamble,v 1.14 99/07/15 13:09:59 sunshine Exp $ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Perform post-build finalization of the framework. See Makefile.preamble for # the other half of this step. #------------------------------------------------------------------------------ AFTER_BUILD += table-scroll-finalize-build #------------------------------------------------------------------------------ # Under 4.1 & 4.2 although PB defines CCFILES, CPPFILES, and CXXFILES in the # Makefile, SRCFILES does not actually references them, so the C++ files # don't get compiled. This is patched by assigning them to OTHER_SOURCEFILES # which does get referenced. # # Under 4.1 & 4.2 (prerelease) OFILES does not include any of the C++ object # files, so we manually add them to OTHER_OFILES. Under 4.2 (final), OFILES # *does* refer to them, so we must remove the duplicates lest the linker # complains about linking the same files twice. This is done in the # Makefile.postamble. # # Under 4.1 & 4.2 implicitrules.make neglects to mention the .cpp suffix. #------------------------------------------------------------------------------ .SUFFIXES: .cpp OTHER_SOURCEFILES += $(CCFILES) $(CPPFILES) $(CXXFILES) OTHER_OFILES += $(CCFILES:.cc=.o) $(CPPFILES:.cpp=.o) $(CXXFILES:.cxx=.o) #------------------------------------------------------------------------------ # As of OpenStep 4.2, the compiler (gcc 2.7.2.1) does not accept Objective-C # code in cc files, so we have to force ObjC++ mode manually. #------------------------------------------------------------------------------ OTHER_CCFLAGS += -ObjC++ #------------------------------------------------------------------------------ # Under OPENSTEP for NT, +[NSBundle load] fails to load the palette DLL file if # it has the same name (MiscTableScroll.dll) as the dll file in the Framework # even though they reside in different directories. (I don't know if the # problem is with the Microsoft DLL loader or the Objective-C run-time.) Work # around the system by renaming the executable (DLL) file within the # MiscTableScroll.palette wrapper. (Also see the CustomInfo.plist which # redefines "NSExecutable" in order to support this.) #------------------------------------------------------------------------------ PALEXENAME = $(NAME)Palette MiscKit2/Palettes/MiscTableScroll/Palette/PB.project100444 1750 1750 4306 6757227356 22614 0ustar sunshinesunshine{ DYNAMIC_CODE_GEN = YES; FILESTABLE = { BUNDLES = (); CLASSES = ( MiscTableConnInspector.M, MiscTableScrollInspector.M, MiscTableScrollPalette.M ); FRAMEWORKS = ( MiscTableScroll.framework, InterfaceBuilder.framework, AppKit.framework, Foundation.framework ); FRAMEWORKSEARCH = (); HEADERSEARCH = (); H_FILES = ( MiscTableConnInspector.h, MiscTableScrollInspector.h, MiscTableScrollPalette.h ); IMAGES = (MiscTableDimple.tiff, MiscTableRightArrow.tiff, MiscTableScroll.tiff); INTERFACES = (MiscTableConnInspector.nib, MiscTableScroll.nib, MiscTableScrollInspector.nib); LIBS = (); OTHER_LINKED = (); OTHER_RESOURCES = (CustomInfo.plist, MiscTableConnector.strings, palette.table); OTHER_SOURCES = (Makefile.preamble, Makefile, Makefile.postamble); SUBPROJECTS = (); TOOLS = (); }; LANGUAGE = English; LOCALIZABLE_FILES = { MiscTableConnInspector.nib = MiscTableConnInspector.nib; MiscTableScroll.nib = MiscTableScroll.nib; MiscTableScrollInspector.nib = MiscTableScrollInspector.nib; }; MAKEFILEDIR = "$(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles"; NEXTSTEP_BUILDTOOL = ./make.sh; NEXTSTEP_COMPILEROPTIONS = "-Werror -Wwrite-strings"; NEXTSTEP_INSTALLDIR = "$(NEXT_ROOT)$(LOCAL_DEVELOPER_DIR)/Palettes"; NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; PDO_UNIX_BUILDTOOL = $NEXT_ROOT/NextDeveloper/bin/make; PDO_UNIX_INSTALLDIR = "$(HOME)/Library/Palettes"; PDO_UNIX_JAVA_COMPILER = "$(NEXTDEV_BIN)/javac"; PDO_UNIX_OBJCPLUS_COMPILER = "$(NEXTDEV_BIN)/gcc"; PROJECTNAME = MiscTableScroll; PROJECTTYPE = Palette; PROJECTVERSION = 2.7; WINDOWS_BUILDTOOL = ./make.sh; WINDOWS_COMPILEROPTIONS = "-Werror -Wwrite-strings"; WINDOWS_INSTALLDIR = "$(NEXT_ROOT)$(LOCAL_DEVELOPER_DIR)/Palettes"; WINDOWS_JAVA_COMPILER = "$(JDKBINDIR)/javac.exe"; WINDOWS_OBJCPLUS_COMPILER = "$(DEVDIR)/gcc"; } MiscKit2/Palettes/MiscTableScroll/Palette/palette.table100444 1750 1750 523 6757227356 23347 0ustar sunshinesunshineClass = MiscTableScrollPalette; /* (a subclass of IBPalette) */ NibFile = MiscTableScroll; /* (a nib file name) */ Icon = MiscTableScroll; /* (a tiff/eps file name) */ ExportClasses = (MiscTableScroll); /* (a list of class names) */ /* ExportImages = (); (a list of image nmaes) */ /* ExportSounds = (); (a list of sound names) */ MiscKit2/Palettes/MiscTableScroll/Palette/MiscTableScroll.tiff100444 1750 1750 14004 6757227317 24630 0ustar sunshinesunshineMM*U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_ 00(RB ' 'MMUMUMU5TMMUMUMU5TMMUMUMU5T 0OOOOOO OUO OUUO OUO ꪯOUOꪯ OO OUUUUUUUUT 00(R@@ ' 'MiscKit2/Palettes/MiscTableScroll/Palette/MiscTableConnInspector.M100444 1750 1750 63702 6757227354 25434 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableConnInspector.M // // A custom Interface Builder connection inspector so that the // doubleTarget and doubleAction can be set. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableConnInspector.M,v 1.13 99/06/30 09:24:10 sunshine Exp $ // $Log: MiscTableConnInspector.M,v $ // Revision 1.13 99/06/30 09:24:10 sunshine // v140.1: Ported to MacOS/X Server in which -outletsOfClass: and // -actionsOfClass: have been deprectaed in favor of new methods // -outletNamesOfClass: and -actionNamesOfClass:, respectively. Uses // -respondsToSelector: to determine if new messages should be sent, or old. // // Revision 1.12 99/06/14 19:25:18 sunshine // v140.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Nib connector classes changed name in MacOS/X Server from NSIBConnector, // to NSIBOutletConnector, and NSIBControlConnector to NSNibConnector, // NSNibOutletConnector, and NSNibControlConnector, respectively. // The "Name" column on the outlet and action MiscTableScrolls now autosizes // since the old hardcoded size is inappropriate for MacOS/X Server DR. // Worked around problem introduced in MacOS/X Server and YellowBox DR2. // Symptom was that method in action list for action and doubleAction was // not being selected when inspected for nibs which had been loaded from a // file. Problem was that -[IBClassData actionsOfClass:] no longer appends // a colon ":" to returned action names, as it did previously. We were doing // a simple string comparison to locate the name in the action list which // consequently failed. Now canonicalizes names before comparison. // Now uses NSStringFromClass() in place of +[NSObject description]. // Added extra explanatory comments. //----------------------------------------------------------------------------- #import "MiscTableConnInspector.h" #import "MiscTableConnector.h" #import extern "Objective-C" { #import #import #import #import #import } enum MiscTSOutletSlot { MISC_TS_NAME_OS, MISC_TS_CONN_OS, MISC_TS_PTR_OS }; enum MiscTSActionSlot { MISC_TS_NAME_AS, MISC_TS_CONN_AS }; #define ICON_DIMPLE @"MiscTableDimple" #define ICON_ARROW @"MiscTableRightArrow" #define ICON_BLANK @"MiscBlankImage" static NSImage* IMAGE_DIMPLE; static NSImage* IMAGE_ARROW; static NSImage* IMAGE_BLANK; static NSString* OUTLET_ACTION_FILE = @"MiscTableConnector"; static NSDictionary* OUTLET_ACTION_DICT = 0; static id FIRST_RESP = (id)~0; static NSString* FIRST_RESP_NAME = @"FirstResponder"; //============================================================================= // PRIVATE IB METHODS //============================================================================= @interface IBDocument: NSObject - (id)classData; // (IBClassData) @end @interface IBClassData: NSObject - (id)outletsOfClass:(NSString*)s; // Pre-MacOX/S Server - (id)actionsOfClass:(NSString*)s; // Pre-MacOX/S Server - (id)outletNamesOfClass:(NSString*)s; // MacOS/X Server - (id)actionNamesOfClass:(NSString*)s; // MacOS/X Server @end //============================================================================= // CATEGORIES OF PRIVATE IB CONNECTION CLASSES // Add useful utility methods which are otherwise absent. //============================================================================= @interface NSNibConnector(MiscTableConnInspector) - (id)initSource:(id)src destination:(id)dst label:(id)lbl; - (NSString*)outletName; - (NSString*)actionName; - (NSString*)actionValue; @end @implementation NSNibConnector(MiscTableConnInspector) - (id)initSource:(id)src destination:(id)dst label:(id)lbl { [self init]; [self setSource:src]; [self setDestination:dst]; [self setLabel:lbl]; return self; } - (NSString*)outletName { return [self label]; } - (NSString*)actionName { return 0; } - (NSString*)actionValue { return 0; } @end @interface NSNibControlConnector(MiscTableConnInspector) - (NSString*)outletName; - (NSString*)actionName; - (NSString*)actionValue; @end @implementation NSNibControlConnector(MiscTableConnInspector) - (NSString*)outletName { NSString* s = @"target"; return s; } - (NSString*)actionName { NSString* s = @"action"; return s; } - (NSString*)actionValue { return [self label]; } @end //============================================================================= // TABLE SCROLL CATEGORY //============================================================================= @interface MiscTableScroll(MiscTableConnInspector) - (NSString*)connectInspectorClassName; @end @implementation MiscTableScroll(MiscTableConnInspector) - (NSString*)connectInspectorClassName { NSString* s = @"MiscTableConnInspector"; return s; } @end //============================================================================= // TABLE CONNECTOR CATEGORY // Add methods for creation and encoding of MiscTableConnector. This code is // only available in the palette, and complements the code in the framework // which allows only immutable access to the connector. //============================================================================= @interface MiscTableConnector(MiscTableConnInspector) - (NSString*)outletName; - (NSString*)actionName; - (id)initSource:(id)src destination:(id)dst label:(NSString*)lbl outlet:(NSString*)out action:(NSString*)act; - (void)encodeWithCoder:(NSCoder*)aCoder; - (NSString*)nibLabel; @end @implementation MiscTableConnector(MiscTableConnInspector) - (NSString*)outletName { return outletName; } - (NSString*)actionName { return actionName; } - (id)initSource:(id)src destination:(id)dst label:(NSString*)lbl outlet:(NSString*)out action:(NSString*)act { [self superInitSource:src destination:dst label:lbl]; outletName = [out retain]; actionName = [act retain]; return self; } - (void)encodeWithCoder:(NSCoder*)coder { [self superEncodeWithCoder:coder]; [coder encodeObject:outletName]; [coder encodeObject:actionName]; } - (id)nibLabel { return [NSString stringWithFormat: @"%@/%@", [self outletName], [self actionValue] ]; } @end //============================================================================= // TABLE CONNECTOR INSPECTOR IMPLEMENTATION //============================================================================= @implementation MiscTableConnInspector //----------------------------------------------------------------------------- // +initialize //----------------------------------------------------------------------------- + (void)initialize { NSString* path; NSBundle* bundle = [NSBundle bundleForClass:self]; path = [bundle pathForImageResource:ICON_DIMPLE]; IMAGE_DIMPLE = [[NSImage alloc] initByReferencingFile:path]; [IMAGE_DIMPLE setName:ICON_DIMPLE]; path = [bundle pathForImageResource:ICON_ARROW]; IMAGE_ARROW = [[NSImage alloc] initByReferencingFile:path]; [IMAGE_ARROW setName:ICON_ARROW]; IMAGE_BLANK = [[NSImage alloc] init]; [IMAGE_BLANK setName:ICON_BLANK]; path = [bundle pathForResource:OUTLET_ACTION_FILE ofType:@"strings"]; OUTLET_ACTION_DICT = [[NSDictionary dictionaryWithContentsOfFile:path] retain]; } //----------------------------------------------------------------------------- // +actionForOutlet: //----------------------------------------------------------------------------- + (NSString*)actionForOutlet:(NSString*)name { return [OUTLET_ACTION_DICT objectForKey:name]; } //----------------------------------------------------------------------------- // -actionForOutlet: //----------------------------------------------------------------------------- - (NSString*)actionForOutlet:(NSString*)name { return [OUTLET_ACTION_DICT objectForKey:name]; } //----------------------------------------------------------------------------- // -dealloc //----------------------------------------------------------------------------- - (void)dealloc { [punctuation release]; [connList release]; [curout release]; [super dealloc]; } //----------------------------------------------------------------------------- // -initScroll:numCols: //----------------------------------------------------------------------------- - (void)initScroll:(MiscTableScroll*)scroll numCols:(int)numCols { [scroll setAutoSortRows:YES]; [scroll setSelectionMode:MISC_RADIO_MODE]; [scroll setDelegate:self]; [scroll setTarget:self]; [scroll setDoubleTarget:self]; for (int i = 0; i < numCols; i++) [scroll addColumn]; } //----------------------------------------------------------------------------- // -init //----------------------------------------------------------------------------- - (id)init { [super init]; connList = [[NSArray array] retain]; [NSBundle loadNibNamed:[[self class] description] owner:self]; [self initScroll:outletScroll numCols:3]; [outletScroll setAction:@selector(outletClick:)]; [outletScroll setDoubleAction:@selector(outletDblClick:)]; [outletScroll setColumn:MISC_TS_NAME_OS autosize:YES]; [outletScroll setColumn:MISC_TS_NAME_OS title:@"Outlets"]; [outletScroll setColumn:MISC_TS_CONN_OS size:13]; [outletScroll setColumn:MISC_TS_CONN_OS sizeable:NO]; [outletScroll setColumn:MISC_TS_CONN_OS cellType:MISC_TABLE_CELL_IMAGE]; [outletScroll setColumn:MISC_TS_CONN_OS sortType:MISC_SORT_TAG]; [outletScroll setColumn:MISC_TS_PTR_OS size:13]; [outletScroll setColumn:MISC_TS_PTR_OS sizeable:NO]; [outletScroll setColumn:MISC_TS_PTR_OS cellType:MISC_TABLE_CELL_IMAGE]; [outletScroll setColumn:MISC_TS_PTR_OS sortType:MISC_SORT_TAG]; [outletScroll setColumn:MISC_TS_PTR_OS sortDirection:MISC_SORT_DESCENDING]; [self initScroll:actionScroll numCols:2]; [actionScroll setAction:@selector(actionClick:)]; [actionScroll setDoubleAction:@selector(actionDblClick:)]; [actionScroll setColumn:MISC_TS_NAME_AS autosize:YES]; [actionScroll setColumn:MISC_TS_NAME_AS title:@"Actions"]; [actionScroll setColumn:MISC_TS_CONN_AS size:13]; [actionScroll setColumn:MISC_TS_CONN_AS sizeable:NO]; [actionScroll setColumn:MISC_TS_CONN_AS cellType:MISC_TABLE_CELL_IMAGE]; [actionScroll setColumn:MISC_TS_CONN_AS sortType:MISC_SORT_TAG]; [actionScroll setColumn:MISC_TS_CONN_AS sortDirection:MISC_SORT_DESCENDING]; [outletScroll setNextKeyView:actionScroll]; [actionScroll setNextKeyView:outletScroll]; punctuation = [[NSCharacterSet punctuationCharacterSet] retain]; return self; } //----------------------------------------------------------------------------- // classNameOf: //----------------------------------------------------------------------------- - (NSString*)classNameOf:(id)obj { if ([obj respondsToSelector:@selector(className)]) return [obj performSelector:@selector(className)]; else return NSStringFromClass( [obj class] ); } //----------------------------------------------------------------------------- // -getConnList //----------------------------------------------------------------------------- - (void)getConnList { [connList autorelease]; connList = [[[NSApp activeDocument] connectorsForSource:[self object]] retain]; } //----------------------------------------------------------------------------- // -findConnectionForOutlet: // Note: this method is only accurate when connList is valid. //----------------------------------------------------------------------------- - (id)findConnectionForOutlet:(NSString*)outletName { unsigned int const lim = [connList count]; for (unsigned int i = 0; i < lim; i++) { id conn = [connList objectAtIndex:i]; if ([outletName isEqualToString:[conn outletName]]) return conn; } return 0; } //----------------------------------------------------------------------------- // -connectionForOutlet: //----------------------------------------------------------------------------- - (id)connectionForOutlet:(NSString*) outletName { [self getConnList]; return [self findConnectionForOutlet:outletName]; } //----------------------------------------------------------------------------- // virtualDestFor: //----------------------------------------------------------------------------- - (id)virtualDestFor:(id)dest { if (dest == 0 || [[self classNameOf:dest] isEqualToString:FIRST_RESP_NAME]) return FIRST_RESP; return dest; } //----------------------------------------------------------------------------- // realDestFor: //----------------------------------------------------------------------------- - (id)realDestFor:(id)dest { return (dest == FIRST_RESP ? 0 : dest); } //----------------------------------------------------------------------------- // -set:outlet: // Note: this method is only accurate when connList is valid. //----------------------------------------------------------------------------- - (void)set:(int)row outlet:(NSString*)name { id cell; id conn = [self findConnectionForOutlet:name]; id dest = (conn == 0 ? 0 : [self virtualDestFor:[conn destination]]); [outletScroll setRow:row tag:int(dest)]; [[outletScroll cellAtRow:row column:MISC_TS_NAME_OS] setStringValue:name]; BOOL const is_connected = (conn != 0); cell = [outletScroll cellAtRow:row column:MISC_TS_CONN_OS]; [cell setImage:(is_connected ? IMAGE_DIMPLE : IMAGE_BLANK)]; [cell setTag:int(is_connected)]; BOOL const has_action = ([self actionForOutlet:name] != 0); cell = [outletScroll cellAtRow:row column:MISC_TS_PTR_OS]; [cell setImage:(has_action ? IMAGE_ARROW : IMAGE_BLANK)]; [cell setTag:int(has_action)]; } //----------------------------------------------------------------------------- // -loadOutlets // Note: this method is only accurate when connList is valid. // // Note: For some silly reason, the -outletsOfClass: method filters // out the "target" outlet. (Who knows why -- must be more hardcoded // internal IB junk.) Therefore, we need to add it back in, manually. //----------------------------------------------------------------------------- - (void)loadOutlets { NSString* className = [self classNameOf:[self object]]; id doc = [NSApp activeDocument]; id data = [doc classData]; id list; if ([data respondsToSelector:@selector(outletNamesOfClass:)]) list = [data outletNamesOfClass:className]; // MacOS/X Server else list = [data outletsOfClass:className]; // Pre-MacOS/X Server unsigned int const lim = [list count]; if (lim > 0) { id str; [outletScroll renewRows:lim + 1]; // Add one for target. NSEnumerator* enu = [list objectEnumerator]; for (int i = 0; (str = [enu nextObject]) != 0; i++) [self set:i outlet:str]; [self set:lim outlet:@"target"]; [outletScroll sortRows]; } else [outletScroll empty]; } //----------------------------------------------------------------------------- // -selectedOutletName //----------------------------------------------------------------------------- - (NSString*)selectedOutletName { NSString* s = 0; int const r = [outletScroll selectedRow]; if (r >= 0) s = [outletScroll stringValueAtRow:r column:MISC_TS_NAME_OS]; return s; } //----------------------------------------------------------------------------- // -shouldShowActions: //----------------------------------------------------------------------------- - (BOOL)shouldShowActions:(id*)old_dest { int const r = [outletScroll selectedRow]; if (r >= 0 && [outletScroll tagAtRow:r column:MISC_TS_PTR_OS] != 0) { *old_dest = (id)[outletScroll rowTag:r]; return YES; } return NO; } //----------------------------------------------------------------------------- // canonicalAction: // Prior to MacOS/X Server & YellowBox DR2, action names returned by // -[IBClassData actionsOfClass:] were always suffixed with a colon ":". // Since Java uses "()" rather than ":", as of DR2, -actionsOfClass: // simply returns the base name of each action, sans ":" or "()". // However, NSNibControlConnector still returns the action name with a // trailing colon, so we need to canonicalize the names prior to // comparing them. //----------------------------------------------------------------------------- - (NSString*)canonicalAction:(NSString*)s { if (s != 0) { NSRange const r = [s rangeOfCharacterFromSet:punctuation]; if (r.length != 0) s = [s substringWithRange:NSMakeRange(0, r.location)]; } return s; } //----------------------------------------------------------------------------- // -loadActions //----------------------------------------------------------------------------- - (void)loadActions { [actionScroll empty]; id old_dest = 0; if ([self shouldShowActions:&old_dest]) { int sel_row = -1; id dest = (curdst != 0 ? curdst : old_dest); if (dest == 0 && [NSApp isConnecting]) dest = [self virtualDestFor:[NSApp connectDestination]]; if (dest != 0) { NSString* lbl = 0; if (dest == old_dest) { NSString* oname = [self selectedOutletName]; id conn = [self connectionForOutlet:oname]; if (conn != 0) lbl = [self canonicalAction:[conn label]]; } NSString* className = (dest == FIRST_RESP ? FIRST_RESP_NAME : [self classNameOf:dest]); id doc = [NSApp activeDocument]; id data = [doc classData]; id list; if ([data respondsToSelector:@selector(actionNamesOfClass:)]) list = [data actionNamesOfClass:className]; // MacOS/X Server else list = [data actionsOfClass:className]; // Pre-MacOS/X Server unsigned int const lim = [list count]; [actionScroll renewRows:lim]; id str; NSEnumerator* enu = [list objectEnumerator]; for (int i = 0; (str = [enu nextObject]) != 0; i++) { [[actionScroll cellAtRow:i column:MISC_TS_NAME_AS] setStringValue:str]; BOOL const connected = lbl != 0 && [lbl isEqualToString:[self canonicalAction:str]]; id cell = [actionScroll cellAtRow:i column:MISC_TS_CONN_AS]; [cell setImage:(connected ? IMAGE_DIMPLE : IMAGE_BLANK)]; [cell setTag:int(connected)]; if (connected) sel_row = i; } } if ([actionScroll numberOfRows] > 0) { [actionScroll sortRows]; if (sel_row >= 0) { [actionScroll selectRow:sel_row]; [actionScroll scrollRowToVisible:sel_row]; } } } } //----------------------------------------------------------------------------- // -selectOutlet: //----------------------------------------------------------------------------- - (void)selectOutlet:(NSString*)name { int row = -1; if (name != 0 && [name length] > 0) { int const lim = [outletScroll numberOfRows]; for (int i = 0; i < lim; i++) { int const j = [outletScroll rowAtPosition:i]; NSString* t = [outletScroll stringValueAtRow:j column:MISC_TS_NAME_OS]; if (t != 0 && [t isEqualToString:name]) { row = j; break; } } } [outletScroll selectRow:row]; if (row >= 0) [outletScroll scrollRowToVisible:row]; [self loadActions]; } //----------------------------------------------------------------------------- // -setCurout: //----------------------------------------------------------------------------- - (void)setCurout:(NSString*)newout { [curout autorelease]; curout = newout; [curout retain]; } //----------------------------------------------------------------------------- // -outletClick: //----------------------------------------------------------------------------- - (void)outletClick:(id)sender { int const r = [outletScroll selectedRow]; if (r >= 0) { NSString* s = [outletScroll stringValueAtRow:r column:MISC_TS_NAME_OS]; cursrc = [self object]; [self setCurout:s]; id conn = [self connectionForOutlet:s]; if (conn != 0) { id dst = [conn destination]; curdst = [self virtualDestFor:dst]; [NSApp displayConnectionBetween:[conn source] and:dst]; } else curdst = 0; } [self loadActions]; } //----------------------------------------------------------------------------- // -outletDblClick: // NOTE *1* The only action allowed on the outlet column for // target/action style outlets is breaking "old" connections that // do not have an action set. //----------------------------------------------------------------------------- - (void)outletDblClick:(id)sender { int const r = [outletScroll selectedRow]; if (r >= 0) { id old_dest = 0; id new_dest = 0; id doc = [NSApp activeDocument]; NSString* outletName = [outletScroll stringValueAtRow:r column:MISC_TS_NAME_OS]; id conn = [self connectionForOutlet:outletName]; BOOL do_break = NO; BOOL do_make = NO; BOOL const has_action = (BOOL) [outletScroll tagAtRow:r column:MISC_TS_PTR_OS]; if (has_action) { do_break = (conn != 0 && [conn actionName] == 0); // NOTE *1* } else { do_break = (conn != 0); old_dest = [self virtualDestFor:[conn destination]]; new_dest = [self virtualDestFor:[NSApp connectDestination]]; do_make = (new_dest != FIRST_RESP && new_dest != old_dest); } if (do_break) [doc removeConnector:conn]; if (do_make) { conn = [[NSNibOutletConnector alloc] initSource:[self object] destination:[self realDestFor:new_dest] label:outletName]; [doc addConnector:conn]; } if (do_break || do_make) [self ok:0]; } } //----------------------------------------------------------------------------- // -actionClick: //----------------------------------------------------------------------------- - (void)actionClick:(id)sender { } //----------------------------------------------------------------------------- // -actionDblClick: // *1* FIXME: Stop this cycle of stupidity! If we can get a better, // more generic subclass to work, that accepts the name of the outlet, // the name of the action-variable as part of the constructor, then we // should do that. //----------------------------------------------------------------------------- - (void)actionDblClick:(id)sender { int const r = [actionScroll selectedRow]; if (r >= 0) { id doc = [NSApp activeDocument]; id dest = [self virtualDestFor:[NSApp connectDestination]]; NSString* outletName = [self selectedOutletName]; id conn = [self connectionForOutlet:outletName]; if (conn != 0) [doc removeConnector:conn]; int const tag = [actionScroll tagAtRow:r column:MISC_TS_CONN_AS]; if (tag == 0) { NSString* s = [actionScroll stringValueAtRow:r column:MISC_TS_NAME_AS]; id realDest = [self realDestFor:dest]; if ([outletName isEqualToString:@"target"]) { conn = [[NSNibControlConnector alloc] initSource:[self object] destination:realDest label:s]; } else { conn = [[MiscTableConnector alloc] initSource:[self object] destination:realDest label:s outlet:outletName action:[self actionForOutlet:outletName]]; } if (conn != 0) { [self setCurout:outletName]; [doc addConnector:conn]; } } [self ok:0]; } } //----------------------------------------------------------------------------- // findRowWithTag // Find the first row (in visual-order) with the given tag. //----------------------------------------------------------------------------- static int findRowWithTag( MiscTableScroll* scroll, int tag ) { unsigned int const lim = [scroll numberOfRows]; for (unsigned int i = 0; i < lim; i++) { int const r = [scroll rowAtPosition:i]; if ([scroll rowTag:r] == tag) return r; } return -1; } //----------------------------------------------------------------------------- // -preselectOutlet //----------------------------------------------------------------------------- - (NSString*)preselectOutlet { int row = findRowWithTag( outletScroll, int(curdst) ); if (row < 0) { row = findRowWithTag( outletScroll, 0 ); if (row < 0) row = 0; } return [outletScroll stringValueAtRow:row column:MISC_TS_NAME_OS]; } //----------------------------------------------------------------------------- // -preselect //----------------------------------------------------------------------------- - (void)preselect { if ([outletScroll numberOfRows] > 0) { id oldsrc = cursrc; id olddst = curdst; if ([NSApp isConnecting]) { cursrc = [NSApp connectSource]; curdst = [self virtualDestFor:[NSApp connectDestination]]; } else { cursrc = [self object]; curdst = 0; } if (oldsrc != cursrc || olddst != curdst) [self setCurout:[self preselectOutlet]]; [self selectOutlet:curout]; } } //----------------------------------------------------------------------------- // -revert: //----------------------------------------------------------------------------- - (void)revert:(id)sender { [super revert:sender]; [self getConnList]; [self loadOutlets]; [self loadActions]; [self preselect]; } //----------------------------------------------------------------------------- // -ok: //----------------------------------------------------------------------------- - (void)ok:(id)sender { [super ok:sender]; [self revert:0]; } //----------------------------------------------------------------------------- // -wantsButtons //----------------------------------------------------------------------------- - (BOOL)wantsButtons { return NO; } @end MiscKit2/Palettes/MiscTableScroll/make.sh100555 1750 1750 6027 6757227305 20575 0ustar sunshinesunshine#!/bin/sh #****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # make.sh (1999-06-09, version 1.1) # # A cross-platform compatibility build script which allows a project to # be built for both YellowBox and OpenStep for Microsoft Windows without # maintaining a distinct PB.project file for each environment. # # In OpenStep for Windows, the "make" utility was located in # $(NEXT_ROOT)/NextDeveloper/Executables. In YellowBox, "make" moved to # $(NEXT_ROOT)/Developer/Executables. Since the path to "make" is # stored in the PB.project file, this generally means that the developer # is forced to maintain two versions of PB.project; one for each # environment. # # This script (make.sh) bridges the gap between the old directory # structure and the new by dynamically determining the correct path for # "make" at build time. # # To insert this script into the build process, follow these steps: # # a) If the project is currently open in ProjectBuilder.app, close it. # b) Open the project's top-level PB.project file in a text editor. # c) Find the line which defines WINDOWS_BUILDTOOL. Its definition will # be either $NEXT_ROOT/NextDeveloper/Executables/make or # $NEXT_ROOT/Developer/Executables/make depending upon whether it # was generated by OpenStep 4.x or YellowBox. # d) Change the value of WINDOWS_BUILDTOOL to "./make.sh". # e) Place this script (make.sh) in the project's main directory. # f) Ensure that the script is executable: chmod a+x make.sh # # Project Builder uses the value of WINDOWS_BUILDTOOL to locate the # program which builds the project. By changing the value of # WINDOWS_BUILDTOOL to "./make.sh", this script is used to build the # project instead. # # Once in control, this script dynamically determines the correct path # to the "make" utility and then executes it on behalf of Project # Builder. # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ if [ -x ${NEXT_ROOT}/Developer/Executables/make.exe ]; then exec ${NEXT_ROOT}/Developer/Executables/make ${1+"$@"} elif [ -x ${NEXT_ROOT}/NextDeveloper/Executables/make.exe ]; then exec ${NEXT_ROOT}/NextDeveloper/Executables/make ${1+"$@"} elif [ -x ${NEXT_ROOT}/bin/gnumake ]; then exec ${NEXT_ROOT}/bin/gnumake ${1+"$@"} fi echo "Unable to determine location of 'make' utility." exit 1 MiscKit2/Palettes/MiscTableScroll/Makefile100444 1750 1750 1327 6757227357 20766 0ustar sunshinesunshine# # Generated by the NeXT Project Builder. # # NOTE: Do NOT change this file -- Project Builder maintains it. # # Put all of your customizations in files called Makefile.preamble # and Makefile.postamble (both optional), and Makefile will include them. # NAME = MiscTableScroll PROJECTVERSION = 2.7 PROJECT_TYPE = Aggregate LANGUAGE = English FRAMEWORK_SUBPROJECTS = Framework PALETTES = Palette OTHERSRCS = make.sh Makefile platform.make MAKEFILEDIR = . CODE_GEN_STYLE = DYNAMIC MAKEFILE = aggregate.make LIBS = DEBUG_LIBS = $(LIBS) PROF_LIBS = $(LIBS) include $(MAKEFILEDIR)/platform.make -include Makefile.preamble include $(MAKEFILEDIR)/$(MAKEFILE) -include Makefile.postamble -include Makefile.dependencies MiscKit2/Palettes/MiscTableScroll/PACKAGE_NUMBER100444 1750 1750 6 6757227305 21256 0ustar sunshinesunshine140 1 MiscKit2/Palettes/MiscTableScroll/PB.project100444 1750 1750 1546 6757227357 21222 0ustar sunshinesunshine{ DYNAMIC_CODE_GEN = YES; FILESTABLE = { BUNDLES = (); FRAMEWORKS = (); LIBS = (); OTHER_SOURCES = (make.sh, Makefile, platform.make); SUBPROJECTS = (Framework, Palette); TOOLS = (); }; LANGUAGE = English; LOCALIZABLE_FILES = {}; MAKEFILEDIR = .; NEXTSTEP_BUILDTOOL = /bin/gnumake; NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; PDO_UNIX_BUILDTOOL = $NEXT_ROOT/NextDeveloper/bin/make; PDO_UNIX_JAVA_COMPILER = "$(NEXTDEV_BIN)/javac"; PDO_UNIX_OBJCPLUS_COMPILER = "$(NEXTDEV_BIN)/gcc"; PROJECTNAME = MiscTableScroll; PROJECTTYPE = Aggregate; PROJECTVERSION = 2.7; WINDOWS_BUILDTOOL = ./make.sh; WINDOWS_JAVA_COMPILER = "$(JDKBINDIR)/javac.exe"; WINDOWS_OBJCPLUS_COMPILER = "$(DEVDIR)/gcc"; } MiscKit2/Palettes/MiscTableScroll/README.rtf100444 1750 1750 55521 6757227357 21025 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\ftech Symbol;\f2\fmodern Ohlfs;} \paperw10980 \paperh7500 \margl120 \margr120 {\colortbl;\red0\green0\blue0;} \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\f0\b\i0\ulnone\fs36\fc0\cf0 MiscTableScroll\ \b0\fs12 \ \fs24 By Paul S. McCarthy and Eric Sunshine\ Copyright \f1 \f0 1995, 1996, 1997, 1998, 1999 by Paul S. McCarthy and Eric Sunshine\ August 20, 1999\ \fs12 \ \ \b\fs28 Overview \fs24 \ \b0\fs12 \ \fs24 This is the source code for the MiscTableScroll framework and palette for MacOS/X Server and OPENSTEP. MiscTableScroll is similar to Apple's NSTableView class, and is accessible from both Objective-C and Java. This version of MiscTableScroll is compatible with MacOS/X Server for Mach and Windows, OPENSTEP 4.2 for Mach and Windows, as well as OPENSTEP 4.1 for Mach.\ \fs12 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\i\fs24\fc0\cf0 WARNING \i0 : Users of previous releases of MiscTableScroll should read the \i Release Notes \i0 section in this document. It details changes in this version which are incompatible with previous releases.\ \fs12 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fc0\cf0 \ \b\fs24 User Interface Highlights\ \b0\fs12 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fi-160\li360\fc0\cf0 Column and row titles.\ Resizing of columns and rows.\ Dragging rows and columns to rearrange them.\ Automatic sorting of rows as columns are rearranged.\ A button in column titles to toggle between ascending and descending sort direction.\ Incremental search.\ In-cell text editing.\ Exporting contents as ASCII, ASCII-delimited or dBASE through the Save Panel.\ Full keyboard and mouse control.\ Interacts with the Pasteboard, Font Panel, and Services.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \ \b\fs24 Programmatic Highlights\ \b0\fs12 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fi-160\li360\fc0\cf0 Accessible from Objective-C and Java.\ Each column and row can have its own size.\ Each cell can have its own color and font or inherit them from the table.\ Each column can have its own cell type.\ Lazy mode for large or expensive-to-generate data sets.\ Full control over selection.\ Smart memory management you don't pay for features you don't use.\ Simple indexed access to rows and columns regardless of visual order.\ Uniform treatment of rows and columns referred to generically as \i slots \i0 .\ Support for dragging images directly out of cells.\ Extensive delegate hooks and notifications.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \ \b\fs28 Installation \fs24 \ \b0\fs12 \ \fs24 MiscTableScroll is normally distributed with the MiscKit for MacOS/X Server and OPENSTEP. However, since it does not use nor rely on any other part of the MiscKit, it can be used as a stand-alone framework and palette. Consequently, this package can be used to create a stand-alone framework and palette or to replace an out-of-date copy of MiscTableScroll which was included with the MiscKit.\ \fs12 \ \fs24 Directory organization differs between MacOS/X Server and OPENSTEP, as well as between Mach and Windows installations. At installation time, environment variables can be used as an abstraction to overcome these differences. The process of defining environment variables differs from shell to shell. If you are using the C-shell then you can define an environment variable, for instance \f2\fs20\fc1\cf1 MISC_DEV \f0\fs24\fc0\cf0 , by typing:\ \fs12 \ \f2\fs20\fi-240\li600 % setenv MISC_DEV "example"\ \f0\fs12\fi0\li0 \ \fs24 If you are using the Bourne shell then you can define an environment variable by typing:\ \fs12 \ \f2\fs20\fi-240\li600 $ MISC_DEV="example"\ $ export MISC_DEV\ \f0\fs12\fi0\li0 \ \fs24 All of the instructions below assume that the environment variables \f2\fs20\fc1\cf1 MISC_LIB \f0\fs24\fc0\cf0 and \f2\fs20\fc1\cf1 MISC_DEV \f0\fs24\fc0\cf0 have been defined. \f2\fs20\fc1\cf1 MISC_LIB \f0\fs24\fc0\cf0 is the directory which contains the standard \i library \i0 resources such as frameworks and documentation. \f2\fs20\fc1\cf1 MISC_DEV \f0\fs24\fc0\cf0 is the standard development directory which contains source code, Interface Builder palettes, and example programs.\ \fs12 \ \fs24 On MacOS/X Server for Mach, and YellowBox for Windows, these variables should be defined as follows:\ \fs12 \ \pard\tx1980\tx4320\ul\fs24\li360\fc0\cf0 Variable \ulnone\fc1\cf1 \ul\fc0\cf0 Mach \ulnone\fc1\cf1 \ul\fc0\cf0 Windows\ \f2\ulnone\fs20\fc1\cf1 MISC_LIB /Local/Library $\{NEXT_ROOT\}/Local/Library\ MISC_DEV /Local/Developer $\{NEXT_ROOT\}/Local/Developer\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\f0\fs12\fc0\cf0 \ \fs24 For OPENSTEP for Mach and Windows, they should be defined as:\ \fs12 \ \pard\tx1980\tx4320\ul\fs24\li360\fc0\cf0 Variable \ulnone\fc1\cf1 \ul\fc0\cf0 Mach \ulnone\fc1\cf1 \ul\fc0\cf0 Windows\ \f2\ulnone\fs20\fc1\cf1 MISC_LIB /LocalLibrary $\{NEXT_ROOT\}/Local/Library\ MISC_DEV /LocalDeveloper $\{NEXT_ROOT\}/Local/Developer\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\f0\fs12\fc0\cf0 \ \fs24 If these locations are inappropriate for your site, configure them to suit your needs. \fs12 \ \ \fs24 Next, follow these steps to install the MiscTableScroll package:\ \fs12 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fi-160\li360\fc0\cf0 Check version numbers\ Remove previous version\ Unpack\ Compile and install framework and palette\ Compile and install Java support\ Compile the example programs \i (optional) \i0 \ Clean up\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \ \b\fs24 Check Version Numbers\ \b0\fs12 \ \fs24 If you have a previous version of MiscTableScroll for MacOS/X Server or OPENSTEP installed, check the version number of the package which you already have by looking in the \f2\fs20 PACKAGE_NUMBER \f0\fs24 file in the source code directory or inside either the installed framework or palette. Compare that number with the version number encoded in the name of the package file \f2\fs20 MiscTableScroll. \f0\b\fs24 ???.? \f2\b0\fs20 .gnutar.gz \f0\fs24 . This way you can tell which version is newer or older, and decide whether to proceed.\ \fs12 \ \ \b\fs24 Remove Previous Version\ \b0\fs12 \ \fs24 If you have a previous version of the MiscTableScroll that you want to replace with this package, then you need to remove the old version before unpacking the new version.\ \fs12 \ \fs24 If you used the standard MiscKit directory structure then these commands will remove the previous version. If you used a different directory structure, then you may need to adjust the commands to match your installation.\ \fs12 \ \f2\fs20\fi-240\li600 # Remove source\ % rm -rf $\{MISC_DEV\}/Source/MiscKit2/Palettes/MiscTableScroll \\\ $\{MISC_DEV\}/Source/MiscKit2/Examples/JavaScrollDir \\\ $\{MISC_DEV\}/Source/MiscKit2/Examples/LazyScrollDir \\\ $\{MISC_DEV\}/Source/MiscKit2/Examples/ScrollDir\ \f0\fs12\fi0\li0 \ \f2\fs20\fi-240\li600 # Remove targets\ % rm -rf $\{MISC_LIB\}/Frameworks/MiscTableScroll.framework \\\ $\{MISC_DEV\}/Palettes/MiscTableScroll.palette \\\ $\{MISC_DEV\}/Examples/MiscKit2/JavaScrollDir \\\ $\{MISC_DEV\}/Examples/MiscKit2/LazyScrollDir \\\ $\{MISC_DEV\}/Examples/MiscKit2/ScrollDir\ \f0\fs12\fi0\li0 \ \ \b\fs24 Unpack\ \b0\fs12 \ \fs24 Unpack the MiscTableScroll package by choosing a convenient directory for the source code, such as \f2\fs20 $\{MISC_DEV\}/Source \f0\fs24 , and performing the following commands:\ \fs12 \ \f2\fs20\fi-240\li600 % mkdir $\{MISC_DEV\}\ % mkdir $\{MISC_DEV\}/Source\ % cd $\{MISC_DEV\}/Source\ % gunzip MiscTableScroll*.gnutar.gz\ % gnutar xvf MiscTableScroll*.gnutar\ \f0\fs12\fi0\li0 \ \fs24 Unpacking the MiscTableScroll package creates the following directory structure:\ \fs12 \ \pard\tx720\tx1080\tx1440\tx1800\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\f2\fs20\li360\fc0\cf0 MiscKit2\ Examples\ JavaScrollDir\ LazyScrollDir\ ScrollDir\ Palettes\ MiscTableScroll\ Framework\ Documentation\ Java\ Notes\ Palette\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\f0\fs12\fc0\cf0 \ \ \b\fs24 Compile and Install Framework and Palette\ \b0\fs12 \ \fs24 By default, MiscTableScroll is configured to install its components in the following locations:\ \fs12 \ \pard\tx3600\ul\fs24\fi-3240\li3600\fc1\cf1 Component \ulnone \ul Installation Location \ulnone \ \f2\fs20 MiscTableScroll.framework $\{MISC_LIB\}/Frameworks\ MiscTableScroll.palette $\{MISC_DEV\}/Palettes\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\f0\fs12\fc0\cf0 \ \fs24 On Windows 95 and NT these additional resources are also installed:\ \fs12 \ \pard\tx3600\f2\fs20\fi-3240\li3600\fc0\cf0 MiscTableScroll.dll $\{MISC_LIB\}/Executables \f0\fs24 \ \f2\fs20 MiscTableScrollJava.dll $\{MISC_LIB\}/Executables \f0\fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \fs24 If these locations are inappropriate for your site, you can adjust them using Project Builder's \i Inspector \i0 panel. The installation directory can be configured individually for both the framework and the palette.\ \fs12 \ \fs24 To build and install the MiscTableScroll framework and palette using Project Builder, follow these steps:\ \fs12 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fi-160\li360\fc0\cf0 Open the project file contained within the top-level MiscTableScroll source directory: \f2\fs20 $\{MISC_DEV\}/Source/MiscKit2/Palettes/MiscTableScroll/PB.project \f0\fs24 \ Select the \f2\fs20 install \f0\fs24 target on the \i Build Options \i0 panel \f2\fs20 . \f0\fs24 \ If you wish to build the project for multiple architectures, such as PowerPC, Intel, Motorola, etc., choose the appropriate options on the \i Build Options \i0 panel.\ Press the \i Build \i0 button.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \fs24 If you are using Windows 95 or NT then you must also add the framework's executable path to your system \f2\fs20 PATH \f0\fs24 variable. For instance, with YellowBox, if \f2\fs20\fc1\cf1 $\{NEXT_ROOT\} \f0\fs24\fc0\cf0 at your site is defined as \f2\fs20\fc1\cf1 C:/Apple/ \f0\fs24\fc0\cf0 , then you should add \f2\fs20\fc1\cf1 C:\\Apple\\Local\\Library\\Executables \f0\fs24\fc0\cf0 to the \f2\fs20\fc1\cf1 PATH \f0\fs24\fc0\cf0 . For OPENSTEP, with \f2\fs20\fc1\cf1 $\{NEXT_ROOT\} \f0\fs24\fc0\cf0 defined as \f2\fs20\fc1\cf1 C:/NeXT/ \f0\fs24\fc0\cf0 , you should add \f2\fs20 C:\\NeXT\\LocalLibrary\\Executables \f0\fs24 to your \f2\fs20 PATH \f0\fs24 . Consult the Windows documentation if you need help setting the PATH environment variable.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \ \b\fs24 Compile and Install Java Support\ \b0\fs12 \ \fs24 As of MacOS/X Server (DR2), MiscTableScroll and its supporting classes are accessible from Java. OPENSTEP does not provide Java support, so OPENSTEP users may proceed to the next section. Java support for MiscTableScroll is discussed in the document \f2\fs20\fc1\cf1 MiscTableScroll.rtf \f0\fs24\fc0\cf0 .\ \fs12 \ \fs24 The MiscTableScroll Java-related resources are installed within the MiscTableScroll framework. On Windows, an additional file, \f2\fs20\fc1\cf1 MiscTableScrollJava.dll \f0\fs24\fc0\cf0 is also installed in \f2\fs20\fc1\cf1 $\{MISC_LIB\}/Executables \f0\fs24\fc0\cf0 alongside \f2\fs20\fc1\cf1 MiscTableScroll.dll \f0\fs24\fc0\cf0 .\ \fs12 \ \fs24 To build and install the MiscTableScroll Java support facilities using Project Builder, follow these steps:\ \fs12 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fi-160\li360\fc0\cf0 Open the project file contained within MiscTableScroll's Java subdirectory: \f2\fs20 $\{MISC_DEV\}/Source/MiscKit2/Palettes/MiscTableScroll/Java/PB.project \f0\fs24 \ Select the \f2\fs20 install \f0\fs24 target on the \i Build Options \i0 panel \f2\fs20 . \f0\fs24 \ If you wish to build the Java support library for multiple architectures, such as PowerPC or Intel, choose the appropriate options on the \i Build Options \i0 panel.\ Press the \i Build \i0 button.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \ \b\fs24 Compile Example Programs \b0\i (optional) \b\i0 \ \b0\fs12 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc0\cf0 You can build the example programs \f2\fs20\fc1\cf1 JavaScrollDir \f0\fs24\fc0\cf0 , \f2\fs20 LazyScrollDir, \f0\fs24 and \f2\fs20 ScrollDir \f0\fs24 using Project Builder. \f2\fs20\fc1\cf1 JavaScrollDir \f0\fs24\fc0\cf0 can be built for MacOS/X Server and YellowBox, but not for OPENSTEP which lacks Java support. To build the example programs with Project Builder:\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fi-160\li360\fc0\cf0 Open the \f2\fs20\fc1\cf1 PB.project \f0\fs24\fc0\cf0 file contained within the each source directory.\ Choose the appropriate architectures from the \i Build Options \i0 panel.\ Press the \i Build \i0 button.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc0\cf0 The project files for the example programs are:\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \pard\tx5040\f2\fs20\fi-4680\li5040\fc0\cf0 $\{MISC_DEV\}/Source/MiscKit2/Examples/JavaScrollDir/PB.project \f0\fs24 \ \f2\fs20 $\{MISC_DEV\}/Source/MiscKit2/Examples/LazyScrollDir/PB.project \f0\fs24 \ \f2\fs20 $\{MISC_DEV\}/Source/MiscKit2/Examples/ScrollDir/PB.project \f0\fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc0\cf0 Finally, if you would like to have the source code for the example programs available for perusal, you can install them in \f2\fs20 $\{MISC_DEV\}/Examples/MiscKit2 \f0\fs24 , either by copying the directories using the File Viewer or by typing the following commands:\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \f2\fs20\fi-240\li600 % cd $\{MISC_DEV\}\ % rm -rf Examples/MiscKit2/JavaScrollDir Examples/MiscKit2/LazyScrollDir Examples/MiscKit2/ScrollDir\ % mkdir Examples\ % mkdir Examples/MiscKit2\ % cp -r Source/MiscKit2/Examples/JavaScrollDir Source/MiscKit2/Examples/LazyScrollDir Source/MiscKit2/Examples/ScrollDir Examples/MiscKit2\ \f0\fs12\fi0\li0 \ \ \b\fs24 Clean Up\ \b0\fs12 \ \fs24 At this point the installation is complete. To reclaim disk space, remove the temporary files which were created during the build process by pressing the \i Clean \i0 button on Project Builder's \i Build \i0 panel. Or, if you do not plan to refer back to the source code at all, then you can delete the project directory entirely: \fs12 \ \ \f2\fs20\fi-240\li600 % rm -rf $\{MISC_DEV\}/Source/MiscKit2\ \f0\fs12\fi0\li0 \ \ \b\fs28 Conversion \fs24 \ \b0\fs12 \ \fs24 This package comes with a \i\fc1\cf1 tops \i0\fc0\cf0 script to assist in the process of porting NEXTSTEP programs which use MiscTableScroll to MacOS/X Server and OPENSTEP. The script should be used after running the standard \i NextStep to OpenStep \i0 conversion scripts which are supplied with OPENSTEP. The MiscTableScroll conversion script is located within the framework at:\ \fs12 \ \pard\tx5040\f2\fs20\fi-4680\li5040\fc0\cf0 MiscTableScroll.framework/Resources/MiscTableScroll-3.3-4.x.tops\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\f0\fs12\fc0\cf0 \ \ \b\fs28 Documentation \fs24 \ \b0\fs12 \ \fs24 Documentation for the public classes is located within the framework's \f2\fs20\fc1\cf1 Documentation \f0\fs24\fc0\cf0 directory in these files:\ \fs12 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fi-160\li360\fc0\cf0 MiscTableScroll.rtf\ MiscTableCell.rtf\ MiscExporter.rtf\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \fs24 A full discussion of the use of MiscTableScroll from Java is included in the document \f2\fs20\fc1\cf1 MiscTableScroll.rtf \f0\fs24\fc0\cf0 in the section titled \i Java \i0 .\ \fs12 \ \fs24 The example programs demonstrate how to use the most important features of MiscTableScroll:\ \fs12 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fi-160\li360\fc0\cf0 \f2\fs20 JavaScrollDir \f0\fs24 \ \f2\fs20 LazyScrollDir \f0\fs24 \ \f2\fs20 ScrollDir \f0\fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \fs24 The following files also provide valuable information. Except for \f2\fs20 PACKAGE_NUMBER \f0\fs24 which is located in the top-level source directory, all of the remaining files reside in the \f2\fs20 Notes \f0\fs24 subdirectory.\ \fs12 \ \pard\tx2880\f2\fs20\fi-2520\li2880\fc0\cf0 PACKAGE_NUMBER \f0\fs24 MiscTableScroll version \f2\fs20 . \f0\fs24 \ \f2\fs20 HISTORY.txt \f0\fs24 Description of changes between versions.\ \f2\fs20 OPENSTEP-HISTORY.txt \f0\fs24 Description of MacOS/X & OPENSTEP changes between versions.\ \f2\fs20 TODO.txt \f0\fs24 A list of future enhancements.\ \f2\fs20 OPENSTEP-TODO.txt \f0\fs24 A list of MacOS/X Server & OPENSTEP related future enhancements.\ \f2\fs20 BUGS.txt \f0\fs24 A list of known bugs.\ \f2\fs20 OPENSTEP-BUGS.txt \f0\fs24 A list of MacOS/X Server & OPENSTEP related bugs.\ \f2\fs20 JAVA-TODO.txt \f0\fs24 A list of Java specific future enhancements.\ \f2\fs20 JAVA-BUGS.txt \f0\fs24 A list of Java specific bugs.\ \f2\fs20 MACH-NT-4.2.txt \f0\fs24 Description of issues which arose when porting MiscTableScroll from OPENSTEP 4.1 for Mach to OPENSTEP 4.2 for both Mach and Microsoft Windows.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \fs24 Finally, the source code itself is commented and may be consulted as needed. It has been formatted with tab-stops of 8 characters and indentation of 4 spaces. \fs12 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fc0\cf0 \ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs28\fc0\cf0 Release Notes\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\b0\fs12\fc0\cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fc0\cf0 The most significant item of note in this release of MiscTableScroll is that it is now accessible from Java. Extensive documentation detailing use of MiscTableScroll from Java is included in \f2\fs20\fc1\cf1 MiscTableScroll.rtf \f0\fs24\fc0\cf0 , and is demonstrated concretely by the new example program, JavaScrollDir.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fc0\cf0 To be consistent with other MacOS/X Server and OpenStep classes, MiscTableScroll now sends notifications in places where it used to solely dispatch certain delegate messages. As with other OpenStep classes which have delegates, MiscTableScroll automatically registers its own delegates to receive these notifications if the delegates implement the appropriate messages. Each notification-style delegate message now receives an \f2\fs20\fc1\cf1 NSNotification \f0\fs24\fc0\cf0 object as its sole argument. The documentation in \f2\fs20\fc1\cf1 MiscTableScroll.rtf \f0\fs24\fc0\cf0 lists the contents of the \f2\fs20\fc1\cf1 userInfo \f0\fs24\fc0\cf0 dictionary \fc1\cf1 for each notification. \fc0\cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\i\fs24\fc0\cf0 WARNING \i0 : \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fc0\cf0 A number of MiscTableScroll methods have been renamed. \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fc0\cf0 Most notably, as a result of the move to notifications, the names of several delegate messages changed. This is significant because your application may cease to work correctly, even though it compiles cleanly, since the old delegate methods are no longer called. The delegate methods which were renamed are listed in \f2\fs20\fc1\cf1 OPENSTEP-HISTORY.txt \f0\fs24\fc0\cf0 . \fc1\cf1 As a consequence of this incompatible change, the framework's version identification has been advanced from \i A \i0 to \i B \i0 . \fc0\cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fc0\cf0 The final significant change is the addition of support for \i represented objects \i0 , which complements represented object support in NSCell. A represented object may be associated with the entire table as well as each row and column.\ \fs12 \ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs28\fc0\cf0 Conclusion\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\b0\fs12\fc0\cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc0\cf0 MiscTableScroll was written by Paul S. McCarthy and Eric Sunshine and is copyright \f1 \f0 1995, 1996, 1997, 1998, 1999 by Paul S. McCarthy and Eric Sunshine. It is included in the MiscKit by permission from the authors and is governed by the MiscKit license found in the file \f2\fs20 License.rtf \f0\fs24 in the MiscKit distribution.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc0\cf0 Please direct comments, questions, and complaints to:\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs24\fi-160\li360\fc0\cf0 Paul S. McCarthy \f2\fs20 \f0\fs24 \ Eric Sunshine \f2\fs20 \f0\fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\fs12\fc0\cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fs24\fc0\cf0 MIME and ASCII mail accepted. \fs12 \ } MiscKit2/Palettes/MiscTableScroll/platform.make100444 1750 1750 13121 6757227305 22015 0ustar sunshinesunshine#****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # platform.make (1999-06-09, version 1.1) # # A cross-platform compatibility makefile which allows a project to be # built for both MacOS/X Server and OpenStep without maintaining # distinct PB.project files and Makefiles for each platform. # # Prior to MacOS/X Server, system-supplied makefiles resided in a # constant location, in this case $(NEXT_ROOT)/NextDeveloper/Makefiles. # As of MacOS/X Server, however, the directory structure changed, so # that on Mach, makefiles now reside in /System/Developer/Makefiles, and # on Windows they reside in $(NEXT_ROOT)/Developer/Makefiles. # # Apple hacked GNU's "make" utility on MacOS/X Server so that it # automatically defines the variable MAKEFILEPATH, which on Mach # defaults to /System/Developer/Makefiles, and on Microsoft Windows # defaults to $(NEXT_ROOT)/Developer/Makefiles. In this manner, they # are able to refer to the system makefile directory without having to # hardcode the path into the local makefile as they did prior to MacOS/X # Server. # # However, Apple's hack does not help the developer who must still # support earlier platforms which use the old directory structure, nor # did Apple provide a backward compatibility solution. Consequently, # the developer is forced to maintain two sets of PB.project files and # Makefiles; one for OpenStep 4.x, and one for MacOS/X Server and later. # # This file (platform.make) bridges the gap between the old directory # structure and the new by forcefully inserting itself into the make # process at the earliest possible time and adjusting the makefile path # dynamically to match either the old or the new directory structure. # # To insert this file into the make process, follow these steps: # # a) If the project is currently open in ProjectBuilder.app, close it. # b) Open the project's top-level PB.project file in a text editor. # c) Find the line which defines MAKEFILEDIR. Its definition will be # either $(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles or # $(MAKEFILEPATH)/pb_makefiles depending upon whether it was # generated by OpenStep 4.x or MacOS/X Server. # d) Change the value of MAKEFILEDIR to "." (a single quoted period). # e) Open the project's top-level Makefile in a text editor. # f) Find the line which defines MAKEFILEDIR. # g) Change the value of MAKEFILEDIR to . (a single period). # h) Place this file (platform.make) in the project's main directory. # # The variable MAKEFILEDIR is normally used to locate the system makefile # directory from which platform.make is loaded as the very beginning of # the build process. By changing the value of MAKEFILEDIR to ".", this # replacement platform.make gets loaded instead. # # Once in control, this file determines the correct makefile path # dynamically, either $(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles # or $(MAKEFILEPATH)/pb_makefiles and sets it as the value of MAKEFILEDIR # so that later references to MAKEFILEDIR use the actual system # makefiles. Finally, the real system platform.make is loaded, and # control returns to the caller. # # To further facilitate cross-platform development, this file also # defines the following variables for pre-MacOS/X Server platforms which # are normally only defined for MacOS/X Server and later platforms. # These variables are typically used by "install" targets where the # installation location may vary from platform to platform. # # MAKEFILEPATH Path to system makefiles # USER_APPS_DIR $(HOME)/Apps [vs. $(HOME)/Applications on OS/X] # USER_LIBRARY_DIR $(HOME)/Library # LOCAL_APPS_DIR /LocalApps [Mach] or /Local/Apps [Windows] # LOCAL_LIBRARY_DIR /LocalLibrary or /Local/Library # LOCAL_DEVELOPER_DIR /LocalDeveloper or /Local/Developer # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ ifndef MAKEFILEPATH MAKEFILEPATH=$(NEXT_ROOT)/NextDeveloper/Makefiles endif MAKEFILEDIR=$(MAKEFILEPATH)/pb_makefiles include $(MAKEFILEDIR)/platform.make ifeq "NEXTSTEP" "$(OS)" ifndef USER_APPS_DIR export USER_APPS_DIR=$(HOME)/Apps endif ifndef USER_LIBRARY_DIR export USER_LIBRARY_DIR=$(HOME)/Library endif ifndef LOCAL_APPS_DIR export LOCAL_APPS_DIR=/LocalApps endif ifndef LOCAL_LIBRARY_DIR export LOCAL_LIBRARY_DIR=/LocalLibrary endif ifndef LOCAL_DEVELOPER_DIR export LOCAL_DEVELOPER_DIR=/LocalDeveloper endif else # Windows and PDO platforms ifndef USER_APPS_DIR export USER_APPS_DIR=$(HOME)/Apps endif ifndef USER_LIBRARY_DIR export USER_LIBRARY_DIR=$(HOME)/Library endif ifndef LOCAL_APPS_DIR export LOCAL_APPS_DIR=/Local/Apps endif ifndef LOCAL_LIBRARY_DIR export LOCAL_LIBRARY_DIR=/Local/Library endif ifndef LOCAL_DEVELOPER_DIR export LOCAL_DEVELOPER_DIR=/Local/Developer endif endif MiscKit2/Examples/ 40755 1750 1750 0 6757227605 14177 5ustar sunshinesunshineMiscKit2/Examples/ScrollDir/ 40755 1750 1750 0 6757366055 16077 5ustar sunshinesunshineMiscKit2/Examples/ScrollDir/English.lproj/ 40755 1750 1750 0 6757227532 20611 5ustar sunshinesunshineMiscKit2/Examples/ScrollDir/English.lproj/DirWindow.nib/ 40755 1750 1750 0 6722775725 23272 5ustar sunshinesunshineMiscKit2/Examples/ScrollDir/English.lproj/DirWindow.nib/data.classes100444 1750 1750 1355 6713657177 25661 0ustar sunshinesunshine"DirWindow" = { ACTIONS = { "autoSortClick:" = id; "cdPressed:" = id; "dragUnscaledClick:" = id; "hiddenFilesClick:" = id; "highlightClick:" = id; "refreshPressed:" = id; "rowNumbersClick:" = id; "scrollClick:" = id; "scrollDoubleClick:" = id; }; OUTLETS = { autoSortSwitch = id; cdButton = id; countField = id; dragUnscaledSwitch = id; hiddenFilesSwitch = id; highlightSwitch = id; refreshButton = id; rowNumbersSwitch = id; scroll = id; window = id; }; SUPERCLASS = NSObject; }; "FirstResponder" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSObject; }; MiscKit2/Examples/ScrollDir/English.lproj/DirWindow.nib/objects.nib100444 1750 1750 6442 6757227541 25512 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ DirWindowi NSButton NSControl)NSView) NSResponder @@@@ffffffffNSMutableArrayNSArray MiscTableScrollꄄ NSScrollView* NSClipView:@vv@@cccNSColorc@@@SystemcontrolBackgroundColorff?* NSScrollericc@ff:?x _doScroller:Affi NSFont[20c] Helveticaf controlTextColorselectedControlTextColorselectedControlColorIP    x  < d P < < ( P [10i] NameSizeModifiedPermsOwnerGroupLinks Soft Link  x $BB NSButtonCell9 NSActionCellNSCell<ii@@@@Refresh Helvetica i:ń ssIi@@@@@@ Helvetica  NSTextField!,NSTextFieldCell=ȶ9999 files 9999999 bytes̈́c@@textBackgroundColor:! ǶShow Hidden Files˅Թ<@NSCustomResource)NSImageNSSwitchؖلNSHighlightedSwitch!)~~Ƕ Auto Sort˅ݹ<@ۅ! ǶHighlight Directories˅แ<@ۅ!~~ǶDrag Big Images˅㹁<@ۅ!~~Ƕ Row Numbers˅湁<@ۅ 蒅$"BBǶTraverse˅@̅ŞNSWindowTemplate) iiffffi@@@@@cG`xWindowNSWindowViewffff~͞땖㞖Ԟݞ枙넘Window File's Owner NSMutableSetNSSetNSIBOutletConnector NSIBConnector넘windowscroll땄delegatedelegateNSIBControlConnector scrollClick:cdButton cdPressed:ń refreshButtonŕrefreshPressed:̈́ countFieldԄhiddenFilesSwitchԕhiddenFilesClick:݄autoSortSwitchݕautoSortClick:highlightSwitchhighlightClick: nextKeyView뢄initialFirstResponderMiscTableConnectorscrollDoubleClick: doubleTarget doubleAction㕄dragUnscaledClick:ㄘdragUnscaledSwitch愘rowNumbersSwitch敄rowNumbersClick:愘 nextKeyView----*@i/ Ȟȕ*1 ș(0'Ȣ .5   *%18 &.07/6 ,4$-9MiscKit2/Examples/ScrollDir/English.lproj/Info.nib/ 40755 1750 1750 0 6722775725 22257 5ustar sunshinesunshineMiscKit2/Examples/ScrollDir/English.lproj/Info.nib/data.classes100444 1750 1750 302 6710113350 24566 0ustar sunshinesunshine"DirController" = { ACTIONS = {}; OUTLETS = {infoPanel = id; infoText = id; }; SUPERCLASS = NSObject; }; "FirstResponder" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSObject; }; MiscKit2/Examples/ScrollDir/English.lproj/Info.nib/objects.nib100444 1750 1750 4207 6757227542 24475 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ DirControlleri NSView) NSResponderNSBox) @@@@ffffffffNSMutableArrayNSArray NSTextField NSControl)!  icc@NSTextFieldCell= NSActionCellNSCell<ii@@@@LCopyright (C) 1995,1996,1997,1998,1999 by Paul S. McCarthy and Eric SunshineNSFont[20c] Helveticaf ci:c@@NSColor@@@System controlColorff?*ffff: nff@@cccBox Helvetica  ;MiscTableScroll Example HelveticatextBackgroundColorcontrolTextColor NSImageView NSMutableSetNSSetINSFilenamesPboardTypeNeXT filename pasteboard typet0000 NSImageCell)NSCustomResource)NSImage ScrollDiriii NSScrollView* NSClipView:ЙNSTextTemplate.NSViewTemplate.әNNӒNSText textColor Helvetica NNNВ֒ք@@cccNSCursor͖΄ NSIBeamCursor NSScrollerЙNNВЄff: _doScroller:ЙWWВ?rCë R RӒӒffi "BoxЖžNSWindowTemplate) iiffffi@@@@@co`xInfoNSPanelViewԆОօ鄘Info File's OwnerƷNSIBOutletConnector NSIBConnector鄘 infoPanelքinfoText@i ɴɕɲ əɜɸ ɞ MiscKit2/Examples/ScrollDir/English.lproj/SD_PageLayout.nib/ 40755 1750 1750 0 6722775725 24024 5ustar sunshinesunshineMiscKit2/Examples/ScrollDir/English.lproj/SD_PageLayout.nib/data.classes100444 1750 1750 601 6710105640 26340 0ustar sunshinesunshine"FirstResponder" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSObject; }; "SD_PageLayout" = { ACTIONS = {}; OUTLETS = { accessoryWindow = id; bottomMarginField = id; centerMatrix = id; leftMarginField = id; paginationMatrix = id; rightMarginField = id; topMarginField = id; }; SUPERCLASS = NSObject; }; MiscKit2/Examples/ScrollDir/English.lproj/SD_PageLayout.nib/objects.nib100444 1750 1750 6544 6705554627 26250 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ SD_PageLayouti NSButtonCell9 NSActionCellNSCell<ii@@@@CellNSFont[20c] Helveticaf ci:NSMatrix< NSControl)NSView) NSResponderNSBox) @@@@ffffffffNSMutableArrayNSArray NSTextField1..icc@NSTextFieldCell=q@c@@NSColor@@@SystemtextBackgroundColorffcontrolTextColor:#..Left:1..q@ ..Right:¯..q@ůc#66Top:ǯ..q@ʯc 66Bottom:̯77sIIff@@cccMarginsљә<<<<Ӓ#iiii:::ffffi@@@@@DՄ ssIi@@@@@7@NSCustomResource)NSImageAlign.HLeft.VTopն7@ٖڄAlign.HCentered.VTopն7@ٖڄAlign.HLeft.VCenteredն7@ٖڄAlign.HCentered.VCentered7@؅׆FAFAђJSJSCenterссihqhq Paginationd_d_ZZZZD 7@ٖڄPagination.HFit.VFit7@ٖڄPagination.HAuto.VFit7@ٖڄPagination.HFit.VAuto7@ٖڄPagination.HAuto.VAuto7@ٖڄPagination.HClip.VAuto7@ٖڄPagination.HFit.VClip7@ٖڄPagination.HAuto.VClip7@ٖڄPagination.HClip.VClip7@󆶁7@ٖڄPagination.HClip.VFitՖѨ®󠖥ՖNSWindowTemplate) iiffffi@@@@@cс`xWindowNSWindowViewffffZ Ֆ𠖮̮ǮՖӖŮіʮ File's OwnerWindow NSMutableSetNSSetINSIBOutletConnector NSIBConnectorleftMarginFieldaccessoryWindowʄbottomMarginFieldrightMarginFieldńtopMarginFieldń nextKeyViewdelegate ŕ" "ʕ"Մ centerMatrixpaginationMatrixՠ nextKeyView--1@i".1  (- !'',%%*&+! $ $)#*. &/2#(,06MiscKit2/Examples/ScrollDir/English.lproj/ScrollDir-macintosh.nib/ 40755 1750 1750 0 6722775725 25244 5ustar sunshinesunshineMiscKit2/Examples/ScrollDir/English.lproj/ScrollDir-macintosh.nib/classes.nib100444 1750 1750 724 6713661074 27440 0ustar sunshinesunshine{ IBClasses = ( { ACTIONS = {info = id; openDirectory = id; runPageLayout = id; }; CLASS = DirController; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { ACTIONS = {destroy = id; export = id; openSelected = id; printDirectory = id; }; CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } ); IBVersion = 1; }MiscKit2/Examples/ScrollDir/English.lproj/ScrollDir-macintosh.nib/objects.nib100444 1750 1750 6645 6713661074 27464 0ustar sunshinesunshine streamtyped@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ NSApplicationi.NSMenui@@@ DirectoryNSMutableArrayNSArray NSMenuItemA i@@IIi@@@@:i@Open...oNSCustomResource)NSImageNSMenuCheckmarkNSMenuMixedStateClose Export...s Page Setup...PPrint...pQuitq ScrollDirNSAppleMenuImagesubmenuAction:InfoŸAbout ScrollDir _NSAppleMenuFileɄʟOpenOʟDeleterEditEditԟCutxԟCopycԟPastevԟClearԟԟ Select AllaFormatFormatFontFont Show FontstBoldbItalici _NSFontMenu Show ColorsCWindow Close Windoww Zoom WindowMinimize WindowmArrange in Front_NSWindowsMenuServicesServices_NSServicesMenu _NSMainMenuԖ Ԗ 漖ʖʖԖ–햸Ԗ DirControllerԖȖ¿Җ斩 Ҽ떻ȼԖ NSFontManager̄1Ϫ1233Ȫ121 DirController2 11 22 2MainMenu Font Manager2 File's Ownerʄ1 NSMutableSetNSSetINSNibOutletConnectorNSNibConnector@@@delegateNSNibControlConnector. terminate:1ㅄ selectAll:1݅paste:1څcopy:1ׅcut:1delete:1 addFontTrait:1 addFontTrait:1orderFrontFontPanel:1info:1openDirectory:1runPageLayout:1printDirectory:1orderFrontColorPanel:1 performZoom:1performMiniaturize:1 performClose:1 arrangeInFront:1 performClose:1̅ openSelected:1υdestroy:1export:F@iE5T3;OKC45ׁ?MJ,2=ʁ=ځ G9BCA YRI)K;UPSM0[Ú>7FҁI:OQLȁ<EŁ݁ԁG9ρ? N H DWQVMiscKit2/Examples/ScrollDir/English.lproj/ScrollDir-windows.nib/ 40755 1750 1750 0 6722775725 24751 5ustar sunshinesunshineMiscKit2/Examples/ScrollDir/English.lproj/ScrollDir-windows.nib/data.classes100444 1750 1750 547 6713661504 27307 0ustar sunshinesunshine"DirController" = { ACTIONS = {"info:" = id; "openDirectory:" = id; "runPageLayout:" = id; }; OUTLETS = {}; SUPERCLASS = NSObject; }; "FirstResponder" = { ACTIONS = { "destroy:" = id; "export:" = id; "openSelected:" = id; "printDirectory:" = id; }; OUTLETS = {}; SUPERCLASS = NSObject; }; MiscKit2/Examples/ScrollDir/English.lproj/ScrollDir-windows.nib/objects.nib100444 1750 1750 10552 6713661504 27177 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ NSApplicationi2 NSMenuItem NSMenuCell NSButtonCell9 NSActionCellNSCell<ii@@@@Open...NSFont[20c] Helveticaf ci:NSMatrix< NSControl)NSView) NSResponder @@@@ffffffffddicc@#iiii:::ffffi@@@@@dNSMutableArrayNSArrayClose ssIi@@@@@@w Export...@s-@ Page Setup...@PPrint...@p-@Exit@qNSColorff@oOpen?(?(?Deleteï@r@OÖH(H(H(FontsubmenuAction:NSMenuTemplate) ffccc@@@@\5FontNSMenu```( Font Panel...ѯ@tBoldѯ@bItalicѯ@iδՁIFormatɅδ$ ScrollDirNSMenuNNN DirectoryδՁ( Directoryࢅކᯁ@NSCustomResource)NSImage NSMenuArrow冒FileδՁo섘NSMenuÅކᯁ@煅톒EditδՁ6EditPPPPPCut@xCopy@cPaste@v Select All@aކᯁ@煅񆒄Formatܒᯁ@煅܆WindowδՁ/NSMenu^<^<^(Cascade@ Minimize All@h-@ކᯁ@煅ServicesδՁFServicesNSMenuPPPކᯁ@煅HelpδՁ#NSMenuooo(About ScrollDir@ކᯁ@煅ɯ@煅͆ Colors...ɯ@Cܖޖ͖ޕіᖄ DirController햪  NSFontManagerі˖і Öɖə Select AllPaste$ Font ManagerCut" DirControllerCopyބMainMenuEdit File's Owner NSMutableSetNSSetINSIBControlConnector NSIBConnector@@@cut:4copy:4paste:4 selectAll:NSIBOutletConnector5"delegate4"openDirectory:4orderFrontColorPanel:4 arrangeInFront:4 hide:4orderFrontColorPanel:4$ addFontTrait:4$ addFontTrait:4$orderFrontFontPanel:4orderFrontColorPanel:4orderFrontColorPanel:4"runPageLayout:4 terminate:4"info:4printDirectory:4 openSelected:4Ņdestroy:4export:4 performClose:$J@iX@Bف<$#TɁYˁEHb$=2% ^Ӂe*RZFP& )LvŁNz\;1ցZ 3.JuDb90́="сMÁI VB`܁_7/MiscKit2/Examples/ScrollDir/English.lproj/ScrollDir.nib/ 40755 1750 1750 0 6722775725 23261 5ustar sunshinesunshineMiscKit2/Examples/ScrollDir/English.lproj/ScrollDir.nib/data.classes100444 1750 1750 547 6713661123 25614 0ustar sunshinesunshine"DirController" = { ACTIONS = {"info:" = id; "openDirectory:" = id; "runPageLayout:" = id; }; OUTLETS = {}; SUPERCLASS = NSObject; }; "FirstResponder" = { ACTIONS = { "destroy:" = id; "export:" = id; "openSelected:" = id; "printDirectory:" = id; }; OUTLETS = {}; SUPERCLASS = NSObject; }; MiscKit2/Examples/ScrollDir/English.lproj/ScrollDir.nib/objects.nib100444 1750 1750 7745 6713661124 25477 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ NSApplicationi- NSMenuItem NSMenuCell NSButtonCell9 NSActionCellNSCell<ii@@@@DeleteNSFont[20c] Helveticaf ci:NSMatrix< NSControl)NSView) NSResponder @@@@ffffffff?(?(icc@#iiii:::ffffi@@@@@?NSMutableArrayNSArrayOpen ssIi@@@@@@ONSColorff@rWindowssubmenuAction:NSMenuTemplate) ffccc@@@@YWindowsNSMenu<<Arrange in Front@Miniaturize Window@m Close Window@w _ ScrollDirNNȒ N Info...ï@ DirectoryY DirectoryS(S(SOpen...˯@o Export...˯@sï@NSCustomResource)NSImage NSMenuArrowɆFileY؄NSMenuï@ӅنEditYEditPPPPPCut߯@xCopy߯@cPaste߯@v Select All߯@aï@Ӆ݆FormatYFormatNSMenuj<j<j(FontāFont񄣒```( Font Panel...@tBold@bItalic@i@Ӆ Colors...@CPage Layout...@Pï@ӅPrint...ï@pServicesY'ServicesNSMenuPPPï@ӅHideï@hQuitï@qï@ӅÖߖ DirController NSFontManager Ö ɖÖÖ Ö˖Öߖ˖ÖÖߖٖۖݖÖזߖǖÙ ᄘCut DirControllerۄEdit Font ManagerMainMenu焘Pasteꄘ Select AllQuit File's Owner䄘CopyHide NSMutableSetNSSetINSIBControlConnector NSIBConnector@@@hide:- terminate:-ᅄcut:-䅄copy:-煄paste:-ꅄ selectAll:NSIBOutletConnector.delegate-performMiniaturize:- performClose:-arrangeInFront:-openDirectory:-info:-Ѕexport:- addFontTrait:- addFontTrait:-orderFrontFontPanel:-orderFrontColorPanel:-runPageLayout:- printDirectory:- openSelected:-destroy:C@i81)??0-]EC[Q,,&WKHMCBI(+ 4/60O_qT LفI yU#A@=>2.GJe* SfGp$:2 F%ׁlMiscKit2/Examples/ScrollDir/make.sh100555 1750 1750 6027 6757227526 17452 0ustar sunshinesunshine#!/bin/sh #****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # make.sh (1999-06-09, version 1.1) # # A cross-platform compatibility build script which allows a project to # be built for both YellowBox and OpenStep for Microsoft Windows without # maintaining a distinct PB.project file for each environment. # # In OpenStep for Windows, the "make" utility was located in # $(NEXT_ROOT)/NextDeveloper/Executables. In YellowBox, "make" moved to # $(NEXT_ROOT)/Developer/Executables. Since the path to "make" is # stored in the PB.project file, this generally means that the developer # is forced to maintain two versions of PB.project; one for each # environment. # # This script (make.sh) bridges the gap between the old directory # structure and the new by dynamically determining the correct path for # "make" at build time. # # To insert this script into the build process, follow these steps: # # a) If the project is currently open in ProjectBuilder.app, close it. # b) Open the project's top-level PB.project file in a text editor. # c) Find the line which defines WINDOWS_BUILDTOOL. Its definition will # be either $NEXT_ROOT/NextDeveloper/Executables/make or # $NEXT_ROOT/Developer/Executables/make depending upon whether it # was generated by OpenStep 4.x or YellowBox. # d) Change the value of WINDOWS_BUILDTOOL to "./make.sh". # e) Place this script (make.sh) in the project's main directory. # f) Ensure that the script is executable: chmod a+x make.sh # # Project Builder uses the value of WINDOWS_BUILDTOOL to locate the # program which builds the project. By changing the value of # WINDOWS_BUILDTOOL to "./make.sh", this script is used to build the # project instead. # # Once in control, this script dynamically determines the correct path # to the "make" utility and then executes it on behalf of Project # Builder. # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ if [ -x ${NEXT_ROOT}/Developer/Executables/make.exe ]; then exec ${NEXT_ROOT}/Developer/Executables/make ${1+"$@"} elif [ -x ${NEXT_ROOT}/NextDeveloper/Executables/make.exe ]; then exec ${NEXT_ROOT}/NextDeveloper/Executables/make ${1+"$@"} elif [ -x ${NEXT_ROOT}/bin/gnumake ]; then exec ${NEXT_ROOT}/bin/gnumake ${1+"$@"} fi echo "Unable to determine location of 'make' utility." exit 1 MiscKit2/Examples/ScrollDir/Align.HLeft.VCentered.tiff100444 1750 1750 430 6757227532 22726 0ustar sunshinesunshineMM*J*JTVO(L-0b(-aS j?P8$ BaP (R;3 ' 'MiscKit2/Examples/ScrollDir/Align.HLeft.VTop.tiff100444 1750 1750 426 6757227533 21745 0ustar sunshinesunshineMM*H*J*VG$` ad9j91Ā ?P8$ BaP (R91 ' 'MiscKit2/Examples/ScrollDir/Lock.insecure.tiff100444 1750 1750 2762 6757227533 21554 0ustar sunshinesunshineII*?@@@@EEEUU??????0?<?<?<?<???????????? (R8~~ ' 'U?UOU?U?U?U?U?U?U?U?U?U?U?U?D_ϪϪD_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_ϪϪD_D_D_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_ r(R ' 'MiscKit2/Examples/ScrollDir/Lock.secure.tiff100444 1750 1750 2762 6757227533 21225 0ustar sunshinesunshineII* \40@@EEEUU???????<?<?<?<???????????? (R8~~ ' 'U?U?U?U?U?U?U?U?U?U?U?U?D_ϪϪD_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_ϪϪD_D_D_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_ r(R ' 'MiscKit2/Examples/ScrollDir/Defaults.h100444 1750 1750 4776 6757227520 20121 0ustar sunshinesunshine#ifndef __Defaults_h #define __Defaults_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // Defaults.h // // Simplified interface to NeXT defaults system. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: Defaults.h,v 1.2 97/03/23 01:40:38 sunshine Exp $ // $Log: Defaults.h,v $ // Revision 1.2 97/03/23 01:40:38 sunshine // v29.2: Brought into syncrhonization with LazyScrollDir v13.1 for OPENSTSEP. // // Revision 1.1 97/03/21 18:30:26 sunshine // v28: Defaults manager. //----------------------------------------------------------------------------- #import #import @class NSColor, NSFont; @interface Defaults : NSObject + (void)set:(NSString*)def str:(NSString*)s; + (void)set:(NSString*)def int:(int)i; + (void)set:(NSString*)def float:(float)f; + (void)set:(NSString*)def color:(NSColor*)c; + (void)set:(NSString*)def bool:(BOOL)b; + (void)set:(NSString*)def font:(NSFont*)f; + (void)set:(NSString*)def size:(NSSize)s; + (void)set:(NSString*)def point:(NSPoint)p; + (void)set:(NSString*)def rect:(NSRect)r; + (NSString*) getStr: (NSString*)def fallback:(NSString*)s; + (int) getInt: (NSString*)def fallback:(int)i; + (int) getInt: (NSString*)def fallback:(int)i min:(int)n; + (int) getInt: (NSString*)def fallback:(int)i min:(int)n max:(int)x; + (float) getFloat:(NSString*)def fallback:(float)f; + (NSColor*) getColor:(NSString*)def fallback:(NSColor*)c; + (BOOL) getBool: (NSString*)def fallback:(BOOL)b; + (NSFont*) getFont: (NSString*)def fallback:(NSFont*)f; + (NSSize) getSize: (NSString*)def fallback:(NSSize)s; + (NSPoint) getPoint:(NSString*)def fallback:(NSPoint)p; + (NSRect) getRect: (NSString*)def fallback:(NSRect)r; + (void)commit; @end #endif // __Defaults_h MiscKit2/Examples/ScrollDir/Defaults.m100444 1750 1750 24355 6757227520 20141 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit disibution. Please refer to that file // for a list of all applicable permissions and resictions. // //============================================================================= //----------------------------------------------------------------------------- // Defaults.m // // Simplified interface to NeXT defaults system. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: Defaults.m,v 1.3 97/04/15 22:18:33 sunshine Exp $ // $Log: Defaults.m,v $ // Revision 1.3 97/04/15 22:18:33 sunshine // 29.3: assert() --> NSAssert() variations. // // Revision 1.2 97/03/22 22:46:43 sunshine // v29.1: Reordered headers to be in sync with LazyScrollDir. // // Revision 1.1 97/03/21 18:30:31 sunshine // v28: Defaults manager. //----------------------------------------------------------------------------- #import "Defaults.h" #import #import #import #import #import #define FONT_NAME_KEY @"Name" #define FONT_SIZE_KEY @"Size" //============================================================================= // IMPLEMENTATION //============================================================================= @implementation Defaults //----------------------------------------------------------------------------- // commit //----------------------------------------------------------------------------- + (void)commit { [[NSUserDefaults standardUserDefaults] synchronize]; } //----------------------------------------------------------------------------- // set:str: //----------------------------------------------------------------------------- + (void)set:(NSString*)def str:(NSString*)s { [[NSUserDefaults standardUserDefaults] setObject:s forKey:def]; } //----------------------------------------------------------------------------- // getStr:fallback: //----------------------------------------------------------------------------- + (NSString*)getStr:(NSString*)def fallback:(NSString*)fallback { NSString* s = [[NSUserDefaults standardUserDefaults] stringForKey:def]; if (s == 0) s = fallback; return s; } //----------------------------------------------------------------------------- // set:int: //----------------------------------------------------------------------------- + (void)set:(NSString*)def int:(int)i { [[NSUserDefaults standardUserDefaults] setInteger:i forKey:def]; } //----------------------------------------------------------------------------- // getInt:fallback: //----------------------------------------------------------------------------- + (int)getInt:(NSString*)def fallback:(int)fallback { NSUserDefaults* defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey:def] != 0) return [defs integerForKey:def]; else return fallback; } //----------------------------------------------------------------------------- // getInt:fallback:min:max: //----------------------------------------------------------------------------- + (int)getInt:(NSString*)def fallback:(int)f min:(int)imin max:(int)imax { int ret; NSParameterAssert( imin <= imax ); ret = [self getInt:def fallback:f]; if (ret < imin) ret = imin; else if (ret > imax) ret = imax; return ret; } //----------------------------------------------------------------------------- // getInt:fallback:min: //----------------------------------------------------------------------------- + (int)getInt:(NSString*)def fallback:(int)fallback min:(int)imin { return [self getInt:def fallback:fallback min:imin max:INT_MAX]; } //----------------------------------------------------------------------------- // set:float: //----------------------------------------------------------------------------- + (void)set:(NSString*)def float:(float)f { [[NSUserDefaults standardUserDefaults] setFloat:f forKey:def]; } //----------------------------------------------------------------------------- // getFloat:fallback: //----------------------------------------------------------------------------- + (float)getFloat:(NSString*)def fallback:(float)fallback { NSUserDefaults* defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey:def] != 0) return [defs floatForKey:def]; else return fallback; } //----------------------------------------------------------------------------- // set:color: //----------------------------------------------------------------------------- + (void)set:(NSString*)def color:(NSColor*)c { NSData* d = [NSArchiver archivedDataWithRootObject:c]; [[NSUserDefaults standardUserDefaults] setObject:d forKey:def]; } //----------------------------------------------------------------------------- // getColor:fallback: //----------------------------------------------------------------------------- + (NSColor*)getColor:(NSString*)def fallback:(NSColor*)fallback { NSData* d = [[NSUserDefaults standardUserDefaults] dataForKey:def]; if (d != 0) return [NSUnarchiver unarchiveObjectWithData:d]; else return fallback; } //----------------------------------------------------------------------------- // set:bool: //----------------------------------------------------------------------------- + (void)set:(NSString*)def bool:(BOOL)b { [[NSUserDefaults standardUserDefaults] setBool:b forKey:def]; } //----------------------------------------------------------------------------- // getBool:fallback: //----------------------------------------------------------------------------- + (BOOL)getBool:(NSString*)def fallback:(BOOL)fallback { NSUserDefaults* defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey:def] != 0) return [defs boolForKey:def]; else return fallback; } //----------------------------------------------------------------------------- // set:font: //----------------------------------------------------------------------------- + (void)set:(NSString*)def font:(NSFont*)f { NSDictionary* d = [NSDictionary dictionaryWithObjectsAndKeys: [f fontName], FONT_NAME_KEY, [[NSNumber numberWithFloat:[f pointSize]] stringValue], FONT_SIZE_KEY, 0]; [[NSUserDefaults standardUserDefaults] setObject:d forKey:def]; } //----------------------------------------------------------------------------- // getFont:fallback: //----------------------------------------------------------------------------- + (NSFont*)getFont:(NSString*)def fallback:(NSFont*)fallback { NSFont* font = fallback; NSDictionary* d = [[NSUserDefaults standardUserDefaults] dictionaryForKey:def]; if (d != 0) { NSString* name = [d objectForKey:FONT_NAME_KEY]; if (name != 0 && [name length] > 0) { NSNumber* size = [d objectForKey:FONT_SIZE_KEY]; NSFont* new_font = [NSFont fontWithName:name size:[size floatValue]]; if (new_font != 0) font = new_font; } } return font; } //----------------------------------------------------------------------------- // set:size: //----------------------------------------------------------------------------- + (void)set:(NSString*)def size:(NSSize)s { NSString* buf = [NSString stringWithFormat:@"%g %g", s.width, s.height]; [[NSUserDefaults standardUserDefaults] setObject:buf forKey:def]; } //----------------------------------------------------------------------------- // getSize:fallback: //----------------------------------------------------------------------------- + (NSSize)getSize:(NSString*)def fallback:(NSSize)fallback { NSSize size = fallback; NSString* s = [[NSUserDefaults standardUserDefaults] stringForKey:def]; if (s != 0) { float w,h; NSScanner* scan = [NSScanner scannerWithString:s]; if ([scan scanFloat:&w] && [scan scanFloat:&h]) size = NSMakeSize( w, h ); } return size; } //----------------------------------------------------------------------------- // set:point: //----------------------------------------------------------------------------- + (void)set:(NSString*)def point:(NSPoint)p { NSString* buf = [NSString stringWithFormat:@"%g %g", p.x, p.y]; [[NSUserDefaults standardUserDefaults] setObject:buf forKey:def]; } //----------------------------------------------------------------------------- // getPoint:fallback: //----------------------------------------------------------------------------- + (NSPoint)getPoint:(NSString*)def fallback:(NSPoint)fallback { NSPoint point = fallback; NSString* s = [[NSUserDefaults standardUserDefaults] stringForKey:def]; if (s != 0) { float x,y; NSScanner* scan = [NSScanner scannerWithString:s]; if ([scan scanFloat:&x] && [scan scanFloat:&y]) point = NSMakePoint( x, y ); } return point; } //----------------------------------------------------------------------------- // set:rect: //----------------------------------------------------------------------------- + (void)set:(NSString*)def rect:(NSRect)r { NSString* buf = [NSString stringWithFormat:@"%g %g %g %g", NSMinX(r), NSMinY(r), NSWidth(r), NSHeight(r)]; [[NSUserDefaults standardUserDefaults] setObject:buf forKey:def]; } //----------------------------------------------------------------------------- // getRect:fallback: //----------------------------------------------------------------------------- + (NSRect)getRect:(NSString*)def fallback:(NSRect)fallback { NSRect rect = fallback; NSString* s = [[NSUserDefaults standardUserDefaults] stringForKey:def]; if (s != 0) { float x,y,w,h; NSScanner* scan = [NSScanner scannerWithString:s]; if ([scan scanFloat:&x] && [scan scanFloat:&y] && [scan scanFloat:&w] && [scan scanFloat:&h]) rect = NSMakeRect( x, y, w, h ); } return rect; } @end MiscKit2/Examples/ScrollDir/DirController.h100444 1750 1750 3376 6757227520 21127 0ustar sunshinesunshine#ifndef __DirController_h #define __DirController_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirController.h // // Manages application which demonstrates use of TableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirController.h,v 1.2 99/06/14 16:06:56 sunshine Exp $ // $Log: DirController.h,v $ // Revision 1.2 99/06/14 16:06:56 sunshine // v35.1: For clarity renamed -new: to -openDirectory:. // // Revision 1.1 1997/03/21 18:30:43 sunshine // v28: Directory controller. //----------------------------------------------------------------------------- #import @class NSNotification, NSPanel, NSText; @interface DirController : NSObject { NSPanel* infoPanel; NSText* infoText; } - (id)init; - (void)dealloc; - (void)applicationDidFinishLaunching:(NSNotification*)n; - (void)applicationWillTerminate:(NSNotification*)n; - (void)openDirectory:(id)sender; - (void)info:(id)sender; @end #endif // __DirController_h MiscKit2/Examples/ScrollDir/DirController.m100444 1750 1750 10345 6757227520 21146 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirController.m // // Manages application which demonstrates use of TableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirController.m,v 1.3 99/06/14 16:07:03 sunshine Exp $ // $Log: DirController.m,v $ // Revision 1.3 99/06/14 16:07:03 sunshine // v35.1: For clarity renamed -new: to -openDirectory:. // // Revision 1.2 1997/03/23 01:41:00 sunshine // v29.2: Brought into syncrhonization with LazyScrollDir v13.1 for OPENSTSEP. //----------------------------------------------------------------------------- #import "DirController.h" #import "Defaults.h" #import "DirWindow.h" #import "SD_PageLayout.h" #import #import #import @implementation DirController //----------------------------------------------------------------------------- // - init //----------------------------------------------------------------------------- - (id)init { [super init]; infoPanel = 0; return self; } //----------------------------------------------------------------------------- // - dealloc //----------------------------------------------------------------------------- - (void)dealloc { if (infoPanel) [infoPanel release]; [super dealloc]; } //----------------------------------------------------------------------------- // - applicationDidFinishLaunching: //----------------------------------------------------------------------------- - (void)applicationDidFinishLaunching:(NSNotification*)n { [DirWindow launchDir:0]; } //----------------------------------------------------------------------------- // - applicationWillTerminate: //----------------------------------------------------------------------------- - (void)applicationWillTerminate:(NSNotification*)n { [Defaults commit]; } //----------------------------------------------------------------------------- // - runPageLayout: //----------------------------------------------------------------------------- - (void)runPageLayout:(id)sender { [[SD_PageLayout pageLayout] runModal]; } //----------------------------------------------------------------------------- // - openDirectory: //----------------------------------------------------------------------------- - (void)openDirectory:(id)sender { static NSOpenPanel* panel = 0; if (panel == 0) { panel = [[NSOpenPanel openPanel] retain]; [panel setTitle:@"Open Directory"]; [panel setPrompt:@"Directory:"]; [panel setCanChooseDirectories:YES]; [panel setCanChooseFiles:NO]; [panel setAllowsMultipleSelection:YES]; [panel setTreatsFilePackagesAsDirectories:YES]; } if ([panel runModal] == NSOKButton) { unsigned int i; NSArray* filenames = [panel filenames]; for (i = [filenames count]; i-- > 0; ) [DirWindow launchDir:[filenames objectAtIndex:i]]; } } //----------------------------------------------------------------------------- // - info: //----------------------------------------------------------------------------- - (void)info:(id)sender { if (infoPanel == 0) { NSString* s; [NSBundle loadNibNamed:@"Info" owner:self]; s = [[NSBundle bundleForClass:[self class]] pathForResource:@"README" ofType:@"rtf"]; if (s == 0) s = [[NSBundle bundleForClass:[self class]] pathForResource:@"README" ofType:@"rtfd"]; if (s != 0) [infoText readRTFDFromFile:s]; } [infoPanel makeKeyAndOrderFront:self]; } @end MiscKit2/Examples/ScrollDir/DirWindow.h100444 1750 1750 4076 6757227543 20256 0ustar sunshinesunshine#ifndef __DirWindow_h #define __DirWindow_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirWindow.h // // Manages window which displays directory listing. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirWindow.h,v 1.3 97/11/22 23:33:31 sunshine Exp $ // $Log: DirWindow.h,v $ // Revision 1.3 97/11/22 23:33:31 sunshine // v32.1: Added row-numbers switch. // // Revision 1.2 97/03/22 22:47:32 sunshine // v29.1: Added 'writable' flag to prevent cmd-r from working in read-only // directories. // // Revision 1.1 97/03/21 18:30:59 sunshine // v28: Directory window. //----------------------------------------------------------------------------- #import @class MiscTableScroll, NSButton, NSTextField, NSWindow; @interface DirWindow : NSObject { MiscTableScroll* scroll; NSWindow* window; NSButton* autoSortSwitch; NSButton* cdButton; NSButton* dragUnscaledSwitch; NSButton* hiddenFilesSwitch; NSButton* highlightSwitch; NSButton* refreshButton; NSButton* rowNumbersSwitch; NSTextField* countField; NSString* path; BOOL writable; BOOL autoSort; BOOL dragUnscaled; BOOL highlightDirs; BOOL showHidden; } + (void)launchDir:(NSString*)dirname; @end #endif // __DirWindow_h MiscKit2/Examples/ScrollDir/DirWindow.m100444 1750 1750 124772 6757227543 20331 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirWindow.m // // Manages window which displays directory listing. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirWindow.m,v 1.14 99/08/12 23:06:27 sunshine Exp $ // $Log: DirWindow.m,v $ // Revision 1.14 99/08/12 23:06:27 sunshine // v35.1: Fixed bug: -getParent did not work correctly on Windows. // Added -fullPathOf: which appends the input argument to "path" in order to // generate a full path, except when the input argument is "..", in which // case -getParent is called. This fixes a number of problem areas where ".." // was being appended to "C:\" on Windows and failing. // // Revision 1.13 99/06/14 16:31:16 sunshine // v35.1: Ported to MacOS/X Server DR2 for Mach and Windows. // For clarity, renamed: -open: to -openSelected: & -save: to -export:. // Now prompts user for confirmation before deleting files in -destroy:. // Numerous MiscTableScroll delegate methods changed to notification style. // Fixed bug: Was responding to -tableScrollFontChanged: rather than // -tableScrollChangeFont:. The latter is sent in response to user-initiated // font changes, which is what we are interested in. // For naming consistency, renamed: -didClick: to -scrollClick: & // -didDoubleClick: to -scrollDoubleClick:. This is more consistent with // other methods such as -lockClick:. // Fixed bug: Attributes displayed for ".." were actually those of ".". // // Revision 1.12 1998/03/30 09:21:07 sunshine // v34.1: Worked around PPC compiler for Rhapsody DR1 compiler bug. Compiler // claimed "totalBytes" was being accessed uninitialized. // // Revision 1.11 98/03/30 00:41:25 sunshine // v34.1: Now uses NSColor's "system" color by default for window rather than // hard-wired light-gray. //----------------------------------------------------------------------------- #import "DirWindow.h" #import "Defaults.h" #import #import #import #import #import #import #import #import #import #import #import #import #import // MS-Windows doesn't define these: #ifndef S_ISUID # define S_ISUID 0004000 /* Set user id on execution */ #endif #ifndef S_ISGID # define S_ISGID 0002000 /* Set group id on execution */ #endif #ifndef S_ISVTX # define S_ISVTX 0001000 /* Save swapped text even after use */ #endif enum { ICON_SLOT, NAME_SLOT, LOCK_SLOT, SIZE_SLOT, MODIFIED_SLOT, PERMS_SLOT, OWNER_SLOT, GROUP_SLOT, HARDLINKS_SLOT, SOFTLINK_SLOT, MAX_SLOT }; static int const CASCADE_MAX = 10; static int CASCADE_COUNTER = 0; static float CASCADE_ORIGIN_X; static float CASCADE_ORIGIN_Y; static float CASCADE_DELTA_X; static float CASCADE_DELTA_Y; static BOOL DEFAULT_AUTO_SORT; static BOOL DEFAULT_ROW_NUMBERS; static BOOL DEFAULT_SHOW_HIDDEN; static BOOL DEFAULT_HIGHLIGHT_DIRS; static BOOL DEFAULT_DRAG_UNSCALED; static NSColor* DEFAULT_COLOR; static NSSize DEFAULT_WIN_SIZE; static NSFont* DEFAULT_FONT; static NSMutableArray* OPEN_DIRS = 0; static NSImage* LOCKED_IMAGE = 0; static NSImage* UNLOCKED_IMAGE = 0; static NSString* const COLOR_DEF = @"DirColor"; static NSString* const SIZE_DEF = @"DirSize"; static NSString* const FONT_DEF = @"DirFont"; static NSString* const SORT_DEF = @"AutoSort"; static NSString* const HIDDEN_DEF = @"ShowHidden"; static NSString* const HLIGHT_DEF = @"HighlightDirs"; static NSString* const UNSCALED_DEF = @"DragUnscaled"; static NSString* const COL_SIZES_DEF = @"ColSizes"; static NSString* const COL_ORDER_DEF = @"ColOrder"; static NSString* const ROW_NUMBERS_DEF = @"RowNumbers"; static NSString* const LOCKED_IMAGE_S = @"Lock.secure"; static NSString* const UNLOCKED_IMAGE_S = @"Lock.insecure"; static NSString* const DA_SHORT_NAME = @"ShortName"; static NSString* const DA_SOFT_LINK = @"SoftLink"; static NSString* const DA_IS_DIRECTORY = @"IsDirectory"; static NSString* const DA_IS_LOCKED = @"IsLocked"; static NSString* const DA_CAN_TOGGLE_LOCK = @"CanToggleLock"; static NSString* const DA_SCALED_ICON = @"ScaledIcon"; static NSString* const DA_UNSCALED_ICON = @"UnscaledIcon"; //----------------------------------------------------------------------------- // NOTE: USE_PRIVATE_ZONE // When set to '1', this program will place each window in a separate // NSZone and destroy the zone when the window is closed. When set to // '0' windows are placed in the NSDefaultMallocZone(). //----------------------------------------------------------------------------- #define USE_PRIVATE_ZONE 1 #if USE_PRIVATE_ZONE # define EMPLOY_ZONE() NSCreateZone( NSPageSize(), NSPageSize(), YES ) # define RETIRE_ZONE(Z) NSRecycleZone(Z) #else # define EMPLOY_ZONE() NSDefaultMallocZone() # define RETIRE_ZONE(Z) (void)(Z) #endif //----------------------------------------------------------------------------- // normalize_path //----------------------------------------------------------------------------- static inline NSString* normalize_path( NSString* buff ) { return [buff stringByStandardizingPath]; } //----------------------------------------------------------------------------- // dir_writable //----------------------------------------------------------------------------- static BOOL dir_writable( NSString* path ) { return [[NSFileManager defaultManager] isWritableFileAtPath:path]; } //----------------------------------------------------------------------------- // dir_sticky //----------------------------------------------------------------------------- static BOOL dir_sticky( NSDirectoryEnumerator* enumerator ) { int const STICKY_BIT = 01000; unsigned long n = [[enumerator directoryAttributes] filePosixPermissions]; return ((n & STICKY_BIT) != 0); } //----------------------------------------------------------------------------- // str_date //----------------------------------------------------------------------------- static NSString* str_date( NSDate* d ) { return [d descriptionWithCalendarFormat:@"%m/%d/%y %H:%M" timeZone:0 locale:0]; } //----------------------------------------------------------------------------- // str_perms //----------------------------------------------------------------------------- static NSString* str_perms( unsigned long mode, NSString* file_type ) { char c; NSMutableString* s = [NSMutableString string]; if ([file_type isEqualToString:NSFileTypeDirectory]) c = 'd'; else if ([file_type isEqualToString:NSFileTypeCharacterSpecial]) c = 'c'; else if ([file_type isEqualToString:NSFileTypeBlockSpecial]) c = 'b'; else if ([file_type isEqualToString:NSFileTypeRegular]) c = '-'; else if ([file_type isEqualToString:NSFileTypeSymbolicLink]) c = 'l'; else if ([file_type isEqualToString:NSFileTypeSocket]) c = 's'; else c = '?'; [s appendFormat:@"%c", c]; [s appendFormat:@"%c", (mode & 0400) ? 'r' : '-']; [s appendFormat:@"%c", (mode & 0200) ? 'w' : '-']; [s appendFormat:@"%c", (mode & S_ISUID) ? 's' : (mode & 0100) ? 'x' : '-']; [s appendFormat:@"%c", (mode & 0040) ? 'r' : '-']; [s appendFormat:@"%c", (mode & 0020) ? 'w' : '-']; [s appendFormat:@"%c", (mode & S_ISGID) ? 's' : (mode & 0010) ? 'x' : '-']; [s appendFormat:@"%c", (mode & 0004) ? 'r' : '-']; [s appendFormat:@"%c", (mode & 0002) ? 'w' : '-']; [s appendFormat:@"%c", (mode & S_ISVTX) ? 't' : (mode & 0001) ? 'x' : '-']; return s; } //----------------------------------------------------------------------------- // fmt_icon //----------------------------------------------------------------------------- static void fmt_icon( MiscTableScroll* ts, NSDictionary* dict, id cell ) { float h,w,s; NSImage* i = [dict objectForKey:DA_SCALED_ICON]; w = [ts columnSize:ICON_SLOT]; if (w == 0) w = 18; h = [ts uniformSizeRows]; if (h == 0) h = 18; s = (w < h ? w : h) - 1.0; [i setSize:NSMakeSize( s, s )]; [cell setImage:i]; [cell setRepresentedObject:[dict objectForKey:DA_UNSCALED_ICON]]; } //----------------------------------------------------------------------------- // fmt_lock //----------------------------------------------------------------------------- static void fmt_lock( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setState:![[dict objectForKey:DA_IS_LOCKED] boolValue]]; [cell setEnabled:[[dict objectForKey:DA_CAN_TOGGLE_LOCK] boolValue]]; } //----------------------------------------------------------------------------- // fmt_name //----------------------------------------------------------------------------- static void fmt_name( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setStringValue:[dict objectForKey:DA_SHORT_NAME]]; } //----------------------------------------------------------------------------- // fmt_size //----------------------------------------------------------------------------- static void fmt_size( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setIntValue:[dict fileSize]]; } //----------------------------------------------------------------------------- // fmt_modified //----------------------------------------------------------------------------- static void fmt_modified( MiscTableScroll* ts, NSDictionary* dict, id cell ) { NSDate* d = [dict fileModificationDate]; [cell setStringValue:str_date(d)]; [cell setTag:(int)[d timeIntervalSinceReferenceDate]]; } //----------------------------------------------------------------------------- // fmt_perms //----------------------------------------------------------------------------- static void fmt_perms( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setStringValue: str_perms( [dict filePosixPermissions], [dict fileType])]; [cell setTag:[[dict objectForKey:DA_IS_DIRECTORY] boolValue]]; } //----------------------------------------------------------------------------- // fmt_owner //----------------------------------------------------------------------------- static void fmt_owner( MiscTableScroll* ts, NSDictionary* dict, id cell ) { NSString* s = [dict fileOwnerAccountName]; [cell setStringValue:(s != 0 ? s : @"")]; } //----------------------------------------------------------------------------- // fmt_group //----------------------------------------------------------------------------- static void fmt_group( MiscTableScroll* ts, NSDictionary* dict, id cell ) { NSString* s = [dict fileGroupOwnerAccountName]; [cell setStringValue:(s != 0 ? s : @"")]; } //----------------------------------------------------------------------------- // fmt_hardlinks //----------------------------------------------------------------------------- static void fmt_hardlinks( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setIntValue: [[dict objectForKey:NSFileReferenceCount] unsignedLongValue]]; } //----------------------------------------------------------------------------- // fmt_softlink //----------------------------------------------------------------------------- static void fmt_softlink( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setStringValue:[dict objectForKey:DA_SOFT_LINK]]; } //----------------------------------------------------------------------------- // FORMAT_FUNC //----------------------------------------------------------------------------- typedef void (*FormatFunc)( MiscTableScroll*, NSDictionary*, id ); static FormatFunc FORMAT_FUNC[ MAX_SLOT ] = { fmt_icon, // ICON_SLOT, fmt_name, // NAME_SLOT, fmt_lock, // LOCK_SLOT, fmt_size, // SIZE_SLOT, fmt_modified, // MODIFIED_SLOT, fmt_perms, // PERMS_SLOT, fmt_owner, // OWNER_SLOT, fmt_group, // GROUP_SLOT, fmt_hardlinks, // HARDLINKS_SLOT, fmt_softlink, // SOFTLINK_SLOT, }; //----------------------------------------------------------------------------- // format_cell //----------------------------------------------------------------------------- static inline void format_cell( MiscTableScroll* ts, NSDictionary* dict, id cell, unsigned int col ) { FORMAT_FUNC[ col ]( ts, dict, cell ); } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation DirWindow //----------------------------------------------------------------------------- // + initCascader //----------------------------------------------------------------------------- + (void)initCascader { NSSize const s = [[NSScreen mainScreen] frame].size; CASCADE_ORIGIN_X = s.width / 4; CASCADE_ORIGIN_Y = s.height - 60; CASCADE_DELTA_X = 20; CASCADE_DELTA_Y = 20; } //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (void)initialize { if (self == [DirWindow class]) { [self initCascader]; OPEN_DIRS = [[NSMutableArray alloc] init]; LOCKED_IMAGE = [[NSImage imageNamed:LOCKED_IMAGE_S] retain]; UNLOCKED_IMAGE = [[NSImage imageNamed:UNLOCKED_IMAGE_S] retain]; DEFAULT_COLOR = [[Defaults getColor:COLOR_DEF fallback:[NSColor controlColor]] retain]; DEFAULT_AUTO_SORT = [Defaults getBool:SORT_DEF fallback:YES]; DEFAULT_SHOW_HIDDEN = [Defaults getBool:HIDDEN_DEF fallback:NO]; DEFAULT_ROW_NUMBERS = [Defaults getBool:ROW_NUMBERS_DEF fallback:NO]; DEFAULT_HIGHLIGHT_DIRS = [Defaults getBool:HLIGHT_DEF fallback:NO]; DEFAULT_DRAG_UNSCALED = [Defaults getBool:UNSCALED_DEF fallback:YES]; } } //----------------------------------------------------------------------------- // - cascade //----------------------------------------------------------------------------- - (void)cascade { float top,left; left = CASCADE_ORIGIN_X + (CASCADE_DELTA_X * CASCADE_COUNTER); top = CASCADE_ORIGIN_Y - (CASCADE_DELTA_Y * CASCADE_COUNTER); [window setFrameTopLeftPoint:NSMakePoint( left, top )]; if (++CASCADE_COUNTER >= CASCADE_MAX) CASCADE_COUNTER = 0; } //----------------------------------------------------------------------------- // - getParent // Unfortunately -stringByDeletingLastPathComponent does not work as // documented when operating on a root directory. On Mach, when handed // "/", it returns "" rather than "/" as documented. On Windows, when // handed "C:\", it returns "C:" rather than "C:\" as documented. // Therefore, we use -isAbsolutePath as a sneaky way to detect this // anomalous condition. //----------------------------------------------------------------------------- - (NSString*)getParent { NSString* s = [path stringByDeletingLastPathComponent]; return ([s isAbsolutePath] ? s : path); } //----------------------------------------------------------------------------- // - fullPathOf: //----------------------------------------------------------------------------- - (NSString*)fullPathOf:(NSString*)file { return [file isEqualToString:@".."] ? [self getParent] : [path stringByAppendingPathComponent:file]; } //----------------------------------------------------------------------------- // - isDir: //----------------------------------------------------------------------------- - (BOOL)isDir:(int)r { return [scroll tagAtRow:r column:PERMS_SLOT]; } //----------------------------------------------------------------------------- // - updateButtons //----------------------------------------------------------------------------- - (void)updateButtons { BOOL const enable = [scroll numberOfSelectedRows] == 1 && [self isDir:[scroll selectedRow]]; if (enable != [cdButton isEnabled]) [cdButton setEnabled:enable]; } //----------------------------------------------------------------------------- // - setRow:useOwner:color: //----------------------------------------------------------------------------- - (void)setRow:(int)r useOwner:(BOOL)useOwner color:(NSColor*)color { int i; for (i = MAX_SLOT; i-- >= 0; ) { id cell = [scroll cellAtRow:r column:i]; if (useOwner && [cell respondsToSelector:@selector(setUseOwnerBackgroundColor:)]) { [cell setUseOwnerBackgroundColor:YES]; if ([cell respondsToSelector:@selector(setOwnerBackgroundColor:)]) [cell setOwnerBackgroundColor:color]; } else if ([cell respondsToSelector:@selector(setBackgroundColor:)]) [cell setBackgroundColor:color]; } } //----------------------------------------------------------------------------- // - scrollColor //----------------------------------------------------------------------------- - (NSColor*)scrollColor { if ([DEFAULT_COLOR isEqual:[NSColor controlColor]]) return [MiscTableScroll defaultBackgroundColor]; else return DEFAULT_COLOR; } //----------------------------------------------------------------------------- // - highlight:row: //----------------------------------------------------------------------------- - (void)highlight:(BOOL)flag row:(int)r { if (flag) [self setRow:r useOwner:NO color:[NSColor cyanColor]]; else [self setRow:r useOwner:YES color:[self scrollColor]]; } //----------------------------------------------------------------------------- // - highlightDirs: //----------------------------------------------------------------------------- - (void)highlightDirs:(BOOL)flag { int i; for (i = [scroll numberOfRows]; i-- > 0; ) if ([self isDir:i]) [self highlight:flag row:i]; } //----------------------------------------------------------------------------- // - releaseImages //----------------------------------------------------------------------------- - (void)releaseImages { int i; for (i = [scroll numberOfRows]; i-- > 0; ) { id cell = [scroll cellAtRow:i column:ICON_SLOT]; [cell setImage:0]; // Scaled image. [cell setRepresentedObject:0]; // Unscaled image. } } //----------------------------------------------------------------------------- // - tableScrollChangeFont: //----------------------------------------------------------------------------- - (void)tableScrollChangeFont:(NSNotification*)n { [DEFAULT_FONT autorelease]; DEFAULT_FONT = [[[n userInfo] objectForKey:@"NewFont"] retain]; [Defaults set:FONT_DEF font:DEFAULT_FONT]; } //----------------------------------------------------------------------------- // - tableScrollSlotResized: //----------------------------------------------------------------------------- - (void)tableScrollSlotResized:(NSNotification*)n { [Defaults set:COL_SIZES_DEF str:[scroll columnSizesAsString]]; } //----------------------------------------------------------------------------- // saveSlotOrder: //----------------------------------------------------------------------------- - (void)saveSlotOrder:(NSNotification*)n { MiscBorderType const b = (MiscBorderType)[[[n userInfo] objectForKey:@"Border"] intValue]; if (b == MISC_COL_BORDER) [Defaults set:COL_ORDER_DEF str:[scroll columnOrderAsString]]; } //----------------------------------------------------------------------------- // - tableScrollSlotDragged: //----------------------------------------------------------------------------- - (void)tableScrollSlotDragged:(NSNotification*)n { [self saveSlotOrder:n]; } //----------------------------------------------------------------------------- // - tableScrollSlotSortReversed: //----------------------------------------------------------------------------- - (void)tableScrollSlotSortReversed:(NSNotification*)n { [self saveSlotOrder:n]; } //----------------------------------------------------------------------------- // - tableScroll:canEdit:atRow:column: //----------------------------------------------------------------------------- - (BOOL)tableScroll:(MiscTableScroll*)ts canEdit:(NSEvent*)ev atRow:(int)row column:(int)col { return ((ev == 0 || [ev clickCount] == 2) && col == NAME_SLOT && [[ts cellAtRow:row column:LOCK_SLOT] state] != 0); } //----------------------------------------------------------------------------- // -tableScroll:draggingSourceOperationMaskForLocal: //----------------------------------------------------------------------------- - (unsigned int)tableScroll:(MiscTableScroll*)s draggingSourceOperationMaskForLocal:(BOOL)isLocal { return NSDragOperationAll; } //----------------------------------------------------------------------------- // tableScrollIgnoreModifierKeysWhileDragging: //----------------------------------------------------------------------------- - (BOOL)tableScrollIgnoreModifierKeysWhileDragging:(MiscTableScroll*)s { return NO; } //----------------------------------------------------------------------------- // - tableScroll:preparePasteboard:forDragOperationAtRow:column: //----------------------------------------------------------------------------- - (void)tableScroll:(MiscTableScroll*)s preparePasteboard:(NSPasteboard*)pb forDragOperationAtRow:(int)r column:(int)c { NSString* file = [self fullPathOf:[s stringValueAtRow:r column:NAME_SLOT]]; [pb declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:0]; [pb setPropertyList:[NSArray arrayWithObject:file] forType:NSFilenamesPboardType]; } //----------------------------------------------------------------------------- // - tableScroll:allowDragOperationAtRow:column: //----------------------------------------------------------------------------- - (BOOL)tableScroll:(MiscTableScroll*)s allowDragOperationAtRow:(int)r column:(int)c { return (c == ICON_SLOT); } //----------------------------------------------------------------------------- // - tableScroll:imageForDragOperationAtRow:column: //----------------------------------------------------------------------------- - (NSImage*)tableScroll:(MiscTableScroll*)s imageForDragOperationAtRow:(int)r column:(int)c { id cell = [s cellAtRow:r column:c]; return (dragUnscaled ? [cell representedObject] : 0); } //----------------------------------------------------------------------------- // - extendedAttributes:forFile:dirSticky:username: //----------------------------------------------------------------------------- - (NSDictionary*)extendedAttributes:(NSDictionary*)attributes forFile:(NSString*)file dirSticky:(BOOL)sticky username:(NSString*)username { NSImage* image; NSFileManager* const manager = [NSFileManager defaultManager]; NSString* const longName = [file isEqualToString:@".."] ? [self getParent] : [path stringByAppendingPathComponent:file]; BOOL const canToggle = writable && ![file isEqualToString:@".."] && (!sticky || [[attributes fileOwnerAccountName] isEqualToString:username]); BOOL const isLink = [[attributes fileType] isEqualToString:NSFileTypeSymbolicLink]; NSDictionary* const deepAttributes = !isLink ? attributes : [manager fileAttributesAtPath:longName traverseLink:YES]; BOOL const isDir = [[deepAttributes fileType] isEqualToString:NSFileTypeDirectory]; NSMutableDictionary* const dict = [[attributes mutableCopy] autorelease]; [dict setObject:file forKey:DA_SHORT_NAME]; [dict setObject:isLink ? [manager pathContentOfSymbolicLinkAtPath:longName] : @"" forKey:DA_SOFT_LINK]; [dict setObject:[NSNumber numberWithBool:isDir] forKey:DA_IS_DIRECTORY]; [dict setObject:[NSNumber numberWithBool:canToggle] forKey:DA_CAN_TOGGLE_LOCK]; [dict setObject:[NSNumber numberWithBool:!canToggle] forKey:DA_IS_LOCKED]; image = [[NSWorkspace sharedWorkspace] iconForFile:longName]; [dict setObject:[[image copy] autorelease] forKey:DA_UNSCALED_ICON]; [image setScalesWhenResized:YES]; [dict setObject:image forKey:DA_SCALED_ICON]; return dict; } //----------------------------------------------------------------------------- // - addFile:attributes:dirSticky:username: //----------------------------------------------------------------------------- - (void)addFile:(NSString*)file attributes:(NSDictionary*)attributes dirSticky:(BOOL)sticky username:(NSString*)username { int r,c; NSDictionary* dict = [self extendedAttributes:attributes forFile:file dirSticky:sticky username:username]; [scroll addRow]; r = [scroll numberOfRows] - 1; for (c = 0; c < MAX_SLOT; c++) format_cell( scroll, dict, [scroll cellAtRow:r column:c], c ); if (highlightDirs && [[dict objectForKey:DA_IS_DIRECTORY] boolValue]) [self highlight:YES row:r]; } //----------------------------------------------------------------------------- // - fillScroll // NOTE *1*: Ugly work around for PPC compiler bug in Rhapsody DR1. // Compiler erroneously reports "totalBytes" used when uninitialized. //----------------------------------------------------------------------------- - (void)fillScroll { NSFileManager* manager = [NSFileManager defaultManager]; NSDirectoryEnumerator* enumerator = [manager enumeratorAtPath:path]; unsigned long long totalBytes; *(&totalBytes) = 0; // NOTE *1* [self releaseImages]; [scroll empty]; if (enumerator == 0) NSRunAlertPanel( @"Can't Read", @"Cannot read directory, %@", @"OK", 0, 0, path ); else { NSString* file; NSString* username = [[NSUserName() retain] autorelease]; BOOL const sticky = dir_sticky( enumerator ); writable = dir_writable( path ); [self addFile:@".." attributes: [manager fileAttributesAtPath:[self getParent] traverseLink:NO] dirSticky:sticky username:username]; while ((file = [enumerator nextObject]) != 0) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSDictionary* attributes = [enumerator fileAttributes]; if (showHidden || [file characterAtIndex:0] != '.') { totalBytes += [attributes fileSize]; [self addFile:file attributes:attributes dirSticky:sticky username:username]; } if ([[attributes fileType] isEqualToString:NSFileTypeDirectory]) [enumerator skipDescendents]; [pool release]; } } if ([scroll autoSortRows]) [scroll sortRows]; [scroll sizeToCells]; [countField setStringValue: [NSString stringWithFormat:@"%d files %lu bytes", [scroll numberOfRows], totalBytes]]; [self updateButtons]; } //----------------------------------------------------------------------------- // - setPath: //----------------------------------------------------------------------------- - (void)setPath:(NSString*)dirname { [path autorelease]; if (dirname == 0) dirname = NSHomeDirectory(); if ([dirname length] == 0) dirname = @"/"; path = [dirname retain]; [window setTitleWithRepresentedFilename:path]; } //----------------------------------------------------------------------------- // - load: //----------------------------------------------------------------------------- - (void)load:(NSString*)dirname { [self setPath:dirname]; [self fillScroll]; } //----------------------------------------------------------------------------- // - export: //----------------------------------------------------------------------------- - (void)export:(id)sender { [[MiscExporter commonInstance] exportTableScroll:scroll]; } //----------------------------------------------------------------------------- // - printDirectory: //----------------------------------------------------------------------------- - (void)printDirectory:(id)sender { [scroll print:self]; } //----------------------------------------------------------------------------- // - openSelected: //----------------------------------------------------------------------------- - (void)openSelected:(id)sender { if ([scroll hasRowSelection]) { int i; NSArray* list = [scroll selectedRows]; for (i = [list count]; i-- > 0; ) { int const r = [[list objectAtIndex:i] intValue]; NSString* s = [self fullPathOf:[scroll stringValueAtRow:r column:NAME_SLOT]]; if ([self isDir:r]) [[self class] launchDir:s]; else [[NSWorkspace sharedWorkspace] openFile:s]; } } } //----------------------------------------------------------------------------- // - destroy: //----------------------------------------------------------------------------- - (void)destroy:(id)sender { if (writable && [scroll hasRowSelection]) { if (NSRunAlertPanel( @"Delete Files", @"Delete selected files?", @"Yes", @"No", 0 ) == NSAlertDefaultReturn) { int i; NSArray* list = [scroll selectedRows]; NSFileManager* manager = [NSFileManager defaultManager]; for (i = [list count]; i-- > 0; ) { int const row = [[list objectAtIndex:i] intValue]; NSString* s = [self fullPathOf: [scroll stringValueAtRow:row column:NAME_SLOT]]; [manager removeFileAtPath:s handler:0]; } [self fillScroll]; } } } //----------------------------------------------------------------------------- // - fileManager:shouldProceedAfterError: //----------------------------------------------------------------------------- - (BOOL)fileManager:(NSFileManager*)manager shouldProceedAfterError:(NSDictionary*)errorInfo { NSRunAlertPanel( @"Error", @"Rename failed: %@.", @"OK", 0, 0, [errorInfo objectForKey:@"Error"]); return NO; } //----------------------------------------------------------------------------- // - rename:to: //----------------------------------------------------------------------------- - (BOOL)rename:(NSString*)oldName to:(NSString*)newName { return [[NSFileManager defaultManager] movePath:[path stringByAppendingPathComponent:oldName] toPath:[path stringByAppendingPathComponent:newName] handler:self]; } //----------------------------------------------------------------------------- // - control:textShouldEndEditing: //----------------------------------------------------------------------------- - (BOOL)control:(NSControl*)control textShouldEndEditing:(NSText*)fieldEditor { BOOL accept = YES; NSString* oldName; NSString* newName; int const r = [scroll clickedRow]; int const c = [scroll clickedColumn]; NSParameterAssert( c == NAME_SLOT ); oldName = [[scroll cellAtRow:r column:c] stringValue]; newName = [fieldEditor string]; if (![newName isEqualToString:oldName]) accept = [self rename:oldName to:newName]; if (!accept) [fieldEditor setString:oldName]; return accept; } //----------------------------------------------------------------------------- // - refreshPressed: //----------------------------------------------------------------------------- - (void)refreshPressed:(id)sender { [scroll abortEditing]; [self fillScroll]; } //----------------------------------------------------------------------------- // - cdPressed: //----------------------------------------------------------------------------- - (void)cdPressed:(id)sender { [scroll abortEditing]; if ([scroll numberOfSelectedRows] == 1) { MiscCoord_P const row = [scroll selectedRow]; if ([self isDir:row]) [self load:normalize_path( [self fullPathOf: [scroll stringValueAtRow:row column:NAME_SLOT]] )]; } } //----------------------------------------------------------------------------- // - rowNumbersClick: //----------------------------------------------------------------------------- - (void)rowNumbersClick:(id)sender { BOOL const newVal = ([rowNumbersSwitch state] != 0); BOOL const oldVal = [scroll rowTitlesOn]; if (newVal != oldVal) { DEFAULT_ROW_NUMBERS = newVal; [scroll setRowTitlesOn:DEFAULT_ROW_NUMBERS]; [Defaults set:ROW_NUMBERS_DEF bool:DEFAULT_ROW_NUMBERS]; } } //----------------------------------------------------------------------------- // - autoSortClick: //----------------------------------------------------------------------------- - (void)autoSortClick:(id)sender { BOOL const switchState = [autoSortSwitch state]; [scroll abortEditing]; if (autoSort != switchState) { DEFAULT_AUTO_SORT = autoSort = switchState; [Defaults set:SORT_DEF bool:DEFAULT_AUTO_SORT]; [scroll setAutoSortRows:switchState]; if (switchState) [scroll sortRows]; } } //----------------------------------------------------------------------------- // - hiddenFilesClick: //----------------------------------------------------------------------------- - (void)hiddenFilesClick:(id)sender { BOOL const switchState = [hiddenFilesSwitch state]; [scroll abortEditing]; if (showHidden != switchState) { DEFAULT_SHOW_HIDDEN = showHidden = switchState; [Defaults set:HIDDEN_DEF bool:DEFAULT_SHOW_HIDDEN]; [self fillScroll]; } } //----------------------------------------------------------------------------- // - highlightClick: //----------------------------------------------------------------------------- - (void)highlightClick:(id)sender { BOOL const switchState = [highlightSwitch state]; [scroll abortEditing]; if (highlightDirs != switchState) { DEFAULT_HIGHLIGHT_DIRS = highlightDirs = switchState; [Defaults set:HLIGHT_DEF bool:DEFAULT_HIGHLIGHT_DIRS]; [self highlightDirs:highlightDirs]; [scroll setNeedsDisplay:YES]; } } //----------------------------------------------------------------------------- // - dragUnscaledClick: //----------------------------------------------------------------------------- - (void)dragUnscaledClick:(id)sender { BOOL const switchState = [dragUnscaledSwitch state]; if (dragUnscaled != switchState) { DEFAULT_DRAG_UNSCALED = dragUnscaled = switchState; [Defaults set:UNSCALED_DEF bool:DEFAULT_DRAG_UNSCALED]; } } //----------------------------------------------------------------------------- // - lockClick: //----------------------------------------------------------------------------- - (void)lockClick:(id)sender { if ([sender autoSortRows]) [sender sortRow:[sender clickedRow]]; } //----------------------------------------------------------------------------- // - scrollClick: //----------------------------------------------------------------------------- - (void)scrollClick:(id)sender { [self updateButtons]; } //----------------------------------------------------------------------------- // - scrollDoubleClick: //----------------------------------------------------------------------------- - (void)scrollDoubleClick:(id)sender { [self openSelected:sender]; } //----------------------------------------------------------------------------- // - activateWindow //----------------------------------------------------------------------------- - (void)activateWindow { [window makeKeyAndOrderFront:0]; } //----------------------------------------------------------------------------- // - windowShouldClose: //----------------------------------------------------------------------------- - (BOOL)windowShouldClose:(id)sender { [scroll abortEditing]; [OPEN_DIRS removeObject:self]; [self autorelease]; return YES; } //----------------------------------------------------------------------------- // - windowDidResize: //----------------------------------------------------------------------------- - (void)windowDidResize:(NSNotification*)notification { NSRect r = [[notification object] frame]; if (NSWidth (r) != DEFAULT_WIN_SIZE.width || NSHeight(r) != DEFAULT_WIN_SIZE.height) { DEFAULT_WIN_SIZE = r.size; [Defaults set:SIZE_DEF size:DEFAULT_WIN_SIZE]; } } //----------------------------------------------------------------------------- // - setDefaultColor: //----------------------------------------------------------------------------- - (void)setDefaultColor:(NSColor*)c { [DEFAULT_COLOR autorelease]; DEFAULT_COLOR = [c retain]; [Defaults set:COLOR_DEF color:c]; } //----------------------------------------------------------------------------- // - setColors: //----------------------------------------------------------------------------- - (void)setColors:(NSColor*)c { [window setBackgroundColor:c]; [scroll setBackgroundColor:[self scrollColor]]; [window display]; } //----------------------------------------------------------------------------- // - draggingEntered: //----------------------------------------------------------------------------- - (unsigned int)draggingEntered:(id)sender { return ([sender draggingSourceOperationMask] & NSDragOperationGeneric); } //----------------------------------------------------------------------------- // - performDragOperation: //----------------------------------------------------------------------------- - (BOOL)performDragOperation:(id)sender { [self setDefaultColor: [NSColor colorFromPasteboard:[sender draggingPasteboard]]]; [self setColors:DEFAULT_COLOR]; return YES; } //----------------------------------------------------------------------------- // - initDefaults //----------------------------------------------------------------------------- - (void)initDefaults { static BOOL initialized = NO; if (!initialized) { DEFAULT_WIN_SIZE = [window frame].size; DEFAULT_FONT = [[Defaults getFont:FONT_DEF fallback:[scroll font]] retain]; initialized = YES; } } //----------------------------------------------------------------------------- // - loadDefaults //----------------------------------------------------------------------------- - (void)loadDefaults { NSString* s; NSRect r = [window frame]; r.size = [Defaults getSize:SIZE_DEF fallback:DEFAULT_WIN_SIZE]; [window setFrame:r display:NO]; autoSort = DEFAULT_AUTO_SORT; showHidden = DEFAULT_SHOW_HIDDEN; highlightDirs = DEFAULT_HIGHLIGHT_DIRS; dragUnscaled = DEFAULT_DRAG_UNSCALED; [autoSortSwitch setState:autoSort]; [hiddenFilesSwitch setState:showHidden]; [highlightSwitch setState:highlightDirs]; [dragUnscaledSwitch setState:dragUnscaled]; [rowNumbersSwitch setState:DEFAULT_ROW_NUMBERS]; [scroll setRowTitlesOn:DEFAULT_ROW_NUMBERS]; [scroll setAutoSortRows:autoSort]; [scroll setFont:DEFAULT_FONT]; [self setColors:DEFAULT_COLOR]; s = [Defaults getStr:COL_SIZES_DEF fallback:0]; if (s) [scroll setColumnSizesFromString:s]; s = [Defaults getStr:COL_ORDER_DEF fallback:0]; if (s) [scroll setColumnOrderFromString:s]; } //----------------------------------------------------------------------------- // - initLockSlot //----------------------------------------------------------------------------- - (void)initLockSlot { id proto = [scroll columnCellPrototype:LOCK_SLOT]; [proto setButtonType:NSSwitchButton]; [proto setImagePosition:NSImageOnly]; [proto setTarget:self]; [proto setAction:@selector(lockClick:)]; [proto setImage:LOCKED_IMAGE]; [proto setAlternateImage:UNLOCKED_IMAGE]; } //----------------------------------------------------------------------------- // - initNameSlot //----------------------------------------------------------------------------- - (void)initNameSlot { id proto = [scroll columnCellPrototype:NAME_SLOT]; [proto setEditable:YES]; [proto setScrollable:YES]; } //----------------------------------------------------------------------------- // - initSlots //----------------------------------------------------------------------------- - (void)initSlots { [self initLockSlot]; [self initNameSlot]; [[scroll columnCellPrototype:SIZE_SLOT] setAlignment:NSRightTextAlignment]; [[scroll columnCellPrototype:HARDLINKS_SLOT] setAlignment:NSRightTextAlignment]; } //----------------------------------------------------------------------------- // - initWithDir: //----------------------------------------------------------------------------- - (id)initWithDir:(NSString*)dirname { [super init]; path = [[NSString alloc] init]; [NSBundle loadNibNamed:@"DirWindow" owner:self]; [window registerForDraggedTypes: [NSArray arrayWithObject:NSColorPboardType]]; [self initSlots]; [self initDefaults]; [self loadDefaults]; [self load:dirname]; [OPEN_DIRS addObject:self]; [self cascade]; return self; } //----------------------------------------------------------------------------- // - init //----------------------------------------------------------------------------- - (id)init { return [self initWithDir:NSHomeDirectory()]; } //----------------------------------------------------------------------------- // - dealloc //----------------------------------------------------------------------------- - (void)dealloc { NSZone* const z = [self zone]; [window setDelegate:0]; [window close]; [self releaseImages]; [window release]; [path release]; [super dealloc]; RETIRE_ZONE(z); } //----------------------------------------------------------------------------- // - path //----------------------------------------------------------------------------- - (NSString*)path { return path; } //----------------------------------------------------------------------------- // + findDir: //----------------------------------------------------------------------------- + (DirWindow*)findDir:(NSString*)normalizedPath { if (normalizedPath != 0) { unsigned int i; unsigned int const lim = [OPEN_DIRS count]; for (i = 0; i < lim; i++) { DirWindow* p = (DirWindow*)[OPEN_DIRS objectAtIndex:i]; NSString* s = [p path]; if (s != 0 && [s isEqualToString:normalizedPath]) return p; } } return 0; } //----------------------------------------------------------------------------- // + launchDir: //----------------------------------------------------------------------------- + (void)launchDir:(NSString*)dirname { DirWindow* p = 0; if (dirname == 0) dirname = NSHomeDirectory(); if (dirname == 0) dirname = @"/"; dirname = normalize_path( dirname ); if ((p = [self findDir:dirname]) == 0) p = [[self allocWithZone:EMPLOY_ZONE()] initWithDir:dirname]; [p activateWindow]; } @end MiscKit2/Examples/ScrollDir/HISTORY.txt100444 1750 1750 23767 6757227543 20131 0ustar sunshinesunshine//----------------------------------------------------------------------------- // ScrollDir HISTORY // $Id: HISTORY.txt,v 1.9 99/06/29 08:15:22 sunshine Exp $ //----------------------------------------------------------------------------- v35 1999/06/25 08:13 EDT sunshine@sunshineco.com Synchronized with ScrollDir v35.1 for OpenStep. Renamed Directory menu's New item to Open. Renamed Directory menu's Save item to Export. Added File menu. Moved Open & Delete items to this menu. Reorganized DirWindow.nib layout to match OpenStep counterpart. Renamed DirController's -new: to -openDirectory:. Renamed DirWindow's -open: to -openSelected:. Renamed DirWindow's -save: to -export:. Fixed spelling error in SD_PageLayout.nib: Botom -> Bottom. Updated copyrignt on Info panel. Updated copyright and contact information in README. The user is now prompted for confirmation before deleting files via the File/Delete menu item. Moved nib files to English.lproj to support localization. Added unpack.sh to simplify unpacking a project with subdirectories. Added copyright notice to ScrollDir_main.m. PB.project no longer generates main() file upon save. Removed unused +[SD_PageLayout launch:]. Fixed comments in SD_PageLayout.{h|m}. Now correctly uses -tableScroll:changeFont:to: rather than -tableScroll:fontChangedFrom:to: to note user instigated font change. For naming consistency, renamed -didClick: to -scrollClick: and -didDoubleClick: to -scrollDoubleClick: in DirWindow. This is more consistent with other names such as -lockClick:. Removed Copy Font, Paste Font, Underline, Superscript, Subscript, and Unscript from Font menu since they made no sense in this context. Cleaned up Makefile.preamble and Makefile.postamble files. Added copyright notices. Ported back to NextStep 3.2. Had to add -I & -L directives to OTHER_CFLAGS & OTHER_LDFLAGS in Makefile.preamble since the 3.2 makefiles do not recognize these directives when specified via NextStep 3.3's Project Builder. Changed Files: * DirController.{h|m} * DirWindows.{h|m|nib} * Info.nib * Makefile * Makefile.{preamble|postamble} * PB.project * README.rtf * ScrollDir.nib * ScrollDir_main.m * SD_PageLayout.{h|m|nib} + unpack.sh v34 1998/03/23 22:59 EST sunshine@sunshineco.com Implemented -tableScroll:draggingSourceOperationMaskForLocal: since the default value changed from Copy to Generic in MiscTableScroll v126. Added -tableScrollIgnoreModifierKeysWhileDragging:, which returns NO. Updated copyright notices on user interface items. Added a "Printing" section to the README. Added license and contact information to the README. Changed Files: * DirWindow.m * Info.nib * Makefile * PB.project * README.rtf v33 1997/11/24 17:05 EST sunshine@sunshineco.com Synchronized with LazyScrollDir v17 for NEXTSTEP. Fixed miminum window size of DirWindow. Unified formatting. Changed Files: * DirWindow.{m|nib} v32 1997/11/14 12:05 EST zarnuk@zarnuk.com Added row-numbers switch. Changed Files: * DirWindow.{h|m|nib} v31 1997/07/08 12:00 EDT sunshine@sunshineco.com Moved include and libarary paths from Makefile.preamble into PB.project. Added /LocalDeveloper/Headers to include paths. Added /LocalDeveloper/Libraries to library paths. Moved -Wwrite-strings from Makefile.preamble into PB.project. Removed hard-coded names from 'relink' target in Makefile.postamble. Worked around AppKit but where the Cell class blindly allocates ClipViews from transient zones and caches them for later re-use. Changed Files: * DirWindow.m * Makefile * Makefile.{preamble|postamble} * PB.project v30 1997/06/10 05:09 EDT sunshine@sunshineco.com Synchronized with ScrollDir v29.4 for OPENSTEP. Restructured DirWindow.m to parallel LazyScrollDir counterpart. Now sets window title with -setTitleAsFilename:. Fixed bug: Wasn't taking "sticky bit" on directories into account when computing whether file could be renamed. No longer misleadingly stat()'s the file which a soft-link points at. Ditched the Message slot. Changed Files: * DirWindow.{m|nib} * pack.sh * pack_binaries.sh * unpack_binaries.sh v29 1997/02/05 04:04 EST sunshine@sunshineco.com Synchronized with LazyScrollDir v13 for NEXTSTEP. Fixed order of headers in ScrollDir.m. Fixed order of headers in DirWindow.m. If directory is readonly then no longer responds to Delete (cmd-r). Removed deviant semi-colon from NameCache.h. Removed deviant semi-colon from -tableScroll:border:slotDraggedFrom:to: in DirWindow.m. Reorganized main menu to be consistent with other NEXTSTEP applications. Recreated missing PB.gdbinit. Changed Files: * Defaults.m * DirWindow.{h|m} * NameCache.h + PB.gdbinit * ScrollDir.nib v28 1997/01/12 07:58 EST sunshine@sunshineco.com Added new delegate methods for support of dragging images out of cells. Added capability to drag scaled or unscaled image from icon cell. Added new column which demonstrates how to use ButtonCell in TableScroll. Fixed wording on Info panel. Updated all the copyrights to include 1997 (including Info.nib). Unified formatting. Updated documentation to reflect the new features. Renamed: "Update" -> "Refresh" Checked all of the files into RCS. Added pack and unpack scripts. Changed Files: * Everything v27 1996/12/30 17:02 EST zarnuk@zarnuk.com Now works with MiscTableScroll v113. Added text-cell editing to rename files. Also added preliminary printing. v26 1996/10/07 09:39 EDT zarnuk@zarnuk.com Now works with MiscTableScroll v109. Added Save command for exporting contents of TableScroll. v25 1996/10/07 09:38 EDT zarnuk@zarnuk.com Now works with MiscTableScroll v105. Responds to new user slot-sort-reversed message. v24 1996/02/17 09:00 EST zarnuk@zarnuk.com Fixed includes since MiscTableScroll.h no longer includes MiscIntList.h v23 1996/02/09 01:00 EST sunshine@sunshineco.com Replaced NameCache's custom hash table with NeXT's HashTable. Info panel will now load README.rtf or README.rtfd. Updated README. v22 1996/02/01 04:15 EST sunshine@sunshineco.com Added Defaults.[mh] as simple front-end to NeXT defaults. The following are now saved and restored via NeXT defaults: Auto-sort Column order Column widths Font Highlight directories Show hidden Window color Window size Added a README.rtf file which explains what this example demonstrates. Added an Info panel that displays the README.rtf file. v21 1996/01/17 05:30 EST sunshine@sunshineco.com Fixed warning that showed up when compiling for debug. Had to replace (int const) with #define for array size. v20 1996/01/17 04:30 EST zarnuk@zarnuk.com Added NameCache code from LazyScrollDir. Small performance improvement. Asking the Workspace for the icons is the real time killer. v19 1996/01/17 02:00 EST sunshine@sunshineco.com Removed mcgh2misc conversions scripts since the one in the palette directory now handles the example directories automatically. v18 1996/01/16 01:00 EST zarnuk@zarnuk.com Fixed bug: Now calls -setImage:0 before freeing the image that was in the cell before. This was the crasher that was generating the message: "objc: FREE(id): message getSize: sent to freed object" The bug was reproducible: (1) Create a non-empty selection. (2) Click on the close box. At step #2, -[DirWindow free] called -freeImages, which freed all the images, but left pointers to the freed images in the icon cells, then it called -[Window free] which ultimately called -[MiscTableScroll free] while it was freeing the views on the window... This invoked -emptyAndFreeCells, which called -empty, which called -renewRows:0, which called -clearSelection, which called -selectionChanged, which called -reflectSelection, which called -[MiscTableView reflectSelection] which tried to draw the cells in their unhighlighted state. (All this, despite the fact that the window had been closed, and was, in fact, about to be freed.) v17 1996/01/08 21:00 EST zarnuk@zarnuk.com Fixed bug: Was not closing directory after scanning it. Fixed bug: Was not freeing images. v16 1995/10/20 13:30 EDT sunshine@sunshineco.com Added missing implementation for -new:. Now it uses the OpenPanel to select the directory you want to view. v15 1995/10/20 04:30 EDT sunshine@sunshineco.com Prepared for inclusion in MiscKit. Added mcgh2misc conversion scripts. Fixed Makefile.preamble's -I and -L flags to work with MiscKit also. Added libMiscTableScroll.a directly to the Project so that Project Builder handles it instead of manually adding it to the Makefile.preamble. Added an application icon. Localized nibs. v14 1995/10/19 02:30 EDT sunshine@sunshineco.com Converted nib's TableScroll class version number from 3 to 0. I changed the version number in TableScroll itself some time ago and converted this nib, but apparently I forgot to cut a new version of ScrollDir. (So essentially this nib could not be loaded in IB, or elsewhere.) Updated DirWindow.m to reflect fact that -cellAt:: methods in TableScroll now return (id) instead of (Cell*). v13 1995/10/01 17:15 EDT zarnuk@zarnuk.com Directory highlight now extends to include the "message" column. Now suppresses display while re-loading the directory. v12 1995/10/01 15:30 EDT sunshine@sunshineco.com Can now drag color swatches into window. Added "highlight dirs" switch which sets the color on cells which show directories. This was done to test individual cell colors to make sure that they don't get changed when a swatch is dropped on the window. v11 1995/09/26 04:00 EDT sunshine@sunshineco.com Now imports newly public header . Old MiscTableCell protocol went away. v10 1995/09/26 04:00 EDT sunshine@sunshineco.com "Change Dir" button is now enabled only when a single directory is selected. MiscKit2/Examples/ScrollDir/Pagination.HAuto.VAuto.tiff100444 1750 1750 512 6757227533 23164 0ustar sunshinesunshineMM*000000000000 *2:B(RH@@ ' 'MiscKit2/Examples/ScrollDir/ScrollDir.ico100444 1750 1750 3066 6757227536 20570 0ustar sunshinesunshine F 0.(^( @wwwwwwwwwwwwwwpwppwppwppppwppwpwpwppppwppwppwpwpppwppwpwpppwppwpwwpwppwppppwppwwwpwwpwppwwwpwwpwppwwwpwwp( @CC{C{AUTCCC{ATCC{C{AUUTC{C{AUUTC{CC{C{B BB BB BB B( wwwwwwppwpwxpppwpwwpwpppwwpwpwwpwp( @BGGBGDGD D D MiscKit2/Examples/ScrollDir/Makefile100444 1750 1750 4022 6757227544 17627 0ustar sunshinesunshine# # Generated by the NeXT Project Builder. # # NOTE: Do NOT change this file -- Project Builder maintains it. # # Put all of your customizations in files called Makefile.preamble # and Makefile.postamble (both optional), and Makefile will include them. # NAME = ScrollDir PROJECTVERSION = 2.7 PROJECT_TYPE = Application LANGUAGE = English NEXTSTEP_APPICON = ScrollDir.tiff WINDOWS_APPICON = ScrollDir.ico ICONSECTIONS = -sectcreate __ICON app ScrollDir.tiff LOCAL_RESOURCES = DirWindow.nib Info.nib ScrollDir-macintosh.nib\ ScrollDir-windows.nib ScrollDir.nib SD_PageLayout.nib GLOBAL_RESOURCES = Align.HCentered.VCentered.tiff\ Align.HCentered.VTop.tiff Align.HLeft.VCentered.tiff\ Align.HLeft.VTop.tiff Lock.insecure.tiff\ Lock.secure.tiff 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 ScrollDir.ico\ ScrollDir.tiff PACKAGE_NUMBER README.rtf CLASSES = Defaults.m DirController.m DirWindow.m SD_PageLayout.m HFILES = Defaults.h DirController.h DirWindow.h SD_PageLayout.h MFILES = ScrollDir_main.m OTHERSRCS = make.sh Makefile Makefile.postamble platform.make MAKEFILEDIR = . CODE_GEN_STYLE = DYNAMIC MAKEFILE = app.make NEXTSTEP_INSTALLDIR = $(USER_APPS_DIR) WINDOWS_INSTALLDIR = $(USER_APPS_DIR) LIBS = DEBUG_LIBS = $(LIBS) PROF_LIBS = $(LIBS) FRAMEWORK_PATHS = -F$(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks NEXTSTEP_PB_CFLAGS = -Werror -Wwrite-strings WINDOWS_PB_CFLAGS = -Werror -Wwrite-strings FRAMEWORKS = -framework MiscTableScroll -framework Foundation\ -framework AppKit include $(MAKEFILEDIR)/platform.make -include Makefile.preamble include $(MAKEFILEDIR)/$(MAKEFILE) -include Makefile.postamble -include Makefile.dependencies MiscKit2/Examples/ScrollDir/Makefile.postamble100444 1750 1750 5125 6757227522 21615 0ustar sunshinesunshine#****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # forceload.fix (1999-06-09, version 1.1) # # A Makefile.postamble patch which eliminates the NSFramework_forceLoad() # compiler warning generated by YellowBox DR2 on Microsoft Windows. # # Under YellowBox DR2 for Microsoft Windows, Apple tried patching the # system makefile so that it automatically generates source code which # references all the classes in each framework used by a project. The # intention was to make all of the frameworks' symbols available to # loadable bundles even if the main application does not reference the # symbols itself. This is similar to the behavior of the linker's # -all_load switch under Mach. # # However, there are two problems with the DR2 implementation: # # a) It is incomplete and does not generate any framework references at # all; instead it generates a single empty function named # NSFramework_forceload(). # b) The generated function is declared "static" which results in a # compiler warning about an unused function. # # This file (forceload.fix) works around the compiler warning by # disabling generation of NSFramework_forceload() altogether. Since the # function is empty and is never referenced by any other code, this is a # safe operation. # # To use this patch, follow these instructions: # # a) Open the project's top-level Makefile.postamble in a text editor. # b) Append the contents of this file (forceload.fix) to the end of # Makefile.postamble. # c) Clean the project (make clean) and then rebuild it. # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ ifeq "WINDOWS" "$(OS)" GENFORCELOAD=echo // endif #------------------------------------------------------------------------------ # A handy "relink" target. #------------------------------------------------------------------------------ relink: -rm -f $(PRODUCT)/$(NAME)$(EXECUTABLE_EXT) $(MAKE) MiscKit2/Examples/ScrollDir/OPENSTEP-BUGS.txt100444 1750 1750 3414 6757227523 20724 0ustar sunshinesunshine//----------------------------------------------------------------------------- // ScrollDir BUGS // $Id: OPENSTEP-BUGS.txt,v 1.2 99/06/14 16:21:55 sunshine Exp $ //----------------------------------------------------------------------------- BUGS: ---- - Each time a new window is opened on MacOS/X Server DR2 for Mach or YellowBox DR2 for Windows, it is taller than the size set with -setFrame:display: by the height of the menu bar. This is an AppKit bug which was introduced in DR2. NeXT BUGS: --------- - Saving font default doesn't work (can't serialize point size error). [I was storing an NSNumber in a dictionary which got saved to defaults. I worked around this bug by storing a string representation of the number in the dictionary instead.] - Info panel not loading README. [I worked around this by explicitly asking for an "rtf" file then an "rtfd" file (if the "rtf" wasn't found). NSBundle is not working as advertised where it says that if you pass nil for the "extension", then it will find the first file with the "name" regardless of the "extension".] - When browsing /LocalApps, the icons are all the same (and they are the icon for MallocDebug.app which isn't even in that directory)! The MallocDebug.app icon shows up as the icon for *ALL* ".app" directories rather than the icon of the executable inside. I tracked this down to MallocDebug's Info.plist: NSExtensions = {app = {NSIcon = Leak.tiff; NSIsPrimary = NO; }; }; [I worked around this problem by explicitly checking for the "app" extension and asking for the icon of the contained executable.] [03/21/97 -- this bug is finally "fixed" in OPENSTEP 4.1 (gamma)] FIXED: ----- v35.1 - File attributes displayed for ".." are actually those for ".". MiscKit2/Examples/ScrollDir/OPENSTEP-HISTORY.txt100444 1750 1750 17533 6757227544 21357 0ustar sunshinesunshine//----------------------------------------------------------------------------- // ScrollDir OPENSTEP HISTORY // $Id: OPENSTEP-HISTORY.txt,v 1.16 99/08/12 23:06:33 sunshine Exp $ //----------------------------------------------------------------------------- v35.1 1999/08/12 21:30 EDT sunshine@sunshineco.com Ported to MacOS/X Server DR2 for Mach and Windows. Updated all nibs to latest UI layout guidelines and adjusted all fonts. Renamed Directory menu's New item to Open. Renamed Directory menu's Save item to Export. Added File menu. Moved Open & Delete items to this menu. Added Close item to Directory menu on MacOS/X platform. Renamed Colors... to Show Colors, and Font Panel... to Show Fonts on MacOS/X platform. Renamed DirController's -new: to -openDirectory:. Renamed DirWindow's -open: to -openSelected:. Renamed DirWindow's -save: to -export:. Fixed spelling error in SD_PageLayout.nib: Botom -> Bottom. Changed background of Page Layout images to be transparent. This looks better on all platforms. The old light-gray background was incorrect for platforms other than NextStep/OpenStep Mach. Updated copyrignt on Info panel. Updated copyright and contact information in README. Added make.sh and platform.make to work around differences in the directory structure between MacOS/X Server DR2 and earlier versions of OpenStep. In particular, the location of the system makefiles changed, as did the location of the 'make' utility on Windows. Added patch to Makefile.postamble to eliminate NSFramework_forceLoad() compiler warning generated by makefiles on YellowBox DR2 for Windows. The user is now prompted for confirmation before deleting files via the File/Delete menu item. Moved nib files to English.lproj to support localization. Added unpack.sh to simplify unpacking a project with subdirectories. Fixed formatting of ScrollDir_main.m. SD_PageLayout implementation is now conditionally compiled for platforms which require it. Removed unused +[SD_PageLayout launch:]. Fixed comments in SD_PageLayout.{h|m}. Some TableScroll delegate method names changed when they were turned into NSNotification-style messages. Now correctly uses -tableScrollChangeFont: rather than -tableScrollFontChanged: to note user instigated font change. For naming consistency, renamed -didClick: to -scrollClick: and -didDoubleClick: to -scrollDoubleClick: in DirWindow. This is more consistent with other names such as -lockClick:. Removed Copy Font, Paste Font, Underline, Kern, Ligature, & Baseline from Format menu since they made no sense in this context. Fixed bug: Attributes displayed for ".." were actually those of ".". Worked around Foundation bug: -[NSString stringByDeletingLastPathComponent] does not handle the root directory as documented. On Mach, when handed "/", it returns "" rather than "/" as documented. On Windows, when handed "C:\", it returns "C:" rather than "C:\" as documented. Changed Files: * DirController.{h|m} * DirWindow.{m|nib} + English.lproj * Info.nib + make.sh * Makefile * Makefile.postamble - Makefile.preamble * Pagination.{HAuto|HClip|HFit}.{VAuto|VClip|VFit}.tiff * PB.project + platform.make * README.rtf * ScrollDir.nib * ScrollDir-macintosh.nib * ScrollDir-windows.nib * ScrollDir_main.m * SD_PageLayout.{h|m|nib} + unpack.sh v34.1 1998/03/30 09:19 EST sunshine@sunshineco.com Applied v34 NEXTSTEP 3.3 diffs. Renamed Windows menu nib: ScrollDir-winnt.nib --> ScrollDir-windows.nib Added Rhapsody-specific main menu. Application icon on Info panel now explicitly names "ScrollDir" rather than "NSApplicationIcon". DirWindow now uses NSColor's "system" color for window background by default, rather than hard-coded light-gray. DirWindow.nib now uses NSColor's "system" colors by default for MiscTableScroll, rather than hard-wired NextStep-like colors. Replaced the NSCStringText in Info.nib with an NSTextView. Ported to Rhapsody DR1 for PPC by working around Objective-C++ compiler bug. Compiler erroneously reported "totalBytes" in -[DirWindow fillScroll] as being used uninitialized. Changed Files: * DirWindow.{m|nib} * Info.nib * Makefile - OPENSTEP-TODO.txt * PB.project + ScrollDir-macintosh.nib > ScrollDir-winnt.nib --> ScrollDir-windows.nib v33.1 1997/11/24 18:05 EST sunshine@sunshineco.com Applied v33 NEXTSTEP 3.3 diffs. Fixed bug: Menu was sending -print: to first-responder which printed the control with keyboard focus rather than the MiscTableScroll. Changed Files: * ScrollDir.nib * ScrollDir-winnt.nib v32.1 1997/11/22 23:30 EST sunshine@sunshineco.com Applied v32 NEXTSTEP 3.3 diffs. Changed Files: * DirWindow.{h|m|nib} v31.1 1997/07/08 13:00 EDT sunshine@sunshineco.com Applied v31 NEXTSTEP 3.3 diffs. Changed Files: * DirWindow.m * Makefile.postamble v30.1 1997/06/24 09:00 EDT sunshine@sunshineco.com Applied v30 NEXTSTEP 3.3 diffs. Changed Files: * DirWindow.m v29.5 1997/06/22 06:00 EST sunshine@sunshineco.com Now works with MiscTableScroll v0.125.9. (Method names changed.) Adjusted framework search path to: $(NEXT_ROOT)/LocalLibrary/Frameworks. Added ScrollDir.ico application icon for Windows NT. Upgraded [un]pack_binaries.sh scripts to handle ICO files. Changed Files: * DirWindow.m * Makefile * pack_binaries.sh * PB.project + ScrollDir.ico * unpack_binaries.sh v29.4 1997/04/25 17:00 EDT sunshine@sunshineco.com Synchronized with LazyScrollDir v14.2 for OPENSTEP. Changed Files: * DirWindow.m v29.3 1997/04/15 23:00 EDT sunshine@sunshineco.com Ported to OPENSTEP 4.2 prerelease for Mach and NT. Replaced the Unix specific directory scanning code with NSFileManager. Removed the "message" column since this information isn't available from the NSFileManager. Added a Windows NT specific main menu nib. Replaced assert() with NSAssert() variations. Removed obsolete NameCache class. No longer needed since NSFileManager returns string versions of file owner's user and group. Removed reference to NameCache from README. Added MiscTableScroll to Frameworks directory in project since it is now a framework. Upgraded pack.sh script to store minor version number in PACKAGE_NUMBER. Upgraded binary pack and unpack scripts so they don't error out if tiffs or nibs are non-existent. Removed obsolete PB.gdbinit (no longer used by ProjectBuilder). *** Delete your old "ColOrder" and "ColSizes" defaults *** Changed Files: * Defaults.m * DirWindow.{m|nib} * Makefile - NameCache.{h|m} * README.rtf * pack.sh * pack_binaries.sh + ScrollDir-winnt.nib * unpack_binaries.sh - PB.gdbinit * PB.project v29.2 1997/03/23 01:45 EST sunshine@sunshineco.com Brought into synchronization with LazyScrollDir v13.1 for OPENSTEP. Latest ScrollDir.nib had not been checked in via RCS. v29.1 1997/03/22 22:50 EST sunshine@sunshineco.com Applied v29 NEXTSTEP 3.3 diffs. v28.1 1997/03/21 18:40 EST sunshine@sunshineco.com Applied v28 NEXTSTEP 3.3 diffs. v27.1 1997/03/21 00:30 EST sunshine@sunshineco.com Applied v27 NEXTSTEP 3.3 diffs. Now works with OPENSTEP MiscTableScroll v125.2 (many MiscTableScroll method names changed since v26 of this project). v26.1 1997/02/07 14:00 EST sunshine@sunshineco.com Applied v26 NEXTSTEP 3.3 diffs. v25.1 1997/02/07 11:00 EST sunshine@sunshineco.com Applied v25 NEXTSTEP 3.3 diffs. v24.3 1996/12/30 02:30 EST sunshine@sunshineco.com Ported to broken OPENSTEP 4.1 (gamma) pb_makefiles. v24.2 1996/05/07 08:00 EDT sunshine@sunshineco.com TableScroll class version numbers were bumped up for all classes which archive themselves. Therefore converted the DirWindow nib. MiscKit2/Examples/ScrollDir/PACKAGE_NUMBER100444 1750 1750 5 6757227523 20127 0ustar sunshinesunshine35 1 MiscKit2/Examples/ScrollDir/PB.project100444 1750 1750 5764 6757227544 20076 0ustar sunshinesunshine{ APPCLASS = NSApplication; FILESTABLE = { BUNDLES = (); CLASSES = (Defaults.m, DirController.m, DirWindow.m, SD_PageLayout.m); FRAMEWORKS = (MiscTableScroll.framework, Foundation.framework, AppKit.framework); FRAMEWORKSEARCH = ("$(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks"); HEADERSEARCH = (); H_FILES = (Defaults.h, DirController.h, DirWindow.h, SD_PageLayout.h); IMAGES = ( Align.HCentered.VCentered.tiff, Align.HCentered.VTop.tiff, Align.HLeft.VCentered.tiff, Align.HLeft.VTop.tiff, Lock.insecure.tiff, Lock.secure.tiff, 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, ScrollDir.ico, ScrollDir.tiff ); INTERFACES = ( DirWindow.nib, Info.nib, "ScrollDir-macintosh.nib", "ScrollDir-windows.nib", ScrollDir.nib, SD_PageLayout.nib ); LIBRARYSEARCH = (); LIBS = (); M_FILES = (); OTHER_LIBS = (); OTHER_LINKED = (ScrollDir_main.m); OTHER_RESOURCES = (PACKAGE_NUMBER, README.rtf); OTHER_SOURCES = (make.sh, Makefile, Makefile.postamble, platform.make); PUBLIC_FILES = (); SUBPROJECTS = (); TOOLS = (); }; GENERATEMAIN = YES; LANGUAGE = English; LOCALIZABLE_FILES = { DirWindow.nib = DirWindow.nib; Info.nib = Info.nib; SD_PageLayout.nib = SD_PageLayout.nib; "ScrollDir-macintosh.nib" = "ScrollDir-macintosh.nib"; "ScrollDir-windows.nib" = "ScrollDir-windows.nib"; ScrollDir.nib = ScrollDir.nib; }; MAKEFILEDIR = .; NEXTSTEP_APPICON = ScrollDir.tiff; NEXTSTEP_BUILDTOOL = /bin/gnumake; NEXTSTEP_COMPILEROPTIONS = "-Werror -Wwrite-strings"; NEXTSTEP_DOCUMENTEXTENSIONS = (); NEXTSTEP_INSTALLDIR = "$(USER_APPS_DIR)"; NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; NEXTSTEP_MAINNIB = ScrollDir; NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; PDO_UNIX_JAVA_COMPILER = "$(NEXTDEV_BIN)/javac"; PDO_UNIX_OBJCPLUS_COMPILER = "$(NEXTDEV_BIN)/gcc"; PROJECTNAME = ScrollDir; PROJECTTYPE = Application; PROJECTVERSION = 2.7; SYSTEMEXTENSIONS = (); TARGETS = (relink); WINDOWS_APPICON = ScrollDir.ico; WINDOWS_BUILDTOOL = ./make.sh; WINDOWS_COMPILEROPTIONS = "-Werror -Wwrite-strings"; WINDOWS_DOCUMENTEXTENSIONS = (); WINDOWS_INSTALLDIR = "$(USER_APPS_DIR)"; WINDOWS_JAVA_COMPILER = "$(JDKBINDIR)/javac.exe"; WINDOWS_MAINNIB = "ScrollDir-windows"; WINDOWS_OBJCPLUS_COMPILER = "$(DEVDIR)/gcc"; } MiscKit2/Examples/ScrollDir/Pagination.HAuto.VClip.tiff100444 1750 1750 512 6757227534 23144 0ustar sunshinesunshineMM*000000 *2:B(RH@@ ' 'MiscKit2/Examples/ScrollDir/Pagination.HAuto.VFit.tiff100444 1750 1750 512 6757227535 23000 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/ScrollDir/Pagination.HClip.VAuto.tiff100444 1750 1750 512 6757227535 23145 0ustar sunshinesunshineMM*00000000 *2:B(RH@@ ' 'MiscKit2/Examples/ScrollDir/Pagination.HClip.VClip.tiff100444 1750 1750 512 6757227535 23124 0ustar sunshinesunshineMM*000000 *2:B(RH@@ ' 'MiscKit2/Examples/ScrollDir/Pagination.HClip.VFit.tiff100444 1750 1750 512 6757227535 22757 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/ScrollDir/Pagination.HFit.VAuto.tiff100444 1750 1750 512 6757227535 23000 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/ScrollDir/Pagination.HFit.VClip.tiff100444 1750 1750 512 6757227536 22760 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/ScrollDir/Pagination.HFit.VFit.tiff100444 1750 1750 512 6757227536 22613 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/ScrollDir/ScrollDir.tiff100444 1750 1750 14004 6757227536 20760 0ustar sunshinesunshineMM*U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_ 00(RB ' 'MMUMUMU5TMMUMUMU5TMMUMUMU5T 0OOOOOO OUO OUUO OUO ꪯOUOꪯ OO OUUUUUUUUT 00(R@@ ' 'MiscKit2/Examples/ScrollDir/README.rtf100444 1750 1750 16630 6757227544 17671 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\ftech Symbol;\f2\fmodern Ohlfs; } {\colortbl;\red255\green255\blue255;} \paperw10980\paperh10140 \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \f0\b\fs36 \cf0 ScrollDir\ \b0\fs24 By Paul S. McCarthy and Eric Sunshine\ Copyright \f1 \f0 1995,1996,1997,1998,1999 by Paul S. McCarthy and Eric Sunshine\ April 23, 1999\ \ \b\fs28 Overview \fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b0\fs12 \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs24 \cf0 This program demonstrates the use of MiscTableScroll using \i eager \i0 mode. It is a simple directory browser which supports basic operations such as \i open, delete, rename, \i0 and \i change directory \i0 .\ \ \ \b\fs28 Notable Features \fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b0\fs12 \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b\fs24 \cf0 Eager Mode\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\ql\qnatural \b0 \cf0 This example uses an \i eager \i0 mode MiscTableScroll which creates and fills all cells immediately. This differs from a \i lazy \i0 mode MiscTableScroll where the data-delegate is responsible for managing the cells. \i Eager \i0 mode is useful for fairly small data sets and data sets for which data retrieval time is small. \i Eager \i0 mode is usually easier to program than \i lazy \i0 mode.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b \cf0 \ Color \b0 \ 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 \i Color Panel \i0 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 \i implicitly \i0 take the same background color. All cells which have had their color set \i explicitly \i0 retain their own color.\ \ The \i highlight directories \i0 switch on the browser window demonstrates that cells can maintain their own colors instead of inheriting them. When toggled \i on \i0 the rows for directories are highlighted in a color independent of the MiscTableScroll. \b \ \ Font\ \b0 When the MiscTableScroll is first-responder, the \i Font Panel \i0 can be used to change its font. Cells which inherit their font from the MiscTableScroll display the newly selected font. \b \ \ Users Preferences\ \b0 This program demonstrates how to save and restore the user's column order and width preferences. Additionally, all other user preferences -- \i font, color, \i0 \i switch settings \i0 , and \i window size -- \i0 are also saved and restored.\ \ \b Sorting\ \b0 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 \i nib \i0 file by adjusting the criteria on a column-by-column basis. For instance, columns may contribute \i stringValue, title, intValue, tag, \i0 etc. to the row-wise comparisons.\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b \cf0 Image Display\ \b0 One column in the browser displays the file's icon. This demonstrates how to use \i image \i0 columns in addition to \i text \i0 columns.\ \ \b Image Dragging\ \b0 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 \i dragged filenames \i0 , 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.\ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b \cf0 Text Editing\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b0 \cf0 MiscTableScroll supports \i in-cell \i0 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 \i Name \i0 column initiates editing.\ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b \cf0 Buttons\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b0 \cf0 This example illustrates how to use \i ButtonCells \i0 with the MiscTableScroll. One column contains a \i ButtonCell \i0 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 \i unlocked, \i0 renaming is allowed, and double-clicking on the file name in the \i Name \i0 column initiates an edit session. When \i locked, \i0 renaming is not allowed. If you do not have permission to rename a file the browser displays a \i locked \i0 icon and disables the \i ButtonCell \i0 .\ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b \cf0 Exporting \b0 \ MiscTableScroll can export its contents in dBASEIII (.dbf) format and also a number of ASCII formats via the \i Export \i0 menu item on the \i Directory \i0 menu.\ \ \b Printing \b0 \ MiscTableScroll respects the various page layout options, such as shrink-to-fit, spill, crop, centering, etc.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \cf0 \ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b\fs28 \cf0 Conclusion\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b0\fs12 \cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \fs24 \cf0 ScrollDir was written by Paul S. McCarthy and Eric Sunshine and is copyright \f1 \f0 1995, 1996, 1997, 1998, 1999 by Paul S. McCarthy and Eric Sunshine. It is included in the MiscKit by permission from the authors and is governed by the MiscKit license found in the file \f2\fs20 License.rtf \f0\fs24 in the MiscKit distribution.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \fs24 \cf0 Please direct comments, questions, and complaints to:\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\li360\fi-160\ql\qnatural \fs24 \cf0 Paul S. McCarthy \f2\fs20 \f0\fs24 \ Eric Sunshine \f2\fs20 \f0\fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \fs24 \cf0 MIME and ASCII mail accepted. \fs12 \ } MiscKit2/Examples/ScrollDir/SD_PageLayout.h100444 1750 1750 4025 6757227525 21002 0ustar sunshinesunshine#ifndef __SD_PageLayout_h #define __SD_PageLayout_h //============================================================================= // // Copyright (C) 1996,1997,1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // SD_PageLayout.h // // Custom subclass of AppKit's NSPageLayout panel that adds user controls // for margins, pagination, & centering. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: SD_PageLayout.h,v 1.2 99/06/14 16:11:33 sunshine Exp $ // $Log: SD_PageLayout.h,v $ // Revision 1.2 99/06/14 16:11:33 sunshine // v35.1: Removed unused +launch:. Fixed up comments. No longer makes an // effort to supply missing NSPageLayout methods on Windows. Now the entire // implementation of the class is conditionally compiled as appropriate, // instead of piecemeal. // //----------------------------------------------------------------------------- #import @class NSMatrix, NSTextField; #if defined(WIN32) #undef SD_USE_PAGE_LAYOUT #else #define SD_USE_PAGE_LAYOUT #endif @interface SD_PageLayout : NSPageLayout { #if defined(SD_USE_PAGE_LAYOUT) NSWindow* accessoryWindow; NSTextField* leftMarginField; NSTextField* topMarginField; NSTextField* rightMarginField; NSTextField* bottomMarginField; NSMatrix* centerMatrix; NSMatrix* paginationMatrix; #endif } @end #endif // __SD_PageLayout_h MiscKit2/Examples/ScrollDir/SD_PageLayout.m100444 1750 1750 14234 6757227525 21032 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1997,1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // SD_PageLayout.m // // Custom subclass of AppKit's NSPageLayout panel that adds user controls // for margins, pagination, & centering. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: SD_PageLayout.m,v 1.3 99/06/14 16:11:27 sunshine Exp $ // $Log: SD_PageLayout.m,v $ // Revision 1.3 99/06/14 16:11:27 sunshine // v35.1: Removed unused +launch:. Fixed up comments. No longer makes an // effort to supply missing NSPageLayout methods on Windows. Now the entire // implementation of the class is conditionally compiled as appropriate, // instead of piecemeal. // // Revision 1.2 1997/04/15 22:20:11 sunshine // 29.3: Ported to OPENSTEP 4.2 prerelease for Windows NT by working around // incompatiblities between Mach and NT NSPageLayout implementations. //----------------------------------------------------------------------------- #import "SD_PageLayout.h" #import #import #import #import #import #import @implementation SD_PageLayout #if defined(SD_USE_PAGE_LAYOUT) //----------------------------------------------------------------------------- // loadAccessoryView //----------------------------------------------------------------------------- - (void)loadAccessoryView { NSView* v; [NSBundle loadNibNamed:@"SD_PageLayout" owner:self]; v = [[[accessoryWindow contentView] retain] autorelease]; [accessoryWindow setContentView:0]; [accessoryWindow close]; [accessoryWindow release]; [self setAccessoryView:v]; } //----------------------------------------------------------------------------- // pageLayout //----------------------------------------------------------------------------- + (NSPageLayout*)pageLayout { static id p = 0; if (p == 0) { p = [[super pageLayout] retain]; [p loadAccessoryView]; } return p; } //----------------------------------------------------------------------------- // pickedUnits: //----------------------------------------------------------------------------- - (void)pickedUnits:(id)sender { float old_factor, new_factor, scaler; [self convertOldFactor:&old_factor newFactor:&new_factor]; scaler = new_factor / old_factor; [leftMarginField setFloatValue:[leftMarginField floatValue] * scaler]; [rightMarginField setFloatValue:[rightMarginField floatValue] * scaler]; [topMarginField setFloatValue:[topMarginField floatValue] * scaler]; [bottomMarginField setFloatValue:[bottomMarginField floatValue] * scaler]; [super pickedUnits:sender]; } //----------------------------------------------------------------------------- // pagination_to_slot //----------------------------------------------------------------------------- static int pagination_to_slot( int pg ) { int slot = 1; if (pg == NSFitPagination) slot = 0; else if (pg == NSClipPagination) slot = 2; return slot; } //----------------------------------------------------------------------------- // slot_to_pagination //----------------------------------------------------------------------------- static int slot_to_pagination( int slot ) { int pg = NSAutoPagination; if (slot == 0) pg = NSFitPagination; else if (slot == 2) pg = NSClipPagination; return pg; } //----------------------------------------------------------------------------- // readPrintInfo //----------------------------------------------------------------------------- - (void)readPrintInfo { NSPrintInfo* pinfo; int pg_row, pg_col; float old_factor, new_factor; [super readPrintInfo]; pinfo = [self printInfo]; [self convertOldFactor:&old_factor newFactor:&new_factor]; [leftMarginField setFloatValue:new_factor * [pinfo leftMargin ]]; [rightMarginField setFloatValue:new_factor * [pinfo rightMargin ]]; [topMarginField setFloatValue:new_factor * [pinfo topMargin ]]; [bottomMarginField setFloatValue:new_factor * [pinfo bottomMargin]]; [centerMatrix selectCellAtRow:(int)[pinfo isVerticallyCentered] column:(int)[pinfo isHorizontallyCentered]]; pg_row = pagination_to_slot( [pinfo verticalPagination] ); pg_col = pagination_to_slot( [pinfo horizontalPagination] ); [paginationMatrix selectCellAtRow:pg_row column:pg_col]; } //----------------------------------------------------------------------------- // writePrintInfo //----------------------------------------------------------------------------- - (void)writePrintInfo { NSPrintInfo* pinfo; float old_factor, new_factor; [super writePrintInfo]; pinfo = [self printInfo]; [self convertOldFactor:&old_factor newFactor:&new_factor]; [pinfo setLeftMargin: [leftMarginField floatValue] / old_factor]; [pinfo setRightMargin: [rightMarginField floatValue] / old_factor]; [pinfo setTopMargin: [topMarginField floatValue] / old_factor]; [pinfo setBottomMargin:[bottomMarginField floatValue] / old_factor]; [pinfo setVerticallyCentered: [centerMatrix selectedRow ]]; [pinfo setHorizontallyCentered:[centerMatrix selectedColumn]]; [pinfo setHorizontalPagination: slot_to_pagination([paginationMatrix selectedColumn])]; [pinfo setVerticalPagination: slot_to_pagination([paginationMatrix selectedRow])]; } #endif // SD_USE_PAGE_LAYOUT @end MiscKit2/Examples/ScrollDir/ScrollDir.iconheader100444 1750 1750 70 6757227525 22045 0ustar sunshinesunshineF ScrollDir.app ScrollDir app F ScrollDir ScrollDir app MiscKit2/Examples/ScrollDir/ScrollDir_main.m100444 1750 1750 2246 6757227526 21254 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // $Id: ScrollDir_main.m,v 1.2 99/06/14 16:12:30 sunshine Exp $ // $Log: ScrollDir_main.m,v $ // Revision 1.2 99/06/14 16:12:30 sunshine // v35.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Added copyright notice. Fixed formatting. // //----------------------------------------------------------------------------- #import int main( int argc, char const* argv[] ) { return NSApplicationMain( argc, argv ); } MiscKit2/Examples/ScrollDir/platform.make100444 1750 1750 13121 6757227526 20672 0ustar sunshinesunshine#****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # platform.make (1999-06-09, version 1.1) # # A cross-platform compatibility makefile which allows a project to be # built for both MacOS/X Server and OpenStep without maintaining # distinct PB.project files and Makefiles for each platform. # # Prior to MacOS/X Server, system-supplied makefiles resided in a # constant location, in this case $(NEXT_ROOT)/NextDeveloper/Makefiles. # As of MacOS/X Server, however, the directory structure changed, so # that on Mach, makefiles now reside in /System/Developer/Makefiles, and # on Windows they reside in $(NEXT_ROOT)/Developer/Makefiles. # # Apple hacked GNU's "make" utility on MacOS/X Server so that it # automatically defines the variable MAKEFILEPATH, which on Mach # defaults to /System/Developer/Makefiles, and on Microsoft Windows # defaults to $(NEXT_ROOT)/Developer/Makefiles. In this manner, they # are able to refer to the system makefile directory without having to # hardcode the path into the local makefile as they did prior to MacOS/X # Server. # # However, Apple's hack does not help the developer who must still # support earlier platforms which use the old directory structure, nor # did Apple provide a backward compatibility solution. Consequently, # the developer is forced to maintain two sets of PB.project files and # Makefiles; one for OpenStep 4.x, and one for MacOS/X Server and later. # # This file (platform.make) bridges the gap between the old directory # structure and the new by forcefully inserting itself into the make # process at the earliest possible time and adjusting the makefile path # dynamically to match either the old or the new directory structure. # # To insert this file into the make process, follow these steps: # # a) If the project is currently open in ProjectBuilder.app, close it. # b) Open the project's top-level PB.project file in a text editor. # c) Find the line which defines MAKEFILEDIR. Its definition will be # either $(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles or # $(MAKEFILEPATH)/pb_makefiles depending upon whether it was # generated by OpenStep 4.x or MacOS/X Server. # d) Change the value of MAKEFILEDIR to "." (a single quoted period). # e) Open the project's top-level Makefile in a text editor. # f) Find the line which defines MAKEFILEDIR. # g) Change the value of MAKEFILEDIR to . (a single period). # h) Place this file (platform.make) in the project's main directory. # # The variable MAKEFILEDIR is normally used to locate the system makefile # directory from which platform.make is loaded as the very beginning of # the build process. By changing the value of MAKEFILEDIR to ".", this # replacement platform.make gets loaded instead. # # Once in control, this file determines the correct makefile path # dynamically, either $(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles # or $(MAKEFILEPATH)/pb_makefiles and sets it as the value of MAKEFILEDIR # so that later references to MAKEFILEDIR use the actual system # makefiles. Finally, the real system platform.make is loaded, and # control returns to the caller. # # To further facilitate cross-platform development, this file also # defines the following variables for pre-MacOS/X Server platforms which # are normally only defined for MacOS/X Server and later platforms. # These variables are typically used by "install" targets where the # installation location may vary from platform to platform. # # MAKEFILEPATH Path to system makefiles # USER_APPS_DIR $(HOME)/Apps [vs. $(HOME)/Applications on OS/X] # USER_LIBRARY_DIR $(HOME)/Library # LOCAL_APPS_DIR /LocalApps [Mach] or /Local/Apps [Windows] # LOCAL_LIBRARY_DIR /LocalLibrary or /Local/Library # LOCAL_DEVELOPER_DIR /LocalDeveloper or /Local/Developer # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ ifndef MAKEFILEPATH MAKEFILEPATH=$(NEXT_ROOT)/NextDeveloper/Makefiles endif MAKEFILEDIR=$(MAKEFILEPATH)/pb_makefiles include $(MAKEFILEDIR)/platform.make ifeq "NEXTSTEP" "$(OS)" ifndef USER_APPS_DIR export USER_APPS_DIR=$(HOME)/Apps endif ifndef USER_LIBRARY_DIR export USER_LIBRARY_DIR=$(HOME)/Library endif ifndef LOCAL_APPS_DIR export LOCAL_APPS_DIR=/LocalApps endif ifndef LOCAL_LIBRARY_DIR export LOCAL_LIBRARY_DIR=/LocalLibrary endif ifndef LOCAL_DEVELOPER_DIR export LOCAL_DEVELOPER_DIR=/LocalDeveloper endif else # Windows and PDO platforms ifndef USER_APPS_DIR export USER_APPS_DIR=$(HOME)/Apps endif ifndef USER_LIBRARY_DIR export USER_LIBRARY_DIR=$(HOME)/Library endif ifndef LOCAL_APPS_DIR export LOCAL_APPS_DIR=/Local/Apps endif ifndef LOCAL_LIBRARY_DIR export LOCAL_LIBRARY_DIR=/Local/Library endif ifndef LOCAL_DEVELOPER_DIR export LOCAL_DEVELOPER_DIR=/Local/Developer endif endif MiscKit2/Examples/ScrollDir/Align.HCentered.VTop.tiff100444 1750 1750 422 6757227532 22577 0ustar sunshinesunshineMM*D*JVOߏ$ C!\6Cq?R` U?P8$ BaP  (R5- ' 'MiscKit2/Examples/ScrollDir/Align.HCentered.VCentered.tiff100444 1750 1750 426 6757227532 23572 0ustar sunshinesunshineMM*H*JTVO(L->C`'ш^!O$@U@@?P8$ BaP (R80 ' 'MiscKit2/Examples/LazyScrollDir/ 40755 1750 1750 0 6757365732 16740 5ustar sunshinesunshineMiscKit2/Examples/LazyScrollDir/English.lproj/ 40755 1750 1750 0 6757227567 21461 5ustar sunshinesunshineMiscKit2/Examples/LazyScrollDir/English.lproj/DirWindow.nib/ 40755 1750 1750 0 6722775725 24132 5ustar sunshinesunshineMiscKit2/Examples/LazyScrollDir/English.lproj/DirWindow.nib/data.classes100444 1750 1750 1355 6713657351 26513 0ustar sunshinesunshine"DirWindow" = { ACTIONS = { "autoSortClick:" = id; "cdPressed:" = id; "dragUnscaledClick:" = id; "hiddenFilesClick:" = id; "highlightClick:" = id; "refreshPressed:" = id; "rowNumbersClick:" = id; "scrollClick:" = id; "scrollDoubleClick:" = id; }; OUTLETS = { autoSortSwitch = id; cdButton = id; countField = id; dragUnscaledSwitch = id; hiddenFilesSwitch = id; highlightSwitch = id; refreshButton = id; rowNumbersSwitch = id; scroll = id; window = id; }; SUPERCLASS = NSObject; }; "FirstResponder" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSObject; }; MiscKit2/Examples/LazyScrollDir/English.lproj/DirWindow.nib/objects.nib100444 1750 1750 6444 6757227574 26362 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ DirWindowi NSWindowTemplate) iiffffi@@@@@c `xWindowNSWindowViewNSView) NSResponder @@@@ffffffffNSMutableArrayNSArray NSButton NSControl)$"BBicc@ NSButtonCell9 NSActionCellNSCell<ii@@@@TraverseNSFont[20c] Helveticaf ci: ssIi@@@@@@ Helvetica $BBRefresh@! Show Hidden Files<@NSCustomResource)NSImageNSSwitchNSHighlightedSwitch!)~~ Auto-Sort<@! Highlight Directories<@MiscTableScrollꄄ NSScrollView* NSClipView:™@vv’@@cccNSColor@@@SystemcontrolBackgroundColorʬff?* NSScroller™’„ff:?x _doScroller:ϒ™’¸CƒВΒƒffi  Helvetica ʬ˄controlTextColorʬɒʬ˄selectedControlTextColorԆʬ˄selectedControlColorʬڒI™P    x  < d P < < ( P [10i]NameSizeModifiedPermsOwnerGroupLinks Soft Link™  x !~~Drag Big Images㮁<@!~~ Row-Numbers殁<@ NSTextField!,NSTextFieldCell=9999 files 9999999 bytesхc@@ʬ˄textBackgroundColorن҆: ꒅffff~枖㞖鞖ž File's OwnerWindow NSMutableSetNSSetNSIBOutletConnector NSIBConnectorwindowdelegatecdButtonNSIBControlConnector cdPressed: refreshButtonrefreshPressed:鄘 countFieldhiddenFilesSwitchhiddenFilesClick:autoSortSwitchautoSortClick:highlightSwitchhighlightClick:„scroll•delegateMiscTableConnector•scrollDoubleClick: doubleTarget doubleAction• scrollClick:¤ nextKeyView„initialFirstResponderㄘdragUnscaledSwitch㕄dragUnscaledClick:愘rowNumbersSwitch敄rowNumbersClick:愘 nextKeyView----*@i $0", & Ȟ$/<%ȳ#ș !51>&1 " !'ȕ,:Ȥȿ(6ȼ/ .;*70=Ȱ ?MiscKit2/Examples/LazyScrollDir/English.lproj/Info.nib/ 40755 1750 1750 0 6722775725 23117 5ustar sunshinesunshineMiscKit2/Examples/LazyScrollDir/English.lproj/Info.nib/data.classes100444 1750 1750 302 6710113351 25427 0ustar sunshinesunshine"DirController" = { ACTIONS = {}; OUTLETS = {infoPanel = id; infoText = id; }; SUPERCLASS = NSObject; }; "FirstResponder" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSObject; }; MiscKit2/Examples/LazyScrollDir/English.lproj/Info.nib/objects.nib100444 1750 1750 4223 6757227575 25341 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ DirControlleri NSView) NSResponderNSBox) @@@@ffffffffNSMutableArrayNSArray NSTextField NSControl)!  icc@NSTextFieldCell= NSActionCellNSCell<ii@@@@LCopyright (C) 1995,1996,1997,1998,1999 by Paul S. McCarthy and Eric SunshineNSFont[20c] Helveticaf ci:c@@NSColor@@@System controlColorff?*ffff:"ff@@cccBox Helvetica  ;MiscTableScroll Example HelveticatextBackgroundColorcontrolTextColor NSImageView NSMutableSetNSSetINSFilenamesPboardTypeNeXT filename pasteboard typet0000 NSImageCell)NSCustomResource)NSImage LazyScrollDiriii NSScrollView* NSClipView:љNSTextTemplate.NSViewTemplate.ԙNNԒNSText textColor† Helvetica NNNђגׄ@@cccNSCursorΖτ NSIBeamCursor NSScrollerљNNђфff: _doScroller:љWWђ?rCë R RԒԒffi  nBoxNSWindowTemplate) iiffffi@@@@@co`xInfoNSPanelViewԆіў떢Þׅ File's Owner넘InfoǷNSIBOutletConnector NSIBConnector넘 infoPanelׄinfoText@i ɹə ɴ ɞ ɲɜɢɕMiscKit2/Examples/LazyScrollDir/English.lproj/LazyScrollDir-windows.nib/ 40755 1750 1750 0 6722775725 26451 5ustar sunshinesunshineMiscKit2/Examples/LazyScrollDir/English.lproj/LazyScrollDir-windows.nib/data.classes100444 1750 1750 547 6713661542 31011 0ustar sunshinesunshine"DirController" = { ACTIONS = {"info:" = id; "openDirectory:" = id; "runPageLayout:" = id; }; OUTLETS = {}; SUPERCLASS = NSObject; }; "FirstResponder" = { ACTIONS = { "destroy:" = id; "export:" = id; "openSelected:" = id; "printDirectory:" = id; }; OUTLETS = {}; SUPERCLASS = NSObject; }; MiscKit2/Examples/LazyScrollDir/English.lproj/LazyScrollDir-windows.nib/objects.nib100444 1750 1750 10566 6713661542 30706 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ NSApplicationi2NSMenuTemplate) ffccc@@@@,WindowNSMenuNSMatrix< NSControl)NSView) NSResponder @@@@ffffffff^<^<icc@#iiii:::ffffi@@@@@ NSMenuItem NSMenuCell NSButtonCell9 NSActionCellNSCell<^(NSMutableArrayNSArrayii@@@@CascadeNSFont[20c] Helveticaf ci: ssIi@@@@@@ Minimize All@h-@NSColorff" LazyScrollDirNSMenujjj DirectorysubmenuAction:% DirectorydddOpen...@oClose@w Export...@s-@ Page Setup...@PPrint...@p-@Exit@q@NSCustomResource)NSImage NSMenuArrowFilel܄NSMenu?(?(?Open߱@ODelete߱@r@ׅ݆Edit\EditPPPPPCut뱁@xCopy뱁@cPaste뱁@v Select All뱁@a@ׅ醒FormatGFormatNSMenuH(H(H(Fontx3Font```( Font Panel...@tBold@bItalic@i@ׅ Colors...@C@ׅ@ׅServicesServicesNSMenuPPP@ׅHelpNSMenu(About LazyScrollDir@@ׅҿʿϿ Ŀ疄 DirController̿ߖ NSFontManagerݖۖߖ繖 Կǿ۹  焘Edit File's Owner" DirController$ Font Manager턘CutCopy󄘘Paste Select AllMainMenu NSMutableSetNSSetINSIBControlConnector NSIBConnector@@@텄cut:4copy:4󅄘paste:4 selectAll:NSIBOutletConnector5"delegate4"openDirectory:4Džexport:4orderFrontColorPanel:4arrangeInFront:4hide:4҅orderFrontColorPanel:4 $ addFontTrait:4 $ addFontTrait:4$orderFrontFontPanel:4orderFrontColorPanel:4ʅorderFrontColorPanel:4"runPageLayout:4ԕ terminate:4 "info:4υprintDirectory:4ᅄ openSelected:4ą performClose:4䅄destroy:$J@i$90HTҁ =I  GGQeSFفsO *A@!MEC 0-:2WׁKb݁,,CBMiscKit2/Examples/LazyScrollDir/English.lproj/SD_PageLayout.nib/ 40755 1750 1750 0 6722775725 24664 5ustar sunshinesunshineMiscKit2/Examples/LazyScrollDir/English.lproj/SD_PageLayout.nib/data.classes100444 1750 1750 601 6710106034 27176 0ustar sunshinesunshine"FirstResponder" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSObject; }; "SD_PageLayout" = { ACTIONS = {}; OUTLETS = { accessoryWindow = id; bottomMarginField = id; centerMatrix = id; leftMarginField = id; paginationMatrix = id; rightMarginField = id; topMarginField = id; }; SUPERCLASS = NSObject; }; MiscKit2/Examples/LazyScrollDir/English.lproj/SD_PageLayout.nib/objects.nib100444 1750 1750 6544 6710105263 27070 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ SD_PageLayouti NSButtonCell9 NSActionCellNSCell<ii@@@@CellNSFont[20c] Helveticaf ci:NSMatrix< NSControl)NSView) NSResponderNSBox) @@@@ffffffffNSMutableArrayNSArray NSTextField1..icc@NSTextFieldCell=q@c@@NSColor@@@SystemtextBackgroundColorffcontrolTextColor:#..Left:1..q@ ..Right:¯..q@ůc#66Top:ǯ..q@ʯc 66Bottom:̯77sIIff@@cccMarginsљә<<<<Ӓ#iiii:::ffffi@@@@@DՄ ssIi@@@@@7@NSCustomResource)NSImageAlign.HLeft.VTopն7@ٖڄAlign.HCentered.VTopն7@ٖڄAlign.HLeft.VCenteredն7@ٖڄAlign.HCentered.VCentered7@؅׆FAFAђJSJSCenterссihqhq Paginationd_d_ZZZZD 7@ٖڄPagination.HFit.VFit7@ٖڄPagination.HAuto.VFit7@ٖڄPagination.HFit.VAuto7@ٖڄPagination.HAuto.VAuto7@ٖڄPagination.HClip.VAuto7@ٖڄPagination.HFit.VClip7@ٖڄPagination.HAuto.VClip7@ٖڄPagination.HClip.VClip7@󆶁7@ٖڄPagination.HClip.VFitՖѨ®󠖥ՖNSWindowTemplate) iiffffi@@@@@cс`xWindowNSWindowViewffffZ Ֆ𠖮̮ǮՖӖŮіʮ File's OwnerWindow NSMutableSetNSSetINSIBOutletConnector NSIBConnectorleftMarginFieldaccessoryWindowʄbottomMarginFieldrightMarginFieldńtopMarginFieldń nextKeyViewdelegate ŕ" "ʕ"Մ centerMatrixpaginationMatrixՠ nextKeyView--1@i".1  (- !'',%%*&+! $ $)#*. &/2#(,06MiscKit2/Examples/LazyScrollDir/English.lproj/LazyScrollDir-macintosh.nib/ 40755 1750 1750 0 6722775725 26744 5ustar sunshinesunshineMiscKit2/Examples/LazyScrollDir/English.lproj/LazyScrollDir-macintosh.nib/classes.nib100444 1750 1750 724 6713661612 31136 0ustar sunshinesunshine{ IBClasses = ( { ACTIONS = {info = id; openDirectory = id; runPageLayout = id; }; CLASS = DirController; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { ACTIONS = {destroy = id; export = id; openSelected = id; printDirectory = id; }; CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } ); IBVersion = 1; }MiscKit2/Examples/LazyScrollDir/English.lproj/LazyScrollDir-macintosh.nib/objects.nib100444 1750 1750 6647 6713661612 31164 0ustar sunshinesunshine streamtyped@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ NSApplicationi. NSMenuItemANSMenui@@@FileNSMutableArrayNSArray i@@IIi@@@@:i@DeleterNSCustomResource)NSImageNSMenuCheckmarkNSMenuMixedStateOpenOWindow Close Windoww Zoom WindowMinimize WindowmArrange in Front_NSWindowsMenu LazyScrollDirNSAppleMenuImagesubmenuAction:InfoßAbout LazyScrollDir _NSAppleMenu Directoryʄ ˟Open...o˟˟Close˟ Export...s˟˟ Page Setup...P˟Print...p˟˟QuitqEditEditCutxCopycPastevClear䟂 Select AllaFormatFormatFontFont Show FontstBoldbItalici _NSFontMenu Show ColorsCServicesServices_NSServicesMenu _NSMainMenuɽ˖˖ὖ˖˖ɖ NSFontManager ˖ DirController˖⽖˖ ˖Ö˖111д2 Font Manager21 DirController11ф1ᴖ2MainMenu File's Owner232211 NSMutableSetNSSetINSNibOutletConnectorNSNibConnector@@@delegateNSNibControlConnector-ޅ terminate:0󅄘 selectAll:0텄paste:0ꅄcopy:0煄cut:0delete:0 addFontTrait:0 addFontTrait:0orderFrontFontPanel:0info:0openDirectory:0Ӆexport:0runPageLayout:0څprintDirectory:0 orderFrontColorPanel:0 openSelected:0destroy:0х performClose:0 performZoom:0performMiniaturize:0 performClose:0arrangeInFront:F@i/)Á5(0!3DځL% V76B⁻'>8灴ށ<Z9T62ˁɁ +2@ X8H#J$́Ё,с-F R.1 4䁿/&P+ց:2Ɓׁ4N*Ӂ݁:MiscKit2/Examples/LazyScrollDir/make.sh100555 1750 1750 6027 6757227562 20312 0ustar sunshinesunshine#!/bin/sh #****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # make.sh (1999-06-09, version 1.1) # # A cross-platform compatibility build script which allows a project to # be built for both YellowBox and OpenStep for Microsoft Windows without # maintaining a distinct PB.project file for each environment. # # In OpenStep for Windows, the "make" utility was located in # $(NEXT_ROOT)/NextDeveloper/Executables. In YellowBox, "make" moved to # $(NEXT_ROOT)/Developer/Executables. Since the path to "make" is # stored in the PB.project file, this generally means that the developer # is forced to maintain two versions of PB.project; one for each # environment. # # This script (make.sh) bridges the gap between the old directory # structure and the new by dynamically determining the correct path for # "make" at build time. # # To insert this script into the build process, follow these steps: # # a) If the project is currently open in ProjectBuilder.app, close it. # b) Open the project's top-level PB.project file in a text editor. # c) Find the line which defines WINDOWS_BUILDTOOL. Its definition will # be either $NEXT_ROOT/NextDeveloper/Executables/make or # $NEXT_ROOT/Developer/Executables/make depending upon whether it # was generated by OpenStep 4.x or YellowBox. # d) Change the value of WINDOWS_BUILDTOOL to "./make.sh". # e) Place this script (make.sh) in the project's main directory. # f) Ensure that the script is executable: chmod a+x make.sh # # Project Builder uses the value of WINDOWS_BUILDTOOL to locate the # program which builds the project. By changing the value of # WINDOWS_BUILDTOOL to "./make.sh", this script is used to build the # project instead. # # Once in control, this script dynamically determines the correct path # to the "make" utility and then executes it on behalf of Project # Builder. # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ if [ -x ${NEXT_ROOT}/Developer/Executables/make.exe ]; then exec ${NEXT_ROOT}/Developer/Executables/make ${1+"$@"} elif [ -x ${NEXT_ROOT}/NextDeveloper/Executables/make.exe ]; then exec ${NEXT_ROOT}/NextDeveloper/Executables/make ${1+"$@"} elif [ -x ${NEXT_ROOT}/bin/gnumake ]; then exec ${NEXT_ROOT}/bin/gnumake ${1+"$@"} fi echo "Unable to determine location of 'make' utility." exit 1 MiscKit2/Examples/LazyScrollDir/Align.HLeft.VCentered.tiff100444 1750 1750 430 6757227567 23576 0ustar sunshinesunshineMM*J*JTVO(L-0b(-aS j?P8$ BaP (R;3 ' 'MiscKit2/Examples/LazyScrollDir/Align.HLeft.VTop.tiff100444 1750 1750 426 6757227567 22614 0ustar sunshinesunshineMM*H*J*VG$` ad9j91Ā ?P8$ BaP (R91 ' 'MiscKit2/Examples/LazyScrollDir/LazyScrollDir.ico100444 1750 1750 3066 6757227570 22266 0ustar sunshinesunshine F 0.(^( @wwwwwwwwwwwwwwpwppwppwppppwppwpwpwppppwppwppwpwpppwppwpwpppwppwpwwpwppwppppwppwwwpwwpwppwwwpwwpwppwwwpwwp( @CC{C{AUTCCC{ATCC{C{AUUTC{C{AUUTC{CC{C{B BB BB BB B( wwwwwwppwpwxpppwpwwpwpppwwpwpwwpwp( @BGGBGDGD D D MiscKit2/Examples/LazyScrollDir/LazyScrollDir.tiff100444 1750 1750 14004 6757227570 22456 0ustar sunshinesunshineMM*U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_ 00(RB ' 'MMUMUMU5TMMUMUMU5TMMUMUMU5T 0OOOOOO OUO OUUO OUO ꪯOUOꪯ OO OUUUUUUUUT 00(R@@ ' 'MiscKit2/Examples/LazyScrollDir/Defaults.h100444 1750 1750 4603 6757227552 20753 0ustar sunshinesunshine#ifndef __Defaults_h #define __Defaults_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // Defaults.h // // Simplified interface to NeXT defaults system. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: Defaults.h,v 1.1 97/03/23 01:58:34 sunshine Exp $ // $Log: Defaults.h,v $ // Revision 1.1 97/03/23 01:58:34 sunshine // v13.1: Defaults manager. // //----------------------------------------------------------------------------- #import #import @class NSColor, NSFont; @interface Defaults : NSObject + (void)set:(NSString*)def str:(NSString*)s; + (void)set:(NSString*)def int:(int)i; + (void)set:(NSString*)def float:(float)f; + (void)set:(NSString*)def color:(NSColor*)c; + (void)set:(NSString*)def bool:(BOOL)b; + (void)set:(NSString*)def font:(NSFont*)f; + (void)set:(NSString*)def size:(NSSize)s; + (void)set:(NSString*)def point:(NSPoint)p; + (void)set:(NSString*)def rect:(NSRect)r; + (NSString*) getStr: (NSString*)def fallback:(NSString*)s; + (int) getInt: (NSString*)def fallback:(int)i; + (int) getInt: (NSString*)def fallback:(int)i min:(int)n; + (int) getInt: (NSString*)def fallback:(int)i min:(int)n max:(int)x; + (float) getFloat:(NSString*)def fallback:(float)f; + (NSColor*) getColor:(NSString*)def fallback:(NSColor*)c; + (BOOL) getBool: (NSString*)def fallback:(BOOL)b; + (NSFont*) getFont: (NSString*)def fallback:(NSFont*)f; + (NSSize) getSize: (NSString*)def fallback:(NSSize)s; + (NSPoint) getPoint:(NSString*)def fallback:(NSPoint)p; + (NSRect) getRect: (NSString*)def fallback:(NSRect)r; + (void)commit; @end #endif // __Defaults_h MiscKit2/Examples/LazyScrollDir/Defaults.m100444 1750 1750 24200 6757227553 20774 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit disibution. Please refer to that file // for a list of all applicable permissions and resictions. // //============================================================================= //----------------------------------------------------------------------------- // Defaults.m // // Simplified interface to NeXT defaults system. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: Defaults.m,v 1.2 97/04/25 19:51:36 sunshine Exp $ // $Log: Defaults.m,v $ // Revision 1.2 97/04/25 19:51:36 sunshine // v14.2: assert() --> NSAssert() variations. // // Revision 1.1 97/03/23 01:58:39 sunshine // v13.1: Defaults manager. //----------------------------------------------------------------------------- #import "Defaults.h" #import #import #import #import #import #define FONT_NAME_KEY @"Name" #define FONT_SIZE_KEY @"Size" //============================================================================= // IMPLEMENTATION //============================================================================= @implementation Defaults //----------------------------------------------------------------------------- // commit //----------------------------------------------------------------------------- + (void)commit { [[NSUserDefaults standardUserDefaults] synchronize]; } //----------------------------------------------------------------------------- // set:str: //----------------------------------------------------------------------------- + (void)set:(NSString*)def str:(NSString*)s { [[NSUserDefaults standardUserDefaults] setObject:s forKey:def]; } //----------------------------------------------------------------------------- // getStr:fallback: //----------------------------------------------------------------------------- + (NSString*)getStr:(NSString*)def fallback:(NSString*)fallback { NSString* s = [[NSUserDefaults standardUserDefaults] stringForKey:def]; if (s == 0) s = fallback; return s; } //----------------------------------------------------------------------------- // set:int: //----------------------------------------------------------------------------- + (void)set:(NSString*)def int:(int)i { [[NSUserDefaults standardUserDefaults] setInteger:i forKey:def]; } //----------------------------------------------------------------------------- // getInt:fallback: //----------------------------------------------------------------------------- + (int)getInt:(NSString*)def fallback:(int)fallback { NSUserDefaults* defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey:def] != 0) return [defs integerForKey:def]; else return fallback; } //----------------------------------------------------------------------------- // getInt:fallback:min:max: //----------------------------------------------------------------------------- + (int)getInt:(NSString*)def fallback:(int)f min:(int)imin max:(int)imax { int ret; NSParameterAssert( imin <= imax ); ret = [self getInt:def fallback:f]; if (ret < imin) ret = imin; else if (ret > imax) ret = imax; return ret; } //----------------------------------------------------------------------------- // getInt:fallback:min: //----------------------------------------------------------------------------- + (int)getInt:(NSString*)def fallback:(int)fallback min:(int)imin { return [self getInt:def fallback:fallback min:imin max:INT_MAX]; } //----------------------------------------------------------------------------- // set:float: //----------------------------------------------------------------------------- + (void)set:(NSString*)def float:(float)f { [[NSUserDefaults standardUserDefaults] setFloat:f forKey:def]; } //----------------------------------------------------------------------------- // getFloat:fallback: //----------------------------------------------------------------------------- + (float)getFloat:(NSString*)def fallback:(float)fallback { NSUserDefaults* defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey:def] != 0) return [defs floatForKey:def]; else return fallback; } //----------------------------------------------------------------------------- // set:color: //----------------------------------------------------------------------------- + (void)set:(NSString*)def color:(NSColor*)c { NSData* d = [NSArchiver archivedDataWithRootObject:c]; [[NSUserDefaults standardUserDefaults] setObject:d forKey:def]; } //----------------------------------------------------------------------------- // getColor:fallback: //----------------------------------------------------------------------------- + (NSColor*)getColor:(NSString*)def fallback:(NSColor*)fallback { NSData* d = [[NSUserDefaults standardUserDefaults] dataForKey:def]; if (d != 0) return [NSUnarchiver unarchiveObjectWithData:d]; else return fallback; } //----------------------------------------------------------------------------- // set:bool: //----------------------------------------------------------------------------- + (void)set:(NSString*)def bool:(BOOL)b { [[NSUserDefaults standardUserDefaults] setBool:b forKey:def]; } //----------------------------------------------------------------------------- // getBool:fallback: //----------------------------------------------------------------------------- + (BOOL)getBool:(NSString*)def fallback:(BOOL)fallback { NSUserDefaults* defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey:def] != 0) return [defs boolForKey:def]; else return fallback; } //----------------------------------------------------------------------------- // set:font: //----------------------------------------------------------------------------- + (void)set:(NSString*)def font:(NSFont*)f { NSDictionary* d = [NSDictionary dictionaryWithObjectsAndKeys: [f fontName], FONT_NAME_KEY, [[NSNumber numberWithFloat:[f pointSize]] stringValue], FONT_SIZE_KEY, 0]; [[NSUserDefaults standardUserDefaults] setObject:d forKey:def]; } //----------------------------------------------------------------------------- // getFont:fallback: //----------------------------------------------------------------------------- + (NSFont*)getFont:(NSString*)def fallback:(NSFont*)fallback { NSFont* font = fallback; NSDictionary* d = [[NSUserDefaults standardUserDefaults] dictionaryForKey:def]; if (d != 0) { NSString* name = [d objectForKey:FONT_NAME_KEY]; if (name != 0 && [name length] > 0) { NSNumber* size = [d objectForKey:FONT_SIZE_KEY]; NSFont* new_font = [NSFont fontWithName:name size:[size floatValue]]; if (new_font != 0) font = new_font; } } return font; } //----------------------------------------------------------------------------- // set:size: //----------------------------------------------------------------------------- + (void)set:(NSString*)def size:(NSSize)s { NSString* buf = [NSString stringWithFormat:@"%g %g", s.width, s.height]; [[NSUserDefaults standardUserDefaults] setObject:buf forKey:def]; } //----------------------------------------------------------------------------- // getSize:fallback: //----------------------------------------------------------------------------- + (NSSize)getSize:(NSString*)def fallback:(NSSize)fallback { NSSize size = fallback; NSString* s = [[NSUserDefaults standardUserDefaults] stringForKey:def]; if (s != 0) { float w,h; NSScanner* scan = [NSScanner scannerWithString:s]; if ([scan scanFloat:&w] && [scan scanFloat:&h]) size = NSMakeSize( w, h ); } return size; } //----------------------------------------------------------------------------- // set:point: //----------------------------------------------------------------------------- + (void)set:(NSString*)def point:(NSPoint)p { NSString* buf = [NSString stringWithFormat:@"%g %g", p.x, p.y]; [[NSUserDefaults standardUserDefaults] setObject:buf forKey:def]; } //----------------------------------------------------------------------------- // getPoint:fallback: //----------------------------------------------------------------------------- + (NSPoint)getPoint:(NSString*)def fallback:(NSPoint)fallback { NSPoint point = fallback; NSString* s = [[NSUserDefaults standardUserDefaults] stringForKey:def]; if (s != 0) { float x,y; NSScanner* scan = [NSScanner scannerWithString:s]; if ([scan scanFloat:&x] && [scan scanFloat:&y]) point = NSMakePoint( x, y ); } return point; } //----------------------------------------------------------------------------- // set:rect: //----------------------------------------------------------------------------- + (void)set:(NSString*)def rect:(NSRect)r { NSString* buf = [NSString stringWithFormat:@"%g %g %g %g", NSMinX(r), NSMinY(r), NSWidth(r), NSHeight(r)]; [[NSUserDefaults standardUserDefaults] setObject:buf forKey:def]; } //----------------------------------------------------------------------------- // getRect:fallback: //----------------------------------------------------------------------------- + (NSRect)getRect:(NSString*)def fallback:(NSRect)fallback { NSRect rect = fallback; NSString* s = [[NSUserDefaults standardUserDefaults] stringForKey:def]; if (s != 0) { float x,y,w,h; NSScanner* scan = [NSScanner scannerWithString:s]; if ([scan scanFloat:&x] && [scan scanFloat:&y] && [scan scanFloat:&w] && [scan scanFloat:&h]) rect = NSMakeRect( x, y, w, h ); } return rect; } @end MiscKit2/Examples/LazyScrollDir/DirArray.h100444 1750 1750 4755 6757227553 20732 0ustar sunshinesunshine#ifndef __DirArray_h #define __DirArray_h //============================================================================= // // Copyright (C) 1995,1996,1997,1998 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirArray.h // // An extensible array of directory entries. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirArray.h,v 1.4 98/03/30 09:12:24 sunshine Exp $ // $Log: DirArray.h,v $ // Revision 1.4 98/03/30 09:12:24 sunshine // v18.1: Now correctly types totalBytes as unsigned long long; not size_t. // // Revision 1.3 97/06/24 07:57:50 sunshine // v15.1: Removed unused dictionary keys. Fixed bug: Wasn't taking sticky bit // into account when computing canToggleLock. // // Revision 1.2 97/04/25 19:53:04 sunshine // v14.2: Ported to OPENSTEP 4.2 (prerelease) for Mach & NT. // Completely rewrote to use NSFileManager rather than Unix directory-scanning // functions so that it works on Windows NT. //----------------------------------------------------------------------------- #import @class DirArray, NSMutableArray; extern NSString* const DA_SHORT_NAME; extern NSString* const DA_LONG_NAME; extern NSString* const DA_SOFT_LINK; extern NSString* const DA_IS_DIRECTORY; extern NSString* const DA_IS_LOCKED; extern NSString* const DA_CAN_TOGGLE_LOCK; @interface NSDictionary(DirArray) - (id)scaledImage; - (id)unscaledImage; @end @interface DirArray : NSObject { NSString* name; NSMutableArray* files; unsigned long long totalBytes; BOOL writable; BOOL sticky; NSString* username; }; - (id)init; - (void)dealloc; - (unsigned int)count; - (id)objectAtIndex:(unsigned int)n; - (BOOL)loadPath:(NSString*)path showHidden:(BOOL)flag; - (unsigned long long)totalBytes; - (BOOL)writable; - (BOOL)sticky; - (NSString*)username; @end #endif // __DirArray_h MiscKit2/Examples/LazyScrollDir/DirArray.m100444 1750 1750 22474 6757227553 20755 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirArray.m // // An extensible array of directory entries. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirArray.m,v 1.6 99/08/12 23:04:10 sunshine Exp $ // $Log: DirArray.m,v $ // Revision 1.6 99/08/12 23:04:10 sunshine // v19.1: Fixed bug: -getParent did not work correctly on Windows. // // Revision 1.5 99/06/14 17:34:31 sunshine // v19.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Worked around Foundation bug: -[NSString stringByDeletingLastPathComponent] // does not handle "/" correctly. It returns "" instead of the documented "/". // // Revision 1.4 1998/03/30 09:12:26 sunshine // v18.1: Now correctly types totalBytes as unsigned long long; not size_t. // // Revision 1.3 97/06/24 07:58:02 sunshine // v15.1: Removed unused dictionary keys. Fixed bug: Wasn't taking sticky bit // into account when computing canToggleLock. //----------------------------------------------------------------------------- #import "DirArray.h" #import #import #import #import NSString* const DA_SHORT_NAME = @"ShortName"; NSString* const DA_LONG_NAME = @"LongName"; NSString* const DA_SOFT_LINK = @"SoftLink"; NSString* const DA_IS_DIRECTORY = @"IsDirectory"; NSString* const DA_IS_LOCKED = @"IsLocked"; NSString* const DA_CAN_TOGGLE_LOCK = @"CanToggleLock"; static NSString* const DA_SCALED_ICON = @"ScaledIcon"; static NSString* const DA_UNSCALED_ICON = @"UnscaledIcon"; //============================================================================= // DirArray IMPELEMENTATION //============================================================================= @implementation DirArray - (unsigned int)count { return [files count]; } - (id)objectAtIndex:(unsigned int)n { return [files objectAtIndex:n]; } - (unsigned long long)totalBytes { return totalBytes; } - (BOOL)writable { return writable; } - (BOOL)sticky { return sticky; } - (NSString*)username { return username; } //----------------------------------------------------------------------------- // init //----------------------------------------------------------------------------- - (id)init { [super init]; name = [[NSString allocWithZone:[self zone]] init]; files = [[NSMutableArray allocWithZone:[self zone]] init]; totalBytes = 0; writable = NO; sticky = NO; username = [NSUserName() retain]; return self; } //----------------------------------------------------------------------------- // dealloc //----------------------------------------------------------------------------- - (void)dealloc { [files release]; [name release]; [username release]; [super dealloc]; } //----------------------------------------------------------------------------- // dirWritable: //----------------------------------------------------------------------------- - (BOOL)dirWritable:(NSString*)path { return [[NSFileManager defaultManager] isWritableFileAtPath:path]; } //----------------------------------------------------------------------------- // dirSticky: //----------------------------------------------------------------------------- - (BOOL)dirSticky:(NSDirectoryEnumerator*)enumerator { int const STICKY_BIT = 01000; unsigned long n = [[enumerator directoryAttributes] filePosixPermissions]; return ((n & STICKY_BIT) != 0); } //----------------------------------------------------------------------------- // getParent // Unfortunately -stringByDeletingLastPathComponent does not work as // documented when operating on a root directory. On Mach, when handed // "/", it returns "" rather than "/" as documented. On Windows, when // handed "C:\", it returns "C:" rather than "C:\" as documented. // Therefore, we use -isAbsolutePath as a sneaky way to detect this // anomalous condition. //----------------------------------------------------------------------------- - (NSString*)getParent { NSString* s = [name stringByDeletingLastPathComponent]; return ([s isAbsolutePath] ? s : name); } //----------------------------------------------------------------------------- // addFile:attributes: //----------------------------------------------------------------------------- - (void)addFile:(NSString*)file attributes:(NSDictionary*)attributes { NSFileManager* const manager = [NSFileManager defaultManager]; NSString* const longName = [file isEqualToString:@".."] ? [self getParent] : [name stringByAppendingPathComponent:file]; BOOL const canToggle = writable && ![file isEqualToString:@".."] && (!sticky || [[attributes fileOwnerAccountName] isEqualToString:username]); BOOL const isLink = [[attributes fileType] isEqualToString:NSFileTypeSymbolicLink]; NSDictionary* const deepAttributes = !isLink ? attributes : [manager fileAttributesAtPath:longName traverseLink:YES]; BOOL const isDir = [[deepAttributes fileType] isEqualToString:NSFileTypeDirectory]; NSMutableDictionary* const dict = [[attributes mutableCopy] autorelease]; [dict setObject:file forKey:DA_SHORT_NAME]; [dict setObject:longName forKey:DA_LONG_NAME]; [dict setObject:isLink ? [manager pathContentOfSymbolicLinkAtPath:longName] : @"" forKey:DA_SOFT_LINK]; [dict setObject:[NSNumber numberWithBool:isDir] forKey:DA_IS_DIRECTORY]; [dict setObject:[NSNumber numberWithBool:canToggle] forKey:DA_CAN_TOGGLE_LOCK]; [dict setObject:[NSNumber numberWithBool:!canToggle] forKey:DA_IS_LOCKED]; [files addObject:dict]; } //----------------------------------------------------------------------------- // loadPath:showHidden: //----------------------------------------------------------------------------- - (BOOL)loadPath:(NSString*)path showHidden:(BOOL)showHidden { NSFileManager* manager = [NSFileManager defaultManager]; NSDirectoryEnumerator* enumerator = [manager enumeratorAtPath:path]; [files removeAllObjects]; [name autorelease]; name = [path copyWithZone:[self zone]]; writable = [self dirWritable:path]; sticky = [self dirSticky:enumerator]; totalBytes = 0; if (enumerator != 0) { NSString* file; [self addFile:@".." attributes: [manager fileAttributesAtPath:[self getParent] traverseLink:NO]]; while ((file = [enumerator nextObject]) != 0) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSDictionary* attributes = [enumerator fileAttributes]; if (showHidden || [file characterAtIndex:0] != '.') { totalBytes += [attributes fileSize]; [self addFile:file attributes:attributes]; } if ([[attributes fileType] isEqualToString:NSFileTypeDirectory]) [enumerator skipDescendents]; [pool release]; } } return (enumerator != 0); } @end //============================================================================= // NSMutableDictionary(DirArray) IMPLEMENTATION //============================================================================= @interface NSMutableDictionary(DirArray) - (void)loadImages; @end @implementation NSMutableDictionary(DirArray) //----------------------------------------------------------------------------- // loadImages //----------------------------------------------------------------------------- - (void)loadImages { NSImage* image; NSString* name = [self objectForKey:DA_LONG_NAME]; NSParameterAssert( name != 0 ); image = [[NSWorkspace sharedWorkspace] iconForFile:name]; [self setObject:[[image copy] autorelease] forKey:DA_UNSCALED_ICON]; [image setScalesWhenResized:YES]; [self setObject:image forKey:DA_SCALED_ICON]; } @end //============================================================================= // NSDictionary(DirArray) IMPLEMENTATION //============================================================================= @implementation NSDictionary(DirArray) //----------------------------------------------------------------------------- // getImage: //----------------------------------------------------------------------------- - (id)getImage:(NSString*)key { id image = 0; if ([self isKindOfClass:[NSMutableDictionary class]]) { if ([self objectForKey:key] == 0) [(NSMutableDictionary*)self loadImages]; image = [self objectForKey:key]; } return image; } //----------------------------------------------------------------------------- // [un]scaledImage //----------------------------------------------------------------------------- - (id)scaledImage { return [self getImage:DA_SCALED_ICON ]; } - (id)unscaledImage { return [self getImage:DA_UNSCALED_ICON]; } @end MiscKit2/Examples/LazyScrollDir/DirController.h100444 1750 1750 3470 6757227553 21770 0ustar sunshinesunshine#ifndef __DirController_h #define __DirController_h //============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirController.h // // Manages application which demonstrates use of TableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirController.h,v 1.2 99/06/14 17:35:40 sunshine Exp $ // $Log: DirController.h,v $ // Revision 1.2 99/06/14 17:35:40 sunshine // v19.1: Ported to MacOS/X Server DR2 for Mach and Windows. // For clarity renamed -new: to -openDirectory:. // // Revision 1.1 1997/03/23 01:59:08 sunshine // v13.1: Application controller. //----------------------------------------------------------------------------- #import @class NSNotification, NSPanel, NSText; @interface DirController : NSObject { NSPanel* infoPanel; NSText* infoText; } - (id)init; - (void)dealloc; - (void)applicationDidFinishLaunching:(NSNotification*)n; - (void)applicationWillTerminate:(NSNotification*)n; - (void)openDirectory:(id)sender; - (void)info:(id)sender; @end #endif // __DirController_h MiscKit2/Examples/LazyScrollDir/DirController.m100444 1750 1750 10356 6757227554 22017 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirController.m // // Manages application which demonstrates use of TableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirController.m,v 1.2 99/06/14 17:35:36 sunshine Exp $ // $Log: DirController.m,v $ // Revision 1.2 99/06/14 17:35:36 sunshine // v19.1: Ported to MacOS/X Server DR2 for Mach and Windows. // For clarity renamed -new: to -openDirectory:. // // Revision 1.1 1997/03/23 01:59:13 sunshine // v13.1: Application controller. //----------------------------------------------------------------------------- #import "DirController.h" #import "Defaults.h" #import "DirWindow.h" #import "SD_PageLayout.h" #import #import #import @implementation DirController //----------------------------------------------------------------------------- // - init //----------------------------------------------------------------------------- - (id)init { [super init]; infoPanel = 0; return self; } //----------------------------------------------------------------------------- // - dealloc //----------------------------------------------------------------------------- - (void)dealloc { if (infoPanel) [infoPanel release]; [super dealloc]; } //----------------------------------------------------------------------------- // - applicationDidFinishLaunching: //----------------------------------------------------------------------------- - (void)applicationDidFinishLaunching:(NSNotification*)n { [DirWindow launchDir:0]; } //----------------------------------------------------------------------------- // - applicationWillTerminate: //----------------------------------------------------------------------------- - (void)applicationWillTerminate:(NSNotification*)n { [Defaults commit]; } //----------------------------------------------------------------------------- // - runPageLayout: //----------------------------------------------------------------------------- - (void)runPageLayout:(id)sender { [[SD_PageLayout pageLayout] runModal]; } //----------------------------------------------------------------------------- // - openDirectory: //----------------------------------------------------------------------------- - (void)openDirectory:(id)sender { static NSOpenPanel* panel = 0; if (panel == 0) { panel = [[NSOpenPanel openPanel] retain]; [panel setTitle:@"Open Directory"]; [panel setPrompt:@"Directory:"]; [panel setCanChooseDirectories:YES]; [panel setCanChooseFiles:NO]; [panel setAllowsMultipleSelection:YES]; [panel setTreatsFilePackagesAsDirectories:YES]; } if ([panel runModal] == NSOKButton) { unsigned int i; NSArray* filenames = [panel filenames]; for (i = [filenames count]; i-- > 0; ) [DirWindow launchDir:[filenames objectAtIndex:i]]; } } //----------------------------------------------------------------------------- // - info: //----------------------------------------------------------------------------- - (void)info:(id)sender { if (infoPanel == 0) { NSString* s; [NSBundle loadNibNamed:@"Info" owner:self]; s = [[NSBundle bundleForClass:[self class]] pathForResource:@"README" ofType:@"rtf"]; if (s == 0) s = [[NSBundle bundleForClass:[self class]] pathForResource:@"README" ofType:@"rtfd"]; if (s != 0) [infoText readRTFDFromFile:s]; } [infoPanel makeKeyAndOrderFront:self]; } @end MiscKit2/Examples/LazyScrollDir/DirWindow.h100444 1750 1750 4364 6757227600 21110 0ustar sunshinesunshine#ifndef __DirWindow_h #define __DirWindow_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirWindow.h // // Manages window which displays directory listing. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirWindow.h,v 1.3 97/11/24 19:50:45 sunshine Exp $ // $Log: DirWindow.h,v $ // Revision 1.3 97/11/24 19:50:45 sunshine // v17.1: Fixed bug: Menu was sending -print: to first-responder even though // any control can be first-responder, rather than just MiscTableScroll. // Added row-numbers switch. Adjusted initial cascade position for NT. // // Revision 1.2 97/04/25 20:02:50 sunshine // v14.2: Now uses NSArray for lazyRow. // // Revision 1.1 97/03/23 01:59:18 sunshine // v13.1: Browser window. //----------------------------------------------------------------------------- #import @class DirArray, MiscTableScroll, NSArray, NSButton, NSTextField, NSWindow; @interface DirWindow : NSObject { MiscTableScroll* scroll; NSWindow* window; NSButton* autoSortSwitch; NSButton* cdButton; NSButton* dragUnscaledSwitch; NSButton* hiddenFilesSwitch; NSButton* highlightSwitch; NSButton* refreshButton; NSButton* rowNumbersSwitch; NSTextField* countField; NSString* path; BOOL autoSort; BOOL dragUnscaled; BOOL highlightDirs; BOOL showHidden; DirArray* dirArray; NSArray* lazyRow; } + (void)launchDir:(NSString*)dirname; @end #endif // __DirWindow_h MiscKit2/Examples/LazyScrollDir/DirWindow.m100444 1750 1750 122454 6757227600 21156 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1995-1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirWindow.m // // Manages window which displays directory listing. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirWindow.m,v 1.8 99/06/14 17:41:57 sunshine Exp $ // $Log: DirWindow.m,v $ // Revision 1.8 99/06/14 17:41:57 sunshine // v19.1: Ported to MacOS/X Server DR2 for Mach and Windows. // For clarity, renamed: -open: to -openSelected: & -save: to -export:. // Now prompts user for confirmation before deleting files in -destroy:. // Numerous MiscTableScroll delegate methods changed to notification style. // Fixed bug: Was responding to -tableScrollFontChanged: rather than // -tableScrollChangeFont:. The latter is sent in response to user-initiated // font changes, which is what we are interested in. // For naming consistency, renamed: -didClick: to -scrollClick: & // -didDoubleClick: to -scrollDoubleClick:. This is more consistent with // other methods such as -lockClick:. // Fixed bug: Attributes displayed for ".." were actually those of ".". // Fixed bug: -destroy: was mis-using result of -selectedRows and consequently // deleting the wrong files. // Fixed bug: Computed full pathname (DA_LONG_NAME) was incorrect for "..". // It should have been the current directory's parent, but was instead just // the current directory. The result was that double-click on ".." failed. // Fixed -cdPressed: to use DA_LONG_NAME rather than constructing the long // name manually from DA_SHORT_NAME and the current path. // // Revision 1.7 1998/03/30 00:19:19 sunshine // v18.1: Wasn't respecting selected-text color. Problem was cell's "owner" // was never getting set. // Now uses NSColor's "system" color by default for window rather than // hard-wired light-gray. // Added -tableScrollIgnoreModifierKeysWhileDragging: returning NO. // Had to implement -tableScroll:draggingSourceOperationMaskForLocal: since // in MiscTableScroll v126.1 the default changed from "copy" to "generic". // // Revision 1.6 97/11/24 19:50:47 sunshine // v17.1: Fixed bug: Menu was sending -print: to first-responder even though // any control can be first-responder, rather than just MiscTableScroll. // Added row-numbers switch. Adjusted initial cascade position for NT. //----------------------------------------------------------------------------- #import "DirWindow.h" #import "Defaults.h" #import "DirArray.h" #import #import #import #import #import #import #import #import #import #import #import #import #import // MS-Windows doesn't define these: #ifndef S_ISUID # define S_ISUID 0004000 /* Set user id on execution */ #endif #ifndef S_ISGID # define S_ISGID 0002000 /* Set group id on execution */ #endif #ifndef S_ISVTX # define S_ISVTX 0001000 /* Save swapped text even after use */ #endif enum { ICON_SLOT, NAME_SLOT, LOCK_SLOT, SIZE_SLOT, MODIFIED_SLOT, PERMS_SLOT, OWNER_SLOT, GROUP_SLOT, HARDLINKS_SLOT, SOFTLINK_SLOT, MAX_SLOT }; static int const CASCADE_MAX = 10; static int CASCADE_COUNTER = 0; static float CASCADE_ORIGIN_X; static float CASCADE_ORIGIN_Y; static float CASCADE_DELTA_X; static float CASCADE_DELTA_Y; static BOOL DEFAULT_AUTO_SORT; static BOOL DEFAULT_ROW_NUMBERS; static BOOL DEFAULT_SHOW_HIDDEN; static BOOL DEFAULT_HIGHLIGHT_DIRS; static BOOL DEFAULT_DRAG_UNSCALED; static NSColor* DEFAULT_COLOR; static NSSize DEFAULT_WIN_SIZE; static NSFont* DEFAULT_FONT; static NSMutableArray* OPEN_DIRS = 0; static NSImage* LOCKED_IMAGE = 0; static NSImage* UNLOCKED_IMAGE = 0; static NSString* const COLOR_DEF = @"DirColor"; static NSString* const SIZE_DEF = @"DirSize"; static NSString* const FONT_DEF = @"DirFont"; static NSString* const SORT_DEF = @"AutoSort"; static NSString* const HIDDEN_DEF = @"ShowHidden"; static NSString* const HLIGHT_DEF = @"HighlightDirs"; static NSString* const UNSCALED_DEF = @"DragUnscaled"; static NSString* const COL_SIZES_DEF = @"ColSizes"; static NSString* const COL_ORDER_DEF = @"ColOrder"; static NSString* const ROW_NUMBERS_DEF = @"RowNumbers"; static NSString* const LOCKED_IMAGE_S = @"Lock.secure"; static NSString* const UNLOCKED_IMAGE_S = @"Lock.insecure"; //----------------------------------------------------------------------------- // NOTE: USE_PRIVATE_ZONE // When set to '1', this program will place each window in a separate // NSZone and destroy the zone when the window is closed. When set to // '0' windows are placed in the NSDefaultMallocZone(). //----------------------------------------------------------------------------- #define USE_PRIVATE_ZONE 1 #if USE_PRIVATE_ZONE # define EMPLOY_ZONE() NSCreateZone( NSPageSize(), NSPageSize(), YES ) # define RETIRE_ZONE(Z) NSRecycleZone(Z) #else # define EMPLOY_ZONE() NSDefaultMallocZone() # define RETIRE_ZONE(Z) (void)(Z) #endif //----------------------------------------------------------------------------- // normalize_path //----------------------------------------------------------------------------- static inline NSString* normalize_path( NSString* buff ) { return [buff stringByStandardizingPath]; } //----------------------------------------------------------------------------- // str_date //----------------------------------------------------------------------------- static NSString* str_date( NSDate* d ) { return [d descriptionWithCalendarFormat:@"%m/%d/%y %H:%M" timeZone:0 locale:0]; } //----------------------------------------------------------------------------- // str_perms //----------------------------------------------------------------------------- static NSString* str_perms( unsigned long mode, NSString* file_type ) { char c; NSMutableString* s = [NSMutableString string]; if ([file_type isEqualToString:NSFileTypeDirectory]) c = 'd'; else if ([file_type isEqualToString:NSFileTypeCharacterSpecial]) c = 'c'; else if ([file_type isEqualToString:NSFileTypeBlockSpecial]) c = 'b'; else if ([file_type isEqualToString:NSFileTypeRegular]) c = '-'; else if ([file_type isEqualToString:NSFileTypeSymbolicLink]) c = 'l'; else if ([file_type isEqualToString:NSFileTypeSocket]) c = 's'; else c = '?'; [s appendFormat:@"%c", c]; [s appendFormat:@"%c", (mode & 0400) ? 'r' : '-']; [s appendFormat:@"%c", (mode & 0200) ? 'w' : '-']; [s appendFormat:@"%c", (mode & S_ISUID) ? 's' : (mode & 0100) ? 'x' : '-']; [s appendFormat:@"%c", (mode & 0040) ? 'r' : '-']; [s appendFormat:@"%c", (mode & 0020) ? 'w' : '-']; [s appendFormat:@"%c", (mode & S_ISGID) ? 's' : (mode & 0010) ? 'x' : '-']; [s appendFormat:@"%c", (mode & 0004) ? 'r' : '-']; [s appendFormat:@"%c", (mode & 0002) ? 'w' : '-']; [s appendFormat:@"%c", (mode & S_ISVTX) ? 't' : (mode & 0001) ? 'x' : '-']; return s; } //----------------------------------------------------------------------------- // fmt_icon //----------------------------------------------------------------------------- static void fmt_icon( MiscTableScroll* ts, NSDictionary* dict, id cell ) { float h,w,s; NSImage* i = [dict scaledImage]; w = [ts columnSize:ICON_SLOT]; if (w == 0) w = 18; h = [ts uniformSizeRows]; if (h == 0) h = 18; s = (w < h ? w : h) - 1.0; [i setSize:NSMakeSize( s, s )]; [cell setImage:i]; } //----------------------------------------------------------------------------- // fmt_lock //----------------------------------------------------------------------------- static void fmt_lock( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setState:![[dict objectForKey:DA_IS_LOCKED] boolValue]]; [cell setEnabled:[[dict objectForKey:DA_CAN_TOGGLE_LOCK] boolValue]]; } //----------------------------------------------------------------------------- // fmt_name //----------------------------------------------------------------------------- static void fmt_name( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setStringValue:[dict objectForKey:DA_SHORT_NAME]]; } //----------------------------------------------------------------------------- // fmt_size //----------------------------------------------------------------------------- static void fmt_size( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setIntValue:[dict fileSize]]; } //----------------------------------------------------------------------------- // fmt_modified //----------------------------------------------------------------------------- static void fmt_modified( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setStringValue:str_date( [dict fileModificationDate] )]; } //----------------------------------------------------------------------------- // fmt_perms //----------------------------------------------------------------------------- static void fmt_perms( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setStringValue: str_perms( [dict filePosixPermissions], [dict fileType])]; } //----------------------------------------------------------------------------- // fmt_owner //----------------------------------------------------------------------------- static void fmt_owner( MiscTableScroll* ts, NSDictionary* dict, id cell ) { NSString* s = [dict fileOwnerAccountName]; [cell setStringValue:(s != 0 ? s : @"")]; } //----------------------------------------------------------------------------- // fmt_group //----------------------------------------------------------------------------- static void fmt_group( MiscTableScroll* ts, NSDictionary* dict, id cell ) { NSString* s = [dict fileGroupOwnerAccountName]; [cell setStringValue:(s != 0 ? s : @"")]; } //----------------------------------------------------------------------------- // fmt_hardlinks //----------------------------------------------------------------------------- static void fmt_hardlinks( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setIntValue: [[dict objectForKey:NSFileReferenceCount] unsignedLongValue]]; } //----------------------------------------------------------------------------- // fmt_softlink //----------------------------------------------------------------------------- static void fmt_softlink( MiscTableScroll* ts, NSDictionary* dict, id cell ) { [cell setStringValue:[dict objectForKey:DA_SOFT_LINK]]; } //----------------------------------------------------------------------------- // FORMAT_FUNC //----------------------------------------------------------------------------- typedef void (*FormatFunc)( MiscTableScroll*, NSDictionary*, id ); static FormatFunc FORMAT_FUNC[ MAX_SLOT ] = { fmt_icon, // ICON_SLOT, fmt_name, // NAME_SLOT, fmt_lock, // LOCK_SLOT, fmt_size, // SIZE_SLOT, fmt_modified, // MODIFIED_SLOT, fmt_perms, // PERMS_SLOT, fmt_owner, // OWNER_SLOT, fmt_group, // GROUP_SLOT, fmt_hardlinks, // HARDLINKS_SLOT, fmt_softlink, // SOFTLINK_SLOT, }; //----------------------------------------------------------------------------- // format_cell //----------------------------------------------------------------------------- static inline void format_cell( MiscTableScroll* ts, NSDictionary* dict, id cell, unsigned int col ) { FORMAT_FUNC[ col ]( ts, dict, cell ); } //============================================================================= // IMPLEMENTATION //============================================================================= @implementation DirWindow //----------------------------------------------------------------------------- // + initCascader //----------------------------------------------------------------------------- + (void)initCascader { NSSize const s = [[NSScreen mainScreen] frame].size; CASCADE_ORIGIN_X = s.width / 4; CASCADE_ORIGIN_Y = s.height - 60; CASCADE_DELTA_X = 20; CASCADE_DELTA_Y = 20; } //----------------------------------------------------------------------------- // + initialize //----------------------------------------------------------------------------- + (void)initialize { if (self == [DirWindow class]) { [self initCascader]; OPEN_DIRS = [[NSMutableArray alloc] init]; LOCKED_IMAGE = [[NSImage imageNamed:LOCKED_IMAGE_S] retain]; UNLOCKED_IMAGE = [[NSImage imageNamed:UNLOCKED_IMAGE_S] retain]; DEFAULT_COLOR = [[Defaults getColor:COLOR_DEF fallback:[NSColor controlColor]] retain]; DEFAULT_AUTO_SORT = [Defaults getBool:SORT_DEF fallback:NO]; DEFAULT_SHOW_HIDDEN = [Defaults getBool:HIDDEN_DEF fallback:NO]; DEFAULT_ROW_NUMBERS = [Defaults getBool:ROW_NUMBERS_DEF fallback:NO]; DEFAULT_HIGHLIGHT_DIRS = [Defaults getBool:HLIGHT_DEF fallback:NO]; DEFAULT_DRAG_UNSCALED = [Defaults getBool:UNSCALED_DEF fallback:YES]; } } //----------------------------------------------------------------------------- // - cascade //----------------------------------------------------------------------------- - (void)cascade { float top,left; left = CASCADE_ORIGIN_X + (CASCADE_DELTA_X * CASCADE_COUNTER); top = CASCADE_ORIGIN_Y - (CASCADE_DELTA_Y * CASCADE_COUNTER); [window setFrameTopLeftPoint:NSMakePoint( left, top )]; if (++CASCADE_COUNTER >= CASCADE_MAX) CASCADE_COUNTER = 0; } //----------------------------------------------------------------------------- // - isDir: //----------------------------------------------------------------------------- - (BOOL)isDir:(int)r { return [[[dirArray objectAtIndex:r] objectForKey:DA_IS_DIRECTORY] boolValue]; } //----------------------------------------------------------------------------- // - updateButtons //----------------------------------------------------------------------------- - (void)updateButtons { BOOL const enable = [scroll numberOfSelectedRows] == 1 && [self isDir:[scroll selectedRow]]; if (enable != [cdButton isEnabled]) [cdButton setEnabled:enable]; } //----------------------------------------------------------------------------- // - scrollColor //----------------------------------------------------------------------------- - (NSColor*)scrollColor { if ([DEFAULT_COLOR isEqual:[NSColor controlColor]]) return [MiscTableScroll defaultBackgroundColor]; else return DEFAULT_COLOR; } //----------------------------------------------------------------------------- // - tableScroll:cellAtRow:column: //----------------------------------------------------------------------------- - (id)tableScroll:(MiscTableScroll*)ts cellAtRow:(int)row column:(int)col { id cell = [lazyRow objectAtIndex:col]; NSDictionary* dict = [dirArray objectAtIndex:row]; format_cell( ts, dict, cell, col ); if ([cell respondsToSelector:@selector(setBackgroundColor:)]) { if (highlightDirs && [self isDir:row]) [cell setBackgroundColor:[NSColor cyanColor]]; else [cell setBackgroundColor:[ts backgroundColor]]; } return cell; } //----------------------------------------------------------------------------- // - tableScroll:stringValueAtRow:column: //----------------------------------------------------------------------------- - (NSString*)tableScroll:(MiscTableScroll*)ts stringValueAtRow:(int)r column:(int)c { NSString* rc = 0; if (r < [dirArray count]) { NSDictionary* dict = [dirArray objectAtIndex:r]; switch (c) { case SIZE_SLOT: rc = [[dict objectForKey:NSFileSize] stringValue]; break; case MODIFIED_SLOT: rc = str_date( [dict fileModificationDate] ); break; case PERMS_SLOT: rc = str_perms( [dict filePosixPermissions], [dict fileType] ); break; case OWNER_SLOT: rc = [dict fileOwnerAccountName]; break; case GROUP_SLOT: rc = [dict fileGroupOwnerAccountName]; break; case HARDLINKS_SLOT: rc = [[dict objectForKey:NSFileReferenceCount] stringValue]; break; case NAME_SLOT: rc = [dict objectForKey:DA_SHORT_NAME]; break; case SOFTLINK_SLOT: rc = [dict objectForKey:DA_SOFT_LINK]; break; case ICON_SLOT: case LOCK_SLOT: default: rc = @""; break; } } return (rc != 0 ? rc : @""); // Owner or group may have returned nil. } //----------------------------------------------------------------------------- // -intValueAtRow:column: //----------------------------------------------------------------------------- - (int)intValueAtRow:(int)r column:(int)c { int rc = 0; if (r < [dirArray count]) { NSDictionary* dict = [dirArray objectAtIndex:r]; switch (c) { case LOCK_SLOT: rc = [[dict objectForKey:DA_IS_LOCKED] intValue]; break; case SIZE_SLOT: rc = [dict fileSize]; break; case MODIFIED_SLOT: rc = [[dict fileModificationDate] timeIntervalSinceReferenceDate]; break; case PERMS_SLOT: rc = [dict filePosixPermissions]; break; case HARDLINKS_SLOT: rc = [[dict objectForKey:NSFileReferenceCount] intValue]; break; case OWNER_SLOT: case GROUP_SLOT: case ICON_SLOT: case NAME_SLOT: case SOFTLINK_SLOT: default: break; } } return rc; } //----------------------------------------------------------------------------- // - tableScroll:intValueAtRow:column: //----------------------------------------------------------------------------- - (int)tableScroll:(MiscTableScroll*)ts intValueAtRow:(int)r column:(int)c { return [self intValueAtRow:r column:c]; } //----------------------------------------------------------------------------- // - tableScroll:tagAtRow:column: //----------------------------------------------------------------------------- - (int)tableScroll:(MiscTableScroll*)ts tagAtRow:(int)r column:(int)c { return [self intValueAtRow:r column:c]; } //----------------------------------------------------------------------------- // - tableScroll:stateAtRow:column: //----------------------------------------------------------------------------- - (int)tableScroll:(MiscTableScroll*)ts stateAtRow:(int)r column:(int)c { return [self intValueAtRow:r column:c]; } //----------------------------------------------------------------------------- // - tableScrollChangeFont: //----------------------------------------------------------------------------- - (void)tableScrollChangeFont:(NSNotification*)n { NSFont* newFont = (NSFont*)[[n userInfo] objectForKey:@"NewFont"]; int col; for (col = 0; col < MAX_SLOT; col++) [[lazyRow objectAtIndex:col] setFont:newFont]; [DEFAULT_FONT autorelease]; DEFAULT_FONT = [newFont retain]; [Defaults set:FONT_DEF font:DEFAULT_FONT]; } //----------------------------------------------------------------------------- // - tableScrollSlotResized: //----------------------------------------------------------------------------- - (void)tableScrollSlotResized:(NSNotification*)n { [Defaults set:COL_SIZES_DEF str:[scroll columnSizesAsString]]; } //----------------------------------------------------------------------------- // saveSlotOrder: //----------------------------------------------------------------------------- - (void)saveSlotOrder:(NSNotification*)n { MiscBorderType const b = (MiscBorderType)[[[n userInfo] objectForKey:@"Border"] intValue]; if (b == MISC_COL_BORDER) [Defaults set:COL_ORDER_DEF str:[scroll columnOrderAsString]]; } //----------------------------------------------------------------------------- // - tableScrollSlotDragged: //----------------------------------------------------------------------------- - (void)tableScrollSlotDragged:(NSNotification*)n { [self saveSlotOrder:n]; } //----------------------------------------------------------------------------- // - tableScrollSlotSortReversed: //----------------------------------------------------------------------------- - (void)tableScrollSlotSortReversed:(NSNotification*)n { [self saveSlotOrder:n]; } //----------------------------------------------------------------------------- // - tableScroll:canEdit:atRow:column: //----------------------------------------------------------------------------- - (BOOL)tableScroll:(MiscTableScroll*)ts canEdit:(NSEvent*)ev atRow:(int)row column:(int)col { return ((ev == 0 || [ev clickCount] == 2) && col == NAME_SLOT && ![[[dirArray objectAtIndex:row] objectForKey:DA_IS_LOCKED] boolValue]); } //----------------------------------------------------------------------------- // - tableScroll:setStringValue:atRow:column: //----------------------------------------------------------------------------- - (BOOL)tableScroll:(MiscTableScroll*)ts setStringValue:(NSString*)s atRow:(int)row column:(int)col { NSMutableDictionary* dict = [dirArray objectAtIndex:row]; [dict setObject:s forKey:DA_SHORT_NAME]; [dict setObject:[path stringByAppendingPathComponent:s] forKey:DA_LONG_NAME]; return YES; } //----------------------------------------------------------------------------- // -tableScroll:draggingSourceOperationMaskForLocal: //----------------------------------------------------------------------------- - (unsigned int)tableScroll:(MiscTableScroll*)s draggingSourceOperationMaskForLocal:(BOOL)isLocal { return NSDragOperationAll; } //----------------------------------------------------------------------------- // tableScrollIgnoreModifierKeysWhileDragging: //----------------------------------------------------------------------------- - (BOOL)tableScrollIgnoreModifierKeysWhileDragging:(MiscTableScroll*)s { return NO; } //----------------------------------------------------------------------------- // - tableScroll:preparePasteboard:forDragOperationAtRow:column: //----------------------------------------------------------------------------- - (void)tableScroll:(MiscTableScroll*)s preparePasteboard:(NSPasteboard*)pb forDragOperationAtRow:(int)r column:(int)c { NSString* file = [[dirArray objectAtIndex:r] objectForKey:DA_LONG_NAME]; [pb declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:0]; [pb setPropertyList:[NSArray arrayWithObject:file] forType:NSFilenamesPboardType]; } //----------------------------------------------------------------------------- // - tableScroll:allowDragOperationAtRow:column: //----------------------------------------------------------------------------- - (BOOL)tableScroll:(MiscTableScroll*)s allowDragOperationAtRow:(int)r column:(int)c { return (c == ICON_SLOT); } //----------------------------------------------------------------------------- // - tableScroll:imageForDragOperationAtRow:column: //----------------------------------------------------------------------------- - (NSImage*)tableScroll:(MiscTableScroll*)s imageForDragOperationAtRow:(int)r column:(int)c { NSDictionary* dict = [dirArray objectAtIndex:r]; return (dragUnscaled ? [dict unscaledImage] : [dict scaledImage]); } //----------------------------------------------------------------------------- // - fillScroll //----------------------------------------------------------------------------- - (void)fillScroll { [scroll renewRows:[dirArray count]]; if ([scroll autoSortRows]) [scroll sortRows]; [countField setStringValue: [NSString stringWithFormat:@"%d files %lu bytes", [dirArray count], [dirArray totalBytes]]]; [self updateButtons]; } //----------------------------------------------------------------------------- // - setPath: //----------------------------------------------------------------------------- - (void)setPath:(NSString*)dirname { [path autorelease]; if (dirname == 0) dirname = NSHomeDirectory(); if ([dirname length] == 0) dirname = @"/"; path = [dirname retain]; [window setTitleWithRepresentedFilename:path]; } //----------------------------------------------------------------------------- // - loadDirectory: //----------------------------------------------------------------------------- - (void)loadDirectory:(NSString*)dirname { if (![dirArray loadPath:dirname showHidden:showHidden]) NSRunAlertPanel( @"Can't Read", @"Cannot read directory, %@", @"OK", 0, 0, path ); } //----------------------------------------------------------------------------- // - reload //----------------------------------------------------------------------------- - (void)reload { [scroll abortEditing]; [self loadDirectory:path]; [self fillScroll]; } //----------------------------------------------------------------------------- // - load: //----------------------------------------------------------------------------- - (void)load:(NSString*)dirname { [self setPath:dirname]; [self reload]; } //----------------------------------------------------------------------------- // - export: //----------------------------------------------------------------------------- - (void)export:(id)sender { [[MiscExporter commonInstance] exportTableScroll:scroll]; } //----------------------------------------------------------------------------- // - printDirectory: //----------------------------------------------------------------------------- - (void)printDirectory:(id)sender { [scroll print:self]; } //----------------------------------------------------------------------------- // - openSelected: //----------------------------------------------------------------------------- - (void)openSelected:(id)sender { if ([scroll hasRowSelection]) { int i; NSArray* list = [scroll selectedRows]; for (i = [list count]; i-- > 0; ) { int const r = [[list objectAtIndex:i] intValue]; NSString* s = [[dirArray objectAtIndex:r] objectForKey:DA_LONG_NAME]; if ([self isDir:r]) [[self class] launchDir:s]; else [[NSWorkspace sharedWorkspace] openFile:s]; } } } //----------------------------------------------------------------------------- // - destroy: //----------------------------------------------------------------------------- - (void)destroy:(id)sender { if ([dirArray writable] && [scroll hasRowSelection]) { if (NSRunAlertPanel( @"Delete Files", @"Delete selected files?", @"Yes", @"No", 0 ) == NSAlertDefaultReturn) { int i; NSArray* list = [scroll selectedRows]; NSFileManager* manager = [NSFileManager defaultManager]; for (i = [list count]; i-- > 0; ) { int const row = [[list objectAtIndex:i] intValue]; [manager removeFileAtPath:[[dirArray objectAtIndex:row] objectForKey:DA_LONG_NAME] handler:0]; } [self reload]; } } } //----------------------------------------------------------------------------- // - fileManager:shouldProceedAfterError: //----------------------------------------------------------------------------- - (BOOL)fileManager:(NSFileManager*)manager shouldProceedAfterError:(NSDictionary*)errorInfo { NSRunAlertPanel( @"Error", @"Rename failed: %@.", @"OK", 0, 0, [errorInfo objectForKey:@"Error"]); return NO; } //----------------------------------------------------------------------------- // - rename:to: //----------------------------------------------------------------------------- - (BOOL)rename:(NSString*)oldName to:(NSString*)newName { return [[NSFileManager defaultManager] movePath:[path stringByAppendingPathComponent:oldName] toPath:[path stringByAppendingPathComponent:newName] handler:self]; } //----------------------------------------------------------------------------- // - control:textShouldEndEditing: //----------------------------------------------------------------------------- - (BOOL)control:(NSControl*)control textShouldEndEditing:(NSText*)fieldEditor { BOOL accept = YES; NSString* oldName; NSString* newName; int const r = [scroll clickedRow]; int const c = [scroll clickedColumn]; NSParameterAssert( c == NAME_SLOT ); oldName = [[dirArray objectAtIndex:r] objectForKey:DA_SHORT_NAME]; newName = [fieldEditor string]; if (![newName isEqualToString:oldName]) accept = [self rename:oldName to:newName]; if (!accept) [fieldEditor setString:oldName]; return accept; } //----------------------------------------------------------------------------- // - refreshPressed: //----------------------------------------------------------------------------- - (void)refreshPressed:(id)sender { [self reload]; } //----------------------------------------------------------------------------- // - cdPressed: //----------------------------------------------------------------------------- - (void)cdPressed:(id)sender { [scroll abortEditing]; if ([scroll numberOfSelectedRows] == 1) { MiscCoord_P const r = [scroll selectedRow]; if ([self isDir:r]) [self load:[[dirArray objectAtIndex:r] objectForKey:DA_LONG_NAME]]; } } //----------------------------------------------------------------------------- // - rowNumbersClick: //----------------------------------------------------------------------------- - (void)rowNumbersClick:(id)sender { BOOL const newVal = ([rowNumbersSwitch state] != 0); BOOL const oldVal = [scroll rowTitlesOn]; if (newVal != oldVal) { DEFAULT_ROW_NUMBERS = newVal; [scroll setRowTitlesOn:DEFAULT_ROW_NUMBERS]; [Defaults set:ROW_NUMBERS_DEF bool:DEFAULT_ROW_NUMBERS]; } } //----------------------------------------------------------------------------- // - autoSortClick: //----------------------------------------------------------------------------- - (void)autoSortClick:(id)sender { BOOL const switchState = [autoSortSwitch state]; [scroll abortEditing]; if (autoSort != switchState) { DEFAULT_AUTO_SORT = autoSort = switchState; [Defaults set:SORT_DEF bool:DEFAULT_AUTO_SORT]; [scroll setAutoSortRows:switchState]; if (switchState) [scroll sortRows]; } } //----------------------------------------------------------------------------- // - hiddenFilesClick: //----------------------------------------------------------------------------- - (void)hiddenFilesClick:(id)sender { BOOL const switchState = [hiddenFilesSwitch state]; [scroll abortEditing]; if (showHidden != switchState) { DEFAULT_SHOW_HIDDEN = showHidden = switchState; [Defaults set:HIDDEN_DEF bool:DEFAULT_SHOW_HIDDEN]; [self reload]; } } //----------------------------------------------------------------------------- // - highlightClick: //----------------------------------------------------------------------------- - (void)highlightClick:(id)sender { BOOL const switchState = [highlightSwitch state]; [scroll abortEditing]; if (highlightDirs != switchState) { DEFAULT_HIGHLIGHT_DIRS = highlightDirs = switchState; [Defaults set:HLIGHT_DEF bool:DEFAULT_HIGHLIGHT_DIRS]; [scroll setNeedsDisplay:YES]; } } //----------------------------------------------------------------------------- // - dragUnscaledClick: //----------------------------------------------------------------------------- - (void)dragUnscaledClick:(id)sender { BOOL const switchState = [dragUnscaledSwitch state]; if (dragUnscaled != switchState) { DEFAULT_DRAG_UNSCALED = dragUnscaled = switchState; [Defaults set:UNSCALED_DEF bool:DEFAULT_DRAG_UNSCALED]; } } //----------------------------------------------------------------------------- // - lockClick: //----------------------------------------------------------------------------- - (void)lockClick:(id)sender { int const row = [sender clickedRow]; NSMutableDictionary* dict = [dirArray objectAtIndex:row]; if ([[dict objectForKey:DA_CAN_TOGGLE_LOCK] boolValue]) { BOOL const wasLocked = [[dict objectForKey:DA_IS_LOCKED] boolValue]; [dict setObject:[NSNumber numberWithBool:!wasLocked] forKey:DA_IS_LOCKED]; if ([sender autoSortRows]) [sender sortRow:row]; } } //----------------------------------------------------------------------------- // - scrollClick: //----------------------------------------------------------------------------- - (void)scrollClick:(id)sender { [self updateButtons]; } //----------------------------------------------------------------------------- // - scrollDoubleClick: //----------------------------------------------------------------------------- - (void)scrollDoubleClick:(id)sender { [self openSelected:sender]; } //----------------------------------------------------------------------------- // - activateWindow //----------------------------------------------------------------------------- - (void)activateWindow { [window makeKeyAndOrderFront:0]; } //----------------------------------------------------------------------------- // - windowShouldClose: //----------------------------------------------------------------------------- - (BOOL)windowShouldClose:(id)sender { [scroll abortEditing]; [OPEN_DIRS removeObject:self]; [self autorelease]; return YES; } //----------------------------------------------------------------------------- // - windowDidResize: //----------------------------------------------------------------------------- - (void)windowDidResize:(NSNotification*)notification { NSRect r = [[notification object] frame]; if (NSWidth (r) != DEFAULT_WIN_SIZE.width || NSHeight(r) != DEFAULT_WIN_SIZE.height) { DEFAULT_WIN_SIZE = r.size; [Defaults set:SIZE_DEF size:DEFAULT_WIN_SIZE]; } } //----------------------------------------------------------------------------- // - setDefaultColor: //----------------------------------------------------------------------------- - (void)setDefaultColor:(NSColor*)c { [DEFAULT_COLOR autorelease]; DEFAULT_COLOR = [c retain]; [Defaults set:COLOR_DEF color:c]; } //----------------------------------------------------------------------------- // - setColors: //----------------------------------------------------------------------------- - (void)setColors:(NSColor*)c { [window setBackgroundColor:c]; [scroll setBackgroundColor:[self scrollColor]]; [window display]; } //----------------------------------------------------------------------------- // - draggingEntered: //----------------------------------------------------------------------------- - (unsigned int)draggingEntered:(id)sender { return ([sender draggingSourceOperationMask] & NSDragOperationGeneric); } //----------------------------------------------------------------------------- // - performDragOperation: //----------------------------------------------------------------------------- - (BOOL)performDragOperation:(id)sender { [self setDefaultColor: [NSColor colorFromPasteboard:[sender draggingPasteboard]]]; [self setColors:DEFAULT_COLOR]; return YES; } //----------------------------------------------------------------------------- // - initLazyRow // NOTE *1*: NeXT docs say immutable arrays are accessed more efficiently. //----------------------------------------------------------------------------- - (NSArray*)initLazyRow { NSMutableArray* array = [NSMutableArray array]; NSFont* font = [scroll font]; NSZone* const z = [self zone]; int i; for (i = 0; i < MAX_SLOT; i++) { id c = [[[scroll columnCellPrototype:i] copyWithZone:z] autorelease]; if ([c respondsToSelector:@selector(setOwner:)]) [c setOwner:scroll]; else if ([c respondsToSelector:@selector(setFont:)]) [c setFont:font]; [array addObject:c]; } return [[array copy] autorelease]; // NOTE *1* } //----------------------------------------------------------------------------- // - initDefaults //----------------------------------------------------------------------------- - (void)initDefaults { static BOOL initialized = NO; if (!initialized) { DEFAULT_WIN_SIZE = [window frame].size; DEFAULT_FONT = [[Defaults getFont:FONT_DEF fallback:[scroll font]] retain]; initialized = YES; } } //----------------------------------------------------------------------------- // - loadDefaults //----------------------------------------------------------------------------- - (void)loadDefaults { NSString* s; NSRect r = [window frame]; r.size = [Defaults getSize:SIZE_DEF fallback:DEFAULT_WIN_SIZE]; [window setFrame:r display:NO]; autoSort = DEFAULT_AUTO_SORT; showHidden = DEFAULT_SHOW_HIDDEN; highlightDirs = DEFAULT_HIGHLIGHT_DIRS; dragUnscaled = DEFAULT_DRAG_UNSCALED; [autoSortSwitch setState:autoSort]; [hiddenFilesSwitch setState:showHidden]; [highlightSwitch setState:highlightDirs]; [dragUnscaledSwitch setState:dragUnscaled]; [rowNumbersSwitch setState:DEFAULT_ROW_NUMBERS]; [scroll setRowTitlesOn:DEFAULT_ROW_NUMBERS]; [scroll setAutoSortRows:autoSort]; [scroll setFont:DEFAULT_FONT]; [self setColors:DEFAULT_COLOR]; s = [Defaults getStr:COL_SIZES_DEF fallback:0]; if (s) [scroll setColumnSizesFromString:s]; s = [Defaults getStr:COL_ORDER_DEF fallback:0]; if (s) [scroll setColumnOrderFromString:s]; } //----------------------------------------------------------------------------- // - initLockSlot //----------------------------------------------------------------------------- - (void)initLockSlot { id proto = [scroll columnCellPrototype:LOCK_SLOT]; [proto setButtonType:NSSwitchButton]; [proto setImagePosition:NSImageOnly]; [proto setTarget:self]; [proto setAction:@selector(lockClick:)]; [proto setImage:LOCKED_IMAGE]; [proto setAlternateImage:UNLOCKED_IMAGE]; } //----------------------------------------------------------------------------- // - initNameSlot //----------------------------------------------------------------------------- - (void)initNameSlot { id proto = [scroll columnCellPrototype:NAME_SLOT]; [proto setEditable:YES]; [proto setScrollable:YES]; } //----------------------------------------------------------------------------- // - initSlots //----------------------------------------------------------------------------- - (void)initSlots { [self initLockSlot]; [self initNameSlot]; [[scroll columnCellPrototype:SIZE_SLOT] setAlignment:NSRightTextAlignment]; [[scroll columnCellPrototype:HARDLINKS_SLOT] setAlignment:NSRightTextAlignment]; } //----------------------------------------------------------------------------- // - initWithDir: //----------------------------------------------------------------------------- - (id)initWithDir:(NSString*)dirname { [super init]; path = [[NSString alloc] init]; [NSBundle loadNibNamed:@"DirWindow" owner:self]; [window registerForDraggedTypes: [NSArray arrayWithObject:NSColorPboardType]]; dirArray = [[DirArray allocWithZone:[self zone]] init]; [self initSlots]; [self initDefaults]; [self loadDefaults]; lazyRow = [[self initLazyRow] retain]; [self load:dirname]; [OPEN_DIRS addObject:self]; [self cascade]; return self; } //----------------------------------------------------------------------------- // - init //----------------------------------------------------------------------------- - (id)init { return [self initWithDir:NSHomeDirectory()]; } //----------------------------------------------------------------------------- // - dealloc //----------------------------------------------------------------------------- - (void)dealloc { NSZone* const z = [self zone]; [window setDelegate:0]; [window close]; [window release]; [path release]; [dirArray release]; [lazyRow release]; [super dealloc]; RETIRE_ZONE(z); } //----------------------------------------------------------------------------- // - path //----------------------------------------------------------------------------- - (NSString*)path { return path; } //----------------------------------------------------------------------------- // + findDir: //----------------------------------------------------------------------------- + (DirWindow*)findDir:(NSString*)normalizedPath { if (normalizedPath != 0) { unsigned int i; unsigned int const lim = [OPEN_DIRS count]; for (i = 0; i < lim; i++) { DirWindow* p = (DirWindow*)[OPEN_DIRS objectAtIndex:i]; NSString* s = [p path]; if (s != 0 && [s isEqualToString:normalizedPath]) return p; } } return 0; } //----------------------------------------------------------------------------- // + launchDir: //----------------------------------------------------------------------------- + (void)launchDir:(NSString*)dirname { DirWindow* p = 0; if (dirname == 0) dirname = NSHomeDirectory(); if (dirname == 0) dirname = @"/"; dirname = normalize_path( dirname ); if ((p = [self findDir:dirname]) == 0) p = [[self allocWithZone:EMPLOY_ZONE()] initWithDir:dirname]; [p activateWindow]; } @end MiscKit2/Examples/LazyScrollDir/HISTORY.txt100444 1750 1750 20012 6757227600 20737 0ustar sunshinesunshine//----------------------------------------------------------------------------- // LazyScrollDir HISTORY.txt // $Id: HISTORY.txt,v 1.10 99/06/29 08:28:56 sunshine Exp $ //----------------------------------------------------------------------------- v19 1999/06/29 08:20 EDT sunshine@sunshineco.com Synchronized with LazyScrollDir v19.1 for OpenStep. Renamed Directory menu's New item to Open. Renamed Directory menu's Save item to Export. Added File menu. Moved Open & Delete items to this menu. Reorganized DirWindow.nib layout to match OpenStep counterpart. Renamed DirController's -new: to -openDirectory:. Renamed DirWindow's -open: to -openSelected:. Renamed DirWindow's -save: to -export:. Fixed spelling error in SD_PageLayout.nib: Botom -> Bottom. Updated copyrignt on Info panel. Updated copyright and contact information in README. The user is now prompted for confirmation before deleting files via the File/Delete menu item. Moved nib files to English.lproj to support localization. Added unpack.sh to simplify unpacking a project with subdirectories. Added copyright notice to LazyScrollDir_main.m. PB.project no longer generates main() file upon save. Removed unused +[SD_PageLayout launch:]. Fixed comments in SD_PageLayout.{h|m}. Now correctly uses -tableScroll:changeFont:to: rather than -tableScroll:fontChangedFrom:to: to note user instigated font change. For naming consistency, renamed -didClick: to -scrollClick: and -didDoubleClick: to -scrollDoubleClick: in DirWindow. This is more consistent with other names such as -lockClick:. Removed Copy Font, Paste Font, Underline, Superscript, Subscript, and Unscript from Font menu since they made no sense in this context. Cleaned up Makefile.preamble and Makefile.postamble files. Added copyright notices. Ported back to NextStep 3.2. Had to add -I & -L directives to OTHER_CFLAGS & OTHER_LDFLAGS in Makefile.preamble since the 3.2 makefiles do not recognize these directives when specified via NextStep 3.3's Project Builder. Changed Files: * DirController.{h|m} * DirWindows.{h|m|nib} * Info.nib * LazyScrollDir.nib * LazyScrollDir_main.m * Makefile * Makefile.{preamble|postamble} * PB.project * README.rtf * SD_PageLayout.{h|m|nib} + unpack.sh v18 1998/03/23 23:38 EST sunshine@sunshineco.com Implemented -tableScroll:draggingSourceOperationMaskForLocal: since the default changed from Copy to Generic in MiscTableScroll v126. Added -tableScrollIgnoreModifierKeysWhileDragging:, which returns NO. Updated copyright notices on user interface items. Added a "Printing" section to the README. Added license and contact information to the README. Fixed v1 bug: Wasn't respecting highlighted-text color. Problem was that the cell's "owner" was never getting set. Changed Files: * DirWindow.m * Info.nib * Makefile * PB.project * README.rtf v17 1997/11/24 17:05 EST sunshine@sunshineco.com Synchronized with ScrollDir v33 for NEXTSTEP. Added row-numbers switch. Changed Files: * DirWindow.{h|m|nib} v16 1997/07/08 12:00 EDT sunshine@sunshineco.com Moved include and libarary paths from Makefile.preamble into PB.project. Added /LocalDeveloper/Headers to include paths. Added /LocalDeveloper/Libraries to library paths. Moved -Wwrite-strings from Makefile.preamble into PB.project. Removed hard-coded names from 'relink' target in Makefile.postamble. Worked around AppKit but where the Cell class blindly allocates ClipViews from transient zones and caches them for later re-use. Fixed broken wording in README. Changed Files: * DirWindow.m * Makefile * Makefile.{preamble|postamble} * PB.project * README.rtf v15 1997/06/10 04:51 EDT sunshine@sunshineco.com Synchonized with ScrollDir v30 for NEXTSTEP. Now sets window title with -setTitleAsFilename:. Fixed bug: Wasn't taking "sticky bit" on directories into account when computing whether file could be renamed. No longer misleadingly stat()'s the file which a soft-link points at. Ditched the Message slot. Changed Files: * DirArray.{h|m} * DirWindow.{h|m|nib} * pack.sh * pack_binaries.sh * unpack_binaries.sh v14 1997/03/22 23:36 EST sunshine@sunshineco.com Lock column in DirWindow.nib was incorrectly sizeable and auto-sizing. SD_PageLayout.{h|m} RCS files were missing. Changed Files: * DirWindow.nib + SD_PageLayout.{h|m},v v13 1997/02/05 04:03 EST sunshine@sunshineco.com Synchronized with ScrollDir v29 for NEXTSTEP. Fixed order of headers in DirWindow.m. If directory is readonly then no longer responds to Delete (cmd-r). Removed deviant semi-colon from NameCache.h. Reorganized main menu to be consistent with other NEXTSTEP applications. Added new delegate methods for support of image dragging out of cells. Added capability to drag scaled or unscaled image from icon cell. Added new column which demonstrates how to use ButtonCell in TableScroll. Fixed wording on Info panel. Updated all the copyrights to include 1997 (including Info.nib). Unified formatting. Updated documentation to reflect the new features. Renamed: "Update" -> "Refresh" Checked all of the files into RCS. Added pack and unpack scripts. Added text-cell editing to rename files. Also added preliminary printing. Changed Files: * Everything v12 1996/10/07 10:41 EDT zarnuk@zarnuk.com Now works with MiscTableScroll v109. Added Save command for exporting contents of TableScroll. v11 1996/10/07 10:32 EDT zarnuk@zarnuk.com Now works with MiscTableScroll v105. Responds to new slot-sort-reversed message. Added row-titles for purposes of testing row-wise dragging. This is not very nice or useful for the user interface, but is extremely useful for testing TableScroll. (Perhaps we should add a button to toggle this). v10 was created by sunshine. It incorporated many experimental features, but was abandoned. v11 is a direct descendent of v9. v9 1996/02/15 06:00 EST zarnuk@zarnuk.com Fixed includes since MiscTableScroll.h no longer includes MiscIntList.h v8 1996/02/09 01:00 EST sunshine@sunshineco.com Replaced NameCache's custom hash table with NeXT's HashTable. Info panel will now load README.rtf or README.rtfd. DirArray is now an Objective-C class rather than kludgy C. Updated README. v7 1996/02/01 04:15 EST sunshine@sunshineco.com Added Defaults.[mh] as a simple front-end to NeXT defaults. The following are now saved and restored via NeXT defaults: Auto-sort Column order Column widths Font Highlight directories Show hidden Window color Window size Fixed bug which caused file icons of "/" directory to be incorrect. The filename sent to the Workspace to retrieve the icons lacked a null-terminator. Fixed bug where toggling "show hidden" switch was ineffective on current brower window (but did correctly affect new ones). Added a README.rtf file which explains what this example demonstrates. Added an Info panel that displays the README.rtf file. v6 1996/01/17 05:00 EST sunshine@sunshineco.com Fixed warning that showed up when compiling for debug. Had to replace (int const) with #define for array size. v5 1996/01/17 04:00 EST zarnuk@zarnuk.com Added NameCache classes to cache user and group names since looking them up in NetInfo for every display and sort is excessively time consuming. v4 1996/01/17 02:00 EST sunshine@sunshineco.com Removed mcgh2misc conversions scripts since the one in the palette directory now handles the example directories automatically. v3 1996/01/16 20:00 EST zarnuk@zarnuk.com Fixed mcgh2misc.csh. v2 1996/01/16 19:00 EST zarnuk@zarnuk.com Implemented -tableScroll:intValueAt::, tagAt::, stringValueAt:: Sorting is much faster now. The only slow columns are the owner and group columns. v1 1996/01/05 13:00 EST zarnuk@zarnuk.com Lazy version derived from scrollDir v17 for NEXTSTEP. MiscKit2/Examples/LazyScrollDir/Lock.insecure.tiff100444 1750 1750 2762 6757227571 22416 0ustar sunshinesunshineII*?@@@@EEEUU??????0?<?<?<?<???????????? (R8~~ ' 'U?UOU?U?U?U?U?U?U?U?U?U?U?U?D_ϪϪD_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_ϪϪD_D_D_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_ r(R ' 'MiscKit2/Examples/LazyScrollDir/LazyScrollDir.iconheader100444 1750 1750 110 6757227554 23562 0ustar sunshinesunshineF LazyScrollDir.app LazyScrollDir app F LazyScrollDir LazyScrollDir app MiscKit2/Examples/LazyScrollDir/Lock.secure.tiff100444 1750 1750 2762 6757227571 22067 0ustar sunshinesunshineII* \40@@EEEUU???????<?<?<?<???????????? (R8~~ ' 'U?U?U?U?U?U?U?U?U?U?U?U?D_ϪϪD_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_ϪϪD_D_D_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_ r(R ' 'MiscKit2/Examples/LazyScrollDir/LazyScrollDir_main.m100444 1750 1750 2256 6757227555 22757 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // $Id: LazyScrollDir_main.m,v 1.2 99/06/14 17:30:00 sunshine Exp $ // $Log: LazyScrollDir_main.m,v $ // Revision 1.2 99/06/14 17:30:00 sunshine // v19.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Added copyright notice. Fixed formatting. // //----------------------------------------------------------------------------- #import int main( int argc, char const* argv[] ) { return NSApplicationMain( argc, argv ); } MiscKit2/Examples/LazyScrollDir/Pagination.HAuto.VAuto.tiff100444 1750 1750 512 6757227571 24026 0ustar sunshinesunshineMM*000000000000 *2:B(RH@@ ' 'MiscKit2/Examples/LazyScrollDir/Makefile100444 1750 1750 4170 6757227601 20465 0ustar sunshinesunshine# # Generated by the NeXT Project Builder. # # NOTE: Do NOT change this file -- Project Builder maintains it. # # Put all of your customizations in files called Makefile.preamble # and Makefile.postamble (both optional), and Makefile will include them. # NAME = LazyScrollDir PROJECTVERSION = 2.7 PROJECT_TYPE = Application LANGUAGE = English NEXTSTEP_APPICON = LazyScrollDir.tiff WINDOWS_APPICON = LazyScrollDir.ico ICONSECTIONS = -sectcreate __ICON app LazyScrollDir.tiff LOCAL_RESOURCES = DirWindow.nib Info.nib LazyScrollDir-macintosh.nib\ LazyScrollDir-windows.nib LazyScrollDir.nib\ SD_PageLayout.nib GLOBAL_RESOURCES = Align.HCentered.VCentered.tiff\ Align.HCentered.VTop.tiff Align.HLeft.VCentered.tiff\ Align.HLeft.VTop.tiff LazyScrollDir.ico\ LazyScrollDir.tiff Lock.insecure.tiff\ Lock.secure.tiff 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 PACKAGE_NUMBER README.rtf CLASSES = Defaults.m DirArray.m DirController.m DirWindow.m\ SD_PageLayout.m HFILES = Defaults.h DirArray.h DirController.h DirWindow.h\ SD_PageLayout.h MFILES = LazyScrollDir_main.m OTHERSRCS = make.sh Makefile Makefile.postamble platform.make MAKEFILEDIR = . CODE_GEN_STYLE = DYNAMIC MAKEFILE = app.make NEXTSTEP_INSTALLDIR = $(USER_APPS_DIR) WINDOWS_INSTALLDIR = $(USER_APPS_DIR) LIBS = DEBUG_LIBS = $(LIBS) PROF_LIBS = $(LIBS) FRAMEWORK_PATHS = -F$(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks NEXTSTEP_PB_CFLAGS = -Werror -Wwrite-strings WINDOWS_PB_CFLAGS = -Werror -Wwrite-strings FRAMEWORKS = -framework MiscTableScroll -framework Foundation\ -framework AppKit include $(MAKEFILEDIR)/platform.make -include Makefile.preamble include $(MAKEFILEDIR)/$(MAKEFILE) -include Makefile.postamble -include Makefile.dependencies MiscKit2/Examples/LazyScrollDir/Makefile.postamble100444 1750 1750 5125 6757227556 22464 0ustar sunshinesunshine#****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # forceload.fix (1999-06-09, version 1.1) # # A Makefile.postamble patch which eliminates the NSFramework_forceLoad() # compiler warning generated by YellowBox DR2 on Microsoft Windows. # # Under YellowBox DR2 for Microsoft Windows, Apple tried patching the # system makefile so that it automatically generates source code which # references all the classes in each framework used by a project. The # intention was to make all of the frameworks' symbols available to # loadable bundles even if the main application does not reference the # symbols itself. This is similar to the behavior of the linker's # -all_load switch under Mach. # # However, there are two problems with the DR2 implementation: # # a) It is incomplete and does not generate any framework references at # all; instead it generates a single empty function named # NSFramework_forceload(). # b) The generated function is declared "static" which results in a # compiler warning about an unused function. # # This file (forceload.fix) works around the compiler warning by # disabling generation of NSFramework_forceload() altogether. Since the # function is empty and is never referenced by any other code, this is a # safe operation. # # To use this patch, follow these instructions: # # a) Open the project's top-level Makefile.postamble in a text editor. # b) Append the contents of this file (forceload.fix) to the end of # Makefile.postamble. # c) Clean the project (make clean) and then rebuild it. # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ ifeq "WINDOWS" "$(OS)" GENFORCELOAD=echo // endif #------------------------------------------------------------------------------ # A handy "relink" target. #------------------------------------------------------------------------------ relink: -rm -f $(PRODUCT)/$(NAME)$(EXECUTABLE_EXT) $(MAKE) MiscKit2/Examples/LazyScrollDir/OPENSTEP-BUGS.txt100444 1750 1750 3627 6757227556 21600 0ustar sunshinesunshine//----------------------------------------------------------------------------- // LazyScrollDir BUGS // $Id: OPENSTEP-BUGS.txt,v 1.2 99/06/14 17:27:48 sunshine Exp $ //----------------------------------------------------------------------------- BUGS: ---- - Each time a new window is opened on MacOS/X Server DR2 for Mach or YellowBox DR2 for Windows, it is taller than the size set with -setFrame:display: by the height of the menu bar. This is an AppKit bug which was introduced in DR2. NeXT BUGS: --------- - Saving font default doesn't work (can't serialize point size error). [I was storing an NSNumber in a dictionary which got saved to defaults. I worked around this bug by storing a string representation of the number in the dictionary instead.] - Info panel not loading README. [I worked around this by explicitly asking for an "rtf" file then an "rtfd" file (if the "rtf" wasn't found). NSBundle is not working as advertised where it says that if you pass nil for the "extension", then it will find the first file with the "name" regardless of the "extension".] - When browsing /LocalApps, the icons are all the same (and they are the icon for MallocDebug.app which isn't even in that directory)! The MallocDebug.app icon shows up as the icon for *ALL* ".app" directories rather than the icon of the executable inside. I tracked this down to MallocDebug's Info.plist: NSExtensions = {app = {NSIcon = Leak.tiff; NSIsPrimary = NO; }; }; [I worked around this problem by explicitly checking for the "app" extension and asking for the icon of the contained executable.] [03/21/97 -- this bug is finally "fixed" in OPENSTEP 4.1 (gamma)] FIXED: ----- v19.1 - File attributes displayed for ".." are actually those for ".". - Double-clicking on ".." does not open the parent directory. It does nothing. Note that using the "Traverse" button does work. MiscKit2/Examples/LazyScrollDir/OPENSTEP-HISTORY.txt100444 1750 1750 20712 6757227600 22201 0ustar sunshinesunshine//----------------------------------------------------------------------------- // LazyScrollDir OPENSTEP HISTORY // $Id: OPENSTEP-HISTORY.txt,v 1.11 99/08/12 23:04:05 sunshine Exp $ //----------------------------------------------------------------------------- v19.1 1999/08/12 21:30 EDT sunshine@sunshineco.com Ported to MacOS/X Server DR2 for Mach and Windows. Updated all nibs to latest UI layout guidelines and adjusted all fonts. Renamed Directory menu's New item to Open. Renamed Directory menu's Save item to Export. Added File menu. Moved Open & Delete items to this menu. Added Close item to Directory menu on MacOS/X platform. Renamed Colors... to Show Colors, and Font Panel... to Show Fonts on MacOS/X platform. Renamed DirController's -new: to -openDirectory:. Renamed DirWindow's -open: to -openSelected:. Renamed DirWindow's -save: to -export:. Fixed spelling error in SD_PageLayout.nib: Botom -> Bottom. Changed background of Page Layout images to be transparent. This looks better on all platforms. The old light-gray background was incorrect for platforms other than NextStep/OpenStep Mach. Updated copyrignt on Info panel. Updated copyright and contact information in README. Added make.sh and platform.make to work around differences in the directory structure between MacOS/X Server DR2 and earlier versions of OpenStep. In particular, the location of the system makefiles changed, as did the location of the 'make' utility on Windows. Added patch to Makefile.postamble to eliminate NSFramework_forceLoad() compiler warning generated by makefiles on YellowBox DR2 for Windows. The user is now prompted for confirmation before deleting files via the File/Delete menu item. Moved nib files to English.lproj to support localization. Added unpack.sh to simplify unpacking a project with subdirectories. Fixed formatting of ScrollDir_main.m. SD_PageLayout implementation is now conditionally compiled for platforms which require it. Removed unused +[SD_PageLayout launch:]. Fixed comments in SD_PageLayout.{h|m}. Some TableScroll delegate method names changed when they were turned into NSNotification-style messages. Now correctly uses -tableScrollChangeFont: rather than -tableScrollFontChanged: to note user instigated font change. For naming consistency, renamed -didClick: to -scrollClick: and -didDoubleClick: to -scrollDoubleClick: in DirWindow. This is more consistent with other names such as -lockClick:. Removed Copy Font, Paste Font, Underline, Kern, Ligature, & Baseline from Format menu since they made no sense in this context. Fixed bug: Attributes displayed for ".." were actually those of ".". Worked around Foundation bug: -[NSString stringByDeletingLastPathComponent] does not handle the root directory as documented. On Mach, when handed "/", it returns "" rather than "/" as documented. On Windows, when handed "C:\", it returns "C:" rather than "C:\" as documented. Fixed bug: -[DirWindow destroy:] was mis-using result of -selectedRows and consequently deleting the wrong files. Fixed bug: Full pathname (DA_LONG_NAME) computed by DirArray was incorrect for "..". It should have been the current directory's parent, but was instead just the current directory. The result was that double clicking on ".." did not open the parent directory. Fixed -[DirWindow cdPressed:] to use DA_LONG_NAME instead of constructing the long name manually from DA_SHORT_NAME and the current path. Changed Files: * DirArray.m * DirController.{h|m} * DirWindow.{m|nib} + English.lproj * Info.nib * LazyScrollDir.nib * LazyScrollDir-macintosh.nib * LazyScrollDir-windows.nib * LazyScrollDir_main.m + make.sh * Makefile * Makefile.postamble - Makefile.preamble * Pagination.{HAuto|HClip|HFit}.{VAuto|VClip|VFit}.tiff * PB.project + platform.make * README.rtf * SD_PageLayout.{h|m|nib} + unpack.sh v18.1 1998/03/30 09:06 EST sunshine@sunshineco.com Applied v18 NEXTSTEP 3.3 diffs. Renamed Windows menu nib: LazyScrollDir-winnt.nib --> LazyScrollDir-windows.nib Added Rhapsody-specific main menu. Application icon on Info panel now explicitly names "LazyScrollDir" rather than "NSApplicationIcon". DirWindow now uses NSColor's "system" color for window background by default, rather than hard-coded light-gray. DirWindow.nib now uses NSColor's "system" colors by default for MiscTableScroll, rather than hard-wired NextStep-like colors. Replaced the NSCStringText in Info.nib with an NSTextView. Fixed v1 bug: Wasn't respecting selected-text color. Problem was that the cell's "owner" was never getting set. DirArray's "totalBytes" is now correctly typed as "unsigned long long" rather than "size_t". Changed Files: * DirArray.{h|m} * DirWindow.{m|nib} * Info.nib + LazyScrollDir-macintosh.nib > LazyScrollDir-winnt.nib --> LazyScrollDir-windows.nib * Makefile - OPENSTEP-TODO.txt * PB.project * README.rtf v17.1 1997/11/24 19:55 EST sunshine@sunshineco.com Applied v17 NEXTSTEP 3.3 diffs. Fixed bug: Menu was sending -print: to first-responder which printed the control with keyboard focus rather than the MiscTableScroll. Changed Files: * DirWindow.{h|m|nib} * LazyScrollDir.nib * LazyScrollDir-winnt.nib v16.1 1997/07/08 13:00 EDT sunshine@sunshineco.com Applied v16 NEXTSTEP 3.3 diffs. Changed Files: * DirWindow.m * Makefile.postamble v15.1 1997/06/24 07:30 EDT sunshine@sunshineco.com Applied v15 NEXTSTEP 3.3 diffs. Changed Files: * DirArray.{h|m} * DirWindow.m v14.3 1997/06/22 06:00 EDT sunshine@sunshineco.com Now works with MiscTableScroll v0.125.9. (Method names changed.) Adjusted framework search path to: $(NEXT_ROOT)/LocalLibrary/Frameworks. Added LazyScrollDir.ico application icon for Windows NT. Upgraded [un]pack_binaries.sh scripts to handle ICO files. Changed Files: * DirWindow.m + LazyScrollDir.ico * Makefile * pack_binaries.sh * PB.project * unpack_binaries.sh v14.2 1997/04/25 20:00 EDT sunshine@sunshineco.com Now works with MiscTableScroll v0.125.8. Synchronized with ScrollDir v29.4 for OPENSTEP. Ported to OPENSTEP 4.2 prerelease for Mach and NT. Replaced the Unix specific directory scanning code with NSFileManager. Removed the "message" column since this information isn't available from the NSFileManager. Completely revamped DirArray. Is now completely Objective-C rather than Objective-C / C mixture. Added a Windows NT specific main menu nib. Replaced assert() with NSAssert() variations. Removed obsolete NameCache class. No longer needed since NSFileManager returns string versions of file owner's user and group. Removed reference to NameCache from README. Added MiscTableScroll to Frameworks directory in project since it is now a framework. Upgraded pack.sh script to store minor version number in PACKAGE_NUMBER. Upgraded binary pack and unpack scripts so they don't error out if tiffs or nibs are non-existent. Removed obsolete PB.gdbinit (no longer used by ProjectBuilder). *** Delete your old "ColOrder" and "ColSizes" defaults *** Changed Files: * Defaults.m * DirArray.{h|m} * DirWindow.{h|m|nib} * Makefile * Makefile.preamble - NameCache.{h|m} * SD_PageLayout.m * README.rtf * pack.sh * pack_binaries.sh + LazyScrollDir-winnt.nib * unpack_binaries.sh - PB.gdbinit * PB.project v14.1 1997/03/23 02:10 EST sunshine@sunshineco.com Applied v14 NEXTSTEP 3.3 diffs. v13.1 1997/03/23 01:50 EST sunshine@sunshineco.com Applied v13 NEXTSTEP 3.3 diffs. Brought into synchronization with ScrollDir v29.2 for OPENSTEP. v12.1 1997/03/22 23:25 EST sunshine@sunshineco.com Applied v12 NEXTSTEP 3.3 diffs. v11.1 1997/03/22 23:15 EST sunshine@sunshineco.com Applied v11 NEXTSTEP 3.3 diffs. (v10 was an experimental version which was never released, and therefore never ported to OPENSTEP.) Now works with OPENSTEP MiscTableScroll v125.3 (many MiscTableScroll method names changed since v9 of this project). v9.3 1996/12/30 02:30 EST sunshine@sunshineco.com Ported to broken OPENSTEP 4.1 (gamma) pb_makefiles. v9.2 1996/05/07 08:00 EDT sunshine@sunshineco.com TableScroll class version numbers were bumped up for all classes which archive themselves. Therefore converted the DirWindow nib. MiscKit2/Examples/LazyScrollDir/PACKAGE_NUMBER100444 1750 1750 5 6757227557 20776 0ustar sunshinesunshine19 1 MiscKit2/Examples/LazyScrollDir/PB.project100444 1750 1750 6120 6757227601 20713 0ustar sunshinesunshine{ APPCLASS = NSApplication; FILESTABLE = { BUNDLES = (); CLASSES = (Defaults.m, DirArray.m, DirController.m, DirWindow.m, SD_PageLayout.m); FRAMEWORKS = (MiscTableScroll.framework, Foundation.framework, AppKit.framework); FRAMEWORKSEARCH = ("$(NEXT_ROOT)$(LOCAL_LIBRARY_DIR)/Frameworks"); HEADERSEARCH = (); H_FILES = (Defaults.h, DirArray.h, DirController.h, DirWindow.h, SD_PageLayout.h); IMAGES = ( Align.HCentered.VCentered.tiff, Align.HCentered.VTop.tiff, Align.HLeft.VCentered.tiff, Align.HLeft.VTop.tiff, LazyScrollDir.ico, LazyScrollDir.tiff, Lock.insecure.tiff, Lock.secure.tiff, 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 ); INTERFACES = ( DirWindow.nib, Info.nib, "LazyScrollDir-macintosh.nib", "LazyScrollDir-windows.nib", LazyScrollDir.nib, SD_PageLayout.nib ); LIBRARYSEARCH = (); LIBS = (); M_FILES = (); OTHER_LIBS = (); OTHER_LINKED = (LazyScrollDir_main.m); OTHER_RESOURCES = (PACKAGE_NUMBER, README.rtf); OTHER_SOURCES = (make.sh, Makefile, Makefile.postamble, platform.make); PUBLIC_FILES = (); SUBPROJECTS = (); TOOLS = (); }; GENERATEMAIN = YES; LANGUAGE = English; LOCALIZABLE_FILES = { DirWindow.nib = DirWindow.nib; Info.nib = Info.nib; "LazyScrollDir-macintosh.nib" = "LazyScrollDir-macintosh.nib"; "LazyScrollDir-windows.nib" = "LazyScrollDir-windows.nib"; LazyScrollDir.nib = LazyScrollDir.nib; SD_PageLayout.nib = SD_PageLayout.nib; }; MAKEFILEDIR = .; NEXTSTEP_APPICON = LazyScrollDir.tiff; NEXTSTEP_BUILDTOOL = /bin/gnumake; NEXTSTEP_COMPILEROPTIONS = "-Werror -Wwrite-strings"; NEXTSTEP_DOCUMENTEXTENSIONS = (); NEXTSTEP_INSTALLDIR = "$(USER_APPS_DIR)"; NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; NEXTSTEP_MAINNIB = LazyScrollDir; NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; PDO_UNIX_JAVA_COMPILER = "$(NEXTDEV_BIN)/javac"; PDO_UNIX_OBJCPLUS_COMPILER = "$(NEXTDEV_BIN)/gcc"; PROJECTNAME = LazyScrollDir; PROJECTTYPE = Application; PROJECTVERSION = 2.7; SYSTEMEXTENSIONS = (); TARGETS = (relink); WINDOWS_APPICON = LazyScrollDir.ico; WINDOWS_BUILDTOOL = ./make.sh; WINDOWS_COMPILEROPTIONS = "-Werror -Wwrite-strings"; WINDOWS_DOCUMENTEXTENSIONS = (); WINDOWS_INSTALLDIR = "$(USER_APPS_DIR)"; WINDOWS_JAVA_COMPILER = "$(JDKBINDIR)/javac.exe"; WINDOWS_MAINNIB = "LazyScrollDir-windows"; WINDOWS_OBJCPLUS_COMPILER = "$(DEVDIR)/gcc"; } MiscKit2/Examples/LazyScrollDir/Pagination.HAuto.VClip.tiff100444 1750 1750 512 6757227571 24005 0ustar sunshinesunshineMM*000000 *2:B(RH@@ ' 'MiscKit2/Examples/LazyScrollDir/Pagination.HAuto.VFit.tiff100444 1750 1750 512 6757227571 23640 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/LazyScrollDir/Pagination.HClip.VAuto.tiff100444 1750 1750 512 6757227572 24006 0ustar sunshinesunshineMM*00000000 *2:B(RH@@ ' 'MiscKit2/Examples/LazyScrollDir/Pagination.HClip.VClip.tiff100444 1750 1750 512 6757227572 23765 0ustar sunshinesunshineMM*000000 *2:B(RH@@ ' 'MiscKit2/Examples/LazyScrollDir/Pagination.HClip.VFit.tiff100444 1750 1750 512 6757227572 23620 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/LazyScrollDir/Pagination.HFit.VAuto.tiff100444 1750 1750 512 6757227572 23641 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/LazyScrollDir/Pagination.HFit.VClip.tiff100444 1750 1750 512 6757227573 23621 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/LazyScrollDir/Pagination.HFit.VFit.tiff100444 1750 1750 512 6757227573 23454 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/LazyScrollDir/README.rtf100444 1750 1750 20021 6757227601 20510 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\ftech Symbol;\f2\fmodern Ohlfs; } {\colortbl;\red255\green255\blue255;} \paperw10980\paperh10140 \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \f0\b\fs36 \cf0 LazyScrollDir\ \b0\fs24 By Paul S. McCarthy and Eric Sunshine\ Copyright \f1 \f0 1995,1996,1997,1998,1999 by Paul S. McCarthy and Eric Sunshine\ April 23, 1999\ \ \b\fs28 Overview \fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b0\fs12 \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs24 \cf0 This program demonstrates the use of MiscTableScroll in \i lazy \i0 mode. It is a simple directory browser which supports basic operations such as \i open, delete, rename, \i0 and \i change directory \i0 .\ \ \ \b\fs28 Notable Features \fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b0\fs12 \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b\fs24 \cf0 Lazy Mode\ \b0 This program illustrates how to use a \i lazy \i0 mode MiscTableScroll. In \i lazy \i0 mode the data-delegate (or the delegate if there is no data-delegate) is responsible for supplying the cells that the MiscTableScroll will display. In this example, the data-delegate also supplies information (such as \i stringValue \i0 , \i intValue \i0 , \i tag \i0 , etc.) during sorting as a speed optimization.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs24 \cf0 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 such as fetching a file's icon can be delayed until the information is actually needed.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs24 \cf0 This contrasts sharply with \i eager \i0 mode, in which all cells are created and filled immediately. \i Lazy \i0 mode is useful for exceptionally large data sets or data sets for which data retrieval is very time-consuming. \i Eager \i0 mode, however, is usually easier to program. \b \ \ Color \b0 \ The example shows how to use color with the MiscTableScroll. Color swatches can be dragged from the \i Color Panel \i0 and dropped onto the browser window. The background of the MiscTableScroll is set to the color of the dropped swatch.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs24 \cf0 When the \i highlight directories \i0 switch is toggled \i on \i0 the rows for directories are highlighted in a color independent of the MiscTableScroll. \b \ \ Font\ \b0 When the MiscTableScroll is first-responder, the \i Font Panel \i0 can be used to change its font. \b \ \ Users Preferences\ \b0 This program demonstrates how to save and restore the user's column order and width preferences. Additionally, all other user preferences -- \i font, color, \i0 \i switch settings \i0 , and \i window size -- \i0 are also saved and restored.\ \ \b Sorting\ \b0 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 \i nib \i0 file by adjusting the criteria on a column-by-column basis. For instance, columns may contribute \i stringValue, title, intValue, tag, \i0 etc. to the row-wise comparisons.\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b \cf0 Image Display\ \b0 One column in the browser displays the file's icon. This demonstrates how to use \i image \i0 columns in addition to \i text \i0 columns.\ \ \b Image Dragging\ \b0 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 \i dragged filenames \i0 , 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.\ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b \cf0 Text Editing\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b0 \cf0 MiscTableScroll supports \i in-cell \i0 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 \i Name \i0 column initiates editing.\ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b \cf0 Buttons\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b0 \cf0 This example illustrates how to use \i ButtonCells \i0 with the MiscTableScroll. One column contains a \i ButtonCell \i0 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 \i unlocked, \i0 renaming is allowed, and double-clicking on the file name in the \i Name \i0 column initiates an edit session. When \i locked, \i0 renaming is not allowed. If you do not have permission to rename a file the browser displays a \i locked \i0 icon and disables the \i ButtonCell \i0 .\ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b \cf0 Exporting \b0 \ MiscTableScroll can export its contents in dBASEIII (.dbf) format and also a number of ASCII formats via the \i Export \i0 menu item on the \i Directory \i0 menu.\ \ \b Printing \b0 \ MiscTableScroll respects the various page layout options, such as shrink-to-fit, spill, crop, centering, etc.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \cf0 \ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b\fs28 \cf0 Conclusion\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b0\fs12 \cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \fs24 \cf0 LazyScrollDir was written by Paul S. McCarthy and Eric Sunshine and is copyright \f1 \f0 1995, 1996, 1997, 1998, 1999 by Paul S. McCarthy and Eric Sunshine. It is included in the MiscKit by permission from the authors and is governed by the MiscKit license found in the file \f2\fs20 License.rtf \f0\fs24 in the MiscKit distribution.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \fs24 \cf0 Please direct comments, questions, and complaints to:\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\li360\fi-160\ql\qnatural \fs24 \cf0 Paul S. McCarthy \f2\fs20 \f0\fs24 \ Eric Sunshine \f2\fs20 \f0\fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \fs24 \cf0 MIME, and ASCII mail accepted. \fs12 \ } MiscKit2/Examples/LazyScrollDir/SD_PageLayout.h100444 1750 1750 4113 6757227561 21640 0ustar sunshinesunshine#ifndef __SD_PageLayout_h #define __SD_PageLayout_h //============================================================================= // // Copyright (C) 1996,1997,1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // SD_PageLayout.h // // Custom subclass of AppKit's NSPageLayout panel that adds user controls // for margins, pagination, & centering. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: SD_PageLayout.h,v 1.2 99/06/14 17:20:04 sunshine Exp $ // $Log: SD_PageLayout.h,v $ // Revision 1.2 99/06/14 17:20:04 sunshine // v19.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Removed unused +launch:. Fixed up comments. No longer makes an // effort to supply missing NSPageLayout methods on Windows. Now the entire // implementation of the class is conditionally compiled as appropriate, // instead of piecemeal. // //----------------------------------------------------------------------------- #import @class NSMatrix, NSTextField; #if defined(WIN32) #undef SD_USE_PAGE_LAYOUT #else #define SD_USE_PAGE_LAYOUT #endif @interface SD_PageLayout : NSPageLayout { #if defined(SD_USE_PAGE_LAYOUT) NSWindow* accessoryWindow; NSTextField* leftMarginField; NSTextField* topMarginField; NSTextField* rightMarginField; NSTextField* bottomMarginField; NSMatrix* centerMatrix; NSMatrix* paginationMatrix; #endif } @end #endif // __SD_PageLayout_h MiscKit2/Examples/LazyScrollDir/SD_PageLayout.m100444 1750 1750 14323 6757227561 21671 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1996,1997,1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // SD_PageLayout.m // // Custom subclass of AppKit's NSPageLayout panel that adds user controls // for margins, pagination, & centering. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: SD_PageLayout.m,v 1.3 99/06/14 17:20:06 sunshine Exp $ // $Log: SD_PageLayout.m,v $ // Revision 1.3 99/06/14 17:20:06 sunshine // v19.1: Ported to MacOS/X Server DR2 for Mach and Windows. // Removed unused +launch:. Fixed up comments. No longer makes an // effort to supply missing NSPageLayout methods on Windows. Now the entire // implementation of the class is conditionally compiled as appropriate, // instead of piecemeal. // // Revision 1.2 1997/04/25 20:01:30 sunshine // v14.2: Ported to OPENSTEP 4.2 prerelease for Windows NT by working around // incompatiblities between Mach and NT NSPageLayout implementations. //----------------------------------------------------------------------------- #import "SD_PageLayout.h" #import #import #import #import #import #import @implementation SD_PageLayout #if defined(SD_USE_PAGE_LAYOUT) //----------------------------------------------------------------------------- // loadAccessoryView //----------------------------------------------------------------------------- - (void)loadAccessoryView { NSView* v; [NSBundle loadNibNamed:@"SD_PageLayout" owner:self]; v = [[[accessoryWindow contentView] retain] autorelease]; [accessoryWindow setContentView:0]; [accessoryWindow close]; [accessoryWindow release]; [self setAccessoryView:v]; } //----------------------------------------------------------------------------- // pageLayout //----------------------------------------------------------------------------- + (NSPageLayout*)pageLayout { static id p = 0; if (p == 0) { p = [[super pageLayout] retain]; [p loadAccessoryView]; } return p; } //----------------------------------------------------------------------------- // pickedUnits: //----------------------------------------------------------------------------- - (void)pickedUnits:(id)sender { float old_factor, new_factor, scaler; [self convertOldFactor:&old_factor newFactor:&new_factor]; scaler = new_factor / old_factor; [leftMarginField setFloatValue:[leftMarginField floatValue] * scaler]; [rightMarginField setFloatValue:[rightMarginField floatValue] * scaler]; [topMarginField setFloatValue:[topMarginField floatValue] * scaler]; [bottomMarginField setFloatValue:[bottomMarginField floatValue] * scaler]; [super pickedUnits:sender]; } //----------------------------------------------------------------------------- // pagination_to_slot //----------------------------------------------------------------------------- static int pagination_to_slot( int pg ) { int slot = 1; if (pg == NSFitPagination) slot = 0; else if (pg == NSClipPagination) slot = 2; return slot; } //----------------------------------------------------------------------------- // slot_to_pagination //----------------------------------------------------------------------------- static int slot_to_pagination( int slot ) { int pg = NSAutoPagination; if (slot == 0) pg = NSFitPagination; else if (slot == 2) pg = NSClipPagination; return pg; } //----------------------------------------------------------------------------- // readPrintInfo //----------------------------------------------------------------------------- - (void)readPrintInfo { NSPrintInfo* pinfo; int pg_row, pg_col; float old_factor, new_factor; [super readPrintInfo]; pinfo = [self printInfo]; [self convertOldFactor:&old_factor newFactor:&new_factor]; [leftMarginField setFloatValue:new_factor * [pinfo leftMargin ]]; [rightMarginField setFloatValue:new_factor * [pinfo rightMargin ]]; [topMarginField setFloatValue:new_factor * [pinfo topMargin ]]; [bottomMarginField setFloatValue:new_factor * [pinfo bottomMargin]]; [centerMatrix selectCellAtRow:(int)[pinfo isVerticallyCentered] column:(int)[pinfo isHorizontallyCentered]]; pg_row = pagination_to_slot( [pinfo verticalPagination] ); pg_col = pagination_to_slot( [pinfo horizontalPagination] ); [paginationMatrix selectCellAtRow:pg_row column:pg_col]; } //----------------------------------------------------------------------------- // writePrintInfo //----------------------------------------------------------------------------- - (void)writePrintInfo { NSPrintInfo* pinfo; float old_factor, new_factor; [super writePrintInfo]; pinfo = [self printInfo]; [self convertOldFactor:&old_factor newFactor:&new_factor]; [pinfo setLeftMargin: [leftMarginField floatValue] / old_factor]; [pinfo setRightMargin: [rightMarginField floatValue] / old_factor]; [pinfo setTopMargin: [topMarginField floatValue] / old_factor]; [pinfo setBottomMargin:[bottomMarginField floatValue] / old_factor]; [pinfo setVerticallyCentered: [centerMatrix selectedRow ]]; [pinfo setHorizontallyCentered:[centerMatrix selectedColumn]]; [pinfo setHorizontalPagination: slot_to_pagination([paginationMatrix selectedColumn])]; [pinfo setVerticalPagination: slot_to_pagination([paginationMatrix selectedRow])]; } #endif // SD_USE_PAGE_LAYOUT @end MiscKit2/Examples/LazyScrollDir/TODO.txt100444 1750 1750 1574 6757227562 20346 0ustar sunshinesunshine//----------------------------------------------------------------------------- // ScrollDir TODO.txt // $Id: TODO.txt,v 1.1 97/02/05 08:20:07 sunshine Exp $ //----------------------------------------------------------------------------- TODO: ----- - Change the behavior: * Double-click on a directory should perform a "change-dir" (*not* launch a new window). * cmd-o / cmd-n should create new windows pre-loaded with the currently selected directories (or something like that). - Fix scroll position after reload. Only "update" should preserve the scroll position. - Should ask the workspace manager for notification of file system changes. DONE: ----- - Implement save/restore settings to/from NXDefaults. - Don't load the image immediately while scanning the directory. - Separate the extra formatting that needs to be done for lazy mode from the stuff done for eager mode. MiscKit2/Examples/LazyScrollDir/platform.make100444 1750 1750 13121 6757227562 21532 0ustar sunshinesunshine#****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # platform.make (1999-06-09, version 1.1) # # A cross-platform compatibility makefile which allows a project to be # built for both MacOS/X Server and OpenStep without maintaining # distinct PB.project files and Makefiles for each platform. # # Prior to MacOS/X Server, system-supplied makefiles resided in a # constant location, in this case $(NEXT_ROOT)/NextDeveloper/Makefiles. # As of MacOS/X Server, however, the directory structure changed, so # that on Mach, makefiles now reside in /System/Developer/Makefiles, and # on Windows they reside in $(NEXT_ROOT)/Developer/Makefiles. # # Apple hacked GNU's "make" utility on MacOS/X Server so that it # automatically defines the variable MAKEFILEPATH, which on Mach # defaults to /System/Developer/Makefiles, and on Microsoft Windows # defaults to $(NEXT_ROOT)/Developer/Makefiles. In this manner, they # are able to refer to the system makefile directory without having to # hardcode the path into the local makefile as they did prior to MacOS/X # Server. # # However, Apple's hack does not help the developer who must still # support earlier platforms which use the old directory structure, nor # did Apple provide a backward compatibility solution. Consequently, # the developer is forced to maintain two sets of PB.project files and # Makefiles; one for OpenStep 4.x, and one for MacOS/X Server and later. # # This file (platform.make) bridges the gap between the old directory # structure and the new by forcefully inserting itself into the make # process at the earliest possible time and adjusting the makefile path # dynamically to match either the old or the new directory structure. # # To insert this file into the make process, follow these steps: # # a) If the project is currently open in ProjectBuilder.app, close it. # b) Open the project's top-level PB.project file in a text editor. # c) Find the line which defines MAKEFILEDIR. Its definition will be # either $(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles or # $(MAKEFILEPATH)/pb_makefiles depending upon whether it was # generated by OpenStep 4.x or MacOS/X Server. # d) Change the value of MAKEFILEDIR to "." (a single quoted period). # e) Open the project's top-level Makefile in a text editor. # f) Find the line which defines MAKEFILEDIR. # g) Change the value of MAKEFILEDIR to . (a single period). # h) Place this file (platform.make) in the project's main directory. # # The variable MAKEFILEDIR is normally used to locate the system makefile # directory from which platform.make is loaded as the very beginning of # the build process. By changing the value of MAKEFILEDIR to ".", this # replacement platform.make gets loaded instead. # # Once in control, this file determines the correct makefile path # dynamically, either $(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles # or $(MAKEFILEPATH)/pb_makefiles and sets it as the value of MAKEFILEDIR # so that later references to MAKEFILEDIR use the actual system # makefiles. Finally, the real system platform.make is loaded, and # control returns to the caller. # # To further facilitate cross-platform development, this file also # defines the following variables for pre-MacOS/X Server platforms which # are normally only defined for MacOS/X Server and later platforms. # These variables are typically used by "install" targets where the # installation location may vary from platform to platform. # # MAKEFILEPATH Path to system makefiles # USER_APPS_DIR $(HOME)/Apps [vs. $(HOME)/Applications on OS/X] # USER_LIBRARY_DIR $(HOME)/Library # LOCAL_APPS_DIR /LocalApps [Mach] or /Local/Apps [Windows] # LOCAL_LIBRARY_DIR /LocalLibrary or /Local/Library # LOCAL_DEVELOPER_DIR /LocalDeveloper or /Local/Developer # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ ifndef MAKEFILEPATH MAKEFILEPATH=$(NEXT_ROOT)/NextDeveloper/Makefiles endif MAKEFILEDIR=$(MAKEFILEPATH)/pb_makefiles include $(MAKEFILEDIR)/platform.make ifeq "NEXTSTEP" "$(OS)" ifndef USER_APPS_DIR export USER_APPS_DIR=$(HOME)/Apps endif ifndef USER_LIBRARY_DIR export USER_LIBRARY_DIR=$(HOME)/Library endif ifndef LOCAL_APPS_DIR export LOCAL_APPS_DIR=/LocalApps endif ifndef LOCAL_LIBRARY_DIR export LOCAL_LIBRARY_DIR=/LocalLibrary endif ifndef LOCAL_DEVELOPER_DIR export LOCAL_DEVELOPER_DIR=/LocalDeveloper endif else # Windows and PDO platforms ifndef USER_APPS_DIR export USER_APPS_DIR=$(HOME)/Apps endif ifndef USER_LIBRARY_DIR export USER_LIBRARY_DIR=$(HOME)/Library endif ifndef LOCAL_APPS_DIR export LOCAL_APPS_DIR=/Local/Apps endif ifndef LOCAL_LIBRARY_DIR export LOCAL_LIBRARY_DIR=/Local/Library endif ifndef LOCAL_DEVELOPER_DIR export LOCAL_DEVELOPER_DIR=/Local/Developer endif endif MiscKit2/Examples/LazyScrollDir/Align.HCentered.VTop.tiff100444 1750 1750 422 6757227567 23447 0ustar sunshinesunshineMM*D*JVOߏ$ C!\6Cq?R` U?P8$ BaP  (R5- ' 'MiscKit2/Examples/LazyScrollDir/Align.HCentered.VCentered.tiff100444 1750 1750 426 6757227567 24442 0ustar sunshinesunshineMM*H*JTVO(L->C`'ш^!O$@U@@?P8$ BaP (R80 ' 'MiscKit2/Examples/JavaScrollDir/ 40755 1750 1750 0 6757227633 16677 5ustar sunshinesunshineMiscKit2/Examples/JavaScrollDir/English.lproj/ 40755 1750 1750 0 6757227623 21414 5ustar sunshinesunshineMiscKit2/Examples/JavaScrollDir/English.lproj/DirWindow.nib/ 40755 1750 1750 0 6722775724 24073 5ustar sunshinesunshineMiscKit2/Examples/JavaScrollDir/English.lproj/DirWindow.nib/classes.nib100444 1750 1750 2015 6713657513 26306 0ustar sunshinesunshine{ IBClasses = ( { ACTIONS = { autoSortClick = id; cdPressed = id; dragUnscaledClick = id; hiddenFilesClick = id; highlightClick = id; refreshPressed = id; rowNumbersClick = id; scrollClick = id; scrollDoubleClick = id; }; CLASS = DirWindow; LANGUAGE = Java; OUTLETS = { autoSortSwitch = id; cdButton = id; countField = id; dragUnscaledSwitch = id; hiddenFilesSwitch = id; highlightSwitch = id; refreshButton = id; rowNumbersSwitch = id; scroll = id; window = id; }; SUPERCLASS = java.lang.Object; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } ); IBVersion = 1; }MiscKit2/Examples/JavaScrollDir/English.lproj/DirWindow.nib/objects.nib100444 1750 1750 6542 6757227630 26314 0ustar sunshinesunshine streamtyped@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ DirWindowi NSButton NSControl)NSView) NSResponder @@@@ffffffffNSMutableArrayNSArray MiscTableScroll NSScrollView NSClipView:@zz@@cccNSColorc@@@SystemcontrolBackgroundColorff*? NSScrollericc@ff:Bl? _doScroller:Affffi ԙNSFont[28c]Helveticaf controlTextColorselectedControlTextColorselectedControlColorIP   x  < d d [6i] NameSizeModified Permissions MiscTableCellNSCell>ii@@@@@µ@µ@µ@  x$"BB NSButtonCell> NSActionCellõTraverseCharcoal i:DŽ ssii@@@@@@Helvetica $BBɵRefresh̅κ@ͅ NSTextField!,NSTextFieldCell=ʵ9999 files 9999999 bytesфc@@textBackgroundColor:!)~~ɵ Auto Sort̅غA<ɼNSCustomResource)NSImageNSSwitchNSButtonImageSourceNSSwitch! ɵHighlight Directories̅⺁A<ɼ߅!~~ɵDrag Big Images̅庁A<ɼ߅!~~ɵ Row Numbers̅躁A<ɼ߅ ! ɵShow Hidden Files̅A<ɼ߅؞➖ў垖Ǟ螖NSWindowTemplate) iiffffi@@@@@cGx`WindowNSWindowViewffff~Ξ턘Window File's Owner NSMutableSetNSSetNSNibOutletConnectorNSNibConnector턘windowscroll필delegatedelegateNSNibControlConnector scrollClickDŽcdButtonǕ cdPressed:΄ refreshButtonΕrefreshPressed:ф countFieldhiddenFilesSwitchhiddenFilesClick:؄autoSortSwitchؕautoSortClick:℘highlightSwitch╄highlightClick:DŽ nextKeyViewinitialFirstResponderMiscTableConnectorscrollDoubleClick doubleTarget doubleAction啄dragUnscaledClick:儘dragUnscaledSwitch脘rowNumbersSwitch蕄rowNumbersClick:脘 nextKeyView////*@i .43827ʢ ʙ%  !'  *0,116 /ʕ*(.&-ʞ 059MiscKit2/Examples/JavaScrollDir/English.lproj/Info.nib/ 40755 1750 1750 0 6722775724 23060 5ustar sunshinesunshineMiscKit2/Examples/JavaScrollDir/English.lproj/Info.nib/classes.nib100444 1750 1750 472 6710113417 25243 0ustar sunshinesunshine{ IBClasses = ( { CLASS = DirController; LANGUAGE = Java; OUTLETS = {infoPanel = id; infoText = id; }; SUPERCLASS = java.lang.Object; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } ); IBVersion = 1; }MiscKit2/Examples/JavaScrollDir/English.lproj/Info.nib/objects.nib100444 1750 1750 4237 6757227630 25300 0ustar sunshinesunshine streamtyped@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ DirControlleri NSTextTemplate.NSViewTemplate.NSView) NSResponder NSClipView: NSScrollView @@@@ffffffffNSMutableArrayNSArray NSTextField NSControl)!  icc@NSTextFieldCell= NSActionCellNSCell>ii@@@@8Copyright (C) 1999 by Paul S. McCarthy and Eric SunshineNSFont[28c]Helveticaf ci:c@@NSColor@@@System controlColorff*?ffff:NSBox)"ff@@cccBoxHelvetica  nBox ;MiscTableScroll ExampleHelvetica°textBackgroundColorcontrolTextColor NSImageView NSMutableSetNSSetINSFilenamesPboardTypeNeXT filename pasteboard typet0000 NSImageCell)NSCustomResource)NSImage JavaScrollDiriii NSScrollerNNff: _doScroller:ܒWWCr? R Rےޒffffi NN@@cccȄNSCursorז؄ NSIBeamCursorNNNSText textColorˆHelvetica ƳN̢NSWindowTemplate) iiffffi@@@@@cox`InfoNSPanelView¢镙鄘Info File's OwnerлNSNibOutletConnectorNSNibConnector鄘 infoPanel󲕙infoText@iɶɹɽ ɢ ɕ ɦ əɠ ɿMiscKit2/Examples/JavaScrollDir/English.lproj/JavaScrollDir-windows.nib/ 40755 1750 1750 0 6722775724 26354 5ustar sunshinesunshineMiscKit2/Examples/JavaScrollDir/English.lproj/JavaScrollDir-windows.nib/classes.nib100444 1750 1750 730 6713661775 30556 0ustar sunshinesunshine{ IBClasses = ( { ACTIONS = {info = id; openDirectory = id; runPageLayout = id; }; CLASS = DirController; LANGUAGE = Java; SUPERCLASS = java.lang.Object; }, { ACTIONS = {destroy = id; export = id; openFile = id; printDirectory = id; }; CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } ); IBVersion = 1; }MiscKit2/Examples/JavaScrollDir/English.lproj/JavaScrollDir-windows.nib/objects.nib100444 1750 1750 6162 6713661775 30577 0ustar sunshinesunshine streamtyped@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ NSApplicationi) NSMenuItemANSMenui@@@EditNSMutableArrayNSArray i@@IIi@@@@:i@CutxNSCustomResource)NSImageNSMenuCheckmarkNSMenuMixedStatePastev Select AllaCopycFontBoldbItalici _NSFontMenu Font Panel...t DirControllerFormatŸ Colors...CFontsubmenuAction:HelpʟAbout JavaScrollDirɂ JavaScrollDirП Directoryɂ Directory՟Open...o՟Closew՟ Export...s՟ɂ՟ Page Setup...P՟Print...p՟ɂ՟ExitqПFileɂFileOpenODeleterПEditɂПFormatɂ†ПWindowɂWindowCascadeɂ Minimize Allhɂ_NSWindowsMenuПServicesɂServices_NSServicesMenuφ _NSMainMenuHelpɂʆՖЖՖЖЖӖʖ–ЖՖЖՖЕՖ– ՖЖ NSFontManagerՖЖՖ*Copy File's Owner18 DirController11ʅ…Pasteɖɖ鄘7섘1℘4Editτ519Յ􄘘1110ɖń13ᄘ3ɖCut脘6ЄMainMenu儘522 ۄ12 Font Managerɖ4ބ21 Select All NSMutableSetNSSetINSNibControlConnectorNSNibConnector@@@cut:4copy:4paste:4 selectAll:NSNibOutletConnector5delegate4ؿopenDirectory:4arrangeInFront:4hide:4ŅorderFrontColorPanel:4⿄runPageLayout:4镄 terminate:4Ϳinfo:4兄printDirectory:4񅄘 openFile:4􅄘destroy:4ޅexport:4ۅ performClose:4orderFrontFontPanel:4 addFontTrait:4 addFontTrait:>@i&L )聮3.ʁ_RIZ=2ŁV;1D7/F၆ ށ90N*b遭ρ @BPT쁞⁅́J偈H\XB%MiscKit2/Examples/JavaScrollDir/English.lproj/JavaScrollDir.nib/ 40755 1750 1750 0 6722775724 24664 5ustar sunshinesunshineMiscKit2/Examples/JavaScrollDir/English.lproj/JavaScrollDir.nib/classes.nib100444 1750 1750 734 6713661675 27071 0ustar sunshinesunshine{ IBClasses = ( { ACTIONS = {info = id; openDirectory = id; runPageLayout = id; }; CLASS = DirController; LANGUAGE = Java; SUPERCLASS = java.lang.Object; }, { ACTIONS = {destroy = id; export = id; openSelected = id; printDirectory = id; }; CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } ); IBVersion = 1; }MiscKit2/Examples/JavaScrollDir/English.lproj/JavaScrollDir.nib/objects.nib100444 1750 1750 6731 6713661675 27110 0ustar sunshinesunshine streamtyped@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ NSApplicationi. NSMenuItemANSMenui@@@FontNSMutableArrayNSArray i@@IIi@@@@:i@ Show FontstNSCustomResource)NSImageNSMenuCheckmarkNSMenuMixedStateBoldb _NSFontMenuItaliciWindow Close Windoww Zoom WindowMinimize WindowmArrange in Front_NSWindowsMenu JavaScrollDirNSAppleMenuImagesubmenuAction:InfoǟAbout JavaScrollDir _NSAppleMenu Directory΄ ϟOpen...oϟϟCloseϟ Export...sϟϟ Page Setup...PϟPrint...pϟϟQuitqFile感OpenODeleterEditEditCutxCopycPastevClear Select AllaFormatFormatFont Show ColorsCServicesServices_NSServicesMenu _NSMainMenu͖Ėϖǖϖϖϖϖϖ 疄 NSFontManager疄 DirController ϖϖ񖳰 ϙ221帖221ׄ1 File's Owner1823 Font ManagerMainMenu焘1츖19鄘1 DirController1103ո21111 2 NSMutableSetNSSetINSNibOutletConnectorNSNibConnector@@@delegateNSNibControlConnector3⅄ terminate:6 selectAll:6paste:6copy:6􅄘cut:6delete:6info:6openDirectory:6runPageLayout:6ޅprintDirectory:6 orderFrontColorPanel:6 performZoom:6performMiniaturize:6 performClose:6arrangeInFront:6Յ performClose:6셄destroy:6ׅexport:6酄 openSelected:6 addFontTrait:6 addFontTrait:6orderFrontFontPanel:F@iF9J;TPDсׁT )RMEB4PLρaہ<ށVR^5=H:g8\>12ǁOځ́ၺD5>oGNKāXUpՁB`CFq⁽:ZXLJI<H N@ʁԁ?MiscKit2/Examples/JavaScrollDir/English.lproj/SD_PageLayout.nib/ 40755 1750 1750 0 6722775724 24625 5ustar sunshinesunshineMiscKit2/Examples/JavaScrollDir/English.lproj/SD_PageLayout.nib/data.classes100444 1750 1750 577 6705554627 27177 0ustar sunshinesunshine"FirstResponder" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSObject; }; "SD_PageLayout" = { ACTIONS = {}; OUTLETS = { accessoryWindow = id; bottomMarginField = id; centerMatrix = id; leftMarginField = id; paginationMatrix = id; rightMarginField = id; topMarginField = id; }; SUPERCLASS = Object; }; MiscKit2/Examples/JavaScrollDir/English.lproj/SD_PageLayout.nib/objects.nib100444 1750 1750 6544 6705554627 27052 0ustar sunshinesunshine typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSString+ SD_PageLayouti NSButtonCell9 NSActionCellNSCell<ii@@@@CellNSFont[20c] Helveticaf ci:NSMatrix< NSControl)NSView) NSResponderNSBox) @@@@ffffffffNSMutableArrayNSArray NSTextField1..icc@NSTextFieldCell=q@c@@NSColor@@@SystemtextBackgroundColorffcontrolTextColor:#..Left:1..q@ ..Right:¯..q@ůc#66Top:ǯ..q@ʯc 66Bottom:̯77sIIff@@cccMarginsљә<<<<Ӓ#iiii:::ffffi@@@@@DՄ ssIi@@@@@7@NSCustomResource)NSImageAlign.HLeft.VTopն7@ٖڄAlign.HCentered.VTopն7@ٖڄAlign.HLeft.VCenteredն7@ٖڄAlign.HCentered.VCentered7@؅׆FAFAђJSJSCenterссihqhq Paginationd_d_ZZZZD 7@ٖڄPagination.HFit.VFit7@ٖڄPagination.HAuto.VFit7@ٖڄPagination.HFit.VAuto7@ٖڄPagination.HAuto.VAuto7@ٖڄPagination.HClip.VAuto7@ٖڄPagination.HFit.VClip7@ٖڄPagination.HAuto.VClip7@ٖڄPagination.HClip.VClip7@󆶁7@ٖڄPagination.HClip.VFitՖѨ®󠖥ՖNSWindowTemplate) iiffffi@@@@@cс`xWindowNSWindowViewffffZ Ֆ𠖮̮ǮՖӖŮіʮ File's OwnerWindow NSMutableSetNSSetINSIBOutletConnector NSIBConnectorleftMarginFieldaccessoryWindowʄbottomMarginFieldrightMarginFieldńtopMarginFieldń nextKeyViewdelegate ŕ" "ʕ"Մ centerMatrixpaginationMatrixՠ nextKeyView--1@i".1  (- !'',%%*&+! $ $)#*. &/2#(,06MiscKit2/Examples/JavaScrollDir/Align.HLeft.VCentered.tiff100444 1750 1750 430 6757227623 23531 0ustar sunshinesunshineMM*J*JTVO(L-0b(-aS j?P8$ BaP (R;3 ' 'MiscKit2/Examples/JavaScrollDir/Align.HLeft.VTop.tiff100444 1750 1750 426 6757227624 22550 0ustar sunshinesunshineMM*H*J*VG$` ad9j91Ā ?P8$ BaP (R91 ' 'MiscKit2/Examples/JavaScrollDir/JavaScrollDir.ico100444 1750 1750 3066 6757227624 22172 0ustar sunshinesunshine F 0.(^( @wwwwwwwwwwwwwwpwppwppwppppwppwpwpwppppwppwppwpwpppwppwpwpppwppwpwwpwppwppppwppwwwpwwpwppwwwpwwpwppwwwpwwp( @CC{C{AUTCCC{ATCC{C{AUUTC{C{AUUTC{CC{C{B BB BB BB B( wwwwwwppwpwxpppwpwwpwpppwwpwpwwpwp( @BGGBGDGD D D MiscKit2/Examples/JavaScrollDir/JavaScrollDir.tiff100444 1750 1750 14004 6757227624 22362 0ustar sunshinesunshineMM*U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_U_ 00(RB ' 'MMUMUMU5TMMUMUMU5TMMUMUMU5T 0OOOOOO OUO OUUO OUO ꪯOUOꪯ OO OUUUUUUUUT 00(R@@ ' 'MiscKit2/Examples/JavaScrollDir/BUGS.txt100444 1750 1750 5173 6757227610 20274 0ustar sunshinesunshine//----------------------------------------------------------------------------- // JavaScrollDir BUGS // $Id: BUGS.txt,v 1.2 99/06/30 09:29:20 sunshine Exp $ //----------------------------------------------------------------------------- BUGS: ---- - Formatted file modification date is two hours earlier than actual date (at least in the Eastern time zone). - Each time a new window is opened on MacOS/X Server DR2 for Mach or YellowBox DR2 for Windows, it is taller than the size set with -setFrame:display: by the height of the menu bar. This is an AppKit bug which was introduced in DR2. FIXED: ----- v1.1 - File attributes displayed for ".." are actually those for ".". - JavaScrollDir crashes with message sent to freed object. The example program launches, loads, and displays a directory window correctly but crashes upon activation of the window. The crash results from an attempt by the AppKit to dispatch -respondsToSelector: to a freed object. This crash does not occur on DR2. [While researching the problem, I ran across an item in the latest Java release notes on the Apple web site which mentioned that the behavior of the Objective-C to Java bridge changed with regards to pure Java objects which have only a "weak" reference on the Objective-C side. As of MacOS/X Server, the bridge now deallocates the Objective-C proxy object of weakly referenced pure Java objects if the object's proxy has not been retained on the Objective-C side. Weakly referenced objects are actually a common occurrence. For instance a pure Java object as an NSWindow's delegate, is one example. The NSWindow merely maintains a pointer to the Java object's Objective-C proxy, but does not retain it. Consequently the bridge thinks that the proxy is unused and should be deallocated. On DR2, these weakly referenced proxy objects were merely leaked. In the case of JavaScrollDir, DirWindow is a pure Java object which is both the NSWindow's and MiscTableScroll's delegate. Consequently, DirWindow's Objective-C proxy gets freed by the bridge even though NSWindow and MiscTableScroll are still pointing at it. To fix the problem some entity on the Objective-C side needs to retain DirWindow's Objective-C proxy object. A simple way to do this is to store a reference to the DirWindow in an NSArray. As it turns out, DirWindow already maintains a list of active DirWindow objects, named OPEN_DIRS, in a Java Vector object. Simply converting OPEN_DIRS from a Vector to an NSArray fixes the problem by creating a strong reference on the Objective-C side.] MiscKit2/Examples/JavaScrollDir/CustomInfo.plist100444 1750 1750 3623 6757227632 22140 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // CustomInfo.plist // // Makefile automatically inserts contents of this file into Info.plist // which is stored in the application's Resources directory. This file // configures the Java engine so that it can locate the MiscTableScroll // byte-code files and run-time library. It also installs the Null // Security Manager which allows the Java to access MiscTableScroll over // the Java-to-Objective-C bridge. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: CustomInfo.plist,v 1.1 99/06/14 15:48:11 sunshine Exp $ // $Log: CustomInfo.plist,v $ // Revision 1.1 99/06/14 15:48:11 sunshine // v1.1: Property list which configures application for Java use. // //----------------------------------------------------------------------------- { MiscTableScrollUseNullSecurityManager = Yes; MiscTableScrollAddLibrarySearchPaths = Yes; NSJavaUserPath = ( /Local/Library/Frameworks/MiscTableScroll.framework/Resources/Java, /Apple/Local/Library/Frameworks/MiscTableScroll.framework/Resources/Java, /Network/Library/Frameworks/MiscTableScroll.framework/Resources/Java ); } MiscKit2/Examples/JavaScrollDir/Defaults.java100444 1750 1750 21646 6757227611 21431 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit disibution. Please refer to that file // for a list of all applicable permissions and resictions. // //============================================================================= //----------------------------------------------------------------------------- // Defaults.java // // Simplified interface to Yellow Box defaults system. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: Defaults.java,v 1.1 99/06/14 15:41:52 sunshine Exp $ // $Log: Defaults.java,v $ // Revision 1.1 99/06/14 15:41:52 sunshine // v1.1: Defaults manager. // //----------------------------------------------------------------------------- import com.apple.yellow.foundation.*; import com.apple.yellow.application.*; class Defaults { private static final String FONT_NAME_KEY = "Name"; private static final String FONT_SIZE_KEY = "Size"; //----------------------------------------------------------------------------- // commit() //----------------------------------------------------------------------------- static void commit() { NSUserDefaults.standardUserDefaults().synchronize(); } //----------------------------------------------------------------------------- // set(String) //----------------------------------------------------------------------------- static void set( String key, String s ) { NSUserDefaults.standardUserDefaults().setObjectForKey( s, key ); } //----------------------------------------------------------------------------- // getString() //----------------------------------------------------------------------------- static String getString( String key, String fallback ) { String s = NSUserDefaults.standardUserDefaults().stringForKey( key ); if (s == null) s = fallback; return s; } //----------------------------------------------------------------------------- // set(int) //----------------------------------------------------------------------------- static void set( String key, int i ) { NSUserDefaults.standardUserDefaults().setIntegerForKey( i, key ); } //----------------------------------------------------------------------------- // getInteger() //----------------------------------------------------------------------------- static int getInteger( String key, int fallback ) { NSUserDefaults defs = NSUserDefaults.standardUserDefaults(); if (defs.objectForKey(key) != null) return defs.integerForKey( key ); else return fallback; } //----------------------------------------------------------------------------- // getInteger(min,max) //----------------------------------------------------------------------------- static int getInteger( String key, int fallback, int min, int max ) { int n = getInteger( key, fallback ); if (n < min) n = min; else if (n > max) n = max; return n; } //----------------------------------------------------------------------------- // getInteger(min) //----------------------------------------------------------------------------- static int getInteger( String key, int fallback, int min ) { return getInteger( key, fallback, min, Integer.MAX_VALUE ); } //----------------------------------------------------------------------------- // set(float) //----------------------------------------------------------------------------- static void set( String key, float f ) { NSUserDefaults.standardUserDefaults().setFloatForKey( f, key ); } //----------------------------------------------------------------------------- // getFloat() //----------------------------------------------------------------------------- static float getFloat( String key, float fallback ) { NSUserDefaults defs = NSUserDefaults.standardUserDefaults(); if (defs.objectForKey(key) != null) return defs.floatForKey( key ); else return fallback; } //----------------------------------------------------------------------------- // set(NSColor) //----------------------------------------------------------------------------- static void set( String key, NSColor c ) { NSData d = NSArchiver.archivedDataWithRootObject(c); NSUserDefaults.standardUserDefaults().setObjectForKey( d, key ); } //----------------------------------------------------------------------------- // getColor() //----------------------------------------------------------------------------- static NSColor getColor( String key, NSColor fallback ) { NSData d = NSUserDefaults.standardUserDefaults().dataForKey( key ); if (d != null) return (NSColor)NSUnarchiver.unarchiveObjectWithData(d); else return fallback; } //----------------------------------------------------------------------------- // set(boolean) //----------------------------------------------------------------------------- static void set( String key, boolean b ) { NSUserDefaults.standardUserDefaults().setBooleanForKey( b, key ); } //----------------------------------------------------------------------------- // getBoolean() //----------------------------------------------------------------------------- static boolean getBoolean( String key, boolean fallback ) { NSUserDefaults defs = NSUserDefaults.standardUserDefaults(); if (defs.objectForKey(key) != null) return defs.booleanForKey( key ); else return fallback; } //----------------------------------------------------------------------------- // set(NSFont) //----------------------------------------------------------------------------- static void set( String key, NSFont f ) { NSMutableDictionary d = new NSMutableDictionary(); d.setObjectForKey( f.fontName(), FONT_NAME_KEY ); d.setObjectForKey( Float.toString(f.pointSize()), FONT_SIZE_KEY ); NSUserDefaults.standardUserDefaults().setObjectForKey( d, key ); } //----------------------------------------------------------------------------- // getFont() //----------------------------------------------------------------------------- static NSFont getFont( String key, NSFont fallback ) { NSFont font = fallback; NSDictionary d = NSUserDefaults.standardUserDefaults().dictionaryForKey( key ); if (d != null) { String name = (String)d.objectForKey( FONT_NAME_KEY ); String size = (String)d.objectForKey( FONT_SIZE_KEY ); if (name != null && name.length() > 0 && size != null) { try { Float f = Float.valueOf( size ); NSFont p = NSFont.fontWithNameAndSize( name, f.floatValue() ); if (p != null) font = p; } catch (NumberFormatException e) {} } } return font; } //----------------------------------------------------------------------------- // set(NSSize) //----------------------------------------------------------------------------- static void set( String key, NSSize s ) { NSUserDefaults.standardUserDefaults().setObjectForKey( s.toString(), key ); } //----------------------------------------------------------------------------- // getSize() //----------------------------------------------------------------------------- static NSSize getSize( String key, NSSize fallback ) { String s = NSUserDefaults.standardUserDefaults().stringForKey( key ); if (s != null) return NSSize.fromString(s); else return fallback; } //----------------------------------------------------------------------------- // set(NSPoint) //----------------------------------------------------------------------------- static void set( String key, NSPoint p ) { NSUserDefaults.standardUserDefaults().setObjectForKey( p.toString(), key ); } //----------------------------------------------------------------------------- // getPoint() //----------------------------------------------------------------------------- static NSPoint getPoint( String key, NSPoint fallback ) { String s = NSUserDefaults.standardUserDefaults().stringForKey( key ); if (s != null) return NSPoint.fromString(s); else return fallback; } //----------------------------------------------------------------------------- // set(NSRect) //----------------------------------------------------------------------------- static void set( String key, NSRect r ) { NSUserDefaults.standardUserDefaults().setObjectForKey( r.toString(), key ); } //----------------------------------------------------------------------------- // getRect() //----------------------------------------------------------------------------- static NSRect getRect( String key, NSRect fallback ) { String s = NSUserDefaults.standardUserDefaults().stringForKey( key ); if (s != null) return NSRect.fromString(s); else return fallback; } } // class Defaults MiscKit2/Examples/JavaScrollDir/DirController.java100444 1750 1750 6776 6757227611 22433 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirController.java // // Manages application which demonstrates use of TableScroll. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirController.java,v 1.1 99/06/14 15:40:39 sunshine Exp $ // $Log: DirController.java,v $ // Revision 1.1 99/06/14 15:40:39 sunshine // v1.1: Application controller. // //----------------------------------------------------------------------------- import java.util.Enumeration; import com.apple.yellow.foundation.*; import com.apple.yellow.application.*; public class DirController { NSPanel infoPanel; NSText infoText; //----------------------------------------------------------------------------- // applicationDidFinishLaunching //----------------------------------------------------------------------------- public void applicationDidFinishLaunching( NSNotification n ) { DirWindow.launchDir( null ); } //----------------------------------------------------------------------------- // applicationWillTerminate //----------------------------------------------------------------------------- public void applicationWillTerminate( NSNotification n ) { Defaults.commit(); } //----------------------------------------------------------------------------- // runPageLayout //----------------------------------------------------------------------------- public void runPageLayout( Object sender ) { SD_PageLayout.sharedInstance().runModal(); } //----------------------------------------------------------------------------- // openDirectory //----------------------------------------------------------------------------- public void openDirectory( Object sender ) { NSOpenPanel panel = new NSOpenPanel(); panel.setTitle( "Open Directory" ); panel.setPrompt( "Directory:" ); panel.setCanChooseDirectories( true ); panel.setCanChooseFiles( false ); panel.setAllowsMultipleSelection( true ); panel.setTreatsFilePackagesAsDirectories( true ); if (panel.runModal() == NSPanel.OKButton) { Enumeration filenames = panel.filenames().objectEnumerator(); while (filenames.hasMoreElements()) DirWindow.launchDir( (String)filenames.nextElement() ); } } //----------------------------------------------------------------------------- // info //----------------------------------------------------------------------------- public void info( Object sender ) { if (infoPanel == null) { NSApplication.loadNibNamed( "Info", this ); NSBundle b = NSBundle.bundleForClass( this.getClass() ); String s = b.pathForResource( "README", "rtf" ); if (s == null) s = b.pathForResource( "README", "rtfd" ); if (s != null) infoText.readRTFDFromFile(s); } infoPanel.makeKeyAndOrderFront(null); } } // class DirController MiscKit2/Examples/JavaScrollDir/DirWindow.java100444 1750 1750 102576 6757227632 21615 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // DirWindow.java // // Manages window which displays directory listing. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: DirWindow.java,v 1.2 99/06/30 09:30:25 sunshine Exp $ // $Log: DirWindow.java,v $ // Revision 1.2 99/06/30 09:30:25 sunshine // v1.1: Ported to final release of MacOS/X Server. // Behavior of Objective-to-Java bridge changed with regards to weakly // referenced objects. Had to accomodate new behavior by creating strong // references to avoid "message sent to freed object" error. // //----------------------------------------------------------------------------- import java.io.File; import java.text.DateFormat; import java.util.Enumeration; import com.apple.yellow.foundation.*; import com.apple.yellow.application.*; import org.misckit.yellow.application.TableScroll; class DirWindow implements java.io.FilenameFilter { private static final int ICON_SLOT = 0; private static final int NAME_SLOT = 1; private static final int LOCK_SLOT = 2; private static final int SIZE_SLOT = 3; private static final int DATE_SLOT = 4; private static final int PERM_SLOT = 5; private static final int MAX_SLOT = PERM_SLOT + 1; private static final int CASCADE_MAX = 10; private static final float CASCADE_DELTA_X = 20; private static final float CASCADE_DELTA_Y = 20; private static int CASCADE_COUNTER = 0; private static float CASCADE_ORIGIN_X; private static float CASCADE_ORIGIN_Y; private static boolean DEFAULT_AUTO_SORT = true; private static boolean DEFAULT_ROW_NUMBERS = false; private static boolean DEFAULT_SHOW_HIDDEN = false; private static boolean DEFAULT_HIGHLIGHT_DIRS = false; private static boolean DEFAULT_DRAG_UNSCALED = true; private static NSColor DEFAULT_COLOR; private static NSSize DEFAULT_WIN_SIZE; private static NSFont DEFAULT_FONT = null; private static NSMutableArray OPEN_DIRS = null; private static NSImage LOCKED_IMAGE = null; private static NSImage UNLOCKED_IMAGE = null; private static DateFormat DATE_FORMAT = DateFormat.getInstance(); private static final String COLOR_DEF = "DirColor"; private static final String SIZE_DEF = "DirSize"; private static final String FONT_DEF = "DirFont"; private static final String SORT_DEF = "AutoSort"; private static final String HIDDEN_DEF = "ShowHidden"; private static final String HLIGHT_DEF = "HighlightDirs"; private static final String UNSCALED_DEF = "DragUnscaled"; private static final String COL_SIZES_DEF = "ColSizes"; private static final String COL_ORDER_DEF = "ColOrder"; private static final String ROW_NUMBERS_DEF = "RowNumbers"; private static final String LOCKED_IMAGE_S = "Lock.secure"; private static final String UNLOCKED_IMAGE_S = "Lock.insecure"; private static final String DA_SHORT_NAME = "ShortName"; private static final String DA_SOFT_LINK = "SoftLink"; private static final String DA_IS_DIRECTORY = "IsDirectory"; private static final String DA_IS_LOCKED = "IsLocked"; private static final String DA_CAN_TOGGLE_LOCK = "CanToggleLock"; private static final String DA_SCALED_ICON = "ScaledIcon"; private static final String DA_UNSCALED_ICON = "UnscaledIcon"; TableScroll scroll; NSWindow window; NSButton autoSortSwitch; NSButton cdButton; NSButton dragUnscaledSwitch; NSButton hiddenFilesSwitch; NSButton highlightSwitch; NSButton refreshButton; NSButton rowNumbersSwitch; NSTextField countField; String path; boolean writable; boolean autoSort; boolean dragUnscaled; boolean highlightDirs; boolean showHidden; //----------------------------------------------------------------------------- // initClass // // *NOTE* // This functionality can not be in a static initializer since it would // execute before NSScreen is available for query. // // *NOTE* OPEN_DIRS // An NSArray is used instead of a java.util.Vector to hold the list of // DirWindow objects in order to keep the Objective-C to Java bridge from // freeing the DirWindow's Objective-C proxy out from underneath us. // This is necessary in cases where a pure Java object, such as // DirWindow, is only referenced "weakly" on the Objective-C side. Even // though DirWindow is the delegate of both the NSWindow and the // TableScroll, we say that it is referenced weakly since neither object // "retains" it. Such weakly referenced objects are automatically freed // by the bridge since it has no way of knowing that they are needed. In // order to work around this problem, such objects must be "strongly" // referenced on the Objective-C side. In our case this is accomplished // by maintaining the list of active DirWindow objects in an NSArray // which retains each of its members. //----------------------------------------------------------------------------- private static void initClass() { if (OPEN_DIRS == null) { NSSize s = NSScreen.mainScreen().frame().size(); CASCADE_ORIGIN_X = s.width() / 4; CASCADE_ORIGIN_Y = s.height() - 60; OPEN_DIRS = new NSMutableArray(); // *NOTE* OPEN_DIRS LOCKED_IMAGE = NSImage.imageNamed( LOCKED_IMAGE_S ); UNLOCKED_IMAGE = NSImage.imageNamed( UNLOCKED_IMAGE_S ); DEFAULT_COLOR = Defaults.getColor( COLOR_DEF, NSColor.controlColor() ); DEFAULT_AUTO_SORT = Defaults.getBoolean( SORT_DEF, true ); DEFAULT_SHOW_HIDDEN = Defaults.getBoolean( HIDDEN_DEF, false ); DEFAULT_ROW_NUMBERS = Defaults.getBoolean( ROW_NUMBERS_DEF, false ); DEFAULT_HIGHLIGHT_DIRS = Defaults.getBoolean( HLIGHT_DEF, false ); DEFAULT_DRAG_UNSCALED = Defaults.getBoolean( UNSCALED_DEF, true ); } } //----------------------------------------------------------------------------- // normalizePath //----------------------------------------------------------------------------- private static String normalizePath( String s ) { File f = new File(s); try { s = f.getCanonicalPath(); } catch (java.io.IOException e) {} return s; } //----------------------------------------------------------------------------- // fmtIcon //----------------------------------------------------------------------------- private void fmtIcon( String name, File file, NSCell cell ) { NSImage i = NSWorkspace.sharedWorkspace().iconForFile( file.getPath() ); cell.setRepresentedObject(i); float w = scroll.columnSize( ICON_SLOT ); if (w == 0) w = 18; float h = scroll.uniformSizeRows(); if (h == 0) h = 18; float s = (w < h ? w : h) - 1; try { i = (NSImage)i.clone(); } catch (CloneNotSupportedException e) {} i.setScalesWhenResized( true ); i.setSize( new NSSize(s,s) ); cell.setImage(i); } //----------------------------------------------------------------------------- // fmtLock //----------------------------------------------------------------------------- private void fmtLock( String name, File file, NSCell cell ) { final boolean unlocked = writable && !name.equals(".."); cell.setState( unlocked ? 1 : 0 ); cell.setEnabled( unlocked ); } //----------------------------------------------------------------------------- // fmtName //----------------------------------------------------------------------------- private void fmtName( String name, File file, NSCell cell ) { cell.setStringValue( name ); } //----------------------------------------------------------------------------- // fmtSize //----------------------------------------------------------------------------- private void fmtSize( String name, File file, NSCell cell ) { cell.setIntValue( (int)file.length() ); } //----------------------------------------------------------------------------- // fmtDate //----------------------------------------------------------------------------- private void fmtDate( String name, File file, NSCell cell ) { java.util.Date d = new java.util.Date( file.lastModified() ); cell.setStringValue( DATE_FORMAT.format(d) ); cell.setTag( (int)file.lastModified() ); } //----------------------------------------------------------------------------- // fmtPerm //----------------------------------------------------------------------------- private void fmtPerm( String name, File file, NSCell cell ) { final boolean r = file.canRead(); final boolean w = file.canWrite(); String s; if (r && w) s = "read/write"; else if (r) s = "read"; else if (w) s = "write"; else s = "none"; cell.setStringValue(s); cell.setTag( file.isDirectory() ? 1 : 0); } //----------------------------------------------------------------------------- // formatCell //----------------------------------------------------------------------------- private void formatCell( String name, File f, NSCell cell, int c ) { switch (c) { case ICON_SLOT: fmtIcon( name, f, cell ); break; case NAME_SLOT: fmtName( name, f, cell ); break; case LOCK_SLOT: fmtLock( name, f, cell ); break; case SIZE_SLOT: fmtSize( name, f, cell ); break; case DATE_SLOT: fmtDate( name, f, cell ); break; case PERM_SLOT: fmtPerm( name, f, cell ); break; } } //----------------------------------------------------------------------------- // cascade //----------------------------------------------------------------------------- private void cascade() { float left = CASCADE_ORIGIN_X + (CASCADE_DELTA_X * CASCADE_COUNTER); float top = CASCADE_ORIGIN_Y - (CASCADE_DELTA_Y * CASCADE_COUNTER); window.setFrameTopLeftPoint( new NSPoint(left, top) ); if (++CASCADE_COUNTER >= CASCADE_MAX) CASCADE_COUNTER = 0; } //----------------------------------------------------------------------------- // isDirAtRow //----------------------------------------------------------------------------- private boolean isDirAtRow( int r ) { return (scroll.tagAtLocation( r, PERM_SLOT ) != 0); } //----------------------------------------------------------------------------- // updateButtons //----------------------------------------------------------------------------- private void updateButtons() { final boolean enable = scroll.numberOfSelectedRows() == 1 && isDirAtRow( scroll.selectedRow() ); if (enable != cdButton.isEnabled()) cdButton.setEnabled( enable ); } //----------------------------------------------------------------------------- // trySendingMessage //----------------------------------------------------------------------------- private void trySendingMessage( String message, Object target, Object arg, Class argClass ) { try { java.lang.reflect.Method method = target.getClass().getMethod(message, new Class[] { argClass }); method.invoke( target, new Object[] { arg } ); } catch (Exception e) {} } //----------------------------------------------------------------------------- // trySendingMessage //----------------------------------------------------------------------------- private void trySendingMessage( String message, Object target, Object arg ) { trySendingMessage( message, target, arg, arg.getClass() ); } //----------------------------------------------------------------------------- // setRowColorAndUseOwner //----------------------------------------------------------------------------- private void setRowColorAndUseOwner(int row, NSColor color, boolean useOwner) { for (int i = MAX_SLOT; i-- >= 0; ) { NSCell cell = scroll.cellAtLocation( row, i ); if (!useOwner) trySendingMessage( "setBackgroundColor", cell, color ); else { trySendingMessage( "setOwnerBackgroundColor", cell, color ); trySendingMessage( "setUseOwnerBackgroundColor", cell, new Boolean(true), boolean.class ); } } } //----------------------------------------------------------------------------- // scrollColor //----------------------------------------------------------------------------- private NSColor scrollColor() { if (DEFAULT_COLOR.equals( NSColor.controlColor() )) return TableScroll.defaultBackgroundColor(); else return DEFAULT_COLOR; } //----------------------------------------------------------------------------- // highlightRow //----------------------------------------------------------------------------- private void highlightRow( int r, boolean flag ) { if (flag) setRowColorAndUseOwner( r, NSColor.cyanColor(), false ); else setRowColorAndUseOwner( r, scrollColor(), true ); } //----------------------------------------------------------------------------- // refreshHighlighting //----------------------------------------------------------------------------- private void refreshHighlighting( boolean flag ) { for (int i = scroll.numberOfRows(); i-- > 0; ) if (isDirAtRow(i)) highlightRow( i, flag ); } //----------------------------------------------------------------------------- // releaseImages //----------------------------------------------------------------------------- private void releaseImages() { for (int i = scroll.numberOfRows(); i-- > 0; ) { NSCell cell = scroll.cellAtLocation( i, ICON_SLOT ); cell.setImage( null ); // Scaled image. cell.setRepresentedObject( null ); // Unscaled image. } } //----------------------------------------------------------------------------- // fullPathAtRow //----------------------------------------------------------------------------- private String fullPathAtRow( int r ) { return path + File.separator + scroll.stringValueAtLocation(r, NAME_SLOT); } //----------------------------------------------------------------------------- // tableScrollChangeFont //----------------------------------------------------------------------------- public void tableScrollChangeFont( NSNotification n ) { DEFAULT_FONT = (NSFont)n.userInfo().objectForKey( "NewFont" ); Defaults.set( FONT_DEF, DEFAULT_FONT ); } //----------------------------------------------------------------------------- // tableScrollSlotResized //----------------------------------------------------------------------------- public void tableScrollSlotResized( NSNotification n ) { Defaults.set( COL_SIZES_DEF, scroll.columnSizesAsString() ); } //----------------------------------------------------------------------------- // saveSlotOrderForBorder //----------------------------------------------------------------------------- private void saveSlotOrderForBorder( NSNotification n ) { int border = ((Integer)n.userInfo().objectForKey( "Border" )).intValue(); if (border == TableScroll.BORDER_COLUMN) Defaults.set( COL_ORDER_DEF, scroll.columnOrderAsString() ); } //----------------------------------------------------------------------------- // tableScrollSlotDragged //----------------------------------------------------------------------------- public void tableScrollSlotDragged( NSNotification n ) { saveSlotOrderForBorder(n); } //----------------------------------------------------------------------------- // tableScrollSlotSortReversed //----------------------------------------------------------------------------- public void tableScrollSlotSortReversed( NSNotification n ) { saveSlotOrderForBorder(n); } //----------------------------------------------------------------------------- // tableScrollCanEditAtLocation //----------------------------------------------------------------------------- public boolean tableScrollCanEditAtLocation( TableScroll ts, NSEvent event, int row, int col ) { return ((event == null || event.clickCount() == 2) && col == NAME_SLOT && ts.cellAtLocation( row, LOCK_SLOT ).state() != 0); } //----------------------------------------------------------------------------- // tableScrollDraggingSourceOperationMask //----------------------------------------------------------------------------- public int tableScrollDraggingSourceOperationMask( TableScroll s, boolean isLocal ) { return NSDraggingInfo.DragOperationAll; } //----------------------------------------------------------------------------- // tableScrollIgnoreModifierKeysWhileDragging //----------------------------------------------------------------------------- public boolean tableScrollIgnoreModifierKeysWhileDragging( TableScroll s ) { return false; } //----------------------------------------------------------------------------- // tableScrollPreparePasteboardForDragOperationAtLocation //----------------------------------------------------------------------------- public void tableScrollPreparePasteboardForDragOperationAtLocation( TableScroll s, NSPasteboard pb, int row, int col ) { String file = fullPathAtRow( row ); pb.declareTypes( new NSArray(NSPasteboard.FilenamesPboardType), null ); pb.setPropertyListForType( new NSArray(file), NSPasteboard.FilenamesPboardType ); } //----------------------------------------------------------------------------- // tableScrollAllowDragOperationAtLocation //----------------------------------------------------------------------------- public boolean tableScrollAllowDragOperationAtLocation( TableScroll s, int row, int col ) { return (col == ICON_SLOT); } //----------------------------------------------------------------------------- // tableScrollImageForDragOperationAtLocation //----------------------------------------------------------------------------- public NSImage tableScrollImageForDragOperationAtLocation( TableScroll s, int row, int col ) { return dragUnscaled ? (NSImage)s.cellAtLocation(row,col).representedObject() : null; } //----------------------------------------------------------------------------- // addFile //----------------------------------------------------------------------------- private void addFile( String name, File file ) { scroll.addRow(); int r = scroll.numberOfRows() - 1; for (int c = 0; c < MAX_SLOT; c++) formatCell( name, file, scroll.cellAtLocation(r, c), c ); if (highlightDirs && file.isDirectory()) highlightRow( r, true ); } //----------------------------------------------------------------------------- // accept -- java.io.FilenameFilter interface conformance. //----------------------------------------------------------------------------- public boolean accept( File dir, String name ) { return (showHidden || !name.startsWith(".")); } //----------------------------------------------------------------------------- // fillScroll //----------------------------------------------------------------------------- private void fillScroll() { File directory = new File( path ); writable = directory.canWrite(); long totalBytes = 0; releaseImages(); scroll.empty(); addFile( "..", new File(normalizePath(path + File.separator + "..")) ); String[] files = directory.list( this ); for (int i = 0; i < files.length; i++) { String name = files[i]; File file = new File( directory, name ); totalBytes += file.length(); addFile( name, file ); } if (scroll.autoSortRows()) scroll.sortRows(); scroll.sizeToCells(); countField.setStringValue( scroll.numberOfRows() + " files " + totalBytes + " bytes" ); updateButtons(); } //----------------------------------------------------------------------------- // setPath //----------------------------------------------------------------------------- private void setPath( String dirname ) { if (dirname == null) dirname = NSSystem.currentHomeDirectory(); if (dirname == null || dirname.length() == 0) dirname = "/"; path = dirname; window.setTitleWithRepresentedFilename( path ); } //----------------------------------------------------------------------------- // loadDirectory //----------------------------------------------------------------------------- private void loadDirectory( String dirname ) { setPath( dirname ); fillScroll(); } //----------------------------------------------------------------------------- // export //----------------------------------------------------------------------------- public void export( Object sender ) { TableScroll.Exporter.commonInstance().exportTableScroll( scroll ); } //----------------------------------------------------------------------------- // printDirectory //----------------------------------------------------------------------------- public void printDirectory( Object sender ) { scroll.print( null ); } //----------------------------------------------------------------------------- // openSelected //----------------------------------------------------------------------------- public void openSelected( Object sender ) { if (scroll.hasRowSelection()) { NSArray list = scroll.selectedRows(); for (int i = list.count(); i-- > 0; ) { final int r = ((Integer)list.objectAtIndex(i)).intValue(); String s = fullPathAtRow(r); if (isDirAtRow(r)) launchDir(s); else NSWorkspace.sharedWorkspace().openFile(s); } } } //----------------------------------------------------------------------------- // destroy //----------------------------------------------------------------------------- public void destroy( Object sender ) { if (writable && scroll.hasRowSelection()) { if (NSAlertPanel.runAlert( "Delete Files", "Delete selected files?", "Yes", "No", null ) == NSAlertPanel.DefaultReturn) { NSArray list = scroll.selectedRows(); for (int i = list.count(); i-- > 0; ) { final int r = ((Integer)list.objectAtIndex(i)).intValue(); File file = new File( fullPathAtRow(r) ); file.delete(); } fillScroll(); } } } //----------------------------------------------------------------------------- // rename //----------------------------------------------------------------------------- private boolean rename( String oldName, String newName ) { File oldFile = new File( path, oldName ); File newFile = new File( path, newName ); final boolean ok = oldFile.renameTo( newFile ); if (!ok) NSAlertPanel.runCriticalAlert( "Renamed Failed", "Unable to rename \"" + oldName + "\" to \"" + newName + "\".", "OK", null, null ); return ok; } //----------------------------------------------------------------------------- // controlTextShouldEndEditing //----------------------------------------------------------------------------- public boolean controlTextShouldEndEditing( NSControl control, NSText text ) { boolean accept = true; final int r = scroll.clickedRow(); final int c = scroll.clickedColumn(); String oldName = scroll.cellAtLocation(r, c).stringValue(); String newName = text.string(); if (!newName.equals( oldName )) accept = rename( oldName, newName ); if (!accept) text.setString( oldName ); return accept; } //----------------------------------------------------------------------------- // refreshPressed //----------------------------------------------------------------------------- public void refreshPressed( Object sender ) { scroll.abortEditing(); fillScroll(); } //----------------------------------------------------------------------------- // cdPressed //----------------------------------------------------------------------------- public void cdPressed( Object sender ) { scroll.abortEditing(); if (scroll.numberOfSelectedRows() == 1) { int row = scroll.selectedRow(); if (isDirAtRow( row )) loadDirectory( normalizePath(fullPathAtRow(row)) ); } } //----------------------------------------------------------------------------- // rowNumbersClick //----------------------------------------------------------------------------- public void rowNumbersClick( Object sender ) { final boolean newVal = (rowNumbersSwitch.state() != 0); final boolean oldVal = scroll.rowTitlesOn(); if (newVal != oldVal) { DEFAULT_ROW_NUMBERS = newVal; scroll.setRowTitlesOn( DEFAULT_ROW_NUMBERS ); Defaults.set( ROW_NUMBERS_DEF, DEFAULT_ROW_NUMBERS ); } } //----------------------------------------------------------------------------- // autoSortClick //----------------------------------------------------------------------------- public void autoSortClick( Object sender ) { final boolean switchState = (autoSortSwitch.state() != 0); scroll.abortEditing(); if (autoSort != switchState) { DEFAULT_AUTO_SORT = autoSort = switchState; Defaults.set( SORT_DEF, DEFAULT_AUTO_SORT ); scroll.setAutoSortRows( switchState ); if (switchState) scroll.sortRows(); } } //----------------------------------------------------------------------------- // hiddenFilesClick //----------------------------------------------------------------------------- public void hiddenFilesClick( Object sender ) { final boolean switchState = (hiddenFilesSwitch.state() != 0); scroll.abortEditing(); if (showHidden != switchState) { DEFAULT_SHOW_HIDDEN = showHidden = switchState; Defaults.set( HIDDEN_DEF, DEFAULT_SHOW_HIDDEN ); fillScroll(); } } //----------------------------------------------------------------------------- // highlightClick //----------------------------------------------------------------------------- public void highlightClick( Object sender ) { final boolean switchState = (highlightSwitch.state() != 0); scroll.abortEditing(); if (highlightDirs != switchState) { DEFAULT_HIGHLIGHT_DIRS = highlightDirs = switchState; Defaults.set( HLIGHT_DEF, DEFAULT_HIGHLIGHT_DIRS ); refreshHighlighting( highlightDirs ); scroll.setNeedsDisplay( true ); } } //----------------------------------------------------------------------------- // dragUnscaledClick //----------------------------------------------------------------------------- public void dragUnscaledClick( Object sender ) { final boolean switchState = (dragUnscaledSwitch.state() != 0); if (dragUnscaled != switchState) { DEFAULT_DRAG_UNSCALED = dragUnscaled = switchState; Defaults.set( UNSCALED_DEF, DEFAULT_DRAG_UNSCALED ); } } //----------------------------------------------------------------------------- // lockClick //----------------------------------------------------------------------------- public void lockClick( Object sender ) { TableScroll s = (TableScroll)sender; if (s.autoSortRows()) s.sortRow( s.clickedRow() ); } //----------------------------------------------------------------------------- // scrollClick //----------------------------------------------------------------------------- public void scrollClick( Object sender ) { updateButtons(); } //----------------------------------------------------------------------------- // scrollDoubleClick //----------------------------------------------------------------------------- public void scrollDoubleClick( Object sender ) { openSelected( sender ); } //----------------------------------------------------------------------------- // activateWindow //----------------------------------------------------------------------------- private void activateWindow() { window.makeKeyAndOrderFront( null ); } //----------------------------------------------------------------------------- // windowShouldClose //----------------------------------------------------------------------------- public boolean windowShouldClose( Object sender ) { scroll.abortEditing(); window.setDelegate( null ); releaseImages(); OPEN_DIRS.removeIdenticalObject( this ); return true; } //----------------------------------------------------------------------------- // windowDidResize //----------------------------------------------------------------------------- public void windowDidResize( NSNotification n ) { NSRect r = ((NSWindow)n.object()).frame(); if (r.width () != DEFAULT_WIN_SIZE.width () || r.height() != DEFAULT_WIN_SIZE.height()) { DEFAULT_WIN_SIZE = r.size(); Defaults.set( SIZE_DEF, DEFAULT_WIN_SIZE ); } } //----------------------------------------------------------------------------- // setDefaultColor //----------------------------------------------------------------------------- private void setDefaultColor( NSColor c ) { DEFAULT_COLOR = c; Defaults.set( COLOR_DEF, c ); } //----------------------------------------------------------------------------- // setColors //----------------------------------------------------------------------------- private void setColors( NSColor c ) { window.setBackgroundColor(c); scroll.setBackgroundColor( scrollColor() ); window.display(); } //----------------------------------------------------------------------------- // draggingEntered //----------------------------------------------------------------------------- public int draggingEntered( NSDraggingInfo info ) { return (info.draggingSourceOperationMask() & NSDraggingInfo.DragOperationGeneric); } //----------------------------------------------------------------------------- // performDragOperation //----------------------------------------------------------------------------- public boolean performDragOperation( NSDraggingInfo info ) { setDefaultColor( NSColor.colorFromPasteboard(info.draggingPasteboard()) ); setColors( DEFAULT_COLOR ); return true; } //----------------------------------------------------------------------------- // initDefaults //----------------------------------------------------------------------------- private void initDefaults() { if (DEFAULT_FONT == null) { DEFAULT_WIN_SIZE = window.frame().size(); DEFAULT_FONT = Defaults.getFont( FONT_DEF, scroll.font() ); } } //----------------------------------------------------------------------------- // loadDefaults //----------------------------------------------------------------------------- private void loadDefaults() { NSRect r = window.frame(); NSSize z = Defaults.getSize( SIZE_DEF, DEFAULT_WIN_SIZE ); window.setFrame( new NSRect(r.x(), r.y(), z.width(), z.height()), false ); autoSort = DEFAULT_AUTO_SORT; showHidden = DEFAULT_SHOW_HIDDEN; highlightDirs = DEFAULT_HIGHLIGHT_DIRS; dragUnscaled = DEFAULT_DRAG_UNSCALED; autoSortSwitch.setState( autoSort ? 1 : 0 ); hiddenFilesSwitch.setState( showHidden ? 1 : 0 ); highlightSwitch.setState( highlightDirs ? 1 : 0 ); dragUnscaledSwitch.setState( dragUnscaled ? 1 : 0 ); rowNumbersSwitch.setState( DEFAULT_ROW_NUMBERS ? 1 : 0 ); scroll.setRowTitlesOn( DEFAULT_ROW_NUMBERS ); scroll.setAutoSortRows( autoSort ); scroll.setFont( DEFAULT_FONT ); setColors( DEFAULT_COLOR ); String s; s = Defaults.getString( COL_SIZES_DEF, null ); if (s != null) scroll.setColumnSizes(s); s = Defaults.getString( COL_ORDER_DEF, null ); if (s != null) scroll.setColumnOrder(s); } //----------------------------------------------------------------------------- // initLockSlot //----------------------------------------------------------------------------- private void initLockSlot() { NSButtonCell proto = (NSButtonCell)scroll.columnCellPrototype( LOCK_SLOT ); proto.setButtonType( NSButtonCell.SwitchButton ); proto.setImagePosition( NSCell.ImageOnly ); proto.setTarget( this ); proto.setAction( new NSSelector("lockClick", new Class[] {Object.class}) ); proto.setImage( LOCKED_IMAGE ); proto.setAlternateImage( UNLOCKED_IMAGE ); } //----------------------------------------------------------------------------- // initNameSlot //----------------------------------------------------------------------------- private void initNameSlot() { NSCell proto = scroll.columnCellPrototype( NAME_SLOT ); proto.setEditable( true ); proto.setScrollable( true ); } //----------------------------------------------------------------------------- // initSlots //----------------------------------------------------------------------------- private void initSlots() { initLockSlot(); initNameSlot(); scroll.columnCellPrototype(SIZE_SLOT). setAlignment(NSText.RightTextAlignment); } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- private DirWindow( String dirname ) { NSApplication.loadNibNamed( "DirWindow", this ); window.registerForDraggedTypes(new NSArray(NSPasteboard.ColorPboardType)); initSlots(); initDefaults(); loadDefaults(); loadDirectory( dirname ); cascade(); } //----------------------------------------------------------------------------- // findDir //----------------------------------------------------------------------------- private static DirWindow findDir( String normalizedPath ) { if (normalizedPath != null) { Enumeration e = OPEN_DIRS.objectEnumerator(); while (e.hasMoreElements()) { DirWindow p = (DirWindow)e.nextElement(); if (p.path != null && p.path.equals( normalizedPath )) return p; } } return null; } //----------------------------------------------------------------------------- // launchDir //----------------------------------------------------------------------------- public static void launchDir( String dirname ) { initClass(); DirWindow p = null; if (dirname == null) dirname = NSSystem.currentHomeDirectory(); if (dirname == null) dirname = "/"; dirname = normalizePath( dirname ); if ((p = findDir( dirname )) == null) { p = new DirWindow( dirname ); OPEN_DIRS.addObject(p); } p.activateWindow(); } } // class DirWindow MiscKit2/Examples/JavaScrollDir/HISTORY.txt100444 1750 1750 3143 6757227611 20671 0ustar sunshinesunshine//----------------------------------------------------------------------------- // JavaScrollDir HISTORY // $Id: HISTORY.txt,v 1.2 99/06/30 09:29:02 sunshine Exp $ //----------------------------------------------------------------------------- v1.1 1999/06/14 15:35 EDT sunshine@sunshineco.com Created. This project is based on ScrollDir v35.1; translated to Java. Worked around problem with message being sent to freed object when run on MacOS/X Server. This problem did not occur on DR2. It turns out that the behavior of the Objective-C to Java bridge changed with regards to weakly-referenced pure-Java objects. Such objects are freed automatically in MacOS/X Server, but were not freed in DR2. DirWindow is just such an object, and was thus being freed unexpectedly. The problem was fixed by creating a strong reference to each DirWindow by converting the list of active DirWindow objects, OPEN_DIRS, from a Java Vector to an NSArray. The NSArray retains each DirWindow on the Objective-C side, thus creating a strong reference. Changed Files: + Align.{HCentered|HLeft}.{VCentered|VTop}.tiff + CustomInfo.plist + Defaults.java + DirController.java + DirWindow.{java|nib} + Info.nib + JavaScrollDir.{ico|iconheader|nib|tiff} + JavaScrollDir-windows.nib + JavaScrollDir_main.m + Lock.{secure|insecure}.tiff + Makefile + Makefile.{preamble|postamble} + pack.sh + pack_binaries.sh + Pagination.{HAuto|HClip|HFit}.{VAuto|VClip|VFit}.tiff + PB.project + README.rtf + SD_PageLayout.{pjava|nib} + unpack.sh + unpack_binaries.sh MiscKit2/Examples/JavaScrollDir/Lock.insecure.tiff100444 1750 1750 2762 6757227624 22357 0ustar sunshinesunshineII*?@@@@EEEUU??????0?<?<?<?<???????????? (R8~~ ' 'U?UOU?U?U?U?U?U?U?U?U?U?U?U?D_ϪϪD_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_ϪϪD_D_D_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_ r(R ' 'MiscKit2/Examples/JavaScrollDir/JavaScrollDir.iconheader100444 1750 1750 110 6757227612 23461 0ustar sunshinesunshineF JavaScrollDir.app JavaScrollDir app F JavaScrollDir JavaScrollDir app MiscKit2/Examples/JavaScrollDir/Lock.secure.tiff100444 1750 1750 2762 6757227625 22031 0ustar sunshinesunshineII* \40@@EEEUU???????<?<?<?<???????????? (R8~~ ' 'U?U?U?U?U?U?U?U?U?U?U?U?D_ϪϪD_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_ϪϪD_D_D_D_D_D_D_D_ϪϪϪD_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_ r(R ' 'MiscKit2/Examples/JavaScrollDir/JavaScrollDir_main.m100444 1750 1750 2141 6757227612 22646 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // $Id: JavaScrollDir_main.m,v 1.1 99/06/14 15:35:03 sunshine Exp $ // $Log: JavaScrollDir_main.m,v $ // Revision 1.1 99/06/14 15:35:03 sunshine // v1.1: The main() function. // //----------------------------------------------------------------------------- #import int main( int argc, char const* argv[] ) { return NSApplicationMain( argc, argv ); } MiscKit2/Examples/JavaScrollDir/Pagination.HAuto.VAuto.tiff100444 1750 1750 512 6757227625 23770 0ustar sunshinesunshineMM*000000000000 *2:B(RH@@ ' 'MiscKit2/Examples/JavaScrollDir/Makefile100444 1750 1750 4713 6757227633 20437 0ustar sunshinesunshine# # Generated by the NeXT Project Builder. # # NOTE: Do NOT change this file -- Project Builder maintains it. # # Put all of your customizations in files called Makefile.preamble # and Makefile.postamble (both optional), and Makefile will include them. # NAME = JavaScrollDir PROJECTVERSION = 2.7 PROJECT_TYPE = Application LANGUAGE = English NEXTSTEP_APPICON = JavaScrollDir.tiff WINDOWS_APPICON = JavaScrollDir.ico ICONSECTIONS = -sectcreate __ICON app JavaScrollDir.tiff LOCAL_RESOURCES = DirWindow.nib Info.nib JavaScrollDir-windows.nib\ JavaScrollDir.nib SD_PageLayout.nib GLOBAL_RESOURCES = Align.HCentered.VCentered.tiff\ Align.HCentered.VTop.tiff Align.HLeft.VCentered.tiff\ Align.HLeft.VTop.tiff JavaScrollDir.ico\ JavaScrollDir.tiff Lock.insecure.tiff\ Lock.secure.tiff 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 CustomInfo.plist README.rtf JAVA_CLASSES = Defaults.java DirController.java DirWindow.java MFILES = JavaScrollDir_main.m OTHERSRCS = Makefile.preamble Makefile Makefile.postamble SD_PageLayout.pjava MAKEFILEDIR = $(MAKEFILEPATH)/pb_makefiles CODE_GEN_STYLE = DYNAMIC MAKEFILE = app.make NEXTSTEP_INSTALLDIR = $(USER_APPS_DIR) WINDOWS_INSTALLDIR = $(USER_APPS_DIR) LIBS = -lMiscTableScrollJava DEBUG_LIBS = $(LIBS) PROF_LIBS = $(LIBS) LIBRARY_PATHS =\ -L$(NEXT_ROOT)/$(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Resources\ -L$(NEXT_ROOT)/Network/Library/Frameworks/MiscTableScroll.framework/Resources NEXTSTEP_PB_CFLAGS = -Werror -Wwrite-strings WINDOWS_PB_CFLAGS = -Werror -Wwrite-strings FRAMEWORKS = -framework AppKit -framework Foundation\ -framework MiscTableScroll JAVA_USED = YES NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc WINDOWS_OBJCPLUS_COMPILER = $(DEVDIR)/gcc PDO_UNIX_OBJCPLUS_COMPILER = $(NEXTDEV_BIN)/gcc NEXTSTEP_JAVA_COMPILER = /usr/bin/javac WINDOWS_JAVA_COMPILER = $(JDKBINDIR)/javac.exe PDO_UNIX_JAVA_COMPILER = $(NEXTDEV_BIN)/javac include $(MAKEFILEDIR)/platform.make -include Makefile.preamble include $(MAKEFILEDIR)/$(MAKEFILE) -include Makefile.postamble -include Makefile.dependencies MiscKit2/Examples/JavaScrollDir/Makefile.postamble100444 1750 1750 7542 6757227612 22424 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # Makefile.preamble # $Id: Makefile.postamble,v 1.1 99/06/23 04:21:33 sunshine Exp $ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # SD_PageLayout under Mach adds functionality which is not supported under # Windows. Choose the correct implementation by running the file through the # C-preprocessor. See Makefile.preamble for the other half of this patch. #------------------------------------------------------------------------------ .PHONY: java-scroll-dir-do-pjava java-scroll-dir-do-pjava: prebuild-directories $(JAVA_CLASSES) .SUFFIXES: .pjava $(SFILE_DIR)/%.java: %.pjava $(CP) $< $(SFILE_DIR)/$*.cc $(CC) -E -P -C -x c++ -o $(SFILE_DIR)/$*.java $(SFILE_DIR)/$*.cc $(RM) -f $(SFILE_DIR)/$*.cc #****************************************************************************** # # Copyright (C)1998,1999 by Eric Sunshine # # The contents of this file are copyrighted by Eric Sunshine. You may use # this file in your own projects provided that this copyright notice is # retained verbatim. # #****************************************************************************** #------------------------------------------------------------------------------ # forceload.fix (1999-06-09, version 1.1) # # A Makefile.postamble patch which eliminates the NSFramework_forceLoad() # compiler warning generated by YellowBox DR2 on Microsoft Windows. # # Under YellowBox DR2 for Microsoft Windows, Apple tried patching the # system makefile so that it automatically generates source code which # references all the classes in each framework used by a project. The # intention was to make all of the frameworks' symbols available to # loadable bundles even if the main application does not reference the # symbols itself. This is similar to the behavior of the linker's # -all_load switch under Mach. # # However, there are two problems with the DR2 implementation: # # a) It is incomplete and does not generate any framework references at # all; instead it generates a single empty function named # NSFramework_forceload(). # b) The generated function is declared "static" which results in a # compiler warning about an unused function. # # This file (forceload.fix) works around the compiler warning by # disabling generation of NSFramework_forceload() altogether. Since the # function is empty and is never referenced by any other code, this is a # safe operation. # # To use this patch, follow these instructions: # # a) Open the project's top-level Makefile.postamble in a text editor. # b) Append the contents of this file (forceload.fix) to the end of # Makefile.postamble. # c) Clean the project (make clean) and then rebuild it. # # Please send comments to Eric Sunshine # MIME, NeXT, and ASCII mail accepted. #------------------------------------------------------------------------------ ifeq "WINDOWS" "$(OS)" GENFORCELOAD=echo // endif MiscKit2/Examples/JavaScrollDir/Makefile.preamble100444 1750 1750 4006 6757227633 22220 0ustar sunshinesunshine#============================================================================== # # Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. # Written by Paul S. McCarthy and Eric Sunshine. # All Rights Reserved. # # This notice may not be removed from this source code. # # This object is included in the MiscKit by permission from the authors # and its use is governed by the MiscKit license, found in the file # "License.rtf" in the MiscKit distribution. Please refer to that file # for a list of all applicable permissions and restrictions. # #============================================================================== #------------------------------------------------------------------------------ # Makefile.preamble # $Id: Makefile.preamble,v 1.1 99/06/14 15:32:27 sunshine Exp $ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Ensure that the Java directory within the MiscTableScroll framework is # included in the class-path passed to the Java compiler. #------------------------------------------------------------------------------ CLASSPATH = $(subst $(THINAIR) $(THINAIR),:,$(strip \ $(NEXT_ROOT)/$(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Resources/Java \ $(NEXT_ROOT)/Network/Library/Frameworks/MiscTableScroll.framework/Resources/Java \ $(shell javaconfig DefaultClasspath))) #------------------------------------------------------------------------------ # SD_PageLayout under Mach adds functionality which is not supported under # Windows. Choose the correct implementation by running the file through the # C-preprocessor. See Makefile.postamble for the other half of this patch. #------------------------------------------------------------------------------ PJAVAFILES = $(patsubst %.pjava,%.java,$(filter %.pjava,$(OTHERSRCS))) OTHER_GENERATED_SRCFILES += $(PJAVAFILES) JAVA_CLASSES += $(addprefix $(SFILE_DIR)/,$(PJAVAFILES)) BEFORE_PREBUILD += java-scroll-dir-do-pjava MiscKit2/Examples/JavaScrollDir/PACKAGE_NUMBER100444 1750 1750 4 6757227613 20730 0ustar sunshinesunshine1 1 MiscKit2/Examples/JavaScrollDir/PB.project100444 1750 1750 5677 6757227633 20702 0ustar sunshinesunshine{ APPCLASS = NSApplication; DYNAMIC_CODE_GEN = YES; FILESTABLE = { CLASSES = (Defaults.java, DirController.java, DirWindow.java); FRAMEWORKS = (AppKit.framework, Foundation.framework, MiscTableScroll.framework); H_FILES = (); IMAGES = ( Align.HCentered.VCentered.tiff, Align.HCentered.VTop.tiff, Align.HLeft.VCentered.tiff, Align.HLeft.VTop.tiff, JavaScrollDir.ico, JavaScrollDir.tiff, Lock.insecure.tiff, Lock.secure.tiff, 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 ); INTERFACES = ( DirWindow.nib, Info.nib, "JavaScrollDir-windows.nib", JavaScrollDir.nib, SD_PageLayout.nib ); LIBRARYSEARCH = ( "$(NEXT_ROOT)/$(LOCAL_LIBRARY_DIR)/Frameworks/MiscTableScroll.framework/Resources", "$(NEXT_ROOT)/Network/Library/Frameworks/MiscTableScroll.framework/Resources" ); OTHER_LIBS = (MiscTableScrollJava); OTHER_LINKED = (JavaScrollDir_main.m); OTHER_RESOURCES = (CustomInfo.plist, README.rtf); OTHER_SOURCES = (Makefile.preamble, Makefile, Makefile.postamble, SD_PageLayout.pjava); }; LANGUAGE = English; LOCALIZABLE_FILES = { DirWindow.nib = DirWindow.nib; Info.nib = Info.nib; "JavaScrollDir-windows.nib" = "JavaScrollDir-windows.nib"; JavaScrollDir.nib = JavaScrollDir.nib; SD_PageLayout.nib = SD_PageLayout.nib; }; MAKEFILEDIR = "$(MAKEFILEPATH)/pb_makefiles"; NEXTSTEP_APPICON = JavaScrollDir.tiff; NEXTSTEP_BUILDTOOL = /bin/gnumake; NEXTSTEP_COMPILEROPTIONS = "-Werror -Wwrite-strings"; NEXTSTEP_DOCUMENTEXTENSIONS = (); NEXTSTEP_INSTALLDIR = "$(USER_APPS_DIR)"; NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; NEXTSTEP_MAINNIB = JavaScrollDir.nib; NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; PDO_UNIX_BUILDTOOL = $NEXT_ROOT/Developer/bin/make; PDO_UNIX_JAVA_COMPILER = "$(NEXTDEV_BIN)/javac"; PDO_UNIX_OBJCPLUS_COMPILER = "$(NEXTDEV_BIN)/gcc"; PROJECTNAME = JavaScrollDir; PROJECTTYPE = Application; PROJECTVERSION = 2.7; WINDOWS_APPICON = JavaScrollDir.ico; WINDOWS_BUILDTOOL = $NEXT_ROOT/Developer/Executables/make; WINDOWS_COMPILEROPTIONS = "-Werror -Wwrite-strings"; WINDOWS_DOCUMENTEXTENSIONS = (); WINDOWS_INSTALLDIR = "$(USER_APPS_DIR)"; WINDOWS_JAVA_COMPILER = "$(JDKBINDIR)/javac.exe"; WINDOWS_MAINNIB = "JavaScrollDir-windows.nib"; WINDOWS_OBJCPLUS_COMPILER = "$(DEVDIR)/gcc"; } MiscKit2/Examples/JavaScrollDir/Pagination.HAuto.VClip.tiff100444 1750 1750 512 6757227625 23747 0ustar sunshinesunshineMM*000000 *2:B(RH@@ ' 'MiscKit2/Examples/JavaScrollDir/Pagination.HAuto.VFit.tiff100444 1750 1750 512 6757227625 23602 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/JavaScrollDir/Pagination.HClip.VAuto.tiff100444 1750 1750 512 6757227625 23747 0ustar sunshinesunshineMM*00000000 *2:B(RH@@ ' 'MiscKit2/Examples/JavaScrollDir/Pagination.HClip.VClip.tiff100444 1750 1750 512 6757227626 23727 0ustar sunshinesunshineMM*000000 *2:B(RH@@ ' 'MiscKit2/Examples/JavaScrollDir/Pagination.HClip.VFit.tiff100444 1750 1750 512 6757227626 23562 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/JavaScrollDir/Pagination.HFit.VAuto.tiff100444 1750 1750 512 6757227626 23603 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/JavaScrollDir/Pagination.HFit.VClip.tiff100444 1750 1750 512 6757227626 23562 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/JavaScrollDir/Pagination.HFit.VFit.tiff100444 1750 1750 512 6757227627 23416 0ustar sunshinesunshineMM* *2:B(RH@@ ' 'MiscKit2/Examples/JavaScrollDir/README.rtf100444 1750 1750 20107 6757227633 20464 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\ftech Symbol;\f2\fmodern Ohlfs; } {\colortbl;\red255\green255\blue255;} \paperw10980\paperh10140 \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \f0\b\fs36 \cf0 JavaScrollDir\ \b0\fs24 By Paul S. McCarthy and Eric Sunshine\ Copyright \f1 \f0 1999 by Paul S. McCarthy and Eric Sunshine\ April 23, 1999\ \ \b\fs28 Overview \fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b0\fs12 \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs24 \cf0 This program demonstrates the use of MiscTableScroll from Java using \i eager \i0 mode. It is a simple directory browser which supports basic operations such as \i open, delete, rename, \i0 and \i change directory. \i0 \ \ \ \b\fs28 Notable Features \fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b0\fs12 \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b\fs24 \cf0 Java Enabled\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\ql\qnatural \b0 \cf0 This program is written entirely in Java. It interacts with MiscTableScroll via the Objective-C / Java bridge supplied by MacOS/X Server for Mach and Microsoft Windows. OpenStep 4.2 and earlier releases do not support Java, so this program is not compatible with environments pre-dating MacOS/X Server.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b \cf0 \ Eager Mode\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\ql\qnatural \b0 \cf0 This example uses an \i eager \i0 mode MiscTableScroll which creates and fills all cells immediately. This differs from a \i lazy \i0 mode MiscTableScroll where the data-delegate is responsible for managing the cells. \i Eager \i0 mode is useful for fairly small data sets and data sets for which data retrieval time is small. \i Eager \i0 mode is usually easier to program than \i lazy \i0 mode.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b \cf0 \ Color \b0 \ 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 \i Color Panel \i0 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 \i implicitly \i0 take the same background color. All cells which have had their color set \i explicitly \i0 retain their own color.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs24 \cf0 The \i highlight directories \i0 switch on the browser window demonstrates that cells can maintain their own colors instead of inheriting them. When toggled \i on \i0 the rows for directories are highlighted in a color independent of the MiscTableScroll. \b \ \ Font\ \b0 When the MiscTableScroll is first-responder, the \i Font Panel \i0 can be used to change its font. Cells which inherit their font from the MiscTableScroll display the newly selected font. \b \ \ Users Preferences\ \b0 This program demonstrates how to save and restore the user's column order and width preferences. Additionally, all other user preferences -- \i font, color, \i0 \i switch settings \i0 , and \i window size -- \i0 are also saved and restored.\ \ \b Sorting\ \b0 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 \i nib \i0 file by adjusting the criteria on a column-by-column basis. For instance, columns may contribute \i stringValue, title, intValue, tag, \i0 etc. to the row-wise comparisons.\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \cf0 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b \cf0 Image Display\ \b0 One column in the browser displays the file's icon. This demonstrates how to use \i image \i0 columns in addition to \i text \i0 columns.\ \ \b Image Dragging\ \b0 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 \i dragged filenames \i0 , 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.\ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b \cf0 Text Editing\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b0 \cf0 MiscTableScroll supports \i in-cell \i0 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 \i Name \i0 column initiates editing.\ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b \cf0 Buttons\ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b0 \cf0 This example illustrates how to use \i ButtonCells \i0 with the MiscTableScroll. One column contains a \i ButtonCell \i0 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 \i unlocked, \i0 renaming is allowed, and double-clicking on the file name in the \i Name \i0 column initiates an edit session. When \i locked, \i0 renaming is not allowed. If you do not have permission to rename a file the browser displays a \i locked \i0 icon and disables the \i ButtonCell \i0 .\ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b \cf0 Exporting \b0 \ MiscTableScroll can export its contents in dBASEIII (.dbf) format and also a number of ASCII formats via the \i Export \i0 menu item on the \i Directory \i0 menu.\ \ \b Printing \b0 \ MiscTableScroll respects the various page layout options, such as shrink-to-fit, spill, crop, centering, etc.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \cf0 \ \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \b\fs28 \cf0 Conclusion\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \b0\fs12 \cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \fs24 \cf0 JavaScrollDir was written by Paul S. McCarthy and Eric Sunshine and is copyright \f1 \f0 1999 by Paul S. McCarthy and Eric Sunshine. It is included in the MiscKit by permission from the authors and is governed by the MiscKit license found in the file \f2\fs20 License.rtf \f0\fs24 in the MiscKit distribution.\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \fs24 \cf0 Please direct comments, questions, and complaints to:\ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx360\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\li360\fi-160\ql\qnatural \fs24 \cf0 Paul S. McCarthy \f2\fs20 \f0\fs24 \ Eric Sunshine \f2\fs20 \f0\fs24 \ \pard\tx800\tx1600\tx2400\tx3200\tx4000\tx4800\tx5600\tx6400\tx7200\tx8000\ql\qnatural \fs12 \cf0 \ \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\ql\qnatural \fs24 \cf0 MIME and ASCII mail accepted. \fs12 \ } MiscKit2/Examples/JavaScrollDir/SD_PageLayout.pjava100444 1750 1750 14511 6757227616 22500 0ustar sunshinesunshine//============================================================================= // // Copyright (C) 1999 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // SD_PageLayout.java // // Custom subclass of AppKit's NSPageLayout panel that adds controls for // margins, pagination, & centering. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: SD_PageLayout.pjava,v 1.1 99/06/14 15:30:21 sunshine Exp $ // $Log: SD_PageLayout.pjava,v $ // Revision 1.1 99/06/14 15:30:21 sunshine // v1.1: Page layout panel. Makefile runs this .pjava file through // C-preprocessor to choose portions specific to Windows or Mach. // //----------------------------------------------------------------------------- import com.apple.yellow.foundation.*; import com.apple.yellow.application.*; class SD_PageLayout extends NSPageLayout { #ifndef __WIN32__ private static SD_PageLayout staticInstance = null; NSWindow accessoryWindow; NSTextField leftMarginField; NSTextField topMarginField; NSTextField rightMarginField; NSTextField bottomMarginField; NSMatrix centerMatrix; NSMatrix paginationMatrix; //----------------------------------------------------------------------------- // sharedInstance //----------------------------------------------------------------------------- public static NSPageLayout sharedInstance() { if (staticInstance == null) staticInstance = new SD_PageLayout(); return staticInstance; } //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- private SD_PageLayout() { NSApplication.loadNibNamed( "SD_PageLayout", this ); NSView v = accessoryWindow.contentView(); accessoryWindow.setContentView( null ); accessoryWindow.close(); accessoryWindow = null; // Releases window resource. setAccessoryView(v); } //----------------------------------------------------------------------------- // pickedUnits //----------------------------------------------------------------------------- public void pickedUnits( Object sender ) { NSForm widthForm = (NSForm)contentView().viewWithTag( PLWidthForm ); final float oldWidth = widthForm.floatValue(); super.pickedUnits( sender ); final float scaler = oldWidth / widthForm.floatValue(); leftMarginField.setFloatValue( leftMarginField.floatValue() / scaler ); rightMarginField.setFloatValue( rightMarginField.floatValue() / scaler ); topMarginField.setFloatValue( topMarginField.floatValue() / scaler ); bottomMarginField.setFloatValue( bottomMarginField.floatValue() / scaler ); } //----------------------------------------------------------------------------- // paginationToSlot //----------------------------------------------------------------------------- private static int paginationToSlot( int pg ) { int slot = 1; if (pg == NSPrintInfo.FitPagination) slot = 0; else if (pg == NSPrintInfo.ClipPagination) slot = 2; return slot; } //----------------------------------------------------------------------------- // slotToPagination //----------------------------------------------------------------------------- private static int slotToPagination( int slot ) { int pg = NSPrintInfo.AutoPagination; if (slot == 0) pg = NSPrintInfo.FitPagination; else if (slot == 2) pg = NSPrintInfo.ClipPagination; return pg; } //----------------------------------------------------------------------------- // readPrintInfo //----------------------------------------------------------------------------- public void readPrintInfo() { super.readPrintInfo(); NSPrintInfo info = printInfo(); NSForm widthForm = (NSForm)contentView().viewWithTag( PLWidthForm ); final float scaler = info.paperSize().width() / widthForm.floatValue(); leftMarginField.setFloatValue( info.leftMargin() / scaler ); rightMarginField.setFloatValue( info.rightMargin() / scaler ); topMarginField.setFloatValue( info.topMargin() / scaler ); bottomMarginField.setFloatValue( info.bottomMargin() / scaler ); centerMatrix.selectCellAtLocation( info.isVerticallyCentered() ? 1 : 0, info.isHorizontallyCentered() ? 1 : 0 ); final int pg_row = paginationToSlot( info.verticalPagination() ); final int pg_col = paginationToSlot( info.horizontalPagination() ); paginationMatrix.selectCellAtLocation( pg_row, pg_col ); } //----------------------------------------------------------------------------- // writePrintInfo //----------------------------------------------------------------------------- public void writePrintInfo() { super.writePrintInfo(); NSPrintInfo info = printInfo(); NSForm widthForm = (NSForm)contentView().viewWithTag( PLWidthForm ); final float scaler = info.paperSize().width() / widthForm.floatValue(); info.setLeftMargin( leftMarginField.floatValue() * scaler ); info.setRightMargin( rightMarginField.floatValue() * scaler ); info.setTopMargin( topMarginField.floatValue() * scaler ); info.setBottomMargin( bottomMarginField.floatValue() * scaler ); info.setVerticallyCentered( centerMatrix.selectedRow() != 0 ); info.setHorizontallyCentered( centerMatrix.selectedColumn() != 0 ); info.setHorizontalPagination( slotToPagination(paginationMatrix.selectedColumn()) ); info.setVerticalPagination( slotToPagination(paginationMatrix.selectedRow()) ); } #else // __WIN32__ //----------------------------------------------------------------------------- // sharedInstance //----------------------------------------------------------------------------- public static NSPageLayout sharedInstance() { return NSPageLayout.pageLayout(); } #endif // __WIN32__ } // class SD_PageLayout MiscKit2/Examples/JavaScrollDir/Align.HCentered.VTop.tiff100444 1750 1750 422 6757227623 23402 0ustar sunshinesunshineMM*D*JVOߏ$ C!\6Cq?R` U?P8$ BaP  (R5- ' 'MiscKit2/Examples/JavaScrollDir/Align.HCentered.VCentered.tiff100444 1750 1750 426 6757227623 24375 0ustar sunshinesunshineMM*H*JTVO(L->C`'ш^!O$@U@@?P8$ BaP (R80 ' 'MiscKit2/License.rtf100444 1750 1750 12063 6757716345 14641 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f3\fnil Times-Roman;\f0\ftech Symbol;\f1\fswiss Helvetica;\f2\fmodern Ohlfs;} \paperw9420 \paperh8980 \margl120 \margr120 {\colortbl;\red0\green0\blue0;} \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f3\b0\i0\ulnone\fs24\fc0\cf0 Copyright \f0 \f3 1993, 1994, 1995, 1996, 1997 Don Yacktman. All Rights Reserved. Version 1.10.0.\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f1\fc1\cf1 \ \ \b\qc\fs72 MiscKit License Agreement \b0 \ \ql\fs24 \ \f3\li360 In this license, the \b MiscKit administrator \b0 is Don Yacktman. \fs20\up8 \fs24\up0 The \b MiscKit authors \b0 include any individual or organization who has contributed a resource to the MiscKit. \b MiscKit owners \b0 are those who hold any of the copyrights associated with the MiscKit and the resources it contains. \b Resources \b0 are the components of the MiscKit, such as an Objective-C \fs20\up8 TM \fs24\up0 object, an application, an Objective-C \fs20\up8 TM \fs24\up0 category, an Interface Builder \fs20\up8 TM \fs24\up0 palette, a Project Builder \fs20\up8 TM \fs24\up0 project, or a documentation file. In special cases, a resource is a single .tiff, .snd, .nib, .eps, or other file, but usually such files are component parts of another resource.\ \ Although the copyright for a resource remains with the author of the resource (unless the copyright has been reassigned), the MiscKit owners have licensed to the MiscKit administrator the right to copy, distribute, license, and print their works. Some of these rights are passed on to you through this license agreement. Any resource which is a part of the MiscKit falls under the terms of this license agreement unless explicitly stated in the resource itself or its accompanying files. The copyright for the MiscKit, held by the MiscKit administrator, covers the collection or arrangement of objects which comprises the MiscKit and any auxiliary files such as, but not limited to, the MiscKit License Agreement, Charter, and Makefiles. The file License_Notes.rtf explains the articles of this license in greater detail.\ \ Permission to copy the MiscKit, to redistribute it, and to use it for any purpose is granted, subject to the following restrictions and understandings:\ \fi440 \ \fi-260\li1060 1. Any copy made of the MiscKit or modified versions of the MiscKit must include verbatim copies of this copyright and license notice and accompanying MiscKit charter.\ \ 2. The MiscKit administrator's permission must be obtained for:\ \pard\tx520\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-240\li1300\fc1\cf1 a. any large-scale distribution of the MiscKit.\ b. redistribution of the MiscKit, or any parts of the MiscKit, in printed form.\ c. distributing a modified version of the MiscKit. Modified versions of the MiscKit must also be plainly marked as such, with a suitable warning, and may not be misrepresented as being the original software.\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-260\li1060\fc1\cf1 \ 3. All materials developed as a consequence of the use of the MiscKit shall duly acknowledge such use.\ \ 4. Anyone, the MiscKit administrator, a MiscKit author, or a third party is free to provide consulting and support services for the MiscKit.\ \ 5. The MiscKit administrator may make changes to this license at any time, providing that a simple majority of MiscKit authors and owners agree to the changes. If a change is made, it immediately becomes binding upon all current resources of and subsequently added to the MiscKit. Changes to the license do not, however, retroactively affect previous versions or uses of the MiscKit or its resources.\ \fi440\li360 \ \fi0 The MiscKit administrator, MiscKit authors and owners, and Brigham Young University make no express or implied warranty or representation of any kind with respect to the MiscKit, including any warranty that the MiscKit is defect- free. ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE IS HEREBY DISCLAIMED. IN NO EVENT WILL THE AFOREMENTIONED PARTIES BE LIABLE FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF OR INABILITY TO USE THE MISCKIT. The parties are under no obligation to provide any services, by way of maintenance, update, or otherwise.\ \ Interface Builder and Project Builder are trademarks of NeXT Computer, Inc. Objective-C is a registered trademark of The Stepstone Corporation.\ \ __________\ \pard\tx1440\tx2720\fs20\fi-440\li800\fc1\cf1\up8 \fs24\up0 The MiscKit administrator may be contacted at:\ U.S. mail: Don Yacktman\ 4279 N. Ivy Lane\ Provo, UT 84604\ telephone: (801) 221 - 0344\ e-mail: don@misckit.com\ \pard\li520\fc1\cf1 This contact information will be valid until at \i least \i0 December 31, 1997, after which time inquiries should be mailed to: Donald A. Yacktman, Jr \b . \b0 , 2826 N. Elm Lane, Arlington Heights, IL, 60004, from which point they will be properly forwarded. Releases of the MiscKit after that time will contain any new addresses.\ } MiscKit2/License_Notes.rtf100444 1750 1750 35047 6757716345 16020 0ustar sunshinesunshine{\rtf0\ansi{\fonttbl\f3\fnil Times-Roman;\f0\ftech Symbol;\f1\fswiss Helvetica;\f2\fmodern Ohlfs;} \paperw9420 \paperh8980 \margl120 \margr120 {\colortbl;\red0\green0\blue0;} \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f3\b0\i0\ulnone\fs24\fc0\cf0 Copyright \f0 \f3 1993, 1994, 1995, 1996, 1997 Don Yacktman. All Rights Reserved. Version 1.10.0.\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f1\fc0\cf0 \ \ \qc\fs48 How the MiscKit License Agreement applies to you (explanatory notes)\ \f3\ql\fs24\fi440\li360\fc1\cf1 \ \ \fi0 In order to understand what is required in order to properly comply with this license, this file describes what is expected of you. It follows the same numbering scheme as the articles of the license, adding clarification to particular requirements. This document is as legally binding as the license in that it attempts to provide the proper interpretation of the license requirements. It is not necessary that you read this entire document, but it is probably worth the time. Hopefully this document will answer any questions you may have about the license. This document grants you some permissions required by the MiscKit license so that the MiscKit administrator does not need to be contacted to give permission for several common uses of the MiscKit. Finally, this document provides the reasoning behind many of the current restrictions. \fi440 \ \fi-260\li1060 \ \fi0\li360 Before covering the articles of the license, there are a few consequences of the copyright scheme which should be understood. Basically, the author retains all rights and the copyright for a resource (unless these have been transferred to another owner) and the owner is granting the MiscKit permission to use the resource (the MiscKit administrator is free to use, distribute, copy, license, and print the resource). As consequences of this:\ \fi-260\li1060 \ \pard\tx520\tx1360\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-280\li1340\fc1\cf1 The author may distribute a resource via any means, and for any cost, outside of the MiscKit. Example: the owner of a resource is free to sell modified versions of said resource to anyone at any price they set. The owner can also give you permission to do so, if they so choose.\ \ Modifications to a resource which are donated to the MiscKit become the property of the owner of a resource. (This is meant to eliminate administrative hassles.) Note that an Objective-C \fs20\up8 TM \fs24\up0 category is not considered a modification of a resource; it is a resource in it's own right, so if a contributor wishes to retain ownership, this is a possible option.\ \ Ownership of a resource may be transferred to an individual other than the author or previous owner if a signed agreement between both parties exists. This is because the original author still retains all rights to the resource, and, more importantly, retains the copyright.\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi440\li360\fc1\cf1 \ \pard\tx520\tx1360\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-280\li1340\fc1\cf1 The author cannot remove a resource from the MiscKit. By contributing, an author has granted the rights to redistribute and use the resource. As part of the agreement between MiscKit administrator and contributor, once those rights are granted, it cannot be revoked. However, the author may remove support for the resource. In such a case, the contributed resource will \b remain \b0 in the MiscKit and one of the MiscKit authors will be assigned to carry on any future development and bug fixes. The copyright for the code will still remain with the original author. (In effect the MiscKit will end up being a separate development branch of the resource.) This provision is to allow authors to stop providing MiscKit support for a resource and transfer the responsibility without having to give up the copyright to the object. Because a contributor cannot remove a donated resource, they should make sure that they truly intend it to be a public resource. Basically, removing a donated resource is far too detrimental to the MiscKit. People who use the kit will come to depend upon the resources in it and many MiscKit resources rely upon other MiscKit resources. Removing a resource would most likely break something else in the MiscKit. Also, pulling a resource and then selling it to those who need it would be the height of rudeness. If this provision weren't included, it is feared that the MiscKit would become a bunch of disjoint objects that don't leverage off the capabilities of existing objects in the kit for fear of something suddenly disappearing in the future. In addition, people would be hesitant to use any object that might disappear some day, thus leaving the kit unused by most people It is hoped that this policy will provide a sense of security to everyone.\ \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi440\li360\fc1\cf1 \ \ \fi-260\li1060 1. Software built using the MiscKit does \i not \i0 have this restriction; this restriction applies only to the MiscKit source code and development tools. So, if you redistribute MiscKit \i source \i0 you must supply these documents in the distribution. An app built with the MiscKit, containing MiscKit objects should \i not \i0 include these documents, as they apply to the MiscKit only.\ \ 2. This article deals with distribution of the MiscKit source. An application that uses the MiscKit (ie. includes binary object code created from the MiscKit source code or contains a .nib, .tiff, etc. taken from the MiscKit) is only restricted by article 3. In other words, the MiscKit license does not infect any project which makes use of the MiscKit.\ \ Any redistribution of the MiscKit without the MiscKit administrator's explicit permission must contain all files which are in the original distribution as it originates from the MiscKit administrator. Currently, the definitive original distribution is available via anonymous ftp from ftp.byu.edu. Any modified distributions fall under part (2.c.), should have all changes clearly marked, and require the MiscKit administrator's permission. For commercial distributions, it is suggested that, where possible, you provide the MiscKit in an uncompressed form so that the user can peruse the documentation easily. (For example, on a CD-ROM, it would be most convenient for the user to have the compressed \i and \i0 the uncompressed MiscKit on the disc. Then, the documentation is easily accessible, without taking up hard drive space, but when a user decides to install the kit, it is much faster to read the compressed version off of the CD-ROM. Obviously such a move increases the value of your product, and would be desirable in most cases.) Also, as this is a free kit, it is hoped that commercial redistributors will not attempt to gouge their customers. (This is unlikely to have happen since this document must be included unchanged in all distributions, and anyone who was bamboozled and then read this would get pretty darn mad, and would likely take the matter into their own hands.)\ \ 2.a. A large-scale distribution is one which is mass-produced; in other words, any time more than 50 copies would be distributed. (In other words, the typical user group could give copies of the Misckit to members, but if they went to press a CD-ROM, then they need to get permission first.) Requiring you to ask permission is mostly to make sure that you have the option of distributing the latest version of the MiscKit and to allow us to be aware which versions of the kit came from a particular source, which makes the job of support much easier when bug reports come in from users. Upon contact, you will be provided with any newer versions of the kit and will be given the option to be added to a list of people who are notified of new releases of the MiscKit. Your product will also, if you wish, be added to a public listing which points to products which contain the MiscKit distribution. (For example, if you produce a CD-ROM and someone wanted a permanent copy of the MiscKit on CD-ROM, they would then be directed to your product.) In practically all circumstances, requested permission will be granted, but you are still required to obtain it from the MiscKit administrator first. An individual making copies for a friend is \i not \i0 required to contact the MiscKit administrator; restriction 2.a. applies only to commercial products.\ \ The MiscKit administrator hereby grants you permission to redistribute the complete, unmodified MiscKit via ftp, e-mail, or any other means of transmission over an electronic network.\ \ 2.b. Again, in practically all circumstances, permission will be granted, but you are still required to obtain it from the MiscKit administrator first. Because the owner of a resource's copyright has licensed the MiscKit administrator the rights to license and print the resource, the MiscKit administrator can transfer the license to print to you upon request. The right to print is not given you in the current license; you must request it. Note that the author of a resource can also give you permission to print it, so that is an alternate route which you may use to obtain permission.\ \ 2.c. Distributing modified versions of the MiscKit is highly discouraged, but some will want to do so anyway. The license automatically grants permission to redistribute the MiscKit \i without \i0 requesting the permission of the MiscKit administrator, but only for unmodified distributions, and under the circumstances delineated in other areas of the license, parts 2.a. and 2.b. in particular. If you have altered the MiscKit or added to it, then part 2.c. applies to the re-distribution. When you attempt to request permission under the terms of part 2.c. you will be expected to give a \i very \i0 good reason for wanting to do this; contribution to the kit should be the norm. It would be preferred that any modifications to the MiscKit be forwarded to the maintainers of the MiscKit so that such modifications become part of the official MiscKit, but this is not required by this license. The warning you will be required to give should clearly state that modified versions are wholly unsupported by the MiscKit authors and may not be compatible with past, current, or future versions of the MiscKit. The license and charter which must be included with modified versions of the MiscKit (see article 1.) are both found in the official MiscKit distribution, and may not be modified.\ \ Due to the rights granted by the MiscKit authors to the MiscKit administrator, the MiscKit administrator hereby grants you permission to redistribute partial versions of the MiscKit comprised of \i unchanged \i0 MiscKit resources, subject to the restrictions of parts 2.a. and 2.b. but you must mark the distribution as being incomplete. If the resources are modified, you must obtain permission to redistribute from the MiscKit administrator or the original author of a resource. If you wish to distribute a single resource, the owner of the resource should be contacted. Some resources may explicitly give permission for any type of redistribution, if the author has included such permission at the top of the file and/or accompanying README file. When an author grants this permission in the resource as it is distributed in the MiscKit, this allows you to redistribute that resource under the terms given, but only that resource and not in conjunction with the MiscKit. If you decide to distribute a partial version of the unmodified MiscKit, be careful that you include all necessary resources; many MiscKit resources depend on each other. For this reason, partial distributions are not generally recommended; they could cause unnecessary hassle.\ \fi440\li360 \ \fi-260\li1060 3. This acknowledgement should, in the case of a GUI application, be both in the application itself, either in the info panel or at some location in the on-line help, and in the printed manual, if such exists. Placing the phrase The MiscKit was used in development of this software in a help panel and the printed manual or the phrase Uses the MiscKit in the Info panel would be sufficient. In the case of a command-line application, acknowledgement should be placed in the README file distributed with the application. This restriction applies only to applications which use objects from the MiscKit library and palettes; no acknowledgement is required for applications which \i only \i0 make use of any specialized development tools (applications) provided with the MiscKit. Why promote the MiscKit in this way? So that it gets used by people! Why develop it if no one ever uses it? Often a developer will not buy objectware because I can do that myself which defeats the whole purpose of OOPcode reuseand so we want our code to be used. As a free project, this is the only kind of advertising we can afford to achieve this goal!\ \fi440\li360 \ \fi-260\li1060 4. Such activities are welcome as long as they do not violate this license agreement.\ \fi440\li360 \ \fi-260\li1060 5. If you are an author and/or owner, and you object to a proposed change, speak up or be forgotten! See the Charter for details on the voting process. Also, note that the kit must always remain free to users; changes which limit the freedom of users and distributors more than the current license are not allowed. Note that since a vote of all authors is required to make changes, this should keep itself in check quite easily.\ \fi440\li360 \ \ \ \ \f1\qc\fs48\fi0\li0\fc0\cf0 Goals of the MiscKit license agreement:\ \f3\ql\fs24\fi440\li360\fc1\cf1 \ \ \fi0 The purpose and intent of the MiscKit license is to fulfill the following goals:\ \ \fi-260\li1060 Allow the MiscKit to be freely distributed to as large an audience as possible.\ \ Provide a kit of useful programming tools which may be used by anybody without having to pay for its use.\ \ Allow programmers to contribute to a project which will aid themselves and their peers.\ \ Assure that there will always be a definitive version of the MiscKit, distributed by the MiscKit administrator, which may be trusted. By allowing contributors, it is hoped that branches will not break off of the MiscKit, which will make the kit more useful as a whole because there will be less confusion as to which version should be used.\ \ \fi0\li360 Basically, we're trying to make something which is almost a public domain kit, but do it in a manner that is organized and lacks the confusion of multiple incompatible versions often seen with public domain code. \fi-260\li1060 \ }