KiCad PCB EDA Suite
PCB_BASE_FRAME Class Referenceabstract

class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer. More...

#include <wxBasePcbFrame.h>

Inheritance diagram for PCB_BASE_FRAME:
EDA_DRAW_FRAME KIWAY_PLAYER EDA_BASE_FRAME KIWAY_HOLDER DISPLAY_FOOTPRINTS_FRAME FOOTPRINT_VIEWER_FRAME FOOTPRINT_WIZARD_FRAME PCB_BASE_EDIT_FRAME FOOTPRINT_EDIT_FRAME PCB_EDIT_FRAME

Public Member Functions

 PCB_BASE_FRAME (KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName)
 
 ~PCB_BASE_FRAME ()
 
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
 
virtual BOARD_DESIGN_SETTINGSGetDesignSettings () const
 Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame. More...
 
virtual void SetDesignSettings (const BOARD_DESIGN_SETTINGS &aSettings)
 
void * GetDisplayOptions () override
 Function GetDisplayOptions returns the display options current in use Display options are relative to the way tracks, vias, outlines and other things are shown (for instance solid or sketch mode) Must be overloaded in frames which have display options (board editor and footprint editor) More...
 
const ZONE_SETTINGSGetZoneSettings () const
 
void SetZoneSettings (const ZONE_SETTINGS &aSettings)
 
virtual const PCB_PLOT_PARAMSGetPlotSettings () const
 Function GetPlotSettings returns the PCB_PLOT_PARAMS for the BOARD owned by this frame. More...
 
virtual void SetPlotSettings (const PCB_PLOT_PARAMS &aSettings)
 
virtual void SetBoard (BOARD *aBoard)
 Function SetBoard sets the m_Pcb member in such as way as to ensure deleting any previous BOARD. More...
 
BOARDGetBoard () const
 
virtual void OnCloseWindow (wxCloseEvent &Event)=0
 
virtual void RedrawActiveWindow (wxDC *DC, bool EraseBg) override
 
virtual void ReCreateHToolbar () override=0
 
virtual void ReCreateVToolbar () override=0
 
virtual void OnLeftClick (wxDC *DC, const wxPoint &MousePos) override=0
 
virtual void OnLeftDClick (wxDC *DC, const wxPoint &MousePos) override=0
 
virtual bool OnRightClick (const wxPoint &MousePos, wxMenu *PopMenu) override=0
 
virtual void ReCreateMenuBar () override
 Function ReCreateMenuBar Creates recreates the menu bar. More...
 
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...
 
virtual void Show3D_Frame (wxCommandEvent &event)
 
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...
 
virtual void OnModify ()
 Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the current screen and update the date in frame reference do not forget to call this basic OnModify function to update info in derived OnModify functions. More...
 
MODULECreateNewModule (const wxString &aModuleName)
 Function CreateNewModule Creates a new module or footprint, at position 0,0 The new module contains only 2 texts: a reference and a value: Reference = REF** Value = "VAL**" or Footprint name in lib Note: they are dummy texts, which will be replaced by the actual texts when the fooprint is placed on a board and a netlist is read. More...
 
void Edit_Module (MODULE *module, wxDC *DC)
 
void Rotate_Module (wxDC *DC, MODULE *module, double angle, bool incremental)
 
void PlaceModule (MODULE *aModule, wxDC *aDC, bool 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)
 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, bool aInit)
 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 RecalculateAllTracksNetcode ()
 Function RecalculateAllTracksNetcode search connections between tracks and pads and propagate pad net codes to the track segments. More...
 
virtual void SaveCopyInUndoList (BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0))=0
 Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands. More...
 
virtual void SaveCopyInUndoList (const PICKED_ITEMS_LIST &aItemsList, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0))=0
 Function SaveCopyInUndoList (virtual pure, overloaded). More...
 
LAYER_ID SelectLayer (LAYER_ID aDefaultLayer, LSET aNotAllowedLayersMask=LSET(), wxPoint aDlgPosition=wxDefaultPosition)
 Install the dialog box for layer selection. More...
 
void SelectCopperLayerPair ()
 
virtual void SwitchLayer (wxDC *DC, LAYER_ID layer)
 
virtual void SetActiveLayer (LAYER_ID aLayer)
 Function SetActiveLayer will change the currently active layer to aLayer. More...
 
virtual LAYER_ID GetActiveLayer () const
 Function GetActiveLayer returns the active layer. More...
 
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...
 
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 UseGalCanvas (bool aEnable) override
 > More...
 
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...
 
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 EDA_HOTKEYGetHotKeyDescription (int aCommand) const =0
 Function GetHotKeyDescription Searches lists of hot key identifiers (HK_xxx) used in the frame to find a matching hot key descriptor. More...
 
virtual bool OnHotKey (wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL)
 
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)
 
virtual void ReCreateAuxiliaryToolbar ()
 
int GetToolId () const
 
virtual bool IsGridVisible () const
 Function IsGridVisible() , virtual. More...
 
virtual void SetGridVisibility (bool aVisible)
 Function SetGridVisibility() , virtual It may be overloaded by derived classes. More...
 
virtual COLOR4D GetGridColor () const
 Function GetGridColor() , virtual. More...
 
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 bool GeneralControl (wxDC *aDC, const wxPoint &aPosition, EDA_KEY aHotKey=0)
 Function GeneralControl performs application specific control using aDC at aPosition in logical units. More...
 
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)
 
virtual void ToolOnRightClick (wxCommandEvent &event)
 
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)
 Function HandleBlockBegin initializes the block command including the command type, initial position, and other variables. More...
 
virtual int BlockCommand (EDA_KEY aKey)
 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)
 Function HandleBlockPlace( ) Called after HandleBlockEnd, when a block command needs to be executed after the block is moved to its new place (bloc move, drag, copy . More...
 
virtual bool HandleBlockEnd (wxDC *DC)
 Function HandleBlockEnd( ) Handle the "end" of a block command, i.e. 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...
 
virtual void PrintPage (wxDC *aDC, LSET aPrintMask, bool aPrintMirrorMode, void *aData=NULL)
 Function PrintPage used to print a page Print the page pointed by current screen, set by the calling print function. 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...
 

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

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) throw ( IO_ERROR, PARSE_ERROR, boost::interprocess::lock_exception )
 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

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

Detailed Description

class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.

Definition at line 66 of file wxBasePcbFrame.h.

Constructor & Destructor Documentation

PCB_BASE_FRAME::PCB_BASE_FRAME ( KIWAY aKiway,
wxWindow *  aParent,
FRAME_T  aFrameType,
const wxString &  aTitle,
const wxPoint aPos,
const wxSize &  aSize,
long  aStyle,
const wxString &  aFrameName 
)
PCB_BASE_FRAME::~PCB_BASE_FRAME ( )

Definition at line 121 of file basepcbframe.cpp.

References m_Collector, and m_Pcb.

122 {
123  delete m_Collector;
124  delete m_Pcb;
125 }
GENERAL_COLLECTOR * m_Collector

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

672 {
673  wxMenu* menu = NULL;
674  wxMenuItem* item = MasterMenu->FindItem( ID_KICAD_SELECT_ICONS_OPTIONS );
675 
676  if( item ) // This menu exists, do nothing
677  return;
678 
679  menu = new wxMenu;
680 
681  menu->Append( new wxMenuItem( menu, ID_KICAD_SELECT_ICONS_IN_MENUS,
682  _( "Icons in Menus" ), wxEmptyString,
683  wxITEM_CHECK ) );
684  menu->Check( ID_KICAD_SELECT_ICONS_IN_MENUS, Pgm().GetUseIconsInMenus() );
685 
686  AddMenuItem( MasterMenu, menu,
688  _( "Icons Options" ),
689  _( "Select show icons in menus and icons sizes" ),
690  KiBitmap( hammer_xpm ) );
691 }
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 
)

Definition at line 110 of file pad_edition_functions.cpp.

References MODULE::CalculateBoundingBox(), D_PAD::GetAttribute(), MODULE::GetBoundingBox(), EDA_DRAW_FRAME::GetCrossHairPosition(), GetDesignSettings(), GetNextPadName(), MODULE::GetOrientation(), MODULE::GetPosition(), D_PAD::GetPosition(), Import_Pad_Settings(), EDA_DRAW_FRAME::m_canvas, BOARD_DESIGN_SETTINGS::m_Pad_Master, m_Pcb, BOARD::m_Status_Pcb, PAD_ATTRIB_HOLE_NOT_PLATED, MODULE::Pads(), 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 FOOTPRINT_EDIT_FRAME::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->Pads().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:751
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:404
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:240
void EDA_DRAW_FRAME::AdjustScrollBars ( const wxPoint aCenterPosition)
inherited

Definition at line 885 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().

886 {
887  BASE_SCREEN* screen = GetScreen();
888 
889  if( !screen || !m_canvas )
890  return;
891 
892  double scale = screen->GetScalingFactor();
893 
894  wxLogTrace( traceScrollSettings, wxT( "Center Position = ( %d, %d ), scale = %.10g" ),
895  aCenterPositionIU.x, aCenterPositionIU.y, scale );
896 
897  // Calculate the portion of the drawing that can be displayed in the
898  // client area at the current zoom level.
899 
900  // visible viewport in device units ~ pixels
901  wxSize clientSizeDU = m_canvas->GetClientSize();
902 
903  // Size of the client window in IU
904  DSIZE clientSizeIU( clientSizeDU.x / scale, clientSizeDU.y / scale );
905 
906  // Full drawing or "page" rectangle in internal units
907  DBOX pageRectIU( wxPoint( 0, 0 ), wxSize( GetPageSizeIU().x, GetPageSizeIU().y ) );
908 
909  // Account for scrollbars
910  wxSize scrollbarSizeDU = m_canvas->GetSize() - m_canvas->GetClientSize();
911  wxSize scrollbarSizeIU = scrollbarSizeDU * (1 / scale);
912  wxPoint centerAdjustedIU = aCenterPositionIU + scrollbarSizeIU / 2;
913 
914  // The upper left corner of the client rectangle in internal units.
915  double xIU = centerAdjustedIU.x - clientSizeIU.x / 2.0;
916  double yIU = centerAdjustedIU.y - clientSizeIU.y / 2.0;
917 
918  // If drawn around the center, adjust the client rectangle accordingly.
919  if( screen->m_Center )
920  {
921  // half page offset.
922  xIU += pageRectIU.GetWidth() / 2.0;
923  yIU += pageRectIU.GetHeight() / 2.0;
924  }
925 
926  DBOX clientRectIU( wxPoint( xIU, yIU ), wxSize( clientSizeIU.x, clientSizeIU.y ) );
927  wxPoint centerPositionIU;
928 
929  // put "int" limits on the clientRect
930  if( clientRectIU.GetLeft() < VIRT_MIN )
931  clientRectIU.MoveLeftTo( VIRT_MIN );
932  if( clientRectIU.GetTop() < VIRT_MIN )
933  clientRectIU.MoveTopTo( VIRT_MIN );
934  if( clientRectIU.GetRight() > VIRT_MAX )
935  clientRectIU.MoveRightTo( VIRT_MAX );
936  if( clientRectIU.GetBottom() > VIRT_MAX )
937  clientRectIU.MoveBottomTo( VIRT_MAX );
938 
939  centerPositionIU.x = KiROUND( clientRectIU.GetX() + clientRectIU.GetWidth() / 2 );
940  centerPositionIU.y = KiROUND( clientRectIU.GetY() + clientRectIU.GetHeight() / 2 );
941 
942  if( screen->m_Center )
943  {
944  centerPositionIU.x -= KiROUND( pageRectIU.GetWidth() / 2.0 );
945  centerPositionIU.y -= KiROUND( pageRectIU.GetHeight() / 2.0 );
946  }
947 
948  DSIZE virtualSizeIU;
949 
950  if( pageRectIU.GetLeft() < clientRectIU.GetLeft() && pageRectIU.GetRight() > clientRectIU.GetRight() )
951  {
952  virtualSizeIU.x = pageRectIU.GetSize().x;
953  }
954  else
955  {
956  double pageCenterX = pageRectIU.GetX() + ( pageRectIU.GetWidth() / 2 );
957  double clientCenterX = clientRectIU.GetX() + ( clientRectIU.GetWidth() / 2 );
958 
959  if( clientRectIU.GetWidth() > pageRectIU.GetWidth() )
960  {
961  if( pageCenterX > clientCenterX )
962  virtualSizeIU.x = ( pageCenterX - clientRectIU.GetLeft() ) * 2;
963  else if( pageCenterX < clientCenterX )
964  virtualSizeIU.x = ( clientRectIU.GetRight() - pageCenterX ) * 2;
965  else
966  virtualSizeIU.x = clientRectIU.GetWidth();
967  }
968  else
969  {
970  if( pageCenterX > clientCenterX )
971  virtualSizeIU.x = pageRectIU.GetWidth() + ( (pageRectIU.GetLeft() - clientRectIU.GetLeft() ) * 2 );
972  else if( pageCenterX < clientCenterX )
973  virtualSizeIU.x = pageRectIU.GetWidth() + ( (clientRectIU.GetRight() - pageRectIU.GetRight() ) * 2 );
974  else
975  virtualSizeIU.x = pageRectIU.GetWidth();
976  }
977  }
978 
979  if( pageRectIU.GetTop() < clientRectIU.GetTop() && pageRectIU.GetBottom() > clientRectIU.GetBottom() )
980  {
981  virtualSizeIU.y = pageRectIU.GetSize().y;
982  }
983  else
984  {
985  double pageCenterY = pageRectIU.GetY() + ( pageRectIU.GetHeight() / 2 );
986  double clientCenterY = clientRectIU.GetY() + ( clientRectIU.GetHeight() / 2 );
987 
988  if( clientRectIU.GetHeight() > pageRectIU.GetHeight() )
989  {
990  if( pageCenterY > clientCenterY )
991  virtualSizeIU.y = ( pageCenterY - clientRectIU.GetTop() ) * 2;
992  else if( pageCenterY < clientCenterY )
993  virtualSizeIU.y = ( clientRectIU.GetBottom() - pageCenterY ) * 2;
994  else
995  virtualSizeIU.y = clientRectIU.GetHeight();
996  }
997  else
998  {
999  if( pageCenterY > clientCenterY )
1000  virtualSizeIU.y = pageRectIU.GetHeight() +
1001  ( ( pageRectIU.GetTop() - clientRectIU.GetTop() ) * 2 );
1002  else if( pageCenterY < clientCenterY )
1003  virtualSizeIU.y = pageRectIU.GetHeight() +
1004  ( ( clientRectIU.GetBottom() - pageRectIU.GetBottom() ) * 2 );
1005  else
1006  virtualSizeIU.y = pageRectIU.GetHeight();
1007  }
1008  }
1009 
1010  // put "int" limits on the virtualSizeIU
1011  virtualSizeIU.x = std::min( virtualSizeIU.x, MAX_AXIS );
1012  virtualSizeIU.y = std::min( virtualSizeIU.y, MAX_AXIS );
1013 
1014  if( screen->m_Center )
1015  {
1016  screen->m_DrawOrg.x = -KiROUND( virtualSizeIU.x / 2.0 );
1017  screen->m_DrawOrg.y = -KiROUND( virtualSizeIU.y / 2.0 );
1018  }
1019  else
1020  {
1021  screen->m_DrawOrg.x = -KiROUND( ( virtualSizeIU.x - pageRectIU.GetWidth() ) / 2.0 );
1022  screen->m_DrawOrg.y = -KiROUND( ( virtualSizeIU.y - pageRectIU.GetHeight() ) / 2.0 );
1023  }
1024 
1025  /* Always set scrollbar pixels per unit to 1 unless you want the zoom
1026  * around cursor to jump around. This reported problem occurs when the
1027  * zoom point is not on a pixel per unit increment. If you set the
1028  * pixels per unit to 10, you have potential for the zoom point to
1029  * jump around +/-5 pixels from the nearest grid point.
1030  */
1031  screen->m_ScrollPixelsPerUnitX = screen->m_ScrollPixelsPerUnitY = 1;
1032 
1033  // Number of scroll bar units for the given zoom level in device units.
1034  double unitsX = virtualSizeIU.x * scale;
1035  double unitsY = virtualSizeIU.y * scale;
1036 
1037  // Store the requested center position for later use
1038  SetScrollCenterPosition( aCenterPositionIU );
1039 
1040  // Calculate the scroll bar position in internal units to place the
1041  // center position at the center of client rectangle.
1042  double posX = centerPositionIU.x - clientRectIU.GetWidth() / 2.0 - screen->m_DrawOrg.x;
1043  double posY = centerPositionIU.y - clientRectIU.GetHeight() / 2.0 - screen->m_DrawOrg.y;
1044 
1045  // Convert scroll bar position to device units.
1046  posX = KiROUND( posX * scale );
1047  posY = KiROUND( posY * scale );
1048 
1049  if( posX < 0 )
1050  {
1051  wxLogTrace( traceScrollSettings, wxT( "Required scroll bar X position %.10g" ), posX );
1052  posX = 0;
1053  }
1054 
1055  if( posX > unitsX )
1056  {
1057  wxLogTrace( traceScrollSettings, wxT( "Required scroll bar X position %.10g" ), posX );
1058  posX = unitsX;
1059  }
1060 
1061  if( posY < 0 )
1062  {
1063  wxLogTrace( traceScrollSettings, wxT( "Required scroll bar Y position %.10g" ), posY );
1064  posY = 0;
1065  }
1066 
1067  if( posY > unitsY )
1068  {
1069  wxLogTrace( traceScrollSettings, wxT( "Required scroll bar Y position %.10g" ), posY );
1070  posY = unitsY;
1071  }
1072 
1073  screen->m_ScrollbarPos = wxPoint( KiROUND( posX ), KiROUND( posY ) );
1074  screen->m_ScrollbarNumber = wxSize( KiROUND( unitsX ), KiROUND( unitsY ) );
1075 
1076  wxLogTrace( traceScrollSettings,
1077  wxT( "Drawing = (%.10g, %.10g), Client = (%.10g, %.10g), Offset = (%d, %d), SetScrollbars(%d, %d, %d, %d, %d, %d)" ),
1078  virtualSizeIU.x, virtualSizeIU.y, clientSizeIU.x, clientSizeIU.y,
1079  screen->m_DrawOrg.x, screen->m_DrawOrg.y,
1081  screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.y,
1082  screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.y );
1083 
1084  bool noRefresh = true;
1085 
1086  m_canvas->SetScrollbars( screen->m_ScrollPixelsPerUnitX,
1087  screen->m_ScrollPixelsPerUnitY,
1088  screen->m_ScrollbarNumber.x,
1089  screen->m_ScrollbarNumber.y,
1090  screen->m_ScrollbarPos.x,
1091  screen->m_ScrollbarPos.y, noRefresh );
1092 }
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:882
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:881
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:879
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 731 of file draw_frame.cpp.

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

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

734 {
735  if( m_messagePanel == NULL )
736  return;
737 
738  m_messagePanel->AppendMessage( textUpper, textLower, color, pad );
739 }
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
double PCB_BASE_FRAME::BestZoom ( )
overridevirtual

Function BestZoom.

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

Implements EDA_DRAW_FRAME.

Definition at line 319 of file basepcbframe.cpp.

References EDA_RECT::Centre(), GetBoardBoundingBox(), EDA_RECT::GetHeight(), EDA_RECT::GetWidth(), EDA_DRAW_FRAME::m_canvas, 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().

320 {
321  if( m_Pcb == NULL )
322  return 1.0;
323 
324  EDA_RECT ibbbox = GetBoardBoundingBox();
325  DSIZE clientz = m_canvas->GetClientSize();
326  DSIZE boardz( ibbbox.GetWidth(), ibbbox.GetHeight() );
327 
328  double iu_per_du_X = clientz.x ? boardz.x / clientz.x : 1.0;
329  double iu_per_du_Y = clientz.y ? boardz.y / clientz.y : 1.0;
330 
331  double bestzoom = std::max( iu_per_du_X, iu_per_du_Y );
332 
333  SetScrollCenterPosition( ibbbox.Centre() );
334 
335  return bestzoom;
336 }
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 EDA_DRAW_FRAME::BlockCommand ( EDA_KEY  aKey)
virtualinherited

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 in SCH_EDIT_FRAME, PCB_EDIT_FRAME, LIB_EDIT_FRAME, GERBVIEW_FRAME, FOOTPRINT_EDIT_FRAME, and PL_EDITOR_FRAME.

Definition at line 626 of file draw_frame.cpp.

Referenced by EDA_DRAW_FRAME::HandleBlockBegin().

627 {
628  return 0;
629 }
void PCB_BASE_FRAME::Build_Board_Ratsnest ( )

Function Build_Board_Ratsnest.

Function to compute the full ratsnest This is the "basic" ratsnest depending only on pads.

Calculates the full ratsnest depending only on pads.

Create the sorted pad list (if necessary) The active pads (i.e included in a net ) are called nodes This pad list is sorted by net codes A ratsnest can be seen as a logical connection.

Update : nb_nodes = Active pads count for the board nb_links = link count for the board (logical connection count) (there are n-1 links in a net which counting n active pads) .

Definition at line 231 of file ratsnest.cpp.

References MIN_SPAN_TREE_PADS::AddTreeToRatsnest(), BOARD::BuildListOfNets(), MIN_SPAN_TREE::BuildTree(), CH_VISIBLE, BOARD::FindNet(), GetBoard(), BOARD::GetNetCount(), BOARD::GetNodesCount(), BOARD::GetPad(), BOARD::GetPadCount(), BOARD::GetRatsnestsCount(), BOARD::IsElementVisible(), LISTE_RATSNEST_ITEM_OK, BOARD::m_FullRatsnest, NETINFO_ITEM::m_PadInNetList, m_Pcb, NETINFO_ITEM::m_RatsnestEndIdx, NETINFO_ITEM::m_RatsnestStartIdx, BOARD::m_Status_Pcb, MIN_SPAN_TREE_PADS::MSP_Init(), NET_CODES_OK, RATSNEST_VISIBLE, D_PAD::SetSubRatsnest(), BOARD::SetUnconnectedNetCount(), and StrPrintf().

Referenced by Compile_Ratsnest(), and TestForActiveLinksInRatsnest().

232 {
233  D_PAD* pad;
234  int noconn;
235 
237 
238  m_Pcb->m_FullRatsnest.clear();
239 
240  if( m_Pcb->GetPadCount() == 0 )
241  return;
242 
243  // Created pad list and the net_codes if needed
244  if( (m_Pcb->m_Status_Pcb & NET_CODES_OK) == 0 )
246 
247  for( unsigned ii = 0; ii<m_Pcb->GetPadCount(); ++ii )
248  {
249  pad = m_Pcb->GetPad( ii );
250  pad->SetSubRatsnest( 0 );
251  }
252 
253  if( m_Pcb->GetNodesCount() == 0 )
254  return; // No useful connections.
255 
256  // Ratsnest computation
257  unsigned current_net_code = 1; // First net code is analyzed.
258  // (net_code = 0 -> no connect)
259  noconn = 0;
260  MIN_SPAN_TREE_PADS min_spanning_tree;
261 
262  for( ; current_net_code < m_Pcb->GetNetCount(); current_net_code++ )
263  {
264  NETINFO_ITEM* net = m_Pcb->FindNet( current_net_code );
265 
266  if( !net ) // Should not occur
267  {
268  UTF8 msg = StrPrintf( "%s: error, net %d not found", __func__, current_net_code );
269  wxMessageBox( msg ); // BTW, it does happen.
270  return;
271  }
272 
274 
275  min_spanning_tree.MSP_Init( &net->m_PadInNetList );
276  min_spanning_tree.BuildTree();
277  min_spanning_tree.AddTreeToRatsnest( &m_Pcb->m_FullRatsnest );
279  }
280 
281  m_Pcb->SetUnconnectedNetCount( noconn );
283 
284  // Update the ratsnest display option (visible/invisible) flag
285  for( unsigned ii = 0; ii < m_Pcb->GetRatsnestsCount(); ii++ )
286  {
287  if( !GetBoard()->IsElementVisible( RATSNEST_VISIBLE ) ) // Clear VISIBLE flag
288  m_Pcb->m_FullRatsnest[ii].m_Status &= ~CH_VISIBLE;
289  }
290 }
Class UTF8 is an 8 bit std::string that is assuredly encoded in UTF8, and supplies special conversion...
Definition: utf8.h:53
void BuildListOfNets()
Definition: class_board.h:764
void SetUnconnectedNetCount(unsigned aCount)
Function SetUnconnectedNetCount sets the number of unconnected nets in the current rats nest to aCoun...
Definition: class_board.h:735
BOARD * GetBoard() const
void SetSubRatsnest(int aSubRatsnest)
Definition: class_pad.h:475
D_PADS m_PadInNetList
List of pads connected to this net.
class MIN_SPAN_TREE_PADS (derived from MIN_SPAN_TREE) specializes the base class to calculate a minim...
Definition: ratsnest.cpp:51
int StrPrintf(std::string *result, const char *format,...)
Function StrPrintf is like sprintf() but the output is appended to a std::string instead of to a char...
Definition: richio.cpp:75
std::vector< RATSNEST_ITEM > m_FullRatsnest
Ratsnest list for the BOARD.
Definition: class_board.h:248
unsigned m_RatsnestStartIdx
unsigned GetRatsnestsCount() const
Function GetNumRatsnests.
Definition: class_board.h:704
void AddTreeToRatsnest(std::vector< RATSNEST_ITEM > *aRatsnestList)
Function AddTreeToRatsnest Adds the current minimum spanning tree as ratsnest items to the main ratsn...
Definition: ratsnest.cpp:95
#define CH_VISIBLE
Definition: class_netinfo.h:57
D_PAD * GetPad(unsigned aIndex) const
Function GetPad.
Definition: class_board.h:750
unsigned GetPadCount() const
Function GetPadCount.
Definition: class_board.h:741
Class NETINFO_ITEM handles the data for a net.
unsigned GetNodesCount() const
Function GetNodesCount.
bool IsElementVisible(int aPCB_VISIBLE) const
Function IsElementVisible tests whether a given element category is visible.
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
void MSP_Init(std::vector< D_PAD * > *aPadsList)
Definition: ratsnest.cpp:69
unsigned m_RatsnestEndIdx
unsigned GetNetCount() const
Function GetNetCount.
Definition: class_board.h:814
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240
void PCB_BASE_FRAME::build_ratsnest_module ( MODULE aModule)

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
aModule= module to consider.

Definition at line 533 of file ratsnest.cpp.

References abs, MIN_SPAN_TREE_PADS::AddTreeToRatsnest(), LSET::AllCuMask(), BOARD::BuildListOfNets(), MIN_SPAN_TREE::BuildTree(), g_Offset_Module, GetBoard(), D_PAD::GetLayerSet(), BOARD_CONNECTED_ITEM::GetNet(), BOARD_CONNECTED_ITEM::GetNetCode(), D_PAD::GetParent(), D_PAD::GetPosition(), LISTE_PAD_OK, LOCAL_RATSNEST_ITEM, RATSNEST_ITEM::m_Length, BOARD::m_LocalRatsnest, RATSNEST_ITEM::m_PadEnd, NETINFO_ITEM::m_PadInNetList, RATSNEST_ITEM::m_PadStart, m_Pcb, RATSNEST_ITEM::m_Status, BOARD::m_Status_Pcb, MIN_SPAN_TREE_PADS::MSP_Init(), D_PAD::Next(), MODULE::Pads(), RATSNEST_ITEM_LOCAL_OK, RATSNEST_ITEM::SetNet(), BOARD_CONNECTED_ITEM::SetSubNet(), D_PAD::SetSubRatsnest(), sortByNetcode(), NETINFO_LIST::UNCONNECTED, wxPoint::x, and wxPoint::y.

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

534 {
535  // for local ratsnest calculation when moving a footprint:
536  // list of pads to use for this local ratsnets:
537  // this is the list of connected pads of the current module,
538  // and all pads connected to these pads:
539  static std::vector <D_PAD*> localPadList;
540  static unsigned pads_module_count; // node count (node = pad with a net
541  // code) for the footprint being moved
542  static unsigned internalRatsCount; // number of internal links (links
543  // between pads of the module)
544  D_PAD* pad_ref;
545  D_PAD* pad_externe;
546  int current_net_code;
547  int distance;
548  wxPoint pad_pos; // True pad position according to the
549  // current footprint position
550 
551  if( (GetBoard()->m_Status_Pcb & LISTE_PAD_OK) == 0 )
552  {
553  GetBoard()->m_Status_Pcb = 0;
555  }
556 
557  /* Compute the "local" ratsnest if needed (when this footprint starts move)
558  * and the list of external pads to consider, i.e pads in others
559  * footprints which are "connected" to
560  * a pad in the current footprint
561  */
563  {
564  // Compute the "internal" ratsnest, i.e the links between the current
565  // footprint pads
566  localPadList.clear();
567  m_Pcb->m_LocalRatsnest.clear();
568 
569  // collect active pads of the module:
570  for( pad_ref = aModule->Pads(); pad_ref; pad_ref = pad_ref->Next() )
571  {
572  if( pad_ref->GetNetCode() == NETINFO_LIST::UNCONNECTED )
573  continue;
574 
575  if( !( pad_ref->GetLayerSet() & LSET::AllCuMask() ).any() )
576  // pad not a copper layer (happens when building complex shapes)
577  continue;
578 
579  localPadList.push_back( pad_ref );
580  pad_ref->SetSubRatsnest( 0 );
581  pad_ref->SetSubNet( 0 );
582  }
583 
584  pads_module_count = localPadList.size();
585 
586  if( pads_module_count == 0 )
587  return; // no connection!
588 
589  sort( localPadList.begin(), localPadList.end(), sortByNetcode );
590 
591  // Build the list of pads linked to the current footprint pads
592  current_net_code = 0;
593 
594  for( unsigned ii = 0; ii < pads_module_count; ii++ )
595  {
596  pad_ref = localPadList[ii];
597 
598  if( pad_ref->GetNetCode() == current_net_code )
599  continue;
600 
601  // A new net was found, load all pads of others modules members of this net:
602  NETINFO_ITEM* net = pad_ref->GetNet();
603 
604  if( net == NULL ) //Should not occur
605  {
606  wxMessageBox( wxT( "build_ratsnest_module() error: net not found" ) );
607  return;
608  }
609 
610  for( unsigned jj = 0; jj < net->m_PadInNetList.size(); jj++ )
611  {
612  pad_externe = net->m_PadInNetList[jj];
613 
614  if( pad_externe->GetParent() == aModule )
615  continue;
616 
617  pad_externe->SetSubRatsnest( 0 );
618  pad_externe->SetSubNet( 0 );
619 
620  localPadList.push_back( pad_externe );
621  }
622  }
623 
624  // Sort the pad list by net_code
625  sort( localPadList.begin() + pads_module_count, localPadList.end(),
626  sortByNetcode );
627 
628  /* Compute the internal rats nest:
629  * this is the same as general ratsnest, but considers only the current
630  * footprint pads it is therefore not time consuming, and it is made only
631  * once
632  */
633  current_net_code = localPadList[0]->GetNetCode();
634 
635  MIN_SPAN_TREE_PADS min_spanning_tree;
636  std::vector<D_PAD*> padsBuffer; // contains pads of only one net
637 
638  for( unsigned ii = 0; ii < pads_module_count; ii++ )
639  {
640  // Search the end of pad list relative to the current net
641  unsigned jj = ii + 1;
642 
643  for( ; jj <= pads_module_count; jj++ )
644  {
645  if( jj >= pads_module_count )
646  break;
647 
648  if( localPadList[jj]->GetNetCode() != current_net_code )
649  break;
650  }
651 
652  for( unsigned kk = ii; kk < jj; kk++ )
653  padsBuffer.push_back( localPadList[kk] );
654 
655  min_spanning_tree.MSP_Init( &padsBuffer );
656  min_spanning_tree.BuildTree();
657  min_spanning_tree.AddTreeToRatsnest( &m_Pcb->m_LocalRatsnest );
658  padsBuffer.clear();
659 
660  ii = jj;
661 
662  if( ii < localPadList.size() )
663  current_net_code = localPadList[ii]->GetNetCode();
664  }
665 
666  internalRatsCount = m_Pcb->m_LocalRatsnest.size();
667 
668  // set the flag LOCAL_RATSNEST_ITEM of the ratsnest status:
669  for( unsigned ii = 0; ii < m_Pcb->m_LocalRatsnest.size(); ii++ )
670  m_Pcb->m_LocalRatsnest[ii].m_Status = LOCAL_RATSNEST_ITEM;
671 
673  } // End of internal ratsnest build
674 
675  /* This section computes the "external" ratsnest: it is done when the
676  * footprint position changes
677  *
678  * This section search:
679  * for each current module pad the nearest neighbor external pad (of
680  * course for the same net code).
681  * For each current footprint cluster of pad (pads having the same net
682  * code),
683  * we search the smaller rats nest.
684  * so, for each net, only one rats nest item is created
685  */
686  RATSNEST_ITEM local_rats;
687 
688  local_rats.m_Length = INT_MAX;
689  local_rats.m_Status = 0;
690  bool addRats = false;
691 
692  // Erase external ratsnest items:
693  if( internalRatsCount < m_Pcb->m_LocalRatsnest.size() )
694  m_Pcb->m_LocalRatsnest.erase( m_Pcb->m_LocalRatsnest.begin() + internalRatsCount,
695  m_Pcb->m_LocalRatsnest.end() );
696 
697  current_net_code = localPadList[0]->GetNetCode();
698 
699  for( unsigned ii = 0; ii < pads_module_count; ii++ )
700  {
701  pad_ref = localPadList[ii];
702 
703  if( pad_ref->GetNetCode() != current_net_code )
704  {
705  // if needed, creates a new ratsnest for the old net
706  if( addRats )
707  {
708  m_Pcb->m_LocalRatsnest.push_back( local_rats );
709  }
710 
711  addRats = false;
712  current_net_code = pad_ref->GetNetCode();
713  local_rats.m_Length = INT_MAX;
714  }
715 
716  pad_pos = pad_ref->GetPosition() - g_Offset_Module;
717 
718  // Search the nearest external pad of this current pad
719  for( unsigned jj = pads_module_count; jj < localPadList.size(); jj++ )
720  {
721  pad_externe = localPadList[jj];
722 
723  // we search pads having the same net code
724  if( pad_externe->GetNetCode() < pad_ref->GetNetCode() )
725  continue;
726 
727  if( pad_externe->GetNetCode() > pad_ref->GetNetCode() ) // pads are sorted by net code
728  break;
729 
730  distance = abs( pad_externe->GetPosition().x - pad_pos.x ) +
731  abs( pad_externe->GetPosition().y - pad_pos.y );
732 
733  if( distance < local_rats.m_Length )
734  {
735  local_rats.m_PadStart = pad_ref;
736  local_rats.m_PadEnd = pad_externe;
737  local_rats.SetNet( pad_ref->GetNetCode() );
738  local_rats.m_Length = distance;
739  local_rats.m_Status = 0;
740 
741  addRats = true;
742  }
743  }
744  }
745 
746  if( addRats ) // Ensure the last created rats nest item is stored in buffer
747  m_Pcb->m_LocalRatsnest.push_back( local_rats );
748 }
std::vector< RATSNEST_ITEM > m_LocalRatsnest
Ratsnest list relative to a given footprint (used while moving a footprint).
Definition: class_board.h:251
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu LAYER_IDs.
Definition: lset.cpp:638
void BuildListOfNets()
Definition: class_board.h:764
wxPoint g_Offset_Module
Definition: pcbnew.cpp:83
MODULE * GetParent() const
Definition: class_pad.h:108
BOARD * GetBoard() const
void SetSubRatsnest(int aSubRatsnest)
Definition: class_pad.h:475
D_PADS m_PadInNetList
List of pads connected to this net.
#define abs(a)
Definition: auxiliary.h:84
void SetNet(int aNetCode)
Definition: class_netinfo.h:90
class MIN_SPAN_TREE_PADS (derived from MIN_SPAN_TREE) specializes the base class to calculate a minim...
Definition: ratsnest.cpp:51
D_PAD * m_PadEnd
Definition: class_netinfo.h:76
static bool sortByNetcode(const D_PAD *const &ref, const D_PAD *const &item)
Definition: ratsnest.cpp:211
#define LOCAL_RATSNEST_ITEM
Definition: class_netinfo.h:61
const wxPoint & GetPosition() const override
Definition: class_pad.h:170
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:235
void AddTreeToRatsnest(std::vector< RATSNEST_ITEM > *aRatsnestList)
Function AddTreeToRatsnest Adds the current minimum spanning tree as ratsnest items to the main ratsn...
Definition: ratsnest.cpp:95
D_PAD * Next() const
Definition: class_pad.h:106
void SetSubNet(int aSubNetCode)
D_PAD * m_PadStart
Definition: class_netinfo.h:75
int GetNetCode() const
Function GetNetCode.
Class NETINFO_ITEM handles the data for a net.
DLIST< D_PAD > & Pads()
Definition: class_module.h:133
Class RATSNEST_ITEM describes a ratsnest line: a straight line connecting 2 pads. ...
Definition: class_netinfo.h:68
void MSP_Init(std::vector< D_PAD * > *aPadsList)
Definition: ratsnest.cpp:69
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
NETINFO_ITEM * GetNet() const
Function GetNet Returns NET_INFO object for a given item.
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240
void PCB_BASE_FRAME::BuildAirWiresTargetsList ( BOARD_CONNECTED_ITEM aItemRef,
const wxPoint aPosition,
bool  aInit 
)

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)
aInit= true to build full candidate list or false to update data When aInit = false, aItemRef is not used (can be NULL)

Definition at line 836 of file ratsnest.cpp.

References BOARD::FindNet(), BOARD_CONNECTED_ITEM::GetNetCode(), D_PAD::GetPosition(), BOARD_CONNECTED_ITEM::GetSubNet(), LISTE_PAD_OK, LISTE_RATSNEST_ITEM_OK, NETINFO_ITEM::m_PadInNetList, m_Pcb, BOARD::m_Status_Pcb, BOARD::m_Track, NET_CODES_OK, TRACK::Next(), s_TargetsLocations, sort_by_distance(), and sort_by_point().

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

838 {
839  if( ( ( m_Pcb->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK ) == 0 )
840  || ( ( m_Pcb->m_Status_Pcb & LISTE_PAD_OK ) == 0 )
841  || ( ( m_Pcb->m_Status_Pcb & NET_CODES_OK ) == 0 ) )
842  {
843  s_TargetsLocations.clear();
844  return;
845  }
846 
847  s_CursorPos = aPosition; // needed for sort_by_distance
848 
849  if( aInit )
850  {
851  s_TargetsLocations.clear();
852 
853  if( aItemRef == NULL )
854  return;
855 
856  int net_code = aItemRef->GetNetCode();
857  int subnet = aItemRef->GetSubNet();
858 
859  if( net_code <= 0 )
860  return;
861 
862  NETINFO_ITEM* net = m_Pcb->FindNet( net_code );
863 
864  if( net == NULL ) // Should not occur
865  {
866  wxMessageBox( wxT( "BuildAirWiresTargetsList() error: net not found" ) );
867  return;
868  }
869 
870  // Create a list of pads candidates ( pads not already connected to the
871  // current track ):
872  for( unsigned ii = 0; ii < net->m_PadInNetList.size(); ii++ )
873  {
874  D_PAD* pad = net->m_PadInNetList[ii];
875 
876  if( pad == aItemRef )
877  continue;
878 
879  if( !pad->GetSubNet() || (pad->GetSubNet() != subnet) )
880  s_TargetsLocations.push_back( pad->GetPosition() );
881  }
882 
883  // Create a list of tracks ends candidates, not already connected to the
884  // current track:
885  for( TRACK* track = m_Pcb->m_Track; track; track = track->Next() )
886  {
887  if( track->GetNetCode() < net_code )
888  continue;
889  if( track->GetNetCode() > net_code )
890  break;
891 
892  if( !track->GetSubNet() || (track->GetSubNet() != subnet) )
893  {
894  if( aPosition != track->GetStart() )
895  s_TargetsLocations.push_back( track->GetStart() );
896  if( aPosition != track->GetEnd() && track->GetStart() != track->GetEnd() )
897  s_TargetsLocations.push_back( track->GetEnd() );
898  }
899  }
900 
901  // Remove duplicate targets, using the C++ unique algorithm
902  sort( s_TargetsLocations.begin(), s_TargetsLocations.end(), sort_by_point );
903  std::vector< wxPoint >::iterator it = unique( s_TargetsLocations.begin(), s_TargetsLocations.end() );
904 
905  // Using the C++ unique algorithm only moves the duplicate entries to the end of
906  // of the array. This removes the duplicate entries from the array.
907  s_TargetsLocations.resize( it - s_TargetsLocations.begin() );
908  } // end if Init
909 
910  // in all cases, sort by distances:
912 }
static wxPoint s_CursorPos
Definition: ratsnest.cpp:802
D_PADS m_PadInNetList
List of pads connected to this net.
static bool sort_by_distance(const wxPoint &ref, const wxPoint &compare)
Definition: ratsnest.cpp:808
const wxPoint & GetPosition() const override
Definition: class_pad.h:170
int GetNetCode() const
Function GetNetCode.
static std::vector< wxPoint > s_TargetsLocations
Definition: ratsnest.cpp:801
Class NETINFO_ITEM handles the data for a net.
TRACK * Next() const
Definition: class_track.h:97
int GetSubNet() const
Function GetSubNet.
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
DLIST< TRACK > m_Track
Definition: class_board.h:244
static bool sort_by_point(const wxPoint &ref, const wxPoint &compare)
Definition: ratsnest.cpp:822
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240
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 576 of file basicframe.cpp.

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

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

578 {
579  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
580  wxCHECK_RET( !aBackupFileExtension.IsEmpty(), wxT( "Invalid backup file extension!" ) );
581 
582  wxFileName autoSaveFileName = aFileName;
583 
584  // Check for auto save file.
585  autoSaveFileName.SetName( AUTOSAVE_PREFIX_FILENAME + aFileName.GetName() );
586 
587  wxLogTrace( traceAutoSave,
588  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
589 
590  if( !autoSaveFileName.FileExists() )
591  return;
592 
593  wxString msg = wxString::Format( _(
594  "Well this is potentially embarrassing!\n"
595  "It appears that the last time you were editing the file\n"
596  "'%s'\n"
597  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
598  GetChars( aFileName.GetFullName() )
599  );
600 
601  int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this );
602 
603  // Make a backup of the current file, delete the file, and rename the auto save file to
604  // the file name.
605  if( response == wxYES )
606  {
607  // Get the backup file name.
608  wxFileName backupFileName = aFileName;
609  backupFileName.SetExt( aBackupFileExtension );
610 
611  // If an old backup file exists, delete it. If an old copy of the file exists, rename
612  // it to the backup file name
613  if( aFileName.FileExists() )
614  {
615  // Remove the old file backup file.
616  if( backupFileName.FileExists() )
617  wxRemoveFile( backupFileName.GetFullPath() );
618 
619  // Rename the old file to the backup file name.
620  if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath() ) )
621  {
622  msg.Printf( _( "Could not create backup file <%s>" ),
623  GetChars( backupFileName.GetFullPath() ) );
624  wxMessageBox( msg );
625  }
626  }
627 
628  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
629  {
630  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
631  Pgm().App().GetAppName(), wxOK | wxICON_EXCLAMATION, this );
632  }
633  }
634  else
635  {
636  wxLogTrace( traceAutoSave,
637  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
638 
639  // Remove the auto save file when using the previous file as is.
640  wxRemoveFile( autoSaveFileName.GetFullPath() );
641  }
642 }
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
a prefix to create filenames for schematic files or other difile when auto-saved to retrieve a crash ...
Definition: wxstruct.h:70
void PCB_BASE_FRAME::ClearSelection ( )
void PCB_BASE_FRAME::Compile_Ratsnest ( wxDC *  aDC,
bool  aDisplayStatus 
)

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

References EDA_DRAW_FRAME::AppendMsgPanel(), Build_Board_Ratsnest(), EDA_DRAW_FRAME::ClearMsgPanel(), CYAN, DrawGeneralRatsnest(), GetBoard(), BOARD::GetNetCount(), BOARD::GetPadCount(), m_Pcb, BOARD::m_Status_Pcb, RATSNEST_VISIBLE, RecalculateAllTracksNetcode(), RED, EDA_DRAW_FRAME::SetMsgPanel(), TestConnections(), and TestForActiveLinksInRatsnest().

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_NETLIST::OnCompileRatsnestClick(), DIALOG_EXCHANGE_MODULE::OnOkClick(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), PCB_EDIT_FRAME::OnSelectTool(), PCB_EDIT_FRAME::OpenProjectFiles(), PlaceModule(), PCB_EDIT_FRAME::RemoveMisConnectedTracks(), PCB_EDIT_FRAME::Reset_Noroutable(), Rotate_Module(), DRC::RunTests(), PCB_EDIT_FRAME::Show_1_Ratsnest(), TestNetConnection(), DRC::testUnconnected(), and BOARD_NETLIST_UPDATER::UpdateNetlist().

166 {
167  wxString msg;
168 
169  GetBoard()->m_Status_Pcb = 0; // we want a full ratsnest computation, from the scratch
170  ClearMsgPanel();
171 
172  // Rebuild the full pads and net info list
174 
175  if( aDisplayStatus )
176  {
177  msg.Printf( wxT( " %d" ), m_Pcb->GetPadCount() );
178  AppendMsgPanel( wxT( "Pads" ), msg, RED );
179  msg.Printf( wxT( " %d" ), m_Pcb->GetNetCount() );
180  AppendMsgPanel( wxT( "Nets" ), msg, CYAN );
181  }
182 
183  /* Compute the full ratsnest
184  * which can be see like all the possible links or logical connections.
185  * some of them are active (no track connected) and others are inactive
186  * (when tracks connect pads)
187  * This full ratsnest is not modified by track editing.
188  * It changes only when a netlist is read, or footprints are modified
189  */
191 
192  // Compute the pad connections due to the existing tracks (physical connections)
193  TestConnections();
194 
195  /* Compute the active ratsnest, i.e. the unconnected links
196  */
198 
199  // Redraw the active ratsnest ( if enabled )
200  if( GetBoard()->IsElementVisible(RATSNEST_VISIBLE) && aDC )
201  DrawGeneralRatsnest( aDC, 0 );
202 
203  if( aDisplayStatus )
204  SetMsgPanel( m_Pcb );
205 }
void TestForActiveLinksInRatsnest(int aNetCode)
Function TestForActiveLinksInRatsnest Explores the full rats nest list (which must exist) to determin...
Definition: ratsnest.cpp:469
BOARD * GetBoard() const
void TestConnections()
Function TestConnections tests the connections relative to all nets.
Definition: connect.cpp:733
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:751
void RecalculateAllTracksNetcode()
Function RecalculateAllTracksNetcode search connections between tracks and pads and propagate pad net...
Definition: connect.cpp:861
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:300
Definition: colors.h:59
Definition: colors.h:60
unsigned GetPadCount() const
Function GetPadCount.
Definition: class_board.h:741
void AppendMsgPanel(const wxString &textUpper, const wxString &textLower, COLOR4D color, int pad=6)
Append a message to the message panel.
Definition: draw_frame.cpp:731
void Build_Board_Ratsnest()
Function Build_Board_Ratsnest.
Definition: ratsnest.cpp:231
void ClearMsgPanel(void)
Clear all messages from the message panel.
Definition: draw_frame.cpp:742
unsigned GetNetCount() const
Function GetNetCount.
Definition: class_board.h:814
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240
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 255 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().

256  {
257  wxString baseCfgName = m_configFrameName.IsEmpty() ? GetName() : m_configFrameName;
258  return baseCfgName;
259  }
wxString m_configFrameName
prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTO...
Definition: wxstruct.h:132
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 790 of file draw_frame.cpp.

References CoordinateToString().

791 {
792  return ::CoordinateToString( aValue, aConvertToMils );
793 }
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 return the default cursor shape.
MODULE * PCB_BASE_FRAME::CreateNewModule ( 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.

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

Definition at line 743 of file librairi.cpp.

References BOARD::Add(), DisplayInfoMessage(), FMT_MOD_CREATE, FMT_MOD_REF, FMT_NO_REF_ABORTED, GetBoard(), 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().

744 {
745  // Creates a new footprint at position 0,0 which contains the minimal items:
746  // the reference and the value.
747  // Value : initialized to the footprint name.
748  // put on fab layer (front side)
749  // Reference : initialized to a default value (REF**).
750  // put on silkscreen layer (front side)
751 
752  wxString moduleName = aModuleName;
753 
754  // Ask for the new module name
755  if( moduleName.IsEmpty() )
756  {
757  wxTextEntryDialog dlg( this, FMT_MOD_REF, FMT_MOD_CREATE, moduleName );
758  dlg.SetTextValidator( FILE_NAME_CHAR_VALIDATOR( &moduleName ) );
759 
760  if( dlg.ShowModal() != wxID_OK )
761  return NULL; //Aborted by user
762  }
763 
764  moduleName.Trim( true );
765  moduleName.Trim( false );
766 
767  if( moduleName.IsEmpty() )
768  {
770  return NULL;
771  }
772 
773  // Creates the new module and add it to the head of the linked list of modules
774  MODULE* module = new MODULE( GetBoard() );
775 
776  GetBoard()->Add( module );
777 
778  // Update parameters: timestamp ...
779  module->SetLastEditTime();
780 
781  // Update its name in lib
782  module->SetFPID( LIB_ID( moduleName ) );
783 
784  wxPoint default_pos;
786 
787  // Update reference:
788  if( settings.m_RefDefaultText.IsEmpty() )
789  module->SetReference( moduleName );
790  else
791  module->SetReference( settings.m_RefDefaultText );
792 
793  module->Reference().SetThickness( settings.m_ModuleTextWidth );
794  module->Reference().SetTextSize( settings.m_ModuleTextSize );
795  default_pos.y = GetDesignSettings().m_ModuleTextSize.y / 2;
796  module->Reference().SetPosition( default_pos );
797  module->Reference().SetLayer( ToLAYER_ID( settings.m_RefDefaultlayer ) );
798  module->Reference().SetVisible( settings.m_RefDefaultVisibility );
799 
800  // Set the value field to a default value
801  if( settings.m_ValueDefaultText.IsEmpty() )
802  module->SetValue( moduleName );
803  else
804  module->SetValue( settings.m_ValueDefaultText );
805 
806  module->Value().SetThickness( GetDesignSettings().m_ModuleTextWidth );
807  module->Value().SetTextSize( GetDesignSettings().m_ModuleTextSize );
808  default_pos.y = -default_pos.y;
809  module->Value().SetPosition( default_pos );
810  module->Value().SetLayer( ToLAYER_ID( settings.m_ValueDefaultlayer ) );
811  module->Value().SetVisible( settings.m_ValueDefaultVisibility );
812 
813  SetMsgPanel( module );
814  return module;
815 }
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:455
#define FMT_MOD_REF
Definition: librairi.cpp:73
int m_ModuleTextWidth
Default footprint texts thickness.
virtual void SetLayer(LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
#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:269
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:751
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:454
#define FMT_NO_REF_ABORTED
Definition: librairi.cpp:79
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_INSERT) override
>
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:421
virtual void SetPosition(const wxPoint &aPos) override
wxString m_ValueDefaultText
Default value text on fp creation.
void DisplayInfoMessage(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:89
LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:766
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:448
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:152
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.
void PCB_BASE_FRAME::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.

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

Definition at line 339 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().

340 {
341  // factored out of pcbnew/find.cpp
342 
344 
345  // There may be need to reframe the drawing.
346  if( !m_canvas->IsPointOnDisplay( aPos ) )
347  {
348  SetCrossHairPosition( aPos );
349  RedrawScreen( aPos, aWarp );
350  }
351  else
352  {
353  // Put cursor on item position
354  m_canvas->CrossHairOff( &dc );
355  SetCrossHairPosition( aPos );
356 
357  if( aWarp )
359  }
360  m_canvas->CrossHairOn( &dc );
361  m_canvas->CrossHairOn( &dc );
362 }
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 PCB_BASE_FRAME::DeletePad ( D_PAD aPad,
bool  aQuery = true 
)

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(), GetBoard(), MODULE::GetBoundingBox(), GetChars(), D_PAD::GetParent(), MODULE::GetReference(), MODULE::GetValue(), IsOK(), EDA_DRAW_FRAME::m_canvas, m_Pcb, BOARD::m_Status_Pcb, OnModify(), BOARD::PadDelete(), EDA_DRAW_PANEL::RefreshDrawingRect(), and MODULE::SetLastEditTime().

Referenced by PCB_EDIT_FRAME::Process_Special_Functions(), and FOOTPRINT_EDIT_FRAME::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:439
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:269
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:411
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:111
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240
void PCB_BASE_FRAME::DeleteTextModule ( TEXTE_MODULE Text)

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, OnModify(), EDA_DRAW_PANEL::RefreshDrawingRect(), MODULE::SetLastEditTime(), and TEXTE_MODULE::TEXT_is_DIVERS.

Referenced by PCB_EDIT_FRAME::Process_Special_Functions(), and FOOTPRINT_EDIT_FRAME::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:269
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(), 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
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 
)

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

References CH_ACTIF, CH_VISIBLE, DO_NOT_SHOW_GENERAL_RASTNEST, RATSNEST_ITEM::Draw(), RATSNEST_ITEM::GetNet(), BOARD::GetRatsnestsCount(), GR_XOR, LISTE_RATSNEST_ITEM_OK, EDA_DRAW_FRAME::m_canvas, BOARD::m_FullRatsnest, m_Pcb, RATSNEST_ITEM::m_Status, and BOARD::m_Status_Pcb.

Referenced by Abort_MoveOrCopyModule(), PCB_EDIT_FRAME::Change_Side_Module(), Compile_Ratsnest(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), PCB_EDIT_FRAME::RedrawActiveWindow(), Rotate_Module(), PCB_EDIT_FRAME::Show_1_Ratsnest(), PCB_EDIT_FRAME::StartMoveModule(), and TestNetConnection().

301 {
302  if( ( m_Pcb->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK ) == 0 )
303  return;
304 
306  return;
307 
308  if( aDC == NULL )
309  return;
310 
311  const int state = CH_VISIBLE | CH_ACTIF;
312 
313  for( unsigned ii = 0; ii < m_Pcb->GetRatsnestsCount(); ii++ )
314  {
315  RATSNEST_ITEM& item = m_Pcb->m_FullRatsnest[ii];
316 
317  if( ( item.m_Status & state ) != state )
318  continue;
319 
320  if( ( aNetcode <= 0 ) || ( aNetcode == item.GetNet() ) )
321  {
322  item.Draw( m_canvas, aDC, GR_XOR, wxPoint( 0, 0 ) );
323  }
324  }
325 }
#define CH_ACTIF
Definition: class_netinfo.h:60
std::vector< RATSNEST_ITEM > m_FullRatsnest
Ratsnest list for the BOARD.
Definition: class_board.h:248
unsigned GetRatsnestsCount() const
Function GetNumRatsnests.
Definition: class_board.h:704
void Draw(EDA_DRAW_PANEL *panel, wxDC *DC, GR_DRAWMODE aDrawMode, const wxPoint &offset)
Function Draw.
#define CH_VISIBLE
Definition: class_netinfo.h:57
int GetNet() const
Function GetNet.
Definition: class_netinfo.h:85
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
Class RATSNEST_ITEM describes a ratsnest line: a straight line connecting 2 pads. ...
Definition: class_netinfo.h:68
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240
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 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(), FOOTPRINT_EDIT_FRAME::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_FRAME::Edit_Module ( MODULE module,
wxDC *  DC 
)
bool EDA_BASE_FRAME::Enable ( bool  enable)
overrideinherited

Definition at line 192 of file basicframe.cpp.

Referenced by FOOTPRINT_EDIT_FRAME::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 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 PCB_BASE_FRAME::Export_Pad_Settings ( D_PAD aPad)

Definition at line 46 of file pad_edition_functions.cpp.

References 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:751
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:1050
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 FOOTPRINT_EDIT_FRAME::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:356
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:358
virtual bool EDA_DRAW_FRAME::GeneralControl ( wxDC *  aDC,
const wxPoint aPosition,
EDA_KEY  aHotKey = 0 
)
inlinevirtualinherited

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 in PCB_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, PL_EDITOR_FRAME, SCH_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, FOOTPRINT_WIZARD_FRAME, FOOTPRINT_VIEWER_FRAME, DISPLAY_FOOTPRINTS_FRAME, and LIB_VIEW_FRAME.

Definition at line 523 of file draw_frame.h.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

524  {
525  return false;
526  }
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 1255 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 LIB_VIEW_FRAME::GeneralControl(), DISPLAY_FOOTPRINTS_FRAME::GeneralControl(), FOOTPRINT_VIEWER_FRAME::GeneralControl(), FOOTPRINT_WIZARD_FRAME::GeneralControl(), FOOTPRINT_EDIT_FRAME::GeneralControl(), SCH_EDIT_FRAME::GeneralControl(), PL_EDITOR_FRAME::GeneralControl(), LIB_EDIT_FRAME::GeneralControl(), GERBVIEW_FRAME::GeneralControl(), and PCB_EDIT_FRAME::GeneralControl().

1257 {
1258 
1259  // If requested snap the current position to the grid
1260  if( aSnapToGrid )
1261  *aPos = GetNearestGridPosition( *aPos );
1262 
1263  switch( aHotKey )
1264  {
1265  // All these keys have almost the same treatment
1266  case GR_KB_CTRL | WXK_NUMPAD8:
1267  case GR_KB_CTRL | WXK_UP:
1268  case GR_KB_CTRL | WXK_NUMPAD2:
1269  case GR_KB_CTRL | WXK_DOWN:
1270  case GR_KB_CTRL | WXK_NUMPAD4:
1271  case GR_KB_CTRL | WXK_LEFT:
1272  case GR_KB_CTRL | WXK_NUMPAD6:
1273  case GR_KB_CTRL | WXK_RIGHT:
1274  case WXK_NUMPAD8:
1275  case WXK_UP:
1276  case WXK_NUMPAD2:
1277  case WXK_DOWN:
1278  case WXK_NUMPAD4:
1279  case WXK_LEFT:
1280  case WXK_NUMPAD6:
1281  case WXK_RIGHT:
1282  {
1283  /* Here's a tricky part: when doing cursor key movement, the
1284  * 'previous' point should be taken from memory, *not* from the
1285  * freshly computed position in the event. Otherwise you can't do
1286  * sub-pixel movement. The m_movingCursorWithKeyboard oneshot 'eats'
1287  * the automatic motion event generated by cursor warping */
1288  wxRealPoint gridSize = GetScreen()->GetGridSize();
1289  *aPos = GetCrossHairPosition();
1290 
1291  // Bonus: ^key moves faster (x10)
1292  switch( aHotKey )
1293  {
1294  case GR_KB_CTRL|WXK_NUMPAD8:
1295  case GR_KB_CTRL|WXK_UP:
1296  aPos->y -= KiROUND( 10 * gridSize.y );
1297  break;
1298 
1299  case GR_KB_CTRL|WXK_NUMPAD2:
1300  case GR_KB_CTRL|WXK_DOWN:
1301  aPos->y += KiROUND( 10 * gridSize.y );
1302  break;
1303 
1304  case GR_KB_CTRL|WXK_NUMPAD4:
1305  case GR_KB_CTRL|WXK_LEFT:
1306  aPos->x -= KiROUND( 10 * gridSize.x );
1307  break;
1308 
1309  case GR_KB_CTRL|WXK_NUMPAD6:
1310  case GR_KB_CTRL|WXK_RIGHT:
1311  aPos->x += KiROUND( 10 * gridSize.x );
1312  break;
1313 
1314  case WXK_NUMPAD8:
1315  case WXK_UP:
1316  aPos->y -= KiROUND( gridSize.y );
1317  break;
1318 
1319  case WXK_NUMPAD2:
1320  case WXK_DOWN:
1321  aPos->y += KiROUND( gridSize.y );
1322  break;
1323 
1324  case WXK_NUMPAD4:
1325  case WXK_LEFT:
1326  aPos->x -= KiROUND( gridSize.x );
1327  break;
1328 
1329  case WXK_NUMPAD6:
1330  case WXK_RIGHT:
1331  aPos->x += KiROUND( gridSize.x );
1332  break;
1333 
1334  default: /* Can't happen since we entered the statement */
1335  break;
1336  }
1337  m_canvas->MoveCursor( *aPos );
1339  }
1340  break;
1341 
1342  default:
1343  break;
1344  }
1345 }
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 ( )
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(), FOOTPRINT_EDIT_FRAME::OnModify(), PCB_EDIT_FRAME::OpenProjectFiles(), DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_EDIT_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 LAYER_ID PCB_BASE_FRAME::GetActiveLayer ( ) const
inlinevirtual

Function GetActiveLayer returns the active layer.

Definition at line 633 of file wxBasePcbFrame.h.

References GetScreen(), and PCB_SCREEN::m_Active_Layer.

Referenced by PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::EditDimension(), 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(), ROUTER_TOOL::performRouting(), DRAWING_TOOL::PlaceText(), PCB_EDIT_FRAME::PrepareLayerIndicator(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), and ROUTER_TOOL::switchLayerOnViaPlacement().

634  {
635  return GetScreen()->m_Active_Layer;
636  }
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 214 of file wxstruct.h.

References EDA_BASE_FRAME::m_autoSaveInterval.

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

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

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

Implements EDA_DRAW_FRAME.

Definition at line 209 of file basepcbframe.cpp.

References BOARD::GetAuxOrigin(), and m_Pcb.

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

210 {
211  wxASSERT( m_Pcb );
212  return m_Pcb->GetAuxOrigin();
213 }
const wxPoint & GetAuxOrigin() const
Definition: class_board.h:332
BOARD* PCB_BASE_FRAME::GetBoard ( ) const
inline

Definition at line 181 of file wxBasePcbFrame.h.

References 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(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Zone(), Build_Board_Ratsnest(), 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(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::Clear_Pcb(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), Compile_Ratsnest(), PCB_EDIT_FRAME::Create_MuWaveComponent(), PCB_EDIT_FRAME::Create_MuWavePolygonShape(), DIALOG_FREEROUTE::createDSN_File(), DIALOG_GEN_MODULE_POSITION::CreateFiles(), CreateHeaderInfoData(), 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(), 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(), PCB_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::DoGenFootprintsPositionFile(), PCB_EDIT_FRAME::DoGenFootprintsReport(), DrawMovingBlockOutlines(), drawPickedItems(), DRC::DRC(), EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::duplicateZone(), FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer(), FOOTPRINT_EDIT_FRAME::Edit_Edge_Width(), PCB_EDIT_FRAME::Edit_Track_Width(), PCB_EDIT_FRAME::Edit_Zone_Params(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::End_Edge(), FOOTPRINT_EDIT_FRAME::End_Edge_Module(), PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::End_Zone(), FOOTPRINT_EDIT_FRAME::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(), FOOTPRINT_EDIT_FRAME::GetDesignSettings(), PCB_LAYER_BOX_SELECTOR::getEnabledLayers(), GetFootprintFromBoardByReference(), PCB_LAYER_BOX_SELECTOR::GetLayerColor(), PCB_LAYER_BOX_SELECTOR::GetLayerName(), FOOTPRINT_EDIT_FRAME::GetModel(), GAL_ARRAY_CREATOR::getModule(), getOptimalModulePlacement(), PCB_EDIT_FRAME::GetProjectFileParameters(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), PCB_EDIT_FRAME::HandleBlockEnd(), FOOTPRINT_EDIT_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HighLight(), PCB_EDIT_FRAME::HighlightUnconnectedPads(), FOOTPRINT_EDIT_FRAME::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(), FOOTPRINT_EDIT_FRAME::IsElementVisible(), PCB_LAYER_BOX_SELECTOR::IsLayerEnabled(), PCB_EDIT_FRAME::ListNetsAndSelect(), FOOTPRINT_EDIT_FRAME::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(), FOOTPRINT_EDIT_FRAME::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::OnLayerColorChange(), PCB_LAYER_WIDGET::OnLayerVisible(), FOOTPRINT_EDIT_FRAME::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::OnRenderColorChange(), PCB_LAYER_WIDGET::OnRenderEnable(), PCB_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), PCB_EDIT_FRAME::OnSelectTool(), DIALOG_DRC_CONTROL::OnStartdrcClick(), DIALOG_NETLIST::OnTestFootprintsClick(), OnTogglePadDrawMode(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLibAndModuleSelected(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected(), FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard(), PCB_EDIT_FRAME::OnUpdateShowBoardRatsnest(), FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::Other_Layer_Route(), DIALOG_UPDATE_PCB::PerformUpdate(), PickModule(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), PlaceModule(), DIALOG_PLOT::Plot(), PCB_EDIT_FRAME::PrepareLayerIndicator(), FOOTPRINT_EDIT_FRAME::PrintPage(), PCB_EDIT_FRAME::PrintPage(), PCB_EDIT_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_EXCHANGE_MODULE::RebuildCmpList(), RecalculateAllTracksNetcode(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow(), FOOTPRINT_VIEWER_FRAME::RedrawActiveWindow(), FOOTPRINT_EDIT_FRAME::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(), ResetModuleTextSizes(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), Rotate_Module(), DRC::RunTests(), FOOTPRINT_EDIT_FRAME::SaveCurrentModule(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), SWAP_LAYERS_DIALOG::Sel_Layer(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SelectCopperLayerPair(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), PCB_EDIT_FRAME::SelectHighLight(), SelectLayer(), DIALOG_GLOBAL_DELETION::SetCurrentLayer(), FOOTPRINT_EDIT_FRAME::SetDesignSettings(), DIALOG_DRC_CONTROL::SetDrcParmeters(), FOOTPRINT_EDIT_FRAME::SetElementVisibility(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), FOOTPRINT_EDIT_FRAME::setupTools(), PCB_EDIT_FRAME::Show_1_Ratsnest(), Show_New_Edge_While_Move_Mouse(), PCB_EDIT_FRAME::SpreadFootprints(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), StartMovePad(), PCB_EDIT_FRAME::Swap_Layers(), PCB_EDIT_FRAME::SwitchLayer(), PCB_LAYER_WIDGET::SyncLayerVisibilities(), PCB_LAYER_WIDGET::SyncRenderStates(), DialogEditModuleText::TransferDataToWindow(), FOOTPRINT_VIEWER_FRAME::Update3D_Frame(), FOOTPRINT_WIZARD_FRAME::Update3D_Frame(), DRC::updatePointers(), FOOTPRINT_VIEWER_FRAME::updateView(), FOOTPRINT_EDIT_FRAME::updateView(), DIALOG_NETLIST::verifyFootprints(), and DIALOG_DRC_CONTROL::writeReport().

182  {
183  wxASSERT( m_Pcb );
184  return m_Pcb;
185  }
EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox ( bool  aBoardEdgesOnly = false) const

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

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

Referenced by BestZoom().

294 {
295  wxASSERT( m_Pcb );
296 
297  EDA_RECT area = aBoardEdgesOnly ? m_Pcb->GetBoardEdgesBoundingBox() : m_Pcb->GetBoundingBox();
298 
299  if( area.GetWidth() == 0 && area.GetHeight() == 0 )
300  {
301  wxSize pageSize = GetPageSizeIU();
302 
304  {
305  area.SetOrigin( 0, 0 );
306  area.SetEnd( pageSize.x, pageSize.y );
307  }
308  else
309  {
310  area.SetOrigin( -pageSize.x / 2, -pageSize.y / 2 );
311  area.SetEnd( pageSize.x / 2, pageSize.y / 2 );
312  }
313  }
314 
315  return area;
316 }
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: class_board.h:827
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:839
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(), 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(), SCH_EDIT_FRAME::RotateHierarchicalSheet(), SetFastGrid1(), SetFastGrid2(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), SetNextGrid(), SetPrevGrid(), DIALOG_ERC::TestErc(), DRC::testUnconnected(), 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 ( )

Function GetCollectorsGuide.

Returns
GENERAL_COLLECTORS_GUIDE - that considers the global configuration options.

Definition at line 592 of file basepcbframe.cpp.

References GetActiveLayer(), BOARD::GetVisibleLayers(), BOARD::IsElementVisible(), m_Pcb, MOD_BK_VISIBLE, MOD_FR_VISIBLE, MOD_REFERENCES_VISIBLE, MOD_TEXT_BK_VISIBLE, MOD_TEXT_FR_VISIBLE, MOD_TEXT_INVISIBLE, MOD_VALUES_VISIBLE, PAD_BK_VISIBLE, PAD_FR_VISIBLE, and GENERAL_COLLECTORS_GUIDE::SetIgnoreMTextsMarkedNoShow().

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

593 {
595  GetActiveLayer() );
596 
597  // account for the globals
599  guide.SetIgnoreMTextsOnBack( ! m_Pcb->IsElementVisible( MOD_TEXT_BK_VISIBLE ));
600  guide.SetIgnoreMTextsOnFront( ! m_Pcb->IsElementVisible( MOD_TEXT_FR_VISIBLE ));
601  guide.SetIgnoreModulesOnBack( ! m_Pcb->IsElementVisible( MOD_BK_VISIBLE ) );
602  guide.SetIgnoreModulesOnFront( ! m_Pcb->IsElementVisible( MOD_FR_VISIBLE ) );
603  guide.SetIgnorePadsOnBack( ! m_Pcb->IsElementVisible( PAD_BK_VISIBLE ) );
604  guide.SetIgnorePadsOnFront( ! m_Pcb->IsElementVisible( PAD_FR_VISIBLE ) );
605  guide.SetIgnoreModulesVals( ! m_Pcb->IsElementVisible( MOD_VALUES_VISIBLE ) );
606  guide.SetIgnoreModulesRefs( ! m_Pcb->IsElementVisible( MOD_REFERENCES_VISIBLE ) );
607 
608  return guide;
609 }
show modules on front
text marked as invisible
virtual LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
show modules references (when texts are visibles)
void SetIgnoreMTextsMarkedNoShow(bool ignore)
Definition: collectors.h:528
bool IsElementVisible(int aPCB_VISIBLE) const
Function IsElementVisible tests whether a given element category is visible.
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
show modules values (when texts are visibles)
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 1148 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(), AddPad(), PCB_EDIT_FRAME::AutoPlaceModule(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Self(), PCB_EDIT_FRAME::Begin_Zone(), 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(), FOOTPRINT_EDIT_FRAME::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(), LIB_VIEW_FRAME::GeneralControl(), DISPLAY_FOOTPRINTS_FRAME::GeneralControl(), FOOTPRINT_VIEWER_FRAME::GeneralControl(), FOOTPRINT_WIZARD_FRAME::GeneralControl(), FOOTPRINT_EDIT_FRAME::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(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PL_EDITOR_FRAME::OnHotKey(), LIB_EDIT_FRAME::OnHotKey(), SCH_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), GERBVIEW_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), EDA_DRAW_PANEL::OnMouseEvent(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), PCB_EDIT_FRAME::OnRightClick(), LIB_VIEW_FRAME::OnSetRelativeOffset(), FOOTPRINT_VIEWER_FRAME::OnSetRelativeOffset(), FOOTPRINT_WIZARD_FRAME::OnSetRelativeOffset(), EDA_DRAW_FRAME::OnZoom(), DIALOG_UPDATE_PCB::PerformUpdate(), LIB_EDIT_FRAME::PlaceAnchor(), PlaceModule(), LIB_EDIT_FRAME::PlacePin(), PlaceTexteModule(), SCH_EDIT_FRAME::PrepareMoveItem(), FOOTPRINT_EDIT_FRAME::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(), FOOTPRINT_EDIT_FRAME::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(), UpdateStatusBar(), and GERBVIEW_FRAME::UpdateStatusBar().

1149 {
1150  // subject to change, borrow from old BASE_SCREEN for now.
1151  if( IsGalCanvasActive() )
1152  {
1154 
1155  return wxPoint( cursor.x, cursor.y );
1156  }
1157  else
1158  {
1159  BASE_SCREEN* screen = GetScreen(); // virtual call
1160  return screen->getCrossHairPosition( aInvertY );
1161  }
1162 }
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...
virtual VECTOR2D GetCursorPosition() const =0
Function GetCursorPosition() Returns the current cursor position in world coordinates.
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:795
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:803
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 1186 of file draw_frame.cpp.

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

1187 {
1188  BASE_SCREEN* screen = GetScreen(); // virtual call
1189  return screen->getCrossHairScreenPosition();
1190 }
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 ( )

Definition at line 586 of file basepcbframe.cpp.

References PCB_SCREEN::GetCurItem(), and 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(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), FOOTPRINT_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), PcbGeneralLocateAndDisplay(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::RemoveStruct(), Show_Zone_Corner_Or_Outline_While_Move_Mouse(), and PCB_EDIT_FRAME::SwitchLayer().

587 {
588  return GetScreen()->GetCurItem();
589 }
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.
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 1172 of file draw_frame.cpp.

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

1173 {
1174  BASE_SCREEN* screen = GetScreen(); // virtual call
1175  return screen->getCursorPosition( aOnGrid, GetGridOrigin(), aGridSize );
1176 }
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 & PCB_BASE_FRAME::GetDesignSettings ( ) const
virtual

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

Overloaded in FOOTPRINT_EDIT_FRAME.

Reimplemented in FOOTPRINT_EDIT_FRAME.

Definition at line 251 of file basepcbframe.cpp.

References BOARD::GetDesignSettings(), and m_Pcb.

Referenced by AddNewTrace(), AddPad(), PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), PAD_TOOL::applyPadSettings(), Autoroute_One_Track(), PCB_EDIT_FRAME::Begin_DrawSegment(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Self(), PAD_TOOL::copyPadSettings(), PCB_EDIT_FRAME::Create_MuWaveComponent(), PCB_EDIT_FRAME::CreateMuWaveBaseFootprint(), CreateNewModule(), PCB_EDIT_FRAME::createPopupMenuForTracks(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_GRAPHIC_ITEMS_OPTIONS::DIALOG_GRAPHIC_ITEMS_OPTIONS(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), PCB_EDIT_FRAME::DlgGlobalChange_PadSettings(), PCB_EDIT_FRAME::Edit_Gap(), PCB_EDIT_FRAME::EditDimension(), Export_Pad_Settings(), GlobalChange_PadSettings(), Import_Pad_Settings(), DIALOG_GLOBAL_MODULES_FIELDS_EDITION::initDialog(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnUpdateSelectAutoTrackWidth(), PCB_EDIT_FRAME::OnUpdateSelectCustomTrackWidth(), PCB_EDIT_FRAME::OnUpdateSelectTrackWidth(), PCB_EDIT_FRAME::OnUpdateSelectViaSize(), PCB_EDIT_FRAME::Other_Layer_Route(), DRAWING_TOOL::PlaceText(), PCB_EDIT_FRAME::PrepareLayerIndicator(), PCB_EDIT_FRAME::Process_Special_Functions(), PAD_TOOL::pushPadSettings(), ResetModuleTextSizes(), ResetTextSize(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), ShowNewTrackWhenMovingCursor(), PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event(), PCB_EDIT_FRAME::updateTraceWidthSelectBox(), and PCB_EDIT_FRAME::updateViaSizeSelectBox().

252 {
253  wxASSERT( m_Pcb );
254  return m_Pcb->GetDesignSettings();
255 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:530
void* PCB_BASE_FRAME::GetDisplayOptions ( )
inlineoverridevirtual

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 160 of file wxBasePcbFrame.h.

References m_DisplayOptions.

Referenced by PCB_EDIT_FRAME::Delete_Segment_Edge(), D_PAD::Draw(), VIA::Draw(), FOOTPRINT_EDIT_FRAME::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(), FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), PCB_EDIT_FRAME::OnSelectTool(), PCB_DRAW_PANEL_GAL::OnShow(), OnTogglePadDrawMode(), OnTogglePolarCoords(), OnUpdateCoordType(), PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode(), DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode(), FOOTPRINT_EDIT_FRAME::OnUpdateOptionsToolbar(), OnUpdatePadDrawMode(), DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode(), PCB_EDIT_FRAME::OnUpdateTraceDrawMode(), PCB_EDIT_FRAME::OnUpdateViaDrawMode(), PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle(), PCBNEW_CONTROL::PadDisplayMode(), PcbGeneralLocateAndDisplay(), PNS::TOOL_BASE::pickSingleItem(), PlaceModule(), FOOTPRINT_EDIT_FRAME::PrintPage(), PCB_EDIT_FRAME::PrintPage(), PCB_EDIT_FRAME::Process_Special_Functions(), PNS_KICAD_IFACE::SetHostFrame(), SetToolID(), SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), TraceAirWiresToTargets(), PCBNEW_CONTROL::TrackDisplayMode(), DIALOG_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_DISPLAY_OPTIONS::TransferDataToWindow(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings(), UpdateStatusBar(), PCBNEW_CONTROL::ViaDisplayMode(), and PCBNEW_CONTROL::ZoneDisplayMode().

160 { 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:121
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
MODULE * PCB_BASE_FRAME::GetFootprintFromBoardByReference ( )

Function GetFootprintFromBoardByReference.

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

Definition at line 60 of file modules.cpp.

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

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

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

Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.

Returns
Pointer to GAL-based canvas.

Definition at line 803 of file draw_frame.h.

References EDA_DRAW_FRAME::m_galCanvas.

Referenced by PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), GRID_HELPER::BestDragOrigin(), GRID_HELPER::BestSnapAnchor(), PCBNEW_CONTROL::CursorControl(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), PCB_EDIT_FRAME::Edit_Zone_Params(), EVT_TOOL(), EVT_UPDATE_UI(), PCB_EDIT_FRAME::Fill_Zone(), SELECTION_TOOL::findCallback(), EDA_DRAW_FRAME::GetCrossHairPosition(), PCBNEW_CONTROL::HighContrastMode(), PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), PCB_EDIT_FRAME::ListNetsAndSelect(), MODULE_EDITOR_TOOLS::ModuleEdgeOutlines(), MODULE_EDITOR_TOOLS::ModuleTextOutlines(), FOOTPRINT_EDIT_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), PCB_LAYER_WIDGET::OnLayerColorChange(), PCB_LAYER_WIDGET::OnLayerVisible(), DIALOG_DRC_CONTROL::OnLeftDClickClearance(), DIALOG_DRC_CONTROL::OnLeftDClickUnconnected(), DIALOG_DRC_CONTROL::OnMarkerSelectionEvent(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick(), DIALOG_DRC_CONTROL::OnPopupMenu(), PCB_LAYER_WIDGET::OnRenderColorChange(), PCB_LAYER_WIDGET::OnRenderEnable(), EDA_DRAW_FRAME::OnToggleGridState(), OnTogglePadDrawMode(), DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent(), OnUpdateSelectZoom(), OnUpdateSwitchCanvas(), PCBNEW_CONTROL::PadDisplayMode(), PCB_EDIT_FRAME::Process_Config(), TOOL_MANAGER::ProcessEvent(), GRID_HELPER::queryVisible(), RecalculateAllTracksNetcode(), DIALOG_PAD_PROPERTIES::redraw(), EDA_DRAW_PANEL::Refresh(), ZOOM_TOOL::selectRegion(), PCB_BASE_EDIT_FRAME::SetBoard(), FOOTPRINT_EDIT_FRAME::SetElementVisibility(), EDA_DRAW_PANEL::SetEnableMousewheelPan(), EDA_DRAW_PANEL::SetEnableZoomNoCenter(), FOOTPRINT_EDIT_FRAME::setupTools(), SwitchCanvas(), SELECTION_TOOL::toggleSelection(), PCBNEW_CONTROL::TrackDisplayMode(), DIALOG_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow(), UpdateMsgPanel(), FOOTPRINT_VIEWER_FRAME::updateView(), FOOTPRINT_EDIT_FRAME::updateView(), PCB_BASE_EDIT_FRAME::UseGalCanvas(), UseGalCanvas(), EDA_DRAW_FRAME::UseGalCanvas(), PCBNEW_CONTROL::ViaDisplayMode(), PCBNEW_CONTROL::ZoneDisplayMode(), COMMON_TOOLS::ZoomFitScreen(), SELECTION_TOOL::zoomFitSelection(), COMMON_TOOLS::ZoomInOut(), and COMMON_TOOLS::ZoomPreset().

803 { return m_galCanvas; }
EDA_DRAW_PANEL_GAL * m_galCanvas
GAL display options - this is the frame's interface to setting GAL display options.
Definition: draw_frame.h:67
virtual COLOR4D EDA_DRAW_FRAME::GetGridColor ( ) const
inlinevirtualinherited

Function GetGridColor() , virtual.

Returns
the color of the grid

Reimplemented in FOOTPRINT_EDIT_FRAME, PCB_EDIT_FRAME, DISPLAY_FOOTPRINTS_FRAME, and FOOTPRINT_VIEWER_FRAME.

Definition at line 435 of file draw_frame.h.

References EDA_DRAW_FRAME::m_gridColor.

Referenced by EDA_DRAW_PANEL::DrawGridAxis(), GERBVIEW_FRAME::GetVisibleElementColor(), and EDA_DRAW_FRAME::SaveSettings().

436  {
437  return m_gridColor;
438  }
COLOR4D m_gridColor
Grid color.
Definition: draw_frame.h:82
const wxPoint & PCB_BASE_FRAME::GetGridOrigin ( ) const
overridevirtual

Function GetGridOrigin returns the absolute coordinates of the origin of the snap grid.

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

Implements EDA_DRAW_FRAME.

Definition at line 223 of file basepcbframe.cpp.

References BOARD::GetGridOrigin(), and m_Pcb.

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

224 {
225  wxASSERT( m_Pcb );
226  return m_Pcb->GetGridOrigin();
227 }
const wxPoint & GetGridOrigin() const
Definition: class_board.h:339
wxPoint EDA_DRAW_FRAME::GetGridPosition ( const wxPoint aPosition) const
inherited

Function GetGridPosition returns the nearest grid position to aPosition if a screen is defined and snap to grid is enabled.

Otherwise, the original positions is returned.

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

Definition at line 556 of file draw_frame.cpp.

References EDA_DRAW_FRAME::GetNearestGridPosition(), EDA_DRAW_FRAME::m_currentScreen, and EDA_DRAW_FRAME::m_snapToGrid.

Referenced by SCH_EDIT_FRAME::HighlightConnectionAtPosition(), and SCH_EDIT_FRAME::OnLeftClick().

557 {
558  wxPoint pos = aPosition;
559 
560  if( m_currentScreen != NULL && m_snapToGrid )
561  pos = GetNearestGridPosition( aPosition );
562 
563  return pos;
564 }
BASE_SCREEN * m_currentScreen
current used SCREEN
Definition: draw_frame.h:62
wxPoint GetNearestGridPosition(const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
Function GetNearestGridPosition returns the nearest aGridSize location to aPosition.
bool m_snapToGrid
Indicates if cursor should be snapped to grid.
Definition: draw_frame.h:64
EDA_HOTKEY_CONFIG* EDA_DRAW_FRAME::GetHotkeyConfig ( ) const
inlineinherited

Function GetHotkeyConfig() Returns a structure containing currently used hotkey mapping.

Definition at line 345 of file draw_frame.h.

References EDA_DRAW_FRAME::m_hotkeysDescrList.

Referenced by PCBNEW_CONTROL::ShowHelp().

345 { return m_hotkeysDescrList; }
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
Definition: draw_frame.h:76
virtual EDA_HOTKEY* EDA_DRAW_FRAME::GetHotKeyDescription ( int  aCommand) const
pure virtualinherited

Function GetHotKeyDescription Searches lists of hot key identifiers (HK_xxx) used in the frame to find a matching hot key descriptor.

Parameters
aCommandis the hot key identifier.
Returns
Hot key descriptor or NULL if none found.

Implemented in GERBVIEW_FRAME, PCB_EDIT_FRAME, SCH_EDIT_FRAME, LIB_EDIT_FRAME, PL_EDITOR_FRAME, FOOTPRINT_WIZARD_FRAME, FOOTPRINT_EDIT_FRAME, FOOTPRINT_VIEWER_FRAME, DISPLAY_FOOTPRINTS_FRAME, and LIB_VIEW_FRAME.

Referenced by ACTION_MANAGER::processHotKey().

void EDA_BASE_FRAME::GetKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 525 of file basicframe.cpp.

References ShowAboutDialog().

526 {
527  bool ShowAboutDialog(wxWindow * parent);
528  ShowAboutDialog( this );
529 }
bool ShowAboutDialog(wxWindow *parent)
void EDA_BASE_FRAME::GetKicadContribute ( wxCommandEvent &  event)
inherited

Definition at line 514 of file basicframe.cpp.

References URL_GET_INVOLVED.

515 {
516  if( !wxLaunchDefaultBrowser( URL_GET_INVOLVED ) )
517  {
518  wxString msg = _( "Could not launch the default browser. For information on how to help the KiCad project, visit " );
519  msg.Append( URL_GET_INVOLVED );
520  wxMessageBox( msg, _( "Get involved with KiCad" ), wxOK, this );
521  }
522 }
#define URL_GET_INVOLVED
Definition: basicframe.cpp:51
void EDA_BASE_FRAME::GetKicadHelp ( wxCommandEvent &  event)
inherited

Definition at line 436 of file basicframe.cpp.

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

437 {
438  const SEARCH_STACK& search = sys_search();
439 
440  /* We have to get document for beginners,
441  * or the full specific doc
442  * if event id is wxID_INDEX, we want the document for beginners.
443  * else the specific doc file (its name is in Kiface().GetHelpFileName())
444  * The document for beginners is the same for all KiCad utilities
445  */
446  if( event.GetId() == wxID_INDEX )
447  {
448  // List of possible names for Getting Started in KiCad
449  const wxChar* names[2] = {
450  wxT( "getting_started_in_kicad" ),
451  wxT( "Getting_Started_in_KiCad" )
452  };
453 
454  wxString helpFile;
455  // Search for "getting_started_in_kicad.html" or "getting_started_in_kicad.pdf"
456  // or "Getting_Started_in_KiCad.html" or "Getting_Started_in_KiCad.pdf"
457  for( unsigned ii = 0; ii < DIM( names ); ii++ )
458  {
459  helpFile = SearchHelpFileFullPath( search, names[ii] );
460 
461  if( !helpFile.IsEmpty() )
462  break;
463  }
464 
465  if( !helpFile )
466  {
467  wxString msg = wxString::Format( _(
468  "Html or pdf help file \n'%s'\n or\n'%s' could not be found." ), names[0], names[1] );
469  wxMessageBox( msg );
470  }
471  else
472  {
473  GetAssociatedDocument( this, helpFile );
474  }
475 
476  return;
477  }
478 
479  wxString base_name = help_name();
480  wxString helpFile = SearchHelpFileFullPath( search, base_name );
481 
482  if( !helpFile )
483  {
484  wxString msg = wxString::Format( _(
485  "Help file '%s' could not be found." ),
486  GetChars( base_name )
487  );
488  wxMessageBox( msg );
489  }
490  else
491  {
492  GetAssociatedDocument( this, helpFile );
493  }
494 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, const wxPathList *aPaths)
Function GetAssociatedDocument open a document (file) with the suitable browser.
Definition: eda_doc.cpp:86
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
virtual const SEARCH_STACK & sys_search()
Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_M...
Definition: basicframe.cpp:370
wxString SearchHelpFileFullPath(const SEARCH_STACK &aSStack, const wxString &aBaseName)
Function SearchHelpFileFullPath returns the help file's full path.
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
virtual wxString help_name()
Definition: basicframe.cpp:376
wxString EDA_BASE_FRAME::GetMruPath ( ) const
inlineinherited

Definition at line 358 of file wxstruct.h.

References EDA_BASE_FRAME::m_mruPath.

Referenced by EDA_BASE_FRAME::ExportHotkeyConfigToFile(), EDA_BASE_FRAME::ImportHotkeyConfigFromFile(), and KICAD_MANAGER_FRAME::OnLoadProject().

358 { return m_mruPath; }
wxString m_mruPath
Most recently used path.
Definition: wxstruct.h:155
wxPoint EDA_DRAW_FRAME::GetNearestGridPosition ( const wxPoint aPosition,
wxRealPoint *  aGridSize = NULL 
) const
inherited

Function GetNearestGridPosition returns the nearest aGridSize location to aPosition.

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

Definition at line 1179 of file draw_frame.cpp.

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

Referenced by PCB_EDIT_FRAME::AppendBoardFile(), EDA_DRAW_PANEL::DrawGrid(), EDA_DRAW_FRAME::GeneralControlKeyMovement(), EDA_DRAW_FRAME::GetGridPosition(), LIB_EDIT_FRAME::HandleBlockEnd(), SCH_EDIT_FRAME::HandleBlockEnd(), LIB_EDIT_FRAME::HandleBlockPlace(), GERBVIEW_FRAME::Locate(), SCH_EDIT_FRAME::LocateAndShowItem(), LIB_EDIT_FRAME::LocateItemUsingCursor(), PCB_EDIT_FRAME::OnRightClick(), and resizeSheetWithMouseCursor().

1180 {
1181  BASE_SCREEN* screen = GetScreen(); // virtual call
1182  return screen->getNearestGridPosition( aPosition, GetGridOrigin(), aGridSize );
1183 }
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 getNearestGridPosition(const wxPoint &aPosition, const wxPoint &aGridOrigin, wxRealPoint *aGridSize) const
Function getNearestGridPosition returns the nearest aGridSize location to aPosition.
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
virtual const wxPoint & GetGridOrigin() const =0
Function GetGridOrigin returns the absolute coordinates of the origin of the snap grid...
const PAGE_INFO & PCB_BASE_FRAME::GetPageSettings ( ) const
overridevirtual

Implements EDA_DRAW_FRAME.

Definition at line 191 of file basepcbframe.cpp.

References BOARD::GetPageSettings(), and m_Pcb.

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

192 {
193  wxASSERT( m_Pcb );
194  return m_Pcb->GetPageSettings();
195 }
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:545
const wxSize PCB_BASE_FRAME::GetPageSizeIU ( ) const
overridevirtual

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

Implements EDA_DRAW_FRAME.

Definition at line 198 of file basepcbframe.cpp.

References BOARD::GetPageSettings(), and m_Pcb.

Referenced by PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::Clear_Pcb(), GetBoardBoundingBox(), DIALOG_DXF_IMPORT::OnOKClick(), PCB_EDIT_FRAME::OpenProjectFiles(), and FOOTPRINT_EDIT_FRAME::PrintPage().

199 {
200  wxASSERT( m_Pcb );
201 
202  // this function is only needed because EDA_DRAW_FRAME is not compiled
203  // with either -DPCBNEW or -DEESCHEMA, so the virtual is used to route
204  // into an application specific source file.
205  return m_Pcb->GetPageSettings().GetSizeIU();
206 }
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:545
const PCB_PLOT_PARAMS & PCB_BASE_FRAME::GetPlotSettings ( ) const
virtual

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

Overloaded in FOOTPRINT_EDIT_FRAME.

Reimplemented in FOOTPRINT_EDIT_FRAME.

Definition at line 279 of file basepcbframe.cpp.

References BOARD::GetPlotOptions(), and m_Pcb.

Referenced by DIALOG_GENDRILL::DIALOG_GENDRILL(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), DIALOG_PRINT_FOR_MODEDIT::OnPrintButtonClick(), and DIALOG_PRINT_USING_PRINTER::SetPrintParameters().

280 {
281  wxASSERT( m_Pcb );
282  return m_Pcb->GetPlotOptions();
283 }
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: class_board.h:548
PCB_SCREEN* PCB_BASE_FRAME::GetScreen ( ) const
inlineoverridevirtual

Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.

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

Reimplemented from EDA_DRAW_FRAME.

Definition at line 199 of file wxBasePcbFrame.h.

References EDA_DRAW_FRAME::GetScreen().

Referenced by Abort_MoveOrCopyModule(), PCB_EDIT_FRAME::Add45DegreeSegment(), AddNewTrace(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::AutoPlaceModule(), PCB_EDIT_FRAME::Autoroute(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Self(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Duplicate(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Block_Rotate(), PCB_EDIT_FRAME::Block_SelectItems(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::doAutoSave(), D_PAD::Draw(), VIA::Draw(), PCB_BASE_EDIT_FRAME::duplicateItem(), PCB_EDIT_FRAME::duplicateItems(), PCB_EDIT_FRAME::duplicateZone(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::End_Zone(), PCB_EDIT_FRAME::Files_io_from_id(), DISPLAY_FOOTPRINTS_FRAME::GeneralControl(), FOOTPRINT_WIZARD_FRAME::GeneralControl(), PCB_EDIT_FRAME::GeneralControl(), GetActiveLayer(), GetCurItem(), GRID_HELPER::GetGrid(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), PCB_EDIT_FRAME::HandleBlockEnd(), FOOTPRINT_EDIT_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HandleBlockPlace(), PCBNEW_CONTROL::LayerToggle(), Magnetize(), PCB_EDIT_FRAME::moveExact(), DIALOG_FIND::onButtonFindItemClick(), DIALOG_FIND::onButtonFindMarkerClick(), FOOTPRINT_EDIT_FRAME::OnCloseWindow(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnExportSTEP(), FOOTPRINT_VIEWER_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), OnModify(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), FOOTPRINT_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), FOOTPRINT_VIEWER_FRAME::OnSetRelativeOffset(), FOOTPRINT_WIZARD_FRAME::OnSetRelativeOffset(), PCB_EDIT_FRAME::OnUpdateSave(), OnUpdateSelectGrid(), OnUpdateSelectZoom(), ROUTER_TOOL::onViaCommand(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::Other_Layer_Route(), ROUTER_TOOL::prepareInteractive(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), PCB_EDIT_FRAME::PrepareLayerIndicator(), PCB_EDIT_FRAME::PrintPage(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::RedrawActiveWindow(), PCB_EDIT_FRAME::RedrawActiveWindow(), PCBNEW_CONTROL::ResetCoords(), PCB_EDIT_FRAME::SavePcbFile(), SelectCopperLayerPair(), SetActiveLayer(), SetCurItem(), SetFastGrid1(), SetFastGrid2(), SetPageSettings(), SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), DIALOG_SET_GRID::TransferDataFromWindow(), PCBNEW_CONTROL::updateGrid(), updateGridSelectBox(), UpdateMsgPanel(), UpdateStatusBar(), updateZoomSelectBox(), and DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME().

199 { return (PCB_SCREEN*) EDA_DRAW_FRAME::GetScreen(); }
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
wxString EDA_DRAW_FRAME::GetScreenDesc ( ) const
virtualinherited

Reimplemented in SCH_EDIT_FRAME.

Definition at line 120 of file worksheet.cpp.

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

121 {
122  // Virtual function. In basic class, returns
123  // an empty string.
124  return wxEmptyString;
125 }
const wxPoint & EDA_DRAW_FRAME::GetScrollCenterPosition ( ) const
inherited

Definition at line 1207 of file draw_frame.cpp.

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

Referenced by SCH_EDIT_FRAME::DisplayCurrentSheet(), EDA_DRAW_PANEL::OnMouseEvent(), EDA_DRAW_PANEL::OnPan(), EDA_DRAW_PANEL::OnScroll(), EDA_DRAW_FRAME::OnSelectZoom(), EDA_DRAW_FRAME::OnZoom(), EDA_DRAW_FRAME::SetPresetZoom(), and EDA_DRAW_FRAME::Zoom_Automatique().

1208 {
1209  BASE_SCREEN* screen = GetScreen(); // virtual call
1210  return screen->getScrollCenterPosition();
1211 }
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 ...)
const wxPoint & getScrollCenterPosition() const
bool EDA_DRAW_FRAME::GetShowBorderAndTitleBlock ( ) const
inlineinherited

Definition at line 293 of file draw_frame.h.

References EDA_DRAW_FRAME::m_showBorderAndTitleBlock.

Referenced by DIALOG_PAGE_SHOW_PAGE_BORDERS::DIALOG_PAGE_SHOW_PAGE_BORDERS(), and DIALOG_DISPLAY_OPTIONS::initOptDialog().

293 { return m_showBorderAndTitleBlock; }
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:112
const TITLE_BLOCK & PCB_BASE_FRAME::GetTitleBlock ( ) const
overridevirtual

Implements EDA_DRAW_FRAME.

Definition at line 237 of file basepcbframe.cpp.

References BOARD::GetTitleBlock(), and m_Pcb.

Referenced by CreateHeaderInfoData().

238 {
239  wxASSERT( m_Pcb );
240  return m_Pcb->GetTitleBlock();
241 }
TITLE_BLOCK & GetTitleBlock()
Definition: class_board.h:551
int EDA_DRAW_FRAME::GetToolId ( ) const
inlineinherited

Definition at line 406 of file draw_frame.h.

References EDA_DRAW_FRAME::m_toolId.

Referenced by PCB_EDIT_FRAME::Begin_Zone(), LIB_EDIT_FRAME::CreateGraphicItem(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), D_PAD::Draw(), LIB_EDIT_FRAME::EndDrawGraphicItem(), PCB_EDIT_FRAME::GeneralControl(), PL_EDITOR_FRAME::HandleBlockEnd(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), GERBVIEW_FRAME::HandleBlockEnd(), LIB_EDIT_FRAME::HandleBlockEnd(), PCB_EDIT_FRAME::HandleBlockEnd(), SCH_EDIT_FRAME::HandleBlockEnd(), PL_EDITOR_FRAME::HandleBlockPlace(), FOOTPRINT_EDIT_FRAME::HandleBlockPlace(), GERBVIEW_FRAME::HandleBlockPlace(), LIB_EDIT_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HandleBlockPlace(), SCH_EDIT_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::MuWaveCommand(), SCH_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), EDA_DRAW_PANEL::OnMouseEvent(), SCH_EDIT_FRAME::OnMoveItem(), FOOTPRINT_EDIT_FRAME::OnRightClick(), GERBVIEW_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRotateItem(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), LIB_EDIT_FRAME::OnSelectTool(), PCB_EDIT_FRAME::OnSelectTool(), LIB_EDIT_FRAME::OnUpdateEditingPart(), PCB_EDIT_FRAME::OnUpdateMuWaveToolbar(), PL_EDITOR_FRAME::OnUpdateSelectTool(), GERBVIEW_FRAME::OnUpdateSelectTool(), SCH_EDIT_FRAME::OnUpdateSelectTool(), FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar(), PCB_EDIT_FRAME::OnUpdateVerticalToolbar(), PcbGeneralLocateAndDisplay(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), SetToolID(), and PCB_EDIT_FRAME::SwitchLayer().

406 { return m_toolId; }
double EDA_DRAW_FRAME::GetZoom ( )
inherited

Function GetZoom.

Returns
The current zoom level.

Definition at line 480 of file draw_frame.cpp.

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

Referenced by SCH_EDIT_FRAME::FindComponentAndItem(), SCH_EDIT_FRAME::OnFindDrcMarker(), EDA_DRAW_FRAME::OnSelectZoom(), SCH_EDIT_FRAME::updateFindReplaceView(), and updateZoomSelectBox().

481 {
482  return GetScreen()->GetZoom();
483 }
double GetZoom() const
Function GetZoom returns the current "zoom factor", which is a measure of "internal units per device ...
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
double EDA_DRAW_FRAME::GetZoomLevelCoeff ( ) const
inlineinherited

Function GetZoomLevelCoeff returns the coefficient to convert internal display scale factor to zoom level.

Definition at line 382 of file draw_frame.h.

References EDA_DRAW_FRAME::m_zoomLevelCoeff.

Referenced by ZOOM_MENU::ZOOM_MENU().

382 { return m_zoomLevelCoeff; }
double m_zoomLevelCoeff
a suitable value to convert the internal zoom scaling factor
Definition: draw_frame.h:85
const wxString PCB_BASE_FRAME::GetZoomLevelIndicator ( ) const
overridevirtual

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

Virtual from the base class

Reimplemented from EDA_DRAW_FRAME.

Definition at line 810 of file basepcbframe.cpp.

References EDA_DRAW_FRAME::GetZoomLevelIndicator().

811 {
813 }
virtual const wxString GetZoomLevelIndicator() const
Function GetZoomLevelIndicator returns a human readable value which can be displayed as zoom level in...
Definition: draw_frame.cpp:661
void PCB_BASE_FRAME::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.

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

Definition at line 146 of file globaleditpad.cpp.

References MODULE::CalculateBoundingBox(), EDA_ITEM::ClearFlags(), CONNEXION_OK, DisplayError(), DO_NOT_DRAW, D_PAD::GetAttribute(), MODULE::GetBoundingBox(), D_PAD::GetDelta(), GetDesignSettings(), D_PAD::GetDrillShape(), D_PAD::GetDrillSize(), MODULE::GetFPID(), D_PAD::GetLayerSet(), D_PAD::GetLocalSolderMaskMargin(), D_PAD::GetLocalSolderPasteMargin(), D_PAD::GetLocalSolderPasteMarginRatio(), D_PAD::GetOffset(), MODULE::GetOrientation(), D_PAD::GetOrientation(), D_PAD::GetParent(), D_PAD::GetShape(), D_PAD::GetSize(), LISTE_RATSNEST_ITEM_OK, EDA_DRAW_FRAME::m_canvas, BOARD::m_Modules, BOARD_DESIGN_SETTINGS::m_Pad_Master, m_Pcb, BOARD::m_Status_Pcb, MODULE::Next(), D_PAD::Next(), OnModify(), PAD_ATTRIB_CONN, PAD_ATTRIB_SMD, PAD_SHAPE_CIRCLE, PAD_SHAPE_TRAPEZOID, MODULE::Pads(), PICKED_ITEMS_LIST::PushItem(), EDA_DRAW_PANEL::RefreshDrawingRect(), SaveCopyInUndoList(), EDA_ITEM::SetFlags(), and UR_CHANGED.

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

152 {
153  if( aPad == NULL )
155 
156  MODULE* module = aPad->GetParent();
157 
158  if( module == NULL )
159  {
160  DisplayError( this, wxT( "Global_Import_Pad_Settings() Error: NULL module" ) );
161  return;
162  }
163 
164  // Search and copy the name of library reference.
165  MODULE* Module_Ref = module;
166  double pad_orient = aPad->GetOrientation() - Module_Ref->GetOrientation();
167 
168  // Prepare an undo list:
169  if( aSaveForUndo )
170  {
171  PICKED_ITEMS_LIST itemsList;
172 
173  for( module = m_Pcb->m_Modules; module; module = module->Next() )
174  {
175  if( !aSameFootprints && (module != Module_Ref) )
176  continue;
177 
178  if( module->GetFPID() != Module_Ref->GetFPID() )
179  continue;
180 
181  bool saveMe = false;
182 
183  for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
184  {
185  // Filters changes prohibited.
186  if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) )
187  continue;
188 
189  double currpad_orient = pad->GetOrientation() - module->GetOrientation();
190 
191  if( aPadOrientFilter && ( currpad_orient != pad_orient ) )
192  continue;
193 
194  if( aPadLayerFilter && pad->GetLayerSet() != aPad->GetLayerSet() )
195  continue;
196 
197  saveMe = true;
198  }
199 
200  if( saveMe )
201  {
202  ITEM_PICKER itemWrapper( module, UR_CHANGED );
203 
204  itemsList.PushItem( itemWrapper );
205  }
206  }
207 
208  SaveCopyInUndoList( itemsList, UR_CHANGED );
209  }
210 
211  // Update the current module and same others modules if requested.
212  for( module = m_Pcb->m_Modules; module; module = module->Next() )
213  {
214  if( !aSameFootprints && (module != Module_Ref) )
215  continue;
216 
217  if( module->GetFPID() != Module_Ref->GetFPID() )
218  continue;
219 
220  // Erase module on screen
221  if( aRedraw )
222  {
223  module->SetFlags( DO_NOT_DRAW );
225  module->ClearFlags( DO_NOT_DRAW );
226  }
227 
228  for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
229  {
230  // Filters changes prohibited.
231  if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) )
232  continue;
233 
234  if( aPadOrientFilter && (pad->GetOrientation() - module->GetOrientation()) != pad_orient )
235  continue;
236 
237  if( aPadLayerFilter )
238  {
239  if( pad->GetLayerSet() != aPad->GetLayerSet() )
240  continue;
241  else
243  }
244 
245  // Change characteristics:
246  pad->SetAttribute( aPad->GetAttribute() );
247  pad->SetShape( aPad->GetShape() );
248 
249  pad->SetLayerSet( aPad->GetLayerSet() );
250 
251  pad->SetSize( aPad->GetSize() );
252  pad->SetDelta( aPad->GetDelta() );
253  pad->SetOffset( aPad->GetOffset() );
254 
255  pad->SetDrillSize( aPad->GetDrillSize() );
256  pad->SetDrillShape( aPad->GetDrillShape() );
257 
258  pad->SetOrientation( pad_orient + module->GetOrientation() );
259 
260  // copy also local mask margins, because these parameters usually depend on
261  // pad sizes and layers
262  pad->SetLocalSolderMaskMargin( aPad->GetLocalSolderMaskMargin() );
263  pad->SetLocalSolderPasteMargin( aPad->GetLocalSolderPasteMargin() );
264  pad->SetLocalSolderPasteMarginRatio( aPad->GetLocalSolderPasteMarginRatio() );
265 
266  if( pad->GetShape() != PAD_SHAPE_TRAPEZOID )
267  {
268  pad->SetDelta( wxSize( 0, 0 ) );
269  }
270 
271  if( pad->GetShape() == PAD_SHAPE_CIRCLE )
272  {
273  // Ensure pad size.y = pad size.x
274  int size = pad->GetSize().x;
275  pad->SetSize( wxSize( size, size ) );
276  }
277 
278  switch( pad->GetAttribute() )
279  {
280  case PAD_ATTRIB_SMD:
281  case PAD_ATTRIB_CONN:
282  pad->SetDrillSize( wxSize( 0, 0 ) );
283  break;
284 
285  default:
286  break;
287  }
288  }
289 
290  module->CalculateBoundingBox();
291 
292  if( aRedraw )
294  }
295 
296  OnModify();
297 }
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:238
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
int GetLocalSolderMaskMargin() const
Definition: class_pad.h:243
MODULE * Next() const
Definition: class_module.h:99
MODULE * GetParent() const
Definition: class_pad.h:108
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:59
void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
Definition: draw_panel.cpp:306
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: class_pad.h:221
void PushItem(const ITEM_PICKER &aItem)
Function PushItem pushes aItem to the top of the list.
const wxSize & GetDrillSize() const
Definition: class_pad.h:188
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:166
const LIB_ID & GetFPID() const
Definition: class_module.h:151
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:253
double GetOrientation() const
Definition: class_module.h:147
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:235
D_PAD * Next() const
Definition: class_pad.h:106
const wxSize & GetSize() const
Definition: class_pad.h:182
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
int GetLocalSolderPasteMargin() const
Definition: class_pad.h:249
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:60
double GetLocalSolderPasteMarginRatio() const
Definition: class_pad.h:252
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...
DLIST< MODULE > m_Modules
Definition: class_board.h:243
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:214
D_PAD m_Pad_Master
A dummy pad to store all default parameters.
const wxSize & GetDelta() const
Definition: class_pad.h:185
virtual void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0))=0
Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:254
DLIST< D_PAD > & Pads()
Definition: class_module.h:133
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
const wxPoint & GetOffset() const
Definition: class_pad.h:191
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:125
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240
bool EDA_DRAW_FRAME::HandleBlockBegin ( wxDC *  aDC,
EDA_KEY  aKey,
const wxPoint aPosition,
int  aExplicitCommand = 0 
)
virtualinherited

Function HandleBlockBegin initializes the block command including the command type, initial position, and other variables.

Parameters
aExplicitCommand- if this is given, begin with this command, rather than looking up the command from aKey.

Definition at line 801 of file draw_frame.cpp.

References BLOCK_COPY, BLOCK_COPY_AND_INCREMENT, BLOCK_DELETE, BLOCK_DRAG, BLOCK_DRAG_ITEM, BLOCK_FLIP, BLOCK_IDLE, BLOCK_MIRROR_X, BLOCK_MIRROR_Y, BLOCK_MOVE, BLOCK_PASTE, BLOCK_PRESELECT_MOVE, BLOCK_ROTATE, BLOCK_SAVE, BLOCK_ZOOM, EDA_DRAW_FRAME::BlockCommand(), EDA_DRAW_PANEL::CallMouseCapture(), BLOCK_SELECTOR::ClearItemsList(), DisplayError(), BLOCK_SELECTOR::GetCommand(), BLOCK_SELECTOR::GetCount(), EDA_DRAW_FRAME::GetScreen(), BLOCK_SELECTOR::GetState(), EDA_DRAW_FRAME::InitBlockPasteInfos(), BLOCK_SELECTOR::InitData(), EDA_DRAW_PANEL::IsMouseCaptured(), BASE_SCREEN::m_BlockLocate, EDA_DRAW_FRAME::m_canvas, BLOCK_SELECTOR::SetCommand(), BLOCK_SELECTOR::SetLastCursorPosition(), BLOCK_SELECTOR::SetMessageBlock(), EDA_DRAW_PANEL::SetMouseCaptureCallback(), BLOCK_SELECTOR::SetState(), STATE_BLOCK_MOVE, and STATE_NO_BLOCK.

Referenced by PCB_EDIT_FRAME::AppendBoardFile(), PCB_BASE_EDIT_FRAME::duplicateItem(), SCH_EDIT_FRAME::OnDragItem(), EDA_DRAW_PANEL::OnMouseEvent(), and SCH_EDIT_FRAME::Process_Special_Functions().

803 {
805 
806  if( ( block->GetCommand() != BLOCK_IDLE ) || ( block->GetState() != STATE_NO_BLOCK ) )
807  return false;
808 
809  if( aExplicitCommand == 0 )
810  block->SetCommand( (BLOCK_COMMAND_T) BlockCommand( aKey ) );
811  else
812  block->SetCommand( (BLOCK_COMMAND_T) aExplicitCommand );
813 
814  if( block->GetCommand() == 0 )
815  return false;
816 
817  switch( block->GetCommand() )
818  {
819  case BLOCK_IDLE:
820  break;
821 
822  case BLOCK_MOVE: // Move
823  case BLOCK_DRAG: // Drag (block defined)
824  case BLOCK_DRAG_ITEM: // Drag from a drag item command
825  case BLOCK_COPY: // Copy
826  case BLOCK_COPY_AND_INCREMENT: // Copy and increment relevant references
827  case BLOCK_DELETE: // Delete
828  case BLOCK_SAVE: // Save
829  case BLOCK_ROTATE: // Rotate 90 deg
830  case BLOCK_FLIP: // Flip
831  case BLOCK_ZOOM: // Window Zoom
832  case BLOCK_MIRROR_X:
833  case BLOCK_MIRROR_Y: // mirror
834  case BLOCK_PRESELECT_MOVE: // Move with preselection list
835  block->InitData( m_canvas, aPosition );
836  break;
837 
838  case BLOCK_PASTE:
839  block->InitData( m_canvas, aPosition );
840  block->SetLastCursorPosition( wxPoint( 0, 0 ) );
842 
843  if( block->GetCount() == 0 ) // No data to paste
844  {
845  DisplayError( this, wxT( "No block to paste" ), 20 );
848  return true;
849  }
850 
851  if( !m_canvas->IsMouseCaptured() )
852  {
853  block->ClearItemsList();
854  DisplayError( this,
855  wxT( "EDA_DRAW_FRAME::HandleBlockBegin() Err: m_mouseCaptureCallback NULL" ) );
856  return true;
857  }
858 
859  block->SetState( STATE_BLOCK_MOVE );
860  m_canvas->CallMouseCapture( aDC, aPosition, false );
861  break;
862 
863  default:
864  {
865  wxString msg;
866  msg << wxT( "EDA_DRAW_FRAME::HandleBlockBegin() error: Unknown command " ) <<
867  block->GetCommand();
868  DisplayError( this, msg );
869  }
870  break;
871  }
872 
873  block->SetMessageBlock( this );
874  return true;
875 }
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
virtual int BlockCommand(EDA_KEY aKey)
Function BlockCommand Returns the block command code (BLOCK_MOVE, BLOCK_COPY...) corresponding to the...
Definition: draw_frame.cpp:626
void SetMessageBlock(EDA_DRAW_FRAME *frame)
Function SetMessageBlock Displays the type of block command in the status bar of the window...
BLOCK_COMMAND_T
virtual void InitBlockPasteInfos()
Definition: draw_frame.cpp:632
void ClearItemsList()
Function ClearItemsList clear only the list of EDA_ITEM pointers, it does NOT delete the EDA_ITEM obj...
void SetState(BLOCK_STATE_T aState)
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 IsMouseCaptured() const
void CallMouseCapture(wxDC *aDC, const wxPoint &aPosition, bool aErase)
Function CallMouseCapture calls the mouse capture callback.
void SetMouseCaptureCallback(MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback)
Definition: solve.cpp:178
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
BLOCK_STATE_T GetState() const
BLOCK_COMMAND_T GetCommand() const
void InitData(EDA_DRAW_PANEL *Panel, const wxPoint &startpos)
Function InitData sets the initial values of a BLOCK_SELECTOR, before starting a block command...
void SetLastCursorPosition(const wxPoint &aPosition)
Function SetLastCursorPosition sets the last cursor position to aPosition.
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
unsigned GetCount() const
void SetCommand(BLOCK_COMMAND_T aCommand)
bool EDA_DRAW_FRAME::HandleBlockEnd ( wxDC *  DC)
virtualinherited

Function HandleBlockEnd( ) Handle the "end" of a block command, i.e.

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

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

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

Definition at line 644 of file draw_frame.cpp.

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

645 {
646  return false;
647 }
void EDA_DRAW_FRAME::HandleBlockPlace ( wxDC *  DC)
virtualinherited

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

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

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

Definition at line 639 of file draw_frame.cpp.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

640 {
641 }
wxString EDA_BASE_FRAME::help_name ( )
protectedvirtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 376 of file basicframe.cpp.

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

Referenced by EDA_BASE_FRAME::GetKicadHelp().

377 {
378  return Kiface().GetHelpFileName();
379 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
const wxString & GetHelpFileName() const
Function GetHelpFileName returns just the basename portion of the current help file.
Definition: kiface_i.h:119
void PCB_BASE_FRAME::Import_Pad_Settings ( D_PAD aPad,
bool  aDraw 
)

Definition at line 63 of file pad_edition_functions.cpp.

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

Referenced by AddPad(), MODULE_EDITOR_TOOLS::PlacePad(), and PCB_EDIT_FRAME::Process_Special_Functions().

64 {
65  if( aDraw )
66  {
67  aPad->SetFlags( DO_NOT_DRAW );
69  aPad->ClearFlags( DO_NOT_DRAW );
70  }
71 
72  const D_PAD& mp = GetDesignSettings().m_Pad_Master;
73 
74  aPad->ImportSettingsFromMaster( mp );
75 
76  if( aDraw )
78 
79  aPad->GetParent()->SetLastEditTime();
80 
81  OnModify();
82 }
MODULE * GetParent() const
Definition: class_pad.h:108
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:269
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:253
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:1050
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...
D_PAD m_Pad_Master
A dummy pad to store all default parameters.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:254
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: class_pad.cpp:181
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:125
void EDA_BASE_FRAME::ImportHotkeyConfigFromFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

Function ImportHotkeyConfigFromFile 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 737 of file hotkeys_basic.cpp.

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

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 FOOTPRINT_EDIT_FRAME::ProcessPreferences().

739 {
740  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
741  wxString mask = wxT( "*." ) + ext;
742 
743 #if 0 // pass in the project dir as an argument
744  wxString path = wxPathOnly( Prj().GetProjectFullName() );
745 #else
746  wxString path = GetMruPath();
747 #endif
748  wxFileName fn( aDefaultShortname );
749  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
750 
751  wxString filename = EDA_FILE_SELECTOR( _( "Read Hotkey Configuration File:" ),
752  path,
753  fn.GetFullPath(),
754  ext,
755  mask,
756  this,
757  wxFD_OPEN,
758  true );
759 
760  if( filename.IsEmpty() )
761  return;
762 
763  ReadHotkeyConfigFile( filename, aDescList );
764  SetMruPath( wxFileName( filename ).GetPath() );
765 }
void SetMruPath(const wxString &aPath)
Definition: wxstruct.h:356
int ReadHotkeyConfigFile(const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList)
Function ReadHotkeyConfigFile Read an old configuration file (<file>.key) and fill the current ho...
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
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
wxString GetMruPath() const
Definition: wxstruct.h:358
void EDA_DRAW_FRAME::InitBlockPasteInfos ( )
virtualinherited

Reimplemented in SCH_EDIT_FRAME.

Definition at line 632 of file draw_frame.cpp.

References BLOCK_SELECTOR::ClearItemsList(), EDA_DRAW_FRAME::GetScreen(), BASE_SCREEN::m_BlockLocate, EDA_DRAW_FRAME::m_canvas, and EDA_DRAW_PANEL::SetMouseCaptureCallback().

Referenced by EDA_DRAW_FRAME::HandleBlockBegin().

633 {
636 }
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
void ClearItemsList()
Function ClearItemsList clear only the list of EDA_ITEM pointers, it does NOT delete the EDA_ITEM obj...
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
void SetMouseCaptureCallback(MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback)
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
void PCB_BASE_FRAME::InstallPadOptionsFrame ( D_PAD pad)

Definition at line 94 of file dialog_pad_properties.cpp.

Referenced by DIALOG_GLOBAL_PADS_EDITION::InstallPadEditor(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), and FOOTPRINT_EDIT_FRAME::ToolOnRightClick().

95 {
96  DIALOG_PAD_PROPERTIES dlg( this, aPad );
97  dlg.ShowModal();
98 }
class DIALOG_PAD_PROPERTIES, derived from DIALOG_PAD_PROPERTIES_BASE, created by wxFormBuilder ...
bool PCB_BASE_FRAME::InvokeDialogGrid ( )

Definition at line 294 of file dialog_set_grid.cpp.

References EDA_DRAW_FRAME::m_gridSelectBox.

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

295 {
296  DIALOG_SET_GRID dlg( this, m_gridSelectBox->GetStrings() );
297  return dlg.ShowModal();
298 }
wxChoice * m_gridSelectBox
Choice box to choose the grid size.
Definition: draw_frame.h:115
virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Function autoSaveRequired returns the auto save status of the application.

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

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 168 of file wxstruct.h.

Referenced by