KiCad PCB EDA Suite
DISPLAY_FOOTPRINTS_FRAME Class Reference

Class DISPLAY_FOOTPRINTS_FRAME is used to display footprints. More...

#include <display_footprints_frame.h>

Inheritance diagram for DISPLAY_FOOTPRINTS_FRAME:
PCB_BASE_FRAME EDA_DRAW_FRAME KIWAY_PLAYER EDA_BASE_FRAME KIWAY_HOLDER

Public Member Functions

 DISPLAY_FOOTPRINTS_FRAME (KIWAY *aKiway, wxWindow *aParent)
 
 ~DISPLAY_FOOTPRINTS_FRAME () override
 
void OnCloseWindow (wxCloseEvent &Event) override
 
void OnUIToolSelection (wxUpdateUIEvent &aEvent)
 UI events: More...
 
void RedrawActiveWindow (wxDC *DC, bool EraseBg) override
 
void ReCreateHToolbar () override
 
void ReCreateVToolbar () override
 
void ReCreateOptToolbar () override
 
void InitDisplay ()
 Function InitDisplay Refresh the full display for this frame: Set the title, the status line and redraw the canvas Must be called after the footprint to display is modifed. More...
 
void updateView ()
 update the gal canvas (view, colors ...) 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 ApplyDisplaySettingsToGAL ()
 Updates the GAL with display settings changes. More...
 
void UpdateMsgPanel () override
 

More...
 
bool GetAutoZoom () const
 
void SetAutoZoom (bool aEnable)
 
bool IsGridVisible () const override
 Function IsGridVisible() , virtual. More...
 
void SetGridVisibility (bool aVisible) override
 Function SetGridVisibility() , virtual It may be overloaded by derived classes if you want to store/retrieve the grid visibility in configuration. More...
 
COLOR4D GetGridColor () override
 Function GetGridColor() , virtual. More...
 
void OnLeftClick (wxDC *DC, const wxPoint &MousePos) override
 
void OnLeftDClick (wxDC *DC, const wxPoint &MousePos) override
 
bool OnRightClick (const wxPoint &MousePos, wxMenu *PopMenu) override
 
bool GeneralControl (wxDC *DC, const wxPoint &aPosition, EDA_KEY aHotKey=0) override
 Perform application specific control using aDC at aPosition in logical units. More...
 
void InstallOptionsDisplay (wxCommandEvent &event)
 
MODULEGet_Module (const wxString &CmpName)
 
EDA_HOTKEYGetHotKeyDescription (int aCommand) const override
 

More...
 
void Show3D_Frame (wxCommandEvent &event) override
 Display 3D frame of current footprint selection. More...
 
void SaveCopyInUndoList (BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand=UR_UNSPECIFIED, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
 Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands. More...
 
void SaveCopyInUndoList (const PICKED_ITEMS_LIST &aItemsList, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
 Function SaveCopyInUndoList (overloaded). More...
 
void SyncMenusAndToolbars () override
 Update the toolbars and menus (mostly settings/check buttons/checkboxes) with the current controller state. More...
 
EDA_3D_VIEWERGet3DViewerFrame ()
 
bool Update3DView (const wxString *aTitle=nullptr)
 Update the 3D view, if the viewer is opened by this frame. More...
 
MODULELoadFootprint (const LIB_ID &aFootprintId)
 Function LoadFootprint attempts to load aFootprintId from the footprint library table. More...
 
EDA_RECT GetBoardBoundingBox (bool aBoardEdgesOnly=false) const
 Function GetBoardBoundingBox calculates the bounding box containing all board items (or board edge segments). More...
 
const BOX2I GetDocumentExtents () const override
 
virtual 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 &aPoint) override
 
const wxPoint & GetGridOrigin () const override
 Return the absolute coordinates of the origin of the snap grid. More...
 
void SetGridOrigin (const wxPoint &aPoint) override
 
const TITLE_BLOCKGetTitleBlock () const override
 
void SetTitleBlock (const TITLE_BLOCK &aTitleBlock) override
 
virtual BOARD_DESIGN_SETTINGSGetDesignSettings () const
 Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame. More...
 
virtual void SetDesignSettings (const BOARD_DESIGN_SETTINGS &aSettings)
 
void SetDrawBgColor (COLOR4D aColor) override
 
void * GetDisplayOptions () override
 Function GetDisplayOptions returns the display options current in use Display options are relative to the way tracks, vias, outlines and other things are shown (for instance solid or sketch mode) Must be overloaded in frames which have display options (board editor and footprint editor) More...
 
const ZONE_SETTINGSGetZoneSettings () const
 
void SetZoneSettings (const ZONE_SETTINGS &aSettings)
 
virtual const PCB_PLOT_PARAMSGetPlotSettings () const
 Function GetPlotSettings returns the PCB_PLOT_PARAMS for the BOARD owned by this frame. More...
 
virtual void SetPlotSettings (const PCB_PLOT_PARAMS &aSettings)
 
virtual void SetBoard (BOARD *aBoard)
 Function SetBoard sets the m_Pcb member in such as way as to ensure deleting any previous BOARD. More...
 
BOARDGetBoard () const
 
virtual void ShowChangedLanguage () override
 Redraw the menus and what not in current language. More...
 
virtual void ReCreateMenuBar () override
 Recreates the menu bar. More...
 
virtual void SetToolID (int aId, int aCursor, const wxString &aToolMsg) override
 Set the tool command ID to aId and sets the cursor to aCursor. More...
 
virtual void UpdateStatusBar () override
 Update the status bar information. More...
 
PCB_SCREENGetScreen () const override
 Return a pointer to a BASE_SCREEN or one of its derivatives. More...
 
void UpdateGridSelectBox ()
 
virtual double BestZoom () override
 Function BestZoom. More...
 
const wxString GetZoomLevelIndicator () const override
 Function GetZoomLevelIndicator returns a human readable value which can be displayed as zoom level indicator in dialogs. More...
 
virtual bool CreateAndShow3D_Frame (bool aForceRecreateIfNotOwner)
 Shows the 3D view frame. More...
 
BOARD_ITEMPcbGeneralLocateAndDisplay (int aHotKeyCode=0)
 Function PcbGeneralLocateAndDisplay searches for an item under the mouse cursor. More...
 
void ProcessItemSelection (wxCommandEvent &event)
 
void SetCurItem (BOARD_ITEM *aItem, bool aDisplayInfo=true)
 Function SetCurItem sets the currently selected item and displays it in the MsgPanel. More...
 
BOARD_ITEMGetCurItem ()
 
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide ()
 Function GetCollectorsGuide. More...
 
wxString SelectLibrary (const wxString &aNicknameExisting)
 Function SelectLibrary puts up a dialog and allows the user to pick a library, for unspecified use. More...
 
MODULEGetFootprintFromBoardByReference ()
 Function GetFootprintFromBoardByReference. More...
 
virtual void OnModify ()
 Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the current screen and update the date in frame reference do not forget to call this basic OnModify function to update info in derived OnModify functions. More...
 
MODULECreateNewModule (const wxString &aModuleName)
 Function CreateNewModule Creates a new module or footprint, at position 0,0 The new module contains only 2 texts: a reference and a value: Reference = REF** Value = "VAL**" or Footprint name in lib Note: they are dummy texts, which will be replaced by the actual texts when the fooprint is placed on a board and a netlist is read. More...
 
void Edit_Module (MODULE *module, wxDC *DC)
 
void Rotate_Module (wxDC *DC, MODULE *module, double angle, bool incremental)
 
void PlaceModule (MODULE *aModule, wxDC *aDC, bool aRecreateRatsnest=true)
 Function PlaceModule places aModule at the current cursor position and updates module coordinates with the new position. More...
 
void RotateTextModule (TEXTE_MODULE *Text, wxDC *DC)
 
void DeleteTextModule (TEXTE_MODULE *Text)
 
void PlaceTexteModule (TEXTE_MODULE *Text, wxDC *DC)
 
void StartMoveTexteModule (TEXTE_MODULE *Text, wxDC *DC)
 
void ResetTextSize (BOARD_ITEM *aItem, wxDC *aDC)
 Function ResetTextSize resets given field text size and width to current settings in Preferences->Dimensions->Texts and Drawings. More...
 
void InstallPadOptionsFrame (D_PAD *pad)
 
void AddPad (MODULE *Module, bool draw)
 
void DeletePad (D_PAD *aPad, bool aQuery=true)
 Function DeletePad Delete the pad aPad. More...
 
void StartMovePad (D_PAD *aPad, wxDC *aDC, bool aDragConnectedTracks)
 Function StartMovePad Initialize a drag or move pad command. More...
 
void PlacePad (D_PAD *Pad, wxDC *DC)
 
void Export_Pad_Settings (D_PAD *aPad)
 
void Import_Pad_Settings (D_PAD *aPad, bool aDraw)
 
void DoPushPadProperties (D_PAD *aPad, bool aSameFootprints, bool aPadShapeFilter, bool aPadOrientFilter, bool aPadLayerFilter, bool aSaveForUndo)
 Function DoPushPadProperties Function to change pad settings for the given footprint or all identical footprints. More...
 
MODULESelectFootprintFromLibTree (LIB_ID aPreselect=LIB_ID(), bool aAllowBroswer=true)
 Function SelectFootprintFromLibTree opens a dialog to select a footprint. More...
 
virtual void AddModuleToBoard (MODULE *module)
 Adds the given module to the board. More...
 
wxString SelectFootprintFromLibBrowser ()
 Function SelectFootprintFromLibBrowser launches the footprint viewer to select the name of a footprint to load. More...
 
void Compile_Ratsnest (wxDC *aDC, bool aDisplayStatus)
 Function Compile_Ratsnest Create the entire board ratsnest. More...
 
void build_ratsnest_module (MODULE *aModule, wxPoint aMoveVector)
 Function build_ratsnest_module Build a ratsnest relative to one footprint. More...
 
void TraceModuleRatsNest (wxDC *aDC)
 Function TraceModuleRatsNest display the rats nest of a moving footprint, computed by build_ratsnest_module() More...
 
void DrawGeneralRatsnest (wxDC *aDC, int aNetcode=0)
 function Displays the general ratsnest Only ratsnest with the status bit CH_VISIBLE is set are displayed More...
 
void TraceAirWiresToTargets (wxDC *aDC)
 Function TraceAirWiresToTargets This functions shows airwires to nearest connecting points (pads) from the current new track end during track creation Uses data prepared by BuildAirWiresTargetsList() More...
 
void BuildAirWiresTargetsList (BOARD_CONNECTED_ITEM *aItemRef, const wxPoint &aPosition, int aNet)
 Function BuildAirWiresTargetsList Build a list of candidates that can be a coonection point when a track is started. More...
 
void TestNetConnection (wxDC *aDC, int aNetCode)
 Function TestNetConnection tests the connections relative to aNetCode. More...
 
PCB_LAYER_ID SelectLayer (PCB_LAYER_ID aDefaultLayer, LSET aNotAllowedLayersMask=LSET(), wxPoint aDlgPosition=wxDefaultPosition)
 Install the dialog box for layer selection. More...
 
void SelectCopperLayerPair ()
 
virtual void SwitchLayer (wxDC *DC, PCB_LAYER_ID layer)
 
virtual void SetActiveLayer (PCB_LAYER_ID aLayer)
 Function SetActiveLayer will change the currently active layer to aLayer. More...
 
virtual PCB_LAYER_ID GetActiveLayer () const
 Function GetActiveLayer returns the active layer. More...
 
void CommonSettingsChanged () override
 Notification event that some of the common (suite-wide) settings have changed. More...
 
void OnTogglePolarCoords (wxCommandEvent &aEvent)
 
void OnTogglePadDrawMode (wxCommandEvent &aEvent)
 
void OnToggleGraphicDrawMode (wxCommandEvent &aEvent)
 
void OnToggleEdgeDrawMode (wxCommandEvent &aEvent)
 
void OnToggleTextDrawMode (wxCommandEvent &aEvent)
 
virtual void OnSwitchCanvas (wxCommandEvent &aEvent)
 
void OnUpdateCoordType (wxUpdateUIEvent &aEvent)
 
void OnUpdateSelectZoom (wxUpdateUIEvent &aEvent)
 
virtual void OnUpdateLayerAlpha (wxUpdateUIEvent &aEvent)
 
void SetFastGrid1 ()
 Function SetFastGrid1() More...
 
void SetFastGrid2 ()
 Function SetFastGrid2() More...
 
virtual void UseGalCanvas (bool aEnable) override
 

More...
 
void OnUpdateSwitchCanvas (wxUpdateUIEvent &aEvent)
 Update UI called when switches currently used canvas (default / Cairo / OpenGL). More...
 
PCB_GENERAL_SETTINGSSettings ()
 
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
 
bool GetShowBorderAndTitleBlock () const
 
void SetShowBorderAndTitleBlock (bool aShow)
 
bool ShowPageLimits () const
 
void SetShowPageLimits (bool aShow)
 
virtual EDA_DRAW_PANELGetCanvas () const
 
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 bool OnHotKey (wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL)
 
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 SetNoToolSelected ()
 Select the ID_NO_TOOL_SELECTED id tool (Idle tool) More...
 
int GetToolId () const
 
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 OnGridSettings (wxCommandEvent &event)
 
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...
 
virtual void RedrawScreen (const wxPoint &aCenterPoint, bool aWarpPointer)
 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)
 Put the crosshair back to the screen position it had before zooming. More...
 
virtual void HardRedraw ()
 Rebuild the GAL and redraws the screen. More...
 
virtual void Zoom_Automatique (bool aWarpPointer)
 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 &Rect)
 
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 ToolOnRightClick (wxCommandEvent &event)
 
void AdjustScrollBars (const wxPoint &aCenterPosition)
 
virtual void OnPageSettingsChange ()
 Called when modifying the page settings. More...
 
virtual void OnActivate (wxActivateEvent &event)
 Called when activating the frame. More...
 
void DisplayUnitsMsg ()
 Display current unit pane on the status bar. More...
 
virtual void InitBlockPasteInfos ()
 
virtual bool HandleBlockBegin (wxDC *aDC, EDA_KEY aKey, const wxPoint &aPosition, int aExplicitCommand=0)
 Initialize a block command. More...
 
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...
 
virtual void ClearMsgPanel ()
 Clear all messages from 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)
 
void PushPreferences (const EDA_DRAW_PANEL *aParentCanvas)
 Push preferences from a parent window to a child window. More...
 
virtual void PrintPage (wxDC *aDC, LSET aPrintMask, bool aPrintMirrorMode, void *aData=NULL)
 Print the page pointed by current screen, set by the calling print function. More...
 
EDA_DRAW_PANEL_GAL::GAL_TYPE LoadCanvasTypeSetting ()
 Returns the canvas type stored in the application settings. 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...
 
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...
 
virtual void KiwayMailIn (KIWAY_EXPRESS &aEvent)
 Function KiwayMailIn receives KIWAY_EXPRESS messages from other players. 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)
 
virtual void InstallPreferences (PAGED_DIALOG *aParent)
 Allow a frame to load its preference panels (if any) into the preferences dialog. More...
 
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...
 

Public Attributes

PCB_DISPLAY_OPTIONS m_DisplayOptions
 
wxPoint m_UserGridSize
 
int m_FastGrid1
 
int m_FastGrid2
 

Static Public Attributes

static const wxChar AUTO_ZOOM_KEY [] = wxT( "AutoZoom" )
 

Key in KifaceSettings to store the canvas type.

More...
 
static const wxChar ZOOM_KEY [] = wxT( "Zoom" )
 

Protected Member Functions

void updateZoomSelectBox ()
 
virtual void unitsChangeRefresh () override
 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...
 
MODULEloadFootprint (const LIB_ID &aFootprintId)
 Function loadFootprint attempts to load aFootprintId from the footprint library table. More...
 
virtual void SetScreen (BASE_SCREEN *aScreen)
 
double bestZoom (double sizeX, double sizeY, double scaleFactor, wxPoint centre)
 
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

BOARDm_Pcb
 
GENERAL_COLLECTORm_Collector
 
PCB_GENERAL_SETTINGS m_configSettings
 
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 Attributes

bool m_autoZoom
 
double m_lastZoom
 

Detailed Description

Class DISPLAY_FOOTPRINTS_FRAME is used to display footprints.

Definition at line 43 of file display_footprints_frame.h.

Constructor & Destructor Documentation

◆ DISPLAY_FOOTPRINTS_FRAME()

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

Definition at line 87 of file display_footprints_frame.cpp.

87  :
88  PCB_BASE_FRAME( aKiway, aParent, FRAME_CVPCB_DISPLAY, _( "Footprint Viewer" ),
89  wxDefaultPosition, wxDefaultSize,
91 {
92  m_showAxis = true; // true to draw axis.
93 
94  // Give an icon
95  wxIcon icon;
96  icon.CopyFromBitmap( KiBitmap( icon_cvpcb_xpm ) );
97  SetIcon( icon );
98 
99  SetBoard( new BOARD() );
100  SetScreen( new PCB_SCREEN( GetPageSizeIU() ) );
101 
102  // Don't show the default board solder mask clearance. Only the
103  // footprint or pad clearance setting should be shown if it is not 0.
105 
106  LoadSettings( config() );
107 
108  // Initialize grid id to a default value if not found in config or incorrect:
109  if( !( GetScreen()->GridExists( m_LastGridSizeId + ID_POPUP_GRID_LEVEL_1000 ) ) )
111 
113 
114  // Initialize some display options
115  auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
116  displ_opts->m_DisplayPadIsol = false; // Pad clearance has no meaning here
117 
118  // Track and via clearance has no meaning here.
119  displ_opts->m_ShowTrackClearanceMode = PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE;
120 
121  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
122 
123  // Create GAL canvas
124 #ifdef __WXMAC__
125  // Cairo renderer doesn't handle Retina displays
127 #else
129 #endif
130  auto* gal_drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
131  GetGalDisplayOptions(), backend );
132  SetGalCanvas( gal_drawPanel );
133 
134  // Create the manager and dispatcher & route draw panel events to the dispatcher
136  m_toolManager->SetEnvironment( GetBoard(), gal_drawPanel->GetView(),
137  gal_drawPanel->GetViewControls(), this );
138  m_actions = new CVPCB_ACTIONS();
140  gal_drawPanel->SetEventDispatcher( m_toolDispatcher );
141 
147 
148  // Run the control tool, it is supposed to be always active
149  m_toolManager->InvokeTool( "cvpcb.InteractiveSelection" );
150 
154 
155  m_auimgr.SetManagedWindow( this );
156  m_auimgr.SetArtProvider( new EDA_DOCKART( this ) );
157 
158  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
159  m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
160 
161  m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
162 
163  m_auimgr.AddPane( m_canvas, EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
164  m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrameGal" ).Center().Hide() );
165 
166  m_auimgr.Update();
167 
168  auto& galOpts = GetGalDisplayOptions();
169  galOpts.m_axesEnabled = true;
170  UseGalCanvas( true );
171 
172  // Restore last zoom. (If auto-zooming we'll adjust when we load the footprint.)
174 
175  updateView();
176 
177  Show( true );
178 }
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:130
int m_SolderMaskMargin
Solder mask margin.
virtual void SetBoard(BOARD *aBoard)
Function SetBoard sets the m_Pcb member in such as way as to ensure deleting any previous BOARD.
Class CVPCB_SELECTION_TOOL.
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
Definition: draw_frame.h:949
bool m_showAxis
True shows the X and Y axis indicators.
Definition: draw_frame.h:138
TOOL_DISPATCHER * m_toolDispatcher
Definition: draw_frame.h:131
ACTION_TOOLBAR * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:166
virtual void SetScreen(BASE_SCREEN *aScreen)
Definition: draw_frame.h:184
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, EDA_DRAW_FRAME *aFrame)
Sets the work environment (model, view, view controls and the parent window).
virtual wxConfigBase * config()
Return the wxConfigBase used in SaveSettings().
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:534
void SetGalCanvas(EDA_DRAW_PANEL_GAL *aPanel)
Definition: draw_frame.h:932
wxAuiManager m_auimgr
#define FOOTPRINTVIEWER_FRAME_NAME
ACTION_TOOLBAR * m_mainToolBar
Definition: draw_frame.h:156
PCB_BASE_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName)
void SetScale(double aScale)
Function SetScale() Sets the scaling factor.
Definition: view.h:250
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls a tool by sending a tool activation event to tool of given ID.
void updateView()
update the gal canvas (view, colors ...)
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
virtual void UseGalCanvas(bool aEnable) override
Class TOOL_MANAGER.
Definition: tool_manager.h:49
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:169
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
#define KICAD_DEFAULT_DRAWFRAME_STYLE
Class CVPCB_ACTIONS.
Definition: cvpcb_actions.h:42
int m_LastGridSizeId
Definition: draw_frame.h:112
Specialization of the wxAuiPaneInfo class for KiCad panels.
Class COMMON_TOOLS.
Definition: common_tools.h:38
Class TOOL_DISPATCHER.
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
const wxSize GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
void InitTools()
Function InitTools() Initializes all registered tools.
BOARD * GetBoard() const
int SetGrid(const wxRealPoint &size)
set the current grid size m_Grid.
ACTIONS * m_actions
Definition: draw_frame.h:132
Class CVPCB_CONTROL.
Definition: cvpcb_control.h:42
void RegisterTool(TOOL_BASE *aTool)
Function RegisterTool() Adds a tool to the manager set and sets it up.

References PCAD2KICAD::Center, PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL, GetBoard(), BOARD::GetDesignSettings(), ID_POPUP_GRID_LEVEL_1000, ID_POPUP_GRID_LEVEL_500, KiBitmap(), PCAD2KICAD::Left, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, and TOOL_MANAGER::SetEnvironment().

◆ ~DISPLAY_FOOTPRINTS_FRAME()

DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME ( )
override

Definition at line 181 of file display_footprints_frame.cpp.

182 {
184  GetGalCanvas()->GetView()->Clear();
185  // Be sure any event cannot be fired after frame deletion:
186  GetGalCanvas()->SetEvtHandlerEnabled( false );
187 
188  // Be sure a active tool (if exists) is desactivated:
189  if( m_toolManager )
191 
192  delete GetScreen();
193  SetScreen( NULL ); // Be sure there is no double deletion
194 }
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:130
virtual void SetScreen(BASE_SCREEN *aScreen)
Definition: draw_frame.h:184
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
void DeactivateTool()
Function DeactivateTool() Deactivates the currently active tool.
void Clear()
Function Clear() Removes all items from the view.
Definition: view.cpp:1110
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void StopDrawing()
Function StopDrawing() Prevents the GAL canvas from further drawing till it is recreated or StartDraw...

References KIGFX::VIEW::Clear(), TOOL_MANAGER::DeactivateTool(), EDA_DRAW_FRAME::GetGalCanvas(), PCB_BASE_FRAME::GetScreen(), EDA_DRAW_PANEL_GAL::GetView(), EDA_DRAW_FRAME::m_toolManager, EDA_DRAW_FRAME::SetScreen(), and EDA_DRAW_PANEL_GAL::StopDrawing().

Member Function Documentation

◆ 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().

◆ AddModuleToBoard()

void PCB_BASE_FRAME::AddModuleToBoard ( MODULE module)
virtualinherited

Adds the given module to the board.

Parameters
module
aDC(can be NULL ) = the current Device Context, to draw the new footprint

Reimplemented in FOOTPRINT_EDIT_FRAME.

Definition at line 222 of file pcb_base_frame.cpp.

223 {
224  if( module )
225  {
226  GetBoard()->Add( module, ADD_APPEND );
227 
228  module->SetFlags( IS_NEW );
229 
230  if( IsGalCanvasActive() )
231  module->SetPosition( wxPoint( 0, 0 ) ); // cursor in GAL may not be initialized at the moment
232  else
233  module->SetPosition( GetCrossHairPosition() );
234 
235  module->SetTimeStamp( GetNewTimeStamp() );
236  GetBoard()->m_Status_Pcb = 0;
237 
238  // Put it on FRONT layer,
239  // (Can be stored flipped if the lib is an archive built from a board)
240  if( module->IsFlipped() )
241  module->Flip( module->GetPosition() );
242 
243  // Place it in orientation 0,
244  // even if it is not saved with orientation 0 in lib
245  // (Can happen if the lib is an archive built from a board)
246  module->SetOrientation( 0 );
247  }
248 }
bool IsFlipped() const
function IsFlipped
Definition: class_module.h:258
void Flip(const wxPoint &aCentre) override
Function Flip Flip this object, i.e.
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use.
Definition: draw_frame.h:924
timestamp_t GetNewTimeStamp()
Definition: common.cpp:217
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_INSERT) override
Adds an item to the container.
void SetPosition(const wxPoint &aPos) override
void SetOrientation(double newangle)
BOARD * GetBoard() const
const wxPoint GetPosition() const override
Definition: class_module.h:183
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Return the current cross hair position in logical (drawing) coordinates.
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:209
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240

References BOARD::Add(), ADD_APPEND, MODULE::Flip(), PCB_BASE_FRAME::GetBoard(), EDA_DRAW_FRAME::GetCrossHairPosition(), GetNewTimeStamp(), MODULE::GetPosition(), IS_NEW, MODULE::IsFlipped(), EDA_DRAW_FRAME::IsGalCanvasActive(), BOARD::m_Status_Pcb, EDA_ITEM::SetFlags(), MODULE::SetOrientation(), MODULE::SetPosition(), and EDA_ITEM::SetTimeStamp().

Referenced by FOOTPRINT_EDIT_FRAME::AddModuleToBoard(), MWAVE::CreateMicrowaveInductor(), PCB_EDIT_FRAME::CreateMuWaveBaseFootprint(), and PCB_EDIT_FRAME::OnLeftClick().

◆ AddPad()

void PCB_BASE_FRAME::AddPad ( MODULE Module,
bool  draw 
)
inherited

Definition at line 111 of file pad_edit_functions.cpp.

112 {
113  m_Pcb->m_Status_Pcb = 0;
114  aModule->SetLastEditTime();
115 
116  D_PAD* pad = new D_PAD( aModule );
117 
118  // Add the new pad to end of the module pad list.
119  aModule->PadsList().PushBack( pad );
120 
121  // Update the pad properties,
122  // and keep NETINFO_LIST::ORPHANED as net info
123  // which is the default when nets cannot be handled.
124  Import_Pad_Settings( pad, false );
125 
127 
128  // Set the relative pad position
129  // ( pad position for module orient, 0, and relative to the module position)
130 
131  wxPoint pos0 = pad->GetPosition() - aModule->GetPosition();
132  RotatePoint( &pos0, -aModule->GetOrientation() );
133  pad->SetPos0( pos0 );
134 
135  /* NPTH pads take empty pad number (since they can't be connected),
136  * other pads get incremented from the last one edited */
137  wxString padName;
138 
141 
142  pad->SetName( padName );
144 
145  aModule->CalculateBoundingBox();
146  SetMsgPanel( pad );
147 
148  if( draw )
149  m_canvas->RefreshDrawingRect( aModule->GetBoundingBox() );
150 }
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame.
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:66
void SetPosition(const wxPoint &aPos) override
Definition: class_pad.h:221
virtual void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:417
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void SetName(const wxString &aName)
Set the pad name (sometimes called pad number, although it can be an array reference like AA12).
Definition: class_pad.h:184
void SetPos0(const wxPoint &aPos)
Definition: class_pad.h:264
const wxString & GetName() const
Definition: class_pad.h:192
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
D_PAD m_Pad_Master
A dummy pad to store all default parameters.
const wxPoint GetPosition() const override
Definition: class_pad.h:222
static wxString GetNextPadName(wxString aPadName)
void Import_Pad_Settings(D_PAD *aPad, bool aDraw)
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Return the current cross hair position in logical (drawing) coordinates.
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240

References MODULE::CalculateBoundingBox(), D_PAD::GetAttribute(), MODULE::GetBoundingBox(), EDA_DRAW_FRAME::GetCrossHairPosition(), PCB_BASE_FRAME::GetDesignSettings(), D_PAD::GetName(), GetNextPadName(), MODULE::GetOrientation(), MODULE::GetPosition(), D_PAD::GetPosition(), PCB_BASE_FRAME::Import_Pad_Settings(), EDA_DRAW_FRAME::m_canvas, BOARD_DESIGN_SETTINGS::m_Pad_Master, PCB_BASE_FRAME::m_Pcb, BOARD::m_Status_Pcb, PAD_ATTRIB_HOLE_NOT_PLATED, MODULE::PadsList(), DLIST< T >::PushBack(), EDA_DRAW_PANEL::RefreshDrawingRect(), RotatePoint(), MODULE::SetLastEditTime(), EDA_DRAW_FRAME::SetMsgPanel(), D_PAD::SetName(), D_PAD::SetPos0(), and D_PAD::SetPosition().

Referenced by FOOTPRINT_EDIT_FRAME::OnLeftClick().

◆ 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(), LIB_EDIT_FRAME::DisplayCmpDoc(), GERBER_FILE_IMAGE::DisplayImageInfo(), SCH_EDIT_FRAME::EditSheet(), SCH_EDIT_FRAME::importFile(), SCH_PRINTOUT::OnPrintPage(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::SaveEEFile(), LIB_EDIT_FRAME::saveLibrary(), PCB_EDIT_FRAME::SavePcbFile(), ShowNewTrackWhenMovingCursor(), and LIB_VIEW_FRAME::updatePreviewSymbol().

◆ ApplyDisplaySettingsToGAL()

void DISPLAY_FOOTPRINTS_FRAME::ApplyDisplaySettingsToGAL ( )

Updates the GAL with display settings changes.

Definition at line 323 of file display_footprints_frame.cpp.

324 {
325  auto painter = static_cast<KIGFX::PCB_PAINTER*>( GetGalCanvas()->GetView()->GetPainter() );
326  KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
327  settings->LoadDisplayOptions( &m_DisplayOptions, false );
328 
330  GetGalCanvas()->Refresh();
331 }
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1443
Item needs to be redrawn.
Definition: view_item.h:61
Class PCB_RENDER_SETTINGS Stores PCB specific render settings.
Definition: pcb_painter.h:61
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...
PCB_DISPLAY_OPTIONS m_DisplayOptions
void LoadDisplayOptions(const PCB_DISPLAY_OPTIONS *aOptions, bool aShowPageLimits)
Function LoadDisplayOptions Loads settings related to display options (high-contrast mode,...
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.

References KIGFX::ALL, EDA_DRAW_FRAME::GetGalCanvas(), EDA_DRAW_PANEL_GAL::GetView(), KIGFX::PCB_RENDER_SETTINGS::LoadDisplayOptions(), PCB_BASE_FRAME::m_DisplayOptions, EDA_DRAW_PANEL_GAL::Refresh(), and KIGFX::VIEW::UpdateAllItems().

Referenced by DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings().

◆ bestZoom()

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

◆ BestZoom()

double PCB_BASE_FRAME::BestZoom ( )
overridevirtualinherited

Function BestZoom.

Returns
the "best" zoom to show the entire board or footprint on the screen.

Implements EDA_DRAW_FRAME.

Reimplemented in FOOTPRINT_EDIT_FRAME.

Definition at line 396 of file pcb_base_frame.cpp.

397 {
398  EDA_RECT ibbbox = GetBoardBoundingBox();
399 
400  double sizeX = (double) ibbbox.GetWidth();
401  double sizeY = (double) ibbbox.GetHeight();
402  wxPoint centre = ibbbox.Centre();
403 
404  // Reserve a 10% margin around board bounding box.
405  double margin_scale_factor = 1.1;
406 
407  return bestZoom( sizeX, sizeY, margin_scale_factor, centre );
408 }
double bestZoom(double sizeX, double sizeY, double scaleFactor, wxPoint centre)
int GetWidth() const
Definition: eda_rect.h:117
EDA_RECT GetBoardBoundingBox(bool aBoardEdgesOnly=false) const
Function GetBoardBoundingBox calculates the bounding box containing all board items (or board edge se...
int GetHeight() const
Definition: eda_rect.h:118
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
wxPoint Centre() const
Definition: eda_rect.h:60

References EDA_DRAW_FRAME::bestZoom(), EDA_RECT::Centre(), PCB_BASE_FRAME::GetBoardBoundingBox(), EDA_RECT::GetHeight(), and EDA_RECT::GetWidth().

◆ 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().

◆ build_ratsnest_module()

void PCB_BASE_FRAME::build_ratsnest_module ( MODULE aModule,
wxPoint  aMoveVector 
)
inherited

Function build_ratsnest_module Build a ratsnest relative to one footprint.

This is a simplified computation used only in move footprint. It is not optimal, but it is fast and sufficient to help a footprint placement It shows the connections from a pad to the nearest connected pad

Parameters
aMoveVector= move vector of the footprint being moved.
aModule= module to consider.

Definition at line 206 of file ratsnest.cpp.

207 {
208  auto connectivity = GetBoard()->GetConnectivity();
209 
210  movedModule = *aModule;
211  movedModule.Move( -aMoveVector );
212  connectivity->ClearDynamicRatsnest();
213  connectivity->BlockRatsnestItems( { aModule } );
214  connectivity->ComputeDynamicRatsnest( { &movedModule } );
215 }
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:292
void Move(const wxPoint &aMoveVector) override
Function Move move this object.
BOARD * GetBoard() const
static MODULE movedModule(nullptr)

References PCB_BASE_FRAME::GetBoard(), BOARD::GetConnectivity(), MODULE::Move(), and movedModule.

Referenced by MODULE::DrawOutlinesWhenMoving().

◆ BuildAirWiresTargetsList()

void PCB_BASE_FRAME::BuildAirWiresTargetsList ( BOARD_CONNECTED_ITEM aItemRef,
const wxPoint &  aPosition,
int  aNet 
)
inherited

Function BuildAirWiresTargetsList Build a list of candidates that can be a coonection point when a track is started.

This functions prepares data to show airwires to nearest connecting points (pads) from the current new track to candidates during track creation

Parameters
aItemRef= the item connected to the starting point of the new track (track or pad)
aPosition= the position of the new track end (usually the mouse cursor on grid)
aNet= the netcode of the track

Definition at line 195 of file ratsnest.cpp.

197 {
198  s_CursorPos = aPosition; // needed for sort_by_distance
199  s_ref = aItemRef;
200  s_refNet = aNet;
201 }
static wxPoint s_CursorPos
Definition: ratsnest.cpp:182
static int s_refNet
Definition: ratsnest.cpp:193
static BOARD_CONNECTED_ITEM * s_ref
Definition: ratsnest.cpp:192

References s_CursorPos, s_ref, and s_refNet.

Referenced by PCB_EDIT_FRAME::Begin_Route(), and ShowNewTrackWhenMovingCursor().

◆ 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()

◆ CommonSettingsChanged()

void PCB_BASE_FRAME::CommonSettingsChanged ( )
overridevirtualinherited

Notification event that some of the common (suite-wide) settings have changed.

Update menus, toolbars, local variables, etc.

Reimplemented from EDA_DRAW_FRAME.

Definition at line 934 of file pcb_base_frame.cpp.

935 {
937 
942 
943  EDA_3D_VIEWER* viewer = Get3DViewerFrame();
944 
945  if( viewer )
946  {
947  // The 3D viewer isn't in the Kiway, so send its update manually
948  viewer->CommonSettingsChanged();
949  }
950 }
virtual void ReCreateVToolbar()=0
void CommonSettingsChanged() override
Notification event that some of the common (suite-wide) settings have changed.
virtual void ReCreateOptToolbar()
virtual void ReCreateAuxiliaryToolbar()
virtual void ReCreateHToolbar()=0
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
Definition: eda_3d_viewer.h:49
void CommonSettingsChanged() override
Notification that common settings are updated.
EDA_3D_VIEWER * Get3DViewerFrame()

References EDA_3D_VIEWER::CommonSettingsChanged(), EDA_DRAW_FRAME::CommonSettingsChanged(), PCB_BASE_FRAME::Get3DViewerFrame(), EDA_DRAW_FRAME::ReCreateAuxiliaryToolbar(), EDA_DRAW_FRAME::ReCreateHToolbar(), PCB_BASE_FRAME::ReCreateOptToolbar(), and EDA_DRAW_FRAME::ReCreateVToolbar().

Referenced by FOOTPRINT_EDIT_FRAME::CommonSettingsChanged(), and PCB_EDIT_FRAME::CommonSettingsChanged().

◆ Compile_Ratsnest()

void PCB_BASE_FRAME::Compile_Ratsnest ( wxDC *  aDC,
bool  aDisplayStatus 
)
inherited

Function Compile_Ratsnest Create the entire board ratsnest.

Must be called after a board change (changes for pads, footprints or a read netlist ).

Parameters
aDC= the current device context (can be NULL)
aDisplayStatus: if true, display the computation results

Definition at line 53 of file ratsnest.cpp.

54 {
55  GetBoard()->GetConnectivity()->RecalculateRatsnest();
56 
57  GetBoard()->m_Status_Pcb = 0; // we want a full ratsnest computation, from the scratch
58 
59  if( GetBoard()->IsElementVisible( LAYER_RATSNEST ) && aDC )
60  DrawGeneralRatsnest( aDC, 0 );
61 
62  wxString msg;
63 
64  ClearMsgPanel();
65 
66  if( aDisplayStatus )
67  {
68  std::shared_ptr<CONNECTIVITY_DATA> conn = m_Pcb->GetConnectivity();
69 
70  msg.Printf( wxT( " %d" ), conn->GetPadCount() );
71  AppendMsgPanel( _( "Pads" ), msg, RED );
72 
73  msg.Printf( wxT( " %d" ), conn->GetNetCount() - 1 /* Don't include "No Net" in count */ );
74  AppendMsgPanel( _( "Nets" ), msg, CYAN );
75 
76  SetMsgPanel( m_Pcb );
77  }
78 }
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void DrawGeneralRatsnest(wxDC *aDC, int aNetcode=0)
function Displays the general ratsnest Only ratsnest with the status bit CH_VISIBLE is set are displa...
Definition: ratsnest.cpp:88
Definition: colors.h:59
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:292
Definition: colors.h:60
virtual void ClearMsgPanel()
Clear all messages from the message panel.
void AppendMsgPanel(const wxString &textUpper, const wxString &textLower, COLOR4D color, int pad=6)
Append a message to the message panel.
BOARD * GetBoard() const
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240

References EDA_DRAW_FRAME::AppendMsgPanel(), EDA_DRAW_FRAME::ClearMsgPanel(), CYAN, PCB_BASE_FRAME::DrawGeneralRatsnest(), PCB_BASE_FRAME::GetBoard(), BOARD::GetConnectivity(), LAYER_RATSNEST, PCB_BASE_FRAME::m_Pcb, BOARD::m_Status_Pcb, RED, and EDA_DRAW_FRAME::SetMsgPanel().

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Duplicate(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Block_Rotate(), PCB_EDIT_FRAME::Change_Side_Module(), PCB_EDIT_FRAME::Delete_Module(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), PCB_EDIT_FRAME::ExportToGenCAD(), DIALOG_EXCHANGE_FOOTPRINTS::OnApplyClicked(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), PCB_EDIT_FRAME::OnSelectTool(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceModule(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::RemoveMisConnectedTracks(), PCB_BASE_FRAME::Rotate_Module(), PCB_BASE_FRAME::TestNetConnection(), and PANEL_SETUP_LAYERS::TransferDataFromWindow().

◆ 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(), LIB_EDIT_FRAME::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 LoadSettings(), FOOTPRINT_VIEWER_FRAME::LoadSettings(), EDA_BASE_FRAME::LoadSettings(), EDA_DRAW_FRAME::LoadSettings(), 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().

◆ CreateAndShow3D_Frame()

bool PCB_BASE_FRAME::CreateAndShow3D_Frame ( bool  aForceRecreateIfNotOwner)
virtualinherited

Shows the 3D view frame.

If it does not exist, it is created. If it exists, it is bring to the foreground

Parameters
aForceRecreateIfNotOwner= true to recreate the 3D frame viewer, when the owner is not me
Returns
true if it is shown with me as owner

Definition at line 439 of file pcb_base_frame.cpp.

440 {
441  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
442 
443  // Ensure the viewer was created by me, and not by another editor:
444  PCB_BASE_FRAME* owner = draw3DFrame ? draw3DFrame->Parent() : nullptr;
445 
446  // if I am not the owner, do not use the current viewer instance
447  if( draw3DFrame && this != owner )
448  {
449  if( aForceRecreateIfNotOwner )
450  {
451  draw3DFrame->Destroy();
452  draw3DFrame = nullptr;
453  }
454  else
455  return false;
456  }
457 
458  if( !draw3DFrame )
459  {
460  draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, _( "3D Viewer" ) );
461  draw3DFrame->Raise(); // Needed with some Window Managers
462  draw3DFrame->Show( true );
463  return true;
464  }
465 
466  // Raising the window does not show the window on Windows if iconized.
467  // This should work on any platform.
468  if( draw3DFrame->IsIconized() )
469  draw3DFrame->Iconize( false );
470 
471  draw3DFrame->Raise();
472 
473  // Raising the window does not set the focus on Linux. This should work on any platform.
474  if( wxWindow::FindFocus() != draw3DFrame )
475  draw3DFrame->SetFocus();
476 
477  return true;
478 }
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
PCB_BASE_FRAME * Parent() const
Definition: eda_3d_viewer.h:60
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
Definition: eda_3d_viewer.h:49
EDA_3D_VIEWER * Get3DViewerFrame()
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.

References KIWAY_PLAYER::Destroy(), PCB_BASE_FRAME::Get3DViewerFrame(), KIWAY_HOLDER::Kiway(), and EDA_3D_VIEWER::Parent().

Referenced by Show3D_Frame(), and FOOTPRINT_EDIT_FRAME::Show3D_Frame().

◆ CreateNewModule()

MODULE * PCB_BASE_FRAME::CreateNewModule ( const wxString &  aModuleName)
inherited

Function CreateNewModule Creates a new module or footprint, at position 0,0 The new module contains only 2 texts: a reference and a value: Reference = REF** Value = "VAL**" or Footprint name in lib Note: they are dummy texts, which will be replaced by the actual texts when the fooprint is placed on a board and a netlist is read.

Parameters
aModuleName= name of the new footprint in library
Returns
a reference to the new module

Definition at line 1032 of file footprint_libraries_utils.cpp.

1033 {
1034  // Creates a new footprint at position 0,0 which contains the minimal items:
1035  // the reference and the value.
1036  // Value : initialized to the footprint name.
1037  // put on fab layer (front side)
1038  // Reference : initialized to a default value (REF**).
1039  // put on silkscreen layer (front side)
1040 
1041  wxString moduleName = aModuleName;
1042 
1043  // Ask for the new module name
1044  if( moduleName.IsEmpty() )
1045  {
1046  WX_TEXT_ENTRY_DIALOG dlg( this, FMT_MOD_REF, FMT_MOD_CREATE, moduleName );
1047  dlg.SetTextValidator( FILE_NAME_CHAR_VALIDATOR( &moduleName ) );
1048 
1049  if( dlg.ShowModal() != wxID_OK )
1050  return NULL; //Aborted by user
1051  }
1052 
1053  moduleName.Trim( true );
1054  moduleName.Trim( false );
1055 
1056  if( moduleName.IsEmpty() )
1057  {
1059  return NULL;
1060  }
1061 
1062  // Creates the new module and add it to the head of the linked list of modules
1063  MODULE* module = new MODULE( GetBoard() );
1064 
1065  // Update parameters: timestamp ...
1066  module->SetLastEditTime();
1067 
1068  // Update its name in lib
1069  module->SetFPID( LIB_ID( wxEmptyString, moduleName ) );
1070 
1071  wxPoint default_pos;
1073 
1074  // Update reference:
1075  if( settings.m_RefDefaultText.IsEmpty() )
1076  module->SetReference( moduleName );
1077  else
1078  module->SetReference( settings.m_RefDefaultText );
1079 
1080  PCB_LAYER_ID layer = ToLAYER_ID( settings.m_RefDefaultlayer );
1081  module->Reference().SetThickness( settings.GetTextThickness( layer ) );
1082  module->Reference().SetTextSize( settings.GetTextSize( layer ) );
1083  module->Reference().SetItalic( settings.GetTextItalic( layer ) );
1084  module->Reference().SetKeepUpright( settings.GetTextUpright( layer ) );
1085  default_pos.y = GetDesignSettings().GetTextSize( layer ).y / 2;
1086  module->Reference().SetPosition( default_pos );
1087  module->Reference().SetLayer( layer );
1088  module->Reference().SetVisible( settings.m_RefDefaultVisibility );
1089 
1090  // Set the value field to a default value
1091  if( settings.m_ValueDefaultText.IsEmpty() )
1092  module->SetValue( moduleName );
1093  else
1094  module->SetValue( settings.m_ValueDefaultText );
1095 
1096  layer = ToLAYER_ID( settings.m_ValueDefaultlayer );
1097  module->Value().SetThickness( settings.GetTextThickness( layer ) );
1098  module->Value().SetTextSize( settings.GetTextSize( layer ) );
1099  module->Value().SetItalic( settings.GetTextItalic( layer ) );
1100  module->Value().SetKeepUpright( settings.GetTextUpright( layer ) );
1101  default_pos.y = -default_pos.y;
1102  module->Value().SetPosition( default_pos );
1103  module->Value().SetLayer( layer );
1104  module->Value().SetVisible( settings.m_ValueDefaultVisibility );
1105 
1106  SetMsgPanel( module );
1107  return module;
1108 }
wxString m_RefDefaultText
Default ref text on fp creation.
bool m_ValueDefaultVisibility
Default value text visibility on fp creation.
void SetKeepUpright(bool aKeepUpright)
TEXTE_MODULE & Reference()
Definition: class_module.h:503
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
void SetItalic(bool isItalic)
Definition: eda_text.h:186
void SetVisible(bool aVisible)
Definition: eda_text.h:192
int m_ValueDefaultlayer
Default value text layer on fp creation.
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:231
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
int GetTextThickness(PCB_LAYER_ID aLayer) const
Function GetTextThickness Returns the default text thickness from the layer class for the given layer...
This class provides a custom wxValidator object for limiting the allowable characters when defining f...
Definition: validators.h:63
bool GetTextUpright(PCB_LAYER_ID aLayer) const
bool GetTextItalic(PCB_LAYER_ID aLayer) const
#define FMT_NO_REF_ABORTED
PCB_LAYER_ID
A quick note on layer IDs:
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:502
void SetLastEditTime(timestamp_t aTime)
Definition: class_module.h:313
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:472
virtual void SetPosition(const wxPoint &aPos) override
wxString m_ValueDefaultText
Default value text on fp creation.
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:496
int m_RefDefaultlayer
Default ref text layer on fp creation.
BOARD * GetBoard() const
#define FMT_MOD_CREATE
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:276
bool m_RefDefaultVisibility
Default ref text visibility on fp creation.
void SetFPID(const LIB_ID &aFPID)
Definition: class_module.h:193
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:813
wxSize GetTextSize(PCB_LAYER_ID aLayer) const
Function GetTextSize Returns the default text size from the layer class for the given layer.
void SetThickness(int aNewThickness)
Function SetThickness sets pen width.
Definition: eda_text.h:165
#define FMT_MOD_REF
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.

References DisplayInfoMessage(), FMT_MOD_CREATE, FMT_MOD_REF, FMT_NO_REF_ABORTED, PCB_BASE_FRAME::GetBoard(), PCB_BASE_FRAME::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetTextItalic(), BOARD_DESIGN_SETTINGS::GetTextSize(), BOARD_DESIGN_SETTINGS::GetTextThickness(), BOARD_DESIGN_SETTINGS::GetTextUpright(), BOARD_DESIGN_SETTINGS::m_RefDefaultlayer, BOARD_DESIGN_SETTINGS::m_RefDefaultText, BOARD_DESIGN_SETTINGS::m_RefDefaultVisibility, BOARD_DESIGN_SETTINGS::m_ValueDefaultlayer, BOARD_DESIGN_SETTINGS::m_ValueDefaultText, BOARD_DESIGN_SETTINGS::m_ValueDefaultVisibility, MODULE::Reference(), MODULE::SetFPID(), EDA_TEXT::SetItalic(), TEXTE_MODULE::SetKeepUpright(), MODULE::SetLastEditTime(), BOARD_ITEM::SetLayer(), EDA_DRAW_FRAME::SetMsgPanel(), TEXTE_MODULE::SetPosition(), MODULE::SetReference(), EDA_TEXT::SetTextSize(), WX_TEXT_ENTRY_DIALOG::SetTextValidator(), EDA_TEXT::SetThickness(), MODULE::SetValue(), EDA_TEXT::SetVisible(), ToLAYER_ID(), and MODULE::Value().

Referenced by MWAVE::CreateMicrowaveInductor(), and PCB_EDIT_FRAME::CreateMuWaveBaseFootprint().

◆ 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().

◆ DeletePad()

void PCB_BASE_FRAME::DeletePad ( D_PAD aPad,
bool  aQuery = true 
)
inherited

Function DeletePad Delete the pad aPad.

Refresh the modified screen area Refresh modified parameters of the parent module (bounding box, last date)

Parameters
aPad= the pad to delete
aQuery= true to prompt for confirmation, false to delete silently

Definition at line 153 of file pad_edit_functions.cpp.

154 {
155  if( aPad == NULL )
156  return;
157 
158  MODULE* module = aPad->GetParent();
159  module->SetLastEditTime();
160 
161  // aQuery = true to prompt for confirmation, false to delete silently
162  if( aQuery )
163  {
164  wxString msg = wxString::Format( _( "Delete pad (footprint %s %s)?" ),
165  module->GetReference(),
166  module->GetValue() );
167 
168  if( !IsOK( this, msg ) )
169  return;
170  }
171 
172  // Stores the initial bounding box to refresh the old area
173  EDA_RECT bbox = module->GetBoundingBox();
174 
175  m_Pcb->m_Status_Pcb = 0;
176 
177  GetBoard()->PadDelete( aPad );
178 
179  // Update the bounding box
180  module->CalculateBoundingBox();
181 
182  // Refresh the modified screen area, using the initial bounding box
183  // which is perhaps larger than the new bounding box
184  m_canvas->RefreshDrawingRect( bbox );
185 
186  OnModify();
187 }
void PadDelete(D_PAD *aPad)
Function PadDelete deletes a given bad from the BOARD by removing it from its module and from the m_N...
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
const wxString GetValue() const
Function GetValue.
Definition: class_module.h:487
virtual void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:462
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
void SetLastEditTime(timestamp_t aTime)
Definition: class_module.h:313
MODULE * GetParent() const
Definition: class_pad.h:164
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
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
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
BOARD * GetBoard() const
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:294
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240

References MODULE::CalculateBoundingBox(), Format(), PCB_BASE_FRAME::GetBoard(), MODULE::GetBoundingBox(), D_PAD::GetParent(), MODULE::GetReference(), MODULE::GetValue(), IsOK(), EDA_DRAW_FRAME::m_canvas, PCB_BASE_FRAME::m_Pcb, BOARD::m_Status_Pcb, PCB_BASE_FRAME::OnModify(), BOARD::PadDelete(), EDA_DRAW_PANEL::RefreshDrawingRect(), and MODULE::SetLastEditTime().

Referenced by PCB_EDIT_FRAME::Process_Special_Functions().

◆ DeleteTextModule()

void PCB_BASE_FRAME::DeleteTextModule ( TEXTE_MODULE Text)
inherited

Definition at line 126 of file edtxtmod.cpp.

127 {
128  MODULE* module;
129 
130  if( aText == NULL )
131  return;
132 
133  module = static_cast<MODULE*>( aText->GetParent() );
134 
135  if( aText->GetType() == TEXTE_MODULE::TEXT_is_DIVERS )
136  {
137  if( module && module->GetEditFlags() == 0 && aText->GetEditFlags() == 0 )
138  {
139  if( IsType( FRAME_PCB ) )
140  SaveCopyInUndoList( module, UR_CHANGED );
141  }
142 
143  m_canvas->RefreshDrawingRect( aText->GetBoundingBox() );
144  aText->DeleteStructure();
145  OnModify();
146 
147  if( module )
148  module->SetLastEditTime();
149  }
150 }
virtual void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
STATUS_FLAGS GetEditFlags() const
Definition: base_struct.h:263
void SetLastEditTime(timestamp_t aTime)
Definition: class_module.h:313
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
bool IsType(FRAME_T aType) const
virtual void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0))=0
Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands.

References BOARD_ITEM::DeleteStructure(), FRAME_PCB, TEXTE_MODULE::GetBoundingBox(), EDA_ITEM::GetEditFlags(), BOARD_ITEM::GetParent(), TEXTE_MODULE::GetType(), EDA_BASE_FRAME::IsType(), EDA_DRAW_FRAME::m_canvas, PCB_BASE_FRAME::OnModify(), EDA_DRAW_PANEL::RefreshDrawingRect(), PCB_BASE_FRAME::SaveCopyInUndoList(), MODULE::SetLastEditTime(), TEXTE_MODULE::TEXT_is_DIVERS, and UR_CHANGED.

Referenced by PCB_EDIT_FRAME::Process_Special_Functions().

◆ 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().

◆ 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().

◆ DoPushPadProperties()

void PCB_BASE_FRAME::DoPushPadProperties ( D_PAD aPad,
bool  aSameFootprints,
bool  aPadShapeFilter,
bool  aPadOrientFilter,
bool  aPadLayerFilter,
bool  aSaveForUndo 
)
inherited

Function DoPushPadProperties Function to change pad settings for the given footprint or all identical footprints.

Parameters
aPadis the pattern. The given footprint is the parent of this pad
aSameFootprintsif true, make changes on all identical footprints
aPadShapeFilterif true, make changes only on pads having the same shape as aPad
aPadOrientFilterif true, make changes only on pads having the same orientation as aPad
aPadLayerFilterif true, make changes only on pads having the same layers as aPad
aSaveForUndoif true: create an entry in the Undo/Redo list (usually: true in Schematic editor, false in Module editor)

Definition at line 265 of file pad_edit_functions.cpp.

270 {
271  MODULE* Module_Ref = aPad->GetParent();
272  double pad_orient = aPad->GetOrientation() - Module_Ref->GetOrientation();
273 
274  // Prepare an undo list:
275  if( aSaveForUndo )
276  {
277  PICKED_ITEMS_LIST itemsList;
278 
279  if( aSameFootprints )
280  {
281  for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
282  {
283  if( module->GetFPID() == Module_Ref->GetFPID() )
284  {
285  ITEM_PICKER itemWrapper( module, UR_CHANGED );
286  itemsList.PushItem( itemWrapper );
287  }
288  }
289  }
290  else
291  {
292  ITEM_PICKER itemWrapper( Module_Ref, UR_CHANGED );
293  itemsList.PushItem( itemWrapper );
294  }
295 
296  SaveCopyInUndoList( itemsList, UR_CHANGED );
297  }
298 
299  // Update the current module and same others modules if requested.
300  for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
301  {
302  if( !aSameFootprints && (module != Module_Ref) )
303  continue;
304 
305  if( module->GetFPID() != Module_Ref->GetFPID() )
306  continue;
307 
308  // Erase module on screen
309  module->SetFlags( DO_NOT_DRAW );
310  m_canvas->RefreshDrawingRect( module->GetBoundingBox() );
311  module->ClearFlags( DO_NOT_DRAW );
312 
313  for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
314  {
315  if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) )
316  continue;
317 
318  double currpad_orient = pad->GetOrientation() - module->GetOrientation();
319 
320  if( aPadOrientFilter && ( currpad_orient != pad_orient ) )
321  continue;
322 
323  if( aPadLayerFilter && ( pad->GetLayerSet() != aPad->GetLayerSet() ) )
324  continue;
325 
326  // Do not copy pad to itself, it can create issues with custom pad primitives.
327  if( pad == aPad )
328  continue;
329 
330  pad->ImportSettingsFromMaster( *aPad );
331  }
332 
333  module->CalculateBoundingBox();
334  m_canvas->RefreshDrawingRect( module->GetBoundingBox() );
335  }
336 
337  OnModify();
338 }
D_PAD * Next() const
Definition: class_pad.h:162
double GetOrientation() const
Definition: class_module.h:188
virtual void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
void PushItem(const ITEM_PICKER &aItem)
Function PushItem pushes aItem to the top of the list.
const LIB_ID & GetFPID() const
Definition: class_module.h:192
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:414
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
MODULE * GetParent() const
Definition: class_pad.h:164
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
DLIST< MODULE > m_Modules
Definition: class_board.h:248
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees,...
Definition: class_pad.h:394
virtual void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0))=0
Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands.
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:218
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:126

References DO_NOT_DRAW, MODULE::GetFPID(), D_PAD::GetLayerSet(), MODULE::GetOrientation(), D_PAD::GetOrientation(), D_PAD::GetParent(), D_PAD::GetShape(), EDA_DRAW_FRAME::m_canvas, BOARD::m_Modules, PCB_BASE_FRAME::m_Pcb, D_PAD::Next(), PCB_BASE_FRAME::OnModify(), PICKED_ITEMS_LIST::PushItem(), EDA_DRAW_PANEL::RefreshDrawingRect(), PCB_BASE_FRAME::SaveCopyInUndoList(), and UR_CHANGED.

Referenced by FOOTPRINT_EDIT_FRAME::PushPadProperties(), and PCB_EDIT_FRAME::PushPadProperties().

◆ DrawGeneralRatsnest()

void PCB_BASE_FRAME::DrawGeneralRatsnest ( wxDC *  aDC,
int  aNetcode = 0 
)
inherited

function Displays the general ratsnest Only ratsnest with the status bit CH_VISIBLE is set are displayed

function DrawGeneralRatsnest Only ratsnest items with the status bit CH_VISIBLE set are displayed

Parameters
aDC= the current device context (can be NULL)
aNetcodeif > 0, Display only the ratsnest relative to the corresponding net_code
aDC= the current device context (can be NULL)
aNetcodeif > 0, Display only the ratsnest relative to the corresponding net_code

Definition at line 88 of file ratsnest.cpp.

89 {
91  {
92  return;
93  }
94 
95  if( aDC == NULL )
96  return;
97 
98  auto connectivity = m_Pcb->GetConnectivity();
99 
100  std::unique_lock<std::mutex> lock( connectivity->GetLock(), std::try_to_lock );
101 
102  if( !lock )
103  return;
104 
106 
107  auto displ_opts = (PCB_DISPLAY_OPTIONS*) GetDisplayOptions();
108 
109  const bool curved_ratsnest = displ_opts->m_DisplayRatsnestLinesCurved;
110 
111  for( int i = 1 /* skip "No Net" at [0] */; i < connectivity->GetNetCount(); ++i )
112  {
113  RN_NET* net = connectivity->GetRatsnestForNet( i );
114 
115  if( !net )
116  continue;
117 
118  if( ( aNetcode <= 0 ) || ( aNetcode == i ) )
119  {
120  for( const auto& edge : net->GetEdges() )
121  {
122  auto s = edge.GetSourcePos();
123  auto d = edge.GetTargetPos();
124  auto sn = edge.GetSourceNode();
125  auto dn = edge.GetTargetNode();
126 
127  if( !sn->Valid() || !dn->Valid() )
128  continue;
129 
130  bool enable = !sn->GetNoLine() && !dn->GetNoLine();
131  bool show = sn->Parent()->GetLocalRatsnestVisible()
132  || dn->Parent()->GetLocalRatsnestVisible();
133 
134  if( enable && show )
135  {
136  if (curved_ratsnest) {
137  auto dx = d.x - s.x;
138  auto dy = d.y - s.y;
139  auto cx = s.x + 0.5 * dx + 1.2 * dy;
140  auto cy = s.y + 0.5 * dy - 1.2 * dx;
141  GRArc1( m_canvas->GetClipBox(), aDC, s.x, s.y, d.x, d.y, cx, cy, 0, color);
142  } else {
143  GRLine( m_canvas->GetClipBox(), aDC, s.x, s.y, d.x, d.y, 0, color );
144  }
145  }
146  }
147  }
148  }
149 }
int color
Definition: DXF_plotter.cpp:62
virtual EDA_RECT * GetClipBox()
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
PCB_GENERAL_SETTINGS & Settings()
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:292
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:285
COLORS_DESIGN_SETTINGS & Colors()
const std::vector< CN_EDGE > & GetEdges() const
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
size_t i
Definition: json11.cpp:597
Class RN_NET Describes ratsnest for a single net.
Definition: ratsnest_data.h:59
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240
void GRArc1(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, COLOR4D Color)
Definition: gr_basic.cpp:799
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References color, PCB_GENERAL_SETTINGS::Colors(), DO_NOT_SHOW_GENERAL_RASTNEST, EDA_DRAW_PANEL::GetClipBox(), BOARD::GetConnectivity(), PCB_BASE_FRAME::GetDisplayOptions(), RN_NET::GetEdges(), COLORS_DESIGN_SETTINGS::GetItemColor(), GRArc1(), GRLine(), i, LAYER_RATSNEST, EDA_DRAW_FRAME::m_canvas, PCB_BASE_FRAME::m_Pcb, BOARD::m_Status_Pcb, and PCB_BASE_FRAME::Settings().

Referenced by Abort_MoveOrCopyModule(), PCB_EDIT_FRAME::Change_Side_Module(), PCB_BASE_FRAME::Compile_Ratsnest(), PCB_EDIT_FRAME::Delete_net(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), PCB_EDIT_FRAME::RedrawActiveWindow(), PCB_EDIT_FRAME::Remove_One_Track(), PCB_BASE_FRAME::Rotate_Module(), and PCB_EDIT_FRAME::StartMoveModule().

◆ 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().

◆ Edit_Module()

void PCB_BASE_FRAME::Edit_Module ( MODULE module,
wxDC *  DC 
)
inherited

◆ 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().

◆ Export_Pad_Settings()

void PCB_BASE_FRAME::Export_Pad_Settings ( D_PAD aPad)
inherited

Definition at line 45 of file pad_edit_functions.cpp.

46 {
47  if( aPad == NULL )
48  return;
49 
50  SetMsgPanel( aPad );
51 
52  D_PAD& masterPad = GetDesignSettings().m_Pad_Master;
53 
54  masterPad.ImportSettingsFromMaster( *aPad );
55 }
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void ImportSettingsFromMaster(const D_PAD &aMasterPad)
Imports the pad settings from aMasterPad.
Definition: class_pad.cpp:1463
D_PAD m_Pad_Master
A dummy pad to store all default parameters.

References PCB_BASE_FRAME::GetDesignSettings(), D_PAD::ImportSettingsFromMaster(), BOARD_DESIGN_SETTINGS::m_Pad_Master, and EDA_DRAW_FRAME::SetMsgPanel().

Referenced by PCB_EDIT_FRAME::Process_Special_Functions().

◆ 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().

◆ 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 DISPLAY_FOOTPRINTS_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 350 of file display_footprints_frame.cpp.

352 {
353  bool eventHandled = true;
354 
355  // Filter out the 'fake' mouse motion after a keyboard movement
356  if( !aHotKey && m_movingCursorWithKeyboard )
357  {
359  return false;
360  }
361 
362  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
363  cmd.SetEventObject( this );
364 
365  wxPoint pos = aPosition;
366  wxPoint oldpos = GetCrossHairPosition();
367  GeneralControlKeyMovement( aHotKey, &pos, true );
368 
369  switch( aHotKey )
370  {
371  case WXK_F1:
372  cmd.SetId( ID_KEY_ZOOM_IN );
373  GetEventHandler()->ProcessEvent( cmd );
374  break;
375 
376  case WXK_F2:
377  cmd.SetId( ID_KEY_ZOOM_OUT );
378  GetEventHandler()->ProcessEvent( cmd );
379  break;
380 
381  case WXK_F3:
382  cmd.SetId( ID_ZOOM_REDRAW );
383  GetEventHandler()->ProcessEvent( cmd );
384  break;
385 
386  case WXK_F4:
387  cmd.SetId( ID_POPUP_ZOOM_CENTER );
388  GetEventHandler()->ProcessEvent( cmd );
389  break;
390 
391  case WXK_HOME:
392  cmd.SetId( ID_ZOOM_PAGE );
393  GetEventHandler()->ProcessEvent( cmd );
394  break;
395 
396  case ' ':
398  break;
399 
400  case GR_KB_ALT + '3':
401  cmd.SetId( ID_CVPCB_SHOW3D_FRAME );
402  GetEventHandler()->ProcessEvent( cmd );
403  break;
404 
405  default:
406  eventHandled = false;
407  }
408 
409  SetCrossHairPosition( pos );
410  RefreshCrossHair( oldpos, aPosition, aDC );
411 
412  UpdateStatusBar(); /* Display new cursor coordinates */
413 
414  return eventHandled;
415 }
#define GR_KB_ALT
wxPoint m_O_Curseur
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:185
bool GeneralControlKeyMovement(int aHotKey, wxPoint *aPos, bool aSnapToGrid)
Handle the common part of GeneralControl dedicated to global cursor keys (i.e.
void RefreshCrossHair(const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC *aDC)
Move and refresh the crosshair after movement and call the mouse capture function.
virtual void UpdateStatusBar() override
Update the status bar information.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
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
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Return the current cross hair position in logical (drawing) coordinates.

References EDA_DRAW_FRAME::GeneralControlKeyMovement(), EDA_DRAW_FRAME::GetCrossHairPosition(), PCB_BASE_FRAME::GetScreen(), GR_KB_ALT, ID_CVPCB_SHOW3D_FRAME, ID_KEY_ZOOM_IN, ID_KEY_ZOOM_OUT, ID_POPUP_ZOOM_CENTER, ID_ZOOM_PAGE, ID_ZOOM_REDRAW, EDA_DRAW_FRAME::m_movingCursorWithKeyboard, BASE_SCREEN::m_O_Curseur, EDA_DRAW_FRAME::RefreshCrossHair(), EDA_DRAW_FRAME::SetCrossHairPosition(), and PCB_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(), GeneralControl(), FOOTPRINT_VIEWER_FRAME::GeneralControl(), FOOTPRINT_WIZARD_FRAME::GeneralControl(), FOOTPRINT_EDIT_FRAME::GeneralControl(), PL_EDITOR_FRAME::GeneralControl(), LIB_EDIT_FRAME::GeneralControl(), GERBVIEW_FRAME::GeneralControl(), and PCB_EDIT_FRAME::GeneralControl().

◆ Get3DViewerFrame()

EDA_3D_VIEWER * PCB_BASE_FRAME::Get3DViewerFrame ( )
inherited
Returns
a reference to the 3D viewer frame, when exists, or NULL

Definition at line 135 of file pcb_base_frame.cpp.

136 {
137  // return the 3D viewer frame, when exists, or NULL
138  return static_cast<EDA_3D_VIEWER*>
139  ( wxWindow::FindWindowByName( VIEWER3D_FRAMENAME ) );
140 }
#define VIEWER3D_FRAMENAME
Definition: eda_3d_viewer.h:44

References VIEWER3D_FRAMENAME.

Referenced by PCB_BASE_FRAME::CommonSettingsChanged(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), PCB_EDIT_FRAME::OpenProjectFiles(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Update3D_Frame(), PCB_BASE_FRAME::Update3DView(), and FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME().

◆ Get_Module()

MODULE * DISPLAY_FOOTPRINTS_FRAME::Get_Module ( const wxString &  CmpName)

Definition at line 454 of file display_footprints_frame.cpp.

455 {
456  MODULE* footprint = NULL;
457 
458  try
459  {
460  LIB_ID fpid;
461 
462  if( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) >= 0 )
463  {
464  DisplayInfoMessage( this, wxString::Format( _( "Footprint ID \"%s\" is not valid." ),
465  GetChars( aFootprintName ) ) );
466  return NULL;
467  }
468 
469  std::string nickname = fpid.GetLibNickname();
470  std::string fpname = fpid.GetLibItemName();
471 
472  wxLogDebug( wxT( "Load footprint \"%s\" from library \"%s\"." ),
473  fpname.c_str(), nickname.c_str() );
474 
475  footprint = Prj().PcbFootprintLibs( Kiway() )->FootprintLoad(
476  FROM_UTF8( nickname.c_str() ), FROM_UTF8( fpname.c_str() ) );
477  }
478  catch( const IO_ERROR& ioe )
479  {
480  DisplayError( this, ioe.What() );
481  return NULL;
482  }
483 
484  if( footprint )
485  {
486  footprint->SetParent( (EDA_ITEM*) GetBoard() );
487  footprint->SetPosition( wxPoint( 0, 0 ) );
488  return footprint;
489  }
490 
491  wxString msg = wxString::Format( _( "Footprint \"%s\" not found" ), aFootprintName.GetData() );
492  DisplayError( this, msg );
493  return NULL;
494 }
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
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
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:61
MODULE * FootprintLoad(const wxString &aNickname, const wxString &aFootprintName)
Function FootprintLoad.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
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.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
VTBL_ENTRY FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
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
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:157
BOARD * GetBoard() const
int Parse(const UTF8 &aId, LIB_ID_TYPE aType, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition: lib_id.cpp:122
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:276
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:244
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

References DisplayError(), DisplayInfoMessage(), FP_LIB_TABLE::FootprintLoad(), Format(), FROM_UTF8(), PCB_BASE_FRAME::GetBoard(), GetChars(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), LIB_ID::ID_PCB, KIWAY_HOLDER::Kiway(), LIB_ID::Parse(), PROJECT::PcbFootprintLibs(), KIWAY_HOLDER::Prj(), EDA_ITEM::SetParent(), MODULE::SetPosition(), and IO_ERROR::What().

Referenced by InitDisplay().

◆ 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().

◆ GetActiveLayer()

virtual PCB_LAYER_ID PCB_BASE_FRAME::GetActiveLayer ( ) const
inlinevirtualinherited

Function GetActiveLayer returns the active layer.

Definition at line 565 of file pcb_base_frame.h.

566  {
567  return GetScreen()->m_Active_Layer;
568  }
PCB_LAYER_ID m_Active_Layer
Definition: pcb_screen.h:44
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.

References PCB_BASE_FRAME::GetScreen(), and PCB_SCREEN::m_Active_Layer.

Referenced by PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Zone(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildFilterLists(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::Delete_Segment(), DRAWING_TOOL::DrawVia(), DRAWING_TOOL::drawZone(), PCB_EDIT_FRAME::EditDimension(), PCB_BASE_FRAME::GetCollectorsGuide(), DRAWING_TOOL::getDrawingLayer(), PCBNEW_CONTROL::HighContrastMode(), PCB_EDIT_FRAME::InstallPcbGlobalDeleteFrame(), PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), PCBNEW_CONTROL::LayerNext(), PCBNEW_CONTROL::LayerPrev(), PCBNEW_CONTROL::LayerToggle(), DIALOG_FOOTPRINT_FP_EDITOR::OnAddField(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAddField(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnLeftClick(), PCB_LAYER_WIDGET::onPopupSelection(), PCB_DRAW_PANEL_GAL::OnShow(), PCB_EDIT_FRAME::OnUpdateLayerSelectBox(), PCB_EDIT_FRAME::Other_Layer_Route(), DRAWING_TOOL::PlaceText(), PCB_EDIT_FRAME::PrepareLayerIndicator(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_BASE_FRAME::SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), ROUTER_TOOL::switchLayerOnViaPlacement(), and FOOTPRINT_EDIT_FRAME::UpdateUserInterface().

◆ 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.

◆ GetAutoZoom()

bool DISPLAY_FOOTPRINTS_FRAME::GetAutoZoom ( ) const
inline

◆ 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 & PCB_BASE_FRAME::GetAuxOrigin ( ) const
overridevirtualinherited

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

Implements EDA_DRAW_FRAME.

Definition at line 279 of file pcb_base_frame.cpp.

280 {
281  wxASSERT( m_Pcb );
282  return m_Pcb->GetAuxOrigin();
283 }
const wxPoint & GetAuxOrigin() const
Definition: class_board.h:345

References BOARD::GetAuxOrigin(), and PCB_BASE_FRAME::m_Pcb.

Referenced by PCB_EDIT_FRAME::DoGenFootprintsPositionFile(), PCB_EDIT_FRAME::ExportToGenCAD(), EDIT_TOOL::MoveExact(), PCB_EDIT_FRAME::moveExact(), PCB_EDIT_FRAME::OnLeftClick(), and DIALOG_GENDRILL::UpdateDrillParams().

◆ 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().

◆ GetBoard()

BOARD* PCB_BASE_FRAME::GetBoard ( ) const
inlineinherited

Definition at line 193 of file pcb_base_frame.h.

194  {
195  wxASSERT( m_Pcb );
196  return m_Pcb;
197  }

References PCB_BASE_FRAME::m_Pcb.

Referenced by Abort_Create_Track(), Abort_MoveOrCopyModule(), Abort_MoveTrack(), Abort_Zone_Create_Outline(), DIALOG_COPPER_ZONE::AcceptOptions(), DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), PCB_EDIT_FRAME::Add45DegreeSegment(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_FRAME::AddModuleToBoard(), PCB_EDIT_FRAME::AppendBoardFile(), DIALOG_PLOT::applyPlotSettings(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), PCB_EDIT_FRAME::Attribut_net(), PCB_EDIT_FRAME::Attribut_Track(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Zone(), GRID_CELL_LAYER_SELECTOR::BeginEdit(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Block_Rotate(), PCB_BASE_FRAME::build_ratsnest_module(), DIALOG_COPPER_ZONE::buildAvailableListOfNets(), PCB_EDIT_FRAME::Change_Side_Module(), PCB_EDIT_FRAME::Check_All_Zones(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::Clear_Pcb(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), PCB_BASE_FRAME::Compile_Ratsnest(), PCB_EDIT_FRAME::Create_MuWaveComponent(), PCB_EDIT_FRAME::Create_MuWavePolygonShape(), DIALOG_GEN_FOOTPRINT_POSITION::CreateFiles(), CreateHeaderInfoData(), PCB_BASE_FRAME::CreateNewModule(), PCB_EDIT_FRAME::createPopupMenuForTracks(), DIALOG_PRINT_PCBNEW::createPrintout(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), PCB_EDIT_FRAME::Delete_Drawings_All_Layer(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Module(), PCB_EDIT_FRAME::Delete_net(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Zone_Contour(), PCB_BASE_FRAME::DeletePad(), DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), DIALOG_GENCAD_EXPORT_OPTIONS::DIALOG_GENCAD_EXPORT_OPTIONS(), DIALOG_GENDRILL::DIALOG_GENDRILL(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_SELECT_NET_FROM_LIST::DIALOG_SELECT_NET_FROM_LIST(), DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), PCB_EDIT_FRAME::doAutoSave(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), PCB_EDIT_FRAME::DoGenFootprintsPositionFile(), PCB_EDIT_FRAME::DoGenFootprintsReport(), DIALOG_DRC_CONTROL::doSelectionMenu(), ROUTER_TOOL::DpDimensionsDialog(), GRID_CELL_LAYER_RENDERER::Draw(), DrawMovingBlockOutlines(), drawPickedItems(), DRC::DRC(), EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::duplicateZone(), FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer(), FOOTPRINT_EDIT_FRAME::Edit_Edge_Width(), PCB_EDIT_FRAME::Edit_Track_Width(), PCB_EDIT_FRAME::Edit_Zone_Params(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::End_Edge(), FOOTPRINT_EDIT_FRAME::End_Edge_Module(), PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::End_Zone(), PCB_EDIT_FRAME::EraseRedundantTrack(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), PCB_EDIT_FRAME::Exchange_Module(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), DIALOG_COPPER_ZONE::ExportSetupToOtherCopperZones(), PCB_EDIT_FRAME::ExportToGenCAD(), PCB_EDIT_FRAME::ExportVRML_File(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::fixEagleNets(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), PCB_EDIT_FRAME::GenD356File(), PCB_EDIT_FRAME::GenFootprintsReport(), Get_Module(), GetBoard(), EDA_3D_VIEWER::GetBoard(), GAL_ARRAY_CREATOR::getBoard(), LEGACY_ARRAY_CREATOR::getBoard(), FOOTPRINT_EDIT_FRAME::GetDesignSettings(), PCB_LAYER_BOX_SELECTOR::getEnabledLayers(), PCB_BASE_FRAME::GetFootprintFromBoardByReference(), PCB_LAYER_SELECTOR::GetLayerName(), PCB_LAYER_BOX_SELECTOR::GetLayerName(), FOOTPRINT_EDIT_FRAME::GetLoadedFPID(), FOOTPRINT_EDIT_FRAME::GetModel(), GAL_ARRAY_CREATOR::getModule(), PCB_EDIT_FRAME::GetProjectFileParameters(), FP_TREE_SYNCHRONIZING_ADAPTER::GetValue(), GRID_CELL_LAYER_SELECTOR::GetValue(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), PCB_EDIT_FRAME::HandleBlockEnd(), FOOTPRINT_EDIT_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HighLight(), FOOTPRINT_EDIT_FRAME::Import_Module(), PCB_EDIT_FRAME::importFile(), DIALOG_PLOT::init_Dialog(), InitDisplay(), PCB_EDIT_FRAME::InstallNetlistFrame(), InvokeDialogImportGfxBoard(), FOOTPRINT_EDIT_FRAME::IsCurrentFPFromBoard(), FOOTPRINT_EDIT_FRAME::IsElementVisible(), PCB_LAYER_SELECTOR::IsLayerEnabled(), PCB_LAYER_BOX_SELECTOR::IsLayerEnabled(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), DIALOG_NETLIST::loadNetlist(), Magnetize(), DIALOG_DRC_CONTROL::OnActivateDlg(), DIALOG_EXCHANGE_FOOTPRINTS::OnApplyClicked(), DIALOG_IMPORT_SETTINGS::OnBrowseClicked(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), DIALOG_FIND::onButtonFindItemClick(), DIALOG_FIND::onButtonFindMarkerClick(), FOOTPRINT_EDIT_FRAME::OnCloseWindow(), DIALOG_NETLIST::OnCompileRatsnestClick(), DIALOG_EXPORT_STEP::onExportButton(), PCB_EDIT_FRAME::OnExportIDF3(), PCB_EDIT_FRAME::OnExportSTEP(), PCB_EDIT_FRAME::OnExportVRML(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_LAYER_WIDGET::OnLayerVisible(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), PCB_LAYER_WIDGET::OnRenderEnable(), PCB_EDIT_FRAME::OnRightClick(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnRightUpItem(), PCB_EDIT_FRAME::OnSelectTool(), DIALOG_DRC_CONTROL::OnStartdrcClick(), DIALOG_NETLIST::OnTestFootprintsClick(), PCB_BASE_FRAME::OnTogglePadDrawMode(), FOOTPRINT_VIEWER_FRAME::OnUpdateFootprintButton(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected(), DIALOG_NETLIST::OnUpdatePCB(), FOOTPRINT_EDIT_FRAME::OnUpdateSave(), FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::Other_Layer_Route(), PANEL_SETUP_FEATURE_CONSTRAINTS::PANEL_SETUP_FEATURE_CONSTRAINTS(), PANEL_SETUP_LAYERS::PANEL_SETUP_LAYERS(), PANEL_SETUP_MASK_AND_PASTE::PANEL_SETUP_MASK_AND_PASTE(), PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES(), PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS(), PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS(), DIALOG_UPDATE_PCB::PerformUpdate(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), PCB_BASE_FRAME::PlaceModule(), DIALOG_PLOT::Plot(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), DIALOG_EXCHANGE_FOOTPRINTS::processMatchingModules(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), PCB_EDIT_FRAME::ReCreateMenuBar(), RedrawActiveWindow(), FOOTPRINT_EDIT_FRAME::RedrawActiveWindow(), FOOTPRINT_VIEWER_FRAME::RedrawActiveWindow(), FOOTPRINT_WIZARD_FRAME::RedrawActiveWindow(), PCB_EDIT_FRAME::RedrawActiveWindow(), PCB_LAYER_WIDGET::ReFill(), PCB_LAYER_WIDGET::ReFillRender(), Refresh(), FOOTPRINT_WIZARD_FRAME::ReloadFootprint(), PCB_EDIT_FRAME::Remove_One_Track(), PCB_EDIT_FRAME::Remove_Zone_Corner(), PCB_EDIT_FRAME::RemoveMisConnectedTracks(), PCB_EDIT_FRAME::RemoveStruct(), PCB_BASE_FRAME::Rotate_Module(), DRC::RunTests(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), PCB_BASE_FRAME::SelectCopperLayerPair(), PCB_EDIT_FRAME::SelectHighLight(), PCB_BASE_FRAME::SelectLayer(), DIALOG_GLOBAL_DELETION::SetCurrentLayer(), FOOTPRINT_EDIT_FRAME::SetDesignSettings(), DIALOG_DRC_CONTROL::SetDrcParmeters(), FOOTPRINT_EDIT_FRAME::SetElementVisibility(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), ZONE_SETTINGS::SetupLayersList(), FOOTPRINT_EDIT_FRAME::setupTools(), PCB_EDIT_FRAME::Show_1_Ratsnest(), Show_New_Edge_While_Move_Mouse(), PCB_EDIT_FRAME::SpreadFootprints(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), PCB_BASE_FRAME::StartMovePad(), PCB_EDIT_FRAME::Swap_Layers(), PCB_EDIT_FRAME::SwitchLayer(), PCB_LAYER_WIDGET::SyncLayerVisibilities(), DRC::testDisabledLayers(), DRC::TestZoneToZoneOutline(), PCB_BASE_FRAME::TraceAirWiresToTargets(), PCB_BASE_FRAME::TraceModuleRatsNest(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow(), DIALOG_SWAP_LAYERS::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow(), DIALOG_PRINT_PCBNEW::TransferDataToWindow(), DIALOG_SWAP_LAYERS::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow(), TRACK_WIDTH_MENU::update(), DIFF_PAIR_MENU::update(), FOOTPRINT_VIEWER_FRAME::UpdateMsgPanel(), UpdateMsgPanel(), FOOTPRINT_WIZARD_FRAME::UpdateMsgPanel(), FOOTPRINT_EDIT_FRAME::UpdateMsgPanel(), DRC::updatePointers(), FOOTPRINT_EDIT_FRAME::updateTitle(), updateView(), FOOTPRINT_WIZARD_FRAME::updateView(), FOOTPRINT_VIEWER_FRAME::updateView(), FOOTPRINT_EDIT_FRAME::updateView(), and DIALOG_DRC_CONTROL::writeReport().

◆ GetBoardBoundingBox()

EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox ( bool  aBoardEdgesOnly = false) const
inherited

Function GetBoardBoundingBox calculates the bounding box containing all board items (or board edge segments).

Parameters
aBoardEdgesOnlyis true if we are interested in board edge segments only.
Returns
EDA_RECT - the board's bounding box

Definition at line 370 of file pcb_base_frame.cpp.

371 {
372  wxASSERT( m_Pcb );
373 
374  EDA_RECT area = aBoardEdgesOnly ? m_Pcb->GetBoardEdgesBoundingBox() : m_Pcb->GetBoundingBox();
375 
376  if( area.GetWidth() == 0 && area.GetHeight() == 0 )
377  {
378  wxSize pageSize = GetPageSizeIU();
379 
381  {
382  area.SetOrigin( 0, 0 );
383  area.SetEnd( pageSize.x, pageSize.y );
384  }
385  else
386  {
387  area.SetOrigin( -pageSize.x / 2, -pageSize.y / 2 );
388  area.SetEnd( pageSize.x / 2, pageSize.y / 2 );
389  }
390  }
391 
392  return area;
393 }
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: class_board.h:790
const EDA_RECT GetBoardEdgesBoundingBox() const
Function GetBoardEdgesBoundingBox Returns the board bounding box calculated using exclusively the boa...
Definition: class_board.h:802
int GetWidth() const
Definition: eda_rect.h:117
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:124
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:148
void SetEnd(int x, int y)
Definition: eda_rect.h:134
int GetHeight() const
Definition: eda_rect.h:118
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
const wxSize GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...

References BOARD::GetBoardEdgesBoundingBox(), BOARD::GetBoundingBox(), EDA_RECT::GetHeight(), PCB_BASE_FRAME::GetPageSizeIU(), EDA_RECT::GetWidth(), PCB_BASE_FRAME::m_Pcb, EDA_DRAW_FRAME::m_showBorderAndTitleBlock, EDA_RECT::SetEnd(), and EDA_RECT::SetOrigin().

Referenced by FOOTPRINT_EDIT_FRAME::BestZoom(), PCB_BASE_FRAME::BestZoom(), and PCB_BASE_FRAME::GetDocumentExtents().

◆ GetCanvas()

virtual EDA_DRAW_PANEL* EDA_DRAW_FRAME::GetCanvas ( ) const
inlinevirtualinherited

Reimplemented in SCH_BASE_FRAME.

Definition at line 399 of file draw_frame.h.

399 { return m_canvas; }
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128

References EDA_DRAW_FRAME::m_canvas.

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), AddNewTrace(), Autoroute_One_Track(), PCB_EDIT_FRAME::Check_All_Zones(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), DIALOG_DRC_CONTROL::doSelectionMenu(), PLEDITOR_PRINTOUT::DrawPage(), DrawPageOnClipboard(), LEGACY_ARRAY_CREATOR::finalise(), DIALOG_DRC_CONTROL::focusOnItem(), DIALOG_SELECT_NET_FROM_LIST::HighlightNet(), InitDisplay(), InstallBlockCmdFrame(), PROPERTIES_FRAME::OnAcceptPrms(), DIALOG_EXCHANGE_FOOTPRINTS::OnApplyClicked(), DIALOG_FIND::onButtonFindItemClick(), DIALOG_FIND::onButtonFindMarkerClick(), PCB_EDIT_FRAME::OnHotKey(), PCB_LAYER_WIDGET::OnLayerColorChange(), GERBER_LAYER_WIDGET::OnLayerColorChange(), PCB_LAYER_WIDGET::OnLayerSelect(), GERBER_LAYER_WIDGET::OnLayerSelect(), PCB_LAYER_WIDGET::OnLayerVisible(), GERBER_LAYER_WIDGET::OnLayerVisible(), GERBER_LAYER_WIDGET::onPopupSelection(), PCB_LAYER_WIDGET::OnRenderColorChange(), GERBER_LAYER_WIDGET::OnRenderColorChange(), PCB_LAYER_WIDGET::OnRenderEnable(), GERBER_LAYER_WIDGET::OnRenderEnable(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnRightUpItem(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnSelectItem(), PROPERTIES_FRAME::OnSetDefaultValues(), PCB_EDIT_FRAME::OpenProjectFiles(), DIALOG_PAD_PROPERTIES::prepareCanvas(), EDA_DRAW_FRAME::Process_PageSettings(), DIALOG_DRC_CONTROL::RedrawDrawPanel(), Refresh(), GERBVIEW_FRAME::SortLayersByX2Attributes(), PCB_EDIT_FRAME::Swap_Layers(), PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ 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().

◆ GetCollectorsGuide()

GENERAL_COLLECTORS_GUIDE PCB_BASE_FRAME::GetCollectorsGuide ( )
inherited

Function GetCollectorsGuide.

Returns
GENERAL_COLLECTORS_GUIDE - that considers the global configuration options.

Definition at line 725 of file pcb_base_frame.cpp.

726 {
728  GetGalCanvas()->GetView() );
729 
730  // account for the globals
732  guide.SetIgnoreMTextsOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_BK ) );
733  guide.SetIgnoreMTextsOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_FR ) );
734  guide.SetIgnoreModulesOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_BK ) );
735  guide.SetIgnoreModulesOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_FR ) );
736  guide.SetIgnorePadsOnBack( ! m_Pcb->IsElementVisible( LAYER_PAD_BK ) );
737  guide.SetIgnorePadsOnFront( ! m_Pcb->IsElementVisible( LAYER_PAD_FR ) );
738  guide.SetIgnoreThroughHolePads( ! m_Pcb->IsElementVisible( LAYER_PADS_TH ) );
739  guide.SetIgnoreModulesVals( ! m_Pcb->IsElementVisible( LAYER_MOD_VALUES ) );
740  guide.SetIgnoreModulesRefs( ! m_Pcb->IsElementVisible( LAYER_MOD_REFERENCES ) );
741  guide.SetIgnoreThroughVias( ! m_Pcb->IsElementVisible( LAYER_VIA_THROUGH ) );
742  guide.SetIgnoreBlindBuriedVias( ! m_Pcb->IsElementVisible( LAYER_VIA_BBLIND ) );
743  guide.SetIgnoreMicroVias( ! m_Pcb->IsElementVisible( LAYER_VIA_MICROVIA ) );
744  guide.SetIgnoreTracks( ! m_Pcb->IsElementVisible( LAYER_TRACKS ) );
745 
746  return guide;
747 }
to draw blind/buried vias
multilayer pads, usually with holes
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
LSET GetVisibleLayers() const
Function GetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
show modules values (when texts are visibles)
show modules on front
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
to draw usual through hole vias
void SetIgnoreMTextsMarkedNoShow(bool ignore)
Definition: collectors.h:542
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Function IsElementVisible tests whether a given element category is visible.
smd pads, front layer
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
A general implementation of a COLLECTORS_GUIDE.
Definition: collectors.h:386
show modules references (when texts are visibles)

References PCB_BASE_FRAME::GetActiveLayer(), EDA_DRAW_FRAME::GetGalCanvas(), EDA_DRAW_PANEL_GAL::GetView(), BOARD::GetVisibleLayers(), BOARD::IsElementVisible(), LAYER_MOD_BK, LAYER_MOD_FR, LAYER_MOD_REFERENCES, LAYER_MOD_TEXT_BK, LAYER_MOD_TEXT_FR, LAYER_MOD_TEXT_INVISIBLE, LAYER_MOD_VALUES, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PADS_TH, LAYER_TRACKS, LAYER_VIA_BBLIND, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, PCB_BASE_FRAME::m_Pcb, and GENERAL_COLLECTORS_GUIDE::SetIgnoreMTextsMarkedNoShow().

Referenced by PCB_EDIT_FRAME::createPopUpMenuForZones(), MODULE_EDITOR_TOOLS::EnumeratePads(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), and PCB_EDIT_FRAME::SelectHighLight().

◆ 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(), 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(), LIB_EDIT_FRAME::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 }

◆ GetCurItem()

BOARD_ITEM * PCB_BASE_FRAME::GetCurItem ( )
inherited

Definition at line 719 of file pcb_base_frame.cpp.

720 {
721  return GetScreen()->GetCurItem();
722 }
BOARD_ITEM * GetCurItem() const
Function GetCurItem returns the currently selected BOARD_ITEM, overriding BASE_SCREEN::GetCurItem().
Definition: pcb_screen.h:72
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.

References PCB_SCREEN::GetCurItem(), and PCB_BASE_FRAME::GetScreen().

Referenced by Abort_Create_Track(), Abort_Zone_Move_Corner_Or_Outlines(), DIALOG_DRC_CONTROL::doSelectionMenu(), EDIT_TOOL::editFootprintInFpEditor(), PCB_EDIT_FRAME::GeneralControl(), Magnetize(), PCB_EDIT_FRAME::moveExact(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), FOOTPRINT_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_EXCHANGE_FOOTPRINTS::processModule(), PCB_EDIT_FRAME::RemoveStruct(), Show_Zone_Corner_Or_Outline_While_Move_Mouse(), PCB_EDIT_FRAME::SwitchLayer(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), and SELECTION_TOOL::unselect().

◆ 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 }

◆ GetDesignSettings()

BOARD_DESIGN_SETTINGS & PCB_BASE_FRAME::GetDesignSettings ( ) const
virtualinherited

Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame.

Overloaded in FOOTPRINT_EDIT_FRAME.

Reimplemented in FOOTPRINT_EDIT_FRAME.

Definition at line 321 of file pcb_base_frame.cpp.

322 {
323  wxASSERT( m_Pcb );
324  return m_Pcb->GetDesignSettings();
325 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:534

References BOARD::GetDesignSettings(), and PCB_BASE_FRAME::m_Pcb.

Referenced by AddNewTrace(), PCB_BASE_FRAME::AddPad(), PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), Autoroute_One_Track(), PCB_EDIT_FRAME::Begin_DrawSegment(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Self(), PAD_TOOL::copyPadSettings(), PCB_EDIT_FRAME::Create_MuWaveComponent(), PCB_EDIT_FRAME::CreateMuWaveBaseFootprint(), PCB_BASE_FRAME::CreateNewModule(), PCB_EDIT_FRAME::createPopupMenuForTracks(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), PCB_EDIT_FRAME::Edit_Gap(), PCB_BASE_FRAME::Export_Pad_Settings(), PCB_BASE_FRAME::Import_Pad_Settings(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAddField(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnUpdateSelectTrackWidth(), PCB_EDIT_FRAME::OnUpdateSelectViaSize(), PCB_EDIT_FRAME::Other_Layer_Route(), PAD_TOOL::pastePadProperties(), DRAWING_TOOL::PlaceText(), PCB_EDIT_FRAME::PrepareLayerIndicator(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_BASE_FRAME::ResetTextSize(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), ShowNewTrackWhenMovingCursor(), PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event(), PCB_EDIT_FRAME::UpdateTrackWidthSelectBox(), and PCB_EDIT_FRAME::UpdateViaSizeSelectBox().

◆ GetDisplayOptions()

void* PCB_BASE_FRAME::GetDisplayOptions ( )
inlineoverridevirtualinherited

Function GetDisplayOptions returns the display options current in use Display options are relative to the way tracks, vias, outlines and other things are shown (for instance solid or sketch mode) Must be overloaded in frames which have display options (board editor and footprint editor)

Reimplemented from EDA_DRAW_FRAME.

Definition at line 172 of file pcb_base_frame.h.

172 { return &m_DisplayOptions; }
PCB_DISPLAY_OPTIONS m_DisplayOptions

References PCB_BASE_FRAME::m_DisplayOptions.

Referenced by PCB_EDIT_FRAME::Delete_Segment_Edge(), VIA::Draw(), PCB_BASE_FRAME::DrawGeneralRatsnest(), FOOTPRINT_EDIT_FRAME::GetConfigurationSettings(), PCB_EDIT_FRAME::GetConfigurationSettings(), DIALOG_FP_BROWSER_DISPLAY_OPTIONS::initDialog(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog(), PCB_EDIT_FRAME::OnHotKey(), PCB_LAYER_WIDGET::OnLayerSelect(), FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), PCB_EDIT_FRAME::OnSelectTool(), PCB_DRAW_PANEL_GAL::OnShow(), PCB_BASE_FRAME::OnToggleEdgeDrawMode(), PCB_BASE_FRAME::OnToggleGraphicDrawMode(), PCB_BASE_FRAME::OnTogglePadDrawMode(), PCB_BASE_FRAME::OnTogglePolarCoords(), PCB_BASE_FRAME::OnToggleTextDrawMode(), PCB_BASE_FRAME::OnUpdateCoordType(), PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode(), FOOTPRINT_EDIT_FRAME::OnUpdateOptionsToolbar(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), PCB_BASE_FRAME::PlaceModule(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), SELECTION_TOOL::selectPoint(), PCB_BASE_FRAME::SetToolID(), PCB_BASE_FRAME::SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), FOOTPRINT_EDIT_FRAME::SyncMenusAndToolbars(), PCB_EDIT_FRAME::SyncMenusAndToolbars(), PCB_BASE_FRAME::TraceAirWiresToTargets(), PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_MODEDIT_SETTINGS::TransferDataFromWindow(), PANEL_PCBNEW_SETTINGS::TransferDataFromWindow(), PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataToWindow(), PANEL_MODEDIT_SETTINGS::TransferDataToWindow(), PANEL_PCBNEW_SETTINGS::TransferDataToWindow(), DIALOG_FP_BROWSER_DISPLAY_OPTIONS::UpdateObjectSettings(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings(), PCB_BASE_FRAME::UpdateStatusBar(), and PCB_BASE_FRAME::UseGalCanvas().

◆ GetDocumentExtents()

const BOX2I PCB_BASE_FRAME::GetDocumentExtents ( ) const
inlineoverridevirtualinherited

Reimplemented from EDA_DRAW_FRAME.

Definition at line 136 of file pcb_base_frame.h.

137  {
138  return GetBoardBoundingBox( false );
139  }
EDA_RECT GetBoardBoundingBox(bool aBoardEdgesOnly=false) const
Function GetBoardBoundingBox calculates the bounding box containing all board items (or board edge se...

References PCB_BASE_FRAME::GetBoardBoundingBox().

◆ 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().

◆ GetFootprintFromBoardByReference()

MODULE * PCB_BASE_FRAME::GetFootprintFromBoardByReference ( )
inherited

Function GetFootprintFromBoardByReference.

Returns
a reference to the footprint found by its refence on the curent board. the reference is entered by the user from a dialog (by awxTextCtlr, or a list of available references)

Definition at line 62 of file pcb_footprint_edit_utils.cpp.

63 {
64  wxString moduleName;
65  MODULE* module = NULL;
66  wxArrayString fplist;
67 
68  // Build list of available fp references, to display them in dialog
69  for( MODULE* fp = GetBoard()->m_Modules; fp; fp = fp->Next() )
70  fplist.Add( fp->GetReference() + wxT(" ( ") + fp->GetValue() + wxT(" )") );
71 
72  fplist.Sort();
73 
74  DIALOG_GET_FOOTPRINT_BY_NAME dlg( this, fplist );
75 
76  if( dlg.ShowModal() != wxID_OK ) //Aborted by user
77  return NULL;
78 
79  moduleName = dlg.GetValue();
80  moduleName.Trim( true );
81  moduleName.Trim( false );
82 
83  if( !moduleName.IsEmpty() )
84  {
85  module = GetBoard()->m_Modules;
86 
87  while( module )
88  {
89  if( module->GetReference().CmpNoCase( moduleName ) == 0 )
90  break;
91 
92  module = module->Next();
93  }
94  }
95 
96  return module;
97 }
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:462
DIALOG_GET_FOOTPRINT_BY_NAME is a helper dialog to select a footprint by its reference One can enter ...
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_INSERT) override
BOARD_ITEM * Next() const
DLIST< MODULE > m_Modules
Definition: class_board.h:248
MODULE * Next() const
Definition: class_module.h:122
BOARD * GetBoard() const

References MODULE::Add(), PCB_BASE_FRAME::GetBoard(), MODULE::GetReference(), DIALOG_GET_FOOTPRINT_BY_NAME::GetValue(), BOARD::m_Modules, BOARD_ITEM::Next(), and MODULE::Next().

Referenced by SELECTION_TOOL::findMove(), and PCB_EDIT_FRAME::Process_Special_Functions().

◆ 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(), 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(), LIB_EDIT_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(), LIB_EDIT_FRAME::OnExportBody(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), LIB_EDIT_FRAME::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(), LIB_EDIT_FRAME::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(), 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(), 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(), 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()

COLOR4D DISPLAY_FOOTPRINTS_FRAME::GetGridColor ( )
overridevirtual

Function GetGridColor() , virtual.

Returns
the color of the grid

Reimplemented from EDA_DRAW_FRAME.

Definition at line 448 of file display_footprints_frame.cpp.

449 {
450  return COLOR4D( DARKGRAY );
451 }
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References DARKGRAY.

◆ GetGridOrigin()

const wxPoint & PCB_BASE_FRAME::GetGridOrigin ( ) const
overridevirtualinherited

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 293 of file pcb_base_frame.cpp.

294 {
295  wxASSERT( m_Pcb );
296  return m_Pcb->GetGridOrigin();
297 }
const wxPoint & GetGridOrigin() const
Definition: class_board.h:352

References BOARD::GetGridOrigin(), and PCB_BASE_FRAME::m_Pcb.

Referenced by GRID_HELPER::GetOrigin(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_SET_GRID::TransferDataFromWindow(), and DIALOG_SET_GRID::TransferDataToWindow().

◆ 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* DISPLAY_FOOTPRINTS_FRAME::GetHotKeyDescription ( int  aCommand) const
inlineoverridevirtual

Implements EDA_DRAW_FRAME.

Definition at line 119 of file display_footprints_frame.h.

119 { return NULL; }

◆ 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.

◆ 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 & PCB_BASE_FRAME::GetPageSettings ( ) const
overridevirtualinherited

Implements EDA_DRAW_FRAME.

Definition at line 261 of file pcb_base_frame.cpp.

262 {
263  wxASSERT( m_Pcb );
264  return m_Pcb->GetPageSettings();
265 }
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:549

References BOARD::GetPageSettings(), and PCB_BASE_FRAME::m_Pcb.

Referenced by FOOTPRINT_EDIT_FRAME::ToPrinter(), and PCB_EDIT_FRAME::ToPrinter().

◆ GetPageSizeIU()

const wxSize PCB_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 268 of file pcb_base_frame.cpp.

269 {
270  wxASSERT( m_Pcb );
271 
272  // this function is only needed because EDA_DRAW_FRAME is not compiled
273  // with either -DPCBNEW or -DEESCHEMA, so the virtual is used to route
274  // into an application specific source file.
275  return m_Pcb->GetPageSettings().GetSizeIU();
276 }
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:549

References BOARD::GetPageSettings(), and PCB_BASE_FRAME::m_Pcb.

Referenced by PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::Clear_Pcb(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), PCB_BASE_FRAME::GetBoardBoundingBox(), and PCB_EDIT_FRAME::OpenProjectFiles().

◆ GetPlotSettings()

const PCB_PLOT_PARAMS & PCB_BASE_FRAME::GetPlotSettings ( ) const
virtualinherited

Function GetPlotSettings returns the PCB_PLOT_PARAMS for the BOARD owned by this frame.

Overloaded in FOOTPRINT_EDIT_FRAME.

Reimplemented in FOOTPRINT_EDIT_FRAME.

Definition at line 356 of file pcb_base_frame.cpp.

357 {
358  wxASSERT( m_Pcb );
359  return m_Pcb->GetPlotOptions();
360 }
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: class_board.h:552

References BOARD::GetPlotOptions(), and PCB_BASE_FRAME::m_Pcb.

Referenced by DIALOG_PLOT::CreateDrillFile(), DIALOG_GENDRILL::DIALOG_GENDRILL(), DIALOG_PLOT::DIALOG_PLOT(), and FOOTPRINT_EDIT_FRAME::GetPlotSettings().

◆ GetScreen()

PCB_SCREEN* PCB_BASE_FRAME::GetScreen ( ) const
inlineoverridevirtualinherited

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.

Definition at line 211 of file pcb_base_frame.h.

211 { return (PCB_SCREEN*) EDA_DRAW_FRAME::GetScreen(); }
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 Abort_MoveOrCopyModule(), PCB_EDIT_FRAME::Add45DegreeSegment(), AddNewTrace(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Self(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Duplicate(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Block_Rotate(), PCB_EDIT_FRAME::Block_SelectItems(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::doAutoSave(), VIA::Draw(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawVia(), PCB_BASE_EDIT_FRAME::duplicateItem(), PCB_EDIT_FRAME::duplicateItems(), PCB_EDIT_FRAME::duplicateZone(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::End_Zone(), PCB_EDIT_FRAME::Files_io_from_id(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), GeneralControl(), FOOTPRINT_WIZARD_FRAME::GeneralControl(), PCB_EDIT_FRAME::GeneralControl(), PCB_BASE_FRAME::GetActiveLayer(), FP_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), PCB_BASE_FRAME::GetCurItem(), GRID_HELPER::GetGrid(), FP_TREE_SYNCHRONIZING_ADAPTER::GetValue(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), PCB_EDIT_FRAME::HandleBlockEnd(), FOOTPRINT_EDIT_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HandleBlockPlace(), InvokeDialogImportGfxBoard(), InvokeDialogImportGfxModule(), PCBNEW_CONTROL::LayerToggle(), Magnetize(), EDIT_TOOL::MoveExact(), PCB_EDIT_FRAME::moveExact(), FOOTPRINT_PREVIEW_PANEL::New(), DIALOG_FIND::onButtonFindItemClick(), DIALOG_FIND::onButtonFindMarkerClick(), FOOTPRINT_EDIT_FRAME::OnCloseWindow(), PCB_EDIT_FRAME::OnExportSTEP(), FOOTPRINT_VIEWER_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotKey(), FOOTPRINT_WIZARD_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), PCB_EDIT_FRAME::OnLeftClick(), PCB_BASE_FRAME::OnModify(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), FOOTPRINT_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), FOOTPRINT_VIEWER_FRAME::OnSetRelativeOffset(), FOOTPRINT_WIZARD_FRAME::OnSetRelativeOffset(), FOOTPRINT_EDIT_FRAME::OnUpdateSave(), PCB_EDIT_FRAME::OnUpdateSave(), PCB_BASE_FRAME::OnUpdateSelectZoom(), DIALOG_POSITION_RELATIVE::OnUseUserOriginClick(), ROUTER_TOOL::onViaCommand(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::Other_Layer_Route(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), PCB_EDIT_FRAME::PrepareLayerIndicator(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::RedrawActiveWindow(), PCB_EDIT_FRAME::RedrawActiveWindow(), CVPCB_CONTROL::ResetCoords(), PCBNEW_CONTROL::ResetCoords(), FOOTPRINT_EDIT_FRAME::RevertFootprint(), PCB_EDIT_FRAME::SavePcbFile(), PCB_BASE_FRAME::SelectCopperLayerPair(), PCB_BASE_FRAME::SetActiveLayer(), PCB_BASE_FRAME::SetCurItem(), PCB_BASE_FRAME::SetFastGrid1(), PCB_BASE_FRAME::SetFastGrid2(), PCB_BASE_FRAME::SetPageSettings(), PCB_BASE_FRAME::SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), DIALOG_SET_GRID::TransferDataFromWindow(), PCBNEW_CONTROL::updateGrid(), PCB_BASE_FRAME::UpdateGridSelectBox(), PCB_BASE_FRAME::UpdateMsgPanel(), FOOTPRINT_EDIT_FRAME::UpdateMsgPanel(), PCB_BASE_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::updateZoomSelectBox(), and ~DISPLAY_FOOTPRINTS_FRAME().

◆ 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().

◆ 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.

◆ 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.

◆ GetTitleBlock()

const TITLE_BLOCK & PCB_BASE_FRAME::GetTitleBlock ( ) const
overridevirtualinherited

Implements EDA_DRAW_FRAME.

Definition at line 307 of file pcb_base_frame.cpp.

308 {
309  wxASSERT( m_Pcb );
310  return m_Pcb->GetTitleBlock();
311 }
TITLE_BLOCK & GetTitleBlock()
Definition: class_board.h:555

References BOARD::GetTitleBlock(), and PCB_BASE_FRAME::m_Pcb.

Referenced by CreateHeaderInfoData().

◆ 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(), LIB_EDIT_FRAME::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(), OnUIToolSelection(), LIB_EDIT_FRAME::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(), LIB_EDIT_FRAME::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(), LIB_EDIT_FRAME::OnAddPartToSchematic(), DIALOG_DRC_CONTROL::OnDeleteOneClick(), SCH_EDIT_FRAME::OnHotKey(), LIB_EDIT_FRAME::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().

◆ 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(), LIB_EDIT_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), CONNECTION_SUBGRAPH::ResolveDrivers(), CVPCB_CONTROL::SwitchUnits(), GERBVIEW_CONTROL::SwitchUnits(), SyncMenusAndToolbars(), FOOTPRINT_EDIT_FRAME::SyncMenusAndToolbars(), LIB_EDIT_FRAME::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().

◆ GetZoneSettings()

◆ 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 PCB_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 966 of file pcb_base_frame.cpp.

967 {
969 }
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 EDA_DRAW_FRAME::HandleBlockBegin ( wxDC *  aDC,
EDA_KEY  aKey,
const wxPoint &  aPosition,
int  aExplicitCommand = 0 
)
virtualinherited

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 in SCH_BASE_FRAME.

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

517 {
518  wxFAIL_MSG( "Obsolete; how'd we get here?" );
519  return false;
520 }

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

◆ 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 EDA_DRAW_FRAME::HardRedraw ( )
virtualinherited

Rebuild the GAL and redraws the screen.

Call when something went wrong.

Reimplemented in SCH_EDIT_FRAME, LIB_EDIT_FRAME, SCH_BASE_FRAME, and FOOTPRINT_EDIT_FRAME.

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

979 {
980 }

Referenced by COMMON_TOOLS::ZoomRedraw().

◆ 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().

◆ Import_Pad_Settings()

void PCB_BASE_FRAME::Import_Pad_Settings ( D_PAD aPad,
bool  aDraw 
)
inherited

Definition at line 63 of file pad_edit_functions.cpp.

64 {
65  if( aDraw )
66  {
67  aPad->SetFlags( DO_NOT_DRAW );
69  aPad->ClearFlags( DO_NOT_DRAW );
70  }
71 
72  const D_PAD& mp = GetDesignSettings().m_Pad_Master;
73 
74  aPad->ImportSettingsFromMaster( mp );
75 
76  if( aDraw )
78 
79  aPad->GetParent()->SetLastEditTime();
80 
81  OnModify();
82 }
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame.
virtual void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259
void SetLastEditTime(timestamp_t aTime)
Definition: class_module.h:313
void ImportSettingsFromMaster(const D_PAD &aMasterPad)
Imports the pad settings from aMasterPad.
Definition: class_pad.cpp:1463
MODULE * GetParent() const
Definition: class_pad.h:164
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
D_PAD m_Pad_Master
A dummy pad to store all default parameters.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:260
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: class_pad.cpp:226
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:126

References EDA_ITEM::ClearFlags(), DO_NOT_DRAW, D_PAD::GetBoundingBox(), PCB_BASE_FRAME::GetDesignSettings(), D_PAD::GetParent(), D_PAD::ImportSettingsFromMaster(), EDA_DRAW_FRAME::m_canvas, BOARD_DESIGN_SETTINGS::m_Pad_Master, PCB_BASE_FRAME::OnModify(), EDA_DRAW_PANEL::RefreshDrawingRect(), EDA_ITEM::SetFlags(), and MODULE::SetLastEditTime().

Referenced by PCB_BASE_FRAME::AddPad(), and PCB_EDIT_FRAME::Process_Special_Functions().

◆ 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().

◆ InitDisplay()

void DISPLAY_FOOTPRINTS_FRAME::InitDisplay ( )

Function InitDisplay Refresh the full display for this frame: Set the title, the status line and redraw the canvas Must be called after the footprint to display is modifed.

Definition at line 497 of file display_footprints_frame.cpp.

498 {
499  CVPCB_MAINFRAME* parentframe = (CVPCB_MAINFRAME *) GetParent();
500  MODULE* module = nullptr;
501  const FOOTPRINT_INFO* module_info = nullptr;
502 
503  if( GetBoard()->m_Modules.GetCount() )
505 
506  wxString footprintName = parentframe->GetSelectedFootprint();
507 
508  if( footprintName.IsEmpty() )
509  {
510  COMPONENT* comp = parentframe->GetSelectedComponent();
511 
512  if( comp )
513  footprintName = comp->GetFPID().GetUniStringLibId();
514  }
515 
516  if( !footprintName.IsEmpty() )
517  {
518  SetTitle( wxString::Format( _( "Footprint: %s" ), footprintName ) );
519 
520  module = Get_Module( footprintName );
521 
522  module_info = parentframe->m_FootprintsList->GetModuleInfo( footprintName );
523  }
524 
525  if( module )
526  GetBoard()->m_Modules.PushBack( module );
527 
528  if( module_info )
529  SetStatusText( wxString::Format( _( "Lib: %s" ), module_info->GetLibNickname() ), 0 );
530  else
531  SetStatusText( wxEmptyString, 0 );
532 
533  updateView();
534 
535  UpdateStatusBar();
536 
537  GetCanvas()->Refresh();
538  Update3DView();
539 }
FOOTPRINT_LIST * m_FootprintsList
FOOTPRINT_INFO * GetModuleInfo(const wxString &aFootprintId)
Get info for a module by id.
wxString GetLibNickname() const override
unsigned GetCount() const
Function GetCount returns the number of elements in the list.
Definition: dlist.h:126
MODULE * Get_Module(const wxString &CmpName)
void DeleteAll()
Function DeleteAll deletes all items on the list and leaves the list empty.
Definition: dlist.cpp:44
void updateView()
update the gal canvas (view, colors ...)
void PushBack(T *aNewElement)
Function PushBack puts aNewElement at the end of the list sequence.
Definition: dlist.h:250
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:166
virtual EDA_DRAW_PANEL * GetCanvas() const
Definition: draw_frame.h:399
Class COMPONENT is used to store components and all of their related information found in a netlist.
Definition: pcb_netlist.h:83
wxString GetSelectedFootprint()
virtual void UpdateStatusBar() override
Update the status bar information.
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
DLIST< MODULE > m_Modules
Definition: class_board.h:248
COMPONENT * GetSelectedComponent()
wxString GetUniStringLibId() const
Definition: lib_id.h:148
BOARD * GetBoard() const
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
The CvPcb application main window.
bool Update3DView(const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.

References DHEAD::DeleteAll(), Format(), Get_Module(), PCB_BASE_FRAME::GetBoard(), EDA_DRAW_FRAME::GetCanvas(), DHEAD::GetCount(), COMPONENT::GetFPID(), FOOTPRINT_INFO::GetLibNickname(), FOOTPRINT_LIST::GetModuleInfo(), CVPCB_MAINFRAME::GetSelectedComponent(), CVPCB_MAINFRAME::GetSelectedFootprint(), LIB_ID::GetUniStringLibId(), CVPCB_MAINFRAME::m_FootprintsList, BOARD::m_Modules, DLIST< T >::PushBack(), EDA_DRAW_PANEL::Refresh(), PCB_BASE_FRAME::Update3DView(), PCB_BASE_FRAME::UpdateStatusBar(), and updateView().

Referenced by CVPCB_MAINFRAME::CreateScreenCmp().

◆ InstallOptionsDisplay()

void DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay ( wxCommandEvent &  event)

Definition at line 34 of file dialog_display_options.cpp.

35 {
36  DIALOG_FOOTPRINTS_DISPLAY_OPTIONS OptionWindow( this );
37 
38  OptionWindow.ShowModal();
39 }

◆ InstallPadOptionsFrame()

void PCB_BASE_FRAME::InstallPadOptionsFrame ( D_PAD pad)
inherited

Definition at line 101 of file dialog_pad_properties.cpp.

102 {
103  DIALOG_PAD_PROPERTIES dlg( this, aPad );
104  dlg.ShowQuasiModal(); // QuasiModal required for NET_SELECTOR
105 }
class DIALOG_PAD_PROPERTIES, derived from DIALOG_PAD_PROPERTIES_BASE, created by wxFormBuilder

References DIALOG_SHIM::ShowQuasiModal().

Referenced by FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), and PCB_EDIT_FRAME::Process_Special_Functions().

◆ InstallPreferences()

virtual void EDA_BASE_FRAME::InstallPreferences ( PAGED_DIALOG aParent)
inlinevirtualinherited

Allow a frame to load its preference panels (if any) into the preferences dialog.

Parameters
aParenta paged dialog into which the preference panels should be installed

Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 238 of file eda_base_frame.h.

238 { }

Referenced by EDA_BASE_FRAME::ShowPreferences().

◆ 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().

◆ 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()

bool DISPLAY_FOOTPRINTS_FRAME::IsGridVisible ( ) const
overridevirtual

Function IsGridVisible() , virtual.

Returns
true if the grid must be shown

Reimplemented from EDA_DRAW_FRAME.

Definition at line 436 of file display_footprints_frame.cpp.

437 {
438  return m_drawGrid;
439 }

References EDA_DRAW_FRAME::m_drawGrid.

◆ IsModal()

◆ 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