GME  13
GMEConstraintPropertiesDialog.cpp
Go to the documentation of this file.
00001 //###############################################################################################################################################
00002 //
00003 //      Object Constraint Language Generic Manager
00004 //      GMEConstraintPropertiesDialog.cpp
00005 //
00006 //###############################################################################################################################################
00007 
00008 #include "StdAfx.h"
00009 #include "OCLGMECMFacade.h"
00010 #include "constraintmanager.h"
00011 #include "GMEConstraintBrowserDialog.h"
00012 #include "GMEConstraintPropertiesDialog.h"
00013 #include "GMESyntacticSemanticDialog.h"
00014 #include "OCLCommonEx.h"
00015 #include <algorithm>
00016 
00017 #ifdef _DEBUG
00018 #define new DEBUG_NEW
00019 #undef THIS_FILE
00020 static char THIS_FILE[] = __FILE__;
00021 #endif
00022 
00023 typedef std::map<int,int> EventMap;
00024 
00025 namespace OclGmeCM
00026 {
00027 
00028 //##############################################################################################################################################
00029 //
00030 //      C L A S S : CConstraintPropertiesDialog <<< + CDialog
00031 //
00032 //##############################################################################################################################################
00033 
00034 CConstraintPropertiesDialog::CConstraintPropertiesDialog( CConstraintBrowserDialog* pDialog, OclGme::SpConstraint spConstraint, CWnd* pParent )
00035         : CDialog(CConstraintPropertiesDialog::IDD, pParent), m_pDialog( pDialog ), m_spConstraintIn( spConstraint )
00036 {
00037         //{{AFX_DATA_INIT(CConstraintPropertiesDialog)
00038                 // NOTE: the ClassWizard will add member initialization here
00039         //}}AFX_DATA_INIT
00040 }
00041 
00042 
00043 void CConstraintPropertiesDialog::DoDataExchange(CDataExchange* pDX)
00044 {
00045         CDialog::DoDataExchange(pDX);
00046         //{{AFX_DATA_MAP(CConstraintPropertiesDialog)
00047         DDX_Control(pDX, CRP_TABPAGES, m_tabPages);
00048         DDX_Control(pDX, CRP_BTNOK, m_btnOK);
00049         DDX_Control(pDX, CRP_BTNCANCEL, m_btnCancel);
00050         //}}AFX_DATA_MAP
00051 }
00052 
00053 
00054 BEGIN_MESSAGE_MAP(CConstraintPropertiesDialog, CDialog)
00055         //{{AFX_MSG_MAP(CConstraintPropertiesDialog)
00056         ON_BN_CLICKED(CRP_BTNCANCEL, OnClickCancel)
00057         ON_BN_CLICKED(CRP_BTNOK, OnClickOK)
00058         ON_NOTIFY(TCN_SELCHANGE, CRP_TABPAGES, OnSelectionChangeTab)
00059         //}}AFX_MSG_MAP
00060 END_MESSAGE_MAP()
00061 
00062 BOOL CConstraintPropertiesDialog::OnInitDialog()
00063 {
00064         CDialog::OnInitDialog();
00065 
00066         m_tabPages.InsertItem(  0, _T("Identity") );
00067         m_tabPages.InsertItem(  1, _T("Expression") );
00068         m_tabPages.InsertItem(  2, _T("Events") );
00069 
00070         m_pageIdentity.Create( IDD_PROPERTIES_IDENTITY_PAGE, &m_tabPages );
00071         m_pageExpression.Create( IDD_PROPERTIES_EXPRESSION_PAGE, &m_tabPages );
00072         m_pageEvent.Create( IDD_PROPERTIES_EVENT_PAGE, &m_tabPages );
00073 
00074         PlacePage( m_pageIdentity );
00075         PlacePage( m_pageExpression );
00076         PlacePage( m_pageEvent );
00077 
00078         m_lstImages.Create( 16, 16, ILC_COLOR24 | ILC_MASK, 28, 28 );
00079         CBitmap bmp;
00080         bmp.LoadBitmap( IDB_TREEICONS );
00081         m_lstImages.Add( &bmp, RGB( 255, 0, 255 ) );
00082 
00083         std::string strName;
00084         std::string strContext;
00085         if ( m_spConstraintIn.Ptr() )
00086                 m_spConstraintIn->GetContextAndName( strContext, strName );
00087 
00088         // Fill Identity Page
00089 
00090         if ( m_spConstraintIn.Ptr() ) {
00091                 m_pageIdentity.m_edtName.SetWindowText( OclCommonEx::Convert( strName ) );
00092                 m_pageIdentity.m_edtName.SetReadOnly( true );
00093                 m_pageIdentity.m_edtDescription.SetWindowText( OclCommonEx::Convert( m_spConstraintIn->GetMessage() ) );
00094                 m_pageIdentity.m_edtDescription.SetReadOnly( m_spConstraintIn->GetLocation() != OclGme::ConstraintBase::CL_PROJECT );
00095                 m_pageIdentity.m_edtDefault.SetReadOnly( m_spConstraintIn->GetLocation() != OclGme::ConstraintBase::CL_PROJECT );
00096                 m_pageIdentity.m_cmbPriority.SetCurSel( m_spConstraintIn->GetPriority() - 1 );
00097                 m_pageIdentity.m_cmbPriority.EnableWindow( m_spConstraintIn->GetLocation() == OclGme::ConstraintBase::CL_PROJECT );
00098                 m_pageIdentity.m_cmbDepth.SetCurSel( m_spConstraintIn->GetDepth() );
00099                 m_pageIdentity.m_cmbDepth.EnableWindow( m_spConstraintIn->GetLocation() == OclGme::ConstraintBase::CL_PROJECT );
00100                 switch ( m_spConstraintIn->GetLocation() ) {
00101                         case OclGme::ConstraintBase::CL_PROJECT : {
00102                                 CString strProject;
00103                                 COMTHROW( m_pDialog->m_pFacade->GetProject()->get_Name( PutOut( strProject ) ) );
00104                                 m_pageIdentity.m_edtDefinition.SetWindowText( L"Project: " + strProject );
00105                                 break;
00106                         }
00107                         case OclGme::ConstraintBase::CL_META : {
00108                                 CString strMProject;
00109                                 COMTHROW( m_pDialog->m_pFacade->GetMetaProject()->get_Name( PutOut( strMProject ) ) );
00110                                 m_pageIdentity.m_edtDefinition.SetWindowText( L"Meta: " + strMProject );
00111                                 break;
00112                         }
00113                         default : {
00114                                 StringVector vecLibPath = m_spConstraintIn->GetLibraryPath();
00115                                 CString strPath;
00116                                 for ( unsigned int i = 0 ; i < vecLibPath.size() ; i++ ) {
00117                                         if ( i > 0 )
00118                                                 strPath += "/";
00119                                         strPath += OclCommonEx::Convert( vecLibPath[ i ] );
00120                                 }
00121                                 m_pageIdentity.m_edtDefinition.SetWindowText( L"Library: " + strPath );
00122                                 break;
00123                         }
00124                 }
00125         }
00126         else {
00127                 m_pageIdentity.m_cmbPriority.SetCurSel( 0 );
00128                 m_pageIdentity.m_cmbDepth.SetCurSel( 1 );
00129                 CString strProject;
00130                 COMTHROW( m_pDialog->m_pFacade->GetProject()->get_Name( PutOut( strProject ) ) );
00131                 m_pageIdentity.m_edtDefinition.SetWindowText( L"Project: " + strProject );
00132         }
00133 
00134         // Fill Expression Page
00135 
00136         m_pageExpression.m_cmbContext.SetImageList( &m_lstImages );
00137         FillContextCombo( OBJTYPE_FOLDER );
00138         FillContextCombo( OBJTYPE_MODEL );
00139         FillContextCombo( OBJTYPE_ATOM );
00140         FillContextCombo( OBJTYPE_REFERENCE );
00141         FillContextCombo( OBJTYPE_CONNECTION );
00142         FillContextCombo( OBJTYPE_SET );
00143         if ( m_pageExpression.m_cmbContext.GetCount() != 0 )
00144                 m_pageExpression.m_cmbContext.SetCurSel( 0 );
00145 
00146         GetItem( 1 );
00147 
00148         if ( m_spConstraintIn.Ptr() ) {
00149                 m_pageExpression.m_cmbContext.EnableWindow( false );
00150                 int iPos = FindItem( OclCommonEx::Convert( strContext ) );
00151                 if ( iPos == -1 ) {
00152                         iPos = InsertItem( OBJTYPE_NULL, L"Invalid context: " + OclCommonEx::Convert( strContext ) );
00153                         m_btnOK.EnableWindow( m_spConstraintIn->GetLocation() == OclGme::ConstraintBase::CL_PROJECT );
00154                 }
00155                 m_pageExpression.m_cmbContext.SetCurSel( iPos );
00156 
00157                 CString strExpression = OclCommonEx::Convert( m_spConstraintIn->GetExpression() );
00158                 strExpression.Replace( _T("\r"), _T("") );
00159                 strExpression.Replace( _T("\n"), _T("\r\n") );
00160                 strExpression.Replace( _T("\t"), _T("    ") );
00161                 m_pageExpression.m_edtExpression.SetWindowText( strExpression );
00162                 m_pageExpression.m_edtExpression.SetReadOnly( m_spConstraintIn->GetLocation() != OclGme::ConstraintBase::CL_PROJECT );
00163         }
00164 
00165         // Fill Event Page
00166 
00167         if ( m_spConstraintIn.Ptr() ) {
00168                 EventMap eMap = GetEventMap();
00169                 for ( EventMap::iterator i = eMap.begin() ; i != eMap.end() ; ++i ) {
00170                         ( ( CButton* ) m_pageEvent.GetDlgItem( (*i).second ) )->SetCheck( ( m_spConstraintIn->GetEventMask() & (*i).first ) ? 1 : 0 );
00171                         m_pageEvent.GetDlgItem( (*i).second )->EnableWindow( m_spConstraintIn->GetLocation() == OclGme::ConstraintBase::CL_PROJECT );
00172                 }
00173         }
00174 
00175         m_btnCancel.EnableWindow( ! ( m_spConstraintIn.Ptr() && m_spConstraintIn->GetLocation() != OclGme::ConstraintBase::CL_PROJECT ) );
00176 
00177         return TRUE;
00178 }
00179 
00180 void CConstraintPropertiesDialog::PlacePage( CDialog& dlgPage )
00181 {
00182         CRect rectTab; 
00183         m_tabPages.GetWindowRect( rectTab ); 
00184         m_tabPages.ScreenToClient( rectTab );
00185         CRect rectItem;
00186         m_tabPages.GetItemRect( 0, rectItem );
00187         
00188         CRect rect;
00189         dlgPage.GetWindowRect( rect ); 
00190         m_tabPages.ScreenToClient( rect );
00191 
00192         int iXGap = ( rectTab.Width() - rect.Width() ) / 2;
00193         int iYGap = ( rectTab.Height() - rectItem.Height() - rect.Height() ) / 2;
00194         
00195         rect.left = iXGap;
00196         rect.right = rectTab.Width() - iXGap;
00197         rect.top = rectItem.Height() + iYGap;
00198         rect.bottom = rectTab.Height() - iYGap;
00199 
00200         dlgPage.MoveWindow( rect );
00201 }
00202 
00203 void CConstraintPropertiesDialog::FillContextCombo( objtype_enum eType )
00204 {
00205         OclCommonEx::MetaBaseVector vecMetas;
00206         OclCommonEx::GetMetaObjects( m_pDialog->m_pFacade->GetMetaProject(), "", eType, vecMetas );
00207 
00208         StringVector vecKinds;
00209         for ( unsigned int i = 0 ; i < vecMetas.size() ; i++ )
00210                 vecKinds.push_back( OclCommonEx::GetObjectName( vecMetas[ i ].p ) );
00211         std::sort( vecKinds.begin(), vecKinds.end() );
00212 
00213         for ( unsigned int i = 0 ; i < vecKinds.size() ; i++ )
00214                 InsertItem( eType, L"meta::" + OclCommonEx::Convert( vecKinds[ i ] ) );
00215 }
00216 
00217 int CConstraintPropertiesDialog::InsertItem( objtype_enum eType, CString& strItem )
00218 {
00219         COMBOBOXEXITEM cbi;
00220         cbi.mask = CBEIF_INDENT | CBEIF_TEXT;
00221         if ( eType != OBJTYPE_NULL )
00222                 cbi.mask |= CBEIF_IMAGE | CBEIF_OVERLAY | CBEIF_SELECTEDIMAGE;
00223         cbi.iItem = m_pageExpression.m_cmbContext.GetCount();
00224         cbi.pszText = strItem.GetBuffer( strItem.GetLength() );
00225         cbi.cchTextMax = strItem.GetLength();
00226         if ( eType != OBJTYPE_NULL ) {
00227                 cbi.iImage = ( eType != OBJTYPE_FOLDER ) ? eType + 10 : ( strItem ==  _T("meta::RootFolder") ) ? 9 : 10;
00228                 cbi.iSelectedImage = cbi.iImage;
00229                 cbi.iOverlay = cbi.iImage;
00230         }
00231         cbi.iIndent = I_INDENTCALLBACK;
00232         int iResult = m_pageExpression.m_cmbContext.InsertItem( &cbi );
00233         strItem.ReleaseBuffer();
00234         return iResult;
00235 }
00236 
00237 CString CConstraintPropertiesDialog::GetItem( int iPos )
00238 {
00239         CString strResult;
00240         COMBOBOXEXITEM cbi;
00241         cbi.mask = CBEIF_TEXT;
00242         cbi.iItem = iPos;
00243         cbi.pszText = strResult.GetBuffer( 255 );
00244         cbi.cchTextMax = 255;
00245 
00246         m_pageExpression.m_cmbContext.GetItem( &cbi );
00247         strResult.ReleaseBuffer();
00248         return strResult;
00249 }
00250 
00251 int CConstraintPropertiesDialog::FindItem( const CString& strItem )
00252 {
00253         for ( int i = 0 ; i < m_pageExpression.m_cmbContext.GetCount() ; i++ )
00254                 if ( GetItem( i ) == strItem )
00255                         return i;
00256         return -1;
00257 }
00258 
00259 void CConstraintPropertiesDialog::OnClickCancel()
00260 {
00261         CDialog::OnCancel();
00262 }
00263 
00264 void CConstraintPropertiesDialog::OnClickOK()
00265 {
00266         if ( m_spConstraintIn.Ptr() && m_spConstraintIn->GetLocation() != OclGme::ConstraintBase::CL_PROJECT ) {
00267                 CDialog::OnCancel();
00268                 return;
00269         }
00270 
00271         // Retrieve Identity Page
00272 
00273         CString strName;
00274         m_pageIdentity.m_edtName.GetWindowText( strName );
00275         if ( strName.IsEmpty() ) {
00276                 AfxMessageBox( _T("Constraint cannot be untitled.") );
00277                 return;
00278         }
00279 
00280         CString strDescription;
00281         m_pageIdentity.m_edtDescription.GetWindowText( strDescription );
00282         if ( strDescription.IsEmpty() ) {
00283                 AfxMessageBox( _T("Constraint must have description.") );
00284                 return;
00285         }
00286 
00287         long lPriority = m_pageIdentity.m_cmbPriority.GetCurSel() + 1;
00288 
00289         constraint_depth_enum eDepth = ( constraint_depth_enum ) m_pageIdentity.m_cmbDepth.GetCurSel();
00290 
00291         // Retrieve Expression page
00292 
00293         CString strContext = GetItem( m_pageExpression.m_cmbContext.GetCurSel() );
00294 
00295         CString strExpression;
00296         m_pageExpression.m_edtExpression.GetWindowText( strExpression );
00297         if ( strExpression.IsEmpty() ) {
00298                 AfxMessageBox( _T("Constraint must have expression.") );
00299                 return;
00300         }
00301 
00302         // Retrieve Event page
00303 
00304         unsigned long ulEventMask = 0;
00305         EventMap eMap = GetEventMap();
00306         for ( EventMap::iterator i = eMap.begin() ; i != eMap.end() ; ++i ) {
00307                 if ( ( ( CButton* ) m_pageEvent.GetDlgItem( (*i).second ) )->GetCheck() == 1 )
00308                         ulEventMask |= (*i).first;
00309         }
00310 
00311         // Check whether Constraint is unique
00312 
00313         ConstraintVectorMap::iterator it = m_pDialog->m_mapConstraints.find( OclCommonEx::Convert( strContext ) );
00314         if ( it != m_pDialog->m_mapConstraints.end() ) {
00315                 OclGme::ConstraintVector vecConstraints = (*it).second;
00316                 for ( unsigned int i = 0 ; i < vecConstraints.size() ; i++ )
00317                         if ( vecConstraints[ i ]->GetName() == OclCommonEx::Convert( strName ) && vecConstraints[ i ].Ptr() != m_spConstraintIn.Ptr() ) {
00318                                 AfxMessageBox( _T("Context [ ") + strContext + _T(" ] already has a constraint called ") + strName + _T(".") );
00319                                 return;
00320                         }
00321         }
00322 
00323         OclGme::Constraint* pConstraint = new OclGme::Constraint( OclCommonEx::Convert( strName ), OclCommonEx::Convert( strContext ), OclCommonEx::Convert( strExpression ), OclCommonEx::Convert( strDescription ), ulEventMask,  lPriority, eDepth );
00324         OclGme::SpConstraint spConstraint( pConstraint );
00325         spConstraint->Register( m_pDialog->m_pFacade->GetTreeManager() );
00326         Ocl::Constraint::State eState = spConstraint->Parse();
00327         if ( eState == Ocl::Constraint::CS_PARSE_SUCCEEDED ) {
00328                 OclTree::TypeContextStack context;
00329                 context.AddVariable( "project", TypeSeq( 1, "gme::Project" ) );
00330                 eState = spConstraint->Check( context );
00331                 if ( eState == Ocl::Constraint::CS_CHECK_SUCCEEDED ) {
00332                         spConstraint->SetDependencyResult( OclMeta::DependencySet() );
00333                         m_spConstraintOut = spConstraint;
00334                         CDialog::OnOK();
00335                         return;
00336                 }
00337         }
00338 
00339         CSyntacticSemanticDialog dlgErrors( this );
00340         dlgErrors.AddItem( spConstraint );
00341         dlgErrors.DoModal();
00342 }
00343 
00344 void CConstraintPropertiesDialog::OnSelectionChangeTab(NMHDR* pNMHDR, LRESULT* pResult)
00345 {
00346         m_pageIdentity.ShowWindow( ( m_tabPages.GetCurSel() == 0 ) ? SW_SHOW : SW_HIDE );
00347         m_pageExpression.ShowWindow( ( m_tabPages.GetCurSel() == 1 ) ? SW_SHOW : SW_HIDE );
00348         m_pageEvent.ShowWindow( ( m_tabPages.GetCurSel() == 2 ) ? SW_SHOW : SW_HIDE );
00349         *pResult = 0;
00350 }
00351 
00352 EventMap CConstraintPropertiesDialog::GetEventMap() const
00353 {
00354         EventMap eMap;
00355 
00356         eMap.insert( EventMap::value_type( OBJEVENT_RELATION, PEVP_CHKCHANGEASSOC ) );
00357         eMap.insert( EventMap::value_type( OBJEVENT_ATTR, PEVP_CHKCHANGEATTRIB ) );
00358         eMap.insert( EventMap::value_type( OBJEVENT_PROPERTIES, PEVP_CHKCHANGEPROP ) );
00359         eMap.insert( EventMap::value_type( OBJEVENT_CLOSEMODEL, PEVP_CHKCLOSEMODEL ) );
00360         eMap.insert( EventMap::value_type( OBJEVENT_CONNECTED, PEVP_CHKCONNECT ) );
00361         eMap.insert( EventMap::value_type( OBJEVENT_CREATED, PEVP_CHKCREATE ) );
00362         eMap.insert( EventMap::value_type( OBJEVENT_DESTROYED, PEVP_CHKDELETE ) );
00363         eMap.insert( EventMap::value_type( OBJEVENT_SUBT_INST, PEVP_CHKDERIVE ) );
00364         eMap.insert( EventMap::value_type( OBJEVENT_DISCONNECTED, PEVP_CHKDISCONNECT ) );
00365         eMap.insert( EventMap::value_type( OBJEVENT_SETEXCLUDED, PEVP_CHKEXCLUDESET ) );
00366         eMap.insert( EventMap::value_type( OBJEVENT_SETINCLUDED, PEVP_CHKINCLUDESET ) );
00367         eMap.insert( EventMap::value_type( OBJEVENT_LOSTCHILD, PEVP_CHKLOSTCHILD ) );
00368         eMap.insert( EventMap::value_type( OBJEVENT_PARENT, PEVP_CHKMOVE ) );
00369         eMap.insert( EventMap::value_type( OBJEVENT_NEWCHILD, PEVP_CHKNEWCHILD ) );
00370         eMap.insert( EventMap::value_type( OBJEVENT_REFERENCED, PEVP_CHKREFER ) );
00371         eMap.insert( EventMap::value_type( OBJEVENT_REFRELEASED, PEVP_CHKUNREFER ) );
00372 
00373         return eMap;
00374 }
00375 
00376 //##############################################################################################################################################
00377 //
00378 //      C L A S S : CIdentityPage <<< + CDialog
00379 //
00380 //##############################################################################################################################################
00381 
00382 CIdentityPage::CIdentityPage(CWnd* pParent /*=NULL*/)
00383         : CDialog(CIdentityPage::IDD, pParent)
00384 {
00385         //{{AFX_DATA_INIT(CIdentityPage)
00386         //}}AFX_DATA_INIT
00387 }
00388 
00389 void CIdentityPage::DoDataExchange(CDataExchange* pDX)
00390 {
00391         CDialog::DoDataExchange(pDX);
00392         //{{AFX_DATA_MAP(CIdentityPage)
00393         DDX_Control(pDX, PIDP_EDTDEFINITION, m_edtDefinition);
00394         DDX_Control(pDX, PIDP_EDTNAME, m_edtName);
00395         DDX_Control(pDX, PIDP_EDTDESCRIPTION, m_edtDescription);
00396         DDX_Control(pDX, PIDP_EDTDEFAULT, m_edtDefault);
00397         DDX_Control(pDX, PIDP_CMBPRIORITY, m_cmbPriority);
00398         DDX_Control(pDX, PIDP_CMBDEPTH, m_cmbDepth);
00399         //}}AFX_DATA_MAP
00400 }
00401 
00402 BEGIN_MESSAGE_MAP(CIdentityPage, CDialog)
00403         //{{AFX_MSG_MAP(CIdentityPage)
00404         //}}AFX_MSG_MAP
00405 END_MESSAGE_MAP()
00406 
00407 BOOL CIdentityPage::PreTranslateMessage(MSG* pMsg)
00408 {
00409         return ( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE ) ? GetParent()->PreTranslateMessage( pMsg ) : CDialog::PreTranslateMessage( pMsg );
00410 }
00411 
00412 //##############################################################################################################################################
00413 //
00414 //      C L A S S : CExpressionPage <<< + CDialog
00415 //
00416 //##############################################################################################################################################
00417 
00418 CExpressionPage::CExpressionPage(CWnd* pParent /*=NULL*/)
00419         : CDialog(CExpressionPage::IDD, pParent)
00420 {
00421         //{{AFX_DATA_INIT(CExpressionPage)
00422         //}}AFX_DATA_INIT
00423 }
00424 
00425 
00426 void CExpressionPage::DoDataExchange(CDataExchange* pDX)
00427 {
00428         CDialog::DoDataExchange(pDX);
00429         //{{AFX_DATA_MAP(CExpressionPage)
00430         DDX_Control(pDX, PEXP_CMBCONTEXT, m_cmbContext);
00431         DDX_Control(pDX, PEXP_EDTEXPRESSION, m_edtExpression);
00432         //}}AFX_DATA_MAP
00433 }
00434 
00435 BEGIN_MESSAGE_MAP(CExpressionPage, CDialog)
00436         //{{AFX_MSG_MAP(CExpressionPage)
00437         //}}AFX_MSG_MAP
00438 END_MESSAGE_MAP()
00439 
00440 BOOL CExpressionPage::PreTranslateMessage(MSG* pMsg)
00441 {
00442         return ( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE ) ? GetParent()->PreTranslateMessage( pMsg ) : CDialog::PreTranslateMessage( pMsg );
00443 }
00444 
00445 //##############################################################################################################################################
00446 //
00447 //      C L A S S : CEventPage <<< + CDialog
00448 //
00449 //##############################################################################################################################################
00450 
00451 CEventPage::CEventPage(CWnd* pParent /*=NULL*/)
00452         : CDialog(CEventPage::IDD, pParent)
00453 {
00454         //{{AFX_DATA_INIT(CEventPage)
00455                 // NOTE: the ClassWizard will add member initialization here
00456         //}}AFX_DATA_INIT
00457 }
00458 
00459 
00460 void CEventPage::DoDataExchange(CDataExchange* pDX)
00461 {
00462         CDialog::DoDataExchange(pDX);
00463         //{{AFX_DATA_MAP(CEventPage)
00464                 // NOTE: the ClassWizard will add DDX and DDV calls here
00465         //}}AFX_DATA_MAP
00466 }
00467 
00468 BEGIN_MESSAGE_MAP(CEventPage, CDialog)
00469         //{{AFX_MSG_MAP(CEventPage)
00470                 // NOTE: the ClassWizard will add message map macros here
00471         //}}AFX_MSG_MAP
00472 END_MESSAGE_MAP()
00473 
00474 BOOL CEventPage::PreTranslateMessage(MSG* pMsg)
00475 {
00476         return ( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE ) ? GetParent()->PreTranslateMessage( pMsg ) : CDialog::PreTranslateMessage( pMsg );
00477 }
00478 
00479 }; // namespace OclGmeCM