// OrdPage.cpp : implementation file // #include "stdafx.h" #include "CB32.h" #include "ComboBar.h" #include "MainFrm.h" #include "CB32Doc.h" #include "CB32View.h" #include "OrdPage.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // COrdPage property page IMPLEMENT_DYNCREATE(COrdPage, CPropertyPage) COrdPage::COrdPage() : CPropertyPage(COrdPage::IDD) { //{{AFX_DATA_INIT(COrdPage) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } COrdPage::~COrdPage() { } void COrdPage::DoDataExchange(CDataExchange* pDX) { CPropertyPage::DoDataExchange(pDX); //{{AFX_DATA_MAP(COrdPage) DDX_Control(pDX, IDC_COLUP, m_colup); DDX_Control(pDX, IDC_COLDOWN, m_coldown); DDX_Control(pDX, IDC_COLBOX, m_colbox); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(COrdPage, CPropertyPage) //{{AFX_MSG_MAP(COrdPage) ON_BN_CLICKED(IDC_COLUP, OnColup) ON_BN_CLICKED(IDC_COLDOWN, OnColdown) ON_WM_DESTROY() ON_BN_CLICKED(IDC_RESETCOL, OnResetcol) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // COrdPage message handlers BOOL COrdPage::OnInitDialog() { CPropertyPage::OnInitDialog(); CCB32View* pView = GetApplicationView(); int colpos[COLS]; for (int p=0; parLabel[colpos[y]]); m_colbox.SetCurSel(0); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void COrdPage::OnColup() { int iIndex; CString strItem; iIndex = m_colbox.GetCurSel(); if (iIndex <= 0 || iIndex == LB_ERR) return; m_colbox.GetText(iIndex, strItem); m_colbox.DeleteString(iIndex); m_colbox.InsertString(iIndex-1, strItem); m_colbox.SetCurSel(iIndex-1); return; } void COrdPage::OnColdown() { int iIndex; CString strItem; iIndex = m_colbox.GetCurSel(); if ((iIndex >= m_colbox.GetCount()-1) || iIndex == LB_ERR) return; m_colbox.GetText(iIndex, strItem); m_colbox.DeleteString(iIndex); m_colbox.InsertString(iIndex+1, strItem); m_colbox.SetCurSel(iIndex+1); return; } void COrdPage::OnDestroy() { if (theApp.GetProfileInt(_T("Preferences"),_T("RememberPos"),1)) { CCB32View* pView = GetApplicationView(); int colpos[COLS]; for (int p = 0; parLabel[y]); if (item != LB_ERR) colpos[item] = y; } CString strBuffer; strBuffer.Format("%d",colpos[0]); for (int z=1; zarLabel[y]); m_colbox.SetCurSel(0); }