KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DESIGN_BLOCK_PANE Class Referenceabstract

#include <design_block_pane.h>

Inheritance diagram for DESIGN_BLOCK_PANE:
WX_PANEL PCB_DESIGN_BLOCK_PANE SCH_DESIGN_BLOCK_PANE

Public Member Functions

 DESIGN_BLOCK_PANE (EDA_DRAW_FRAME *aParent, const LIB_ID *aPreselect, std::vector< LIB_ID > &aHistoryList)
 
 ~DESIGN_BLOCK_PANE () override
 
void SaveSettings ()
 
LIB_ID GetSelectedLibId (int *aUnit=nullptr) const
 
void SelectLibId (const LIB_ID &aLibId)
 
DESIGN_BLOCKGetDesignBlock (const LIB_ID &aLibId, bool aUseCacheLib, bool aShowErrorMsg)
 Load design block from design block library table.
 
DESIGN_BLOCKGetSelectedDesignBlock (bool aUseCacheLib, bool aShowErrorMsg)
 
void RefreshLibs ()
 
wxString CreateNewDesignBlockLibrary (const wxString &aDialogTitle)
 Creates a new design block library.
 
bool AddDesignBlockLibrary (const wxString &aDialogTitle, const wxString &aFilename, DESIGN_BLOCK_LIB_TABLE *aTable)
 Add an existing library to a library table (presumed to be either the global or project design block table).
 
bool DeleteDesignBlockLibrary (const wxString &aLibName, bool aConfirm)
 
bool DeleteDesignBlockFromLibrary (const LIB_ID &aLibId, bool aConfirm)
 
bool EditDesignBlockProperties (const LIB_ID &aLibId)
 
PANEL_DESIGN_BLOCK_CHOOSERGetDesignBlockPanel () const
 
void SetBorders (bool aLeft, bool aRight, bool aTop, bool aBottom)
 
void SetBorderColor (const KIGFX::COLOR4D &aColor)
 

Protected Member Functions

virtual void setLabelsAndTooltips ()=0
 
virtual void OnLanguageChanged (wxCommandEvent &aEvent)
 
void OnClosed (wxAuiManagerEvent &aEvent)
 

Protected Attributes

EDA_DRAW_FRAMEm_frame = nullptr
 
PANEL_DESIGN_BLOCK_CHOOSERm_chooserPanel = nullptr
 

Private Member Functions

bool checkOverwrite (wxWindow *aFrame, wxString &libname, wxString &newName)
 
wxString createNewDesignBlockLibrary (const wxString &aDialogTitle)
 
void OnPaint (wxPaintEvent &event)
 

Private Attributes

bool m_leftBorder
 
bool m_rightBorder
 
bool m_topBorder
 
bool m_bottomBorder
 
KIGFX::COLOR4D m_borderColor
 

Detailed Description

Definition at line 38 of file design_block_pane.h.

Constructor & Destructor Documentation

◆ DESIGN_BLOCK_PANE()

DESIGN_BLOCK_PANE::DESIGN_BLOCK_PANE ( EDA_DRAW_FRAME aParent,
const LIB_ID aPreselect,
std::vector< LIB_ID > &  aHistoryList 
)

Definition at line 44 of file design_block_pane.cpp.

References m_frame, OnClosed(), and OnLanguageChanged().

◆ ~DESIGN_BLOCK_PANE()

DESIGN_BLOCK_PANE::~DESIGN_BLOCK_PANE ( )
override

Definition at line 54 of file design_block_pane.cpp.

References m_frame, OnClosed(), and OnLanguageChanged().

Member Function Documentation

◆ AddDesignBlockLibrary()

bool DESIGN_BLOCK_PANE::AddDesignBlockLibrary ( const wxString &  aDialogTitle,
const wxString &  aFilename,
DESIGN_BLOCK_LIB_TABLE aTable 
)

◆ checkOverwrite()

bool DESIGN_BLOCK_PANE::checkOverwrite ( wxWindow *  aFrame,
wxString &  libname,
wxString &  newName 
)
private

Definition at line 418 of file design_block_pane.cpp.

References _, and OKOrCancelDialog().

Referenced by EditDesignBlockProperties().

◆ CreateNewDesignBlockLibrary()

wxString DESIGN_BLOCK_PANE::CreateNewDesignBlockLibrary ( const wxString &  aDialogTitle)

Creates a new design block library.

Returns
The newly created library path if library was successfully created, else wxEmptyString because user aborted or error.

Definition at line 143 of file design_block_pane.cpp.

References createNewDesignBlockLibrary().

◆ createNewDesignBlockLibrary()

◆ DeleteDesignBlockFromLibrary()

◆ DeleteDesignBlockLibrary()

◆ EditDesignBlockProperties()

◆ GetDesignBlock()

DESIGN_BLOCK * DESIGN_BLOCK_PANE::GetDesignBlock ( const LIB_ID aLibId,
bool  aUseCacheLib,
bool  aShowErrorMsg 
)

Load design block from design block library table.

Parameters
aLibIdis the design block library identifier to load.
aUseCacheLibset to true to fall back to cache library if design block is not found in design block library table.
aShowErrorMessageset to true to show any error messages.
Returns
The design block found in the library or NULL if the design block was not found.

Definition at line 108 of file design_block_pane.cpp.

References _, PROJECT::DesignBlockLibs(), DESIGN_BLOCK_LIB_TABLE::DesignBlockLoadWithOptionalNickname(), DisplayErrorMessage(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), m_frame, KIWAY_HOLDER::Prj(), IO_ERROR::What(), and UTF8::wx_str().

Referenced by PCB_CONTROL::AppendDesignBlock(), EditDesignBlockProperties(), GetSelectedDesignBlock(), SCH_DRAWING_TOOLS::ImportSheet(), PANEL_DESIGN_BLOCK_CHOOSER::onDesignBlockSelected(), SCH_EDITOR_CONTROL::PlaceLinkedDesignBlock(), PCB_CONTROL::PlaceLinkedDesignBlock(), SCH_EDITOR_CONTROL::SaveToLinkedDesignBlock(), and PCB_CONTROL::SaveToLinkedDesignBlock().

◆ GetDesignBlockPanel()

PANEL_DESIGN_BLOCK_CHOOSER * DESIGN_BLOCK_PANE::GetDesignBlockPanel ( ) const
inline

Definition at line 87 of file design_block_pane.h.

References m_chooserPanel.

Referenced by DESIGN_BLOCK_CONTROL::getCurrentTreeNode().

◆ GetSelectedDesignBlock()

DESIGN_BLOCK * DESIGN_BLOCK_PANE::GetSelectedDesignBlock ( bool  aUseCacheLib,
bool  aShowErrorMsg 
)

Definition at line 134 of file design_block_pane.cpp.

References GetDesignBlock(), and GetSelectedLibId().

◆ GetSelectedLibId()

◆ OnClosed()

void DESIGN_BLOCK_PANE::OnClosed ( wxAuiManagerEvent &  aEvent)
protected

◆ OnLanguageChanged()

void DESIGN_BLOCK_PANE::OnLanguageChanged ( wxCommandEvent &  aEvent)
protectedvirtual

◆ OnPaint()

◆ RefreshLibs()

◆ SaveSettings()

void DESIGN_BLOCK_PANE::SaveSettings ( )

◆ SelectLibId()

◆ SetBorderColor()

void WX_PANEL::SetBorderColor ( const KIGFX::COLOR4D aColor)
inlineinherited

Definition at line 47 of file wx_panel.h.

References WX_PANEL::m_borderColor.

Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::ShowPreview().

◆ SetBorders()

◆ setLabelsAndTooltips()

virtual void DESIGN_BLOCK_PANE::setLabelsAndTooltips ( )
protectedpure virtual

Member Data Documentation

◆ m_borderColor

KIGFX::COLOR4D WX_PANEL::m_borderColor
privateinherited

Definition at line 61 of file wx_panel.h.

Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorderColor().

◆ m_bottomBorder

bool WX_PANEL::m_bottomBorder
privateinherited

Definition at line 59 of file wx_panel.h.

Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().

◆ m_chooserPanel

◆ m_frame

◆ m_leftBorder

bool WX_PANEL::m_leftBorder
privateinherited

Definition at line 56 of file wx_panel.h.

Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().

◆ m_rightBorder

bool WX_PANEL::m_rightBorder
privateinherited

Definition at line 57 of file wx_panel.h.

Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().

◆ m_topBorder

bool WX_PANEL::m_topBorder
privateinherited

Definition at line 58 of file wx_panel.h.

Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().


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