KiCad PCB EDA Suite
|
#include <design_block_pane.h>
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_BLOCK * | GetDesignBlock (const LIB_ID &aLibId, bool aUseCacheLib, bool aShowErrorMsg) |
Load design block from design block library table. | |
DESIGN_BLOCK * | GetSelectedDesignBlock (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_CHOOSER * | GetDesignBlockPanel () 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_FRAME * | m_frame = nullptr |
PANEL_DESIGN_BLOCK_CHOOSER * | m_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 |
Definition at line 38 of file design_block_pane.h.
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().
|
override |
Definition at line 54 of file design_block_pane.cpp.
References m_frame, OnClosed(), and OnLanguageChanged().
bool DESIGN_BLOCK_PANE::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).
Definition at line 222 of file design_block_pane.cpp.
References _, PROJECT::DesignBlockLibTblName(), DisplayError(), DESIGN_BLOCK_IO_MGR::FILE_TYPE_NONE, DESIGN_BLOCK_LIB_TABLE::GetGlobalLibTable(), DESIGN_BLOCK_LIB_TABLE::GetGlobalTableFileName(), DESIGN_BLOCK_IO_MGR::GuessPluginTypeFromLibPath(), LIB_TABLE::InsertRow(), DESIGN_BLOCK_IO_MGR::KICAD_SEXP, FILEEXT::KiCadDesignBlockLibPathExtension, m_frame, NormalizePath(), Pgm(), KIWAY_HOLDER::Prj(), RefreshLibs(), LIB_TABLE::Save(), SelectLibId(), DESIGN_BLOCK_IO_MGR::ShowType(), and IO_ERROR::What().
Referenced by createNewDesignBlockLibrary().
|
private |
Definition at line 418 of file design_block_pane.cpp.
References _, and OKOrCancelDialog().
Referenced by EditDesignBlockProperties().
wxString DESIGN_BLOCK_PANE::CreateNewDesignBlockLibrary | ( | const wxString & | aDialogTitle | ) |
Creates a new design block library.
Definition at line 143 of file design_block_pane.cpp.
References createNewDesignBlockLibrary().
|
private |
Definition at line 149 of file design_block_pane.cpp.
References _, AddDesignBlockLibrary(), PROJECT::DesignBlockLibs(), DisplayError(), KIDIALOG::DoNotShowCheckbox(), DESIGN_BLOCK_IO_MGR::FindPlugin(), DESIGN_BLOCK_LIB_TABLE::GetGlobalLibTable(), FILEDLG_HOOK_NEW_LIBRARY::GetUseGlobalTable(), DESIGN_BLOCK_IO_MGR::KICAD_SEXP, FILEEXT::KiCadDesignBlockLibPathExtension, FILEEXT::KiCadDesignBlockLibPathWildcard(), EDA_DRAW_FRAME::LibraryFileBrowser(), m_frame, KIWAY_HOLDER::Prj(), EDA_BASE_FRAME::ShowInfoBarError(), KIDIALOG::ShowModal(), and IO_ERROR::What().
Referenced by CreateNewDesignBlockLibrary().
bool DESIGN_BLOCK_PANE::DeleteDesignBlockFromLibrary | ( | const LIB_ID & | aLibId, |
bool | aConfirm | ||
) |
Definition at line 319 of file design_block_pane.cpp.
References _, DESIGN_BLOCK_LIB_TABLE::DesignBlockDelete(), PROJECT::DesignBlockLibs(), DisplayError(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), DESIGN_BLOCK_LIB_TABLE::IsDesignBlockLibWritable(), IsOK(), LIB_ID::IsValid(), m_frame, KIWAY_HOLDER::Prj(), RefreshLibs(), EDA_BASE_FRAME::ShowInfoBarError(), and IO_ERROR::What().
bool DESIGN_BLOCK_PANE::DeleteDesignBlockLibrary | ( | const wxString & | aLibName, |
bool | aConfirm | ||
) |
Definition at line 277 of file design_block_pane.cpp.
References _, DESIGN_BLOCK_LIB_TABLE::DesignBlockLibDelete(), PROJECT::DesignBlockLibs(), DisplayError(), DisplayErrorMessage(), DESIGN_BLOCK_LIB_TABLE::IsDesignBlockLibWritable(), IsOK(), m_frame, KIWAY_HOLDER::Prj(), RefreshLibs(), EDA_BASE_FRAME::ShowInfoBarError(), and IO_ERROR::What().
bool DESIGN_BLOCK_PANE::EditDesignBlockProperties | ( | const LIB_ID & | aLibId | ) |
Definition at line 361 of file design_block_pane.cpp.
References _, checkOverwrite(), DESIGN_BLOCK_LIB_TABLE::DesignBlockDelete(), DESIGN_BLOCK_LIB_TABLE::DesignBlockExists(), PROJECT::DesignBlockLibs(), DESIGN_BLOCK_LIB_TABLE::DesignBlockSave(), DisplayError(), GetDesignBlock(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), DESIGN_BLOCK_LIB_TABLE::IsDesignBlockLibWritable(), LIB_ID::IsValid(), m_frame, KIWAY_HOLDER::Prj(), RefreshLibs(), SelectLibId(), EDA_BASE_FRAME::ShowInfoBarError(), DIALOG_SHIM::ShowModal(), and IO_ERROR::What().
DESIGN_BLOCK * DESIGN_BLOCK_PANE::GetDesignBlock | ( | const LIB_ID & | aLibId, |
bool | aUseCacheLib, | ||
bool | aShowErrorMsg | ||
) |
Load design block from design block library table.
aLibId | is the design block library identifier to load. |
aUseCacheLib | set to true to fall back to cache library if design block is not found in design block library table. |
aShowErrorMessage | set to true to show any error messages. |
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().
|
inline |
Definition at line 87 of file design_block_pane.h.
References m_chooserPanel.
Referenced by DESIGN_BLOCK_CONTROL::getCurrentTreeNode().
DESIGN_BLOCK * DESIGN_BLOCK_PANE::GetSelectedDesignBlock | ( | bool | aUseCacheLib, |
bool | aShowErrorMsg | ||
) |
Definition at line 134 of file design_block_pane.cpp.
References GetDesignBlock(), and GetSelectedLibId().
LIB_ID DESIGN_BLOCK_PANE::GetSelectedLibId | ( | int * | aUnit = nullptr | ) | const |
Definition at line 90 of file design_block_pane.cpp.
References PANEL_DESIGN_BLOCK_CHOOSER::GetSelectedLibId(), and m_chooserPanel.
Referenced by PCB_CONTROL::AppendDesignBlock(), GetSelectedDesignBlock(), DESIGN_BLOCK_CONTROL::getSelectedLibId(), PCB_DESIGN_BLOCK_CONTROL::getSelectedLibId(), SCH_DRAWING_TOOLS::ImportSheet(), PCB_EDIT_FRAME::SaveBoardAsDesignBlock(), PCB_EDIT_FRAME::SaveBoardToDesignBlock(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), PCB_EDIT_FRAME::SaveSelectionAsDesignBlock(), and SCH_EDIT_FRAME::SaveSheetAsDesignBlock().
|
protected |
Definition at line 72 of file design_block_pane.cpp.
References EDA_BASE_FRAME::config(), m_frame, and EDA_DRAW_FRAME::SaveSettings().
Referenced by DESIGN_BLOCK_PANE(), and ~DESIGN_BLOCK_PANE().
|
protectedvirtual |
Definition at line 61 of file design_block_pane.cpp.
References m_chooserPanel, setLabelsAndTooltips(), and PANEL_DESIGN_BLOCK_CHOOSER::ShowChangedLanguage().
Referenced by DESIGN_BLOCK_PANE(), and ~DESIGN_BLOCK_PANE().
|
privateinherited |
Definition at line 47 of file wx_panel.cpp.
References WX_PANEL::m_borderColor, WX_PANEL::m_bottomBorder, WX_PANEL::m_leftBorder, WX_PANEL::m_rightBorder, WX_PANEL::m_topBorder, KIGFX::COLOR4D::Mix(), KIGFX::COLOR4D::ToColour(), and KIGFX::COLOR4D::UNSPECIFIED.
Referenced by WX_PANEL::WX_PANEL(), and WX_PANEL::~WX_PANEL().
void DESIGN_BLOCK_PANE::RefreshLibs | ( | ) |
Definition at line 102 of file design_block_pane.cpp.
References m_chooserPanel, and PANEL_DESIGN_BLOCK_CHOOSER::RefreshLibs().
Referenced by AddDesignBlockLibrary(), DeleteDesignBlockFromLibrary(), DeleteDesignBlockLibrary(), EditDesignBlockProperties(), SCH_EDIT_FRAME::KiwayMailIn(), PCB_EDIT_FRAME::KiwayMailIn(), DESIGN_BLOCK_CONTROL::PinLibrary(), PCB_EDIT_FRAME::SaveBoardAsDesignBlock(), PCB_EDIT_FRAME::SaveBoardToDesignBlock(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_EDIT_FRAME::SaveSelectionToDesignBlock(), PCB_EDIT_FRAME::saveSelectionToDesignBlock(), SCH_EDIT_FRAME::SaveSheetAsDesignBlock(), SCH_EDIT_FRAME::SaveSheetToDesignBlock(), and DESIGN_BLOCK_CONTROL::UnpinLibrary().
void DESIGN_BLOCK_PANE::SaveSettings | ( | ) |
Definition at line 84 of file design_block_pane.cpp.
References m_chooserPanel, and PANEL_DESIGN_BLOCK_CHOOSER::SaveSettings().
Referenced by SCH_EDIT_FRAME::SaveSettings(), and PCB_EDIT_FRAME::SaveSettings().
void DESIGN_BLOCK_PANE::SelectLibId | ( | const LIB_ID & | aLibId | ) |
Definition at line 96 of file design_block_pane.cpp.
References m_chooserPanel, and PANEL_DESIGN_BLOCK_CHOOSER::SelectLibId().
Referenced by AddDesignBlockLibrary(), EditDesignBlockProperties(), SCH_EDITOR_CONTROL::PlaceLinkedDesignBlock(), PCB_EDIT_FRAME::SaveBoardAsDesignBlock(), PCB_EDIT_FRAME::SaveBoardToDesignBlock(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_EDIT_FRAME::SaveSelectionToDesignBlock(), PCB_EDIT_FRAME::saveSelectionToDesignBlock(), SCH_EDIT_FRAME::SaveSheetAsDesignBlock(), SCH_EDIT_FRAME::SaveSheetToDesignBlock(), SCH_EDITOR_CONTROL::SaveToLinkedDesignBlock(), and PCB_CONTROL::SaveToLinkedDesignBlock().
|
inlineinherited |
Definition at line 47 of file wx_panel.h.
References WX_PANEL::m_borderColor.
Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::ShowPreview().
|
inlineinherited |
Definition at line 39 of file wx_panel.h.
References WX_PANEL::m_bottomBorder, WX_PANEL::m_leftBorder, WX_PANEL::m_rightBorder, and WX_PANEL::m_topBorder.
Referenced by APPEARANCE_CONTROLS::APPEARANCE_CONTROLS(), APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D(), PAGED_DIALOG::PAGED_DIALOG(), PANEL_COLOR_SETTINGS::PANEL_COLOR_SETTINGS(), PANEL_PACKAGES_VIEW::PANEL_PACKAGES_VIEW(), PANEL_SCH_SELECTION_FILTER::PANEL_SCH_SELECTION_FILTER(), PANEL_SELECTION_FILTER::PANEL_SELECTION_FILTER(), PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP(), PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::PANEL_SETUP_TIME_DOMAIN_PARAMETERS(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::ShowPreview().
|
protectedpure virtual |
Implemented in SCH_DESIGN_BLOCK_PANE, and PCB_DESIGN_BLOCK_PANE.
Referenced by OnLanguageChanged().
|
privateinherited |
Definition at line 61 of file wx_panel.h.
Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorderColor().
|
privateinherited |
Definition at line 59 of file wx_panel.h.
Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().
|
protected |
Definition at line 96 of file design_block_pane.h.
Referenced by GetDesignBlockPanel(), GetSelectedLibId(), OnLanguageChanged(), PCB_DESIGN_BLOCK_PANE::PCB_DESIGN_BLOCK_PANE(), RefreshLibs(), SaveSettings(), SCH_DESIGN_BLOCK_PANE::SCH_DESIGN_BLOCK_PANE(), and SelectLibId().
|
protected |
Definition at line 95 of file design_block_pane.h.
Referenced by AddDesignBlockLibrary(), createNewDesignBlockLibrary(), DeleteDesignBlockFromLibrary(), DeleteDesignBlockLibrary(), DESIGN_BLOCK_PANE(), EditDesignBlockProperties(), GetDesignBlock(), OnClosed(), SCH_DESIGN_BLOCK_PANE::SCH_DESIGN_BLOCK_PANE(), and ~DESIGN_BLOCK_PANE().
|
privateinherited |
Definition at line 56 of file wx_panel.h.
Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().
|
privateinherited |
Definition at line 57 of file wx_panel.h.
Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().
|
privateinherited |
Definition at line 58 of file wx_panel.h.
Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().