bsnes/hiro/core/menu-bar.cpp
Tim Allen 20cc6148cb Update to v094r27 release.
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.
2015-06-18 20:48:53 +10:00

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