1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a MouseEvent parameter to ListBoxModel::backgroundClicked and TableListBoxModel::backgroundClicked

This commit is contained in:
jules 2014-06-04 13:08:49 +01:00
parent ead283e95c
commit 4ab9cdf33a
4 changed files with 24 additions and 12 deletions

View file

@ -809,7 +809,7 @@ void ListBox::mouseWheelMove (const MouseEvent& e, const MouseWheelDetails& whee
void ListBox::mouseUp (const MouseEvent& e)
{
if (e.mouseWasClicked() && model != nullptr)
model->backgroundClicked();
model->backgroundClicked (e);
}
//==============================================================================
@ -947,7 +947,7 @@ Component* ListBoxModel::refreshComponentForRow (int, bool, Component* existingC
void ListBoxModel::listBoxItemClicked (int, const MouseEvent&) {}
void ListBoxModel::listBoxItemDoubleClicked (int, const MouseEvent&) {}
void ListBoxModel::backgroundClicked() {}
void ListBoxModel::backgroundClicked (const MouseEvent&) {}
void ListBoxModel::selectedRowsChanged (int) {}
void ListBoxModel::deleteKeyPressed (int) {}
void ListBoxModel::returnKeyPressed (int) {}

View file

@ -84,18 +84,18 @@ public:
/** This can be overridden to react to the user clicking on a row.
@see listBoxItemDoubleClicked
*/
virtual void listBoxItemClicked (int row, const MouseEvent& e);
virtual void listBoxItemClicked (int row, const MouseEvent&);
/** This can be overridden to react to the user double-clicking on a row.
@see listBoxItemClicked
*/
virtual void listBoxItemDoubleClicked (int row, const MouseEvent& e);
virtual void listBoxItemDoubleClicked (int row, const MouseEvent&);
/** This can be overridden to react to the user clicking on a part of the list where
there are no rows.
@see listBoxItemClicked
*/
virtual void backgroundClicked();
virtual void backgroundClicked (const MouseEvent&);
/** Override this to be informed when rows are selected or deselected.
@ -152,6 +152,12 @@ public:
/** You can override this to return a custom mouse cursor for each row. */
virtual MouseCursor getMouseCursorForRow (int row);
private:
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// This method's signature has changed to take a MouseEvent parameter - please update your code!
JUCE_DEPRECATED_WITH_BODY (virtual int backgroundClicked(), { return 0; })
#endif
};

View file

@ -398,10 +398,10 @@ void TableListBox::returnKeyPressed (int row)
model->returnKeyPressed (row);
}
void TableListBox::backgroundClicked()
void TableListBox::backgroundClicked (const MouseEvent& e)
{
if (model != nullptr)
model->backgroundClicked();
model->backgroundClicked (e);
}
void TableListBox::listWasScrolled()
@ -457,7 +457,7 @@ void TableListBox::updateColumnComponents() const
//==============================================================================
void TableListBoxModel::cellClicked (int, int, const MouseEvent&) {}
void TableListBoxModel::cellDoubleClicked (int, int, const MouseEvent&) {}
void TableListBoxModel::backgroundClicked() {}
void TableListBoxModel::backgroundClicked (const MouseEvent&) {}
void TableListBoxModel::sortOrderChanged (int, const bool) {}
int TableListBoxModel::getColumnAutoSizeWidth (int) { return 0; }
void TableListBoxModel::selectedRowsChanged (int) {}

View file

@ -103,21 +103,21 @@ public:
The mouse event's coordinates will be relative to the entire table row.
@see cellDoubleClicked, backgroundClicked
*/
virtual void cellClicked (int rowNumber, int columnId, const MouseEvent& e);
virtual void cellClicked (int rowNumber, int columnId, const MouseEvent&);
/** This callback is made when the user clicks on one of the cells in the table.
The mouse event's coordinates will be relative to the entire table row.
@see cellClicked, backgroundClicked
*/
virtual void cellDoubleClicked (int rowNumber, int columnId, const MouseEvent& e);
virtual void cellDoubleClicked (int rowNumber, int columnId, const MouseEvent&);
/** This can be overridden to react to the user double-clicking on a part of the list where
there are no rows.
@see cellClicked
*/
virtual void backgroundClicked();
virtual void backgroundClicked (const MouseEvent&);
//==============================================================================
/** This callback is made when the table's sort order is changed.
@ -182,6 +182,12 @@ public:
@see getDragSourceCustomData, DragAndDropContainer::startDragging
*/
virtual var getDragSourceDescription (const SparseSet<int>& currentlySelectedRows);
private:
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// This method's signature has changed to take a MouseEvent parameter - please update your code!
JUCE_DEPRECATED_WITH_BODY (virtual int backgroundClicked(), { return 0; })
#endif
};
@ -303,7 +309,7 @@ public:
/** @internal */
void returnKeyPressed (int currentSelectedRow) override;
/** @internal */
void backgroundClicked() override;
void backgroundClicked (const MouseEvent&) override;
/** @internal */
void listWasScrolled() override;
/** @internal */