複選框 Checkbox

- Prototype - 1 
 2
 3- bool Checkbox(const char* label, bool* v); 
 // label: 名稱
 // v : 是否已經勾選
- 回傳 bool - 當 checkbox 正被選取/取消勾選時為 true
- 其餘回傳 false
 
- 當 checkbox 正被選取/取消勾選時為 
- e.g. 
| 1 | static bool chk = false; | 


單選按鈕 Radio Button

- Prototype - 1 
 2
 3
 4- bool RadioButton(const char* label, int* v, int v_button); 
 // label : 名稱
 // *v : 指向儲存選項的 int pointer
 // v_button : 該 radio button 所代表的數字
- example - 1 
 2
 3
 4
 5
 6
 7
 8
 9- static int select = -1; 
 ImGui::RadioButton("Zero", &select, 0); ImGui::SameLine();
 ImGui::RadioButton("One", &select, 1); ImGui::SameLine();
 ImGui::RadioButton("Two", &select, 2);
 if(select >= 0)
 {
 ImGui::Text("You Select %d\n", select);
 }

如果你覺得這篇文章很棒,請你不吝點讚 (゚∀゚)
