mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-24 15:12:23 +01:00
byuu says: Updated to support latest phoenix changes. Converted Settings and Tools to TabFrame views. Errata: - phoenix/Windows ComboButton wasn't calling parent pWidget::setGeometry() [fixed locally] - TRACKBAR_CLASS draws COLOR_3DFACE for the background even when its parent is a WC_TABCONTROL
43 lines
976 B
C++
43 lines
976 B
C++
namespace phoenix {
|
|
|
|
void pRadioItem::setChecked() {
|
|
locked = true;
|
|
for(auto& item : radioItem.state.group) {
|
|
bool checkState = item.p.qtAction == qtAction;
|
|
item.state.checked = checkState;
|
|
item.p.qtAction->setChecked(checkState);
|
|
}
|
|
locked = false;
|
|
}
|
|
|
|
void pRadioItem::setGroup(const group<RadioItem>& group) {
|
|
}
|
|
|
|
void pRadioItem::setText(string text) {
|
|
qtAction->setText(QString::fromUtf8(text));
|
|
}
|
|
|
|
void pRadioItem::constructor() {
|
|
qtAction = new QAction(0);
|
|
qtGroup = new QActionGroup(0);
|
|
qtAction->setCheckable(true);
|
|
qtAction->setActionGroup(qtGroup);
|
|
qtAction->setChecked(true);
|
|
connect(qtAction, SIGNAL(triggered()), SLOT(onActivate()));
|
|
}
|
|
|
|
void pRadioItem::destructor() {
|
|
if(action.state.menu) action.state.menu->remove(radioItem);
|
|
delete qtAction;
|
|
qtAction = nullptr;
|
|
}
|
|
|
|
void pRadioItem::onActivate() {
|
|
if(!radioItem.state.checked) {
|
|
setChecked();
|
|
if(!locked && radioItem.onActivate) radioItem.onActivate();
|
|
}
|
|
}
|
|
|
|
}
|