| 1 | // File: helpdialog.h |
| 2 | /* |
| 3 | Pep8-1 is a virtual machine for writing machine language and assembly |
| 4 | language programs. |
| 5 | |
| 6 | Copyright (C) 2009 J. Stanley Warford, Pepperdine University |
| 7 | |
| 8 | This program is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation, either version 3 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | */ |
| 21 | |
| 22 | #ifndef HELPDIALOG_H |
| 23 | #define HELPDIALOG_H |
| 24 | |
| 25 | #include <QDialog> |
| 26 | #include <QTreeWidgetItem> |
| 27 | #include "pephighlighter.h" // For syntax highlighting |
| 28 | #include "cpphighlighter.h" |
| 29 | #include "enu.h" |
| 30 | |
| 31 | namespace Ui { |
| 32 | class HelpDialog; |
| 33 | } |
| 34 | |
| 35 | class HelpDialog : public QDialog { |
| 36 | Q_OBJECT |
| 37 | Q_DISABLE_COPY(HelpDialog) |
| 38 | public: |
| 39 | explicit HelpDialog(QWidget *parent = 0); |
| 40 | virtual ~HelpDialog(); |
| 41 | |
| 42 | void machineLanguageClicked(); |
| 43 | void assemblyLanguageClicked(); |
| 44 | void debuggingProgramsClicked(); |
| 45 | void writingTrapHandlersClicked(); |
| 46 | void pep8ReferenceClicked(); |
| 47 | void examplesClicked(); |
| 48 | void operatingSystemClicked(); |
| 49 | QString getCode(Enu::EPane &destPane, Enu::EPane &inputDest, QString &input); |
| 50 | |
| 51 | bool hasFocus(); |
| 52 | // Post: returns true if either of the text edits have focus |
| 53 | |
| 54 | void copy(); |
| 55 | // Post: the text edit that has focus has the copy() operation performed |
| 56 | |
| 57 | void setCopyButtonDisabled(bool b); |
| 58 | // Post: the enabled state of the copy to source/object code button is set to b |
| 59 | |
| 60 | private: |
| 61 | Ui::HelpDialog *ui; |
| 62 | |
| 63 | void selectItem(QString string); |
| 64 | PepHighlighter *leftHighlighter; |
| 65 | CppHighlighter *rightCppHighlighter; |
| 66 | PepHighlighter *rightPepHighlighter; |
| 67 | |
| 68 | enum Row { |
| 69 | |
| 70 | eWRITING = 0, |
| 71 | eDEBUGGING = 1, |
| 72 | eTRAP = 2, |
| 73 | eREFERENCE = 3, |
| 74 | eEXAMPLES = 4, |
| 75 | eOS = 5, |
| 76 | |
| 77 | eASSEMBLY = 1, |
| 78 | eMACHINE = 0, |
| 79 | |
| 80 | eFIG432 = 0, |
| 81 | eFIG434 = 1, |
| 82 | eFIG435 = 2, |
| 83 | eFIG436 = 3, |
| 84 | eFIG503 = 4, |
| 85 | eFIG506 = 5, |
| 86 | eFIG507 = 6, |
| 87 | eFIG510 = 7, |
| 88 | eFIG511 = 8, |
| 89 | eFIG512 = 9, |
| 90 | eFIG513 = 10, |
| 91 | eFIG514a= 11, |
| 92 | eFIG514b= 12, |
| 93 | eFIG515 = 13, |
| 94 | eFIG516 = 14, |
| 95 | eFIG518 = 15, |
| 96 | eFIG521 = 16, |
| 97 | eFIG526 = 17, |
| 98 | eFIG601 = 18, |
| 99 | eFIG604 = 19, |
| 100 | eFIG606 = 20, |
| 101 | eFIG608 = 21, |
| 102 | eFIG610 = 22, |
| 103 | eFIG612 = 23, |
| 104 | eFIG614 = 24, |
| 105 | eFIG616 = 25, |
| 106 | eFIG618 = 26, |
| 107 | eFIG621 = 27, |
| 108 | eFIG623 = 28, |
| 109 | eFIG625 = 29, |
| 110 | eFIG627 = 30, // Interactive input |
| 111 | eFIG629 = 31, // Interactive input |
| 112 | eFIG632 = 32, |
| 113 | eFIG634 = 33, |
| 114 | eFIG636 = 34, |
| 115 | eFIG638 = 35, |
| 116 | eFIG640 = 36, // Interactive input |
| 117 | eFIG641 = 37, |
| 118 | eFIG643 = 38, |
| 119 | eFIG645 = 39, |
| 120 | eFIG647 = 40, |
| 121 | eEXER804 = 41, |
| 122 | ePROB829 = 42, |
| 123 | ePROB832 = 43, |
| 124 | }; |
| 125 | |
| 126 | public slots: |
| 127 | void onFontChanged(QFont font); |
| 128 | |
| 129 | private slots: |
| 130 | void onCurrentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*); |
| 131 | |
| 132 | signals: |
| 133 | void clicked(); |
| 134 | }; |
| 135 | |
| 136 | #endif // HELPDIALOG_H |