home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / gui / CHyperScroller.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.0 KB  |  92 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. #pragma once
  20.  
  21. #include "CConfigActiveScroller.h"
  22.  
  23. /******************************************************************************
  24.  * CHyperScroller 
  25.  * Each hyperview needs the ability to show/hide a 
  26.  * - focus/dragging border
  27.  * - scrollers
  28.  * This is implemented as an addition to the LScroller class, because LScroller
  29.  * already manages the scrollbars
  30.  ******************************************************************************/
  31.  
  32. class CHyperScroller: public CConfigActiveScroller
  33. {
  34. #if !defined(__MWERKS__) || (__MWERKS__ >= 0x2000)
  35.     typedef CConfigActiveScroller inherited;
  36. #endif
  37.  
  38. public:
  39.     friend class CHyperView;
  40.     
  41.                     enum { class_ID = 'HSCR' };
  42.                     
  43.                      CHyperScroller( LStream* inStream );    
  44.  
  45.     void            ResetExpansion(void);
  46.  
  47.     void            ExpandLeft(void);
  48.     void            ExpandTop(void);
  49.     void            ExpandRight(void);
  50.     void            ExpandBottom(void);
  51.     
  52.     // Ñ display control
  53.     void            ShowScrollbars( Boolean hori, Boolean vert );
  54.     Boolean            HasScrollbars()    { return ( !fVerticalBar  && !fHorizontalBar ); }
  55.     Boolean            HasVerticalScrollbar() { return !fVerticalBar;}
  56.     Boolean            HasHorizontalScrollbar() {return !fHorizontalBar; }
  57.  
  58.     // Draw  a little gray rectangle next to scrollers if needed
  59.     void            DrawDummySizeBox();
  60.     
  61.     void            AdjustHyperViewBounds(void);
  62.     virtual void AdjustScrollBars();
  63.  
  64.     virtual void RefreshSelf();
  65.  
  66.     // Access to handle grow icon state
  67.     Boolean            GetHandleGrowIconManually() { return mHandleGrowIconManually; }
  68.     void            SetHandleGrowIconManually(Boolean inState)
  69.                     { mHandleGrowIconManually = inState; }
  70.  
  71.     // Override ClickSelf so that we can handle grow icon clicking
  72.     virtual void    ClickSelf(const SMouseDownEvent &inMouseDown);
  73.  
  74. protected:
  75.     // Ñ Standard overrides
  76.     virtual void        FinishCreateSelf(void);
  77.     virtual void        DrawSelf(void);
  78.     virtual void        ActivateSelf();
  79.  
  80.     SBooleanRect        mExpanded;
  81.  
  82.     Rect            CalcDummySizeBox();    // Rectangle enclosing the dummy box
  83.     void            DrawEmptyScroller( LStdControl* scrollBar );
  84.     LStdControl*    fVerticalBar;    // When it is hidden, we need to save this value
  85.                                     // because LScroller assumes that we want scrollbars
  86.                                     // to be visible. The only way to turn this off 
  87.                                     // is to set scrollbars to NIL.
  88.     LStdControl*    fHorizontalBar;
  89.     
  90.     Boolean            mHandleGrowIconManually;
  91. };
  92.