void CReferenceDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { int nMaxVerse; wchar_t c[5]; CSpinButtonCtrl* pSpin; CReferenceUtils ref; switch(pScrollBar->GetDlgCtrlID()) { case IDC_SPINCHAPTER: pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINCHAPTER); m_nChapter=pSpin->GetPos(); _itow(m_nChapter,c,10); m_strChapter=c; nMaxVerse=ref.GetMaxVerse(m_nBook,m_nChapter, m_nSourceText, m_pDoc); pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINVERSE); pSpin->SetRange(1,nMaxVerse); //set the verse spinner's range pSpin->SetPos(1); //select first verse m_nVerse=1; m_strVerse=L"1"; break; case IDC_SPINVERSE: pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINVERSE); m_nVerse=pSpin->GetPos(); _itow(m_nVerse,c,10); m_strVerse=c; break; } UpdateData(FALSE); }
void CGrid::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { CString strValue; CSpinButtonCtrl* pSpin = (CSpinButtonCtrl*) GetDlgItem(IDC_SPIN_GRID_SIZE); strValue.Format("%i", pSpin->GetPos()); pSpin->GetBuddy()->SetWindowText(strValue); The_grid->nrows = pSpin->GetPos() * 5; The_grid->ncols = The_grid->nrows; modify_grid(The_grid); CDialog::OnVScroll(nSBCode, nPos, pScrollBar); }
/* void CInstrumentEditorN163Wave::OnPositionClicked() { if (IsDlgButtonChecked(IDC_POSITION)) { GetDlgItem(IDC_WAVE_POS)->EnableWindow(FALSE); m_pInstrument->SetAutoWavePos(true); } else { GetDlgItem(IDC_WAVE_POS)->EnableWindow(TRUE); m_pInstrument->SetAutoWavePos(false); } } */ void CInstrumentEditorN163Wave::OnWavesChange() { CSpinButtonCtrl *pIndexSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_INDEX_SPIN); int count = GetDlgItemInt(IDC_WAVES) + 1; if (m_pInstrument != NULL) m_pInstrument->SetWaveCount(count); pIndexSpin->SetRange(0, count - 1); pIndexSpin->RedrawWindow(); if (pIndexSpin->GetPos() > (count - 1)) pIndexSpin->SetPos(count - 1); if (m_pWaveEditor != NULL) { m_pWaveEditor->SetWave(m_iWaveIndex); m_pWaveEditor->WaveChanged(); } }