KiCad PCB EDA Suite
|
#include <sch_design_block_pane.h>
Public Member Functions | |
SCH_DESIGN_BLOCK_PANE (SCH_EDIT_FRAME *aParent, const LIB_ID *aPreselect, std::vector< LIB_ID > &aHistoryList) | |
void | OnCheckBox (wxCommandEvent &aEvent) |
void | UpdateCheckboxes () |
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 | |
void | setLabelsAndTooltips () override |
virtual void | OnLanguageChanged (wxCommandEvent &aEvent) |
void | OnClosed (wxAuiManagerEvent &aEvent) |
Protected Attributes | |
wxCheckBox * | m_repeatedPlacement |
wxCheckBox * | m_placeAsSheet |
wxCheckBox * | m_keepAnnotations |
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 39 of file sch_design_block_pane.h.
SCH_DESIGN_BLOCK_PANE::SCH_DESIGN_BLOCK_PANE | ( | SCH_EDIT_FRAME * | aParent, |
const LIB_ID * | aPreselect, | ||
std::vector< LIB_ID > & | aHistoryList | ||
) |
Definition at line 45 of file sch_design_block_pane.cpp.
References PANEL_DESIGN_BLOCK_CHOOSER::FinishSetup(), EDA_DRAW_PANEL_GAL::GetBackend(), EDA_DRAW_FRAME::GetCanvas(), PANEL_DESIGN_BLOCK_CHOOSER::GetDetailsPanel(), TOOLS_HOLDER::GetToolManager(), LIB_ID::IsValid(), KEEP_ANNOTATIONS, DESIGN_BLOCK_PANE::m_chooserPanel, DESIGN_BLOCK_PANE::m_frame, m_keepAnnotations, m_placeAsSheet, m_repeatedPlacement, PANEL_DESIGN_BLOCK_CHOOSER::OnChar(), OnCheckBox(), PLACE_AS_SHEET, SCH_ACTIONS::placeDesignBlock, REPEATED_PLACEMENT, setLabelsAndTooltips(), PANEL_DESIGN_BLOCK_CHOOSER::SetPreselect(), PANEL_DESIGN_BLOCK_CHOOSER::SetPreviewWidget(), and UpdateCheckboxes().
|
inherited |
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(), DESIGN_BLOCK_PANE::m_frame, NormalizePath(), Pgm(), KIWAY_HOLDER::Prj(), DESIGN_BLOCK_PANE::RefreshLibs(), LIB_TABLE::Save(), DESIGN_BLOCK_PANE::selectDesignBlockLibTable(), DESIGN_BLOCK_PANE::SelectLibId(), DESIGN_BLOCK_IO_MGR::ShowType(), and IO_ERROR::What().
Referenced by DESIGN_BLOCK_PANE::createNewDesignBlockLibrary().
|
privateinherited |
Definition at line 456 of file design_block_pane.cpp.
References _, and OKOrCancelDialog().
Referenced by DESIGN_BLOCK_PANE::EditDesignBlockProperties().
|
privateinherited |
Definition at line 150 of file design_block_pane.cpp.
References _, DESIGN_BLOCK_PANE::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(), DESIGN_BLOCK_PANE::m_frame, KIWAY_HOLDER::Prj(), EDA_BASE_FRAME::ShowInfoBarError(), KIDIALOG::ShowModal(), and IO_ERROR::What().
Referenced by DESIGN_BLOCK_PANE::CreateNewDesignBlockLibrary().
|
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.
aProposedName | is the initial path and filename shown in the file chooser dialog. |
Definition at line 144 of file design_block_pane.cpp.
References DESIGN_BLOCK_PANE::createNewDesignBlockLibrary(), and DESIGN_BLOCK_PANE::selectDesignBlockLibTable().
|
inherited |
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(), DESIGN_BLOCK_PANE::m_frame, KIWAY_HOLDER::Prj(), DESIGN_BLOCK_PANE::RefreshLibs(), EDA_BASE_FRAME::ShowInfoBarError(), and IO_ERROR::What().
|
inherited |
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(), DESIGN_BLOCK_PANE::m_frame, KIWAY_HOLDER::Prj(), DESIGN_BLOCK_PANE::RefreshLibs(), EDA_BASE_FRAME::ShowInfoBarError(), and IO_ERROR::What().
|
inherited |
Definition at line 401 of file design_block_pane.cpp.
References _, DESIGN_BLOCK_PANE::checkOverwrite(), DESIGN_BLOCK_LIB_TABLE::DesignBlockDelete(), DESIGN_BLOCK_LIB_TABLE::DesignBlockExists(), PROJECT::DesignBlockLibs(), DESIGN_BLOCK_LIB_TABLE::DesignBlockSave(), DisplayError(), DESIGN_BLOCK_PANE::GetDesignBlock(), DESIGN_BLOCK::GetLibId(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), DESIGN_BLOCK_LIB_TABLE::IsDesignBlockLibWritable(), LIB_ID::IsValid(), DESIGN_BLOCK_PANE::m_frame, KIWAY_HOLDER::Prj(), DESIGN_BLOCK_PANE::RefreshLibs(), DESIGN_BLOCK_PANE::SelectLibId(), EDA_BASE_FRAME::ShowInfoBarError(), DIALOG_SHIM::ShowModal(), and IO_ERROR::What().
|
inherited |
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(), 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().
|
inlineinherited |
Definition at line 92 of file design_block_pane.h.
References DESIGN_BLOCK_PANE::m_chooserPanel.
Referenced by DESIGN_BLOCK_CONTROL::getCurrentTreeNode().
|
inherited |
Definition at line 135 of file design_block_pane.cpp.
References DESIGN_BLOCK_PANE::GetDesignBlock(), and DESIGN_BLOCK_PANE::GetSelectedLibId().
|
inherited |
Definition at line 91 of file design_block_pane.cpp.
References PANEL_DESIGN_BLOCK_CHOOSER::GetSelectedLibId(), and DESIGN_BLOCK_PANE::m_chooserPanel.
Referenced by PCB_CONTROL::AppendDesignBlock(), DESIGN_BLOCK_PANE::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().
void SCH_DESIGN_BLOCK_PANE::OnCheckBox | ( | wxCommandEvent & | aEvent | ) |
Definition at line 122 of file sch_design_block_pane.cpp.
References Kiface(), m_keepAnnotations, m_placeAsSheet, and m_repeatedPlacement.
Referenced by SCH_DESIGN_BLOCK_PANE().
|
protectedinherited |
Definition at line 73 of file design_block_pane.cpp.
References EDA_BASE_FRAME::config(), DESIGN_BLOCK_PANE::m_frame, and EDA_DRAW_FRAME::SaveSettings().
Referenced by DESIGN_BLOCK_PANE::DESIGN_BLOCK_PANE(), and DESIGN_BLOCK_PANE::~DESIGN_BLOCK_PANE().
|
protectedvirtualinherited |
Definition at line 62 of file design_block_pane.cpp.
References DESIGN_BLOCK_PANE::m_chooserPanel, DESIGN_BLOCK_PANE::setLabelsAndTooltips(), and PANEL_DESIGN_BLOCK_CHOOSER::ShowChangedLanguage().
Referenced by DESIGN_BLOCK_PANE::DESIGN_BLOCK_PANE(), and DESIGN_BLOCK_PANE::~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().
|
inherited |
Definition at line 103 of file design_block_pane.cpp.
References DESIGN_BLOCK_PANE::m_chooserPanel, and PANEL_DESIGN_BLOCK_CHOOSER::RefreshLibs().
Referenced by DESIGN_BLOCK_PANE::AddDesignBlockLibrary(), DESIGN_BLOCK_PANE::DeleteDesignBlockFromLibrary(), DESIGN_BLOCK_PANE::DeleteDesignBlockLibrary(), DESIGN_BLOCK_PANE::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().
|
inherited |
Definition at line 85 of file design_block_pane.cpp.
References DESIGN_BLOCK_PANE::m_chooserPanel, and PANEL_DESIGN_BLOCK_CHOOSER::SaveSettings().
Referenced by SCH_EDIT_FRAME::SaveSettings(), and PCB_EDIT_FRAME::SaveSettings().
|
privateinherited |
Definition at line 471 of file design_block_pane.cpp.
References _, PROJECT::DesignBlockLibs(), DESIGN_BLOCK_LIB_TABLE::GetGlobalLibTable(), PROJECT::IsNullProject(), DESIGN_BLOCK_PANE::m_frame, and KIWAY_HOLDER::Prj().
Referenced by DESIGN_BLOCK_PANE::AddDesignBlockLibrary(), and DESIGN_BLOCK_PANE::CreateNewDesignBlockLibrary().
|
inherited |
Definition at line 97 of file design_block_pane.cpp.
References DESIGN_BLOCK_PANE::m_chooserPanel, and PANEL_DESIGN_BLOCK_CHOOSER::SelectLibId().
Referenced by DESIGN_BLOCK_PANE::AddDesignBlockLibrary(), DESIGN_BLOCK_PANE::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().
|
overrideprotectedvirtual |
Implements DESIGN_BLOCK_PANE.
Definition at line 97 of file sch_design_block_pane.cpp.
References _, KEEP_ANNOTATIONS, m_keepAnnotations, m_placeAsSheet, m_repeatedPlacement, PLACE_AS_SHEET, and REPEATED_PLACEMENT.
Referenced by SCH_DESIGN_BLOCK_PANE().
void SCH_DESIGN_BLOCK_PANE::UpdateCheckboxes | ( | ) |
Definition at line 133 of file sch_design_block_pane.cpp.
References Kiface(), m_keepAnnotations, m_placeAsSheet, and m_repeatedPlacement.
Referenced by SCH_DRAWING_TOOLS::ImportSheet(), and SCH_DESIGN_BLOCK_PANE().
|
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().
|
protectedinherited |
Definition at line 101 of file design_block_pane.h.
Referenced by DESIGN_BLOCK_PANE::GetDesignBlockPanel(), DESIGN_BLOCK_PANE::GetSelectedLibId(), DESIGN_BLOCK_PANE::OnLanguageChanged(), PCB_DESIGN_BLOCK_PANE::PCB_DESIGN_BLOCK_PANE(), DESIGN_BLOCK_PANE::RefreshLibs(), DESIGN_BLOCK_PANE::SaveSettings(), SCH_DESIGN_BLOCK_PANE(), and DESIGN_BLOCK_PANE::SelectLibId().
|
protectedinherited |
Definition at line 100 of file design_block_pane.h.
Referenced by DESIGN_BLOCK_PANE::AddDesignBlockLibrary(), DESIGN_BLOCK_PANE::createNewDesignBlockLibrary(), DESIGN_BLOCK_PANE::DeleteDesignBlockFromLibrary(), DESIGN_BLOCK_PANE::DeleteDesignBlockLibrary(), DESIGN_BLOCK_PANE::DESIGN_BLOCK_PANE(), DESIGN_BLOCK_PANE::EditDesignBlockProperties(), DESIGN_BLOCK_PANE::GetDesignBlock(), DESIGN_BLOCK_PANE::OnClosed(), SCH_DESIGN_BLOCK_PANE(), DESIGN_BLOCK_PANE::selectDesignBlockLibTable(), and DESIGN_BLOCK_PANE::~DESIGN_BLOCK_PANE().
|
protected |
Definition at line 54 of file sch_design_block_pane.h.
Referenced by OnCheckBox(), SCH_DESIGN_BLOCK_PANE(), setLabelsAndTooltips(), and UpdateCheckboxes().
|
privateinherited |
Definition at line 56 of file wx_panel.h.
Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().
|
protected |
Definition at line 53 of file sch_design_block_pane.h.
Referenced by OnCheckBox(), SCH_DESIGN_BLOCK_PANE(), setLabelsAndTooltips(), and UpdateCheckboxes().
|
protected |
Definition at line 52 of file sch_design_block_pane.h.
Referenced by OnCheckBox(), SCH_DESIGN_BLOCK_PANE(), setLabelsAndTooltips(), and UpdateCheckboxes().
|
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().