home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / mac / UserInterface / Tables / LTableRowSelector.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.8 KB  |  87 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /*
  20.     
  21.     Created 3/26/96 - Tim Craycroft
  22.  
  23.     
  24.     A subclass of LTableSelector that always selects entire rows.
  25.     Supports multiple selection and std selection extension semantics.
  26.     
  27.     Kind of lame implementation.  We store an array (LArray) 
  28.     of bytes, each byte representing a row.  Easier than expanding
  29.     and collapsing an array of bits.
  30. */
  31.  
  32.  
  33. #pragma once
  34.  
  35. #include <UTableHelpers.h>
  36. #include <LArray.h>
  37.  
  38. class    LTableRowSelector : public LTableSelector,
  39.                             public LArray {
  40. public:
  41.         LTableRowSelector(LTableView *inTableView, Boolean inAllowMultiple=true);
  42.                         
  43.     // TSM - Added two methods below for compatibility with PP 1.5
  44.     virtual    STableCell    GetFirstSelectedCell() const;
  45.     virtual    TableIndexT    GetFirstSelectedRow() const;
  46.  
  47.     virtual Boolean        CellIsSelected(const STableCell    &inCell) const;
  48.     
  49.     virtual void        SelectCell(const STableCell    &inCell);
  50.     virtual void        SelectAllCells();
  51.     virtual void        UnselectCell(const STableCell &inCell);
  52.     virtual void        UnselectAllCells();
  53.     
  54.     virtual void        ClickSelect(const STableCell        &inCell,
  55.                                     const SMouseDownEvent    &inMouseDown);
  56.     
  57.     virtual Boolean        DragSelect(    const STableCell        &inCell,
  58.                                     const SMouseDownEvent    &inMouseDown);
  59.  
  60.     virtual void        InsertRows(    Uint32                    inHowMany,
  61.                                     TableIndexT                inAfterRow);
  62.                                     
  63.     virtual void        RemoveRows(
  64.                                 Uint32        inHowMany,
  65.                                 TableIndexT    inFromRow );
  66.     TableIndexT            GetSelectedRowCount() const { return mSelectedRowCount; }
  67.     virtual void         DoSelect(TableIndexT inRow, Boolean inSelect, Boolean inHilite, Boolean inNotify = false);    
  68.  
  69. protected:
  70.     virtual void DoSelectAll(Boolean inSelect, Boolean inNotify);        
  71.     void DoSelectRange(TableIndexT inFrom, TableIndexT inTo, Boolean inSelect, Boolean inNotify);
  72.     
  73.     void ExtendSelection(TableIndexT inRow);
  74.  
  75. protected:
  76.     
  77.     TableIndexT            mAnchorRow;
  78.     TableIndexT            mExtensionRow;
  79.     Boolean                mAllowMultiple;
  80.     TableIndexT         mSelectedRowCount;
  81.     RgnHandle            mAddToSelection;
  82.     RgnHandle            mRemoveFromSelection;
  83.     RgnHandle            mInvertSelection;
  84.  
  85. };
  86.  
  87.