KiCad PCB EDA Suite
Loading...
Searching...
No Matches
HYPERLINK_DV_RENDERER Class Reference

wxDataViewCtrl renderer that draws [label](url) markup as clickable link runs inline with plain text. More...

#include <wx_data_view_hyperlink_renderer.h>

Inheritance diagram for HYPERLINK_DV_RENDERER:

Classes

struct  RUN
 

Public Member Functions

 HYPERLINK_DV_RENDERER ()
 
bool SetValue (const wxVariant &aValue) override
 
bool GetValue (wxVariant &aValue) const override
 
wxSize GetSize () const override
 
bool Render (wxRect aCell, wxDC *aDC, int aState) override
 
bool HitTestRunsForCell (const wxString &aValue, const wxRect &aCell, const wxPoint &aPoint, wxString *aHref) const
 Hit-test aPoint against the link runs of aValue laid out in aCell.
 

Static Public Member Functions

static void ParseRuns (const wxString &aValue, std::vector< RUN > &aRuns)
 Split aValue into plain text and link runs.
 
static bool IsSafeUrl (const wxString &aHref)
 Accept only schemes that wxLaunchDefaultBrowser cannot turn into program execution.
 
static wxString StripMarkup (const wxString &aValue)
 Flatten [label](url) markup, keeping just the label.
 

Private Attributes

wxString m_value
 
std::vector< RUNm_runs
 
wxFont m_renderFont
 

Detailed Description

wxDataViewCtrl renderer that draws [label](url) markup as clickable link runs inline with plain text.

Definition at line 35 of file wx_data_view_hyperlink_renderer.h.

Constructor & Destructor Documentation

◆ HYPERLINK_DV_RENDERER()

HYPERLINK_DV_RENDERER::HYPERLINK_DV_RENDERER ( )

Definition at line 168 of file wx_data_view_hyperlink_renderer.cpp.

Member Function Documentation

◆ GetSize()

wxSize HYPERLINK_DV_RENDERER::GetSize ( ) const
override

Definition at line 189 of file wx_data_view_hyperlink_renderer.cpp.

References m_runs, and m_value.

◆ GetValue()

bool HYPERLINK_DV_RENDERER::GetValue ( wxVariant & aValue) const
override

Definition at line 182 of file wx_data_view_hyperlink_renderer.cpp.

References m_value.

◆ HitTestRunsForCell()

bool HYPERLINK_DV_RENDERER::HitTestRunsForCell ( const wxString & aValue,
const wxRect & aCell,
const wxPoint & aPoint,
wxString * aHref ) const

Hit-test aPoint against the link runs of aValue laid out in aCell.

Definition at line 263 of file wx_data_view_hyperlink_renderer.cpp.

References m_renderFont, and ParseRuns().

◆ IsSafeUrl()

bool HYPERLINK_DV_RENDERER::IsSafeUrl ( const wxString & aHref)
static

Accept only schemes that wxLaunchDefaultBrowser cannot turn into program execution.

Definition at line 85 of file wx_data_view_hyperlink_renderer.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and ParseRuns().

◆ ParseRuns()

◆ Render()

bool HYPERLINK_DV_RENDERER::Render ( wxRect aCell,
wxDC * aDC,
int aState )
override

Definition at line 212 of file wx_data_view_hyperlink_renderer.cpp.

References m_renderFont, and m_runs.

◆ SetValue()

bool HYPERLINK_DV_RENDERER::SetValue ( const wxVariant & aValue)
override

Definition at line 174 of file wx_data_view_hyperlink_renderer.cpp.

References m_runs, m_value, and ParseRuns().

◆ StripMarkup()

wxString HYPERLINK_DV_RENDERER::StripMarkup ( const wxString & aValue)
static

Member Data Documentation

◆ m_renderFont

wxFont HYPERLINK_DV_RENDERER::m_renderFont
private

Definition at line 68 of file wx_data_view_hyperlink_renderer.h.

Referenced by HitTestRunsForCell(), and Render().

◆ m_runs

std::vector<RUN> HYPERLINK_DV_RENDERER::m_runs
private

Definition at line 67 of file wx_data_view_hyperlink_renderer.h.

Referenced by GetSize(), Render(), and SetValue().

◆ m_value

wxString HYPERLINK_DV_RENDERER::m_value
private

Definition at line 66 of file wx_data_view_hyperlink_renderer.h.

Referenced by GetSize(), GetValue(), and SetValue().


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