* Set item checkable state by name * 通过名称设置菜单项可选中状态
(name: string, bCheckable: boolean)
| 180 | * 通过名称设置菜单项可选中状态 |
| 181 | */ |
| 182 | public setItemCheckable(name: string, bCheckable: boolean): void { |
| 183 | const item = this._list.getChild(name); |
| 184 | if (item && item instanceof GButton) { |
| 185 | const c = item.getController('checked'); |
| 186 | if (c) { |
| 187 | if (bCheckable) { |
| 188 | if (c.selectedIndex === 0) { |
| 189 | c.selectedIndex = 1; |
| 190 | } |
| 191 | } else { |
| 192 | c.selectedIndex = 0; |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | /** |
| 199 | * Set item checked state by name |
nothing calls this directly
no test coverage detected