OpenCPN Partial API docs
Loading...
Searching...
No Matches
TtyScroll Class Reference

Scrolled TTY-like window for logging, etc. More...

#include <tty_scroll.h>

Inheritance diagram for TtyScroll:

Public Member Functions

 TtyScroll (wxWindow *parent, int n_lines, wxTextCtrl &filter)
 Create a TtyScroll instance.
 
virtual void Add (const wxString &line)
 Add a line to bottom of window, typically discarding top-most line.
 
void Pause (bool pause)
 Set the window to ignore Add() or not depending on pause.
 
void Copy (bool n183)
 Copy visible content to clipboard.
 

Protected Member Functions

virtual void OnDraw (wxDC &dc)
 
void OnSize (wxSizeEvent &event)
 

Protected Attributes

wxCoord m_line_height
 
size_t m_n_lines
 
std::deque< wxString > m_lines
 
wxTextCtrl & m_filter
 
bool m_is_paused
 

Detailed Description

Scrolled TTY-like window for logging, etc.

Definition at line 35 of file tty_scroll.h.

Constructor & Destructor Documentation

◆ TtyScroll()

TtyScroll::TtyScroll ( wxWindow *  parent,
int  n_lines,
wxTextCtrl &  filter 
)

Create a TtyScroll instance.

Parameters
parentParent window
n_linesNumber of visible lines i. e., window height.
filterUsed by Add() to discard lines. If filter is empty or added lines contains filter.GetValue() lines are used; otherwise lines are discarded.

Definition at line 32 of file tty_scroll.cpp.

Member Function Documentation

◆ Add()

void TtyScroll::Add ( const wxString &  line)
virtual

Add a line to bottom of window, typically discarding top-most line.

Subject to checks with respect to paused state and filter possibly discarding argument line.

Definition at line 43 of file tty_scroll.cpp.

◆ Copy()

void TtyScroll::Copy ( bool  n183)

Copy visible content to clipboard.

Parameters
n0183If true, copy cleaned up data excluding time stamps etc.

Definition at line 93 of file tty_scroll.cpp.

◆ OnDraw()

void TtyScroll::OnDraw ( wxDC &  dc)
protectedvirtual

Definition at line 52 of file tty_scroll.cpp.

◆ Pause()

void TtyScroll::Pause ( bool  pause)
inline

Set the window to ignore Add() or not depending on pause.

Definition at line 57 of file tty_scroll.h.

Member Data Documentation

◆ m_filter

wxTextCtrl& TtyScroll::m_filter
protected

Definition at line 70 of file tty_scroll.h.

◆ m_is_paused

bool TtyScroll::m_is_paused
protected

Definition at line 71 of file tty_scroll.h.

◆ m_line_height

wxCoord TtyScroll::m_line_height
protected

Definition at line 66 of file tty_scroll.h.

◆ m_lines

std::deque<wxString> TtyScroll::m_lines
protected

Definition at line 69 of file tty_scroll.h.

◆ m_n_lines

size_t TtyScroll::m_n_lines
protected

Definition at line 67 of file tty_scroll.h.


The documentation for this class was generated from the following files: