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.
 
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 75 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 148 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 165 of file tty_scroll.cpp.

◆ CopyToClipboard()

void TtyScroll::CopyToClipboard ( ) const

Copy message contents to clipboard.


Definition at line 197 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 109 of file tty_scroll.cpp.

◆ GetFilter()

const NavmsgFilter & TtyScroll::GetFilter ( )
inline

Return current display filter.

Definition at line 103 of file tty_scroll.h.

◆ OnDraw()

void TtyScroll::OnDraw ( wxDC &  dc)
protectedvirtual

Definition at line 177 of file tty_scroll.cpp.

◆ OnSize()

void TtyScroll::OnSize ( wxSizeEvent &  event)
protected

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

◆ SetColors()

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

Set color scheme.

Definition at line 173 of file tty_scroll.cpp.

◆ SetFilter()

void TtyScroll::SetFilter ( const NavmsgFilter filter)
inline

Apply a display filter.

Definition at line 100 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 106 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 119 of file tty_scroll.h.

◆ m_filter

NavmsgFilter TtyScroll::m_filter
protected

Definition at line 117 of file tty_scroll.h.

◆ m_is_paused

bool TtyScroll::m_is_paused
protected

Definition at line 118 of file tty_scroll.h.

◆ m_line_height

wxCoord TtyScroll::m_line_height
protected

Definition at line 112 of file tty_scroll.h.

◆ m_lines

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

Definition at line 116 of file tty_scroll.h.

◆ m_n_lines

size_t TtyScroll::m_n_lines
protected

Definition at line 113 of file tty_scroll.h.

◆ m_quick_filter

std::string TtyScroll::m_quick_filter
protected

Definition at line 120 of file tty_scroll.h.

◆ m_text_width

wxCoord TtyScroll::m_text_width
protected

Definition at line 114 of file tty_scroll.h.


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