76 EVT_LISTBOX_DCLICK( ID_LIBVIEW_CMP_LIST,
LIB_VIEW_FRAME::DClickOnCmpList )
107 #define MODAL_MODE_EXTRASTYLE wxFRAME_FLOAT_ON_PARENT // could be wxSTAY_ON_TOP if issues 109 #define MODAL_MODE_EXTRASTYLE wxFRAME_FLOAT_ON_PARENT 112 #define LIB_VIEW_FRAME_NAME "ViewlibFrame" 113 #define LIB_VIEW_FRAME_NAME_MODAL "ViewlibFrameModal" 116 const wxString& aLibraryName ) :
117 SCH_BASE_FRAME( aKiway, aParent, aFrameType, _(
"Library Browser" ),
118 wxDefaultPosition, wxDefaultSize,
139 icon.CopyFromBitmap(
KiBitmap( library_browse_xpm ) );
164 if( aLibraryName.empty() )
167 m_libList =
new wxListBox(
this, ID_LIBVIEW_LIB_LIST,
169 0, NULL, wxLB_HSCROLL );
208 wxAuiPaneInfo( horiz ).Name(
"m_mainToolBar" ).Top().Row( 0 ) );
218 m_auimgr.AddPane(
m_canvas, wxAuiPaneInfo().Name(
"DrawFrame" ).CentrePane() );
222 wxAuiPaneInfo( mesg ).Name(
"MsgPanel" ).Bottom().Layer( 10 ) );
239 #ifdef USE_WX_GRAPHICS_CONTEXT 260 m_unit = aUnit > 0 ? aUnit : 1;
300 aEvent.Check(
false );
313 aEvent.Check(
true );
373 double defaultLibraryZoom = 7.33;
378 return defaultLibraryZoom;
397 return defaultLibraryZoom;
402 double sizeX = (double) boundingBox.
GetWidth();
403 double sizeY = (double) boundingBox.
GetHeight();
407 double margin_scale_factor = 1.2;
409 return bestZoom( sizeX, sizeY, margin_scale_factor, centre );
420 std::vector< wxString > libs =
Prj().SchSymbolLibTable()->GetLogicalLibs();
425 for(
unsigned ii = 0; ii < libs.size(); )
428 libs.erase( libs.begin() + ii );
437 for(
unsigned ii = 0; ii < libs.size(); )
439 wxArrayString aliasNames;
441 Prj().SchSymbolLibTable()->EnumerateSymbolLib( libs[ii], aliasNames,
true );
443 if( aliasNames.IsEmpty() )
444 libs.erase( libs.begin() + ii );
453 wxArrayString libNames;
455 for(
const auto&
name : libs )
456 libNames.Add(
name );
463 if( index != wxNOT_FOUND )
493 wxArrayString aliasNames;
502 if( aliasNames.IsEmpty() )
514 bool changed =
false;
516 if( index == wxNOT_FOUND )
529 wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_CMP_LIST );
590 m_cmpList->SetStringSelection( aComponentName,
true );
649 #define LIBLIST_WIDTH_KEY "ViewLiblistWidth" 650 #define CMPLIST_WIDTH_KEY "ViewCmplistWidth" 651 #define CMPVIEW_SHOW_PINELECTRICALTYPE_KEY "ViewCmpShowPinElectricalType" 656 #define LIBVIEW_BGCOLOR "LibviewBgColor" EDA_PANEINFO & HorizontalToolbarPane()
Function HorizontalToolbarPane Change *this to a horizontal toolbar for KiCad.
void SetFilter(const SCHLIB_FILTER *aFilter)
Set a filter to display only libraries and/or components which match the filter.
static wxString m_entryName
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.
Part library alias object definition.
#define LIB_VIEW_FRAME_NAME
void SetUnitAndConvert(int aUnit, int aConvert)
Set unit and convert, and set flag preventing them from automatically resetting to 1...
bool m_selection_changed
Updated to true if a list rewrite on GUI activation resulted in the component selection changing...
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
bool IsDismissed()
Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been...
void onUpdateViewDoc(wxUpdateUIEvent &aEvent)
virtual void OnActivate(wxActivateEvent &event) override
Called when the frame is activated to reload the libraries and component lists that can be changed by...
double bestZoom(double sizeX, double sizeY, double scaleFactor, wxPoint centre)
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
void SetScreen(BASE_SCREEN *aScreen)
void SetScrollCenterPosition(const wxPoint &aPoint)
void OnCloseWindow(wxCloseEvent &Event)
void SetShowElectricalType(bool aShow)
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
virtual wxConfigBase * config()
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
wxArrayString m_allowedLibs
Schematic editor (Eeschema) main window.
static wxString m_libraryName
void SkipNextLeftButtonReleaseEvent()
function SkipNextLeftButtonReleaseEvent after calling this function, if the left mouse button is down...
virtual void SetGridColor(COLOR4D aColor)
Function SetGridColor() , virtual.
#define LIBLIST_WIDTH_KEY
Class EDA_DRAW_FRAME is the base class for create windows for drawing purpose.
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
LIB_ALIAS * getSelectedAlias()
wxPoint m_O_Curseur
Relative Screen cursor coordinate (on grid) in user units.
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
void SetSelectedComponent(const wxString &aComponentName)
Set the selected component.
Specialization of the wxAuiPaneInfo class for KiCad panels.
Symbol library viewer main window.
BOX2I boundingBox(T aObject)
boundingBox template method
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
void Zoom_Automatique(bool aWarpPointer)
Function Zoom_Automatique redraws the screen with best zoom level and the best centering that shows a...
EDA_PANEINFO & VerticalToolbarPane()
Function VerticalToolbarPane Change *this to a vertical toolbar for KiCad.
bool m_showPinElectricalTypeName
the option to show the pin electrical name in the component editor
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
LIB_VIEW_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aLibraryName=wxEmptyString)
Constructor.
const wxArrayString & GetAllowedLibList() const
void ReCreateMenuBar() override
Function ReCreateMenuBar Creates recreates the menu bar.
bool m_Center
Center on screen.
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Class LIB_ITEM definition.
void SetScalingFactor(double iu_per_du)
Function SetScalingFactor sets the scaling factor of "internal unit per device unit".
void CloseLibraryViewer(wxCommandEvent &event)
LIB_PART * getSelectedSymbol()
Define a library symbol object.
Helper dialog and control classes.
void ReCreateHToolbar() override
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
wxString m_configFrameName
prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTO...
#define KICAD_DEFAULT_DRAWFRAME_STYLE
bool GetFilterPowerParts() const
void OnSetRelativeOffset(wxCommandEvent &event)
EDA_PANEINFO & InfoToolbarPane()
Function InfoToolbarPane Change *this to a information panel for for KiCad.
bool ReCreateListCmp()
Create or recreate the list of components in the currently selected library.
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
void ExportToSchematicLibraryPart(wxCommandEvent &event)
Function ExportToSchematicLibraryPart exports the current component to schematic and close the librar...
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
void SetModal(bool aIsModal)
EVT_TOOL_RANGE(ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, LIB_VIEW_FRAME::onSelectSymbolBodyStyle) EVT_UPDATE_UI(ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT
LIB_PART * GetPart() const
Get the shared LIB_PART.
void UpdateStatusBar() override
Function UpdateStatusBar updates the status bar information.
void ClickOnLibList(wxCommandEvent &event)
EDA_DRAW_PANEL * m_canvas
The area to draw on.
#define CMPVIEW_SHOW_PINELECTRICALTYPE_KEY
wxString GetDocFileName() const
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
EDA_PANEINFO & MessageToolbarPane()
Function MessageToolbarPane Change *this to a message pane for KiCad.
void onUpdateNormalBodyStyleButton(wxUpdateUIEvent &aEvent)
void DismissModal(bool aRetVal, const wxString &aResult=wxEmptyString)
void OnUpdateElectricalType(wxUpdateUIEvent &aEvent)
struct EDA_HOTKEY_CONFIG g_Viewlib_Hokeys_Descr[]
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
void onUpdateAlternateBodyStyleButton(wxUpdateUIEvent &aEvent)
Class EDA_RECT handles the component boundary box.
void ClickOnCmpList(wxCommandEvent &event)
#define MODAL_MODE_EXTRASTYLE
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void SetDrawBgColor(COLOR4D aColor) override
double BestZoom() override
Return the zoom level which displays the full page on screen.
void ReCreateVToolbar() override
bool GetShowElectricalType()
#define LIB_VIEW_FRAME_NAME_MODAL
Definition for part library class.
void OnShowElectricalType(wxCommandEvent &event)
void DClickOnCmpList(wxCommandEvent &event)
int SetGrid(const wxRealPoint &size)
set the current grid size m_Grid.
Message panel definition file.
bool ReCreateListLib()
Creates or recreates a sorted list of currently loaded libraries.
A shim class between EDA_DRAW_FRAME and several derived classes: LIB_EDIT_FRAME, LIB_VIEW_FRAME, and SCH_EDIT_FRAME, and it brings in a common way of handling the provided virtual functions for the derived classes.
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
virtual void OnActivate(wxActivateEvent &event)
Function OnActivate (virtual) is called when activating the frame.
#define CMPLIST_WIDTH_KEY
bool ProcessEvent(wxEvent &aEvent) override
Function ProcessEvent overrides the default process event handler to implement the auto save feature...
void SetSelectedLibrary(const wxString &aLibName)
Set the selected library in the library window.
void OnSize(wxSizeEvent &event) override
Function OnSize recalculates the size of toolbars and display panel when the frame size changes...