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

#include <dialog_template_selector.h>

Inheritance diagram for TEMPLATE_WIDGET:
TEMPLATE_WIDGET_BASE

Public Types

enum class  CATEGORY { USER , SYSTEM , BROWSED }
 

Public Member Functions

 TEMPLATE_WIDGET (wxWindow *aParent, DIALOG_TEMPLATE_SELECTOR *aDialog)
 
void SetTemplate (PROJECT_TEMPLATE *aTemplate)
 Set the project template for this widget, which will determine the icon and title associated with this project template widget.
 
PROJECT_TEMPLATE * GetTemplate ()
 
wxString GetTemplatePath () const
 The template directory, the identity used for recent and pinned templates.
 
void SetPinned (bool aPinned)
 
bool IsPinned () const
 
void Select ()
 
void SelectWithoutStateChange ()
 
void Unselect ()
 
void SetDescription (const wxString &aDescription)
 
wxString GetDescription () const
 
void SetCategory (CATEGORY aCategory)
 
CATEGORY GetCategory () const
 
bool IsUserTemplate () const
 
bool IsSelected () const
 

Protected Member Functions

void OnMouse (wxMouseEvent &event)
 
void OnDoubleClick (wxMouseEvent &event)
 
void OnSize (wxSizeEvent &event)
 
void onRightClick (wxMouseEvent &event)
 
void onEditTemplate (wxCommandEvent &event)
 
void onOpenFolder (wxCommandEvent &event)
 
void onDuplicateTemplate (wxCommandEvent &event)
 
void onTogglePinned (wxCommandEvent &event)
 

Protected Attributes

DIALOG_TEMPLATE_SELECTOR * m_dialog
 
wxWindow * m_parent
 
wxPanel * m_panel
 
bool m_selected
 
bool m_pinned
 
CATEGORY m_category
 
wxString m_description
 
PROJECT_TEMPLATE * m_currTemplate
 
wxStaticBitmap * m_bitmapIcon
 
wxStaticText * m_titleLabel
 
wxStaticText * m_descLabel
 

Detailed Description

Definition at line 64 of file dialog_template_selector.h.

Member Enumeration Documentation

◆ CATEGORY

enum class TEMPLATE_WIDGET::CATEGORY
strong
Enumerator
USER 
SYSTEM 
BROWSED 

Definition at line 67 of file dialog_template_selector.h.

Constructor & Destructor Documentation

◆ TEMPLATE_WIDGET()

Member Function Documentation

◆ GetCategory()

CATEGORY TEMPLATE_WIDGET::GetCategory ( ) const
inline

Definition at line 98 of file dialog_template_selector.h.

References m_category.

◆ GetDescription()

wxString TEMPLATE_WIDGET::GetDescription ( ) const
inline

Definition at line 95 of file dialog_template_selector.h.

References m_description.

◆ GetTemplate()

PROJECT_TEMPLATE * TEMPLATE_WIDGET::GetTemplate ( )
inline

Definition at line 82 of file dialog_template_selector.h.

References m_currTemplate.

Referenced by DIALOG_TEMPLATE_SELECTOR::SetWidget().

◆ GetTemplatePath()

wxString TEMPLATE_WIDGET::GetTemplatePath ( ) const

The template directory, the identity used for recent and pinned templates.

Definition at line 257 of file dialog_template_selector.cpp.

References m_currTemplate.

Referenced by onTogglePinned().

◆ IsPinned()

bool TEMPLATE_WIDGET::IsPinned ( ) const
inline

Definition at line 88 of file dialog_template_selector.h.

References m_pinned.

◆ IsSelected()

bool TEMPLATE_WIDGET::IsSelected ( ) const
inline

Definition at line 115 of file dialog_template_selector.h.

References m_selected.

◆ IsUserTemplate()

bool TEMPLATE_WIDGET::IsUserTemplate ( ) const
inline

Definition at line 102 of file dialog_template_selector.h.

References m_category.

◆ OnDoubleClick()

void TEMPLATE_WIDGET::OnDoubleClick ( wxMouseEvent & event)
protected

Definition at line 327 of file dialog_template_selector.cpp.

References m_dialog, and Select().

Referenced by TEMPLATE_WIDGET().

◆ onDuplicateTemplate()

void TEMPLATE_WIDGET::onDuplicateTemplate ( wxCommandEvent & event)
protected

◆ onEditTemplate()

void TEMPLATE_WIDGET::onEditTemplate ( wxCommandEvent & event)
protected

Definition at line 378 of file dialog_template_selector.cpp.

References _, DisplayErrorMessage(), m_currTemplate, and m_dialog.

Referenced by onRightClick().

◆ OnMouse()

void TEMPLATE_WIDGET::OnMouse ( wxMouseEvent & event)
protected

Definition at line 320 of file dialog_template_selector.cpp.

References Select().

Referenced by TEMPLATE_WIDGET().

◆ onOpenFolder()

void TEMPLATE_WIDGET::onOpenFolder ( wxCommandEvent & event)
protected

Definition at line 411 of file dialog_template_selector.cpp.

References _, DisplayError(), and m_currTemplate.

Referenced by onRightClick().

◆ onRightClick()

void TEMPLATE_WIDGET::onRightClick ( wxMouseEvent & event)
protected

◆ OnSize()

void TEMPLATE_WIDGET::OnSize ( wxSizeEvent & event)
protected

Definition at line 294 of file dialog_template_selector.cpp.

References TEMPLATE_WIDGET_BASE::m_descLabel, and m_description.

Referenced by TEMPLATE_WIDGET().

◆ onTogglePinned()

void TEMPLATE_WIDGET::onTogglePinned ( wxCommandEvent & event)
protected

Definition at line 371 of file dialog_template_selector.cpp.

References GetTemplatePath(), m_currTemplate, m_dialog, and m_pinned.

Referenced by onRightClick().

◆ Select()

void TEMPLATE_WIDGET::Select ( )

◆ SelectWithoutStateChange()

void TEMPLATE_WIDGET::SelectWithoutStateChange ( )

◆ SetCategory()

void TEMPLATE_WIDGET::SetCategory ( CATEGORY aCategory)
inline

Definition at line 97 of file dialog_template_selector.h.

References m_category.

Referenced by DIALOG_TEMPLATE_SELECTOR::BuildTemplateList().

◆ SetDescription()

void TEMPLATE_WIDGET::SetDescription ( const wxString & aDescription)

◆ SetPinned()

void TEMPLATE_WIDGET::SetPinned ( bool aPinned)

◆ SetTemplate()

void TEMPLATE_WIDGET::SetTemplate ( PROJECT_TEMPLATE * aTemplate)

Set the project template for this widget, which will determine the icon and title associated with this project template widget.

Definition at line 218 of file dialog_template_selector.cpp.

References PROJECT_TEMPLATE::GetIcon(), KIUI::GetInfoFont(), PROJECT_TEMPLATE::GetTitle(), icon_kicad, KiBitmapBundleDef(), TEMPLATE_WIDGET_BASE::m_bitmapIcon, m_currTemplate, TEMPLATE_WIDGET_BASE::m_titleLabel, and scale.

Referenced by DIALOG_TEMPLATE_SELECTOR::BuildTemplateList().

◆ Unselect()

void TEMPLATE_WIDGET::Unselect ( )

Member Data Documentation

◆ m_bitmapIcon

wxStaticBitmap* TEMPLATE_WIDGET_BASE::m_bitmapIcon
protectedinherited

◆ m_category

CATEGORY TEMPLATE_WIDGET::m_category
protected

◆ m_currTemplate

◆ m_descLabel

◆ m_description

wxString TEMPLATE_WIDGET::m_description
protected

Definition at line 124 of file dialog_template_selector.h.

Referenced by GetDescription(), OnSize(), and SetDescription().

◆ m_dialog

◆ m_panel

wxPanel* TEMPLATE_WIDGET::m_panel
protected

Definition at line 120 of file dialog_template_selector.h.

◆ m_parent

wxWindow* TEMPLATE_WIDGET::m_parent
protected

Definition at line 119 of file dialog_template_selector.h.

Referenced by TEMPLATE_WIDGET().

◆ m_pinned

bool TEMPLATE_WIDGET::m_pinned
protected

◆ m_selected

bool TEMPLATE_WIDGET::m_selected
protected

Definition at line 121 of file dialog_template_selector.h.

Referenced by IsSelected(), Select(), SelectWithoutStateChange(), and Unselect().

◆ m_titleLabel


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