home *** CD-ROM | disk | FTP | other *** search
/ MacWorld UK 2005 May / MW_UK_2005_05.iso / 16 iCal utilities / quickCal.sit / quickCal / quickCal.app / Contents / Resources / RowResizableViewMethods.h < prev    next >
Encoding:
Text File  |  2005-01-25  |  2.8 KB  |  62 lines

  1. /*
  2.  RowResizableViewMethods.h
  3.  Written by Evan Jones <ejones@uwaterloo.ca>, 14-11-2002
  4.  http://www.eng.uwaterloo.ca/~ejones/
  5.  
  6.  Released under the GNU LGPL.
  7.  
  8.  That means that you can use this class in open source or commercial products, with the limitation that you must distribute the source code for this class, and any modifications you make. See http://www.gnu.org/ for more information.
  9.  
  10.  IMPORTANT NOTE:
  11.  
  12.  This file is included into both RowResizableTableView.h and RowResizableOutlineView.h. This is because these two classes share the implementation of the methods defined in this file.
  13.  
  14.  Yes, I know that this is an ugly hack, but it is the least ugly hack I could find. It is simple to use and to understand. Search the MacOSX-dev mailing list archives for the thread with the subject "Objective-C Multiple Inheritance Work Arounds?" for a detailed discussion. A short list of stuff I tried or thought about and rejected:
  15.  
  16.  - Hacking the classes so that RowResizableTableView could be both a subclass of NSTableView and NSOutlineView, and then RowResizeableOutlineView became a subclass of "RowResizableTableView-copy".
  17.  - Using the "concrete protocols" library.
  18.  
  19.  */
  20.  
  21.  
  22. /* "PUBLIC" METHODS: These can be called by anyone. */
  23.    
  24. /** Sets the height for the specified row to the specified height. It will automatically adjust all other row origins and setNeedsDisplay if required. */
  25. - (void) setHeightOfRow: (int) row toHeight: (float)height;
  26.  
  27.  
  28. /* SUBCLASS OVERRIDES */
  29. - (void) dealloc;
  30.  
  31. - (void) setDelegate: (id) obj;
  32. - (void) tile;
  33. - (void) viewDidEndLiveResize;
  34. - (void) textDidEndEditing:(NSNotification *)aNotification;
  35. - (void) textDidChange:(NSNotification *)notification;
  36. - (NSRect) rectOfRow:(int)row;
  37.  
  38.  
  39. /* "PRIVATE" METHODS: These methods are part of the "implementation" of RowResizable*View. */
  40.  
  41. /** Performs initialization (primarily of instance variables) that is common to both RowResizable*View. */
  42. - (id) commonInitWithCoder: (NSCoder*) decoder;
  43.  
  44.     /** Recalculates the row heights for the entire table. */
  45. - (void) recalculateGrid;
  46.     /** Finds the height of the tallest cell in a specified row. */
  47. - (float) maxHeightInRow:(int)row;
  48.     /** Returns the cell object for the specified row and column. */
  49. - (NSCell*) cellForRow:(int)row column:(int)col;
  50.  
  51.     /** Returns the height of the cell in the specified column and row. */
  52. - (float) findHeightForColumn: (int) column row: (int) row withValue: (id) value;
  53.  
  54. /** Sets up dataCell to display the information in tabCol and row. */
  55. - (void) willDisplayCell: (NSCell*) dataCell forTableColumn: (NSTableColumn*) tabCol row: (int) row;
  56.  
  57. - (id) getValueForTableColumn: (NSTableColumn*) tabCol row: (int) row;
  58. - (void)columnDidResize:(NSNotification*)aNotification;
  59.     /** Returns the rectange for the cells in a column, adjusted for intercell spacing and indent. */
  60. //- (NSRect) rectOfCellsForColumn: (int) column row: (int) row;
  61.  
  62.