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 &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_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) |
DESIGN_BLOCK_LIB_TABLE * | selectDesignBlockLibTable (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 |
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 47 of file design_block_pane.cpp.
References m_frame, OnClosed(), and OnLanguageChanged().
|
override |
Definition at line 55 of file design_block_pane.cpp.
References m_frame, OnClosed(), and OnLanguageChanged().
bool DESIGN_BLOCK_PANE::AddDesignBlockLibrary | ( | const wxString & | aFilename, |
DESIGN_BLOCK_LIB_TABLE * | aTable | ||
) |
Add an existing library to either the global or project library table.
aFileName | the library to add; a file open dialog will be displayed if empty. |
Definition at line 245 of file design_block_pane.cpp.
References _, PROJECT::DesignBlockLibs(), PROJECT::DesignBlockLibTblName(), DisplayError(), DESIGN_BLOCK_IO_MGR::FILE_TYPE_NONE, PATHS::GetDefaultUserDesignBlocksPath(), 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, FILEEXT::KiCadDesignBlockLibPathWildcard(), EDA_DRAW_FRAME::LibraryFileBrowser(), m_frame, NormalizePath(), Pgm(), KIWAY_HOLDER::Prj(), RefreshLibs(), LIB_TABLE::Save(), selectDesignBlockLibTable(), SelectLibId(), DESIGN_BLOCK_IO_MGR::ShowType(), and IO_ERROR::What().
Referenced by createNewDesignBlockLibrary().
|
private |
Definition at line 456 of file design_block_pane.cpp.
References _, and OKOrCancelDialog().
Referenced by EditDesignBlockProperties().
|
private |
Definition at line 150 of file design_block_pane.cpp.
References _, AddDesignBlockLibrary(), DisplayError(), KIDIALOG::DoNotShowCheckbox(), EnsureFileExtension(), DESIGN_BLOCK_IO_MGR::FindPlugin(), PATHS::GetDefaultUserDesignBlocksPath(), DESIGN_BLOCK_LIB_TABLE::GetGlobalLibTable(), PROJECT::GetProjectPath(), 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().
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.
aProposedName | is the initial path and filename shown in the file chooser dialog. |
Definition at line 144 of file design_block_pane.cpp.
References createNewDesignBlockLibrary(), and selectDesignBlockLibTable().
bool DESIGN_BLOCK_PANE::DeleteDesignBlockFromLibrary | ( | const LIB_ID & | aLibId, |
bool | aConfirm | ||
) |
Definition at line 359 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 317 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 401 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(), DESIGN_BLOCK::GetLibId(), 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 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().
|
inline |
Definition at line 92 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 135 of file design_block_pane.cpp.
References GetDesignBlock(), and GetSelectedLibId().
LIB_ID DESIGN_BLOCK_PANE::GetSelectedLibId | ( | int * | aUnit = nullptr | ) | const |
Definition at line 91 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 73 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 62 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 103 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 85 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().
|
private |
Definition at line 471 of file design_block_pane.cpp.
References _, PROJECT::DesignBlockLibs(), DESIGN_BLOCK_LIB_TABLE::GetGlobalLibTable(), PROJECT::IsNullProject(), m_frame, and KIWAY_HOLDER::Prj().
Referenced by AddDesignBlockLibrary(), and CreateNewDesignBlockLibrary().
void DESIGN_BLOCK_PANE::SelectLibId | ( | const LIB_ID & | aLibId | ) |
Definition at line 97 of file design_block_pane.cpp.
References m_chooserPanel, and PANEL_DESIGN_BLOCK_CHOOSER::SelectLibId().
Referenced by AddDesignBlockLibrary(), EditDesignBlockProperties(), PCB_EDIT_FRAME::SaveBoardAsDesignBlock(), PCB_EDIT_FRAME::SaveBoardToDesignBlock(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_EDIT_FRAME::SaveSelectionToDesignBlock(), PCB_EDIT_FRAME::saveSelectionToDesignBlock(), SCH_EDIT_FRAME::SaveSheetAsDesignBlock(), and SCH_EDIT_FRAME::SaveSheetToDesignBlock().
|
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(), 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 101 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 100 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(), selectDesignBlockLibTable(), 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().