Browse Source

Provided support for setting the mouse cursor in ListBoxModel.

tags/2021-05-28
jules 11 years ago
parent
commit
18ff9f4849
2 changed files with 6 additions and 0 deletions
  1. +3
    -0
      modules/juce_gui_basics/widgets/juce_ListBox.cpp
  2. +3
    -0
      modules/juce_gui_basics/widgets/juce_ListBox.h

+ 3
- 0
modules/juce_gui_basics/widgets/juce_ListBox.cpp View File

@@ -49,6 +49,8 @@ public:
if (ListBoxModel* m = owner.getModel())
{
setMouseCursor (m->getMouseCursorForRow (row));
customComponent = m->refreshComponentForRow (newRow, nowSelected, customComponent.release());
if (customComponent != nullptr)
@@ -952,3 +954,4 @@ void ListBoxModel::returnKeyPressed (int) {}
void ListBoxModel::listWasScrolled() {}
var ListBoxModel::getDragSourceDescription (const SparseSet<int>&) { return var::null; }
String ListBoxModel::getTooltipForRow (int) { return String::empty; }
MouseCursor ListBoxModel::getMouseCursorForRow (int) { return MouseCursor::NormalCursor; }

+ 3
- 0
modules/juce_gui_basics/widgets/juce_ListBox.h View File

@@ -149,6 +149,9 @@ public:
@see TooltipClient
*/
virtual String getTooltipForRow (int row);
/** You can override this to return a custom mouse cursor for each row. */
virtual MouseCursor getMouseCursorForRow (int row);
};


Loading…
Cancel
Save