We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b980b68 commit 21dcb08Copy full SHA for 21dcb08
src/main/java/controlP5/controller/button/ButtonBar.java
@@ -103,12 +103,21 @@ public ButtonBar updateViewMode(int theMode) {
103
@Override
104
public void onClick() {
105
int index = hover();
106
- if (index > -1) {
+ changeSelectedIndex(index);
107
+ }
108
+
109
+ /**
110
+ * 選択中のindex切り替え、利用は非推奨
111
+ *
112
+ * @param _index 切り替えたいボタンのindex
113
+ */
114
+ public void changeSelectedIndex(int _index) {
115
+ if (_index > -1) {
116
for (Map m : items) {
117
m.put("selected", false);
118
}
- items.get(index).put("selected", true);
- setValue(hover());
119
+ items.get(_index).put("selected", true);
120
+ setValue(_index);
121
122
123
0 commit comments