| 24 | #include "Dexed.h" |
| 25 | |
| 26 | ProgramListBox::ProgramListBox(const String name, int numCols) : Component(name) { |
| 27 | cols = numCols; |
| 28 | rows = 32 / numCols; |
| 29 | activePgm = -1; |
| 30 | hasContent = false; |
| 31 | readOnly = false; |
| 32 | programNames.clear(); |
| 33 | |
| 34 | for(int i=0;i<32;i++) { |
| 35 | labels[i].reset(new ProgramLabel(this, i)); |
| 36 | addAndMakeVisible(labels[i].get()); |
| 37 | } |
| 38 | |
| 39 | setTitle(name); |
| 40 | setWantsKeyboardFocus(true); |
| 41 | addKeyListener(this); |
| 42 | setFocusContainerType(FocusContainerType::focusContainer); |
| 43 | } |
| 44 | |
| 45 | void ProgramListBox::resized() { |
| 46 | cellWidth = (float) getWidth() / cols; |