Skip to content

Commit

Permalink
GUI: Auto-scroll coordinate list for legacy digitize panel
Browse files Browse the repository at this point in the history
  • Loading branch information
rcassani committed Sep 9, 2024
1 parent 9c178f9 commit e8b808e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/license.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<body alink="#fff000" link="#fff000" vlink="#fff000">
<h4><span style="font-family: Arial Black; color: #ffffff;"><strong>THERE IS NO UNDO BUTTON!<BR>SET UP A <FONT color=red>BACKUP</FONT> OF YOUR DATABASE</strong></span></h4>
<HR>
<!-- LICENCE_START -->Version: 3.240905 (05-Sep-2024)<br>
<!-- LICENCE_START -->Version: 3.240909 (09-Sep-2024)<br>
<span style="font-style: italic;">COPYRIGHT &copy; 2000-2024
USC &amp; McGill University.<br>
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/version.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
% Brainstorm
% v. 3.240905 (05-Sep-2024)
% v. 3.240909 (09-Sep-2024)
13 changes: 7 additions & 6 deletions toolbox/sensors/panel_digitize.m
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ function Start() %#ok<DEFNU>
jListCoord = JList(largeFontSize);
jListCoord.setCellRenderer(BstStringListRenderer(fontSize));
% Size
jPanelScrollList = JScrollPane();
jPanelScrollList = JScrollPane(jListCoord);
jPanelScrollList.getLayout.getViewport.setView(jListCoord);
jPanelScrollList.setHorizontalScrollBarPolicy(jPanelScrollList.HORIZONTAL_SCROLLBAR_NEVER);
jPanelScrollList.setVerticalScrollBarPolicy(jPanelScrollList.VERTICAL_SCROLLBAR_ALWAYS);
Expand Down Expand Up @@ -732,12 +732,13 @@ function UpdateList()
ctrl.jListCoord.setModel(listModel);
ctrl.jListCoord.repaint();
drawnow;
% Scroll down
% Scroll to last collected point (non-empty Loc), +1 if more points listed.
lastIndex = min(listModel.getSize(), 12 + nRecEEG + nHeadShape);
selRect = ctrl.jListCoord.getCellBounds(lastIndex-1, lastIndex-1);
%ctrl.jListCoord.scrollRectToVisible(selRect);
ctrl.jListCoord.repaint();
ctrl.jListCoord.getParent().getParent().repaint();
if listModel.getSize() > lastIndex
ctrl.jListCoord.ensureIndexIsVisible(lastIndex); % 0-indexed
else
ctrl.jListCoord.ensureIndexIsVisible(lastIndex-1); % 0-indexed, -1 works even if 0
end
end


Expand Down

0 comments on commit e8b808e

Please sign in to comment.