KiCad PCB EDA Suite
FOOTPRINT_EDIT_FRAME Class Reference

#include <module_editor_frame.h>

Inheritance diagram for FOOTPRINT_EDIT_FRAME:
PCB_BASE_EDIT_FRAME PCB_BASE_FRAME EDA_DRAW_FRAME KIWAY_PLAYER EDA_BASE_FRAME KIWAY_HOLDER

Public Member Functions

 ~FOOTPRINT_EDIT_FRAME ()
 
BOARD_ITEM_CONTAINERGetModel () const override
 > More...
 
BOARD_DESIGN_SETTINGSGetDesignSettings () const override
 Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame. More...
 
void SetDesignSettings (const BOARD_DESIGN_SETTINGS &aSettings) override
 
const PCB_PLOT_PARAMSGetPlotSettings () const override
 Function GetPlotSettings returns the PCB_PLOT_PARAMS for the BOARD owned by this frame. More...
 
void SetPlotSettings (const PCB_PLOT_PARAMS &aSettings) override
 
void LoadSettings (wxConfigBase *aCfg) override
 Function LoadSettings loads common frame parameters from a configuration file. More...
 
void SaveSettings (wxConfigBase *aCfg) override
 Function SaveSettings saves common frame parameters to a configuration data file. More...
 
PARAM_CFG_ARRAYGetConfigurationSettings ()
 Function GetConfigurationSettings returns the footpr�int editor settings list. More...
 
void InstallOptionsFrame (const wxPoint &pos)
 
void OnCloseWindow (wxCloseEvent &Event) override
 
void CloseModuleEditor (wxCommandEvent &Event)
 
void Process_Special_Functions (wxCommandEvent &event)
 
void ProcessPreferences (wxCommandEvent &event)
 
void RedrawActiveWindow (wxDC *DC, bool EraseBg) override
 Function RedrawActiveWindoow draws the footprint editor BOARD, and others elements such as axis and grid. More...
 
void ReCreateHToolbar () override
 Function ReCreateHToolbar create the main horizontal toolbar for the footprint editor. More...
 
void ReCreateVToolbar () override
 
void ReCreateOptToolbar ()
 
void ReCreateAuxiliaryToolbar () override
 
void OnLeftClick (wxDC *DC, const wxPoint &MousePos) override
 
void OnLeftDClick (wxDC *DC, const wxPoint &MousePos) override
 Function OnLeftDClick handles the double click in the footprint editor: If the double clicked item is editable: call the corresponding editor. More...
 
bool OnRightClick (const wxPoint &MousePos, wxMenu *PopMenu) override
 Function OnRightClick handles the right mouse click in the footprint editor: Create the pop up menu After this menu is built, the standard ZOOM menu is added. More...
 
void ReCreateMenuBar () override
 (Re)Create the menubar for the module editor frame More...
 
void setupTools ()
 
void ToolOnRightClick (wxCommandEvent &event) override
 
void OnSelectOptionToolbar (wxCommandEvent &event)
 
void OnConfigurePaths (wxCommandEvent &aEvent)
 
void OnSaveLibraryAs (wxCommandEvent &aEvent)
 Function OnSaveLibraryAs saves the current library to a new name and/or library type. More...
 
EDA_HOTKEYGetHotKeyDescription (int aCommand) const override
 > More...
 
bool OnHotKey (wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
 Function OnHotKey handle hot key events. More...
 
BOARD_ITEMPrepareItemForHotkey (bool failIfCurrentlyEdited)
 
bool OnHotkeyEditItem (int aIdCommand)
 
bool OnHotkeyDeleteItem (int aIdCommand)
 
bool OnHotkeyMoveItem (int aIdCommand)
 
bool OnHotkeyMoveItemExact ()
 
bool OnHotkeyRotateItem (int aIdCommand)
 
bool OnHotkeyDuplicateItem (int aIdCommand)
 
void Show3D_Frame (wxCommandEvent &event) override
 Function Show3D_Frame displays 3D view of the footprint (module) being edited. More...
 
bool GeneralControl (wxDC *aDC, const wxPoint &aPosition, EDA_KEY aHotKey=0) override
 Function GeneralControl performs application specific control using aDC at aPosition in logical units. More...
 
void OnVerticalToolbar (wxCommandEvent &aEvent)
 
void OnUpdateSelectTool (wxUpdateUIEvent &aEvent)
 handle ID_ZOOM_SELECTION and ID_NO_TOOL_SELECTED tools More...
 
void OnUpdateVerticalToolbar (wxUpdateUIEvent &aEvent)
 handle most of tools og the vertical right toolbar ("Tools" toolbar) More...
 
void OnUpdateOptionsToolbar (wxUpdateUIEvent &aEvent)
 
void OnUpdateLibSelected (wxUpdateUIEvent &aEvent)
 
void OnUpdateModuleSelected (wxUpdateUIEvent &aEvent)
 
void OnUpdateLibAndModuleSelected (wxUpdateUIEvent &aEvent)
 
void OnUpdateLoadModuleFromBoard (wxUpdateUIEvent &aEvent)
 
void OnUpdateInsertModuleInBoard (wxUpdateUIEvent &aEvent)
 
void OnUpdateReplaceModuleInBoard (wxUpdateUIEvent &aEvent)
 
void OnUpdateSelectCurrentLib (wxUpdateUIEvent &aEvent)
 
void OnEditItemRequest (wxDC *aDC, BOARD_ITEM *aItem) override
 > More...
 
void LoadModuleFromBoard (wxCommandEvent &event)
 Function LoadModuleFromBoard called from the main toolbar to load a footprint from board mainly to edit it. More...
 
bool SaveFootprintInLibrary (const wxString &aLibName, MODULE *aModule, bool aOverwrite, bool aDisplayDialog)
 Function SaveFootprintInLibrary Save in an existing library a given footprint. More...
 
virtual void OnModify () override
 Virtual Function OnModify() Must be called after a footprint change in order to set the "modify" flag of the current screen and prepare, if needed the refresh of the 3D frame showing the footprint do not forget to call the basic OnModify function to update auxiliary info. More...
 
void ToPrinter (wxCommandEvent &event)
 Function ToPrinter Install the print dialog. More...
 
virtual void PrintPage (wxDC *aDC, LSET aPrintMaskLayer, bool aPrintMirrorMode, void *aData=NULL) override
 Function PrintPage is used to print a page. More...
 
bool Clear_Pcb (bool aQuery)
 Function Clear_Pcb delete all and reinitialize the current board. More...
 
virtual int BlockCommand (EDA_KEY key) override
 Function BlockCommand Returns 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) override
 Function HandleBlockPlace handles the BLOCK PLACE command Last routine for block operation for: More...
 
virtual bool HandleBlockEnd (wxDC *DC) override
 Function HandleBlockEnd( ) Handle the "end" of a block command, i.e. More...
 
BOARD_ITEMModeditLocateAndDisplay (int aHotKeyCode=0)
 
const wxString GetCurrentLib () const
 Return the current library nickname. More...
 
void RemoveStruct (EDA_ITEM *Item)
 
void Transform (MODULE *module, int transform)
 Function Transform performs a geometric transform on the current footprint. More...
 
void Export_Module (MODULE *aModule)
 Function Export_Module Create a file containing only one footprint. More...
 
MODULEImport_Module ()
 Function Import_Module Read a file containing only one footprint. More...
 
bool SaveCurrentModule (const wxString *aLibPath=NULL)
 Function SaveCurrentModule saves the module which is currently being edited into aLibPath or into the currently selected library if aLibPath is NULL. More...
 
bool Load_Module_From_BOARD (MODULE *Module)
 Function Load_Module_From_BOARD load in Modedit a footprint from the main board. More...
 
MODULESelectFootprint (BOARD *aPcb)
 Function SelectFootprint Display the list of modules currently existing on the BOARD. More...
 
void Edit_Edge_Width (EDGE_MODULE *aEdge)
 Function Edit_Edge_Width changes the width of module perimeter lines, EDGE_MODULEs. More...
 
void Edit_Edge_Layer (EDGE_MODULE *Edge)
 Function Edit_Edge_Layer changes the EDGE_MODULE Edge layer, (The new layer will be asked) if Edge == NULL change the layer of the entire footprint edges. More...
 
void Delete_Edge_Module (EDGE_MODULE *Edge)
 Function Delete_Edge_Module deletes EDGE_MODULE Edge. More...
 
EDGE_MODULEBegin_Edge_Module (EDGE_MODULE *Edge, wxDC *DC, STROKE_T type_edge)
 Function Begin_Edge_Module creates a new edge item (line, arc ..). More...
 
void End_Edge_Module (EDGE_MODULE *Edge)
 Function End_Edge_Module terminates a move or create edge function. More...
 
void Enter_Edge_Width (EDGE_MODULE *aEdge)
 Function Enter_Edge_Width Edition of width of module outlines Ask for a new width. More...
 
void Start_Move_EdgeMod (EDGE_MODULE *drawitem, wxDC *DC)
 Function to initialize the move function params of a graphic item type DRAWSEGMENT. More...
 
void Place_EdgeMod (EDGE_MODULE *drawitem)
 Function to place a graphic item type EDGE_MODULE currently moved. More...
 
void InstallFootprintBodyItemPropertiesDlg (EDGE_MODULE *aItem)
 Function InstallFootprintBodyItemPropertiesDlg Install a dialog to edit a graphic item of a footprint body. More...
 
void DlgGlobalChange_PadSettings (D_PAD *aPad)
 Function DlgGlobalChange_PadSettings changes pad characteristics for the given footprint or all footprints which look like the given footprint. More...
 
bool DeleteModuleFromCurrentLibrary ()
 Function DeleteModuleFromCurrentLibrary prompts user for footprint name, then deletes it from current library. More...
 
bool IsElementVisible (GAL_LAYER_ID aElement) const
 Function IsElementVisible tests whether a given element category is visible. More...
 
void SetElementVisibility (GAL_LAYER_ID aElement, bool aNewState)
 Function SetElementVisibility changes the visibility of an element category. More...
 
virtual bool IsGridVisible () const override
 Function IsGridVisible() , virtual. More...
 
virtual 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...
 
virtual COLOR4D GetGridColor () override
 Function GetGridColor() , virtual. More...
 
void SetActiveLayer (PCB_LAYER_ID aLayer) override
 > More...
 
virtual void UseGalCanvas (bool aEnable) override
 > More...
 
wxString CreateNewLibrary ()
 Function CreateNewLibrary prompts user for a library path, then creates a new footprint library at that location. More...
 
void SaveCopyInUndoList (BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
 Function SaveCopyInUndoList 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 Creates a new entry in undo list of commands. More...
 
void RestoreCopyFromRedoList (wxCommandEvent &aEvent)
 Function RestoreCopyFromRedoList Redo the last edition: More...
 
void RestoreCopyFromUndoList (wxCommandEvent &aEvent)
 Function RestoreCopyFromUndoList Undo the last edition: More...
 
void PutDataInPreviousState (PICKED_ITEMS_LIST *aList, bool aRedoCommand, bool aRebuildRatsnet=true)
 Function PutDataInPreviousState Used in undo or redo command. More...
 
bool UndoRedoBlocked () const
 Function UndoRedoBlocked Checks if the undo and redo operations are currently blocked. More...
 
void UndoRedoBlock (bool aBlock=true)
 Function UndoRedoBlock Enables/disable undo and redo operations. More...
 
int GetRotationAngle () const
 Function GetRotationAngle() Returns the angle used for rotate operations. More...
 
void SetRotationAngle (int aRotationAngle)
 Function SetRotationAngle() Sets the angle used for rotate operations. More...
 
virtual void SetBoard (BOARD *aBoard) override
 > More...
 
EDA_3D_VIEWERGet3DViewerFrame ()
 
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...
 
virtual void SetPageSettings (const PAGE_INFO &aPageSettings) override
 
const PAGE_INFOGetPageSettings () const override
 
const wxSize GetPageSizeIU () const override
 Function GetPageSizeIU works off of GetPageSettings() to return the size of the paper page in the internal units of this particular view. More...
 
const wxPointGetAuxOrigin () const override
 Function GetAuxOrigin returns the origin of the axis used for plotting and various exports. More...
 
void SetAuxOrigin (const wxPoint &aPoint) override
 
const wxPointGetGridOrigin () const override
 Function GetGridOrigin returns 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
 
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)
 
BOARDGetBoard () const
 
virtual void SetToolID (int aId, int aCursor, const wxString &aToolMsg) override
 Function SetToolID sets the tool command ID to aId and sets the cursor to aCursor. More...
 
virtual void UpdateStatusBar () override
 Function UpdateStatusBar updates the status bar information. More...
 
PCB_SCREENGetScreen () const override
 Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives. More...
 
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...
 
EDA_ITEMReadDrawSegmentDescr (LINE_READER *aReader)
 
int ReadListeSegmentDescr (LINE_READER *aReader, TRACK *PtSegm, int StructType, int NumSegm)
 
int ReadSetup (LINE_READER *aReader)
 
int ReadGeneralDescrPcb (LINE_READER *aReader)
 
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 ()
 
void UpdateMsgPanel () override
 > More...
 
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide ()
 Function GetCollectorsGuide. More...
 
void CursorGoto (const wxPoint &aPos, bool aWarp=true)
 Function CursorGoto positions the cursor at a given coordinate and reframes the drawing if the requested point is out of view. 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...
 
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 aDoNotRecreateRatsnest=false)
 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 ResetModuleTextSizes (const wxString &aFilter, bool aRef, bool aValue, bool aOthers)
 Function ResetModuleTextSizes resets text size and width of all module text fields of given field type to current settings in Preferences->Dimensions->Texts and Drawings. More...
 
void InstallPadOptionsFrame (D_PAD *pad)
 
void InstallTextModOptionsFrame (TEXTE_MODULE *TextMod, wxDC *DC)
 
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 RotatePad (D_PAD *Pad, wxDC *DC)
 
void PlacePad (D_PAD *Pad, wxDC *DC)
 
void Export_Pad_Settings (D_PAD *aPad)
 
void Import_Pad_Settings (D_PAD *aPad, bool aDraw)
 
void GlobalChange_PadSettings (D_PAD *aPad, bool aSameFootprints, bool aPadShapeFilter, bool aPadOrientFilter, bool aPadLayerFilter, bool aRedraw, bool aSaveForUndo)
 Function GlobalChange_PadSettings Function to change pad caracteristics for the given footprint or all footprints which look like the given footprint. More...
 
wxString SelectFootprint (EDA_DRAW_FRAME *aWindow, const wxString &aLibraryName, const wxString &aMask, const wxString &aKeyWord, FP_LIB_TABLE *aTable)
 Function SelectFootprint displays a list of modules found in all libraries or a given library. More...
 
MODULELoadModuleFromLibrary (const wxString &aLibrary, FP_LIB_TABLE *aTable, bool aUseFootprintViewer=true, wxDC *aDC=NULL)
 Function LoadModuleFromLibrary opens a dialog to select a footprint, and loads it into current 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 Build_Board_Ratsnest ()
 Function Build_Board_Ratsnest. 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 TestForActiveLinksInRatsnest (int aNetCode)
 Function TestForActiveLinksInRatsnest Explores the full rats nest list (which must exist) to determine the ACTIVE links in the full rats nest list When tracks exist between pads, a link can connect 2 pads already connected by a track and the link is said inactive. More...
 
void TestConnections ()
 Function TestConnections tests the connections relative to all nets. More...
 
void TestNetConnection (wxDC *aDC, int aNetCode)
 Function TestNetConnection tests the connections relative to aNetCode. More...
 
void ComputeLegacyConnections ()
 Function RecalculateAllTracksNetcode search connections between tracks and pads and propagate pad net codes to the track segments. 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 PCB_LAYER_ID GetActiveLayer () const
 Function GetActiveLayer returns the active layer. More...
 
bool InvokeDialogGrid ()
 
void OnTogglePolarCoords (wxCommandEvent &aEvent)
 
void OnTogglePadDrawMode (wxCommandEvent &aEvent)
 
void OnUpdateCoordType (wxUpdateUIEvent &aEvent)
 
void OnUpdatePadDrawMode (wxUpdateUIEvent &aEvent)
 
void OnUpdateSelectGrid (wxUpdateUIEvent &aEvent)
 
void OnUpdateSelectZoom (wxUpdateUIEvent &aEvent)
 
void SetFastGrid1 ()
 Function SetFastGrid1() More...
 
void SetFastGrid2 ()
 Function SetFastGrid2() More...
 
void SetNextGrid () override
 Virtual function SetNextGrid() changes the grid size settings to the next one available. More...
 
void SetPrevGrid () override
 Virtual function SetPrevGrid() changes the grid size settings to the previous one available. More...
 
void ClearSelection ()
 
virtual void SwitchCanvas (wxCommandEvent &aEvent)
 switches currently used canvas (default / Cairo / OpenGL). More...
 
void OnUpdateSwitchCanvas (wxUpdateUIEvent &aEvent)
 Update UI called when switches currently used canvas (default / Cairo / OpenGL). More...
 
EDA_DRAW_PANEL_GAL::GAL_TYPE LoadCanvasTypeSetting () const
 Function LoadCanvasTypeSetting() Returns the canvas type stored in the application settings. More...
 
bool SaveCanvasTypeSetting (EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
 Function SaveCanvasTypeSetting() Stores the canvas type in the application settings. More...
 
PCB_GENERAL_SETTINGSSettings ()
 
const PCB_GENERAL_SETTINGSCSettings () const
 
bool LockFile (const wxString &aFileName)
 Function LockFile marks a schematic file as being in use. More...
 
void ReleaseFile ()
 Function ReleaseFile Release the current file marked in use. More...
 
wxPoint GetCrossHairPosition (bool aInvertY=false) const
 Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates. More...
 
void SetCrossHairPosition (const wxPoint &aPosition, bool aSnapToGrid=true)
 Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) units. More...
 
wxPoint GetCursorPosition (bool aOnGrid, wxRealPoint *aGridSize=NULL) const
 Function GetCursorPosition returns the current cursor position in logical (drawing) units. More...
 
wxPoint GetNearestGridPosition (const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
 Function GetNearestGridPosition returns the nearest aGridSize location to aPosition. More...
 
wxPoint GetCrossHairScreenPosition () const
 Function GetCursorScreenPosition returns the cross hair position in device (display) units.b. More...
 
void SetMousePosition (const wxPoint &aPosition)
 
wxPoint RefPos (bool useMouse) const
 Function RefPos Return the reference position, coming from either the mouse position or the cursor position. More...
 
const wxPointGetScrollCenterPosition () const
 
void SetScrollCenterPosition (const wxPoint &aPoint)
 
virtual COLOR4D GetDrawBgColor () const
 
virtual void SetDrawBgColor (COLOR4D aColor)
 
bool GetShowBorderAndTitleBlock () const
 
void SetShowBorderAndTitleBlock (bool aShow)
 
bool ShowPageLimits () const
 
void SetShowPageLimits (bool aShow)
 
EDA_DRAW_PANELGetCanvas ()
 
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 ()
 function 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
 Function GetHotkeyConfig() Returns a structure containing currently used hotkey mapping. More...
 
virtual void AddMenuZoomAndGrid (wxMenu *aMasterMenu)
 Function AddMenuZoomAndGrid (virtual) 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
 Function GetZoomLevelCoeff returns the coefficient to convert internal display scale factor to zoom level. More...
 
void EraseMsgBox ()
 
void Process_PageSettings (wxCommandEvent &event)
 
wxAuiToolBar * GetMainToolBar () const
 
virtual void SetNoToolSelected ()
 Select the ID_NO_TOOL_SELECTED id tool (Idle tool) More...
 
int GetToolId () const
 
virtual void SetGridColor (COLOR4D aColor)
 Function SetGridColor() , virtual. More...
 
wxPoint GetGridPosition (const wxPoint &aPosition) const
 Function GetGridPosition returns the nearest grid position to aPosition if a screen is defined and snap to grid is enabled. More...
 
void SetPresetGrid (int aIndex)
 Function SetPresetGrid() changes the grid size to one of the preset values. More...
 
virtual void OnSelectGrid (wxCommandEvent &event)
 Command event handler for selecting grid sizes. More...
 
virtual void OnSelectZoom (wxCommandEvent &event)
 Functions OnSelectZoom sets the zoom factor when selected by the zoom list box in the main tool bar. More...
 
void OnToggleGridState (wxCommandEvent &aEvent)
 
void OnSelectUnits (wxCommandEvent &aEvent)
 
void OnToggleCrossHairStyle (wxCommandEvent &aEvent)
 
void OnUpdateUndo (wxUpdateUIEvent &aEvent)
 
void OnUpdateRedo (wxUpdateUIEvent &aEvent)
 
void OnUpdateGrid (wxUpdateUIEvent &aEvent)
 
void OnUpdateUnits (wxUpdateUIEvent &aEvent)
 
void OnUpdateCrossHairStyle (wxUpdateUIEvent &aEvent)
 
virtual void OnSize (wxSizeEvent &event)
 Function OnSize recalculates the size of toolbars and display panel when the frame size changes. More...
 
void OnEraseBackground (wxEraseEvent &SizeEvent)
 
virtual void OnZoom (wxCommandEvent &event)
 Function OnZoom Called from any zoom event (toolbar , hotkey or popup ) More...
 
void SetNextZoom ()
 Function SetNextZoom() changes the zoom to the next one available. More...
 
void SetPrevZoom ()
 Function SetPrevZoom() changes the zoom to the previous one available. More...
 
void SetPresetZoom (int aIndex)
 Function SetPresetZoom() changes zoom to one of the preset values. More...
 
void RedrawScreen (const wxPoint &aCenterPoint, bool aWarpPointer)
 Function RedrawScreen redraws the entire screen area by updating the scroll bars and mouse pointer in order to have aCenterPoint at the center of the screen. More...
 
void RedrawScreen2 (const wxPoint &posBefore)
 Function RedrawScreen2 puts the crosshair back to the screen position it had before zooming. More...
 
void Zoom_Automatique (bool aWarpPointer)
 Function Zoom_Automatique redraws the screen with best zoom level and the best centering that shows all the page or the board. More...
 
void Window_Zoom (EDA_RECT &Rect)
 Compute the zoom factor and the new draw offset to draw the selected area (Rect) in full window screen. More...
 
double GetZoom ()
 Function GetZoom. More...
 
void DrawWorkSheet (wxDC *aDC, BASE_SCREEN *aScreen, int aLineWidth, double aScale, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
 Function DrawWorkSheet Draws on screen the page layout with the frame and the basic inscriptions. More...
 
void DisplayToolMsg (const wxString &msg)
 
void AdjustScrollBars (const wxPoint &aCenterPosition)
 
virtual void OnActivate (wxActivateEvent &event)
 Function OnActivate (virtual) is called when activating the frame. More...
 
void DisplayUnitsMsg ()
 Function DisplayUnitsMsg displays 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...
 
void CopyToClipboard (wxCommandEvent &event)
 Function CopyToClipboard copies the current page or the current block to the clipboard. More...
 
void OnSockRequest (wxSocketEvent &evt)
 
void OnSockRequestServer (wxSocketEvent &evt)
 
void AppendMsgPanel (const wxString &textUpper, const wxString &textLower, COLOR4D color, int pad=6)
 Append a message to the message panel. More...
 
void ClearMsgPanel (void)
 Clear all messages from the message panel. More...
 
void SetMsgPanel (const std::vector< MSG_PANEL_ITEM > &aList)
 Function SetMsgPanel clears the message panel and populates it with the contents of aList. More...
 
void SetMsgPanel (EDA_ITEM *aItem)
 
void PushPreferences (const EDA_DRAW_PANEL *aParentCanvas)
 Function PushPreferences Pushes a few preferences from a parent window to a child window. More...
 
wxString CoordinateToString (int aValue, bool aConvertToMils=false) const
 Function CoordinateToString is a helper to convert the integer coordinate aValue to a string in inches or mm according to the current user units setting. More...
 
wxString LengthDoubleToString (double aValue, bool aConvertToMils=false) const
 Function LengthDoubleToString is a helper to convert the double value aValue to a string in inches or mm according to the current user units setting. 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
 Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame. More...
 
void SetGalCanvas (EDA_DRAW_PANEL_GAL *aPanel)
 
TOOL_MANAGERGetToolManager () const
 Function GetToolManager returns the tool manager instance, if any. More...
 
KIGFX::GAL_DISPLAY_OPTIONSGetGalDisplayOptions ()
 Function GetGalDisplayOptions Returns a reference to the gal rendering options used by GAL for rendering. More...
 
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
 Function ProcessEvent overrides the default process event handler to implement the auto save feature. More...
 
bool Enable (bool enable) override
 
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)
 
void PrintMsg (const wxString &text)
 
wxString ConfigBaseName ()
 Function ConfigBaseName. More...
 
virtual void SaveProjectSettings (bool aAskForSave)
 Function SaveProjectSettings saves changes to the project settings to the project (.pro) file. More...
 
virtual void OnSelectPreferredEditor (wxCommandEvent &event)
 Function OnSelectPreferredEditor Open a dialog to select the editor that will used in KiCad to edit or display files (reports ... More...
 
int ReadHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList)
 Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys. More...
 
int ReadHotkeyConfigFile (const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList)
 Function ReadHotkeyConfigFile Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list with hotkeys. More...
 
void ImportHotkeyConfigFromFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it. More...
 
void ExportHotkeyConfigToFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Function ExportHotkeyConfigToFile Prompt the user for an old hotkey file to read, and read it. More...
 
wxString GetFileFromHistory (int cmdId, const wxString &type, wxFileHistory *aFileHistory=NULL)
 Function GetFileFromHistory fetches the file name from the file history list. More...
 
void UpdateFileHistory (const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
 Function UpdateFileHistory Updates the list of recently opened files. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
bool IsWritable (const wxFileName &aFileName)
 Function IsWritable checks if aFileName can be written. More...
 
void CheckForAutoSaveFile (const wxFileName &aFileName, const wxString &aBackupFileExtension)
 Function CheckForAutoSaveFile checks if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More...
 
virtual void ShowChangedLanguage ()
 Function ShowChangedLanguage redraws the menus and what not in current language. More...
 
virtual void ShowChangedIcons ()
 Function ShowChangedIcons redraws items menus after a icon was changed option. More...
 
void AddMenuIconsOptions (wxMenu *MasterMenu)
 Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice, and add it as submenu to MasterMenu. More...
 
bool PostCommandMenuEvent (int evt_type)
 Function PostCommandMenuEvent. More...
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Static Public Member Functions

static const wxChar * GetFootprintEditorFrameName ()
 Function GetFootprintEditorFrameName (static) More...
 

Public Attributes

DISPLAY_OPTIONS m_DisplayOptions
 
EDA_UNITS_T m_UserGridUnit
 
wxRealPoint m_UserGridSize
 
int m_FastGrid1
 
int m_FastGrid2
 

Static Public Attributes

static const wxChar CANVAS_TYPE_KEY [] = wxT( "canvas_type" )
 

Key in KifaceSettings to store the canvas type.

More...
 

Protected Member Functions

 FOOTPRINT_EDIT_FRAME (KIWAY *aKiway, wxWindow *aParent)
 protected so only friend PCB::IFACE::CreateWindow() can act as sole factory. More...
 
void updateTitle ()
 Function UpdateTitle updates window title according to getLibNickName(). More...
 
void updateView ()
 Reloads displayed items and sets view. More...
 
const wxString getLibPath ()
 The libPath is not publicly visible, grab it from the FP_LIB_TABLE if we must. More...
 
void restoreLastFootprint ()
 
void retainLastFootprint ()
 
TEXTE_MODULECreateTextModule (MODULE *aModule, wxDC *aDC)
 Creates a new text for the footprint. More...
 
void createArray ()
 Function createArray Create an array of the selected item (invokes the dialogue) This function is shared between pcbnew and modedit, as it is virtually the same. More...
 
void duplicateItem (BOARD_ITEM *aItem, bool aIncrement)
 Function duplicateItem Duplicate the specified item This function is shared between pcbnew and modedit, as it is virtually the same. More...
 
void updateGridSelectBox ()
 
void updateZoomSelectBox ()
 
virtual void unitsChangeRefresh () override
 Function unitsChangeRefresh is 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...
 
void SetScreen (BASE_SCREEN *aScreen)
 
void GeneralControlKeyMovement (int aHotKey, wxPoint *aPos, bool aSnapToGrid)
 Function GeneralControlKeyMovement Handle the common part of GeneralControl dedicated to global cursor keys (i.e. More...
 
void RefreshCrossHair (const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC *aDC)
 
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 OnChangeIconsOptions (wxCommandEvent &event) override
 Function OnChangeIconsOptions is an event handler called on a icons options in menus or toolbars menu selection. More...
 
void onAutoSaveTimer (wxTimerEvent &aEvent)
 Function onAutoSaveTimer handles the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Function autoSaveRequired returns the auto save status of the application. More...
 
virtual bool doAutoSave ()
 Function doAutoSave should be overridden by the derived class to handle the auto save feature. More...
 
virtual wxConfigBase * config ()
 Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME. More...
 
virtual const SEARCH_STACKsys_search ()
 Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_MANAGER_FRAME. More...
 
virtual wxString help_name ()
 

Protected Attributes

PCB_LAYER_WIDGETm_Layers
 
PARAM_CFG_ARRAY m_configSettings
 List of footprint editor configuration settings. More...
 
int m_rotationAngle
 User defined rotation angle (in tenths of a degree). More...
 
bool m_undoRedoBlocked
 Is undo/redo operation currently blocked? More...
 
BOARDm_Pcb
 
GENERAL_COLLECTORm_Collector
 
wxAuiToolBar * m_auxiliaryToolBar
 Auxiliary tool bar typically shown below the main tool bar at the top of the main window. 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_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...
 
wxChoice * m_gridSelectBox
 Choice box to choose the grid size. More...
 
wxChoice * m_zoomSelectBox
 Choice box to choose the zoom value. More...
 
wxAuiToolBar * m_drawToolBar
 The tool bar that contains the buttons for quick access to the application draw tools. More...
 
wxAuiToolBar * m_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...
 
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...) if empty, the frame name defined in CTOR is used More...
 
wxAuiToolBar * m_mainToolBar
 Standard horizontal Toolbar. 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...
 

Private Member Functions

void moveExact ()
 Function moveExact Move the selected item exactly, popping up a dialog to allow the user the enter the move delta. More...
 
void duplicateItems (bool aIncrement) override
 Function duplicateItems Duplicate the item under the cursor. More...
 

Friends

struct PCB::IFACE
 

Detailed Description

Definition at line 44 of file module_editor_frame.h.

Constructor & Destructor Documentation

FOOTPRINT_EDIT_FRAME::~FOOTPRINT_EDIT_FRAME ( )

Definition at line 359 of file moduleframe.cpp.

References m_Layers, and retainLastFootprint().

360 {
361  // save the footprint in the PROJECT
363 
364  delete m_Layers;
365 }
PCB_LAYER_WIDGET * m_Layers
FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME ( KIWAY aKiway,
wxWindow *  aParent 
)
protected

protected so only friend PCB::IFACE::CreateWindow() can act as sole factory.

Member Function Documentation

void EDA_BASE_FRAME::AddMenuIconsOptions ( wxMenu *  MasterMenu)
inherited

Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice, and add it as submenu to MasterMenu.

Parameters
MasterMenuThe main menu. The sub menu list will be accessible from the menu item with id ID_KICAD_SELECT_ICONS_OPTIONS

Definition at line 673 of file basicframe.cpp.

References AddMenuItem(), ID_KICAD_SELECT_ICONS_IN_MENUS, ID_KICAD_SELECT_ICONS_OPTIONS, KiBitmap(), and Pgm().

Referenced by preparePreferencesMenu(), PL_EDITOR_FRAME::ReCreateMenuBar(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), and GERBVIEW_FRAME::ReCreateMenuBar().

674 {
675  wxMenu* menu = NULL;
676  wxMenuItem* item = MasterMenu->FindItem( ID_KICAD_SELECT_ICONS_OPTIONS );
677 
678  if( item ) // This menu exists, do nothing
679  return;
680 
681  menu = new wxMenu;
682 
683  menu->Append( new wxMenuItem( menu, ID_KICAD_SELECT_ICONS_IN_MENUS,
684  _( "Icons in Menus" ), wxEmptyString,
685  wxITEM_CHECK ) );
686  menu->Check( ID_KICAD_SELECT_ICONS_IN_MENUS, Pgm().GetUseIconsInMenus() );
687 
688  AddMenuItem( MasterMenu, menu,
690  _( "Icons Options" ),
691  _( "Select show icons in menus and icons sizes" ),
692  KiBitmap( icon_xpm ) );
693 }
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:55
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
void EDA_DRAW_FRAME::AddMenuZoomAndGrid ( wxMenu *  aMasterMenu)
virtualinherited

Function AddMenuZoomAndGrid (virtual) 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 239 of file zoom.cpp.

References AddHotkeyName(), AddMenuItem(), BASE_SCREEN::BuildGridsChoiceList(), g_UserUnit, BASE_SCREEN::GetGrid(), BASE_SCREEN::GetGridCount(), EDA_DRAW_PANEL::GetScreen(), BASE_SCREEN::GetZoom(), HK_ZOOM_AUTO, HK_ZOOM_CENTER, HK_ZOOM_IN, HK_ZOOM_OUT, HK_ZOOM_REDRAW, ID_POPUP_CANCEL, ID_POPUP_GRID_SELECT, ID_POPUP_ZOOM_CENTER, ID_POPUP_ZOOM_IN, ID_POPUP_ZOOM_LEVEL_END, ID_POPUP_ZOOM_LEVEL_START, ID_POPUP_ZOOM_OUT, ID_POPUP_ZOOM_PAGE, ID_POPUP_ZOOM_REDRAW, ID_POPUP_ZOOM_SELECT, INCHES, KiBitmap(), EDA_DRAW_FRAME::m_canvas, GRID_TYPE::m_CmdId, EDA_DRAW_FRAME::m_hotkeysDescrList, EDA_DRAW_FRAME::m_zoomLevelCoeff, and BASE_SCREEN::m_ZoomList.

Referenced by EDA_DRAW_PANEL::OnRightClick().

240 {
241  int maxZoomIds;
242  double zoom;
243  wxString msg;
244  BASE_SCREEN* screen = m_canvas->GetScreen();
245 
246  msg = AddHotkeyName( _( "Center" ), m_hotkeysDescrList, HK_ZOOM_CENTER );
247  AddMenuItem( MasterMenu, ID_POPUP_ZOOM_CENTER, msg, KiBitmap( zoom_center_on_screen_xpm ) );
248  msg = AddHotkeyName( _( "Zoom in" ), m_hotkeysDescrList, HK_ZOOM_IN );
249  AddMenuItem( MasterMenu, ID_POPUP_ZOOM_IN, msg, KiBitmap( zoom_in_xpm ) );
250  msg = AddHotkeyName( _( "Zoom out" ), m_hotkeysDescrList, HK_ZOOM_OUT );
251  AddMenuItem( MasterMenu, ID_POPUP_ZOOM_OUT, msg, KiBitmap( zoom_out_xpm ) );
252  msg = AddHotkeyName( _( "Redraw view" ), m_hotkeysDescrList, HK_ZOOM_REDRAW );
253  AddMenuItem( MasterMenu, ID_POPUP_ZOOM_REDRAW, msg, KiBitmap( zoom_redraw_xpm ) );
254  msg = AddHotkeyName( _( "Zoom auto" ), m_hotkeysDescrList, HK_ZOOM_AUTO );
255  AddMenuItem( MasterMenu, ID_POPUP_ZOOM_PAGE, msg, KiBitmap( zoom_fit_in_page_xpm ) );
256 
257 
258  wxMenu* zoom_choice = new wxMenu;
259  AddMenuItem( MasterMenu, zoom_choice,
260  ID_POPUP_ZOOM_SELECT, _( "Zoom Select" ),
261  KiBitmap( zoom_selection_xpm ) );
262 
263  zoom = screen->GetZoom();
265  maxZoomIds = ( (size_t) maxZoomIds < screen->m_ZoomList.size() ) ?
266  maxZoomIds : screen->m_ZoomList.size();
267 
268  // Populate zoom submenu.
269  for( int i = 0; i < maxZoomIds; i++ )
270  {
271  msg.Printf( wxT( "%.2f" ), m_zoomLevelCoeff / screen->m_ZoomList[i] );
272 
273  zoom_choice->Append( ID_POPUP_ZOOM_LEVEL_START + i, _( "Zoom: " ) + msg,
274  wxEmptyString, wxITEM_CHECK );
275  if( zoom == screen->m_ZoomList[i] )
276  zoom_choice->Check( ID_POPUP_ZOOM_LEVEL_START + i, true );
277  }
278 
279  // Create grid submenu as required.
280  if( screen->GetGridCount() )
281  {
282  wxMenu* gridMenu = new wxMenu;
283  AddMenuItem( MasterMenu, gridMenu, ID_POPUP_GRID_SELECT,
284  _( "Grid Select" ), KiBitmap( grid_select_xpm ) );
285 
286  wxArrayString gridsList;
287  int icurr = screen->BuildGridsChoiceList( gridsList, g_UserUnit != INCHES );
288 
289  for( unsigned i = 0; i < gridsList.GetCount(); i++ )
290  {
291  GRID_TYPE& grid = screen->GetGrid( i );
292  gridMenu->Append( grid.m_CmdId, gridsList[i], wxEmptyString, wxITEM_CHECK );
293 
294  if( (int)i == icurr )
295  gridMenu->Check( grid.m_CmdId, true );
296  }
297  }
298 
299  MasterMenu->AppendSeparator();
300  AddMenuItem( MasterMenu, ID_POPUP_CANCEL, _( "Close" ), KiBitmap( cancel_xpm ) );
301 }
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:55
double GetZoom() const
Function GetZoom returns the current "zoom factor", which is a measure of "internal units per device ...
size_t GetGridCount() const
Function GetGridCount().
int BuildGridsChoiceList(wxArrayString &aGridsList, bool aMmFirst) const
Function BuildGridsChoiceList().
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
Definition: draw_frame.h:76
const GRID_TYPE & GetGrid() const
Return the grid object of the currently selected grid.
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: common.h:145
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
double m_zoomLevelCoeff
a suitable value to convert the internal zoom scaling factor
Definition: draw_frame.h:85
wxString AddHotkeyName(const wxString &aText, EDA_HOTKEY **aList, int aCommandId, HOTKEY_ACTION_TYPE aShortCutType)
Function AddHotkeyName Add the key name from the Command id value ( m_Idcommand member value) ...
Class GRID_TYPE is for grid arrays.
BASE_SCREEN * GetScreen()
Definition: draw_panel.cpp:188
std::vector< double > m_ZoomList
standard zoom (i.e. scale) coefficients.
void PCB_BASE_FRAME::AddPad ( MODULE Module,
bool  draw 
)
inherited

Definition at line 110 of file pad_edition_functions.cpp.

References MODULE::CalculateBoundingBox(), D_PAD::GetAttribute(), MODULE::GetBoundingBox(), EDA_DRAW_FRAME::GetCrossHairPosition(), PCB_BASE_FRAME::GetDesignSettings(), 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::SetPadName(), D_PAD::SetPos0(), and D_PAD::SetPosition().

Referenced by OnLeftClick().

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

Definition at line 911 of file draw_frame.cpp.

References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetLeft(), EDA_DRAW_FRAME::GetPageSizeIU(), BOX2< Vec >::GetRight(), BASE_SCREEN::GetScalingFactor(), EDA_DRAW_FRAME::GetScreen(), BOX2< Vec >::GetSize(), BOX2< Vec >::GetTop(), BOX2< Vec >::GetWidth(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), KiROUND(), EDA_DRAW_FRAME::m_canvas, BASE_SCREEN::m_Center, BASE_SCREEN::m_DrawOrg, BASE_SCREEN::m_ScrollbarNumber, BASE_SCREEN::m_ScrollbarPos, BASE_SCREEN::m_ScrollPixelsPerUnitX, BASE_SCREEN::m_ScrollPixelsPerUnitY, min, BOX2< Vec >::MoveBottomTo(), BOX2< Vec >::MoveLeftTo(), BOX2< Vec >::MoveRightTo(), BOX2< Vec >::MoveTopTo(), scale, EDA_DRAW_FRAME::SetScrollCenterPosition(), traceScrollSettings(), VIRT_MAX, VIRT_MIN, wxPoint::x, VECTOR2< T >::x, wxPoint::y, and VECTOR2< T >::y.

Referenced by EDA_DRAW_FRAME::RedrawScreen(), EDA_DRAW_FRAME::RedrawScreen2(), and EDA_DRAW_FRAME::UseGalCanvas().

912 {
913  BASE_SCREEN* screen = GetScreen();
914 
915  if( !screen || !m_canvas )
916  return;
917 
918  double scale = screen->GetScalingFactor();
919 
920  wxLogTrace( traceScrollSettings, wxT( "Center Position = ( %d, %d ), scale = %.10g" ),
921  aCenterPositionIU.x, aCenterPositionIU.y, scale );
922 
923  // Calculate the portion of the drawing that can be displayed in the
924  // client area at the current zoom level.
925 
926  // visible viewport in device units ~ pixels
927  wxSize clientSizeDU = m_canvas->GetClientSize();
928 
929  // Size of the client window in IU
930  DSIZE clientSizeIU( clientSizeDU.x / scale, clientSizeDU.y / scale );
931 
932  // Full drawing or "page" rectangle in internal units
933  DBOX pageRectIU( wxPoint( 0, 0 ), wxSize( GetPageSizeIU().x, GetPageSizeIU().y ) );
934 
935  // Account for scrollbars
936  wxSize scrollbarSizeDU = m_canvas->GetSize() - m_canvas->GetClientSize();
937  wxSize scrollbarSizeIU = scrollbarSizeDU * (1 / scale);
938  wxPoint centerAdjustedIU = aCenterPositionIU + scrollbarSizeIU / 2;
939 
940  // The upper left corner of the client rectangle in internal units.
941  double xIU = centerAdjustedIU.x - clientSizeIU.x / 2.0;
942  double yIU = centerAdjustedIU.y - clientSizeIU.y / 2.0;
943 
944  // If drawn around the center, adjust the client rectangle accordingly.
945  if( screen->m_Center )
946  {
947  // half page offset.
948  xIU += pageRectIU.GetWidth() / 2.0;
949  yIU += pageRectIU.GetHeight() / 2.0;
950  }
951 
952  DBOX clientRectIU( wxPoint( xIU, yIU ), wxSize( clientSizeIU.x, clientSizeIU.y ) );
953  wxPoint centerPositionIU;
954 
955  // put "int" limits on the clientRect
956  if( clientRectIU.GetLeft() < VIRT_MIN )
957  clientRectIU.MoveLeftTo( VIRT_MIN );
958  if( clientRectIU.GetTop() < VIRT_MIN )
959  clientRectIU.MoveTopTo( VIRT_MIN );
960  if( clientRectIU.GetRight() > VIRT_MAX )
961  clientRectIU.MoveRightTo( VIRT_MAX );
962  if( clientRectIU.GetBottom() > VIRT_MAX )
963  clientRectIU.MoveBottomTo( VIRT_MAX );
964 
965  centerPositionIU.x = KiROUND( clientRectIU.GetX() + clientRectIU.GetWidth() / 2 );
966  centerPositionIU.y = KiROUND( clientRectIU.GetY() + clientRectIU.GetHeight() / 2 );
967 
968  if( screen->m_Center )
969  {
970  centerPositionIU.x -= KiROUND( pageRectIU.GetWidth() / 2.0 );
971  centerPositionIU.y -= KiROUND( pageRectIU.GetHeight() / 2.0 );
972  }
973 
974  DSIZE virtualSizeIU;
975 
976  if( pageRectIU.GetLeft() < clientRectIU.GetLeft() && pageRectIU.GetRight() > clientRectIU.GetRight() )
977  {
978  virtualSizeIU.x = pageRectIU.GetSize().x;
979  }
980  else
981  {
982  double pageCenterX = pageRectIU.GetX() + ( pageRectIU.GetWidth() / 2 );
983  double clientCenterX = clientRectIU.GetX() + ( clientRectIU.GetWidth() / 2 );
984 
985  if( clientRectIU.GetWidth() > pageRectIU.GetWidth() )
986  {
987  if( pageCenterX > clientCenterX )
988  virtualSizeIU.x = ( pageCenterX - clientRectIU.GetLeft() ) * 2;
989  else if( pageCenterX < clientCenterX )
990  virtualSizeIU.x = ( clientRectIU.GetRight() - pageCenterX ) * 2;
991  else
992  virtualSizeIU.x = clientRectIU.GetWidth();
993  }
994  else
995  {
996  if( pageCenterX > clientCenterX )
997  virtualSizeIU.x = pageRectIU.GetWidth() + ( (pageRectIU.GetLeft() - clientRectIU.GetLeft() ) * 2 );
998  else if( pageCenterX < clientCenterX )
999  virtualSizeIU.x = pageRectIU.GetWidth() + ( (clientRectIU.GetRight() - pageRectIU.GetRight() ) * 2 );
1000  else
1001  virtualSizeIU.x = pageRectIU.GetWidth();
1002  }
1003  }
1004 
1005  if( pageRectIU.GetTop() < clientRectIU.GetTop() && pageRectIU.GetBottom() > clientRectIU.GetBottom() )
1006  {
1007  virtualSizeIU.y = pageRectIU.GetSize().y;
1008  }
1009  else
1010  {
1011  double pageCenterY = pageRectIU.GetY() + ( pageRectIU.GetHeight() / 2 );
1012  double clientCenterY = clientRectIU.GetY() + ( clientRectIU.GetHeight() / 2 );
1013 
1014  if( clientRectIU.GetHeight() > pageRectIU.GetHeight() )
1015  {
1016  if( pageCenterY > clientCenterY )
1017  virtualSizeIU.y = ( pageCenterY - clientRectIU.GetTop() ) * 2;
1018  else if( pageCenterY < clientCenterY )
1019  virtualSizeIU.y = ( clientRectIU.GetBottom() - pageCenterY ) * 2;
1020  else
1021  virtualSizeIU.y = clientRectIU.GetHeight();
1022  }
1023  else
1024  {
1025  if( pageCenterY > clientCenterY )
1026  virtualSizeIU.y = pageRectIU.GetHeight() +
1027  ( ( pageRectIU.GetTop() - clientRectIU.GetTop() ) * 2 );
1028  else if( pageCenterY < clientCenterY )
1029  virtualSizeIU.y = pageRectIU.GetHeight() +
1030  ( ( clientRectIU.GetBottom() - pageRectIU.GetBottom() ) * 2 );
1031  else
1032  virtualSizeIU.y = pageRectIU.GetHeight();
1033  }
1034  }
1035 
1036  // put "int" limits on the virtualSizeIU
1037  virtualSizeIU.x = std::min( virtualSizeIU.x, MAX_AXIS );
1038  virtualSizeIU.y = std::min( virtualSizeIU.y, MAX_AXIS );
1039 
1040  if( screen->m_Center )
1041  {
1042  screen->m_DrawOrg.x = -KiROUND( virtualSizeIU.x / 2.0 );
1043  screen->m_DrawOrg.y = -KiROUND( virtualSizeIU.y / 2.0 );
1044  }
1045  else
1046  {
1047  screen->m_DrawOrg.x = -KiROUND( ( virtualSizeIU.x - pageRectIU.GetWidth() ) / 2.0 );
1048  screen->m_DrawOrg.y = -KiROUND( ( virtualSizeIU.y - pageRectIU.GetHeight() ) / 2.0 );
1049  }
1050 
1051  /* Always set scrollbar pixels per unit to 1 unless you want the zoom
1052  * around cursor to jump around. This reported problem occurs when the
1053  * zoom point is not on a pixel per unit increment. If you set the
1054  * pixels per unit to 10, you have potential for the zoom point to
1055  * jump around +/-5 pixels from the nearest grid point.
1056  */
1057  screen->m_ScrollPixelsPerUnitX = screen->m_ScrollPixelsPerUnitY = 1;
1058 
1059  // Number of scroll bar units for the given zoom level in device units.
1060  double unitsX = virtualSizeIU.x * scale;
1061  double unitsY = virtualSizeIU.y * scale;
1062 
1063  // Store the requested center position for later use
1064  SetScrollCenterPosition( aCenterPositionIU );
1065 
1066  // Calculate the scroll bar position in internal units to place the
1067  // center position at the center of client rectangle.
1068  double posX = centerPositionIU.x - clientRectIU.GetWidth() / 2.0 - screen->m_DrawOrg.x;
1069  double posY = centerPositionIU.y - clientRectIU.GetHeight() / 2.0 - screen->m_DrawOrg.y;
1070 
1071  // Convert scroll bar position to device units.
1072  posX = KiROUND( posX * scale );
1073  posY = KiROUND( posY * scale );
1074 
1075  if( posX < 0 )
1076  {
1077  wxLogTrace( traceScrollSettings, wxT( "Required scroll bar X position %.10g" ), posX );
1078  posX = 0;
1079  }
1080 
1081  if( posX > unitsX )
1082  {
1083  wxLogTrace( traceScrollSettings, wxT( "Required scroll bar X position %.10g" ), posX );
1084  posX = unitsX;
1085  }
1086 
1087  if( posY < 0 )
1088  {
1089  wxLogTrace( traceScrollSettings, wxT( "Required scroll bar Y position %.10g" ), posY );
1090  posY = 0;
1091  }
1092 
1093  if( posY > unitsY )
1094  {
1095  wxLogTrace( traceScrollSettings, wxT( "Required scroll bar Y position %.10g" ), posY );
1096  posY = unitsY;
1097  }
1098 
1099  screen->m_ScrollbarPos = wxPoint( KiROUND( posX ), KiROUND( posY ) );
1100  screen->m_ScrollbarNumber = wxSize( KiROUND( unitsX ), KiROUND( unitsY ) );
1101 
1102  wxLogTrace( traceScrollSettings,
1103  wxT( "Drawing = (%.10g, %.10g), Client = (%.10g, %.10g), Offset = (%d, %d), SetScrollbars(%d, %d, %d, %d, %d, %d)" ),
1104  virtualSizeIU.x, virtualSizeIU.y, clientSizeIU.x, clientSizeIU.y,
1105  screen->m_DrawOrg.x, screen->m_DrawOrg.y,
1107  screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.y,
1108  screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.y );
1109 
1110  bool noRefresh = true;
1111 
1112  m_canvas->SetScrollbars( screen->m_ScrollPixelsPerUnitX,
1113  screen->m_ScrollPixelsPerUnitY,
1114  screen->m_ScrollbarNumber.x,
1115  screen->m_ScrollbarNumber.y,
1116  screen->m_ScrollbarPos.x,
1117  screen->m_ScrollbarPos.y, noRefresh );
1118 }
wxSize m_ScrollbarNumber
Current virtual draw area size in scroll units.
#define VIRT_MAX
max X or Y coordinate in virtual space
Definition: draw_frame.cpp:908
int m_ScrollPixelsPerUnitY
Pixels per scroll unit in the vertical direction.
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
double GetScalingFactor() const
Function GetScalingFactor returns the inverse of the current scale used to draw items on screen...
Definition: base_screen.cpp:92
#define VIRT_MIN
min X or Y coordinate in virtual space
Definition: draw_frame.cpp:907
void SetScrollCenterPosition(const wxPoint &aPoint)
Class BOX2 handles a 2-D bounding box, built on top of an origin point and size vector, both of templated class Vec.
Definition: box2.h:41
virtual const wxSize GetPageSizeIU() const =0
Function GetPageSizeIU works off of GetPageSettings() to return the size of the paper page in the int...
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
bool m_Center
Center on screen.
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
int m_ScrollPixelsPerUnitX
Pixels per scroll unit in the horizontal direction.
wxPoint m_ScrollbarPos
Current scroll bar position in scroll units.
static const wxString traceScrollSettings(wxT("KicadScrollSettings"))
Definition for enabling and disabling scroll bar setting trace output.
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
static const double MAX_AXIS
Definition: draw_frame.cpp:905
const int scale
wxPoint m_DrawOrg
offsets for drawing the circuit on the screen
#define min(a, b)
Definition: auxiliary.h:85
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 753 of file draw_frame.cpp.

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

Referenced by PCB_BASE_FRAME::Compile_Ratsnest(), LIB_EDIT_FRAME::DisplayCmpDoc(), GERBER_FILE_IMAGE::DisplayImageInfo(), PCB_EDIT_FRAME::Fill_Zone(), SCH_PRINTOUT::OnPrintPage(), SCH_EDIT_FRAME::OpenProjectFiles(), LIB_VIEW_FRAME::RedrawActiveWindow(), LIB_EDIT_FRAME::SaveActiveLibrary(), SCH_EDIT_FRAME::SaveEEFile(), PCB_EDIT_FRAME::SavePcbFile(), ShowNewTrackWhenMovingCursor(), and PCB_EDIT_FRAME::Solve().

756 {
757  if( m_messagePanel == NULL )
758  return;
759 
760  m_messagePanel->AppendMessage( textUpper, textLower, color, pad );
761 }
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:128
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
EDGE_MODULE * FOOTPRINT_EDIT_FRAME::Begin_Edge_Module ( EDGE_MODULE Edge,
wxDC *  DC,
STROKE_T  type_edge 
)

Function Begin_Edge_Module creates a new edge item (line, arc ..).

Parameters
Edge= if NULL: create new edge else terminate edge and create a new edge
DC= current Device Context
type_edge= S_SEGMENT,S_ARC ..
Returns
the new created edge.

Definition at line 322 of file edgemod.cpp.

References Abort_Move_ModuleOutline(), ArcValue, MODULE::CalculateBoundingBox(), EDA_ITEM::ClearFlags(), EDGE_MODULE::Draw(), PCB_BASE_FRAME::GetActiveLayer(), PCB_BASE_FRAME::GetBoard(), EDA_DRAW_FRAME::GetCrossHairPosition(), GetDesignSettings(), MODULE::GetOrientation(), MODULE::GetPosition(), DRAWSEGMENT::GetShape(), DRAWSEGMENT::GetStart(), EDGE_MODULE::GetStart0(), GR_OR, MODULE::GraphicalItemsList(), DLIST< T >::Insert(), IS_NEW, EDA_DRAW_FRAME::m_canvas, EDGE_MODULE::m_End0, BOARD::m_Modules, EDGE_MODULE::m_Start0, BOARD_ITEM::Next(), OnModify(), DLIST< T >::PushFront(), RotatePoint(), S_ARC, S_SEGMENT, PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), DRAWSEGMENT::SetAngle(), DRAWSEGMENT::SetEnd(), EDGE_MODULE::SetEnd0(), EDA_ITEM::SetFlags(), MODULE::SetLastEditTime(), BOARD_ITEM::SetLayer(), EDA_DRAW_PANEL::SetMouseCapture(), DRAWSEGMENT::SetShape(), DRAWSEGMENT::SetStart(), EDGE_MODULE::SetStart0(), DRAWSEGMENT::SetWidth(), ShowNewEdgeModule(), UR_CHANGED, wxPoint::x, and wxPoint::y.

Referenced by OnLeftClick().

325 {
326  MODULE* module = GetBoard()->m_Modules;
327 
328  if( module == NULL )
329  return NULL;
330 
331  if( aEdge == NULL ) // Start a new edge item
332  {
333  SaveCopyInUndoList( module, UR_CHANGED );
334 
335  aEdge = new EDGE_MODULE( module );
336  MoveVector.x = MoveVector.y = 0;
337 
338  // Add the new item to the Drawings list head
339  module->GraphicalItemsList().PushFront( aEdge );
340 
341  // Update characteristics of the segment or arc.
342  aEdge->SetFlags( IS_NEW );
343  aEdge->SetAngle( 0 );
344  aEdge->SetShape( type_edge );
345 
346  if( aEdge->GetShape() == S_ARC )
347  aEdge->SetAngle( ArcValue );
348 
349  aEdge->SetWidth( GetDesignSettings().m_ModuleSegmentWidth );
350  aEdge->SetLayer( GetActiveLayer() );
351 
352  // Initialize the starting point of the new segment or arc
353  aEdge->SetStart( GetCrossHairPosition() );
354 
355  // Initialize the ending point of the new segment or arc
356  aEdge->SetEnd( aEdge->GetStart() );
357 
358  // Initialize the relative coordinates
359  aEdge->SetStart0( aEdge->GetStart() - module->GetPosition() );
360 
361  RotatePoint( &aEdge->m_Start0, -module->GetOrientation() );
362 
363  aEdge->m_End0 = aEdge->m_Start0;
364  module->CalculateBoundingBox();
366  }
367  /* Segment creation in progress.
368  * The ending coordinate is updated by the function
369  * ShowNewEdgeModule() called on move mouse event
370  * during the segment creation
371  */
372  else
373  {
374  if( type_edge == S_SEGMENT )
375  {
376  if( aEdge->m_Start0 != aEdge->m_End0 )
377  {
378  aEdge->Draw( m_canvas, DC, GR_OR );
379 
380  EDGE_MODULE* newedge = new EDGE_MODULE( *aEdge );
381 
382  // insert _after_ aEdge, which is the same as inserting before aEdge->Next()
383  module->GraphicalItemsList().Insert( newedge, aEdge->Next() );
384  aEdge->ClearFlags();
385 
386  aEdge = newedge; // point now new item
387 
388  aEdge->SetFlags( IS_NEW );
389  aEdge->SetWidth( GetDesignSettings().m_ModuleSegmentWidth );
390  aEdge->SetStart( GetCrossHairPosition() );
391  aEdge->SetEnd( aEdge->GetStart() );
392 
393  // Update relative coordinate.
394  aEdge->SetStart0( aEdge->GetStart() - module->GetPosition() );
395 
396  wxPoint pt( aEdge->GetStart0() );
397 
398  RotatePoint( &pt, -module->GetOrientation() );
399 
400  aEdge->SetStart0( pt );
401 
402  aEdge->SetEnd0( aEdge->GetStart0() );
403 
404  module->CalculateBoundingBox();
405  module->SetLastEditTime();
406  OnModify();
407  }
408  }
409  else
410  {
411  wxMessageBox( wxT( "Begin_Edge() error" ) );
412  }
413  }
414 
415  return aEdge;
416 }
static void Abort_Move_ModuleOutline(EDA_DRAW_PANEL *Panel, wxDC *DC)
Definition: edgemod.cpp:295
BOARD_DESIGN_SETTINGS & GetDesignSettings() const override
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
void PushFront(T *aNewElement)
Function PushFront puts aNewElement at front of list sequence.
Definition: dlist.h:240
static wxPoint MoveVector
Definition: edgemod.cpp:57
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
const wxPoint & GetPosition() const override
Definition: class_module.h:155
BOARD * GetBoard() const
usual segment : line with rounded ends
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
void SetLastEditTime(time_t aTime)
Definition: class_module.h:282
static double ArcValue
Definition: edgemod.cpp:56
#define IS_NEW
New item, just created.
Definition: base_struct.h:113
BOARD_ITEM * Next() const
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:253
virtual void OnModify() override
Virtual Function OnModify() Must be called after a footprint change in order to set the "modify" flag...
double GetOrientation() const
Definition: class_module.h:160
Arcs (with rounded ends)
void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
Function SaveCopyInUndoList Creates a new entry in undo list of commands.
Definition: undo_redo.cpp:172
static void ShowNewEdgeModule(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aPosition, bool erase)
Definition: edgemod.cpp:129
Definition: gr_basic.h:42
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
DLIST< MODULE > m_Modules
Definition: class_board.h:245
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:137
void SetMouseCapture(MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback, END_MOUSE_CAPTURE_CALLBACK aEndMouseCaptureCallback)
Function SetMouseCapture sets the mouse capture and end mouse capture callbacks to aMouseCaptureCallb...
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
void Insert(T *aNewElement, T *aElementAfterMe)
Function Insert puts aNewElement just in front of aElementAfterMe in the list sequence.
Definition: dlist.h:200
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.

Definition at line 322 of file basepcbframe.cpp.

References EDA_RECT::Centre(), PCB_BASE_FRAME::GetBoardBoundingBox(), EDA_RECT::GetHeight(), EDA_RECT::GetWidth(), EDA_DRAW_FRAME::m_canvas, PCB_BASE_FRAME::m_Pcb, max, EDA_DRAW_FRAME::SetScrollCenterPosition(), VECTOR2< T >::x, and VECTOR2< T >::y.

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

323 {
324  if( m_Pcb == NULL )
325  return 1.0;
326 
327  EDA_RECT ibbbox = GetBoardBoundingBox();
328  DSIZE clientz = m_canvas->GetClientSize();
329  DSIZE boardz( ibbbox.GetWidth(), ibbbox.GetHeight() );
330 
331  double iu_per_du_X = clientz.x ? boardz.x / clientz.x : 1.0;
332  double iu_per_du_Y = clientz.y ? boardz.y / clientz.y : 1.0;
333 
334  double bestzoom = std::max( iu_per_du_X, iu_per_du_Y );
335 
336  SetScrollCenterPosition( ibbbox.Centre() );
337 
338  return bestzoom;
339 }
void SetScrollCenterPosition(const wxPoint &aPoint)
int GetHeight() const
wxPoint Centre() const
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
EDA_RECT GetBoardBoundingBox(bool aBoardEdgesOnly=false) const
Function GetBoardBoundingBox calculates the bounding box containing all board items (or board edge se...
#define max(a, b)
Definition: auxiliary.h:86
Class EDA_RECT handles the component boundary box.
int GetWidth() const
int FOOTPRINT_EDIT_FRAME::BlockCommand ( EDA_KEY  aKey)
overridevirtual

Function BlockCommand Returns 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 from EDA_DRAW_FRAME.

Definition at line 81 of file block_module_editor.cpp.

References BLOCK_DELETE, BLOCK_DUPLICATE, BLOCK_MIRROR_Y, BLOCK_MOVE, BLOCK_PRESELECT_MOVE, BLOCK_ROTATE, BLOCK_ZOOM, EDA_KEY_C, GR_KB_ALT, GR_KB_CTRL, GR_KB_SHIFT, GR_KB_SHIFTCTRL, GR_KEY_INVALID, and MOUSE_MIDDLE.

82 {
83  int cmd;
84 
85  switch( key )
86  {
87  default:
88  cmd = key & 0xFF;
89  break;
90 
91  case EDA_KEY_C( 0xffffffff ): // -1
92  // Historically, -1 has been used as a key, which can cause bit flag
93  // clashes with unaware code. On debug builds, catch any old code that
94  // might still be doing this. TODO: remove if sure all this old code is gone.
95  wxFAIL_MSG( "negative EDA_KEY value should be converted to GR_KEY_INVALID" );
96  // fall through on release builds
97 
98  case GR_KEY_INVALID:
100  break;
101 
102  case 0:
103  cmd = BLOCK_MOVE;
104  break;
105 
106  case GR_KB_ALT:
107  cmd = BLOCK_MIRROR_Y;
108  break;
109 
110  case GR_KB_SHIFTCTRL:
111  cmd = BLOCK_DELETE;
112  break;
113 
114  case GR_KB_SHIFT:
115  cmd = BLOCK_DUPLICATE;
116  break;
117 
118  case GR_KB_CTRL:
119  cmd = BLOCK_ROTATE;
120  break;
121 
122  case MOUSE_MIDDLE:
123  cmd = BLOCK_ZOOM;
124  break;
125  }
126 
127  return cmd;
128 }
#define GR_KB_ALT
Definition: common.h:65
#define GR_KEY_INVALID
Definition: common.h:69
#define GR_KB_SHIFT
Definition: common.h:66
#define GR_KB_SHIFTCTRL
Definition: common.h:67
#define MOUSE_MIDDLE
Definition: common.h:68
#define EDA_KEY_C
Definition: common.h:60
#define GR_KB_CTRL
Definition: common.h:64
void PCB_BASE_FRAME::Build_Board_Ratsnest ( )
inherited

Function Build_Board_Ratsnest.

Calculates the full ratsnest depending only on pads.

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 184 of file ratsnest.cpp.

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

Referenced by MODULE::DrawOutlinesWhenMoving(), getOptimalModulePlacement(), and PickModule().

185 {
186  auto connectivity = GetBoard()->GetConnectivity();
187 
188  movedModule = *aModule;
189  movedModule.Move( -aMoveVector );
190  connectivity->ClearDynamicRatsnest();
191  connectivity->BlockRatsnestItems( { aModule } );
192  connectivity->ComputeDynamicRatsnest( { &movedModule } );
193 }
BOARD * GetBoard() const
void Move(const wxPoint &aMoveVector) override
Function Move move this object.
static MODULE movedModule(nullptr)
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:290
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 173 of file ratsnest.cpp.

References s_refNet.

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

175 {
176  s_CursorPos = aPosition; // needed for sort_by_distance
177  s_ref = aItemRef;
178  s_refNet = aNet;
179 }
static wxPoint s_CursorPos
Definition: ratsnest.cpp:160
static int s_refNet
Definition: ratsnest.cpp:171
static BOARD_CONNECTED_ITEM * s_ref
Definition: ratsnest.cpp:170
void EDA_BASE_FRAME::CheckForAutoSaveFile ( const wxFileName &  aFileName,
const wxString &  aBackupFileExtension 
)
inherited

Function CheckForAutoSaveFile checks 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.
aBackupFileExtensionA wxString object containing the backup file extension used to create the backup file name.

Definition at line 578 of file basicframe.cpp.

References AUTOSAVE_PREFIX_FILENAME, Format(), GetChars(), Pgm(), and traceAutoSave.

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

580 {
581  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
582  wxCHECK_RET( !aBackupFileExtension.IsEmpty(), wxT( "Invalid backup file extension!" ) );
583 
584  wxFileName autoSaveFileName = aFileName;
585 
586  // Check for auto save file.
587  autoSaveFileName.SetName( AUTOSAVE_PREFIX_FILENAME + aFileName.GetName() );
588 
589  wxLogTrace( traceAutoSave,
590  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
591 
592  if( !autoSaveFileName.FileExists() )
593  return;
594 
595  wxString msg = wxString::Format( _(
596  "Well this is potentially embarrassing!\n"
597  "It appears that the last time you were editing the file\n"
598  "'%s'\n"
599  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
600  GetChars( aFileName.GetFullName() )
601  );
602 
603  int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this );
604 
605  // Make a backup of the current file, delete the file, and rename the auto save file to
606  // the file name.
607  if( response == wxYES )
608  {
609  // Get the backup file name.
610  wxFileName backupFileName = aFileName;
611  backupFileName.SetExt( aBackupFileExtension );
612 
613  // If an old backup file exists, delete it. If an old copy of the file exists, rename
614  // it to the backup file name
615  if( aFileName.FileExists() )
616  {
617  // Remove the old file backup file.
618  if( backupFileName.FileExists() )
619  wxRemoveFile( backupFileName.GetFullPath() );
620 
621  // Rename the old file to the backup file name.
622  if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath() ) )
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 traceAutoSave[]
Custom trace mask to enable and disable auto save tracing.
Definition: basicframe.cpp:53
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
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:92
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
#define AUTOSAVE_PREFIX_FILENAME
Prefix to create filenames for schematic files or other difile when auto-saved to retrieve a crash...
Definition: wxstruct.h:71
bool FOOTPRINT_EDIT_FRAME::Clear_Pcb ( bool  aQuery)

Function Clear_Pcb delete all and reinitialize the current board.

Parameters
aQuery= true to prompt user for confirmation, false to initialize silently

Definition at line 94 of file initpcb.cpp.

References BASE_SCREEN::ClearUndoRedoList(), BASE_SCREEN::ClrModify(), PCB_BASE_FRAME::GetBoard(), GetDesignSettings(), PCB_BASE_FRAME::GetPageSizeIU(), PCB_BASE_FRAME::GetScreen(), BASE_SCREEN::InitDataPoints(), IsOK(), PCB_BASE_EDIT_FRAME::SetBoard(), PCB_BASE_FRAME::SetCurItem(), BOARD::SetDesignSettings(), BOARD::SetFileName(), and EDA_DRAW_FRAME::Zoom_Automatique().

95 {
96  if( GetBoard() == NULL )
97  return false;
98 
99  if( aQuery && GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
100  {
101  if( !IsOK( this,
102  _( "Current Footprint will be lost and this operation cannot be undone. Continue ?" ) ) )
103  return false;
104  }
105 
106  // Clear undo and redo lists because we want a full deletion
108  GetScreen()->ClrModify();
109 
110  BOARD* board = new BOARD;
111 
112  // Transfer current design settings
113  if( GetBoard() )
115 
116  SetBoard( board );
117 
118  SetCurItem( NULL );
119 
120  // clear filename, to avoid overwriting an old file
121  GetBoard()->SetFileName( wxEmptyString );
122 
124 
125  Zoom_Automatique( false );
126 
127  return true;
128 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const override
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
void SetCurItem(BOARD_ITEM *aItem, bool aDisplayInfo=true)
Function SetCurItem sets the currently selected item and displays it in the MsgPanel.
BOARD * GetBoard() const
void InitDataPoints(const wxSize &aPageSizeInternalUnits)
Definition: base_screen.cpp:69
void Zoom_Automatique(bool aWarpPointer)
Function Zoom_Automatique redraws the screen with best zoom level and the best centering that shows a...
Definition: zoom.cpp:77
virtual void ClearUndoRedoList()
Function ClearUndoRedoList clear undo and redo list, using ClearUndoORRedoList() picked items are del...
void SetDesignSettings(const BOARD_DESIGN_SETTINGS &aDesignSettings)
Function SetDesignSettings.
Definition: class_board.h:542
void SetFileName(const wxString &aFileName)
Definition: class_board.h:232
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
virtual void SetBoard(BOARD *aBoard) override
>
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
const wxSize GetPageSizeIU() const override
Function GetPageSizeIU works off of GetPageSettings() to return the size of the paper page in the int...
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:129
void PCB_BASE_FRAME::ClearSelection ( )
inherited
void FOOTPRINT_EDIT_FRAME::CloseModuleEditor ( wxCommandEvent &  Event)

Definition at line 564 of file moduleframe.cpp.

565 {
566  Close();
567 }
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 56 of file ratsnest.cpp.

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::AutoPlaceModule(), PCB_EDIT_FRAME::Autoroute(), 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::Clean_Pcb(), PCB_EDIT_FRAME::Delete_Module(), PCB_EDIT_FRAME::ExportToGenCAD(), DIALOG_EXCHANGE_MODULE::OnOkClick(), 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_EDIT_FRAME::Reset_Noroutable(), PCB_BASE_FRAME::Rotate_Module(), and PCB_BASE_FRAME::TestNetConnection().

57 {
58  GetBoard()->GetConnectivity()->RecalculateRatsnest();
59 
60  GetBoard()->m_Status_Pcb = 0; // we want a full ratsnest computation, from the scratch
61 
62  if( GetBoard()->IsElementVisible( LAYER_RATSNEST ) && aDC )
63  DrawGeneralRatsnest( aDC, 0 );
64 
65  wxString msg;
66 
67  ClearMsgPanel();
68 
69  if( aDisplayStatus )
70  {
71  msg.Printf( wxT( " %d" ), m_Pcb->GetConnectivity()->GetPadCount() );
72  AppendMsgPanel( wxT( "Pads" ), msg, RED );
73  msg.Printf( wxT( " %d" ), m_Pcb->GetConnectivity()->GetNetCount() );
74  AppendMsgPanel( wxT( "Nets" ), msg, CYAN );
75  SetMsgPanel( m_Pcb );
76  }
77 }
BOARD * GetBoard() const
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Function SetMsgPanel clears the message panel and populates it with the contents of aList...
Definition: draw_frame.cpp:773
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:87
Definition: colors.h:59
Definition: colors.h:60
void AppendMsgPanel(const wxString &textUpper, const wxString &textLower, COLOR4D color, int pad=6)
Append a message to the message panel.
Definition: draw_frame.cpp:753
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:290
void ClearMsgPanel(void)
Clear all messages from the message panel.
Definition: draw_frame.cpp:764
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:237
void PCB_BASE_FRAME::ComputeLegacyConnections ( )
inherited

Function RecalculateAllTracksNetcode search connections between tracks and pads and propagate pad net codes to the track segments.

wxConfigBase * EDA_BASE_FRAME::config ( )
protectedvirtualinherited
wxString EDA_BASE_FRAME::ConfigBaseName ( )
inlineinherited

Function ConfigBaseName.

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 256 of file wxstruct.h.

References EDA_BASE_FRAME::m_configFrameName.

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

257  {
258  wxString baseCfgName = m_configFrameName.IsEmpty() ? GetName() : m_configFrameName;
259  return baseCfgName;
260  }
wxString m_configFrameName
prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTO...
Definition: wxstruct.h:133
wxString EDA_DRAW_FRAME::CoordinateToString ( int  aValue,
bool  aConvertToMils = false 
) const
inherited

Function CoordinateToString is a helper to convert the integer coordinate aValue to a string in inches or mm according to the current user units setting.

Parameters
aValueThe coordinate to convert.
aConvertToMilsConvert inch values to mils if true. This setting has no effect if the current user unit is millimeters.
Returns
The converted string for display in user interface elements.

Definition at line 812 of file draw_frame.cpp.

References CoordinateToString().

813 {
814  return ::CoordinateToString( aValue, aConvertToMils );
815 }
wxString CoordinateToString(int aValue, bool aConvertToMils)
Function CoordinateToString is a helper to convert the integer coordinate aValue to a string in inche...
Definition: base_units.cpp:117
void EDA_DRAW_FRAME::CopyToClipboard ( wxCommandEvent &  event)
inherited

Function CopyToClipboard copies the current page or the current block to the clipboard.

Definition at line 43 of file copy_to_clipboard.cpp.

References DrawPageOnClipboard(), EDA_DRAW_PANEL::EndMouseCapture(), EDA_DRAW_PANEL::GetDefaultCursor(), EDA_DRAW_FRAME::GetScreen(), ID_GEN_COPY_BLOCK_TO_CLIPBOARD, BASE_SCREEN::IsBlockActive(), and EDA_DRAW_FRAME::m_canvas.

44 {
45  DrawPageOnClipboard( this );
46 
47  if( event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD )
48  {
49  if( GetScreen()->IsBlockActive() )
50  m_canvas->SetCursor( wxCursor( (wxStockCursor) m_canvas->GetDefaultCursor() ) );
51 
53  }
54 }
void EndMouseCapture(int aId=-1, int aCursorId=-1, const wxString &aTitle=wxEmptyString, bool aCallEndFunc=true)
Function EndMouseCapture ends mouse a capture.
bool IsBlockActive() const
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
static bool DrawPageOnClipboard(EDA_DRAW_FRAME *aFrame)
int GetDefaultCursor() const
Function GetDefaultCursor.
void PCB_BASE_EDIT_FRAME::createArray ( )
protectedinherited

Function createArray Create an array of the selected item (invokes the dialogue) This function is shared between pcbnew and modedit, as it is virtually the same.

Definition at line 1703 of file edit.cpp.

References ARRAY_CREATOR::Invoke().

Referenced by PCB_EDIT_FRAME::Process_Special_Functions().

1704 {
1705  LEGACY_ARRAY_CREATOR array_creator( *this );
1706 
1707  array_creator.Invoke();
1708 }
wxString PCB_BASE_EDIT_FRAME::CreateNewLibrary ( )
inherited

Function CreateNewLibrary prompts user for a library path, then creates a new footprint library at that location.

If library exists, user is warned about that, and is given a chance to abort the new creation, and in that case existing library is first deleted.

Returns
wxString - the newly created library path if library was successfully created, else wxEmptyString because user aborted or error.

Definition at line 439 of file librairi.cpp.

References DisplayError(), FMT_LIB_READ_ONLY, FMT_OK_OVERWRITE, PLUGIN::FootprintLibCreate(), PLUGIN::FootprintLibDelete(), Format(), GetChars(), DIALOG_SELECT_PRETTY_LIB::GetFullPrettyLibName(), PLUGIN::IsFootprintLibWritable(), IsOK(), IO_MGR::KICAD, IO_MGR::PluginFind(), KIWAY_HOLDER::Prj(), and IO_ERROR::What().

Referenced by PCB_EDIT_FRAME::ArchiveModulesOnBoard().

440 {
441  // Kicad cannot write legacy format libraries, only .pretty new format
442  // because the legacy format cannot handle current features.
443  // The footprint library is actually a directory
444 
445  // prompt user for footprint library name, ending by ".pretty"
446  // Because there are constraints for the directory name to create,
447  // (the name should have the extension ".pretty", and the folder cannot be inside
448  // a footprint library), we do not use the standard wxDirDialog.
449 
450  wxString initialPath = wxPathOnly( Prj().GetProjectFullName() );
451  DIALOG_SELECT_PRETTY_LIB dlg( this, initialPath );
452 
453  if( dlg.ShowModal() != wxID_OK )
454  return wxEmptyString;
455 
456  wxString libPath = dlg.GetFullPrettyLibName();
457 
458  // We can save fp libs only using IO_MGR::KICAD format (.pretty libraries)
460 
461  try
462  {
463  PLUGIN::RELEASER pi( IO_MGR::PluginFind( piType ) );
464 
465  bool writable = false;
466  bool exists = false;
467 
468  try
469  {
470  writable = pi->IsFootprintLibWritable( libPath );
471  exists = true; // no exception was thrown, lib must exist.
472  }
473  catch( const IO_ERROR& )
474  {
475  // ignore, original values of 'writable' and 'exists' are accurate.
476  }
477 
478  if( exists )
479  {
480  if( !writable )
481  {
482  wxString msg = wxString::Format( FMT_LIB_READ_ONLY, GetChars( libPath ) );
483  DisplayError( this, msg );
484  return wxEmptyString;
485  }
486  else
487  {
488  wxString msg = wxString::Format( FMT_OK_OVERWRITE, GetChars( libPath ) );
489 
490  if( !IsOK( this, msg ) )
491  return wxEmptyString;
492 
493  pi->FootprintLibDelete( libPath );
494  }
495  }
496 
497  pi->FootprintLibCreate( libPath );
498  }
499  catch( const IO_ERROR& ioe )
500  {
501  DisplayError( this, ioe.What() );
502  return wxEmptyString;
503  }
504 
505  return libPath;
506 }
Class RELEASER releases a PLUGIN in the context of a potential thrown exception, through its destruct...
Definition: io_mgr.h:474
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
S-expression Pcbnew file format.
Definition: io_mgr.h:54
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
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:92
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
static PLUGIN * PluginFind(PCB_FILE_T aFileType)
Function PluginFind returns a PLUGIN which the caller can use to import, export, save, or load design documents.
Definition: io_mgr.cpp:58
#define FMT_LIB_READ_ONLY
Definition: librairi.cpp:69
PCB_FILE_T
Enum PCB_FILE_T is a set of file types that the IO_MGR knows about, and for which there has been a pl...
Definition: io_mgr.h:51
#define FMT_OK_OVERWRITE
Definition: librairi.cpp:60
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:129
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 747 of file librairi.cpp.

References BOARD::Add(), DisplayInfoMessage(), FMT_MOD_CREATE, FMT_MOD_REF, FMT_NO_REF_ABORTED, PCB_BASE_FRAME::GetBoard(), PCB_BASE_FRAME::GetDesignSettings(), BOARD_DESIGN_SETTINGS::m_ModuleTextSize, BOARD_DESIGN_SETTINGS::m_ModuleTextWidth, 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(), MODULE::SetLastEditTime(), BOARD_ITEM::SetLayer(), EDA_DRAW_FRAME::SetMsgPanel(), TEXTE_MODULE::SetPosition(), MODULE::SetReference(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetThickness(), MODULE::SetValue(), EDA_TEXT::SetVisible(), ToLAYER_ID(), MODULE::Value(), and wxPoint::y.

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

748 {
749  // Creates a new footprint at position 0,0 which contains the minimal items:
750  // the reference and the value.
751  // Value : initialized to the footprint name.
752  // put on fab layer (front side)
753  // Reference : initialized to a default value (REF**).
754  // put on silkscreen layer (front side)
755 
756  wxString moduleName = aModuleName;
757 
758  // Ask for the new module name
759  if( moduleName.IsEmpty() )
760  {
761  wxTextEntryDialog dlg( this, FMT_MOD_REF, FMT_MOD_CREATE, moduleName );
762  dlg.SetTextValidator( FILE_NAME_CHAR_VALIDATOR( &moduleName ) );
763 
764  if( dlg.ShowModal() != wxID_OK )
765  return NULL; //Aborted by user
766  }
767 
768  moduleName.Trim( true );
769  moduleName.Trim( false );
770 
771  if( moduleName.IsEmpty() )
772  {
774  return NULL;
775  }
776 
777  // Creates the new module and add it to the head of the linked list of modules
778  MODULE* module = new MODULE( GetBoard() );
779 
780  GetBoard()->Add( module );
781 
782  // Update parameters: timestamp ...
783  module->SetLastEditTime();
784 
785  // Update its name in lib
786  module->SetFPID( LIB_ID( moduleName ) );
787 
788  wxPoint default_pos;
790 
791  // Update reference:
792  if( settings.m_RefDefaultText.IsEmpty() )
793  module->SetReference( moduleName );
794  else
795  module->SetReference( settings.m_RefDefaultText );
796 
797  module->Reference().SetThickness( settings.m_ModuleTextWidth );
798  module->Reference().SetTextSize( settings.m_ModuleTextSize );
799  default_pos.y = GetDesignSettings().m_ModuleTextSize.y / 2;
800  module->Reference().SetPosition( default_pos );
801  module->Reference().SetLayer( ToLAYER_ID( settings.m_RefDefaultlayer ) );
802  module->Reference().SetVisible( settings.m_RefDefaultVisibility );
803 
804  // Set the value field to a default value
805  if( settings.m_ValueDefaultText.IsEmpty() )
806  module->SetValue( moduleName );
807  else
808  module->SetValue( settings.m_ValueDefaultText );
809 
810  module->Value().SetThickness( GetDesignSettings().m_ModuleTextWidth );
811  module->Value().SetTextSize( GetDesignSettings().m_ModuleTextSize );
812  default_pos.y = -default_pos.y;
813  module->Value().SetPosition( default_pos );
814  module->Value().SetLayer( ToLAYER_ID( settings.m_ValueDefaultlayer ) );
815  module->Value().SetVisible( settings.m_ValueDefaultVisibility );
816 
817  SetMsgPanel( module );
818  return module;
819 }
wxString m_RefDefaultText
Default ref text on fp creation.
bool m_ValueDefaultVisibility
Default value text visibility on fp creation.
TEXTE_MODULE & Reference()
Definition: class_module.h:463
#define FMT_MOD_REF
Definition: librairi.cpp:73
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
int m_ModuleTextWidth
Default footprint texts thickness.
#define FMT_MOD_CREATE
Definition: librairi.cpp:76
void SetVisible(bool aVisible)
Definition: eda_text.h:175
BOARD * GetBoard() const
int m_ValueDefaultlayer
Default value text layer on fp creation.
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:214
Class LIB_ID.
Definition: lib_id.h:56
wxSize m_ModuleTextSize
Default footprint texts size.
void SetLastEditTime(time_t aTime)
Definition: class_module.h:282
Class FILE_NAME_CHAR_VALIDATOR.
Definition: validators.h:43
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Function SetMsgPanel clears the message panel and populates it with the contents of aList...
Definition: draw_frame.cpp:773
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:462
#define FMT_NO_REF_ABORTED
Definition: librairi.cpp:79
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_INSERT) override
Adds an item to the container.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString aExtraInfo)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:102
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:429
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:456
int m_RefDefaultlayer
Default ref text layer on fp creation.
bool m_RefDefaultVisibility
Default ref text visibility on fp creation.
void SetFPID(const LIB_ID &aFPID)
Definition: class_module.h:165
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:767
void SetThickness(int aNewThickness)
Function SetThickness sets pen width.
Definition: eda_text.h:148
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.
TEXTE_MODULE * FOOTPRINT_EDIT_FRAME::CreateTextModule ( MODULE aModule,
wxDC *  aDC 
)
protected

Creates a new text for the footprint.

Parameters
aModuleis the owner of the text
aDCis the current DC (can be NULL )
Returns
a pointer to the new text, or NULL if aborted

Definition at line 66 of file edtxtmod.cpp.

References LSET::AllTechMask(), Clamp_Text_PenSize(), EDA_ITEM::ClearFlags(), TEXTE_MODULE::Draw(), PCB_BASE_FRAME::GetActiveLayer(), EDA_DRAW_FRAME::GetCrossHairPosition(), GetDesignSettings(), EDA_TEXT::GetText(), GR_OR, MODULE::GraphicalItemsList(), PCB_BASE_FRAME::InstallTextModOptionsFrame(), IS_NEW, EDA_DRAW_FRAME::m_canvas, BOARD_DESIGN_SETTINGS::m_ModuleTextWidth, min, EDA_DRAW_PANEL::MoveCursorToCrossHair(), DLIST< T >::PushFront(), EDA_ITEM::SetFlags(), BOARD_ITEM::SetLayer(), EDA_DRAW_FRAME::SetMsgPanel(), TEXTE_MODULE::SetPosition(), EDA_TEXT::SetTextSize(), and EDA_TEXT::SetThickness().

Referenced by OnLeftClick().

67 {
68  TEXTE_MODULE* text = new TEXTE_MODULE( aModule );
69 
70  text->SetFlags( IS_NEW );
71 
73  std::min( GetDesignSettings().m_ModuleTextSize.x, GetDesignSettings().m_ModuleTextSize.y ), true );
74  text->SetTextSize( GetDesignSettings().m_ModuleTextSize );
75  text->SetThickness( GetDesignSettings().m_ModuleTextWidth );
77 
78  if( LSET::AllTechMask().test( GetActiveLayer() ) ) // i.e. a possible layer for a text
79  text->SetLayer( GetActiveLayer() );
80 
81  InstallTextModOptionsFrame( text, NULL );
82 
84 
85  if( text->GetText().IsEmpty() )
86  {
87  delete text;
88  return NULL;
89  }
90 
91  // Add the new text object to the beginning of the footprint draw list.
92  if( aModule )
93  aModule->GraphicalItemsList().PushFront( text );
94 
95  text->ClearFlags();
96 
97  if( aDC )
98  text->Draw( m_canvas, aDC, GR_OR );
99 
100  SetMsgPanel( text );
101 
102  return text;
103 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const override
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
void PushFront(T *aNewElement)
Function PushFront puts aNewElement at front of list sequence.
Definition: dlist.h:240
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
int m_ModuleTextWidth
Default footprint texts thickness.
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:214
void MoveCursorToCrossHair()
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
Definition: draw_panel.cpp:348
static LSET AllTechMask()
Function AllTechMask returns a mask holding all technical layers (no CU layer) on both side...
Definition: lset.cpp:709
#define IS_NEW
New item, just created.
Definition: base_struct.h:113
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:253
void InstallTextModOptionsFrame(TEXTE_MODULE *TextMod, wxDC *DC)
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Function SetMsgPanel clears the message panel and populates it with the contents of aList...
Definition: draw_frame.cpp:773
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:130
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aBold)
Function Clamp_Text_PenSize As a rule, pen width should not be >1/4em, otherwise the character will b...
Definition: drawtxt.cpp:67
virtual void SetPosition(const wxPoint &aPos) override
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw Draw the text according to the footprint pos and orient.
Definition: gr_basic.h:42
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:254
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:137
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
void SetThickness(int aNewThickness)
Function SetThickness sets pen width.
Definition: eda_text.h:148
#define min(a, b)
Definition: auxiliary.h:85
const PCB_GENERAL_SETTINGS& PCB_BASE_FRAME::CSettings ( ) const
inlineinherited

Definition at line 714 of file wxBasePcbFrame.h.

References PCB_BASE_FRAME::m_configSettings.

715  {
716  return m_configSettings;
717  }
PCB_GENERAL_SETTINGS m_configSettings
void PCB_BASE_FRAME::CursorGoto ( const wxPoint aPos,
bool  aWarp = true 
)
inherited

Function CursorGoto positions the cursor at a given coordinate and reframes the drawing if the requested point is out of view.

Parameters
aPosis the point to go to.
aWarpis true if the pointer should be warped to the new position.

Definition at line 342 of file basepcbframe.cpp.

References EDA_DRAW_PANEL::CrossHairOff(), EDA_DRAW_PANEL::CrossHairOn(), INSTALL_UNBUFFERED_DC, EDA_DRAW_PANEL::IsPointOnDisplay(), EDA_DRAW_FRAME::m_canvas, EDA_DRAW_PANEL::MoveCursorToCrossHair(), EDA_DRAW_FRAME::RedrawScreen(), and EDA_DRAW_FRAME::SetCrossHairPosition().

Referenced by DIALOG_FIND::onButtonFindItemClick(), DIALOG_FIND::onButtonFindMarkerClick(), DIALOG_DRC_CONTROL::OnLeftDClickClearance(), DIALOG_DRC_CONTROL::OnLeftDClickUnconnected(), DIALOG_DRC_CONTROL::OnMarkerSelectionEvent(), DIALOG_DRC_CONTROL::OnPopupMenu(), and DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent().

343 {
344  // factored out of pcbnew/find.cpp
345 
347 
348  // There may be need to reframe the drawing.
349  if( !m_canvas->IsPointOnDisplay( aPos ) )
350  {
351  SetCrossHairPosition( aPos );
352  RedrawScreen( aPos, aWarp );
353  }
354  else
355  {
356  // Put cursor on item position
357  m_canvas->CrossHairOff( &dc );
358  SetCrossHairPosition( aPos );
359 
360  if( aWarp )
362  }
363  m_canvas->CrossHairOn( &dc );
364  m_canvas->CrossHairOn( &dc );
365 }
void MoveCursorToCrossHair()
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
Definition: draw_panel.cpp:348
bool IsPointOnDisplay(const wxPoint &aPosition)
Function IsPointOnDisplay.
Definition: draw_panel.cpp:288
void CrossHairOff(wxDC *DC)
Definition: draw_panel.cpp:253
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
Function RedrawScreen redraws the entire screen area by updating the scroll bars and mouse pointer in...
Definition: zoom.cpp:46
void CrossHairOn(wxDC *DC)
Definition: draw_panel.cpp:260
#define INSTALL_UNBUFFERED_DC(name, parent)
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
void FOOTPRINT_EDIT_FRAME::Delete_Edge_Module ( EDGE_MODULE Edge)

Function Delete_Edge_Module deletes EDGE_MODULE Edge.

Parameters
Edge= edge to delete

Definition at line 272 of file edgemod.cpp.

References MODULE::CalculateBoundingBox(), BOARD_ITEM::DeleteStructure(), DisplayError(), BOARD_ITEM::GetParent(), OnModify(), PCB_MODULE_EDGE_T, MODULE::SetLastEditTime(), and EDA_ITEM::Type().

Referenced by RemoveStruct().

273 {
274  if( aEdge == NULL )
275  return;
276 
277  if( aEdge->Type() != PCB_MODULE_EDGE_T )
278  {
279  DisplayError( this, wxT( "StructType error: PCB_MODULE_EDGE_T expected" ) );
280  return;
281  }
282 
283  MODULE* module = (MODULE*) aEdge->GetParent();
284 
285  // Delete segment.
286  aEdge->DeleteStructure();
287  module->SetLastEditTime();
288  module->CalculateBoundingBox();
289  OnModify();
290 }
BOARD_ITEM_CONTAINER * GetParent() const
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
void DeleteStructure()
Function DeleteStructure deletes this object after UnLink()ing it from its owner if it has one...
void SetLastEditTime(time_t aTime)
Definition: class_module.h:282
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:106
virtual void OnModify() override
Virtual Function OnModify() Must be called after a footprint change in order to set the "modify" flag...
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
bool FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary ( )

Function DeleteModuleFromCurrentLibrary prompts user for footprint name, then deletes it from current library.

Definition at line 509 of file librairi.cpp.

References DisplayError(), DisplayInfoMessage(), FP_LIB_TABLE::FindRow(), FMT_MOD_DELETED, FMT_OK_DELETE, FP_LIB_TABLE::FootprintDelete(), Format(), GetChars(), GetCurrentLib(), LIB_TABLE_ROW::GetFullURI(), LIB_ID::GetLibItemName(), IO_MGR::GuessPluginTypeFromLibPath(), INFO_LEGACY_LIB_WARN_DELETE(), IsOK(), IO_MGR::LEGACY, PROJECT::PcbFootprintLibs(), KIWAY_HOLDER::Prj(), PCB_BASE_FRAME::SelectFootprint(), and IO_ERROR::What().

510 {
511  wxString nickname = GetCurrentLib();
512 
513  // Legacy libraries are readable, but modifying legacy format is not allowed
514  // So prompt the user if he try to delete a footprint from a legacy lib
515  wxString libfullname = Prj().PcbFootprintLibs()->FindRow(nickname)->GetFullURI();
517 
518  if( piType == IO_MGR::LEGACY )
519  {
521  return false;
522  }
523 
524  if( !Prj().PcbFootprintLibs()->IsFootprintLibWritable( nickname ) )
525  {
526  wxString msg = wxString::Format(
527  _( "Library '%s' is read only" ),
528  GetChars( nickname )
529  );
530 
531  DisplayError( this, msg );
532  return false;
533  }
534 
535  wxString fpid_txt = PCB_BASE_FRAME::SelectFootprint( this, nickname,
536  wxEmptyString, wxEmptyString, Prj().PcbFootprintLibs() );
537 
538  if( !fpid_txt )
539  return false;
540 
541  LIB_ID fpid( fpid_txt );
542  wxString fpname = fpid.GetLibItemName();
543 
544  // Confirmation
545  wxString msg = wxString::Format( FMT_OK_DELETE, fpname.GetData(), nickname.GetData() );
546 
547  if( !IsOK( this, msg ) )
548  return false;
549 
550  try
551  {
552  Prj().PcbFootprintLibs()->FootprintDelete( nickname, fpname );
553  }
554  catch( const IO_ERROR& ioe )
555  {
556  DisplayError( this, ioe.What() );
557  return false;
558  }
559 
560  msg.Printf( FMT_MOD_DELETED, fpname.GetData(), nickname.GetData() );
561 
562  SetStatusText( msg );
563 
564  return true;
565 }
static const wxString INFO_LEGACY_LIB_WARN_DELETE(_("Modifying legacy libraries (.mod files) is not allowed\n""Please save the current library under the new .pretty format\n""and update your footprint lib table\n""before deleting a footprint"))
Class LIB_ID.
Definition: lib_id.h:56
#define FMT_OK_DELETE
Definition: librairi.cpp:62
static PCB_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath)
Function GuessPluginTypeFromLibPath returns a plugin type given a footprint library's libPath...
Definition: io_mgr.cpp:182
const wxString GetFullURI(bool aSubstituted=false) const
Function GetFullURI.
const wxString GetCurrentLib() const
Return the current library nickname.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString aExtraInfo)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:102
VTBL_ENTRY FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Function FindRow.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
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:92
Legacy Pcbnew file formats prior to s-expression.
Definition: io_mgr.h:53
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
#define FMT_MOD_DELETED
Definition: librairi.cpp:75
void FootprintDelete(const wxString &aNickname, const wxString &aFootprintName)
Function FootprintDelete.
PCB_FILE_T
Enum PCB_FILE_T is a set of file types that the IO_MGR knows about, and for which there has been a pl...
Definition: io_mgr.h:51
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:129
wxString SelectFootprint(EDA_DRAW_FRAME *aWindow, const wxString &aLibraryName, const wxString &aMask, const wxString &aKeyWord, FP_LIB_TABLE *aTable)
Function SelectFootprint displays a list of modules found in all libraries or a given library...
Definition: loadcmp.cpp:362
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 155 of file pad_edition_functions.cpp.

References MODULE::CalculateBoundingBox(), PCB_BASE_FRAME::GetBoard(), MODULE::GetBoundingBox(), GetChars(), 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(), and RemoveStruct().

156 {
157  if( aPad == NULL )
158  return;
159 
160  MODULE* module = aPad->GetParent();
161  module->SetLastEditTime();
162 
163  // aQuery = true to prompt for confirmation, false to delete silently
164  if( aQuery )
165  {
166  wxString msg;
167  msg.Printf( _( "Delete Pad (footprint %s %s) ?" ),
168  GetChars( module->GetReference() ),
169  GetChars( module->GetValue() ) );
170 
171  if( !IsOK( this, msg ) )
172  return;
173  }
174 
175  // Stores the initial bounding box to refresh the old area
176  EDA_RECT bbox = module->GetBoundingBox();
177 
178  m_Pcb->m_Status_Pcb = 0;
179 
180  GetBoard()->PadDelete( aPad );
181 
182  // Update the bounding box
183  module->CalculateBoundingBox();
184 
185  // Refresh the modified screen area, using the initial bounding box
186  // which is perhaps larger than the new bounding box
187  m_canvas->RefreshDrawingRect( bbox );
188 
189  OnModify();
190 }
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.
MODULE * GetParent() const
Definition: class_pad.h:108
BOARD * GetBoard() const
const wxString & GetValue() const
Function GetValue.
Definition: class_module.h:447
void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
Definition: draw_panel.cpp:306
void SetLastEditTime(time_t aTime)
Definition: class_module.h:282
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
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:92
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:419
Class EDA_RECT handles the component boundary box.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:129
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:237
void PCB_BASE_FRAME::DeleteTextModule ( TEXTE_MODULE Text)
inherited

Definition at line 139 of file edtxtmod.cpp.

References BOARD_ITEM::DeleteStructure(), TEXTE_MODULE::GetBoundingBox(), BOARD_ITEM::GetParent(), TEXTE_MODULE::GetType(), EDA_DRAW_FRAME::m_canvas, PCB_BASE_FRAME::OnModify(), EDA_DRAW_PANEL::RefreshDrawingRect(), MODULE::SetLastEditTime(), and TEXTE_MODULE::TEXT_is_DIVERS.

Referenced by PCB_EDIT_FRAME::Process_Special_Functions(), and RemoveStruct().

140 {
141  MODULE* Module;
142 
143  if( Text == NULL )
144  return;
145 
146  Module = static_cast<MODULE*>( Text->GetParent() );
147 
148  if( Text->GetType() == TEXTE_MODULE::TEXT_is_DIVERS )
149  {
151  Text->DeleteStructure();
152  OnModify();
153  Module->SetLastEditTime();
154  }
155 }
BOARD_ITEM_CONTAINER * GetParent() const
TEXT_TYPE GetType() const
void DeleteStructure()
Function DeleteStructure deletes this object after UnLink()ing it from its owner if it has one...
void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
Definition: draw_panel.cpp:306
void SetLastEditTime(time_t aTime)
Definition: class_module.h:282
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
void KIWAY_PLAYER::DismissModal ( bool  aRetVal,
const wxString &  aResult = wxEmptyString 
)
protectedinherited
void EDA_DRAW_FRAME::DisplayUnitsMsg ( )
inherited

Function DisplayUnitsMsg displays current unit pane on the status bar.

Definition at line 503 of file draw_frame.cpp.

References g_UserUnit, INCHES, and MILLIMETRES.

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

504 {
505  wxString msg;
506 
507  switch( g_UserUnit )
508  {
509  case INCHES:
510  msg = _( "Inches" );
511  break;
512 
513  case MILLIMETRES:
514  msg = _( "mm" );
515  break;
516 
517  default:
518  msg = _( "Units" );
519  break;
520  }
521 
522  SetStatusText( msg, 4 );
523 }
Definition: common.h:145
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
void FOOTPRINT_EDIT_FRAME::DlgGlobalChange_PadSettings ( D_PAD aPad)

Function DlgGlobalChange_PadSettings changes pad characteristics for the given footprint or all footprints which look like the given footprint.

Options are set by the opened dialog.

Parameters
aPadis the pattern. The given footprint is the parent of this pad

Definition at line 94 of file globaleditpad.cpp.

References DisplayError(), GetDesignSettings(), D_PAD::GetParent(), PCB_BASE_FRAME::GlobalChange_PadSettings(), DIALOG_GLOBAL_PADS_EDITION_BASE::m_buttonIdModules, DIALOG_GLOBAL_PADS_EDITION::m_Pad_Layer_Filter, BOARD_DESIGN_SETTINGS::m_Pad_Master, DIALOG_GLOBAL_PADS_EDITION::m_Pad_Orient_Filter, DIALOG_GLOBAL_PADS_EDITION::m_Pad_Shape_Filter, and EDA_DRAW_FRAME::SetMsgPanel().

95 {
96  int diag;
97 
98  if( aPad == NULL )
100 
101  MODULE* module = aPad->GetParent();
102 
103  if( module == NULL )
104  {
105  DisplayError( this, wxT( "Global_Import_Pad_Settings() Error: NULL module" ) );
106  return;
107  }
108 
109  SetMsgPanel( module );
110 
111  {
112  DIALOG_GLOBAL_PADS_EDITION dlg( this, aPad );
113 
114  dlg.m_buttonIdModules->Enable( false );
115 
116  diag = dlg.ShowModal();
117  }
118 
119  if( diag == -1 )
120  return;
121 
122  bool edit_Same_Modules = false;
123  if( diag == 1 )
124  edit_Same_Modules = true;
125 
126  GlobalChange_PadSettings( aPad, edit_Same_Modules,
130  true, false );
131 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const override
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
MODULE * GetParent() const
Definition: class_pad.h:108
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Function SetMsgPanel clears the message panel and populates it with the contents of aList...
Definition: draw_frame.cpp:773
void GlobalChange_PadSettings(D_PAD *aPad, bool aSameFootprints, bool aPadShapeFilter, bool aPadOrientFilter, bool aPadLayerFilter, bool aRedraw, bool aSaveForUndo)
Function GlobalChange_PadSettings Function to change pad caracteristics for the given footprint or al...
D_PAD m_Pad_Master
A dummy pad to store all default parameters.
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

Function doAutoSave 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 231 of file basicframe.cpp.

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

232 {
233  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
234 }
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 87 of file ratsnest.cpp.

References color, PCB_GENERAL_SETTINGS::Colors(), DO_NOT_SHOW_GENERAL_RASTNEST, EDA_DRAW_PANEL::GetClipBox(), BOARD::GetConnectivity(), RN_NET::GetEdges(), COLORS_DESIGN_SETTINGS::GetItemColor(), GRLine(), 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::OnPlaceOrRouteFootprints(), PCB_EDIT_FRAME::RedrawActiveWindow(), PCB_BASE_FRAME::Rotate_Module(), and PCB_EDIT_FRAME::StartMoveModule().

88 {
90  {
91  return;
92  }
93 
94  if( aDC == NULL )
95  return;
96 
97  auto connectivity = m_Pcb->GetConnectivity();
98 
100 
101  for( int i = 1; i < connectivity->GetNetCount(); ++i )
102  {
103  RN_NET* net = connectivity->GetRatsnestForNet( i );
104 
105  if( !net )
106  continue;
107 
108  if( ( aNetcode <= 0 ) || ( aNetcode == i ) )
109  {
110  for( const auto& edge : net->GetEdges() )
111  {
112  auto s = edge.GetSourcePos();
113  auto d = edge.GetTargetPos();
114  auto sn = edge.GetSourceNode();
115  auto dn = edge.GetTargetNode();
116 
117  bool enable = !sn->GetNoLine() && !dn->GetNoLine();
118  bool show = sn->Parent()->GetLocalRatsnestVisible()
119  || dn->Parent()->GetLocalRatsnestVisible();
120 
121  if( enable && show )
122  GRLine( m_canvas->GetClipBox(), aDC, wxPoint( s.x, s.y ), wxPoint( d.x,
123  d.y ), 0, color );
124  }
125  }
126  }
127 }
const std::vector< CN_EDGE > & GetEdges() const
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
Definition: gr_basic.cpp:352
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
PCB_GENERAL_SETTINGS & Settings()
EDA_RECT * GetClipBox()
COLORS_DESIGN_SETTINGS & Colors()
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
Class RN_NET Describes ratsnest for a single net.
Definition: ratsnest_data.h:59
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:290
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:237
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void EDA_DRAW_FRAME::DrawWorkSheet ( wxDC *  aDC,
BASE_SCREEN aScreen,
int  aLineWidth,
double  aScale,
const wxString &  aFilename,
const wxString &  aSheetLayer = wxEmptyString 
)
inherited

Function DrawWorkSheet 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 77 of file worksheet.cpp.

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, WHITE, wxPoint::x, and wxPoint::y.

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

80 {
82  return;
83 
84  const PAGE_INFO& pageInfo = GetPageSettings();
85  wxSize pageSize = pageInfo.GetSizeMils();
86 
87  // if not printing, draw the page limits:
88  if( !aScreen->m_IsPrinting && m_showPageLimits )
89  {
90  GRSetDrawMode( aDC, GR_COPY );
91  GRRect( m_canvas->GetClipBox(), aDC, 0, 0,
92  pageSize.x * aScalar, pageSize.y * aScalar, aLineWidth,
94  }
95 
96  TITLE_BLOCK t_block = GetTitleBlock();
97  COLOR4D color = COLOR4D( RED );
98 
99  wxPoint origin = aDC->GetDeviceOrigin();
100 
101  if( aScreen->m_IsPrinting && origin.y > 0 )
102  {
103  aDC->SetDeviceOrigin( 0, 0 );
104  aDC->SetAxisOrientation( true, false );
105  }
106 
107  DrawPageLayout( aDC, m_canvas->GetClipBox(), pageInfo,
108  GetScreenDesc(), aFilename, t_block,
109  aScreen->m_NumberOfScreens, aScreen->m_ScreenNumber,
110  aLineWidth, aScalar, color, color, aSheetLayer );
111 
112  if( aScreen->m_IsPrinting && origin.y > 0 )
113  {
114  aDC->SetDeviceOrigin( origin.x, origin.y );
115  aDC->SetAxisOrientation( true, true );
116  }
117 }
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:290
virtual const TITLE_BLOCK & GetTitleBlock() const =0
COLOR4D m_drawBgColor
the background color of the draw canvas BLACK for Pcbnew, BLACK or WHITE for eeschema ...
Definition: draw_frame.h:83
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout, or editing view.
const wxSize & GetSizeMils() const
virtual const PAGE_INFO & GetPageSettings() const =0
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
Definition: gr_basic.cpp:1077
virtual wxString GetScreenDesc() const
Definition: worksheet.cpp:120
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:112
EDA_RECT * GetClipBox()
Definition: colors.h:60
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
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...
Definition: worksheet.cpp:49
bool m_showPageLimits
true to display the page limits
Definition: draw_frame.h:81
Definition: colors.h:49
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void PCB_BASE_EDIT_FRAME::duplicateItem ( BOARD_ITEM aItem,
bool  aIncrement 
)
protectedinherited

Function duplicateItem Duplicate the specified item This function is shared between pcbnew and modedit, as it is virtually the same.

Parameters
aItemthe item to duplicate
aIncrement(has meaning only for pads in footprint editor): increment pad name if appropriate

Definition at line 1619 of file edit.cpp.

References BLOCK_DUPLICATE, BLOCK_DUPLICATE_AND_INCREMENT, EDA_DRAW_FRAME::GetCrossHairPosition(), BLOCK_SELECTOR::GetItems(), PCB_BASE_FRAME::GetScreen(), EDA_ITEM::GetState(), EDA_DRAW_FRAME::HandleBlockBegin(), EDA_DRAW_FRAME::HandleBlockEnd(), INSTALL_UNBUFFERED_DC, BASE_SCREEN::m_BlockLocate, EDA_DRAW_FRAME::m_canvas, EDA_DRAW_PANEL::MoveCursorToCrossHair(), PICKED_ITEMS_LIST::PushItem(), EDA_RECT::SetEnd(), ITEM_PICKER::SetItem(), BLOCK_SELECTOR::SetLastCursorPosition(), STATE_NO_BLOCK, and UR_UNSPECIFIED.

Referenced by PCB_EDIT_FRAME::duplicateItems(), and duplicateItems().

1620 {
1621  if( !aItem )
1622  return;
1623 
1624  // The easiest way to handle a duplicate item command
1625  // is to simulate a block copy command, which gives us the undo management
1626  // for free
1627  if( GetScreen()->m_BlockLocate.GetState() == STATE_NO_BLOCK )
1628  {
1630 
1632 
1633  wxPoint crossHairPos = GetCrossHairPosition();
1634 
1635  const BLOCK_COMMAND_T blockType = aIncrement ? BLOCK_DUPLICATE_AND_INCREMENT : BLOCK_DUPLICATE;
1636 
1637  if( !HandleBlockBegin( &dc, blockType, crossHairPos ) )
1638  return;
1639 
1640  // Add the item to the block copy pick list:
1642  ITEM_PICKER picker( NULL, UR_UNSPECIFIED );
1643 
1644  picker.SetItem ( aItem );
1645  itemsList.PushItem( picker );
1646 
1647  // Set 2 coordinates updated by the mouse, because our simulation
1648  // does not use the mouse to call HandleBlockEnd()
1649  GetScreen()->m_BlockLocate.SetLastCursorPosition( crossHairPos );
1650  GetScreen()->m_BlockLocate.SetEnd( crossHairPos );
1651  HandleBlockEnd( &dc );
1652  }
1653 }
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
BLOCK_COMMAND_T
void PushItem(const ITEM_PICKER &aItem)
Function PushItem pushes aItem to the top of the list.
void MoveCursorToCrossHair()
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
Definition: draw_panel.cpp:348
int GetState(int type) const
Definition: base_struct.h:237
virtual bool HandleBlockBegin(wxDC *aDC, EDA_KEY aKey, const wxPoint &aPosition, int aExplicitCommand=0)
Initialize a block command.
Definition: draw_frame.cpp:823
void SetEnd(int x, int y)
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
virtual bool HandleBlockEnd(wxDC *DC)
Function HandleBlockEnd( ) Handle the "end" of a block command, i.e.
Definition: draw_frame.cpp:663
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
#define INSTALL_UNBUFFERED_DC(name, parent)
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
PICKED_ITEMS_LIST & GetItems()
void SetLastCursorPosition(const wxPoint &aPosition)
Function SetLastCursorPosition sets the last cursor position to aPosition.
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
void FOOTPRINT_EDIT_FRAME::duplicateItems ( bool  aIncrement)
overrideprivatevirtual

Function duplicateItems Duplicate the item under the cursor.

Parameters
aIncrementincrement the number of pad (if that is what is selected)

Implements PCB_BASE_EDIT_FRAME.

Definition at line 872 of file modedit.cpp.

References PCB_BASE_EDIT_FRAME::duplicateItem().

873 {
874  BOARD_ITEM* item = GetScreen()->GetCurItem();
875 
876  PCB_BASE_EDIT_FRAME::duplicateItem( item, aIncrement );
877 }
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
void duplicateItem(BOARD_ITEM *aItem, bool aIncrement)
Function duplicateItem Duplicate the specified item This function is shared between pcbnew and modedi...
Definition: edit.cpp:1619
BOARD_ITEM * GetCurItem() const
Function GetCurItem returns the currently selected BOARD_ITEM, overriding BASE_SCREEN::GetCurItem().
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
void FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer ( EDGE_MODULE Edge)

Function Edit_Edge_Layer changes the EDGE_MODULE Edge layer, (The new layer will be asked) if Edge == NULL change the layer of the entire footprint edges.

Parameters
Edge= edge to edit, or NULL

Definition at line 191 of file edgemod.cpp.

References MODULE::CalculateBoundingBox(), dyn_cast(), Edge_Cuts, F_SilkS, PCB_BASE_FRAME::GetBoard(), BOARD_ITEM::GetLayer(), MODULE::GraphicalItemsList(), IsCopperLayer(), IsOK(), BOARD::m_Modules, BOARD_ITEM::Next(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), PCB_BASE_FRAME::SelectLayer(), MODULE::SetLastEditTime(), BOARD_ITEM::SetLayer(), and UR_CHANGED.

192 {
193  // note: if aEdge == NULL, all outline segments will be modified
194 
195  MODULE* module = GetBoard()->m_Modules;
196  PCB_LAYER_ID layer = F_SilkS;
197  bool modified = false;
198 
199  if( aEdge )
200  layer = aEdge->GetLayer();
201 
202  // Ask for the new layer
203  PCB_LAYER_ID new_layer = SelectLayer( layer, Edge_Cuts );
204 
205  if( layer < 0 )
206  return;
207 
208  if( IsCopperLayer( new_layer ) )
209  {
210  // an edge is put on a copper layer, and it is very dangerous.
211  // A confirmation is requested
212  if( !IsOK( this,
213  _( "The graphic item will be on a copper layer.\n"
214  "This is very dangerous. Are you sure?" ) ) )
215  return;
216  }
217 
218  if( !aEdge )
219  {
220  for( BOARD_ITEM *item = module->GraphicalItemsList() ; item != NULL;
221  item = item->Next() )
222  {
223  aEdge = dyn_cast<EDGE_MODULE*>( item );
224 
225  if( aEdge && (aEdge->GetLayer() != new_layer) )
226  {
227  if( ! modified ) // save only once
228  SaveCopyInUndoList( module, UR_CHANGED );
229  aEdge->SetLayer( new_layer );
230  modified = true;
231  }
232  }
233  }
234  else if( aEdge->GetLayer() != new_layer )
235  {
236  SaveCopyInUndoList( module, UR_CHANGED );
237  aEdge->SetLayer( new_layer );
238  modified = true;
239  }
240 
241  if( modified )
242  {
243  module->CalculateBoundingBox();
244  module->SetLastEditTime();
245  }
246 }
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
BOARD * GetBoard() const
void SetLastEditTime(time_t aTime)
Definition: class_module.h:282
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:73
BOARD_ITEM * Next() const
PCB_LAYER_ID
A quick note on layer IDs:
void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
Function SaveCopyInUndoList Creates a new entry in undo list of commands.
Definition: undo_redo.cpp:172
DLIST< MODULE > m_Modules
Definition: class_board.h:245
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:137
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:129
PCB_LAYER_ID SelectLayer(PCB_LAYER_ID aDefaultLayer, LSET aNotAllowedLayersMask=LSET(), wxPoint aDlgPosition=wxDefaultPosition)
Install the dialog box for layer selection.
Definition: sel_layer.cpp:221
void FOOTPRINT_EDIT_FRAME::Edit_Edge_Width ( EDGE_MODULE aEdge)

Function Edit_Edge_Width changes the width of module perimeter lines, EDGE_MODULEs.

param ModuleSegmentWidth (global) = new width

Parameters
aEdge= edge to edit, or NULL. If aEdge == NULL change the width of all footprint's edges

Definition at line 162 of file edgemod.cpp.

References MODULE::CalculateBoundingBox(), dyn_cast(), PCB_BASE_FRAME::GetBoard(), GetDesignSettings(), MODULE::GraphicalItemsList(), BOARD::m_Modules, BOARD_ITEM::Next(), OnModify(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), MODULE::SetLastEditTime(), DRAWSEGMENT::SetWidth(), and UR_CHANGED.

163 {
164  MODULE* module = GetBoard()->m_Modules;
165 
166  SaveCopyInUndoList( module, UR_CHANGED );
167 
168  if( aEdge == NULL )
169  {
170  aEdge = (EDGE_MODULE*) (BOARD_ITEM*) module->GraphicalItemsList();
171 
172  for( BOARD_ITEM *item = module->GraphicalItemsList(); item; item = item->Next() )
173  {
174  aEdge = dyn_cast<EDGE_MODULE*>( item );
175 
176  if( aEdge )
177  aEdge->SetWidth( GetDesignSettings().m_ModuleSegmentWidth );
178  }
179  }
180  else
181  {
182  aEdge->SetWidth( GetDesignSettings().m_ModuleSegmentWidth );
183  }
184 
185  OnModify();
186  module->CalculateBoundingBox();
187  module->SetLastEditTime();
188 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const override
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
BOARD * GetBoard() const
void SetLastEditTime(time_t aTime)
Definition: class_module.h:282
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:73
BOARD_ITEM * Next() const
virtual void OnModify() override
Virtual Function OnModify() Must be called after a footprint change in order to set the "modify" flag...
void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
Function SaveCopyInUndoList Creates a new entry in undo list of commands.
Definition: undo_redo.cpp:172
DLIST< MODULE > m_Modules
Definition: class_board.h:245
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:137
void SetWidth(int aWidth)
void PCB_BASE_FRAME::Edit_Module ( MODULE module,
wxDC *  DC 
)
inherited
bool EDA_BASE_FRAME::Enable ( bool  enable)
overrideinherited

Definition at line 192 of file basicframe.cpp.

Referenced by OnUpdateLoadModuleFromBoard(), and KIWAY_PLAYER::ShowModal().

193 {
194  // so we can do logging of this state change:
195 
196 #if defined(DEBUG)
197  const char* type_id = typeid( *this ).name();
198  printf( "wxFrame %-28s: %s\n", type_id, enable ? "enabled" : "disabled" );
199 #endif
200 
201  return wxFrame::Enable( enable );
202 }
void FOOTPRINT_EDIT_FRAME::End_Edge_Module ( EDGE_MODULE Edge)

Function End_Edge_Module terminates a move or create edge function.

Definition at line 419 of file edgemod.cpp.

References MODULE::CalculateBoundingBox(), EDA_ITEM::ClearFlags(), BOARD_ITEM::DeleteStructure(), PCB_BASE_FRAME::GetBoard(), DRAWSEGMENT::GetEnd(), DRAWSEGMENT::GetStart(), EDA_DRAW_FRAME::m_canvas, BOARD::m_Modules, OnModify(), MODULE::SetLastEditTime(), and EDA_DRAW_PANEL::SetMouseCapture().

Referenced by OnLeftClick(), and OnLeftDClick().

420 {
421  MODULE* module = GetBoard()->m_Modules;
422 
423  if( aEdge )
424  {
425  aEdge->ClearFlags();
426 
427  // If last segment length is 0: remove it
428  if( aEdge->GetStart() == aEdge->GetEnd() )
429  aEdge->DeleteStructure();
430  }
431 
432  module->CalculateBoundingBox();
433  module->SetLastEditTime();
434  OnModify();
435  m_canvas->SetMouseCapture( NULL, NULL );
436 }
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
BOARD * GetBoard() const
void SetLastEditTime(time_t aTime)
Definition: class_module.h:282
virtual void OnModify() override
Virtual Function OnModify() Must be called after a footprint change in order to set the "modify" flag...
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
DLIST< MODULE > m_Modules
Definition: class_board.h:245
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:254
void SetMouseCapture(MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback, END_MOUSE_CAPTURE_CALLBACK aEndMouseCaptureCallback)
Function SetMouseCapture sets the mouse capture and end mouse capture callbacks to aMouseCaptureCallb...
void FOOTPRINT_EDIT_FRAME::Enter_Edge_Width ( EDGE_MODULE aEdge)

Function Enter_Edge_Width Edition of width of module outlines Ask for a new width.

Change the width of EDGE_MODULE Edge if aEdge != NULL

Parameters
aEdge= edge to edit, or NULL changes ModuleSegmentWidth (global) = new width

Definition at line 249 of file edgemod.cpp.

References MODULE::CalculateBoundingBox(), g_UserUnit, PCB_BASE_FRAME::GetBoard(), GetDesignSettings(), BOARD::m_Modules, BOARD_DESIGN_SETTINGS::m_ModuleSegmentWidth, OnModify(), DRAWSEGMENT::SetWidth(), StringFromValue(), and ValueFromString().

250 {
251  wxString buffer;
252 
253  buffer = StringFromValue( g_UserUnit, GetDesignSettings().m_ModuleSegmentWidth );
254  wxTextEntryDialog dlg( this, _( "New Width:" ), _( "Edge Width" ), buffer );
255 
256  if( dlg.ShowModal() != wxID_OK )
257  return; // canceled by user
258 
259  buffer = dlg.GetValue( );
261 
262  if( aEdge )
263  {
264  MODULE* module = GetBoard()->m_Modules;
265  aEdge->SetWidth( GetDesignSettings().m_ModuleSegmentWidth );
266  module->CalculateBoundingBox();
267  OnModify();
268  }
269 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const override
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
int m_ModuleSegmentWidth
Default width for all graphic lines.
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:203
BOARD * GetBoard() const
virtual void OnModify() override
Virtual Function OnModify() Must be called after a footprint change in order to set the "modify" flag...
int ValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application...
Definition: base_units.cpp:368
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
DLIST< MODULE > m_Modules
Definition: class_board.h:245
void SetWidth(int aWidth)
void EDA_DRAW_FRAME::EraseMsgBox ( )
inherited

Definition at line 250 of file draw_frame.cpp.

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

Referenced by GERBVIEW_FRAME::SetCurItem(), and PCB_EDIT_FRAME::Solve().

251 {
252  if( m_messagePanel )
254 }
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:128
void EraseMsgBox()
Definition: msgpanel.cpp:215
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 320 of file draw_frame.h.

Referenced by EDA_DRAW_FRAME::OnSockRequest().

320 {}
void FOOTPRINT_EDIT_FRAME::Export_Module ( MODULE aModule)

Function Export_Module Create a file containing only one footprint.

Used to export a footprint Exported files have the standard ext .emp This is the same format as .mod files but restricted to only one footprint So Create a new lib (which will contains one module) and export a footprint is basically the same thing

Parameters
aModule= the module to export

Definition at line 338 of file librairi.cpp.

References EDA_BASE_FRAME::config(), CTL_FOR_LIBRARY, DisplayError(), DisplayInfoMessage(), EXPORT_IMPORT_LASTPATH_KEY, FMT_EXPORT_MODULE, FMT_EXPORTED, PCB_IO::Format(), Format(), GetChars(), MODULE::GetFPID(), LIB_ID::GetLibItemName(), PCB_IO::GetStringOutput(), KiCadFootprintFileExtension, KiCadFootprintLibFileWildcard, Kiface(), KIFACE_I::KifaceSettings(), EDA_BASE_FRAME::m_mruPath, and IO_ERROR::What().

339 {
340  wxFileName fn;
341  wxConfigBase* config = Kiface().KifaceSettings();
342 
343  if( !aModule )
344  return;
345 
346  fn.SetName( aModule->GetFPID().GetLibItemName() );
347 
348  wxString wildcard = wxGetTranslation( KiCadFootprintLibFileWildcard );
349 
350  fn.SetExt( KiCadFootprintFileExtension );
351 
352  if( config )
353  {
354  wxString path;
355  config->Read( EXPORT_IMPORT_LASTPATH_KEY, &path, m_mruPath );
356  fn.SetPath( path );
357  }
358 
359  wxFileDialog dlg( this, FMT_EXPORT_MODULE, fn.GetPath(), fn.GetFullName(),
360  wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
361 
362  if( dlg.ShowModal() == wxID_CANCEL )
363  return;
364 
365  fn = dlg.GetPath();
366 
367  if( config ) // Save file path
368  {
369  config->Write( EXPORT_IMPORT_LASTPATH_KEY, fn.GetPath() );
370  }
371 
372  try
373  {
374  // Export as *.kicad_pcb format, using a strategy which is specifically chosen
375  // as an example on how it could also be used to send it to the system clipboard.
376 
377  PCB_IO pcb_io( CTL_FOR_LIBRARY );
378 
379  /* This module should *already* be "normalized" in a way such that
380  orientation is zero, etc., since it came from module editor.
381 
382  module->SetTimeStamp( 0 );
383  module->SetParent( 0 );
384  module->SetOrientation( 0 );
385  */
386 
387  pcb_io.Format( aModule );
388 
389  FILE* fp = wxFopen( dlg.GetPath(), wxT( "wt" ) );
390 
391  if( fp == NULL )
392  {
393  wxMessageBox( wxString::Format(
394  _( "Unable to create or write file '%s'" ),
395  GetChars( dlg.GetPath() ) ) );
396  return;
397  }
398 
399  fprintf( fp, "%s", pcb_io.GetStringOutput( false ).c_str() );
400  fclose( fp );
401  }
402  catch( const IO_ERROR& ioe )
403  {
404  DisplayError( this, ioe.What() );
405  return;
406  }
407 
408  wxString msg = wxString::Format( FMT_EXPORTED, GetChars( dlg.GetPath() ) );
409  DisplayInfoMessage( this, msg );
410 }
const wxString KiCadFootprintFileExtension
Class PCB_IO is a PLUGIN derivation for saving and loading Pcbnew s-expression formatted files...
wxString m_mruPath
Most recently used path.
Definition: wxstruct.h:156
const wxString KiCadFootprintLibFileWildcard
virtual wxConfigBase * config()
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
Definition: basicframe.cpp:361
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
const LIB_ID & GetFPID() const
Definition: class_module.h:164
#define FMT_EXPORT_MODULE
Definition: librairi.cpp:71
const UTF8 & GetLibItemName() const
Function GetLibItemName.
Definition: lib_id.h:129
#define EXPORT_IMPORT_LASTPATH_KEY
Definition: librairi.cpp:97
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:103
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString aExtraInfo)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:102
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
#define CTL_FOR_LIBRARY
Format output for a footprint library instead of clipboard or BOARD.
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:92
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
#define FMT_EXPORTED
Definition: librairi.cpp:74
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:71
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
void PCB_BASE_FRAME::Export_Pad_Settings ( D_PAD aPad)
inherited

Definition at line 46 of file pad_edition_functions.cpp.

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

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

Function ExportHotkeyConfigToFile 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 (extention not needed) like eechema, kicad...

Definition at line 768 of file hotkeys_basic.cpp.

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

Referenced by KICAD_MANAGER_FRAME::Process_Config(), LIB_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Config(), PL_EDITOR_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), GERBVIEW_FRAME::Process_Config(), and ProcessPreferences().

770 {
771  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
772  wxString mask = wxT( "*." ) + ext;
773 
774 #if 0
775  wxString path = wxPathOnly( Prj().GetProjectFullName() );
776 #else
777  wxString path = GetMruPath();
778 #endif
779  wxFileName fn( aDefaultShortname );
780  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
781 
782  wxString filename = EDA_FILE_SELECTOR( _( "Write Hotkey Configuration File:" ),
783  path,
784  fn.GetFullPath(),
785  ext,
786  mask,
787  this,
788  wxFD_SAVE,
789  true );
790 
791  if( filename.IsEmpty() )
792  return;
793 
794  WriteHotkeyConfig( aDescList, &filename );
795  SetMruPath( wxFileName( filename ).GetPath() );
796 }
void SetMruPath(const wxString &aPath)
Definition: wxstruct.h:357
PROJECT & Prj()
Definition: kicad.cpp:293
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)
Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mec...
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
wxString GetMruPath() const
Definition: wxstruct.h:359
bool FOOTPRINT_EDIT_FRAME::GeneralControl ( wxDC *  aDC,
const wxPoint aPosition,
EDA_KEY  aHotKey = 0 
)
overridevirtual

Function GeneralControl performs 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.

Reimplemented from EDA_DRAW_FRAME.

Definition at line 730 of file moduleframe.cpp.

References EDA_DRAW_FRAME::GeneralControlKeyMovement(), EDA_DRAW_FRAME::GetCrossHairPosition(), EDA_DRAW_FRAME::m_movingCursorWithKeyboard, OnHotKey(), EDA_DRAW_FRAME::RefreshCrossHair(), EDA_DRAW_FRAME::SetCrossHairPosition(), and PCB_BASE_FRAME::UpdateStatusBar().

731 {
732  bool eventHandled = true;
733 
734  // Filter out the 'fake' mouse motion after a keyboard movement
735  if( !aHotKey && m_movingCursorWithKeyboard )
736  {
738  return false;
739  }
740 
741  // when moving mouse, use the "magnetic" grid, unless the shift+ctrl keys is pressed
742  // for next cursor position
743  // ( shift or ctrl key down are PAN command with mouse wheel)
744  bool snapToGrid = true;
745 
746  if( !aHotKey && wxGetKeyState( WXK_SHIFT ) && wxGetKeyState( WXK_CONTROL ) )
747  snapToGrid = false;
748 
749  wxPoint oldpos = GetCrossHairPosition();
750  wxPoint pos = aPosition;
751  GeneralControlKeyMovement( aHotKey, &pos, snapToGrid );
752 
753  SetCrossHairPosition( pos, snapToGrid );
754  RefreshCrossHair( oldpos, aPosition, aDC );
755 
756  if( aHotKey )
757  {
758  eventHandled = OnHotKey( aDC, aHotKey, aPosition );
759  }
760 
761  UpdateStatusBar();
762 
763  return eventHandled;
764 }
void RefreshCrossHair(const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC *aDC)
bool OnHotKey(wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
Function OnHotKey handle hot key events.
virtual void UpdateStatusBar() override
Function UpdateStatusBar updates the status bar information.
void GeneralControlKeyMovement(int aHotKey, wxPoint *aPos, bool aSnapToGrid)
Function GeneralControlKeyMovement Handle the common part of GeneralControl dedicated to global curso...
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
bool m_movingCursorWithKeyboard
One-shot to avoid a recursive mouse event during hotkey movement.
Definition: draw_frame.h:138
void EDA_DRAW_FRAME::GeneralControlKeyMovement ( int  aHotKey,
wxPoint aPos,
bool  aSnapToGrid 
)
protectedinherited

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

cursor movement by keyboard)

Definition at line 1281 of file draw_frame.cpp.

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, EDA_DRAW_PANEL::MoveCursor(), wxPoint::x, and wxPoint::y.

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

1283 {
1284 
1285  // If requested snap the current position to the grid
1286  if( aSnapToGrid )
1287  *aPos = GetNearestGridPosition( *aPos );
1288 
1289  switch( aHotKey )
1290  {
1291  // All these keys have almost the same treatment
1292  case GR_KB_CTRL | WXK_NUMPAD8:
1293  case GR_KB_CTRL | WXK_UP:
1294  case GR_KB_CTRL | WXK_NUMPAD2:
1295  case GR_KB_CTRL | WXK_DOWN:
1296  case GR_KB_CTRL | WXK_NUMPAD4:
1297  case GR_KB_CTRL | WXK_LEFT:
1298  case GR_KB_CTRL | WXK_NUMPAD6:
1299  case GR_KB_CTRL | WXK_RIGHT:
1300  case WXK_NUMPAD8:
1301  case WXK_UP:
1302  case WXK_NUMPAD2:
1303  case WXK_DOWN:
1304  case WXK_NUMPAD4:
1305  case WXK_LEFT:
1306  case WXK_NUMPAD6:
1307  case WXK_RIGHT:
1308  {
1309  /* Here's a tricky part: when doing cursor key movement, the
1310  * 'previous' point should be taken from memory, *not* from the
1311  * freshly computed position in the event. Otherwise you can't do
1312  * sub-pixel movement. The m_movingCursorWithKeyboard oneshot 'eats'
1313  * the automatic motion event generated by cursor warping */
1314  wxRealPoint gridSize = GetScreen()->GetGridSize();
1315  *aPos = GetCrossHairPosition();
1316 
1317  // Bonus: ^key moves faster (x10)
1318  switch( aHotKey )
1319  {
1320  case GR_KB_CTRL|WXK_NUMPAD8:
1321  case GR_KB_CTRL|WXK_UP:
1322  aPos->y -= KiROUND( 10 * gridSize.y );
1323  break;
1324 
1325  case GR_KB_CTRL|WXK_NUMPAD2:
1326  case GR_KB_CTRL|WXK_DOWN:
1327  aPos->y += KiROUND( 10 * gridSize.y );
1328  break;
1329 
1330  case GR_KB_CTRL|WXK_NUMPAD4:
1331  case GR_KB_CTRL|WXK_LEFT:
1332  aPos->x -= KiROUND( 10 * gridSize.x );
1333  break;
1334 
1335  case GR_KB_CTRL|WXK_NUMPAD6:
1336  case GR_KB_CTRL|WXK_RIGHT:
1337  aPos->x += KiROUND( 10 * gridSize.x );
1338  break;
1339 
1340  case WXK_NUMPAD8:
1341  case WXK_UP:
1342  aPos->y -= KiROUND( gridSize.y );
1343  break;
1344 
1345  case WXK_NUMPAD2:
1346  case WXK_DOWN:
1347  aPos->y += KiROUND( gridSize.y );
1348  break;
1349 
1350  case WXK_NUMPAD4:
1351  case WXK_LEFT:
1352  aPos->x -= KiROUND( gridSize.x );
1353  break;
1354 
1355  case WXK_NUMPAD6:
1356  case WXK_RIGHT:
1357  aPos->x += KiROUND( gridSize.x );
1358  break;
1359 
1360  default: /* Can't happen since we entered the statement */
1361  break;
1362  }
1363  m_canvas->MoveCursor( *aPos );
1365  }
1366  break;
1367 
1368  default:
1369  break;
1370  }
1371 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
void MoveCursor(const wxPoint &aPosition)
Function MoveCursor moves the mouse pointer to aPosition in logical (drawing) units.
Definition: draw_panel.cpp:354
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
wxPoint GetNearestGridPosition(const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
Function GetNearestGridPosition returns the nearest aGridSize location to aPosition.
const wxRealPoint & GetGridSize() const
Return the grid size of the currently selected grid.
#define GR_KB_CTRL
Definition: common.h:64
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
bool m_movingCursorWithKeyboard
One-shot to avoid a recursive mouse event during hotkey movement.
Definition: draw_frame.h:138
EDA_3D_VIEWER * PCB_BASE_FRAME::Get3DViewerFrame ( )
inherited
Returns
a reference to the 3D viewer frame, when exists, or NULL

Definition at line 128 of file basepcbframe.cpp.

References VIEWER3D_FRAMENAME.

Referenced by DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow(), OnModify(), PCB_EDIT_FRAME::OpenProjectFiles(), DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), FOOTPRINT_VIEWER_FRAME::Update3D_Frame(), FOOTPRINT_WIZARD_FRAME::Update3D_Frame(), FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME(), and FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME().

129 {
130  // return the 3D viewer frame, when exists, or NULL
131  return dynamic_cast<EDA_3D_VIEWER*>
132  ( wxWindow::FindWindowByName( VIEWER3D_FRAMENAME ) );
133 }
Class EDA_3D_VIEWER Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard...
Definition: eda_3d_viewer.h:50
#define VIEWER3D_FRAMENAME
Definition: eda_3d_viewer.h:44
virtual PCB_LAYER_ID PCB_BASE_FRAME::GetActiveLayer ( ) const
inlinevirtualinherited

Function GetActiveLayer returns the active layer.

Definition at line 637 of file wxBasePcbFrame.h.

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

Referenced by PCB_EDIT_FRAME::Begin_DrawSegment(), Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::CreateTextePcb(), CreateTextModule(), PCB_EDIT_FRAME::Delete_Segment(), DRAWING_TOOL::DrawVia(), PCB_EDIT_FRAME::EditDimension(), PCB_BASE_FRAME::GetCollectorsGuide(), DRAWING_TOOL::getDrawingLayer(), SELECTION_TOOL::guessSelectionCandidates(), PCBNEW_CONTROL::HighContrastMode(), DIALOG_NON_COPPER_ZONES_EDITOR::Init(), PCB_EDIT_FRAME::InstallPcbGlobalDeleteFrame(), PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), PCBNEW_CONTROL::LayerNext(), PCBNEW_CONTROL::LayerPrev(), PCBNEW_CONTROL::LayerToggle(), 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_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_BASE_FRAME::SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), and ROUTER_TOOL::switchLayerOnViaPlacement().

638  {
639  return GetScreen()->m_Active_Layer;
640  }
PCB_LAYER_ID m_Active_Layer
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 215 of file wxstruct.h.

References EDA_BASE_FRAME::m_autoSaveInterval.

Referenced by DIALOG_GENERALOPTIONS::init(), and SCH_EDIT_FRAME::OnPreferencesOptions().

215 { return m_autoSaveInterval; }
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:149
const wxPoint & PCB_BASE_FRAME::GetAuxOrigin ( ) const
overridevirtualinherited

Function GetAuxOrigin returns the origin of the axis used for plotting and various exports.

Implements EDA_DRAW_FRAME.

Definition at line 212 of file basepcbframe.cpp.

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

Referenced by CreateHeaderInfoData(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), PCB_EDIT_FRAME::DoGenFootprintsPositionFile(), PCB_EDIT_FRAME::ExportToGenCAD(), DIALOG_MOVE_EXACT::OnOkClick(), and DIALOG_GENDRILL::SetParams().

213 {
214  wxASSERT( m_Pcb );
215  return m_Pcb->GetAuxOrigin();
216 }
const wxPoint & GetAuxOrigin() const
Definition: class_board.h:343
BOARD* PCB_BASE_FRAME::GetBoard ( ) const
inlineinherited

Definition at line 184 of file wxBasePcbFrame.h.

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(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), PCB_EDIT_FRAME::Attribut_net(), PCB_EDIT_FRAME::Attribut_Track(), PCB_EDIT_FRAME::AutoPlaceModule(), PCB_EDIT_FRAME::Autoroute(), PCB_EDIT_FRAME::Begin_DrawSegment(), Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Zone(), 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_Net_Tracks_And_Vias_Sizes(), PCB_EDIT_FRAME::Change_Side_Module(), DIALOG_EXCHANGE_MODULE::changeAllFootprints(), DIALOG_EXCHANGE_MODULE::changeSameFootprints(), PCB_EDIT_FRAME::Clean_Pcb(), 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_FREEROUTE::createDSN_File(), DIALOG_GEN_MODULE_POSITION::CreateFiles(), CreateHeaderInfoData(), PCB_BASE_FRAME::CreateNewModule(), PCB_EDIT_FRAME::createPopupMenuForTracks(), 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_OldZone_Fill(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Zone_Contour(), PCB_BASE_FRAME::DeletePad(), DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR(), DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL(), DIALOG_GENDRILL::DIALOG_GENDRILL(), DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PADS_MASK_CLEARANCE::DIALOG_PADS_MASK_CLEARANCE(), DIALOG_SELECT_NET_FROM_LIST::DIALOG_SELECT_NET_FROM_LIST(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), PCB_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::DoGenFootprintsPositionFile(), PCB_EDIT_FRAME::DoGenFootprintsReport(), DrawMovingBlockOutlines(), drawPickedItems(), DRC::DRC(), EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::duplicateZone(), Edit_Edge_Layer(), Edit_Edge_Width(), PCB_EDIT_FRAME::Edit_Track_Width(), PCB_EDIT_FRAME::Edit_Zone_Params(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::End_Edge(), End_Edge_Module(), PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::End_Zone(), Enter_Edge_Width(), PCB_EDIT_FRAME::EraseRedundantTrack(), 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::Fill_All_Zones(), PCB_EDIT_FRAME::Fill_Zone(), PCB_EDIT_FRAME::GenD356File(), DIALOG_GENDRILL::GenDrillAndMapFiles(), PCB_EDIT_FRAME::GenFootprintsReport(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), GetBoard(), EDA_3D_VIEWER::GetBoard(), GAL_ARRAY_CREATOR::getBoard(), LEGACY_ARRAY_CREATOR::getBoard(), GetDesignSettings(), PCB_LAYER_BOX_SELECTOR::getEnabledLayers(), PCB_BASE_FRAME::GetFootprintFromBoardByReference(), PCB_LAYER_SELECTOR::GetLayerName(), PCB_LAYER_BOX_SELECTOR::GetLayerName(), GetModel(), GAL_ARRAY_CREATOR::getModule(), getOptimalModulePlacement(), PCB_EDIT_FRAME::GetProjectFileParameters(), HandleBlockEnd(), PCB_EDIT_FRAME::HandleBlockEnd(), HandleBlockPlace(), PCB_EDIT_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HighLight(), Import_Module(), DIALOG_GENERALOPTIONS::init(), DIALOG_NON_COPPER_ZONES_EDITOR::Init(), DIALOG_KEEPOUT_AREA_PROPERTIES::initDialog(), DIALOG_COPPER_ZONE::initDialog(), DIALOG_DESIGN_RULES::InitDialogRules(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), DIALOG_GENDRILL::InitDisplayParams(), DIALOG_PRINT_USING_PRINTER::initValues(), PCB_EDIT_FRAME::InstallNetlistFrame(), InvokeDXFDialogBoardImport(), IsElementVisible(), PCB_LAYER_SELECTOR::IsLayerEnabled(), PCB_LAYER_BOX_SELECTOR::IsLayerEnabled(), PCB_EDIT_FRAME::ListNetsAndSelect(), Load_Module_From_BOARD(), PCB_EDIT_FRAME::LockModule(), Magnetize(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit(), DIALOG_DRC_CONTROL::OnActivateDlg(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), DIALOG_FIND::onButtonFindItemClick(), DIALOG_FIND::onButtonFindMarkerClick(), DIALOG_PADS_MASK_CLEARANCE::OnButtonOkClick(), OnCloseWindow(), DIALOG_NETLIST::OnCompileRatsnestClick(), PCB_EDIT_FRAME::OnExportIDF3(), PCB_EDIT_FRAME::OnExportSTEP(), PCB_EDIT_FRAME::OnExportVRML(), DIALOG_GENDRILL::OnGenReportFile(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_LAYER_WIDGET::OnLayerVisible(), OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_EXCHANGE_MODULE::OnOkClick(), DIALOG_GRAPHIC_ITEMS_OPTIONS::OnOkClick(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick(), DIALOG_DIMENSION_EDITOR::OnOKClick(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_MODULE_POSITION::OnOutputDirectoryBrowseClicked(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), DIALOG_NETLIST::OnReadNetlistFileClick(), PCB_LAYER_WIDGET::OnRenderEnable(), PCB_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnSelectTool(), DIALOG_DRC_CONTROL::OnStartdrcClick(), DIALOG_NETLIST::OnTestFootprintsClick(), PCB_BASE_FRAME::OnTogglePadDrawMode(), OnUpdateInsertModuleInBoard(), OnUpdateLibAndModuleSelected(), OnUpdateLoadModuleFromBoard(), OnUpdateModuleSelected(), OnUpdateReplaceModuleInBoard(), PCB_EDIT_FRAME::OnUpdateShowBoardRatsnest(), OnUpdateVerticalToolbar(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::Other_Layer_Route(), DIALOG_UPDATE_PCB::PerformUpdate(), PickModule(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), PCB_BASE_FRAME::PlaceModule(), DIALOG_PLOT::Plot(), PrintPage(), PCB_EDIT_FRAME::PrintPage(), PCB_EDIT_FRAME::Process_Config(), Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_EXCHANGE_MODULE::RebuildCmpList(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow(), FOOTPRINT_VIEWER_FRAME::RedrawActiveWindow(), RedrawActiveWindow(), FOOTPRINT_WIZARD_FRAME::RedrawActiveWindow(), PCB_EDIT_FRAME::RedrawActiveWindow(), PCB_LAYER_WIDGET::ReFill(), PCB_LAYER_WIDGET::ReFillRender(), 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_EDIT_FRAME::Reset_All_Tracks_And_Vias_To_Netclass_Values(), PCB_EDIT_FRAME::Reset_Noroutable(), PCB_BASE_FRAME::ResetModuleTextSizes(), restoreLastFootprint(), retainLastFootprint(), PCB_BASE_FRAME::Rotate_Module(), DRC::RunTests(), SaveCurrentModule(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), SWAP_LAYERS_DIALOG::Sel_Layer(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), PCB_BASE_FRAME::SelectCopperLayerPair(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), PCB_EDIT_FRAME::SelectHighLight(), PCB_BASE_FRAME::SelectLayer(), DIALOG_GLOBAL_DELETION::SetCurrentLayer(), SetDesignSettings(), DIALOG_DRC_CONTROL::SetDrcParmeters(), SetElementVisibility(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), setupTools(), 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(), PCB_LAYER_WIDGET::SyncRenderStates(), PCB_BASE_FRAME::TraceAirWiresToTargets(), PCB_BASE_FRAME::TraceModuleRatsNest(), DialogEditModuleText::TransferDataToWindow(), DRC::updatePointers(), FOOTPRINT_VIEWER_FRAME::updateView(), updateView(), DIALOG_NETLIST::verifyFootprints(), and DIALOG_DRC_CONTROL::writeReport().

185  {
186  wxASSERT( m_Pcb );
187  return m_Pcb;
188  }
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 296 of file basepcbframe.cpp.

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 PCB_BASE_FRAME::BestZoom().

297 {
298  wxASSERT( m_Pcb );
299 
300  EDA_RECT area = aBoardEdgesOnly ? m_Pcb->GetBoardEdgesBoundingBox() : m_Pcb->GetBoundingBox();
301 
302  if( area.GetWidth() == 0 && area.GetHeight() == 0 )
303  {
304  wxSize pageSize = GetPageSizeIU();
305 
307  {
308  area.SetOrigin( 0, 0 );
309  area.SetEnd( pageSize.x, pageSize.y );
310  }
311  else
312  {
313  area.SetOrigin( -pageSize.x / 2, -pageSize.y / 2 );
314  area.SetEnd( pageSize.x / 2, pageSize.y / 2 );
315  }
316  }
317 
318  return area;
319 }
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: class_board.h:785
int GetHeight() const
void SetOrigin(const wxPoint &pos)
const EDA_RECT GetBoardEdgesBoundingBox() const
Function GetBoardEdgesBoundingBox Returns the board bounding box calculated using exclusively the boa...
Definition: class_board.h:797
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:112
void SetEnd(int x, int y)
Class EDA_RECT handles the component boundary box.
int GetWidth() const
const wxSize GetPageSizeIU() const override
Function GetPageSizeIU works off of GetPageSettings() to return the size of the paper page in the int...
EDA_DRAW_PANEL* EDA_DRAW_FRAME::GetCanvas ( )
inlineinherited

Definition at line 299 of file draw_frame.h.

References EDA_DRAW_FRAME::m_canvas.

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), AddNewTrace(), Autoroute_One_Track(), SCH_EDIT_FRAME::DeleteAnnotation(), PLEDITOR_PRINTOUT::DrawPage(), SCH_PRINTOUT::DrawPage(), BOARD_PRINTOUT_CONTROLLER::DrawPage(), DrawPageOnClipboard(), SCH_EDIT_FRAME::EditComponent(), LEGACY_ARRAY_CREATOR::finalise(), getOptimalModulePlacement(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), DIALOG_DISPLAY_OPTIONS::initOptDialog(), InstallBlockCmdFrame(), SCH_EDIT_FRAME::InstallConfigFrame(), SCH_EDIT_FRAME::KiwayMailIn(), SCH_EDIT_FRAME::MirrorSheet(), PROPERTIES_FRAME::OnAcceptPrms(), DIALOG_ANNOTATE::OnApplyClick(), SCH_EDIT_FRAME::OnAutoplaceFields(), DIALOG_FIND::onButtonFindItemClick(), DIALOG_FIND::onButtonFindMarkerClick(), DIALOG_LABEL_EDITOR::OnCancelClick(), DIALOG_ERC::OnEraseDrcMarkersClick(), SCH_EDIT_FRAME::OnHotKey(), 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(), SCH_EDIT_FRAME::OnLeftDClick(), DIALOG_DISPLAY_OPTIONS::OnOKBUttonClick(), DIALOG_GENERALOPTIONS::OnOkClick(), DIALOG_EXCHANGE_MODULE::OnOkClick(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick(), DIALOG_PAGES_SETTINGS::OnOkClick(), TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick(), DIALOG_DIMENSION_EDITOR::OnOKClick(), GERBER_LAYER_WIDGET::onPopupSelection(), PCB_LAYER_WIDGET::OnRenderColorChange(), GERBER_LAYER_WIDGET::OnRenderColorChange(), PCB_LAYER_WIDGET::OnRenderEnable(), GERBER_LAYER_WIDGET::OnRenderEnable(), PROPERTIES_FRAME::OnSetDefaultValues(), LIB_EDIT_FRAME::OnShowElectricalType(), PCB_EDIT_FRAME::OpenProjectFiles(), DIALOG_UPDATE_PCB::PerformUpdate(), SCH_FIELD::Place(), DIALOG_DRC_CONTROL::RedrawDrawPanel(), Refresh(), PCB_BASE_FRAME::ResetModuleTextSizes(), SCH_EDIT_FRAME::RotateHierarchicalSheet(), PCB_BASE_FRAME::SetFastGrid1(), PCB_BASE_FRAME::SetFastGrid2(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), PCB_BASE_FRAME::SetNextGrid(), PCB_BASE_FRAME::SetPrevGrid(), DIALOG_ERC::TestErc(), DIALOG_LABEL_EDITOR::TextPropertiesAccept(), WIDGET_EESCHEMA_COLOR_CONFIG::TransferDataFromControl(), DIALOG_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow(), DialogEditModuleText::TransferDataFromWindow(), DIALOG_PCB_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow(), DIALOG_MODULE_BOARD_EDITOR::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings().

299 { return m_canvas; }
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
GENERAL_COLLECTORS_GUIDE PCB_BASE_FRAME::GetCollectorsGuide ( )
inherited

Function GetCollectorsGuide.

Returns
GENERAL_COLLECTORS_GUIDE - that considers the global configuration options.

Definition at line 595 of file basepcbframe.cpp.

References PCB_BASE_FRAME::GetActiveLayer(), 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, PCB_BASE_FRAME::m_Pcb, and GENERAL_COLLECTORS_GUIDE::SetIgnoreMTextsMarkedNoShow().

Referenced by MODULE_EDITOR_TOOLS::EnumeratePads(), highlightNet(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), PCB_EDIT_FRAME::SelectHighLight(), and SELECTION_TOOL::selectPoint().

596 {
598  GetActiveLayer() );
599 
600  // account for the globals
602  guide.SetIgnoreMTextsOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_BK ) );
603  guide.SetIgnoreMTextsOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_FR ) );
604  guide.SetIgnoreModulesOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_BK ) );
605  guide.SetIgnoreModulesOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_FR ) );
606  guide.SetIgnorePadsOnBack( ! m_Pcb->IsElementVisible( LAYER_PAD_BK ) );
607  guide.SetIgnorePadsOnFront( ! m_Pcb->IsElementVisible( LAYER_PAD_FR ) );
608  guide.SetIgnoreModulesVals( ! m_Pcb->IsElementVisible( LAYER_MOD_VALUES ) );
609  guide.SetIgnoreModulesRefs( ! m_Pcb->IsElementVisible( LAYER_MOD_REFERENCES ) );
610 
611  return guide;
612 }
bool IsElementVisible(GAL_LAYER_ID LAYER_aPCB) const
Function IsElementVisible tests whether a given element category is visible.
show modules on back
show modules values (when texts are visibles)
smd pads, back layer
show modules on front
void SetIgnoreMTextsMarkedNoShow(bool ignore)
Definition: collectors.h:528
smd pads, front layer
LSET GetVisibleLayers() const
Function GetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
Class GENERAL_COLLECTORS_GUIDE is a general implementation of a COLLECTORS_GUIDE. ...
Definition: collectors.h:378
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
show modules references (when texts are visibles)
PARAM_CFG_ARRAY & FOOTPRINT_EDIT_FRAME::GetConfigurationSettings ( )

Function GetConfigurationSettings returns the footpr�int editor settings list.

Currently, only the settings that are needed at start up by the main window are defined here. There are other locally used settings that are scattered throughout the Pcbnew source code. If you need to define a configuration setting that needs to be loaded at run time, this is the place to define it.

Returns
- Reference to the list of applications settings.

Definition at line 84 of file modeditoptions.cpp.

References DEFAULT_GR_MODULE_THICKNESS, DEFAULT_TEXT_MODULE_SIZE, F_Fab, F_SilkS, FILLED, g_UserUnit, GetDesignSettings(), PCB_BASE_FRAME::GetDisplayOptions(), m_configSettings, DISPLAY_OPTIONS::m_DisplayModEdgeFill, DISPLAY_OPTIONS::m_DisplayModTextFill, DISPLAY_OPTIONS::m_DisplayPadFill, DISPLAY_OPTIONS::m_DisplayPolarCood, BOARD_DESIGN_SETTINGS::m_ModuleSegmentWidth, BOARD_DESIGN_SETTINGS::m_ModuleTextSize, BOARD_DESIGN_SETTINGS::m_ModuleTextWidth, 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, and MILLIMETRES.

Referenced by LoadSettings(), and SaveSettings().

85 {
88 
89  // Update everything
90  m_configSettings.clear(); // boost::ptr_vector destroys the pointers inside
91 
92  // Display options:
93  m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "FpEditorUnits" ),
94  (int*)&g_UserUnit, MILLIMETRES ) );
95  m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorDisplayPolarCoords" ),
96  &displ_opts->m_DisplayPolarCood, false ) );
97  m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorPadDisplayMode" ),
98  &displ_opts->m_DisplayPadFill, true ) );
99  m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorGraphicLinesDisplayMode" ),
100  &displ_opts->m_DisplayModEdgeFill, FILLED ) );
101  m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorTextsDisplayMode" ),
102  &displ_opts->m_DisplayModTextFill, FILLED ) );
103  m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorTextsDisplayMode" ),
104  &displ_opts->m_DisplayModTextFill, FILLED ) );
105  m_configSettings.push_back( new PARAM_CFG_WXSTRING( true, wxT( "FpEditorTextsRefDefaultText" ),
106  &settings.m_RefDefaultText, wxT( "REF**" ) ) );
107 
108  // design settings
109  m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorGrlineWidth" ),
110  &settings.m_ModuleSegmentWidth,
111  Millimeter2iu( DEFAULT_GR_MODULE_THICKNESS ),
112  Millimeter2iu( 0.01 ), Millimeter2iu( 100.0 ),
113  NULL, 1/IU_PER_MM ) );
114  m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorTextsDefaultSizeH" ),
115  &settings.m_ModuleTextSize.x,
116  Millimeter2iu( DEFAULT_TEXT_MODULE_SIZE ),
117  Millimeter2iu( 0.01 ), Millimeter2iu( 100.0 ),
118  NULL, 1/IU_PER_MM ) );
119  m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorTextsDefaultSizeV" ),
120  &settings.m_ModuleTextSize.y,
121  Millimeter2iu( DEFAULT_TEXT_MODULE_SIZE ),
122  Millimeter2iu(0.01), Millimeter2iu( 100.0 ),
123  NULL, 1/IU_PER_MM ) );
124  m_configSettings.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorTextsDefaultThickness" ),
125  &settings.m_ModuleTextWidth,
126  Millimeter2iu( DEFAULT_GR_MODULE_THICKNESS ),
127  Millimeter2iu( 0.01 ), Millimeter2iu( 20.0 ),
128  NULL, 1/IU_PER_MM ) );
129 
130  m_configSettings.push_back( new PARAM_CFG_WXSTRING( true,
131  wxT( "FpEditorRefDefaultText" ),
132  &settings.m_RefDefaultText, wxT( "REF**" ) ) );
133  m_configSettings.push_back( new PARAM_CFG_BOOL( true,
134  wxT( "FpEditorRefDefaultVisibility" ),
135  &settings.m_RefDefaultVisibility, true ) );
136  m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "FpEditorRefDefaultLayer" ),
137  &settings.m_RefDefaultlayer,
138  int( F_SilkS ), int( F_SilkS ), int( F_Fab ) ) );
139 
140  m_configSettings.push_back( new PARAM_CFG_WXSTRING( true, wxT( "FpEditorValueDefaultText" ),
141  &settings.m_ValueDefaultText, wxT( "" ) ) );
142  m_configSettings.push_back( new PARAM_CFG_BOOL( true,
143  wxT( "FpEditorValueDefaultVisibility" ),
144  &settings.m_ValueDefaultVisibility, true ) );
145  m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "FpEditorValueDefaultLayer" ),
146  &settings.m_ValueDefaultlayer,
147  int( F_Fab ), int( F_SilkS ), int( F_Fab ) ) );
148 
149  return m_configSettings;
150 }
wxString m_RefDefaultText
Default ref text on fp creation.
bool m_ValueDefaultVisibility
Default value text visibility on fp creation.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const override
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
int m_ModuleTextWidth
Default footprint texts thickness.
int m_ModuleSegmentWidth
Default width for all graphic lines.
bool m_DisplayModEdgeFill
Definition: pcbstruct.h:69
int m_ValueDefaultlayer
Default value text layer on fp creation.
bool m_DisplayPolarCood
Definition: pcbstruct.h:76
wxSize m_ModuleTextSize
Default footprint texts size.
Configuration parameter - Integer Class with unit conversion.
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
#define DEFAULT_TEXT_MODULE_SIZE
#define DEFAULT_GR_MODULE_THICKNESS
Configuration parameter - Integer Class.
PARAM_CFG_ARRAY m_configSettings
List of footprint editor configuration settings.
Configuration parameter - Boolean Class.
wxString m_ValueDefaultText
Default value text on fp creation.
Configuration parameter - wxString Class.
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
bool m_DisplayPadFill
Definition: pcbstruct.h:65
int m_RefDefaultlayer
Default ref text layer on fp creation.
bool m_RefDefaultVisibility
Default ref text visibility on fp creation.
bool m_DisplayModTextFill
Definition: pcbstruct.h:70
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.
wxPoint EDA_DRAW_FRAME::GetCrossHairPosition ( bool  aInvertY = false) const
inherited

Function GetCrossHairPosition 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 1174 of file draw_frame.cpp.

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

Referenced by Abort_EditEdge(), AbortSymbolTraceOn(), AddMenusForBus(), AddMenusForWire(), PCB_BASE_FRAME::AddPad(), PCB_EDIT_FRAME::AutoPlaceModule(), PCB_EDIT_FRAME::Begin_DrawSegment(), Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Self(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::BeginSegment(), PL_EDITOR_FRAME::Block_Move(), GERBVIEW_FRAME::Block_Move(), BuildDimension(), SCH_EDIT_FRAME::CreateBusBusEntry(), SCH_EDIT_FRAME::CreateBusWireEntry(), LIB_EDIT_FRAME::CreateGraphicItem(), SCH_EDIT_FRAME::CreateNewImage(), SCH_EDIT_FRAME::CreateNewText(), LIB_EDIT_FRAME::CreatePin(), PCB_EDIT_FRAME::createPopupMenuForTracks(), SCH_EDIT_FRAME::CreateSheet(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), CreateTextModule(), SCH_EDIT_FRAME::DeleteConnection(), SCH_EDIT_FRAME::DeleteItemAtCrossHair(), DrawAndSizingBlockOutlines(), EDA_DRAW_PANEL::DrawCrossHair(), DrawMovePin(), drawMovingBlock(), DrawMovingBlockOutlines(), DrawSegment(), PCB_BASE_EDIT_FRAME::duplicateItem(), PCB_EDIT_FRAME::EditDimension(), LIB_EDIT_FRAME::EndDrawGraphicItem(), DISPLAY_FOOTPRINTS_FRAME::GeneralControl(), LIB_VIEW_FRAME::GeneralControl(), FOOTPRINT_VIEWER_FRAME::GeneralControl(), FOOTPRINT_WIZARD_FRAME::GeneralControl(), GeneralControl(), SCH_EDIT_FRAME::GeneralControl(), PL_EDITOR_FRAME::GeneralControl(), LIB_EDIT_FRAME::GeneralControl(), GERBVIEW_FRAME::GeneralControl(), PCB_EDIT_FRAME::GeneralControl(), EDA_DRAW_FRAME::GeneralControlKeyMovement(), LIB_EDIT_FRAME::GraphicItemBeginDraw(), SCH_EDIT_FRAME::ImportSheetPin(), InstallBlockCmdFrame(), SCH_EDIT_FRAME::Load_Component(), PL_EDITOR_FRAME::Locate(), Move_Segment(), Move_Texte_Pcb(), moveBitmap(), MoveDimensionText(), MoveFootprint(), moveItem(), PL_EDITOR_FRAME::MoveItem(), moveItemWithMouseCursor(), SCH_EDIT_FRAME::OnDragItem(), DIALOG_MODULE_MODULE_EDITOR::OnEditReference(), DIALOG_MODULE_BOARD_EDITOR::OnEditReference(), DIALOG_MODULE_MODULE_EDITOR::OnEditValue(), DIALOG_MODULE_BOARD_EDITOR::OnEditValue(), LIB_VIEW_FRAME::OnHotKey(), FOOTPRINT_VIEWER_FRAME::OnHotKey(), OnHotKey(), PL_EDITOR_FRAME::OnHotKey(), LIB_EDIT_FRAME::OnHotKey(), SCH_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), GERBVIEW_FRAME::OnHotKey(), 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(), EDA_DRAW_FRAME::OnZoom(), DIALOG_UPDATE_PCB::PerformUpdate(), LIB_EDIT_FRAME::PlaceAnchor(), PCB_BASE_FRAME::PlaceModule(), LIB_EDIT_FRAME::PlacePin(), PCB_BASE_FRAME::PlaceTexteModule(), SCH_EDIT_FRAME::PrepareMoveItem(), Process_Special_Functions(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), PushTrack(), EDA_DRAW_FRAME::RedrawScreen2(), RedrawWhileMovingCursor(), EDA_DRAW_FRAME::RefreshCrossHair(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), resizeSheetWithMouseCursor(), 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(), Start_Move_EdgeMod(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), LIB_EDIT_FRAME::StartModifyDrawSymbol(), LIB_EDIT_FRAME::StartMoveDrawSymbol(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), SymbolDisplayDraw(), SCH_BASE_FRAME::UpdateStatusBar(), PL_EDITOR_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), and GERBVIEW_FRAME::UpdateStatusBar().

1175 {
1176  // subject to change, borrow from old BASE_SCREEN for now.
1177  if( IsGalCanvasActive() )
1178  {
1180 
1181  return wxPoint( cursor.x, cursor.y );
1182  }
1183  else
1184  {
1185  BASE_SCREEN* screen = GetScreen(); // virtual call
1186  return screen->getCrossHairPosition( aInvertY );
1187  }
1188 }
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
wxPoint getCrossHairPosition(bool aInvertY) const
Function getCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:809
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
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:817
wxPoint EDA_DRAW_FRAME::GetCrossHairScreenPosition ( ) const
inherited

Function GetCursorScreenPosition returns the cross hair position in device (display) units.b.

Returns
The current cross hair position.

Definition at line 1212 of file draw_frame.cpp.

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

1213 {
1214  BASE_SCREEN* screen = GetScreen(); // virtual call
1215  return screen->getCrossHairScreenPosition();
1216 }
wxPoint getCrossHairScreenPosition() const
Function getCursorScreenPosition returns the cross hair position in device (display) units...
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
BOARD_ITEM * PCB_BASE_FRAME::GetCurItem ( )
inherited

Definition at line 589 of file basepcbframe.cpp.

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

Referenced by Abort_Create_Track(), Abort_Zone_Move_Corner_Or_Outlines(), PCB_EDIT_FRAME::Autoroute(), EDIT_TOOL::editFootprintInFpEditor(), PCB_EDIT_FRAME::GeneralControl(), Magnetize(), PCB_EDIT_FRAME::moveExact(), 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(), OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), PrepareItemForHotkey(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::RemoveStruct(), Show_Zone_Corner_Or_Outline_While_Move_Mouse(), and PCB_EDIT_FRAME::SwitchLayer().

590 {
591  return GetScreen()->GetCurItem();
592 }
BOARD_ITEM * GetCurItem() const
Function GetCurItem returns the currently selected BOARD_ITEM, overriding BASE_SCREEN::GetCurItem().
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
const wxString FOOTPRINT_EDIT_FRAME::GetCurrentLib ( ) const

Return the current library nickname.

Definition at line 391 of file moduleframe.cpp.

References PROJECT::GetRString(), PROJECT::PCB_LIB_NICKNAME, and KIWAY_HOLDER::Prj().

Referenced by DeleteModuleFromCurrentLibrary(), getLibPath(), OnCloseWindow(), and updateTitle().

392 {
394 };
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
VTBL_ENTRY const wxString & GetRString(RSTRING_T aStringId)
Function GetRString returns a "retained string", which is any session and project specific string ide...
Definition: project.cpp:177
wxPoint EDA_DRAW_FRAME::GetCursorPosition ( bool  aOnGrid,
wxRealPoint *  aGridSize = NULL 
) const
inherited

Function GetCursorPosition returns 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 1198 of file draw_frame.cpp.

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

1199 {
1200  BASE_SCREEN* screen = GetScreen(); // virtual call
1201  return screen->getCursorPosition( aOnGrid, GetGridOrigin(), aGridSize );
1202 }
wxPoint getCursorPosition(bool aOnGrid, const wxPoint &aGridOrigin, wxRealPoint *aGridSize) const
Function getCursorPosition returns the current cursor position in logical (drawing) units...
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
virtual const wxPoint & GetGridOrigin() const =0
Function GetGridOrigin returns the absolute coordinates of the origin of the snap grid...
BOARD_DESIGN_SETTINGS & FOOTPRINT_EDIT_FRAME::GetDesignSettings ( ) const
overridevirtual

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

Overloaded in FOOTPRINT_EDIT_FRAME.

Reimplemented from PCB_BASE_FRAME.

Definition at line 460 of file moduleframe.cpp.

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

Referenced by Begin_Edge_Module(), Clear_Pcb(), CreateTextModule(), DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES(), DIALOG_MODEDIT_OPTIONS::DIALOG_MODEDIT_OPTIONS(), DlgGlobalChange_PadSettings(), Edit_Edge_Width(), Enter_Edge_Width(), GetConfigurationSettings(), and LoadSettings().

461 {
462  return GetBoard()->GetDesignSettings();
463 }
BOARD * GetBoard() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:532
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 163 of file wxBasePcbFrame.h.

References PCB_BASE_FRAME::m_DisplayOptions.

Referenced by PCB_EDIT_FRAME::Delete_Segment_Edge(), VIA::Draw(), GetConfigurationSettings(), PCB_EDIT_FRAME::GetConfigurationSettings(), getOptimalModulePlacement(), PCBNEW_CONTROL::HighContrastMode(), DIALOG_GENERALOPTIONS::init(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog(), PCB_EDIT_FRAME::OnHotKey(), PCB_LAYER_WIDGET::OnLayerSelect(), DIALOG_GENERALOPTIONS::OnOkClick(), DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar(), OnSelectOptionToolbar(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), PCB_EDIT_FRAME::OnSelectTool(), PCB_DRAW_PANEL_GAL::OnShow(), PCB_BASE_FRAME::OnTogglePadDrawMode(), PCB_BASE_FRAME::OnTogglePolarCoords(), PCB_BASE_FRAME::OnUpdateCoordType(), PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode(), DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode(), OnUpdateOptionsToolbar(), PCB_BASE_FRAME::OnUpdatePadDrawMode(), DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode(), PCB_EDIT_FRAME::OnUpdateTraceDrawMode(), PCB_EDIT_FRAME::OnUpdateViaDrawMode(), PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle(), PCBNEW_CONTROL::PadDisplayMode(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), PNS::TOOL_BASE::pickSingleItem(), PCB_BASE_FRAME::PlaceModule(), PrintPage(), PCB_EDIT_FRAME::PrintPage(), PCB_EDIT_FRAME::Process_Special_Functions(), PNS_KICAD_IFACE::SetHostFrame(), PCB_BASE_FRAME::SetToolID(), PCB_BASE_FRAME::SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), PCB_BASE_FRAME::TraceAirWiresToTargets(), PCBNEW_CONTROL::TrackDisplayMode(), DIALOG_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_DISPLAY_OPTIONS::TransferDataToWindow(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings(), PCB_BASE_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UseGalCanvas(), PCBNEW_CONTROL::ViaDisplayMode(), and PCBNEW_CONTROL::ZoneDisplayMode().

163 { return &m_DisplayOptions; }
DISPLAY_OPTIONS m_DisplayOptions
wxString EDA_BASE_FRAME::GetFileFromHistory ( int  cmdId,
const wxString &  type,
wxFileHistory *  aFileHistory = NULL 
)
inherited

Function GetFileFromHistory fetches the file name from the file history list.

and removes the selected file, if this file does not exists Note also the menu is 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 400 of file basicframe.cpp.

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

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

402 {
403  wxFileHistory* fileHistory = aFileHistory;
404 
405  if( !fileHistory )
406  fileHistory = &Kiface().GetFileHistory();
407 
408  int baseId = fileHistory->GetBaseId();
409 
410  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
411 
412  unsigned i = cmdId - baseId;
413 
414  if( i < fileHistory->GetCount() )
415  {
416  wxString fn = fileHistory->GetHistoryFile( i );
417 
418  if( wxFileName::FileExists( fn ) )
419  return fn;
420  else
421  {
422  wxString msg = wxString::Format(
423  wxT( "file '%s' was not found." ),
424  GetChars( fn ) );
425 
426  wxMessageBox( msg );
427 
428  fileHistory->RemoveFileFromHistory( i );
429  }
430  }
431 
432  return wxEmptyString;
433 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxFileHistory & GetFileHistory()
Definition: kiface_i.h:123
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:92
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
const wxChar * FOOTPRINT_EDIT_FRAME::GetFootprintEditorFrameName ( )
static

Function GetFootprintEditorFrameName (static)

Returns
the frame name used when creating the frame used to get a reference to this frame, if exists

Definition at line 454 of file moduleframe.cpp.

References FOOTPRINT_EDIT_FRAME_NAME.

455 {
457 }
#define FOOTPRINT_EDIT_FRAME_NAME
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 f