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

A wxAuiTabArt that renders editor tabs with preview/modified decorations. More...

#include <kicad_tab_art.h>

Inheritance diagram for KICAD_TAB_ART:

Public Types

using STATE_FN = std::function<TAB_VISUAL_STATE( wxWindow* )>
 Returns the current visual state for a page window.
 

Public Member Functions

 KICAD_TAB_ART (STATE_FN aProvider)
 
wxAuiTabArt * Clone () override
 
void DrawTab (wxDC &aDc, wxWindow *aWnd, const wxAuiNotebookPage &aPage, const wxRect &aInRect, int aCloseButtonState, wxRect *aOutTabRect, wxRect *aOutButtonRect, int *aXExtent) override
 
wxSize GetTabSize (wxDC &aDc, wxWindow *aWnd, const wxString &aCaption, const wxBitmapBundle &aBitmap, bool aActive, int aCloseButtonState, int *aXExtent) override
 

Private Member Functions

TAB_VISUAL_STATE stateFor (wxWindow *aPageWindow) const
 Visual state for a page, or a default if no provider is set.
 
wxFont decoratedFont (const TAB_VISUAL_STATE &aState, bool aActive) const
 The base caption font for a tab, styled italic for preview and bold for modified.
 

Private Attributes

STATE_FN m_stateFn
 

Detailed Description

A wxAuiTabArt that renders editor tabs with preview/modified decorations.

Per-page state comes from a caller callback keyed on the page window, since wxAuiNotebookPage has no slot for it.

Definition at line 48 of file kicad_tab_art.h.

Member Typedef Documentation

◆ STATE_FN

using KICAD_TAB_ART::STATE_FN = std::function<TAB_VISUAL_STATE( wxWindow* )>

Returns the current visual state for a page window.

Definition at line 52 of file kicad_tab_art.h.

Constructor & Destructor Documentation

◆ KICAD_TAB_ART()

KICAD_TAB_ART::KICAD_TAB_ART ( STATE_FN aProvider)
explicit

Definition at line 47 of file kicad_tab_art.cpp.

References m_stateFn, and move.

Referenced by Clone().

Member Function Documentation

◆ Clone()

wxAuiTabArt * KICAD_TAB_ART::Clone ( )
override

Definition at line 57 of file kicad_tab_art.cpp.

References KICAD_TAB_ART(), and m_stateFn.

◆ decoratedFont()

wxFont KICAD_TAB_ART::decoratedFont ( const TAB_VISUAL_STATE & aState,
bool aActive ) const
private

The base caption font for a tab, styled italic for preview and bold for modified.

Definition at line 72 of file kicad_tab_art.cpp.

References TAB_VISUAL_STATE::bold, and TAB_VISUAL_STATE::italic.

Referenced by DrawTab().

◆ DrawTab()

void KICAD_TAB_ART::DrawTab ( wxDC & aDc,
wxWindow * aWnd,
const wxAuiNotebookPage & aPage,
const wxRect & aInRect,
int aCloseButtonState,
wxRect * aOutTabRect,
wxRect * aOutButtonRect,
int * aXExtent )
override

Definition at line 126 of file kicad_tab_art.cpp.

References decoratedFont(), TAB_VISUAL_STATE::showAsterisk, and stateFor().

◆ GetTabSize()

wxSize KICAD_TAB_ART::GetTabSize ( wxDC & aDc,
wxWindow * aWnd,
const wxString & aCaption,
const wxBitmapBundle & aBitmap,
bool aActive,
int aCloseButtonState,
int * aXExtent )
override

Definition at line 154 of file kicad_tab_art.cpp.

◆ stateFor()

TAB_VISUAL_STATE KICAD_TAB_ART::stateFor ( wxWindow * aPageWindow) const
private

Visual state for a page, or a default if no provider is set.

Definition at line 63 of file kicad_tab_art.cpp.

References m_stateFn.

Referenced by DrawTab().

Member Data Documentation

◆ m_stateFn

STATE_FN KICAD_TAB_ART::m_stateFn
private

Definition at line 88 of file kicad_tab_art.h.

Referenced by Clone(), KICAD_TAB_ART(), and stateFor().


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