KiCad PCB EDA Suite
GERBVIEW_FRAME Class Reference

#include <gerbview_frame.h>

Inheritance diagram for GERBVIEW_FRAME:
EDA_DRAW_FRAME KIWAY_PLAYER EDA_BASE_FRAME KIWAY_HOLDER

Public Member Functions

void SetLayout (GBR_LAYOUT *aLayout)
 Function SetLayout sets the m_gerberLayout member in such as way as to ensure deleting any previous GBR_LAYOUT. More...
 
GBR_LAYOUTGetGerberLayout () const
 
GERBER_FILE_IMAGE_LISTGetImagesList () const
 Accessors to GERBER_FILE_IMAGE_LIST and GERBER_FILE_IMAGE data. More...
 
GERBER_FILE_IMAGEGetGbrImage (int aIdx) const
 
unsigned ImagesMaxCount () const
 The max number of file images. More...
 
void SetPageSettings (const PAGE_INFO &aPageSettings) override
 
const PAGE_INFOGetPageSettings () const override
 
const wxSize GetPageSizeIU () const override
 Works off of GetPageSettings() to return the size of the paper page in the internal units of this particular view. More...
 
const wxPoint & GetAuxOrigin () const override
 Return the origin of the axis used for plotting and various exports. More...
 
void SetAuxOrigin (const wxPoint &aPoint) override
 
const wxPoint & GetGridOrigin () const override
 Return the absolute coordinates of the origin of the snap grid. More...
 
void SetGridOrigin (const wxPoint &aPoint) override
 
const TITLE_BLOCKGetTitleBlock () const override
 
void SetTitleBlock (const TITLE_BLOCK &aTitleBlock) override
 
void SetCurItem (GERBER_DRAW_ITEM *aItem, bool aDisplayInfo=true)
 Function SetCurItem sets the currently selected item and displays it in the MsgPanel. More...
 
int SelectPCBLayer (int aDefaultLayer, int aOpperLayerCount, bool aNullLayer=false)
 Install the dialog box for layer selection. More...
 
virtual void SetGridColor (COLOR4D aColor) override
 

More...
 
 GERBVIEW_FRAME (KIWAY *aKiway, wxWindow *aParent)
 
 ~GERBVIEW_FRAME ()
 
void OnCloseWindow (wxCloseEvent &Event)
 
bool OpenProjectFiles (const std::vector< wxString > &aFileSet, int aCtl) override
 
void RedrawActiveWindow (wxDC *DC, bool EraseBg) override
 
void ReCreateHToolbar () override
 
void ReCreateAuxiliaryToolbar () override
 
void ReCreateVToolbar () override
 Function ReCreateVToolbar creates or updates the right vertical toolbar. More...
 
void ReCreateOptToolbar ()
 Create or update the left vertical toolbar (option toolbar. More...
 
void ReCreateMenuBar () override
 Recreates the menu bar. More...
 
void OnLeftClick (wxDC *aDC, const wxPoint &aMousePos) override
 
void OnLeftDClick (wxDC *aDC, const wxPoint &aMousePos) override
 
bool OnRightClick (const wxPoint &aMousePos, wxMenu *aPopMenu) override
 
void OnUpdateSelectTool (wxUpdateUIEvent &aEvent)
 
void OnUpdateSelectZoom (wxUpdateUIEvent &aEvent)
 
double BestZoom () override
 Return the zoom level which displays the full page on screen. More...
 
void UpdateStatusBar () override
 Update the status bar information. More...
 
const wxString GetZoomLevelIndicator () const override
 Function GetZoomLevelIndicator returns a human readable value which can be displayed as zoom level indicator in dialogs. More...
 
int GetDisplayMode ()
 Function GetDisplayMode. More...
 
void SetDisplayMode (int aMode)
 Function SetDisplayMode. More...
 
bool IsElementVisible (int aLayerID) const
 Function IsElementVisible tests whether a given element category is visible. More...
 
void SetElementVisibility (int aLayerID, bool aNewState)
 Function SetElementVisibility changes the visibility of an element category. More...
 
void SetGridVisibility (bool aVisible) override
 Function SetGridVisibility(), virtual from EDA_DRAW_FRAME It may be overloaded by derived classes. More...
 
LSET GetVisibleLayers () const
 Function GetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSettings. More...
 
void SetVisibleLayers (LSET aLayerMask)
 Function SetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSettings. More...
 
bool IsLayerVisible (int aLayer) const
 Function IsLayerVisible tests whether a given layer is visible. More...
 
COLOR4D GetVisibleElementColor (int aLayerID)
 Function GetVisibleElementColor returns the color of a gerber visible element. More...
 
void SetVisibleElementColor (int aLayerID, COLOR4D aColor)
 
COLOR4D GetLayerColor (int aLayer) const
 Function GetLayerColor gets a layer color for any valid layer. More...
 
void SetLayerColor (int aLayer, COLOR4D aColor)
 Function SetLayerColor changes a layer color for any valid layer. More...
 
COLOR4D GetNegativeItemsColor ()
 Function GetNegativeItemsColor. More...
 
void ReFillLayerWidget ()
 Function ReFillLayerWidget changes out all the layers in m_Layers and may be called upon loading new gerber files. More...
 
void SetActiveLayer (int aLayer, bool doLayerWidgetUpdate=true)
 Function SetActiveLayer will change the currently active layer to aLayer and also update the GERBER_LAYER_WIDGET. More...
 
int GetActiveLayer ()
 Function SetActiveLayer returns the active layer. More...
 
int getNextAvailableLayer (int aLayer=0) const
 Function getNextAvailableLayer finds the next empty layer starting at aLayer and returns it to the caller. More...
 
bool hasAvailableLayers () const
 
void syncLayerWidget ()
 Function syncLayerWidget updates the currently "selected" layer within the GERBER_LAYER_WIDGET. More...
 
void syncLayerBox (bool aRebuildLayerBox=false)
 Function syncLayerBox updates the currently "selected" layer within m_SelLayerBox The currently active layer, as defined by the return value of GetActiveLayer(). More...
 
void UpdateTitleAndInfo ()
 Function UpdateTitleAndInfo displays the short filename (if exists) of the selected layer on the caption of the main GerbView window and some other parameters Name of the layer (found in the gerber file: LN &ltname&gt command) in the status bar Name of the Image (found in the gerber file: IN &ltname&gt command) in the status bar and other data in toolbar. More...
 
PARAM_CFG_ARRAYGetConfigurationSettings (void)
 Function GetConfigurationSettings Populates the GerbView applications settings list. More...
 
void LoadSettings (wxConfigBase *aCfg) override
 Load common frame parameters from a configuration file. More...
 
void SaveSettings (wxConfigBase *aCfg) override
 Saves common frame parameters to a configuration data file. More...
 
void OnToggleCoordType (wxCommandEvent &aEvent)
 
void OnToggleFlashItemDrawMode (wxCommandEvent &aEvent)
 
void OnToggleLineDrawMode (wxCommandEvent &aEvent)
 
void OnTogglePolygonDrawMode (wxCommandEvent &aEvent)
 
void OnToggleShowLayerManager (wxCommandEvent &aEvent)
 
void ShowChangedLanguage () override
 Redraw the menus and what not in current language. More...
 
void Process_Special_Functions (wxCommandEvent &event)
 
void OnSelectOptionToolbar (wxCommandEvent &event)
 
void OnSelectHighlightChoice (wxCommandEvent &event)
 Handles the changing of the highlighted component/net/attribute. More...
 
void OnSelectActiveDCode (wxCommandEvent &event)
 Function OnSelectActiveDCode Selects the active DCode for the current active layer. More...
 
void OnSelectActiveLayer (wxCommandEvent &event)
 Function OnSelectActiveLayer Selects the active layer: More...
 
void OnShowGerberSourceFile (wxCommandEvent &event)
 Function OnShowGerberSourceFile Call the preferred editor to show (and edit) the gerber source file loaded in the active layer. More...
 
void OnSelectDisplayMode (wxCommandEvent &event)
 Function OnSelectDisplayMode called on a display mode selection Mode selection can be fast display, or exact mode with stacked images or with transparency. More...
 
void OnQuit (wxCommandEvent &event)
 Function OnQuit called on request of application quit. More...
 
EDA_HOTKEYGetHotKeyDescription (int aCommand) const override
 

More...
 
bool OnHotKey (wxDC *aDC, int aHotkeyCode, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
 Function OnHotKey. More...
 
GERBER_DRAW_ITEMLocate (const wxPoint &aPosition, int typeloc)
 
void Process_Config (wxCommandEvent &event)
 
void OnUpdateDrawMode (wxUpdateUIEvent &aEvent)
 
void OnUpdateCoordType (wxUpdateUIEvent &aEvent)
 
void OnUpdateFlashedItemsDrawMode (wxUpdateUIEvent &aEvent)
 
void OnUpdateLineDrawMode (wxUpdateUIEvent &aEvent)
 
void OnUpdatePolygonDrawMode (wxUpdateUIEvent &aEvent)
 
void OnUpdateShowDCodes (wxUpdateUIEvent &aEvent)
 
void OnUpdateShowNegativeItems (wxUpdateUIEvent &aEvent)
 
void OnUpdateShowLayerManager (wxUpdateUIEvent &aEvent)
 
void OnUpdateSelectDCode (wxUpdateUIEvent &aEvent)
 
void OnUpdateLayerSelectBox (wxUpdateUIEvent &aEvent)
 
void OnUpdateDiffMode (wxUpdateUIEvent &aEvent)
 
void OnUpdateHighContrastMode (wxUpdateUIEvent &aEvent)
 
virtual int BlockCommand (EDA_KEY key) override
 Function BlockCommand returns the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to the aKey (ALT, SHIFT ALT ..) More...
 
virtual void HandleBlockPlace (wxDC *DC) override
 Function HandleBlockPlace handles the block place command. More...
 
virtual bool HandleBlockEnd (wxDC *DC) override
 Function HandleBlockEnd handles the end of a block command, It is called at the end of the definition of the area of a block. More...
 
void Block_Move ()
 Function Block_Move moves all tracks and segments within the selected block. More...
 
void ToPrinter (wxCommandEvent &event)
 Function ToPrinter Open a dialog frame to print layers. More...
 
void Files_io (wxCommandEvent &event)
 
void OnGbrFileHistory (wxCommandEvent &event)
 Function OnGbrFileHistory deletes the current data and loads a Gerber file selected from history list on current layer. More...
 
void OnDrlFileHistory (wxCommandEvent &event)
 Function OnDrlFileHistory deletes the current data and load a drill file in Excellon format selected from history list on current layer. More...
 
void OnZipFileHistory (wxCommandEvent &event)
 Function OnZipFileHistory deletes the current data and load a zip archive file selected from the history list. More...
 
void OnJobFileHistory (wxCommandEvent &event)
 deletes the current data and load a gerber job file selected from the history list. More...
 
bool unarchiveFiles (const wxString &aFullFileName, REPORTER *aReporter=nullptr)
 Extracts gerber and drill files from the zip archive, and load them. More...
 
bool LoadGerberFiles (const wxString &aFileName)
 function LoadGerberFiles Load a photoplot (Gerber) file or many files. More...
 
bool Read_GERBER_File (const wxString &GERBER_FullFileName)
 
bool LoadExcellonFiles (const wxString &aFileName)
 function LoadExcellonFiles Load a drill (EXCELLON) file or many files. More...
 
bool Read_EXCELLON_File (const wxString &aFullFileName)
 
bool LoadZipArchiveFile (const wxString &aFileName)
 function LoadZipArchiveFileLoadZipArchiveFile Load a zipped archive file. More...
 
bool LoadGerberJobFile (const wxString &aFileName)
 Load a Gerber job file, and load gerber files found in job files. More...
 
bool GeneralControl (wxDC *aDC, const wxPoint &aPosition, EDA_KEY aHotKey=0) override
 Perform application specific control using aDC at aPosition in logical units. More...
 
void Liste_D_Codes ()
 Set Size Items (Lines, Flashes) from DCodes List. More...
 
bool Clear_DrawLayers (bool query)
 
void Erase_Current_DrawLayer (bool query)
 
void SortLayersByX2Attributes ()
 
void UpdateDisplayOptions (const GBR_DISPLAY_OPTIONS &aOptions)
 Updates the display options and refreshes the view as needed. More...
 
void ExportDataInPcbnewFormat (wxCommandEvent &event)
 
void SaveCopyInUndoList (GERBER_DRAW_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand=UR_UNSPECIFIED, const wxPoint &aTransformPoint=wxPoint(0, 0))
 
void SaveCopyInUndoList (const PICKED_ITEMS_LIST &aItemsList, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0))
 Function SaveCopyInUndoList (overloaded). More...
 
virtual void UseGalCanvas (bool aEnable) override
 

More...
 
void OnSwitchCanvas (wxCommandEvent &aEvent)
 switches currently used canvas (default / Cairo / OpenGL). More...
 
void OnUpdateSwitchCanvas (wxUpdateUIEvent &aEvent)
 Update UI called when switches currently used canvas (default / Cairo / OpenGL). More...
 
void InstallPreferences (PAGED_DIALOG *aParent) override
 Allows Gerbview to install its preferences panels into the preferences dialog. More...
 
void CommonSettingsChanged () override
 Called after the preferences dialog is run. More...
 
void SyncMenusAndToolbars () override
 Update the toolbars and menus (mostly settings/check buttons/checkboxes) with the current controller state. More...
 
virtual void OnCharHook (wxKeyEvent &event)
 Capture the key event before it is sent to the GUI. More...
 
bool LockFile (const wxString &aFileName)
 Mark a schematic file as being in use. More...
 
void ReleaseFile ()
 Release the current file marked in use. More...
 
EDA_UNITS_T GetUserUnits () const override
 Return the user units currently in use. More...
 
void SetUserUnits (EDA_UNITS_T aUnits)
 
void ChangeUserUnits (EDA_UNITS_T aUnits)
 
int GetLastGridSizeId () const
 
void SetLastGridSizeId (int aId)
 
wxPoint GetCrossHairPosition (bool aInvertY=false) const
 Return the current cross hair position in logical (drawing) coordinates. More...
 
void SetCrossHairPosition (const wxPoint &aPosition, bool aSnapToGrid=true)
 Set the screen cross hair position to aPosition in logical (drawing) units. More...
 
wxPoint GetCursorPosition (bool aOnGrid, wxRealPoint *aGridSize=NULL) const
 Return the current cursor position in logical (drawing) units. More...
 
wxPoint GetNearestGridPosition (const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
 Return the nearest aGridSize location to aPosition. More...
 
wxPoint GetCrossHairScreenPosition () const
 Return the cross hair position in device (display) units.b. More...
 
void SetMousePosition (const wxPoint &aPosition)
 
wxPoint RefPos (bool useMouse) const
 Return the reference position, coming from either the mouse position or the cursor position. More...
 
const wxPoint & GetScrollCenterPosition () const
 
void SetScrollCenterPosition (const wxPoint &aPoint)
 
virtual COLOR4D GetDrawBgColor () const
 
virtual void SetDrawBgColor (COLOR4D aColor)
 
bool GetShowBorderAndTitleBlock () const
 
void SetShowBorderAndTitleBlock (bool aShow)
 
bool ShowPageLimits () const
 
void SetShowPageLimits (bool aShow)
 
virtual EDA_DRAW_PANELGetCanvas () const
 
virtual wxString GetScreenDesc () const
 
virtual BASE_SCREENGetScreen () const
 Return a pointer to a BASE_SCREEN or one of its derivatives. More...
 
virtual void ExecuteRemoteCommand (const char *cmdline)
 Execute a remote command send via a socket to the application, port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242) It called by EDA_DRAW_FRAME::OnSockRequest(). More...
 
void OnMenuOpen (wxMenuEvent &event)
 
void OnMouseEvent (wxMouseEvent &event)
 
void SkipNextLeftButtonReleaseEvent ()
 After calling this function, if the left mouse button is down, the next left mouse button release event will be ignored. More...
 
int WriteHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL) override
 

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

Public Attributes

GBR_DISPLAY_OPTIONS m_DisplayOptions
 
wxChoice * m_SelComponentBox
 
wxChoice * m_SelNetnameBox
 
wxChoice * m_SelAperAttributesBox
 
GBR_LAYER_BOX_SELECTORm_SelLayerBox
 
DCODE_SELECTION_BOXm_DCodeSelector
 
wxTextCtrl * m_TextInfo
 
COLORS_DESIGN_SETTINGSm_colorsSettings
 

Protected Member Functions

virtual void SetScreen (BASE_SCREEN *aScreen)
 
double bestZoom (double sizeX, double sizeY, double scaleFactor, wxPoint centre)
 
bool LibraryFileBrowser (bool doOpen, wxFileName &aFilename, const wxString &wildcard, const wxString &ext, bool isDirectory=false)
 
bool GeneralControlKeyMovement (int aHotKey, wxPoint *aPos, bool aSnapToGrid)
 Handle the common part of GeneralControl dedicated to global cursor keys (i.e. More...
 
void RefreshCrossHair (const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC *aDC)
 Move and refresh the crosshair after movement and call the mouse capture function. More...
 
bool saveCanvasTypeSetting (EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
 Stores the canvas type in the application settings. More...
 
bool saveCanvasImageToFile (const wxString &aFileName, wxBitmapType aBitmapType=wxBITMAP_TYPE_PNG)
 
virtual wxString GetCanvasTypeKey ()
 
bool IsModal ()
 
void SetModal (bool aIsModal)
 
bool IsDismissed ()
 Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal(). More...
 
void DismissModal (bool aRetVal, const wxString &aResult=wxEmptyString)
 
void kiway_express (KIWAY_EXPRESS &aEvent)
 event handler, routes to derivative specific virtual KiwayMailIn() More...
 
void language_change (wxCommandEvent &event)
 Function language_change is an event handler called on a language menu selection. More...
 
void onAutoSaveTimer (wxTimerEvent &aEvent)
 Handle the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Return the auto save status of the application. More...
 
virtual bool doAutoSave ()
 This should be overridden by the derived class to handle the auto save feature. More...
 
virtual wxConfigBase * config ()
 Return the wxConfigBase used in SaveSettings(). More...
 
virtual const SEARCH_STACKsys_search ()
 Return a SEARCH_STACK pertaining to entire program. More...
 
virtual wxString help_name ()
 

Static Protected Member Functions

static wxString GetBackupSuffix ()
 
static wxString GetAutoSaveFilePrefix ()
 

Protected Attributes

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

Static Protected Attributes

static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND
 

Default style flags used for wxAUI toolbars

More...
 

Private Member Functions

void updateComponentListSelectBox ()
 
void updateNetnameListSelectBox ()
 
void updateAperAttributesSelectBox ()
 
void updateDCodeSelectBox ()
 
void updateGridSelectBox ()
 
void updateZoomSelectBox ()
 
void unitsChangeRefresh () override
 Called when when the units setting has changed to allow for any derived classes to handle refreshing and controls that have units based measurements in them. More...
 
void setupTools ()
 
void applyDisplaySettingsToGAL ()
 Updates the GAL with display settings changes. More...
 
bool loadListOfGerberAndDrillFiles (const wxString &aPath, const wxArrayString &aFilenameList, const std::vector< int > *aFileType=nullptr)
 Loads a list of Gerber and NC drill files and updates the view based on them. More...
 

Private Attributes

GBR_LAYOUTm_gerberLayout
 
wxPoint m_grid_origin
 
PAGE_INFO m_paper
 
PARAM_CFG_ARRAY m_configSettings
 
int m_displayMode
 
bool m_show_layer_manager_tools
 

Detailed Description

Definition at line 58 of file gerbview_frame.h.

Constructor & Destructor Documentation

◆ GERBVIEW_FRAME()

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

Definition at line 67 of file gerbview_frame.cpp.

67  :
68  EDA_DRAW_FRAME( aKiway, aParent, FRAME_GERBER, wxT( "GerbView" ),
69  wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, GERBVIEW_FRAME_NAME ),
73 {
75  m_gerberLayout = NULL;
76  m_zoomLevelCoeff = ZOOM_FACTOR( 110 ); // Adjusted to roughly displays zoom level = 1
77  // when the screen shows a 1:1 image
78  // obviously depends on the monitor,
79  // but this is an acceptable value
80 
81  // Be sure a page info is set. this default value will be overwritten later.
82  PAGE_INFO pageInfo( wxT( "GERBER" ) );
83  SetPageSettings( pageInfo );
84 
86 
87  m_showAxis = true; // true to show X and Y axis on screen
88  m_showBorderAndTitleBlock = false; // true for reference drawings.
90  m_SelLayerBox = NULL;
91  m_DCodeSelector = NULL;
92  m_SelComponentBox = nullptr;
93  m_SelNetnameBox = nullptr;
94  m_SelAperAttributesBox = nullptr;
95  m_displayMode = 0;
96  m_AboutTitle = "GerbView";
97 
98  int fileHistorySize;
99  Pgm().CommonSettings()->Read( FILE_HISTORY_SIZE_KEY, &fileHistorySize,
101  m_drillFileHistory.SetMaxFiles( fileHistorySize );
102  m_zipFileHistory.SetMaxFiles( fileHistorySize );
103  m_jobFileHistory.SetMaxFiles( fileHistorySize );
104 
105  EDA_DRAW_PANEL_GAL* galCanvas = new GERBVIEW_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ),
106  m_FrameSize,
109 
110  SetGalCanvas( galCanvas );
111 
112  // GerbView requires draw priority for rendering negative objects
113  galCanvas->GetView()->UseDrawPriority( true );
114 
115  if( m_canvas )
117 
118  // Give an icon
119  wxIcon icon;
120  icon.CopyFromBitmap( KiBitmap( icon_gerbview_xpm ) );
121  SetIcon( icon );
122 
123  SetLayout( new GBR_LAYOUT() );
124 
125  SetVisibleLayers( LSET::AllLayersMask() ); // All draw layers visible.
126 
127  SetScreen( new GBR_SCREEN( GetPageSettings().GetSizeIU() ) );
128 
129  // Create the PCB_LAYER_WIDGET *after* SetLayout():
131 
132  // LoadSettings() *after* creating m_LayersManager, because LoadSettings()
133  // initialize parameters in m_LayersManager
134  LoadSettings( config() );
135 
136  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
137 
138  if( m_LastGridSizeId < 0 )
139  m_LastGridSizeId = 0;
140 
143 
145 
146  setupTools();
147  ReCreateMenuBar();
151 
152  m_auimgr.SetManagedWindow( this );
153  m_auimgr.SetArtProvider( new EDA_DOCKART( this ) );
154 
155  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
156  m_auimgr.AddPane( m_auxiliaryToolBar, EDA_PANE().HToolbar().Name( "AuxToolbar" ).Top().Layer(4) );
157  m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
158 
159  m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
160  m_auimgr.AddPane( m_LayersManager, EDA_PANE().Palette().Name( "LayersManager" ).Right().Layer(3)
161  .Caption( _( "Layers Manager" ) ).PaneBorder( false )
162  .MinSize( 80, -1 ).BestSize( m_LayersManager->GetBestSize() ) );
163 
164  m_auimgr.AddPane( m_canvas, EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
165  m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrameGal" ).Center().Hide() );
166 
167  ReFillLayerWidget(); // this is near end because contents establish size
168  m_auimgr.Update();
169 
170  SetActiveLayer( 0, true );
171  Zoom_Automatique( false ); // Gives a default zoom value
172 
174 
175  // Nudge user to switch to OpenGL if they are on legacy or Cairo
176  if( m_firstRunDialogSetting < 1 )
177  {
178  if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL )
179  {
180  wxString msg = _( "KiCad can use your graphics card to give you a smoother "
181  "and faster experience. This option is turned off by "
182  "default since it is not compatible with all computers.\n\n"
183  "Would you like to try enabling graphics acceleration?\n\n"
184  "If you'd like to choose later, select Modern Toolset "
185  "(Accelerated) in the Preferences menu." );
186 
187  wxMessageDialog dlg( this, msg, _( "Enable Graphics Acceleration" ), wxYES_NO );
188 
189  dlg.SetYesNoLabels( _( "&Enable Acceleration" ), _( "&No Thanks" ) );
190 
191  if( dlg.ShowModal() == wxID_YES )
192  {
193  // Save Cairo as default in case OpenGL crashes
195 
196  // Switch to OpenGL, which will save the new setting if successful
197  wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_OPENGL );
198  GetEventHandler()->ProcessEvent( evt );
199 
200  // Switch back to Cairo if OpenGL is not supported
201  if( GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
202  {
203  wxCommandEvent cairoEvt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
204  GetEventHandler()->ProcessEvent( cairoEvt );
205  }
206  }
207  else if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
208  {
209  // If they were on legacy, switch them to Cairo
210  wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
211  GetEventHandler()->ProcessEvent( evt );
212  }
213  }
214 
216  SaveSettings( config() );
217  }
218  else if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
219  {
220  if( GetGalCanvas()->SwitchBackend( canvasType ) )
221  UseGalCanvas( true );
222 
223  wxUpdateUIEvent e;
225  }
226  else
227  {
229  m_canvas->Refresh();
230  }
231 
232  // Enable the axes to match legacy draw style
233  auto& galOptions = GetGalDisplayOptions();
234  galOptions.m_axesEnabled = true;
235  galOptions.NotifyChanged();
236 
238  m_LayersManager->ReFillRender(); // Update colors in Render after the config is read
239 }
Class GBR_LAYOUT holds list of GERBER_DRAW_ITEM currently loaded.
Definition: gbr_layout.h:53
wxSize GetBestSize() const
Function GetBestSize returns the preferred minimum size, taking into consideration the dynamic conten...
COLORS_DESIGN_SETTINGS g_ColorsSettings(FRAME_GERBER)
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
Definition: draw_frame.h:949
bool m_showAxis
True shows the X and Y axis indicators.
Definition: draw_frame.h:138
ACTION_TOOLBAR * m_auxiliaryToolBar
Auxiliary tool bar typically shown below the main tool bar at the top of the main window.
Definition: draw_frame.h:159
ACTION_TOOLBAR * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:166
virtual void SetScreen(BASE_SCREEN *aScreen)
Definition: draw_frame.h:184
FILE_HISTORY m_jobFileHistory
void SetPageSettings(const PAGE_INFO &aPageSettings) override
GERBER_LAYER_WIDGET * m_LayersManager
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
void UseDrawPriority(bool aFlag)
Function UseDrawPriority()
Definition: view.h:667
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
Function SetActiveLayer will change the currently active layer to aLayer and also update the GERBER_L...
GBR_LAYER_BOX_SELECTOR * m_SelLayerBox
wxString m_AboutTitle
Name of program displayed in About.
EDA_DRAW_PANEL_GAL::GAL_TYPE LoadCanvasTypeSetting()
Returns the canvas type stored in the application settings.
virtual wxConfigBase * config()
Return the wxConfigBase used in SaveSettings().
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
void SetGalCanvas(EDA_DRAW_PANEL_GAL *aPanel)
Definition: draw_frame.h:932
struct EDA_HOTKEY_CONFIG GerbviewHotkeysDescr[]
wxAuiManager m_auimgr
ACTION_TOOLBAR * m_mainToolBar
Definition: draw_frame.h:156
wxChoice * m_SelNetnameBox
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
void ReCreateHToolbar() override
FILE_HISTORY m_zipFileHistory
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
#define DEFAULT_FILE_HISTORY_SIZE
The default file history size is 9.
Definition: pgm_base.h:61
void ReCreateAuxiliaryToolbar() override
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
Definition: draw_frame.h:110
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:169
GAL not used (the legacy wxDC engine is used)
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:148
COLORS_DESIGN_SETTINGS * m_colorsSettings
#define FILE_HISTORY_SIZE_KEY
Definition: pgm_base.h:53
GBR_LAYOUT * m_gerberLayout
static LSET AllLayersMask()
Definition: lset.cpp:713
virtual void UseGalCanvas(bool aEnable) override
Class GERBER_LAYER_WIDGET is here to implement the abtract functions of LAYER_WIDGET so they may be t...
#define KICAD_DEFAULT_DRAWFRAME_STYLE
EDA_DRAW_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName)
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
FILE_HISTORY m_drillFileHistory
int m_LastGridSizeId
Definition: draw_frame.h:112
#define GERBVIEW_FRAME_NAME
Class GERBVIEW_FRAME is the main window used in GerbView.
VTBL_ENTRY wxConfigBase * CommonSettings() const
Definition: pgm_base.h:190
Specialization of the wxAuiPaneInfo class for KiCad panels.
#define ZOOM_FACTOR(x)
Definition: pcb_screen.cpp:42
void ReCreateOptToolbar()
Create or update the left vertical toolbar (option toolbar.
DCODE_SELECTION_BOX * m_DCodeSelector
const PAGE_INFO & GetPageSettings() const override
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
void SetMaxFiles(size_t aMaxFiles)
Definition: pgm_base.cpp:79
double m_zoomLevelCoeff
a suitable value to convert the internal zoom scaling factor
Definition: draw_frame.h:120
wxChoice * m_SelAperAttributesBox
void OnUpdateSwitchCanvas(wxUpdateUIEvent &aEvent)
Update UI called when switches currently used canvas (default / Cairo / OpenGL).
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
void SetEnableBlockCommands(bool aEnable)
wxChoice * m_SelComponentBox
void SetLegacyMode(bool aMode)
Enables or disables legacy color mode.
void SetVisibleLayers(LSET aLayerMask)
Function SetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
void ReFillRender()
Function ReFillRender Rebuild Render for instance after the config is read.
bool m_show_layer_manager_tools
void ReCreateMenuBar() override
Recreates the menu bar.
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
bool saveCanvasTypeSetting(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Stores the canvas type in the application settings.
int SetGrid(const wxRealPoint &size)
set the current grid size m_Grid.
void SetLayout(GBR_LAYOUT *aLayout)
Function SetLayout sets the m_gerberLayout member in such as way as to ensure deleting any previous G...
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408
void ReFillLayerWidget()
Function ReFillLayerWidget changes out all the layers in m_Layers and may be called upon loading new ...
long m_firstRunDialogSetting
Key to control whether first run dialog is shown on startup.
Definition: draw_frame.h:151

References LSET::AllLayersMask(), PCAD2KICAD::Center, PGM_BASE::CommonSettings(), EDA_BASE_FRAME::config(), DEFAULT_FILE_HISTORY_SIZE, FILE_HISTORY_SIZE_KEY, g_ColorsSettings, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO, EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL, GerbviewHotkeysDescr, LAYER_WIDGET::GetBestSize(), EDA_DRAW_FRAME::GetGalCanvas(), EDA_DRAW_FRAME::GetGalDisplayOptions(), GetPageSettings(), EDA_DRAW_FRAME::GetScreen(), EDA_DRAW_PANEL_GAL::GetView(), ID_MENU_CANVAS_CAIRO, ID_MENU_CANVAS_OPENGL, ID_POPUP_GRID_LEVEL_0_0_1MM, ID_POPUP_GRID_LEVEL_1000, KiBitmap(), PCAD2KICAD::Left, EDA_DRAW_FRAME::LoadCanvasTypeSetting(), LoadSettings(), EDA_BASE_FRAME::m_AboutTitle, EDA_BASE_FRAME::m_auimgr, EDA_DRAW_FRAME::m_auxiliaryToolBar, EDA_DRAW_FRAME::m_canvas, m_colorsSettings, m_DCodeSelector, m_displayMode, m_drillFileHistory, EDA_DRAW_FRAME::m_firstRunDialogSetting, EDA_BASE_FRAME::m_FramePos, EDA_BASE_FRAME::m_FrameSize, m_gerberLayout, EDA_DRAW_FRAME::m_hotkeysDescrList, m_jobFileHistory, EDA_DRAW_FRAME::m_LastGridSizeId, m_LayersManager, EDA_DRAW_FRAME::m_mainToolBar, EDA_DRAW_FRAME::m_messagePanel, EDA_DRAW_FRAME::m_optionsToolBar, m_SelAperAttributesBox, m_SelComponentBox, m_SelLayerBox, m_SelNetnameBox, m_show_layer_manager_tools, EDA_DRAW_FRAME::m_showAxis, EDA_DRAW_FRAME::m_showBorderAndTitleBlock, m_zipFileHistory, EDA_DRAW_FRAME::m_zoomLevelCoeff, OnUpdateSwitchCanvas(), Pgm(), ReCreateAuxiliaryToolbar(), ReCreateHToolbar(), ReCreateMenuBar(), ReCreateOptToolbar(), GERBER_LAYER_WIDGET::ReFill(), ReFillLayerWidget(), GERBER_LAYER_WIDGET::ReFillRender(), EDA_DRAW_PANEL::Refresh(), PCAD2KICAD::Right, EDA_DRAW_FRAME::saveCanvasTypeSetting(), SaveSettings(), SetActiveLayer(), EDA_DRAW_PANEL::SetEnableBlockCommands(), EDA_DRAW_FRAME::SetGalCanvas(), BASE_SCREEN::SetGrid(), SetLayout(), COLORS_DESIGN_SETTINGS::SetLegacyMode(), FILE_HISTORY::SetMaxFiles(), SetPageSettings(), EDA_DRAW_FRAME::SetScreen(), setupTools(), SetVisibleLayers(), KIGFX::VIEW::UseDrawPriority(), UseGalCanvas(), EDA_DRAW_FRAME::Zoom_Automatique(), and ZOOM_FACTOR.

◆ ~GERBVIEW_FRAME()

GERBVIEW_FRAME::~GERBVIEW_FRAME ( )

Definition at line 242 of file gerbview_frame.cpp.

243 {
244  GetGalCanvas()->GetView()->Clear();
245 
247  delete m_gerberLayout;
248 }
void DeleteAllImages()
remove all loaded data in list, and delete all images.
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
void Clear()
Function Clear() Removes all items from the view.
Definition: view.cpp:1110
GBR_LAYOUT * m_gerberLayout
GBR_LAYOUT * GetGerberLayout() const
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Definition: gbr_layout.cpp:50

References KIGFX::VIEW::Clear(), GERBER_FILE_IMAGE_LIST::DeleteAllImages(), EDA_DRAW_FRAME::GetGalCanvas(), GetGerberLayout(), GBR_LAYOUT::GetImagesList(), EDA_DRAW_PANEL_GAL::GetView(), and m_gerberLayout.

Member Function Documentation

◆ AddMenuZoomAndGrid()

void EDA_DRAW_FRAME::AddMenuZoomAndGrid ( wxMenu *  aMasterMenu)
virtualinherited

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

Parameters
aMasterMenu= the menu to populate.

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

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

Referenced by EDA_DRAW_PANEL::OnRightClick().

◆ AdjustScrollBars()

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

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

670 {
671 }

◆ AppendMsgPanel()

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

Append a message to the message panel.

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

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

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

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

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

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

◆ applyDisplaySettingsToGAL()

void GERBVIEW_FRAME::applyDisplaySettingsToGAL ( )
private

Updates the GAL with display settings changes.

Definition at line 501 of file gerbview_frame.cpp.

502 {
503  auto view = GetGalCanvas()->GetView();
504  auto painter = static_cast<KIGFX::GERBVIEW_PAINTER*>( view->GetPainter() );
505  KIGFX::GERBVIEW_RENDER_SETTINGS* settings = painter->GetSettings();
506  settings->LoadDisplayOptions( &m_DisplayOptions );
507 
508  settings->ImportLegacyColors( m_colorsSettings );
509 
510  view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
511 }
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
void LoadDisplayOptions(const GBR_DISPLAY_OPTIONS *aOptions)
Function LoadDisplayOptions Loads settings related to display options.
Auxiliary rendering target (noncached)
Definition: definitions.h:49
COLORS_DESIGN_SETTINGS * m_colorsSettings
GBR_DISPLAY_OPTIONS m_DisplayOptions
Class GERBVIEW_RENDER_SETTINGS Stores GerbView specific render settings.
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.

References EDA_DRAW_FRAME::GetGalCanvas(), EDA_DRAW_PANEL_GAL::GetView(), KIGFX::GERBVIEW_RENDER_SETTINGS::LoadDisplayOptions(), m_colorsSettings, m_DisplayOptions, and KIGFX::TARGET_NONCACHED.

Referenced by SetElementVisibility(), SetLayerColor(), and UpdateDisplayOptions().

◆ bestZoom()

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

◆ BestZoom()

double GERBVIEW_FRAME::BestZoom ( )
overridevirtual

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

Implements EDA_DRAW_FRAME.

Definition at line 327 of file gerbview_frame.cpp.

328 {
330 
331  // Reserve a margin around the bounding box, for a better display.
332  double margin_scale_factor = 1.05;
333 
334  // If there is not item loaded, use the current page size
335  if( bbox.GetWidth() == 0 || bbox.GetHeight() == 0 )
336  {
337  bbox.SetSize( GetPageSizeIU() );
338  bbox.SetOrigin( 0, 0 );
339  }
340 
341  double sizeX = (double) bbox.GetWidth();
342  double sizeY = (double) bbox.GetHeight();
343  wxPoint centre = bbox.Centre();
344 
345  return bestZoom( sizeX, sizeY, margin_scale_factor, centre );
346 }
const wxSize GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
double bestZoom(double sizeX, double sizeY, double scaleFactor, wxPoint centre)
int GetWidth() const
Definition: eda_rect.h:117
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:124
EDA_RECT ComputeBoundingBox() const
Function ComputeBoundingBox calculates the bounding box containing all Gerber items.
Definition: gbr_layout.cpp:56
int GetHeight() const
Definition: eda_rect.h:118
GBR_LAYOUT * GetGerberLayout() const
void SetSize(const wxSize &size)
Definition: eda_rect.h:126
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
wxPoint Centre() const
Definition: eda_rect.h:60

References EDA_DRAW_FRAME::bestZoom(), EDA_RECT::Centre(), GBR_LAYOUT::ComputeBoundingBox(), GetGerberLayout(), EDA_RECT::GetHeight(), GetPageSizeIU(), EDA_RECT::GetWidth(), EDA_RECT::SetOrigin(), and EDA_RECT::SetSize().

◆ Block_Move()

void GERBVIEW_FRAME::Block_Move ( )

Function Block_Move moves all tracks and segments within the selected block.

New location is determined by the current offset from the selected block's original location.

Definition at line 187 of file gerbview/block.cpp.

188 {
189  wxPoint delta;
190  wxPoint oldpos;
191 
192  oldpos = GetCrossHairPosition();
194 
195  SetCrossHairPosition( oldpos );
197  GetScreen()->SetModify();
199 
200  /* Calculate displacement vectors. */
203 
204  for( unsigned layer = 0; layer < images->ImagesMaxCount(); ++layer )
205  {
206  GERBER_FILE_IMAGE* gerber = images->GetGbrImage( layer );
207 
208  if( gerber == NULL ) // Graphic layer not yet used
209  continue;
210 
211  /* Move items in block */
212  for( GERBER_DRAW_ITEM* item = gerber->GetItemsList(); item; item = item->Next() )
213  {
214  GERBER_DRAW_ITEM* gerb_item = item;
215 
216  if( gerb_item->HitTest( GetScreen()->m_BlockLocate, true ) )
217  gerb_item->MoveAB( delta );
218  }
219  }
220 
221  m_canvas->Refresh( true );
222 }
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
Definition: base_screen.h:214
void MoveAB(const wxPoint &aMoveVector)
Function MoveAB move this object.
Class GERBER_FILE_IMAGE holds the Image data and parameters for one gerber file and layer parameters ...
bool HitTest(const wxPoint &aRefPos, int aAccuracy=0) const override
Function HitTest tests if the given wxPoint is within the bounds of this object.
wxPoint GetMoveVector() const
virtual void MoveCursorToCrossHair()
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
static const int delta[8][2]
Definition: solve.cpp:112
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)
GBR_LAYOUT * GetGerberLayout() const
void Normalize()
Function Normalize ensures that the height ant width are positive.
GERBER_DRAW_ITEM * Next() const
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
GERBER_DRAW_ITEM * GetItemsList()
Function GetItemsList.
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Definition: gbr_layout.cpp:50
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
void SetModify()
Definition: base_screen.h:324
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Set the screen cross hair position to aPosition in logical (drawing) units.
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408
virtual void SetMouseCaptureCallback(MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback)
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Return the current cross hair position in logical (drawing) coordinates.

References delta, EDA_DRAW_FRAME::GetCrossHairPosition(), GERBER_FILE_IMAGE_LIST::GetGbrImage(), GetGerberLayout(), GBR_LAYOUT::GetImagesList(), GERBER_FILE_IMAGE::GetItemsList(), BLOCK_SELECTOR::GetMoveVector(), EDA_DRAW_FRAME::GetScreen(), GERBER_DRAW_ITEM::HitTest(), GERBER_FILE_IMAGE_LIST::ImagesMaxCount(), BASE_SCREEN::m_BlockLocate, EDA_DRAW_FRAME::m_canvas, GERBER_DRAW_ITEM::MoveAB(), EDA_DRAW_PANEL::MoveCursorToCrossHair(), GERBER_DRAW_ITEM::Next(), EDA_RECT::Normalize(), EDA_DRAW_PANEL::Refresh(), EDA_DRAW_FRAME::SetCrossHairPosition(), BASE_SCREEN::SetModify(), and EDA_DRAW_PANEL::SetMouseCaptureCallback().

Referenced by HandleBlockPlace().

◆ BlockCommand()

int GERBVIEW_FRAME::BlockCommand ( EDA_KEY  key)
overridevirtual

Function BlockCommand returns the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to the aKey (ALT, SHIFT ALT ..)

Reimplemented from EDA_DRAW_FRAME.

Definition at line 44 of file gerbview/block.cpp.

45 {
46  int cmd = 0;
47 
48  switch( key )
49  {
50  default:
51  cmd = key & 0x255;
52  break;
53 
54  case 0:
55  cmd = BLOCK_MOVE;
56  break;
57 
58  case GR_KB_SHIFT:
59  case GR_KB_CTRL:
60  case GR_KB_SHIFTCTRL:
61  case GR_KB_ALT:
62  break;
63 
64  case MOUSE_MIDDLE:
65  cmd = BLOCK_ZOOM;
66  break;
67  }
68 
69  return cmd;
70 }
#define GR_KB_ALT
#define MOUSE_MIDDLE
#define GR_KB_CTRL
#define GR_KB_SHIFT
#define GR_KB_SHIFTCTRL

References BLOCK_MOVE, BLOCK_ZOOM, GR_KB_ALT, GR_KB_CTRL, GR_KB_SHIFT, GR_KB_SHIFTCTRL, and MOUSE_MIDDLE.

◆ ChangeUserUnits()

void EDA_DRAW_FRAME::ChangeUserUnits ( EDA_UNITS_T  aUnits)
inlineinherited

Definition at line 292 of file draw_frame.h.

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

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

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

◆ CheckForAutoSaveFile()

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

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

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

Parameters
aFileNameA wxFileName object containing the file name to check.

Definition at line 584 of file eda_base_frame.cpp.

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

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

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

◆ Clear_DrawLayers()

bool GERBVIEW_FRAME::Clear_DrawLayers ( bool  query)

Definition at line 41 of file clear_gbr_drawlayers.cpp.

42 {
43  if( GetGerberLayout() == NULL )
44  return false;
45 
46  if( query && GetScreen()->IsModify() )
47  {
48  if( !IsOK( this, _( "Current data will be lost?" ) ) )
49  return false;
50  }
51 
52  if( auto canvas = GetGalCanvas() )
53  {
54  if( m_toolManager )
56 
57  canvas->GetView()->Clear();
58 
59  // Reinit the worksheet view, cleared by GetView()->Clear():
61  }
62 
64 
66 
67  SetActiveLayer( 0 );
69  syncLayerBox();
70  return true;
71 }
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:130
void DeleteAllImages()
remove all loaded data in list, and delete all images.
Model changes (required full reload)
Definition: tool_base.h:83
void syncLayerBox(bool aRebuildLayerBox=false)
Function syncLayerBox updates the currently "selected" layer within m_SelLayerBox The currently activ...
void SetPageSettings(const PAGE_INFO &aPageSettings) override
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
Function SetActiveLayer will change the currently active layer to aLayer and also update the GERBER_L...
void SetBoundingBox(const EDA_RECT &aBox)
Definition: gbr_layout.h:109
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Function ResetTools() Resets all tools (i.e.
GBR_LAYOUT * GetGerberLayout() const
const PAGE_INFO & GetPageSettings() const override
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Accessors to GERBER_FILE_IMAGE_LIST and GERBER_FILE_IMAGE data.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:294
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408
void ReFillLayerWidget()
Function ReFillLayerWidget changes out all the layers in m_Layers and may be called upon loading new ...

References GERBER_FILE_IMAGE_LIST::DeleteAllImages(), EDA_DRAW_FRAME::GetGalCanvas(), GetGerberLayout(), GetImagesList(), GetPageSettings(), EDA_DRAW_FRAME::GetScreen(), IsOK(), EDA_DRAW_FRAME::m_toolManager, TOOL_BASE::MODEL_RELOAD, ReFillLayerWidget(), TOOL_MANAGER::ResetTools(), SetActiveLayer(), GBR_LAYOUT::SetBoundingBox(), SetPageSettings(), and syncLayerBox().

Referenced by Files_io(), and LoadGerberJobFile().

◆ ClearMsgPanel()

◆ CommonSettingsChanged()

void GERBVIEW_FRAME::CommonSettingsChanged ( )
overridevirtual

Called after the preferences dialog is run.

Reimplemented from EDA_BASE_FRAME.

Definition at line 1302 of file gerbview_frame.cpp.

1303 {
1305 
1306  ReCreateHToolbar();
1309  Layout();
1310  SendSizeEvent();
1311 }
void CommonSettingsChanged() override
Notification event that some of the common (suite-wide) settings have changed.
void ReCreateHToolbar() override
void ReCreateAuxiliaryToolbar() override
void ReCreateOptToolbar()
Create or update the left vertical toolbar (option toolbar.

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

◆ config()

wxConfigBase * EDA_BASE_FRAME::config ( )
protectedvirtualinherited

Return the wxConfigBase used in SaveSettings().

This is overloaded in KICAD_MANAGER_FRAME

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 359 of file eda_base_frame.cpp.

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

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

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

◆ ConfigBaseName()

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

Definition at line 266 of file eda_base_frame.h.

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

References EDA_BASE_FRAME::m_configFrameName.

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

◆ CopyToClipboard()

void EDA_DRAW_FRAME::CopyToClipboard ( wxCommandEvent &  event)
inherited

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

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

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

References DrawPageOnClipboard().

◆ CreateServer()

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

Definition at line 49 of file eda_dde.cpp.

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

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

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

◆ Destroy()

◆ DismissModal()

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

Definition at line 162 of file kiway_player.cpp.

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

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

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

◆ DisplayToolMsg()

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

◆ DisplayUnitsMsg()

void EDA_DRAW_FRAME::DisplayUnitsMsg ( )
inherited

Display current unit pane on the status bar.

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

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

References INCHES, EDA_DRAW_FRAME::m_UserUnits, and MILLIMETRES.

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

◆ doAutoSave()

bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

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

Returns
true if the auto save was successful otherwise false.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 222 of file eda_base_frame.cpp.

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

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

◆ DrawWorkSheet()

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

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

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

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

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

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

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

◆ Erase_Current_DrawLayer()

void GERBVIEW_FRAME::Erase_Current_DrawLayer ( bool  query)

Definition at line 74 of file clear_gbr_drawlayers.cpp.

75 {
76  int layer = GetActiveLayer();
77  wxString msg;
78 
79  msg.Printf( _( "Clear layer %d?" ), layer + 1 );
80 
81  if( query && !IsOK( this, msg ) )
82  return;
83 
84  SetCurItem( NULL );
85 
86  if( m_toolManager )
88 
89  GetImagesList()->DeleteImage( layer );
90 
92  syncLayerBox();
93  m_canvas->Refresh();
94 }
TOOL_MANAGER * m_toolManager
Definition: draw_frame.h:130
Model changes (required full reload)
Definition: tool_base.h:83
void syncLayerBox(bool aRebuildLayerBox=false)
Function syncLayerBox updates the currently "selected" layer within m_SelLayerBox The currently activ...
void SetCurItem(GERBER_DRAW_ITEM *aItem, bool aDisplayInfo=true)
Function SetCurItem sets the currently selected item and displays it in the MsgPanel.
int GetActiveLayer()
Function SetActiveLayer returns the active layer.
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Function ResetTools() Resets all tools (i.e.
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
void DeleteImage(int aIdx)
delete the loaded data of image aIdx.
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Accessors to GERBER_FILE_IMAGE_LIST and GERBER_FILE_IMAGE data.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:294
void ReFillLayerWidget()
Function ReFillLayerWidget changes out all the layers in m_Layers and may be called upon loading new ...

References GERBER_FILE_IMAGE_LIST::DeleteImage(), GetActiveLayer(), GetImagesList(), IsOK(), EDA_DRAW_FRAME::m_canvas, EDA_DRAW_FRAME::m_toolManager, TOOL_BASE::MODEL_RELOAD, ReFillLayerWidget(), EDA_DRAW_PANEL::Refresh(), TOOL_MANAGER::ResetTools(), SetCurItem(), and syncLayerBox().

Referenced by LoadGerberFiles(), OnDrlFileHistory(), OnGbrFileHistory(), OnZipFileHistory(), Read_EXCELLON_File(), and Read_GERBER_File().

◆ EraseMsgBox()

void EDA_DRAW_FRAME::EraseMsgBox ( )
inherited

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

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

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

Referenced by SetCurItem().

◆ ExecuteRemoteCommand()

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

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

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

Parameters
cmdline= received command from socket

Reimplemented in SCH_EDIT_FRAME, and PCB_EDIT_FRAME.

Definition at line 419 of file draw_frame.h.

419 {}

Referenced by EDA_DRAW_FRAME::OnSockRequest().

◆ ExportDataInPcbnewFormat()

void GERBVIEW_FRAME::ExportDataInPcbnewFormat ( wxCommandEvent &  event)

Definition at line 168 of file export_to_pcbnew.cpp.

169 {
170  int layercount = 0;
171 
173 
174  // Count the Gerber layers which are actually currently used
175  for( LAYER_NUM ii = 0; ii < (LAYER_NUM)images->ImagesMaxCount(); ++ii )
176  {
177  if( images->GetGbrImage( ii ) )
178  layercount++;
179  }
180 
181  if( layercount == 0 )
182  {
183  DisplayInfoMessage( this,
184  _( "None of the Gerber layers contain any data" ) );
185  return;
186  }
187 
188  wxString fileName;
189  wxString path = m_mruPath;
190 
191  wxFileDialog filedlg( this, _( "Board File Name" ),
192  path, fileName, PcbFileWildcard(),
193  wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
194 
195  if( filedlg.ShowModal() == wxID_CANCEL )
196  return;
197 
198  fileName = filedlg.GetPath();
199 
200  /* Install a dialog frame to choose the mapping
201  * between gerber layers and Pcbnew layers
202  */
203  LAYERS_MAP_DIALOG* layerdlg = new LAYERS_MAP_DIALOG( this );
204  int ok = layerdlg->ShowModal();
205  layerdlg->Destroy();
206 
207  if( ok != wxID_OK )
208  return;
209 
210  m_mruPath = wxFileName( fileName ).GetPath();
211 
212  GBR_TO_PCB_EXPORTER gbr_exporter( this, fileName );
213 
214  gbr_exporter.ExportPcb( layerdlg->GetLayersLookUpTable(), layerdlg->GetCopperLayersCount() );
215 }
wxString m_mruPath
Most recently used path.
LAYER_NUM * GetLayersLookUpTable()
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
static int GetCopperLayersCount()
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
GBR_LAYOUT * GetGerberLayout() const
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Definition: gbr_layout.cpp:50
wxString PcbFileWildcard()
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:276

References DisplayInfoMessage(), GBR_TO_PCB_EXPORTER::ExportPcb(), LAYERS_MAP_DIALOG::GetCopperLayersCount(), GERBER_FILE_IMAGE_LIST::GetGbrImage(), GetGerberLayout(), GBR_LAYOUT::GetImagesList(), LAYERS_MAP_DIALOG::GetLayersLookUpTable(), GERBER_FILE_IMAGE_LIST::ImagesMaxCount(), EDA_BASE_FRAME::m_mruPath, and PcbFileWildcard().

◆ ExportHotkeyConfigToFile()

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

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

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

Definition at line 738 of file hotkeys_basic.cpp.

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

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

Referenced by PANEL_HOTKEYS_EDITOR::installButtons().

◆ Files_io()

void GERBVIEW_FRAME::Files_io ( wxCommandEvent &  event)

Definition at line 101 of file gerbview/files.cpp.

102 {
103  int id = event.GetId();
104 
105  switch( id )
106  {
107  case wxID_FILE:
108  LoadGerberFiles( wxEmptyString );
109  break;
110 
112  Clear_DrawLayers( false );
113  Zoom_Automatique( false );
114  m_canvas->Refresh();
115  ClearMsgPanel();
116  break;
117 
119  {
120  // Store filenames
121  wxArrayString listOfGerberFiles;
122  std::vector<int> fileType;
123 
124  for( unsigned i = 0; i < GetImagesList()->ImagesMaxCount(); i++ )
125  {
126  if( GetImagesList()->GetGbrImage( i ) == nullptr )
127  continue;
128 
129  if( !GetImagesList()->GetGbrImage( i )->m_InUse )
130  continue;
131 
132  auto* drill_file = dynamic_cast<EXCELLON_IMAGE*>( GetImagesList()->GetGbrImage( i ) );
133 
134  if( drill_file )
135  fileType.push_back( 1 );
136  else
137  fileType.push_back( 0 );
138 
139  listOfGerberFiles.Add( GetImagesList()->GetGbrImage( i )->m_FileName );
140  }
141 
142  // Clear all layers
143  Clear_DrawLayers( false );
144  Zoom_Automatique( false );
145  m_canvas->Refresh();
146  ClearMsgPanel();
147 
148  // Load the layers from stored paths
149  wxBusyCursor wait;
150  loadListOfGerberAndDrillFiles( wxEmptyString, listOfGerberFiles, &fileType );
151  }
152  break;
153 
155  LoadExcellonFiles( wxEmptyString );
156  m_canvas->Refresh();
157  break;
158 
160  LoadZipArchiveFile( wxEmptyString );
161  m_canvas->Refresh();
162  break;
163 
165  LoadGerberJobFile( wxEmptyString );
166  m_canvas->Refresh();
167  break;
168 
169  default:
170  wxFAIL_MSG( "File_io: unexpected command id" );
171  break;
172  }
173 }
bool Clear_DrawLayers(bool query)
bool loadListOfGerberAndDrillFiles(const wxString &aPath, const wxArrayString &aFilenameList, const std::vector< int > *aFileType=nullptr)
Loads a list of Gerber and NC drill files and updates the view based on them.
bool LoadGerberJobFile(const wxString &aFileName)
Load a Gerber job file, and load gerber files found in job files.
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)
bool LoadGerberFiles(const wxString &aFileName)
function LoadGerberFiles Load a photoplot (Gerber) file or many files.
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
bool LoadZipArchiveFile(const wxString &aFileName)
function LoadZipArchiveFileLoadZipArchiveFile Load a zipped archive file.
virtual void ClearMsgPanel()
Clear all messages from the message panel.
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
size_t i
Definition: json11.cpp:597
bool LoadExcellonFiles(const wxString &aFileName)
function LoadExcellonFiles Load a drill (EXCELLON) file or many files.
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Accessors to GERBER_FILE_IMAGE_LIST and GERBER_FILE_IMAGE data.

References Clear_DrawLayers(), EDA_DRAW_FRAME::ClearMsgPanel(), GERBER_FILE_IMAGE_LIST::GetGbrImage(), GetGbrImage(), GetImagesList(), i, ID_GERBVIEW_ERASE_ALL, ID_GERBVIEW_LOAD_DRILL_FILE, ID_GERBVIEW_LOAD_JOB_FILE, ID_GERBVIEW_LOAD_ZIP_ARCHIVE_FILE, ID_GERBVIEW_RELOAD_ALL, GERBER_FILE_IMAGE_LIST::ImagesMaxCount(), LoadExcellonFiles(), LoadGerberFiles(), LoadGerberJobFile(), loadListOfGerberAndDrillFiles(), LoadZipArchiveFile(), EDA_DRAW_FRAME::m_canvas, GERBER_FILE_IMAGE::m_InUse, EDA_DRAW_PANEL::Refresh(), and EDA_DRAW_FRAME::Zoom_Automatique().

◆ FocusOnLocation()

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

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

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

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

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

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

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

◆ GeneralControl()

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

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

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

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

Reimplemented from EDA_DRAW_FRAME.

Definition at line 34 of file gerbview/controle.cpp.

35 {
36  // Filter out the 'fake' mouse motion after a keyboard movement
37  if( !aHotKey && m_movingCursorWithKeyboard )
38  {
40  return false;
41  }
42 
43  wxPoint pos = aPosition;
44  wxPoint oldpos = GetCrossHairPosition();
45  bool eventHandled = GeneralControlKeyMovement( aHotKey, &pos, true );
46 
47  SetCrossHairPosition( pos );
48  RefreshCrossHair( oldpos, aPosition, aDC );
49 
50  if( aHotKey && OnHotKey( aDC, aHotKey, aPosition ) )
51  {
52  eventHandled = true;
53  }
54 
56 
57  return eventHandled;
58 }
void UpdateStatusBar() override
Update the status bar information.
bool GeneralControlKeyMovement(int aHotKey, wxPoint *aPos, bool aSnapToGrid)
Handle the common part of GeneralControl dedicated to global cursor keys (i.e.
void RefreshCrossHair(const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC *aDC)
Move and refresh the crosshair after movement and call the mouse capture function.
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Set the screen cross hair position to aPosition in logical (drawing) units.
bool m_movingCursorWithKeyboard
One-shot to avoid a recursive mouse event during hotkey movement.
Definition: draw_frame.h:179
bool OnHotKey(wxDC *aDC, int aHotkeyCode, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
Function OnHotKey.
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Return the current cross hair position in logical (drawing) coordinates.

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

◆ GeneralControlKeyMovement()

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

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

cursor movement by keyboard)

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

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

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

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

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

◆ GetAboutTitle()

const wxString& EDA_BASE_FRAME::GetAboutTitle ( ) const
inlineinherited

Definition at line 405 of file eda_base_frame.h.

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

References EDA_BASE_FRAME::m_AboutTitle.

Referenced by DIALOG_ABOUT::DIALOG_ABOUT().

◆ GetActiveLayer()

◆ GetAutoSaveFilePrefix()

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

Definition at line 161 of file eda_base_frame.h.

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

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

◆ GetAutoSaveInterval()

int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 218 of file eda_base_frame.h.

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

References EDA_BASE_FRAME::m_autoSaveInterval.

◆ GetAuxiliaryToolBar()

ACTION_TOOLBAR* EDA_DRAW_FRAME::GetAuxiliaryToolBar ( ) const
inlineinherited

Definition at line 489 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_auxiliaryToolBar.

◆ GetAuxOrigin()

const wxPoint & GERBVIEW_FRAME::GetAuxOrigin ( ) const
overridevirtual

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

Implements EDA_DRAW_FRAME.

Definition at line 1004 of file gerbview_frame.cpp.

1005 {
1006  wxASSERT( m_gerberLayout );
1007  return m_gerberLayout->GetAuxOrigin();
1008 }
const wxPoint & GetAuxOrigin() const
Definition: gbr_layout.h:74
GBR_LAYOUT * m_gerberLayout

References GBR_LAYOUT::GetAuxOrigin(), and m_gerberLayout.

◆ GetBackupSuffix()

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

Definition at line 153 of file eda_base_frame.h.

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

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

◆ GetCanvas()

virtual EDA_DRAW_PANEL* EDA_DRAW_FRAME::GetCanvas ( ) const
inlinevirtualinherited

Reimplemented in SCH_BASE_FRAME.

Definition at line 399 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_canvas.

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

◆ GetCanvasTypeKey()

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

Definition at line 239 of file draw_frame.h.

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

References CanvasTypeKeyBase.

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

◆ GetConfigurationSettings()

PARAM_CFG_ARRAY & GERBVIEW_FRAME::GetConfigurationSettings ( void  )

Function GetConfigurationSettings Populates the GerbView applications settings list.

(list of parameters that must be saved in GerbView parameters) Currently, only the settings that are needed at start up by the main window are defined here. There are other locally used settings scattered throughout the GerbView source code (mainly in dialogs). If you need to define a configuration setting that need to be loaded at run time, this is the place to define it.

Definition at line 73 of file gerbview_config.cpp.

74 {
75  if( !m_configSettings.empty() )
76  return m_configSettings;
77 
78  m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "DrawModeOption" ),
79  &m_displayMode, 2, 0, 2 ) );
80  m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
81  true, wxT( "DCodeColorEx" ),
83  m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
84  true, wxT( "NegativeObjectsColorEx" ),
86  m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
87  true, wxT( "GridColorEx" ),
89  m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
90  true, wxT( "WorksheetColorEx" ),
92  m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
93  true, wxT( "BackgroundColorEx" ),
95  m_configSettings.push_back( new PARAM_CFG_BOOL(
96  true, wxT( "DisplayPolarCoordinates" ),
98 
99  // Default colors for layers 0 to 31
100  static const COLOR4D color_default[] = {
109  };
110 
111  // List of keywords used as identifiers in config.
112  // They *must* be static const and not temporarily created,
113  // because the parameter list that use these keywords does not store them,
114  // just points to them.
115  static const wxChar* keys[] = {
116  wxT("ColorLayer0Ex"), wxT("ColorLayer1Ex"), wxT("ColorLayer2Ex"), wxT("ColorLayer3Ex"),
117  wxT("ColorLayer4Ex"), wxT("ColorLayer5Ex"), wxT("ColorLayer6Ex"), wxT("ColorLayer7Ex"),
118  wxT("ColorLayer8Ex"), wxT("ColorLayer9Ex"), wxT("ColorLayer10Ex"), wxT("ColorLayer11Ex"),
119  wxT("ColorLayer12Ex"), wxT("ColorLayer13Ex"), wxT("ColorLayer14Ex"), wxT("ColorLayer15Ex"),
120  wxT("ColorLayer16Ex"), wxT("ColorLayer17Ex"), wxT("ColorLayer18Ex"), wxT("ColorLayer19Ex"),
121  wxT("ColorLayer20Ex"), wxT("ColorLayer21Ex"), wxT("ColorLayer22Ex"), wxT("ColorLayer23Ex"),
122  wxT("ColorLayer24Ex"), wxT("ColorLayer25Ex"), wxT("ColorLayer26Ex"), wxT("ColorLayer27Ex"),
123  wxT("ColorLayer28Ex"), wxT("ColorLayer29Ex"), wxT("ColorLayer30Ex"), wxT("ColorLayer31Ex"),
124  };
125 
126  wxASSERT( arrayDim(keys) == arrayDim(color_default) );
127  wxASSERT( arrayDim(keys) <= arrayDim(g_ColorsSettings.m_LayersColors) && arrayDim(keys) <= arrayDim(color_default) );
128 
129  for( unsigned i = 0; i < arrayDim(keys); ++i )
130  {
132 
133  PARAM_CFG_SETCOLOR* prm_entry =
134  new PARAM_CFG_SETCOLOR( true, keys[i], prm, color_default[i] );
135 
136  m_configSettings.push_back( prm_entry );
137  }
138 
139  return m_configSettings;
140 }
Definition: colors.h:57
Definition: colors.h:61
Definition: colors.h:54
COLOR4D m_LayersColors[LAYER_ID_COUNT]
Layer colors (tracks and graphic items)
PARAM_CFG_ARRAY m_configSettings
Configuration parameter - SetColor Class.
GBR_DISPLAY_OPTIONS m_DisplayOptions
Configuration parameter - Integer Class.
Definition: colors.h:59
Configuration parameter - Boolean Class.
Definition: colors.h:60
bool m_DisplayPolarCood
Option to display coordinates in status bar in X,Y or Polar coords.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:107
Definition: colors.h:58
COLORS_DESIGN_SETTINGS g_ColorsSettings(FRAME_CVPCB_DISPLAY)
size_t i
Definition: json11.cpp:597
Definition: colors.h:49
#define GERBER_DRAW_LAYER(x)
Definition: colors.h:45
Definition: colors.h:68
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
Definition: colors.h:62

References arrayDim(), BLACK, BLUE, BROWN, CYAN, DARKCYAN, DARKGRAY, DARKGREEN, DARKRED, g_ColorsSettings, GERBER_DRAW_LAYER, GREEN, i, LAYER_DCODES, LAYER_GERBVIEW_GRID, LAYER_NEGATIVE_OBJECTS, LAYER_PCB_BACKGROUND, LAYER_WORKSHEET, LIGHTCYAN, LIGHTGRAY, LIGHTMAGENTA, LIGHTRED, m_configSettings, m_displayMode, m_DisplayOptions, GBR_DISPLAY_OPTIONS::m_DisplayPolarCood, COLORS_DESIGN_SETTINGS::m_LayersColors, MAGENTA, RED, WHITE, and YELLOW.

Referenced by LoadSettings(), and SaveSettings().

◆ GetCrossHairPosition()

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

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

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

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

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

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

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

◆ GetCrossHairScreenPosition()

wxPoint EDA_DRAW_FRAME::GetCrossHairScreenPosition ( ) const
inherited

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

Returns
The current cross hair position.

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

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

◆ GetCursorPosition()

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

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

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

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

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

◆ GetDisplayMode()

int GERBVIEW_FRAME::GetDisplayMode ( )
inline

Function GetDisplayMode.

Returns
0 for fast mode (not fully compatible with negative objects) 1 for exact mode, write mode 2 for exact mode, OR mode (transparency mode)

Definition at line 255 of file gerbview_frame.h.

255 { return m_displayMode; }

References m_displayMode.

Referenced by OnSelectDisplayMode(), OnUpdateDrawMode(), and RedrawActiveWindow().

◆ GetDisplayOptions()

virtual void* EDA_DRAW_FRAME::GetDisplayOptions ( )
inlinevirtualinherited

A way to pass info to draw functions.

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

Reimplemented in PCB_BASE_FRAME.

Definition at line 944 of file draw_frame.h.

944 { return NULL; }

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

◆ GetDocumentExtents()

const BOX2I EDA_DRAW_FRAME::GetDocumentExtents ( ) const
virtualinherited

Reimplemented in SCH_EDIT_FRAME, LIB_EDIT_FRAME, LIB_VIEW_FRAME, and PCB_BASE_FRAME.

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

963 {
964  return BOX2I();
965 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:520

Referenced by SCH_BASE_FRAME::Zoom_Automatique(), and COMMON_TOOLS::ZoomFitScreen().

◆ GetDrawBgColor()

virtual COLOR4D EDA_DRAW_FRAME::GetDrawBgColor ( ) const
inlinevirtualinherited
Returns
the COLOR4D for the canvas background

Definition at line 386 of file draw_frame.h.

386 { return m_drawBgColor; }
COLOR4D m_drawBgColor
the background color of the draw canvas BLACK for Pcbnew, BLACK or WHITE for eeschema
Definition: draw_frame.h:118

References EDA_DRAW_FRAME::m_drawBgColor.

Referenced by EDA_DOCKART::DrawBorder(), PLEDITOR_PRINTOUT::DrawPage(), SCH_PRINTOUT::DrawPage(), EDA_DRAW_PANEL::EDA_DRAW_PANEL(), GetNegativeItemsColor(), PL_EDITOR_FRAME::Process_Config(), PL_EDITOR_FRAME::ReCreateMenuBar(), PL_EDITOR_FRAME::RedrawActiveWindow(), RedrawActiveWindow(), and PL_EDITOR_FRAME::SaveSettings().

◆ GetDrawToolBar()

ACTION_TOOLBAR* EDA_DRAW_FRAME::GetDrawToolBar ( ) const
inlineinherited

Definition at line 488 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_drawToolBar.

◆ GetFileFromHistory()

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

Fetches the file name from the file history list.

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

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

Definition at line 398 of file eda_base_frame.cpp.

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

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

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

◆ GetGalCanvas()

EDA_DRAW_PANEL_GAL* EDA_DRAW_FRAME::GetGalCanvas ( ) const
inlineinherited

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

Returns
Pointer to GAL-based canvas.

Definition at line 931 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_galCanvas.

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

◆ GetGalDisplayOptions()

◆ GetGbrImage()

◆ GetGerberLayout()

◆ GetGridColor()

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

Reimplemented in FOOTPRINT_EDIT_FRAME, PCB_EDIT_FRAME, DISPLAY_FOOTPRINTS_FRAME, and FOOTPRINT_VIEWER_FRAME.

Definition at line 550 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_gridColor.

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

◆ GetGridOrigin()

const wxPoint& GERBVIEW_FRAME::GetGridOrigin ( ) const
inlineoverridevirtual

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

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

Implements EDA_DRAW_FRAME.

Definition at line 105 of file gerbview_frame.h.

105 { return m_grid_origin; }
wxPoint m_grid_origin

References m_grid_origin.

◆ GetGridPosition()

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

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

Otherwise, the original positions is returned.

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

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

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

◆ GetHotkeyConfig()

EDA_HOTKEY_CONFIG* EDA_DRAW_FRAME::GetHotkeyConfig ( ) const
inlineinherited

Return a structure containing currently used hotkey mapping.

Definition at line 442 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_hotkeysDescrList.

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

◆ GetHotKeyDescription()

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

Implements EDA_DRAW_FRAME.

Definition at line 145 of file gerbview/hotkeys.cpp.

146 {
147  EDA_HOTKEY* HK_Descr = GetDescriptorFromCommand( aCommand, gerbviewHotkeyList );
148 
149  return HK_Descr;
150 }
EDA_HOTKEY * gerbviewHotkeyList[]
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:59
EDA_HOTKEY * GetDescriptorFromCommand(int aCommand, EDA_HOTKEY **aList)
Function GetDescriptorFromCommand Returns a EDA_HOTKEY* pointer from a hot key identifier.

References gerbviewHotkeyList, and GetDescriptorFromCommand().

◆ GetImagesList()

◆ GetKicadAbout()

void EDA_BASE_FRAME::GetKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 505 of file eda_base_frame.cpp.

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

References ShowAboutDialog().

◆ GetKicadContribute()

void EDA_BASE_FRAME::GetKicadContribute ( wxCommandEvent &  event)
inherited

Definition at line 492 of file eda_base_frame.cpp.

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

References URL_GET_INVOLVED.

◆ GetKicadHelp()

void EDA_BASE_FRAME::GetKicadHelp ( wxCommandEvent &  event)
inherited

Definition at line 431 of file eda_base_frame.cpp.

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

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

◆ GetLastGridSizeId()

int EDA_DRAW_FRAME::GetLastGridSizeId ( ) const
inlineinherited

Definition at line 312 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_LastGridSizeId.

◆ GetLayerColor()

COLOR4D GERBVIEW_FRAME::GetLayerColor ( int  aLayer) const

Function GetLayerColor gets a layer color for any valid layer.

Definition at line 907 of file gerbview_frame.cpp.

908 {
909  return m_colorsSettings->GetLayerColor( aLayer );
910 }
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
COLORS_DESIGN_SETTINGS * m_colorsSettings

References COLORS_DESIGN_SETTINGS::GetLayerColor(), and m_colorsSettings.

Referenced by GBR_LAYOUT::Draw(), GBR_LAYER_BOX_SELECTOR::GetLayerColor(), GERBER_LAYER_WIDGET::ReFill(), and UseGalCanvas().

◆ GetMainToolBar()

ACTION_TOOLBAR* EDA_DRAW_FRAME::GetMainToolBar ( ) const
inlineinherited

Definition at line 486 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_mainToolBar.

◆ GetMruPath()

wxString EDA_BASE_FRAME::GetMruPath ( ) const
inlineinherited

◆ GetNearestGridPosition()

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

Return the nearest aGridSize location to aPosition.

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

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

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

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

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

◆ GetNegativeItemsColor()

COLOR4D GERBVIEW_FRAME::GetNegativeItemsColor ( )

Function GetNegativeItemsColor.

Returns
the color of negative items. This is usually the background color, but can be another color in order to see negative objects

Definition at line 898 of file gerbview_frame.cpp.

899 {
902  else
903  return GetDrawBgColor();
904 }
COLOR4D GetVisibleElementColor(int aLayerID)
Function GetVisibleElementColor returns the color of a gerber visible element.
bool IsElementVisible(int aLayerID) const
Function IsElementVisible tests whether a given element category is visible.
virtual COLOR4D GetDrawBgColor() const
Definition: draw_frame.h:386

References EDA_DRAW_FRAME::GetDrawBgColor(), GetVisibleElementColor(), IsElementVisible(), and LAYER_NEGATIVE_OBJECTS.

Referenced by RedrawActiveWindow().

◆ getNextAvailableLayer()

int GERBVIEW_FRAME::getNextAvailableLayer ( int  aLayer = 0) const

Function getNextAvailableLayer finds the next empty layer starting at aLayer and returns it to the caller.

If no empty layers are found, NO_AVAILABLE_LAYERS is return.

Parameters
aLayerThe first layer to search.
Returns
The first empty layer found or NO_AVAILABLE_LAYERS.

Definition at line 514 of file gerbview_frame.cpp.

515 {
516  int layer = aLayer;
517 
518  for( unsigned i = 0; i < ImagesMaxCount(); ++i )
519  {
520  const GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
521 
522  if( gerber == NULL ) // this graphic layer is available: use it
523  return layer;
524 
525  ++layer; // try next graphic layer
526 
527  if( layer >= (int)ImagesMaxCount() )
528  layer = 0;
529  }
530 
531  return NO_AVAILABLE_LAYERS;
532 }
Class GERBER_FILE_IMAGE holds the Image data and parameters for one gerber file and layer parameters ...
unsigned ImagesMaxCount() const
The max number of file images.
#define NO_AVAILABLE_LAYERS
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
size_t i
Definition: json11.cpp:597

References GetGbrImage(), i, ImagesMaxCount(), and NO_AVAILABLE_LAYERS.

Referenced by hasAvailableLayers(), LoadExcellonFiles(), loadListOfGerberAndDrillFiles(), and unarchiveFiles().

◆ GetOptionsToolBar()

ACTION_TOOLBAR* EDA_DRAW_FRAME::GetOptionsToolBar ( ) const
inlineinherited

Definition at line 487 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_optionsToolBar.

◆ GetPageSettings()

const PAGE_INFO & GERBVIEW_FRAME::GetPageSettings ( ) const
overridevirtual

◆ GetPageSizeIU()

const wxSize GERBVIEW_FRAME::GetPageSizeIU ( ) const
overridevirtual

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 981 of file gerbview_frame.cpp.

982 {
983  // this function is only needed because EDA_DRAW_FRAME is not compiled
984  // with either -DPCBNEW or -DEESCHEMA, so the virtual is used to route
985  // into an application specific source file.
986  return GetPageSettings().GetSizeIU();
987 }
const PAGE_INFO & GetPageSettings() const override

References GetPageSettings().

Referenced by BestZoom().

◆ GetScreen()

virtual BASE_SCREEN* EDA_DRAW_FRAME::GetScreen ( ) const
inlinevirtualinherited

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

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

Reimplemented in PCB_BASE_FRAME, SCH_EDIT_FRAME, PL_EDITOR_FRAME, and SCH_BASE_FRAME.

Definition at line 408 of file draw_frame.h.

408 { return m_currentScreen; }
BASE_SCREEN * m_currentScreen
current used SCREEN
Definition: draw_frame.h:92

References EDA_DRAW_FRAME::m_currentScreen.

Referenced by Block_Move(), Clear_DrawLayers(), COMMON_TOOLS::CursorControl(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), COMMON_TOOLS::doGridPreset(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), EDA_DRAW_FRAME::GeneralControlKeyMovement(), GERBVIEW_FRAME(), GetActiveLayer(), EDA_DRAW_FRAME::GetNearestGridPosition(), SCH_BASE_FRAME::GetScreen(), EDA_DRAW_PANEL::GetScreen(), PL_EDITOR_FRAME::GetScreen(), PCB_BASE_FRAME::GetScreen(), EDA_DRAW_FRAME::GetScrollCenterPosition(), EDA_DRAW_FRAME::GetZoom(), GRID_MENU::GRID_MENU(), COMMON_TOOLS::GridNext(), COMMON_TOOLS::GridPrev(), HandleBlockEnd(), HandleBlockPlace(), OnHotKey(), OnLeftClick(), EDA_DRAW_PANEL::OnMouseEvent(), EDA_DRAW_PANEL::OnMouseWheel(), EDA_DRAW_PANEL_GAL::onPaint(), EDA_DRAW_PANEL::OnPan(), OnRightClick(), EDA_DRAW_PANEL::OnScroll(), EDA_DRAW_FRAME::OnUpdateRedo(), EDA_DRAW_FRAME::OnUpdateSelectGrid(), OnUpdateSelectZoom(), EDA_DRAW_FRAME::OnUpdateUndo(), COMMON_TOOLS::PanControl(), PushTrack(), RedrawActiveWindow(), EDA_DRAW_FRAME::RefPos(), GERBVIEW_CONTROL::ResetCoords(), EDA_DRAW_FRAME::SaveSettings(), SetActiveLayer(), SetCurItem(), EDA_DRAW_FRAME::SetMousePosition(), EDA_DRAW_FRAME::SetNextZoom(), SetPageSettings(), EDA_DRAW_FRAME::SetPresetZoom(), EDA_DRAW_FRAME::SetPrevZoom(), EDA_DRAW_FRAME::SetScrollCenterPosition(), ZOOM_MENU::update(), GRID_MENU::update(), updateGridSelectBox(), EDA_DRAW_FRAME::UpdateMsgPanel(), UpdateStatusBar(), updateZoomSelectBox(), and ZOOM_MENU::ZOOM_MENU().

◆ GetScreenDesc()

wxString EDA_DRAW_FRAME::GetScreenDesc ( ) const
virtualinherited

Reimplemented in SCH_EDIT_FRAME.

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

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

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

◆ GetScrollCenterPosition()

const wxPoint & EDA_DRAW_FRAME::GetScrollCenterPosition ( ) const
inherited

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

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

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

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

◆ GetShowAxis()

bool EDA_DRAW_FRAME::GetShowAxis ( ) const
inlineinherited

Definition at line 957 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_showAxis.

◆ GetShowBorderAndTitleBlock()

bool EDA_DRAW_FRAME::GetShowBorderAndTitleBlock ( ) const
inlineinherited

Definition at line 393 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_showBorderAndTitleBlock.

◆ GetShowGridAxis()

bool EDA_DRAW_FRAME::GetShowGridAxis ( ) const
inlineinherited

Definition at line 958 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_showGridAxis.

◆ GetShowOriginAxis()

bool EDA_DRAW_FRAME::GetShowOriginAxis ( ) const
inlineinherited

Definition at line 959 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_showOriginAxis.

◆ GetTitleBlock()

const TITLE_BLOCK & GERBVIEW_FRAME::GetTitleBlock ( ) const
overridevirtual

Implements EDA_DRAW_FRAME.

Definition at line 990 of file gerbview_frame.cpp.

991 {
992  wxASSERT( m_gerberLayout );
993  return m_gerberLayout->GetTitleBlock();
994 }
TITLE_BLOCK & GetTitleBlock()
Definition: gbr_layout.h:84
GBR_LAYOUT * m_gerberLayout

References GBR_LAYOUT::GetTitleBlock(), and m_gerberLayout.

Referenced by SetPageSettings().

◆ GetToolId()

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

Definition at line 524 of file draw_frame.h.

524 { return m_toolId; }

References EDA_DRAW_FRAME::m_toolId.

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

◆ GetToolManager()

TOOL_MANAGER* EDA_DRAW_FRAME::GetToolManager ( ) const
inlineoverrideinherited

Return the tool manager instance, if any.

Definition at line 937 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_toolManager.

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

◆ GetToolMsg()

wxString EDA_DRAW_FRAME::GetToolMsg ( )
inlineinherited

Definition at line 747 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_toolMsg.

Referenced by EE_POINT_EDITOR::Main().

◆ GetToolToggled()

bool EDA_DRAW_FRAME::GetToolToggled ( int  aToolId)
inherited

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

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

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

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

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

Referenced by ZOOM_TOOL::Main().

◆ GetUserUnits()

EDA_UNITS_T EDA_DRAW_FRAME::GetUserUnits ( ) const
inlineoverrideinherited

Return the user units currently in use.

Definition at line 289 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_UserUnits.

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

◆ GetVisibleElementColor()

COLOR4D GERBVIEW_FRAME::GetVisibleElementColor ( int  aLayerID)

Function GetVisibleElementColor returns the color of a gerber visible element.

Definition at line 840 of file gerbview_frame.cpp.

841 {
842  COLOR4D color = COLOR4D::UNSPECIFIED;
843 
844  switch( aLayerID )
845  {
847  case LAYER_DCODES:
848  case LAYER_WORKSHEET:
850  color = m_colorsSettings->GetItemColor( aLayerID );
851  break;
852 
853  case LAYER_GERBVIEW_GRID:
854  color = GetGridColor();
855  break;
856 
857  default:
858  wxLogDebug( wxT( "GERBVIEW_FRAME::GetVisibleElementColor(): bad arg %d" ), aLayerID );
859  }
860 
861  return color;
862 }
int color
Definition: DXF_plotter.cpp:62
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
COLORS_DESIGN_SETTINGS * m_colorsSettings
virtual COLOR4D GetGridColor()
Definition: draw_frame.h:550
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References color, EDA_DRAW_FRAME::GetGridColor(), COLORS_DESIGN_SETTINGS::GetItemColor(), LAYER_DCODES, LAYER_GERBVIEW_GRID, LAYER_NEGATIVE_OBJECTS, LAYER_PCB_BACKGROUND, LAYER_WORKSHEET, and m_colorsSettings.

Referenced by GetNegativeItemsColor(), RedrawActiveWindow(), and GERBER_LAYER_WIDGET::ReFillRender().

◆ GetVisibleLayers()

LSET GERBVIEW_FRAME::GetVisibleLayers ( ) const

Function GetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSettings.

Returns
LSET of the visible layers

Definition at line 804 of file gerbview_frame.cpp.

805 {
806  LSET visible = LSET::AllLayersMask();
807 
808  if( auto canvas = GetGalCanvas() )
809  {
810  for( int i = 0; i < GERBER_DRAWLAYERS_COUNT; i++ )
811  visible[i] = canvas->GetView()->IsLayerVisible( GERBER_DRAW_LAYER( i ) );
812  }
813 
814  return visible;
815 }
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
Class LSET is a set of PCB_LAYER_IDs.
#define GERBER_DRAWLAYERS_COUNT
static LSET AllLayersMask()
Definition: lset.cpp:713
size_t i
Definition: json11.cpp:597
#define GERBER_DRAW_LAYER(x)

References LSET::AllLayersMask(), GERBER_DRAW_LAYER, GERBER_DRAWLAYERS_COUNT, EDA_DRAW_FRAME::GetGalCanvas(), and i.

Referenced by loadListOfGerberAndDrillFiles(), and GERBER_LAYER_WIDGET::OnLayerVisible().

◆ GetZoom()

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

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

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

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

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

◆ GetZoomLevelCoeff()

double EDA_DRAW_FRAME::GetZoomLevelCoeff ( ) const
inlineinherited

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

Definition at line 475 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_zoomLevelCoeff.

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

◆ GetZoomLevelIndicator()

const wxString GERBVIEW_FRAME::GetZoomLevelIndicator ( ) const
overridevirtual

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

Virtual from the base class

Reimplemented from EDA_DRAW_FRAME.

Definition at line 1134 of file gerbview_frame.cpp.

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

References EDA_DRAW_FRAME::GetZoomLevelIndicator().

◆ HandleBlockBegin()

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

Initialize a block command.

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

Reimplemented in SCH_BASE_FRAME.

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

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

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

◆ HandleBlockEnd()

bool GERBVIEW_FRAME::HandleBlockEnd ( wxDC *  DC)
overridevirtual

Function HandleBlockEnd handles the end of a block command, It 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 from EDA_DRAW_FRAME.

Definition at line 104 of file gerbview/block.cpp.

105 {
106  bool nextcmd = false;
107  bool zoom_command = false;
108 
109  if( m_canvas->IsMouseCaptured() )
110 
111  switch( GetScreen()->m_BlockLocate.GetCommand() )
112  {
113  case BLOCK_MOVE: /* Move */
115  nextcmd = true;
116  m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
118  m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
119  break;
120 
121  case BLOCK_ZOOM: /* Window Zoom */
122  zoom_command = true;
123  break;
124 
125  default:
126  wxFAIL_MSG( wxT("HandleBlockEnd: Unexpected block command") );
127  break;
128  }
129 
130  if( ! nextcmd )
131  {
134  false );
135  }
136 
137  if( zoom_command )
138  Window_Zoom( GetScreen()->m_BlockLocate );
139 
140  return nextcmd ;
141 }
BLOCK_COMMAND_T GetCommand() const
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
Definition: base_screen.h:214
int GetCurrentCursor() const
Function GetCurrentCursor.
virtual void EndMouseCapture(int aId=-1, int aCursorId=-1, const wxString &aTitle=wxEmptyString, bool aCallEndFunc=true)
Function EndMouseCapture ends mouse a capture.
void ClearBlockCommand()
Definition: base_screen.h:501
void SetState(BLOCK_STATE_T aState)
virtual void CallMouseCapture(wxDC *aDC, const wxPoint &aPosition, bool aErase)
Function CallMouseCapture calls the mouse capture callback.
static void DrawMovingBlockOutlines(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aPosition, bool erase)
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
virtual void Window_Zoom(EDA_RECT &Rect)
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408
virtual void SetMouseCaptureCallback(MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback)
int GetToolId() const
Definition: draw_frame.h:524

References BLOCK_MOVE, BLOCK_ZOOM, EDA_DRAW_PANEL::CallMouseCapture(), BASE_SCREEN::ClearBlockCommand(), DrawMovingBlockOutlines(), EDA_DRAW_PANEL::EndMouseCapture(), BLOCK_SELECTOR::GetCommand(), EDA_DRAW_PANEL::GetCurrentCursor(), EDA_DRAW_FRAME::GetScreen(), EDA_DRAW_FRAME::GetToolId(), EDA_DRAW_PANEL::IsMouseCaptured(), BASE_SCREEN::m_BlockLocate, EDA_DRAW_FRAME::m_canvas, EDA_DRAW_PANEL::SetMouseCaptureCallback(), BLOCK_SELECTOR::SetState(), STATE_BLOCK_MOVE, and EDA_DRAW_FRAME::Window_Zoom().

◆ HandleBlockPlace()

void GERBVIEW_FRAME::HandleBlockPlace ( wxDC *  DC)
overridevirtual

Function HandleBlockPlace handles the block place command.

Reimplemented from EDA_DRAW_FRAME.

Definition at line 73 of file gerbview/block.cpp.

74 {
75  wxASSERT( m_canvas->IsMouseCaptured() );
76 
78 
79  switch( GetScreen()->m_BlockLocate.GetCommand() )
80  {
81  case BLOCK_MOVE: /* Move */
82  if( m_canvas->IsMouseCaptured() )
83  m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
84 
85  Block_Move();
87  break;
88 
89  default:
90  wxFAIL_MSG( wxT("HandleBlockPlace: Unexpected block command") );
91  break;
92  }
93 
94  m_canvas->EndMouseCapture( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString, false );
95  GetScreen()->SetModify();
97 
98  wxASSERT( GetScreen()->m_BlockLocate.GetCount() == 0 );
99 
100  DisplayToolMsg( wxEmptyString );
101 }
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
Definition: base_screen.h:214
int GetCurrentCursor() const
Function GetCurrentCursor.
void Block_Move()
Function Block_Move moves all tracks and segments within the selected block.
virtual void EndMouseCapture(int aId=-1, int aCursorId=-1, const wxString &aTitle=wxEmptyString, bool aCallEndFunc=true)
Function EndMouseCapture ends mouse a capture.
void ClearBlockCommand()
Definition: base_screen.h:501
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 void CallMouseCapture(wxDC *aDC, const wxPoint &aPosition, bool aErase)
Function CallMouseCapture calls the mouse capture callback.
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:128
void DisplayToolMsg(const wxString &msg)
void SetModify()
Definition: base_screen.h:324
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408
int GetToolId() const
Definition: draw_frame.h:524

References BLOCK_MOVE, Block_Move(), EDA_DRAW_PANEL::CallMouseCapture(), BASE_SCREEN::ClearBlockCommand(), BLOCK_SELECTOR::ClearItemsList(), EDA_DRAW_FRAME::DisplayToolMsg(), EDA_DRAW_PANEL::EndMouseCapture(), EDA_DRAW_PANEL::GetCurrentCursor(), EDA_DRAW_FRAME::GetScreen(), EDA_DRAW_FRAME::GetToolId(), EDA_DRAW_PANEL::IsMouseCaptured(), BASE_SCREEN::m_BlockLocate, EDA_DRAW_FRAME::m_canvas, BASE_SCREEN::SetModify(), BLOCK_SELECTOR::SetState(), and STATE_BLOCK_STOP.

◆ HardRedraw()

void EDA_DRAW_FRAME::HardRedraw ( )
virtualinherited

Rebuild the GAL and redraws the screen.

Call when something went wrong.

Reimplemented in SCH_EDIT_FRAME, LIB_EDIT_FRAME, SCH_BASE_FRAME, and FOOTPRINT_EDIT_FRAME.

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

979 {
980 }

Referenced by COMMON_TOOLS::ZoomRedraw().

◆ hasAvailableLayers()

bool GERBVIEW_FRAME::hasAvailableLayers ( ) const
inline

Definition at line 369 of file gerbview_frame.h.

370  {
372  }
#define NO_AVAILABLE_LAYERS
int getNextAvailableLayer(int aLayer=0) const
Function getNextAvailableLayer finds the next empty layer starting at aLayer and returns it to the ca...

References getNextAvailableLayer(), and NO_AVAILABLE_LAYERS.

◆ help_name()

wxString EDA_BASE_FRAME::help_name ( )
protectedvirtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 374 of file eda_base_frame.cpp.

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

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

Referenced by EDA_BASE_FRAME::GetKicadHelp().

◆ ImagesMaxCount()

unsigned GERBVIEW_FRAME::ImagesMaxCount ( ) const

The max number of file images.

Definition at line 1146 of file gerbview_frame.cpp.

1147 {
1149 }
GBR_LAYOUT * m_gerberLayout
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Definition: gbr_layout.cpp:50

References GBR_LAYOUT::GetImagesList(), GERBER_FILE_IMAGE_LIST::ImagesMaxCount(), and m_gerberLayout.

Referenced by getNextAvailableLayer(), Liste_D_Codes(), and Locate().

◆ ImportHotkeyConfigFromFile()

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

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

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

Definition at line 709 of file hotkeys_basic.cpp.

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

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

Referenced by PANEL_HOTKEYS_EDITOR::installButtons().

◆ InitBlockPasteInfos()

void EDA_DRAW_FRAME::InitBlockPasteInfos ( )
virtualinherited

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

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

Referenced by SCH_BASE_FRAME::HandleBlockBegin().

◆ InstallPreferences()

void GERBVIEW_FRAME::InstallPreferences ( PAGED_DIALOG aParent)
overridevirtual

Allows Gerbview to install its preferences panels into the preferences dialog.

Reimplemented from EDA_BASE_FRAME.

Definition at line 64 of file gerbview_config.cpp.

65 {
66  wxTreebook* book = aParent->GetTreebook();
67 
68  book->AddPage( new PANEL_GERBVIEW_SETTINGS( this, book ), _( "Gerbview" ) );
69  book->AddSubPage( new PANEL_GERBVIEW_DISPLAY_OPTIONS( this, book ), _( "Display Options" ) );
70 }
wxTreebook * GetTreebook()
Definition: paged_dialog.h:43

References PAGED_DIALOG::GetTreebook().

◆ isAutoSaveRequired()

virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Return the auto save status of the application.

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

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 176 of file eda_base_frame.h.

176 { return false; }

Referenced by EDA_BASE_FRAME::ProcessEvent().

◆ IsDismissed()

bool KIWAY_PLAYER::IsDismissed ( )
protectedinherited

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

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

Definition at line 156 of file kiway_player.cpp.

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

References KIWAY_PLAYER::m_modal_loop.

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

◆ IsElementVisible()

bool GERBVIEW_FRAME::IsElementVisible ( int  aLayerID) const

Function IsElementVisible tests whether a given element category is visible.

Keep this as an inline function.

Parameters
aLayerIDis an item id from the enum GERBVIEW_LAYER_ID
Returns
bool - true if the element is visible.

Definition at line 777 of file gerbview_frame.cpp.

778 {
779  switch( aLayerID )
780  {
781  case LAYER_DCODES:
783 
786 
787  case LAYER_GERBVIEW_GRID:
788  return IsGridVisible();
789 
790  case LAYER_WORKSHEET:
792 
794  return true;
795 
796  default:
797  wxLogDebug( wxT( "GERBVIEW_FRAME::IsElementVisible(): bad arg %d" ), aLayerID );
798  }
799 
800  return true;
801 }
virtual bool IsGridVisible() const
Definition: draw_frame.h:533
bool m_DisplayNegativeObjects
Option to draw negative objects in a specific color.
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:148
GBR_DISPLAY_OPTIONS m_DisplayOptions
bool m_DisplayDCodes
Option to show dcode values on items drawn with a dcode tool.

References EDA_DRAW_FRAME::IsGridVisible(), LAYER_DCODES, LAYER_GERBVIEW_GRID, LAYER_NEGATIVE_OBJECTS, LAYER_PCB_BACKGROUND, LAYER_WORKSHEET, GBR_DISPLAY_OPTIONS::m_DisplayDCodes, GBR_DISPLAY_OPTIONS::m_DisplayNegativeObjects, m_DisplayOptions, and EDA_DRAW_FRAME::m_showBorderAndTitleBlock.

Referenced by GERBVIEW_CONTROL::DisplayControl(), GetNegativeItemsColor(), OnHotKey(), OnSelectOptionToolbar(), OnUpdateShowDCodes(), OnUpdateShowNegativeItems(), GERBER_LAYER_WIDGET::ReFillRender(), SaveSettings(), and PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataToWindow().

◆ IsGalCanvasActive()

bool EDA_DRAW_FRAME::IsGalCanvasActive ( ) const
inlineinherited

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

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

Definition at line 924 of file draw_frame.h.

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

References EDA_DRAW_FRAME::m_galCanvasActive.

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

◆ IsGridVisible()

◆ IsLayerVisible()

bool GERBVIEW_FRAME::IsLayerVisible ( int  aLayer) const

Function IsLayerVisible tests whether a given layer is visible.

Parameters
aLayer= The layer to be tested (still 0-31!)
Returns
bool - true if the layer is visible.

Definition at line 834 of file gerbview_frame.cpp.

835 {
836  return m_LayersManager->IsLayerVisible( aLayer );
837 }
GERBER_LAYER_WIDGET * m_LayersManager
bool IsLayerVisible(LAYER_NUM aLayer)
Function IsLayerVisible returns the visible state of the layer ROW associated with aLayer id.

References LAYER_WIDGET::IsLayerVisible(), and m_LayersManager.

Referenced by GBR_LAYOUT::Draw(), GBR_LAYOUT::DrawItemsDCodeID(), and GERBER_LAYER_WIDGET::ReFill().

◆ IsModal()

◆ IsType()

◆ IsWritable()

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

Checks if aFileName can be written.

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

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

Definition at line 540 of file eda_base_frame.cpp.

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

References GetChars().

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

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

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

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 61 of file kiway_player.h.

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

References KIWAY_HOLDER::m_kiway.

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

◆ kiway_express()

void KIWAY_PLAYER::kiway_express ( KIWAY_EXPRESS aEvent)
protectedinherited

event handler, routes to derivative specific virtual KiwayMailIn()

Definition at line 177 of file kiway_player.cpp.

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

References KIWAY_PLAYER::KiwayMailIn().

◆ KiwayMailIn()

void KIWAY_PLAYER::KiwayMailIn ( KIWAY_EXPRESS aEvent)
virtualinherited

Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.

Merely override it in derived classes.

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

Definition at line 71 of file kiway_player.cpp.

72 {
73  // override this in derived classes.
74 }

Referenced by KIWAY_PLAYER::kiway_express(), and KIWAY::ProcessEvent().

◆ language_change()

void KIWAY_PLAYER::language_change ( wxCommandEvent &  event)
protectedinherited

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

Definition at line 184 of file kiway_player.cpp.

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

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

◆ LibraryFileBrowser()

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

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

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

References KIWAY_HOLDER::Prj().

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

◆ Liste_D_Codes()

void GERBVIEW_FRAME::Liste_D_Codes ( )

Set Size Items (Lines, Flashes) from DCodes List.

Definition at line 563 of file gerbview_frame.cpp.

564 {
565  int ii, jj;
566  wxString Line;
567  wxArrayString list;
568  double scale = GetUserUnits() == INCHES ? IU_PER_MILS * 1000 : IU_PER_MM;
569  int curr_layer = GetActiveLayer();
570 
571  for( int layer = 0; layer < (int)ImagesMaxCount(); ++layer )
572  {
573  GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
574 
575  if( gerber == NULL )
576  continue;
577 
578  if( gerber->GetDcodesCount() == 0 )
579  continue;
580 
581  if( layer == curr_layer )
582  Line.Printf( wxT( "*** Active layer (%2.2d) ***" ), layer + 1 );
583  else
584  Line.Printf( wxT( "*** layer %2.2d ***" ), layer + 1 );
585 
586  list.Add( Line );
587 
588  const char* units = GetUserUnits() == INCHES ? "\"" : "mm";
589 
590  for( ii = 0, jj = 1; ii < TOOLS_MAX_COUNT; ii++ )
591  {
592  D_CODE* pt_D_code = gerber->GetDCODE( ii + FIRST_DCODE );
593 
594  if( pt_D_code == NULL )
595  continue;
596 
597  if( !pt_D_code->m_InUse && !pt_D_code->m_Defined )
598  continue;
599 
600  Line.Printf( wxT( "tool %2.2d: D%2.2d V %.4f %s H %.4f %s %s attribute '%s'" ),
601  jj,
602  pt_D_code->m_Num_Dcode,
603  pt_D_code->m_Size.y / scale, units,
604  pt_D_code->m_Size.x / scale, units,
605  D_CODE::ShowApertureType( pt_D_code->m_Shape ),
606  pt_D_code->m_AperFunction.IsEmpty()? wxT( "none" ) : GetChars( pt_D_code->m_AperFunction )
607  );
608 
609  if( !pt_D_code->m_Defined )
610  Line += wxT( " (not defined)" );
611 
612  if( pt_D_code->m_InUse )
613  Line += wxT( " (in use)" );
614 
615  list.Add( Line );
616  jj++;
617  }
618  }
619 
620  wxSingleChoiceDialog dlg( this, wxEmptyString, _( "D Codes" ), list, (void**) NULL,
621  wxCHOICEDLG_STYLE & ~wxCANCEL );
622 
623  dlg.ShowModal();
624 }
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:94
bool m_InUse
false if the aperure (previously defined) is not used to draw something
Definition: dcode.h:102
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:95
D_CODE * GetDCODE(int aDCODE) const
Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE.
Class GERBER_FILE_IMAGE holds the Image data and parameters for one gerber file and layer parameters ...
int GetActiveLayer()
Function SetActiveLayer returns the active layer.
bool m_Defined
false if the aperture is not defined in the header
Definition: dcode.h:104
unsigned ImagesMaxCount() const
The max number of file images.
#define FIRST_DCODE
Definition: dcode.h:71
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:289
Definition: common.h:158
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:96
static const wxChar * ShowApertureType(APERTURE_T aType)
Function ShowApertureType returns a character string telling what type of aperture type aType is.
Definition: dcode.cpp:95
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command) attached to the D_CODE
Definition: dcode.h:105
const int scale
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
#define TOOLS_MAX_COUNT
Definition: dcode.h:73
#define IU_PER_MILS
Definition: plotter.cpp:134

References FIRST_DCODE, GetActiveLayer(), GetChars(), GERBER_FILE_IMAGE::GetDCODE(), GERBER_FILE_IMAGE::GetDcodesCount(), GetGbrImage(), EDA_DRAW_FRAME::GetUserUnits(), ImagesMaxCount(), INCHES, IU_PER_MILS, D_CODE::m_AperFunction, D_CODE::m_Defined, D_CODE::m_InUse, D_CODE::m_Num_Dcode, D_CODE::m_Shape, D_CODE::m_Size, scale, D_CODE::ShowApertureType(), and TOOLS_MAX_COUNT.

◆ LoadCanvasTypeSetting()

EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::LoadCanvasTypeSetting ( )
inherited

Returns the canvas type stored in the application settings.

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

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

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

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

◆ LoadExcellonFiles()

bool GERBVIEW_FRAME::LoadExcellonFiles ( const wxString &  aFileName)

function LoadExcellonFiles Load a drill (EXCELLON) file or many files.

Parameters
aFileName- void string or file name with full path to open or empty string to open a new file. In this case one one file is loaded if empty string: user will be prompted for filename(s)
Returns
true if file was opened successfully.

Definition at line 387 of file gerbview/files.cpp.

388 {
389  wxString filetypes;
390  wxArrayString filenamesList;
391  wxFileName filename = aFullFileName;
392  wxString currentPath;
393 
394  if( !filename.IsOk() )
395  {
396  filetypes = DrillFileWildcard();
397  filetypes << wxT( "|" );
398 
399  /* All filetypes */
400  filetypes += AllFilesWildcard();
401 
402  /* Use the current working directory if the file name path does not exist. */
403  if( filename.DirExists() )
404  currentPath = filename.GetPath();
405  else
406  currentPath = m_mruPath;
407 
408  wxFileDialog dlg( this, _( "Open NC (Excellon) Drill File(s)" ),
409  currentPath, filename.GetFullName(), filetypes,
410  wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE | wxFD_CHANGE_DIR );
411 
412  if( dlg.ShowModal() == wxID_CANCEL )
413  return false;
414 
415  dlg.GetPaths( filenamesList );
416  currentPath = wxGetCwd();
417  m_mruPath = currentPath;
418  }
419  else
420  {
421  filenamesList.Add( aFullFileName );
422  currentPath = filename.GetPath();
423  m_mruPath = currentPath;
424  }
425 
426  // Read Excellon drill files: each file is loaded on a new GerbView layer
427  bool success = true;
428  int layer = GetActiveLayer();
429 
430  // Manage errors when loading files
431  wxString msg;
432  WX_STRING_REPORTER reporter( &msg );
433 
434  for( unsigned ii = 0; ii < filenamesList.GetCount(); ii++ )
435  {
436  filename = filenamesList[ii];
437 
438  if( !filename.IsAbsolute() )
439  filename.SetPath( currentPath );
440 
441  m_lastFileName = filename.GetFullPath();
442 
443  SetActiveLayer( layer, false );
444 
445  if( Read_EXCELLON_File( filename.GetFullPath() ) )
446  {
447  // Update the list of recent drill files.
448  UpdateFileHistory( filename.GetFullPath(), &m_drillFileHistory );
449 
450  layer = getNextAvailableLayer( layer );
451 
452  if( layer == NO_AVAILABLE_LAYERS && ii < filenamesList.GetCount()-1 )
453  {
454  success = false;
455  reporter.Report( MSG_NO_MORE_LAYER, REPORTER::RPT_ERROR );
456 
457  // Report the name of not loaded files:
458  ii += 1;
459  while( ii < filenamesList.GetCount() )
460  {
461  filename = filenamesList[ii++];
462  wxString txt = wxString::Format( MSG_NOT_LOADED, filename.GetFullName() );
463  reporter.Report( txt, REPORTER::RPT_ERROR );
464  }
465  break;
466  }
467 
468  SetActiveLayer( layer, false );
469  }
470  }
471 
472  if( !success )
473  {
474  HTML_MESSAGE_BOX mbox( this, _( "Errors" ) );
475  mbox.ListSet( msg );
476  mbox.ShowModal();
477  }
478 
479  Zoom_Automatique( false );
480 
481  // Synchronize layers tools with actual active layer:
485  syncLayerBox();
486 
487  return success;
488 }
wxString m_lastFileName
wxString m_mruPath
Most recently used path.
void syncLayerBox(bool aRebuildLayerBox=false)
Function syncLayerBox updates the currently "selected" layer within m_SelLayerBox The currently activ...
GERBER_LAYER_WIDGET * m_LayersManager
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
Function SetActiveLayer will change the currently active layer to aLayer and also update the GERBER_L...
int GetActiveLayer()
Function SetActiveLayer returns the active layer.
wxString AllFilesWildcard()
void UpdateFileHistory(const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
Update the list of recently opened files.
#define MSG_NOT_LOADED
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
#define NO_AVAILABLE_LAYERS
void UpdateLayerIcons()
Function UpdateLayerIcons Update all layer manager icons (layers only) Useful when loading a file or ...
Class HTML_MESSAGE_BOX.
FILE_HISTORY m_drillFileHistory
#define MSG_NO_MORE_LAYER
wxString DrillFileWildcard()
Class WX_STRING_REPORTER is a wrapper for reporting to a wxString object.
Definition: reporter.h:165
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.</