KiCad PCB EDA Suite
LIB_VIEW_FRAME Class Reference

Component library viewer main window. More...

#include <viewlib_frame.h>

Inheritance diagram for LIB_VIEW_FRAME:
SCH_BASE_FRAME EDA_DRAW_FRAME KIWAY_PLAYER EDA_BASE_FRAME KIWAY_HOLDER

Public Types

typedef std::vector< COMPONENT_SELECTIONHISTORY_LIST
 

Public Member Functions

 LIB_VIEW_FRAME (KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, PART_LIB *aLibrary=NULL)
 Constructor. More...
 
 ~LIB_VIEW_FRAME ()
 
void OnSize (wxSizeEvent &event) override
 Function OnSize recalculates the size of toolbars and display panel when the frame size changes. More...
 
void ReCreateListLib ()
 Function ReCreateListLib. More...
 
void ReCreateListCmp ()
 
void DisplayLibInfos ()
 
void RedrawActiveWindow (wxDC *DC, bool EraseBg) override
 
void OnCloseWindow (wxCloseEvent &Event)
 
void CloseLibraryViewer (wxCommandEvent &event)
 
void ReCreateHToolbar () override
 
void ReCreateVToolbar () override
 
void ReCreateMenuBar () override
 Function ReCreateMenuBar Creates recreates the menu bar. More...
 
void OnLeftClick (wxDC *DC, const wxPoint &MousePos) override
 
double BestZoom () override
 Return the zoom level which displays the full page on screen. More...
 
void ClickOnLibList (wxCommandEvent &event)
 
void ClickOnCmpList (wxCommandEvent &event)
 
void OnSetRelativeOffset (wxCommandEvent &event)
 
void OnSelectSymbol (wxCommandEvent &aEvent)
 
void OnShowElectricalType (wxCommandEvent &event)
 
bool GeneralControl (wxDC *aDC, const wxPoint &aPosition, EDA_KEY aHotKey=0) override
 Function GeneralControl performs application specific control using aDC at aPosition in logical units. More...
 
EDA_HOTKEYGetHotKeyDescription (int aCommand) const override
 > More...
 
bool OnHotKey (wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
 Function OnHotKey handle hot key events. More...
 
void LoadSettings (wxConfigBase *aCfg) override
 Function LoadSettings loads common frame parameters from a configuration file. More...
 
void SaveSettings (wxConfigBase *aCfg) override
 Function SaveSettings saves common frame parameters to a configuration data file. More...
 
void SetFilter (const SCHLIB_FILTER *aFilter)
 set a filter to display only libraries and/or components which match the filter More...
 
void SetSelectedLibrary (const wxString &aLibName)
 Set the selected library in the library window. More...
 
void SetSelectedComponent (const wxString &aComponentName)
 Set the selected component. More...
 
void SetUnit (int aUnit)
 
int GetUnit (void)
 
void SetConvert (int aConvert)
 
int GetConvert (void)
 
bool GetShowElectricalType ()
 
void SetShowElectricalType (bool aShow)
 
SCH_SCREENGetScreen () const override
 Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives. More...
 
const wxPoint GetRepeatStep () const
 
void SetRepeatStep (const wxPoint &aStep)
 Sets the repeat step value for repeat command. More...
 
int GetRepeatDeltaLabel () const
 
void SetRepeatDeltaLabel (int aDelta)
 Sets the repeat delta label value for repeat command. More...
 
const wxString GetZoomLevelIndicator () const override
 Function GetZoomLevelIndicator returns a human readable value which can be displayed as zoom level indicator in dialogs. More...
 
void SetPageSettings (const PAGE_INFO &aPageSettings) override
 
const PAGE_INFOGetPageSettings () const override
 
const wxSize GetPageSizeIU () const override
 Function GetPageSizeIU works off of GetPageSettings() to return the size of the paper page in the internal units of this particular view. More...
 
const wxPointGetAuxOrigin () const override
 Function GetAuxOrigin returns the origin of the axis used for plotting and various exports. More...
 
void SetAuxOrigin (const wxPoint &aPosition) override
 
const wxPointGetGridOrigin () const override
 Function GetGridOrigin returns the absolute coordinates of the origin of the snap grid. More...
 
void SetGridOrigin (const wxPoint &aPoint) override
 
COLOR4D GetDrawBgColor () const override
 
void SetDrawBgColor (COLOR4D aColor) override
 
const TITLE_BLOCKGetTitleBlock () const override
 
void SetTitleBlock (const TITLE_BLOCK &aTitleBlock) override
 
void UpdateStatusBar () override
 Function UpdateStatusBar updates the status bar information. More...
 
COMPONENT_SELECTION SelectComponentFromLibrary (const SCHLIB_FILTER *aFilter, std::vector< COMPONENT_SELECTION > &aHistoryList, bool aUseLibBrowser, int aUnit, int aConvert, const wxString &aHighlight=wxEmptyString, bool aAllowFields=true)
 Function SelectComponentFromLib Calls the library viewer to select component to import into schematic. More...
 
bool LockFile (const wxString &aFileName)
 Function LockFile marks a schematic file as being in use. More...
 
void ReleaseFile ()
 Function ReleaseFile Release the current file marked in use. More...
 
wxPoint GetCrossHairPosition (bool aInvertY=false) const
 Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates. More...
 
void SetCrossHairPosition (const wxPoint &aPosition, bool aSnapToGrid=true)
 Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) units. More...
 
wxPoint GetCursorPosition (bool aOnGrid, wxRealPoint *aGridSize=NULL) const
 Function GetCursorPosition returns the current cursor position in logical (drawing) units. More...
 
wxPoint GetNearestGridPosition (const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
 Function GetNearestGridPosition returns the nearest aGridSize location to aPosition. More...
 
wxPoint GetCrossHairScreenPosition () const
 Function GetCursorScreenPosition returns the cross hair position in device (display) units.b. More...
 
void SetMousePosition (const wxPoint &aPosition)
 
wxPoint RefPos (bool useMouse) const
 Function RefPos Return the reference position, coming from either the mouse position or the cursor position. More...
 
const wxPointGetScrollCenterPosition () const
 
void SetScrollCenterPosition (const wxPoint &aPoint)
 
bool GetShowBorderAndTitleBlock () const
 
void SetShowBorderAndTitleBlock (bool aShow)
 
bool ShowPageLimits () const
 
void SetShowPageLimits (bool aShow)
 
EDA_DRAW_PANELGetCanvas ()
 
virtual wxString GetScreenDesc () const
 
virtual void ExecuteRemoteCommand (const char *cmdline)
 Execute a remote command send via a socket to the application, port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242) It called by EDA_DRAW_FRAME::OnSockRequest(). More...
 
void OnMenuOpen (wxMenuEvent &event)
 
void OnMouseEvent (wxMouseEvent &event)
 
void SkipNextLeftButtonReleaseEvent ()
 function SkipNextLeftButtonReleaseEvent after calling this function, if the left mouse button is down, the next left mouse button release event will be ignored. More...
 
int WriteHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL) override
 > More...
 
EDA_HOTKEY_CONFIGGetHotkeyConfig () const
 Function GetHotkeyConfig() Returns a structure containing currently used hotkey mapping. More...
 
virtual void AddMenuZoomAndGrid (wxMenu *aMasterMenu)
 Function AddMenuZoomAndGrid (virtual) Add standard zoom commands and submenu zoom and grid selection to a popup menu uses zoom hotkeys info base to add hotkeys info to menu commands. More...
 
double GetZoomLevelCoeff () const
 Function GetZoomLevelCoeff returns the coefficient to convert internal display scale factor to zoom level. More...
 
void EraseMsgBox ()
 
void Process_PageSettings (wxCommandEvent &event)
 
virtual void ReCreateAuxiliaryToolbar ()
 
virtual void SetToolID (int aId, int aCursor, const wxString &aToolMsg)
 Function SetToolID sets the tool command ID to aId and sets the cursor to aCursor. More...
 
int GetToolId () const
 
virtual bool IsGridVisible () const
 Function IsGridVisible() , virtual. More...
 
virtual void SetGridVisibility (bool aVisible)
 Function SetGridVisibility() , virtual It may be overloaded by derived classes. More...
 
virtual COLOR4D GetGridColor () const
 Function GetGridColor() , virtual. More...
 
virtual void SetGridColor (COLOR4D aColor)
 Function SetGridColor() , virtual. More...
 
wxPoint GetGridPosition (const wxPoint &aPosition) const
 Function GetGridPosition returns the nearest grid position to aPosition if a screen is defined and snap to grid is enabled. More...
 
virtual void SetNextGrid ()
 Function SetNextGrid() changes the grid size settings to the next one available. More...
 
virtual void SetPrevGrid ()
 Function SetPrevGrid() changes the grid size settings to the previous one available. More...
 
void SetPresetGrid (int aIndex)
 Function SetPresetGrid() changes the grid size to one of the preset values. More...
 
virtual void OnSelectGrid (wxCommandEvent &event)
 Command event handler for selecting grid sizes. More...
 
virtual void OnSelectZoom (wxCommandEvent &event)
 Functions OnSelectZoom sets the zoom factor when selected by the zoom list box in the main tool bar. More...
 
void OnToggleGridState (wxCommandEvent &aEvent)
 
void OnSelectUnits (wxCommandEvent &aEvent)
 
void OnToggleCrossHairStyle (wxCommandEvent &aEvent)
 
void OnUpdateUndo (wxUpdateUIEvent &aEvent)
 
void OnUpdateRedo (wxUpdateUIEvent &aEvent)
 
void OnUpdateGrid (wxUpdateUIEvent &aEvent)
 
void OnUpdateUnits (wxUpdateUIEvent &aEvent)
 
void OnUpdateCrossHairStyle (wxUpdateUIEvent &aEvent)
 
void OnEraseBackground (wxEraseEvent &SizeEvent)
 
virtual void OnZoom (wxCommandEvent &event)
 Function OnZoom Called from any zoom event (toolbar , hotkey or popup ) More...
 
void SetNextZoom ()
 Function SetNextZoom() changes the zoom to the next one available. More...
 
void SetPrevZoom ()
 Function SetPrevZoom() changes the zoom to the previous one available. More...
 
void SetPresetZoom (int aIndex)
 Function SetPresetZoom() changes zoom to one of the preset values. More...
 
void RedrawScreen (const wxPoint &aCenterPoint, bool aWarpPointer)
 Function RedrawScreen redraws the entire screen area by updating the scroll bars and mouse pointer in order to have aCenterPoint at the center of the screen. More...
 
void RedrawScreen2 (const wxPoint &posBefore)
 Function RedrawScreen2 puts the crosshair back to the screen position it had before zooming. More...
 
void Zoom_Automatique (bool aWarpPointer)
 Function Zoom_Automatique redraws the screen with best zoom level and the best centering that shows all the page or the board. More...
 
void Window_Zoom (EDA_RECT &Rect)
 Compute the zoom factor and the new draw offset to draw the selected area (Rect) in full window screen. More...
 
double GetZoom ()
 Function GetZoom. More...
 
void DrawWorkSheet (wxDC *aDC, BASE_SCREEN *aScreen, int aLineWidth, double aScale, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
 Function DrawWorkSheet Draws on screen the page layout with the frame and the basic inscriptions. More...
 
void DisplayToolMsg (const wxString &msg)
 
virtual void OnLeftDClick (wxDC *DC, const wxPoint &MousePos)
 
virtual void ToolOnRightClick (wxCommandEvent &event)
 
void AdjustScrollBars (const wxPoint &aCenterPosition)
 
void DisplayUnitsMsg ()
 Function DisplayUnitsMsg displays current unit pane on the status bar. More...
 
virtual void InitBlockPasteInfos ()
 
virtual bool HandleBlockBegin (wxDC *aDC, EDA_KEY aKey, const wxPoint &aPosition, int aExplicitCommand=0)
 Function HandleBlockBegin initializes the block command including the command type, initial position, and other variables. More...
 
virtual int BlockCommand (EDA_KEY aKey)
 Function BlockCommand Returns the block command code (BLOCK_MOVE, BLOCK_COPY...) corresponding to the keys pressed (ALT, SHIFT, SHIFT ALT ..) when block command is started by dragging the mouse. More...
 
virtual void HandleBlockPlace (wxDC *DC)
 Function HandleBlockPlace( ) Called after HandleBlockEnd, when a block command needs to be executed after the block is moved to its new place (bloc move, drag, copy . More...
 
virtual bool HandleBlockEnd (wxDC *DC)
 Function HandleBlockEnd( ) Handle the "end" of a block command, i.e. More...
 
void CopyToClipboard (wxCommandEvent &event)
 Function CopyToClipboard copies the current page or the current block to the clipboard. More...
 
void OnSockRequest (wxSocketEvent &evt)
 
void OnSockRequestServer (wxSocketEvent &evt)
 
void AppendMsgPanel (const wxString &textUpper, const wxString &textLower, COLOR4D color, int pad=6)
 Append a message to the message panel. More...
 
void ClearMsgPanel (void)
 Clear all messages from the message panel. More...
 
void SetMsgPanel (const std::vector< MSG_PANEL_ITEM > &aList)
 Function SetMsgPanel clears the message panel and populates it with the contents of aList. More...
 
void SetMsgPanel (EDA_ITEM *aItem)
 
virtual void UpdateMsgPanel ()
 Function UpdateMsgPanel redraws the message panel. More...
 
void PushPreferences (const EDA_DRAW_PANEL *aParentCanvas)
 Function PushPreferences Pushes a few preferences from a parent window to a child window. More...
 
virtual void PrintPage (wxDC *aDC, LSET aPrintMask, bool aPrintMirrorMode, void *aData=NULL)
 Function PrintPage used to print a page Print the page pointed by current screen, set by the calling print function. More...
 
wxString CoordinateToString (int aValue, bool aConvertToMils=false) const
 Function CoordinateToString is a helper to convert the integer coordinate aValue to a string in inches or mm according to the current user units setting. More...
 
wxString LengthDoubleToString (double aValue, bool aConvertToMils=false) const
 Function LengthDoubleToString is a helper to convert the double value aValue to a string in inches or mm according to the current user units setting. More...
 
virtual void UseGalCanvas (bool aEnable)
 Function UseGalCanvas used to switch between standard and GAL-based canvas. More...
 
bool IsGalCanvasActive () const
 Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use. More...
 
EDA_DRAW_PANEL_GALGetGalCanvas () const
 Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame. More...
 
void SetGalCanvas (EDA_DRAW_PANEL_GAL *aPanel)
 
TOOL_MANAGERGetToolManager () const
 Function GetToolManager returns the tool manager instance, if any. More...
 
virtual void * GetDisplayOptions ()
 Function GetDisplayOptions A way to pass info to draw functions. More...
 
KIGFX::GAL_DISPLAY_OPTIONSGetGalDisplayOptions ()
 Function GetGalDisplayOptions Returns a reference to the gal rendering options used by GAL for rendering. More...
 
VTBL_ENTRY bool OpenProjectFiles (const std::vector< wxString > &aFileList, int aCtl=0)
 Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList. More...
 
VTBL_ENTRY bool ShowModal (wxString *aResult=NULL, wxWindow *aResultantFocusWindow=NULL)
 Function ShowModal puts up this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until this KIWAY_PLAYER derivative calls DismissModal(). More...
 
virtual void KiwayMailIn (KIWAY_EXPRESS &aEvent)
 Function KiwayMailIn receives KIWAY_EXPRESS messages from other players. More...
 
bool Destroy () override
 Our version of Destroy() which is virtual from wxWidgets. More...
 
bool ProcessEvent (wxEvent &aEvent) override
 Function ProcessEvent overrides the default process event handler to implement the auto save feature. More...
 
bool Enable (bool enable) override
 
void SetAutoSaveInterval (int aInterval)
 
int GetAutoSaveInterval () const
 
bool IsType (FRAME_T aType) const
 
void GetKicadHelp (wxCommandEvent &event)
 
void GetKicadContribute (wxCommandEvent &event)
 
void GetKicadAbout (wxCommandEvent &event)
 
void PrintMsg (const wxString &text)
 
wxString ConfigBaseName ()
 Function ConfigBaseName. More...
 
virtual void SaveProjectSettings (bool aAskForSave)
 Function SaveProjectSettings saves changes to the project settings to the project (.pro) file. More...
 
virtual void OnSelectPreferredEditor (wxCommandEvent &event)
 Function OnSelectPreferredEditor Open a dialog to select the editor that will used in KiCad to edit or display files (reports ... More...
 
int ReadHotkeyConfig (struct EDA_HOTKEY_CONFIG *aDescList)
 Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys. More...
 
int ReadHotkeyConfigFile (const wxString &aFilename, struct EDA_HOTKEY_CONFIG *aDescList)
 Function ReadHotkeyConfigFile Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list with hotkeys. More...
 
void ImportHotkeyConfigFromFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Function ImportHotkeyConfigFromFile Prompt the user for an old hotkey file to read, and read it. More...
 
void ExportHotkeyConfigToFile (EDA_HOTKEY_CONFIG *aDescList, const wxString &aDefaultShortname)
 Function ExportHotkeyConfigToFile Prompt the user for an old hotkey file to read, and read it. More...
 
wxString GetFileFromHistory (int cmdId, const wxString &type, wxFileHistory *aFileHistory=NULL)
 Function GetFileFromHistory fetches the file name from the file history list. More...
 
void UpdateFileHistory (const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
 Function UpdateFileHistory Updates the list of recently opened files. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
bool IsWritable (const wxFileName &aFileName)
 Function IsWritable checks if aFileName can be written. More...
 
void CheckForAutoSaveFile (const wxFileName &aFileName, const wxString &aBackupFileExtension)
 Function CheckForAutoSaveFile checks if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More...
 
virtual void ShowChangedLanguage ()
 Function ShowChangedLanguage redraws the menus and what not in current language. More...
 
virtual void ShowChangedIcons ()
 Function ShowChangedIcons redraws items menus after a icon was changed option. More...
 
void AddMenuIconsOptions (wxMenu *MasterMenu)
 Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice, and add it as submenu to MasterMenu. More...
 
bool PostCommandMenuEvent (int evt_type)
 Function PostCommandMenuEvent. More...
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Protected Member Functions

COMPONENT_SELECTION SelectComponentFromLibBrowser (const SCHLIB_FILTER *aFilter, LIB_ALIAS *aPreselectedAlias, int aUnit, int aConvert)
 Function SelectComponentFromLibBrowser Calls the library viewer to select component to import into schematic. More...
 
void OnOpenLibraryViewer (wxCommandEvent &event)
 Function OnOpenLibraryViewer Open the library viewer only to browse library contents. More...
 
bool DisplayListComponentsInLib (PART_LIB *aLibrary, wxString &aBuffer, wxString &aPreviousChoice)
 Function DisplayComponentsNamesInLib Select a component from the list of components in a library. More...
 
PART_LIBSelectLibraryFromList ()
 Function SelectLibraryFromList displays a list of current loaded libraries, and allows the user to select a library This list is sorted, with the library cache always at end of the list. More...
 
bool SelectPartNameToLoad (PART_LIB *aLibrary, wxString &aBufName)
 Function SelectPartNameToLoad Select a part name from the list of components (parts) found in a library. More...
 
void SetScreen (BASE_SCREEN *aScreen)
 
virtual void unitsChangeRefresh ()
 Function unitsChangeRefresh is called when when the units setting has changed to allow for any derived classes to handle refreshing and controls that have units based measurements in them. More...
 
void GeneralControlKeyMovement (int aHotKey, wxPoint *aPos, bool aSnapToGrid)
 Function GeneralControlKeyMovement Handle the common part of GeneralControl dedicated to global cursor keys (i.e. More...
 
void RefreshCrossHair (const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC *aDC)
 
bool IsModal ()
 
void SetModal (bool aIsModal)
 
bool IsDismissed ()
 Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal(). More...
 
void DismissModal (bool aRetVal, const wxString &aResult=wxEmptyString)
 
void kiway_express (KIWAY_EXPRESS &aEvent)
 event handler, routes to derivative specific virtual KiwayMailIn() More...
 
void language_change (wxCommandEvent &event)
 Function language_change is an event handler called on a language menu selection. More...
 
void OnChangeIconsOptions (wxCommandEvent &event) override
 Function OnChangeIconsOptions is an event handler called on a icons options in menus or toolbars menu selection. More...
 
void onAutoSaveTimer (wxTimerEvent &aEvent)
 Function onAutoSaveTimer handles the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Function autoSaveRequired returns the auto save status of the application. More...
 
virtual bool doAutoSave ()
 Function doAutoSave should be overridden by the derived class to handle the auto save feature. More...
 
virtual wxConfigBase * config ()
 Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME. More...
 
virtual const SEARCH_STACKsys_search ()
 Function sys_search returns a SEARCH_STACK pertaining to entire program, and is overloaded in KICAD_MANAGER_FRAME. More...
 
virtual wxString help_name ()
 

Protected Attributes

wxPoint m_repeatStep
 the increment value of the position of an item when it is repeated More...
 
int m_repeatDeltaLabel
 the increment value of labels like bus members when they are repeated More...
 
std::unique_ptr< wxSingleInstanceChecker > m_file_checker
 prevents opening same file multiple times. More...
 
EDA_HOTKEY_CONFIGm_hotkeysDescrList
 
int m_LastGridSizeId
 
bool m_drawGrid
 
bool m_showPageLimits
 true to display the page limits More...
 
COLOR4D m_gridColor
 Grid color. More...
 
COLOR4D m_drawBgColor
 the background color of the draw canvas BLACK for Pcbnew, BLACK or WHITE for eeschema More...
 
double m_zoomLevelCoeff
 a suitable value to convert the internal zoom scaling factor More...
 
int m_UndoRedoCountMax
 default Undo/Redo command Max depth, to be handed More...
 
EDA_DRAW_PANELm_canvas
 The area to draw on. More...
 
TOOL_MANAGERm_toolManager
 
TOOL_DISPATCHERm_toolDispatcher
 
ACTIONSm_actions
 
int m_lastDrawToolId
 Tool ID of previously active draw tool bar button. More...
 
bool m_showAxis
 True shows the X and Y axis indicators. More...
 
bool m_showGridAxis
 True shows the grid axis indicators. More...
 
bool m_showOriginAxis
 True shows the origin axis used to indicate the coordinate offset for drill, gerber, and component position files. More...
 
bool m_showBorderAndTitleBlock
 True shows the drawing border and title block. More...
 
wxChoice * m_gridSelectBox
 Choice box to choose the grid size. More...
 
wxChoice * m_zoomSelectBox
 Choice box to choose the zoom value. More...
 
wxAuiToolBar * m_drawToolBar
 The tool bar that contains the buttons for quick access to the application draw tools. More...
 
wxAuiToolBar * m_optionsToolBar
 The options tool bar typcially located on the left edge of the main window. More...
 
EDA_MSG_PANELm_messagePanel
 Panel used to display information at the bottom of the main window. More...
 
int m_MsgFrameHeight
 
bool m_movingCursorWithKeyboard
 One-shot to avoid a recursive mouse event during hotkey movement. More...
 
bool m_modal
 
WX_EVENT_LOOPm_modal_loop
 
wxWindow * m_modal_resultant_parent
 
wxString m_modal_string
 
bool m_modal_ret_val
 
FRAME_T m_Ident
 Id Type (pcb, schematic, library..) More...
 
wxPoint m_FramePos
 
wxSize m_FrameSize
 
wxString m_configFrameName
 prefix used in config to identify some params (frame size...) if empty, the frame name defined in CTOR is used More...
 
wxAuiToolBar * m_mainToolBar
 Standard horizontal Toolbar. More...
 
wxString m_AboutTitle
 Name of program displayed in About. More...
 
wxAuiManager m_auimgr
 
bool m_hasAutoSave
 Flag to indicate if this frame supports auto save. More...
 
bool m_autoSaveState
 Flag to indicate the last auto save state. More...
 
int m_autoSaveInterval
 The auto save interval time in seconds. More...
 
wxTimer * m_autoSaveTimer
 The timer used to implement the auto save feature;. More...
 
wxString m_perspective
 wxAuiManager perspective. More...
 
wxString m_mruPath
 Most recently used path. More...
 

Private Member Functions

virtual void OnActivate (wxActivateEvent &event) override
 Function OnActivate is called when the frame frame is activate to reload the libraries and component lists that can be changed by the schematic editor or the library editor. More...
 
void ExportToSchematicLibraryPart (wxCommandEvent &event)
 Function ExportToSchematicLibraryPart exports the current component to schematic and close the library browser. More...
 
bool OnRightClick (const wxPoint &MousePos, wxMenu *PopMenu) override
 
void DClickOnCmpList (wxCommandEvent &event)
 
void onUpdateAlternateBodyStyleButton (wxUpdateUIEvent &aEvent)
 
void onUpdateNormalBodyStyleButton (wxUpdateUIEvent &aEvent)
 
void onUpdateViewDoc (wxUpdateUIEvent &aEvent)
 
void OnUpdateElectricalType (wxUpdateUIEvent &aEvent)
 
void onSelectNextSymbol (wxCommandEvent &aEvent)
 
void onSelectPreviousSymbol (wxCommandEvent &aEvent)
 
void onViewSymbolDocument (wxCommandEvent &aEvent)
 
void onSelectSymbolBodyStyle (wxCommandEvent &aEvent)
 
void onSelectSymbolUnit (wxCommandEvent &aEvent)
 
LIB_ALIASgetSelectedAlias ()
 
LIB_PARTgetSelectedSymbol ()
 

Private Attributes

wxComboBox * m_selpartBox
 
wxListBox * m_libList
 
int m_libListWidth
 
wxListBox * m_cmpList
 
int m_cmpListWidth
 
bool m_listPowerCmpOnly
 
wxArrayString m_allowedLibs
 
bool m_showPinElectricalTypeName
 the option to show the pin electrical name in the component editor More...
 

Static Private Attributes

static wxString m_libraryName
 
static wxString m_entryName
 
static int m_unit = 1
 
static int m_convert = 1
 

Detailed Description

Component library viewer main window.

Definition at line 49 of file viewlib_frame.h.

Member Typedef Documentation

typedef std::vector<COMPONENT_SELECTION> SCH_BASE_FRAME::HISTORY_LIST
inherited

Definition at line 141 of file sch_base_frame.h.

Constructor & Destructor Documentation

LIB_VIEW_FRAME::LIB_VIEW_FRAME ( KIWAY aKiway,
wxWindow *  aParent,
FRAME_T  aFrameType,
PART_LIB aLibrary = NULL 
)

Constructor.

Parameters
aKiway
aParent= the parent frame
aFrameTypemust be given either FRAME_SCH_LIB_VIEWER or FRAME_SCH_LIB_VIEWER_MODAL
aLibrary= the library to open when starting (default = NULL)
LIB_VIEW_FRAME::~LIB_VIEW_FRAME ( )

Definition at line 247 of file viewlib_frame.cpp.

248 {
249 }

Member Function Documentation

void EDA_BASE_FRAME::AddMenuIconsOptions ( wxMenu *  MasterMenu)
inherited

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

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

Definition at line 671 of file basicframe.cpp.

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

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

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

Function AddMenuZoomAndGrid (virtual) Add standard zoom commands and submenu zoom and grid selection to a popup menu uses zoom hotkeys info base to add hotkeys info to menu commands.

Parameters
aMasterMenu= the menu to populate.

Definition at line 239 of file zoom.cpp.

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

Referenced by EDA_DRAW_PANEL::OnRightClick().

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

Definition at line 888 of file draw_frame.cpp.

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

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

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

Append a message to the message panel.

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

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

Definition at line 734 of file draw_frame.cpp.

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

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

737 {
738  if( m_messagePanel == NULL )
739  return;
740 
741  m_messagePanel->AppendMessage( textUpper, textLower, color, pad );
742 }
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:128
void AppendMessage(const wxString &aUpperText, const wxString &aLowerText, COLOR4D aColor, int aPad=6)
Function AppendMessage appends a message to the message panel.
Definition: msgpanel.cpp:110
double LIB_VIEW_FRAME::BestZoom ( )
overridevirtual

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

Implements EDA_DRAW_FRAME.

Definition at line 358 of file viewlib_frame.cpp.

References boundingBox(), EDA_RECT::Centre(), PART_LIB::FindPart(), EDA_RECT::GetHeight(), SCH_BASE_FRAME::GetScreen(), LIB_PART::GetUnitBoundingBox(), EDA_RECT::GetWidth(), EDA_DRAW_FRAME::m_canvas, m_convert, m_entryName, m_libraryName, m_unit, BASE_SCREEN::m_ZoomList, max, KIWAY_HOLDER::Prj(), and EDA_DRAW_FRAME::SetScrollCenterPosition().

359 {
360  /* Please, note: wxMSW before version 2.9 seems have
361  * problems with zoom values < 1 ( i.e. userscale > 1) and needs to be patched:
362  * edit file <wxWidgets>/src/msw/dc.cpp
363  * search for line static const int VIEWPORT_EXTENT = 1000;
364  * and replace by static const int VIEWPORT_EXTENT = 10000;
365  */
366 
367  LIB_PART* part = NULL;
368  double bestzoom = 16.0; // default value for bestzoom
369  PART_LIB* lib = Prj().SchLibs()->FindLibrary( m_libraryName );
370 
371  if( lib )
372  part = lib->FindPart( m_entryName );
373 
374  if( !part )
375  {
376  SetScrollCenterPosition( wxPoint( 0, 0 ) );
377  return bestzoom;
378  }
379 
380  wxSize size = m_canvas->GetClientSize();
381 
383 
384  // Reserve a 10% margin around component bounding box.
385  double margin_scale_factor = 0.8;
386  double zx =(double) boundingBox.GetWidth() /
387  ( margin_scale_factor * (double)size.x );
388  double zy = (double) boundingBox.GetHeight() /
389  ( margin_scale_factor * (double)size.y);
390 
391  // Calculates the best zoom
392  bestzoom = std::max( zx, zy );
393 
394  // keep it >= minimal existing zoom (can happen for very small components
395  // like small power symbols
396  if( bestzoom < GetScreen()->m_ZoomList[0] )
397  bestzoom = GetScreen()->m_ZoomList[0];
398 
399  SetScrollCenterPosition( boundingBox.Centre() );
400 
401  return bestzoom;
402 }
static int m_unit
static int m_convert
static wxString m_entryName
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Function GetBoundingBox.
void SetScrollCenterPosition(const wxPoint &aPoint)
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
int GetHeight() const
static wxString m_libraryName
BOX2I boundingBox(T aObject)
boundingBox template method
Definition: shape_index.h:59
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
Class LIB_PART defines a library part object.
wxPoint Centre() const
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
#define max(a, b)
Definition: auxiliary.h:86
Class EDA_RECT handles the component boundary box.
int GetWidth() const
Class PART_LIB is used to load, save, search, and otherwise manipulate part library files...
std::vector< double > m_ZoomList
standard zoom (i.e. scale) coefficients.
LIB_PART * FindPart(const wxString &aName)
Find part by aName.
int EDA_DRAW_FRAME::BlockCommand ( EDA_KEY  aKey)
virtualinherited

Function BlockCommand Returns the block command code (BLOCK_MOVE, BLOCK_COPY...) corresponding to the keys pressed (ALT, SHIFT, SHIFT ALT ..) when block command is started by dragging the mouse.

Parameters
aKey= the key modifiers (Alt, Shift ...)
Returns
the block command id (BLOCK_MOVE, BLOCK_COPY...)

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

Definition at line 626 of file draw_frame.cpp.

Referenced by EDA_DRAW_FRAME::HandleBlockBegin().

627 {
628  return 0;
629 }
void EDA_BASE_FRAME::CheckForAutoSaveFile ( const wxFileName &  aFileName,
const wxString &  aBackupFileExtension 
)
inherited

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

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

Parameters
aFileNameA wxFileName object containing the file name to check.
aBackupFileExtensionA wxString object containing the backup file extension used to create the backup file name.

Definition at line 576 of file basicframe.cpp.

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

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

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

Definition at line 544 of file viewlib_frame.cpp.

References m_cmpList, and SetSelectedComponent().

545 {
546  int ii = m_cmpList->GetSelection();
547 
548  if( ii < 0 )
549  return;
550 
551  SetSelectedComponent( m_cmpList->GetString( ii ) );
552 }
wxListBox * m_cmpList
void SetSelectedComponent(const wxString &aComponentName)
Set the selected component.
void LIB_VIEW_FRAME::ClickOnLibList ( wxCommandEvent &  event)

Definition at line 515 of file viewlib_frame.cpp.

References m_libList, and SetSelectedLibrary().

516 {
517  int ii = m_libList->GetSelection();
518 
519  if( ii < 0 )
520  return;
521 
522  SetSelectedLibrary( m_libList->GetString( ii ) );
523 }
wxListBox * m_libList
void SetSelectedLibrary(const wxString &aLibName)
Set the selected library in the library window.
void LIB_VIEW_FRAME::CloseLibraryViewer ( wxCommandEvent &  event)

Definition at line 677 of file viewlib_frame.cpp.

678 {
679  Close();
680 }
wxConfigBase * EDA_BASE_FRAME::config ( )
protectedvirtualinherited
wxString EDA_BASE_FRAME::ConfigBaseName ( )
inlineinherited

Function ConfigBaseName.

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

Definition at line 255 of file wxstruct.h.

References EDA_BASE_FRAME::m_configFrameName.

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

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

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

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

Definition at line 793 of file draw_frame.cpp.

References CoordinateToString().

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

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

Definition at line 43 of file copy_to_clipboard.cpp.

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

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

Definition at line 576 of file viewlib_frame.cpp.

References ExportToSchematicLibraryPart(), KIWAY_PLAYER::IsModal(), and EDA_DRAW_FRAME::SkipNextLeftButtonReleaseEvent().

577 {
578  if( IsModal() )
579  {
581 
582  // The schematic editor might not be the parent of the library viewer.
583  // It could be a python window.
584  SCH_EDIT_FRAME* schframe = dynamic_cast<SCH_EDIT_FRAME*>( GetParent() );
585 
586  if( schframe )
587  {
588  // Prevent the double click from being as a single click in the parent
589  // window which would cause the part to be parked rather than staying
590  // in drag mode.
591  schframe->SkipNextLeftButtonReleaseEvent();
592  }
593  }
594 }
Schematic editor (Eeschema) main window.
Definition: schframe.h:117
void SkipNextLeftButtonReleaseEvent()
function SkipNextLeftButtonReleaseEvent after calling this function, if the left mouse button is down...
Definition: draw_frame.cpp:275
bool IsModal()
Definition: kiway_player.h:216
void ExportToSchematicLibraryPart(wxCommandEvent &event)
Function ExportToSchematicLibraryPart exports the current component to schematic and close the librar...
void KIWAY_PLAYER::DismissModal ( bool  aRetVal,
const wxString &  aResult = wxEmptyString 
)
protectedinherited

Definition at line 173 of file kiway_player.cpp.

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

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

174 {
175  m_modal_ret_val = aRetVal;
176  m_modal_string = aResult;
177 
178  if( m_modal_loop )
179  {
180  m_modal_loop->Exit();
181  m_modal_loop = 0; // this marks it as dismissed.
182  }
183 
184  Show( false );
185 }
bool m_modal_ret_val
Definition: kiway_player.h:250
wxString m_modal_string
Definition: kiway_player.h:249
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:247
void LIB_VIEW_FRAME::DisplayLibInfos ( )

Definition at line 172 of file viewlibs.cpp.

References PART_LIBS::FindLibrary(), Format(), PART_LIB::GetFullFileName(), m_libraryName, and KIWAY_HOLDER::Prj().

Referenced by OnActivate(), ReCreateListLib(), SetSelectedComponent(), and SetSelectedLibrary().

173 {
174  PART_LIBS* libs = Prj().SchLibs();
175 
176  if( libs )
177  {
178  PART_LIB* lib = libs->FindLibrary( m_libraryName );
179 
180  wxString title = wxString::Format( L"Library Browser \u2014 %s",
181  lib ? lib->GetFullFileName() : "no library selected" );
182  SetTitle( title );
183  }
184 }
wxString GetFullFileName()
Function GetFullFileName returns the full file library name with path and extension.
static wxString m_libraryName
PART_LIB * FindLibrary(const wxString &aName)
Function FindLibrary finds a part library by aName.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
Class PART_LIBS is a collection of PART_LIBs.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
Class PART_LIB is used to load, save, search, and otherwise manipulate part library files...
bool SCH_BASE_FRAME::DisplayListComponentsInLib ( PART_LIB aLibrary,
wxString &  aBuffer,
wxString &  aPreviousChoice 
)
protectedinherited

Function DisplayComponentsNamesInLib Select a component from the list of components in a library.

Parameters
aLibrary= a reference to the library to explore If NULL the user will be prompted tp chose a library
aBuffer= a wxString to put the selected component name
Returns
true if a component is selected false on cancel

Definition at line 113 of file selpart.cpp.

References DisplayCmpDocAndKeywords(), PART_LIB::GetAliasNames(), PART_LIB::GetLogicalName(), EDA_LIST_DIALOG::GetTextSelection(), KIWAY_HOLDER::Prj(), and SCH_BASE_FRAME::SelectLibraryFromList().

Referenced by SCH_BASE_FRAME::SelectPartNameToLoad().

115 {
116  wxArrayString nameList;
117 
118  if( aLibrary == NULL )
119  aLibrary = SelectLibraryFromList();
120 
121  if( aLibrary == NULL )
122  return false;
123 
124  aLibrary->GetAliasNames( nameList );
125 
126  wxArrayString headers;
127  headers.Add( wxT("Component") );
128  headers.Add( wxT("Library") );
129  std::vector<wxArrayString> itemsToDisplay;
130 
131  // Conversion from wxArrayString to vector of ArrayString
132  for( unsigned i = 0; i < nameList.GetCount(); i++ )
133  {
134  wxArrayString item;
135  item.Add( nameList[i] );
136  item.Add( aLibrary->GetLogicalName() );
137  itemsToDisplay.push_back( item );
138  }
139 
140  EDA_LIST_DIALOG dlg( this, _( "Select Component" ), headers, itemsToDisplay,
141  aPreviousChoice, DisplayCmpDocAndKeywords, Prj().SchLibs() );
142 
143  if( dlg.ShowModal() != wxID_OK )
144  return false;
145 
146  aBuffer = dlg.GetTextSelection();
147 
148  return true;
149 }
void GetAliasNames(wxArrayString &aNames)
Load a string array with the names of all the entries in this library.
const wxString GetLogicalName()
Function GetLogicalName returns the logical name of the library.
class EDA_LIST_DIALOG
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
static void DisplayCmpDocAndKeywords(wxString &aName, void *aData)
Definition: selpart.cpp:41
PART_LIB * SelectLibraryFromList()
Function SelectLibraryFromList displays a list of current loaded libraries, and allows the user to se...
Definition: selpart.cpp:58
void EDA_DRAW_FRAME::DisplayUnitsMsg ( )
inherited

Function DisplayUnitsMsg displays current unit pane on the status bar.

Definition at line 503 of file draw_frame.cpp.

References g_UserUnit, INCHES, and MILLIMETRES.

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

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

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

Returns
true if the auto save was successful otherwise false.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 231 of file basicframe.cpp.

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

232 {
233  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
234 }
void EDA_DRAW_FRAME::DrawWorkSheet ( wxDC *  aDC,
BASE_SCREEN aScreen,
int  aLineWidth,
double  aScale,
const wxString &  aFilename,
const wxString &  aSheetLayer = wxEmptyString 
)
inherited

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

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

Definition at line 77 of file worksheet.cpp.

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

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

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

Definition at line 192 of file basicframe.cpp.

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

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

Definition at line 250 of file draw_frame.cpp.

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

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

251 {
252  if( m_messagePanel )
254 }
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:128
void EraseMsgBox()
Definition: msgpanel.cpp:215
virtual void EDA_DRAW_FRAME::ExecuteRemoteCommand ( const char *  cmdline)
inlinevirtualinherited

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

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

Parameters
cmdline= received command from socket

Reimplemented in SCH_EDIT_FRAME, and PCB_EDIT_FRAME.

Definition at line 320 of file draw_frame.h.

Referenced by EDA_DRAW_FRAME::OnSockRequest().

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

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

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

Definition at line 768 of file hotkeys_basic.cpp.

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

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

770 {
771  wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
772  wxString mask = wxT( "*." ) + ext;
773 
774 #if 0
775  wxString path = wxPathOnly( Prj().GetProjectFullName() );
776 #else
777  wxString path = GetMruPath();
778 #endif
779  wxFileName fn( aDefaultShortname );
780  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
781 
782  wxString filename = EDA_FILE_SELECTOR( _( "Write Hotkey Configuration File:" ),
783  path,
784  fn.GetFullPath(),
785  ext,
786  mask,
787  this,
788  wxFD_SAVE,
789  true );
790 
791  if( filename.IsEmpty() )
792  return;
793 
794  WriteHotkeyConfig( aDescList, &filename );
795  SetMruPath( wxFileName( filename ).GetPath() );
796 }
void SetMruPath(const wxString &aPath)
Definition: wxstruct.h:356
PROJECT & Prj()
Definition: kicad.cpp:293
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
virtual int WriteHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mec...
#define DEFAULT_HOTKEY_FILENAME_EXT
Definition: hotkeys_basic.h:34
wxString GetMruPath() const
Definition: wxstruct.h:358
void LIB_VIEW_FRAME::ExportToSchematicLibraryPart ( wxCommandEvent &  event)
private

Function ExportToSchematicLibraryPart exports the current component to schematic and close the library browser.

Definition at line 597 of file viewlib_frame.cpp.

References KIWAY_PLAYER::DismissModal(), and m_cmpList.

Referenced by DClickOnCmpList().

598 {
599  int ii = m_cmpList->GetSelection();
600 
601  if( ii >= 0 )
602  {
603  wxString part_name = m_cmpList->GetString( ii );
604 
605  // a selection was made, pass true
606  DismissModal( true, part_name );
607  }
608  else
609  {
610  // no selection was made, pass false
611  DismissModal( false );
612  }
613 
614  Close( true );
615 }
wxListBox * m_cmpList
void DismissModal(bool aRetVal, const wxString &aResult=wxEmptyString)
bool LIB_VIEW_FRAME::GeneralControl ( wxDC *  aDC,
const wxPoint aPosition,
EDA_KEY  aHotKey = 0 
)
overridevirtual

Function GeneralControl performs application specific control using aDC at aPosition in logical units.

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

Parameters
aDCA device context.
aPositionThe current cursor position in logical (drawing) units.
aHotKeyA key event used for application specific control if not zero.

Reimplemented from EDA_DRAW_FRAME.

Definition at line 306 of file eeschema/controle.cpp.

References EDA_DRAW_FRAME::GeneralControlKeyMovement(), EDA_DRAW_FRAME::GetCrossHairPosition(), SCH_SCREEN::GetCurItem(), EDA_ITEM::GetFlags(), SCH_BASE_FRAME::GetScreen(), EDA_DRAW_FRAME::m_movingCursorWithKeyboard, OnHotKey(), EDA_DRAW_FRAME::RefreshCrossHair(), EDA_DRAW_FRAME::SetCrossHairPosition(), and SCH_BASE_FRAME::UpdateStatusBar().

307 {
308  bool eventHandled = true;
309 
310  // Filter out the 'fake' mouse motion after a keyboard movement
311  if( !aHotKey && m_movingCursorWithKeyboard )
312  {
314  return false;
315  }
316 
317  wxPoint pos = aPosition;
318  wxPoint oldpos = GetCrossHairPosition();
319  GeneralControlKeyMovement( aHotKey, &pos, true );
320 
321  // Update cursor position.
322  SetCrossHairPosition( pos, true );
323  RefreshCrossHair( oldpos, aPosition, aDC );
324 
325  if( aHotKey )
326  {
327  SCH_SCREEN* screen = GetScreen();
328 
329  if( screen->GetCurItem() && screen->GetCurItem()->GetFlags() )
330  eventHandled = OnHotKey( aDC, aHotKey, aPosition, screen->GetCurItem() );
331  else
332  eventHandled = OnHotKey( aDC, aHotKey, aPosition, NULL );
333  }
334 
335  UpdateStatusBar(); // Display cursor coordinates info.
336 
337  return eventHandled;
338 }
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:255
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
bool OnHotKey(wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
Function OnHotKey handle hot key events.
void RefreshCrossHair(const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC *aDC)
SCH_ITEM * GetCurItem() const
Function GetCurItem returns the currently selected SCH_ITEM, overriding BASE_SCREEN::GetCurItem().
void UpdateStatusBar() override
Function UpdateStatusBar updates the status bar information.
void GeneralControlKeyMovement(int aHotKey, wxPoint *aPos, bool aSnapToGrid)
Function GeneralControlKeyMovement Handle the common part of GeneralControl dedicated to global curso...
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
bool m_movingCursorWithKeyboard
One-shot to avoid a recursive mouse event during hotkey movement.
Definition: draw_frame.h:138
void EDA_DRAW_FRAME::GeneralControlKeyMovement ( int  aHotKey,
wxPoint aPos,
bool  aSnapToGrid 
)
protectedinherited

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

cursor movement by keyboard)

Definition at line 1258 of file draw_frame.cpp.

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

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

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

Definition at line 214 of file wxstruct.h.

References EDA_BASE_FRAME::m_autoSaveInterval.

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

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

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

Implements EDA_DRAW_FRAME.

Definition at line 107 of file sch_base_frame.cpp.

References SCH_SCREEN::GetAuxOrigin(), and SCH_BASE_FRAME::GetScreen().

108 {
109  wxASSERT( GetScreen() );
110  return GetScreen()->GetAuxOrigin();
111 }
const wxPoint & GetAuxOrigin() const
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
EDA_DRAW_PANEL* EDA_DRAW_FRAME::GetCanvas ( )
inlineinherited

Definition at line 299 of file draw_frame.h.

References EDA_DRAW_FRAME::m_canvas.

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

299 { return m_canvas; }
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
int LIB_VIEW_FRAME::GetConvert ( void  )
inline

Definition at line 142 of file viewlib_frame.h.

References m_convert.

Referenced by SCH_BASE_FRAME::SelectComponentFromLibBrowser().

142 { return m_convert; }
static int m_convert
wxPoint EDA_DRAW_FRAME::GetCrossHairPosition ( bool  aInvertY = false) const
inherited

Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates.

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

Definition at line 1151 of file draw_frame.cpp.

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

Referenced by Abort_EditEdge(), AbortSymbolTraceOn(), AddMenusForBus(), AddMenusForWire(), PCB_BASE_FRAME::AddPad(), PCB_EDIT_FRAME::AutoPlaceModule(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Self(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::BeginSegment(), PL_EDITOR_FRAME::Block_Move(), GERBVIEW_FRAME::Block_Move(), BuildDimension(), SCH_EDIT_FRAME::CreateBusBusEntry(), SCH_EDIT_FRAME::CreateBusWireEntry(), LIB_EDIT_FRAME::CreateGraphicItem(), SCH_EDIT_FRAME::CreateNewImage(), SCH_EDIT_FRAME::CreateNewText(), LIB_EDIT_FRAME::CreatePin(), PCB_EDIT_FRAME::createPopupMenuForTracks(), SCH_EDIT_FRAME::CreateSheet(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), SCH_EDIT_FRAME::DeleteConnection(), SCH_EDIT_FRAME::DeleteItemAtCrossHair(), DrawAndSizingBlockOutlines(), EDA_DRAW_PANEL::DrawCrossHair(), DrawMovePin(), drawMovingBlock(), DrawMovingBlockOutlines(), DrawSegment(), PCB_BASE_EDIT_FRAME::duplicateItem(), PCB_EDIT_FRAME::EditDimension(), LIB_EDIT_FRAME::EndDrawGraphicItem(), GeneralControl(), DISPLAY_FOOTPRINTS_FRAME::GeneralControl(), FOOTPRINT_VIEWER_FRAME::GeneralControl(), FOOTPRINT_WIZARD_FRAME::GeneralControl(), FOOTPRINT_EDIT_FRAME::GeneralControl(), SCH_EDIT_FRAME::GeneralControl(), PL_EDITOR_FRAME::GeneralControl(), LIB_EDIT_FRAME::GeneralControl(), GERBVIEW_FRAME::GeneralControl(), PCB_EDIT_FRAME::GeneralControl(), EDA_DRAW_FRAME::GeneralControlKeyMovement(), LIB_EDIT_FRAME::GraphicItemBeginDraw(), SCH_EDIT_FRAME::ImportSheetPin(), InstallBlockCmdFrame(), SCH_EDIT_FRAME::Load_Component(), PL_EDITOR_FRAME::Locate(), Move_Segment(), Move_Texte_Pcb(), moveBitmap(), MoveDimensionText(), MoveFootprint(), moveItem(), PL_EDITOR_FRAME::MoveItem(), moveItemWithMouseCursor(), SCH_EDIT_FRAME::OnDragItem(), DIALOG_MODULE_MODULE_EDITOR::OnEditReference(), DIALOG_MODULE_BOARD_EDITOR::OnEditReference(), DIALOG_MODULE_MODULE_EDITOR::OnEditValue(), DIALOG_MODULE_BOARD_EDITOR::OnEditValue(), OnHotKey(), FOOTPRINT_VIEWER_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PL_EDITOR_FRAME::OnHotKey(), LIB_EDIT_FRAME::OnHotKey(), SCH_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), GERBVIEW_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), EDA_DRAW_PANEL::OnMouseEvent(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), PCB_EDIT_FRAME::OnRightClick(), OnSetRelativeOffset(), FOOTPRINT_VIEWER_FRAME::OnSetRelativeOffset(), FOOTPRINT_WIZARD_FRAME::OnSetRelativeOffset(), EDA_DRAW_FRAME::OnZoom(), DIALOG_UPDATE_PCB::PerformUpdate(), LIB_EDIT_FRAME::PlaceAnchor(), PCB_BASE_FRAME::PlaceModule(), LIB_EDIT_FRAME::PlacePin(), PCB_BASE_FRAME::PlaceTexteModule(), SCH_EDIT_FRAME::PrepareMoveItem(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), PushTrack(), EDA_DRAW_FRAME::RedrawScreen2(), RedrawWhileMovingCursor(), EDA_DRAW_FRAME::RefreshCrossHair(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), resizeSheetWithMouseCursor(), Show_Drag_Track_Segment_With_Cte_Slope(), Show_MoveNode(), Show_MoveTexte_Module(), Show_New_Edge_While_Move_Mouse(), Show_Pad_Move(), Show_Zone_Corner_Or_Outline_While_Move_Mouse(), ShowBoundingBoxMicroWaveInductor(), ShowCurrentOutlineWhileMoving(), ShowNewEdgeModule(), ShowNewTrackWhenMovingCursor(), ShowTargetShapeWhileMovingMouse(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_DrawItem(), FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), LIB_EDIT_FRAME::StartModifyDrawSymbol(), LIB_EDIT_FRAME::StartMoveDrawSymbol(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), SymbolDisplayDraw(), SCH_BASE_FRAME::UpdateStatusBar(), PL_EDITOR_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), and GERBVIEW_FRAME::UpdateStatusBar().

1152 {
1153  // subject to change, borrow from old BASE_SCREEN for now.
1154  if( IsGalCanvasActive() )
1155  {
1157 
1158  return wxPoint( cursor.x, cursor.y );
1159  }
1160  else
1161  {
1162  BASE_SCREEN* screen = GetScreen(); // virtual call
1163  return screen->getCrossHairPosition( aInvertY );
1164  }
1165 }
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
wxPoint getCrossHairPosition(bool aInvertY) const
Function getCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
virtual VECTOR2D GetCursorPosition() const =0
Function GetCursorPosition() Returns the current cursor position in world coordinates.
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:795
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel...
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
wxPoint EDA_DRAW_FRAME::GetCrossHairScreenPosition ( ) const
inherited

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

Returns
The current cross hair position.

Definition at line 1189 of file draw_frame.cpp.

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

1190 {
1191  BASE_SCREEN* screen = GetScreen(); // virtual call
1192  return screen->getCrossHairScreenPosition();
1193 }
wxPoint getCrossHairScreenPosition() const
Function getCursorScreenPosition returns the cross hair position in device (display) units...
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
wxPoint EDA_DRAW_FRAME::GetCursorPosition ( bool  aOnGrid,
wxRealPoint *  aGridSize = NULL 
) const
inherited

Function GetCursorPosition returns the current cursor position in logical (drawing) units.

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

Definition at line 1175 of file draw_frame.cpp.

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

1176 {
1177  BASE_SCREEN* screen = GetScreen(); // virtual call
1178  return screen->getCursorPosition( aOnGrid, GetGridOrigin(), aGridSize );
1179 }
wxPoint getCursorPosition(bool aOnGrid, const wxPoint &aGridOrigin, wxRealPoint *aGridSize) const
Function getCursorPosition returns the current cursor position in logical (drawing) units...
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
virtual const wxPoint & GetGridOrigin() const =0
Function GetGridOrigin returns the absolute coordinates of the origin of the snap grid...
virtual void* EDA_DRAW_FRAME::GetDisplayOptions ( )
inlinevirtualinherited

Function GetDisplayOptions 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 818 of file draw_frame.h.

Referenced by EDA_DRAW_PANEL::GetDisplayOptions(), and PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL().

818 { return NULL; }
COLOR4D SCH_BASE_FRAME::GetDrawBgColor ( ) const
overridevirtualinherited
Returns
the COLOR4D for the canvas background

Reimplemented from EDA_DRAW_FRAME.

Definition at line 66 of file sch_base_frame.cpp.

References GetLayerColor(), and LAYER_SCHEMATIC_BACKGROUND.

Referenced by SCH_PRINTOUT::DrawPage(), DIALOG_RESCUE_EACH::renderPreview(), and DIALOG_CHOOSE_COMPONENT::RenderPreview().

67 {
69 }
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:166
wxString EDA_BASE_FRAME::GetFileFromHistory ( int  cmdId,
const wxString &  type,
wxFileHistory *  aFileHistory = NULL 
)
inherited

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

and removes the selected file, if this file does not exists Note also the menu is updated, if wxFileHistory::UseMenu was called at init time

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

Definition at line 400 of file basicframe.cpp.

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

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

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

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

Returns
Pointer to GAL-based canvas.

Definition at line 803 of file draw_frame.h.

References EDA_DRAW_FRAME::m_galCanvas.

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

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

Function GetGridColor() , virtual.

Returns
the color of the grid

Reimplemented in FOOTPRINT_EDIT_FRAME, PCB_EDIT_FRAME, DISPLAY_FOOTPRINTS_FRAME, and FOOTPRINT_VIEWER_FRAME.

Definition at line 435 of file draw_frame.h.

References EDA_DRAW_FRAME::m_gridColor.

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

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

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

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

Implements EDA_DRAW_FRAME.

Definition at line 108 of file sch_base_frame.h.

109  {
110  static wxPoint zero;
111  return zero;
112  }
wxPoint EDA_DRAW_FRAME::GetGridPosition ( const wxPoint aPosition) const
inherited

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

Otherwise, the original positions is returned.

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

Definition at line 556 of file draw_frame.cpp.

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

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

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

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

Definition at line 345 of file draw_frame.h.

References EDA_DRAW_FRAME::m_hotkeysDescrList.

Referenced by PCBNEW_CONTROL::ShowHelp().

345 { return m_hotkeysDescrList; }
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
Definition: draw_frame.h:76
EDA_HOTKEY * LIB_VIEW_FRAME::GetHotKeyDescription ( int  aCommand) const
overridevirtual

>

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

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

Implements EDA_DRAW_FRAME.

Definition at line 840 of file eeschema/hotkeys.cpp.

References GetDescriptorFromCommand().

841 {
842  EDA_HOTKEY* HK_Descr = GetDescriptorFromCommand( aCommand, common_Hotkey_List );
843 
844  if( HK_Descr == NULL )
845  HK_Descr = GetDescriptorFromCommand( aCommand, viewlib_Hotkey_List );
846 
847  return HK_Descr;
848 }
static EDA_HOTKEY * common_Hotkey_List[]
static EDA_HOTKEY * viewlib_Hotkey_List[]
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:57
EDA_HOTKEY * GetDescriptorFromCommand(int aCommand, EDA_HOTKEY **aList)
Function GetDescriptorFromCommand Returns a EDA_HOTKEY* pointer from a hot key identifier.
void EDA_BASE_FRAME::GetKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 525 of file basicframe.cpp.

References ShowAboutDialog().

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

Definition at line 514 of file basicframe.cpp.

References URL_GET_INVOLVED.

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

Definition at line 436 of file basicframe.cpp.

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

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

Definition at line 358 of file wxstruct.h.

References EDA_BASE_FRAME::m_mruPath.

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

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

Function GetNearestGridPosition returns the nearest aGridSize location to aPosition.

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

Definition at line 1182 of file draw_frame.cpp.

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

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

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

Implements EDA_DRAW_FRAME.

Definition at line 94 of file sch_base_frame.cpp.

References SCH_SCREEN::GetPageSettings(), and SCH_BASE_FRAME::GetScreen().

Referenced by DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL(), DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF(), and DIALOG_PLOT_SCHEMATIC::plotOneSheetPS().

95 {
96  return GetScreen()->GetPageSettings();
97 }
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
const PAGE_INFO & GetPageSettings() const
const wxSize SCH_BASE_FRAME::GetPageSizeIU ( ) const
overridevirtualinherited

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

Implements EDA_DRAW_FRAME.

Definition at line 100 of file sch_base_frame.cpp.

References SCH_SCREEN::GetPageSettings(), and SCH_BASE_FRAME::GetScreen().

101 {
102  // GetSizeIU is compile time dependent:
103  return GetScreen()->GetPageSettings().GetSizeIU();
104 }
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
const PAGE_INFO & GetPageSettings() const
int SCH_BASE_FRAME::GetRepeatDeltaLabel ( ) const
inlineinherited
Returns
the increment value of labels like bus members for the repeat command

Definition at line 83 of file sch_base_frame.h.

References SCH_BASE_FRAME::m_repeatDeltaLabel.

Referenced by SCH_EDIT_FRAME::OnPreferencesOptions(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), and LIB_EDIT_FRAME::SaveSettings().

83 { return m_repeatDeltaLabel; }
int m_repeatDeltaLabel
the increment value of labels like bus members when they are repeated
const wxPoint SCH_BASE_FRAME::GetRepeatStep ( ) const
inlineinherited
Returns
the increment value of the position of an item for the repeat command

Definition at line 70 of file sch_base_frame.h.

References SCH_BASE_FRAME::m_repeatStep.

Referenced by SCH_EDIT_FRAME::OnPreferencesOptions(), SCH_EDIT_FRAME::RepeatDrawItem(), and LIB_EDIT_FRAME::SaveSettings().

70 { return m_repeatStep; }
wxPoint m_repeatStep
the increment value of the position of an item when it is repeated
SCH_SCREEN * SCH_BASE_FRAME::GetScreen ( ) const
overridevirtualinherited

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

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

Reimplemented from EDA_DRAW_FRAME.

Reimplemented in SCH_EDIT_FRAME.

Definition at line 78 of file sch_base_frame.cpp.

References EDA_DRAW_FRAME::GetScreen().

Referenced by AddMenusForBlock(), BestZoom(), LIB_EDIT_FRAME::BestZoom(), LIB_EDIT_FRAME::CreateNewLibraryPart(), LIB_EDIT_FRAME::DeleteOnePart(), GeneralControl(), LIB_EDIT_FRAME::GeneralControl(), SCH_BASE_FRAME::GetAuxOrigin(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_BASE_FRAME::GetPageSettings(), SCH_BASE_FRAME::GetPageSizeIU(), SCH_BASE_FRAME::GetTitleBlock(), LIB_EDIT_FRAME::HandleBlockEnd(), LIB_EDIT_FRAME::HandleBlockPlace(), LIB_EDIT_FRAME::LIB_EDIT_FRAME(), LIB_EDIT_FRAME::LoadComponentAndSelectLib(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), LIB_EDIT_FRAME::LoadOneLibraryPart(), LIB_EDIT_FRAME::LoadOneLibraryPartAux(), LIB_EDIT_FRAME::OnCloseWindow(), OnHotKey(), LIB_EDIT_FRAME::OnHotKey(), LIB_EDIT_FRAME::OnImportPart(), LIB_EDIT_FRAME::OnModify(), LIB_EDIT_FRAME::OnOrient(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), LIB_EDIT_FRAME::OnRightClick(), OnSetRelativeOffset(), LIB_EDIT_FRAME::OnUpdateRedo(), LIB_EDIT_FRAME::OnUpdateSaveCurrentLib(), LIB_EDIT_FRAME::OnUpdateUndo(), LIB_EDIT_FRAME::PrintPage(), LIB_EDIT_FRAME::Process_Special_Functions(), LIB_EDIT_FRAME::RedrawActiveWindow(), LIB_EDIT_FRAME::SaveActiveLibrary(), LIB_EDIT_FRAME::SaveCopyInUndoList(), LIB_EDIT_FRAME::SaveOnePart(), SCH_BASE_FRAME::SetAuxOrigin(), SCH_BASE_FRAME::SetPageSettings(), SCH_BASE_FRAME::SetTitleBlock(), LIB_EDIT_FRAME::SVG_PlotComponent(), and SCH_BASE_FRAME::UpdateStatusBar().

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

Reimplemented in SCH_EDIT_FRAME.

Definition at line 120 of file worksheet.cpp.

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

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

Definition at line 1210 of file draw_frame.cpp.

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

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

1211 {
1212  BASE_SCREEN* screen = GetScreen(); // virtual call
1213  return screen->getScrollCenterPosition();
1214 }
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
const wxPoint & getScrollCenterPosition() const
LIB_ALIAS * LIB_VIEW_FRAME::getSelectedAlias ( )
private

Definition at line 252 of file viewlib_frame.cpp.

References PART_LIB::FindAlias(), m_entryName, m_libraryName, and KIWAY_HOLDER::Prj().

Referenced by getSelectedSymbol(), and onUpdateViewDoc().

253 {
254  LIB_ALIAS* alias = NULL;
255 
256  if( !m_libraryName.IsEmpty() && !m_entryName.IsEmpty() )
257  {
258  PART_LIB* lib = Prj().SchLibs()->FindLibrary( m_libraryName );
259 
260  if( lib )
261  alias = lib->FindAlias( m_entryName );
262  }
263 
264  return alias;
265 }
static wxString m_entryName
Part library alias object definition.
static wxString m_libraryName
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
Class PART_LIB is used to load, save, search, and otherwise manipulate part library files...
LIB_ALIAS * FindAlias(const wxString &aName)
Find LIB_ALIAS by aName.
LIB_PART * LIB_VIEW_FRAME::getSelectedSymbol ( )
private

Definition at line 268 of file viewlib_frame.cpp.

References LIB_ALIAS::GetPart(), and getSelectedAlias().

Referenced by onUpdateAlternateBodyStyleButton(), and onUpdateNormalBodyStyleButton().

269 {
270  LIB_PART* symbol = NULL;
271  LIB_ALIAS* alias = getSelectedAlias();
272 
273  if( alias )
274  symbol = alias->GetPart();
275 
276  return symbol;
277 }
Part library alias object definition.
LIB_ALIAS * getSelectedAlias()
Class LIB_PART defines a library part object.
LIB_PART * GetPart() const
Function GetPart gets the shared LIB_PART.
bool EDA_DRAW_FRAME::GetShowBorderAndTitleBlock ( ) const
inlineinherited

Definition at line 293 of file draw_frame.h.

References EDA_DRAW_FRAME::m_showBorderAndTitleBlock.

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

293 { return m_showBorderAndTitleBlock; }
bool m_showBorderAndTitleBlock
True shows the drawing border and title block.
Definition: draw_frame.h:112
bool LIB_VIEW_FRAME::GetShowElectricalType ( void  )
inline

Definition at line 144 of file viewlib_frame.h.

References m_showPinElectricalTypeName.

Referenced by OnShowElectricalType(), OnUpdateElectricalType(), and RedrawActiveWindow().

144 { return m_showPinElectricalTypeName; }
bool m_showPinElectricalTypeName
the option to show the pin electrical name in the component editor
const TITLE_BLOCK & SCH_BASE_FRAME::GetTitleBlock ( ) const
overridevirtualinherited

Implements EDA_DRAW_FRAME.

Definition at line 121 of file sch_base_frame.cpp.

References SCH_BASE_FRAME::GetScreen(), and SCH_SCREEN::GetTitleBlock().

Referenced by DIALOG_PLOT_SCHEMATIC::createPDFFile(), DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL(), DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF(), and DIALOG_PLOT_SCHEMATIC::plotOneSheetPS().

122 {
123  wxASSERT( GetScreen() );
124  return GetScreen()->GetTitleBlock();
125 }
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
const TITLE_BLOCK & GetTitleBlock() const
int EDA_DRAW_FRAME::GetToolId ( ) const
inlineinherited

Definition at line 406 of file draw_frame.h.

References EDA_DRAW_FRAME::m_toolId.

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

406 { return m_toolId; }
int LIB_VIEW_FRAME::GetUnit ( void  )
inline

Definition at line 139 of file viewlib_frame.h.

References m_unit.

Referenced by SCH_BASE_FRAME::SelectComponentFromLibBrowser().

139 { return m_unit; }
static int m_unit
double EDA_DRAW_FRAME::GetZoom ( )
inherited

Function GetZoom.

Returns
The current zoom level.

Definition at line 480 of file draw_frame.cpp.

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

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

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

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

Definition at line 382 of file draw_frame.h.

References EDA_DRAW_FRAME::m_zoomLevelCoeff.

Referenced by ZOOM_MENU::ZOOM_MENU().

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

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

Virtual from the base class

Reimplemented from EDA_DRAW_FRAME.

Definition at line 83 of file sch_base_frame.cpp.

References EDA_DRAW_FRAME::GetZoomLevelIndicator().

84 {
86 }
virtual const wxString GetZoomLevelIndicator() const
Function GetZoomLevelIndicator returns a human readable value which can be displayed as zoom level in...
Definition: draw_frame.cpp:661
bool EDA_DRAW_FRAME::HandleBlockBegin ( wxDC *  aDC,
EDA_KEY  aKey,
const wxPoint aPosition,
int  aExplicitCommand = 0 
)
virtualinherited

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

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

Definition at line 804 of file draw_frame.cpp.

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

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

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

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

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

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

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

Definition at line 644 of file draw_frame.cpp.

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

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

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

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

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

Definition at line 639 of file draw_frame.cpp.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

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

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 376 of file basicframe.cpp.

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

Referenced by EDA_BASE_FRAME::GetKicadHelp().

377 {
378  return Kiface().GetHelpFileName();
379 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
const wxString & GetHelpFileName() const
Function GetHelpFileName returns just the basename portion of the current help file.
Definition: kiface_i.h:119
void EDA_BASE_FRAME::ImportHotkeyConfigFromFile ( EDA_HOTKEY_CONFIG aDescList,
const wxString &  aDefaultShortname 
)
inherited

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

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

Definition at line 737 of file hotkeys_basic.cpp.

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

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

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

Reimplemented in SCH_EDIT_FRAME.

Definition at line 632 of file draw_frame.cpp.

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

Referenced by EDA_DRAW_FRAME::HandleBlockBegin().

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

Function autoSaveRequired returns the auto save status of the application.

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

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 168 of file wxstruct.h.

Referenced by EDA_BASE_FRAME::ProcessEvent().

168 { return false; }
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 163 of file kiway_player.cpp.

References DBG, and KIWAY_PLAYER::m_modal_loop.

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

164 {
165  bool ret = !m_modal_loop;
166 
167  DBG(printf( "%s: ret:%d\n", __func__, ret );)
168 
169  return ret;
170 }
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:247
#define DBG(x)
Definition: fctsys.h:33
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 795 of file draw_frame.h.

References EDA_DRAW_FRAME::m_galCanvasActive.

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_LAYER_WIDGET::AreArbitraryColorsAllowed(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), PCB_EDIT_FRAME::Edit_Zone_Params(), EVT_TOOL(), EVT_UPDATE_UI(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), EDA_DRAW_FRAME::GetCrossHairPosition(), EDA_DRAW_FRAME::GetZoomLevelIndicator(), FOOTPRINT_EDIT_FRAME::Import_Module(), PCB_EDIT_FRAME::ListNetsAndSelect(), FOOTPRINT_EDIT_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), DIALOG_NETLIST::OnCompileRatsnestClick(), PCB_LAYER_WIDGET::OnLayerColorChange(), PCB_BASE_FRAME::OnModify(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick(), PCB_LAYER_WIDGET::OnRenderColorChange(), PCB_LAYER_WIDGET::OnRenderEnable(), EDA_DRAW_FRAME::OnSelectGrid(), EDA_DRAW_FRAME::OnSelectZoom(), EDA_DRAW_FRAME::OnToggleGridState(), PCB_BASE_FRAME::OnUpdateSelectZoom(), PCB_BASE_FRAME::OnUpdateSwitchCanvas(), DIALOG_UPDATE_PCB::PerformUpdate(), PCB_EDIT_FRAME::Process_Config(), PCB_BASE_FRAME::RecalculateAllTracksNetcode(), DIALOG_PAD_PROPERTIES::redraw(), EDA_DRAW_FRAME::RedrawScreen(), EDA_DRAW_FRAME::RedrawScreen2(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), DIALOG_SET_GRID::TransferDataFromWindow(), PCB_BASE_FRAME::UpdateMsgPanel(), FOOTPRINT_VIEWER_FRAME::updateView(), EDA_DRAW_FRAME::WriteHotkeyConfig(), and EDA_DRAW_FRAME::Zoom_Automatique().

795 { return m_galCanvasActive; }
bool m_galCanvasActive
whether to use new GAL engine
Definition: draw_frame.h:65
bool EDA_BASE_FRAME::IsType ( FRAME_T  aType) const
inlineinherited
bool EDA_BASE_FRAME::IsWritable ( const wxFileName &  aFileName)
inherited

Function IsWritable 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 532 of file basicframe.cpp.

References GetChars().

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

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

References KIWAY_HOLDER::m_kiway.

Referenced by SCH_EDIT_FRAME::AppendOneEEProject(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), CVPCB_MAINFRAME::CreateScreenCmp(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_SHIM::DIALOG_SHIM(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers(), LIB_EDIT_FRAME::InstallConfigFrame(), PCB_EDIT_FRAME::InstallModuleOptionsFrame(), KIWAY_PLAYER::language_change(), SCH_SHEET::Load(), CVPCB_MAINFRAME::LoadFootprintFiles(), KIWAY_PLAYER::OnChangeIconsOptions(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnLeftClick(), SCH_BASE_FRAME::OnOpenLibraryViewer(), SCH_EDIT_FRAME::OnSimulate(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard(), SCH_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndLinkFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_EDIT_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::showButtonHandler(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::showButtonHandler(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and DIALOG_EXCHANGE_MODULE::ViewAndSelectFootprint().

61  {
62  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
63  return *m_kiway;
64  }
KIWAY * m_kiway
Definition: kiway_player.h:85
void KIWAY_PLAYER::kiway_express ( KIWAY_EXPRESS aEvent)
protectedinherited

event handler, routes to derivative specific virtual KiwayMailIn()

Definition at line 188 of file kiway_player.cpp.

References KIWAY_EXPRESS::Command(), KIWAY_EXPRESS::GetPayload(), KIWAY_PLAYER::KiwayMailIn(), and name.

189 {
190  // logging support
191 #if defined(DEBUG)
192  const char* class_name = typeid( this ).name();
193 
194  printf( "%s: received cmd:%d pay:'%s'\n", class_name,
195  aEvent.Command(), aEvent.GetPayload().c_str() );
196 #endif
197 
198  KiwayMailIn( aEvent ); // call the virtual, override in derived.
199 }
virtual void KiwayMailIn(KIWAY_EXPRESS &aEvent)
Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.
const std::string & GetPayload()
Function Payload returns the payload, which can be any text but it typicall self identifying s-expres...
Definition: kiway_express.h:62
const char * name
MAIL_T Command()
Function Command returns the MAIL_T associated with this mail.
Definition: kiway_express.h:52
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 SCH_EDIT_FRAME, PCB_EDIT_FRAME, and CVPCB_MAINFRAME.

Definition at line 75 of file kiway_player.cpp.

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

76 {
77  // override this in derived classes.
78 }
void KIWAY_PLAYER::language_change ( wxCommandEvent &  event)
protectedinherited

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

Definition at line 202 of file kiway_player.cpp.

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

203 {
204  int id = event.GetId();
205 
206  // tell all the KIWAY_PLAYERs about the language change.
207  Kiway().SetLanguage( id );
208 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
VTBL_ENTRY void SetLanguage(int aLanguage)
Function SetLanguage changes the language and then calls ShowChangedLanguage() on all KIWAY_PLAYERs...
Definition: kiway.cpp:396
wxString EDA_DRAW_FRAME::LengthDoubleToString ( double  aValue,
bool  aConvertToMils = false 
) const
inherited

Function LengthDoubleToString is a helper to convert the double value aValue to a string in inches or mm according to the current user units setting.

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

Definition at line 798 of file draw_frame.cpp.

References LengthDoubleToString().

Referenced by ShowNewTrackWhenMovingCursor().

799 {
800  return ::LengthDoubleToString( aValue, aConvertToMils );
801 }
wxString LengthDoubleToString(double aValue, bool aConvertToMils)
Function LengthDoubleToString is a helper to convert the double length aValue to a string in inches...
Definition: base_units.cpp:122
void LIB_VIEW_FRAME::LoadSettings ( wxConfigBase *  aCfg)
overridevirtual

Function LoadSettings loads common frame parameters from a configuration file.

Don't forget to call the base method or your frames won't remember their positions and sizes.

Reimplemented from EDA_BASE_FRAME.

Definition at line 628 of file viewlib_frame.cpp.

References CMPLIST_WIDTH_KEY, CMPVIEW_SHOW_PINELECTRICALTYPE_KEY, GetLayerColor(), LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_GRID, LIBLIST_WIDTH_KEY, EDA_DRAW_FRAME::LoadSettings(), m_cmpListWidth, EDA_BASE_FRAME::m_FrameSize, m_libListWidth, m_showPinElectricalTypeName, SCH_BASE_FRAME::SetDrawBgColor(), and EDA_DRAW_FRAME::SetGridColor().

629 {
631 
634 
635  aCfg->Read( LIBLIST_WIDTH_KEY, &m_libListWidth, 150 );
636  aCfg->Read( CMPLIST_WIDTH_KEY, &m_cmpListWidth, 150 );
637  aCfg->Read( CMPLIST_WIDTH_KEY, &m_cmpListWidth, 150 );
639 
640  // Set parameters to a reasonable value.
641  if( m_libListWidth > m_FrameSize.x/2 )
643 
644  if( m_cmpListWidth > m_FrameSize.x/2 )
646 }
virtual void SetGridColor(COLOR4D aColor)
Function SetGridColor() , virtual.
Definition: draw_frame.h:444
#define LIBLIST_WIDTH_KEY
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:166
bool m_showPinElectricalTypeName
the option to show the pin electrical name in the component editor
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
Definition: draw_frame.cpp:686
#define CMPVIEW_SHOW_PINELECTRICALTYPE_KEY
void SetDrawBgColor(COLOR4D aColor) override
wxSize m_FrameSize
Definition: wxstruct.h:130
#define CMPLIST_WIDTH_KEY
bool EDA_DRAW_FRAME::LockFile ( const wxString &  aFileName)
inherited

Function LockFile marks a schematic file as being in use.

Use ReleaseFile() to undo this.

Parameters
aFileName= full path to the file.
Returns
false if the file was already locked, true otherwise.

Definition at line 235 of file draw_frame.cpp.

References EDA_DRAW_FRAME::m_file_checker.

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

236 {
237  m_file_checker = ::LockFile( aFileName );
238 
239  return bool( m_file_checker );
240 }
std::unique_ptr< wxSingleInstanceChecker > m_file_checker
prevents opening same file multiple times.
Definition: draw_frame.h:74
bool LockFile(const wxString &aFileName)
Function LockFile marks a schematic file as being in use.
Definition: draw_frame.cpp:235
void LIB_VIEW_FRAME::OnActivate ( wxActivateEvent &  event)
overrideprivatevirtual

Function OnActivate is called when the frame frame is activate to reload the libraries and component lists that can be changed by the schematic editor or the library editor.

Reimplemented from EDA_DRAW_FRAME.

Definition at line 666 of file viewlib_frame.cpp.

References DisplayLibInfos(), m_libList, EDA_DRAW_FRAME::OnActivate(), and ReCreateListLib().

667 {
669 
670  if( m_libList )
671  ReCreateListLib();
672 
673  DisplayLibInfos();
674 }
void DisplayLibInfos()
Definition: viewlibs.cpp:172
wxListBox * m_libList
virtual void OnActivate(wxActivateEvent &event)
Function OnActivate (virtual) is called when activating the frame.
Definition: draw_frame.cpp:257
void ReCreateListLib()
Function ReCreateListLib.
void EDA_BASE_FRAME::onAutoSaveTimer ( wxTimerEvent &  aEvent)
protectedinherited

Function onAutoSaveTimer handles the auto save timer event.

Definition at line 224 of file basicframe.cpp.

References EDA_BASE_FRAME::doAutoSave(), EDA_BASE_FRAME::m_autoSaveInterval, and EDA_BASE_FRAME::m_autoSaveTimer.

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

225 {
226  if( !doAutoSave() )
227  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
228 }
virtual bool doAutoSave()
Function doAutoSave should be overridden by the derived class to handle the auto save feature...
Definition: basicframe.cpp:231
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
Definition: wxstruct.h:151
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:148
void KIWAY_PLAYER::OnChangeIconsOptions ( wxCommandEvent &  event)
overrideprotectedvirtualinherited

Function OnChangeIconsOptions is an event handler called on a icons options in menus or toolbars menu selection.

Reimplemented from EDA_BASE_FRAME.

Definition at line 211 of file kiway_player.cpp.

References KIWAY_HOLDER::Kiway(), EDA_BASE_FRAME::OnChangeIconsOptions(), and KIWAY::ShowChangedIcons().

212 {
215 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
virtual void OnChangeIconsOptions(wxCommandEvent &event)
Function OnChangeIconsOptions Selects the current icons options in menus (or toolbars) in Kicad (the ...
Definition: basicframe.cpp:660
VTBL_ENTRY void ShowChangedIcons()
Function ShowChangedIcons Calls ShowChangedIcons() on all KIWAY_PLAYERs.
Definition: kiway.cpp:432
void LIB_VIEW_FRAME::OnCloseWindow ( wxCloseEvent &  Event)

Definition at line 314 of file viewlib_frame.cpp.

References KIWAY_PLAYER::Destroy(), KIWAY_PLAYER::DismissModal(), KIWAY_PLAYER::IsDismissed(), and KIWAY_PLAYER::IsModal().

315 {
316  if( !IsModal() )
317  {
318  Destroy();
319  }
320  else if( !IsDismissed() )
321  {
322  // only dismiss modal frame if not already dismissed.
323  DismissModal( false );
324 
325  // Modal frame will be destroyed by the calling function.
326  }
327 }
bool IsDismissed()
Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been...
bool IsModal()
Definition: kiway_player.h:216
void DismissModal(bool aRetVal, const wxString &aResult=wxEmptyString)
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void EDA_DRAW_FRAME::OnEraseBackground ( wxEraseEvent &  SizeEvent)
inherited
bool LIB_VIEW_FRAME::OnHotKey ( wxDC *  aDC,
int  aHotKey,
const wxPoint aPosition,
EDA_ITEM aItem = NULL 
)
overridevirtual

Function OnHotKey handle hot key events.

<p? Some commands are relative to the item under the mouse cursor. Commands are case insensitive

Reimplemented from EDA_DRAW_FRAME.

Definition at line 851 of file eeschema/hotkeys.cpp.

References DisplayHotkeyList(), EDA_DRAW_FRAME::GetCrossHairPosition(), GetDescriptorFromHotkey(), SCH_BASE_FRAME::GetScreen(), HK_HELP, HK_LEFT_CLICK, HK_LEFT_DCLICK, HK_NOT_FOUND, HK_RESET_LOCAL_COORD, HK_ZOOM_AUTO, HK_ZOOM_CENTER, HK_ZOOM_IN, HK_ZOOM_OUT, HK_ZOOM_REDRAW, ID_POPUP_ZOOM_CENTER, ID_POPUP_ZOOM_IN, ID_POPUP_ZOOM_OUT, ID_ZOOM_PAGE, ID_ZOOM_REDRAW, EDA_HOTKEY::m_Idcommand, BASE_SCREEN::m_O_Curseur, OnLeftClick(), and EDA_DRAW_FRAME::OnLeftDClick().

Referenced by GeneralControl().

852 {
853  if( aHotKey == 0 )
854  return false;
855 
856  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
857  cmd.SetEventObject( this );
858 
859  /* Convert lower to upper case (the usual toupper function has problem with non ascii
860  * codes like function keys */
861  if( (aHotKey >= 'a') && (aHotKey <= 'z') )
862  aHotKey += 'A' - 'a';
863 
865 
866  if( HK_Descr == NULL )
867  HK_Descr = GetDescriptorFromHotkey( aHotKey, viewlib_Hotkey_List );
868 
869  if( HK_Descr == NULL )
870  return false;
871 
872  switch( HK_Descr->m_Idcommand )
873  {
874  default:
875  case HK_NOT_FOUND:
876  return false;
877 
878  case HK_HELP: // Display Current hotkey list
880  break;
881 
882  case HK_RESET_LOCAL_COORD: // set local (relative) coordinate origin
884  break;
885 
886  case HK_LEFT_CLICK:
887  OnLeftClick( aDC, aPosition );
888  break;
889 
890  case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events
891  OnLeftClick( aDC, aPosition );
892  OnLeftDClick( aDC, aPosition );
893  break;
894 
895  case HK_ZOOM_IN:
896  cmd.SetId( ID_POPUP_ZOOM_IN );
897  GetEventHandler()->ProcessEvent( cmd );
898  break;
899 
900  case HK_ZOOM_OUT:
901  cmd.SetId( ID_POPUP_ZOOM_OUT );
902  GetEventHandler()->ProcessEvent( cmd );
903  break;
904 
905  case HK_ZOOM_REDRAW:
906  cmd.SetId( ID_ZOOM_REDRAW );
907  GetEventHandler()->ProcessEvent( cmd );
908  break;
909 
910  case HK_ZOOM_CENTER:
911  cmd.SetId( ID_POPUP_ZOOM_CENTER );
912  GetEventHandler()->ProcessEvent( cmd );
913  break;
914 
915  case HK_ZOOM_AUTO:
916  cmd.SetId( ID_ZOOM_PAGE );
917  GetEventHandler()->ProcessEvent( cmd );
918  break;
919  }
920 
921  return true;
922 }
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
void OnLeftClick(wxDC *DC, const wxPoint &MousePos) override
Definition: viewlibs.cpp:161
wxPoint m_O_Curseur
Relative Screen cursor coordinate (on grid) in user units.
EDA_HOTKEY * GetDescriptorFromHotkey(int aKey, EDA_HOTKEY **aList)
Function GetDescriptorFromHotkey Return a EDA_HOTKEY * pointer from a key code for OnHotKey() functio...
void DisplayHotkeyList(EDA_BASE_FRAME *aFrame, struct EDA_HOTKEY_CONFIG *aDescList)
Function DisplayHotkeyList Displays the current hotkey list.
static EDA_HOTKEY * common_basic_Hotkey_List[]
static EDA_HOTKEY * viewlib_Hotkey_List[]
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:57
struct EDA_HOTKEY_CONFIG g_Viewlib_Hokeys_Descr[]
virtual void OnLeftDClick(wxDC *DC, const wxPoint &MousePos)
Definition: draw_frame.cpp:492
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
void LIB_VIEW_FRAME::OnLeftClick ( wxDC *  DC,
const wxPoint MousePos 
)
overridevirtual

Implements EDA_DRAW_FRAME.

Definition at line 161 of file viewlibs.cpp.

Referenced by OnHotKey().

162 {
163 }
void EDA_DRAW_FRAME::OnLeftDClick ( wxDC *  DC,
const wxPoint MousePos 
)
virtualinherited
void EDA_DRAW_FRAME::OnMenuOpen ( wxMenuEvent &  event)
inherited

Definition at line 266 of file draw_frame.cpp.

References EDA_DRAW_FRAME::m_canvas, and EDA_DRAW_PANEL::SetCanStartBlock().

267 {
268  if( m_canvas )
269  m_canvas->SetCanStartBlock( -1 );
270 
271  event.Skip();
272 }
void SetCanStartBlock(int aStartBlock)
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
void EDA_DRAW_FRAME::OnMouseEvent ( wxMouseEvent &  event)
inherited

Definition at line 486 of file draw_frame.cpp.

487 {
488  event.Skip();
489 }
void SCH_BASE_FRAME::OnOpenLibraryViewer ( wxCommandEvent &  event)
protectedinherited

Function OnOpenLibraryViewer Open the library viewer only to browse library contents.

If the viewed is already opened from this, raise the viewer If the viewed is already opened from an other window, close it and reopen

Definition at line 51 of file sch_base_frame.cpp.

References FRAME_SCH_VIEWER, KIWAY_HOLDER::Kiway(), EDA_DRAW_FRAME::m_canvas, KIWAY::Player(), and EDA_DRAW_FRAME::PushPreferences().

52 {
53  LIB_VIEW_FRAME* viewlibFrame = (LIB_VIEW_FRAME*) Kiway().Player( FRAME_SCH_VIEWER, true );
54 
55  viewlibFrame->PushPreferences( m_canvas );
56 
57  // On Windows, Raise() does not bring the window on screen, when iconized
58  if( viewlibFrame->IsIconized() )
59  viewlibFrame->Iconize( false );
60 
61  viewlibFrame->Show( true );
62  viewlibFrame->Raise();
63 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
void PushPreferences(const EDA_DRAW_PANEL *aParentCanvas)
Function PushPreferences Pushes a few preferences from a parent window to a child window...
Definition: draw_frame.cpp:787
Component library viewer main window.
Definition: viewlib_frame.h:49
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, KIWAY_PLAYER *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:302
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
bool LIB_VIEW_FRAME::OnRightClick ( const wxPoint MousePos,
wxMenu *  PopMenu 
)
overrideprivatevirtual

Implements EDA_DRAW_FRAME.

Definition at line 166 of file viewlibs.cpp.

167 {
168  return true;
169 }
void EDA_DRAW_FRAME::OnSelectGrid ( wxCommandEvent &  event)
virtualinherited

Command event handler for selecting grid sizes.

All commands that set the grid size should eventually end up here. This is where the application setting is saved. If you override this method, make sure you call down to the base class.

Parameters
event- Command event passed by selecting grid size from the grid size combobox on the toolbar.

Definition at line 400 of file draw_frame.cpp.

References EDA_DRAW_FRAME::GetToolManager(), ID_POPUP_GRID_LEVEL_100, ID_POPUP_GRID_LEVEL_1000, EDA_DRAW_FRAME::IsGalCanvasActive(), EDA_DRAW_FRAME::m_canvas, EDA_DRAW_FRAME::m_gridSelectBox, EDA_DRAW_PANEL::Refresh(), TOOL_MANAGER::RunAction(), and EDA_DRAW_FRAME::SetPresetGrid().

Referenced by PCB_BASE_FRAME::SetFastGrid1(), PCB_BASE_FRAME::SetFastGrid2(), PCB_BASE_FRAME::SetNextGrid(), and PCB_BASE_FRAME::SetPrevGrid().

401 {
402  int* clientData;
403  int eventId = ID_POPUP_GRID_LEVEL_100;
404 
405  if( event.GetEventType() == wxEVT_CHOICE )
406  {
407  if( m_gridSelectBox == NULL ) // Should not happen
408  return;
409 
410  /*
411  * Don't use wxCommandEvent::GetClientData() here. It always
412  * returns NULL in GTK. This solution is not as elegant but
413  * it works.
414  */
415  int index = m_gridSelectBox->GetSelection();
416  wxASSERT( index != wxNOT_FOUND );
417  clientData = (int*) m_gridSelectBox->wxItemContainer::GetClientData( index );
418 
419  if( clientData != NULL )
420  eventId = *clientData;
421  }
422  else
423  {
424  eventId = event.GetId();
425  }
426 
427  int idx = eventId - ID_POPUP_GRID_LEVEL_1000;
428 
429  // Notify GAL
430  TOOL_MANAGER* mgr = GetToolManager();
431 
432  if( mgr && IsGalCanvasActive() )
433  {
434  mgr->RunAction( "common.Control.gridPreset", true, idx );
435  }
436  else
437  SetPresetGrid( idx );
438 
439  m_canvas->Refresh();
440 }
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
wxChoice * m_gridSelectBox
Choice box to choose the grid size.
Definition: draw_frame.h:115
Class TOOL_MANAGER.
Definition: tool_manager.h:49
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:795
void SetPresetGrid(int aIndex)
Function SetPresetGrid() changes the grid size to one of the preset values.
Definition: draw_frame.cpp:595
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
TOOL_MANAGER * GetToolManager() const
Function GetToolManager returns the tool manager instance, if any.
Definition: draw_frame.h:810
void LIB_VIEW_FRAME::onSelectNextSymbol ( wxCommandEvent &  aEvent)
private

Definition at line 87 of file viewlibs.cpp.

References ID_LIBVIEW_CMP_LIST, m_cmpList, and EDA_BASE_FRAME::ProcessEvent().

88 {
89  wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_CMP_LIST );
90  int ii = m_cmpList->GetSelection();
91 
92  // Select the next symbol or stop at the end of the list.
93  if( ii != wxNOT_FOUND || ii != (int)m_cmpList->GetCount() - 1 )
94  ii += 1;
95 
96  m_cmpList->SetSelection( ii );
97  ProcessEvent( evt );
98 }
wxListBox * m_cmpList
bool ProcessEvent(wxEvent &aEvent) override
Function ProcessEvent overrides the default process event handler to implement the auto save feature...
Definition: basicframe.cpp:166
void EDA_BASE_FRAME::OnSelectPreferredEditor ( wxCommandEvent &  event)
virtualinherited

Function OnSelectPreferredEditor Open a dialog to select the editor that will used in KiCad to edit or display files (reports ...

) The full filename editor is saved in configuration (global params)

Definition at line 497 of file basicframe.cpp.

References PGM_BASE::AskUserForPreferredEditor(), PGM_BASE::GetEditorName(), Pgm(), and PGM_BASE::SetEditorName().

498 {
499  // Ask for the current editor and instruct GetEditorName() to not show
500  // unless we pass false as argument.
501  wxString editorname = Pgm().GetEditorName( false );
502 
503  // Ask the user to select a new editor, but suggest the current one as the default.
504  editorname = Pgm().AskUserForPreferredEditor( editorname );
505 
506  // If we have a new editor name request it to be copied to m_editor_name and saved
507  // to the preferences file. If the user cancelled the dialog then the previous
508  // value will be retained.
509  if( !editorname.IsEmpty() )
510  Pgm().SetEditorName( editorname );
511 }
VTBL_ENTRY void SetEditorName(const wxString &aFileName)
Definition: pgm_base.cpp:328
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
VTBL_ENTRY const wxString AskUserForPreferredEditor(const wxString &aDefaultEditor=wxEmptyString)
Shows a dialog that instructs the user to select a new preferred editor.
Definition: pgm_base.cpp:373
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:336
void LIB_VIEW_FRAME::onSelectPreviousSymbol ( wxCommandEvent &  aEvent)
private

Definition at line 101 of file viewlibs.cpp.

References ID_LIBVIEW_CMP_LIST, m_cmpList, and EDA_BASE_FRAME::ProcessEvent().

102 {
103  wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_CMP_LIST );
104  int ii = m_cmpList->GetSelection();
105 
106  // Select the previous symbol or stop at the beginning of list.
107  if( ii != wxNOT_FOUND && ii != 0 )
108  ii -= 1;
109 
110  m_cmpList->SetSelection( ii );
111  ProcessEvent( evt );
112 }
wxListBox * m_cmpList
bool ProcessEvent(wxEvent &aEvent) override
Function ProcessEvent overrides the default process event handler to implement the auto save feature...
Definition: basicframe.cpp:166
void LIB_VIEW_FRAME::OnSelectSymbol ( wxCommandEvent &  aEvent)
Todo:
: The unit selection gets reset to 1 by SetSelectedComponent() so the unit selection feature of the choose symbol dialog doesn't work.

Definition at line 47 of file viewlibs.cpp.

References CMP_TREE_MODEL_ADAPTER::Create(), LIB_ALIAS::GetLib(), LIB_ALIAS::GetName(), PART_LIB::GetName(), DIALOG_CHOOSE_COMPONENT::GetSelectedAlias(), m_convert, m_entryName, m_libraryName, m_unit, KIWAY_HOLDER::Prj(), SetSelectedComponent(), SetSelectedLibrary(), and DIALOG_SHIM::ShowQuasiModal().

48 {
49  wxString dialogTitle;
50  PART_LIBS* libs = Prj().SchLibs();
51 
52  // Container doing search-as-you-type.
53  auto adapter( CMP_TREE_MODEL_ADAPTER::Create( libs ) );
54 
55  for( PART_LIB& lib : *libs )
56  {
57  adapter->AddLibrary( lib );
58  }
59 
60  dialogTitle.Printf( _( "Choose Component (%d items loaded)" ),
61  adapter->GetComponentsCount() );
62  DIALOG_CHOOSE_COMPONENT dlg( this, dialogTitle, adapter, m_convert, false );
63 
64  if( dlg.ShowQuasiModal() == wxID_CANCEL )
65  return;
66 
69  LIB_ALIAS* const alias = dlg.GetSelectedAlias( &m_unit );
70 
71  if( !alias || !alias->GetLib() )
72  return;
73 
74  if( m_libraryName == alias->GetLib()->GetName() )
75  {
76  if( m_entryName != alias->GetName() )
77  SetSelectedComponent( alias->GetName() );
78  }
79  else
80  {
81  m_entryName = alias->GetName();
82  SetSelectedLibrary( alias->GetLib()->GetName() );
83  }
84 }
static int m_unit
static int m_convert
static wxString m_entryName
Part library alias object definition.
static wxString m_libraryName
PART_LIB * GetLib()
void SetSelectedComponent(const wxString &aComponentName)
Set the selected component.
static PTR Create(PART_LIBS *aLibs)
Factory function: create a model adapter in a reference-counting container.
Dialog class to select a component from the libraries.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
const wxString GetName() const
Return the file name without path or extension.
Class PART_LIBS is a collection of PART_LIBs.
const wxString & GetName() const
Class PART_LIB is used to load, save, search, and otherwise manipulate part library files...
void SetSelectedLibrary(const wxString &aLibName)
Set the selected library in the library window.
void LIB_VIEW_FRAME::onSelectSymbolBodyStyle ( wxCommandEvent &  aEvent)
private

Definition at line 129 of file viewlibs.cpp.

References ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, EDA_DRAW_FRAME::m_canvas, m_convert, and EDA_DRAW_PANEL::Refresh().

130 {
131  int id = aEvent.GetId();
132 
133  switch( id )
134  {
135  default:
137  m_convert = 1;
138  break;
139 
141  m_convert = 2;
142  break;
143  }
144 
145  m_canvas->Refresh();
146 }
static int m_convert
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
void LIB_VIEW_FRAME::onSelectSymbolUnit ( wxCommandEvent &  aEvent)
private

Definition at line 149 of file viewlibs.cpp.

References EDA_DRAW_FRAME::m_canvas, m_selpartBox, m_unit, and EDA_DRAW_PANEL::Refresh().

150 {
151  int ii = m_selpartBox->GetCurrentSelection();
152 
153  if( ii < 0 )
154  return;
155 
156  m_unit = ii + 1;
157  m_canvas->Refresh();
158 }
static int m_unit
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
wxComboBox * m_selpartBox
void EDA_DRAW_FRAME::OnSelectUnits ( wxCommandEvent &  aEvent)
inherited

Definition at line 295 of file draw_frame.cpp.

References g_UserUnit, INCHES, MILLIMETRES, and EDA_DRAW_FRAME::unitsChangeRefresh().

296 {
297  if( aEvent.GetId() == ID_TB_OPTIONS_SELECT_UNIT_MM && g_UserUnit != MILLIMETRES )
298  {
301  }
302  else if( aEvent.GetId() == ID_TB_OPTIONS_SELECT_UNIT_INCH && g_UserUnit != INCHES )
303  {
304  g_UserUnit = INCHES;
306  }
307 }
EDA_DRAW_FRAME::OnSelectGrid ID_TB_OPTIONS_SELECT_UNIT_INCH
Definition: draw_frame.cpp:121
Definition: common.h:145
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
virtual void unitsChangeRefresh()
Function unitsChangeRefresh is called when when the units setting has changed to allow for any derive...
Definition: draw_frame.cpp:243
void EDA_DRAW_FRAME::OnSelectZoom ( wxCommandEvent &  event)
virtualinherited

Functions OnSelectZoom sets the zoom factor when selected by the zoom list box in the main tool bar.

Note
List position 0 is fit to page List position >= 1 = zoom (1 to zoom max) Last list position is custom zoom not in zoom list.

Definition at line 443 of file draw_frame.cpp.

References EDA_DRAW_FRAME::GetScreen(), EDA_DRAW_FRAME::GetScrollCenterPosition(), EDA_DRAW_FRAME::GetToolManager(), EDA_DRAW_FRAME::GetZoom(), EDA_DRAW_FRAME::IsGalCanvasActive(), BASE_SCREEN::m_ZoomList, EDA_DRAW_FRAME::m_zoomSelectBox, EDA_DRAW_FRAME::RedrawScreen(), TOOL_MANAGER::RunAction(), BASE_SCREEN::SetZoom(), EDA_DRAW_FRAME::UpdateStatusBar(), and EDA_DRAW_FRAME::Zoom_Automatique().

444 {
445  if( m_zoomSelectBox == NULL )
446  return; // Should not happen!
447 
448  int id = m_zoomSelectBox->GetCurrentSelection();
449 
450  if( id < 0 || !( id < (int)m_zoomSelectBox->GetCount() ) )
451  return;
452 
453  if( id == 0 ) // Auto zoom (Fit in Page)
454  {
455  Zoom_Automatique( true );
456  }
457  else
458  {
459  id--;
460  double selectedZoom = GetScreen()->m_ZoomList[id];
461 
462  if( GetScreen()->GetZoom() == selectedZoom )
463  return;
464 
465  GetScreen()->SetZoom( selectedZoom );
467  }
468 
469  // Notify GAL
470  TOOL_MANAGER* mgr = GetToolManager();
471 
472  if( mgr && IsGalCanvasActive() )
473  {
474  mgr->RunAction( "common.Control.zoomPreset", true, id );
475  UpdateStatusBar();
476  }
477 }
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
const wxPoint & GetScrollCenterPosition() const
Class TOOL_MANAGER.
Definition: tool_manager.h:49
void Zoom_Automatique(bool aWarpPointer)
Function Zoom_Automatique redraws the screen with best zoom level and the best centering that shows a...
Definition: zoom.cpp:77
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
wxChoice * m_zoomSelectBox
Choice box to choose the zoom value.
Definition: draw_frame.h:118
double GetZoom()
Function GetZoom.
Definition: draw_frame.cpp:480
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:795
bool SetZoom(double iu_per_du)
Function SetZoom adjusts the current zoom factor.
void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
Function RedrawScreen redraws the entire screen area by updating the scroll bars and mouse pointer in...
Definition: zoom.cpp:46
TOOL_MANAGER * GetToolManager() const
Function GetToolManager returns the tool manager instance, if any.
Definition: draw_frame.h:810
virtual void UpdateStatusBar()
Function UpdateStatusBar updates the status bar information.
Definition: draw_frame.cpp:650
std::vector< double > m_ZoomList
standard zoom (i.e. scale) coefficients.
void LIB_VIEW_FRAME::OnSetRelativeOffset ( wxCommandEvent &  event)

Definition at line 339 of file viewlib_frame.cpp.

References EDA_DRAW_FRAME::GetCrossHairPosition(), SCH_BASE_FRAME::GetScreen(), BASE_SCREEN::m_O_Curseur, and SCH_BASE_FRAME::UpdateStatusBar().

340 {
342  UpdateStatusBar();
343 }
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
wxPoint m_O_Curseur
Relative Screen cursor coordinate (on grid) in user units.
void UpdateStatusBar() override
Function UpdateStatusBar updates the status bar information.
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
void LIB_VIEW_FRAME::OnShowElectricalType ( wxCommandEvent &  event)

Definition at line 346 of file viewlib_frame.cpp.

References GetShowElectricalType(), EDA_DRAW_FRAME::m_canvas, EDA_DRAW_PANEL::Refresh(), and SetShowElectricalType().

347 {
349  m_canvas->Refresh();
350 }
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
void SetShowElectricalType(bool aShow)
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
bool GetShowElectricalType()
void LIB_VIEW_FRAME::OnSize ( wxSizeEvent &  event)
overridevirtual

Function OnSize recalculates the size of toolbars and display panel when the frame size changes.

Reimplemented from EDA_DRAW_FRAME.

Definition at line 330 of file viewlib_frame.cpp.

References EDA_BASE_FRAME::m_auimgr.

331 {
332  if( m_auimgr.GetManagedWindow() )
333  m_auimgr.Update();
334 
335  SizeEv.Skip();
336 }
wxAuiManager m_auimgr
Definition: wxstruct.h:139
void EDA_DRAW_FRAME::OnSockRequest ( wxSocketEvent &  evt)
inherited

Definition at line 75 of file eda_dde.cpp.

References EDA_DRAW_FRAME::ExecuteRemoteCommand(), and IPC_BUF_SIZE.

76 {
77  size_t len;
78  wxSocketBase* sock = evt.GetSocket();
79 
80  switch( evt.GetSocketEvent() )
81  {
82  case wxSOCKET_INPUT:
83  sock->Read( client_ipc_buffer, 1 );
84 
85  if( sock->LastCount() == 0 )
86  break; // No data, occurs on opening connection
87 
88  sock->Read( client_ipc_buffer + 1, IPC_BUF_SIZE - 2 );
89  len = 1 + sock->LastCount();
90  client_ipc_buffer[len] = 0;
92  break;
93 
94  case wxSOCKET_LOST:
95  return;
96  break;
97 
98  default:
99  wxPrintf( wxT( "EDA_DRAW_FRAME::OnSockRequest() error: Invalid event !" ) );
100  break;
101  }
102 }
#define IPC_BUF_SIZE
Definition: eda_dde.cpp:39
static char client_ipc_buffer[IPC_BUF_SIZE]
Definition: eda_dde.cpp:40
virtual void ExecuteRemoteCommand(const char *cmdline)
Execute a remote command send via a socket to the application, port KICAD_PCB_PORT_SERVICE_NUMBER (cu...
Definition: draw_frame.h:320
void EDA_DRAW_FRAME::OnSockRequestServer ( wxSocketEvent &  evt)
inherited

Definition at line 107 of file eda_dde.cpp.

References ID_EDA_SOCKET_EVENT.

108 {
109  wxSocketBase* sock2;
110  wxSocketServer* server = (wxSocketServer*) evt.GetSocket();
111 
112  sock2 = server->Accept();
113 
114  if( sock2 == NULL )
115  return;
116 
117  sock2->Notify( true );
118  sock2->SetEventHandler( *this, ID_EDA_SOCKET_EVENT );
119  sock2->SetNotify( wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG );
120 }
void EDA_DRAW_FRAME::OnToggleCrossHairStyle ( wxCommandEvent &  aEvent)
inherited

Definition at line 310 of file draw_frame.cpp.

References EDA_DRAW_PANEL::CrossHairOff(), EDA_DRAW_PANEL::CrossHairOn(), EDA_DRAW_FRAME::GetGalDisplayOptions(), INSTALL_UNBUFFERED_DC, and EDA_DRAW_FRAME::m_canvas.

311 {
313  m_canvas->CrossHairOff( &dc );
314 
315  auto& galOpts = GetGalDisplayOptions();
316  galOpts.m_fullscreenCursor = !galOpts.m_fullscreenCursor;
317  galOpts.NotifyChanged();
318 
319  m_canvas->CrossHairOn( &dc );
320 }
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Function GetGalDisplayOptions Returns a reference to the gal rendering options used by GAL for render...
Definition: draw_frame.h:824
void CrossHairOff(wxDC *DC)
Definition: draw_panel.cpp:253
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
void CrossHairOn(wxDC *DC)
Definition: draw_panel.cpp:260
#define INSTALL_UNBUFFERED_DC(name, parent)
void EDA_DRAW_FRAME::OnToggleGridState ( wxCommandEvent &  aEvent)
inherited

Definition at line 281 of file draw_frame.cpp.

References EDA_DRAW_PANEL_GAL::GetGAL(), EDA_DRAW_FRAME::GetGalCanvas(), EDA_DRAW_PANEL_GAL::GetView(), EDA_DRAW_FRAME::IsGalCanvasActive(), EDA_DRAW_FRAME::IsGridVisible(), EDA_DRAW_FRAME::m_canvas, KIGFX::VIEW::MarkTargetDirty(), EDA_DRAW_PANEL::Refresh(), EDA_DRAW_FRAME::SetGridVisibility(), KIGFX::GAL::SetGridVisibility(), and KIGFX::TARGET_NONCACHED.

282 {
284 
285  if( IsGalCanvasActive() )
286  {
289  }
290 
291  m_canvas->Refresh();
292 }
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
virtual bool IsGridVisible() const
Function IsGridVisible() , virtual.
Definition: draw_frame.h:416
Auxiliary rendering target (noncached)
Definition: definitions.h:42
KIGFX::GAL * GetGAL() const
Function GetGAL() Returns a pointer to the GAL instance used in the panel.
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target 'dirty' flag.
Definition: view.h:575
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:795
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
void SetGridVisibility(bool aVisibility)
Sets the visibility setting of the grid.
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
virtual void SetGridVisibility(bool aVisible)
Function SetGridVisibility() , virtual It may be overloaded by derived classes.
Definition: draw_frame.h:426
void LIB_VIEW_FRAME::onUpdateAlternateBodyStyleButton ( wxUpdateUIEvent &  aEvent)
private

Definition at line 280 of file viewlib_frame.cpp.

References getSelectedSymbol(), LIB_PART::HasConversion(), and m_convert.

281 {
282  LIB_PART* symbol = getSelectedSymbol();
283 
284  aEvent.Enable( symbol && symbol->HasConversion() );
285 
286  if( symbol )
287  aEvent.Check( m_convert > 1 );
288  else
289  aEvent.Check( false );
290 }
static int m_convert
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
LIB_PART * getSelectedSymbol()
Class LIB_PART defines a library part object.
void EDA_DRAW_FRAME::OnUpdateCrossHairStyle ( wxUpdateUIEvent &  aEvent)
inherited

Definition at line 358 of file draw_frame.cpp.

References EDA_DRAW_FRAME::GetGalDisplayOptions().

359 {
360  aEvent.Check( GetGalDisplayOptions().m_fullscreenCursor );
361 }
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Function GetGalDisplayOptions Returns a reference to the gal rendering options used by GAL for render...
Definition: draw_frame.h:824
void LIB_VIEW_FRAME::OnUpdateElectricalType ( wxUpdateUIEvent &  aEvent)
private

Definition at line 353 of file viewlib_frame.cpp.

References GetShowElectricalType().

354 {
355  aEvent.Check( GetShowElectricalType() );
356 }
bool GetShowElectricalType()
void EDA_DRAW_FRAME::OnUpdateGrid ( wxUpdateUIEvent &  aEvent)
inherited

Definition at line 349 of file draw_frame.cpp.

References EDA_DRAW_FRAME::IsGridVisible(), and EDA_DRAW_FRAME::m_optionsToolBar.

350 {
351  wxString tool_tip = IsGridVisible() ? _( "Hide grid" ) : _( "Show grid" );
352 
353  aEvent.Check( IsGridVisible() );
354  m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_GRID, tool_tip );
355 }
virtual bool IsGridVisible() const
Function IsGridVisible() , virtual.
Definition: draw_frame.h:416
wxAuiToolBar * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:125
void LIB_VIEW_FRAME::onUpdateNormalBodyStyleButton ( wxUpdateUIEvent &  aEvent)
private

Definition at line 293 of file viewlib_frame.cpp.

References getSelectedSymbol(), LIB_PART::HasConversion(), and m_convert.

294 {
295  LIB_PART* symbol = getSelectedSymbol();
296 
297  aEvent.Enable( symbol && symbol->HasConversion() );
298 
299  if( symbol )
300  aEvent.Check( m_convert <= 1 );
301  else
302  aEvent.Check( true );
303 }
static int m_convert
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
LIB_PART * getSelectedSymbol()
Class LIB_PART defines a library part object.
void EDA_DRAW_FRAME::OnUpdateRedo ( wxUpdateUIEvent &  aEvent)
inherited

Definition at line 330 of file draw_frame.cpp.

References EDA_DRAW_FRAME::GetScreen().

331 {
332  if( GetScreen() )
333  aEvent.Enable( GetScreen()->GetRedoCommandCount() > 0 );
334 }
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
void EDA_DRAW_FRAME::OnUpdateUndo ( wxUpdateUIEvent &  aEvent)
inherited

Definition at line 323 of file draw_frame.cpp.

References EDA_DRAW_FRAME::GetScreen().

324 {
325  if( GetScreen() )
326  aEvent.Enable( GetScreen()->GetUndoCommandCount() > 0 );
327 }
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
void EDA_DRAW_FRAME::OnUpdateUnits ( wxUpdateUIEvent &  aEvent)
inherited

Definition at line 337 of file draw_frame.cpp.

References EDA_DRAW_FRAME::DisplayUnitsMsg(), g_UserUnit, ID_TB_OPTIONS_SELECT_UNIT_INCH, ID_TB_OPTIONS_SELECT_UNIT_MM, INCHES, and MILLIMETRES.

338 {
339  bool enable;
340 
341  enable = ( ((aEvent.GetId() == ID_TB_OPTIONS_SELECT_UNIT_MM) && (g_UserUnit == MILLIMETRES))
342  || ((aEvent.GetId() == ID_TB_OPTIONS_SELECT_UNIT_INCH) && (g_UserUnit == INCHES)) );
343 
344  aEvent.Check( enable );
345  DisplayUnitsMsg();
346 }
EDA_DRAW_FRAME::OnSelectGrid ID_TB_OPTIONS_SELECT_UNIT_INCH
Definition: draw_frame.cpp:121
void DisplayUnitsMsg()
Function DisplayUnitsMsg displays current unit pane on the status bar.
Definition: draw_frame.cpp:503
Definition: common.h:145
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
void LIB_VIEW_FRAME::onUpdateViewDoc ( wxUpdateUIEvent &  aEvent)
private

Definition at line 306 of file viewlib_frame.cpp.

References LIB_ALIAS::GetDocFileName(), and getSelectedAlias().

307 {
308  LIB_ALIAS* alias = getSelectedAlias();
309 
310  aEvent.Enable( alias && !alias->GetDocFileName().IsEmpty() );
311 }
Part library alias object definition.
LIB_ALIAS * getSelectedAlias()
wxString GetDocFileName() const
void LIB_VIEW_FRAME::onViewSymbolDocument ( wxCommandEvent &  aEvent)
private

Definition at line 115 of file viewlibs.cpp.

References GetAssociatedDocument(), LIB_ALIAS::GetDocFileName(), m_entryName, m_libraryName, and KIWAY_HOLDER::Prj().

116 {
117  LIB_ID id( wxEmptyString, m_entryName );
118  LIB_ALIAS* entry = Prj().SchLibs()->FindLibraryAlias( id, m_libraryName );
119 
120  if( entry && !entry->GetDocFileName().IsEmpty() )
121  {
122  SEARCH_STACK* lib_search = Prj().SchSearchS();
123 
124  GetAssociatedDocument( this, entry->GetDocFileName(), lib_search );
125  }
126 }
static wxString m_entryName
Part library alias object definition.
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, const wxPathList *aPaths)
Function GetAssociatedDocument open a document (file) with the suitable browser.
Definition: eda_doc.cpp:86
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
static wxString m_libraryName
Class LIB_ID.
Definition: lib_id.h:56
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxString GetDocFileName() const
void EDA_DRAW_FRAME::OnZoom ( wxCommandEvent &  event)
virtualinherited

Function OnZoom Called from any zoom event (toolbar , hotkey or popup )

Definition at line 125 of file zoom.cpp.

References EDA_DRAW_FRAME::GetCrossHairPosition(), EDA_DRAW_FRAME::GetScreen(), EDA_DRAW_FRAME::GetScrollCenterPosition(), ID_OFFCENTER_ZOOM_IN, ID_OFFCENTER_ZOOM_OUT, ID_POPUP_CANCEL, ID_POPUP_ZOOM_CENTER, ID_POPUP_ZOOM_IN, ID_POPUP_ZOOM_LEVEL_START, ID_POPUP_ZOOM_OUT, ID_POPUP_ZOOM_PAGE, ID_POPUP_ZOOM_REDRAW, ID_POPUP_ZOOM_SELECT, ID_VIEWER_ZOOM_IN, ID_VIEWER_ZOOM_OUT, ID_VIEWER_ZOOM_PAGE, ID_VIEWER_ZOOM_REDRAW, ID_ZOOM_IN, ID_ZOOM_OUT, ID_ZOOM_PAGE, ID_ZOOM_REDRAW, EDA_DRAW_FRAME::m_canvas, EDA_DRAW_PANEL::MoveCursorToCrossHair(), EDA_DRAW_FRAME::RedrawScreen(), EDA_DRAW_FRAME::RedrawScreen2(), EDA_DRAW_PANEL::Refresh(), BASE_SCREEN::SetNextZoom(), EDA_DRAW_FRAME::SetPresetZoom(), BASE_SCREEN::SetPreviousZoom(), EDA_DRAW_PANEL::ToDeviceXY(), EDA_DRAW_FRAME::UpdateStatusBar(), and EDA_DRAW_FRAME::Zoom_Automatique().

126 {
127  if( m_canvas == NULL )
128  return;
129 
130  int id = event.GetId();
131  bool zoom_at_cursor = false;
132  BASE_SCREEN* screen = GetScreen();
133  wxPoint center = GetScrollCenterPosition();
134 
135  switch( id )
136  {
139  if( screen->SetPreviousZoom() )
140  RedrawScreen2( center );
141  break;
142 
143  case ID_POPUP_ZOOM_IN:
144  zoom_at_cursor = true;
145  center = GetCrossHairPosition();
146 
147  // fall thru
148  case ID_VIEWER_ZOOM_IN:
149  case ID_ZOOM_IN:
150  if( screen->SetPreviousZoom() )
151  RedrawScreen( center, zoom_at_cursor );
152  break;
153 
156  if( screen->SetNextZoom() )
157  RedrawScreen2( center );
158  break;
159 
160  case ID_POPUP_ZOOM_OUT:
161  zoom_at_cursor = true;
162  center = GetCrossHairPosition();
163 
164  // fall thru
165  case ID_VIEWER_ZOOM_OUT:
166  case ID_ZOOM_OUT:
167  if( screen->SetNextZoom() )
168  RedrawScreen( center, zoom_at_cursor );
169  break;
170 
173  case ID_ZOOM_REDRAW:
174  m_canvas->Refresh();
175  break;
176 
178  center = GetCrossHairPosition();
179  RedrawScreen( center, true );
180  break;
181 
182  case ID_POPUP_ZOOM_PAGE:
183  case ID_VIEWER_ZOOM_PAGE:
184  case ID_ZOOM_PAGE:
185  Zoom_Automatique( false );
186  break;
187 
189  break;
190 
191  case ID_POPUP_CANCEL:
193  break;
194 
195  default:
197  }
198 
199  UpdateStatusBar();
200 }
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
wxPoint ToDeviceXY(const wxPoint &pos)
Function ToDeviceXY transforms logical to device coordinates.
Definition: draw_panel.cpp:196
Definition: id.h:232
const wxPoint & GetScrollCenterPosition() const
void MoveCursorToCrossHair()
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
Definition: draw_panel.cpp:348
bool SetPreviousZoom()
bool SetNextZoom()
void Zoom_Automatique(bool aWarpPointer)
Function Zoom_Automatique redraws the screen with best zoom level and the best centering that shows a...
Definition: zoom.cpp:77
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
void SetPresetZoom(int aIndex)
Function SetPresetZoom() changes zoom to one of the preset values.
Definition: zoom.cpp:215
void RedrawScreen2(const wxPoint &posBefore)
Function RedrawScreen2 puts the crosshair back to the screen position it had before zooming...
Definition: zoom.cpp:61
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
Function RedrawScreen redraws the entire screen area by updating the scroll bars and mouse pointer in...
Definition: zoom.cpp:46
virtual void UpdateStatusBar()
Function UpdateStatusBar updates the status bar information.
Definition: draw_frame.cpp:650
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
VTBL_ENTRY bool KIWAY_PLAYER::OpenProjectFiles ( const std::vector< wxString > &  aFileList,
int  aCtl = 0 
)
inlineinherited

Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList.

This is generalized in the direction of worst case. In a typical case aFileList will only hold a single file, like "myboard.kicad_pcb", because any KIWAY_PLAYER is only in one KIWAY and the KIWAY owns the PROJECT. Therefore opening files from multiple projects into the same KIWAY_PLAYER is precluded.

Each derived class should handle this in a way specific to its needs. No filename prompting is done inside here for any file or project. There should be no need to call this with aFileList which is empty. However, calling it with a single filename which does not exist should indicate to the implementor that a new session is being started and that the given name is the desired name for the data file at time of save.

This function does not support "appending". Use a different function for that. Any prior project data tree should be cleared before loading the new stuff.

Therefore, one of the first things an implementation should do is test for existence of the first file in the list, and if it does not exist, treat it as a new session, possibly with a UI notification to that effect.

After loading the window should update its Title as part of this operation. If the KIWAY_PLAYER needs to, it can load the *.pro file as part of this operation.

If the KIWAY_PLAYER cannot load any of the file(s) in the list, then it should say why through some GUI interface, and return false.

Parameters
aFileListincludes files that this frame should open according to the knowledge in the derived wxFrame. In almost every case, the list will have only a single file in it.
aCtlis a set of bit flags ORed together from the set of KICTL_* #defined above.
Returns
bool - true if all requested files were opened OK, else false.

Definition at line 170 of file kiway_player.h.

Referenced by PGM_SINGLE_TOP::MacOpenFile(), SCH_EDIT_FRAME::OnOpenPcbnew(), PGM_SINGLE_TOP::OnPgmInit(), SCH_EDIT_FRAME::OnUpdatePCB(), PCB_EDIT_FRAME::OnUpdatePCBFromSch(), KICAD_MANAGER_FRAME::RunEeschema(), and KICAD_MANAGER_FRAME::RunPcbNew().

171  {
172  // overload me for your wxFrame type.
173 
174  // Any overload should probably do this also:
175  // Prj().MaybeLoadProjectSettings();
176 
177  // Then update the window title.
178 
179  return false;
180  }
bool EDA_BASE_FRAME::PostCommandMenuEvent ( int  evt_type)
inherited

Function PostCommandMenuEvent.

Post a menu event to the frame, which can be used to trigger actions bound to menu items.

Definition at line 645 of file basicframe.cpp.

Referenced by FOOTPRINT_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDuplicateItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItemExact(), and FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem().

646 {
647  if( evt_type != 0 )
648  {
649  wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
650  evt.SetEventObject( this );
651  evt.SetId( evt_type );
652  wxPostEvent( this, evt );
653  return true;
654  }
655 
656  return false;
657 }
void EDA_BASE_FRAME::PrintMsg ( const wxString &  text)
inherited

Definition at line 382 of file basicframe.cpp.

Referenced by SCH_EDIT_FRAME::LoadOneEEFile(), and EDA_DRAW_PANEL::OnMouseEvent().

383 {
384  SetStatusText( text );
385 }
void EDA_DRAW_FRAME::PrintPage ( wxDC *  aDC,
LSET  aPrintMask,
bool  aPrintMirrorMode,
void *  aData = NULL 
)
virtualinherited

Function PrintPage used to print a page Print the page pointed by current screen, set by the calling print function.

Parameters
aDC= wxDC given by the calling print function
aPrintMask= not used here
aPrintMirrorMode= not used here (Set when printing in mirror mode)
aData= a pointer on an auxiliary data (not always used, NULL if not used)

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

Definition at line 394 of file draw_frame.cpp.

Referenced by BOARD_PRINTOUT_CONTROLLER::DrawPage(), and DrawPageOnClipboard().

395 {
396  wxMessageBox( wxT("EDA_DRAW_FRAME::PrintPage() error") );
397 }
PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

Function Prj returns a reference to the PROJECT "associated with" this KIWAY.

Definition at line 34 of file kiway_holder.cpp.

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

Referenced by SCH_EDIT_FRAME::AnnotateComponents(), SCH_EDIT_FRAME::AppendOneEEProject(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), BestZoom(), DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_MODULE_BOARD_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::BrowseAndSelectDocFile(), DIALOG_EXCHANGE_MODULE::BrowseAndSelectFootprint(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_MODULE_MODULE_EDITOR::Cfg3DPath(), DIALOG_MODULE_BOARD_EDITOR::Cfg3DPath(), SCH_EDIT_FRAME::CheckAnnotate(), SCH_SCREEN::CheckComponentsToPartsLinks(), SCH_EDIT_FRAME::ConvertPart(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), SCH_EDIT_FRAME::CreateArchiveLibrary(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), LIB_EDIT_FRAME::DeleteOnePart(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG(), DIALOG_FP_LIB_TABLE::DIALOG_FP_LIB_TABLE(), DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR(), DIALOG_MODULE_MODULE_EDITOR::DIALOG_MODULE_MODULE_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DisplayLibInfos(), SCH_BASE_FRAME::DisplayListComponentsInLib(), PCB_EDIT_FRAME::doAutoSave(), DIALOG_MODULE_MODULE_EDITOR::Edit3DShapeFileName(), DIALOG_MODULE_BOARD_EDITOR::Edit3DShapeFileName(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::ExportToGenCAD(), PCB_EDIT_FRAME::ExportVRML_File(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), NETLIST_DIALOG::GenNetlist(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), LIB_EDIT_FRAME::GetCurPart(), FOOTPRINT_EDIT_FRAME::GetCurrentLib(), FOOTPRINT_EDIT_FRAME::getLibPath(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), DIALOG_BOM::getPluginFileName(), getSelectedAlias(), FP_THREAD_IFACE::GetTable(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers(), DIALOG_MODULE_MODULE_EDITOR::initModeditProperties(), DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties(), LIB_EDIT_FRAME::InstallConfigFrame(), SCH_EDIT_FRAME::InstallConfigFrame(), PCB_EDIT_FRAME::InstallNetlistFrame(), SCH_EDIT_FRAME::IsSearchCacheObsolete(), SCH_EDIT_FRAME::Load_Component(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), DIALOG_BOM_EDITOR::LoadComponents(), CVPCB_MAINFRAME::LoadFootprintFiles(), SCH_EDIT_FRAME::LoadOneEEFile(), LIB_EDIT_FRAME::LoadOneLibraryPart(), LIB_EDIT_FRAME::LoadOneSymbol(), CVPCB_MAINFRAME::LoadProjectFile(), SCH_EDIT_FRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), DIALOG_DRC_CONTROL::makeValidFileNameReport(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick(), DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), LIB_EDIT_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), DIALOG_GENDRILL::OnGenReportFile(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), DIALOG_NETLIST::OnOpenNetlistClick(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_SVG_PRINT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_MODULE_POSITION::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), SCH_EDIT_FRAME::OnRightClick(), DIALOG_BOM::OnRunPlugin(), DIALOG_NETLIST::OnSaveMessagesToFile(), SCH_EDIT_FRAME::OnSaveProject(), DIALOG_SPICE_MODEL::onSelectIcLib(), OnSelectSymbol(), SCH_EDIT_FRAME::OnSelectUnit(), DIALOG_SPICE_MODEL::onSemiSelectLib(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName(), FOOTPRINT_EDIT_FRAME::OnUpdateSelectCurrentLib(), LIB_EDIT_FRAME::OnViewEntryDoc(), onViewSymbolDocument(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_EDITOR_CONTROL::PlaceModule(), SCH_EDIT_FRAME::prepareForNetlist(), SCH_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::ProcessCmpToFootprintLinkFile(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndLinkFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), ReCreateHToolbar(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), ReCreateListCmp(), ReCreateListLib(), RedrawActiveWindow(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SCH_EDIT_FRAME::RescueProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), SCH_SCREEN::Save(), LIB_EDIT_FRAME::SaveActiveLibrary(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectComponentFromLibrary(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), EDA_3D_VIEWER::takeScreenshot(), DIALOG_ERC::TestErc(), DIALOG_SPICE_MODEL::updateFromFile(), SIM_PLOT_FRAME::updateNetlistExporter(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), CVPCB_MAINFRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_MODULE_BOARD_EDITOR::~DIALOG_MODULE_BOARD_EDITOR(), and DIALOG_MODULE_MODULE_EDITOR::~DIALOG_MODULE_MODULE_EDITOR().

35 {
36  return Kiway().Prj();
37 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:144
void EDA_DRAW_FRAME::Process_PageSettings ( wxCommandEvent &  event)
inherited

Definition at line 80 of file dialog_page_settings.cpp.

References EDA_DRAW_FRAME::m_canvas, BASE_SCREEN::m_PageLayoutDescrFileName, EDA_DRAW_PANEL::Refresh(), and DIALOG_PAGES_SETTINGS::SetWksFileName().

81 {
82  DIALOG_PAGES_SETTINGS dlg( this );
83  dlg.SetWksFileName( BASE_SCREEN::m_PageLayoutDescrFileName );
84 
85  if( dlg.ShowModal() == wxID_OK )
86  {
87  if( m_canvas )
88  m_canvas->Refresh();
89  }
90 }
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
static wxString m_PageLayoutDescrFileName
the name of the page layout descr file, or emty to used the default pagelayout
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
bool EDA_BASE_FRAME::ProcessEvent ( wxEvent &  aEvent)
overrideinherited

Function ProcessEvent overrides the default process event handler to implement the auto save feature.

Warning
If you override this function in a derived class, make sure you call down to this or the auto save feature will be disabled.

Definition at line 166 of file basicframe.cpp.

References EDA_BASE_FRAME::isAutoSaveRequired(), EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_autoSaveState, EDA_BASE_FRAME::m_autoSaveTimer, EDA_BASE_FRAME::m_hasAutoSave, and traceAutoSave.

Referenced by onSelectNextSymbol(), onSelectPreviousSymbol(), KIWAY::ProcessEvent(), ReCreateListCmp(), and PCBNEW_CONTROL::SwitchUnits().

167 {
168  if( !wxFrame::ProcessEvent( aEvent ) )
169  return false;
170 
171  if( IsShown() && m_hasAutoSave &&
173  {
174  if( !m_autoSaveState )
175  {
176  wxLogTrace( traceAutoSave, wxT( "Starting auto save timer." ) );
177  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
178  m_autoSaveState = true;
179  }
180  else if( m_autoSaveTimer->IsRunning() )
181  {
182  wxLogTrace( traceAutoSave, wxT( "Stopping auto save timer." ) );
183  m_autoSaveTimer->Stop();
184  m_autoSaveState = false;
185  }
186  }
187 
188  return true;
189 }
bool m_autoSaveState
Flag to indicate the last auto save state.
Definition: wxstruct.h:145
const wxChar traceAutoSave[]
Custom trace mask to enable and disable auto save tracing.
Definition: basicframe.cpp:53
wxTimer * m_autoSaveTimer
The timer used to implement the auto save feature;.
Definition: wxstruct.h:151
virtual bool isAutoSaveRequired() const
Function autoSaveRequired returns the auto save status of the application.
Definition: wxstruct.h:168
bool m_hasAutoSave
Flag to indicate if this frame supports auto save.
Definition: wxstruct.h:142
int m_autoSaveInterval
The auto save interval time in seconds.
Definition: wxstruct.h:148
void EDA_DRAW_FRAME::PushPreferences ( const EDA_DRAW_PANEL aParentCanvas)
inherited

Function PushPreferences Pushes a few preferences from a parent window to a child window.

(i.e. from eeschema to schematic symbol editor)

Parameters
aParentCanvasis the parent canvas to push preferences from.

Definition at line 787 of file draw_frame.cpp.

References EDA_DRAW_PANEL::GetEnableAutoPan(), EDA_DRAW_PANEL::GetEnableZoomNoCenter(), EDA_DRAW_FRAME::m_canvas, EDA_DRAW_PANEL::SetEnableAutoPan(), and EDA_DRAW_PANEL::SetEnableZoomNoCenter().

Referenced by SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_BASE_FRAME::OnOpenLibraryViewer(), and PCB_EDIT_FRAME::Process_Special_Functions().

788 {
790  m_canvas->SetEnableAutoPan( aParentCanvas->GetEnableAutoPan() );
791 }
bool GetEnableAutoPan() const
void SetEnableZoomNoCenter(bool aEnable)
Definition: draw_panel.cpp:657
bool GetEnableZoomNoCenter() const
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
void SetEnableAutoPan(bool aEnable)
int EDA_BASE_FRAME::ReadHotkeyConfig ( struct EDA_HOTKEY_CONFIG aDescList)
inherited

Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys.

Parameters
aDescList= current hotkey list descr. to initialize.

Definition at line 658 of file hotkeys_basic.cpp.

659 {
660  ::ReadHotkeyConfig( GetName(), aDescList );
661  return 1;
662 }
int ReadHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList)
Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys...
int EDA_BASE_FRAME::ReadHotkeyConfigFile ( const wxString &  aFilename,
struct EDA_HOTKEY_CONFIG aDescList 
)
inherited

Function ReadHotkeyConfigFile Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list with hotkeys.

Parameters
aFilename= file name to read.
aDescList= current hotkey list descr. to initialize.

Definition at line 601 of file hotkeys_basic.cpp.

References DEFAULT_HOTKEY_FILENAME_EXT, and ParseHotkeyConfig().

Referenced by EDA_BASE_FRAME::ImportHotkeyConfigFromFile().

603 {
604  wxFileName fn( aFilename );
605  fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
606 
607  wxFile cfgfile( fn.GetFullPath() );
608 
609  if( !cfgfile.IsOpened() ) // There is a problem to open file
610  return 0;
611 
612  // get length
613  cfgfile.SeekEnd();
614  wxFileOffset size = cfgfile.Tell();
615  cfgfile.Seek( 0 );
616 
617&#