KiCad PCB EDA Suite
LIB_EDIT_FRAME Class Reference

The symbol library editor main window. More...

#include <lib_edit_frame.h>

Inheritance diagram for LIB_EDIT_FRAME:
SCH_BASE_FRAME EDA_DRAW_FRAME KIWAY_PLAYER EDA_BASE_FRAME KIWAY_HOLDER

Public Types

typedef std::vector< COMPONENT_SELECTIONHISTORY_LIST
 

Public Member Functions

 LIB_EDIT_FRAME (KIWAY *aKiway, wxWindow *aParent)
 
 ~LIB_EDIT_FRAME ()
 
void OnSwitchCanvas (wxCommandEvent &aEvent) override
 switches currently used canvas ( Cairo / OpenGL). More...
 
wxString GetCurLib () const
 The nickname of the current library being edited and empty string if none. More...
 
wxString SetCurLib (const wxString &aLibNickname)
 Sets the current library nickname and returns the old library nickname. More...
 
LIB_PARTGetCurPart () const
 Return the current part being edited or NULL if none selected. More...
 
void SetCurPart (LIB_PART *aPart)
 Take ownership of aPart and notes that it is the one currently being edited. More...
 
int GetRepeatPinStep () const
 
void SetRepeatPinStep (int aStep)
 Sets the repeat step value for pins repeat command. More...
 
void ReCreateMenuBar () override
 Recreates the menu bar. More...
 
void OnPreferencesOptions (wxCommandEvent &event)
 
void Process_Config (wxCommandEvent &event)
 
bool SynchronizePins ()
 Pin editing (add, delete, move...) can be synchronized between units when units are interchangeable because in this case similar pins are expected at the same location. More...
 
void OnPlotCurrentComponent (wxCommandEvent &event)
 Plot the current symbol in SVG or PNG format. More...
 
void OnSyncPinEditClick (wxCommandEvent &event)
 
void OnImportBody (wxCommandEvent &aEvent)
 
void OnExportBody (wxCommandEvent &aEvent)
 
void OnCreateNewLibrary (wxCommandEvent &aEvent)
 Creates a new library. More...
 
void OnAddLibrary (wxCommandEvent &aEvent)
 Adds an existing library. More...
 
void OnCreateNewPart (wxCommandEvent &aEvent)
 Creates a new part in the selected library. More...
 
void OnEditPart (wxCommandEvent &aEvent)
 Opens the selected part for editing. More...
 
void OnImportPart (wxCommandEvent &event)
 Routine to read one part. More...
 
void OnExportPart (wxCommandEvent &event)
 Creates a new library and backup the current component in this library or exports the component of the current library. More...
 
void OnAddPartToSchematic (wxCommandEvent &event)
 Add the current part to the schematic. More...
 
void OnSave (wxCommandEvent &aEvent)
 Saves the selected part or library. More...
 
void OnSaveAs (wxCommandEvent &aEvent)
 Saves the selected part or library to a new name and/or location. More...
 
void OnSaveAll (wxCommandEvent &aEvent)
 Saves all modified parts and libraries. More...
 
void OnRevert (wxCommandEvent &aEvent)
 Reverts unsaved changes in a part, restoring to the last saved state. More...
 
void OnRemovePart (wxCommandEvent &aEvent)
 Removes a part from the working copy of a library. More...
 
void OnCopyCutPart (wxCommandEvent &aEvent)
 
void OnPasteDuplicatePart (wxCommandEvent &aEvent)
 
void OnSelectUnit (wxCommandEvent &event)
 
void OnToggleSearchTree (wxCommandEvent &event)
 
void OnEditSymbolLibTable (wxCommandEvent &aEvent) override
 
bool IsSearchTreeShown ()
 
void ClearSearchTreeSelection ()
 
void OnViewEntryDoc (wxCommandEvent &event)
 
void OnCheckComponent (wxCommandEvent &event)
 
void OnSelectBodyStyle (wxCommandEvent &event)
 
void OnUpdatePaste (wxUpdateUIEvent &event)
 
void OnUpdateEditingPart (wxUpdateUIEvent &event)
 
void OnUpdateHavePart (wxUpdateUIEvent &aEvent)
 
void OnUpdateSave (wxUpdateUIEvent &aEvent)
 
void OnUpdateRevert (wxUpdateUIEvent &aEvent)
 
void OnUpdateSyncPinEdit (wxUpdateUIEvent &event)
 
void OnUpdatePartNumber (wxUpdateUIEvent &event)
 
void OnUpdateDeMorganNormal (wxUpdateUIEvent &event)
 
void OnUpdateDeMorganConvert (wxUpdateUIEvent &event)
 
void UpdateAfterSymbolProperties (wxString *aOldName, wxArrayString *aOldAliases)
 
void RebuildSymbolUnitsList ()
 
void RedrawComponent (wxDC *aDC, wxPoint aOffset)
 Redraw the current component loaded in library editor Display reference like in schematic (a reference U is shown U? or U?A) accordint to the current selected unit and De Morgan selection although it is stored without ? and part id. More...
 
void RedrawActiveWindow (wxDC *DC, bool EraseBg) override
 Redraw the current component loaded in library editor, an axes Display reference like in schematic (a reference U is shown U? or U?A) update status bar and info shown in the bottom of the window. More...
 
void OnCloseWindow (wxCloseEvent &Event)
 
void ReCreateHToolbar () override
 
void ReCreateVToolbar () override
 
void ReCreateOptToolbar ()
 
bool OnRightClick (const wxPoint &MousePos, wxMenu *PopMenu) override
 
double BestZoom () override
 Return the zoom level which displays the full page on screen. More...
 
EDA_HOTKEYGetHotKeyDescription (int aCommand) const override
 

More...
 
bool OnHotKey (wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
 
bool GeneralControl (wxDC *aDC, const wxPoint &aPosition, EDA_KEY aHotKey=0) override
 Perform application specific control using aDC at aPosition in logical units. More...
 
void LoadSettings (wxConfigBase *aCfg) override
 Load common frame parameters from a configuration file. More...
 
void SaveSettings (wxConfigBase *aCfg) override
 Saves common frame parameters to a configuration data file. More...
 
void CloseWindow (wxCommandEvent &event)
 Trigger the wxCloseEvent, which is handled by the function given to EVT_CLOSE() macro: More...
 
void OnModify () override
 Must be called after a schematic change in order to set the "modify" flag of the current symbol. More...
 
int GetUnit ()
 
int GetConvert ()
 
bool GetShowDeMorgan ()
 
void SetShowDeMorgan (bool show)
 
void ClearMsgPanel () override
 Clear all messages from the message panel. More...
 
void SaveCopyInUndoList (EDA_ITEM *ItemToCopy, UNDO_REDO_T undoType=UR_LIBEDIT, bool aAppend=false)
 Create a copy of the current component, and save it in the undo list. More...
 
void GetComponentFromUndoList ()
 
void GetComponentFromRedoList ()
 
void RollbackPartFromUndo ()
 
bool LoadComponentAndSelectLib (const LIB_ID &aLibId, int aUnit, int aConvert)
 Selects the currently active library and loads the symbol from aLibId. More...
 
void CreateImageFile (const wxString &aFileName, wxBitmapType aBitmapType=wxBITMAP_TYPE_PNG)
 Creates an image (screenshot) of the current symbol. More...
 
virtual void PrintPage (wxDC *aDC, LSET aPrintMask, bool aPrintMirrorMode, void *aData=NULL) override
 Print a page. More...
 
void SVG_PlotComponent (const wxString &aFullFileName)
 Creates the SVG print file for the current edited component. More...
 
void SyncLibraries (bool aShowProgress)
 Synchronize the library manager to the symbol library table, and then the symbol tree to the library manager. More...
 
void InstallPreferences (PAGED_DIALOG *aParent) override
 Allows Libedit to install its preferences panel into the preferences dialog. More...
 
void CommonSettingsChanged () override
 Called after the preferences dialog is run. More...
 
void ShowChangedLanguage () override
 Redraw the menus and what not in current language. More...
 
void SyncMenusAndToolbars () override
 Update the toolbars and menus (mostly settings/check buttons/checkboxes) with the current controller state. More...
 
virtual void SetScreen (BASE_SCREEN *aScreen) override
 
virtual const BOX2I GetDocumentExtents () const override
 
void RebuildView ()
 
void HardRedraw () override
 Rebuild the GAL and redraw the screen. More...
 
void KiwayMailIn (KIWAY_EXPRESS &mail) override
 Function KiwayMailIn receives KIWAY_EXPRESS messages from other players. More...
 
void createCanvas ()
 
SCH_DRAW_PANELGetCanvas () const override
 
SCH_SCREENGetScreen () const override
 Return a pointer to a BASE_SCREEN or one of its derivatives. More...
 
KIGFX::SCH_RENDER_SETTINGSGetRenderSettings ()
 
virtual bool GetShowAllPins () const
 Allow some frames to show/hide hidden pins. More...
 
bool GetShowElectricalType ()
 Allow some frames to show/hide pin electrical type names. More...
 
void SetShowElectricalType (bool aShow)
 
void OnUpdateSwitchCanvas (wxUpdateUIEvent &aEvent)
 Update UI called when switches currently used canvas (Cairo / OpenGL). More...
 
const wxPoint GetRepeatStep () const
 
void SetRepeatStep (const wxPoint &aStep)
 Sets the repeat step value for repeat command. More...
 
int GetRepeatDeltaLabel () const
 
void SetRepeatDeltaLabel (int aDelta)
 Sets the repeat delta label value for repeat command. More...
 
const wxString GetZoomLevelIndicator () const override
 Function GetZoomLevelIndicator returns a human readable value which can be displayed as zoom level indicator in dialogs. More...
 
void SetPageSettings (const PAGE_INFO &aPageSettings) override
 
const PAGE_INFOGetPageSettings () const override
 
const wxSize GetPageSizeIU () const override
 Works off of GetPageSettings() to return the size of the paper page in the internal units of this particular view. More...
 
const wxPoint & GetAuxOrigin () const override
 Return the origin of the axis used for plotting and various exports. More...
 
void SetAuxOrigin (const wxPoint &aPosition) override
 
const wxPoint & GetGridOrigin () const override
 Return the absolute coordinates of the origin of the snap grid. More...
 
void SetGridOrigin (const wxPoint &aPoint) override
 
void OnGridSettings (wxCommandEvent &aEvent) override
 
const TITLE_BLOCKGetTitleBlock () const override
 
void SetTitleBlock (const TITLE_BLOCK &aTitleBlock) override
 
void UpdateStatusBar () override
 Update the status bar information. More...
 
COMPONENT_SELECTION SelectCompFromLibTree (const SCHLIB_FILTER *aFilter, std::vector< COMPONENT_SELECTION > &aHistoryList, bool aUseLibBrowser, int aUnit, int aConvert, bool aShowFootprints, const LIB_ID *aHighlight=nullptr, bool aAllowFields=true)
 Function SelectComponentFromLib Calls the library viewer to select component to import into schematic. More...
 
void OnConfigurePaths (wxCommandEvent &aEvent)
 
const TEMPLATE_FIELDNAMESGetTemplateFieldNames () const
 Return a template field names list for read only access. More...
 
const TEMPLATE_FIELDNAMEGetTemplateFieldName (const wxString &aName) const
 Search for aName in the the template field name list. More...
 
LIB_ALIASGetLibAlias (const LIB_ID &aLibId, bool aUseCacheLib=false, bool aShowError=false)
 Load symbol from symbol library table. More...
 
LIB_PARTGetLibPart (const LIB_ID &aLibId, bool aUseCacheLib=false, bool aShowErrorMsg=false)
 
COMPONENT_SELECTION SelectComponentFromLibBrowser (wxTopLevelWindow *aParent, const SCHLIB_FILTER *aFilter, const LIB_ID &aPreselectedLibid, int aUnit, int aConvert)
 Function SelectComponentFromLibBrowser Calls the library viewer to select component to import into schematic. More...
 
virtual void Zoom_Automatique (bool aWarpPointer) override
 Redraw the screen with best zoom level and the best centering that shows all the page or the board. More...
 
virtual void Window_Zoom (EDA_RECT &aRect) override
 
virtual void RedrawScreen (const wxPoint &aCenterPoint, bool aWarpPointer) override
 Redraw the entire screen area by updating the scroll bars and mouse pointer in order to have aCenterPoint at the center of the screen. More...
 
virtual void RedrawScreen2 (const wxPoint &posBefore) override
 Put the crosshair back to the screen position it had before zooming. More...
 
virtual void CenterScreen (const wxPoint &aCenterPoint, bool aWarpPointer)
 
void AddToScreen (EDA_ITEM *aItem, SCH_SCREEN *aScreen=nullptr)
 Add an item to the screen (and view) aScreen is the screen the item is located on, if not the current screen. More...
 
void RemoveFromScreen (EDA_ITEM *aItem, SCH_SCREEN *aScreen=nullptr)
 Remove an item from the screen (and view) aScreen is the screen the item is located on, if not the current screen. More...
 
void RefreshItem (EDA_ITEM *aItem, bool isAddOrDelete=false)
 Mark an item for refresh. More...
 
void SyncView ()
 Mark all items for refresh. More...
 
void OnOpenLibraryViewer (wxCommandEvent &event)
 Open the library viewer only to browse library contents. More...
 
virtual void OnCharHook (wxKeyEvent &event)
 Capture the key event before it is sent to the GUI. More...
 
bool LockFile (const wxString &aFileName)
 Mark a schematic file as being in use. More...
 
void ReleaseFile ()
 Release the current file marked in use. More...
 
EDA_UNITS_T GetUserUnits () const override
 Return the user units currently in use. More...
 
void SetUserUnits (EDA_UNITS_T aUnits)
 
void ChangeUserUnits (EDA_UNITS_T aUnits)
 
int GetLastGridSizeId () const
 
void SetLastGridSizeId (int aId)
 
wxPoint GetCrossHairPosition (bool aInvertY=false) const
 Return the current cross hair position in logical (drawing) coordinates. More...
 
void SetCrossHairPosition (const wxPoint &aPosition, bool aSnapToGrid=true)
 Set the screen cross hair position to aPosition in logical (drawing) units. More...
 
wxPoint GetCursorPosition (bool aOnGrid, wxRealPoint *aGridSize=NULL) const
 Return the current cursor position in logical (drawing) units. More...
 
wxPoint GetNearestGridPosition (const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
 Return the nearest aGridSize location to aPosition. More...
 
wxPoint GetCrossHairScreenPosition () const
 Return the cross hair position in device (display) units.b. More...
 
void SetMousePosition (const wxPoint &aPosition)
 
wxPoint RefPos (bool useMouse) const
 Return the reference position, coming from either the mouse position or the cursor position. More...
 
const wxPoint & GetScrollCenterPosition () const
 
void SetScrollCenterPosition (const wxPoint &aPoint)
 
virtual COLOR4D GetDrawBgColor () const
 
virtual void SetDrawBgColor (COLOR4D aColor)
 
bool GetShowBorderAndTitleBlock () const
 
void SetShowBorderAndTitleBlock (bool aShow)
 
bool ShowPageLimits () const
 
void SetShowPageLimits (bool aShow)
 
virtual wxString GetScreenDesc () const
 
virtual void ExecuteRemoteCommand (const char *cmdline)
 Execute a remote command send via a socket to the application, port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242) It called by EDA_DRAW_FRAME::OnSockRequest(). More...
 
void OnMenuOpen (wxMenuEvent &event)
 
void OnMouseEvent (wxMouseEvent &event)
 
void SkipNextLeftButtonReleaseEvent ()
 After calling this function, if the left mouse button is down, the next left mouse button release event will be ignored. More...
 
int WriteHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL) override
 

More...
 
EDA_HOTKEY_CONFIGGetHotkeyConfig () const
 Return a structure containing currently used hotkey mapping. More...
 
virtual void AddMenuZoomAndGrid (wxMenu *aMasterMenu)
 Add standard zoom commands and submenu zoom and grid selection to a popup menu uses zoom hotkeys info base to add hotkeys info to menu commands. More...
 
double GetZoomLevelCoeff () const
 Return the coefficient to convert internal display scale factor to zoom level. More...
 
void EraseMsgBox ()
 
void Process_PageSettings (wxCommandEvent &event)
 
virtual void ReCreateAuxiliaryToolbar ()
 
ACTION_TOOLBARGetMainToolBar () const
 
ACTION_TOOLBARGetOptionsToolBar () const
 
ACTION_TOOLBARGetDrawToolBar () const
 
ACTION_TOOLBARGetAuxiliaryToolBar () const
 
bool GetToolToggled (int aToolId)
 Checks all the toolbars and returns true if the given tool id is toggled. More...
 
virtual void SetToolID (int aId, int aCursor, const wxString &aToolMsg)
 Set the tool command ID to aId and sets the cursor to aCursor. More...
 
virtual void SetNoToolSelected ()
 Select the ID_NO_TOOL_SELECTED id tool (Idle tool) More...
 
int GetToolId () const
 
virtual bool IsGridVisible () const
 
virtual void SetGridVisibility (bool aVisible)
 It may be overloaded by derived classes. More...
 
virtual COLOR4D GetGridColor ()
 
virtual void SetGridColor (COLOR4D aColor)
 
wxPoint GetGridPosition (const wxPoint &aPosition) const
 Return the nearest grid position to aPosition if a screen is defined and snap to grid is enabled. More...
 
virtual void SetNextGrid ()
 Change the grid size settings to the next one available. More...
 
virtual void SetPrevGrid ()
 Change the grid size settings to the previous one available. More...
 
void SetPresetGrid (int aIndex)
 Change the grid size to one of the preset values. More...
 
virtual void OnSelectGrid (wxCommandEvent &event)
 Command event handler for selecting grid sizes. More...
 
virtual void OnSelectZoom (wxCommandEvent &event)
 Set the zoom factor when selected by the zoom list box in the main tool bar. More...
 
void OnToggleGridState (wxCommandEvent &aEvent)
 
void OnToggleCrossHairStyle (wxCommandEvent &aEvent)
 
void OnUpdateUndo (wxUpdateUIEvent &aEvent)
 
void OnUpdateRedo (wxUpdateUIEvent &aEvent)
 
void OnUpdateSelectGrid (wxUpdateUIEvent &aEvent)
 
void OnUpdateCrossHairStyle (wxUpdateUIEvent &aEvent)
 
virtual void OnSize (wxSizeEvent &event)
 Recalculate the size of toolbars and display panel when the frame size changes. More...
 
void OnEraseBackground (wxEraseEvent &SizeEvent)
 
virtual void OnZoom (wxCommandEvent &event)
 
void SetNextZoom ()
 Change the zoom to the next one available. More...
 
void SetNextZoomAndRedraw (const wxPoint &aCenterPoint, bool aWarpPointer)
 Change the zoom to the next one available redraws the screen and warp the mouse pointer on request. More...
 
void SetPrevZoom ()
 Change the zoom to the previous one available. More...
 
void SetPreviousZoomAndRedraw (const wxPoint &aCenterPoint, bool aWarpPointer)
 Change the zoom to the previous one available redraws the screen and warp the mouse pointer on request. More...
 
void SetPresetZoom (int aIndex)
 Change zoom to one of the preset values. More...
 
void FocusOnLocation (const wxPoint &aPos, bool aWarpCursor=true, bool aCenterView=false)
 Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor) at a given coordinate and reframes the drawing if the requested point is out of view or if center on location is requested. More...
 
double GetZoom ()
 
void DrawWorkSheet (wxDC *aDC, BASE_SCREEN *aScreen, int aLineWidth, double aScale, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
 Draws on screen the page layout with the frame and the basic inscriptions. More...
 
void DisplayToolMsg (const wxString &msg)
 
wxString GetToolMsg ()
 
virtual void OnLeftClick (wxDC *DC, const wxPoint &MousePos)
 
virtual void OnLeftDClick (wxDC *DC, const wxPoint &MousePos)
 
virtual void ToolOnRightClick (wxCommandEvent &event)
 
void AdjustScrollBars (const wxPoint &aCenterPosition)
 
virtual void OnPageSettingsChange ()
 Called when modifying the page settings. More...
 
void DisplayUnitsMsg ()
 Display current unit pane on the status bar. More...
 
virtual void InitBlockPasteInfos ()
 
virtual int BlockCommand (EDA_KEY aKey)
 Return the block command code (BLOCK_MOVE, BLOCK_COPY...) corresponding to the keys pressed (ALT, SHIFT, SHIFT ALT ..) when block command is started by dragging the mouse. More...
 
virtual void HandleBlockPlace (wxDC *DC)
 Called after HandleBlockEnd, when a block command needs to be executed after the block is moved to its new place (bloc move, drag, copy . More...
 
virtual bool HandleBlockEnd (wxDC *DC)
 Handle the "end" of a block command, i.e. More...
 
void CopyToClipboard (wxCommandEvent &event)
 Copy the current page or the current block to the clipboard. More...
 
void CreateServer (int service, bool local=true)
 
void OnSockRequest (wxSocketEvent &evt)
 
void OnSockRequestServer (wxSocketEvent &evt)
 
void AppendMsgPanel (const wxString &textUpper, const wxString &textLower, COLOR4D color, int pad=6)
 Append a message to the message panel. More...
 
void SetMsgPanel (const std::vector< MSG_PANEL_ITEM > &aList)
 Clear the message panel and populates it with the contents of aList. More...
 
void SetMsgPanel (EDA_ITEM *aItem)
 
virtual void UpdateMsgPanel ()
 Redraw the message panel. More...
 
void PushPreferences (const EDA_DRAW_PANEL *aParentCanvas)
 Push preferences from a parent window to a child window. More...
 
EDA_DRAW_PANEL_GAL::GAL_TYPE LoadCanvasTypeSetting ()
 Returns the canvas type stored in the application settings. More...
 
virtual void UseGalCanvas (bool aEnable)
 Use to switch between standard and GAL-based canvas. More...
 
virtual bool SwitchCanvas (EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
 Changes the current rendering backend. More...
 
bool IsGalCanvasActive () const
 Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use. More...
 
EDA_DRAW_PANEL_GALGetGalCanvas () const
 Return a pointer to GAL-based canvas of given EDA draw frame. More...
 
void SetGalCanvas (EDA_DRAW_PANEL_GAL *aPanel)
 
TOOL_MANAGERGetToolManager () const override
 Return the tool manager instance, if any. More...
 
virtual void * GetDisplayOptions ()
 A way to pass info to draw functions. More...
 
KIGFX::GAL_DISPLAY_OPTIONSGetGalDisplayOptions ()
 Return a reference to the gal rendering options used by GAL for rendering. More...
 
bool GetShowAxis () const
 
bool GetShowGridAxis () const
 
bool GetShowOriginAxis () const
 
VTBL_ENTRY bool OpenProjectFiles (const std::vector< wxString > &aFileList, int aCtl=0)
 Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList. More...
 
VTBL_ENTRY bool ShowModal (wxString *aResult=NULL, wxWindow *aResultantFocusWindow=NULL)
 Function ShowModal puts up this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until this KIWAY_PLAYER derivative calls DismissModal(). More...
 
bool Destroy () override
 Our version of Destroy() which is virtual from wxWidgets. More...
 
bool ProcessEvent (wxEvent &aEvent) override
 Override the default process event handler to implement the auto save feature. More...
 
void SetAutoSaveInterval (int aInterval)
 
int GetAutoSaveInterval () const
 
bool IsType (FRAME_T aType) const
 
void GetKicadHelp (wxCommandEvent &event)
 
void GetKicadContribute (wxCommandEvent &event)
 
void GetKicadAbout (wxCommandEvent &event)
 
bool ShowPreferences (EDA_HOTKEY_CONFIG *aHotkeys, EDA_HOTKEY_CONFIG *aShowHotkeys, const wxString &aHotkeysNickname)
 
void PrintMsg (const wxString &text)
 
wxString ConfigBaseName ()
 
virtual void SaveProjectSettings (bool aAskForSave)
 Save changes to the project settings to the project (.pro) file. More...
 
void ImportHotkeyConfigFromFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Prompt the user for an old hotkey file to read, and read it. More...
 
void ExportHotkeyConfigToFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Prompt the user for an old hotkey file to read, and read it. More...
 
wxString GetFileFromHistory (int cmdId, const wxString &type, wxFileHistory *aFileHistory=NULL)
 Fetches the file name from the file history list. More...
 
void UpdateFileHistory (const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
 Update the list of recently opened files. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
bool IsWritable (const wxFileName &aFileName)
 Checks if aFileName can be written. More...
 
void CheckForAutoSaveFile (const wxFileName &aFileName)
 Check if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More...
 
bool PostCommandMenuEvent (int evt_type)
 Post a menu event to the frame, which can be used to trigger actions bound to menu items. More...
 
const wxString & GetAboutTitle () const
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Static Public Member Functions

static int GetPinNumDefaultSize ()
 
static void SetPinNumDefaultSize (int aSize)
 
static int GetPinNameDefaultSize ()
 
static void SetPinNameDefaultSize (int aSize)
 
static int GetDefaultPinLength ()
 
static void SetDefaultPinLength (int aLength)
 Set the default pin len. More...
 

Public Attributes

bool m_SyncPinEdit
 Set to true to not synchronize pins at the same position when editing symbols with multiple units or multiple body styles. More...
 
bool m_DrawSpecificConvert
 Convert of the item currently being drawn. More...
 
bool m_DrawSpecificUnit
 Specify which component parts the current draw item applies to. More...
 

Static Public Attributes

static int g_LastTextSize = -1
 
static double g_LastTextAngle = TEXT_ANGLE_HORIZ
 
static FILL_T g_LastFillStyle = NO_FILL
 
static int g_LastLineWidth = 0
 

Protected Member Functions

bool saveSymbolLibTables (bool aGlobal, bool aProject)
 Saves Symbol Library Tables to disk. More...
 
virtual bool HandleBlockBegin (wxDC *aDC, EDA_KEY aKey, const wxPoint &aPosition, int aExplicitCommand=0) override
 Initialize a block command. More...
 
double bestZoom (double sizeX, double sizeY, double scaleFactor, wxPoint centre)
 
virtual void unitsChangeRefresh ()
 Called when when the units setting has changed to allow for any derived classes to handle refreshing and controls that have units based measurements in them. More...
 
bool LibraryFileBrowser (bool doOpen, wxFileName &aFilename, const wxString &wildcard, const wxString &ext, bool isDirectory=false)
 
bool GeneralControlKeyMovement (int aHotKey, wxPoint *aPos, bool aSnapToGrid)
 Handle the common part of GeneralControl dedicated to global cursor keys (i.e. More...
 
void RefreshCrossHair (const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC *aDC)
 Move and refresh the crosshair after movement and call the mouse capture function. More...
 
bool saveCanvasTypeSetting (EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
 Stores the canvas type in the application settings. More...
 
bool saveCanvasImageToFile (const wxString &aFileName, wxBitmapType aBitmapType=wxBITMAP_TYPE_PNG)
 
virtual wxString GetCanvasTypeKey ()
 
bool IsModal ()
 
void SetModal (bool aIsModal)
 
bool IsDismissed ()
 Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal(). More...
 
void DismissModal (bool aRetVal, const wxString &aResult=wxEmptyString)
 
void kiway_express (KIWAY_EXPRESS &aEvent)
 event handler, routes to derivative specific virtual KiwayMailIn() More...
 
void language_change (wxCommandEvent &event)
 Function language_change is an event handler called on a language menu selection. More...
 
void onAutoSaveTimer (wxTimerEvent &aEvent)
 Handle the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Return the auto save status of the application. More...
 
virtual bool doAutoSave ()
 This should be overridden by the derived class to handle the auto save feature. More...
 
virtual wxConfigBase * config ()
 Return the wxConfigBase used in SaveSettings(). More...
 
virtual const SEARCH_STACKsys_search ()
 Return a SEARCH_STACK pertaining to entire program. More...
 
virtual wxString help_name ()
 

Static Protected Member Functions

static wxString GetBackupSuffix ()
 
static wxString GetAutoSaveFilePrefix ()
 

Protected Attributes

TEMPLATES m_templateFieldNames
 
wxPoint m_repeatStep
 the increment value of the position of an item when it is repeated More...
 
int m_repeatDeltaLabel
 the increment value of labels like bus members when they are repeated More...
 
bool m_showPinElectricalTypeName
 
bool m_galCanvasActive
 whether to use new GAL engine More...
 
bool m_useSingleCanvasPane
 
wxSocketServer * m_socketServer
 
std::vector< wxSocketBase * > m_sockets
 interprocess communication More...
 
std::unique_ptr< wxSingleInstanceChecker > m_file_checker
 prevents opening same file multiple times. More...
 
EDA_HOTKEY_CONFIGm_hotkeysDescrList
 
int m_LastGridSizeId
 
bool m_drawGrid
 
bool m_showPageLimits
 true to display the page limits More...
 
COLOR4D m_gridColor
 Grid color. More...
 
COLOR4D m_drawBgColor
 the background color of the draw canvas BLACK for Pcbnew, BLACK or WHITE for eeschema More...
 
double m_zoomLevelCoeff
 a suitable value to convert the internal zoom scaling factor More...
 
int m_UndoRedoCountMax
 default Undo/Redo command Max depth, to be handed More...
 
EDA_UNITS_T m_UserUnits
 
EDA_DRAW_PANELm_canvas
 The area to draw on. More...
 
TOOL_MANAGERm_toolManager
 
TOOL_DISPATCHERm_toolDispatcher
 
ACTIONSm_actions
 
int m_lastDrawToolId
 Tool ID of previously active draw tool bar button. More...
 
bool m_showAxis
 True shows the X and Y axis indicators. More...
 
bool m_showGridAxis
 True shows the grid axis indicators. More...
 
bool m_showOriginAxis
 True shows the origin axis used to indicate the coordinate offset for drill, gerber, and component position files. More...
 
bool m_showBorderAndTitleBlock
 True shows the drawing border and title block. More...
 
long m_firstRunDialogSetting
 Key to control whether first run dialog is shown on startup. More...
 
wxChoice * m_gridSelectBox
 
wxChoice * m_zoomSelectBox
 
ACTION_TOOLBARm_mainToolBar
 
ACTION_TOOLBARm_auxiliaryToolBar
 Auxiliary tool bar typically shown below the main tool bar at the top of the main window. More...
 
ACTION_TOOLBARm_drawToolBar
 The tool bar that contains the buttons for quick access to the application draw tools. More...
 
ACTION_TOOLBARm_optionsToolBar
 The options tool bar typcially located on the left edge of the main window. More...
 
EDA_MSG_PANELm_messagePanel
 Panel used to display information at the bottom of the main window. More...
 
int m_MsgFrameHeight
 
bool m_movingCursorWithKeyboard
 One-shot to avoid a recursive mouse event during hotkey movement. More...
 
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
 The current canvas type. More...
 
bool m_modal
 
WX_EVENT_LOOPm_modal_loop
 
wxWindow * m_modal_resultant_parent
 
wxString m_modal_string
 
bool m_modal_ret_val
 
FRAME_T m_Ident
 Id Type (pcb, schematic, library..) More...
 
wxPoint m_FramePos
 
wxSize m_FrameSize
 
wxString m_configFrameName
 prefix used in config to identify some params (frame size...) More...
 
wxString m_AboutTitle
 Name of program displayed in About. More...
 
wxAuiManager m_auimgr
 
bool m_hasAutoSave
 Flag to indicate if this frame supports auto save. More...
 
bool m_autoSaveState
 Flag to indicate the last auto save state. More...
 
int m_autoSaveInterval
 The auto save interval time in seconds. More...
 
wxTimer * m_autoSaveTimer
 The timer used to implement the auto save feature;. More...
 
wxString m_perspective
 wxAuiManager perspective. More...
 
wxString m_mruPath
 Most recently used path. More...
 

Static Protected Attributes

static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND
 

Default style flags used for wxAUI toolbars

More...
 

Private Member Functions

void setupTools ()
 
void loadPart (const wxString &aLibrary, const wxString &aPart, int Unit)
 
void savePartAs ()
 
bool saveLibrary (const wxString &aLibrary, bool aNewFile)
 Saves the changes to the current library. More...
 
void updateTitle ()
 Updates the main window title bar with the current library name and read only status of the library. More...
 
virtual void OnActivate (wxActivateEvent &event) override
 Called when the frame is activated. More...
 
void SelectActiveLibrary (const wxString &aLibrary=wxEmptyString)
 Set the current active library to aLibrary. More...
 
wxString SelectLibraryFromList ()
 Dispaly a list of loaded libraries in the symbol library and allows the user to select a library. More...
 
bool LoadComponentFromCurrentLib (const wxString &aAliasName, int aUnit=0, int aConvert=0)
 Loads a symbol from the current active library, optionally setting the selected unit and convert. More...
 
bool LoadOneLibraryPartAux (LIB_ALIAS *aLibEntry, const wxString &aLibrary, int aUnit, int aConvert)
 Create a copy of aLibEntry into memory. More...
 
void DisplayCmpDoc ()
 Display the documentation of the selected component. More...
 
void LoadOneSymbol ()
 Read a component symbol file (*.sym ) and add graphic items to the current component. More...
 
void SaveOneSymbol ()
 Saves the current symbol to a symbol file. More...
 
void refreshSchematic ()
 
SYMBOL_LIB_TABLEselectSymLibTable (bool aOptional=false)
 Displays a dialog asking the user to select a symbol library table. More...
 
bool backupFile (const wxFileName &aOriginalFile, const wxString &aBackupExt)
 

Creates a backup copy of a file with requested extension

More...
 
LIB_PARTgetTargetPart () const
 

Returns currently edited part.

More...
 
LIB_ID getTargetLibId () const
 

Returns either the part selected in the component tree, if context menu is active or the currently modified part.

More...
 
wxString getTargetLib () const
 

Returns either the library selected in the component tree, if context menu is active or the library that is currently modified.

More...
 
bool saveAllLibraries (bool aRequireConfirmation)
 
bool saveCurrentPart ()
 

Saves the current part.

More...
 
bool addLibraryFile (bool aCreateNew)
 

Creates or adds an existing library to the symbol library table.

More...
 
void storeCurrentPart ()
 

Stores the currently modified part in the library manager buffer.

More...
 
bool isCurrentPart (const LIB_ID &aLibId) const
 

Returns true if aLibId is an alias for the editor screen part.

More...
 
void emptyScreen ()
 

Restores the empty editor screen, without any part or library selected.

More...
 
void fixDuplicateAliases (LIB_PART *aPart, const wxString &aLibrary)
 

Renames LIB_PART aliases to avoid conflicts before adding a component to a library

More...
 

Private Attributes

LIB_PARTm_my_part
 a part I own, it is not in any library, but a copy could be. More...
 
wxComboBox * m_partSelectBox
 a Box to select a part to edit (if any) More...
 
SYMBOL_TREE_PANEm_treePane
 component search tree widget More...
 
LIB_MANAGERm_libMgr
 manager taking care of temporary modificatoins More...
 
int m_unit
 
int m_convert
 
int m_repeatPinStep
 Default repeat offset for pins in repeat place pin. More...
 
int m_defaultLibWidth
 
SCH_SCREENm_dummyScreen
 

Helper screen used when no part is loaded

More...
 
BLOCK_SELECTOR m_clipboard
 

Clipboard buffer storing LIB_ITEMs

More...
 

Static Private Attributes

static bool m_showDeMorgan = false
 
static int m_textPinNumDefaultSize = DEFAULTPINNUMSIZE
 The default pin num text size setting. More...
 
static int m_textPinNameDefaultSize = DEFAULTPINNAMESIZE
 The default pin name text size setting. More...
 
static int m_defaultPinLength = DEFAULTPINLENGTH
 Default pin length. More...
 

Detailed Description

The symbol library editor main window.

Definition at line 51 of file lib_edit_frame.h.

Member Typedef Documentation

◆ HISTORY_LIST

typedef std::vector<COMPONENT_SELECTION> SCH_BASE_FRAME::HISTORY_LIST
inherited

Definition at line 205 of file sch_base_frame.h.

Constructor & Destructor Documentation

◆ LIB_EDIT_FRAME()

LIB_EDIT_FRAME::LIB_EDIT_FRAME ( KIWAY aKiway,
wxWindow *  aParent 
)

◆ ~LIB_EDIT_FRAME()

LIB_EDIT_FRAME::~LIB_EDIT_FRAME ( )

Definition at line 263 of file lib_edit_frame.cpp.

264 {
265  Unbind( wxEVT_COMMAND_MENU_SELECTED, &LIB_EDIT_FRAME::OnEditSymbolLibTable, this,
267 
268  // current screen is destroyed in EDA_DRAW_FRAME
270 
271  delete m_libMgr;
272  delete m_my_part;
273 }
void OnEditSymbolLibTable(wxCommandEvent &aEvent) override
LIB_MANAGER * m_libMgr
manager taking care of temporary modificatoins
LIB_PART * m_my_part
a part I own, it is not in any library, but a copy could be.
virtual void SetScreen(BASE_SCREEN *aScreen) override
SCH_SCREEN * m_dummyScreen
Helper screen used when no part is loaded

References ID_EDIT_SYM_LIB_TABLE, m_dummyScreen, m_libMgr, m_my_part, OnEditSymbolLibTable(), and SetScreen().

Member Function Documentation

◆ addLibraryFile()

bool LIB_EDIT_FRAME::addLibraryFile ( bool  aCreateNew)
private

Creates or adds an existing library to the symbol library table.

Definition at line 711 of file lib_edit_frame.cpp.

712 {
713  wxFileName fn = m_libMgr->GetUniqueLibraryName();
714 
715  if( !LibraryFileBrowser( !aCreateNew, fn, SchematicLibraryFileWildcard(),
717  {
718  return false;
719  }
720 
721  wxString libName = fn.GetName();
722 
723  if( libName.IsEmpty() )
724  return false;
725 
726  if( m_libMgr->LibraryExists( libName ) )
727  {
728  DisplayError( this, wxString::Format( _( "Library \"%s\" already exists" ), libName ) );
729  return false;
730  }
731 
732  // Select the target library table (global/project)
733  SYMBOL_LIB_TABLE* libTable = selectSymLibTable();
734 
735  if( !libTable )
736  return false;
737 
738  if( aCreateNew )
739  {
740  if( !m_libMgr->CreateLibrary( fn.GetFullPath(), libTable ) )
741  {
742  DisplayError( this, wxString::Format( _( "Could not create the library file '%s'.\n"
743  "Check write permission." ),
744  fn.GetFullPath() ) );
745  return false;
746  }
747  }
748  else
749  {
750  if( !m_libMgr->AddLibrary( fn.GetFullPath(), libTable ) )
751  {
752  DisplayError( this, _( "Could not open the library file." ) );
753  return false;
754  }
755  }
756 
757  bool globalTable = ( libTable == &SYMBOL_LIB_TABLE::GetGlobalLibTable() );
758  saveSymbolLibTables( globalTable, !globalTable );
759 
760  return true;
761 }
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
bool CreateLibrary(const wxString &aFilePath, SYMBOL_LIB_TABLE *aTable)
Creates an empty library and adds it to the library table.
Definition: lib_manager.h:91
LIB_MANAGER * m_libMgr
manager taking care of temporary modificatoins
wxString SchematicLibraryFileWildcard()
bool AddLibrary(const wxString &aFilePath, SYMBOL_LIB_TABLE *aTable)
Adds an existing library.
Definition: lib_manager.h:99
wxString GetUniqueLibraryName() const
Returns a library name that is not currently in use.
const std::string SchematicLibraryFileExtension
bool LibraryFileBrowser(bool doOpen, wxFileName &aFilename, const wxString &wildcard, const wxString &ext, bool isDirectory=false)
bool saveSymbolLibTables(bool aGlobal, bool aProject)
Saves Symbol Library Tables to disk.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
bool LibraryExists(const wxString &aLibrary, bool aCheckEnabled=false) const
Returns true if library exists.
SYMBOL_LIB_TABLE * selectSymLibTable(bool aOptional=false)
Displays a dialog asking the user to select a symbol library table.
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:244

References LIB_MANAGER::AddLibrary(), LIB_MANAGER::CreateLibrary(), DisplayError(), Format(), SYMBOL_LIB_TABLE::GetGlobalLibTable(), LIB_MANAGER::GetUniqueLibraryName(), LIB_MANAGER::LibraryExists(), EDA_DRAW_FRAME::LibraryFileBrowser(), m_libMgr, SCH_BASE_FRAME::saveSymbolLibTables(), SchematicLibraryFileExtension, SchematicLibraryFileWildcard(), and selectSymLibTable().

Referenced by OnAddLibrary(), and OnCreateNewLibrary().

◆ AddMenuZoomAndGrid()

void EDA_DRAW_FRAME::AddMenuZoomAndGrid ( wxMenu *  aMasterMenu)
virtualinherited

Add standard zoom commands and submenu zoom and grid selection to a popup menu uses zoom hotkeys info base to add hotkeys info to menu commands.

Parameters
aMasterMenu= the menu to populate.

Definition at line 1012 of file legacy_gal/eda_draw_frame.cpp.

1013 {
1014  wxFAIL_MSG( "Obsolete! Should go through COMMON_TOOLS." );
1015 }

Referenced by EDA_DRAW_PANEL::OnRightClick().

◆ AddToScreen()

void SCH_BASE_FRAME::AddToScreen ( EDA_ITEM aItem,
SCH_SCREEN aScreen = nullptr 
)
inherited

Add an item to the screen (and view) aScreen is the screen the item is located on, if not the current screen.

Definition at line 637 of file sch_base_frame.cpp.

638 {
639  auto screen = aScreen;
640 
641  if( aScreen == nullptr )
642  screen = GetScreen();
643 
644  screen->Append( (SCH_ITEM*) aItem );
645 
646  if( screen == GetScreen() )
647  {
648  GetCanvas()->GetView()->Add( aItem );
649  RefreshItem( aItem, true ); // handle any additional parent semantics
650  }
651 }
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_DRAW_PANEL * GetCanvas() const override
KIGFX::SCH_VIEW * GetView() const
void RefreshItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:346
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114

References KIGFX::VIEW::Add(), SCH_BASE_FRAME::GetCanvas(), SCH_BASE_FRAME::GetScreen(), SCH_DRAW_PANEL::GetView(), and SCH_BASE_FRAME::RefreshItem().

Referenced by SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_EDIT_FRAME::AddJunction(), SCH_EDIT_FRAME::AddMissingJunctions(), SCH_EDIT_FRAME::BreakSegment(), SCH_EDIT_FRAME::ConvertTextType(), SCH_EDIT_FRAME::DeleteJunction(), SCH_WIRE_BUS_TOOL::doDrawSegments(), SCH_WIRE_BUS_TOOL::doUnfoldBus(), SCH_EDIT_TOOL::Duplicate(), SCH_WIRE_BUS_TOOL::finishSegments(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), and SCH_EDIT_FRAME::SchematicCleanUp().

◆ AdjustScrollBars()

void EDA_DRAW_FRAME::AdjustScrollBars ( const wxPoint &  aCenterPosition)
inherited

Definition at line 669 of file legacy_gal/eda_draw_frame.cpp.

670 {
671 }

◆ AppendMsgPanel()

void EDA_DRAW_FRAME::AppendMsgPanel ( const wxString &  textUpper,
const wxString &  textLower,
COLOR4D  color,
int  pad = 6 
)
inherited

Append a message to the message panel.

This helper method checks to make sure the message panel exists in the frame and appends a message to it using the message panel AppendMessage() method.

Parameters
textUpper- The message upper text.
textLower- The message lower text.
color- A color ID from the KiCad color list (see colors.h).
pad- Number of spaces to pad between messages (default = 4).

Definition at line 609 of file legacy_gal/eda_draw_frame.cpp.

611 {
612  if( m_messagePanel == NULL )
613  return;
614 
615  m_messagePanel->AppendMessage( textUpper, textLower, color, pad );
616 }
int color
Definition: DXF_plotter.cpp:62
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:169
void AppendMessage(const wxString &aUpperText, const wxString &aLowerText, COLOR4D aColor, int aPad=6)
Function AppendMessage appends a message to the message panel.
Definition: msgpanel.cpp:110

References EDA_MSG_PANEL::AppendMessage(), color, and EDA_DRAW_FRAME::m_messagePanel.

Referenced by SCH_EDIT_FRAME::AppendSchematic(), PCB_BASE_FRAME::Compile_Ratsnest(), DisplayCmpDoc(), GERBER_FILE_IMAGE::DisplayImageInfo(), SCH_EDIT_FRAME::EditSheet(), SCH_EDIT_FRAME::importFile(), SCH_PRINTOUT::OnPrintPage(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::SaveEEFile(), saveLibrary(), PCB_EDIT_FRAME::SavePcbFile(), ShowNewTrackWhenMovingCursor(), and LIB_VIEW_FRAME::updatePreviewSymbol().

◆ backupFile()

bool LIB_EDIT_FRAME::backupFile ( const wxFileName &  aOriginalFile,
const wxString &  aBackupExt 
)
private

Creates a backup copy of a file with requested extension

Definition at line 885 of file lib_edit_frame.cpp.

886 {
887  if( aOriginalFile.FileExists() )
888  {
889  wxFileName backupFileName( aOriginalFile );
890  backupFileName.SetExt( "bck" );
891 
892  if( backupFileName.FileExists() )
893  wxRemoveFile( backupFileName.GetFullPath() );
894 
895  if( !wxCopyFile( aOriginalFile.GetFullPath(), backupFileName.GetFullPath() ) )
896  {
897  DisplayError( this, wxString::Format( _( "Failed to save backup to \"%s\"" ),
898  backupFileName.GetFullPath() ) );
899  return false;
900  }
901  }
902 
903  return true;
904 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:244

References DisplayError(), and Format().

Referenced by saveLibrary().

◆ bestZoom()

double EDA_DRAW_FRAME::bestZoom ( double  sizeX,
double  sizeY,
double  scaleFactor,
wxPoint  centre 
)
protectedinherited

◆ BestZoom()

double LIB_EDIT_FRAME::BestZoom ( )
overridevirtual

Return the zoom level which displays the full page on screen.

Implements EDA_DRAW_FRAME.

Definition at line 315 of file lib_edit_frame.cpp.

316 {
317  LIB_PART* part = GetCurPart();
318  double defaultLibraryZoom = 7.33;
319 
320  if( !part )
321  {
322  SetScrollCenterPosition( wxPoint( 0, 0 ) );
323  return defaultLibraryZoom;
324  }
325 
327 
328  double sizeX = (double) boundingBox.GetWidth();
329  double sizeY = (double) boundingBox.GetHeight();
330  wxPoint centre = boundingBox.Centre();
331 
332  // Reserve a 20% margin around component bounding box.
333  double margin_scale_factor = 1.2;
334 
335  return bestZoom( sizeX, sizeY, margin_scale_factor, centre);
336 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
double bestZoom(double sizeX, double sizeY, double scaleFactor, wxPoint centre)
void SetScrollCenterPosition(const wxPoint &aPoint)
BOX2I boundingBox(T aObject)
boundingBox template method
Definition: shape_index.h:59
coord_type GetWidth() const
Definition: box2.h:195
Define a library symbol object.
Vec Centre() const
Definition: box2.h:77
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
coord_type GetHeight() const
Definition: box2.h:196

References EDA_DRAW_FRAME::bestZoom(), boundingBox(), BOX2< Vec >::Centre(), GetCurPart(), BOX2< Vec >::GetHeight(), LIB_PART::GetUnitBoundingBox(), BOX2< Vec >::GetWidth(), m_convert, m_unit, and EDA_DRAW_FRAME::SetScrollCenterPosition().

◆ BlockCommand()

int EDA_DRAW_FRAME::BlockCommand ( EDA_KEY  aKey)
virtualinherited

Return the block command code (BLOCK_MOVE, BLOCK_COPY...) corresponding to the keys pressed (ALT, SHIFT, SHIFT ALT ..) when block command is started by dragging the mouse.

Parameters
aKey= the key modifiers (Alt, Shift ...)
Returns
the block command id (BLOCK_MOVE, BLOCK_COPY...)

Reimplemented in PCB_EDIT_FRAME, GERBVIEW_FRAME, FOOTPRINT_EDIT_FRAME, and PL_EDITOR_FRAME.

Definition at line 503 of file legacy_gal/eda_draw_frame.cpp.

504 {
505  wxFAIL_MSG( "Obsolete; how'd we get here?" );
506  return 0;
507 }

Referenced by SCH_BASE_FRAME::HandleBlockBegin().

◆ CenterScreen()

void SCH_BASE_FRAME::CenterScreen ( const wxPoint &  aCenterPoint,
bool  aWarpPointer 
)
virtualinherited

Definition at line 475 of file sch_base_frame.cpp.

476 {
477  GetCanvas()->GetView()->SetCenter( aCenterPoint );
478 
479  if( aWarpPointer )
480  GetCanvas()->GetViewControls()->WarpCursor( aCenterPoint, true );
481 
482  GetGalCanvas()->Refresh();
483 }
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
Function WarpCursor() If enabled (.
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:601
SCH_DRAW_PANEL * GetCanvas() const override
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
KIGFX::SCH_VIEW * GetView() const

References SCH_BASE_FRAME::GetCanvas(), EDA_DRAW_FRAME::GetGalCanvas(), SCH_DRAW_PANEL::GetView(), EDA_DRAW_PANEL_GAL::GetViewControls(), EDA_DRAW_PANEL_GAL::Refresh(), KIGFX::VIEW::SetCenter(), and KIGFX::VIEW_CONTROLS::WarpCursor().

Referenced by SCH_EDIT_FRAME::DisplayCurrentSheet(), SCH_EDIT_FRAME::FindComponentAndItem(), SCH_EDIT_FRAME::OnFindDrcMarker(), and SCH_EDIT_FRAME::updateFindReplaceView().

◆ ChangeUserUnits()

void EDA_DRAW_FRAME::ChangeUserUnits ( EDA_UNITS_T  aUnits)
inlineinherited

Definition at line 292 of file draw_frame.h.

293  {
294  SetUserUnits( aUnits );
296  }
virtual void unitsChangeRefresh()
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
void SetUserUnits(EDA_UNITS_T aUnits)
Definition: draw_frame.h:290

References EDA_DRAW_FRAME::SetUserUnits(), and EDA_DRAW_FRAME::unitsChangeRefresh().

Referenced by COMMON_TOOLS::ImperialUnits(), COMMON_TOOLS::MetricUnits(), CVPCB_CONTROL::SwitchUnits(), GERBVIEW_CONTROL::SwitchUnits(), and COMMON_TOOLS::ToggleUnits().

◆ CheckForAutoSaveFile()

void EDA_BASE_FRAME::CheckForAutoSaveFile ( const wxFileName &  aFileName)
inherited

Check if an auto save file exists for aFileName and takes the appropriate action depending on the user input.

If an auto save file exists for aFileName, the user is prompted if they wish to replace file aFileName with the auto saved file. If the user chooses to replace the file, the backup file of aFileName is removed, aFileName is renamed to the backup file name, and the auto save file is renamed to aFileName. If user chooses to keep the existing version of aFileName, the auto save file is removed.

Parameters
aFileNameA wxFileName object containing the file name to check.

Definition at line 584 of file eda_base_frame.cpp.

585 {
586  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
587 
588  wxFileName autoSaveFileName = aFileName;
589 
590  // Check for auto save file.
591  autoSaveFileName.SetName( GetAutoSaveFilePrefix() + aFileName.GetName() );
592 
593  wxLogTrace( traceAutoSave,
594  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
595 
596  if( !autoSaveFileName.FileExists() )
597  return;
598 
599  wxString msg = wxString::Format( _(
600  "Well this is potentially embarrassing!\n"
601  "It appears that the last time you were editing the file\n"
602  "\"%s\"\n"
603  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
604  GetChars( aFileName.GetFullName() )
605  );
606 
607  int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this );
608 
609  // Make a backup of the current file, delete the file, and rename the auto save file to
610  // the file name.
611  if( response == wxYES )
612  {
613  // Get the backup file name.
614  wxFileName backupFileName = aFileName;
615  backupFileName.SetExt( aFileName.GetExt() + GetBackupSuffix() );
616 
617  // If an old backup file exists, delete it. If an old copy of the file exists, rename
618  // it to the backup file name
619  if( aFileName.FileExists() )
620  {
621  // Rename the old file to the backup file name.
622  if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath(), true ) )
623  {
624  msg.Printf( _( "Could not create backup file \"%s\"" ),
625  GetChars( backupFileName.GetFullPath() ) );
626  wxMessageBox( msg );
627  }
628  }
629 
630  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
631  {
632  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
633  Pgm().App().GetAppName(), wxOK | wxICON_EXCLAMATION, this );
634  }
635  }
636  else
637  {
638  wxLogTrace( traceAutoSave,
639  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
640 
641  // Remove the auto save file when using the previous file as is.
642  wxRemoveFile( autoSaveFileName.GetFullPath() );
643  }
644 }
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
static wxString GetBackupSuffix()
static wxString GetAutoSaveFilePrefix()
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

References Format(), EDA_BASE_FRAME::GetAutoSaveFilePrefix(), EDA_BASE_FRAME::GetBackupSuffix(), GetChars(), Pgm(), and traceAutoSave.

Referenced by SCH_EDIT_FRAME::OpenProjectFiles(), and PCB_EDIT_FRAME::OpenProjectFiles().

◆ ClearMsgPanel()

void LIB_EDIT_FRAME::ClearMsgPanel ( )
inlineoverridevirtual

Clear all messages from the message panel.

Reimplemented from EDA_DRAW_FRAME.

Definition at line 366 of file lib_edit_frame.h.

366 { DisplayCmpDoc(); }
void DisplayCmpDoc()
Display the documentation of the selected component.
Definition: libedit.cpp:927

References DisplayCmpDoc().

Referenced by saveLibrary().

◆ ClearSearchTreeSelection()

void LIB_EDIT_FRAME::ClearSearchTreeSelection ( )

Definition at line 398 of file lib_edit_frame.cpp.

399 {
401 }
void Unselect()
Unselect currently selected item in wxDataViewCtrl.
Definition: lib_tree.cpp:177
LIB_TREE * GetLibTree() const
SYMBOL_TREE_PANE * m_treePane
component search tree widget

References SYMBOL_TREE_PANE::GetLibTree(), m_treePane, and LIB_TREE::Unselect().

Referenced by GeneralControl().

◆ CloseWindow()

void LIB_EDIT_FRAME::CloseWindow ( wxCommandEvent &  event)
inline

Trigger the wxCloseEvent, which is handled by the function given to EVT_CLOSE() macro:

EVT_CLOSE( LIB_EDIT_FRAME::OnCloseWindow )

Definition at line 347 of file lib_edit_frame.h.

348  {
349  // Generate a wxCloseEvent
350  Close( false );
351  }

◆ CommonSettingsChanged()

void LIB_EDIT_FRAME::CommonSettingsChanged ( )
overridevirtual

Called after the preferences dialog is run.

Reimplemented from EDA_BASE_FRAME.

Definition at line 934 of file lib_edit_frame.cpp.

935 {
937 
941  Layout();
942  SendSizeEvent();
943 }
void CommonSettingsChanged() override
Notification event that some of the common (suite-wide) settings have changed.
void ReCreateHToolbar() override
void ReCreateVToolbar() override

References EDA_DRAW_FRAME::CommonSettingsChanged(), ReCreateHToolbar(), ReCreateOptToolbar(), and ReCreateVToolbar().

◆ config()

wxConfigBase * EDA_BASE_FRAME::config ( )
protectedvirtualinherited

Return the wxConfigBase used in SaveSettings().

This is overloaded in KICAD_MANAGER_FRAME

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 359 of file eda_base_frame.cpp.

360 {
361  // KICAD_MANAGER_FRAME overrides this
362  wxConfigBase* ret = Kiface().KifaceSettings();
363  //wxASSERT( ret );
364  return ret;
365 }
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:103
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52

References Kiface(), and KIFACE_I::KifaceSettings().

Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), PCB_EDIT_FRAME::GetSettings(), SIM_PLOT_FRAME::onClose(), FOOTPRINT_WIZARD_FRAME::OnCloseWindow(), OnPreferencesOptions(), SCH_EDIT_FRAME::OnPreferencesOptions(), SCH_EDIT_FRAME::OpenProjectFiles(), PL_EDITOR_FRAME::PL_EDITOR_FRAME(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and EDA_BASE_FRAME::windowClosing().

◆ ConfigBaseName()

wxString EDA_BASE_FRAME::ConfigBaseName ( )
inlineinherited
Returns
a base name prefix used in Load/Save settings to build the full name of keys used in config. This is usually the name of the frame set by CTOR, unless m_configFrameName contains a base name. this is the case of frames which can be shown in normal or modal mode. This is needed because we want only one base name prefix, regardless the mode used.

Definition at line 266 of file eda_base_frame.h.

267  {
268  wxString baseCfgName = m_configFrameName.IsEmpty() ? GetName() : m_configFrameName;
269  return baseCfgName;
270  }
wxString m_configFrameName
prefix used in config to identify some params (frame size...)

References EDA_BASE_FRAME::m_configFrameName.

Referenced by DISPLAY_FOOTPRINTS_FRAME::LoadSettings(), FOOTPRINT_VIEWER_FRAME::LoadSettings(), EDA_BASE_FRAME::LoadSettings(), EDA_DRAW_FRAME::LoadSettings(), DISPLAY_FOOTPRINTS_FRAME::SaveSettings(), FOOTPRINT_VIEWER_FRAME::SaveSettings(), EDA_BASE_FRAME::SaveSettings(), EDA_DRAW_FRAME::SaveSettings(), and EDA_BASE_FRAME::WriteHotkeyConfig().

◆ CopyToClipboard()

void EDA_DRAW_FRAME::CopyToClipboard ( wxCommandEvent &  event)
inherited

Copy the current page or the current block to the clipboard.

Definition at line 1057 of file legacy_gal/eda_draw_frame.cpp.

1058 {
1059  DrawPageOnClipboard( this );
1060 }
static bool DrawPageOnClipboard(EDA_DRAW_FRAME *aFrame)

References DrawPageOnClipboard().

◆ createCanvas()

void SCH_BASE_FRAME::createCanvas ( )
inherited

Definition at line 592 of file sch_base_frame.cpp.

593 {
595 
596  // Allows only a CAIRO or OPENGL canvas:
599  {
601  }
602 
603  m_canvas = new SCH_DRAW_PANEL( this, wxID_ANY, wxPoint( 0, 0 ), m_FrameSize,
605 
606  m_useSingleCanvasPane = true;
607 
608  SetGalCanvas( static_cast<SCH_DRAW_PANEL*> (m_canvas) );
609  UseGalCanvas( true );
610 }
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
Definition: draw_frame.h:949
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
The current canvas type.
Definition: draw_frame.h:182
EDA_DRAW_PANEL_GAL::GAL_TYPE LoadCanvasTypeSetting()
Returns the canvas type stored in the application settings.
void SetGalCanvas(EDA_DRAW_PANEL_GAL *aPanel)
Definition: draw_frame.h:932
bool m_useSingleCanvasPane
Definition: draw_frame.h:103
virtual void UseGalCanvas(bool aEnable)
Use to switch between standard and GAL-based canvas.
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128

References EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL, EDA_DRAW_FRAME::GetGalDisplayOptions(), EDA_DRAW_FRAME::LoadCanvasTypeSetting(), EDA_DRAW_FRAME::m_canvas, EDA_DRAW_FRAME::m_canvasType, EDA_BASE_FRAME::m_FrameSize, EDA_DRAW_FRAME::m_useSingleCanvasPane, EDA_DRAW_FRAME::SetGalCanvas(), and EDA_DRAW_FRAME::UseGalCanvas().

Referenced by SCH_BASE_FRAME::SCH_BASE_FRAME().

◆ CreateImageFile()

void LIB_EDIT_FRAME::CreateImageFile ( const wxString &  aFileName,
wxBitmapType  aBitmapType = wxBITMAP_TYPE_PNG 
)

Creates an image (screenshot) of the current symbol.

Parameters
aFileName= the full filename
aBitmapType= bitmap file format

Definition at line 117 of file libedit_plot_component.cpp.

118 {
119  if( !saveCanvasImageToFile( aFileName, aBitmapType ) )
120  {
121  wxString msg;
122  msg.Printf( _( "Can't save file \"%s\"." ), aFileName );
123  wxMessageBox( msg );
124  }
125 }
bool saveCanvasImageToFile(const wxString &aFileName, wxBitmapType aBitmapType=wxBITMAP_TYPE_PNG)

References EDA_DRAW_FRAME::saveCanvasImageToFile().

Referenced by OnPlotCurrentComponent().

◆ CreateServer()

void EDA_DRAW_FRAME::CreateServer ( int  service,
bool  local = true 
)
inherited

Definition at line 49 of file eda_dde.cpp.

50 {
51  wxIPV4address addr;
52 
53  // Set the port number
54  addr.Service( service );
55 
56  // Listen on localhost only if requested
57  if( local )
58  addr.Hostname( HOSTNAME );
59 
60  delete m_socketServer;
61  m_socketServer = new wxSocketServer( addr );
62 
63  m_socketServer->SetNotify( wxSOCKET_CONNECTION_FLAG );
64  m_socketServer->SetEventHandler( *this, ID_EDA_SOCKET_EVENT_SERV );
65  m_socketServer->Notify( true );
66 }
static const wxString HOSTNAME(wxT("localhost"))
wxSocketServer * m_socketServer
Definition: draw_frame.h:105

References HOSTNAME(), ID_EDA_SOCKET_EVENT_SERV, and EDA_DRAW_FRAME::m_socketServer.

Referenced by SCH::IFACE::CreateWindow().

◆ Destroy()

◆ DismissModal()

void KIWAY_PLAYER::DismissModal ( bool  aRetVal,
const wxString &  aResult = wxEmptyString 
)
protectedinherited

Definition at line 162 of file kiway_player.cpp.

163 {
164  m_modal_ret_val = aRetVal;
165  m_modal_string = aResult;
166 
167  if( m_modal_loop )
168  {
169  m_modal_loop->Exit();
170  m_modal_loop = 0; // this marks it as dismissed.
171  }
172 
173  Show( false );
174 }
bool m_modal_ret_val
Definition: kiway_player.h:260
wxString m_modal_string
Definition: kiway_player.h:259
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:257

References KIWAY_PLAYER::m_modal_loop, KIWAY_PLAYER::m_modal_ret_val, and KIWAY_PLAYER::m_modal_string.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), FOOTPRINT_WIZARD_FRAME::ExportSelectedFootprint(), LIB_VIEW_FRAME::OnAddPartToSchematic(), LIB_VIEW_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), and FOOTPRINT_WIZARD_FRAME::OnCloseWindow().

◆ DisplayCmpDoc()

void LIB_EDIT_FRAME::DisplayCmpDoc ( )
private

Display the documentation of the selected component.

Definition at line 927 of file libedit.cpp.

928 {
929  LIB_PART* part = GetCurPart();
930 
932 
933  if( !part )
934  return;
935 
936  LIB_ALIAS* alias = part->GetAlias( part->GetName() );
937  wxString msg = part->GetName();
938 
939  AppendMsgPanel( _( "Name" ), msg, BLUE, 8 );
940 
941  static wxChar UnitLetter[] = wxT( "?ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
942  msg = UnitLetter[m_unit];
943 
944  AppendMsgPanel( _( "Unit" ), msg, BROWN, 8 );
945 
946  if( m_convert > 1 )
947  msg = _( "Convert" );
948  else
949  msg = _( "Normal" );
950 
951  AppendMsgPanel( _( "Body" ), msg, GREEN, 8 );
952 
953  if( part->IsPower() )
954  msg = _( "Power Symbol" );
955  else
956  msg = _( "Symbol" );
957 
958  AppendMsgPanel( _( "Type" ), msg, MAGENTA, 8 );
959  AppendMsgPanel( _( "Description" ), alias->GetDescription(), CYAN, 8 );
960  AppendMsgPanel( _( "Key words" ), alias->GetKeyWords(), DARKDARKGRAY );
961  AppendMsgPanel( _( "Datasheet" ), alias->GetDocFileName(), DARKDARKGRAY );
962 }
Definition: colors.h:57
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
Part library alias object definition.
LIB_ALIAS * GetAlias(size_t aIndex)
Definition: colors.h:61
const wxString & GetDocFileName() const
const wxString & GetKeyWords() const
Definition: colors.h:59
Define a library symbol object.
virtual void ClearMsgPanel()
Clear all messages from the message panel.
const wxString & GetDescription() override
void AppendMsgPanel(const wxString &textUpper, const wxString &textLower, COLOR4D color, int pad=6)
Append a message to the message panel.
bool IsPower() const
Definition: colors.h:58
const wxString & GetName() const
Definition: colors.h:62

References EDA_DRAW_FRAME::AppendMsgPanel(), BLUE, BROWN, EDA_DRAW_FRAME::ClearMsgPanel(), CYAN, DARKDARKGRAY, LIB_PART::GetAlias(), GetCurPart(), LIB_ALIAS::GetDescription(), LIB_ALIAS::GetDocFileName(), LIB_ALIAS::GetKeyWords(), LIB_PART::GetName(), GREEN, LIB_PART::IsPower(), m_convert, m_unit, and MAGENTA.

Referenced by ClearMsgPanel(), LoadOneLibraryPartAux(), and UpdateAfterSymbolProperties().

◆ DisplayToolMsg()

void EDA_DRAW_FRAME::DisplayToolMsg ( const wxString &  msg)
inherited

◆ DisplayUnitsMsg()

void EDA_DRAW_FRAME::DisplayUnitsMsg ( )
inherited

Display current unit pane on the status bar.

Definition at line 420 of file legacy_gal/eda_draw_frame.cpp.

421 {
422  wxString msg;
423 
424  switch( m_UserUnits )
425  {
426  case INCHES: msg = _( "Inches" ); break;
427  case MILLIMETRES: msg = _( "mm" ); break;
428  default: msg = _( "Units" ); break;
429  }
430 
431  SetStatusText( msg, 4 );
432 }
Definition: common.h:158
EDA_UNITS_T m_UserUnits
Definition: draw_frame.h:125

References INCHES, EDA_DRAW_FRAME::m_UserUnits, and MILLIMETRES.

Referenced by GERBVIEW_FRAME::updateGridSelectBox(), PCB_BASE_FRAME::UpdateGridSelectBox(), SCH_BASE_FRAME::UpdateStatusBar(), and EDA_DRAW_FRAME::UpdateStatusBar().

◆ doAutoSave()

bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

This should be overridden by the derived class to handle the auto save feature.

Returns
true if the auto save was successful otherwise false.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 222 of file eda_base_frame.cpp.

223 {
224  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
225 }

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

◆ DrawWorkSheet()

void EDA_DRAW_FRAME::DrawWorkSheet ( wxDC *  aDC,
BASE_SCREEN aScreen,
int  aLineWidth,
double  aScale,
const wxString &  aFilename,
const wxString &  aSheetLayer = wxEmptyString 
)
inherited

Draws on screen the page layout with the frame and the basic inscriptions.

Parameters
aDCThe device context.
aScreenscreen to draw
aLineWidthThe pen width to use to draw the layout.
aScaleThe mils to Iu conversion factor.
aFilenameThe filename to display in basic inscriptions.
aSheetLayerThe layer displayed from pcbnew.

Definition at line 1193 of file legacy_gal/eda_draw_frame.cpp.

1196 {
1198  return;
1199 
1200  const PAGE_INFO& pageInfo = GetPageSettings();
1201  wxSize pageSize = pageInfo.GetSizeMils();
1202 
1203  // if not printing, draw the page limits:
1204  if( !aScreen->m_IsPrinting && m_showPageLimits )
1205  {
1206  GRSetDrawMode( aDC, GR_COPY );
1207  GRRect( m_canvas->GetClipBox(), aDC, 0, 0, pageSize.x * aScalar, pageSize.y * aScalar,
1208  aLineWidth, m_drawBgColor == WHITE ? LIGHTGRAY : DARKDARKGRAY );
1209  }
1210 
1211  TITLE_BLOCK t_block = GetTitleBlock();
1212  COLOR4D color = COLOR4D( RED );
1213 
1214  wxPoint origin = aDC->GetDeviceOrigin();
1215 
1216  if( aScreen->m_IsPrinting && origin.y > 0 )
1217  {
1218  aDC->SetDeviceOrigin( 0, 0 );
1219  aDC->SetAxisOrientation( true, false );
1220  }
1221 
1222  DrawPageLayout( aDC, m_canvas->GetClipBox(), pageInfo, GetScreenDesc(), aFilename, t_block,
1223  aScreen->m_NumberOfScreens, aScreen->m_ScreenNumber, aLineWidth, aScalar,
1224  color, color, aSheetLayer );
1225 
1226  if( aScreen->m_IsPrinting && origin.y > 0 )
1227  {
1228  aDC->SetDeviceOrigin( origin.x, origin.y );
1229  aDC->SetAxisOrientation( true, true );
1230  }
1231 }
int m_ScreenNumber
Definition: base_screen.h:216
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:223
virtual const TITLE_BLOCK & GetTitleBlock() const =0
int color
Definition: DXF_plotter.cpp:62
virtual EDA_RECT * GetClipBox()
COLOR4D m_drawBgColor
the background color of the draw canvas BLACK for Pcbnew, BLACK or WHITE for eeschema
Definition: draw_frame.h:118
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot,...
Definition: title_block.h:40
virtual const PAGE_INFO & GetPageSettings() const =0
void DrawPageLayout(wxDC *aDC, EDA_RECT *aClipBox, const PAGE_INFO &aPageInfo, const wxString &aFullSheetName, const wxString &aFileName, TITLE_BLOCK &aTitleBlock, int aSheetCount, int aSheetNumber, int aPenWidth, double aScalar, COLOR4D aColor, COLOR4D aAltColor, const wxString &aSheetLayer)
Function DrawPageLayout is a core function to draw the page layout with the frame and the basic inscr...
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
Definition: gr_basic.cpp:1003
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:148
Definition: colors.h:60
const wxSize & GetSizeMils() const
Definition: page_info.h:142
bool m_IsPrinting
Definition: base_screen.h:220
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
bool m_showPageLimits
true to display the page limits
Definition: draw_frame.h:116
Definition: colors.h:49
int m_NumberOfScreens
Definition: base_screen.h:217
virtual wxString GetScreenDesc() const
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References color, DARKDARKGRAY, DrawPageLayout(), EDA_DRAW_PANEL::GetClipBox(), EDA_DRAW_FRAME::GetPageSettings(), EDA_DRAW_FRAME::GetScreenDesc(), PAGE_INFO::GetSizeMils(), EDA_DRAW_FRAME::GetTitleBlock(), GR_COPY, GRRect(), GRSetDrawMode(), LIGHTGRAY, EDA_DRAW_FRAME::m_canvas, EDA_DRAW_FRAME::m_drawBgColor, BASE_SCREEN::m_IsPrinting, BASE_SCREEN::m_NumberOfScreens, BASE_SCREEN::m_ScreenNumber, EDA_DRAW_FRAME::m_showBorderAndTitleBlock, EDA_DRAW_FRAME::m_showPageLimits, RED, and WHITE.

Referenced by PLEDITOR_PRINTOUT::DrawPage(), SCH_PRINTOUT::DrawPage(), PL_EDITOR_FRAME::PrintPage(), SCH_EDIT_FRAME::PrintPage(), PL_EDITOR_FRAME::RedrawActiveWindow(), FOOTPRINT_EDIT_FRAME::RedrawActiveWindow(), GERBVIEW_FRAME::RedrawActiveWindow(), and PCB_EDIT_FRAME::RedrawActiveWindow().

◆ emptyScreen()

void LIB_EDIT_FRAME::emptyScreen ( )
private

Restores the empty editor screen, without any part or library selected.

Definition at line 923 of file lib_edit_frame.cpp.

924 {
925  SetCurLib( wxEmptyString );
926  SetCurPart( nullptr );
929  m_toolManager->RunAction( "common.Control.zoomFitScreen", true );
930  Refresh();
931 }
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:130
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
virtual void ClearUndoRedoList()
Function ClearUndoRedoList clear undo and redo list, using ClearUndoORRedoList() picked items are del...
void SetCurPart(LIB_PART *aPart)
Take ownership of aPart and notes that it is the one currently being edited.
virtual void SetScreen(BASE_SCREEN *aScreen) override
SCH_SCREEN * m_dummyScreen
Helper screen used when no part is loaded
wxString SetCurLib(const wxString &aLibNickname)
Sets the current library nickname and returns the old library nickname.

References BASE_SCREEN::ClearUndoRedoList(), m_dummyScreen, EDA_DRAW_FRAME::m_toolManager, Refresh(), TOOL_MANAGER::RunAction(), SetCurLib(), SetCurPart(), and SetScreen().

Referenced by OnRemovePart(), and OnRevert().

◆ EraseMsgBox()

void EDA_DRAW_FRAME::EraseMsgBox ( )
inherited

Definition at line 264 of file legacy_gal/eda_draw_frame.cpp.

265 {
266  if( m_messagePanel )
268 }
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:169
void EraseMsgBox()
Definition: msgpanel.cpp:216

References EDA_MSG_PANEL::EraseMsgBox(), and EDA_DRAW_FRAME::m_messagePanel.

Referenced by GERBVIEW_FRAME::SetCurItem().

◆ ExecuteRemoteCommand()

virtual void EDA_DRAW_FRAME::ExecuteRemoteCommand ( const char *  cmdline)
inlinevirtualinherited

Execute a remote command send via a socket to the application, port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242) It called by EDA_DRAW_FRAME::OnSockRequest().

this is a virtual function becuse the actual commands depends on the application. the basic function do nothing

Parameters
cmdline= received command from socket

Reimplemented in SCH_EDIT_FRAME, and PCB_EDIT_FRAME.

Definition at line 419 of file draw_frame.h.

419 {}

Referenced by EDA_DRAW_FRAME::OnSockRequest().

◆ ExportHotkeyConfigToFile()

void EDA_BASE_FRAME::ExportHotkeyConfigToFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

Prompt the user for an old hotkey file to read, and read it.

Parameters
aDescList= current hotkey list descr. to initialize.
aDefaultShortname= a default short name (extension not needed) like eechema, kicad...

Definition at line 738 of file hotkeys_basic.cpp.

740 {
741  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
742  wxString mask = wxT( "*." ) + ext;
743 
744 #if 0
745  wxString path = wxPathOnly( Prj().GetProjectFullName() );
746 #else
747  wxString path = GetMruPath();
748 #endif
749  wxFileName fn( aDefaultShortname );
750  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
751 
752  wxString filename = EDA_FILE_SELECTOR( _( "Write Hotkey Configuration File:" ),
753  path,
754  fn.GetFullPath(),
755  ext,
756  mask,
757  this,
758  wxFD_SAVE,
759  true );
760 
761  if( filename.IsEmpty() )
762  return;
763 
764  WriteHotkeyConfig( aDescList, &filename );
765  SetMruPath( wxFileName( filename ).GetPath() );
766 }
void SetMruPath(const wxString &aPath)
PROJECT & Prj()
Definition: kicad.cpp:303
wxString GetMruPath() const
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
virtual int WriteHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
Store the current hotkey list.
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34

References DEFAULT_HOTKEY_FILENAME_EXT, EDA_FILE_SELECTOR(), EDA_BASE_FRAME::GetMruPath(), Prj(), EDA_BASE_FRAME::SetMruPath(), and EDA_BASE_FRAME::WriteHotkeyConfig().

Referenced by PANEL_HOTKEYS_EDITOR::installButtons().

◆ fixDuplicateAliases()

void LIB_EDIT_FRAME::fixDuplicateAliases ( LIB_PART aPart,
const wxString &  aLibrary 
)
private

Renames LIB_PART aliases to avoid conflicts before adding a component to a library

Definition at line 692 of file libedit.cpp.

693 {
694  wxString newName;
695 
696  for( unsigned int i = 0; i < aPart->GetAliasCount(); ++i )
697  {
698  LIB_ALIAS* alias = aPart->GetAlias( i );
699  int sfx = 0;
700  newName = alias->GetName();
701 
702  while( m_libMgr->PartExists( newName, aLibrary ) )
703  {
704  if( sfx == 0 )
705  newName = wxString::Format( "%s_copy", alias->GetName() );
706  else
707  newName = wxString::Format( "%s_copy%d", alias->GetName(), sfx );
708  ++sfx;
709  }
710 
711  if( i == 0 )
712  aPart->SetName( newName );
713  else
714  alias->SetName( newName );
715  }
716 }
Part library alias object definition.
LIB_ALIAS * GetAlias(size_t aIndex)
LIB_MANAGER * m_libMgr
manager taking care of temporary modificatoins
void SetName(const wxString &aName)
bool PartExists(const wxString &aAlias, const wxString &aLibrary) const
Returns true if part with a specific alias exists in library (either original one or buffered).
const wxString & GetName() const override
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
size_t i
Definition: json11.cpp:597
virtual void SetName(const wxString &aName)
size_t GetAliasCount() const

References Format(), LIB_PART::GetAlias(), LIB_PART::GetAliasCount(), LIB_ALIAS::GetName(), i, m_libMgr, LIB_MANAGER::PartExists(), LIB_ALIAS::SetName(), and LIB_PART::SetName().

Referenced by OnPasteDuplicatePart(), and savePartAs().

◆ FocusOnLocation()

void EDA_DRAW_FRAME::FocusOnLocation ( const wxPoint &  aPos,
bool  aWarpCursor = true,
bool  aCenterView = false 
)
inherited

Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor) at a given coordinate and reframes the drawing if the requested point is out of view or if center on location is requested.

Parameters
aPosis the point to go to.
aWarpCursoris true if the pointer should be warped to the new position.
aCenterViewis true if the new cursor position should be centered on canvas.

Definition at line 1030 of file legacy_gal/eda_draw_frame.cpp.

1031 {
1032  if( aCenterView )
1033  {
1034  wxWindow* dialog = findDialog( GetChildren() );
1035 
1036  // If a dialog partly obscures the window, then center on the uncovered area.
1037  if( dialog )
1038  {
1039  wxRect dialogRect( GetGalCanvas()->ScreenToClient( dialog->GetScreenPosition() ),
1040  dialog->GetSize() );
1041  GetGalCanvas()->GetView()->SetCenter( aPos, dialogRect );
1042  }
1043  else
1044  GetGalCanvas()->GetView()->SetCenter( aPos );
1045  }
1046 
1047  if( aWarpCursor )
1049  else
1051 }
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:601
wxWindow * findDialog(wxWindowList &aList)
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Moves the graphic crosshair cursor to the requested position expressed in world coordinates.
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false)=0
Moves cursor to the requested position expressed in world coordinates.

References findDialog(), EDA_DRAW_FRAME::GetGalCanvas(), EDA_DRAW_PANEL_GAL::GetView(), EDA_DRAW_PANEL_GAL::GetViewControls(), KIGFX::VIEW::SetCenter(), KIGFX::VIEW_CONTROLS::SetCrossHairCursorPosition(), and KIGFX::VIEW_CONTROLS::SetCursorPosition().

Referenced by DIALOG_FIND::onButtonFindItemClick(), DIALOG_FIND::onButtonFindMarkerClick(), DIALOG_ERC::OnLeftClickMarkersList(), DIALOG_ERC::OnLeftDblClickMarkersList(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnLeftDClickItem(), and DIALOG_CLEANUP_TRACKS_AND_VIAS::OnSelectItem().

◆ GeneralControl()

bool LIB_EDIT_FRAME::GeneralControl ( wxDC *  aDC,
const wxPoint &  aPosition,
EDA_KEY  aHotKey = 0 
)
overridevirtual

Perform application specific control using aDC at aPosition in logical units.

Override this function for application specific control. This function gets called on every mouse and key event.

Parameters
aDCA device context.
aPositionThe current cursor position in logical (drawing) units.
aHotKeyA key event used for application specific control if not zero.
Returns
true if the hotkey code is handled (captured).

Reimplemented from EDA_DRAW_FRAME.

Definition at line 1067 of file lib_edit_frame.cpp.

1068 {
1069  bool keyHandled = false;
1070  wxPoint pos = aPosition;
1071 
1072  // Filter out the 'fake' mouse motion after a keyboard movement
1073  if( !aHotKey && m_movingCursorWithKeyboard )
1074  {
1076  return false;
1077  }
1078 
1079  if( aHotKey )
1080  keyHandled = GeneralControlKeyMovement( aHotKey, &pos, true );
1081 
1082  if( GetToolId() == ID_NO_TOOL_SELECTED )
1083  m_canvas->CrossHairOff( aDC );
1084  else
1085  m_canvas->CrossHairOn( aDC );
1086 
1087  GetGalCanvas()->GetViewControls()->SetSnapping( false );
1088  SetCrossHairPosition( pos, false );
1089 
1090  if( m_canvas->IsMouseCaptured() )
1091  m_canvas->CallMouseCapture( aDC, aPosition, true );
1092 
1093  if( aHotKey && OnHotKey( aDC, aHotKey, aPosition, NULL ) )
1094  keyHandled = true;
1095 
1096  // Make sure current-part highlighting doesn't get lost in seleciton highlighting
1098 
1099  UpdateStatusBar();
1100 
1101  return keyHandled;
1102 }
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
bool OnHotKey(wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
Definition: ee_hotkeys.cpp:530
void ClearSearchTreeSelection()
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
virtual void SetSnapping(bool aEnabled)
Function SetSnapping() Enables/disables snapping cursor to grid.
bool GeneralControlKeyMovement(int aHotKey, wxPoint *aPos, bool aSnapToGrid)
Handle the common part of GeneralControl dedicated to global cursor keys (i.e.
virtual void CrossHairOn(wxDC *DC=nullptr)
virtual void CallMouseCapture(wxDC *aDC, const wxPoint &aPosition, bool aErase)
Function CallMouseCapture calls the mouse capture callback.
virtual void CrossHairOff(wxDC *DC=nullptr)
void UpdateStatusBar() override
Update the status bar information.
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Set the screen cross hair position to aPosition in logical (drawing) units.
bool m_movingCursorWithKeyboard
One-shot to avoid a recursive mouse event during hotkey movement.
Definition: draw_frame.h:179
int GetToolId() const
Definition: draw_frame.h:524

References EDA_DRAW_PANEL::CallMouseCapture(), ClearSearchTreeSelection(), EDA_DRAW_PANEL::CrossHairOff(), EDA_DRAW_PANEL::CrossHairOn(), EDA_DRAW_FRAME::GeneralControlKeyMovement(), EDA_DRAW_FRAME::GetGalCanvas(), EDA_DRAW_FRAME::GetToolId(), EDA_DRAW_PANEL_GAL::GetViewControls(), ID_NO_TOOL_SELECTED, EDA_DRAW_PANEL::IsMouseCaptured(), EDA_DRAW_FRAME::m_canvas, EDA_DRAW_FRAME::m_movingCursorWithKeyboard, OnHotKey(), EDA_DRAW_FRAME::SetCrossHairPosition(), KIGFX::VIEW_CONTROLS::SetSnapping(), and SCH_BASE_FRAME::UpdateStatusBar().

◆ GeneralControlKeyMovement()

bool EDA_DRAW_FRAME::GeneralControlKeyMovement ( int  aHotKey,
wxPoint *  aPos,
bool  aSnapToGrid 
)
protectedinherited

Handle the common part of GeneralControl dedicated to global cursor keys (i.e.

cursor movement by keyboard)

Parameters
aHotKeyis the hotkey code
aPosis the position of the cursor (initial then new)
aSnapToGrid= true to force the cursor position on grid
Returns
true if the hotkey code is handled (captured).

Definition at line 865 of file legacy_gal/eda_draw_frame.cpp.

866 {
867  bool key_handled = false;
868 
869  // If requested snap the current position to the grid
870  if( aSnapToGrid )
871  *aPos = GetNearestGridPosition( *aPos );
872 
873  switch( aHotKey )
874  {
875  // All these keys have almost the same treatment
876  case GR_KB_CTRL | WXK_NUMPAD8:
877  case GR_KB_CTRL | WXK_UP:
878  case GR_KB_CTRL | WXK_NUMPAD2:
879  case GR_KB_CTRL | WXK_DOWN:
880  case GR_KB_CTRL | WXK_NUMPAD4:
881  case GR_KB_CTRL | WXK_LEFT:
882  case GR_KB_CTRL | WXK_NUMPAD6:
883  case GR_KB_CTRL | WXK_RIGHT:
884  case WXK_NUMPAD8:
885  case WXK_UP:
886  case WXK_NUMPAD2:
887  case WXK_DOWN:
888  case WXK_NUMPAD4:
889  case WXK_LEFT:
890  case WXK_NUMPAD6:
891  case WXK_RIGHT:
892  key_handled = true;
893  {
894  /* Here's a tricky part: when doing cursor key movement, the
895  * 'previous' point should be taken from memory, *not* from the
896  * freshly computed position in the event. Otherwise you can't do
897  * sub-pixel movement. The m_movingCursorWithKeyboard oneshot 'eats'
898  * the automatic motion event generated by cursor warping */
899  wxRealPoint gridSize = GetScreen()->GetGridSize();
900  *aPos = GetCrossHairPosition();
901 
902  // Bonus: ^key moves faster (x10)
903  switch( aHotKey )
904  {
905  case GR_KB_CTRL|WXK_NUMPAD8:
906  case GR_KB_CTRL|WXK_UP:
907  aPos->y -= KiROUND( 10 * gridSize.y );
908  break;
909 
910  case GR_KB_CTRL|WXK_NUMPAD2:
911  case GR_KB_CTRL|WXK_DOWN:
912  aPos->y += KiROUND( 10 * gridSize.y );
913  break;
914 
915  case GR_KB_CTRL|WXK_NUMPAD4:
916  case GR_KB_CTRL|WXK_LEFT:
917  aPos->x -= KiROUND( 10 * gridSize.x );
918  break;
919 
920  case GR_KB_CTRL|WXK_NUMPAD6:
921  case GR_KB_CTRL|WXK_RIGHT:
922  aPos->x += KiROUND( 10 * gridSize.x );
923  break;
924 
925  case WXK_NUMPAD8:
926  case WXK_UP:
927  aPos->y -= KiROUND( gridSize.y );
928  break;
929 
930  case WXK_NUMPAD2:
931  case WXK_DOWN:
932  aPos->y += KiROUND( gridSize.y );
933  break;
934 
935  case WXK_NUMPAD4:
936  case WXK_LEFT:
937  aPos->x -= KiROUND( gridSize.x );
938  break;
939 
940  case WXK_NUMPAD6:
941  case WXK_RIGHT:
942  aPos->x += KiROUND( gridSize.x );
943  break;
944 
945  default: /* Can't happen since we entered the statement */
946  break;
947  }
948 
949  m_canvas->MoveCursor( *aPos );
951  }
952  break;
953 
954  default:
955  break;
956  }
957 
958  return key_handled;
959 }
const wxRealPoint & GetGridSize() const
Return the grid size of the currently selected grid.
Definition: base_screen.h:410
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:118
#define GR_KB_CTRL
virtual void MoveCursor(const wxPoint &aPosition)
Function MoveCursor moves the mouse pointer to aPosition in logical (drawing) units.
wxPoint GetNearestGridPosition(const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
Return the nearest aGridSize location to aPosition.
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408
bool m_movingCursorWithKeyboard
One-shot to avoid a recursive mouse event during hotkey movement.
Definition: draw_frame.h:179
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Return the current cross hair position in logical (drawing) coordinates.

References EDA_DRAW_FRAME::GetCrossHairPosition(), BASE_SCREEN::GetGridSize(), EDA_DRAW_FRAME::GetNearestGridPosition(), EDA_DRAW_FRAME::GetScreen(), GR_KB_CTRL, KiROUND(), EDA_DRAW_FRAME::m_canvas, EDA_DRAW_FRAME::m_movingCursorWithKeyboard, and EDA_DRAW_PANEL::MoveCursor().

Referenced by LIB_VIEW_FRAME::GeneralControl(), DISPLAY_FOOTPRINTS_FRAME::GeneralControl(), FOOTPRINT_VIEWER_FRAME::GeneralControl(), FOOTPRINT_WIZARD_FRAME::GeneralControl(), FOOTPRINT_EDIT_FRAME::GeneralControl(), PL_EDITOR_FRAME::GeneralControl(), GeneralControl(), GERBVIEW_FRAME::GeneralControl(), and PCB_EDIT_FRAME::GeneralControl().

◆ GetAboutTitle()

const wxString& EDA_BASE_FRAME::GetAboutTitle ( ) const
inlineinherited

Definition at line 405 of file eda_base_frame.h.

405 { return m_AboutTitle; }
wxString m_AboutTitle
Name of program displayed in About.

References EDA_BASE_FRAME::m_AboutTitle.

Referenced by DIALOG_ABOUT::DIALOG_ABOUT().

◆ GetAutoSaveFilePrefix()

static wxString EDA_BASE_FRAME::GetAutoSaveFilePrefix ( )
inlinestaticprotectedinherited
Returns
the string to prepend to a file name for automatic save.

Definition at line 161 of file eda_base_frame.h.

162  {
163  return wxT( "_autosave-" );
164  }

Referenced by EDA_BASE_FRAME::CheckForAutoSaveFile(), SCH_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::Files_io_from_id(), SCH_EDIT_FRAME::OnCloseWindow(), PCB_EDIT_FRAME::OnExportSTEP(), SCH_EDIT_FRAME::SaveEEFile(), and PCB_EDIT_FRAME::SavePcbFile().

◆ GetAutoSaveInterval()

int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 218 of file eda_base_frame.h.

218 { return m_autoSaveInterval; }
int m_autoSaveInterval
The auto save interval time in seconds.

References EDA_BASE_FRAME::m_autoSaveInterval.

◆ GetAuxiliaryToolBar()

ACTION_TOOLBAR* EDA_DRAW_FRAME::GetAuxiliaryToolBar ( ) const
inlineinherited

Definition at line 489 of file draw_frame.h.

489 { return m_auxiliaryToolBar; }
ACTION_TOOLBAR * m_auxiliaryToolBar
Auxiliary tool bar typically shown below the main tool bar at the top of the main window.
Definition: draw_frame.h:159

References EDA_DRAW_FRAME::m_auxiliaryToolBar.

◆ GetAuxOrigin()

const wxPoint & SCH_BASE_FRAME::GetAuxOrigin ( ) const
overridevirtualinherited

Return the origin of the axis used for plotting and various exports.

Implements EDA_DRAW_FRAME.

Definition at line 205 of file sch_base_frame.cpp.

206 {
207  wxASSERT( GetScreen() );
208  return GetScreen()->GetAuxOrigin();
209 }
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
const wxPoint & GetAuxOrigin() const
Definition: sch_screen.h:126

References SCH_SCREEN::GetAuxOrigin(), and SCH_BASE_FRAME::GetScreen().

◆ GetBackupSuffix()

static wxString EDA_BASE_FRAME::GetBackupSuffix ( )
inlinestaticprotectedinherited
Returns
the suffix to be appended to the file extension on backup

Definition at line 153 of file eda_base_frame.h.

154  {
155  return wxT( "-bak" );
156  }

Referenced by EDA_BASE_FRAME::CheckForAutoSaveFile(), PCB_EDIT_FRAME::createBackupFile(), and PCB_EDIT_FRAME::Files_io_from_id().

◆ GetCanvas()

SCH_DRAW_PANEL * SCH_BASE_FRAME::GetCanvas ( ) const
overridevirtualinherited

Reimplemented from EDA_DRAW_FRAME.

Definition at line 493 of file sch_base_frame.cpp.

494 {
495  return static_cast<SCH_DRAW_PANEL*>( GetGalCanvas() );
496 }
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931

References EDA_DRAW_FRAME::GetGalCanvas().

Referenced by SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_DRAWING_TOOLS::AddJunction(), SCH_EDIT_FRAME::AddJunction(), SCH_BASE_FRAME::AddToScreen(), SCH_EDIT_FRAME::AnnotateComponents(), SCH_EDIT_FRAME::backAnnotateFootprints(), SCH_EDIT_TOOL::BreakWire(), SCH_BASE_FRAME::CenterScreen(), SCH_EDIT_FRAME::DeleteAnnotation(), SCH_EDIT_TOOL::DoDelete(), SCH_DRAWING_TOOLS::doPlaceComponent(), EE_SELECTION_TOOL::doSelectionMenu(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), SCH_PRINTOUT::DrawPage(), SCH_EDIT_FRAME::EditComponent(), LIB_EDIT_TOOL::editFieldProperties(), LIB_EDIT_TOOL::editGraphicProperties(), SCH_EDIT_FRAME::EditSheet(), LIB_EDIT_TOOL::editTextProperties(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::FindComponentAndItem(), SCH_BASE_FRAME::HandleBlockBegin(), SCH_EDIT_FRAME::KiwayMailIn(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), SCH_EDIT_FRAME::LoadSettings(), LoadSettings(), EE_POINT_EDITOR::Main(), DIALOG_MIGRATE_BUSES::onAcceptClicked(), DIALOG_EDIT_COMPONENTS_LIBID::onApplyButton(), DIALOG_ANNOTATE::OnApplyClick(), LIB_VIEW_FRAME::OnCloseWindow(), DIALOG_ERC::OnEraseDrcMarkersClick(), SCH_EDIT_FRAME::OnFindReplace(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick(), SCH_FIELD::Place(), SCH_DRAWING_TOOLS::PlaceImage(), LIB_PIN_TOOL::PlacePin(), SCH_EDIT_TOOL::Properties(), SCH_EDIT_FRAME::PutDataInPreviousState(), RebuildView(), SCH_EDITOR_CONTROL::Redo(), DIALOG_ERC::RedrawDrawPanel(), SCH_BASE_FRAME::RedrawScreen(), SCH_BASE_FRAME::RedrawScreen2(), SCH_BASE_FRAME::RefreshItem(), SCH_BASE_FRAME::RemoveFromScreen(), SCH_EDIT_FRAME::rescueProject(), DIALOG_EDIT_COMPONENTS_LIBID::revertChanges(), SCH_EDIT_FRAME::RollbackSchematicFromUndo(), SCH_EDIT_FRAME::SelectUnit(), SCH_BASE_FRAME::SetScreen(), LIB_VIEW_FRAME::SetUnitAndConvert(), LIB_VIEW_FRAME::setupTools(), setupTools(), SCH_EDIT_FRAME::setupTools(), LIB_CONTROL::ShowElectricalTypes(), SCH_WIRE_BUS_TOOL::StartBus(), SCH_WIRE_BUS_TOOL::StartLine(), SCH_WIRE_BUS_TOOL::StartWire(), SCH_EDIT_FRAME::TestDanglingEnds(), DIALOG_ERC::TestErc(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), PANEL_LIBEDIT_SETTINGS::TransferDataFromWindow(), PANEL_LIBEDIT_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_EDIT_LINE_STYLE::TransferDataFromWindow(), DIALOG_UPDATE_FIELDS::TransferDataFromWindow(), DIALOG_SCH_EDIT_SHEET_PIN::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), SCH_EDITOR_CONTROL::Undo(), LIB_VIEW_FRAME::updatePreviewSymbol(), DIALOG_FIELDS_EDITOR_GLOBAL::~DIALOG_FIELDS_EDITOR_GLOBAL(), and LIB_VIEW_FRAME::~LIB_VIEW_FRAME().

◆ GetCanvasTypeKey()

virtual wxString EDA_DRAW_FRAME::GetCanvasTypeKey ( )
inlineprotectedvirtualinherited
Returns
the key in KifaceSettings to store the canvas type. the base version returns only CanvasTypeKeyBase. Can be overriden to return a key specific of a frame name

Definition at line 239 of file draw_frame.h.

240  {
241  return CanvasTypeKeyBase;
242  }
#define CanvasTypeKeyBase
The key to store the canvas type in config.
Definition: draw_frame.h:74

References CanvasTypeKeyBase.

Referenced by EDA_DRAW_FRAME::LoadCanvasTypeSetting(), and EDA_DRAW_FRAME::saveCanvasTypeSetting().

◆ GetComponentFromRedoList()

void LIB_EDIT_FRAME::GetComponentFromRedoList ( )

Definition at line 60 of file libedit_undo_redo.cpp.

61 {
62  if( GetScreen()->GetRedoCommandCount() <= 0 )
63  return;
64 
66 
67  // Load the last redo entry
69  ITEM_PICKER redoWrapper = redoCommand->PopItem();
70  delete redoCommand;
71  LIB_PART* part = (LIB_PART*) redoWrapper.GetItem();
72  wxCHECK( part, /* void */ );
73  part->ClearFlags( UR_TRANSIENT );
74  UNDO_REDO_T undoRedoType = redoWrapper.GetStatus();
75 
76  // Store the current part in the undo buffer
77  PICKED_ITEMS_LIST* undoCommand = new PICKED_ITEMS_LIST();
78  LIB_PART* oldPart = GetCurPart();
79  oldPart->SetFlags( UR_TRANSIENT );
80  ITEM_PICKER undoWrapper( oldPart, undoRedoType );
81  undoCommand->PushItem( undoWrapper );
82  GetScreen()->PushCommandToUndoList( undoCommand );
83 
84  // Do not delete the previous part by calling SetCurPart( part )
85  // which calls delete <previous part>.
86  // <previous part> is now put in undo list and is owned by this list
87  // Just set the current part to the part which come from the redo list
88  m_my_part = part;
89 
90  if( undoRedoType == UR_LIB_RENAME )
91  {
92  wxString lib = GetCurLib();
93  m_libMgr->UpdatePartAfterRename( part, oldPart->GetName(), lib );
94 
95  // Reselect the renamed part
96  m_treePane->GetLibTree()->SelectLibId( LIB_ID( lib, part->GetName() ) );
97  }
98 
100  SetShowDeMorgan( part->HasConversion() );
101  updateTitle();
102 
103  RebuildView();
104  OnModify();
105 }
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:130
virtual void PushCommandToUndoList(PICKED_ITEMS_LIST *aItem)
Function PushCommandToUndoList add a command to undo in undo list delete the very old commands when t...
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
UNDO_REDO_T GetStatus() const
UNDO_REDO_T
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
EDA_ITEM * GetItem() const
LIB_MANAGER * m_libMgr
manager taking care of temporary modificatoins
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
void PushItem(const ITEM_PICKER &aItem)
Function PushItem pushes aItem to the top of the list.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
LIB_PART * m_my_part
a part I own, it is not in any library, but a copy could be.
wxString GetCurLib() const
The nickname of the current library being edited and empty string if none.
void SetShowDeMorgan(bool show)
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259
virtual PICKED_ITEMS_LIST * PopCommandFromRedoList()
PopCommandFromRedoList return the last command to undo and remove it from list nothing is deleted.
Define a library symbol object.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
void RebuildSymbolUnitsList()
void updateTitle()
Updates the main window title bar with the current library name and read only status of the library.
Definition: libedit.cpp:55
const wxString & GetName() const
ITEM_PICKER PopItem()
Function PopItem.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:260
#define UR_TRANSIENT
indicates the item is owned by the undo/redo stack
Definition: base_struct.h:141
LIB_TREE * GetLibTree() const
SYMBOL_TREE_PANE * m_treePane
component search tree widget
void SelectLibId(const LIB_ID &aLibId)
Select an item in the tree widget.
Definition: lib_tree.cpp:165
bool UpdatePartAfterRename(LIB_PART *aPart, const wxString &oldAlias, const wxString &aLibrary)
Updates the part buffer with a new version of the part when the name has changed.

References EDA_ITEM::ClearFlags(), EE_ACTIONS::clearSelection, GetCurLib(), GetCurPart(), ITEM_PICKER::GetItem(), SYMBOL_TREE_PANE::GetLibTree(), LIB_PART::GetName(), SCH_BASE_FRAME::GetScreen(), ITEM_PICKER::GetStatus(), LIB_PART::HasConversion(), m_libMgr, m_my_part, EDA_DRAW_FRAME::m_toolManager, m_treePane, OnModify(), BASE_SCREEN::PopCommandFromRedoList(), PICKED_ITEMS_LIST::PopItem(), BASE_SCREEN::PushCommandToUndoList(), PICKED_ITEMS_LIST::PushItem(), RebuildSymbolUnitsList(), RebuildView(), TOOL_MANAGER::RunAction(), LIB_TREE::SelectLibId(), EDA_ITEM::SetFlags(), SetShowDeMorgan(), LIB_MANAGER::UpdatePartAfterRename(), updateTitle(), UR_LIB_RENAME, and UR_TRANSIENT.

Referenced by LIB_EDIT_TOOL::Redo().

◆ GetComponentFromUndoList()

void LIB_EDIT_FRAME::GetComponentFromUndoList ( )

Definition at line 108 of file libedit_undo_redo.cpp.

109 {
110  if( GetScreen()->GetUndoCommandCount() <= 0 )
111  return;
112 
114 
115  // Load the last undo entry
117  ITEM_PICKER undoWrapper = undoCommand->PopItem();
118  delete undoCommand;
119  LIB_PART* part = (LIB_PART*) undoWrapper.GetItem();
120  wxCHECK( part, /* void */ );
121  part->ClearFlags( UR_TRANSIENT );
122  UNDO_REDO_T undoRedoType = undoWrapper.GetStatus();
123 
124  // Store the current part in the redo buffer
125  PICKED_ITEMS_LIST* redoCommand = new PICKED_ITEMS_LIST();
126  LIB_PART* oldPart = GetCurPart();
127  oldPart->SetFlags( UR_TRANSIENT );
128  ITEM_PICKER redoWrapper( oldPart, undoRedoType );
129  redoCommand->PushItem( redoWrapper );
130  GetScreen()->PushCommandToRedoList( redoCommand );
131 
132  // Do not delete the previous part by calling SetCurPart( part ),
133  // which calls delete <previous part>.
134  // <previous part> is now put in redo list and is owned by this list.
135  // Just set the current part to the part which come from the undo list
136  m_my_part = part;
137 
138  if( undoRedoType == UR_LIB_RENAME )
139  {
140  wxString lib = GetCurLib();
141  m_libMgr->UpdatePartAfterRename( part, oldPart->GetName(), lib );
142 
143  // Reselect the renamed part
144  m_treePane->GetLibTree()->SelectLibId( LIB_ID( lib, part->GetName() ) );
145  }
146 
148  SetShowDeMorgan( part->HasConversion() );
149  updateTitle();
150 
151  RebuildView();
152  OnModify();
153 }
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:130
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
UNDO_REDO_T GetStatus() const
UNDO_REDO_T
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
EDA_ITEM * GetItem() const
LIB_MANAGER * m_libMgr
manager taking care of temporary modificatoins
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
void PushItem(const ITEM_PICKER &aItem)
Function PushItem pushes aItem to the top of the list.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
LIB_PART * m_my_part
a part I own, it is not in any library, but a copy could be.
wxString GetCurLib() const
The nickname of the current library being edited and empty string if none.
void SetShowDeMorgan(bool show)
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
PopCommandFromUndoList return the last command to undo and remove it from list nothing is deleted.
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259
Define a library symbol object.
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:57
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
void RebuildSymbolUnitsList()
void updateTitle()
Updates the main window title bar with the current library name and read only status of the library.
Definition: libedit.cpp:55
const wxString & GetName() const
virtual void PushCommandToRedoList(PICKED_ITEMS_LIST *aItem)
Function PushCommandToRedoList add a command to redo in redo list delete the very old commands when t...
ITEM_PICKER PopItem()
Function PopItem.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:260
#define UR_TRANSIENT
indicates the item is owned by the undo/redo stack
Definition: base_struct.h:141
LIB_TREE * GetLibTree() const
SYMBOL_TREE_PANE * m_treePane
component search tree widget
void SelectLibId(const LIB_ID &aLibId)
Select an item in the tree widget.
Definition: lib_tree.cpp:165
bool UpdatePartAfterRename(LIB_PART *aPart, const wxString &oldAlias, const wxString &aLibrary)
Updates the part buffer with a new version of the part when the name has changed.

References EDA_ITEM::ClearFlags(), EE_ACTIONS::clearSelection, GetCurLib(), GetCurPart(), ITEM_PICKER::GetItem(), SYMBOL_TREE_PANE::GetLibTree(), LIB_PART::GetName(), SCH_BASE_FRAME::GetScreen(), ITEM_PICKER::GetStatus(), LIB_PART::HasConversion(), m_libMgr, m_my_part, EDA_DRAW_FRAME::m_toolManager, m_treePane, OnModify(), BASE_SCREEN::PopCommandFromUndoList(), PICKED_ITEMS_LIST::PopItem(), BASE_SCREEN::PushCommandToRedoList(), PICKED_ITEMS_LIST::PushItem(), RebuildSymbolUnitsList(), RebuildView(), TOOL_MANAGER::RunAction(), LIB_TREE::SelectLibId(), EDA_ITEM::SetFlags(), SetShowDeMorgan(), LIB_MANAGER::UpdatePartAfterRename(), updateTitle(), UR_LIB_RENAME, and UR_TRANSIENT.

Referenced by LIB_EDIT_TOOL::Undo().

◆ GetConvert()

◆ GetCrossHairPosition()

wxPoint EDA_DRAW_FRAME::GetCrossHairPosition ( bool  aInvertY = false) const
inherited

Return the current cross hair position in logical (drawing) coordinates.

Parameters
aInvertYInverts the Y axis position.
Returns
The cross hair position in drawing coordinates.

Definition at line 795 of file legacy_gal/eda_draw_frame.cpp.

796 {
798  return wxPoint( cursor.x, aInvertY ? -cursor.y : cursor.y );
799 }
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.

References KIGFX::VIEW_CONTROLS::GetCursorPosition(), EDA_DRAW_FRAME::GetGalCanvas(), EDA_DRAW_PANEL_GAL::GetViewControls(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by Abort_EditEdge(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SCH_DRAWING_TOOLS::AddJunction(), PCB_BASE_FRAME::AddModuleToBoard(), PCB_BASE_FRAME::AddPad(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Self(), PCB_EDIT_FRAME::Begin_Zone(), PL_EDITOR_FRAME::Block_Move(), GERBVIEW_FRAME::Block_Move(), BuildDimension(), SCH_EDIT_FRAME::CreateNewText(), PCB_EDIT_FRAME::createPopupMenuForTracks(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), SCH_WIRE_BUS_TOOL::doUnfoldBus(), DrawAndSizingBlockOutlines(), drawMovingBlock(), DrawMovingBlockOutlines(), DrawSegment(), PCB_BASE_EDIT_FRAME::duplicateItem(), PCB_EDIT_FRAME::EditDimension(), DISPLAY_FOOTPRINTS_FRAME::GeneralControl(), FOOTPRINT_VIEWER_FRAME::GeneralControl(), FOOTPRINT_WIZARD_FRAME::GeneralControl(), FOOTPRINT_EDIT_FRAME::GeneralControl(), PL_EDITOR_FRAME::GeneralControl(), GERBVIEW_FRAME::GeneralControl(), PCB_EDIT_FRAME::GeneralControl(), EDA_DRAW_FRAME::GeneralControlKeyMovement(), SCH_EDIT_FRAME::ImportSheetPin(), InstallBlockCmdFrame(), PL_EDITOR_FRAME::Locate(), Move_Segment(), Move_Texte_Pcb(), MoveDimensionText(), MoveFootprint(), moveItem(), PL_EDITOR_FRAME::MoveItem(), LIB_VIEW_FRAME::OnHotKey(), FOOTPRINT_VIEWER_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotKey(), FOOTPRINT_WIZARD_FRAME::OnHotKey(), PL_EDITOR_FRAME::OnHotKey(), SCH_EDIT_FRAME::OnHotKey(), OnHotKey(), GERBVIEW_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), EDA_DRAW_PANEL::OnMouseEvent(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), PCB_EDIT_FRAME::OnRightClick(), LIB_VIEW_FRAME::OnSetRelativeOffset(), FOOTPRINT_VIEWER_FRAME::OnSetRelativeOffset(), FOOTPRINT_WIZARD_FRAME::OnSetRelativeOffset(), PCB_BASE_FRAME::PlaceModule(), PCB_BASE_FRAME::PlaceTexteModule(), PCB_EDIT_FRAME::Process_Special_Functions(), PushTrack(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), Show_Drag_Track_Segment_With_Cte_Slope(), Show_MoveNode(), Show_MoveTexte_Module(), Show_New_Edge_While_Move_Mouse(), Show_Pad_Move(), Show_Zone_Corner_Or_Outline_While_Move_Mouse(), ShowBoundingBoxMicroWaveInductor(), ShowCurrentOutlineWhileMoving(), ShowNewEdgeModule(), ShowNewTrackWhenMovingCursor(), ShowTargetShapeWhileMovingMouse(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_DrawItem(), FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), SCH_WIRE_BUS_TOOL::StartBus(), SCH_WIRE_BUS_TOOL::StartLine(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), SCH_WIRE_BUS_TOOL::StartWire(), PL_EDITOR_FRAME::UpdateStatusBar(), SCH_BASE_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), and GERBVIEW_FRAME::UpdateStatusBar().

◆ GetCrossHairScreenPosition()

wxPoint EDA_DRAW_FRAME::GetCrossHairScreenPosition ( ) const
inherited

Return the cross hair position in device (display) units.b.

Returns
The current cross hair position.

Definition at line 823 of file legacy_gal/eda_draw_frame.cpp.

824 {
825  wxFAIL_MSG( "Obsolete; use VIEW_CONTROLS instead" );
826  return wxPoint();
827 }

◆ GetCurLib()

wxString LIB_EDIT_FRAME::GetCurLib ( ) const

The nickname of the current library being edited and empty string if none.

Definition at line 572 of file lib_edit_frame.cpp.

573 {
574  wxString libNickname = Prj().GetRString( PROJECT::SCH_LIBEDIT_CUR_LIB );
575 
576  if( !libNickname.empty() )
577  {
578  if( !Prj().SchSymbolLibTable()->HasLibrary( libNickname ) )
579  {
580  Prj().SetRString( PROJECT::SCH_LIBEDIT_CUR_LIB, wxEmptyString );
581  libNickname = wxEmptyString;
582  }
583  }
584 
585  return libNickname;
586 }
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
VTBL_ENTRY void SetRString(RSTRING_T aStringId, const wxString &aString)
Function SetRString stores a "retained string", which is any session and project specific string iden...
Definition: project.cpp:171
VTBL_ENTRY const wxString & GetRString(RSTRING_T aStringId)
Function GetRString returns a "retained string", which is any session and project specific string ide...
Definition: project.cpp:186

References PROJECT::GetRString(), KIWAY_HOLDER::Prj(), PROJECT::SCH_LIBEDIT_CUR_LIB, and PROJECT::SetRString().

Referenced by DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkAliasName(), GetComponentFromRedoList(), GetComponentFromUndoList(), LoadComponentFromCurrentLib(), SetCurLib(), storeCurrentPart(), SyncLibraries(), UpdateAfterSymbolProperties(), and updateTitle().

◆ GetCurPart()

LIB_PART* LIB_EDIT_FRAME::GetCurPart ( ) const
inline

Return the current part being edited or NULL if none selected.

This is a LIB_PART that I own, it is at best a copy of one in a library.

Definition at line 145 of file lib_edit_frame.h.

145 { return m_my_part; }
LIB_PART * m_my_part
a part I own, it is not in any library, but a copy could be.

References m_my_part.

Referenced by BestZoom(), LIB_EDIT_TOOL::Copy(), DisplayCmpDoc(), LIB_EDIT_TOOL::DoDelete(), LIB_DRAWING_TOOLS::doTwoClickPlace(), LIB_DRAWING_TOOLS::DrawShape(), LIB_EDIT_TOOL::Duplicate(), LIB_EDIT_TOOL::editSymbolProperties(), GetComponentFromRedoList(), GetComponentFromUndoList(), GetDocumentExtents(), getTargetLibId(), getTargetPart(), isCurrentPart(), LoadComponentAndSelectLib(), LoadComponentFromCurrentLib(), LoadOneSymbol(), LIB_MOVE_TOOL::Main(), LIB_EDIT_TOOL::Mirror(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAddFootprintFilter(), OnAddPartToSchematic(), OnCheckComponent(), DIALOG_LIB_EDIT_PIN::OnPaintShowPanel(), OnPlotCurrentComponent(), OnRevert(), OnUpdateDeMorganConvert(), OnUpdateDeMorganNormal(), OnUpdateEditingPart(), OnUpdatePartNumber(), OnUpdateSyncPinEdit(), OnViewEntryDoc(), LIB_EDIT_TOOL::Paste(), LIB_EDIT_TOOL::PinTable(), LIB_DRAWING_TOOLS::PlaceAnchor(), LIB_PIN_TOOL::PlacePin(), PrintPage(), LIB_EDIT_TOOL::Properties(), LIB_PIN_TOOL::PushPinProperties(), RebuildSymbolUnitsList(), ReCreateMenuBar(), RedrawComponent(), LIB_DRAWING_TOOLS::RepeatDrawItem(), LIB_EDIT_TOOL::Rotate(), saveCurrentPart(), SaveOneSymbol(), EE_SELECTION_TOOL::selectable(), SVG_PlotComponent(), SynchronizePins(), SyncLibraries(), UpdateAfterSymbolProperties(), and updateTitle().

◆ GetCursorPosition()

wxPoint EDA_DRAW_FRAME::GetCursorPosition ( bool  aOnGrid,
wxRealPoint *  aGridSize = NULL 
) const
inherited

Return the current cursor position in logical (drawing) units.

Parameters
aOnGridReturns the nearest grid position at the current cursor position.
aGridSizeCustom grid size instead of the current grid size. Only valid if aOnGrid is true.
Returns
The current cursor position.

Definition at line 808 of file legacy_gal/eda_draw_frame.cpp.

809 {
810  wxFAIL_MSG( "Obsolete; use VIEW_CONTROLS instead" );
811  return wxPoint();
812 }

◆ GetDefaultPinLength()

static int LIB_EDIT_FRAME::GetDefaultPinLength ( )
inlinestatic
Returns
The default pin len setting.

Definition at line 164 of file lib_edit_frame.h.

164 { return m_defaultPinLength; }
static int m_defaultPinLength
Default pin length.

References m_defaultPinLength.

Referenced by GetLastPinLength(), LIB_PIN::LIB_PIN(), SaveSettings(), and PANEL_LIBEDIT_SETTINGS::TransferDataToWindow().

◆ GetDisplayOptions()

virtual void* EDA_DRAW_FRAME::GetDisplayOptions ( )
inlinevirtualinherited

A way to pass info to draw functions.

the base class has no knowledge about these options. It is virtual because this function must be overloaded to pass usefull info.

Reimplemented in PCB_BASE_FRAME.

Definition at line 944 of file draw_frame.h.

944 { return NULL; }

Referenced by GERBVIEW_DRAW_PANEL_GAL::OnShow(), PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL(), and PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow().

◆ GetDocumentExtents()

const BOX2I LIB_EDIT_FRAME::GetDocumentExtents ( ) const
overridevirtual

Reimplemented from EDA_DRAW_FRAME.

Definition at line 987 of file lib_edit_frame.cpp.

988 {
989  LIB_PART* part = GetCurPart();
990 
991  if( !part )
992  {
993  return BOX2I( VECTOR2I(-100, -100), VECTOR2I( 200, 200 ) );
994  }
995  else
996  {
999  }
1000 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
BOX2< VECTOR2I > BOX2I
Definition: box2.h:520
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
BOX2I boundingBox(T aObject)
boundingBox template method
Definition: shape_index.h:59
coord_type GetWidth() const
Definition: box2.h:195
Define a library symbol object.
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Get the bounding box for the symbol.
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
coord_type GetHeight() const
Definition: box2.h:196
const Vec & GetOrigin() const
Definition: box2.h:191

References boundingBox(), GetCurPart(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetOrigin(), LIB_PART::GetUnitBoundingBox(), BOX2< Vec >::GetWidth(), m_convert, and m_unit.

◆ GetDrawBgColor()

virtual COLOR4D EDA_DRAW_FRAME::GetDrawBgColor ( ) const
inlinevirtualinherited

◆ GetDrawToolBar()

ACTION_TOOLBAR* EDA_DRAW_FRAME::GetDrawToolBar ( ) const
inlineinherited

Definition at line 488 of file draw_frame.h.

488 { return m_drawToolBar; }
ACTION_TOOLBAR * m_drawToolBar
The tool bar that contains the buttons for quick access to the application draw tools.
Definition: draw_frame.h:163

References EDA_DRAW_FRAME::m_drawToolBar.

◆ GetFileFromHistory()

wxString EDA_BASE_FRAME::GetFileFromHistory ( int  cmdId,
const wxString &  type,
wxFileHistory *  aFileHistory = NULL 
)
inherited

Fetches the file name from the file history list.

This removes the selected file, if this file does not exist. The menu is also updated, if wxFileHistory::UseMenu was called at init time

Parameters
cmdIdThe command ID associated with the aFileHistory object.
typePlease document me!
aFileHistoryThe wxFileHistory in use. If null, the main application file history is used
Returns
a wxString containing the selected filename

Definition at line 398 of file eda_base_frame.cpp.

400 {
401  wxFileHistory* fileHistory = aFileHistory;
402 
403  if( !fileHistory )
404  fileHistory = &Kiface().GetFileHistory();
405 
406  int baseId = fileHistory->GetBaseId();
407 
408  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
409 
410  unsigned i = cmdId - baseId;
411 
412  if( i < fileHistory->GetCount() )
413  {
414  wxString fn = fileHistory->GetHistoryFile( i );
415 
416  if( wxFileName::FileExists( fn ) )
417  return fn;
418  else
419  {
420  wxString msg = wxString::Format( _( "File \"%s\" was not found." ), fn );
421  wxMessageBox( msg );
422 
423  fileHistory->RemoveFileFromHistory( i );
424  }
425  }
426 
427  return wxEmptyString;
428 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
FILE_HISTORY & GetFileHistory()
Definition: kiface_i.h:123
size_t i
Definition: json11.cpp:597

References Format(), KIFACE_I::GetFileHistory(), i, and Kiface().

Referenced by GERBVIEW_FRAME::OnDrlFileHistory(), KICAD_MANAGER_FRAME::OnFileHistory(), PL_EDITOR_FRAME::OnFileHistory(), PCB_EDIT_FRAME::OnFileHistory(), GERBVIEW_FRAME::OnGbrFileHistory(), GERBVIEW_FRAME::OnJobFileHistory(), SCH_EDIT_FRAME::OnLoadFile(), and GERBVIEW_FRAME::OnZipFileHistory().

◆ GetGalCanvas()

EDA_DRAW_PANEL_GAL* EDA_DRAW_FRAME::GetGalCanvas ( ) const
inlineinherited

Return a pointer to GAL-based canvas of given EDA draw frame.

Returns
Pointer to GAL-based canvas.

Definition at line 931 of file draw_frame.h.

931 { return m_galCanvas; }
EDA_DRAW_PANEL_GAL * m_galCanvas
GAL display options - this is the frame's interface to setting GAL display options.
Definition: draw_frame.h:96

References EDA_DRAW_FRAME::m_galCanvas.

Referenced by PCB_EDIT_FRAME::AppendBoardFile(), FOOTPRINT_VIEWER_FRAME::ApplyDisplaySettingsToGAL(), DISPLAY_FOOTPRINTS_FRAME::ApplyDisplaySettingsToGAL(), GERBVIEW_FRAME::applyDisplaySettingsToGAL(), GRID_HELPER::BestDragOrigin(), GRID_HELPER::BestSnapAnchor(), COMMON_TOOLS::CenterContents(), SCH_BASE_FRAME::CenterScreen(), PCB_EDIT_FRAME::Check_All_Zones(), GERBVIEW_FRAME::Clear_DrawLayers(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), DIALOG_PRINT_PCBNEW::createPrintout(), DIALOG_PRINT_GERBVIEW::createPrintout(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), DRAWING_TOOL::DrawVia(), PCB_EDIT_FRAME::Edit_Zone_Params(), MODULE_EDITOR_TOOLS::EnumeratePads(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SELECTION_TOOL::findCallback(), EDA_DRAW_FRAME::FocusOnLocation(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), GeneralControl(), GERBVIEW_FRAME::GERBVIEW_FRAME(), SCH_BASE_FRAME::GetCanvas(), PCB_BASE_FRAME::GetCollectorsGuide(), EDA_DRAW_FRAME::GetCrossHairPosition(), SCH_BASE_FRAME::GetRenderSettings(), GERBVIEW_FRAME::GetVisibleLayers(), GRID_HELPER::GRID_HELPER(), FOOTPRINT_EDIT_FRAME::HardRedraw(), SCH_BASE_FRAME::HardRedraw(), SCH_EDIT_FRAME::HardRedraw(), GERBVIEW_CONTROL::HighlightControl(), DIALOG_SELECT_NET_FROM_LIST::HighlightNet(), PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), GERBVIEW_FRAME::loadListOfGerberAndDrillFiles(), FOOTPRINT_PREVIEW_PANEL::New(), STATUS_POPUP::onCharHook(), FOOTPRINT_EDIT_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), GERBVIEW_FRAME::OnCloseWindow(), OnExportBody(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), OnImportBody(), PCB_LAYER_WIDGET::OnLayerColorChange(), GERBER_LAYER_WIDGET::OnLayerColorChange(), PCB_LAYER_WIDGET::OnLayerVisible(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), PCB_LAYER_WIDGET::OnRenderColorChange(), GERBER_LAYER_WIDGET::OnRenderColorChange(), PCB_LAYER_WIDGET::OnRenderEnable(), GERBER_LAYER_WIDGET::OnRenderEnable(), GERBVIEW_FRAME::OnSelectHighlightChoice(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), FOOTPRINT_EDIT_FRAME::OnSwitchCanvas(), SCH_BASE_FRAME::OnSwitchCanvas(), OnSwitchCanvas(), PCB_BASE_FRAME::OnToggleEdgeDrawMode(), PCB_BASE_FRAME::OnTogglePadDrawMode(), PCB_BASE_FRAME::OnToggleTextDrawMode(), GERBVIEW_FRAME::OnUpdateSelectZoom(), PCB_BASE_FRAME::OnUpdateSelectZoom(), SCH_BASE_FRAME::OnUpdateSwitchCanvas(), PCB_BASE_FRAME::OnUpdateSwitchCanvas(), GERBVIEW_FRAME::OnUpdateSwitchCanvas(), FOOTPRINT_TREE_PANE::onUpdateUI(), DIALOG_PAD_PROPERTIES::prepareCanvas(), processBoardItem(), BOARD_COMMIT::Push(), GRID_HELPER::queryVisible(), PCB_EDITOR_CONTROL::ratsnestTimer(), GERBVIEW_FRAME::Read_EXCELLON_File(), GERBVIEW_FRAME::Read_GERBER_File(), PCB_EDIT_FRAME::ReCreateMenuBar(), SCH_BASE_FRAME::RedrawScreen2(), GERBER_LAYER_WIDGET::ReFill(), Refresh(), refreshCallback(), SELECTION_TOOL::RequestSelection(), SCH_EDIT_FRAME::RescueLegacyProject(), SCH_EDIT_FRAME::RescueSymbolLibTableProject(), SaveCanvasImageToFile(), DISPLAY_FOOTPRINTS_FRAME::SaveSettings(), FOOTPRINT_VIEWER_FRAME::SaveSettings(), ZOOM_TOOL::selectRegion(), GERBVIEW_FRAME::SetActiveLayer(), GRID_HELPER::SetAuxAxes(), PCB_BASE_EDIT_FRAME::SetBoard(), EDA_DRAW_FRAME::SetCrossHairPosition(), GERBVIEW_FRAME::SetElementVisibility(), FOOTPRINT_EDIT_FRAME::SetElementVisibility(), GERBVIEW_FRAME::SetGridColor(), EDA_DRAW_FRAME::SetNoToolSelected(), GERBVIEW_FRAME::SetPageSettings(), EDA_DRAW_FRAME::SetToolID(), FOOTPRINT_EDIT_FRAME::setupTools(), GERBVIEW_FRAME::setupTools(), GERBVIEW_FRAME::SetVisibleLayers(), GERBVIEW_FRAME::SortLayersByX2Attributes(), PCB_EDIT_FRAME::Swap_Layers(), EDA_DRAW_FRAME::SwitchCanvas(), SCH_BASE_FRAME::SyncView(), COMMON_TOOLS::ToggleGrid(), GERBVIEW_SELECTION_TOOL::toggleSelection(), EE_SELECTION_TOOL::toggleSelection(), SELECTION_TOOL::toggleSelection(), PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_LIBEDIT_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_PCBNEW_SETTINGS::TransferDataFromWindow(), PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), GERBVIEW_FRAME::UpdateDisplayOptions(), PCB_BASE_FRAME::UpdateMsgPanel(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), FOOTPRINT_EDIT_FRAME::UpdateUserInterface(), DISPLAY_FOOTPRINTS_FRAME::updateView(), FOOTPRINT_WIZARD_FRAME::updateView(), FOOTPRINT_VIEWER_FRAME::updateView(), FOOTPRINT_EDIT_FRAME::updateView(), PCB_BASE_EDIT_FRAME::UseGalCanvas(), FOOTPRINT_EDIT_FRAME::UseGalCanvas(), PCB_BASE_FRAME::UseGalCanvas(), GERBVIEW_FRAME::UseGalCanvas(), EDA_DRAW_FRAME::UseGalCanvas(), CVPCB_CONTROL::view(), SCH_BASE_FRAME::Window_Zoom(), SCH_BASE_FRAME::Zoom_Automatique(), COMMON_TOOLS::ZoomFitScreen(), GERBVIEW_SELECTION_TOOL::zoomFitSelection(), SELECTION_TOOL::zoomFitSelection(), DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME(), FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME(), FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME(), GERBVIEW_FRAME::~GERBVIEW_FRAME(), and PCB_BASE_FRAME::~PCB_BASE_FRAME().

◆ GetGalDisplayOptions()

◆ GetGridColor()

virtual COLOR4D EDA_DRAW_FRAME::GetGridColor ( )
inlinevirtualinherited
Returns
the color of the grid

Reimplemented in FOOTPRINT_EDIT_FRAME, PCB_EDIT_FRAME, DISPLAY_FOOTPRINTS_FRAME, and FOOTPRINT_VIEWER_FRAME.

Definition at line 550 of file draw_frame.h.

551  {
552  return m_gridColor;
553  }
COLOR4D m_gridColor
Grid color.
Definition: draw_frame.h:117

References EDA_DRAW_FRAME::m_gridColor.

Referenced by GERBVIEW_FRAME::GetVisibleElementColor(), and PCBNEW_CONTROL::Reset().

◆ GetGridOrigin()

const wxPoint& SCH_BASE_FRAME::GetGridOrigin ( ) const
inlineoverridevirtualinherited

Return the absolute coordinates of the origin of the snap grid.

This is treated as a relative offset, and snapping will occur at multiples of the grid size relative to this point.

Implements EDA_DRAW_FRAME.

Definition at line 176 of file sch_base_frame.h.

177  {
178  static wxPoint zero;
179  return zero;
180  }

◆ GetGridPosition()

wxPoint EDA_DRAW_FRAME::GetGridPosition ( const wxPoint &  aPosition) const
inherited

Return the nearest grid position to aPosition if a screen is defined and snap to grid is enabled.

Otherwise, the original positions is returned.

See also
m_snapToGrid and m_BaseScreen members.
Parameters
aPositionThe position to test.
Returns
The wxPoint of the appropriate cursor position.

Definition at line 478 of file legacy_gal/eda_draw_frame.cpp.

479 {
480  wxFAIL_MSG( "Obsolete! Should go through COMMON_TOOLS." );
481  return aPosition;
482 }

◆ GetHotkeyConfig()

EDA_HOTKEY_CONFIG* EDA_DRAW_FRAME::GetHotkeyConfig ( ) const
inlineinherited

Return a structure containing currently used hotkey mapping.

Definition at line 442 of file draw_frame.h.

442 { return m_hotkeysDescrList; }
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
Definition: draw_frame.h:110

References EDA_DRAW_FRAME::m_hotkeysDescrList.

Referenced by GERBVIEW_CONTROL::ShowHelp(), and PCBNEW_CONTROL::ShowHelp().

◆ GetHotKeyDescription()

EDA_HOTKEY * LIB_EDIT_FRAME::GetHotKeyDescription ( int  aCommand) const
overridevirtual

Implements EDA_DRAW_FRAME.

Definition at line 519 of file ee_hotkeys.cpp.

520 {
521  EDA_HOTKEY* HK_Descr = GetDescriptorFromCommand( aCommand, common_Hotkey_List );
522 
523  if( HK_Descr == NULL )
524  HK_Descr = GetDescriptorFromCommand( aCommand, libEdit_Hotkey_List );
525 
526  return HK_Descr;
527 }
static EDA_HOTKEY * libEdit_Hotkey_List[]
Definition: ee_hotkeys.cpp:362
static EDA_HOTKEY * common_Hotkey_List[]
Definition: ee_hotkeys.cpp:271
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:59
EDA_HOTKEY * GetDescriptorFromCommand(int aCommand, EDA_HOTKEY **aList)
Function GetDescriptorFromCommand Returns a EDA_HOTKEY* pointer from a hot key identifier.

References common_Hotkey_List, GetDescriptorFromCommand(), and libEdit_Hotkey_List.

◆ GetKicadAbout()

void EDA_BASE_FRAME::GetKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 505 of file eda_base_frame.cpp.

506 {
507  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
508  ShowAboutDialog( this );
509 }
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
The base frame for deriving all KiCad main window classes.

References ShowAboutDialog().

◆ GetKicadContribute()

void EDA_BASE_FRAME::GetKicadContribute ( wxCommandEvent &  event)
inherited

Definition at line 492 of file eda_base_frame.cpp.

493 {
494  if( !wxLaunchDefaultBrowser( URL_GET_INVOLVED ) )
495  {
496  wxString msg;
497  msg.Printf( _( "Could not launch the default browser.\n"
498  "For information on how to help the KiCad project, visit %s" ),
500  wxMessageBox( msg, _( "Get involved with KiCad" ), wxOK, this );
501  }
502 }
#define URL_GET_INVOLVED

References URL_GET_INVOLVED.

◆ GetKicadHelp()

void EDA_BASE_FRAME::GetKicadHelp ( wxCommandEvent &  event)
inherited

Definition at line 431 of file eda_base_frame.cpp.

432 {
433  const SEARCH_STACK& search = sys_search();
434 
435  /* We have to get document for beginners,
436  * or the full specific doc
437  * if event id is wxID_INDEX, we want the document for beginners.
438  * else the specific doc file (its name is in Kiface().GetHelpFileName())
439  * The document for beginners is the same for all KiCad utilities
440  */
441  if( event.GetId() == wxID_INDEX )
442  {
443  // List of possible names for Getting Started in KiCad
444  const wxChar* names[2] = {
445  wxT( "getting_started_in_kicad" ),
446  wxT( "Getting_Started_in_KiCad" )
447  };
448 
449  wxString helpFile;
450  // Search for "getting_started_in_kicad.html" or "getting_started_in_kicad.pdf"
451  // or "Getting_Started_in_KiCad.html" or "Getting_Started_in_KiCad.pdf"
452  for( unsigned ii = 0; ii < arrayDim( names ); ii++ )
453  {
454  helpFile = SearchHelpFileFullPath( search, names[ii] );
455 
456  if( !helpFile.IsEmpty() )
457  break;
458  }
459 
460  if( !helpFile )
461  {
462  wxString msg = wxString::Format( _(
463  "Html or pdf help file \n\"%s\"\n or\n\"%s\" could not be found." ), names[0], names[1] );
464  wxMessageBox( msg );
465  }
466  else
467  {
468  GetAssociatedDocument( this, helpFile );
469  }
470 
471  return;
472  }
473 
474  wxString base_name = help_name();
475  wxString helpFile = SearchHelpFileFullPath( search, base_name );
476 
477  if( !helpFile )
478  {
479  wxString msg = wxString::Format( _(
480  "Help file \"%s\" could not be found." ),
481  GetChars( base_name )
482  );
483  wxMessageBox( msg );
484  }
485  else
486  {
487  GetAssociatedDocument( this, helpFile );
488  }
489 }
wxString SearchHelpFileFullPath(const SEARCH_STACK &aSearchStack, const wxString &aBaseName)
Return the help file's full path.
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, const wxPathList *aPaths)
Function GetAssociatedDocument open a document (file) with the suitable browser.
Definition: eda_doc.cpp:87
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
virtual const SEARCH_STACK & sys_search()
Return a SEARCH_STACK pertaining to entire program.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:107
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
virtual wxString help_name()

References arrayDim(), Format(), GetAssociatedDocument(), GetChars(), EDA_BASE_FRAME::help_name(), numEval::SearchHelpFileFullPath(), and EDA_BASE_FRAME::sys_search().

◆ GetLastGridSizeId()

int EDA_DRAW_FRAME::GetLastGridSizeId ( ) const
inlineinherited

Definition at line 312 of file draw_frame.h.

312 { return m_LastGridSizeId; }
int m_LastGridSizeId
Definition: draw_frame.h:112

References EDA_DRAW_FRAME::m_LastGridSizeId.

◆ GetLibAlias()

LIB_ALIAS * SCH_BASE_FRAME::GetLibAlias ( const LIB_ID aLibId,
bool  aUseCacheLib = false,
bool  aShowError = false 
)
inherited

Load symbol from symbol library table.

Parameters
aLibIdis the symbol library identifier to load.
aUseCacheLibset to true to fall back to cache library if symbol is not found in symbol library table.
aShowErrorMessageset to true to show any error messages.
Returns
The symbol found in the library or NULL if the symbol was not found.

Definition at line 316 of file sch_base_frame.cpp.

317 {
318  PART_LIB* cache = ( aUseCacheLib ) ? Prj().SchLibs()->GetCacheLibrary() : NULL;
319 
320  return SchGetLibAlias( aLibId, Prj().SchSymbolLibTable(), cache, this, aShowError );
321 }
static S3D_CACHE * cache
Definition: export_vrml.cpp:64
LIB_ALIAS * SchGetLibAlias(const LIB_ID &aLibId, SYMBOL_LIB_TABLE *aLibTable, PART_LIB *aCacheLib, wxWindow *aParent, bool aShowErrorMsg)
Load symbol from symbol library table.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
Object used to load, save, search, and otherwise manipulate symbol library files.

References cache, KIWAY_HOLDER::Prj(), and SchGetLibAlias().

Referenced by SCH_BASE_FRAME::SelectCompFromLibTree(), and DIALOG_UPDATE_FIELDS::updateFields().

◆ GetLibPart()

LIB_PART * SCH_BASE_FRAME::GetLibPart ( const LIB_ID aLibId,
bool  aUseCacheLib = false,
bool  aShowErrorMsg = false 
)
inherited

Definition at line 324 of file sch_base_frame.cpp.

325 {
326  PART_LIB* cache = ( aUseCacheLib ) ? Prj().SchLibs()->GetCacheLibrary() : NULL;
327 
328  return SchGetLibPart( aLibId, Prj().SchSymbolLibTable(), cache, this, aShowErrorMsg );
329 }
static S3D_CACHE * cache
Definition: export_vrml.cpp:64
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
LIB_PART * SchGetLibPart(const LIB_ID &aLibId, SYMBOL_LIB_TABLE *aLibTable, PART_LIB *aCacheLib, wxWindow *aParent, bool aShowErrorMsg)
Object used to load, save, search, and otherwise manipulate symbol library files.

References cache, KIWAY_HOLDER::Prj(), and SchGetLibPart().

Referenced by SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::CreateArchiveLibrary(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), SCH_DRAWING_TOOLS::doPlaceComponent(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnBrowseLibrary(), SCH_EDIT_FRAME::SelectUnit(), and DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow().

◆ GetMainToolBar()

ACTION_TOOLBAR* EDA_DRAW_FRAME::GetMainToolBar ( ) const
inlineinherited

Definition at line 486 of file draw_frame.h.

486 { return m_mainToolBar; }
ACTION_TOOLBAR * m_mainToolBar
Definition: draw_frame.h:156

References EDA_DRAW_FRAME::m_mainToolBar.

◆ GetMruPath()

wxString EDA_BASE_FRAME::GetMruPath ( ) const
inlineinherited

◆ GetNearestGridPosition()

wxPoint EDA_DRAW_FRAME::GetNearestGridPosition ( const wxPoint &  aPosition,
wxRealPoint *  aGridSize = NULL 
) const
inherited

Return the nearest aGridSize location to aPosition.

Parameters
aPositionThe position to check.
aGridSizeThe grid size to locate to if provided. If NULL then the current grid size is used.
Returns
The nearst grid position.

Definition at line 815 of file legacy_gal/eda_draw_frame.cpp.

817 {
818  BASE_SCREEN* screen = GetScreen(); // virtual call
819  return screen->getNearestGridPosition( aPosition, GetGridOrigin(), aGridSize );
820 }
wxPoint getNearestGridPosition(const wxPoint &aPosition, const wxPoint &aGridOrigin, wxRealPoint *aGridSize) const
Function getNearestGridPosition returns the nearest aGridSize location to aPosition.
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
virtual const wxPoint & GetGridOrigin() const =0
Return the absolute coordinates of the origin of the snap grid.
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408

References EDA_DRAW_FRAME::GetGridOrigin(), BASE_SCREEN::getNearestGridPosition(), and EDA_DRAW_FRAME::GetScreen().

Referenced by PCB_EDIT_FRAME::AppendBoardFile(), EDA_DRAW_FRAME::GeneralControlKeyMovement(), InvokeDialogImportGfxBoard(), InvokeDialogImportGfxModule(), GERBVIEW_FRAME::Locate(), LIB_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), PCB_EDIT_FRAME::OnRightClick(), LIB_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), and SCH_DRAWING_TOOLS::sizeSheet().

◆ GetOptionsToolBar()

ACTION_TOOLBAR* EDA_DRAW_FRAME::GetOptionsToolBar ( ) const
inlineinherited

Definition at line 487 of file draw_frame.h.

487 { return m_optionsToolBar; }
ACTION_TOOLBAR * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:166

References EDA_DRAW_FRAME::m_optionsToolBar.

◆ GetPageSettings()

const PAGE_INFO & SCH_BASE_FRAME::GetPageSettings ( ) const
overridevirtualinherited

Implements EDA_DRAW_FRAME.

Definition at line 192 of file sch_base_frame.cpp.

193 {
194  return GetScreen()->GetPageSettings();
195 }
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:119

References SCH_SCREEN::GetPageSettings(), and SCH_BASE_FRAME::GetScreen().

Referenced by DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL(), DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF(), and DIALOG_PLOT_SCHEMATIC::plotOneSheetPS().

◆ GetPageSizeIU()

const wxSize SCH_BASE_FRAME::GetPageSizeIU ( ) const
overridevirtualinherited

Works off of GetPageSettings() to return the size of the paper page in the internal units of this particular view.

Implements EDA_DRAW_FRAME.

Definition at line 198 of file sch_base_frame.cpp.

199 {
200  // GetSizeIU is compile time dependent:
201  return GetScreen()->GetPageSettings().GetSizeIU();
202 }
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:119

References SCH_SCREEN::GetPageSettings(), and SCH_BASE_FRAME::GetScreen().

◆ GetPinNameDefaultSize()

static int LIB_EDIT_FRAME::GetPinNameDefaultSize ( )
inlinestatic
Returns
The default pin name text size setting.

Definition at line 159 of file lib_edit_frame.h.

159 { return m_textPinNameDefaultSize; }
static int m_textPinNameDefaultSize
The default pin name text size setting.

References m_textPinNameDefaultSize.

Referenced by GetLastPinNameSize(), LIB_PIN::LIB_PIN(), SaveSettings(), and PANEL_LIBEDIT_SETTINGS::TransferDataToWindow().

◆ GetPinNumDefaultSize()

static int LIB_EDIT_FRAME::GetPinNumDefaultSize ( )
inlinestatic
Returns
the default pin num text size.

Definition at line 154 of file lib_edit_frame.h.

154 { return m_textPinNumDefaultSize; }
static int m_textPinNumDefaultSize
The default pin num text size setting.

References m_textPinNumDefaultSize.

Referenced by GetLastPinNumSize(), LIB_PIN::LIB_PIN(), SaveSettings(), and PANEL_LIBEDIT_SETTINGS::TransferDataToWindow().

◆ GetRenderSettings()

KIGFX::SCH_RENDER_SETTINGS * SCH_BASE_FRAME::GetRenderSettings ( )
inherited

Definition at line 499 of file sch_base_frame.cpp.

500 {
501  KIGFX::PAINTER* painter = GetGalCanvas()->GetView()->GetPainter();
502  return static_cast<KIGFX::SCH_RENDER_SETTINGS*>( painter->GetSettings() );
503 }
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
Class PAINTER contains all the knowledge about how to draw graphical object onto any particular outpu...
Definition: painter.h:308
virtual RENDER_SETTINGS * GetSettings()=0
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.

References EDA_DRAW_FRAME::GetGalCanvas(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), and EDA_DRAW_PANEL_GAL::GetView().

Referenced by DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), RebuildView(), LIB_VIEW_FRAME::SetUnitAndConvert(), LIB_CONTROL::ShowElectricalTypes(), PANEL_LIBEDIT_SETTINGS::TransferDataFromWindow(), PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow(), and LIB_VIEW_FRAME::updatePreviewSymbol().

◆ GetRepeatDeltaLabel()

int SCH_BASE_FRAME::GetRepeatDeltaLabel ( ) const
inlineinherited
Returns
the increment value of labels like bus members for the repeat command

Definition at line 151 of file sch_base_frame.h.

151 { return m_repeatDeltaLabel; }
int m_repeatDeltaLabel
the increment value of labels like bus members when they are repeated

References SCH_BASE_FRAME::m_repeatDeltaLabel.

Referenced by SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), SaveSettings(), PANEL_EESCHEMA_SETTINGS::TransferDataToWindow(), and PANEL_LIBEDIT_SETTINGS::TransferDataToWindow().

◆ GetRepeatPinStep()

int LIB_EDIT_FRAME::GetRepeatPinStep ( ) const
inline
Returns
the increment value of the position of a pin for the pin repeat command

Definition at line 174 of file lib_edit_frame.h.

174 { return m_repeatPinStep; }
int m_repeatPinStep
Default repeat offset for pins in repeat place pin.

References m_repeatPinStep.

Referenced by DIALOG_LIB_EDIT_PIN_TABLE::OnAddRow(), LIB_PIN_TOOL::RepeatPin(), SaveSettings(), and PANEL_LIBEDIT_SETTINGS::TransferDataToWindow().

◆ GetRepeatStep()

const wxPoint SCH_BASE_FRAME::GetRepeatStep ( ) const
inlineinherited
Returns
the increment value of the position of an item for the repeat command

Definition at line 138 of file sch_base_frame.h.

138 { return m_repeatStep; }
wxPoint m_repeatStep
the increment value of the position of an item when it is repeated

References SCH_BASE_FRAME::m_repeatStep.

Referenced by SCH_EDIT_TOOL::RepeatDrawItem(), SaveSettings(), PANEL_LIBEDIT_SETTINGS::TransferDataToWindow(), and PANEL_EESCHEMA_SETTINGS::TransferDataToWindow().

◆ GetScreen()

SCH_SCREEN * SCH_BASE_FRAME::GetScreen ( ) const
overridevirtualinherited

Return a pointer to a BASE_SCREEN or one of its derivatives.

It is overloaded by derived classes to return SCH_SCREEN or PCB_SCREEN.

Reimplemented from EDA_DRAW_FRAME.

Reimplemented in SCH_EDIT_FRAME.

Definition at line 162 of file sch_base_frame.cpp.

163 {
165 }
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408

References EDA_DRAW_FRAME::GetScreen().

Referenced by SCH_BASE_FRAME::AddToScreen(), LIB_VIEW_FRAME::GeneralControl(), SCH_BASE_FRAME::GetAuxOrigin(), GetComponentFromRedoList(), GetComponentFromUndoList(), EE_SELECTION_TOOL::GetNode(), SCH_BASE_FRAME::GetPageSettings(), SCH_BASE_FRAME::GetPageSizeIU(), SCH_BASE_FRAME::GetTitleBlock(), SCH_BASE_FRAME::HandleBlockBegin(), LoadComponentAndSelectLib(), LoadComponentFromCurrentLib(), LoadOneLibraryPartAux(), EDIT_POINTS_FACTORY::Make(), OnCheckComponent(), LIB_VIEW_FRAME::OnHotKey(), OnHotKey(), OnModify(), OnPlotCurrentComponent(), LIB_VIEW_FRAME::OnSetRelativeOffset(), PrintPage(), EE_SELECTION_TOOL::RebuildSelection(), ReCreateMenuBar(), RedrawActiveWindow(), SCH_BASE_FRAME::RedrawScreen(), SCH_BASE_FRAME::RedrawScreen2(), SCH_BASE_FRAME::RemoveFromScreen(), RollbackPartFromUndo(), SaveCopyInUndoList(), EE_SELECTION_TOOL::SelectConnection(), EE_SELECTION_TOOL::SelectPoint(), SCH_BASE_FRAME::SetAuxOrigin(), SetCurPart(), SCH_BASE_FRAME::SetPageSettings(), SCH_BASE_FRAME::SetTitleBlock(), LIB_VIEW_FRAME::setupTools(), setupTools(), storeCurrentPart(), SVG_PlotComponent(), SCH_BASE_FRAME::SyncView(), SCH_BASE_FRAME::UpdateStatusBar(), SCH_BASE_FRAME::Window_Zoom(), and SCH_BASE_FRAME::Zoom_Automatique().

◆ GetScreenDesc()

wxString EDA_DRAW_FRAME::GetScreenDesc ( ) const
virtualinherited

Reimplemented in SCH_EDIT_FRAME.

Definition at line 1234 of file legacy_gal/eda_draw_frame.cpp.

1235 {
1236  // Virtual function. Base class implementation returns an empty string.
1237  return wxEmptyString;
1238 }

Referenced by ConfigureDrawList(), KIGFX::SCH_VIEW::DisplaySheet(), EDA_DRAW_FRAME::DrawWorkSheet(), PL_EDITOR_FRAME::Locate(), and DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG().

◆ GetScrollCenterPosition()

const wxPoint & EDA_DRAW_FRAME::GetScrollCenterPosition ( ) const
inherited

Definition at line 844 of file legacy_gal/eda_draw_frame.cpp.

845 {
846  BASE_SCREEN* screen = GetScreen(); // virtual call
847  return screen->getScrollCenterPosition();
848 }
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
const wxPoint & getScrollCenterPosition() const
Definition: base_screen.h:173
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408

References EDA_DRAW_FRAME::GetScreen(), and BASE_SCREEN::getScrollCenterPosition().

Referenced by SCH_EDIT_FRAME::DisplayCurrentSheet(), DIALOG_ERC::OnLeftClickMarkersList(), EDA_DRAW_PANEL::OnMouseEvent(), EDA_DRAW_PANEL::OnMouseWheel(), EDA_DRAW_PANEL::OnPan(), EDA_DRAW_PANEL::OnScroll(), and EDA_DRAW_FRAME::SetPresetZoom().

◆ GetShowAllPins()

virtual bool SCH_BASE_FRAME::GetShowAllPins ( ) const
inlinevirtualinherited

Allow some frames to show/hide hidden pins.

The default impl shows all pins.

Reimplemented in SCH_EDIT_FRAME.

Definition at line 116 of file sch_base_frame.h.

116 { return true; }

Referenced by EE_SELECTION_TOOL::selectable().

◆ GetShowAxis()

bool EDA_DRAW_FRAME::GetShowAxis ( ) const
inlineinherited

Definition at line 957 of file draw_frame.h.

957 { return m_showAxis; }
bool m_showAxis
True shows the X and Y axis indicators.
Definition: draw_frame.h:138

References EDA_DRAW_FRAME::m_showAxis.

◆ GetShowBorderAndTitleBlock()

bool EDA_DRAW_FRAME::GetShowBorderAndTitleBlock ( ) const
inlineinherited

Definition at line 393 of file draw_frame.h.

393 { return m_showBorderAndTitleBlock; }
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:148

References EDA_DRAW_FRAME::m_showBorderAndTitleBlock.

◆ GetShowDeMorgan()

bool LIB_EDIT_FRAME::GetShowDeMorgan ( )
inline

◆ GetShowElectricalType()

bool SCH_BASE_FRAME::GetShowElectricalType ( )
inlineinherited

◆ GetShowGridAxis()

bool EDA_DRAW_FRAME::GetShowGridAxis ( ) const
inlineinherited

Definition at line 958 of file draw_frame.h.

958 { return m_showGridAxis; }
bool m_showGridAxis
True shows the grid axis indicators.
Definition: draw_frame.h:141

References EDA_DRAW_FRAME::m_showGridAxis.

◆ GetShowOriginAxis()

bool EDA_DRAW_FRAME::GetShowOriginAxis ( ) const
inlineinherited

Definition at line 959 of file draw_frame.h.

959 { return m_showOriginAxis; }
bool m_showOriginAxis
True shows the origin axis used to indicate the coordinate offset for drill, gerber,...
Definition: draw_frame.h:145

References EDA_DRAW_FRAME::m_showOriginAxis.

◆ getTargetLib()

wxString LIB_EDIT_FRAME::getTargetLib ( ) const
private

Returns either the library selected in the component tree, if context menu is active or the library that is currently modified.

Definition at line 794 of file lib_edit_frame.cpp.

795 {
796  return getTargetLibId().GetLibNickname();
797 }
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
LIB_ID getTargetLibId() const
Returns either the part selected in the component tree, if context menu is active or the currently mo...

References LIB_ID::GetLibNickname(), and getTargetLibId().

Referenced by OnCreateNewPart(), and OnImportPart().

◆ getTargetLibId()

LIB_ID LIB_EDIT_FRAME::getTargetLibId ( ) const
private

Returns either the part selected in the component tree, if context menu is active or the currently modified part.

Definition at line 782 of file lib_edit_frame.cpp.

783 {
785  wxString nickname = id.GetLibNickname();
786 
787  if( nickname.IsEmpty() && GetCurPart() )
788  id = GetCurPart()->GetLibId();
789 
790  return id;
791 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
For multi-unit components, if the user selects the component itself rather than picking an individual...
Definition: lib_tree.cpp:147
const LIB_ID & GetLibId() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
LIB_TREE * GetLibTree() const
SYMBOL_TREE_PANE * m_treePane
component search tree widget

References GetCurPart(), LIB_PART::GetLibId(), LIB_ID::GetLibNickname(), SYMBOL_TREE_PANE::GetLibTree(), LIB_TREE::GetSelectedLibId(), and m_treePane.

Referenced by getTargetLib(), OnRemovePart(), OnRevert(), OnSave(), OnSaveAs(), OnUpdateHavePart(), OnUpdateRevert(), OnUpdateSave(), and savePartAs().

◆ getTargetPart()

LIB_PART * LIB_EDIT_FRAME::getTargetPart ( ) const
private

Returns currently edited part.

Definition at line 764 of file lib_edit_frame.cpp.

765 {
766  LIB_ALIAS* alias = nullptr;
767 
769  {
771  alias = m_libMgr->GetAlias( libId.GetLibItemName(), libId.GetLibNickname() );
772  }
773  else if( LIB_PART* part = GetCurPart() )
774  {
775  alias = part->GetAlias( 0 );
776  }
777 
778  return alias ? alias->GetPart() : nullptr;
779 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
Part library alias object definition.
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
LIB_MANAGER * m_libMgr
manager taking care of temporary modificatoins
bool IsMenuActive() const
Returns the status of right-click context menu.
Definition: lib_tree.h:106
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
LIB_ALIAS * GetAlias(const wxString &aAlias, const wxString &aLibrary) const
Returns either an alias of a working LIB_PART copy, or alias of the original part if there is no work...
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
For multi-unit components, if the user selects the component itself rather than picking an individual...
Definition: lib_tree.cpp:147
Define a library symbol object.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
LIB_PART * GetPart() const
Get the shared LIB_PART.
LIB_TREE * GetLibTree() const
SYMBOL_TREE_PANE * m_treePane
component search tree widget

References LIB_MANAGER::GetAlias(), GetCurPart(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), SYMBOL_TREE_PANE::GetLibTree(), LIB_ALIAS::GetPart(), LIB_TREE::GetSelectedLibId(), LIB_TREE::IsMenuActive(), m_libMgr, and m_treePane.

Referenced by OnExportPart().

◆ GetTemplateFieldName()

const TEMPLATE_FIELDNAME* SCH_BASE_FRAME::GetTemplateFieldName ( const wxString &  aName) const
inlineinherited

Search for aName in the the template field name list.

Parameters
aNameA wxString object containing the field name to search for.
Returns
the template fieldname if found; NULL otherwise.

Definition at line 257 of file sch_base_frame.h.

258  {
259  return m_templateFieldNames.GetFieldName( aName );
260  }
TEMPLATES m_templateFieldNames
const TEMPLATE_FIELDNAME * GetFieldName(const wxString &aName) const
Function GetFieldName searches for aName in the the template field name list.

References TEMPLATES::GetFieldName(), and SCH_BASE_FRAME::m_templateFieldNames.

◆ GetTemplateFieldNames()

const TEMPLATE_FIELDNAMES& SCH_BASE_FRAME::GetTemplateFieldNames ( ) const
inlineinherited

Return a template field names list for read only access.

Definition at line 246 of file sch_base_frame.h.

247  {
249  }
TEMPLATES m_templateFieldNames
const TEMPLATE_FIELDNAMES & GetTemplateFieldNames() const
Function GetTemplateFieldName returns a template fieldnames list for read only access.

References TEMPLATES::GetTemplateFieldNames(), and SCH_BASE_FRAME::m_templateFieldNames.

Referenced by DIALOG_FIELDS_EDITOR_GLOBAL::LoadFieldNames(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::TransferDataToWindow(), and DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::UpdateFieldsFromLibrary().

◆ GetTitleBlock()

const TITLE_BLOCK & SCH_BASE_FRAME::GetTitleBlock ( ) const
overridevirtualinherited

Implements EDA_DRAW_FRAME.

Definition at line 219 of file sch_base_frame.cpp.

220 {
221  wxASSERT( GetScreen() );
222  return GetScreen()->GetTitleBlock();
223 }
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
const TITLE_BLOCK & GetTitleBlock() const
Definition: sch_screen.h:129

References SCH_BASE_FRAME::GetScreen(), and SCH_SCREEN::GetTitleBlock().

Referenced by DIALOG_PLOT_SCHEMATIC::createPDFFile(), DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL(), DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF(), and DIALOG_PLOT_SCHEMATIC::plotOneSheetPS().

◆ GetToolId()

int EDA_DRAW_FRAME::GetToolId ( ) const
inlineinherited
Returns
the current tool ID when there is no active tool, the ID_NO_TOOL_SELECTED is returned (the id of the default Tool (idle tool) of the right vertical toolbar)

Definition at line 524 of file draw_frame.h.

524 { return m_toolId; }

References EDA_DRAW_FRAME::m_toolId.

Referenced by PCB_EDIT_FRAME::Begin_Zone(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), SCH_WIRE_BUS_TOOL::doDrawSegments(), SCH_DRAWING_TOOLS::doTwoClickPlace(), SCH_WIRE_BUS_TOOL::DrawBusses(), SCH_WIRE_BUS_TOOL::DrawLines(), LIB_DRAWING_TOOLS::DrawShape(), SCH_WIRE_BUS_TOOL::DrawWires(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), GeneralControl(), PCB_EDIT_FRAME::GeneralControl(), PL_EDITOR_FRAME::HandleBlockEnd(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), GERBVIEW_FRAME::HandleBlockEnd(), PCB_EDIT_FRAME::HandleBlockEnd(), PL_EDITOR_FRAME::HandleBlockPlace(), FOOTPRINT_EDIT_FRAME::HandleBlockPlace(), GERBVIEW_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HandleBlockPlace(), PCB_EDITOR_CONTROL::HighlightNetCursor(), SCH_EDIT_TOOL::Init(), PAD_TOOL::Init(), PCB_EDITOR_CONTROL::Init(), SCH_WIRE_BUS_TOOL::Init(), EDIT_TOOL::Init(), SCH_MOVE_TOOL::Main(), EE_POINT_EDITOR::Main(), CVPCB_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_EDIT_FRAME::MuWaveCommand(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), EDA_DRAW_PANEL::OnMouseEvent(), FOOTPRINT_EDIT_FRAME::OnRightClick(), PL_EDITOR_FRAME::OnRightClick(), GERBVIEW_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), PCB_EDIT_FRAME::OnSelectTool(), DISPLAY_FOOTPRINTS_FRAME::OnUIToolSelection(), OnUpdateEditingPart(), PCB_EDIT_FRAME::OnUpdateMuWaveToolbar(), FOOTPRINT_EDIT_FRAME::OnUpdateSelectTool(), PL_EDITOR_FRAME::OnUpdateSelectTool(), GERBVIEW_FRAME::OnUpdateSelectTool(), FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar(), PCB_EDIT_FRAME::OnUpdateVerticalToolbar(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_BASE_FRAME::SetToolID(), PCB_EDIT_FRAME::SwitchLayer(), SyncMenusAndToolbars(), GERBVIEW_FRAME::SyncMenusAndToolbars(), SCH_EDIT_FRAME::SyncMenusAndToolbars(), and SCH_WIRE_BUS_TOOL::UnfoldBus().

◆ GetToolManager()

TOOL_MANAGER* EDA_DRAW_FRAME::GetToolManager ( ) const
inlineoverrideinherited

Return the tool manager instance, if any.

Definition at line 937 of file draw_frame.h.

937 { return m_toolManager; }
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:130

References EDA_DRAW_FRAME::m_toolManager.

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BOARD_COMMIT::BOARD_COMMIT(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), DIALOG_DRC_CONTROL::DelDRCMarkers(), deleteItem(), DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES(), SCH_EDIT_FRAME::DisplayCurrentSheet(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), DIALOG_DRC_CONTROL::doSelectionMenu(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), PCB_EDIT_FRAME::Fill_All_Zones(), DIALOG_DRC_CONTROL::focusOnItem(), LIB_VIEW_FRAME::OnAddPartToSchematic(), OnAddPartToSchematic(), DIALOG_DRC_CONTROL::OnDeleteOneClick(), SCH_EDIT_FRAME::OnHotKey(), OnHotKey(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnRightUpItem(), BOARD_COMMIT::Push(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), PCB_BASE_FRAME::SetFastGrid1(), PCB_BASE_FRAME::SetFastGrid2(), DRC::ShowDRCDialog(), PCB_LAYER_WIDGET::SyncLayerAlphaIndicators(), FOOTPRINT_EDIT_FRAME::ToPrinter(), PCB_EDIT_FRAME::ToPrinter(), GERBVIEW_FRAME::ToPrinter(), DIALOG_SET_GRID::TransferDataFromWindow(), EDA_DRAW_FRAME::WriteHotkeyConfig(), DIALOG_NETLIST::~DIALOG_NETLIST(), and DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB().

◆ GetToolMsg()

wxString EDA_DRAW_FRAME::GetToolMsg ( )
inlineinherited

Definition at line 747 of file draw_frame.h.

747 { return m_toolMsg; }
wxString m_toolMsg
Definition: draw_frame.h:90

References EDA_DRAW_FRAME::m_toolMsg.

Referenced by EE_POINT_EDITOR::Main().

◆ GetToolToggled()

bool EDA_DRAW_FRAME::GetToolToggled ( int  aToolId)
inherited

Checks all the toolbars and returns true if the given tool id is toggled.

This is needed because GerbView and Pcbnew can put some of the same tools in different toolbars.

Definition at line 297 of file legacy_gal/eda_draw_frame.cpp.

298 {
299  // Checks all the toolbars and returns true if the given tool id is toggled.
300  return ( ( m_mainToolBar && m_mainToolBar->GetToolToggled( aToolId ) ) ||
301  ( m_optionsToolBar && m_optionsToolBar->GetToolToggled( aToolId ) ) ||
302  ( m_drawToolBar && m_drawToolBar->GetToolToggled( aToolId ) ) ||
303  ( m_auxiliaryToolBar && m_auxiliaryToolBar->GetToolToggled( aToolId ) )
304  );
305 }
ACTION_TOOLBAR * m_auxiliaryToolBar
Auxiliary tool bar typically shown below the main tool bar at the top of the main window.
Definition: draw_frame.h:159
ACTION_TOOLBAR * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:166
ACTION_TOOLBAR * m_mainToolBar
Definition: draw_frame.h:156
ACTION_TOOLBAR * m_drawToolBar
The tool bar that contains the buttons for quick access to the application draw tools.
Definition: draw_frame.h:163

References EDA_DRAW_FRAME::m_auxiliaryToolBar, EDA_DRAW_FRAME::m_drawToolBar, EDA_DRAW_FRAME::m_mainToolBar, and EDA_DRAW_FRAME::m_optionsToolBar.

Referenced by ZOOM_TOOL::Main().

◆ GetUnit()

◆ GetUserUnits()

EDA_UNITS_T EDA_DRAW_FRAME::GetUserUnits ( ) const
inlineoverrideinherited

Return the user units currently in use.

Definition at line 289 of file draw_frame.h.

289 { return m_UserUnits; }
EDA_UNITS_T m_UserUnits
Definition: draw_frame.h:125

References EDA_DRAW_FRAME::m_UserUnits.

Referenced by PANEL_SETUP_TRACKS_AND_VIAS::AppendDiffPairs(), PANEL_SETUP_TRACKS_AND_VIAS::AppendTrackWidth(), PANEL_SETUP_TRACKS_AND_VIAS::AppendViaSize(), PCB_EDIT_FRAME::Create_MuWaveComponent(), MWAVE::CreateMicrowaveInductor(), PCB_EDIT_FRAME::createPopupMenuForTracks(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), GERBER_FILE_IMAGE::DisplayImageInfo(), MARKER_BASE::DisplayMarkerInfo(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRC::DRC(), PCB_EDIT_FRAME::Edit_Gap(), LIB_EDIT_TOOL::editGraphicProperties(), LIB_PIN_TOOL::EditPinProperties(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), EVT_GRID_CMD_CELL_CHANGED(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PCB_EDIT_FRAME::GenFootprintsReport(), PANEL_MODEDIT_DEFAULTS::getGridValue(), PANEL_SETUP_TEXT_AND_GRAPHICS::getGridValue(), PANEL_SETUP_NETCLASSES::getNetclassValue(), GetUserUnits(), GRID_MENU::GRID_MENU(), GERBVIEW_FRAME::Liste_D_Codes(), CVPCB_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), FOOTPRINT_VIEWER_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotKey(), FOOTPRINT_WIZARD_FRAME::OnHotKey(), GERBVIEW_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnRightClick(), PANEL_PREV_3D::PANEL_PREV_3D(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), CONNECTION_SUBGRAPH::ResolveDrivers(), CVPCB_CONTROL::SwitchUnits(), GERBVIEW_CONTROL::SwitchUnits(), DISPLAY_FOOTPRINTS_FRAME::SyncMenusAndToolbars(), FOOTPRINT_EDIT_FRAME::SyncMenusAndToolbars(), SyncMenusAndToolbars(), GERBVIEW_FRAME::SyncMenusAndToolbars(), SCH_EDIT_FRAME::SyncMenusAndToolbars(), PCB_EDIT_FRAME::SyncMenusAndToolbars(), DRC::testDrilledHoles(), DRC::testUnconnected(), COMMON_TOOLS::ToggleUnits(), PANEL_SETUP_TRACKS_AND_VIAS::TransferDataFromWindow(), PANEL_SETUP_NETCLASSES::TransferDataFromWindow(), PANEL_EESCHEMA_SETTINGS::TransferDataToWindow(), PANEL_MODEDIT_SETTINGS::TransferDataToWindow(), PANEL_GERBVIEW_SETTINGS::TransferDataToWindow(), PANEL_PCBNEW_SETTINGS::TransferDataToWindow(), PANEL_SETUP_NETCLASSES::TransferDataToWindow(), UNIT_BINDER::UNIT_BINDER(), GRID_MENU::update(), TRACK_WIDTH_MENU::update(), DIFF_PAIR_MENU::update(), GERBVIEW_FRAME::updateDCodeSelectBox(), GERBVIEW_FRAME::updateGridSelectBox(), PCB_BASE_FRAME::UpdateGridSelectBox(), EE_INSPECTION_TOOL::UpdateMessagePanel(), DRC::updatePointers(), PNS_TUNE_STATUS_POPUP::UpdateStatus(), PL_EDITOR_FRAME::UpdateStatusBar(), SCH_BASE_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), GERBVIEW_FRAME::UpdateStatusBar(), PCB_EDIT_FRAME::UpdateTrackWidthSelectBox(), PCB_EDIT_FRAME::UpdateViaSizeSelectBox(), PANEL_SETUP_TRACKS_AND_VIAS::validateData(), and PANEL_SETUP_NETCLASSES::validateData().

◆ GetZoom()

double EDA_DRAW_FRAME::GetZoom ( )
inherited
Returns
The current zoom level.

Definition at line 401 of file legacy_gal/eda_draw_frame.cpp.

402 {
403  return GetScreen()->GetZoom();
404 }
double GetZoom() const
Function GetZoom returns the current "zoom factor", which is a measure of "internal units per device ...
Definition: base_screen.h:340
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408

References EDA_DRAW_FRAME::GetScreen(), and BASE_SCREEN::GetZoom().

Referenced by SCH_EDIT_FRAME::FindComponentAndItem(), SCH_EDIT_FRAME::OnFindDrcMarker(), SCH_EDIT_FRAME::updateFindReplaceView(), PCB_BASE_FRAME::updateZoomSelectBox(), and GERBVIEW_FRAME::updateZoomSelectBox().

◆ GetZoomLevelCoeff()

double EDA_DRAW_FRAME::GetZoomLevelCoeff ( ) const
inlineinherited

Return the coefficient to convert internal display scale factor to zoom level.

Definition at line 475 of file draw_frame.h.

475 { return m_zoomLevelCoeff; }
double m_zoomLevelCoeff
a suitable value to convert the internal zoom scaling factor
Definition: draw_frame.h:120

References EDA_DRAW_FRAME::m_zoomLevelCoeff.

Referenced by COMMON_TOOLS::doZoomToPreset(), EDA_DRAW_PANEL_GAL::GetLegacyZoom(), EDA_DRAW_FRAME::UseGalCanvas(), and ZOOM_MENU::ZOOM_MENU().

◆ GetZoomLevelIndicator()

const wxString SCH_BASE_FRAME::GetZoomLevelIndicator ( ) const
overridevirtualinherited

Function GetZoomLevelIndicator returns a human readable value which can be displayed as zoom level indicator in dialogs.

Virtual from the base class

Reimplemented from EDA_DRAW_FRAME.

Definition at line 180 of file sch_base_frame.cpp.

181 {
183 }
virtual const wxString GetZoomLevelIndicator() const
Return a human readable value which can be displayed as zoom level indicator in dialogs.

References EDA_DRAW_FRAME::GetZoomLevelIndicator().

◆ HandleBlockBegin()

bool SCH_BASE_FRAME::HandleBlockBegin ( wxDC *  aDC,
EDA_KEY  aKey,
const wxPoint &  aPosition,
int  aExplicitCommand = 0 
)
overrideprotectedvirtualinherited

Initialize a block command.

Parameters
aDCis the device context to perform the block command.
aKeyis the block command key press.
aPositionis the logical position of the start of the block command.
aExplicitCommand- if this is given, begin with this command, rather than looking up the command from aKey.

Reimplemented from EDA_DRAW_FRAME.

Definition at line 506 of file sch_base_frame.cpp.

508 {
510 
511  if( ( block->GetCommand() != BLOCK_IDLE ) || ( block->GetState() != STATE_NO_BLOCK ) )
512  return false;
513 
514  if( aExplicitCommand == 0 )
515  block->SetCommand( (BLOCK_COMMAND_T) BlockCommand( aKey ) );
516  else
517  block->SetCommand( (BLOCK_COMMAND_T) aExplicitCommand );
518 
519  if( block->GetCommand() == 0 )
520  return false;
521 
522  switch( block->GetCommand() )
523  {
524  case BLOCK_IDLE:
525  break;
526 
527  case BLOCK_MOVE: // Move
528  case BLOCK_DRAG: // Drag (block defined)
529  case BLOCK_DRAG_ITEM: // Drag from a drag item command
530  case BLOCK_DUPLICATE: // Duplicate
531  case BLOCK_DUPLICATE_AND_INCREMENT: // Duplicate and increment relevant references
532  case BLOCK_DELETE: // Delete
533  case BLOCK_COPY: // Copy
534  case BLOCK_FLIP: // Flip
535  case BLOCK_ZOOM: // Window Zoom
536  case BLOCK_MIRROR_X:
537  case BLOCK_MIRROR_Y: // mirror
538  block->InitData( m_canvas, aPosition );
540  break;
541 
542  case BLOCK_PASTE:
543  {
544  block->InitData( m_canvas, aPosition );
546 
547  wxRect bounds( 0, 0, 0, 0 );
548 
549  for( unsigned i = 0; i < block->GetCount(); ++i )
550  bounds.Union( block->GetItem( i )->GetBoundingBox() );
551 
552  block->SetOrigin( bounds.GetPosition() );
553  block->SetSize( bounds.GetSize() );
554  block->SetLastCursorPosition( wxPoint( 0, 0 ) );
555 
556  if( block->GetCount() == 0 ) // No data to paste
557  {
558  DisplayError( this, _( "Nothing to paste" ), 20 );
561  block->SetState( STATE_NO_BLOCK );
562  block->SetMessageBlock( this );
563  return true;
564  }
565 
566  if( !m_canvas->IsMouseCaptured() )
567  {
568  block->ClearItemsList();
569  wxFAIL_MSG( "SCH_BASE_FRAME::HandleBlockBegin() error: m_mouseCaptureCallback NULL" );
570  block->SetState( STATE_NO_BLOCK );
571  block->SetMessageBlock( this );
572  return true;
573  }
574 
575  block->SetState( STATE_BLOCK_MOVE );
576  block->SetFlags( IS_MOVED );
577  m_canvas->CallMouseCapture( aDC, aPosition, false );
578  m_canvas->Refresh();
579  }
580  break;
581 
582  default:
583  wxFAIL_MSG( wxString::Format( "SCH_BASE_FRAME::HandleBlockBegin() unknown command: %s",
584  block->GetCommand() ) );
585  break;
586  }
587 
588  block->SetMessageBlock( this );
589  return true;
590 }
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
Definition: base_screen.h:214
virtual int BlockCommand(EDA_KEY aKey)
Return the block command code (BLOCK_MOVE, BLOCK_COPY...) corresponding to the keys pressed (ALT,...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void ShowSelectionArea(bool aShow=true)
Definition: sch_view.cpp:159
BLOCK_COMMAND_T
virtual void InitBlockPasteInfos()
SCH_DRAW_PANEL * GetCanvas() const override
virtual void CallMouseCapture(wxDC *aDC, const wxPoint &aPosition, bool aErase)
Function CallMouseCapture calls the mouse capture callback.
Definition: solve.cpp:178
KIGFX::SCH_VIEW * GetView() const
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
size_t i
Definition: json11.cpp:597
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:244
virtual void SetMouseCaptureCallback(MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback)
void SetCommand(BLOCK_COMMAND_T aCommand)
#define IS_MOVED
Item being moved.
Definition: base_struct.h:113

References BLOCK_COPY, BLOCK_DELETE, BLOCK_DRAG, BLOCK_DRAG_ITEM, BLOCK_DUPLICATE, BLOCK_DUPLICATE_AND_INCREMENT, BLOCK_FLIP, BLOCK_IDLE, BLOCK_MIRROR_X, BLOCK_MIRROR_Y, BLOCK_MOVE, BLOCK_PASTE, BLOCK_ZOOM, EDA_DRAW_FRAME::BlockCommand(), EDA_DRAW_PANEL::CallMouseCapture(), DisplayError(), Format(), SCH_BASE_FRAME::GetCanvas(), SCH_BASE_FRAME::GetScreen(), SCH_DRAW_PANEL::GetView(), i, EDA_DRAW_FRAME::InitBlockPasteInfos(), IS_MOVED, EDA_DRAW_PANEL::IsMouseCaptured(), BASE_SCREEN::m_BlockLocate, EDA_DRAW_FRAME::m_canvas, EDA_DRAW_PANEL::Refresh(), BLOCK_SELECTOR::SetCommand(), EDA_DRAW_PANEL::SetMouseCaptureCallback(), KIGFX::SCH_VIEW::ShowSelectionArea(), STATE_BLOCK_MOVE, and STATE_NO_BLOCK.

◆ HandleBlockEnd()

bool EDA_DRAW_FRAME::HandleBlockEnd ( wxDC *  DC)
virtualinherited

Handle the "end" of a block command, i.e.

is called at the end of the definition of the area of a block. depending on the current block command, this command is executed or parameters are initialized to prepare a call to HandleBlockPlace in GetScreen()->m_BlockLocate

Returns
false if no item selected, or command finished, true if some items found and HandleBlockPlace must be called later

Reimplemented in PCB_EDIT_FRAME, GERBVIEW_FRAME, FOOTPRINT_EDIT_FRAME, and PL_EDITOR_FRAME.

Definition at line 529 of file legacy_gal/eda_draw_frame.cpp.

530 {
531  wxFAIL_MSG( "Obsolete; how'd we get here?" );
532  return false;
533 }

Referenced by AbortBlockCurrentCommand(), PCB_BASE_EDIT_FRAME::duplicateItem(), InvokeDialogImportGfxBoard(), InvokeDialogImportGfxModule(), and EDA_DRAW_PANEL::OnMouseEvent().

◆ HandleBlockPlace()

void EDA_DRAW_FRAME::HandleBlockPlace ( wxDC *  DC)
virtualinherited

Called after HandleBlockEnd, when a block command needs to be executed after the block is moved to its new place (bloc move, drag, copy .

. ) Parameters must be initialized in GetScreen()->m_BlockLocate

Reimplemented in PCB_EDIT_FRAME, GERBVIEW_FRAME, FOOTPRINT_EDIT_FRAME, and PL_EDITOR_FRAME.

Definition at line 523 of file legacy_gal/eda_draw_frame.cpp.

524 {
525  wxFAIL_MSG( "Obsolete; how'd we get here?" );
526 }

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

◆ HardRedraw()

void LIB_EDIT_FRAME::HardRedraw ( )
overridevirtual

Rebuild the GAL and redraw the screen.

Call when something went wrong.

Reimplemented from SCH_BASE_FRAME.

Definition at line 980 of file lib_edit_frame.cpp.

981 {
982  SyncLibraries( true );
983  RebuildView();
984 }
void SyncLibraries(bool aShowProgress)
Synchronize the library manager to the symbol library table, and then the symbol tree to the library ...

References RebuildView(), and SyncLibraries().

◆ help_name()

wxString EDA_BASE_FRAME::help_name ( )
protectedvirtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 374 of file eda_base_frame.cpp.

375 {
376  return Kiface().GetHelpFileName();
377 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
const wxString & GetHelpFileName() const
Function GetHelpFileName returns just the basename portion of the current help file.
Definition: kiface_i.h:121

References KIFACE_I::GetHelpFileName(), and Kiface().

Referenced by EDA_BASE_FRAME::GetKicadHelp().

◆ ImportHotkeyConfigFromFile()

void EDA_BASE_FRAME::ImportHotkeyConfigFromFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

Prompt the user for an old hotkey file to read, and read it.

Parameters
aDescList= current hotkey list descr. to initialize.
aDefaultShortname= a default short name (extension not needed) like eechema, kicad...

Definition at line 709 of file hotkeys_basic.cpp.

711 {
712  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
713  wxString mask = wxT( "*." ) + ext;
714 
715 
716  wxString path = GetMruPath();
717  wxFileName fn( aDefaultShortname );
718  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
719 
720  wxString filename = EDA_FILE_SELECTOR( _( "Read Hotkey Configuration File:" ),
721  path,
722  fn.GetFullPath(),
723  ext,
724  mask,
725  this,
726  wxFD_OPEN,
727  true );
728 
729  if( filename.IsEmpty() )
730  return;
731 
732  ::ReadHotkeyConfigFile( filename, aDescList, false );
733  WriteHotkeyConfig( aDescList );
734  SetMruPath( wxFileName( filename ).GetPath() );
735 }
void SetMruPath(const wxString &aPath)
int ReadHotkeyConfigFile(const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList, const bool aDefaultLocation)
Function ReadHotkeyConfig Read hotkey configuration for a given app, possibly before the frame for th...
wxString GetMruPath() const
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
virtual int WriteHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
Store the current hotkey list.
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34

References DEFAULT_HOTKEY_FILENAME_EXT, EDA_FILE_SELECTOR(), EDA_BASE_FRAME::GetMruPath(), ReadHotkeyConfigFile(), EDA_BASE_FRAME::SetMruPath(), and EDA_BASE_FRAME::WriteHotkeyConfig().

Referenced by PANEL_HOTKEYS_EDITOR::installButtons().

◆ InitBlockPasteInfos()

void EDA_DRAW_FRAME::InitBlockPasteInfos ( )
virtualinherited

Definition at line 510 of file legacy_gal/eda_draw_frame.cpp.

511 {
512  wxFAIL_MSG( "Obsolete; how'd we get here?" );
513 }

Referenced by SCH_BASE_FRAME::HandleBlockBegin().

◆ InstallPreferences()

void LIB_EDIT_FRAME::InstallPreferences ( PAGED_DIALOG aParent)
overridevirtual

Allows Libedit to install its preferences panel into the preferences dialog.

Reimplemented from EDA_BASE_FRAME.

Definition at line 609 of file eeschema_config.cpp.

610 {
611  wxTreebook* book = aParent->GetTreebook();
612 
613  book->AddPage( new PANEL_LIBEDIT_SETTINGS( this, book ), _( "Symbol Editor" ) );
614  book->AddSubPage( new PANEL_LIBEDIT_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) );
615 }
wxTreebook * GetTreebook()
Definition: paged_dialog.h:43

References PAGED_DIALOG::GetTreebook().

◆ isAutoSaveRequired()

virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Return the auto save status of the application.

Override this function if your derived frame supports automatic file saving.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 176 of file eda_base_frame.h.

176 { return false; }

Referenced by EDA_BASE_FRAME::ProcessEvent().

◆ isCurrentPart()

bool LIB_EDIT_FRAME::isCurrentPart ( const LIB_ID aLibId) const
private

Returns true if aLibId is an alias for the editor screen part.

Definition at line 914 of file lib_edit_frame.cpp.

915 {
916  // This will return the root part of any alias
917  LIB_PART* part = m_libMgr->GetBufferedPart( aLibId.GetLibItemName(), aLibId.GetLibNickname() );
918  // Now we can compare the libId of the current part and the root part
919  return ( part && GetCurPart() && part->GetLibId() == GetCurPart()->GetLibId() );
920 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
LIB_MANAGER * m_libMgr
manager taking care of temporary modificatoins
const LIB_ID & GetLibId() const
Define a library symbol object.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
LIB_PART * GetBufferedPart(const wxString &aAlias, const wxString &aLibrary)
Returns the part copy from the buffer.

References LIB_MANAGER::GetBufferedPart(), GetCurPart(), LIB_PART::GetLibId(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), and m_libMgr.

Referenced by OnRemovePart(), OnRevert(), and savePartAs().

◆ IsDismissed()

bool KIWAY_PLAYER::IsDismissed ( )
protectedinherited

Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal().

IOW, it will return true if the dialog is not modal or if it is modal and has been dismissed.

Definition at line 156 of file kiway_player.cpp.

157 {
158  return !m_modal_loop;
159 }
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:257

References KIWAY_PLAYER::m_modal_loop.

Referenced by LIB_VIEW_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), and FOOTPRINT_WIZARD_FRAME::OnCloseWindow().

◆ IsGalCanvasActive()

bool EDA_DRAW_FRAME::IsGalCanvasActive ( ) const
inlineinherited

Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use.

Returns
True for GAL-based canvas, false for standard canvas.

Definition at line 924 of file draw_frame.h.

924 { return m_galCanvasActive; }
bool m_galCanvasActive
whether to use new GAL engine
Definition: draw_frame.h:102

References EDA_DRAW_FRAME::m_galCanvasActive.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_FRAME::AddModuleToBoard(), PCB_EDIT_FRAME::AppendBoardFile(), GERBER_LAYER_WIDGET::AreArbitraryColorsAllowed(), PCB_LAYER_WIDGET::AreArbitraryColorsAllowed(), PCB_EDIT_FRAME::Check_All_Zones(), PCB_EDIT_FRAME::Edit_Zone_Params(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), DIALOG_SELECT_NET_FROM_LIST::HighlightNet(), FOOTPRINT_EDIT_FRAME::Import_Module(), DIALOG_PAD_PROPERTIES::OnCancel(), DIALOG_PAD_PROPERTIES::onChangePadMode(), STATUS_POPUP::onCharHook(), FOOTPRINT_EDIT_FRAME::OnCloseWindow(), GERBVIEW_FRAME::OnCloseWindow(), PCB_LAYER_WIDGET::OnLayerColorChange(), GERBER_LAYER_WIDGET::OnLayerColorChange(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnLeftDClickItem(), PCB_BASE_FRAME::OnModify(), PCB_LAYER_WIDGET::OnRenderColorChange(), GERBER_LAYER_WIDGET::OnRenderColorChange(), PCB_LAYER_WIDGET::OnRenderEnable(), GERBER_LAYER_WIDGET::OnRenderEnable(), GERBVIEW_FRAME::OnSelectHighlightChoice(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnSelectItem(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), GERBVIEW_FRAME::OnUpdateSelectZoom(), PCB_BASE_FRAME::OnUpdateSelectZoom(), PCB_BASE_FRAME::OnUpdateSwitchCanvas(), GERBVIEW_FRAME::OnUpdateSwitchCanvas(), PCB_EDIT_FRAME::OpenProjectFiles(), DIALOG_PAD_PROPERTIES::prepareCanvas(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), DIALOG_PAD_PROPERTIES::redraw(), Refresh(), FOOTPRINT_WIZARD_FRAME::ReloadFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), GERBVIEW_FRAME::SetActiveLayer(), GERBVIEW_FRAME::SetGridColor(), EDA_DRAW_FRAME::SetNoToolSelected(), GERBVIEW_FRAME::SetPageSettings(), EDA_DRAW_FRAME::SetToolID(), DIALOG_SET_GRID::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataFromWindow(), PCB_BASE_FRAME::UpdateMsgPanel(), FOOTPRINT_WIZARD_FRAME::updateView(), and FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME().

◆ IsGridVisible()

◆ IsModal()

◆ IsSearchTreeShown()

bool LIB_EDIT_FRAME::IsSearchTreeShown ( )

Definition at line 392 of file lib_edit_frame.cpp.

393 {
394  return m_auimgr.GetPane( m_treePane ).IsShown();
395 }
wxAuiManager m_auimgr
SYMBOL_TREE_PANE * m_treePane
component search tree widget

References EDA_BASE_FRAME::m_auimgr, and m_treePane.

Referenced by OnToggleSearchTree(), ReCreateMenuBar(), and SyncMenusAndToolbars().

◆ IsType()

◆ IsWritable()

bool EDA_BASE_FRAME::IsWritable ( const wxFileName &  aFileName)
inherited

Checks if aFileName can be written.

The function performs a number of tests on aFileName to verify that it can be saved. If aFileName defines a path with no file name, them the path is tested for user write permission. If aFileName defines a file name that does not exist in the path, the path is tested for user write permission. If aFileName defines a file that already exits, the file name is tested for user write permissions.

Note
The file name path must be set or an assertion will be raised on debug builds and return false on release builds.
Parameters
aFileNameThe full path and/or file name of the file to test.
Returns
False if aFileName cannot be written.

Definition at line 540 of file eda_base_frame.cpp.

541 {
542  wxString msg;
543  wxFileName fn = aFileName;
544 
545  // Check for absence of a file path with a file name. Unfortunately KiCad
546  // uses paths relative to the current project path without the ./ part which
547  // confuses wxFileName. Making the file name path absolute may be less than
548  // elegant but it solves the problem.
549  if( fn.GetPath().IsEmpty() && fn.HasName() )
550  fn.MakeAbsolute();
551 
552  wxCHECK_MSG( fn.IsOk(), false,
553  wxT( "File name object is invalid. Bad programmer!" ) );
554  wxCHECK_MSG( !fn.GetPath().IsEmpty(), false,
555  wxT( "File name object path <" ) + fn.GetFullPath() +
556  wxT( "> is not set. Bad programmer!" ) );
557 
558  if( fn.IsDir() && !fn.IsDirWritable() )
559  {
560  msg.Printf( _( "You do not have write permissions to folder \"%s\"." ),
561  GetChars( fn.GetPath() ) );
562  }
563  else if( !fn.FileExists() && !fn.IsDirWritable() )
564  {
565  msg.Printf( _( "You do not have write permissions to save file \"%s\" to folder \"%s\"." ),
566  GetChars( fn.GetFullName() ), GetChars( fn.GetPath() ) );
567  }
568  else if( fn.FileExists() && !fn.IsFileWritable() )
569  {
570  msg.Printf( _( "You do not have write permissions to save file \"%s\"." ),
571  GetChars( fn.GetFullPath() ) );
572  }
573 
574  if( !msg.IsEmpty() )
575  {
576  wxMessageBox( msg );
577  return false;
578  }
579 
580  return true;
581 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100

References GetChars().

Referenced by SCH_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::SaveEEFile(), saveLibrary(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), CVPCB_MAINFRAME::SaveProjectFile(), and SCH_EDIT_FRAME::SaveProjectSettings().

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in.

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 61 of file kiway_player.h.

62  {
63  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
64  return *m_kiway;
65  }
KIWAY * m_kiway
Definition: kiway_player.h:101

References KIWAY_HOLDER::m_kiway.

Referenced by TREEPROJECT_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), SCH_EDIT_FRAME::AppendSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), CVPCB_MAINFRAME::CreateScreenCmp(), SCH_EDIT_FRAME::CreateScreens(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getLibraryBuffer(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::InitSheet(), KIWAY_PLAYER::language_change(), KICAD_MANAGER_FRAME::language_change(), CVPCB_MAINFRAME::LoadFootprintFiles(), KICAD_MANAGER_FRAME::LoadProject(), LIB_VIEW_FRAME::OnAddPartToSchematic(), OnAddPartToSchematic(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), KICAD_MANAGER_FRAME::OnEditFpLibTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), KICAD_MANAGER_FRAME::OnEditSymLibTable(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_BASE_FRAME::OnOpenLibraryViewer(), SCH_EDIT_FRAME::OnOpenPcbModuleEditor(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), KICAD_MANAGER_FRAME::OnRunPcbFpEditor(), KICAD_MANAGER_FRAME::OnRunSchLibEditor(), SCH_EDIT_FRAME::OnSimulate(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), SCH_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), refreshSchematic(), SCH_EDIT_FRAME::rescueProject(), KICAD_MANAGER_FRAME::RunEeschema(), KICAD_MANAGER_FRAME::RunPcbNew(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlistToCvpcb(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), EDA_BASE_FRAME::ShowPreferences(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::UpdatePart(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ kiway_express()

void KIWAY_PLAYER::kiway_express ( KIWAY_EXPRESS aEvent)
protectedinherited

event handler, routes to derivative specific virtual KiwayMailIn()

Definition at line 177 of file kiway_player.cpp.

178 {
179  // logging support
180  KiwayMailIn( aEvent ); // call the virtual, override in derived.
181 }
virtual void KiwayMailIn(KIWAY_EXPRESS &aEvent)
Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.

References KIWAY_PLAYER::KiwayMailIn().

◆ KiwayMailIn()

void LIB_EDIT_FRAME::KiwayMailIn ( KIWAY_EXPRESS aEvent)
overridevirtual

Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.

Merely override it in derived classes.

Reimplemented from KIWAY_PLAYER.

Definition at line 1003 of file lib_edit_frame.cpp.

1004 {
1005  const std::string& payload = mail.GetPayload();
1006 
1007  switch( mail.Command() )
1008  {
1009  case MAIL_LIB_EDIT:
1010  if( !payload.empty() )
1011  {
1012  wxString libFileName( payload );
1013  wxString libNickname;
1014  wxString msg;
1015 
1016  SYMBOL_LIB_TABLE* libTable = Prj().SchSymbolLibTable();
1017  const LIB_TABLE_ROW* libTableRow = libTable->FindRowByURI( libFileName );
1018 
1019  if( !libTableRow )
1020  {
1021  msg.Printf( _( "The current configuration does not include the symbol library\n"
1022  "\"%s\".\nUse Manage Symbol Libraries to edit the configuration." ),
1023  libFileName );
1024  DisplayErrorMessage( this, _( "Library not found in symbol library table." ), msg );
1025  break;
1026  }
1027 
1028  libNickname = libTableRow->GetNickName();
1029 
1030  if( !libTable->HasLibrary( libNickname, true ) )
1031  {
1032  msg.Printf( _( "The library with the nickname \"%s\" is not enabled\n"
1033  "in the current configuration. Use Manage Symbol Libraries to\n"
1034  "edit the configuration." ), libNickname );
1035  DisplayErrorMessage( this, _( "Symbol library not enabled." ), msg );
1036  break;
1037  }
1038 
1039  SetCurLib( libNickname );
1040 
1041  if( m_treePane )
1042  {
1043  LIB_ID id( libNickname, wxEmptyString );
1044  m_treePane->GetLibTree()->ExpandLibId( id );
1045  m_treePane->GetLibTree()->CenterLibId( id );
1046  }
1047  }
1048 
1049  break;
1050 
1051  default:
1052  ;
1053  }
1054 }
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Function DisplayErrorMessage displays an error message with aMessage.
Definition: confirm.cpp:258
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
const wxString & GetNickName() const
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
const LIB_TABLE_ROW * FindRowByURI(const wxString &aURI)
void ExpandLibId(const LIB_ID &aLibId)
Expand and item i the tree widget.
Definition: lib_tree.cpp:182
wxString SetCurLib(const wxString &aLibNickname)
Sets the current library nickname and returns the old library nickname.
LIB_TREE * GetLibTree() const
SYMBOL_TREE_PANE * m_treePane
component search tree widget
void CenterLibId(const LIB_ID &aLibId)
Ensure that an item is visible (preferrably centered).
Definition: lib_tree.cpp:171

References LIB_TREE::CenterLibId(), KIWAY_EXPRESS::Command(), DisplayErrorMessage(), LIB_TREE::ExpandLibId(), LIB_TABLE::FindRowByURI(), SYMBOL_TREE_PANE::GetLibTree(), LIB_TABLE_ROW::GetNickName(), KIWAY_EXPRESS::GetPayload(), LIB_TABLE::HasLibrary(), m_treePane, MAIL_LIB_EDIT, KIWAY_HOLDER::Prj(), and SetCurLib().

◆ language_change()

void KIWAY_PLAYER::language_change ( wxCommandEvent &  event)
protectedinherited

Function language_change is an event handler called on a language menu selection.

Definition at line 184 of file kiway_player.cpp.

185 {
186  int id = event.GetId();
187 
188  // tell all the KIWAY_PLAYERs about the language change.
189  Kiway().SetLanguage( id );
190 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:61
VTBL_ENTRY void SetLanguage(int aLanguage)
Function SetLanguage changes the language and then calls ShowChangedLanguage() on all KIWAY_PLAYERs.
Definition: kiway.cpp:415

References KIWAY_HOLDER::Kiway(), and KIWAY::SetLanguage().

◆ LibraryFileBrowser()

bool EDA_DRAW_FRAME::LibraryFileBrowser ( bool  doOpen,
wxFileName &  aFilename,
const wxString &  wildcard,
const wxString &  ext,
bool  isDirectory = false 
)
protectedinherited
Parameters
doOpenif true runs an Open Library browser, otherwise New Library
aFilenamefor New may contain a default name; in both cases return the chosen filename.
wildcarda wildcard to filter the displayed files
extthe library file extension
isDirectoryindicates the library files are directories
Returns
true for OK; false for Cancel.

Definition at line 1240 of file legacy_gal/eda_draw_frame.cpp.

1243 {
1244  wxString prompt = doOpen ? _( "Select Library" ) : _( "New Library" );
1245  aFilename.SetExt( ext );
1246 
1247  if( isDirectory && doOpen )
1248  {
1249  wxDirDialog dlg( this, prompt, Prj().GetProjectPath(),
1250  wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
1251 
1252  if( dlg.ShowModal() == wxID_CANCEL )
1253  return false;
1254 
1255  aFilename = dlg.GetPath();
1256  aFilename.SetExt( ext );
1257  }
1258  else
1259  {
1260  wxFileDialog dlg( this, prompt, Prj().GetProjectPath(), aFilename.GetFullName() ,
1261  wildcard, doOpen ? wxFD_OPEN | wxFD_FILE_MUST_EXIST
1262  : wxFD_SAVE | wxFD_CHANGE_DIR | wxFD_OVERWRITE_PROMPT );
1263 
1264  if( dlg.ShowModal() == wxID_CANCEL )
1265  return false;
1266 
1267  aFilename = dlg.GetPath();
1268  aFilename.SetExt( ext );
1269  }
1270 
1271  return true;
1272 }
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.

References KIWAY_HOLDER::Prj().

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), addLibraryFile(), and PCB_BASE_EDIT_FRAME::CreateNewLibrary().

◆ LoadCanvasTypeSetting()

EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::LoadCanvasTypeSetting ( )
inherited

Returns the canvas type stored in the application settings.

Definition at line 719 of file legacy_gal/eda_draw_frame.cpp.

720 {
722  wxConfigBase* cfg = Kiface().KifaceSettings();
723 
724  if( cfg )
725  {
726  canvasType = (EDA_DRAW_PANEL_GAL::GAL_TYPE)
728  }
729 
730  if( canvasType < EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE
731  || canvasType >= EDA_DRAW_PANEL_GAL::GAL_TYPE_LAST )
732  {
733  wxASSERT( false );
735  }
736 
737  // Coerce the value into a GAL type when Legacy is not available
738  // Default to Cairo, and on the first, user will be prompted for OpenGL
739  if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE
740  && !ADVANCED_CFG::GetCfg().AllowLegacyCanvas() )
741  {
742 #ifdef __WXMAC__
743  // Cairo renderer doesn't handle Retina displays
745 #else
747 #endif
748  }
749 
750  return canvasType;
751 }
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:103
virtual wxString GetCanvasTypeKey()
Definition: draw_frame.h:239
Sentinel, do not use as a parameter.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
GAL not used (the legacy wxDC engine is used)
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers of advanced config.

References EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO, EDA_DRAW_PANEL_GAL::GAL_TYPE_LAST, EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL, EDA_DRAW_FRAME::GetCanvasTypeKey(), ADVANCED_CFG::GetCfg(), Kiface(), and KIFACE_I::KifaceSettings().

Referenced by SCH_BASE_FRAME::createCanvas(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), and GERBVIEW_FRAME::GERBVIEW_FRAME().

◆ LoadComponentAndSelectLib()

bool LIB_EDIT_FRAME::LoadComponentAndSelectLib ( const LIB_ID aLibId,
int  aUnit,
int  aConvert 
)

Selects the currently active library and loads the symbol from aLibId.

Parameters
aLibIdis the LIB_ID of the symbol to select.
aUnitthe unit to show
aConvertthe DeMorgan variant to show
Returns
true if the symbol defined by aLibId was loaded.

Definition at line 148 of file libedit.cpp.

149 {
150  if( GetCurPart() && GetCurPart()->GetLibId() == aLibId
151  && GetUnit() == aUnit && GetConvert() == aConvert )
152  {
153  return true;
154  }
155 
156  if( GetScreen()->IsModify() && GetCurPart() )
157  {
158  if( !HandleUnsavedChanges( this, _( "The current symbol has been modified. Save changes?" ),
159  [&]()->bool { return saveCurrentPart(); } ) )
160  {
161  return false;
162  }
163  }
164 
166  return LoadComponentFromCurrentLib( aLibId.GetLibItemName(), aUnit, aConvert );
167 }
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Function HandleUnsavedChanges displays a dialog with Save, Cancel and Discard Changes buttons.
Definition: confirm.cpp:212
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
bool LoadComponentFromCurrentLib(const wxString &aAliasName, int aUnit=0, int aConvert=0)
Loads a symbol from the current active library, optionally setting the selected unit and convert.
Definition: libedit.cpp:170
void SelectActiveLibrary(const wxString &aLibrary=wxEmptyString)
Set the current active library to aLibrary.
Definition: libedit.cpp:67
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
bool saveCurrentPart()
Saves the current part.
Definition: libedit.cpp:129

References GetConvert(), GetCurPart(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), SCH_BASE_FRAME::GetScreen(), GetUnit(), HandleUnsavedChanges(), LoadComponentFromCurrentLib(), saveCurrentPart(), and SelectActiveLibrary().

◆ LoadComponentFromCurrentLib()

bool LIB_EDIT_FRAME::LoadComponentFromCurrentLib ( const wxString &  aAliasName,
int  aUnit = 0,
int  aConvert = 0 
)
private

Loads a symbol from the current active library, optionally setting the selected unit and convert.

Parameters
aAliasNameThe symbol alias name to load from the current library.
aUnitUnit to be selected
aConvertConvert to be selected
Returns
true if the symbol loaded correctly.

Definition at line 170 of file libedit.cpp.

172 {
173  LIB_ALIAS* alias = nullptr;
174 
175  try
176  {
177  alias = Prj().SchSymbolLibTable()->LoadSymbol( GetCurLib(), aAliasName );
178  }
179  catch( const IO_ERROR& ioe )
180  {
181  wxString msg;
182 
183  msg.Printf( _( "Error occurred loading symbol \"%s\" from library \"%s\"." ),
184  aAliasName, GetCurLib() );
185  DisplayErrorMessage( this, msg, ioe.What() );
186  return false;
187  }
188 
189  if( !alias || !LoadOneLibraryPartAux( alias, GetCurLib(), aUnit, aConvert ) )
190  return false;
191 
192  // Enable synchronized pin edit mode for symbols with interchangeable units
194 
196  m_toolManager->RunAction( "common.Control.zoomFitScreen", true );
197  SetShowDeMorgan( GetCurPart()->HasConversion() );
198 
199  if( aUnit > 0 )
201 
202  return true;
203 }
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:130
LIB_PART * GetCurPart() const
Return the current part being edited or NULL if none selected.
Part library alias object definition.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Function DisplayErrorMessage displays an error message with aMessage.
Definition: confirm.cpp:258
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
wxString GetCurLib() const
The nickname of the current library being edited and empty string if none.
void SetShowDeMorgan(bool show)
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
virtual void ClearUndoRedoList()
Function ClearUndoRedoList clear undo and redo list, using ClearUndoORRedoList() picked items are del...
bool LoadOneLibraryPartAux(LIB_ALIAS *aLibEntry, const wxString &aLibrary, int aUnit, int aConvert)
Create a copy of aLibEntry into memory.
Definition: libedit.cpp:222
void RebuildSymbolUnitsList()
bool m_SyncPinEdit
Set to true to not synchronize pins at the same position when editing symbols with multiple units or ...
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
bool UnitsLocked() const
Check whether part units are interchangeable.

References BASE_SCREEN::ClearUndoRedoList(), DisplayErrorMessage(), GetCurLib(), GetCurPart(), SCH_BASE_FRAME::GetScreen(), LoadOneLibraryPartAux(), m_SyncPinEdit, EDA_DRAW_FRAME::m_toolManager, KIWAY_HOLDER::Prj(), RebuildSymbolUnitsList(), TOOL_MANAGER::RunAction(), SetShowDeMorgan(), LIB_PART::UnitsLocked(), and IO_ERROR::What().

Referenced by LoadComponentAndSelectLib().

◆ LoadOneLibraryPartAux()

bool LIB_EDIT_FRAME::LoadOneLibraryPartAux ( LIB_ALIAS aLibEntry,
const wxString &  aLibrary,
int  aUnit,
int  aConvert 
)
private

Create a copy of aLibEntry into memory.

Parameters
aLibEntryA pointer to the LIB_ALIAS object to an already loaded.
aLibrarythe path to the library file that aLibEntry was loaded from. This is for error messaging purposes only.
aUnitthe initial unit to show.
aConvertthe initial DeMorgan variant to show.
Returns
True if a copy of aLibEntry was successfully copied.

Definition at line 222 of file libedit.cpp.

224 {
225  wxString msg, rootName;
226 
227  if( !aEntry || aLibrary.empty() )
228  return false;
229 
230  if( aEntry->GetName().IsEmpty() )
231  {
232  wxLogWarning( "Symbol in library \"%s\" has empty name field.", aLibrary );
233  return false;
234  }
235 
236  LIB_PART* lib_part = m_libMgr->GetBufferedPart( aEntry->GetName(), aLibrary );
237  wxASSERT( lib_part );
238 
239  m_unit = aUnit > 0 ? aUnit : 1;
240  m_convert = aConvert > 0 ? aConvert : 1;
241 
242  // The buffered screen for the part
243  SCH_SCREEN* part_screen = m_libMgr->GetScreen( lib_part->GetName(), aLibrary );
244 
245  const SCH_SCREEN* curr_screen = GetScreen();
246 
247  // Before we set the frame screen, transfer any settings from the current
248  // screen that we want to keep to the incoming (buffered) part's screen
249  // which could be out of date relative to the current screen.
250  if( curr_screen )
251  synchronizeLibEditScreenSettings( *curr_screen, *part_screen );
252 
253  SetScreen( part_screen );
254  SetCurPart( new LIB_PART( *lib_part ) );
255  SetCurLib( aLibrary );
256 
257  m_toolManager->RunAction( "common.Control.zoomFitScreen", true );
258  updateTitle();
260 
261  // Display the document information based on the entry selected just in
262  // case the entry is an alias.
263  DisplayCmpDoc();
264  Refresh();
265 
266  return true;
267 }
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:130
static void synchronizeLibEditScreenSettings(const SCH_SCREEN &aCurrentScreen, SCH_SCREEN &aIncomingScreen)
Synchronise screen settings from a current screen into another screen.
Definition: libedit.cpp:215
LIB_MANAGER * m_libMgr
manager taking care of temporary modificatoins
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
SCH_SCREEN * GetScreen(const wxString &aAlias, const wxString &aLibrary)
Returns the screen used to edit a specific part.