home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / mac / UserInterface / CTextTable.cp < prev    next >
Encoding:
Text File  |  1998-04-08  |  2.7 KB  |  114 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. #ifdef PowerPlant_PCH
  20. #include PowerPlant_PCH
  21. #endif
  22.  
  23. #include "CTextTable.h"
  24.  
  25. #include <UDrawingUtils.h>
  26. #include <PP_Messages.h>
  27.  
  28. // ---------------------------------------------------------------------------
  29. //        Ñ CTextTable(LStream*)
  30. // ---------------------------------------------------------------------------
  31. //    Construct from the data in a Stream
  32.  
  33. CTextTable::CTextTable(
  34.     LStream*    inStream)
  35.     
  36.     :    super(inStream)
  37. {
  38. }
  39.  
  40. // ---------------------------------------------------------------------------
  41. //        Ñ ~CTextTable
  42. // ---------------------------------------------------------------------------
  43. //    Destructor
  44.  
  45. CTextTable::~CTextTable()
  46. {
  47. }
  48.  
  49. // ---------------------------------------------------------------------------
  50. //        Ñ ClickSelf
  51. // ---------------------------------------------------------------------------
  52.  
  53. void
  54. CTextTable::ClickSelf(
  55.     const SMouseDownEvent&    inMouseDown)
  56. {
  57.     if (FocusDraw())
  58.     {
  59.         SwitchTarget(this);
  60.         
  61.         UpdatePort ();
  62.  
  63.         super::ClickSelf(inMouseDown);
  64.     }
  65. }
  66.  
  67. // ---------------------------------------------------------------------------
  68. //        Ñ ObeyCommand
  69. // ---------------------------------------------------------------------------
  70. //    Respond to Command message
  71.  
  72. Boolean
  73. CTextTable::ObeyCommand(
  74.     CommandT    inCommand,
  75.     void*        ioParam)
  76. {
  77.     Boolean cmdHandled = true;
  78.     
  79.     switch (inCommand)
  80.     {
  81.         case msg_TabSelect:
  82.             if (!IsEnabled())
  83.             {
  84.                 cmdHandled = false;
  85.             }
  86.             break;
  87.             
  88.         default:
  89.             cmdHandled = LCommander::ObeyCommand(inCommand, ioParam);
  90.             break;
  91.     }
  92.     
  93.     return cmdHandled;
  94. }
  95.  
  96. // ---------------------------------------------------------------------------
  97. //        Ñ ObeyCommand
  98. // ---------------------------------------------------------------------------
  99. //    Deactivate list if we aren't going to be the target anymore
  100.  
  101. void CTextTable::DontBeTarget()
  102. {
  103.     Deactivate();
  104.     // UnselectAllCells();
  105. }
  106.  
  107.  
  108. void CTextTable::BeTarget()
  109. {
  110.     Activate();
  111. }
  112.  
  113.  
  114.