Skip to content

Commit 5c9c84a

Browse files
committed
Fix bugs in TopNav and Control Panel UI created by v7 merge
1 parent c3d717d commit 5c9c84a

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

OpenBCI_GUI/ControlPanel.pde

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,26 +307,25 @@ class ControlPanel {
307307

308308
class DataSourceBox {
309309
public int x, y, w, h, padding; //size and position
310-
private int numItems;
310+
private final int NUM_ITEMS = 5;
311311
private int boxHeight = 24;
312312
private int spacing = 43;
313313
private ControlP5 datasource_cp5;
314314
private MenuList sourceList;
315315
private boolean initialUpdate = false;
316316

317317
DataSourceBox(int _x, int _y, int _w, int _h, int _padding) {
318-
numItems = 6;
319318
x = _x;
320319
y = _y;
321320
w = _w;
322-
h = spacing + (numItems * boxHeight);
321+
h = spacing + (NUM_ITEMS * boxHeight);
323322
padding = _padding;
324323

325324
//Instantiate local cp5 for this box
326325
datasource_cp5 = new ControlP5(ourApplet);
327326
datasource_cp5.setGraphics(ourApplet, 0,0);
328327
datasource_cp5.setAutoDraw(false);
329-
createDatasourceList(datasource_cp5, "DataSourceList", x + padding, y + padding*2 + 13, w - padding*2, numItems * boxHeight, p3);
328+
createDatasourceList(datasource_cp5, "DataSourceList", x + padding, y + padding*2 + 13, w - padding*2, NUM_ITEMS * boxHeight, p3);
330329
}
331330

332331
public void update() {
@@ -356,8 +355,6 @@ class DataSourceBox {
356355
private void createDatasourceList(ControlP5 _cp5, String name, int _x, int _y, int _w, int _h, PFont font) {
357356
sourceList = new MenuList(_cp5, name, _w, _h, font);
358357
sourceList.setPosition(_x, _y);
359-
// sourceList.itemHeight = 28;
360-
// sourceList.padding = 9;
361358
sourceList.addItem("CYTON (live)", DATASOURCE_CYTON);
362359
sourceList.addItem("GANGLION (live)", DATASOURCE_GANGLION);
363360
sourceList.addItem("PLAYBACK (from file)", DATASOURCE_PLAYBACKFILE);

OpenBCI_GUI/TopNav.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class TopNav {
6767
createDebugButton(" ", width - DEBUG_BUT_W - PAD_3, PAD_3, DEBUG_BUT_W, TOPNAV_BUT_H, h3, 16, TOPNAV_DARKBLUE, WHITE);
6868
createScreenshotButton(" ", (int)debugButton.getPosition()[0] - DEBUG_BUT_W - PAD_3, PAD_3, DEBUG_BUT_W, TOPNAV_BUT_H, h3, 16, TOPNAV_DARKBLUE, WHITE);
6969
createTutorialsButton("Docs", (int)screenshotButton.getPosition()[0] - TOPRIGHT_BUT_W - PAD_3, PAD_3, TOPRIGHT_BUT_W, TOPNAV_BUT_H, h3, 16, TOPNAV_DARKBLUE, WHITE);
70-
createUpdateGuiButton("Update", (int)debugButton.getPosition()[0] - TOPRIGHT_BUT_W - PAD_3, PAD_3, TOPRIGHT_BUT_W, TOPNAV_BUT_H, h3, 16, TOPNAV_DARKBLUE, WHITE);
70+
createUpdateGuiButton("Update", (int)tutorialsButton.getPosition()[0] - TOPRIGHT_BUT_W - PAD_3, PAD_3, TOPRIGHT_BUT_W, TOPNAV_BUT_H, h3, 16, TOPNAV_DARKBLUE, WHITE);
7171

7272
//SUBNAV TOP RIGHT
7373
createTopNavSettingsButton("Settings", width - SUBNAV_BUT_W - PAD_3, SUBNAV_BUT_Y, SUBNAV_BUT_W, SUBNAV_BUT_H, h4, 14, SUBNAV_LIGHTBLUE, WHITE);

0 commit comments

Comments
 (0)