GME  13
ClosureSmart.cpp
Go to the documentation of this file.
00001 // ClosureSmart.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "mgautil.h"
00006 #include "ClosureSmart.h"
00007 
00008 #ifdef _DEBUG
00009 #define new DEBUG_NEW
00010 #undef THIS_FILE
00011 static char THIS_FILE[] = __FILE__;
00012 #endif
00013 
00015 // CClosureSmart dialog
00016 
00017 
00018 CClosureSmart::CClosureSmart(CWnd* pParent /*=NULL*/)
00019         : CDialog(CClosureSmart::IDD, pParent)
00020         //: CPropertyPage(CClosureSmart::IDD)
00021 {
00022         //{{AFX_DATA_INIT(CClosureSmart)
00023         m_bConns = FALSE;
00024         m_bRefs = FALSE;
00025         m_bSets = FALSE;
00026         //}}AFX_DATA_INIT
00027 
00028         m_disable = false;
00029 }
00030 
00031 void CClosureSmart::DoDataExchange(CDataExchange* pDX)
00032 {
00033         CDialog::DoDataExchange(pDX);
00034         //{{AFX_DATA_MAP(CClosureSmart)
00035         DDX_Check(pDX, IDC_CHECKCONN, m_bConns);
00036         DDX_Check(pDX, IDC_CHECKREF, m_bRefs);
00037         DDX_Check(pDX, IDC_CHECKSET, m_bSets);
00038         //}}AFX_DATA_MAP
00039 }
00040 
00041 
00042 BEGIN_MESSAGE_MAP(CClosureSmart, CDialog)
00043         //{{AFX_MSG_MAP(CClosureSmart)
00044         ON_BN_CLICKED(IDC_INVERT, OnInvert)
00045         //}}AFX_MSG_MAP
00046 END_MESSAGE_MAP()
00047 
00049 // CClosureSmart message handlers
00050 
00051 BOOL CClosureSmart::OnInitDialog() 
00052 {
00053         UpdateData( FALSE);
00054         CDialog::OnInitDialog();
00055         
00056         if( m_disable)
00057         {
00058                 GetDlgItem( IDC_CHECKCONN)->EnableWindow( m_bConns);
00059                 GetDlgItem( IDC_CHECKSET)->EnableWindow( m_bSets);
00060                 GetDlgItem( IDC_CHECKREF)->EnableWindow( m_bRefs);
00061         }
00062         else // container case
00063         {
00064                 CWnd* w; CString t;
00065                 w = GetDlgItem( IDC_CHECKCONN);
00066                 w->GetWindowText( t);
00067                 w->SetWindowText( "Inner " + t);
00068 
00069                 w = GetDlgItem( IDC_CHECKSET);
00070                 w->GetWindowText( t);
00071                 w->SetWindowText( "Inner " + t);
00072 
00073                 w = GetDlgItem( IDC_CHECKREF);
00074                 w->GetWindowText( t);
00075                 w->SetWindowText( "Inner " + t);
00076         }
00077         
00078         return TRUE;  // return TRUE unless you set the focus to a control
00079                       // EXCEPTION: OCX Property Pages should return FALSE
00080 }
00081 
00082 void CClosureSmart::OnInvert()
00083 {
00084         UpdateData( TRUE);
00085 
00086         CWnd* w;
00087         w = GetDlgItem( IDC_CHECKCONN);
00088         if( w && w->IsWindowEnabled()) m_bConns = !m_bConns;
00089 
00090         w = GetDlgItem( IDC_CHECKSET);
00091         if( w && w->IsWindowEnabled()) m_bSets = !m_bSets;
00092         
00093         w = GetDlgItem( IDC_CHECKREF);
00094         if( w && w->IsWindowEnabled()) m_bRefs = !m_bRefs;
00095 
00096         UpdateData( FALSE);
00097 }