home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / opendc12.zip / od124os2.exe / od12osp1.exe / src / dynamicp / bimaglay / ifacetad.c < prev    next >
Text File  |  1997-04-02  |  2KB  |  65 lines

  1. /*====START_GENERATED_PROLOG======================================
  2.  */
  3. /*
  4.  *   COMPONENT_NAME: oddynamicpart
  5.  *
  6.  *   CLASSES: none
  7.  *
  8.  *   ORIGINS: 82,27
  9.  *
  10.  *
  11.  *   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  12.  *   All Rights Reserved
  13.  *   Licensed Materials - Property of IBM
  14.  *   US Government Users Restricted Rights - Use, duplication or
  15.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  16.  *
  17.  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18.  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19.  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  20.  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  21.  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  22.  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  23.  *   OR PERFORMANCE OF THIS SOFTWARE.
  24.  */
  25. /*====END_GENERATED_PROLOG========================================
  26.  */
  27. /* @(#) 1.4 com/src/samples/dynamicp/bimaglay/ifacetad.c, oddynamicpart, od96os2, odos29712d 97/03/21 17:44:43 (97/02/18 13:54:16)
  28. *******************************************************************
  29. ** Name: void FacetAdded
  30. **
  31. ** Description:  Create a graphic font when a facet is added to
  32. **               the part and initiate frame negotiation.
  33. **
  34. *******************************************************************
  35. */
  36. try {
  37.    ODFrame * frame = facet->GetFrame(ev);
  38.    ODFrameFacetIterator* facets = frame->CreateFacetIterator(ev);
  39.  
  40.    // if this is the first facet, give the part a chance to resize the frame
  41.  
  42.    facets->First(ev);
  43.    if (!facets->Next(ev))         //Only one facet?
  44.    {
  45.      // set font to use this facet
  46.      {
  47.        ODShape *shape = kODNULL;
  48.        HPS hps;
  49.        CFocus f(facet, shape, &hps);          // Set up drawing environment
  50.  
  51.        IPresSpaceHandle DrawHps(hps);
  52.        _Font->useVectorOnly(TRUE, DrawHps);
  53.      }
  54.      // now adjust the facet's size
  55.      somSelf->AdjustSize(ev, frame, facet);
  56.    } /* endif */
  57.    delete facets;
  58.  
  59. } catch (IException &exc) {
  60.   reportIException(exc);
  61. } catch (...) {
  62.   reportAnyException(ev);
  63. } /* end try */
  64.  
  65.