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

Editor_VPoint.h

00001 #ifndef EDITOR_VPOINT_H
00002 #define EDITOR_VPOINT_H
00003 
00004 #include "Panel.h"
00005 #include "Point.h"
00006 #include "AbstractEditor.h"
00007 #include "Panel_VPoint.h"
00008 
00009 class VEditor_VPoint : public VAbstractEditor
00010 {
00011 protected:
00012         VPoint* m_pPoint;
00013         VPanel_VPoint* m_pPanel;
00014 
00015 public:
00016         VEditor_VPoint(VPoint* pPoint)
00017         {
00018                 m_pPanel = NULL;
00019                 m_pPoint = pPoint;
00020         }
00021 
00022         ~VEditor_VPoint()
00023         {
00024                 if (m_pPanel != NULL)
00025                         EndPanel();
00026         }
00027 
00029         void CreatePanel(CWnd* pParent, CRect rcWindowLocation)
00030         {
00031                 if (m_pPanel != NULL) // there already is a panel open
00032                         EndPanel();
00033 
00034                 m_pPanel = new VPanel_VPoint(pParent);
00035                 if (m_pPanel)
00036                 {
00037                         m_pPanel->Create(IDD_PANEL_POINT, pParent);
00038                         m_pPanel->EnableWindow(TRUE);
00039 
00040                         m_pPanel->m_X = m_pPoint->x / 20;
00041                         m_pPanel->m_Y = m_pPoint->y / 20;
00042 
00043                         m_pPanel->UpdateData(FALSE);
00044                         m_pPanel->ShowWindow(SW_SHOW);
00045                         // move the window to fit the space
00046                         m_pPanel->MoveWindow(rcWindowLocation.left, rcWindowLocation.top, rcWindowLocation.Width(), rcWindowLocation.Height(), FALSE);
00047                 }
00048         }
00049 
00051         void EndPanel()
00052         {
00053                 if (m_pPanel != NULL) { 
00054                         m_pPanel->UpdateData(TRUE);
00055                         m_pPoint->x = m_pPanel->m_X * 20;
00056                         m_pPoint->y = m_pPanel->m_Y * 20;
00057                         m_pPanel->DestroyWindow();
00058                         delete m_pPanel;
00059                         m_pPanel = NULL;
00060                 }
00061         }
00062 
00063 };
00064 
00065 
00066 #endif

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