KiCad PCB EDA Suite
FOOTPRINT_WIZARD_FRAME Class Reference

Class FOOTPRINT_WIZARD_FRAME. More...

#include <footprint_wizard_frame.h>

Inheritance diagram for FOOTPRINT_WIZARD_FRAME:
PCB_BASE_FRAME EDA_DRAW_FRAME KIWAY_PLAYER EDA_BASE_FRAME KIWAY_HOLDER

Public Member Functions

 FOOTPRINT_WIZARD_FRAME (KIWAY *aKiway, wxWindow *parent, FRAME_T aFrameType)
 
 ~FOOTPRINT_WIZARD_FRAME ()
 
MODULEGetBuiltFootprint ()
 
void PythonPluginsReload ()
 Reload the Python plugins if they are newer than the already loaded, and load new plugins if any Do nothing if KICAD_SCRIPTING is not defined. More...
 
EDA_3D_VIEWERGet3DViewerFrame ()
 
MODULELoadFootprint (const LIB_ID &aFootprintId)
 Function LoadFootprint attempts to load aFootprintId from the footprint library table. More...
 
EDA_RECT GetBoardBoundingBox (bool aBoardEdgesOnly=false) const
 Function GetBoardBoundingBox calculates the bounding box containing all board items (or board edge segments). More...
 
virtual void SetPageSettings (const PAGE_INFO &aPageSettings) override
 
const PAGE_INFOGetPageSettings () const override
 
const wxSize GetPageSizeIU () const override
 Function GetPageSizeIU works off of GetPageSettings() to return the size of the paper page in the internal units of this particular view. More...
 
const wxPointGetAuxOrigin () const override
 Function GetAuxOrigin returns the origin of the axis used for plotting and various exports. More...
 
void SetAuxOrigin (const wxPoint &aPoint) override
 
const wxPointGetGridOrigin () const override
 Function GetGridOrigin returns the absolute coordinates of the origin of the snap grid. More...
 
void SetGridOrigin (const wxPoint &aPoint) override
 
const TITLE_BLOCKGetTitleBlock () const override
 
void SetTitleBlock (const TITLE_BLOCK &aTitleBlock) override
 
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 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...
 
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 FocusOnLocation (const wxPoint &aPos, bool aWarpMouseCursor=true, bool aCenterView=false)
 Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor) at a given coordinate and reframes the drawing if the requested point is out of view or if center on location is requested. More...
 
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, wxPoint aMoveVector)
 Function build_ratsnest_module Build a ratsnest relative to one footprint. More...
 
void TraceModuleRatsNest (wxDC *aDC)
 Function TraceModuleRatsNest display the rats nest of a moving footprint, computed by build_ratsnest_module() More...
 
void Build_Board_Ratsnest ()
 Function Build_Board_Ratsnest. More...
 
void DrawGeneralRatsnest (wxDC *aDC, int aNetcode=0)
 function Displays the general ratsnest Only ratsnest with the status bit CH_VISIBLE is set are displayed More...
 
void TraceAirWiresToTargets (wxDC *aDC)
 Function TraceAirWiresToTargets This functions shows airwires to nearest connecting points (pads) from the current new track end during track creation Uses data prepared by BuildAirWiresTargetsList() More...
 
void BuildAirWiresTargetsList (BOARD_CONNECTED_ITEM *aItemRef, const wxPoint &aPosition, int aNet)
 Function BuildAirWiresTargetsList Build a list of candidates that can be a coonection point when a track is started. More...
 
void TestForActiveLinksInRatsnest (int aNetCode)
 Function TestForActiveLinksInRatsnest Explores the full rats nest list (which must exist) to determine the ACTIVE links in the full rats nest list When tracks exist between pads, a link can connect 2 pads already connected by a track and the link is said inactive. More...
 
void TestConnections ()
 Function TestConnections tests the connections relative to all nets. More...
 
void TestNetConnection (wxDC *aDC, int aNetCode)
 Function TestNetConnection tests the connections relative to aNetCode. More...
 
void ComputeLegacyConnections ()
 Function RecalculateAllTracksNetcode search connections between tracks and pads and propagate pad net codes to the track segments. More...
 
PCB_LAYER_ID SelectLayer (PCB_LAYER_ID aDefaultLayer, LSET aNotAllowedLayersMask=LSET(), wxPoint aDlgPosition=wxDefaultPosition)
 Install the dialog box for layer selection. More...
 
void SelectCopperLayerPair ()
 
virtual void SwitchLayer (wxDC *DC, PCB_LAYER_ID layer)
 
virtual void SetActiveLayer (PCB_LAYER_ID aLayer)
 Function SetActiveLayer will change the currently active layer to aLayer. More...
 
virtual PCB_LAYER_ID GetActiveLayer () const
 Function GetActiveLayer returns the active layer. More...
 
bool InvokeDialogGrid ()
 
void OnTogglePolarCoords (wxCommandEvent &aEvent)
 
void OnTogglePadDrawMode (wxCommandEvent &aEvent)
 
virtual void OnSwitchCanvas (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 OnUpdateSwitchCanvas (wxUpdateUIEvent &aEvent)
 Update UI called when switches currently used canvas (default / Cairo / OpenGL). More...
 
PCB_GENERAL_SETTINGSSettings ()
 
const PCB_GENERAL_SETTINGSCSettings () const
 
virtual void OnCharHook (wxKeyEvent &event)
 this function capture the key event before it is sent to the GUI. 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 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 ()
 
wxAuiToolBar * GetMainToolBar () const
 
bool GetToolToggled (int aToolId)
 Checks all the toolbars and returns true if the given tool id is toggled. More...
 
virtual void SetNoToolSelected ()
 Select the ID_NO_TOOL_SELECTED id tool (Idle tool) More...
 
int GetToolId () const
 
virtual 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 ()
 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)
 
void OnEraseBackground (wxEraseEvent &SizeEvent)
 
virtual void OnZoom (wxCommandEvent &event)
 
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)
 
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)
 
void DisplayUnitsMsg ()
 Function DisplayUnitsMsg displays current unit pane on the status bar. More...
 
virtual void InitBlockPasteInfos ()
 
virtual bool HandleBlockBegin (wxDC *aDC, EDA_KEY aKey, const wxPoint &aPosition, int aExplicitCommand=0)
 Initialize a block command. More...
 
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...
 
virtual bool SwitchCanvas (EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
 Changes the current rendering backend. More...
 
bool IsGalCanvasActive () const
 Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use. More...
 
EDA_DRAW_PANEL_GALGetGalCanvas () const
 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 ImportFile (const wxString &aFileName, int aFileType)
 Function ImportFile load the given filename but sets the path to the current project path. 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...
 
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...
 
virtual int GetIconScale ()
 Function GetIconScale. More...
 
virtual void SetIconScale (int aScale)
 Function SetIconScale. 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

PCB_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)
 Function loadFootprint attempts to load aFootprintId from the footprint library table. More...
 
void SetScreen (BASE_SCREEN *aScreen)
 
double bestZoom (double sizeX, double sizeY, double scaleFactor, wxPoint centre)
 
bool 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)
 Move and refresh the crosshair after movement and call the mouse capture function. More...
 
bool isBusy () const
 
EDA_DRAW_PANEL_GAL::GAL_TYPE loadCanvasTypeSetting () const
 Returns the canvas type stored in the application settings. More...
 
bool saveCanvasTypeSetting (EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
 Stores the canvas type in the application settings. More...
 
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

wxString m_wizardName
 name of the current wizard More...
 
wxString m_wizardDescription
 description of the wizard More...
 
wxString m_wizardStatus
 current wizard status More...
 
BOARDm_Pcb
 
GENERAL_COLLECTORm_Collector
 
PCB_GENERAL_SETTINGS m_configSettings
 
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...
 
long m_firstRunDialogSetting
 Key to control whether first run dialog is shown on startup. 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_canvasTypeDirty
 Flag indicating that drawing canvas type needs to be saved to config. More...
 
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
 The current canvas type. More...
 
bool m_modal
 
WX_EVENT_LOOPm_modal_loop
 
wxWindow * m_modal_resultant_parent
 
wxString m_modal_string
 
bool m_modal_ret_val
 
FRAME_T m_Ident
 Id Type (pcb, schematic, library..) More...
 
wxPoint m_FramePos
 
wxSize m_FrameSize
 
wxString m_configFrameName
 prefix used in config to identify some params (frame size...) 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...
 

Static Protected Attributes

static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND
 

Default style flags used for wxAUI toolbars

More...
 

Private Member Functions

void OnSize (wxSizeEvent &event) override
 Function OnSize recalculates the size of toolbars and display panel when the frame size changes. More...
 
void OnGridSize (wxSizeEvent &aSizeEvent)
 
void ExportSelectedFootprint (wxCommandEvent &aEvent)
 Function ExportSelectedFootprint(); will let the caller exit from the wait loop, and get the built footprint. More...
 
void OnSashDrag (wxSashEvent &event)
 Function OnSashDrag resizes the child windows when dragging a sash window border. More...
 
void ReCreatePageList ()
 Function ReCreatePageList Creates or recreates the list of parameter pages for the current wizard. More...
 
void ReCreateParameterList ()
 Function ReCreateParameterList Creates the list of parameters for the current page. More...
 
void ResizeParamColumns ()
 Expand the 'Value' column to fill available. More...
 
void initParameterGrid ()
 Function initParameterGrid Prepare the grid where parameters are displayed. More...
 
void SelectFootprintWizard ()
 Function SelectFootprintWizard Shows the list of footprint wizards available into the system. More...
 
void ReloadFootprint ()
 Function ReloadFootprint Reloads the current footprint. More...
 
void DisplayBuildMessage (wxString &aMessage)
 Function DisplayBuildMessages Display the message generated by the python build footprint script. More...
 
FOOTPRINT_WIZARDGetMyWizard ()
 Function GetMyWizard Reloads the wizard by name. More...
 
void Process_Special_Functions (wxCommandEvent &event)
 
void DisplayWizardInfos ()
 Function DisplayWizardInfos Shows all the details about the current wizard. More...
 
void RedrawActiveWindow (wxDC *DC, bool EraseBg) override
 Function RedrawActiveWindow Display the current selected component. More...
 
void OnCloseWindow (wxCloseEvent &Event) override
 
void ReCreateHToolbar () override
 
void ReCreateVToolbar () override
 
void OnLeftClick (wxDC *DC, const wxPoint &MousePos) override
 
void ClickOnPageList (wxCommandEvent &event)
 
void OnSetRelativeOffset (wxCommandEvent &event)
 
bool GeneralControl (wxDC *aDC, const wxPoint &aPosition, EDA_KEY aHotKey=0) override
 Function GeneralControl performs application specific control using aDC at aPosition in logical units. More...
 
void 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...
 
EDA_HOTKEYGetHotKeyDescription (int aCommand) const override
 > More...
 
virtual void OnActivate (wxActivateEvent &event) override
 Function OnActivate is called when the frame frame is activate to reload the libraries and component lists that can be changed by the schematic editor or the library editor. More...
 
void SelectCurrentWizard (wxCommandEvent &event)
 
void DefaultParameters (wxCommandEvent &event)
 
void ParametersUpdated (wxGridEvent &event)
 Function ParametersUpdated Update the footprint python parameters values from the values in grid. More...
 
bool OnRightClick (const wxPoint &MousePos, wxMenu *PopMenu) override
 
void Show3D_Frame (wxCommandEvent &event) override
 Function Show3D_Frame (virtual) displays 3D view of the footprint (module) being edited. More...
 
void Update3D_Frame (bool aForceReloadFootprint=true)
 Function Update3D_Frame must be called after a footprint selection Updates the 3D view and 3D frame title. More...
 
void OnLeftDClick (wxDC *, const wxPoint &) override
 
void SaveCopyInUndoList (BOARD_ITEM *, UNDO_REDO_T, const wxPoint &) override
 Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands. More...
 
void SaveCopyInUndoList (const PICKED_ITEMS_LIST &, UNDO_REDO_T, const wxPoint &) override
 Function SaveCopyInUndoList (virtual pure, overloaded). More...
 

Private Attributes

wxListBox * m_pageList
 The list of pages. More...
 
int m_pageListWidth
 width of the window More...
 
wxGrid * m_parameterGrid
 The list of parameters. More...
 
int m_parameterGridWidth
 size of the grid More...
 
int m_parameterGridPage
 the page currently displayed by m_parameterGrid it is most of time the m_pageList selection, but can differ during transitions between pages. More...
 
FOOTPRINT_WIZARD_MESSAGESm_messagesFrame
 

Detailed Description

Class FOOTPRINT_WIZARD_FRAME.

Definition at line 55 of file footprint_wizard_frame.h.

Constructor & Destructor Documentation

FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME ( KIWAY aKiway,
wxWindow *  parent,
FRAME_T  aFrameType 
)
FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME ( )

Definition at line 228 of file footprint_wizard_frame.cpp.

References KIWAY_PLAYER::Destroy(), and PCB_BASE_FRAME::Get3DViewerFrame().

229 {
230  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
231 
232  if( draw3DFrame )
233  draw3DFrame->Destroy();
234 }
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
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
EDA_3D_VIEWER * Get3DViewerFrame()

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 677 of file eda_base_frame.cpp.

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

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

678 {
679  wxMenu* menu = NULL;
680  wxMenuItem* item = MasterMenu->FindItem( ID_KICAD_SELECT_ICONS_OPTIONS );
681 
682  if( item ) // This menu exists, do nothing
683  return;
684 
685  menu = new wxMenu;
686 
687  menu->Append( new wxMenuItem( menu, ID_KICAD_SELECT_ICONS_IN_MENUS,
688  _( "Icons in Menus" ), wxEmptyString,
689  wxITEM_CHECK ) );
690  menu->Check( ID_KICAD_SELECT_ICONS_IN_MENUS, Pgm().GetUseIconsInMenus() );
691 
692  AddMenuItem( MasterMenu, menu,
694  _( "Icons Options" ),
695  _( "Select show icons in menus and icons sizes" ),
696  KiBitmap( icon_xpm ) );
697 }
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:174
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:78
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 266 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().

267 {
268  int maxZoomIds;
269  double zoom;
270  wxString msg;
271  BASE_SCREEN* screen = m_canvas->GetScreen();
272 
273  msg = AddHotkeyName( _( "Center" ), m_hotkeysDescrList, HK_ZOOM_CENTER );
274  AddMenuItem( MasterMenu, ID_POPUP_ZOOM_CENTER, msg, KiBitmap( zoom_center_on_screen_xpm ) );
275  msg = AddHotkeyName( _( "Zoom In" ), m_hotkeysDescrList, HK_ZOOM_IN );
276  AddMenuItem( MasterMenu, ID_POPUP_ZOOM_IN, msg, KiBitmap( zoom_in_xpm ) );
277  msg = AddHotkeyName( _( "Zoom Out" ), m_hotkeysDescrList, HK_ZOOM_OUT );
278  AddMenuItem( MasterMenu, ID_POPUP_ZOOM_OUT, msg, KiBitmap( zoom_out_xpm ) );
279  msg = AddHotkeyName( _( "Redraw View" ), m_hotkeysDescrList, HK_ZOOM_REDRAW );
280  AddMenuItem( MasterMenu, ID_POPUP_ZOOM_REDRAW, msg, KiBitmap( zoom_redraw_xpm ) );
281  msg = AddHotkeyName( _( "Zoom Auto" ), m_hotkeysDescrList, HK_ZOOM_AUTO );
282  AddMenuItem( MasterMenu, ID_POPUP_ZOOM_PAGE, msg, KiBitmap( zoom_fit_in_page_xpm ) );
283 
284 
285  wxMenu* zoom_choice = new wxMenu;
286  AddMenuItem( MasterMenu, zoom_choice,
287  ID_POPUP_ZOOM_SELECT, _( "Zoom Select" ),
288  KiBitmap( zoom_selection_xpm ) );
289 
290  zoom = screen->GetZoom();
292  maxZoomIds = ( (size_t) maxZoomIds < screen->m_ZoomList.size() ) ?
293  maxZoomIds : screen->m_ZoomList.size();
294 
295  // Populate zoom submenu.
296  for( int i = 0; i < maxZoomIds; i++ )
297  {
298  msg.Printf( wxT( "%.2f" ), m_zoomLevelCoeff / screen->m_ZoomList[i] );
299 
300  zoom_choice->Append( ID_POPUP_ZOOM_LEVEL_START + i, _( "Zoom: " ) + msg,
301  wxEmptyString, wxITEM_CHECK );
302  if( zoom == screen->m_ZoomList[i] )
303  zoom_choice->Check( ID_POPUP_ZOOM_LEVEL_START + i, true );
304  }
305 
306  // Create grid submenu as required.
307  if( screen->GetGridCount() )
308  {
309  wxMenu* gridMenu = new wxMenu;
310  AddMenuItem( MasterMenu, gridMenu, ID_POPUP_GRID_SELECT,
311  _( "Grid Select" ), KiBitmap( grid_select_xpm ) );
312 
313  wxArrayString gridsList;
314  int icurr = screen->BuildGridsChoiceList( gridsList, g_UserUnit != INCHES );
315 
316  for( unsigned i = 0; i < gridsList.GetCount(); i++ )
317  {
318  GRID_TYPE& grid = screen->GetGrid( i );
319  gridMenu->Append( grid.m_CmdId, gridsList[i], wxEmptyString, wxITEM_CHECK );
320 
321  if( (int)i == icurr )
322  gridMenu->Check( grid.m_CmdId, true );
323  }
324  }
325 
326  MasterMenu->AppendSeparator();
327  AddMenuItem( MasterMenu, ID_POPUP_CANCEL, _( "Close" ), KiBitmap( cancel_xpm ) );
328 }
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:174
double GetZoom() const
Function GetZoom returns the current "zoom factor", which is a measure of "internal units per device ...
Definition: base_screen.h:340
size_t GetGridCount() const
Function GetGridCount().
Definition: base_screen.h:457
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:78
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
Definition: draw_frame.h:77
const GRID_TYPE & GetGrid() const
Return the grid object of the currently selected grid.
Definition: base_screen.h:417
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
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:93
double m_zoomLevelCoeff
a suitable value to convert the internal zoom scaling factor
Definition: draw_frame.h:86
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.
Definition: base_screen.h:45
BASE_SCREEN * GetScreen()
Definition: draw_panel.cpp:194
int m_CmdId
Definition: base_screen.h:48
std::vector< double > m_ZoomList
standard zoom (i.e. scale) coefficients.
Definition: base_screen.h:219
void PCB_BASE_FRAME::AddPad ( MODULE Module,
bool  draw 
)
inherited

Definition at line 114 of file pad_edition_functions.cpp.

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

Referenced by PCB_BASE_FRAME::GetScreen(), and FOOTPRINT_EDIT_FRAME::OnLeftClick().

115 {
116  m_Pcb->m_Status_Pcb = 0;
117  aModule->SetLastEditTime();
118 
119  D_PAD* pad = new D_PAD( aModule );
120 
121  // Add the new pad to end of the module pad list.
122  aModule->PadsList().PushBack( pad );
123 
124  // Update the pad properties,
125  // and keep NETINFO_LIST::ORPHANED as net info
126  // which is the default when nets cannot be handled.
127  Import_Pad_Settings( pad, false );
128 
130 
131  // Set the relative pad position
132  // ( pad position for module orient, 0, and relative to the module position)
133 
134  wxPoint pos0 = pad->GetPosition() - aModule->GetPosition();
135  RotatePoint( &pos0, -aModule->GetOrientation() );
136  pad->SetPos0( pos0 );
137 
138  /* NPTH pads take empty pad number (since they can't be connected),
139  * other pads get incremented from the last one edited */
140  wxString padName;
141 
143  {
144  padName = GetNextPadName( GetDesignSettings()
145  .m_Pad_Master.GetName() );
146  }
147 
148  pad->SetName( padName );
150 
151  aModule->CalculateBoundingBox();
152  SetMsgPanel( pad );
153 
154  if( draw )
155  m_canvas->RefreshDrawingRect( aModule->GetBoundingBox() );
156 }
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:398
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:65
void SetPosition(const wxPoint &aPos) override
Definition: class_pad.h:219
void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
Definition: draw_panel.cpp:319
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
static wxString GetNextPadName(wxString aPadName)
Compute the &#39;next&#39; 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:790
void SetName(const wxString &aName)
Set the pad name (sometimes called pad number, although it can be an array reference like AA12)...
Definition: class_pad.h:182
void SetPos0(const wxPoint &aPos)
Definition: class_pad.h:262
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:93
D_PAD m_Pad_Master
A dummy pad to store all default parameters.
const wxPoint GetPosition() const override
Definition: class_pad.h:220
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
void Import_Pad_Settings(D_PAD *aPad, bool aDraw)
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:237
void EDA_DRAW_FRAME::AdjustScrollBars ( const wxPoint aCenterPosition)
inherited

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

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

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

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

773 {
774  if( m_messagePanel == NULL )
775  return;
776 
777  m_messagePanel->AppendMessage( textUpper, textLower, color, pad );
778 }
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:132
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 EDA_DRAW_FRAME::bestZoom ( double  sizeX,
double  sizeY,
double  scaleFactor,
wxPoint  centre 
)
protectedinherited

Definition at line 86 of file zoom.cpp.

References EDA_DRAW_FRAME::m_canvas, max, EDA_DRAW_FRAME::SetScrollCenterPosition(), wxPoint::x, and wxPoint::y.

Referenced by FOOTPRINT_EDIT_FRAME::BestZoom(), LIB_VIEW_FRAME::BestZoom(), PL_EDITOR_FRAME::BestZoom(), PCB_BASE_FRAME::BestZoom(), GERBVIEW_FRAME::BestZoom(), and LIB_EDIT_FRAME::BestZoom().

87 {
88  double bestzoom = std::max( sizeX * scaleFactor / (double) m_canvas->GetClientSize().x,
89  sizeY * scaleFactor / (double) m_canvas->GetClientSize().y );
90 
91  // Take scrollbars into account
92  DSIZE scrollbarSize = m_canvas->GetSize() - m_canvas->GetClientSize();
93  centre.x -= int( bestzoom * scrollbarSize.x / 2.0 );
94  centre.y -= int( bestzoom * scrollbarSize.y / 2.0 );
95 
96  SetScrollCenterPosition( centre );
97 
98  return bestzoom;
99 }
void SetScrollCenterPosition(const wxPoint &aPoint)
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
#define max(a, b)
Definition: auxiliary.h:86
double PCB_BASE_FRAME::BestZoom ( )
overridevirtualinherited

Function BestZoom.

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

Implements EDA_DRAW_FRAME.

Reimplemented in FOOTPRINT_EDIT_FRAME.

Definition at line 323 of file pcb_base_frame.cpp.

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

Referenced by PCB_BASE_FRAME::GetScreen().

324 {
325  EDA_RECT ibbbox = GetBoardBoundingBox();
326 
327  double sizeX = (double) ibbbox.GetWidth();
328  double sizeY = (double) ibbbox.GetHeight();
329  wxPoint centre = ibbbox.Centre();
330 
331  // Reserve a 10% margin around board bounding box.
332  double margin_scale_factor = 1.1;
333 
334  return bestZoom( sizeX, sizeY, margin_scale_factor, centre );
335 }
double bestZoom(double sizeX, double sizeY, double scaleFactor, wxPoint centre)
Definition: zoom.cpp:86
int GetHeight() const
Definition: eda_rect.h:118
wxPoint Centre() const
Definition: eda_rect.h:60
EDA_RECT GetBoardBoundingBox(bool aBoardEdgesOnly=false) const
Function GetBoardBoundingBox calculates the bounding box containing all board items (or board edge se...
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
int GetWidth() const
Definition: eda_rect.h:117
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 659 of file draw_frame.cpp.

Referenced by EDA_DRAW_FRAME::HandleBlockBegin().

660 {
661  return 0;
662 }
void PCB_BASE_FRAME::Build_Board_Ratsnest ( )
inherited

Function Build_Board_Ratsnest.

Calculates the full ratsnest depending only on pads.

Referenced by PCB_BASE_FRAME::GetScreen().

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

Function build_ratsnest_module Build a ratsnest relative to one footprint.

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

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

Definition at line 187 of file ratsnest.cpp.

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

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

188 {
189  auto connectivity = GetBoard()->GetConnectivity();
190 
191  movedModule = *aModule;
192  movedModule.Move( -aMoveVector );
193  connectivity->ClearDynamicRatsnest();
194  connectivity->BlockRatsnestItems( { aModule } );
195  connectivity->ComputeDynamicRatsnest( { &movedModule } );
196 }
BOARD * GetBoard() const
void Move(const wxPoint &aMoveVector) override
Function Move move this object.
static MODULE movedModule(nullptr)
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:290
void PCB_BASE_FRAME::BuildAirWiresTargetsList ( BOARD_CONNECTED_ITEM aItemRef,
const wxPoint aPosition,
int  aNet 
)
inherited

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

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

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

Definition at line 176 of file ratsnest.cpp.

References movedModule, and s_refNet.

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

178 {
179  s_CursorPos = aPosition; // needed for sort_by_distance
180  s_ref = aItemRef;
181  s_refNet = aNet;
182 }
static wxPoint s_CursorPos
Definition: ratsnest.cpp:163
static int s_refNet
Definition: ratsnest.cpp:174
static BOARD_CONNECTED_ITEM * s_ref
Definition: ratsnest.cpp:173
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 582 of file eda_base_frame.cpp.

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

Referenced by EDA_BASE_FRAME::GetMruPath(), and PCB_EDIT_FRAME::OpenProjectFiles().

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

Definition at line 468 of file footprint_wizard_frame.cpp.

References DisplayWizardInfos(), EDA_DRAW_FRAME::m_canvas, m_pageList, ReCreateParameterList(), and EDA_DRAW_PANEL::Refresh().

Referenced by Process_Special_Functions().

469 {
470  int ii = m_pageList->GetSelection();
471 
472  if( ii < 0 )
473  return;
474 
476  m_canvas->Refresh();
478 }
void DisplayWizardInfos()
Function DisplayWizardInfos Shows all the details about the current wizard.
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:339
wxListBox * m_pageList
The list of pages.
void ReCreateParameterList()
Function ReCreateParameterList Creates the list of parameters for the current page.
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
void PCB_BASE_FRAME::Compile_Ratsnest ( wxDC *  aDC,
bool  aDisplayStatus 
)
inherited

Function Compile_Ratsnest Create the entire board ratsnest.

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

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

Definition at line 54 of file ratsnest.cpp.

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

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), PCB_EDIT_FRAME::AutoPlaceModule(), PCB_EDIT_FRAME::Autoroute(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Duplicate(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Block_Rotate(), PCB_EDIT_FRAME::Change_Side_Module(), PCB_EDIT_FRAME::Delete_Module(), PCB_EDIT_FRAME::ExportToGenCAD(), PCB_BASE_FRAME::GetScreen(), DIALOG_EXCHANGE_FOOTPRINTS::OnApplyClick(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), PCB_EDIT_FRAME::OnSelectOptionToolbar(), PCB_EDIT_FRAME::OnSelectTool(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceModule(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Reset_Noroutable(), PCB_BASE_FRAME::Rotate_Module(), and PCB_BASE_FRAME::TestNetConnection().

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

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

Referenced by PCB_BASE_FRAME::GetScreen().

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 266 of file eda_base_frame.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().

267  {
268  wxString baseCfgName = m_configFrameName.IsEmpty() ? GetName() : m_configFrameName;
269  return baseCfgName;
270  }
wxString m_configFrameName
prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTO...
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 829 of file draw_frame.cpp.

References CoordinateToString().

Referenced by getOptimalModulePlacement().

830 {
831  return ::CoordinateToString( aValue, aConvertToMils );
832 }
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:118
void EDA_DRAW_FRAME::CopyToClipboard ( wxCommandEvent &  event)
inherited

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

Definition at line 42 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.

Referenced by add_search_paths().

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

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

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

Definition at line 773 of file footprint_libraries_utils.cpp.

References BOARD::Add(), DisplayInfoMessage(), FMT_MOD_CREATE, FMT_MOD_REF, FMT_NO_REF_ABORTED, PCB_BASE_FRAME::GetBoard(), FOOTPRINT_EDIT_FRAME::GetDesignSettings(), BOARD_DESIGN_SETTINGS::m_ModuleTextSize, BOARD_DESIGN_SETTINGS::m_ModuleTextWidth, BOARD_DESIGN_SETTINGS::m_RefDefaultlayer, BOARD_DESIGN_SETTINGS::m_RefDefaultText, BOARD_DESIGN_SETTINGS::m_RefDefaultVisibility, BOARD_DESIGN_SETTINGS::m_ValueDefaultlayer, BOARD_DESIGN_SETTINGS::m_ValueDefaultText, BOARD_DESIGN_SETTINGS::m_ValueDefaultVisibility, MODULE::Reference(), MODULE::SetFPID(), MODULE::SetLastEditTime(), BOARD_ITEM::SetLayer(), EDA_DRAW_FRAME::SetMsgPanel(), TEXTE_MODULE::SetPosition(), MODULE::SetReference(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetThickness(), MODULE::SetValue(), EDA_TEXT::SetVisible(), ToLAYER_ID(), MODULE::Value(), and wxPoint::y.

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

774 {
775  // Creates a new footprint at position 0,0 which contains the minimal items:
776  // the reference and the value.
777  // Value : initialized to the footprint name.
778  // put on fab layer (front side)
779  // Reference : initialized to a default value (REF**).
780  // put on silkscreen layer (front side)
781 
782  wxString moduleName = aModuleName;
783 
784  // Ask for the new module name
785  if( moduleName.IsEmpty() )
786  {
787  wxTextEntryDialog dlg( this, FMT_MOD_REF, FMT_MOD_CREATE, moduleName );
788  dlg.SetTextValidator( FILE_NAME_CHAR_VALIDATOR( &moduleName ) );
789 
790  if( dlg.ShowModal() != wxID_OK )
791  return NULL; //Aborted by user
792  }
793 
794  moduleName.Trim( true );
795  moduleName.Trim( false );
796 
797  if( moduleName.IsEmpty() )
798  {
800  return NULL;
801  }
802 
803  // Creates the new module and add it to the head of the linked list of modules
804  MODULE* module = new MODULE( GetBoard() );
805 
806  GetBoard()->Add( module );
807 
808  // Update parameters: timestamp ...
809  module->SetLastEditTime();
810 
811  // Update its name in lib
812  module->SetFPID( LIB_ID( moduleName ) );
813 
814  wxPoint default_pos;
816 
817  // Update reference:
818  if( settings.m_RefDefaultText.IsEmpty() )
819  module->SetReference( moduleName );
820  else
821  module->SetReference( settings.m_RefDefaultText );
822 
823  module->Reference().SetThickness( settings.m_ModuleTextWidth );
824  module->Reference().SetTextSize( settings.m_ModuleTextSize );
825  default_pos.y = GetDesignSettings().m_ModuleTextSize.y / 2;
826  module->Reference().SetPosition( default_pos );
827  module->Reference().SetLayer( ToLAYER_ID( settings.m_RefDefaultlayer ) );
828  module->Reference().SetVisible( settings.m_RefDefaultVisibility );
829 
830  // Set the value field to a default value
831  if( settings.m_ValueDefaultText.IsEmpty() )
832  module->SetValue( moduleName );
833  else
834  module->SetValue( settings.m_ValueDefaultText );
835 
836  module->Value().SetThickness( GetDesignSettings().m_ModuleTextWidth );
837  module->Value().SetTextSize( GetDesignSettings().m_ModuleTextSize );
838  default_pos.y = -default_pos.y;
839  module->Value().SetPosition( default_pos );
840  module->Value().SetLayer( ToLAYER_ID( settings.m_ValueDefaultlayer ) );
841  module->Value().SetVisible( settings.m_ValueDefaultVisibility );
842 
843  SetMsgPanel( module );
844  return module;
845 }
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:483
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
int m_ModuleTextWidth
Default footprint texts thickness.
void SetVisible(bool aVisible)
Definition: eda_text.h:173
BOARD * GetBoard() const
int m_ValueDefaultlayer
Default value text layer on fp creation.
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:212
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
wxSize m_ModuleTextSize
Default footprint texts size.
void SetLastEditTime(time_t aTime)
Definition: class_module.h:302
Class FILE_NAME_CHAR_VALIDATOR.
Definition: validators.h:43
#define FMT_NO_REF_ABORTED
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:790
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:482
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_INSERT) override
Adds an item to the container.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:449
virtual void SetPosition(const wxPoint &aPos) override
wxString m_ValueDefaultText
Default value text on fp creation.
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:476
int m_RefDefaultlayer
Default ref text layer on fp creation.
#define FMT_MOD_CREATE
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:105
bool m_RefDefaultVisibility
Default ref text visibility on fp creation.
void SetFPID(const LIB_ID &aFPID)
Definition: class_module.h:185
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:796
void SetThickness(int aNewThickness)
Function SetThickness sets pen width.
Definition: eda_text.h:146
#define FMT_MOD_REF
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.
const PCB_GENERAL_SETTINGS& PCB_BASE_FRAME::CSettings ( ) const
inlineinherited

Definition at line 699 of file pcb_base_frame.h.

References PCB_BASE_FRAME::m_configSettings.

700  {
701  return m_configSettings;
702  }
PCB_GENERAL_SETTINGS m_configSettings
void FOOTPRINT_WIZARD_FRAME::DefaultParameters ( wxCommandEvent &  event)
private

Definition at line 230 of file footprint_wizard_frame_functions.cpp.

References DisplayWizardInfos(), GetMyWizard(), ReCreateParameterList(), ReloadFootprint(), and FOOTPRINT_WIZARD::ResetParameters().

Referenced by GetHotKeyDescription().

231 {
232  FOOTPRINT_WIZARD* footprintWizard = GetMyWizard();
233 
234  if ( footprintWizard == NULL )
235  return;
236 
237  footprintWizard->ResetParameters();
238 
239  // Reload
241  ReloadFootprint();
243 
244 }
void DisplayWizardInfos()
Function DisplayWizardInfos Shows all the details about the current wizard.
void ReloadFootprint()
Function ReloadFootprint Reloads the current footprint.
void ReCreateParameterList()
Function ReCreateParameterList Creates the list of parameters for the current page.
FOOTPRINT_WIZARD * GetMyWizard()
Function GetMyWizard Reloads the wizard by name.
virtual void ResetParameters()=0
Function ResetParameters Reset all wizard parameters to default values.
Class FOOTPRINT_WIZARD This is the parent class from where any footprint wizard class must derive...
void PCB_BASE_FRAME::DeletePad ( D_PAD aPad,
bool  aQuery = true 
)
inherited

Function DeletePad Delete the pad aPad.

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

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

Definition at line 159 of file pad_edition_functions.cpp.

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

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

160 {
161  if( aPad == NULL )
162  return;
163 
164  MODULE* module = aPad->GetParent();
165  module->SetLastEditTime();
166 
167  // aQuery = true to prompt for confirmation, false to delete silently
168  if( aQuery )
169  {
170  wxString msg;
171  msg.Printf( _( "Delete Pad (footprint %s %s) ?" ),
172  GetChars( module->GetReference() ),
173  GetChars( module->GetValue() ) );
174 
175  if( !IsOK( this, msg ) )
176  return;
177  }
178 
179  // Stores the initial bounding box to refresh the old area
180  EDA_RECT bbox = module->GetBoundingBox();
181 
182  m_Pcb->m_Status_Pcb = 0;
183 
184  GetBoard()->PadDelete( aPad );
185 
186  // Update the bounding box
187  module->CalculateBoundingBox();
188 
189  // Refresh the modified screen area, using the initial bounding box
190  // which is perhaps larger than the new bounding box
191  m_canvas->RefreshDrawingRect( bbox );
192 
193  OnModify();
194 }
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:162
BOARD * GetBoard() const
const wxString & GetValue() const
Function GetValue.
Definition: class_module.h:467
void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
Definition: draw_panel.cpp:319
void SetLastEditTime(time_t aTime)
Definition: class_module.h:302
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:93
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:439
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:122
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:237
void PCB_BASE_FRAME::DeleteTextModule ( TEXTE_MODULE Text)
inherited

Definition at line 139 of file edtxtmod.cpp.

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

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

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:319
void SetLastEditTime(time_t aTime)
Definition: class_module.h:302
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:93
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

Definition at line 164 of file kiway_player.cpp.

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

Referenced by ExportSelectedFootprint(), FOOTPRINT_VIEWER_FRAME::ExportSelectedFootprint(), LIB_VIEW_FRAME::ExportToSchematicLibraryPart(), LIB_VIEW_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), and OnCloseWindow().

165 {
166  m_modal_ret_val = aRetVal;
167  m_modal_string = aResult;
168 
169  if( m_modal_loop )
170  {
171  m_modal_loop->Exit();
172  m_modal_loop = 0; // this marks it as dismissed.
173  }
174 
175  Show( false );
176 }
bool m_modal_ret_val
Definition: kiway_player.h:263
wxString m_modal_string
Definition: kiway_player.h:262
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:260
void FOOTPRINT_WIZARD_FRAME::DisplayBuildMessage ( wxString &  aMessage)
private

Function DisplayBuildMessages Display the message generated by the python build footprint script.

Definition at line 147 of file footprint_wizard_frame_functions.cpp.

References FOOTPRINT_WIZARD_MESSAGES::ClearScreen(), EDA_BASE_FRAME::config(), m_messagesFrame, and FOOTPRINT_WIZARD_MESSAGES::PrintMessage().

Referenced by GetBuiltFootprint(), and ReloadFootprint().

148 {
149  if( m_messagesFrame == NULL )
150  {
151  // Prepare the window to display the message generated by the footprint script builder
153  m_messagesFrame->Show( true );
154  }
155 
157 
158  if( !aMessage.IsEmpty() )
159  m_messagesFrame->PrintMessage( aMessage );
160 }
FOOTPRINT_WIZARD_MESSAGES * m_messagesFrame
virtual wxConfigBase * config()
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
void PrintMessage(const wxString &aMessage)
void EDA_DRAW_FRAME::DisplayToolMsg ( const wxString &  msg)
inherited
void EDA_DRAW_FRAME::DisplayUnitsMsg ( )
inherited

Function DisplayUnitsMsg displays current unit pane on the status bar.

Definition at line 517 of file draw_frame.cpp.

References g_UserUnit, INCHES, and MILLIMETRES.

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

518 {
519  wxString msg;
520 
521  switch( g_UserUnit )
522  {
523  case INCHES:
524  msg = _( "Inches" );
525  break;
526 
527  case MILLIMETRES:
528  msg = _( "mm" );
529  break;
530 
531  default:
532  msg = _( "Units" );
533  break;
534  }
535 
536  SetStatusText( msg, 4 );
537 }
Definition: common.h:145
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
void FOOTPRINT_WIZARD_FRAME::DisplayWizardInfos ( )
private

Function DisplayWizardInfos Shows all the details about the current wizard.

Definition at line 98 of file footprint_wizard_frame_functions.cpp.

References m_wizardName.

Referenced by ClickOnPageList(), DefaultParameters(), OnActivate(), ParametersUpdated(), ReCreatePageList(), and SelectFootprintWizard().

99 {
100  wxString msg;
101 
102  msg = _( "Footprint Wizard" );
103  msg << wxT( " [" );
104 
105  if( !m_wizardName.IsEmpty() )
106  msg << m_wizardName;
107  else
108  msg += _( "no wizard selected" );
109 
110  msg << wxT( "]" );
111 
112  SetTitle( msg );
113 }
wxString m_wizardName
name of the current wizard
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 235 of file eda_base_frame.cpp.

Referenced by EDA_BASE_FRAME::isAutoSaveRequired(), and EDA_BASE_FRAME::onAutoSaveTimer().

236 {
237  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
238 }
void PCB_BASE_FRAME::DrawGeneralRatsnest ( wxDC *  aDC,
int  aNetcode = 0 
)
inherited

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

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

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

Definition at line 85 of file ratsnest.cpp.

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

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

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

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

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

Definition at line 76 of file worksheet.cpp.

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

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

79 {
81  return;
82 
83  const PAGE_INFO& pageInfo = GetPageSettings();
84  wxSize pageSize = pageInfo.GetSizeMils();
85 
86  // if not printing, draw the page limits:
87  if( !aScreen->m_IsPrinting && m_showPageLimits )
88  {
89  GRSetDrawMode( aDC, GR_COPY );
90  GRRect( m_canvas->GetClipBox(), aDC, 0, 0,
91  pageSize.x * aScalar, pageSize.y * aScalar, aLineWidth,
93  }
94 
95  TITLE_BLOCK t_block = GetTitleBlock();
96  COLOR4D color = COLOR4D( RED );
97 
98  wxPoint origin = aDC->GetDeviceOrigin();
99 
100  if( aScreen->m_IsPrinting && origin.y > 0 )
101  {
102  aDC->SetDeviceOrigin( 0, 0 );
103  aDC->SetAxisOrientation( true, false );
104  }
105 
106  DrawPageLayout( aDC, m_canvas->GetClipBox(), pageInfo,
107  GetScreenDesc(), aFilename, t_block,
108  aScreen->m_NumberOfScreens, aScreen->m_ScreenNumber,
109  aLineWidth, aScalar, color, color, aSheetLayer );
110 
111  if( aScreen->m_IsPrinting && origin.y > 0 )
112  {
113  aDC->SetDeviceOrigin( origin.x, origin.y );
114  aDC->SetAxisOrientation( true, true );
115  }
116 }
int m_ScreenNumber
Definition: base_screen.h:216
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:318
virtual const TITLE_BLOCK & GetTitleBlock() const =0
int color
Definition: DXF_plotter.cpp:62
COLOR4D m_drawBgColor
the background color of the draw canvas BLACK for Pcbnew, BLACK or WHITE for eeschema ...
Definition: draw_frame.h:84
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:39
const wxSize & GetSizeMils() const
Definition: page_info.h:137
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:1098
virtual wxString GetScreenDesc() const
Definition: worksheet.cpp:119
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:49
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:113
EDA_RECT * GetClipBox()
Definition: colors.h:60
bool m_IsPrinting
Definition: base_screen.h:220
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
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:48
bool m_showPageLimits
true to display the page limits
Definition: draw_frame.h:82
Definition: colors.h:49
int m_NumberOfScreens
Definition: base_screen.h:217
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 
)
inherited
void EDA_DRAW_FRAME::EraseMsgBox ( )
inherited

Definition at line 264 of file draw_frame.cpp.

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

Referenced by GERBVIEW_FRAME::SetCurItem().

265 {
266  if( m_messagePanel )
268 }
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:132
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 363 of file draw_frame.h.

References EDA_DRAW_PANEL::OnMouseEvent().

Referenced by EDA_DRAW_FRAME::OnSockRequest().

363 {}
void PCB_BASE_FRAME::Export_Pad_Settings ( D_PAD aPad)
inherited

Definition at line 46 of file pad_edition_functions.cpp.

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

Referenced by PCB_BASE_FRAME::GetScreen(), and 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:790
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:1348
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 757 of file hotkeys_basic.cpp.

References DEFAULT_HOTKEY_FILENAME_EXT, EDA_FILE_SELECTOR(), and Prj().

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(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), and EDA_BASE_FRAME::SaveProjectSettings().

759 {
760  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
761  wxString mask = wxT( "*." ) + ext;
762 
763 #if 0
764  wxString path = wxPathOnly( Prj().GetProjectFullName() );
765 #else
766  wxString path = GetMruPath();
767 #endif
768  wxFileName fn( aDefaultShortname );
769  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
770 
771  wxString filename = EDA_FILE_SELECTOR( _( "Write Hotkey Configuration File:" ),
772  path,
773  fn.GetFullPath(),
774  ext,
775  mask,
776  this,
777  wxFD_SAVE,
778  true );
779 
780  if( filename.IsEmpty() )
781  return;
782 
783  WriteHotkeyConfig( aDescList, &filename );
784  SetMruPath( wxFileName( filename ).GetPath() );
785 }
void SetMruPath(const wxString &aPath)
PROJECT & Prj()
Definition: kicad.cpp:270
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
void FOOTPRINT_WIZARD_FRAME::ExportSelectedFootprint ( wxCommandEvent &  aEvent)
private

Function ExportSelectedFootprint(); will let the caller exit from the wait loop, and get the built footprint.

Definition at line 258 of file footprint_wizard_frame.cpp.

References KIWAY_PLAYER::DismissModal().

259 {
260  DismissModal( true );
261  Close();
262 }
void DismissModal(bool aRetVal, const wxString &aResult=wxEmptyString)
void PCB_BASE_FRAME::FocusOnLocation ( const wxPoint aPos,
bool  aWarpMouseCursor = true,
bool  aCenterView = false 
)
inherited

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

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

Definition at line 338 of file pcb_base_frame.cpp.

References EDA_DRAW_PANEL::CrossHairOff(), EDA_DRAW_PANEL::CrossHairOn(), EDA_DRAW_FRAME::GetGalCanvas(), EDA_DRAW_PANEL_GAL::GetView(), EDA_DRAW_PANEL_GAL::GetViewControls(), INSTALL_UNBUFFERED_DC, EDA_DRAW_FRAME::IsGalCanvasActive(), EDA_DRAW_PANEL::IsPointOnDisplay(), EDA_DRAW_FRAME::m_canvas, EDA_DRAW_PANEL::MoveCursorToCrossHair(), EDA_DRAW_FRAME::RedrawScreen(), KIGFX::VIEW::SetCenter(), KIGFX::VIEW_CONTROLS::SetCrossHairCursorPosition(), EDA_DRAW_FRAME::SetCrossHairPosition(), and KIGFX::VIEW_CONTROLS::SetCursorPosition().

Referenced by PCB_BASE_FRAME::GetScreen(), 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  if( IsGalCanvasActive() )
342  {
343  if( aCenterView )
344  GetGalCanvas()->GetView()->SetCenter( aPos );
345 
346  if( aWarpMouseCursor )
348  else
350  }
351  else
352  {
354 
355  // There may be need to reframe the drawing.
356  if( aCenterView || !m_canvas->IsPointOnDisplay( aPos ) )
357  {
358  SetCrossHairPosition( aPos );
359  RedrawScreen( aPos, aWarpMouseCursor );
360  }
361  else
362  {
363  // Put cursor on item position
364  m_canvas->CrossHairOff( &dc );
365  SetCrossHairPosition( aPos );
366 
367  if( aWarpMouseCursor )
369  }
370 
371  // Be sure cross hair cursor is ON:
372  m_canvas->CrossHairOn( &dc );
373  m_canvas->CrossHairOn( &dc );
374  }
375 }
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
void MoveCursorToCrossHair()
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
Definition: draw_panel.cpp:361
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Moves cursor to the requested position expressed in world coordinates.
bool IsPointOnDisplay(const wxPoint &aPosition)
Function IsPointOnDisplay.
Definition: draw_panel.cpp:301
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:562
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:874
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Moves the graphic crosshair cursor to the requested position expressed in world coordinates.
void CrossHairOff(wxDC *DC)
Definition: draw_panel.cpp:266
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
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:273
#define INSTALL_UNBUFFERED_DC(name, parent)
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:882
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
bool FOOTPRINT_WIZARD_FRAME::GeneralControl ( wxDC *  aDC,
const wxPoint aPosition,
EDA_KEY  aHotKey = 0 
)
overrideprivatevirtual

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.
Returns
true if the hotkey code is handled (captured).

Reimplemented from EDA_DRAW_FRAME.

Definition at line 534 of file footprint_wizard_frame.cpp.

References EDA_DRAW_FRAME::GeneralControlKeyMovement(), EDA_DRAW_FRAME::GetCrossHairPosition(), PCB_BASE_FRAME::GetScreen(), ID_KEY_ZOOM_IN, ID_KEY_ZOOM_OUT, ID_POPUP_ZOOM_CENTER, ID_ZOOM_PAGE, ID_ZOOM_REDRAW, EDA_DRAW_FRAME::m_movingCursorWithKeyboard, BASE_SCREEN::m_O_Curseur, EDA_DRAW_FRAME::RefreshCrossHair(), EDA_DRAW_FRAME::SetCrossHairPosition(), and PCB_BASE_FRAME::UpdateStatusBar().

535 {
536  // Filter out the 'fake' mouse motion after a keyboard movement
537  if( !aHotKey && m_movingCursorWithKeyboard )
538  {
540  return false;
541  }
542 
543  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
544  cmd.SetEventObject( this );
545 
546  wxPoint pos = aPosition;
547  wxPoint oldpos = GetCrossHairPosition();
548  bool keyHandled = GeneralControlKeyMovement( aHotKey, &pos, true );
549 
550  switch( aHotKey )
551  {
552  case WXK_F1:
553  cmd.SetId( ID_KEY_ZOOM_IN );
554  GetEventHandler()->ProcessEvent( cmd );
555  keyHandled = true;
556  break;
557 
558  case WXK_F2:
559  cmd.SetId( ID_KEY_ZOOM_OUT );
560  GetEventHandler()->ProcessEvent( cmd );
561  keyHandled = true;
562  break;
563 
564  case WXK_F3:
565  cmd.SetId( ID_ZOOM_REDRAW );
566  GetEventHandler()->ProcessEvent( cmd );
567  keyHandled = true;
568  break;
569 
570  case WXK_F4:
571  cmd.SetId( ID_POPUP_ZOOM_CENTER );
572  GetEventHandler()->ProcessEvent( cmd );
573  keyHandled = true;
574  break;
575 
576  case WXK_HOME:
577  cmd.SetId( ID_ZOOM_PAGE );
578  GetEventHandler()->ProcessEvent( cmd );
579  keyHandled = true;
580  break;
581 
582  case ' ':
584  keyHandled = true;
585  break;
586 
587  default:
588  break;
589  }
590 
591  SetCrossHairPosition( pos );
592  RefreshCrossHair( oldpos, aPosition, aDC );
593 
594  UpdateStatusBar(); // Display new cursor coordinates
595 
596  return keyHandled;
597 }
wxPoint m_O_Curseur
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:185
bool GeneralControlKeyMovement(int aHotKey, wxPoint *aPos, bool aSnapToGrid)
Function GeneralControlKeyMovement Handle the common part of GeneralControl dedicated to global curso...
void RefreshCrossHair(const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC *aDC)
Move and refresh the crosshair after movement and call the mouse capture function.
virtual void UpdateStatusBar() override
Function UpdateStatusBar updates the status bar information.
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
bool m_movingCursorWithKeyboard
One-shot to avoid a recursive mouse event during hotkey movement.
Definition: draw_frame.h:142
bool 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)

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

Definition at line 1351 of file draw_frame.cpp.

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

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

1353 {
1354  bool key_handled = false;
1355 
1356  // If requested snap the current position to the grid
1357  if( aSnapToGrid )
1358  *aPos = GetNearestGridPosition( *aPos );
1359 
1360  switch( aHotKey )
1361  {
1362  // All these keys have almost the same treatment
1363  case GR_KB_CTRL | WXK_NUMPAD8:
1364  case GR_KB_CTRL | WXK_UP:
1365  case GR_KB_CTRL | WXK_NUMPAD2:
1366  case GR_KB_CTRL | WXK_DOWN:
1367  case GR_KB_CTRL | WXK_NUMPAD4:
1368  case GR_KB_CTRL | WXK_LEFT:
1369  case GR_KB_CTRL | WXK_NUMPAD6:
1370  case GR_KB_CTRL | WXK_RIGHT:
1371  case WXK_NUMPAD8:
1372  case WXK_UP:
1373  case WXK_NUMPAD2:
1374  case WXK_DOWN:
1375  case WXK_NUMPAD4:
1376  case WXK_LEFT:
1377  case WXK_NUMPAD6:
1378  case WXK_RIGHT:
1379  key_handled = true;
1380  {
1381  /* Here's a tricky part: when doing cursor key movement, the
1382  * 'previous' point should be taken from memory, *not* from the
1383  * freshly computed position in the event. Otherwise you can't do
1384  * sub-pixel movement. The m_movingCursorWithKeyboard oneshot 'eats'
1385  * the automatic motion event generated by cursor warping */
1386  wxRealPoint gridSize = GetScreen()->GetGridSize();
1387  *aPos = GetCrossHairPosition();
1388 
1389  // Bonus: ^key moves faster (x10)
1390  switch( aHotKey )
1391  {
1392  case GR_KB_CTRL|WXK_NUMPAD8:
1393  case GR_KB_CTRL|WXK_UP:
1394  aPos->y -= KiROUND( 10 * gridSize.y );
1395  break;
1396 
1397  case GR_KB_CTRL|WXK_NUMPAD2:
1398  case GR_KB_CTRL|WXK_DOWN:
1399  aPos->y += KiROUND( 10 * gridSize.y );
1400  break;
1401 
1402  case GR_KB_CTRL|WXK_NUMPAD4:
1403  case GR_KB_CTRL|WXK_LEFT:
1404  aPos->x -= KiROUND( 10 * gridSize.x );
1405  break;
1406 
1407  case GR_KB_CTRL|WXK_NUMPAD6:
1408  case GR_KB_CTRL|WXK_RIGHT:
1409  aPos->x += KiROUND( 10 * gridSize.x );
1410  break;
1411 
1412  case WXK_NUMPAD8:
1413  case WXK_UP:
1414  aPos->y -= KiROUND( gridSize.y );
1415  break;
1416 
1417  case WXK_NUMPAD2:
1418  case WXK_DOWN:
1419  aPos->y += KiROUND( gridSize.y );
1420  break;
1421 
1422  case WXK_NUMPAD4:
1423  case WXK_LEFT:
1424  aPos->x -= KiROUND( gridSize.x );
1425  break;
1426 
1427  case WXK_NUMPAD6:
1428  case WXK_RIGHT:
1429  aPos->x += KiROUND( gridSize.x );
1430  break;
1431 
1432  default: /* Can't happen since we entered the statement */
1433  break;
1434  }
1435 
1436  m_canvas->MoveCursor( *aPos );
1438  }
1439  break;
1440 
1441  default:
1442  break;
1443  }
1444 
1445  return key_handled;
1446 }
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:367
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:352
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
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.
Definition: base_screen.h:410
#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:142
EDA_3D_VIEWER * PCB_BASE_FRAME::Get3DViewerFrame ( )
inherited
Returns
a reference to the 3D viewer frame, when exists, or NULL

Definition at line 129 of file pcb_base_frame.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(), Show3D_Frame(), FOOTPRINT_VIEWER_FRAME::Update3D_Frame(), Update3D_Frame(), FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME(), and ~FOOTPRINT_WIZARD_FRAME().

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

Function GetActiveLayer returns the active layer.

Definition at line 637 of file pcb_base_frame.h.

References PCB_BASE_FRAME::ClearSelection(), PCB_BASE_FRAME::GetScreen(), PCB_BASE_FRAME::InvokeDialogGrid(), PCB_BASE_FRAME::LoadSettings(), PCB_SCREEN::m_Active_Layer, PCB_BASE_FRAME::OnSwitchCanvas(), PCB_BASE_FRAME::OnTogglePadDrawMode(), PCB_BASE_FRAME::OnTogglePolarCoords(), PCB_BASE_FRAME::OnUpdateCoordType(), PCB_BASE_FRAME::OnUpdatePadDrawMode(), PCB_BASE_FRAME::OnUpdateSelectGrid(), PCB_BASE_FRAME::OnUpdateSelectZoom(), PCB_BASE_FRAME::OnUpdateSwitchCanvas(), PCB_BASE_FRAME::SaveSettings(), PCB_BASE_FRAME::SetFastGrid1(), PCB_BASE_FRAME::SetFastGrid2(), PCB_BASE_FRAME::SetNextGrid(), PCB_BASE_FRAME::SetPrevGrid(), and PCB_BASE_FRAME::UseGalCanvas().

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(), DRAWING_TOOL::DrawVia(), PCB_BASE_FRAME::GetCollectorsGuide(), DRAWING_TOOL::getDrawingLayer(), PCBNEW_CONTROL::HighContrastMode(), DIALOG_NON_COPPER_ZONES_EDITOR::Init(), PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), PCBNEW_CONTROL::LayerNext(), PCBNEW_CONTROL::LayerPrev(), PCBNEW_CONTROL::LayerToggle(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnLeftClick(), PCB_LAYER_WIDGET::onPopupSelection(), PCB_DRAW_PANEL_GAL::OnShow(), PCB_EDIT_FRAME::OnUpdateLayerSelectBox(), PCB_EDIT_FRAME::Other_Layer_Route(), DRAWING_TOOL::PlaceText(), PCB_EDIT_FRAME::PrepareLayerIndicator(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_BASE_FRAME::SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), and ROUTER_TOOL::switchLayerOnViaPlacement().

638  {
639  return GetScreen()->m_Active_Layer;
640  }
PCB_LAYER_ID m_Active_Layer
Definition: pcb_screen.h:44
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 225 of file eda_base_frame.h.

References EDA_BASE_FRAME::m_autoSaveInterval.

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

225 { return m_autoSaveInterval; }
int m_autoSaveInterval
The auto save interval time in seconds.
const wxPoint & PCB_BASE_FRAME::GetAuxOrigin ( ) const
overridevirtualinherited

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

Implements EDA_DRAW_FRAME.

Definition at line 213 of file pcb_base_frame.cpp.

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

Referenced by DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), PCB_EDIT_FRAME::ExportToGenCAD(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_GENDRILL::SetParams(), and DIALOG_MOVE_EXACT::TransferDataFromWindow().

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

Definition at line 182 of file pcb_base_frame.h.

References PCB_BASE_FRAME::m_Pcb, and PCB_BASE_FRAME::OnCloseWindow().

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(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Block_Rotate(), PCB_BASE_FRAME::build_ratsnest_module(), DIALOG_COPPER_ZONE::buildAvailableListOfNets(), PCB_EDIT_FRAME::Change_Net_Tracks_And_Vias_Sizes(), PCB_EDIT_FRAME::Change_Side_Module(), DIALOG_EXCHANGE_FOOTPRINTS::changeSameFootprints(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::Clear_Pcb(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), PCB_BASE_FRAME::Compile_Ratsnest(), PCB_EDIT_FRAME::Create_MuWaveComponent(), PCB_EDIT_FRAME::Create_MuWavePolygonShape(), DIALOG_FREEROUTE::createDSN_File(), CreateHeaderInfoData(), PCB_BASE_FRAME::CreateNewModule(), PCB_EDIT_FRAME::createPopupMenuForTracks(), PCB_EDIT_FRAME::CreateTextePcb(), PCB_EDIT_FRAME::Delete_Drawings_All_Layer(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Module(), PCB_EDIT_FRAME::Delete_net(), PCB_EDIT_FRAME::Delete_OldZone_Fill(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Zone_Contour(), PCB_BASE_FRAME::DeletePad(), DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR(), DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL(), DIALOG_GENCAD_EXPORT_OPTIONS::DIALOG_GENCAD_EXPORT_OPTIONS(), DIALOG_GENDRILL::DIALOG_GENDRILL(), DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PADS_MASK_CLEARANCE::DIALOG_PADS_MASK_CLEARANCE(), DIALOG_SELECT_NET_FROM_LIST::DIALOG_SELECT_NET_FROM_LIST(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), PCB_EDIT_FRAME::doAutoSave(), 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::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::ExecuteRemoteCommand(), DIALOG_COPPER_ZONE::ExportSetupToOtherCopperZones(), PCB_EDIT_FRAME::ExportToGenCAD(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::Fill_All_Zones(), DIALOG_GENDRILL::GenDrillAndMapFiles(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), GetBoard(), EDA_3D_VIEWER::GetBoard(), FOOTPRINT_EDIT_FRAME::GetDesignSettings(), PCB_LAYER_BOX_SELECTOR::getEnabledLayers(), PCB_BASE_FRAME::GetFootprintFromBoardByReference(), PCB_LAYER_SELECTOR::GetLayerName(), PCB_LAYER_BOX_SELECTOR::GetLayerName(), FOOTPRINT_EDIT_FRAME::GetModel(), 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(), FOOTPRINT_EDIT_FRAME::Import_Module(), PCB_EDIT_FRAME::ImportFile(), 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_SELECTOR::IsLayerEnabled(), PCB_LAYER_BOX_SELECTOR::IsLayerEnabled(), PCB_EDIT_FRAME::KiwayMailIn(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), PCB_EDIT_FRAME::LockModule(), Magnetize(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit(), DIALOG_DRC_CONTROL::OnActivateDlg(), DIALOG_EXCHANGE_FOOTPRINTS::OnApplyClick(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), DIALOG_FIND::onButtonFindItemClick(), DIALOG_FIND::onButtonFindMarkerClick(), DIALOG_PADS_MASK_CLEARANCE::OnButtonOkClick(), FOOTPRINT_EDIT_FRAME::OnCloseWindow(), DIALOG_NETLIST::OnCompileRatsnestClick(), DIALOG_GENDRILL::OnGenReportFile(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), DIALOG_KEEPOUT_AREA_PROPERTIES::OnLayerSelection(), PCB_LAYER_WIDGET::OnLayerVisible(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_GRAPHIC_ITEMS_OPTIONS::OnOkClick(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick(), DIALOG_DIMENSION_EDITOR::OnOKClick(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), DIALOG_NETLIST::OnReadNetlistFileClick(), PCB_LAYER_WIDGET::OnRenderEnable(), PCB_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnSelectTool(), DIALOG_DRC_CONTROL::OnStartdrcClick(), DIALOG_NETLIST::OnTestFootprintsClick(), PCB_BASE_FRAME::OnTogglePadDrawMode(), 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(), PCB_BASE_FRAME::PlaceModule(), DIALOG_PLOT::Plot(), 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_FOOTPRINTS::RebuildCmpList(), DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow(), FOOTPRINT_VIEWER_FRAME::RedrawActiveWindow(), FOOTPRINT_EDIT_FRAME::RedrawActiveWindow(), RedrawActiveWindow(), PCB_EDIT_FRAME::RedrawActiveWindow(), PCB_LAYER_WIDGET::ReFill(), PCB_LAYER_WIDGET::ReFillRender(), Refresh(), ReloadFootprint(), PCB_EDIT_FRAME::Remove_One_Track(), PCB_EDIT_FRAME::Remove_Zone_Corner(), PCB_EDIT_FRAME::RemoveStruct(), PCB_EDIT_FRAME::Reset_All_Tracks_And_Vias_To_Netclass_Values(), PCB_EDIT_FRAME::Reset_Noroutable(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), PCB_BASE_FRAME::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(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), PCB_EDIT_FRAME::SelectHighLight(), DIALOG_GLOBAL_DELETION::SetCurrentLayer(), FOOTPRINT_EDIT_FRAME::SetDesignSettings(), DIALOG_DRC_CONTROL::SetDrcParmeters(), FOOTPRINT_EDIT_FRAME::SetElementVisibility(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), FOOTPRINT_EDIT_FRAME::setupTools(), Show_New_Edge_While_Move_Mouse(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), PCB_BASE_FRAME::StartMovePad(), PCB_EDIT_FRAME::SwitchLayer(), PCB_LAYER_WIDGET::SyncLayerVisibilities(), PCB_LAYER_WIDGET::SyncRenderStates(), DRC::TestZoneToZoneOutline(), PCB_BASE_FRAME::TraceAirWiresToTargets(), PCB_BASE_FRAME::TraceModuleRatsNest(), DIALOG_EDIT_FPTEXT::TransferDataToWindow(), DRC::updatePointers(), FOOTPRINT_VIEWER_FRAME::updateView(), FOOTPRINT_EDIT_FRAME::updateView(), DIALOG_NETLIST::verifyFootprints(), and DIALOG_DRC_CONTROL::writeReport().

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

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

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

Definition at line 297 of file pcb_base_frame.cpp.

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

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

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

Definition at line 180 of file footprint_wizard_frame_functions.cpp.

References DisplayBuildMessage(), FOOTPRINT_WIZARD::GetFootprint(), FOOTPRINT_WIZARD_LIST::GetWizard(), KIWAY_PLAYER::m_modal_ret_val, and m_wizardName.

Referenced by FOOTPRINT_EDIT_FRAME::Process_Special_Functions().

181 {
183 
184  if( footprintWizard && m_modal_ret_val )
185  {
186  wxString msg;
187  MODULE * footprint = footprintWizard->GetFootprint( &msg );
188  DisplayBuildMessage( msg );
189 
190  return footprint;
191  }
192 
193  return NULL;
194 }
bool m_modal_ret_val
Definition: kiway_player.h:263
wxString m_wizardName
name of the current wizard
static FOOTPRINT_WIZARD * GetWizard(const wxString &aName)
Function GetWizard.
void DisplayBuildMessage(wxString &aMessage)
Function DisplayBuildMessages Display the message generated by the python build footprint script...
virtual MODULE * GetFootprint(wxString *aMessage)=0
Function GetModule This method builds the module itself and returns it to the caller function...
Class FOOTPRINT_WIZARD This is the parent class from where any footprint wizard class must derive...
EDA_DRAW_PANEL* EDA_DRAW_FRAME::GetCanvas ( )
inlineinherited

Definition at line 342 of file draw_frame.h.

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(), getOptimalModulePlacement(), DIALOG_SELECT_NET_FROM_LIST::HighlightNet(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), DIALOG_DISPLAY_OPTIONS::initOptDialog(), InstallBlockCmdFrame(), SCH_EDIT_FRAME::KiwayMailIn(), SCH_EDIT_FRAME::MirrorSheet(), PROPERTIES_FRAME::OnAcceptPrms(), DIALOG_EDIT_COMPONENTS_LIBID::onApplyButton(), DIALOG_EXCHANGE_FOOTPRINTS::OnApplyClick(), DIALOG_ANNOTATE::OnApplyClick(), 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_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(), EDA_DRAW_FRAME::OnZoom(), PCB_EDIT_FRAME::OpenProjectFiles(), DIALOG_UPDATE_PCB::PerformUpdate(), SCH_FIELD::Place(), DIALOG_PAD_PROPERTIES::prepareCanvas(), PCB_EDIT_FRAME::Process_Config(), DIALOG_DRC_CONTROL::RedrawDrawPanel(), Refresh(), DIALOG_EDIT_COMPONENTS_LIBID::revertChanges(), SCH_EDIT_FRAME::RotateHierarchicalSheet(), PCB_BASE_FRAME::SetFastGrid1(), PCB_BASE_FRAME::SetFastGrid2(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), PCB_BASE_FRAME::SetNextGrid(), PCB_BASE_FRAME::SetPrevGrid(), DIALOG_ERC::TestErc(), DIALOG_LABEL_EDITOR::TextPropertiesAccept(), WIDGET_EESCHEMA_COLOR_CONFIG::TransferDataFromControl(), DIALOG_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_EDIT_FPTEXT::TransferDataFromWindow(), DIALOG_PCB_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings().

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

Function GetCollectorsGuide.

Returns
GENERAL_COLLECTORS_GUIDE - that considers the global configuration options.

Definition at line 623 of file pcb_base_frame.cpp.

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

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

624 {
626  GetActiveLayer() );
627 
628  // account for the globals
630  guide.SetIgnoreMTextsOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_BK ) );
631  guide.SetIgnoreMTextsOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_FR ) );
632  guide.SetIgnoreModulesOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_BK ) );
633  guide.SetIgnoreModulesOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_FR ) );
634  guide.SetIgnorePadsOnBack( ! m_Pcb->IsElementVisible( LAYER_PAD_BK ) );
635  guide.SetIgnorePadsOnFront( ! m_Pcb->IsElementVisible( LAYER_PAD_FR ) );
636  guide.SetIgnoreModulesVals( ! m_Pcb->IsElementVisible( LAYER_MOD_VALUES ) );
637  guide.SetIgnoreModulesRefs( ! m_Pcb->IsElementVisible( LAYER_MOD_REFERENCES ) );
638  guide.SetIgnoreThroughVias( ! m_Pcb->IsElementVisible( LAYER_VIA_THROUGH ) );
639  guide.SetIgnoreBlindBuriedVias( ! m_Pcb->IsElementVisible( LAYER_VIA_BBLIND ) );
640  guide.SetIgnoreMicroVias( ! m_Pcb->IsElementVisible( LAYER_VIA_MICROVIA ) );
641 
642  return guide;
643 }
to draw blind/buried vias
show modules on back
show modules values (when texts are visibles)
smd pads, back layer
show modules on front
to draw usual through hole vias
void SetIgnoreMTextsMarkedNoShow(bool ignore)
Definition: collectors.h:509
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Function IsElementVisible tests whether a given element category is visible.
smd pads, front layer
LSET GetVisibleLayers() const
Function GetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
A general implementation of a COLLECTORS_GUIDE.
Definition: collectors.h:366
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
show modules references (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 1244 of file draw_frame.cpp.

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

Referenced by Abort_EditEdge(), AbortSymbolTraceOn(), AddMenusForBus(), AddMenusForWire(), PCB_BASE_FRAME::AddPad(), PCB_EDIT_FRAME::AutoPlaceModule(), PCB_EDIT_FRAME::Begin_DrawSegment(), 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::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(), LIB_EDIT_FRAME::EndDrawGraphicItem(), DISPLAY_FOOTPRINTS_FRAME::GeneralControl(), LIB_VIEW_FRAME::GeneralControl(), FOOTPRINT_VIEWER_FRAME::GeneralControl(), FOOTPRINT_EDIT_FRAME::GeneralControl(), GeneralControl(), SCH_EDIT_FRAME::GeneralControl(), PL_EDITOR_FRAME::GeneralControl(), LIB_EDIT_FRAME::GeneralControl(), PCB_EDIT_FRAME::GeneralControl(), GERBVIEW_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_FOOTPRINT_FP_EDITOR::OnEditReference(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnEditReference(), DIALOG_FOOTPRINT_FP_EDITOR::OnEditValue(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnEditValue(), LIB_VIEW_FRAME::OnHotKey(), FOOTPRINT_VIEWER_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PL_EDITOR_FRAME::OnHotKey(), SCH_EDIT_FRAME::OnHotKey(), LIB_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(), OnSetRelativeOffset(), EDA_DRAW_FRAME::OnZoom(), DIALOG_UPDATE_PCB::PerformUpdate(), LIB_EDIT_FRAME::PlaceAnchor(), PCB_BASE_FRAME::PlaceModule(), LIB_EDIT_FRAME::PlacePin(), PCB_BASE_FRAME::PlaceTexteModule(), SCH_EDIT_FRAME::PrepareMoveItem(), 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(), PL_EDITOR_FRAME::UpdateStatusBar(), SCH_BASE_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), and GERBVIEW_FRAME::UpdateStatusBar().

1245 {
1246  // subject to change, borrow from old BASE_SCREEN for now.
1247  if( IsGalCanvasActive() )
1248  {
1250 
1251  return wxPoint( cursor.x, cursor.y );
1252  }
1253  else
1254  {
1255  BASE_SCREEN* screen = GetScreen(); // virtual call
1256  return screen->getCrossHairPosition( aInvertY );
1257  }
1258 }
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:352
wxPoint getCrossHairPosition(bool aInvertY) const
Function getCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
Definition: base_screen.h:107
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:874
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:882
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 1282 of file draw_frame.cpp.

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

1283 {
1284  BASE_SCREEN* screen = GetScreen(); // virtual call
1285  return screen->getCrossHairScreenPosition();
1286 }
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:352
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
BOARD_ITEM * PCB_BASE_FRAME::GetCurItem ( )
inherited

Definition at line 617 of file pcb_base_frame.cpp.

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

Referenced by Abort_Create_Track(), Abort_Zone_Move_Corner_Or_Outlines(), PCB_EDIT_FRAME::Autoroute(), DIALOG_EXCHANGE_FOOTPRINTS::change_1_Module(), EDIT_TOOL::editFootprintInFpEditor(), PCB_EDIT_FRAME::GeneralControl(), PCB_BASE_FRAME::GetScreen(), Magnetize(), PCB_EDIT_FRAME::moveExact(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), FOOTPRINT_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::RemoveStruct(), Show_Zone_Corner_Or_Outline_While_Move_Mouse(), and PCB_EDIT_FRAME::SwitchLayer().

618 {
619  return GetScreen()->GetCurItem();
620 }
BOARD_ITEM * GetCurItem() const
Function GetCurItem returns the currently selected BOARD_ITEM, overriding BASE_SCREEN::GetCurItem().
Definition: pcb_screen.h:72
PCB_SCREEN * GetScreen() const override
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 1268 of file draw_frame.cpp.

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

Referenced by EDA_DRAW_PANEL::OnMouseWheel().

1269 {
1270  BASE_SCREEN* screen = GetScreen(); // virtual call
1271  return screen->getCursorPosition( aOnGrid, GetGridOrigin(), aGridSize );
1272 }
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:352
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
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
virtualinherited

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

Overloaded in FOOTPRINT_EDIT_FRAME.

Reimplemented in FOOTPRINT_EDIT_FRAME.

Definition at line 255 of file pcb_base_frame.cpp.

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

Referenced by AddNewTrace(), PCB_BASE_FRAME::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(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PAD_TOOL::copyPadSettings(), PCB_EDIT_FRAME::Create_MuWaveComponent(), PCB_EDIT_FRAME::CreateMuWaveBaseFootprint(), PCB_EDIT_FRAME::createPopupMenuForTracks(), 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(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), FOOTPRINT_EDIT_FRAME::DlgGlobalChange_PadSettings(), PCB_EDIT_FRAME::DlgGlobalChange_PadSettings(), PCB_EDIT_FRAME::Edit_Gap(), PCB_BASE_FRAME::Export_Pad_Settings(), PCB_BASE_FRAME::GlobalChange_PadSettings(), PCB_BASE_FRAME::Import_Pad_Settings(), DIALOG_GLOBAL_FOOTPRINTS_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(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), ShowNewTrackWhenMovingCursor(), PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event(), PCB_EDIT_FRAME::updateTraceWidthSelectBox(), and PCB_EDIT_FRAME::updateViaSizeSelectBox().

256 {
257  wxASSERT( m_Pcb );
258  return m_Pcb->GetDesignSettings();
259 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:532
void* PCB_BASE_FRAME::GetDisplayOptions ( )
inlineoverridevirtualinherited

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

Reimplemented from EDA_DRAW_FRAME.

Definition at line 161 of file pcb_base_frame.h.

References PCB_BASE_FRAME::GetPlotSettings(), PCB_BASE_FRAME::GetZoneSettings(), PCB_BASE_FRAME::m_DisplayOptions, PCB_BASE_FRAME::SetBoard(), PCB_BASE_FRAME::SetPlotSettings(), and PCB_BASE_FRAME::SetZoneSettings().

Referenced by PCB_EDIT_FRAME::Delete_Segment_Edge(), PCB_TOOL::displayOptions(), VIA::Draw(), FOOTPRINT_EDIT_FRAME::GetConfigurationSettings(), PCB_EDIT_FRAME::GetConfigurationSettings(), getOptimalModulePlacement(), DIALOG_GENERALOPTIONS::init(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog(), MODULE_EDITOR_TOOLS::ModuleEdgeOutlines(), MODULE_EDITOR_TOOLS::ModuleTextOutlines(), 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(), PCB_BASE_FRAME::OnTogglePadDrawMode(), PCB_BASE_FRAME::OnTogglePolarCoords(), PCB_BASE_FRAME::OnUpdateCoordType(), PCB_EDIT_FRAME::OnUpdateHighContrastDisplayMode(), DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode(), FOOTPRINT_EDIT_FRAME::OnUpdateOptionsToolbar(), PCB_BASE_FRAME::OnUpdatePadDrawMode(), DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode(), PCB_EDIT_FRAME::OnUpdateTraceDrawMode(), PCB_EDIT_FRAME::OnUpdateViaDrawMode(), PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), PCB_BASE_FRAME::PlaceModule(), FOOTPRINT_EDIT_FRAME::PrintPage(), PCB_EDIT_FRAME::PrintPage(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_BASE_FRAME::SetToolID(), ShowNewTrackWhenMovingCursor(), PCB_BASE_FRAME::SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), PCB_BASE_FRAME::TraceAirWiresToTargets(), DIALOG_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_DISPLAY_OPTIONS::TransferDataToWindow(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings(), PCB_BASE_FRAME::UpdateStatusBar(), and PCB_BASE_FRAME::UseGalCanvas().

161 { return &m_DisplayOptions; }
PCB_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 404 of file eda_base_frame.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(), GERBVIEW_FRAME::OnJobFileHistory(), GERBVIEW_FRAME::OnZipFileHistory(), and EDA_BASE_FRAME::SaveProjectSettings().

406 {
407  wxFileHistory* fileHistory = aFileHistory;
408 
409  if( !fileHistory )
410  fileHistory = &Kiface().GetFileHistory();
411 
412  int baseId = fileHistory->GetBaseId();
413 
414  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
415 
416  unsigned i = cmdId - baseId;
417 
418  if( i < fileHistory->GetCount() )
419  {
420  wxString fn = fileHistory->GetHistoryFile( i );
421 
422  if( wxFileName::FileExists( fn ) )
423  return fn;
424  else
425  {
426  wxString msg = wxString::Format(
427  _( "File \"%s\" was not found." ),
428  GetChars( fn ) );
429 
430  wxMessageBox( msg );
431 
432  fileHistory->RemoveFileFromHistory( i );
433  }
434  }
435 
436  return wxEmptyString;
437 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxFileHistory & GetFileHistory()
Definition: kiface_i.h:123
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
MODULE * PCB_BASE_FRAME::GetFootprintFromBoardByReference ( )
inherited

Function GetFootprintFromBoardByReference.

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

Definition at line 62 of file pcb_footprint_edit_utils.cpp.

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

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

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

Referenced by PCB_EDIT_FRAME::AppendBoardFile(), GERBVIEW_FRAME::applyDisplaySettingsToGAL(), GRID_HELPER::BestDragOrigin(), GRID_HELPER::BestSnapAnchor(), PCB_TOOL::canvas(), GERBVIEW_FRAME::Clear_DrawLayers(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), PCB_EDIT_FRAME::Edit_Zone_Params(), MODULE_EDITOR_TOOLS::EnumeratePads(), EVT_TOOL(), EVT_UPDATE_UI(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SELECTION_TOOL::findCallback(), PCB_BASE_FRAME::FocusOnLocation(), GERBVIEW_FRAME::GERBVIEW_FRAME(), EDA_DRAW_FRAME::GetCrossHairPosition(), GERBVIEW_FRAME::GetVisibleLayers(), GRID_HELPER::GRID_HELPER(), GERBVIEW_CONTROL::HighlightControl(), DIALOG_SELECT_NET_FROM_LIST::HighlightNet(), PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), MODULE_EDITOR_TOOLS::ModuleEdgeOutlines(), MODULE_EDITOR_TOOLS::ModuleTextOutlines(), FOOTPRINT_EDIT_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), GERBVIEW_FRAME::OnCloseWindow(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_LAYER_WIDGET::OnLayerColorChange(), GERBER_LAYER_WIDGET::OnLayerColorChange(), PCB_LAYER_WIDGET::OnLayerVisible(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_DISPLAY_OPTIONS::OnOKBUttonClick(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick(), PCB_LAYER_WIDGET::OnRenderColorChange(), GERBER_LAYER_WIDGET::OnRenderColorChange(), PCB_LAYER_WIDGET::OnRenderEnable(), GERBER_LAYER_WIDGET::OnRenderEnable(), GERBVIEW_FRAME::OnSelectHighlightChoice(), EDA_DRAW_FRAME::OnToggleGridState(), PCB_BASE_FRAME::OnTogglePadDrawMode(), PCB_BASE_FRAME::OnUpdateSelectZoom(), PCB_BASE_FRAME::OnUpdateSwitchCanvas(), GERBVIEW_FRAME::OnUpdateSwitchCanvas(), DIALOG_UPDATE_PCB::PerformUpdate(), DIALOG_PAD_PROPERTIES::prepareCanvas(), PCB_EDIT_FRAME::Process_Config(), TOOL_MANAGER::ProcessEvent(), BOARD_COMMIT::Push(), GRID_HELPER::queryVisible(), PCB_EDITOR_CONTROL::ratsnestTimer(), GERBVIEW_FRAME::Read_EXCELLON_File(), GERBVIEW_FRAME::Read_GERBER_File(), GERBER_LAYER_WIDGET::ReFill(), Refresh(), EDA_DRAW_PANEL::Refresh(), ZOOM_TOOL::selectRegion(), GERBVIEW_FRAME::SetActiveLayer(), GRID_HELPER::SetAuxAxes(), PCB_BASE_EDIT_FRAME::SetBoard(), FOOTPRINT_EDIT_FRAME::SetElementVisibility(), EDA_DRAW_PANEL::SetEnableAutoPan(), EDA_DRAW_PANEL::SetEnableMousewheelPan(), EDA_DRAW_PANEL::SetEnableZoomNoCenter(), GERBVIEW_FRAME::SetGridColor(), EDA_DRAW_FRAME::SetNoToolSelected(), EDA_DRAW_FRAME::SetToolID(), FOOTPRINT_EDIT_FRAME::setupTools(), GERBVIEW_FRAME::setupTools(), GERBVIEW_FRAME::SetVisibleLayers(), EDA_DRAW_FRAME::SwitchCanvas(), GERBVIEW_SELECTION_TOOL::toggleSelection(), SELECTION_TOOL::toggleSelection(), DIALOG_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow(), PCB_BASE_FRAME::UpdateMsgPanel(), FOOTPRINT_VIEWER_FRAME::updateView(), FOOTPRINT_EDIT_FRAME::updateView(), PCB_BASE_EDIT_FRAME::UseGalCanvas(), FOOTPRINT_EDIT_FRAME::UseGalCanvas(), PCB_BASE_FRAME::UseGalCanvas(), GERBVIEW_FRAME::UseGalCanvas(), EDA_DRAW_FRAME::UseGalCanvas(), COMMON_TOOLS::ZoomFitScreen(), GERBVIEW_SELECTION_TOOL::zoomFitSelection(), SELECTION_TOOL::zoomFitSelection(), COMMON_TOOLS::ZoomInOut(), and COMMON_TOOLS::ZoomPreset().

882 { return m_galCanvas; }
EDA_DRAW_PANEL_GAL * m_galCanvas
GAL display options - this is the frame&#39;s interface to setting GAL display options.
Definition: draw_frame.h:68
KIGFX::GAL_DISPLAY_OPTIONS& EDA_DRAW_FRAME::GetGalDisplayOptions ( )
inlineinherited
virtual COLOR4D EDA_DRAW_FRAME::GetGridColor ( )
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 505 of file draw_frame.h.

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

506  {
507  return m_gridColor;
508  }
COLOR4D m_gridColor
Grid color.
Definition: draw_frame.h:83
const wxPoint & PCB_BASE_FRAME::GetGridOrigin ( ) const
overridevirtualinherited

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

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

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

228 {
229  wxASSERT( m_Pcb );
230  return m_Pcb->GetGridOrigin();
231 }
const wxPoint & GetGridOrigin() const
Definition: class_board.h:350
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 589 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().

590 {
591  wxPoint pos = aPosition;
592 
593  if( m_currentScreen != NULL && m_snapToGrid )
594  pos = GetNearestGridPosition( aPosition );
595 
596  return pos;
597 }
BASE_SCREEN * m_currentScreen
current used SCREEN
Definition: draw_frame.h:63
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:65
EDA_HOTKEY_CONFIG* EDA_DRAW_FRAME::GetHotkeyConfig ( ) const
inlineinherited

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

Definition at line 388 of file draw_frame.h.

Referenced by PCBNEW_CONTROL::ShowHelp().

388 { return m_hotkeysDescrList; }
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
Definition: draw_frame.h:77
EDA_HOTKEY* FOOTPRINT_WIZARD_FRAME::GetHotKeyDescription ( int  aCommand) const
inlineoverrideprivatevirtual

>

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.

Implements EDA_DRAW_FRAME.

Definition at line 179 of file footprint_wizard_frame.h.

References DefaultParameters(), OnActivate(), OnRightClick(), ParametersUpdated(), SelectCurrentWizard(), Show3D_Frame(), and Update3D_Frame().

179 { return NULL; }
virtual int EDA_BASE_FRAME::GetIconScale ( )
inlinevirtualinherited

Function GetIconScale.

Return the desired scaling for toolbar/menubar icons in fourths (e.g. 4 is unity). A negative number indicates autoscale based on font size.

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

Definition at line 459 of file eda_base_frame.h.

Referenced by get_scale_factor().

459 { return -1; }
void EDA_BASE_FRAME::GetKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 531 of file eda_base_frame.cpp.

References ShowAboutDialog().

Referenced by add_search_paths(), and EDA_BASE_FRAME::IsType().

532 {
533  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
534  ShowAboutDialog( this );
535 }
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
void EDA_BASE_FRAME::GetKicadContribute ( wxCommandEvent &  event)
inherited

Definition at line 518 of file eda_base_frame.cpp.

References URL_GET_INVOLVED.

Referenced by add_search_paths(), and EDA_BASE_FRAME::IsType().

519 {
520  if( !wxLaunchDefaultBrowser( URL_GET_INVOLVED ) )
521  {
522  wxString msg;
523  msg.Printf( _( "Could not launch the default browser.\n"
524  "For information on how to help the KiCad project, visit %s" ),
526  wxMessageBox( msg, _( "Get involved with KiCad" ), wxOK, this );
527  }
528 }
#define URL_GET_INVOLVED
void EDA_BASE_FRAME::GetKicadHelp ( wxCommandEvent &  event)
inherited

Definition at line 440 of file eda_base_frame.cpp.

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

Referenced by add_search_paths(), and EDA_BASE_FRAME::IsType().

441 {
442  const SEARCH_STACK& search = sys_search();
443 
444  /* We have to get document for beginners,
445  * or the full specific doc
446  * if event id is wxID_INDEX, we want the document for beginners.
447  * else the specific doc file (its name is in Kiface().GetHelpFileName())
448  * The document for beginners is the same for all KiCad utilities
449  */
450  if( event.GetId() == wxID_INDEX )
451  {
452  // List of possible names for Getting Started in KiCad
453  const wxChar* names[2] = {
454  wxT( "getting_started_in_kicad" ),
455  wxT( "Getting_Started_in_KiCad" )
456  };
457 
458  wxString helpFile;
459  // Search for "getting_started_in_kicad.html" or "getting_started_in_kicad.pdf"
460  // or "Getting_Started_in_KiCad.html" or "Getting_Started_in_KiCad.pdf"
461  for( unsigned ii = 0; ii < DIM( names ); ii++ )
462  {
463  helpFile = SearchHelpFileFullPath( search, names[ii] );
464 
465  if( !helpFile.IsEmpty() )
466  break;
467  }
468 
469  if( !helpFile )
470  {
471  wxString msg = wxString::Format( _(
472  "Html or pdf help file \n\"%s\"\n or\n\"%s\" could not be found." ), names[0], names[1] );
473  wxMessageBox( msg );
474  }
475  else
476  {
477  GetAssociatedDocument( this, helpFile );
478  }
479 
480  return;
481  }
482 
483  wxString base_name = help_name();
484  wxString helpFile = SearchHelpFileFullPath( search, base_name );
485 
486  if( !helpFile )
487  {
488  wxString msg = wxString::Format( _(
489  "Help file \"%s\" could not be found." ),
490  GetChars( base_name )
491  );
492  wxMessageBox( msg );
493  }
494  else
495  {
496  GetAssociatedDocument( this, helpFile );
497  }
498 }
#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...
wxString SearchHelpFileFullPath(const SEARCH_STACK &aSStack, const wxString &aBaseName)
Function SearchHelpFileFullPath returns the help file&#39;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()
wxAuiToolBar* EDA_DRAW_FRAME::GetMainToolBar ( ) const
inlineinherited

Definition at line 436 of file draw_frame.h.

436 { return m_mainToolBar; }
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
FOOTPRINT_WIZARD * FOOTPRINT_WIZARD_FRAME::GetMyWizard ( )
private

Function GetMyWizard Reloads the wizard by name.

Definition at line 163 of file footprint_wizard_frame_functions.cpp.

References FOOTPRINT_WIZARD_LIST::GetWizard(), and m_wizardName.

Referenced by DefaultParameters(), ParametersUpdated(), ReCreatePageList(), ReCreateParameterList(), and ReloadFootprint().

164 {
165  if( m_wizardName.Length() == 0 )
166  return NULL;
167 
169 
170  if( !footprintWizard )
171  {
172  wxMessageBox( _( "Couldn't reload footprint wizard" ) );
173  return NULL;
174  }
175 
176  return footprintWizard;
177 }
wxString m_wizardName
name of the current wizard
static FOOTPRINT_WIZARD * GetWizard(const wxString &aName)
Function GetWizard.
Class FOOTPRINT_WIZARD This is the parent class from where any footprint wizard class must derive...
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 1275 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().

1276 {
1277  BASE_SCREEN* screen = GetScreen(); // virtual call
1278  return screen->getNearestGridPosition( aPosition, GetGridOrigin(), aGridSize );
1279 }
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:352
wxPoint getNearestGridPosition(const wxPoint &aPosition, const wxPoint &aGridOrigin, wxRealPoint *aGridSize) const
Function getNearestGridPosition returns the nearest aGridSize location to aPosition.
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
virtual const wxPoint & GetGridOrigin() const =0
Function GetGridOrigin returns the absolute coordinates of the origin of the snap grid...
const PAGE_INFO & PCB_BASE_FRAME::GetPageSettings ( ) const
overridevirtualinherited

Implements EDA_DRAW_FRAME.

Definition at line 195 of file pcb_base_frame.cpp.

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

196 {
197  wxASSERT( m_Pcb );
198  return m_Pcb->GetPageSettings();
199 }
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:547
const wxSize PCB_BASE_FRAME::GetPageSizeIU ( ) const
overridevirtualinherited

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

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

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

203 {
204  wxASSERT( m_Pcb );
205 
206  // this function is only needed because EDA_DRAW_FRAME is not compiled
207  // with either -DPCBNEW or -DEESCHEMA, so the virtual is used to route
208  // into an application specific source file.
209  return m_Pcb->GetPageSettings().GetSizeIU();
210 }
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:547
const PCB_PLOT_PARAMS & PCB_BASE_FRAME::GetPlotSettings ( ) const
virtualinherited
PCB_SCREEN* PCB_BASE_FRAME::GetScreen ( ) const
inlineoverridevirtualinherited

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 200 of file pcb_base_frame.h.

References PCB_BASE_FRAME::AddPad(), PNS::angle(), PCB_BASE_FRAME::BestZoom(), PCB_BASE_FRAME::Build_Board_Ratsnest(), PCB_BASE_FRAME::build_ratsnest_module(), PCB_BASE_FRAME::BuildAirWiresTargetsList(), PCB_BASE_FRAME::Compile_Ratsnest(), PCB_BASE_FRAME::ComputeLegacyConnections(), PCB_BASE_FRAME::CreateNewModule(), PCB_BASE_FRAME::DeletePad(), PCB_BASE_FRAME::DeleteTextModule(), PCB_BASE_FRAME::DrawGeneralRatsnest(), PCB_BASE_FRAME::Edit_Module(), PCB_BASE_FRAME::Export_Pad_Settings(), PCB_BASE_FRAME::FocusOnLocation(), PCB_BASE_FRAME::GetCollectorsGuide(), PCB_BASE_FRAME::GetCurItem(), PCB_BASE_FRAME::GetFootprintFromBoardByReference(), EDA_DRAW_FRAME::GetScreen(), PCB_BASE_FRAME::GetZoomLevelIndicator(), PCB_BASE_FRAME::GlobalChange_PadSettings(), PCB_BASE_FRAME::Import_Pad_Settings(), PCB_BASE_FRAME::InstallPadOptionsFrame(), PCB_BASE_FRAME::InstallTextModOptionsFrame(), PCB_BASE_FRAME::LoadModuleFromLibrary(), PCB_BASE_FRAME::OnModify(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), PCB_BASE_FRAME::PlaceModule(), PCB_BASE_FRAME::PlacePad(), PCB_BASE_FRAME::PlaceTexteModule(), PCB_BASE_FRAME::ProcessItemSelection(), PCB_BASE_FRAME::ReadDrawSegmentDescr(), PCB_BASE_FRAME::ReadGeneralDescrPcb(), PCB_BASE_FRAME::ReadListeSegmentDescr(), PCB_BASE_FRAME::ReadSetup(), PCB_BASE_FRAME::ResetModuleTextSizes(), PCB_BASE_FRAME::ResetTextSize(), PCB_BASE_FRAME::Rotate_Module(), PCB_BASE_FRAME::RotatePad(), PCB_BASE_FRAME::RotateTextModule(), PCB_BASE_FRAME::SaveCopyInUndoList(), PCB_BASE_FRAME::SelectCopperLayerPair(), PCB_BASE_FRAME::SelectFootprint(), PCB_BASE_FRAME::SelectFootprintFromLibBrowser(), PCB_BASE_FRAME::SelectLayer(), PCB_BASE_FRAME::SelectLibrary(), PCB_BASE_FRAME::SetCurItem(), PCB_BASE_FRAME::Show3D_Frame(), PCB_BASE_FRAME::StartMovePad(), PCB_BASE_FRAME::StartMoveTexteModule(), PCB_BASE_FRAME::SwitchLayer(), PCB_BASE_FRAME::TestConnections(), PCB_BASE_FRAME::TestForActiveLinksInRatsnest(), PCB_BASE_FRAME::TestNetConnection(), PCB_BASE_FRAME::TraceAirWiresToTargets(), PCB_BASE_FRAME::TraceModuleRatsNest(), and PCB_BASE_FRAME::UpdateMsgPanel().

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(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), PCB_EDIT_FRAME::doAutoSave(), VIA::Draw(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawVia(), PCB_BASE_EDIT_FRAME::duplicateItem(), PCB_EDIT_FRAME::duplicateItems(), PCB_EDIT_FRAME::duplicateZone(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::End_Zone(), PCB_EDIT_FRAME::Files_io_from_id(), DISPLAY_FOOTPRINTS_FRAME::GeneralControl(), GeneralControl(), PCB_EDIT_FRAME::GeneralControl(), PCB_BASE_FRAME::GetActiveLayer(), PCB_BASE_FRAME::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(), FOOTPRINT_VIEWER_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), PCB_EDIT_FRAME::OnLeftClick(), PCB_BASE_FRAME::OnModify(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), SCH_PRINTOUT::OnPrintPage(), FOOTPRINT_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), FOOTPRINT_VIEWER_FRAME::OnSetRelativeOffset(), OnSetRelativeOffset(), PCB_EDIT_FRAME::OnUpdateSave(), PCB_BASE_FRAME::OnUpdateSelectGrid(), PCB_BASE_FRAME::OnUpdateSelectZoom(), ROUTER_TOOL::onViaCommand(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::Other_Layer_Route(), 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(), PCB_BASE_FRAME::SetActiveLayer(), PCB_BASE_FRAME::SetCurItem(), PCB_BASE_FRAME::SetFastGrid1(), PCB_BASE_FRAME::SetFastGrid2(), PCB_BASE_FRAME::SetPageSettings(), PCB_BASE_FRAME::SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), DIALOG_SET_GRID::TransferDataFromWindow(), DIALOG_MOVE_EXACT::TransferDataFromWindow(), PCBNEW_CONTROL::updateGrid(), PCB_BASE_FRAME::updateGridSelectBox(), PCB_BASE_FRAME::UpdateMsgPanel(), PCB_BASE_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::updateZoomSelectBox(), and DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME().

200 { 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:352
wxString EDA_DRAW_FRAME::GetScreenDesc ( ) const
virtualinherited

Reimplemented in SCH_EDIT_FRAME.

Definition at line 119 of file worksheet.cpp.

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

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

Definition at line 1303 of file draw_frame.cpp.

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

Referenced by EDA_DRAW_PANEL::OnMouseEvent(), EDA_DRAW_PANEL::OnMouseWheel(), 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().

1304 {
1305  BASE_SCREEN* screen = GetScreen(); // virtual call
1306  return screen->getScrollCenterPosition();
1307 }
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:352
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
const wxPoint & getScrollCenterPosition() const
Definition: base_screen.h:173
bool EDA_DRAW_FRAME::GetShowBorderAndTitleBlock ( ) const
inlineinherited

Definition at line 336 of file draw_frame.h.

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

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

Implements EDA_DRAW_FRAME.

Definition at line 241 of file pcb_base_frame.cpp.

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

Referenced by CreateHeaderInfoData().

242 {
243  wxASSERT( m_Pcb );
244  return m_Pcb->GetTitleBlock();
245 }
TITLE_BLOCK & GetTitleBlock()
Definition: class_board.h:553
int EDA_DRAW_FRAME::GetToolId ( ) const
inlineinherited
Returns
the current tool ID when there is no active tool, the ID_NO_TOOL_SELECTED is returned (the id of the default Tool (idle tool) of the right vertical toolbar)

Definition at line 476 of file draw_frame.h.

Referenced by PCB_EDIT_FRAME::Begin_Zone(), LIB_EDIT_FRAME::CreateGraphicItem(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), LIB_EDIT_FRAME::EndDrawGraphicItem(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), 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(), PICKER_TOOL::Init(), PAD_TOOL::Init(), PCB_EDITOR_CONTROL::Init(), EDIT_TOOL::Init(), GERBVIEW_SELECTION_TOOL::Main(), 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(), PL_EDITOR_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(), SCH_EDIT_FRAME::OnSelectTool(), PCB_EDIT_FRAME::OnSelectTool(), LIB_EDIT_FRAME::OnUpdateEditingPart(), PCB_EDIT_FRAME::OnUpdateMuWaveToolbar(), FOOTPRINT_EDIT_FRAME::OnUpdateSelectTool(), PL_EDITOR_FRAME::OnUpdateSelectTool(), GERBVIEW_FRAME::OnUpdateSelectTool(), LIB_EDIT_FRAME::OnUpdateSelectTool(), SCH_EDIT_FRAME::OnUpdateSelectTool(), FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar(), PCB_EDIT_FRAME::OnUpdateVerticalToolbar(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), PCB_BASE_FRAME::SetToolID(), and PCB_EDIT_FRAME::SwitchLayer().

476 { return m_toolId; }
bool EDA_DRAW_FRAME::GetToolToggled ( int  aToolId)
inlineinherited

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

This is needed because GerbView and Pcbnew put some of the same tools in different toolbars (for example, zoom selection is in the main bar in Pcbnew and in the options bar in GerbView).

Definition at line 445 of file draw_frame.h.

Referenced by ZOOM_TOOL::Main().

446  {
447  return ( m_mainToolBar->GetToolToggled( aToolId ) ||
448  m_optionsToolBar->GetToolToggled( aToolId ) ||
449  m_drawToolBar->GetToolToggled( aToolId ) );
450  }
wxAuiToolBar * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:129
wxAuiToolBar * m_drawToolBar
The tool bar that contains the buttons for quick access to the application draw tools.
Definition: draw_frame.h:126
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
double EDA_DRAW_FRAME::GetZoom ( )
inherited

Function GetZoom.

Returns
The current zoom level.

Definition at line 494 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 PCB_BASE_FRAME::updateZoomSelectBox().

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

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

Definition at line 425 of file draw_frame.h.

Referenced by ZOOM_MENU::ZOOM_MENU().

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

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

Virtual from the base class

Reimplemented from EDA_DRAW_FRAME.

Definition at line 844 of file pcb_base_frame.cpp.

References EDA_DRAW_FRAME::GetZoomLevelIndicator().

Referenced by PCB_BASE_FRAME::GetScreen().

845 {
847 }
virtual const wxString GetZoomLevelIndicator() const
Function GetZoomLevelIndicator returns a human readable value which can be displayed as zoom level in...
Definition: draw_frame.cpp:694
void PCB_BASE_FRAME::GlobalChange_PadSettings ( D_PAD aPad,
bool  aSameFootprints,
bool  aPadShapeFilter,
bool  aPadOrientFilter,
bool  aPadLayerFilter,
bool  aRedraw,
bool  aSaveForUndo 
)
inherited

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(), DisplayError(), DO_NOT_DRAW, MODULE::GetBoundingBox(), PCB_BASE_FRAME::GetDesignSettings(), MODULE::GetFPID(), D_PAD::GetLayerSet(), D_PAD::GetLocalSolderMaskMargin(), D_PAD::GetLocalSolderPasteMargin(), D_PAD::GetLocalSolderPasteMarginRatio(), MODULE::GetOrientation(), D_PAD::GetOrientation(), D_PAD::GetParent(), D_PAD::GetShape(), EDA_DRAW_FRAME::m_canvas, BOARD::m_Modules, BOARD_DESIGN_SETTINGS::m_Pad_Master, PCB_BASE_FRAME::m_Pcb, MODULE::Next(), D_PAD::Next(), PCB_EDIT_FRAME::OnModify(), MODULE::PadsList(), PICKED_ITEMS_LIST::PushItem(), EDA_DRAW_PANEL::RefreshDrawingRect(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EDA_ITEM::SetFlags(), and UR_CHANGED.

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

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->PadsList(); 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  // Do not copy a pad into it, it can create issue, and this is useless
198  if( pad == aPad )
199  continue;
200 
201  saveMe = true;
202  }
203 
204  if( saveMe )
205  {
206  ITEM_PICKER itemWrapper( module, UR_CHANGED );
207 
208  itemsList.PushItem( itemWrapper );
209  }
210  }
211 
212  SaveCopyInUndoList( itemsList, UR_CHANGED );
213  }
214 
215  // Update the current module and same others modules if requested.
216  for( module = m_Pcb->m_Modules; module; module = module->Next() )
217  {
218  if( !aSameFootprints && (module != Module_Ref) )
219  continue;
220 
221  if( module->GetFPID() != Module_Ref->GetFPID() )
222  continue;
223 
224  // Erase module on screen
225  if( aRedraw )
226  {
227  module->SetFlags( DO_NOT_DRAW );
229  module->ClearFlags( DO_NOT_DRAW );
230  }
231 
232  for( D_PAD* pad = module->PadsList(); pad; pad = pad->Next() )
233  {
234  // Filters changes prohibited.
235  if( aPadShapeFilter && ( pad->GetShape() != aPad->GetShape() ) )
236  continue;
237 
238  if( aPadOrientFilter &&
239  (pad->GetOrientation() - module->GetOrientation()) != pad_orient )
240  continue;
241 
242  if( aPadLayerFilter )
243  {
244  if( pad->GetLayerSet() != aPad->GetLayerSet() )
245  continue;
246  }
247 
248  // Do not copy a pad into it, it can create issue in custom pads
249  // and primitive list.
250  if( pad == aPad )
251  continue;
252 
253  // Copy physical characteristics:
254  pad->ImportSettingsFromMaster( *aPad );
255 
256  // copy also local mask margins:
257  pad->SetLocalSolderMaskMargin( aPad->GetLocalSolderMaskMargin() );
258  pad->SetLocalSolderPasteMargin( aPad->GetLocalSolderPasteMargin() );
259  pad->SetLocalSolderPasteMarginRatio( aPad->GetLocalSolderPasteMarginRatio() );
260  }
261 
262  module->CalculateBoundingBox();
263 
264  if( aRedraw )
266  }
267 
268  OnModify();
269 }
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
int GetLocalSolderMaskMargin() const
Definition: class_pad.h:403
MODULE * Next() const
Definition: class_module.h:120
MODULE * GetParent() const
Definition: class_pad.h:162
void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
Definition: draw_panel.cpp:319
void PushItem(const ITEM_PICKER &aItem)
Function PushItem pushes aItem to the top of the list.
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:216
const LIB_ID & GetFPID() const
Definition: class_module.h:184
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:282
double GetOrientation() const
Definition: class_module.h:180
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:395
D_PAD * Next() const
Definition: class_pad.h:160
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:409
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
double GetLocalSolderPasteMarginRatio() const
Definition: class_pad.h:412
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
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:245
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:375
D_PAD m_Pad_Master
A dummy pad to store all default parameters.
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:283
DLIST< D_PAD > & PadsList()
Definition: class_module.h:154
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:74
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:139
bool EDA_DRAW_FRAME::HandleBlockBegin ( wxDC *  aDC,
EDA_KEY  aKey,
const wxPoint aPosition,
int  aExplicitCommand = 0 
)
virtualinherited

Initialize a block command.

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

Definition at line 840 of file draw_frame.cpp.

References BLOCK_COPY, BLOCK_DELETE, BLOCK_DRAG, BLOCK_DRAG_ITEM, BLOCK_DUPLICATE, BLOCK_DUPLICATE_AND_INCREMENT, BLOCK_FLIP, BLOCK_IDLE, BLOCK_MIRROR_X, BLOCK_MIRROR_Y, BLOCK_MOVE, BLOCK_PASTE, BLOCK_PRESELECT_MOVE, BLOCK_ROTATE, 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(), LIB_EDIT_FRAME::Process_Special_Functions(), and SCH_EDIT_FRAME::Process_Special_Functions().

842 {
844 
845  if( ( block->GetCommand() != BLOCK_IDLE ) || ( block->GetState() != STATE_NO_BLOCK ) )
846  return false;
847 
848  if( aExplicitCommand == 0 )
849  block->SetCommand( (BLOCK_COMMAND_T) BlockCommand( aKey ) );
850  else
851  block->SetCommand( (BLOCK_COMMAND_T) aExplicitCommand );
852 
853  if( block->GetCommand() == 0 )
854  return false;
855 
856  switch( block->GetCommand() )
857  {
858  case BLOCK_IDLE:
859  break;
860 
861  case BLOCK_MOVE: // Move
862  case BLOCK_DRAG: // Drag (block defined)
863  case BLOCK_DRAG_ITEM: // Drag from a drag item command
864  case BLOCK_DUPLICATE: // Duplicate
865  case BLOCK_DUPLICATE_AND_INCREMENT: // Duplicate and increment relevant references
866  case BLOCK_DELETE: // Delete
867  case BLOCK_COPY: // Copy
868  case BLOCK_ROTATE: // Rotate 90 deg
869  case BLOCK_FLIP: // Flip
870  case BLOCK_ZOOM: // Window Zoom
871  case BLOCK_MIRROR_X:
872  case BLOCK_MIRROR_Y: // mirror
873  case BLOCK_PRESELECT_MOVE: // Move with preselection list
874  block->InitData( m_canvas, aPosition );
875  break;
876 
877  case BLOCK_PASTE:
878  block->InitData( m_canvas, aPosition );
879  block->SetLastCursorPosition( wxPoint( 0, 0 ) );
881 
882  if( block->GetCount() == 0 ) // No data to paste
883  {
884  DisplayError( this, wxT( "No block to paste" ), 20 );
887  block->SetState( STATE_NO_BLOCK );
888  block->SetMessageBlock( this );
889  return true;
890  }
891 
892  if( !m_canvas->IsMouseCaptured() )
893  {
894  block->ClearItemsList();
895  DisplayError( this,
896  wxT( "EDA_DRAW_FRAME::HandleBlockBegin() Err: m_mouseCaptureCallback NULL" ) );
897  block->SetState( STATE_NO_BLOCK );
898  block->SetMessageBlock( this );
899  return true;
900  }
901 
902  block->SetState( STATE_BLOCK_MOVE );
903  m_canvas->CallMouseCapture( aDC, aPosition, false );
904  break;
905 
906  default:
907  {
908  wxString msg;
909  msg << wxT( "EDA_DRAW_FRAME::HandleBlockBegin() error: Unknown command " ) <<
910  block->GetCommand();
911  DisplayError( this, msg );
912  }
913  break;
914  }
915 
916  block->SetMessageBlock( this );
917  return true;
918 }
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
Definition: base_screen.h:214
virtual int BlockCommand(EDA_KEY aKey)
Function BlockCommand Returns the block command code (BLOCK_MOVE, BLOCK_COPY...) corresponding to the...
Definition: draw_frame.cpp:659
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:665
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:352
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:93
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:74
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 677 of file draw_frame.cpp.

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

678 {
679  return false;
680 }
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 672 of file draw_frame.cpp.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

673 {
674 }
wxString EDA_BASE_FRAME::help_name ( )
protectedvirtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 380 of file eda_base_frame.cpp.

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

Referenced by EDA_BASE_FRAME::GetKicadHelp(), and EDA_BASE_FRAME::isAutoSaveRequired().

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

Definition at line 63 of file pad_edition_functions.cpp.

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

Referenced by PCB_BASE_FRAME::AddPad(), PCB_BASE_FRAME::GetScreen(), 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  aPad->SetPrimitives( mp.GetPrimitives() );
79 
80  if( aDraw )
82 
83  aPad->GetParent()->SetLastEditTime();
84 
85  OnModify();
86 }
bool MergePrimitivesAsPolygon(SHAPE_POLY_SET *aMergedPolygon=NULL, int aCircleToSegmentsCount=32)
Merge all basic shapes, converted to a polygon in one polygon, in m_customShapeAsPolygon.
PAD_SHAPE_T GetAnchorPadShape() const
Function GetAnchorPadShape.
Definition: class_pad.h:226
const std::vector< PAD_CS_PRIMITIVE > & GetPrimitives() const
Accessor to the basic shape list.
Definition: class_pad.h:336
MODULE * GetParent() const
Definition: class_pad.h:162
void RefreshDrawingRect(const EDA_RECT &aRect, bool aEraseBackground=true)
Function RefreshDrawingRect redraws the contents of aRect in drawing units.
Definition: draw_panel.cpp:319
void SetLastEditTime(time_t aTime)
Definition: class_module.h:302
void SetAnchorPadShape(PAD_SHAPE_T aShape)
Function SetAnchorPadShape Set the shape of the anchor pad for custm shped pads.
Definition: class_pad.h:253
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:282
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:1348
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
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:283
bool SetPrimitives(const std::vector< PAD_CS_PRIMITIVE > &aPrimitivesList)
Import to the basic shape list.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
Definition: class_pad.cpp:198
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:139
VTBL_ENTRY bool KIWAY_PLAYER::ImportFile ( const wxString &  aFileName,
int  aFileType 
)
inlineinherited

Function ImportFile load the given filename but sets the path to the current project path.

Parameters
fullfilepath of file to be imported.
aFileTypeenum value for filetype

Definition at line 188 of file kiway_player.h.

References VTBL_ENTRY.

189  {
190  // overload me for your wxFrame type.
191 
192  return false;
193  }
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 728 of file hotkeys_basic.cpp.

References DEFAULT_HOTKEY_FILENAME_EXT, and EDA_FILE_SELECTOR().

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(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), and EDA_BASE_FRAME::SaveProjectSettings().

730 {
731  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
732  wxString mask = wxT( "*." ) + ext;
733 
734 
735  wxString path = GetMruPath();
736  wxFileName fn( aDefaultShortname );
737  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
738 
739  wxString filename = EDA_FILE_SELECTOR( _( "Read Hotkey Configuration File:" ),
740  path,
741  fn.GetFullPath(),
742  ext,
743  mask,
744  this,
745  wxFD_OPEN,
746  true );
747 
748  if( filename.IsEmpty() )
749  return;
750 
751  ReadHotkeyConfigFile( filename, aDescList );
752  WriteHotkeyConfig( aDescList );
753  SetMruPath( wxFileName( filename ).GetPath() );
754 }
void SetMruPath(const wxString &aPath)
int ReadHotkeyConfigFile(const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList)
Function ReadHotkeyConfigFile Read an old configuration file (&ltfile&gt.key) and fill the current ho...
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