home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / gui / CDragBarDockControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.4 KB  |  113 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. //    CDragBarDockControl.h
  21. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  22.  
  23. #pragma once
  24.  
  25. #include <LControl.h>
  26. #include "CToolTipAttachment.h"
  27. #include "CDynamicTooltips.h"
  28.  
  29. class CDragBar;
  30. class CSharedPatternWorld;
  31.  
  32. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  33. //
  34. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  35.  
  36. class CDragBarDockControl : public LControl, public CDynamicTooltipMixin
  37. {
  38.     public:
  39.         enum { class_ID = 'DbDc' };
  40.         
  41.                                 CDragBarDockControl(LStream* inStream);
  42.         virtual                    ~CDragBarDockControl();
  43.         
  44.         virtual    void            AddBarToDock(CDragBar* inBar);
  45.         virtual    void            RemoveBarFromDock(CDragBar* inBar);
  46.         virtual    Boolean            HasDockedBars(void) const;
  47.  
  48.         virtual void            SavePlace(LStream *outPlace);
  49.         virtual void            RestorePlace(LStream *inPlace);
  50.  
  51.             // Ñ Drawing
  52.  
  53.         virtual void            ResizeFrameBy(
  54.                                     Int16                 inWidthDelta,
  55.                                     Int16                inHeightDelta,
  56.                                     Boolean                inRefresh);
  57.  
  58.         virtual    void            SetNeedsRecalc(Boolean inRecalc);
  59.         virtual    Boolean            IsRecalcRequired(void) const;
  60.         
  61.         virtual void            HideBar(CDragBar* inBar); // for javascript - mjc        
  62.         virtual void            ShowBar(CDragBar* inBar); // for javascript - mjc    
  63.  
  64.         const CDragBar*            FindBarSpot(
  65.                                     Point                 inLocalPoint);
  66.  
  67.         // for hilighting on mouse entry/exit
  68.         void MouseLeave ( ) ;
  69.         void MouseWithin ( Point inPoint, const EventRecord & inEvent ) ;
  70.  
  71.         virtual void FindTooltipForMouseLocation ( const EventRecord& inMacEvent,
  72.                                                     StringPtr outTip ) ;
  73.  
  74.     protected:
  75.  
  76.  
  77.             // Ñ Drawing    
  78.         virtual void            DrawSelf(void);
  79.         virtual    void            DrawOneDockedBar(
  80.                                     CDragBar*             inBar);
  81.  
  82.         virtual void            RecalcDock(void);
  83.         virtual    void            CalcOneDockedBar(
  84.                                     CDragBar*            inBar,
  85.                                     const Rect&            inBounds);
  86.  
  87.             // CONTROL BEHAVIOUR
  88.             
  89.         virtual Int16            FindHotSpot(
  90.                                     Point                 inPoint);
  91.                                     
  92.         virtual Boolean            PointInHotSpot(
  93.                                     Point                 inPoint,
  94.                                     Int16                 inHotSpot);
  95.  
  96.         virtual void            HotSpotAction(
  97.                                     Int16                inHotSpot,
  98.                                     Boolean             inCurrInside,
  99.                                     Boolean                inPrevInside);
  100.                                     
  101.         virtual void            HotSpotResult(Int16 inHotSpot);    
  102.  
  103.         CSharedPatternWorld*     mBackPattern;
  104.         CSharedPatternWorld*    mBackPatternHilite;
  105.         CSharedPatternWorld*    mGrippy;
  106.         CSharedPatternWorld*    mGrippyHilite;
  107.         ResIDT                    mBarTraitsID;
  108.         LArray                    mBars;
  109.         Boolean                    mNeedsRecalc;
  110.         CIconHandle                mTriangle;
  111.         const CDragBar*            mMouseInside;        // which bar is mouse hovering over?
  112. };
  113.