home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-09-18 | 2.1 KB | 56 lines | [ TEXT/ttxt]
OpenDoc Development Framework Embedding an OpenDoc File ODF Release 2 In the case where your part editor needs to embed another OpenDoc document or stationery without intervention by the user, ODF provides the function FW_ClonePartFromFile. This function, located in the file FWEmdUtl.cpp, allows you to clone a part from a document or stationery. Your code should look something like the following: void CMyFrame::EmbedOpenDocFile(Environment* ev, const FW_PFileSpecification& fileSpec) { // Call FW_ClonePartFromFile FW_CAcquiredODPart embeddedPart = FW_ClonePartFromFile(ev, this, fileSpec); // Create the proxy CMyProxy* proxy = FW_NEW(CMyProxy, (ev, .....)); // Create the frame shape FW_CRect tempRect(FW_kFixed0, FW_kFixed0, FW_IntToFixed(100), FW_IntToFixed(100)); FW_CAcquiredODShape aqFrameShape = ::FW_NewODShape(ev, tempRect); // Call FW_CPresentation Embed FW_TRY { proxy->Embed(ev, GetPresentation(ev), embeddedPart, NULL, kODFrameObject, aqFrameShape, FW_CPart::gViewAsFrameToken, NULL, 0, FALSE, FALSE); } FW_CATCH_BEGIN FW_CATCH_EVERYTHING () { delete proxy; FW_THROW_SAME (); } FW_CATCH_END // At this point you can add the proxy object to your content .... // Don't forget also to clip the embedded facets FW_CFacetClipper facetClipper(fMyPart); facetClipper.Clip(ev, GetPresentation(ev), aqFrameShape); } © 1993 - 1996 Apple Computer, Inc. All rights reserved. Apple, the Apple Logo, Macintosh, and OpenDoc are trademarks of Apple Computer, Inc., registered in the United States and other countries.