Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Editor_VPathController.h

00001 #ifndef EDITOR_VPATHCONTROLLER_H
00002 #define EDITOR_VPATHCONTROLLER_H
00003 
00004 #include "Panel.h"
00005 
00006 #include "AbstractEditor.h"
00007 #include "PathController.h"
00008 #include "Panel_VPathController.h"
00009 
00010 class VEditor_VPathController : public VAbstractEditor
00011 {
00012 protected:
00013         VPathController *m_pController;
00014         VPanel_VPathController *m_pPanel;
00015 
00016 
00017 public:
00018         VEditor_VPathController(VPathController* pController)
00019         {
00020                 m_pPanel = NULL;
00021                 m_pController = pController;
00022         }
00023 
00024         ~VEditor_VPathController()
00025         {
00026                 if (m_pPanel != NULL)
00027                         EndPanel();
00028         }
00029 
00031         void CreatePanel(CWnd* pParent, CRect rcWindowLocation)
00032         {
00033                 if (m_pPanel != NULL) // there already is a panel open
00034                         EndPanel();
00035 
00036                 m_pPanel = new VPanel_VPathController(pParent);
00037                 if (m_pPanel)
00038                 {
00039                 
00040                         m_pPanel->SetLine( m_pController->GetPath() );
00041 
00042                         m_pPanel->m_StartFrame = m_pController->StartFrame();
00043                         m_pPanel->m_EndFrame = m_pController->EndFrame();
00044 
00045                         m_pPanel->Create(IDD_PANEL_PATHCONTROLLER, pParent);
00046                         m_pPanel->EnableWindow(TRUE);
00047 
00048 
00049 
00050                         m_pPanel->ShowWindow(SW_SHOW);
00051                         // move the window to fit the space
00052                         m_pPanel->MoveWindow(rcWindowLocation.left, rcWindowLocation.top, rcWindowLocation.Width(), rcWindowLocation.Height(), FALSE);
00053                 }
00054         }
00055 
00057         void EndPanel()
00058         {
00059                 if (m_pPanel != NULL) { 
00060 
00061                         m_pPanel->UpdateData(TRUE);
00062 
00063                         m_pController->StartFrame( m_pPanel->m_StartFrame );
00064                         m_pController->EndFrame( m_pPanel->m_EndFrame );
00065 
00066                         m_pController->SetPath(  m_pPanel->GetLine() );
00067 
00068                         m_pPanel->DestroyWindow();
00069                         delete m_pPanel;
00070                         m_pPanel = NULL;
00071                 }
00072         }
00073 
00074 };
00075 
00076 
00077 
00078 #endif

Generated at Wed Aug 29 19:58:55 2001 for Pocket Animator by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001