2010-12-28 01:53:15 +00:00
|
|
|
MainWindow mainWindow;
|
|
|
|
|
|
|
|
void MainWindow::create() {
|
2010-12-30 07:18:47 +00:00
|
|
|
Window::create(128, 128, 160 * 2, 144 * 2, { GameBoy::Info::Name, " v", GameBoy::Info::Version });
|
|
|
|
setDefaultFont(application.proportionalFont);
|
|
|
|
setFont(application.proportionalFontBold);
|
2010-12-28 01:53:15 +00:00
|
|
|
|
|
|
|
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");
|
2010-12-30 07:18:47 +00:00
|
|
|
//settings.setEnabled(false);
|
2010-12-28 01:53:15 +00:00
|
|
|
|
|
|
|
tools.create(*this, "Tools");
|
2010-12-30 07:18:47 +00:00
|
|
|
//tools.setEnabled(false);
|
2010-12-28 01:53:15 +00:00
|
|
|
|
|
|
|
help.create(*this, "Help");
|
|
|
|
helpAbout.create(help, "About ...");
|
|
|
|
|
2010-12-30 07:18:47 +00:00
|
|
|
viewport.create(*this, 0, 0, 160 * 2, 144 * 2);
|
2010-12-28 01:53:15 +00:00
|
|
|
|
|
|
|
setMenuVisible(true);
|
|
|
|
setStatusVisible(true);
|
|
|
|
|
|
|
|
onClose = []() {
|
|
|
|
application.quit = true;
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
|
|
|
systemLoadCartridge.onTick = []() {
|
2011-01-02 04:46:54 +00:00
|
|
|
string filename = OS::fileOpen(mainWindow, "Game Boy cartridges\t*.gb,*.gbc", "/media/sdb1/root/gameboy_images/");
|
2010-12-28 01:53:15 +00:00
|
|
|
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/"
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|