This PR adds a method to get info about the score object at mouse click point position. It returns a struct ClickPointData that describes the content of the point on current bitmap rendition.
The struct provides a ptr. to the clicked object, and if the clicked point is on a score, it also provides:
A MeasureLocator struct with information about measure, instrument, and time position.
The staff index, relative to instrument staves.
Otherwise, if clicked point is not on a score, the MeasureLocator is invalid and the staff index is -1.
Example:
//get mouse click point
Pixels x = Pixels( mouse_x );
Pixels y = Pixels( mouse_y );
//get information about that point
ClickPointData data = spInteractor->find_click_info_at(x, y);
ImoObj* pClickedObj = data.pImo;
MeasureLocator ml = data.ml;
if (ml.is_valid())
{
//clicked point is a valid location on an score
int iMeasure = ml.iMeasure;
int iInstr = ml.iInstr
int iStaff = data.iStaff
//do whatever you like with this information
...
}
Other changes
Added method MeasureLocator::is_valid() to check locators.
Some fixes for warnings about a variable that shadows another local variable.
Add prefix std:: to declarations in some header files.
This PR adds a method to get info about the score object at mouse click point position. It returns a struct
ClickPointData
that describes the content of the point on current bitmap rendition.The struct provides a ptr. to the clicked object, and if the clicked point is on a score, it also provides:
MeasureLocator
struct with information about measure, instrument, and time position.Otherwise, if clicked point is not on a score, the
MeasureLocator
is invalid and the staff index is -1.Example:
Other changes
MeasureLocator::is_valid()
to check locators.std::
to declarations in some header files.