| 
    KiCad PCB EDA Suite
    
   | 
 
#include <panel_design_block_chooser.h>
 Public Member Functions | |
| PANEL_DESIGN_BLOCK_CHOOSER (EDA_DRAW_FRAME *aFrame, DESIGN_BLOCK_PANE *aParent, std::vector< LIB_ID > &aHistoryList, std::function< void()> aSelectHandler, TOOL_INTERACTIVE *aContextMenuTool) | |
| Panel for using design blocks.   | |
| ~PANEL_DESIGN_BLOCK_CHOOSER () | |
| void | SaveSettings () | 
| void | OnChar (wxKeyEvent &aEvent) | 
| wxPanel * | GetDetailsPanel () | 
| void | SetPreviewWidget (DESIGN_BLOCK_PREVIEW_WIDGET *aPreview) | 
| void | FinishSetup () | 
| void | SetPreselect (const LIB_ID &aPreselect) | 
| void | RefreshLibs (bool aProgress=false) | 
| LIB_ID | GetSelectedLibId (int *aUnit=nullptr) const | 
| To be called after this dialog returns from ShowModal().   | |
| void | SelectLibId (const LIB_ID &aLibId) | 
| LIB_TREE * | GetLibTree () | 
| void | ShowChangedLanguage () | 
Protected Member Functions | |
| void | OnDetailsCharHook (wxKeyEvent &aEvt) | 
| void | onCloseTimer (wxTimerEvent &aEvent) | 
| void | onOpenLibsTimer (wxTimerEvent &aEvent) | 
| void | onDesignBlockSelected (wxCommandEvent &aEvent) | 
| void | onDesignBlockChosen (wxCommandEvent &aEvent) | 
| Handle the selection of an item.   | |
| void | addDesignBlockToHistory (const LIB_ID &aLibId) | 
| void | rebuildHistoryNode () | 
| void | displayErrors (wxTopLevelWindow *aWindow) | 
Protected Attributes | |
| wxTimer * | m_dbl_click_timer | 
| wxTimer * | m_open_libs_timer | 
| wxSplitterWindow * | m_vsplitter | 
| wxPanel * | m_detailsPanel | 
| wxBoxSizer * | m_detailsSizer | 
| wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > | m_adapter | 
| LIB_TREE * | m_tree | 
| DESIGN_BLOCK_PREVIEW_WIDGET * | m_preview | 
| DESIGN_BLOCK_PANE * | m_parent | 
| EDA_DRAW_FRAME * | m_frame | 
| std::function< void()> | m_selectHandler | 
| std::vector< LIB_ID > | m_historyList | 
Static Protected Attributes | |
| static constexpr int | DBLCLICK_DELAY = 100 | 
| static wxString | g_designBlockSearchString | 
Definition at line 39 of file panel_design_block_chooser.h.
| PANEL_DESIGN_BLOCK_CHOOSER::PANEL_DESIGN_BLOCK_CHOOSER | ( | EDA_DRAW_FRAME * | aFrame, | 
| DESIGN_BLOCK_PANE * | aParent, | ||
| std::vector< LIB_ID > & | aHistoryList, | ||
| std::function< void()> | aSelectHandler, | ||
| TOOL_INTERACTIVE * | aContextMenuTool ) | 
Panel for using design blocks.
| aFrame | the parent frame (usually a SCH_EDIT_FRAME or PCB_EDIT_FRAME) | 
| aParent | the parent design block pane | 
| aAcceptHandler | a handler to be called on double-click of a footprint | 
| aContextMenuTool | the tool that will be used to provide an appropriate context menu for the design block actions available in that frame | 
Definition at line 52 of file panel_design_block_chooser.cpp.
References LIB_TREE::ALL_WIDGETS, DESIGN_BLOCK_TREE_MODEL_ADAPTER::Create(), g_designBlockSearchString, m_adapter, m_dbl_click_timer, m_detailsPanel, m_detailsSizer, m_frame, m_historyList, m_open_libs_timer, m_parent, m_preview, m_selectHandler, m_tree, m_vsplitter, move, OnChar(), onCloseTimer(), onDesignBlockChosen(), onOpenLibsTimer(), and RefreshLibs().
| PANEL_DESIGN_BLOCK_CHOOSER::~PANEL_DESIGN_BLOCK_CHOOSER | ( | ) | 
Definition at line 133 of file panel_design_block_chooser.cpp.
References m_dbl_click_timer, m_open_libs_timer, OnChar(), onCloseTimer(), onDesignBlockChosen(), and onDesignBlockSelected().
      
  | 
  protected | 
Definition at line 341 of file panel_design_block_chooser.cpp.
References GetSelectedLibId(), m_historyList, m_tree, rebuildHistoryNode(), and SelectLibId().
Referenced by onCloseTimer().
      
  | 
  protected | 
Definition at line 392 of file panel_design_block_chooser.cpp.
References _, HTML_MESSAGE_BOX::AddHTML_Text(), EscapeHTML(), HTML_MESSAGE_BOX::MessageSet(), and DIALOG_SHIM::ShowModal().
| void PANEL_DESIGN_BLOCK_CHOOSER::FinishSetup | ( | ) | 
Definition at line 203 of file panel_design_block_chooser.cpp.
References APP_SETTINGS_BASE::PANEL_DESIGN_BLOCK_CHOOSER::height, m_adapter, m_frame, m_vsplitter, APP_SETTINGS_BASE::PANEL_DESIGN_BLOCK_CHOOSER::sash_pos_h, APP_SETTINGS_BASE::PANEL_DESIGN_BLOCK_CHOOSER::sash_pos_v, APP_SETTINGS_BASE::PANEL_DESIGN_BLOCK_CHOOSER::sort_mode, and APP_SETTINGS_BASE::PANEL_DESIGN_BLOCK_CHOOSER::width.
      
  | 
  inline | 
Definition at line 62 of file panel_design_block_chooser.h.
References m_detailsPanel.
      
  | 
  inline | 
Definition at line 84 of file panel_design_block_chooser.h.
References m_tree.
Referenced by DESIGN_BLOCK_CONTROL::getCurrentTreeNode().
| LIB_ID PANEL_DESIGN_BLOCK_CHOOSER::GetSelectedLibId | ( | int * | aUnit = nullptr | ) | const | 
To be called after this dialog returns from ShowModal().
For multi-unit design_blocks, if the user selects the design_block itself rather than picking an individual unit, 0 will be returned in aUnit. Beware that this is an invalid unit number - this should be replaced with whatever default is desired (usually 1).
| aUnit | if not NULL, the selected unit is filled in here. | 
Definition at line 268 of file panel_design_block_chooser.cpp.
References m_tree.
Referenced by addDesignBlockToHistory(), and onDesignBlockSelected().
| void PANEL_DESIGN_BLOCK_CHOOSER::OnChar | ( | wxKeyEvent & | aEvent | ) | 
Definition at line 180 of file panel_design_block_chooser.cpp.
References m_tree.
Referenced by PANEL_DESIGN_BLOCK_CHOOSER(), PCB_DESIGN_BLOCK_PANE::PCB_DESIGN_BLOCK_PANE(), SCH_DESIGN_BLOCK_PANE::SCH_DESIGN_BLOCK_PANE(), and ~PANEL_DESIGN_BLOCK_CHOOSER().
      
  | 
  protected | 
Definition at line 281 of file panel_design_block_chooser.cpp.
References addDesignBlockToHistory(), DBLCLICK_DELAY, m_dbl_click_timer, m_frame, m_selectHandler, and m_tree.
Referenced by PANEL_DESIGN_BLOCK_CHOOSER(), and ~PANEL_DESIGN_BLOCK_CHOOSER().
      
  | 
  protected | 
Handle the selection of an item.
This is called when either the search box or the tree receive an Enter, or the tree receives a double click. If the item selected is a category, it is expanded or collapsed; if it is a design_block, the design_block is picked.
Definition at line 324 of file panel_design_block_chooser.cpp.
References DBLCLICK_DELAY, m_dbl_click_timer, and m_tree.
Referenced by PANEL_DESIGN_BLOCK_CHOOSER(), and ~PANEL_DESIGN_BLOCK_CHOOSER().
      
  | 
  protected | 
Definition at line 314 of file panel_design_block_chooser.cpp.
References GetSelectedLibId(), m_parent, and m_preview.
Referenced by onOpenLibsTimer(), and ~PANEL_DESIGN_BLOCK_CHOOSER().
      
  | 
  protected | 
      
  | 
  protected | 
Definition at line 303 of file panel_design_block_chooser.cpp.
References m_adapter, m_frame, and onDesignBlockSelected().
Referenced by PANEL_DESIGN_BLOCK_CHOOSER().
      
  | 
  protected | 
Definition at line 368 of file panel_design_block_chooser.cpp.
References _, info, DESIGN_BLOCK_LIBRARY_ADAPTER::LoadDesignBlock(), m_adapter, m_frame, and m_historyList.
Referenced by addDesignBlockToHistory(), and RefreshLibs().
| void PANEL_DESIGN_BLOCK_CHOOSER::RefreshLibs | ( | bool | aProgress = false | ) | 
Definition at line 239 of file panel_design_block_chooser.cpp.
References DESIGN_BLOCK_TREE_MODEL_ADAPTER::AddLibraries(), DESIGN_BLOCK_TREE_MODEL_ADAPTER::ClearLibraries(), m_adapter, m_frame, m_historyList, m_tree, rebuildHistoryNode(), Refresh(), and LIB_TREE_MODEL_ADAPTER::SetPreselectNode().
Referenced by PANEL_DESIGN_BLOCK_CHOOSER().
| void PANEL_DESIGN_BLOCK_CHOOSER::SaveSettings | ( | ) | 
Definition at line 148 of file panel_design_block_chooser.cpp.
References g_designBlockSearchString, m_adapter, m_frame, m_tree, and m_vsplitter.
| void PANEL_DESIGN_BLOCK_CHOOSER::SelectLibId | ( | const LIB_ID & | aLibId | ) | 
Definition at line 274 of file panel_design_block_chooser.cpp.
References m_tree.
Referenced by addDesignBlockToHistory().
| void PANEL_DESIGN_BLOCK_CHOOSER::SetPreselect | ( | const LIB_ID & | aPreselect | ) | 
Definition at line 262 of file panel_design_block_chooser.cpp.
References m_adapter.
| void PANEL_DESIGN_BLOCK_CHOOSER::SetPreviewWidget | ( | DESIGN_BLOCK_PREVIEW_WIDGET * | aPreview | ) | 
Definition at line 172 of file panel_design_block_chooser.cpp.
References m_detailsSizer, and m_preview.
| void PANEL_DESIGN_BLOCK_CHOOSER::ShowChangedLanguage | ( | ) | 
Definition at line 165 of file panel_design_block_chooser.cpp.
References m_tree.
      
  | 
  staticconstexprprotected | 
Definition at line 89 of file panel_design_block_chooser.h.
Referenced by onCloseTimer(), and onDesignBlockChosen().
      
  | 
  staticprotected | 
Definition at line 111 of file panel_design_block_chooser.h.
Referenced by PANEL_DESIGN_BLOCK_CHOOSER(), and SaveSettings().
      
  | 
  protected | 
Definition at line 119 of file panel_design_block_chooser.h.
Referenced by FinishSetup(), onOpenLibsTimer(), PANEL_DESIGN_BLOCK_CHOOSER(), rebuildHistoryNode(), RefreshLibs(), SaveSettings(), and SetPreselect().
      
  | 
  protected | 
Definition at line 113 of file panel_design_block_chooser.h.
Referenced by onCloseTimer(), onDesignBlockChosen(), PANEL_DESIGN_BLOCK_CHOOSER(), and ~PANEL_DESIGN_BLOCK_CHOOSER().
      
  | 
  protected | 
Definition at line 116 of file panel_design_block_chooser.h.
Referenced by GetDetailsPanel(), and PANEL_DESIGN_BLOCK_CHOOSER().
      
  | 
  protected | 
Definition at line 117 of file panel_design_block_chooser.h.
Referenced by PANEL_DESIGN_BLOCK_CHOOSER(), and SetPreviewWidget().
      
  | 
  protected | 
Definition at line 125 of file panel_design_block_chooser.h.
Referenced by FinishSetup(), onCloseTimer(), onOpenLibsTimer(), PANEL_DESIGN_BLOCK_CHOOSER(), rebuildHistoryNode(), RefreshLibs(), and SaveSettings().
      
  | 
  protected | 
Definition at line 128 of file panel_design_block_chooser.h.
Referenced by addDesignBlockToHistory(), PANEL_DESIGN_BLOCK_CHOOSER(), rebuildHistoryNode(), and RefreshLibs().
      
  | 
  protected | 
Definition at line 114 of file panel_design_block_chooser.h.
Referenced by PANEL_DESIGN_BLOCK_CHOOSER(), and ~PANEL_DESIGN_BLOCK_CHOOSER().
      
  | 
  protected | 
Definition at line 124 of file panel_design_block_chooser.h.
Referenced by onDesignBlockSelected(), and PANEL_DESIGN_BLOCK_CHOOSER().
      
  | 
  protected | 
Definition at line 122 of file panel_design_block_chooser.h.
Referenced by onDesignBlockSelected(), PANEL_DESIGN_BLOCK_CHOOSER(), and SetPreviewWidget().
      
  | 
  protected | 
Definition at line 126 of file panel_design_block_chooser.h.
Referenced by onCloseTimer(), and PANEL_DESIGN_BLOCK_CHOOSER().
      
  | 
  protected | 
Definition at line 121 of file panel_design_block_chooser.h.
Referenced by addDesignBlockToHistory(), GetLibTree(), GetSelectedLibId(), OnChar(), onCloseTimer(), onDesignBlockChosen(), PANEL_DESIGN_BLOCK_CHOOSER(), RefreshLibs(), SaveSettings(), SelectLibId(), and ShowChangedLanguage().
      
  | 
  protected | 
Definition at line 115 of file panel_design_block_chooser.h.
Referenced by FinishSetup(), PANEL_DESIGN_BLOCK_CHOOSER(), and SaveSettings().