OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
TextRenderer Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/ExtraRenderers.hpp>

Inheritance diagram for TextRenderer:
Collaboration diagram for TextRenderer:

Public Member Functions

 TextRenderer (wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL)
bool SetValue (const wxVariant &value) override
bool GetValue (wxVariant &value) const override
virtual bool Render (wxRect cell, wxDC *dc, int state) override
virtual wxSize GetSize () const override
bool HasEditorCtrl () const override

Private Attributes

wxString m_value

Detailed Description

Constructor & Destructor Documentation

◆ TextRenderer()

TextRenderer::TextRenderer ( wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL )
inline
190 : wxDataViewCustomRenderer(wxT("string"), mode, align) {}

Member Function Documentation

◆ GetSize()

wxSize TextRenderer::GetSize ( ) const
overridevirtual
414{
415 return GetTextExtent(m_value);
416}
wxString m_value
Definition ExtraRenderers.hpp:201

References m_value.

◆ GetValue()

bool TextRenderer::GetValue ( wxVariant & value) const
override
397{
398 return false;
399}

◆ HasEditorCtrl()

bool TextRenderer::HasEditorCtrl ( ) const
inlineoverride
198{ return false; }

◆ Render()

bool TextRenderer::Render ( wxRect cell,
wxDC * dc,
int state )
overridevirtual
402{
403#ifdef _WIN32
404 // workaround for Windows DarkMode : Don't respect to the state & wxDATAVIEW_CELL_SELECTED to avoid update of the text color
405 RenderText(m_value, 0, rect, dc, state & wxDATAVIEW_CELL_SELECTED ? 0 : state);
406#else
407 RenderText(m_value, 0, rect, dc, state);
408#endif
409
410 return true;
411}

References m_value.

◆ SetValue()

bool TextRenderer::SetValue ( const wxVariant & value)
override
391{
392 m_value = value.GetString();
393 return true;
394}

References m_value.

Member Data Documentation

◆ m_value

wxString TextRenderer::m_value
private

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


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