KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
PCB_DESIGN_BLOCK_PANE Class Reference

#include <pcb_design_block_pane.h>

Inheritance diagram for PCB_DESIGN_BLOCK_PANE:
DESIGN_BLOCK_PANE WX_PANEL

Public Member Functions

 PCB_DESIGN_BLOCK_PANE (PCB_EDIT_FRAME *aParent, const LIB_ID *aPreselect, std::vector< LIB_ID > &aHistoryList)
 
void OnCheckBox (wxCommandEvent &aEvent)
 
void UpdateCheckboxes ()
 
void OnSaveSheetAsDesignBlock (wxCommandEvent &aEvent)
 
void OnSaveSelectionAsDesignBlock (wxCommandEvent &aEvent)
 
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

void setLabelsAndTooltips () override
 
virtual void OnLanguageChanged (wxCommandEvent &aEvent)
 
void OnClosed (wxAuiManagerEvent &aEvent)
 

Protected Attributes

wxCheckBox * m_repeatedPlacement
 
wxCheckBox * m_placeAsGroup
 
wxCheckBox * m_keepAnnotations
 
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 39 of file pcb_design_block_pane.h.

Constructor & Destructor Documentation

◆ PCB_DESIGN_BLOCK_PANE()

Member Function Documentation

◆ AddDesignBlockLibrary()

◆ checkOverwrite()

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

Definition at line 456 of file design_block_pane.cpp.

References _, and OKOrCancelDialog().

Referenced by DESIGN_BLOCK_PANE::EditDesignBlockProperties().

◆ createNewDesignBlockLibrary()

◆ CreateNewDesignBlockLibrary()

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

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 DESIGN_BLOCK_PANE::createNewDesignBlockLibrary(), and DESIGN_BLOCK_PANE::selectDesignBlockLibTable().

◆ DeleteDesignBlockFromLibrary()

◆ DeleteDesignBlockLibrary()

◆ EditDesignBlockProperties()

◆ GetDesignBlock()

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

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(), DESIGN_BLOCK_PANE::m_frame, KIWAY_HOLDER::Prj(), IO_ERROR::What(), and UTF8::wx_str().

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

◆ GetDesignBlockPanel()

PANEL_DESIGN_BLOCK_CHOOSER * DESIGN_BLOCK_PANE::GetDesignBlockPanel ( ) const
inlineinherited

◆ GetSelectedDesignBlock()

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

◆ GetSelectedLibId()

◆ OnCheckBox()

void PCB_DESIGN_BLOCK_PANE::OnCheckBox ( wxCommandEvent &  aEvent)

◆ OnClosed()

void DESIGN_BLOCK_PANE::OnClosed ( wxAuiManagerEvent &  aEvent)
protectedinherited

◆ OnLanguageChanged()

void DESIGN_BLOCK_PANE::OnLanguageChanged ( wxCommandEvent &  aEvent)
protectedvirtualinherited

◆ OnPaint()

◆ OnSaveSelectionAsDesignBlock()

void PCB_DESIGN_BLOCK_PANE::OnSaveSelectionAsDesignBlock ( wxCommandEvent &  aEvent)

◆ OnSaveSheetAsDesignBlock()

void PCB_DESIGN_BLOCK_PANE::OnSaveSheetAsDesignBlock ( wxCommandEvent &  aEvent)

◆ RefreshLibs()

◆ SaveSettings()

void DESIGN_BLOCK_PANE::SaveSettings ( )
inherited

◆ selectDesignBlockLibTable()

◆ 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()

void PCB_DESIGN_BLOCK_PANE::setLabelsAndTooltips ( )
overrideprotectedvirtual

◆ UpdateCheckboxes()

void PCB_DESIGN_BLOCK_PANE::UpdateCheckboxes ( )

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_keepAnnotations

wxCheckBox* PCB_DESIGN_BLOCK_PANE::m_keepAnnotations
protected

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

wxCheckBox* PCB_DESIGN_BLOCK_PANE::m_placeAsGroup
protected

◆ m_repeatedPlacement

wxCheckBox* PCB_DESIGN_BLOCK_PANE::m_repeatedPlacement
protected

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