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 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_TEMPLATEGetTemplate ()
 
void Select ()
 
void Unselect ()
 
void SetIsUserTemplate (bool aIsUser)
 Set whether this template widget represents a user template.
 
bool IsUserTemplate () const
 

Protected Member Functions

void OnKillFocus (wxFocusEvent &event)
 
void OnMouse (wxMouseEvent &event)
 
void OnDoubleClick (wxMouseEvent &event)
 
void onRightClick (wxMouseEvent &event)
 
void onEditTemplate (wxCommandEvent &event)
 
void onDuplicateTemplate (wxCommandEvent &event)
 

Protected Attributes

DIALOG_TEMPLATE_SELECTORm_dialog
 
wxWindow * m_parent
 
wxPanel * m_panel
 
bool m_selected
 
bool m_isUserTemplate
 
PROJECT_TEMPLATEm_currTemplate
 
wxStaticBitmap * m_bitmapIcon
 
wxStaticText * m_staticTitle
 

Private Member Functions

bool IsSelected ()
 

Detailed Description

Definition at line 38 of file dialog_template_selector.h.

Constructor & Destructor Documentation

◆ TEMPLATE_WIDGET()

Member Function Documentation

◆ GetTemplate()

PROJECT_TEMPLATE * TEMPLATE_WIDGET::GetTemplate ( )
inline

◆ IsSelected()

bool TEMPLATE_WIDGET::IsSelected ( )
inlineprivate

Definition at line 70 of file dialog_template_selector.h.

References m_selected.

◆ IsUserTemplate()

bool TEMPLATE_WIDGET::IsUserTemplate ( ) const
inline

Definition at line 59 of file dialog_template_selector.h.

References m_isUserTemplate.

◆ OnDoubleClick()

void TEMPLATE_WIDGET::OnDoubleClick ( wxMouseEvent & event)
protected

Definition at line 211 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 246 of file dialog_template_selector.cpp.

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

Referenced by onRightClick().

◆ OnKillFocus()

void TEMPLATE_WIDGET::OnKillFocus ( wxFocusEvent & event)
protected

◆ OnMouse()

void TEMPLATE_WIDGET::OnMouse ( wxMouseEvent & event)
protected

Definition at line 203 of file dialog_template_selector.cpp.

References Select().

Referenced by TEMPLATE_WIDGET().

◆ onRightClick()

void TEMPLATE_WIDGET::onRightClick ( wxMouseEvent & event)
protected

◆ Select()

void TEMPLATE_WIDGET::Select ( )

◆ SetIsUserTemplate()

void TEMPLATE_WIDGET::SetIsUserTemplate ( bool aIsUser)
inline

Set whether this template widget represents a user template.

Parameters
aIsUsertrue if this is a user template (can be edited/duplicated)

Definition at line 58 of file dialog_template_selector.h.

References m_isUserTemplate.

Referenced by DIALOG_TEMPLATE_SELECTOR::AddTemplate().

◆ 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 171 of file dialog_template_selector.cpp.

References PROJECT_TEMPLATE::GetIcon(), KIUI::GetInfoFont(), PROJECT_TEMPLATE::GetTitle(), icon_kicad, image, KiBitmap(), TEMPLATE_WIDGET_BASE::m_bitmapIcon, m_currTemplate, TEMPLATE_WIDGET_BASE::m_staticTitle, and scale.

Referenced by DIALOG_TEMPLATE_SELECTOR::AddTemplate().

◆ Unselect()

void TEMPLATE_WIDGET::Unselect ( )

Definition at line 162 of file dialog_template_selector.cpp.

References m_selected, TEMPLATE_WIDGET_BASE::m_staticTitle, and Refresh().

Referenced by TEMPLATE_WIDGET().

Member Data Documentation

◆ m_bitmapIcon

wxStaticBitmap* TEMPLATE_WIDGET_BASE::m_bitmapIcon
protectedinherited

◆ m_currTemplate

PROJECT_TEMPLATE* TEMPLATE_WIDGET::m_currTemplate
protected

◆ m_dialog

DIALOG_TEMPLATE_SELECTOR* TEMPLATE_WIDGET::m_dialog
protected

◆ m_isUserTemplate

bool TEMPLATE_WIDGET::m_isUserTemplate
protected

◆ m_panel

wxPanel* TEMPLATE_WIDGET::m_panel
protected

Definition at line 75 of file dialog_template_selector.h.

◆ m_parent

wxWindow* TEMPLATE_WIDGET::m_parent
protected

Definition at line 74 of file dialog_template_selector.h.

Referenced by TEMPLATE_WIDGET().

◆ m_selected

bool TEMPLATE_WIDGET::m_selected
protected

Definition at line 76 of file dialog_template_selector.h.

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

◆ m_staticTitle

wxStaticText* TEMPLATE_WIDGET_BASE::m_staticTitle
protectedinherited

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