home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / QuickTime / QT Tools / QuickTime Interfacing.sit / QuickTime Interfacing / SeeMovieRun folder / sources / CQTPane.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-26  |  4.2 KB  |  196 lines  |  [TEXT/KAHL]

  1. /****
  2.  * CQTPane.c
  3.  *
  4.  *    Pane methods for the QuickTime demo application.
  5.  *
  6.  *  Copyright © 1992 Joe Zobkiw.  All rights reserved.
  7.  *  Portions Copyright © 1990 Symantec Corporation.  All rights reserved.
  8.  *
  9.  ****/
  10.  
  11. /**
  12.  *
  13.  *  Most applications will want a scrollable window, so this
  14.  *  class is based on the class CPanorama. All the methods here
  15.  *  would still apply to classes based directly on CPane.
  16.  *
  17.  **/
  18.  
  19. #include "CQTPane.h"
  20. #include "Defines.h"
  21. #include "CMovie.h"
  22. #include "QuickTime Utilities.h"
  23. #include <CBartender.h>
  24.  
  25. extern    CBartender    *gBartender;    /* The menu handling object */
  26.  
  27. void CQTPane::IQTPane(CView *anEnclosure, CBureaucrat *aSupervisor,
  28.                             short aWidth, short aHeight,
  29.                             short aHEncl, short aVEncl,
  30.                             SizingOption aHSizing, SizingOption aVSizing,
  31.                             FSSpec *movieSpec)
  32. {
  33.     CPanorama::IPanorama(anEnclosure, aSupervisor, aWidth, aHeight,
  34.                             aHEncl, aVEncl, aHSizing, aVSizing);
  35.     
  36.     SetWantsClicks(true);
  37.     
  38.     //
  39.     // create our subpane to hold the movie
  40.     //
  41.     
  42.     itsMoviePane = new(CMovie);
  43.     itsMoviePane->IMovie(this, this, aWidth, aHeight,
  44.                          aHEncl, aVEncl, aHSizing, aVSizing, movieSpec);
  45. }
  46.  
  47. /***
  48.  * DoCommand
  49.  *
  50.  *    This is the heart of your pane.
  51.  *    In this method, you handle all the commands your pane
  52.  *    deals with.
  53.  *
  54.  ***/
  55.  
  56. void CQTPane::DoCommand(long theCommand)
  57.  
  58. {
  59.     switch (theCommand) {
  60.  
  61.         /* your pane commands here */
  62.             
  63.         default:    inherited::DoCommand(theCommand);
  64.                     break;
  65.     }
  66. }
  67.  
  68.  
  69. /***
  70.  * UpdateMenus
  71.  *
  72.  *  In this method you can enable menu commands that apply when
  73.  *  your pane is active.
  74.  *
  75. ***/
  76.  
  77.  void CQTPane::UpdateMenus()
  78.  
  79.  {
  80.   inherited::UpdateMenus();
  81.  
  82.     /* Enable your menu commands here (enable each one with a call to   
  83.        gBartender->EnableCmd(command_number)).  
  84.     */                
  85.     
  86.  }
  87.  
  88. /***
  89.  * ImportMovie
  90.  *
  91.  *    Import a movie into an existing document.
  92.  *
  93.  ***/
  94.  
  95. void CQTPane::ImportMovie(FSSpec *spec)
  96. {
  97.     itsMoviePane->ImportMovie(spec);
  98. }
  99.  
  100. /***
  101.  * Draw
  102.  *
  103.  *    In this method, you draw whatever you need to display in
  104.  *    your pane. The area parameter gives the portion of the 
  105.  *    pane that needs to be redrawn. Area is in frame coordinates.
  106.  *
  107.  ***/
  108.  
  109. void CQTPane::Draw(Rect *area)
  110.  
  111. {
  112.  
  113. }
  114.  
  115.  
  116. /***
  117.  * DoClick
  118.  *
  119.  *    The mouse went down in the pane.
  120.  *    In this method you do whatever is appropriate for your
  121.  *    application. HitPt is given in frame coordinates. The other
  122.  *    parameters, modiferKeys and when, are taken from the event
  123.  *    record.
  124.  *
  125.  *    If you want to implement mouse tracking, this is the method
  126.  *    to do it in. You need to create a subclass of CMouseTask and
  127.  *    pass it in a TrackMouse() message to the pane.
  128.  *
  129.  ***/ 
  130.  
  131. void CQTPane::DoClick(Point hitPt, short modifierKeys, long when)
  132.  
  133. {
  134.  
  135. }
  136.  
  137.  
  138. /***
  139.  * HitSamePart
  140.  *
  141.  *    Test whether pointA and pointB are in the same part.
  142.  *    "The same part" means different things for different applications.
  143.  *    In the default method, "the same part" means "in the same pane."
  144.  *    If you want a different behavior, override this method. For instance,
  145.  *    two points might be in the same part if they're within n pixels
  146.  *  of each other.
  147.  *
  148.  *    PointA and pointB are both in frame coordinates.
  149.  *
  150.  ***/
  151.  
  152. Boolean     CQTPane::HitSamePart(Point pointA, Point pointB)
  153.  
  154. {
  155.     return inherited::HitSamePart(pointA, pointB);
  156. }
  157.  
  158.  
  159. /***
  160.  * AdjustCursor
  161.  *
  162.  *    If you want the cursor to have a different shape in your pane,
  163.  *    do it in this method. If you want a different cursor for different
  164.  *    parts of the same pane, you'll need to change the mouseRgn like this:
  165.  *        1. Create a region for the "special area" of your pane.
  166.  *        2. Convert this region to global coordinates
  167.  *        3. Set the mouseRgn to the intersection of this region
  168.  *           and the original mouseRgn: SectRgn(mouseRgn, myRgn, mouseRgn);
  169.  *
  170.  *    The default method just sets the cursor to the arrow. If this is fine
  171.  *    for you, don't override this method.
  172.  *
  173.  ***/
  174.  
  175. void CQTPane::AdjustCursor(Point where, RgnHandle mouseRgn)
  176.  
  177. {
  178.     inherited::AdjustCursor(where, mouseRgn);
  179. }
  180.  
  181.  
  182. /***
  183.  * ScrollToSelection
  184.  *
  185.  *    If your pane is based on a Panorama (as this example is), you might
  186.  *    want to define what it means to have a selection and what it means to
  187.  *    scroll to that selection.
  188.  *
  189.  ***/
  190.  
  191. void CQTPane::ScrollToSelection(void)
  192.  
  193. {
  194.     /* scroll to the selection */
  195. }
  196.