home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / os2tk21j / c / samples / tp / colblk.cs_ / colblk.csc
Encoding:
Text File  |  1993-03-12  |  1.8 KB  |  75 lines

  1. #   @(#)colblk.csc 1.3 1/22/92 16:09:15 [1/26/92] (c)IBM Corp. 1992
  2.  
  3. -- This class is adapted from the book
  4. --   Class Construction in C and C++, Object Oriented Fundamentals
  5. --   by Roger Sessions, Copyright (c) 1992 Prentice Hall.
  6. -- Reprinted with permission.
  7.  
  8. include "ll.sc"
  9.  
  10. class: columnBlock,
  11.   local;
  12.  
  13. parent: linkedList;
  14.  
  15. /*
  16. ----------------------------------------------------
  17.   Class: columnBlock
  18.  
  19. Purpose: One of the lower level classes used to store
  20.      information for a page.  A columnBlock is a
  21.      special type of linked list, in which each link
  22.      contains a column of text.  A columnBlock will
  23.      contain one link for each column of text, as
  24.      defined in the SetUpEnvironment.  So if the input
  25.      text contains
  26.  
  27.         width 60
  28.         height 15
  29.         columns 2
  30.  
  31.      the columnBlock will contain two links.
  32.      Each link in the columnBlock is another linked
  33.      list of textlines.  Each of these linked lists
  34.      represents one column of text in the page.
  35. ---------------------------------------------------- */
  36.  
  37.  
  38. data:
  39.  
  40.   int columnWidth;
  41.  
  42. methods:
  43.  
  44. group: AdditionalMethods;
  45.  
  46.   void cbInit(int newColumns, int newHeight, int newWidth);
  47.   --   Initialize a new columnBlock.
  48.  
  49.   int cbGetColumnWidth();
  50.   --  Returns the width of a column (in characters).
  51.  
  52.   int cbLinesLeft();
  53.   --  Returns TRUE if there is room for at least one more
  54.   --  line in the columnBlock, FALSE otherwise.
  55.  
  56. group: BaseOverrides;
  57.  
  58.    override llAddTail;
  59.    -- See the linkedList class definition for more information.
  60.  
  61.    override print;
  62.    --  See the baseType class definition for more information.
  63.  
  64. group: SystemMethodOverrides;
  65.  
  66.    override somInit;
  67.    override somUninit;
  68.    override somDumpSelfInt;
  69.  
  70. group: PrivateMethods;
  71.  
  72.    void cbPrintBlanks(FILE *output, int nblanks), private;
  73.    --    Prints blank characters to the output file.
  74.  
  75.