Commit 628be5d1 authored by dickelbeck's avatar dickelbeck

chasing a bug

parent 9200a9da
......@@ -4,6 +4,15 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Dec-4 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
added the D() macro to fctsys.h to ease conditional debug printf()s.
worked on http://sourceforge.net/tracker/index.php?func=detail&aid=1844960&group_id=145591&atid=762476
but could not resolve it in 1/2 day.
2007-Dec-4 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
......
......@@ -112,6 +112,9 @@ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos )
{
wxPoint curpos;
D(printf("curpos=%d,%d GetZoom=%d, mDrawOrg=%d,%d\n",
curpos.x, curpos.y, GetZoom(), m_DrawOrg.x, m_DrawOrg.y );)
curpos.x = ScreenPos.x * GetZoom();
curpos.y = ScreenPos.y * GetZoom();
......
......@@ -66,6 +66,13 @@
#define STRING_DIR_SEP wxT( "/" )
#endif
#ifdef DEBUG
#define D(x) x
#else
#define D(x) // nothing
#endif
#define UNIX_STRING_DIR_SEP wxT( "/" )
#define WIN_STRING_DIR_SEP wxT( "\\" )
......
MAKEGTK = $(MAKE) -f makefile.gtk
KICAD_SUBDIRS = common 3d-viewer pcbnew eeschema eeschema/plugins cvpcb kicad gerbview
KICAD_SUBDIRS = common 3d-viewer pcbnew #eeschema eeschema/plugins cvpcb kicad gerbview
KICAD_SUBDIRS_BIN = eeschema eeschema/plugins pcbnew cvpcb kicad gerbview
KICAD_SUBDIRS_RES = internat modules template library
KICAD_SUBDIRS_HELP = help
......
......@@ -119,6 +119,9 @@ void WinEDA_BasePcbFrame::CursorGoto( const wxPoint& aPos )
DrawPanel->MouseToCursorSchema();
DrawPanel->CursorOn( &dc );
}
D(printf("CursorGoto end x=%d, y=%d\n",
m_CurrentScreen->m_Curseur.x, m_CurrentScreen->m_Curseur.y );)
}
......
......@@ -223,6 +223,9 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
/*****************************************************************/
{
D(printf("GeneralControle x=%d, y=%d\n",
m_CurrentScreen->m_Curseur.x, m_CurrentScreen->m_Curseur.y );)
wxSize delta;
int zoom = GetScreen()->GetZoom();
wxPoint curpos, oldpos;
......@@ -256,7 +259,12 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
SetTitle( GetScreen()->m_FileName );
}
D(printf("GeneralControleA Mouse.x=%d, Mouse.y=%d\n",
Mouse.x, Mouse.y );)
curpos = DrawPanel->CursorRealPosition( Mouse );
D(printf("GeneralControleB curpos.x=%d, curpos.y=%d\n", curpos.x, curpos.y );)
oldpos = GetScreen()->m_Curseur;
......@@ -272,7 +280,8 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
printf( "delta.x=%d delta.y=%d grid.x=%d, grid.y=%d, zoom=%d\n",
delta.x, delta.y, GetScreen()->GetGrid().x, GetScreen()->GetGrid().y, zoom );
#endif
switch( g_KeyPressed )
{
case EDA_PANNING_UP_KEY:
......@@ -339,9 +348,16 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
break;
}
D(printf("GeneralControle2 x=%d, y=%d\n",
m_CurrentScreen->m_Curseur.x, m_CurrentScreen->m_Curseur.y );)
/* Put cursor in new position, according to the zoom keys (if any) */
GetScreen()->m_Curseur = curpos;
D(printf("GeneralControle3 x=%d, y=%d\n",
m_CurrentScreen->m_Curseur.x, m_CurrentScreen->m_Curseur.y );)
/* Put cursor on grid or a pad centre if requested
* But if the tool DELETE is active the cursor is left off grid
* this is better to reach items to delete off grid
......@@ -383,7 +399,9 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
// If we are not in delete function, put cursor on grid
if( keep_on_grid )
{
PutOnGrid( &GetScreen()->m_Curseur );
}
break;
}
......
......@@ -884,8 +884,6 @@ void DrcDialog::OnPopupMenu( wxCommandEvent& event )
{
int source = event.GetId();
printf( "source=%d\n", source );
const DRC_ITEM* item = 0;
wxPoint pos;
......
......@@ -584,6 +584,9 @@ void WinEDA_DrawFrame::OnZoom( int zoom_type )
* replac au centre de l'ecran
*/
{
D(printf("OnZoom x=%d, y=%d\n",
m_CurrentScreen->m_Curseur.x, m_CurrentScreen->m_Curseur.y );)
if( DrawPanel == NULL )
return;
......@@ -604,7 +607,9 @@ void WinEDA_DrawFrame::OnZoom( int zoom_type )
case ID_ZOOM_PLUS_BUTT:
if( zoom_type == ID_ZOOM_PLUS_BUTT )
m_CurrentScreen->m_Curseur = DrawPanel->GetScreenCenterRealPosition();
m_CurrentScreen->SetPreviousZoom();
Recadre_Trace( move_mouse_cursor );
break;
......
......@@ -47,13 +47,22 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
*/
{
PutOnGrid( &m_CurrentScreen->m_Curseur );
AdjustScrollBars();
ReDrawPanel();
D(printf("~ReDrawPanel x=%d, y=%d\n",
m_CurrentScreen->m_Curseur.x, m_CurrentScreen->m_Curseur.y );)
/* Move the mouse cursor to the on grid graphic cursor position */
if( ToMouse == TRUE )
{
DrawPanel->MouseToCursorSchema();
D(printf("~MouseToCursorSchema x=%d, y=%d\n",
m_CurrentScreen->m_Curseur.x, m_CurrentScreen->m_Curseur.y );)
}
}
......
......@@ -70,3 +70,11 @@ asked by: Dick Hollenbeck
asked by: jp Charras
================================================================================
Use the collector classes in eeschema.
2007-Dec-5 Assigned To: charras
asked by: Dick
================================================================================
http://sourceforge.net/tracker/index.php?func=detail&aid=1844960&group_id=145591&atid=762476
Notice my appended note to this bug report as well.
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