// RepositionCellDlg.cpp : implementation file // #include "stdafx.h" #include "MSVC5conview.h" #include "RepositionCellDlg.h" #include "leadrastercontainercell.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CRepositionCellDlg dialog CRepositionCellDlg::CRepositionCellDlg(CWnd* pParent /*=NULL*/) : CDialog(CRepositionCellDlg::IDD, pParent) { //{{AFX_DATA_INIT(CRepositionCellDlg) m_uCellIndex = 0; m_uTargetIndex = 0; //}}AFX_DATA_INIT } void CRepositionCellDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CRepositionCellDlg) DDX_Control(pDX, IDC_ACTION_TARGETINDEX_EDT, m_edtTargetCell); DDX_Control(pDX, IDC_ACTION_CELLINDEX_EDT, m_edtCellIndex); DDX_Text(pDX, IDC_ACTION_CELLINDEX_EDT, m_uCellIndex); DDX_Text(pDX, IDC_ACTION_TARGETINDEX_EDT, m_uTargetIndex); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CRepositionCellDlg, CDialog) //{{AFX_MSG_MAP(CRepositionCellDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CRepositionCellDlg message handlers BOOL CRepositionCellDlg::OnInitDialog() { CDialog::OnInitDialog(); CConViewApp * pTheApp = (CConViewApp *)AfxGetApp(); INT nIndex = pTheApp->SearchForFirstSelectedCell(); m_uTargetIndex = m_uCellIndex = max(0, nIndex); m_edtCellIndex.SetNumericEditBox(0, m_pView->m_ConView.GetCellCount() - 1, 1, 0, 0); m_edtTargetCell.SetNumericEditBox(0, m_pView->m_ConView.GetCellCount() - 1, 1, 0, 0); UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CRepositionCellDlg::OnOK() { UpdateData(); m_pView->m_ConView.Cell(m_uCellIndex).RepositionCell(m_uTargetIndex); CDialog::OnOK(); }