home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.4 KB | 144 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWGrowBx.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWFrameW.hpp"
-
- #ifndef FWGROWBX_H
- #include "FWGrowBx.h"
- #endif
-
- #ifndef FWFRAME_H
- #include "FWFrame.h"
- #endif
-
- #ifndef FWSCLBAR_H
- #include "FWSclBar.h"
- #endif
-
- #ifndef FWEVENT_H
- #include "FWEvent.h"
- #endif
-
- #ifndef FWCONTXT_H
- #include "FWContxt.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_ODFacet_xh
- #include <Facet.xh>
- #endif
-
- #ifndef SOM_ODWindow_xh
- #include <Window.xh>
- #endif
-
- //========================================================================================
- // File scope definitions
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwgadgts
- #endif
-
- //========================================================================================
- // CLASS FW_CGrowBox
- //========================================================================================
-
- FW_DEFINE_CLASS_M1(FW_CGrowBox, FW_CView)
-
- // This class is archivable, but we provide the archiving implementation in a separate
- // translation unit in order to enable deadstripping of the archiving-related code
- // in parts that do not use archiving with this class.
-
- //----------------------------------------------------------------------------------------
- // FW_CGrowBox::FW_CGrowBox
- //----------------------------------------------------------------------------------------
-
- FW_CGrowBox::FW_CGrowBox(Environment* ev,
- FW_CSuperView* container, ODID id,
- const FW_CPoint& location) :
- FW_CView(ev, container, FW_CRect(location, FW_kFixed0,FW_kFixed0), id)
- {
- SetSize(ev, FW_CScrollBar::GetDefaultScrollBarSize());
- SetBindings(ev, FW_kFixedSize + FW_kRightBinding + FW_kBottomBinding);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CGrowBox::FW_CGrowBox
- //----------------------------------------------------------------------------------------
-
- FW_CGrowBox::FW_CGrowBox(Environment* ev) :
- FW_CView(ev)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CGrowBox::~FW_CGrowBox
- //----------------------------------------------------------------------------------------
-
- FW_CGrowBox::~FW_CGrowBox()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CGrowBox::Draw
- //----------------------------------------------------------------------------------------
-
- void FW_CGrowBox::Draw(Environment* ev, ODFacet* facet, ODShape* invalidShape)
- {
- #ifdef FW_BUILD_MAC
- FW_CAcquiredODWindow aqODWindow = facet->GetFrame(ev)->AcquireWindow(ev);
- ODPlatformWindow window = aqODWindow->GetPlatformWindow(ev);
-
- // Clip to the grow box to avoid drawing the scollbars which may not be there
- FW_CViewContext vc(ev, this, facet, invalidShape);
-
- ::DrawGrowIcon(window);
-
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CGrowBox::DoActivateEvent
- //----------------------------------------------------------------------------------------
-
- void FW_CGrowBox::DoActivateEvent(Environment *ev, const FW_CActivateEvent& theActivateEvent)
- {
- #ifdef FW_BUILD_MAC
- ODFacet* facet = theActivateEvent.GetFacet(ev);
-
- // we simply draw the grow box again (DrawGrowIcon takes care of the activate state)
- Draw(ev, facet, NULL);
- #endif
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CGrowBox::Flatten
- //----------------------------------------------------------------------------------------
-
- void FW_CGrowBox::Flatten(Environment* ev, FW_CWritableStream& stream) const
- {
- FW_CView::Flatten(ev, stream);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CGrowBox::InitializeFromStream
- //----------------------------------------------------------------------------------------
-
- void FW_CGrowBox::InitializeFromStream(Environment* ev, FW_CReadableStream& stream)
- {
- FW_CView::InitializeFromStream(ev, stream);
-
- // Enforce standard size and bindings
- SetSize(ev, FW_CScrollBar::GetDefaultScrollBarSize());
- SetBindings(ev, FW_kFixedSize + FW_kRightBinding + FW_kBottomBinding);
- }
-
-