X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=emul%2Femulwin.cpp;h=a49fa4807c910b8edcf4db0db853471e81df3718;hb=HEAD;hp=b5b516a6cd70bb7c984315aa5c9f53f0110b5b48;hpb=6ac6b17a873cc424f8a9d63c56116c1d94276017;p=bertos.git diff --git a/emul/emulwin.cpp b/emul/emulwin.cpp deleted file mode 100644 index b5b516a6..00000000 --- a/emul/emulwin.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/** - * \file - * - * - * \version $Id$ - * - * \author Bernardo Innocenti - * - * \brief Main Qt window for embedded applications emulator (implementation) - */ - -#include "emulwin.h" - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -using namespace Qt; - -EmulWin::EmulWin(Emulator *e) -{ - setWindowTitle(tr("BeRTOS Emul Demo")); - setAttribute(Qt::WA_DeleteOnClose); - - // Create the menu bar - QMenu *file_menu = menuBar()->addMenu(tr("&File")); - file_menu->addAction(tr("&Quit"), - e->emulApp, SLOT(closeAllWindows()), CTRL+Key_Q); - - menuBar()->addSeparator(); - - QMenu *help_menu = menuBar()->addMenu(tr("&Help")); - help_menu->addAction(tr("&About"), - this, SLOT(about()), Key_F1); - - // Make a central widget to contain the other widgets - QWidget *central = new QWidget(this); - setCentralWidget(central); - - // Create a layout to position the widgets - QHBoxLayout *box_main = new QHBoxLayout(central); - - // Main layout - QVBoxLayout *box_right = new QVBoxLayout(); - box_main->addLayout(box_right); - - // LCD - QHBoxLayout *lay_lcd = new QHBoxLayout(); - box_right->addLayout(lay_lcd); - lay_lcd->addStretch(); - lay_lcd->addWidget(e->emulLCD = new EmulLCD(central)); - lay_lcd->addStretch(); - - // Keyboard - box_right->addWidget(e->emulKbd = new EmulKbd(central)); - - // Setup keyboard: Label Keycode Row Col MRow MCol - e->emulKbd->addKey("^", Key_Up, 0, 0, 0, 0); - e->emulKbd->addKey("v", Key_Down, 1, 0, 0, 1); - e->emulKbd->addKey("OK", Key_Return, 0, 1, 0, 2); - e->emulKbd->addKey("ESC", Key_Escape, 1, 1, 0, 3); -} - - -EmulWin::~EmulWin() -{ - emul->quit(); -} - - -void EmulWin::closeEvent(QCloseEvent *ce) -{ - ce->accept(); -} - - -void EmulWin::about() -{ - QMessageBox::about(this, - "BeRTOS Embedded Application Emulator", - "Version 0.1\n" - "Copyright 2006, 2008 Develer S.r.l. (http://www.develer.com/)\n" - "Copyright 2001, 2002, 2003, 2005 Bernardo Innocenti \n" - "All rights reserved." - ); -} - -#include "emulwin_moc.cpp"