From: <sag...@us...> - 2015-06-26 12:51:17
|
Revision: 5355 http://sourceforge.net/p/modplug/code/5355 Author: saga-games Date: 2015-06-26 12:51:11 +0000 (Fri, 26 Jun 2015) Log Message: ----------- [Mod] Remember group size between tempo swing dialog calls. Modified Paths: -------------- trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/dlg_misc.h Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2015-06-26 12:39:49 UTC (rev 5354) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2015-06-26 12:51:11 UTC (rev 5355) @@ -1206,15 +1206,17 @@ //}}AFX_MSG_MAP END_MESSAGE_MAP() +int CTempoSwingDlg::m_groupSize = 1; CTempoSwingDlg::CTempoSwingDlg(CWnd *parent, const TempoSwing ¤tTempoSwing, CSoundFile &sndFile, PATTERNINDEX pattern) : CDialog(IDD_TEMPO_SWING, parent) - , m_groupSize(1) , m_tempoSwing(currentTempoSwing) , m_origTempoSwing(pattern == PATTERNINDEX_INVALID ? sndFile.m_tempoSwing : sndFile.Patterns[pattern].GetTempoSwing()) , m_sndFile(sndFile) , m_pattern(pattern) -{ } +{ + m_groupSize = std::min(m_groupSize, static_cast<int>(m_tempoSwing.size())); +} BOOL CTempoSwingDlg::OnInitDialog() //--------------------------------- @@ -1374,8 +1376,8 @@ void CTempoSwingDlg::OnGroupChanged() //----------------------------------- { - m_groupSize = GetDlgItemInt(IDC_EDIT1); - Limit(m_groupSize, 1, static_cast<int>(m_tempoSwing.size())); + int val = GetDlgItemInt(IDC_EDIT1); + if(val > 0) m_groupSize = std::min(val, static_cast<int>(m_tempoSwing.size())); } @@ -1386,12 +1388,11 @@ { // Edit groups size_t editedGroup = 0; - int editedValue = SliderUnity; + int editedValue = reinterpret_cast<CSliderCtrl *>(pScrollBar)->GetPos(); for(size_t i = 0; i < m_controls.size(); i++) { if(m_controls[i]->valueSlider.m_hWnd == pScrollBar->m_hWnd) { - editedValue = m_controls[i]->valueSlider.GetPos(); editedGroup = (i / m_groupSize) % 2; break; } Modified: trunk/OpenMPT/mptrack/dlg_misc.h =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.h 2015-06-26 12:39:49 UTC (rev 5354) +++ trunk/OpenMPT/mptrack/dlg_misc.h 2015-06-26 12:51:11 UTC (rev 5355) @@ -278,7 +278,7 @@ CSliderCtrl valueSlider; }; std::vector<RowCtls *> m_controls; - int m_groupSize; + static int m_groupSize; public: TempoSwing m_tempoSwing; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |