home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-03-29 | 2.8 KB | 111 lines | [TEXT/CWIE] |
- // Release Version: $ ODF 1 $
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
-
- //================================================================================
- #ifndef PART_H
- #include "Part.h"
- #endif
-
- #ifndef FRAME_H
- #include "Frame.h"
- #endif
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- #ifndef BINDING_K
- #include "Binding.k"
- #endif
-
- // ----- Framework Includes -----
- #ifndef FWUTIL_H
- #include "FWUtil.h"
- #endif
-
- #ifndef FWABOUT_H
- #include "FWAbout.h" //::FW_About()
- #endif
-
- #include "SLMixOS.h" // FW_GetMainScreenBounds
-
- //==============================================================================
- #ifdef FW_BUILD_MAC
- #pragma segment GraphicsBfr
- #endif
-
- FW_DEFINE_AUTO(CGraphicsBfrPart)
- //==============================================================================
- CGraphicsBfrPart::CGraphicsBfrPart(ODPart* odPart)
- : FW_CPart(odPart, FW_gInstance, kPartInfoID),
- fPresentation(NULL)
- {
- }
-
- //--------------------------------------------------------------------------------
- CGraphicsBfrPart::~CGraphicsBfrPart()
- {
- }
-
- //--------------------------------------------------------------------------------
- void
- CGraphicsBfrPart::Initialize(Environment* ev) // Override
- {
- FW_CPart::Initialize(ev);
- FW_CSelection* selection = NULL;
- const ODType kMainPresentation = "Apple:Presentation:GraphicsBfr";
- fPresentation = this->RegisterPresentation(ev, kMainPresentation, true, selection);
- }
-
- //--------------------------------------------------------------------------------
- FW_CFrame*
- CGraphicsBfrPart::NewFrame(Environment* ev, ODFrame* odFrame,
- FW_CPresentation* presentation, FW_Boolean fromStorage) // Override
- {
- FW_UNUSED(presentation);
- FW_UNUSED(fromStorage);
- return FW_NEW(CGraphicsBfrFrame, (ev, odFrame, presentation, this));
- }
-
- //----------------------------------------------------------------------------------------
- FW_CWindow*
- CGraphicsBfrPart::NewDocumentWindow(Environment* ev)
- {
- FW_CRect screenBounds;
- ::FW_GetMainScreenBounds(screenBounds);
- screenBounds.Inset(FW_IntToFixed(3), FW_IntToFixed(3));
-
- return new FW_CWindow(ev,
- this,
- FW_CPart::gViewAsFrameToken,
- fPresentation,
- FW_CPoint(FW_IntToFixed(300), FW_IntToFixed(300)),
- screenBounds.TopLeft(),
- FW_kDocumentWindow);
- }
-
- //--------------------------------------------------------------------------------
- FW_CContent*
- CGraphicsBfrPart::NewPartContent(Environment* ev)
- {
- return NULL;
- }
-
- //--------------------------------------------------------------------------------
- FW_Boolean
- CGraphicsBfrPart::DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent) // Override
- {
- FW_Boolean menuHandled = true;
- switch (theMenuEvent.GetCommandID(ev))
- {
- case kODCommandAbout:
- ::FW_About(ev, this, kAbout);
- break;
-
- default:
- menuHandled = false;
- }
- return menuHandled;
- }
-
-