home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / New System Software Extensions / ASLM SDK v1.1.2 / ASLM Examples / Inspector / Sources / List.cp < prev    next >
Encoding:
Text File  |  1994-11-21  |  3.3 KB  |  194 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        List.cp
  3.  
  4.     Contains:    TList implementation.  A front end to the list manager.
  5.  
  6.     Copyright:    © 1991-1993 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10.  
  11. #ifndef __LIST__
  12. #include <List.h>
  13. #endif
  14.  
  15. TList::TList()
  16. {
  17.     fList = NULL;
  18. }
  19.  
  20. TList::TList(const Rect *rView, const Rect *dataBounds, Point cSize,
  21.             short theProc, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow,
  22.             Boolean scrollHoriz, Boolean scrollVert)
  23. {
  24.     InitList(rView, dataBounds, cSize, theProc, theWindow, drawIt, hasGrow,
  25.         scrollHoriz, scrollVert);
  26. }
  27.  
  28. TList::~TList()
  29. {
  30.     Trace("Disposing TList\n");
  31.     if (fList)
  32.         LDispose(fList);
  33. }
  34.  
  35. void TList::InitList(const Rect *rView, const Rect *dataBounds, Point cSize,
  36.     short theProc, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow,
  37.     Boolean scrollHoriz, Boolean scrollVert)
  38. {
  39.     fList = LNew(rView, dataBounds, cSize, theProc, theWindow, drawIt, hasGrow,
  40.         scrollHoriz, scrollVert);
  41. }
  42.  
  43. short TList::AddColumn(short count,short colNum)
  44. {
  45.     return LAddColumn(count, colNum, fList);
  46. }
  47.  
  48. short TList::AddRow(short count,short rowNum)
  49. {
  50.     return LAddRow(count, rowNum, fList);
  51. }
  52.  
  53. short TList::AddRow(short count)
  54. {
  55.     return LAddRow(count,this->GetLastRow() + 1, fList);
  56. }
  57.  
  58. void TList::DelColumn(short count,short colNum)
  59. {
  60.     LDelColumn(count, colNum, fList);
  61. }
  62.  
  63. void TList::DelRow(short count,short rowNum)
  64. {
  65.     LDelRow(count, rowNum, fList);
  66. }
  67.  
  68. void TList::AddToCell(const void *dataPtr,short dataLen,Cell theCell)
  69. {
  70.     LAddToCell(dataPtr,dataLen,theCell,fList);
  71. }
  72.  
  73. void TList::ClrCell(Cell theCell)
  74. {
  75.     LClrCell(theCell,fList);
  76. }
  77.  
  78. void TList::GetCell(void *dataPtr,short *dataLen,Cell theCell)
  79. {
  80.     LGetCell(dataPtr,dataLen,theCell,fList);
  81. }
  82.  
  83. void TList::SetCell(const void *dataPtr,short dataLen,Cell theCell)
  84. {
  85.     LSetCell(dataPtr,dataLen,theCell,fList);
  86. }
  87.  
  88. void TList::CellSize(Point cSize)
  89. {
  90.     LCellSize(cSize,fList);
  91. }
  92.  
  93. Boolean    TList::GetSelect(Boolean next,Cell *theCell)
  94. {
  95.     return LGetSelect(next,theCell,fList);
  96. }
  97.  
  98. void TList::SetSelect(Boolean setIt,Cell theCell)
  99. {
  100.     LSetSelect(setIt,theCell,fList);
  101. }
  102.  
  103. Boolean    TList::Click(Point pt,short modifiers)
  104. {
  105.     return LClick(pt,modifiers,fList);
  106. }
  107.  
  108. Cell TList::LastClick()
  109. {
  110.     return LLastClick(fList);
  111. }
  112.  
  113. void TList::Find(short *offset,short *len,Cell theCell)
  114. {
  115.     LFind(offset,len,theCell,fList);
  116. }
  117.  
  118. Boolean    TList::NextCell(Boolean hNext,Boolean vNext,Cell *theCell)
  119. {
  120.     return LNextCell(hNext,vNext,theCell,fList);
  121. }
  122.  
  123. void TList::CellRect(Rect *cellRect,Cell theCell)
  124. {
  125.     LRect(cellRect,theCell,fList);
  126. }
  127.  
  128. Boolean    TList::Search(const void *dataPtr,short dataLen,SearchProcPtr searchProc,
  129.                 Cell *theCell)
  130. {
  131.     return LSearch(dataPtr,dataLen,searchProc,theCell,fList);
  132. }
  133.  
  134. void TList::Size(short listWidth,short listHeight)
  135. {
  136.     LSize(listWidth,listHeight,fList);
  137. }
  138.  
  139. void TList::Draw(Cell theCell)
  140. {
  141.     LDraw(theCell,fList);
  142. }
  143.  
  144. void TList::DoDraw(Boolean drawIt)
  145. {
  146.     LDoDraw(drawIt,fList);
  147. }
  148.  
  149. void TList::Scroll(short dCols,short dRows)
  150. {
  151.     LScroll(dCols,dRows,fList);
  152. }
  153.  
  154. void TList::AutoScroll()
  155. {
  156.     LAutoScroll(fList);
  157. }
  158.  
  159. void TList::Update(RgnHandle theRgn)
  160. {
  161.     LUpdate(theRgn,fList);
  162. }
  163.  
  164. void TList::Activate(Boolean act)
  165. {
  166.     LActivate(act,fList);
  167. }
  168.  
  169. void TList::SetSelFlags(char theFlags)
  170. {
  171.     (**fList).selFlags = theFlags;
  172. }
  173.  
  174. short TList::GetLastRow()
  175. {
  176.     return (**fList).dataBounds.bottom;
  177. }
  178.  
  179. short TList::GetLastColumn()
  180. {
  181.     return (**fList).dataBounds.right;
  182. }
  183.  
  184. ListHandle TList::GetList()
  185. {
  186.     return fList;
  187. }
  188.  
  189. Rect TList::GetListRect()
  190. {
  191.     return (*fList)->rView;
  192. }
  193.  
  194.