Skip to content

Commit

Permalink
Show electrode info in a tooltip window
Browse files Browse the repository at this point in the history
  • Loading branch information
anjaldoshi committed Nov 7, 2024
1 parent d9f51b6 commit 32a86a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Source/UI/NeuropixInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ NeuropixInterface::NeuropixInterface (DataSource* p,
mode = VisualizationMode::ENABLE_VIEW;

probeBrowser = std::make_unique<ProbeBrowser> (this);
probeBrowser->setBounds (0, 0, 800, 600);
probeBrowser->setBounds (0, 0, 400, 550);
addAndMakeVisible (probeBrowser.get());

int currentHeight = 55;
Expand Down
17 changes: 4 additions & 13 deletions Source/UI/ProbeBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

ProbeBrowser::ProbeBrowser (NeuropixInterface* parent_) : parent (parent_)
{
tooltipWindow = std::make_unique <TooltipWindow> (parent, 300);

cursorType = MouseCursor::NormalCursor;

activityToView = ActivityToView::APVIEW;
Expand Down Expand Up @@ -227,9 +229,8 @@ void ProbeBrowser::mouseMove (const MouseEvent& event)
{
isOverElectrode = true;
electrodeInfoString = getElectrodeInfoString (index);
tooltipWindow->displayTip (event.getScreenPosition(), electrodeInfoString);
}

repaint();
}
else
{
Expand All @@ -238,7 +239,7 @@ void ProbeBrowser::mouseMove (const MouseEvent& event)
if (isOverChannelNew != isOverElectrode)
{
isOverElectrode = isOverChannelNew;
repaint();
tooltipWindow->hideTip();
}
}
}
Expand Down Expand Up @@ -877,16 +878,6 @@ void ProbeBrowser::paint (Graphics& g)
g.setColour (Colours::white.withAlpha (0.5f));
//g.drawRect(selectionBox);
}

if (isOverElectrode)
{
g.setColour (Colour (55, 55, 55));
g.setFont (15);
g.drawMultiLineText (electrodeInfoString,
250 + shankOffset + 45,
330,
250);
}
}

void ProbeBrowser::drawAnnotations (Graphics& g)
Expand Down
2 changes: 2 additions & 0 deletions Source/UI/ProbeBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class ProbeBrowser : public Component,
Array<int> getElectrodesWithinBounds (int x, int y, int w, int h);
String getElectrodeInfoString (int index);

std::unique_ptr<TooltipWindow> tooltipWindow;

NeuropixInterface* parent;
};

Expand Down

0 comments on commit 32a86a9

Please sign in to comment.