KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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 &aLibName=wxEmptyString, const wxString &aProposedName=wxEmptyString)
 If a library name is given, creates a new design block library in the project folder with the given name.
 
bool AddDesignBlockLibrary (const wxString &aFilename, DESIGN_BLOCK_LIB_TABLE *aTable)
 Add an existing library to either the global or project library 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)
 
DESIGN_BLOCK_LIB_TABLEselectDesignBlockLibTable (bool aOptional=false)
 
wxString createNewDesignBlockLibrary (const wxString &aLibName, const wxString &aProposedName, DESIGN_BLOCK_LIB_TABLE *aTable)
 
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 47 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 55 of file design_block_pane.cpp.

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

Member Function Documentation

◆ AddDesignBlockLibrary()

◆ checkOverwrite()

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

Definition at line 456 of file design_block_pane.cpp.

References _, and OKOrCancelDialog().

Referenced by EditDesignBlockProperties().

◆ createNewDesignBlockLibrary()

◆ CreateNewDesignBlockLibrary()

wxString DESIGN_BLOCK_PANE::CreateNewDesignBlockLibrary ( const wxString &  aLibName = wxEmptyString,
const wxString &  aProposedName = wxEmptyString 
)

If a library name is given, creates a new design block library in the project folder with the given name.

If no library name is given it prompts user for a library path, then creates a new design block library at that location. If library exists, user is warned about that, and is given a chance to abort the new creation, and in that case existing library is first deleted.

Parameters
aProposedNameis the initial path and filename shown in the file chooser dialog.
Returns
The newly created library path if library was successfully created, else wxEmptyString because user aborted or error.

Definition at line 144 of file design_block_pane.cpp.

References createNewDesignBlockLibrary(), and selectDesignBlockLibTable().

◆ 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 109 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(), and PANEL_DESIGN_BLOCK_CHOOSER::onDesignBlockSelected().

◆ GetDesignBlockPanel()

PANEL_DESIGN_BLOCK_CHOOSER * DESIGN_BLOCK_PANE::GetDesignBlockPanel ( ) const
inline

Definition at line 92 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 135 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 ( )

◆ selectDesignBlockLibTable()

DESIGN_BLOCK_LIB_TABLE * DESIGN_BLOCK_PANE::selectDesignBlockLibTable ( bool  aOptional = false)
private

◆ 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: