home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Palettes / MiscClipTextPalette / MiscClipText.subproj / _clipStringValue.notes next >
Encoding:
Text File  |  1995-07-12  |  1.3 KB  |  37 lines

  1. /*
  2.     NOTES:    `_clipStringValue:' could be implemented as a function which would
  3.             make it possible to use this clipping feature in other custom
  4.             cell classes (e.g. MyClippingBrowserCell) as well. What do you 
  5.             think ? 
  6.             
  7.     char* clipString(string, delimiters, clipper, font, fromRight, maxWidth)
  8.                       const char     *string;    //The string to clip
  9.                     const char  *delimiters;//Delimiters to clip by
  10.                     const char     *clipper;    //String that subst. invis. part 
  11.                     id            font;        //Font the string is displayed with
  12.                     BOOL        fromRight;    //Clipping from left or right ?    
  13.                     float         maxWidth;     //The max width of the object the
  14.                                             //string will be displayed in e.g.
  15.                                             //an adjusted Cell width
  16.  
  17.             Or maybe better to include it in a category of ActionCell thus 
  18.             applying clipping option to all ActionCell subclasses (it has to be 
  19.             an ActionCell category beacause it uses `controlView' to 
  20.             determine the size of the view the cell is displayed in). But we 
  21.             need the clipper and delimiter arguments then, don't we.
  22.             So, it could look like:
  23.  
  24.  
  25.     @interface ActionCell(ClippingText)
  26.     
  27.     - clipStringValue:(const char *) theString
  28.         fromRight:(BOOL)yesno
  29.         usingDelimiters:(const char*) delimiters
  30.         clipperString:(const char*) clipperString
  31.     
  32.     @end;
  33.     
  34.             Which one do you think is better?
  35.     
  36. */
  37.