MAK RTIspy API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
consoleWidget.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2017 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vlutil/vlPrint.h>
13 #include <QWidget>
14 #include <list>
15 #include "rtiMsConfig.h"
16 #include "widgetDialog.h"
17 
18 class QToolBar;
19 class QComboBox;
20 class QGridLayout;
21 class QFrame;
22 class QTextDocument;
23 class QLineEdit;
24 class QPushButton;
25 class QSpacerItem;
26 class QShortcut;
27 #if QT_VERSION >= 0x040400
28 class QPlainTextEdit;
29 #else
30 class QTextEdit;
31 #endif
32 
35 {
36  Q_OBJECT
37 
38 public:
39 
41  DtConsoleWidget( QWidget* parent = 0, Qt::WindowFlags f = 0 );
42 
44  virtual ~DtConsoleWidget();
45 
48  virtual void writeText( const QString& st, QColor color = Qt::black );
49 
51  virtual void clear();
52 
54  virtual void setNotifyLevel( MAKRti::DtNotifyLevelType notifyLevel );
55 
58  virtual void setMaximumLines( int max );
59 
62  virtual void setDocument( QTextDocument* document );
63 
65  virtual void showToolBar( bool showBar = true );
67  virtual void showClearButton( bool showButton = true );
68  virtual void showSaveButton( bool showButton = true );
69  virtual void showPauseResumeButton( bool showButton = true );
70  virtual void showNotifyLevelBox( bool showBox = true );
72 
74  virtual void removeNotifyComboBox();
75 
76 public slots:
77 
80  virtual void processNotifyComboxBoxUpdate( int level );
81 
83  virtual void processSave();
84 
86  virtual void processPause();
87 
89  virtual void processResume();
90 
92  virtual void processSearch();
93 
95  virtual void focusSearchEdit();
96 
97 signals:
98 
102  void notifyLevelUpdated( MAKRti::DtNotifyLevelType notifyLevel );
103 
104 protected:
105 
107  {
108  QString text;
109  QColor color;
110  };
111  typedef std::list< DtTextAndColor > DtTextAndColorList;
112 
115  virtual void saveToFile();
116 
118  QToolBar* myToolBar;
119 
121  QAction* myClearAction;
122 
124  QAction* mySaveAction;
125 
128  QAction* myPauseAction;
129 
131  QAction* myResumeAction;
132 
134  QComboBox* myNotifyComboBox;
135 
137 #if QT_VERSION >= 0x040400
138  QPlainTextEdit* myTextEdit;
139 #else
140  QTextEdit* myTextEdit;
141 #endif
142 
144  QFrame* myFrame;
145 
147  QGridLayout* myLayout;
148 
150  QGridLayout* myFrameLayout;
151 
153  QString mySavedFile;
154 
156  QLineEdit* mySearchEdit;
157 
159  QPushButton* mySearchPushButton;
160 
162  QSpacerItem* mySpacer;
163 
165  QShortcut* mySearchShortcut;
166 
169 
173 };
174 
177 {
178 
179 public:
180 
182  DtConsoleDialog( DtConsoleWidget* console = 0, QWidget* parent = 0, Qt::WindowFlags f = 0 ) :
183  DtWidgetDialog( 0, parent, f ) { setWidget( console? console : new DtConsoleWidget( this ) ); }
184 
186  virtual ~DtConsoleDialog(){}
187 
190  { return dynamic_cast<DtConsoleWidget*>(myWidget); }
191 };
QLineEdit * mySearchEdit
The search edit box.
Definition: consoleWidget.h:156
QSpacerItem * mySpacer
Spacer item for the grid layout.
Definition: consoleWidget.h:162
bool myIsPaused
Indicates if the console is currently paused.
Definition: consoleWidget.h:168
Dialog to hold a DtConsoleWidget.
Definition: consoleWidget.h:176
virtual ~DtConsoleDialog()
Destructor.
Definition: consoleWidget.h:186
QAction * myPauseAction
The tool bar action which pauses the console, preventing it from updating and scrolling.
Definition: consoleWidget.h:128
virtual void setWidget(QWidget *widget)
Embeds the widget in the dialog.
DtConsoleDialog(DtConsoleWidget *console=0, QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
Definition: consoleWidget.h:182
QFrame * myFrame
The frame of the widget.
Definition: consoleWidget.h:144
QString text
Definition: consoleWidget.h:108
QAction * mySaveAction
The tool bar action which saves the full log to a file.
Definition: consoleWidget.h:124
QString mySavedFile
The previously saved file.
Definition: consoleWidget.h:153
QGridLayout * myFrameLayout
The layout of the frame.
Definition: consoleWidget.h:150
std::list< DtTextAndColor > DtTextAndColorList
Definition: consoleWidget.h:111
Contains the DtWidgetDialog class declaration.
QGridLayout * myLayout
The layout of the widget.
Definition: consoleWidget.h:147
QToolBar * myToolBar
The tool bar for a console widget.
Definition: consoleWidget.h:118
QAction * myResumeAction
The tool bar action which resumes the console after it has been paused.
Definition: consoleWidget.h:131
QTextEdit * myTextEdit
The text edit box which displays the log.
Definition: consoleWidget.h:140
Qt widget that provides the GUI for a console display.
Definition: consoleWidget.h:34
A generic dialog which houses a single widget.
Definition: widgetDialog.h:21
#define DT_DLL_ASSISTANTAPP
Definition: rtiMsConfig.h:151
DtTextAndColorList myPauseText
Used to store text while pause is on.
Definition: consoleWidget.h:172
QComboBox * myNotifyComboBox
The tool bar combo box which will update the notify level.
Definition: consoleWidget.h:134
DtConsoleWidget * widget()
Returns a pointer to the embedded widget.
Definition: consoleWidget.h:189
QWidget * myWidget
The embedded widget.
Definition: widgetDialog.h:77
QPushButton * mySearchPushButton
The search button.
Definition: consoleWidget.h:159
QShortcut * mySearchShortcut
Search edit shortcut.
Definition: consoleWidget.h:165
QAction * myClearAction
The tool bar action which clears the console.
Definition: consoleWidget.h:121
Definition: consoleWidget.h:106
QColor color
Definition: consoleWidget.h:109

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)