| 1753 | // // // |
| 1754 | |
| 1755 | int CPatternEditor::GetChannelAtPoint(int PointX) const |
| 1756 | { |
| 1757 | // Convert X position to channel number |
| 1758 | const int ChannelCount = GetChannelCount(); |
| 1759 | |
| 1760 | if (PointX < m_iRowColumnWidth) |
| 1761 | return -1; // -1 means row number column |
| 1762 | |
| 1763 | const int Offset = PointX - m_iRowColumnWidth + m_iChannelOffsets[m_iFirstChannel]; |
| 1764 | for (int i = m_iFirstChannel; i < ChannelCount; ++i) { |
| 1765 | if (Offset >= m_iChannelOffsets[i] && Offset < (m_iChannelOffsets[i] + m_iChannelWidths[i])) |
| 1766 | return i; |
| 1767 | } |
| 1768 | |
| 1769 | return m_iFirstChannel + m_iChannelsVisible; |
| 1770 | } |
| 1771 | |
| 1772 | cursor_column_t CPatternEditor::GetColumnAtPoint(int PointX) const // // // |
| 1773 | { |