GNU Radio's DISPLAY Package
show_text_window.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2022 by Volker Schroer, DL1KSV *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 ***************************************************************************/
19
20#ifndef SHOW_TEXT_WINDOWS_H
21#define SHOW_TEXT_WINDOWS_H
22
23#include <QtWidgets/QHBoxLayout>
24#include <QtWidgets/QLabel>
25#include <QtWidgets/QPushButton>
26#include <QtWidgets/QRadioButton>
27#include <QtWidgets/QScrollArea>
28#include <QtWidgets/QSpacerItem>
29#include <QtWidgets/QVBoxLayout>
30#include <QtWidgets/QWidget>
31
32
33class show_text_window : public QWidget
34{
35 Q_OBJECT
36
37public:
38 explicit show_text_window(int splitlength, int maxlines, QWidget* parent = 0);
39 void set_text(const char* c, int count);
40 void setHeader(QString header);
41
42private:
43 QVBoxLayout* d_vertical_layout;
44 QLabel* d_label;
45 QScrollArea* d_display_area;
46 QHBoxLayout* d_horizontal_layout;
47 QPushButton* d_clear;
48 QSpacerItem* d_horizontal_spacer;
49 QRadioButton* d_auto_focus;
50 QSpacerItem* d_horizontal_spacer_2;
51 QPushButton* d_save;
52 QVBoxLayout* d_lines_layout;
53
54 QString d_line;
55
56 int d_splitlength;
57 unsigned int d_linecount;
58 unsigned int d_maxlines;
59 bool d_line_to_be_continued;
60
61 QWidget* d_d_display_box;
62 QLabel** d_lines;
63 bool d_autofocus;
64 void insert_nl_into_line(int from);
65 void move_input2lines();
66 void scroll_up(unsigned int rows, bool d_clear);
67
68private slots:
69 void text2File();
70 void clearText();
71 void autofocus_enable(bool);
72};
73
74#endif // SHOW_TEXT_WINDOWS_H
void setHeader(QString header)
void set_text(const char *c, int count)
show_text_window(int splitlength, int maxlines, QWidget *parent=0)