| 1 | // File: outputpane.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 OUTPUTPANE_H |
| 23 | #define OUTPUTPANE_H |
| 24 | |
| 25 | #include <QWidget> |
| 26 | |
| 27 | namespace Ui { |
| 28 | class OutputPane; |
| 29 | } |
| 30 | |
| 31 | class OutputPane : public QWidget { |
| 32 | Q_OBJECT |
| 33 | Q_DISABLE_COPY(OutputPane) |
| 34 | public: |
| 35 | explicit OutputPane(QWidget *parent = 0); |
| 36 | virtual ~OutputPane(); |
| 37 | |
| 38 | void appendOutput(QString str); |
| 39 | // Post: str is appended to the text edit |
| 40 | |
| 41 | void clearOutput(); |
| 42 | // Post: the output is cleared |
| 43 | |
| 44 | void highlightOnFocus(); |
| 45 | // Post: Highlights the label based on the label window color saved in the UI file |
| 46 | |
| 47 | bool hasFocus(); |
| 48 | // Post: returns if the pane has focus |
| 49 | |
| 50 | void copy(); |
| 51 | // Post: selected text in the text edit is copied to the clipboard |
| 52 | |
| 53 | public slots: |
| 54 | void onFontChanged(QFont font); |
| 55 | |
| 56 | private: |
| 57 | Ui::OutputPane *ui; |
| 58 | |
| 59 | void mouseReleaseEvent(QMouseEvent *); |
| 60 | }; |
| 61 | |
| 62 | #endif // OUTPUTPANE_H |