Changes to use cursor position as parameter and snap to grid settings.

* Changed managed cursor callback definition to include the current
  cursor drawing position.
* Modified all managed cursor callbacks to match new definition.
* Added snap to grid option to base drawing frame object.
* Changed add no connect managed cursor callback to use new position
  parameter instead of the stored one.
* Lots of coding policy fixes.
This commit is contained in:
Wayne Stambaugh
2011-02-03 14:27:28 -05:00
parent f92d697278
commit 50f063da07
48 changed files with 569 additions and 477 deletions
+12
View File
@@ -78,6 +78,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype,
m_LastGridSizeId = 0;
m_DrawGrid = true; // hide/Show grid. default = show
m_GridColor = DARKGRAY; // Grid color
m_snapToGrid = true;
// Internal units per inch: = 1000 for schema, = 10000 for PCB
m_InternalUnits = EESCHEMA_INTERNAL_UNIT;
@@ -450,6 +451,17 @@ void EDA_DRAW_FRAME::OnGrid( int grid_type )
}
wxPoint EDA_DRAW_FRAME::GetGridPosition( const wxPoint& aPosition )
{
wxPoint pos = aPosition;
if( m_CurrentScreen != NULL && m_snapToGrid )
pos = m_CurrentScreen->GetNearestGridPosition( aPosition );
return pos;
}
int EDA_DRAW_FRAME::ReturnBlockCommand( int key )
{
return 0;