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)
 Create a TtyScroll instance.
 
virtual void Add (const Logline &line)
 Add a line to bottom of window, typically discarding top-most line.
 
virtual void Clear ()
 Clear the log window.
 
void Pause (bool pause)
 Set the window to ignore Add() or not depending on pause.
 
void CopyToClipboard () const
 Copy message contents to clipboard.
 
void SetFilter (const NavmsgFilter &filter)
 Apply a display filter.
 
const NavmsgFilterGetFilter ()
 Return current display filter.
 
void SetQuickFilter (const std::string s)
 Apply a quick filter directly matched against lines.
 
void SetColors (std::unique_ptr< ColorByState > color_by_state)
 Set color scheme.
 

Protected Member Functions

void DrawLine (wxDC &dc, const Logline &ll, int data_pos, int y)
 Draw a single line in the log window.
 
virtual void OnDraw (wxDC &dc)
 
void OnSize (wxSizeEvent &event)
 

Protected Attributes

wxCoord m_line_height
 
size_t m_n_lines
 
wxCoord m_text_width
 
std::deque< Loglinem_lines
 
NavmsgFilter m_filter
 
bool m_is_paused
 
std::unique_ptr< ColorByStatem_color_by_state
 
std::string m_quick_filter
 

Detailed Description

Scrolled TTY-like window for logging, etc.

Definition at line 79 of file tty_scroll.h.

Constructor & Destructor Documentation

◆ TtyScroll()

TtyScroll::TtyScroll ( wxWindow *  parent,
int  n_lines 
)

Create a TtyScroll instance.

Parameters
parentParent window
n_linesNumber of visible lines i. e., window height.

Definition at line 166 of file tty_scroll.cpp.

Member Function Documentation

◆ Add()

void TtyScroll::Add ( const Logline 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 189 of file tty_scroll.cpp.

◆ Clear()

void TtyScroll::Clear ( )
virtual

Clear the log window.

Definition at line 183 of file tty_scroll.cpp.

◆ CopyToClipboard()

void TtyScroll::CopyToClipboard ( ) const

Copy message contents to clipboard.


Definition at line 221 of file tty_scroll.cpp.

◆ DrawLine()

void TtyScroll::DrawLine ( wxDC &  dc,
const Logline ll,
int  data_pos,
int  y 
)
protected

Draw a single line in the log window.

Definition at line 123 of file tty_scroll.cpp.

◆ GetFilter()

const NavmsgFilter & TtyScroll::GetFilter ( )
inline

Return current display filter.

Definition at line 110 of file tty_scroll.h.

◆ OnDraw()

void TtyScroll::OnDraw ( wxDC &  dc)
protectedvirtual

Definition at line 201 of file tty_scroll.cpp.

◆ OnSize()

void TtyScroll::OnSize ( wxSizeEvent &  event)
protected

Definition at line 177 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 101 of file tty_scroll.h.

◆ SetColors()

void TtyScroll::SetColors ( std::unique_ptr< ColorByState color_by_state)

Set color scheme.

Definition at line 197 of file tty_scroll.cpp.

◆ SetFilter()

void TtyScroll::SetFilter ( const NavmsgFilter filter)
inline

Apply a display filter.

Definition at line 107 of file tty_scroll.h.

◆ SetQuickFilter()

void TtyScroll::SetQuickFilter ( const std::string  s)
inline

Apply a quick filter directly matched against lines.

Definition at line 113 of file tty_scroll.h.

Member Data Documentation

◆ m_color_by_state

std::unique_ptr<ColorByState> TtyScroll::m_color_by_state
protected

Definition at line 126 of file tty_scroll.h.

◆ m_filter

NavmsgFilter TtyScroll::m_filter
protected

Definition at line 124 of file tty_scroll.h.

◆ m_is_paused

bool TtyScroll::m_is_paused
protected

Definition at line 125 of file tty_scroll.h.

◆ m_line_height

wxCoord TtyScroll::m_line_height
protected

Definition at line 119 of file tty_scroll.h.

◆ m_lines

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

Definition at line 123 of file tty_scroll.h.

◆ m_n_lines

size_t TtyScroll::m_n_lines
protected

Definition at line 120 of file tty_scroll.h.

◆ m_quick_filter

std::string TtyScroll::m_quick_filter
protected

Definition at line 127 of file tty_scroll.h.

◆ m_text_width

wxCoord TtyScroll::m_text_width
protected

Definition at line 121 of file tty_scroll.h.


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