home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Snippets / MMapp / MMovieControl.cp < prev    next >
Encoding:
Text File  |  1996-10-24  |  1.9 KB  |  91 lines  |  [TEXT/CWIE]

  1. #include "MMovieControl.h"
  2. // =================================================================================
  3. //    CColorControl.cp                    ©1995 Metrowerks Inc. All rights reserved.
  4. // =================================================================================
  5.  
  6. #include <LString.h>
  7. #include <UDrawingState.h>
  8. #include <UGraphicsUtilities.h>
  9.  
  10.  
  11.  
  12.  
  13. // ---------------------------------------------------------------------------------
  14. //        • CreateColorControlStream [static]
  15. // ---------------------------------------------------------------------------------
  16.  
  17.  
  18. void
  19. MMovieView::ListenToMessage( MessageT theMessage, void *ioParam )
  20. {
  21.     switch( theMessage )
  22.     {
  23.         case msg_PlayMovie:
  24.             {
  25.                 break;
  26.             }
  27.     }
  28.     if( ioParam )
  29.     {
  30.         return;
  31.     }
  32. }
  33.  
  34. MMovieView *
  35. MMovieView::CreateMoviePaneStream( LStream    *inStream )
  36. {
  37.     return (new MMovieView( inStream ));
  38. }
  39.  
  40.  
  41. // ---------------------------------------------------------------------------------
  42. //        • MMovieView
  43. // ---------------------------------------------------------------------------------
  44.  
  45. MMovieView::MMovieView()
  46. {
  47.     mMovieTitle = gEmptyString;
  48. }
  49.  
  50.  
  51. MMovieView::MMovieView(
  52.     LStream    *inStream )
  53.         : LView( inStream )
  54. {
  55.     // Initialize the color from the stream.
  56.     inStream->ReadPString( mMovieTitle );
  57. }
  58.  
  59.  
  60. // ---------------------------------------------------------------------------------
  61. //        • ~MMovieView
  62. // ---------------------------------------------------------------------------------
  63.  
  64. MMovieView::~MMovieView()
  65. {
  66. }
  67.  
  68.  
  69.  
  70. // ---------------------------------------------------------------------------------
  71. //        • DrawSelf
  72. // ---------------------------------------------------------------------------------
  73.  
  74. void
  75. MMovieView::DrawSelf()
  76. {
  77.     // Save and normalize the color and pen states.
  78.     StColorPenState savePenState;
  79.     StColorPenState::Normalize();
  80.     
  81.     // Calculate the frame rect.
  82.     Rect    theFrame;
  83.     CalcLocalFrameRect( theFrame );
  84.     
  85.     // Frame the control.
  86.     ::FrameRect( &theFrame );
  87.     
  88. }
  89.  
  90.  
  91.