bsnes/purify/phoenix/windows/widget/radio-box.cpp

44 lines
1.0 KiB
C++
Raw Normal View History

bool pRadioBox::checked() {
return SendMessage(hwnd, BM_GETCHECK, 0, 0);
}
Update to v078 release. byuu says: Finally, a new release. I have been very busy finishing up SNES box, cartridge and PCB scanning plus cataloguing the data, however this release still has some significant improvements. Most notably would be randomization on startup. This will help match the behavior of real hardware and uninitialized memory + registers. It should help catch homebrew software that forgets to initialize things properly. Of course, I was not able to test the complete library, so it is possible that if I've randomized anything that should be constant, that this could cause a regression. You can disable this randomization for netplay or to work around any incompatibilities by editing bsnes.cfg and setting snes.random to false. The GUI also received some updates. Widget sizes are now computed based on font sizes, giving it a perfectly native look (because it is native.) I've also added a hotkey remapping screen to the input settings. Not only can you remap inputs to controllers now, but those who did not know the hotkey bindings can now quickly see which ones exist and what they are mapped to. Changelog (since v077): - memory and most registers are now randomly initialized on power-up - fixed auto joypad polling issue in Super Star Wars - fixed .nec and .rtc file extensions (they were missing the dot) [krom] - PPU/accuracy now clears overscan region on any frame when it is disabled - PPU/compatibility no longer auto-blends hires pixels (use NTSC filter for this) - added hotkey remapping dialog to input settings window - added a few new hotkeys, including quick-reset - phoenix API now auto-sizes widgets based on font sizes - file dialog once again remembers previously selected file when possible
2011-04-30 13:12:15 +00:00
Geometry pRadioBox::minimumGeometry() {
Geometry geometry = pFont::geometry(hfont, radioBox.state.text);
return { 0, 0, geometry.width + 20, geometry.height + 4 };
Update to v078 release. byuu says: Finally, a new release. I have been very busy finishing up SNES box, cartridge and PCB scanning plus cataloguing the data, however this release still has some significant improvements. Most notably would be randomization on startup. This will help match the behavior of real hardware and uninitialized memory + registers. It should help catch homebrew software that forgets to initialize things properly. Of course, I was not able to test the complete library, so it is possible that if I've randomized anything that should be constant, that this could cause a regression. You can disable this randomization for netplay or to work around any incompatibilities by editing bsnes.cfg and setting snes.random to false. The GUI also received some updates. Widget sizes are now computed based on font sizes, giving it a perfectly native look (because it is native.) I've also added a hotkey remapping screen to the input settings. Not only can you remap inputs to controllers now, but those who did not know the hotkey bindings can now quickly see which ones exist and what they are mapped to. Changelog (since v077): - memory and most registers are now randomly initialized on power-up - fixed auto joypad polling issue in Super Star Wars - fixed .nec and .rtc file extensions (they were missing the dot) [krom] - PPU/accuracy now clears overscan region on any frame when it is disabled - PPU/compatibility no longer auto-blends hires pixels (use NTSC filter for this) - added hotkey remapping dialog to input settings window - added a few new hotkeys, including quick-reset - phoenix API now auto-sizes widgets based on font sizes - file dialog once again remembers previously selected file when possible
2011-04-30 13:12:15 +00:00
}
void pRadioBox::setChecked() {
for(auto &item : radioBox.state.group) {
SendMessage(item.p.hwnd, BM_SETCHECK, (WPARAM)(&item == &radioBox), 0);
}
}
void pRadioBox::setGroup(const array<RadioBox&> &group) {
}
void pRadioBox::setText(const string &text) {
SetWindowText(hwnd, utf16_t(text));
}
void pRadioBox::constructor() {
hwnd = CreateWindow(
L"BUTTON", L"",
WS_CHILD | WS_TABSTOP | BS_RADIOBUTTON,
0, 0, 0, 0, parentWindow->p.hwnd, (HMENU)id, GetModuleHandle(0), 0
);
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&radioBox);
setDefaultFont();
if(radioBox.state.checked) setChecked();
setText(radioBox.state.text);
synchronize();
}
void pRadioBox::destructor() {
DestroyWindow(hwnd);
}
void pRadioBox::orphan() {
destructor();
constructor();
}