Commit ee003180 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Global variable removal and minor Doxygen comment fixes.

* Remove global key press variable.  The key press is know passed to
  GeneralControl().
* Removed unused old mouse buttons global variable.
parent c9688dee
...@@ -73,8 +73,6 @@ const wxString AllFilesWildcard( _( "All files (*)|*" ) ); ...@@ -73,8 +73,6 @@ const wxString AllFilesWildcard( _( "All files (*)|*" ) );
wxString g_ProductName = wxT( "KiCad E.D.A. " ); wxString g_ProductName = wxT( "KiCad E.D.A. " );
bool g_ShowPageLimits = true; bool g_ShowPageLimits = true;
wxString g_UserLibDirBuffer; wxString g_UserLibDirBuffer;
int g_MouseOldButtons;
int g_KeyPressed;
wxString g_Prj_Default_Config_FullFilename; wxString g_Prj_Default_Config_FullFilename;
wxString g_Prj_Config_LocalFilename; wxString g_Prj_Config_LocalFilename;
......
...@@ -814,7 +814,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -814,7 +814,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
static bool ignoreNextLeftButtonRelease = false; static bool ignoreNextLeftButtonRelease = false;
static EDA_DRAW_PANEL* LastPanel = NULL; static EDA_DRAW_PANEL* LastPanel = NULL;
int localrealbutt = 0, localbutt = 0, localkey = 0; int localrealbutt = 0, localbutt = 0;
BASE_SCREEN* screen = GetScreen(); BASE_SCREEN* screen = GetScreen();
if( !screen ) if( !screen )
...@@ -846,7 +846,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -846,7 +846,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
else else
return; return;
if( !event.IsButton() && !event.Moving() && !event.Dragging() && !localkey ) if( !event.IsButton() && !event.Moving() && !event.Dragging() )
{ {
return; return;
} }
...@@ -888,8 +888,6 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -888,8 +888,6 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
int kbstat = 0; int kbstat = 0;
g_KeyPressed = localkey;
if( event.ShiftDown() ) if( event.ShiftDown() )
kbstat |= GR_KB_SHIFT; kbstat |= GR_KB_SHIFT;
...@@ -899,8 +897,6 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -899,8 +897,6 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
if( event.AltDown() ) if( event.AltDown() )
kbstat |= GR_KB_ALT; kbstat |= GR_KB_ALT;
g_MouseOldButtons = localrealbutt;
// Calling Double Click and Click functions : // Calling Double Click and Click functions :
if( localbutt == (int) ( GR_M_LEFT_DOWN | GR_M_DCLICK ) ) if( localbutt == (int) ( GR_M_LEFT_DOWN | GR_M_DCLICK ) )
{ {
...@@ -941,7 +937,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -941,7 +937,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
} }
/* Calling the general function on mouse changes (and pseudo key commands) */ /* Calling the general function on mouse changes (and pseudo key commands) */
GetParent()->GeneralControle( &DC, event.GetLogicalPosition( DC ) ); GetParent()->GeneralControl( &DC, event.GetLogicalPosition( DC ), 0 );
/*******************************/ /*******************************/
/* Control of block commands : */ /* Control of block commands : */
...@@ -1090,10 +1086,10 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -1090,10 +1086,10 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event ) void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
{ {
long key, localkey; int localkey;
wxPoint pos; wxPoint pos;
key = localkey = event.GetKeyCode(); localkey = event.GetKeyCode();
switch( localkey ) switch( localkey )
{ {
...@@ -1121,7 +1117,7 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event ) ...@@ -1121,7 +1117,7 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
localkey |= GR_KB_CTRL; localkey |= GR_KB_CTRL;
if( event.AltDown() ) if( event.AltDown() )
localkey |= GR_KB_ALT; localkey |= GR_KB_ALT;
if( event.ShiftDown() && (key > 256) ) if( event.ShiftDown() && (event.GetKeyCode() > 256) )
localkey |= GR_KB_SHIFT; localkey |= GR_KB_SHIFT;
/* Normalize keys code to easily handle keys from Ctrl+A to Ctrl+Z /* Normalize keys code to easily handle keys from Ctrl+A to Ctrl+Z
...@@ -1135,8 +1131,6 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event ) ...@@ -1135,8 +1131,6 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
BASE_SCREEN* Screen = GetScreen(); BASE_SCREEN* Screen = GetScreen();
g_KeyPressed = localkey;
// Some key commands use the current mouse position: refresh it. // Some key commands use the current mouse position: refresh it.
pos = wxGetMousePosition() - GetScreenPosition(); pos = wxGetMousePosition() - GetScreenPosition();
...@@ -1144,7 +1138,7 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event ) ...@@ -1144,7 +1138,7 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
pos = wxPoint( DC.DeviceToLogicalX( pos.x ), DC.DeviceToLogicalY( pos.y ) ); pos = wxPoint( DC.DeviceToLogicalX( pos.x ), DC.DeviceToLogicalY( pos.y ) );
Screen->SetMousePosition( pos ); Screen->SetMousePosition( pos );
GetParent()->GeneralControle( &DC, pos ); GetParent()->GeneralControl( &DC, pos, localkey );
#if 0 #if 0
event.Skip(); // Allow menu shortcut processing event.Skip(); // Allow menu shortcut processing
......
...@@ -311,7 +311,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -311,7 +311,7 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
} }
void DISPLAY_FOOTPRINTS_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
{ {
wxRealPoint gridSize; wxRealPoint gridSize;
wxPoint oldpos; wxPoint oldpos;
...@@ -325,7 +325,7 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosit ...@@ -325,7 +325,7 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosit
oldpos = screen->GetCrossHairPosition(); oldpos = screen->GetCrossHairPosition();
gridSize = screen->GetGridSize(); gridSize = screen->GetGridSize();
switch( g_KeyPressed ) switch( aHotKey )
{ {
case WXK_F1: case WXK_F1:
cmd.SetId( ID_POPUP_ZOOM_IN ); cmd.SetId( ID_POPUP_ZOOM_IN );
......
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
void GeneralControle( wxDC* DC, const wxPoint& aPosition ); void GeneralControl( wxDC* DC, const wxPoint& aPosition, int aHotKey = 0 );
void InstallOptionsDisplay( wxCommandEvent& event ); void InstallOptionsDisplay( wxCommandEvent& event );
MODULE* Get_Module( const wxString& CmpName ); MODULE* Get_Module( const wxString& CmpName );
......
...@@ -232,19 +232,18 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, bool aIncludePin ...@@ -232,19 +232,18 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, bool aIncludePin
} }
void SCH_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
{ {
wxRealPoint gridSize; wxRealPoint gridSize;
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
wxPoint oldpos; wxPoint oldpos;
int hotkey = 0;
wxPoint pos = aPosition; wxPoint pos = aPosition;
pos = screen->GetNearestGridPosition( pos ); pos = screen->GetNearestGridPosition( pos );
oldpos = screen->GetCrossHairPosition(); oldpos = screen->GetCrossHairPosition();
gridSize = screen->GetGridSize(); gridSize = screen->GetGridSize();
switch( g_KeyPressed ) switch( aHotKey )
{ {
case 0: case 0:
break; break;
...@@ -274,7 +273,6 @@ void SCH_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -274,7 +273,6 @@ void SCH_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
break; break;
default: default:
hotkey = g_KeyPressed;
break; break;
} }
...@@ -295,31 +293,30 @@ void SCH_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -295,31 +293,30 @@ void SCH_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
} }
} }
if( hotkey ) if( aHotKey )
{ {
if( screen->GetCurItem() && screen->GetCurItem()->m_Flags ) if( screen->GetCurItem() && screen->GetCurItem()->m_Flags )
OnHotKey( aDC, hotkey, aPosition, screen->GetCurItem() ); OnHotKey( aDC, aHotKey, aPosition, screen->GetCurItem() );
else else
OnHotKey( aDC, hotkey, aPosition, NULL ); OnHotKey( aDC, aHotKey, aPosition, NULL );
} }
UpdateStatusBar(); /* Display cursor coordinates info */ UpdateStatusBar(); /* Display cursor coordinates info */
} }
void LIB_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
{ {
wxRealPoint gridSize; wxRealPoint gridSize;
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
wxPoint oldpos; wxPoint oldpos;
int hotkey = 0;
wxPoint pos = aPosition; wxPoint pos = aPosition;
pos = screen->GetNearestGridPosition( pos ); pos = screen->GetNearestGridPosition( pos );
oldpos = screen->GetCrossHairPosition(); oldpos = screen->GetCrossHairPosition();
gridSize = screen->GetGridSize(); gridSize = screen->GetGridSize();
switch( g_KeyPressed ) switch( aHotKey )
{ {
case 0: case 0:
break; break;
...@@ -349,7 +346,6 @@ void LIB_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -349,7 +346,6 @@ void LIB_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
break; break;
default: default:
hotkey = g_KeyPressed;
break; break;
} }
...@@ -370,31 +366,30 @@ void LIB_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -370,31 +366,30 @@ void LIB_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
} }
} }
if( hotkey ) if( aHotKey )
{ {
if( screen->GetCurItem() && screen->GetCurItem()->m_Flags ) if( screen->GetCurItem() && screen->GetCurItem()->m_Flags )
OnHotKey( aDC, hotkey, aPosition, screen->GetCurItem() ); OnHotKey( aDC, aHotKey, aPosition, screen->GetCurItem() );
else else
OnHotKey( aDC, hotkey, aPosition, NULL ); OnHotKey( aDC, aHotKey, aPosition, NULL );
} }
UpdateStatusBar(); UpdateStatusBar();
} }
void LIB_VIEW_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
{ {
wxRealPoint gridSize; wxRealPoint gridSize;
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
wxPoint oldpos; wxPoint oldpos;
int hotkey = 0;
wxPoint pos = aPosition; wxPoint pos = aPosition;
pos = screen->GetNearestGridPosition( pos ); pos = screen->GetNearestGridPosition( pos );
oldpos = screen->GetCrossHairPosition(); oldpos = screen->GetCrossHairPosition();
gridSize = screen->GetGridSize(); gridSize = screen->GetGridSize();
switch( g_KeyPressed ) switch( aHotKey )
{ {
case 0: case 0:
break; break;
...@@ -424,7 +419,6 @@ void LIB_VIEW_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -424,7 +419,6 @@ void LIB_VIEW_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
break; break;
default: default:
hotkey = g_KeyPressed;
break; break;
} }
...@@ -445,12 +439,12 @@ void LIB_VIEW_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -445,12 +439,12 @@ void LIB_VIEW_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
} }
} }
if( hotkey ) if( aHotKey )
{ {
if( screen->GetCurItem() && screen->GetCurItem()->m_Flags ) if( screen->GetCurItem() && screen->GetCurItem()->m_Flags )
OnHotKey( aDC, hotkey, aPosition, screen->GetCurItem() ); OnHotKey( aDC, aHotKey, aPosition, screen->GetCurItem() );
else else
OnHotKey( aDC, hotkey, aPosition, NULL ); OnHotKey( aDC, aHotKey, aPosition, NULL );
} }
UpdateStatusBar(); UpdateStatusBar();
......
...@@ -105,7 +105,7 @@ public: ...@@ -105,7 +105,7 @@ public:
void OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, EDA_ITEM* aItem = NULL ); void OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, EDA_ITEM* aItem = NULL );
void GeneralControle( wxDC* aDC, const wxPoint& aPosition ); void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
void LoadSettings(); void LoadSettings();
void SaveSettings(); void SaveSettings();
......
...@@ -69,7 +69,7 @@ public: ...@@ -69,7 +69,7 @@ public:
SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) EDA_DRAW_FRAME::GetScreen(); } SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) EDA_DRAW_FRAME::GetScreen(); }
void GeneralControle( wxDC* aDC, const wxPoint& aPosition ); void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
void LoadSettings(); void LoadSettings();
void SaveSettings(); void SaveSettings();
......
...@@ -8,11 +8,10 @@ ...@@ -8,11 +8,10 @@
#include "gerbview.h" #include "gerbview.h"
void WinEDA_GerberFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) void WinEDA_GerberFrame::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
{ {
wxRealPoint gridSize; wxRealPoint gridSize;
wxPoint oldpos; wxPoint oldpos;
int hotkey = 0;
wxPoint pos = aPosition; wxPoint pos = aPosition;
pos = GetScreen()->GetNearestGridPosition( pos ); pos = GetScreen()->GetNearestGridPosition( pos );
...@@ -20,7 +19,7 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -20,7 +19,7 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
oldpos = GetScreen()->GetCrossHairPosition(); oldpos = GetScreen()->GetCrossHairPosition();
gridSize = GetScreen()->GetGridSize(); gridSize = GetScreen()->GetGridSize();
switch( g_KeyPressed ) switch( aHotKey )
{ {
case WXK_NUMPAD8: case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
...@@ -47,7 +46,6 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -47,7 +46,6 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
break; break;
default: default:
hotkey = g_KeyPressed;
break; break;
} }
...@@ -67,9 +65,9 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -67,9 +65,9 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
} }
} }
if( hotkey ) if( aHotKey )
{ {
OnHotKey( aDC, hotkey, NULL ); OnHotKey( aDC, aHotKey, NULL );
} }
UpdateStatusBar(); UpdateStatusBar();
......
...@@ -377,8 +377,7 @@ public: WinEDA_GerberFrame( wxWindow* father, const wxString& title, ...@@ -377,8 +377,7 @@ public: WinEDA_GerberFrame( wxWindow* father, const wxString& title,
bool Read_GERBER_File( const wxString& GERBER_FullFileName, bool Read_GERBER_File( const wxString& GERBER_FullFileName,
const wxString& D_Code_FullFileName ); const wxString& D_Code_FullFileName );
void GeneralControle( wxDC* aDC, const wxPoint& aPosition ); void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
/** /**
* Function Read_D_Code_File * Function Read_D_Code_File
......
...@@ -156,9 +156,6 @@ extern wxString g_ProductName; ...@@ -156,9 +156,6 @@ extern wxString g_ProductName;
/* Default user lib path can be left void, if the standard lib path is used */ /* Default user lib path can be left void, if the standard lib path is used */
extern wxString g_UserLibDirBuffer; extern wxString g_UserLibDirBuffer;
extern int g_MouseOldButtons;
extern int g_KeyPressed;
extern bool g_ShowPageLimits; // TRUE to display the page limits extern bool g_ShowPageLimits; // TRUE to display the page limits
/* File name extension definitions. */ /* File name extension definitions. */
......
...@@ -109,7 +109,7 @@ public: ...@@ -109,7 +109,7 @@ public:
void Process_Config( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event );
void OnSelectTool( wxCommandEvent& aEvent ); void OnSelectTool( wxCommandEvent& aEvent );
void GeneralControle( wxDC* aDC, const wxPoint& aPosition ); void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
PARAM_CFG_ARRAY& GetProjectFileParameters( void ); PARAM_CFG_ARRAY& GetProjectFileParameters( void );
void SaveProjectFile( wxWindow* displayframe, bool askoverwrite = true ); void SaveProjectFile( wxWindow* displayframe, bool askoverwrite = true );
......
...@@ -387,7 +387,7 @@ public: ...@@ -387,7 +387,7 @@ public:
void ReFillLayerWidget(); void ReFillLayerWidget();
void Show3D_Frame( wxCommandEvent& event ); void Show3D_Frame( wxCommandEvent& event );
void GeneralControle( wxDC* aDC, const wxPoint& aPosition ); void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
/** /**
* Function ShowDesignRulesEditor * Function ShowDesignRulesEditor
...@@ -590,7 +590,7 @@ public: ...@@ -590,7 +590,7 @@ public:
/** /**
* Function ReadPcbFile * Function ReadPcbFile
* reads a board file &ltfile&gt.brd * reads a board file &ltfile&gt.brd
* @param File - The file to read from. * @param aReader The line reader object to read from.
* @param Append if 0: a previously loaded board is deleted before loading * @param Append if 0: a previously loaded board is deleted before loading
* the file else all items of the board file are added to the * the file else all items of the board file are added to the
* existing board * existing board
...@@ -750,10 +750,10 @@ public: ...@@ -750,10 +750,10 @@ public:
/** /**
* Function OnEditItemRequest * Function OnEditItemRequest
* Install the corresponding dialog editor for the given item * Install the corresponding dialog editor for the given item
* @param DC = the current device context * @param aDC = the current device context
* @param aItem = a pointer to the BOARD_ITEM to edit * @param aItem = a pointer to the BOARD_ITEM to edit
*/ */
void OnEditItemRequest( wxDC* DC, BOARD_ITEM* aItem ); void OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem );
// Highlight functions: // Highlight functions:
......
...@@ -390,7 +390,7 @@ public: ...@@ -390,7 +390,7 @@ public:
void OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent ); void OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent );
/** /**
* Function GeneralControle * Function GeneralControl
* performs application specific control using \a aDC at \a aPosition in logical units. * performs application specific control using \a aDC at \a aPosition in logical units.
* <p> * <p>
* Override this function for application specific control. This function gets * Override this function for application specific control. This function gets
...@@ -398,8 +398,9 @@ public: ...@@ -398,8 +398,9 @@ public:
*</p> *</p>
* @param aDC A device context. * @param aDC A device context.
* @param aPosition The current cursor position in logical (drawing) units. * @param aPosition The current cursor position in logical (drawing) units.
* @param aHotKey A key event used for appication specific control if not zero.
*/ */
virtual void GeneralControle( wxDC* aDC, const wxPoint& aPosition ) { /* dummy */ } virtual void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 ) { }
virtual void OnSize( wxSizeEvent& event ); virtual void OnSize( wxSizeEvent& event );
void OnEraseBackground( wxEraseEvent& SizeEvent ); void OnEraseBackground( wxEraseEvent& SizeEvent );
......
...@@ -96,9 +96,7 @@ bool TEXTE_MODULE::Save( FILE* aFile ) const ...@@ -96,9 +96,7 @@ bool TEXTE_MODULE::Save( FILE* aFile ) const
/** /**
* Function ReadDescr * Function ReadDescr
* Read description from a given line in "*.brd" format. * Read description from a given line in "*.brd" format.
* @param aLine The current line which contains the first line of description. * @param aReader The line reader object which contains the first line of description.
* @param aLine The FILE to read next lines (currently not used).
* @param aLineNum a point to the line count (currently not used).
* @return int - > 0 if success reading else 0. * @return int - > 0 if success reading else 0.
*/ */
int TEXTE_MODULE::ReadDescr( LINE_READER* aReader ) int TEXTE_MODULE::ReadDescr( LINE_READER* aReader )
......
...@@ -226,11 +226,10 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode ) ...@@ -226,11 +226,10 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
} }
void WinEDA_PcbFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) void WinEDA_PcbFrame::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
{ {
wxRealPoint gridSize; wxRealPoint gridSize;
wxPoint oldpos; wxPoint oldpos;
int hotkey = 0;
wxPoint pos = GetScreen()->GetNearestGridPosition( aPosition ); wxPoint pos = GetScreen()->GetNearestGridPosition( aPosition );
// Save the board after the time out : // Save the board after the time out :
...@@ -264,7 +263,7 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -264,7 +263,7 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
gridSize = GetScreen()->GetGridSize(); gridSize = GetScreen()->GetGridSize();
switch( g_KeyPressed ) switch( aHotKey )
{ {
case WXK_NUMPAD8: /* Deplacement curseur vers le haut */ case WXK_NUMPAD8: /* Deplacement curseur vers le haut */
case WXK_UP: case WXK_UP:
...@@ -291,7 +290,6 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -291,7 +290,6 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
break; break;
default: default:
hotkey = g_KeyPressed;
break; break;
} }
...@@ -365,9 +363,9 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -365,9 +363,9 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
#endif #endif
} }
if( hotkey ) if( aHotKey )
{ {
OnHotKey( aDC, hotkey, aPosition ); OnHotKey( aDC, aHotKey, aPosition );
} }
UpdateStatusBar(); /* Display new cursor coordinates */ UpdateStatusBar(); /* Display new cursor coordinates */
......
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
bool OnHotkeyMoveItem( int aIdCommand ); bool OnHotkeyMoveItem( int aIdCommand );
bool OnHotkeyRotateItem( int aIdCommand ); bool OnHotkeyRotateItem( int aIdCommand );
void Show3D_Frame( wxCommandEvent& event ); void Show3D_Frame( wxCommandEvent& event );
void GeneralControle( wxDC* aDC, const wxPoint& aPosition ); void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
void OnVerticalToolbar( wxCommandEvent& aEvent ); void OnVerticalToolbar( wxCommandEvent& aEvent );
void OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent ); void OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent );
......
...@@ -330,18 +330,17 @@ void WinEDA_ModuleEditFrame::Show3D_Frame( wxCommandEvent& event ) ...@@ -330,18 +330,17 @@ void WinEDA_ModuleEditFrame::Show3D_Frame( wxCommandEvent& event )
} }
void WinEDA_ModuleEditFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) void WinEDA_ModuleEditFrame::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
{ {
wxRealPoint gridSize; wxRealPoint gridSize;
wxPoint oldpos; wxPoint oldpos;
int hotkey = 0;
wxPoint pos = aPosition; wxPoint pos = aPosition;
pos = GetScreen()->GetNearestGridPosition( aPosition ); pos = GetScreen()->GetNearestGridPosition( aPosition );
oldpos = GetScreen()->GetCrossHairPosition(); oldpos = GetScreen()->GetCrossHairPosition();
gridSize = GetScreen()->GetGridSize(); gridSize = GetScreen()->GetGridSize();
switch( g_KeyPressed ) switch( aHotKey )
{ {
case WXK_NUMPAD8: case WXK_NUMPAD8:
case WXK_UP: case WXK_UP:
...@@ -368,7 +367,6 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* aDC, const wxPoint& aPositio ...@@ -368,7 +367,6 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* aDC, const wxPoint& aPositio
break; break;
default: default:
hotkey = g_KeyPressed;
break; break;
} }
...@@ -388,9 +386,9 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* aDC, const wxPoint& aPositio ...@@ -388,9 +386,9 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* aDC, const wxPoint& aPositio
} }
} }
if( hotkey ) if( aHotKey )
{ {
OnHotKey( aDC, hotkey, aPosition ); OnHotKey( aDC, aHotKey, aPosition );
} }
UpdateStatusBar(); UpdateStatusBar();
......
...@@ -489,13 +489,6 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -489,13 +489,6 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
} }
/**
* Function OnEditItemRequest
* Install the corresponding dialog editor for the given item
* @param aDC = the current device context
* @param aItem = a pointer to the BOARD_ITEM to edit
*/
void WinEDA_PcbFrame::OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem ) void WinEDA_PcbFrame::OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem )
{ {
switch( aItem->Type() ) switch( aItem->Type() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment