home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Demos / A.D. Software / OOFILE / Buildable, limited OOFILE / source / GUI / Mac / PPlant / LStrTableView.h < prev    next >
Encoding:
Text File  |  1996-03-29  |  1.6 KB  |  58 lines  |  [TEXT/CWIE]

  1. // LStrTableView
  2. // simple subclass of LTableView, that just draws strings
  3. // ©1995 A.D. Software, all rights reserved
  4. // freely licensed for any use
  5. // contact dent@highway1.com.au  or http://www.highway1.com.au/adsoftware/
  6.  
  7. /*
  8.      INSTRUCTIONS
  9.  
  10. 1)     
  11.     in the Constructor
  12.     Create an LView object with a class id of 'stbv'.
  13.     
  14.  
  15. 2)
  16.     Register the class type somewhere, possibly in YourApp::RegisterClasses()
  17.     URegistrar::RegisterClass(LStrTableView::class_ID, (ClassCreatorFunc)LStrTableView::CreateStrTableViewStream);
  18.     
  19.     in FinishCreateSelf()
  20. 3)
  21.     create the control with a cast like:
  22.         mFindField = (LStrTableView *)FindPaneByID('Edit');
  23.  
  24.     instead of the normal
  25.         mFindField = (LTableView *)FindPaneByID('Edit');
  26.  
  27. */
  28.  
  29. #include <LTableView.h>
  30. #include <LBroadcaster.h>
  31.  
  32. class    LStrTableView : public LTableView, public LBroadcaster {
  33. public:
  34.     enum                 { class_ID = 'stbv' };
  35.     static LStrTableView*    CreateStrTableViewStream(
  36.                                 LStream                    *inStream);
  37.     
  38.         // • Constructors & Destructor
  39.     
  40.                         LStrTableView() {};
  41.                         LStrTableView(
  42.                                 const SPaneInfo            &inPaneInfo,
  43.                                 const SViewInfo            &inViewInfo,
  44.                                 LTableGeometry            *inTableGeometry,
  45.                                 LTableSelector            *inTableSelector,
  46.                                 LTableStorage            *inTableStorage);
  47.                         LStrTableView(LStream            *inStream);
  48.     virtual                ~LStrTableView() {};
  49.  
  50.     MessageT        GetDoubleClickMessage() const;
  51.     void            SetDoubleClickMessage(MessageT inMessage);
  52.     
  53.     virtual void ClickCell(const STableCell&, const SMouseDownEvent&);
  54.     virtual void DrawCell(    const STableCell&,    const Rect&);
  55.  
  56. protected:
  57.     MessageT        mDoubleClickMessage;
  58. };