X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fhelp.cpp;h=3194f904b29022f0ae8859d40741bfae05863e60;hb=8103796dd981a8a1c2e18979fd5ef3a1f3f1ccdb;hp=8c8c98d588454673d67b1d45f18fb8f4bc5d960f;hpb=34c2f4526d11f2139130c4c94920dd7b1c7a6124;p=virtualjaguar diff --git a/src/gui/help.cpp b/src/gui/help.cpp index 8c8c98d..3194f90 100644 --- a/src/gui/help.cpp +++ b/src/gui/help.cpp @@ -1,14 +1,15 @@ // // help.cpp - Help file // -// by James L. Hammons +// by James Hammons // (C) 2011 Underground Software // -// JLH = James L. Hammons +// JLH = James Hammons // // Who When What // --- ---------- ------------------------------------------------------------- // JLH 08/01/2011 Created this file +// JLH 10/08/2011 Added Esc & Return as exit keys // // STILL TO DO: @@ -28,41 +29,13 @@ HelpWindow::HelpWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog) // layout->setSizeConstraint(QLayout::SetFixedSize); setLayout(layout); -// image = new QLabel(); -// image->setAlignment(Qt::AlignRight); -// image->setPixmap(QPixmap(":/res/vj_title_small.png")); -// layout->addWidget(image); - text = new QTextBrowser; text->setSource(QUrl("qrc:/res/help.html")); layout->addWidget(text); } -#if 0 -label size is 365x168 -scaled(365, 168 - -#include "htmlviewer.moc" -HtmlViewerWindow *htmlViewerWindow; - -HtmlViewerWindow::HtmlViewerWindow() { - setObjectName("html-window"); - resize(560, 480); - setGeometryString(&config().geometry.htmlViewerWindow); - application.windowList.add(this); - - layout = new QVBoxLayout; - layout->setMargin(Style::WindowMargin); - layout->setSpacing(0); - setLayout(layout); - - document = new QTextBrowser; - layout->addWidget(document); -} - -void HtmlViewerWindow::show(const char *title, const char *htmlData) { - document->setHtml(string() << htmlData); - setWindowTitle(title); - Window::show(); +void HelpWindow::keyPressEvent(QKeyEvent * e) +{ + if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return) + hide(); } -#endif