bsnes/ui/general/main-window.cpp

49 lines
1.3 KiB
C++
Executable File

MainWindow mainWindow;
void MainWindow::create() {
Window::create(128, 128, 160 * 2, 144 * 2, { GameBoy::Info::Name, " v", GameBoy::Info::Version });
setDefaultFont(application.proportionalFont);
setFont(application.proportionalFontBold);
system.create(*this, "System");
systemLoadCartridge.create(system, "Load Cartridge ...");
systemSeparator1.create(system);
systemPower.create(system, "Power Cycle");
systemPower.setEnabled(false);
systemReset.create(system, "Reset");
systemReset.setEnabled(false);
settings.create(*this, "Settings");
//settings.setEnabled(false);
tools.create(*this, "Tools");
//tools.setEnabled(false);
help.create(*this, "Help");
helpAbout.create(help, "About ...");
viewport.create(*this, 0, 0, 160 * 2, 144 * 2);
setMenuVisible(true);
setStatusVisible(true);
onClose = []() {
application.quit = true;
return false;
};
systemLoadCartridge.onTick = []() {
string filename = OS::fileOpen(mainWindow, "Game Boy cartridges\t*.gb,*.gbc", "/media/sdb1/root/gameboy_images/");
if(filename != "") utility.loadCartridge(filename);
};
helpAbout.onTick = []() {
MessageWindow::information(mainWindow, {
"bgameboy\n\n",
"Version: ", GameBoy::Info::Version, "\n",
"Author: byuu\n",
"Homepage: http://byuu.org/"
});
};
}