home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / gui / CTaskBarView.cp < prev    next >
Encoding:
Text File  |  1998-04-08  |  2.2 KB  |  69 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. // CTaskBarView.cp
  21. // A subclass of UTearOffBar for task bar view in main browser window
  22. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  23.  
  24. #include "CTaskBarView.h"
  25. #include "CGrayBevelView.h"
  26.  
  27. CTaskBarView::CTaskBarView(LStream *inStream) :
  28. CTearOffBar(inStream)
  29. {
  30.     *inStream >> fControlPaneID;
  31.     fAllowClickDrag = true;
  32. }
  33.  
  34. CTaskBarView::~CTaskBarView()
  35. {
  36. }
  37.  
  38. void CTaskBarView::Click( SMouseDownEvent    &inMouseDown )
  39. {
  40.                                     // Check if a SubPane of this View
  41.                                     //   is hit
  42. // Modified code
  43. // Check if we have clicked on a 0 pane
  44.     LPane    *clickedPane;
  45.     clickedPane = FindDeepSubPaneContaining(inMouseDown.wherePort.h,
  46.                                             inMouseDown.wherePort.v );
  47.     if    ( clickedPane != nil )
  48.     {
  49.         // If the controlling pane is click, we treat it as if the CTaskBarView
  50.         // were clicked and we process the drag.
  51.         if (clickedPane->GetPaneID() == fControlPaneID)
  52.         {
  53.             ClickSelf(inMouseDown);
  54.             return;
  55.         }
  56.     }
  57.  
  58. // LView::Click code
  59.     // If it was one of our subpanes (but not the controlling pane-- we would have
  60.     // already returned) then we let it get the click.
  61.     clickedPane = FindSubPaneHitBy(inMouseDown.wherePort.h,
  62.                                             inMouseDown.wherePort.v);
  63.  
  64.     if    ( clickedPane != nil )
  65.     {        //  SubPane is hit, let it respond to the Click
  66.         clickedPane->Click(inMouseDown);
  67.     }
  68. }
  69.