mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-23 22:52:34 +01:00
byuu says: Added AWJ's fixes for alt/cpu (Tetris Attack framelines issue) and alt/dsp (Thread::clock reset) Added fix so that the taskbar entry appears when the application first starts on Windows. Fixed checkbox toggling inside of list views on Windows. Updated nall/image to properly protect variables that should not be written externally. New Object syntax for hiro is in. Fixed the backwards-typing on Windows with the state manager. NOTE: the list view isn't redrawing when you change the description text. It does so on the cheat editor because of the resizeColumns call; but that shouldn't be necessary. I'll try and fix this for the next WIP.
52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
#if defined(Hiro_MenuBar)
|
|
|
|
auto mMenuBar::allocate() -> pObject* {
|
|
return new pMenuBar(*this);
|
|
}
|
|
|
|
auto mMenuBar::destruct() -> void {
|
|
for(auto& menu : state.menus) menu->destruct();
|
|
mObject::destruct();
|
|
}
|
|
|
|
//
|
|
|
|
auto mMenuBar::append(sMenu menu) -> type& {
|
|
state.menus.append(menu);
|
|
menu->setParent(this, menus() - 1);
|
|
signal(append, menu);
|
|
return *this;
|
|
}
|
|
|
|
auto mMenuBar::menu(unsigned position) const -> Menu {
|
|
if(position < menus()) return state.menus[position];
|
|
return {};
|
|
}
|
|
|
|
auto mMenuBar::menus() const -> unsigned {
|
|
return state.menus.size();
|
|
}
|
|
|
|
auto mMenuBar::remove() -> type& {
|
|
if(auto window = parentWindow()) window->remove(window->menuBar());
|
|
return *this;
|
|
}
|
|
|
|
auto mMenuBar::remove(sMenu menu) -> type& {
|
|
signed offset = menu->offset();
|
|
signal(remove, *menu);
|
|
state.menus.remove(offset);
|
|
for(auto n : range(offset, menus())) {
|
|
state.menus[n]->adjustOffset(-1);
|
|
}
|
|
menu->setParent();
|
|
return *this;
|
|
}
|
|
|
|
auto mMenuBar::reset() -> type& {
|
|
while(state.menus) remove(state.menus.last());
|
|
return *this;
|
|
}
|
|
|
|
#endif
|