Hi,
Yet another embarrassingly easy question to answer - I hope! OK, so basically, I have a button called ‘chordButton’ but confusingly labeled ‘Note On Button’ on my background component. Hardly worth a picture but here it is:
So, I have the following method which should display the text ‘Kill Chord Called’ when chordButton is the event component and I lift my finger after a click (or so I thought) but as you can see above, entering the area of the chordButton and clicking and releasing the mouse only displays ‘mouseExit Entered’ (this happens when the button has the mouse focus. mouseExit Entered only works for the background as I’ve also implemented mouseExit and mouseDown.
[code]void ZS1AudioProcessorEditor::mouseUp(const MouseEvent &event)
{
kill = ("mouseUp Entered");
setDebugInt();
if (event.eventComponent==chordButton){
getProcessor()->killChord(80);
kill = ("Kill Chord Called");
setDebugInt();
}
}
void ZS1AudioProcessorEditor::mouseExit(const MouseEvent &event)
{
kill = ("mouseExit Entered");
setDebugInt();
if (event.eventComponent==chordButton){
getProcessor()->killChord(80);
kill = ("Exit Called");
setDebugInt();
}
}
void ZS1AudioProcessorEditor::mouseDown(const MouseEvent &event)
{
kill = ("mouseDown Entered");
setDebugInt();
if (event.eventComponent==chordButton){
//getProcessor()->killChord(80);
kill = ("Down Called");
setDebugInt();
}
}[/code]
So, the documentation for button says:
void Button::mouseUp ( const MouseEvent & ) [protected, virtual]
So I tried
[code]void chordButton::mouseDown(MouseEvent e){
getProcessor()->killChord(80);
kill = ("Kill Chord Called");
setDebugInt();
}[/code] but XCode said 'Use of undeclared identifier ‘chordButton’
I’m a complete novice, as is probably obvious, but can somebody tell me where and how to get my chordButton responding to a mouse up!