From: <sag...@us...> - 2012-05-06 20:50:30
|
Revision: 1265 http://modplug.svn.sourceforge.net/modplug/?rev=1265&view=rev Author: saga-games Date: 2012-05-06 20:50:23 +0000 (Sun, 06 May 2012) Log Message: ----------- [Fix] Pattern Editor: Fixed Shift+Click behaviour if a selection has already been made (http://bugs.openmpt.org/view.php?id=249). [Mod] Package Template: Added/moved files for zip package which were only present in installer package so far. Modified Paths: -------------- trunk/OpenMPT/installer/filetypes.iss trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h Added Paths: ----------- trunk/OpenMPT/packageTemplate/ModPlug Central.url trunk/OpenMPT/packageTemplate/mpt.ico Removed Paths: ------------- trunk/OpenMPT/installer/mpt.ico Modified: trunk/OpenMPT/installer/filetypes.iss =================================================================== --- trunk/OpenMPT/installer/filetypes.iss 2012-05-05 15:37:01 UTC (rev 1264) +++ trunk/OpenMPT/installer/filetypes.iss 2012-05-06 20:50:23 UTC (rev 1265) @@ -91,5 +91,5 @@ [Files] ; icon file (should be moved into EXE) -Source: "mpt.ico"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\packageTemplate\mpt.ico"; DestDir: "{app}"; Flags: ignoreversion Deleted: trunk/OpenMPT/installer/mpt.ico =================================================================== (Binary files differ) Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2012-05-05 15:37:01 UTC (rev 1264) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2012-05-06 20:50:23 UTC (rev 1265) @@ -1142,24 +1142,37 @@ m_bInItemRect = true; m_bShiftDragging = false; + PatternCursor pointCursor(GetPositionFromPoint(point)); + SetCapture(); - if ((point.x >= m_szHeader.cx) && (point.y <= m_szHeader.cy)) + if(point.x >= m_szHeader.cx && point.y <= m_szHeader.cy) { + // Click on channel header if (nFlags & MK_CONTROL) { - TogglePendingMute(GetPositionFromPoint(point).GetChannel()); + TogglePendingMute(pointCursor.GetChannel()); } - } - else if ((point.x >= m_szHeader.cx) && (point.y > m_szHeader.cy)) + } else if(point.x >= m_szHeader.cx && point.y > m_szHeader.cy) { - if(CMainFrame::GetInputHandler()->SelectionPressed() && m_StartSel == m_Selection.GetLowerRight()) + // Click on pattern data + + if(CMainFrame::GetInputHandler()->SelectionPressed() + && ((m_dwStatus & psShiftSelect) + || m_Selection.GetUpperLeft() == m_Selection.GetLowerRight() + || !m_Selection.Contains(pointCursor))) { // Shift pressed -> set 2nd selection point - DragToSel(GetPositionFromPoint(point), true, true); + // This behaviour is only used if: + // * Shift-click has previously been used since the shift key has been pressed down (psShiftSelect flag is set), + // * No selection has been made yet, or + // * Shift-clicking outside the current selection. + // This is necessary so that selections can still be moved properly while the shift button is pressed (for copy-move). + DragToSel(pointCursor, true, true); + m_dwStatus |= psShiftSelect; } else { // Set first selection point - m_StartSel = GetPositionFromPoint(point); + m_StartSel = pointCursor; if(m_StartSel.GetChannel() < pSndFile->GetNumChannels()) { m_dwStatus |= psMouseDragSelect; @@ -1183,20 +1196,19 @@ } } } - } else if((point.x < m_szHeader.cx) && (point.y > m_szHeader.cy)) + } else if(point.x < m_szHeader.cx && point.y > m_szHeader.cy) { // Mark row number => mark whole row (start) InvalidateSelection(); - PatternCursor cursor(GetPositionFromPoint(point)); - if(cursor.GetRow() < pSndFile->Patterns[m_nPattern].GetNumRows()) + if(pointCursor.GetRow() < pSndFile->Patterns[m_nPattern].GetNumRows()) { - m_StartSel.Set(cursor); - SetCurSel(cursor, PatternCursor(cursor.GetRow(), pSndFile->GetNumChannels() - 1, PatternCursor::lastColumn)); + m_StartSel.Set(pointCursor); + SetCurSel(pointCursor, PatternCursor(pointCursor.GetRow(), pSndFile->GetNumChannels() - 1, PatternCursor::lastColumn)); m_dwStatus |= psRowSelection; } } - if (m_nDragItem) + if(m_nDragItem) { InvalidateRect(&m_rcDragItem, FALSE); UpdateWindow(); @@ -1216,7 +1228,7 @@ return; } else { - if (ShowEditWindow()) return; + if(ShowEditWindow()) return; } } OnLButtonDown(uFlags, point); @@ -4075,13 +4087,15 @@ case kcSelectWithCopySelect: case kcSelectWithNav: case kcSelect: if (!(m_dwStatus & (psDragnDropEdit|psRowSelection))) m_StartSel = m_Cursor; - m_dwStatus |= psKeyboardDragSelect; return wParam; + m_dwStatus |= psKeyboardDragSelect; + return wParam; case kcSelectOffWithCopySelect: case kcSelectOffWithNav: - case kcSelectOff: m_dwStatus &= ~psKeyboardDragSelect; return wParam; + case kcSelectOff: m_dwStatus &= ~(psKeyboardDragSelect | psShiftSelect); + return wParam; case kcCopySelectWithSelect: case kcCopySelectWithNav: - case kcCopySelect: if (!(m_dwStatus & (psDragnDropEdit|psRowSelection))) m_StartSel = m_Cursor; + case kcCopySelect: if (!(m_dwStatus & (psDragnDropEdit | psRowSelection))) m_StartSel = m_Cursor; m_dwStatus |= psCtrlDragSelect; return wParam; case kcCopySelectOffWithSelect: case kcCopySelectOffWithNav: Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2012-05-05 15:37:01 UTC (rev 1264) +++ trunk/OpenMPT/mptrack/View_pat.h 2012-05-06 20:50:23 UTC (rev 1265) @@ -105,23 +105,24 @@ { protected: + // Pattern status flags enum PatternStatus { - psMouseDragSelect = 0x01, // Creating a selection using the mouse - psKeyboardDragSelect = 0x02, // Creating a selection using shortcuts - psFocussed = 0x04, // Is the pattern editor focussed - psFollowSong = 0x08, // Does the cursor follow playback - psRecordingEnabled = 0x10, // Recording enabled - psDragHScroll = 0x20, // Some weird dragging stuff (?) - psDragVScroll = 0x40, // Some weird dragging stuff (?) - psShowVUMeters = 0x80, // Display channel VU meters? - psChordPlaying = 0x100, // Is a chord playing? (pretty much unused) - psDragnDropEdit = 0x200, // Drag & Drop editing (?) - psDragnDropping = 0x400, // Dragging a selection around - //psMIDISpacingPending = 0x800, // Unused (?) - psCtrlDragSelect = 0x1000, // Creating a selection using Ctrl - psShowPluginNames = 0x2000, // Show plugin names in channel headers //rewbs.patPlugName - psRowSelection = 0x4000, // Selecting a whole pattern row by clicking the row numbers + psMouseDragSelect = 0x01, // Creating a selection using the mouse + psKeyboardDragSelect = 0x02, // Creating a selection using shortcuts + psFocussed = 0x04, // Is the pattern editor focussed + psFollowSong = 0x08, // Does the cursor follow playback + psRecordingEnabled = 0x10, // Recording enabled + psDragHScroll = 0x20, // Some weird dragging stuff (?) - unused + psDragVScroll = 0x40, // Some weird dragging stuff (?) + psShowVUMeters = 0x80, // Display channel VU meters + psChordPlaying = 0x100, // Is a chord playing? (pretty much unused) + psDragnDropEdit = 0x200, // Drag & Drop editing (?) + psDragnDropping = 0x400, // Dragging a selection around + psShiftSelect = 0x800, // User has made at least one selection using Shift-Click since the Shift key has been pressed. + psCtrlDragSelect = 0x1000, // Creating a selection using Ctrl + psShowPluginNames = 0x2000, // Show plugin names in channel headers + psRowSelection = 0x4000, // Selecting a whole pattern row by clicking the row numbers }; CFastBitmap m_Dib; Added: trunk/OpenMPT/packageTemplate/ModPlug Central.url =================================================================== --- trunk/OpenMPT/packageTemplate/ModPlug Central.url (rev 0) +++ trunk/OpenMPT/packageTemplate/ModPlug Central.url 2012-05-06 20:50:23 UTC (rev 1265) @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=http://forum.openmpt.org/ Copied: trunk/OpenMPT/packageTemplate/mpt.ico (from rev 1262, trunk/OpenMPT/installer/mpt.ico) =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |