Changeset 1287
- Timestamp:
- 10/16/07 13:52:29 (11 months ago)
- Location:
- trunk/src/buzelib
- Files:
-
- 2 modified
-
PatternEditor/PatternEditorInner.cpp (modified) (1 diff)
-
PatternView.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/buzelib/PatternEditor/PatternEditorInner.cpp
r1270 r1287 223 223 rc->bottom = select_end.y * skip; 224 224 if (select_start.x == -1) return false; 225 226 // make sure selection is valid in case we made the selection on a bigger 227 // pattern and now try to copy from a smaller where the selection goes 228 // outside the pattern extensions 229 if (rc->left < 0) rc->left = 0; 230 if (rc->left >= columns.size()) rc->left = columns.size() -1; 231 if (rc->right < 0) rc->right = 0; 232 if (rc->right >= columns.size()) rc->right = columns.size() -1; 233 if (rc->top < 0) rc->top = 0; 234 if (rc->top >= total_rows) rc->top = total_rows -1; 235 if (rc->bottom < 0) rc->bottom = 0; 236 if (rc->bottom >= total_rows) rc->bottom = total_rows -1; 225 237 return true; 226 238 } -
trunk/src/buzelib/PatternView.cpp
r1286 r1287 221 221 mainFrame->addTimerHandler(this); 222 222 223 machine->addEventHandler(this);224 223 return 0; 225 224 } … … 233 232 234 233 LRESULT CPatternView::OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { 235 machine->removeEventHandler(this);236 234 237 235 setPattern(0,0); // in case pattern is deleted and window updated before window is fully destroyed … … 1038 1036 void CPatternView::setPattern(zzub::metaplugin* toMachine, zzub::pattern* toPattern) { 1039 1037 1038 if (machine != 0) machine->removeEventHandler(this); 1039 1040 1040 if (toMachine == 0 && toPattern == 0) { 1041 1041 this->pattern = 0; … … 1051 1051 bindPatternEditor(); 1052 1052 bindMachinePatternPanel(); 1053 1054 if (machine != 0) machine->addEventHandler(this); 1053 1055 } 1054 1056 … … 1553 1555 const PATTERNCOLUMN& col = patternEditor.GetColumn(patternEditor.editor.drag_to.x); 1554 1556 pastePatternTrack(selection, patternEditor.editor.drag_to.y * patternEditor.GetSkip(), col.group, col.track, col.column); 1557 delete selection; 1555 1558 return 0; 1556 1559 } … … 1575 1578 undo->addEdit(cursor.y, col.group, col.track, col.column, oldv); 1576 1579 1577 if (col.type == pattern_column_type_note) { 1580 size_t wavec = track->getWaveColumn(); 1581 1582 if (col.type == pattern_column_type_note && ccol.index == 0) { 1578 1583 int wave = getSelectedWave(); 1579 1584 if (wave != -1) { 1580 size_t wavec = track->getWaveColumn();1581 1582 1585 if (wavec != no_column) { 1583 1586 if (v == 255 || v == col.novalue) wave = track->getParam(wavec)->value_none; … … 1589 1592 } 1590 1593 } 1591 1592 1593 1594 document->undoManager.insertAndCommit(redo, undo); 1595 1596 // change selected wave in dropdown if a wave was entered 1597 if (wavec != no_column && col.column == wavec) { 1598 int wave = track->getValue(cursor.y, wavec); 1599 int wave_index = 0; 1600 for (size_t i = 0; wave > 0 && i < document->player->getWaves(); i++) { 1601 wave_info_ex* entry = document->player->getWave(i); 1602 int levelcount = entry->get_levels(); 1603 if (levelcount) { 1604 if (i == wave - 1) { 1605 waveDropDown.SetCurSel(wave_index); 1606 break; 1607 } 1608 wave_index++; 1609 } 1610 } 1611 } 1594 1612 1595 1613 // play note … … 1726 1744 menu.InsertMenu(-1, (document->player->getSoloMachine() == machine?MF_CHECKED:0)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_SOLO, "Solo Machine\tCtrl+L"); 1727 1745 menu.InsertMenu(-1, (machine->isMuted()?MF_CHECKED:0)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_MUTE, "Mute Machine\tCtrl+M"); 1728 menu.InsertMenu(-1, (!hasPattern?MF_GRAYED:0)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_PARAMETERS, "Machine Parameters ");1746 menu.InsertMenu(-1, (!hasPattern?MF_GRAYED:0)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_PARAMETERS, "Machine Parameters\tShift+Enter"); 1729 1747 menu.InsertMenu(-1, MF_BYPOSITION|MF_SEPARATOR); 1730 1748 menu.InsertMenu(-1, (!hasPattern?MF_GRAYED:0)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_PATTERN_PROPERTIES, "Pattern Properties\tCtrl+Backspace");
