// $Revision: 1.5 $ // Copyright (C) 1995 Taligent, Inc. All rights reserved. #if 0 --------------------------------------------------------------------------- > Class: | TGraphicDocumentView > Taxonomy Category: | Documented Samples | WebRunner Sample > Interface Category: | Sample. > Inherits From: | TDocumentComponentView, MDropAcceptor, MMouseEventHandler > Inherited By: | None. > Purpose: | This view is used to display a graphic document component. It needs to handle the display of the graphic in addition to component resizing and drag and drop. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | No special considerations. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TGraphicDocumentView::TGraphicDocumentView ; | 1. TGraphicDocumentView (TGUIBundle * bundle) | 2. TGraphicDocumentView () | 3. TGraphicDocumentView (const TGraphicDocumentView & source) > Interface Category: | Sample. > Purpose: | 1. Presentation framework constructor, uses the state bundle to allow access to the model and document state. | 2. Default constructor. | 3. Copy constructor. > Calling Context: | 1. Called by the Document framework's presenters. | 2. Called by the stream-in operators. | 3. Called to copy an object. > Parameters: = 1. TGUIBundle * bundle -The Presentation framework state bundle. = 2. Takes no parameters. = 3. const TGraphicDocumentView & source -The view to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TGraphicDocumentView::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -The stream the object streams itself out to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TGraphicDocumentView::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -The stream the object streams itself in from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws TInvalidVersionError if the object version isn't known. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TGraphicDocumentView::DrawContents ; | virtual void DrawContents (TGrafPort & port) const > Interface Category: | Sample. > Purpose: | Draws the contents of this view to the provided graphic port. > Calling Context: | Called by the View system, but can be directly called when needed by a user. > Parameters: = TGrafPort & port -The graphic port into which this draws. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TGraphicDocumentView::HandleAllocatedAreaChanged ; | void HandleAllocatedAreaChanged (const TGArea & newArea) > Interface Category: | Sample. > Purpose: | Creates a matrix to scale the graphic to the new area of the view and then invalidates the view to force a redraw with this matrix. > Calling Context: | Called by the View system when the view is resized. > Parameters: = const TGArea & newArea -The new area of the view. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TGraphicDocumentView::MouseDown ; | virtual bool MouseDown (TMouseDownEvent & event) > Interface Category: | Sample. > Purpose: | When a mouse-down event is received by this view, it creates a graphical scrap item (TScrapItemOn< MGraphic >) and begins a drag of this item. The drag graphic used is a copy of the raw graphic that was used to create this component, which might not be scaled the same as the current view. > Calling Context: | Called by the Input system. > Parameters: = TMouseDownEvent & event -The event that caused the MouseDown. > Return Value: | Returns true, always handles the event. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TGraphicDocumentView::ChoosePreferredType ; | virtual bool ChoosePreferredType (const TGPoint & whereDropped, const TSequenceOf < TTypeDescription > & availableTypes, TTypeDescription & chosenType) const > Interface Category: | Sample. > Purpose: | Chooses from a collection of available types in a drop action. This member function iterates through the collection and only accepts the graphic scrap type returned by TScrapItemOn< MGraphic >::GetScrapItemType. > Calling Context: | Called by the Drag and Drop framework. > Parameters: = const TGPoint & whereDropped -The drop location in the view. = const TSequenceOf < TTypeDescription > & availableTypes -The list of available types. = TTypeDescription & chosenType -Where the chosen type is assigned. > Return Value: | Returns true if it finds an acceptable graphic scrap type, returns | false otherwise. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TGraphicDocumentView::AcceptDrop ; | bool AcceptDrop (const TGPoint & droppedAt, const TTypeDescription & type, const TScrapItem & item) > Interface Category: | Sample. > Purpose: | Takes the dropped scrap item, extracts its data graphic, and changes the content of this component to display that graphic. > Calling Context: | Called by the Drag and Drop framework. > Parameters: = const TGPoint & droppedAt -The location of the drop event. = const TTypeDescription & type -The CommonPoint type of the scrap item. = const TScrapItem & item -The scrap item wrapper for the data. > Return Value: | Returns true if the dropped item is a graphic scrap item. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TGraphicDocumentView::LookupGraphic ; | const MGraphic * LookupGraphic () const > Interface Category: | Sample. > Purpose: | This is used internally to get a pointer to the graphic from the model. > Calling Context: | Called internally. > Parameters: = Takes no parameters. > Return Value: | Returns an alias to the graphic being displayed by this view. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TGraphicDocumentView::AdoptGraphic ; | void AdoptGraphic (MGraphic * toGraphic) const > Interface Category: | Sample. > Purpose: | Used internally to change the graphic displayed by this view. > Calling Context: | Called internally. > Parameters: = MGraphic * toGraphic -The new graphic to display. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif