My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
helpdialog.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  helpdialog.cpp
3  ------------------
4  begin : Sun Apr 03 2005
5  copyright : (C) 2005 by Stefan Jahn
6  email : stefan@lkcc.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifdef HAVE_CONFIG_H
19 # include <config.h>
20 #endif
21 
22 #include <qlayout.h>
23 #include <qhbox.h>
24 #include <qpushbutton.h>
25 #include <qtextedit.h>
26 
27 #include "helpdialog.h"
28 
29 
30 HelpDialog::HelpDialog(QWidget *parent)
31  : QDialog(parent, 0, false, Qt::WDestructiveClose)
32 {
33  setCaption("QucsTranscalc "+tr("Help"));
34 
35  // -------- set help text into dialog ------------
36  QString s(tr("QucsTranscalc is an analysis and synthesis tool for "
37  "calculating the electrical and physical properties of "
38  "different kinds of RF and microwave transmission lines.")+
39  "\n\n"+
40  tr("For each type of transmission line, using dialog boxes, you can "
41  "enter values for the various parameters, and either calculate its "
42  "electrical properties, or use the given electrical requirements to "
43  "synthesize physical parameters of the required transmission line."));
44 
45 
46  // -------- create dialog widgets ------------
47  resize(350, 230);
48 
49  vLayout = new QVBoxLayout(this);
50  vLayout->setMargin(3);
51  vLayout->setSpacing(3);
52 
53  Text = new QTextEdit(s, QString::null, this);
54  Text->setTextFormat(Qt::PlainText);
55  Text->setReadOnly(true);
56  Text->setMinimumSize(300,200);
57  vLayout->addWidget(Text);
58 
59  QPushButton *ButtonClose = new QPushButton(tr("Dismiss"), this);
60  vLayout->addWidget(ButtonClose);
61  connect(ButtonClose, SIGNAL(clicked()), SLOT(slotClose()));
62  ButtonClose->setFocus();
63 }
64 
66 {
67  delete vLayout;
68 }
69 
70 void HelpDialog::slotClose()
71 {
72  accept();
73 }