Debian Codegraph @

phoenix/windows/action/radio-item.cpp

raw
1 namespace phoenix {
2
3 void pRadioItem::setChecked() {
4 for(auto &item : radioItem.state.group) {
5 //CheckMenuRadioItem takes: lo, hi, id; checking only id when lo <= id <= hi
6 //phoenix does not force IDs to be linear, so to uncheck id, we use: lo == hi == id + 1 (out of range)
7 //to check id, we use: lo == hi == id (only ID, but in range)
8 if(item.p.parentMenu) CheckMenuRadioItem(item.p.parentMenu->p.hmenu, item.p.id, item.p.id, item.p.id + (id != item.p.id), MF_BYCOMMAND);
9 }
10 }
11
12 void pRadioItem::setGroup(const group<RadioItem>& group) {
13 }
14
15 void pRadioItem::setText(string text) {
16 if(parentWindow) parentWindow->p.updateMenu();
17 }
18
19 void pRadioItem::constructor() {
20 }
21
22 void pRadioItem::destructor() {
23 if(parentMenu) parentMenu->remove(radioItem);
24 }
25
26 void pRadioItem::onActivate() {
27 if(radioItem.state.checked) return;
28 radioItem.setChecked();
29 if(radioItem.onActivate) radioItem.onActivate();
30 }
31
32 }