Commit dd091fc6 authored by Dick Hollenbeck's avatar Dick Hollenbeck

merge in mainline into KICAD_PLUGIN work, which is for the PCBNEW nanometer support

parents 90bb27ca 152b8d91
...@@ -49,13 +49,20 @@ int S3D_MASTER::ReadData() ...@@ -49,13 +49,20 @@ int S3D_MASTER::ReadData()
return 1; return 1;
} }
if( wxFileName::FileExists( m_Shape3DName ) ) wxString shape3DNname = m_Shape3DName;
#ifdef __WINDOWS__
shape3DNname.Replace( wxT("/"), wxT("\\") );
#else
shape3DNname.Replace( wxT("\\"), wxT("/") );
#endif
if( wxFileName::FileExists( shape3DNname ) )
{ {
FullFilename = m_Shape3DName; FullFilename = shape3DNname;
} }
else else
{ {
fn = m_Shape3DName; fn = shape3DNname;
FullFilename = wxGetApp().FindLibraryPath( fn ); FullFilename = wxGetApp().FindLibraryPath( fn );
if( FullFilename.IsEmpty() ) if( FullFilename.IsEmpty() )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -478,18 +478,21 @@ PICKED_ITEMS_LIST* BASE_SCREEN::PopCommandFromRedoList( ) ...@@ -478,18 +478,21 @@ PICKED_ITEMS_LIST* BASE_SCREEN::PopCommandFromRedoList( )
} }
void BASE_SCREEN::AddItem( EDA_ITEM* aItem ) #if defined(DEBUG)
void BASE_SCREEN::Show( int nestLevel, std::ostream& os ) const
{ {
wxCHECK_RET( aItem != NULL, wxT( "Attempt to add NULL item pointer to " ) + GetClass() + // for now, make it look like XML, expand on this later.
wxT( "item list" ) ); NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";
m_items.push_back( aItem );
}
/* this class will eventually go away, but here's a place holder until then.
for( EDA_ITEM* item = m_drawList; item; item = item->Next() )
{
item->Show( nestLevel+1, os );
}
*/
void BASE_SCREEN::InsertItem( EDA_ITEMS::iterator aIter, EDA_ITEM* aItem ) NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
{
wxCHECK_RET( aItem != NULL, wxT( "Attempt to insert NULL item pointer to " ) + GetClass() +
wxT( "item list" ) );
m_items.insert( aIter, aItem );
} }
#endif
...@@ -427,7 +427,7 @@ bool EDA_TEXT::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy ...@@ -427,7 +427,7 @@ bool EDA_TEXT::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy
void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
EDA_Colors aColor, int aDrawMode, EDA_Colors aColor, int aDrawMode,
GRTraceMode aFillMode, EDA_Colors aAnchor_color ) EDA_DRAW_MODE_T aFillMode, EDA_Colors aAnchor_color )
{ {
if( m_MultilineAllowed ) if( m_MultilineAllowed )
{ {
...@@ -471,13 +471,13 @@ void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, ...@@ -471,13 +471,13 @@ void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC, void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, EDA_Colors aColor, const wxPoint& aOffset, EDA_Colors aColor,
int aDrawMode, GRTraceMode aFillMode, int aDrawMode, EDA_DRAW_MODE_T aFillMode,
EDA_Colors aAnchor_color, EDA_Colors aAnchor_color,
wxString& aText, wxPoint aPos ) wxString& aText, wxPoint aPos )
{ {
int width = m_Thickness; int width = m_Thickness;
if( aFillMode == FILAIRE ) if( aFillMode == LINE )
width = 0; width = 0;
if( aDrawMode != -1 ) if( aDrawMode != -1 )
...@@ -494,10 +494,10 @@ void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC, ...@@ -494,10 +494,10 @@ void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
int cX = aPos.x + aOffset.x; int cX = aPos.x + aOffset.x;
int cY = aPos.y + aOffset.y; int cY = aPos.y + aOffset.y;
GRLine( &aPanel->m_ClipBox, aDC, cX - anchor_size, cY, GRLine( aPanel->GetClipBox(), aDC, cX - anchor_size, cY,
cX + anchor_size, cY, 0, aAnchor_color ); cX + anchor_size, cY, 0, aAnchor_color );
GRLine( &aPanel->m_ClipBox, aDC, cX, cY - anchor_size, GRLine( aPanel->GetClipBox(), aDC, cX, cY - anchor_size,
cX, cY + anchor_size, 0, aAnchor_color ); cX, cY + anchor_size, 0, aAnchor_color );
} }
......
...@@ -131,10 +131,10 @@ void BLOCK_SELECTOR::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf ...@@ -131,10 +131,10 @@ void BLOCK_SELECTOR::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
GRSetDrawMode( aDC, aDrawMode ); GRSetDrawMode( aDC, aDrawMode );
if( w == 0 || h == 0 ) if( w == 0 || h == 0 )
GRLine( &aPanel->m_ClipBox, aDC, GetX() + aOffset.x, GetY() + aOffset.y, GRLine( aPanel->GetClipBox(), aDC, GetX() + aOffset.x, GetY() + aOffset.y,
GetRight() + aOffset.x, GetBottom() + aOffset.y, 0, aColor ); GetRight() + aOffset.x, GetBottom() + aOffset.y, 0, aColor );
else else
GRRect( &aPanel->m_ClipBox, aDC, GetX() + aOffset.x, GetY() + aOffset.y, GRRect( aPanel->GetClipBox(), aDC, GetX() + aOffset.x, GetY() + aOffset.y,
GetRight() + aOffset.x, GetBottom() + aOffset.y, 0, aColor ); GetRight() + aOffset.x, GetBottom() + aOffset.y, 0, aColor );
} }
...@@ -241,7 +241,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo ...@@ -241,7 +241,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
{ {
DisplayError( this, wxT( "No Block to paste" ), 20 ); DisplayError( this, wxT( "No Block to paste" ), 20 );
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
m_canvas->m_mouseCaptureCallback = NULL; m_canvas->SetMouseCaptureCallback( NULL );
return true; return true;
} }
...@@ -254,7 +254,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo ...@@ -254,7 +254,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
} }
Block->m_State = STATE_BLOCK_MOVE; Block->m_State = STATE_BLOCK_MOVE;
m_canvas->m_mouseCaptureCallback( m_canvas, DC, startpos, false ); m_canvas->CallMouseCapture( DC, startpos, false );
break; break;
default: default:
...@@ -314,7 +314,7 @@ void AbortBlockCurrentCommand( EDA_DRAW_PANEL* Panel, wxDC* DC ) ...@@ -314,7 +314,7 @@ void AbortBlockCurrentCommand( EDA_DRAW_PANEL* Panel, wxDC* DC )
if( Panel->IsMouseCaptured() ) /* Erase current drawing on screen */ if( Panel->IsMouseCaptured() ) /* Erase current drawing on screen */
{ {
/* Clear block outline. */ /* Clear block outline. */
Panel->m_mouseCaptureCallback( Panel, DC, wxDefaultPosition, false ); Panel->CallMouseCapture( DC, wxDefaultPosition, false );
Panel->SetMouseCapture( NULL, NULL ); Panel->SetMouseCapture( NULL, NULL );
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
......
...@@ -162,7 +162,7 @@ void MARKER_BASE::DrawMarker( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, ...@@ -162,7 +162,7 @@ void MARKER_BASE::DrawMarker( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
corners[ii] += m_Pos + aOffset; corners[ii] += m_Pos + aOffset;
} }
GRClosedPoly( &aPanel->m_ClipBox, aDC, CORNERS_COUNT, corners, GRClosedPoly( aPanel->GetClipBox(), aDC, CORNERS_COUNT, corners,
true, // = Filled true, // = Filled
0, // outline width 0, // outline width
m_Color, // outline color m_Color, // outline color
......
...@@ -252,7 +252,7 @@ void PLOTTER::marker( const wxPoint& position, int diametre, int aShapeId ) ...@@ -252,7 +252,7 @@ void PLOTTER::marker( const wxPoint& position, int diametre, int aShapeId )
/* Convert a thick segment and plot it as an oval */ /* Convert a thick segment and plot it as an oval */
void PLOTTER::segment_as_oval( wxPoint start, wxPoint end, int width, void PLOTTER::segment_as_oval( wxPoint start, wxPoint end, int width,
GRTraceMode tracemode ) EDA_DRAW_MODE_T tracemode )
{ {
wxPoint center( (start.x + end.x) / 2, (start.y + end.y) / 2 ); wxPoint center( (start.x + end.x) / 2, (start.y + end.y) / 2 );
wxSize size( end.x - start.x, end.y - start.y ); wxSize size( end.x - start.x, end.y - start.y );
...@@ -326,12 +326,12 @@ void PLOTTER::sketch_oval( wxPoint pos, wxSize size, int orient, ...@@ -326,12 +326,12 @@ void PLOTTER::sketch_oval( wxPoint pos, wxSize size, int orient,
/* Plot 1 segment like a track segment /* Plot 1 segment like a track segment
*/ */
void PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, void PLOTTER::thick_segment( wxPoint start, wxPoint end, int width,
GRTraceMode tracemode ) EDA_DRAW_MODE_T tracemode )
{ {
switch( tracemode ) switch( tracemode )
{ {
case FILLED: case FILLED:
case FILAIRE: case LINE:
set_current_line_width( tracemode==FILLED ? width : -1 ); set_current_line_width( tracemode==FILLED ? width : -1 );
move_to( start ); move_to( start );
finish_to( end ); finish_to( end );
...@@ -346,11 +346,11 @@ void PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, ...@@ -346,11 +346,11 @@ void PLOTTER::thick_segment( wxPoint start, wxPoint end, int width,
void PLOTTER::thick_arc( wxPoint centre, int StAngle, int EndAngle, int radius, void PLOTTER::thick_arc( wxPoint centre, int StAngle, int EndAngle, int radius,
int width, GRTraceMode tracemode ) int width, EDA_DRAW_MODE_T tracemode )
{ {
switch( tracemode ) switch( tracemode )
{ {
case FILAIRE: case LINE:
set_current_line_width( -1 ); set_current_line_width( -1 );
arc( centre, StAngle, EndAngle, radius, NO_FILL, -1 ); arc( centre, StAngle, EndAngle, radius, NO_FILL, -1 );
break; break;
...@@ -371,11 +371,11 @@ void PLOTTER::thick_arc( wxPoint centre, int StAngle, int EndAngle, int radius, ...@@ -371,11 +371,11 @@ void PLOTTER::thick_arc( wxPoint centre, int StAngle, int EndAngle, int radius,
void PLOTTER::thick_rect( wxPoint p1, wxPoint p2, int width, void PLOTTER::thick_rect( wxPoint p1, wxPoint p2, int width,
GRTraceMode tracemode ) EDA_DRAW_MODE_T tracemode )
{ {
switch( tracemode ) switch( tracemode )
{ {
case FILAIRE: case LINE:
rect( p1, p2, NO_FILL, -1 ); rect( p1, p2, NO_FILL, -1 );
break; break;
...@@ -401,11 +401,11 @@ void PLOTTER::thick_rect( wxPoint p1, wxPoint p2, int width, ...@@ -401,11 +401,11 @@ void PLOTTER::thick_rect( wxPoint p1, wxPoint p2, int width,
void PLOTTER::thick_circle( wxPoint pos, int diametre, int width, void PLOTTER::thick_circle( wxPoint pos, int diametre, int width,
GRTraceMode tracemode ) EDA_DRAW_MODE_T tracemode )
{ {
switch( tracemode ) switch( tracemode )
{ {
case FILAIRE: case LINE:
circle( pos, diametre, NO_FILL, -1 ); circle( pos, diametre, NO_FILL, -1 );
break; break;
......
...@@ -213,15 +213,17 @@ void DXF_PLOTTER::set_dash( bool dashed ) ...@@ -213,15 +213,17 @@ void DXF_PLOTTER::set_dash( bool dashed )
* @param aPlotMode = FILLED, SKETCH .. * @param aPlotMode = FILLED, SKETCH ..
*/ */
void DXF_PLOTTER::thick_segment( wxPoint aStart, wxPoint aEnd, int aWidth, void DXF_PLOTTER::thick_segment( wxPoint aStart, wxPoint aEnd, int aWidth,
GRTraceMode aPlotMode ) EDA_DRAW_MODE_T aPlotMode )
{ {
if( aPlotMode == FILAIRE ) /* just a line is Ok */ if( aPlotMode == LINE ) /* just a line is Ok */
{ {
move_to( aStart ); move_to( aStart );
finish_to( aEnd ); finish_to( aEnd );
} }
else else
{
segment_as_oval( aStart, aEnd, aWidth, aPlotMode ); segment_as_oval( aStart, aEnd, aWidth, aPlotMode );
}
} }
...@@ -253,7 +255,7 @@ void DXF_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int radius, ...@@ -253,7 +255,7 @@ void DXF_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int radius,
/* Plot oval pad at position. */ /* Plot oval pad at position. */
void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
GRTraceMode trace_mode ) EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
...@@ -272,7 +274,7 @@ void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, ...@@ -272,7 +274,7 @@ void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
/* Plot round pad or via. */ /* Plot round pad or via. */
void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
GRTraceMode trace_mode ) EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
circle( pos, diametre, NO_FILL ); circle( pos, diametre, NO_FILL );
...@@ -283,7 +285,7 @@ void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, ...@@ -283,7 +285,7 @@ void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
* Plot rectangular pad vertical or horizontal (rectangular Pad) * Plot rectangular pad vertical or horizontal (rectangular Pad)
*/ */
void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize, void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
int orient, GRTraceMode trace_mode ) int orient, EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
wxSize size; wxSize size;
...@@ -353,7 +355,7 @@ void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize, ...@@ -353,7 +355,7 @@ void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
* Plot mode = FILLED, SKETCH (unused) * Plot mode = FILLED, SKETCH (unused)
*/ */
void DXF_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], void DXF_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
int aPadOrient, GRTraceMode aTrace_Mode ) int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
wxPoint coord[4]; /* coord actual corners of a trapezoidal trace */ wxPoint coord[4]; /* coord actual corners of a trapezoidal trace */
......
...@@ -369,14 +369,14 @@ void GERBER_PLOTTER::PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFac ...@@ -369,14 +369,14 @@ void GERBER_PLOTTER::PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFac
/* Function flash_pad_circle /* Function flash_pad_circle
* Plot a circular pad or via at the user position pos * Plot a circular pad or via at the user position pos
*/ */
void GERBER_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, GRTraceMode trace_mode ) void GERBER_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
wxSize size( diametre, diametre ); wxSize size( diametre, diametre );
switch( trace_mode ) switch( trace_mode )
{ {
case FILAIRE: case LINE:
case SKETCH: case SKETCH:
set_current_line_width( -1 ); set_current_line_width( -1 );
circle( pos, diametre - current_pen_width, NO_FILL ); circle( pos, diametre - current_pen_width, NO_FILL );
...@@ -398,7 +398,7 @@ void GERBER_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, GRTraceMode tr ...@@ -398,7 +398,7 @@ void GERBER_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, GRTraceMode tr
* For any orientation the shape is drawn as a segment * For any orientation the shape is drawn as a segment
*/ */
void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
GRTraceMode trace_mode ) EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
int x0, y0, x1, y1, delta; int x0, y0, x1, y1, delta;
...@@ -455,7 +455,7 @@ void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, ...@@ -455,7 +455,7 @@ void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
* For others shape the direction is plotted as a polygon. * For others shape the direction is plotted as a polygon.
*/ */
void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size, void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
int orient, GRTraceMode trace_mode ) int orient, EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
...@@ -472,7 +472,7 @@ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size, ...@@ -472,7 +472,7 @@ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
case 1800: case 1800:
switch( trace_mode ) switch( trace_mode )
{ {
case FILAIRE: case LINE:
case SKETCH: case SKETCH:
set_current_line_width( -1 ); set_current_line_width( -1 );
rect( wxPoint( pos.x - (size.x - current_pen_width) / 2, rect( wxPoint( pos.x - (size.x - current_pen_width) / 2,
...@@ -522,7 +522,7 @@ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size, ...@@ -522,7 +522,7 @@ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
* Plot mode = FILLED or SKETCH * Plot mode = FILLED or SKETCH
*/ */
void GERBER_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], void GERBER_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
int aPadOrient, GRTraceMode aTrace_Mode ) int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{ {
// polygon corners list // polygon corners list
......
...@@ -204,13 +204,13 @@ void HPGL_PLOTTER::set_dash( bool dashed ) ...@@ -204,13 +204,13 @@ void HPGL_PLOTTER::set_dash( bool dashed )
* @param width = segment width (thickness) * @param width = segment width (thickness)
* @param tracemode = FILLED, SKETCH .. * @param tracemode = FILLED, SKETCH ..
*/ */
void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, GRTraceMode tracemode ) void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, EDA_DRAW_MODE_T tracemode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
wxPoint center; wxPoint center;
wxSize size; wxSize size;
if( (pen_diameter >= width) || (tracemode == FILAIRE) ) /* just a line is if( (pen_diameter >= width) || (tracemode == LINE) ) /* just a line is
* Ok */ * Ok */
{ {
move_to( start ); move_to( start );
...@@ -267,7 +267,7 @@ void HPGL_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int rayon, ...@@ -267,7 +267,7 @@ void HPGL_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
/* Plot oval pad. /* Plot oval pad.
*/ */
void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
GRTraceMode trace_mode ) EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
int deltaxy, cx, cy; int deltaxy, cx, cy;
...@@ -306,7 +306,7 @@ void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, ...@@ -306,7 +306,7 @@ void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
/* Plot round pad or via. /* Plot round pad or via.
*/ */
void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
GRTraceMode trace_mode ) EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
int rayon, delta; int rayon, delta;
...@@ -315,7 +315,8 @@ void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, ...@@ -315,7 +315,8 @@ void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
delta = wxRound( pen_diameter - pen_overlap ); delta = wxRound( pen_diameter - pen_overlap );
rayon = diametre / 2; rayon = diametre / 2;
if( trace_mode != FILAIRE )
if( trace_mode != LINE )
{ {
rayon = ( diametre - wxRound( pen_diameter ) ) / 2; rayon = ( diametre - wxRound( pen_diameter ) ) / 2;
} }
...@@ -357,7 +358,7 @@ void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, ...@@ -357,7 +358,7 @@ void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
* Units are user units * Units are user units
*/ */
void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize, void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
int orient, GRTraceMode trace_mode ) int orient, EDA_DRAW_MODE_T trace_mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
wxSize size; wxSize size;
...@@ -367,7 +368,7 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize, ...@@ -367,7 +368,7 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
size.x = padsize.x / 2; size.x = padsize.x / 2;
size.y = padsize.y / 2; size.y = padsize.y / 2;
if( trace_mode != FILAIRE ) if( trace_mode != LINE )
{ {
size.x = (padsize.x - (int) pen_diameter) / 2; size.x = (padsize.x - (int) pen_diameter) / 2;
size.y = (padsize.y - (int) pen_diameter) / 2; size.y = (padsize.y - (int) pen_diameter) / 2;
...@@ -475,7 +476,7 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize, ...@@ -475,7 +476,7 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
* Plot mode FILLED or SKETCH * Plot mode FILLED or SKETCH
*/ */
void HPGL_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], void HPGL_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
int aPadOrient, GRTraceMode aTrace_Mode ) int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
wxPoint polygone[4]; // coordinates of corners relatives to the pad wxPoint polygone[4]; // coordinates of corners relatives to the pad
......
...@@ -456,7 +456,7 @@ bool PS_PLOTTER::end_plot() ...@@ -456,7 +456,7 @@ bool PS_PLOTTER::end_plot()
* The shape is drawn as a segment * The shape is drawn as a segment
*/ */
void PS_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, void PS_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
GRTraceMode modetrace ) EDA_DRAW_MODE_T modetrace )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
int x0, y0, x1, y1, delta; int x0, y0, x1, y1, delta;
...@@ -489,7 +489,7 @@ void PS_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient, ...@@ -489,7 +489,7 @@ void PS_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
/* Plot round pad or via. /* Plot round pad or via.
*/ */
void PS_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, void PS_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
GRTraceMode modetrace ) EDA_DRAW_MODE_T modetrace )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
...@@ -509,7 +509,7 @@ void PS_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, ...@@ -509,7 +509,7 @@ void PS_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
/* Plot rectangular pad in any orientation. /* Plot rectangular pad in any orientation.
*/ */
void PS_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size, void PS_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
int orient, GRTraceMode trace_mode ) int orient, EDA_DRAW_MODE_T trace_mode )
{ {
static std::vector< wxPoint > cornerList; static std::vector< wxPoint > cornerList;
cornerList.clear(); cornerList.clear();
...@@ -557,7 +557,7 @@ void PS_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size, ...@@ -557,7 +557,7 @@ void PS_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
* Plot mode FILLED or SKETCH * Plot mode FILLED or SKETCH
*/ */
void PS_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4], void PS_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
int aPadOrient, GRTraceMode aTrace_Mode ) int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{ {
static std::vector< wxPoint > cornerList; static std::vector< wxPoint > cornerList;
cornerList.clear(); cornerList.clear();
......
///////////////////////////////////////////////////////////////////////////// /*
// Name: copy_to_clipboard.cpp * This program source code file is part of KiCad, a free EDA CAD application.
// Author: jean-pierre Charras *
// Created: 18 aug 2006 * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
// Licence: License GNU * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
///////////////////////////////////////////////////////////////////////////// *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file copy_to_clipboard.cpp
*/
#include "wx/metafile.h" #include "wx/metafile.h"
#include "fctsys.h" #include "fctsys.h"
...@@ -73,7 +94,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) ...@@ -73,7 +94,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
wxMetafileDC dc; wxMetafileDC dc;
EDA_RECT tmp = aFrame->GetCanvas()->m_ClipBox; EDA_RECT tmp = *aFrame->GetCanvas()->GetClipBox();
GRResetPenAndBrush( &dc ); GRResetPenAndBrush( &dc );
const bool plotBlackAndWhite = false; const bool plotBlackAndWhite = false;
GRForceBlackPen( plotBlackAndWhite ); GRForceBlackPen( plotBlackAndWhite );
...@@ -81,10 +102,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) ...@@ -81,10 +102,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
dc.SetUserScale( scale, scale ); dc.SetUserScale( scale, scale );
ClipboardSizeX = dc.MaxX() + 10; ClipboardSizeX = dc.MaxX() + 10;
ClipboardSizeY = dc.MaxY() + 10; ClipboardSizeY = dc.MaxY() + 10;
aFrame->GetCanvas()->m_ClipBox.SetX( 0 ); aFrame->GetCanvas()->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) );
aFrame->GetCanvas()->m_ClipBox.SetY( 0 );
aFrame->GetCanvas()->m_ClipBox.SetWidth( 0x7FFFFF0 );
aFrame->GetCanvas()->m_ClipBox.SetHeight( 0x7FFFFF0 );
if( DrawBlock ) if( DrawBlock )
{ {
...@@ -94,7 +112,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame ) ...@@ -94,7 +112,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
const int maskLayer = 0xFFFFFFFF; const int maskLayer = 0xFFFFFFFF;
aFrame->PrintPage( &dc, maskLayer, false ); aFrame->PrintPage( &dc, maskLayer, false );
screen->m_IsPrinting = false; screen->m_IsPrinting = false;
aFrame->GetCanvas()->m_ClipBox = tmp; aFrame->GetCanvas()->SetClipBox( tmp );
wxMetafile* mf = dc.Close(); wxMetafile* mf = dc.Close();
if( mf ) if( mf )
......
...@@ -214,19 +214,24 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -214,19 +214,24 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
info.AddDeveloper( new Contributor( wxT( "KBool Library" ), info.AddDeveloper( new Contributor( wxT( "KBool Library" ),
wxT( "http://boolean.klaasholwerda.nl/bool.html" ) ) ); wxT( "http://boolean.klaasholwerda.nl/bool.html" ) ) );
info.AddDeveloper( new Contributor( wxT( "Lorenzo Marcantonio" ), wxT( "lomarcan@tin.it" ) ) ); info.AddDeveloper( new Contributor( wxT( "Lorenzo Marcantonio" ), wxT( "lomarcan@tin.it" ) ) );
info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ), wxT( "marco.serantoni@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ),
wxT( "marco.serantoni@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Marco Mattila" ), wxT( "marcom99@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Marco Mattila" ), wxT( "marcom99@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Rafael Sokolowski" ), info.AddDeveloper( new Contributor( wxT( "Rafael Sokolowski" ),
wxT( "rafael.sokolowski@web.de" ) ) ); wxT( "rafael.sokolowski@web.de" ) ) );
info.AddDeveloper( new Contributor( wxT( "Rok Markovic" ), wxT( "rok@kanardia.eu" ) ) ); info.AddDeveloper( new Contributor( wxT( "Rok Markovic" ), wxT( "rok@kanardia.eu" ) ) );
info.AddDeveloper( new Contributor( wxT( "Tim Hanson" ), wxT( "sideskate@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Tim Hanson" ), wxT( "sideskate@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Vesa Solonen" ), wxT( "vesa.solonen@hut.fi" ) ) ); info.AddDeveloper( new Contributor( wxT( "Vesa Solonen" ), wxT( "vesa.solonen@hut.fi" ) ) );
info.AddDeveloper( new Contributor( wxT( "Wayne Stambaugh" ), wxT( "stambaughw@verizon.net" ) ) ); info.AddDeveloper( new Contributor( wxT( "Wayne Stambaugh" ),
wxT( "stambaughw@verizon.net" ) ) );
/* The document writers */ /* The document writers */
info.AddDocWriter( new Contributor( wxT( "Jean-Pierre Charras" ), info.AddDocWriter( new Contributor( wxT( "Jean-Pierre Charras" ),
wxT( "jean-pierre.charras@gipsa-lab.inpg.fr" ) ) ); wxT( "jean-pierre.charras@gipsa-lab.inpg.fr" ) ) );
info.AddDocWriter( new Contributor( wxT( "Igor Plyatov" ), wxT( "plyatov@gmail.com" ) ) ); info.AddDocWriter( new Contributor( wxT( "Igor Plyatov" ),
wxT( "plyatov@gmail.com" ) ) );
info.AddDocWriter( new Contributor( wxT( "Fabrizio Tappero" ),
wxT( "fabrizio.tappero@gmail.com" ) ) );
/* The translators /* The translators
* As category the language to which the translation was done is used * As category the language to which the translation was done is used
...@@ -270,7 +275,9 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -270,7 +275,9 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
wxT( "evgeniy_p_ivanov@yahoo.ca" ), wxT( "Bulgarian (BG)" ), wxT( "evgeniy_p_ivanov@yahoo.ca" ), wxT( "Bulgarian (BG)" ),
KiBitmapNew( lang_bg_xpm ) ) ); KiBitmapNew( lang_bg_xpm ) ) );
/* TODO: are these all russian translators, placed them here now, or else align them below other language maintainer with mail adress */ // TODO: are these all russian translators,
// placed them here now,
// or else align them below other language maintainer with mail adress
info.AddTranslator( new Contributor( wxT( "Remy Halvick" ), wxEmptyString, wxT( "Others" ) ) ); info.AddTranslator( new Contributor( wxT( "Remy Halvick" ), wxEmptyString, wxT( "Others" ) ) );
info.AddTranslator( new Contributor( wxT( "David Briscoe" ), wxEmptyString, wxT( "Others" ) ) ); info.AddTranslator( new Contributor( wxT( "David Briscoe" ), wxEmptyString, wxT( "Others" ) ) );
info.AddTranslator( new Contributor( wxT( "Dominique Laigle" ), wxEmptyString, wxT( "Others" ) ) ); info.AddTranslator( new Contributor( wxT( "Dominique Laigle" ), wxEmptyString, wxT( "Others" ) ) );
......
...@@ -28,10 +28,7 @@ ...@@ -28,10 +28,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h"
#include "class_bitmap_base.h" #include "class_bitmap_base.h"
#include "dialog_image_editor.h" #include "dialog_image_editor.h"
......
...@@ -183,7 +183,7 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event ) ...@@ -183,7 +183,7 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
m_FrameIsActive = event.GetActive(); m_FrameIsActive = event.GetActive();
if( m_canvas ) if( m_canvas )
m_canvas->m_CanStartBlock = -1; m_canvas->SetCanStartBlock( -1 );
event.Skip(); // required under wxMAC event.Skip(); // required under wxMAC
} }
...@@ -192,7 +192,7 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event ) ...@@ -192,7 +192,7 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event ) void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event )
{ {
if( m_canvas ) if( m_canvas )
m_canvas->m_CanStartBlock = -1; m_canvas->SetCanStartBlock( -1 );
event.Skip(); event.Skip();
} }
...@@ -486,7 +486,7 @@ int EDA_DRAW_FRAME::ReturnBlockCommand( int key ) ...@@ -486,7 +486,7 @@ int EDA_DRAW_FRAME::ReturnBlockCommand( int key )
void EDA_DRAW_FRAME::InitBlockPasteInfos() void EDA_DRAW_FRAME::InitBlockPasteInfos()
{ {
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
m_canvas->m_mouseCaptureCallback = NULL; m_canvas->SetMouseCaptureCallback( NULL );
} }
......
...@@ -94,19 +94,19 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id, ...@@ -94,19 +94,19 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
m_ClipBox.SetSize( size ); m_ClipBox.SetSize( size );
m_ClipBox.SetX( 0 ); m_ClipBox.SetX( 0 );
m_ClipBox.SetY( 0 ); m_ClipBox.SetY( 0 );
m_CanStartBlock = -1; // Command block can start if >= 0 m_canStartBlock = -1; // Command block can start if >= 0
m_AbortEnable = m_AbortRequest = false; m_abortRequest = false;
m_AutoPAN_Enable = true; m_enableAutoPan = true;
m_IgnoreMouseEvents = 0; m_ignoreMouseEvents = false;
m_mouseCaptureCallback = NULL; m_mouseCaptureCallback = NULL;
m_endMouseCaptureCallback = NULL; m_endMouseCaptureCallback = NULL;
if( wxGetApp().GetSettings() ) if( wxGetApp().GetSettings() )
wxGetApp().GetSettings()->Read( wxT( "AutoPAN" ), &m_AutoPAN_Enable, true ); wxGetApp().GetSettings()->Read( wxT( "AutoPAN" ), &m_enableAutoPan, true );
m_AutoPAN_Request = false; m_requestAutoPan = false;
m_Block_Enable = false; m_enableBlockCommands = false;
#ifdef __WXMAC__ #ifdef __WXMAC__
m_defaultCursor = m_currentCursor = wxCURSOR_CROSS; m_defaultCursor = m_currentCursor = wxCURSOR_CROSS;
...@@ -123,7 +123,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id, ...@@ -123,7 +123,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
EDA_DRAW_PANEL::~EDA_DRAW_PANEL() EDA_DRAW_PANEL::~EDA_DRAW_PANEL()
{ {
wxGetApp().GetSettings()->Write( wxT( "AutoPAN" ), m_AutoPAN_Enable ); wxGetApp().GetSettings()->Write( wxT( "AutoPAN" ), m_enableAutoPan );
} }
...@@ -306,7 +306,7 @@ void EDA_DRAW_PANEL::MoveCursor( const wxPoint& aPosition ) ...@@ -306,7 +306,7 @@ void EDA_DRAW_PANEL::MoveCursor( const wxPoint& aPosition )
void EDA_DRAW_PANEL::OnActivate( wxActivateEvent& event ) void EDA_DRAW_PANEL::OnActivate( wxActivateEvent& event )
{ {
m_CanStartBlock = -1; // Block Command can't start m_canStartBlock = -1; // Block Command can't start
event.Skip(); event.Skip();
} }
...@@ -751,10 +751,10 @@ bool EDA_DRAW_PANEL::OnRightClick( wxMouseEvent& event ) ...@@ -751,10 +751,10 @@ bool EDA_DRAW_PANEL::OnRightClick( wxMouseEvent& event )
GetParent()->AddMenuZoomAndGrid( &MasterMenu ); GetParent()->AddMenuZoomAndGrid( &MasterMenu );
pos = event.GetPosition(); pos = event.GetPosition();
m_IgnoreMouseEvents = true; m_ignoreMouseEvents = true;
PopupMenu( &MasterMenu, pos ); PopupMenu( &MasterMenu, pos );
MoveCursorToCrossHair(); MoveCursorToCrossHair();
m_IgnoreMouseEvents = false; m_ignoreMouseEvents = false;
return true; return true;
} }
...@@ -763,9 +763,9 @@ bool EDA_DRAW_PANEL::OnRightClick( wxMouseEvent& event ) ...@@ -763,9 +763,9 @@ bool EDA_DRAW_PANEL::OnRightClick( wxMouseEvent& event )
void EDA_DRAW_PANEL::OnMouseLeaving( wxMouseEvent& event ) void EDA_DRAW_PANEL::OnMouseLeaving( wxMouseEvent& event )
{ {
if( m_mouseCaptureCallback == NULL ) // No command in progress. if( m_mouseCaptureCallback == NULL ) // No command in progress.
m_AutoPAN_Request = false; m_requestAutoPan = false;
if( !m_AutoPAN_Enable || !m_AutoPAN_Request || m_IgnoreMouseEvents ) if( !m_enableAutoPan || !m_requestAutoPan || m_ignoreMouseEvents )
return; return;
// Auto pan if mouse is leave working area: // Auto pan if mouse is leave working area:
...@@ -785,7 +785,7 @@ void EDA_DRAW_PANEL::OnMouseLeaving( wxMouseEvent& event ) ...@@ -785,7 +785,7 @@ void EDA_DRAW_PANEL::OnMouseLeaving( wxMouseEvent& event )
void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event ) void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
{ {
if( m_IgnoreMouseEvents ) if( m_ignoreMouseEvents )
return; return;
wxRect rect = wxRect( wxPoint( 0, 0 ), GetClientSize() ); wxRect rect = wxRect( wxPoint( 0, 0 ), GetClientSize() );
...@@ -857,18 +857,18 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -857,18 +857,18 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
/* Count the drag events. Used to filter mouse moves before starting a /* Count the drag events. Used to filter mouse moves before starting a
* block command. A block command can be started only if * block command. A block command can be started only if
* MinDragEventCount > MIN_DRAG_COUNT_FOR_START_BLOCK_COMMAND * MinDragEventCount > MIN_DRAG_COUNT_FOR_START_BLOCK_COMMAND
* and m_CanStartBlock >= 0 * and m_canStartBlock >= 0
* in order to avoid spurious block commands. * in order to avoid spurious block commands.
*/ */
static int MinDragEventCount; static int MinDragEventCount;
if( event.Leaving() ) if( event.Leaving() )
{ {
m_CanStartBlock = -1; m_canStartBlock = -1;
} }
if( !IsMouseCaptured() ) // No mouse capture in progress. if( !IsMouseCaptured() ) // No mouse capture in progress.
m_AutoPAN_Request = false; m_requestAutoPan = false;
if( GetParent()->IsActive() ) if( GetParent()->IsActive() )
SetFocus(); SetFocus();
...@@ -886,7 +886,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -886,7 +886,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
return; return;
} }
if( m_IgnoreMouseEvents ) if( m_ignoreMouseEvents )
return; return;
if( event.LeftIsDown() ) if( event.LeftIsDown() )
...@@ -973,7 +973,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -973,7 +973,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
if( LastPanel != this ) if( LastPanel != this )
{ {
MinDragEventCount = 0; MinDragEventCount = 0;
m_CanStartBlock = -1; m_canStartBlock = -1;
} }
/* A new command block can start after a release buttons /* A new command block can start after a release buttons
...@@ -985,7 +985,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -985,7 +985,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
if( !event.LeftIsDown() && !event.MiddleIsDown() ) if( !event.LeftIsDown() && !event.MiddleIsDown() )
{ {
MinDragEventCount = 0; MinDragEventCount = 0;
m_CanStartBlock = 0; m_canStartBlock = 0;
/* Remember the last cursor position when a drag mouse starts /* Remember the last cursor position when a drag mouse starts
* this is the last position ** before ** clicking a button * this is the last position ** before ** clicking a button
...@@ -997,7 +997,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -997,7 +997,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
m_CursorStartPos = screen->GetCrossHairPosition(); m_CursorStartPos = screen->GetCrossHairPosition();
} }
if( m_Block_Enable && !(localbutt & GR_M_DCLICK) ) if( m_enableBlockCommands && !(localbutt & GR_M_DCLICK) )
{ {
if( !screen->IsBlockActive() ) if( !screen->IsBlockActive() )
{ {
...@@ -1008,12 +1008,12 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -1008,12 +1008,12 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
{ {
if( screen->m_BlockLocate.m_State == STATE_BLOCK_MOVE ) if( screen->m_BlockLocate.m_State == STATE_BLOCK_MOVE )
{ {
m_AutoPAN_Request = false; m_requestAutoPan = false;
GetParent()->HandleBlockPlace( &DC ); GetParent()->HandleBlockPlace( &DC );
ignoreNextLeftButtonRelease = true; ignoreNextLeftButtonRelease = true;
} }
} }
else if( ( m_CanStartBlock >= 0 ) else if( ( m_canStartBlock >= 0 )
&& ( event.LeftIsDown() || event.MiddleIsDown() ) && ( event.LeftIsDown() || event.MiddleIsDown() )
&& !IsMouseCaptured() ) && !IsMouseCaptured() )
{ {
...@@ -1042,7 +1042,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -1042,7 +1042,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
} }
else else
{ {
m_AutoPAN_Request = true; m_requestAutoPan = true;
SetCursor( wxCURSOR_SIZING ); SetCursor( wxCURSOR_SIZING );
} }
} }
...@@ -1068,19 +1068,19 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ...@@ -1068,19 +1068,19 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
if( m_endMouseCaptureCallback ) if( m_endMouseCaptureCallback )
{ {
m_endMouseCaptureCallback( this, &DC ); m_endMouseCaptureCallback( this, &DC );
m_AutoPAN_Request = false; m_requestAutoPan = false;
} }
SetCursor( m_currentCursor ); SetCursor( m_currentCursor );
} }
else if( screen->m_BlockLocate.m_State == STATE_BLOCK_END ) else if( screen->m_BlockLocate.m_State == STATE_BLOCK_END )
{ {
m_AutoPAN_Request = false; m_requestAutoPan = false;
GetParent()->HandleBlockEnd( &DC ); GetParent()->HandleBlockEnd( &DC );
SetCursor( m_currentCursor ); SetCursor( m_currentCursor );
if( screen->m_BlockLocate.m_State == STATE_BLOCK_MOVE ) if( screen->m_BlockLocate.m_State == STATE_BLOCK_MOVE )
{ {
m_AutoPAN_Request = true; m_requestAutoPan = true;
SetCursor( wxCURSOR_HAND ); SetCursor( wxCURSOR_HAND );
} }
} }
...@@ -1128,7 +1128,7 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event ) ...@@ -1128,7 +1128,7 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
break; break;
case WXK_ESCAPE: case WXK_ESCAPE:
m_AbortRequest = true; m_abortRequest = true;
if( IsMouseCaptured() ) if( IsMouseCaptured() )
EndMouseCapture(); EndMouseCapture();
...@@ -1231,7 +1231,7 @@ void EDA_DRAW_PANEL::EndMouseCapture( int id, int cursor, const wxString& title, ...@@ -1231,7 +1231,7 @@ void EDA_DRAW_PANEL::EndMouseCapture( int id, int cursor, const wxString& title,
m_mouseCaptureCallback = NULL; m_mouseCaptureCallback = NULL;
m_endMouseCaptureCallback = NULL; m_endMouseCaptureCallback = NULL;
m_AutoPAN_Request = false; m_requestAutoPan = false;
if( id != -1 && cursor != -1 ) if( id != -1 && cursor != -1 )
{ {
...@@ -1239,3 +1239,21 @@ void EDA_DRAW_PANEL::EndMouseCapture( int id, int cursor, const wxString& title, ...@@ -1239,3 +1239,21 @@ void EDA_DRAW_PANEL::EndMouseCapture( int id, int cursor, const wxString& title,
GetParent()->SetToolID( id, cursor, title ); GetParent()->SetToolID( id, cursor, title );
} }
} }
void EDA_DRAW_PANEL::CallMouseCapture( wxDC* aDC, const wxPoint& aPosition, bool aErase )
{
wxCHECK_RET( aDC != NULL, wxT( "Invalid device context." ) );
wxCHECK_RET( m_mouseCaptureCallback != NULL, wxT( "Mouse capture callback not set." ) );
m_mouseCaptureCallback( this, aDC, aPosition, aErase );
}
void EDA_DRAW_PANEL::CallEndMouseCapture( wxDC* aDC )
{
wxCHECK_RET( aDC != NULL, wxT( "Invalid device context." ) );
wxCHECK_RET( m_endMouseCaptureCallback != NULL, wxT( "End mouse capture callback not set." ) );
m_endMouseCaptureCallback( this, aDC );
}
...@@ -230,8 +230,8 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, ...@@ -230,8 +230,8 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
const wxString& aText, const wxString& aText,
int aOrient, int aOrient,
const wxSize& aSize, const wxSize& aSize,
enum GRTextHorizJustifyType aH_justify, enum EDA_TEXT_HJUSTIFY_T aH_justify,
enum GRTextVertJustifyType aV_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
int aWidth, int aWidth,
bool aItalic, bool aItalic,
bool aBold, bool aBold,
...@@ -249,7 +249,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, ...@@ -249,7 +249,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
int overbar_italic_comp; // Italic compensation for overbar int overbar_italic_comp; // Italic compensation for overbar
EDA_RECT* clipBox; // Clip box used in basic draw functions EDA_RECT* clipBox; // Clip box used in basic draw functions
clipBox = aPanel ? &aPanel->m_ClipBox : NULL; clipBox = aPanel ? aPanel->GetClipBox() : NULL;
#define BUF_SIZE 100 #define BUF_SIZE 100
wxPoint coord[BUF_SIZE + 1]; // Buffer coordinate used to draw polylines (one char shape) wxPoint coord[BUF_SIZE + 1]; // Buffer coordinate used to draw polylines (one char shape)
bool sketch_mode = false; bool sketch_mode = false;
...@@ -292,10 +292,10 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, ...@@ -292,10 +292,10 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
xc = current_char_pos.x; xc = current_char_pos.x;
yc = current_char_pos.y; yc = current_char_pos.y;
x0 = aPanel->m_ClipBox.GetX() - ll; x0 = aPanel->GetClipBox()->GetX() - ll;
y0 = aPanel->m_ClipBox.GetY() - ll; y0 = aPanel->GetClipBox()->GetY() - ll;
xm = aPanel->m_ClipBox.GetRight() + ll; xm = aPanel->GetClipBox()->GetRight() + ll;
ym = aPanel->m_ClipBox.GetBottom() + ll; ym = aPanel->GetClipBox()->GetBottom() + ll;
if( xc < x0 ) if( xc < x0 )
return; return;
...@@ -366,7 +366,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, ...@@ -366,7 +366,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
aCallback( current_char_pos.x, current_char_pos.y, end.x, end.y ); aCallback( current_char_pos.x, current_char_pos.y, end.x, end.y );
} }
else else
GRLine( &aPanel->m_ClipBox, aDC, GRLine( aPanel->GetClipBox(), aDC,
current_char_pos.x, current_char_pos.y, end.x, end.y, aWidth, aColor ); current_char_pos.x, current_char_pos.y, end.x, end.y, aWidth, aColor );
return; return;
...@@ -521,8 +521,8 @@ void PLOTTER::text( const wxPoint& aPos, ...@@ -521,8 +521,8 @@ void PLOTTER::text( const wxPoint& aPos,
const wxString& aText, const wxString& aText,
int aOrient, int aOrient,
const wxSize& aSize, const wxSize& aSize,
enum GRTextHorizJustifyType aH_justify, enum EDA_TEXT_HJUSTIFY_T aH_justify,
enum GRTextVertJustifyType aV_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify,
int aWidth, int aWidth,
bool aItalic, bool aItalic,
bool aBold ) bool aBold )
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
*/ */
/** /**
* @file edaapl.cpp * @file edaappl.cpp
* *
* @brief For the main application: init functions, and language selection * @brief For the main application: init functions, and language selection
* (locale handling) * (locale handling)
......
...@@ -80,37 +80,6 @@ SCH_ITEM::~SCH_ITEM() ...@@ -80,37 +80,6 @@ SCH_ITEM::~SCH_ITEM()
} }
void SCH_ITEM::Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC )
{
SCH_SCREEN* screen = aFrame->GetScreen();
if( IsNew() )
{
if( !screen->CheckIfOnDrawList( this ) ) // don't want a loop!
screen->AddToDrawList( this );
aFrame->SetRepeatItem( this );
aFrame->SaveCopyInUndoList( this, UR_NEW );
}
else
{
aFrame->SaveUndoItemInUndoList( this );
}
m_Flags = 0;
screen->SetModify();
screen->SetCurItem( NULL );
aFrame->GetCanvas()->SetMouseCapture( NULL, NULL );
aFrame->GetCanvas()->EndMouseCapture();
if( aDC )
{
EDA_CROSS_HAIR_MANAGER( aFrame->GetCanvas(), aDC ); // Erase schematic cursor
Draw( aFrame->GetCanvas(), aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
}
}
bool SCH_ITEM::IsConnected( const wxPoint& aPosition ) const bool SCH_ITEM::IsConnected( const wxPoint& aPosition ) const
{ {
if( m_Flags & STRUCT_DELETED || m_Flags & SKIP_STRUCT ) if( m_Flags & STRUCT_DELETED || m_Flags & SKIP_STRUCT )
......
...@@ -1034,7 +1034,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1034,7 +1034,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( !screen->m_IsPrinting & g_ShowPageLimits ) if( !screen->m_IsPrinting & g_ShowPageLimits )
{ {
GRSetDrawMode( DC, GR_COPY ); GRSetDrawMode( DC, GR_COPY );
GRRect( &m_canvas->m_ClipBox, DC, 0, 0, GRRect( m_canvas->GetClipBox(), DC, 0, 0,
pageSize.x * scale, pageSize.y * scale, width, pageSize.x * scale, pageSize.y * scale, width,
g_DrawBgColor == WHITE ? LIGHTGRAY : DARKDARKGRAY ); g_DrawBgColor == WHITE ? LIGHTGRAY : DARKDARKGRAY );
} }
...@@ -1052,13 +1052,13 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1052,13 +1052,13 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
yg = pageSize.y - pageInfo.GetBottomMarginMils(); yg = pageSize.y - pageInfo.GetBottomMarginMils();
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
GRRect( &m_canvas->m_ClipBox, DC, refx * scale, refy * scale, GRRect( m_canvas->GetClipBox(), DC, refx * scale, refy * scale,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
#else #else
for( ii = 0; ii < 2; ii++ ) for( ii = 0; ii < 2; ii++ )
{ {
GRRect( &m_canvas->m_ClipBox, DC, refx * scale, refy * scale, GRRect( m_canvas->GetClipBox(), DC, refx * scale, refy * scale,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
refx += GRID_REF_W; refy += GRID_REF_W; refx += GRID_REF_W; refy += GRID_REF_W;
...@@ -1094,7 +1094,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1094,7 +1094,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
case WS_SEGMENT_LU: case WS_SEGMENT_LU:
xg = pageInfo.GetLeftMargin() - WsItem->m_Endx; xg = pageInfo.GetLeftMargin() - WsItem->m_Endx;
yg = pageSize.y - pageInfo.GetBottomMarginMils() - WsItem->m_Endy; yg = pageSize.y - pageInfo.GetBottomMarginMils() - WsItem->m_Endy;
GRLine( &m_canvas->m_ClipBox, DC, pos.x, pos.y, GRLine( m_canvas->GetClipBox(), DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
break; break;
} }
...@@ -1111,7 +1111,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1111,7 +1111,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
case WS_SEGMENT_LT: case WS_SEGMENT_LT:
xg = pageInfo.GetLeftMarginMils() + WsItem->m_Endx; xg = pageInfo.GetLeftMarginMils() + WsItem->m_Endx;
yg = pageInfo.GetBottomMarginMils() + WsItem->m_Endy; yg = pageInfo.GetBottomMarginMils() + WsItem->m_Endy;
GRLine( &m_canvas->m_ClipBox, DC, pos.x, pos.y, GRLine( &m_canvas->GetClipBox(), DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
break; break;
} }
...@@ -1134,7 +1134,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1134,7 +1134,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( ii < xg - PAS_REF / 2 ) if( ii < xg - PAS_REF / 2 )
{ {
GRLine( &m_canvas->m_ClipBox, DC, ii * scale, refy * scale, GRLine( m_canvas->GetClipBox(), DC, ii * scale, refy * scale,
ii * scale, ( refy + GRID_REF_W ) * scale, width, Color ); ii * scale, ( refy + GRID_REF_W ) * scale, width, Color );
} }
DrawGraphicText( m_canvas, DC, DrawGraphicText( m_canvas, DC,
...@@ -1146,7 +1146,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1146,7 +1146,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( ii < xg - PAS_REF / 2 ) if( ii < xg - PAS_REF / 2 )
{ {
GRLine( &m_canvas->m_ClipBox, DC, ii * scale, yg * scale, GRLine( m_canvas->GetClipBox(), DC, ii * scale, yg * scale,
ii * scale, ( yg - GRID_REF_W ) * scale, width, Color ); ii * scale, ( yg - GRID_REF_W ) * scale, width, Color );
} }
DrawGraphicText( m_canvas, DC, DrawGraphicText( m_canvas, DC,
...@@ -1169,7 +1169,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1169,7 +1169,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( ii < yg - PAS_REF / 2 ) if( ii < yg - PAS_REF / 2 )
{ {
GRLine( &m_canvas->m_ClipBox, DC, refx * scale, ii * scale, GRLine( m_canvas->GetClipBox(), DC, refx * scale, ii * scale,
( refx + GRID_REF_W ) * scale, ii * scale, width, Color ); ( refx + GRID_REF_W ) * scale, ii * scale, width, Color );
} }
...@@ -1182,7 +1182,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1182,7 +1182,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( ii < yg - PAS_REF / 2 ) if( ii < yg - PAS_REF / 2 )
{ {
GRLine( &m_canvas->m_ClipBox, DC, xg * scale, ii * scale, GRLine( m_canvas->GetClipBox(), DC, xg * scale, ii * scale,
( xg - GRID_REF_W ) * scale, ii * scale, width, Color ); ( xg - GRID_REF_W ) * scale, ii * scale, width, Color );
} }
DrawGraphicText( m_canvas, DC, DrawGraphicText( m_canvas, DC,
...@@ -1336,7 +1336,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1336,7 +1336,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
pageInfo.GetRightMarginMils() - WsItem->m_Endx; pageInfo.GetRightMarginMils() - WsItem->m_Endx;
yg = pageSize.y - yg = pageSize.y -
pageInfo.GetBottomMarginMils() - WsItem->m_Endy; pageInfo.GetBottomMarginMils() - WsItem->m_Endy;
GRLine( &m_canvas->m_ClipBox, DC, pos.x, pos.y, GRLine( &m_canvas->GetClipBox(), DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
break; break;
} }
...@@ -1400,7 +1400,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1400,7 +1400,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
pageInfo.GetRightMarginMils() - WsItem->m_Endx; pageInfo.GetRightMarginMils() - WsItem->m_Endx;
yg = pageSize.y - yg = pageSize.y -
pageInfo.GetBottomMarginMils() - WsItem->m_Endy; pageInfo.GetBottomMarginMils() - WsItem->m_Endy;
GRLine( &m_canvas->m_ClipBox, DC, pos.x, pos.y, GRLine( &m_canvas->GetClipBox(), DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
break; break;
} }
...@@ -1597,7 +1597,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1597,7 +1597,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
GRID_REF_W - pageInfo.GetRightMarginMils() - WsItem->m_Endx; GRID_REF_W - pageInfo.GetRightMarginMils() - WsItem->m_Endx;
yg = pageSize.y - yg = pageSize.y -
GRID_REF_W - pageInfo.GetBottomMarginMils() - WsItem->m_Endy; GRID_REF_W - pageInfo.GetBottomMarginMils() - WsItem->m_Endy;
GRLine( &m_canvas->m_ClipBox, DC, pos.x, pos.y, GRLine( m_canvas->GetClipBox(), DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color ); xg * scale, yg * scale, width, Color );
break; break;
} }
......
...@@ -415,7 +415,7 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi ...@@ -415,7 +415,7 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, 0 ); m_canvas->CallMouseCapture( aDC, aPosition, 0 );
} }
} }
......
...@@ -105,7 +105,7 @@ void SCH_EDIT_FRAME::InitBlockPasteInfos() ...@@ -105,7 +105,7 @@ void SCH_EDIT_FRAME::InitBlockPasteInfos()
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate; BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
block->m_ItemsSelection.CopyList( m_blockItems.m_ItemsSelection ); block->m_ItemsSelection.CopyList( m_blockItems.m_ItemsSelection );
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
} }
...@@ -139,7 +139,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) ...@@ -139,7 +139,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_DRAG: /* Drag */ case BLOCK_DRAG: /* Drag */
case BLOCK_MOVE: /* Move */ case BLOCK_MOVE: /* Move */
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
SaveCopyInUndoList( block->m_ItemsSelection, UR_MOVED, block->m_MoveVector ); SaveCopyInUndoList( block->m_ItemsSelection, UR_MOVED, block->m_MoveVector );
MoveItemsInList( block->m_ItemsSelection, block->m_MoveVector ); MoveItemsInList( block->m_ItemsSelection, block->m_MoveVector );
...@@ -149,7 +149,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) ...@@ -149,7 +149,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_COPY: /* Copy */ case BLOCK_COPY: /* Copy */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
DuplicateItemsInList( GetScreen(), block->m_ItemsSelection, block->m_MoveVector ); DuplicateItemsInList( GetScreen(), block->m_ItemsSelection, block->m_MoveVector );
...@@ -161,7 +161,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) ...@@ -161,7 +161,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_PASTE: case BLOCK_PASTE:
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
PasteListOfItems( DC ); PasteListOfItems( DC );
block->ClearItemsList(); block->ClearItemsList();
...@@ -206,8 +206,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -206,8 +206,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
BlockState state = block->m_State; BlockState state = block->m_State;
CmdBlockType command = block->m_Command; CmdBlockType command = block->m_Command;
if( m_canvas->m_endMouseCaptureCallback ) m_canvas->CallEndMouseCapture( DC );
m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
block->m_State = state; block->m_State = state;
block->m_Command = command; block->m_Command = command;
...@@ -243,14 +242,14 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -243,14 +242,14 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{ {
nextcmd = true; nextcmd = true;
GetScreen()->SelectBlockItems(); GetScreen()->SelectBlockItems();
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
block->m_State = STATE_BLOCK_MOVE; block->m_State = STATE_BLOCK_MOVE;
} }
else else
{ {
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->SetMouseCapture( NULL, NULL ); m_canvas->SetMouseCapture( NULL, NULL );
} }
break; break;
...@@ -352,7 +351,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -352,7 +351,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_DRAG: /* move to Drag */ case BLOCK_DRAG: /* move to Drag */
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
// Clear list of items to move, and rebuild it with items to drag: // Clear list of items to move, and rebuild it with items to drag:
block->ClearItemsList(); block->ClearItemsList();
...@@ -366,7 +365,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -366,7 +365,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
GetScreen()->SelectBlockItems(); GetScreen()->SelectBlockItems();
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
block->m_State = STATE_BLOCK_MOVE; block->m_State = STATE_BLOCK_MOVE;
} }
...@@ -374,7 +373,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -374,7 +373,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_DELETE: /* move to Delete */ case BLOCK_DELETE: /* move to Delete */
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
...@@ -388,7 +387,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -388,7 +387,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_SAVE: /* Save list in paste buffer*/ case BLOCK_SAVE: /* Save list in paste buffer*/
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
...@@ -399,7 +398,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -399,7 +398,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
break; break;
case BLOCK_ZOOM: /* Window Zoom */ case BLOCK_ZOOM: /* Window Zoom */
m_canvas->m_endMouseCaptureCallback( m_canvas, DC ); m_canvas->CallEndMouseCapture( DC );
m_canvas->SetCursor( m_canvas->GetDefaultCursor() ); m_canvas->SetCursor( m_canvas->GetDefaultCursor() );
Window_Zoom( GetScreen()->m_BlockLocate ); Window_Zoom( GetScreen()->m_BlockLocate );
break; break;
...@@ -407,7 +406,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -407,7 +406,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_ROTATE: case BLOCK_ROTATE:
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
...@@ -426,7 +425,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -426,7 +425,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_MIRROR_X: case BLOCK_MIRROR_X:
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
...@@ -444,7 +443,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -444,7 +443,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_MIRROR_Y: case BLOCK_MIRROR_Y:
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( block->GetCount() ) if( block->GetCount() )
{ {
......
...@@ -92,7 +92,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -92,7 +92,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{ {
BlockState state = GetScreen()->m_BlockLocate.m_State; BlockState state = GetScreen()->m_BlockLocate.m_State;
CmdBlockType command = GetScreen()->m_BlockLocate.m_Command; CmdBlockType command = GetScreen()->m_BlockLocate.m_Command;
m_canvas->m_endMouseCaptureCallback( m_canvas, DC ); m_canvas->CallEndMouseCapture( DC );
GetScreen()->m_BlockLocate.m_State = state; GetScreen()->m_BlockLocate.m_State = state;
GetScreen()->m_BlockLocate.m_Command = command; GetScreen()->m_BlockLocate.m_Command = command;
m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand ); m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
...@@ -120,9 +120,9 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -120,9 +120,9 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
} }
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
...@@ -132,7 +132,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) ...@@ -132,7 +132,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
nextCmd = true; nextCmd = true;
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines; m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
break; break;
......
...@@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type ) ...@@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
return; return;
} }
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
/* Creates the new segment, or terminates the command /* Creates the new segment, or terminates the command
* if the end point is on a pin, junction or an other wire or bus */ * if the end point is on a pin, junction or an other wire or bus */
...@@ -218,7 +218,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type ) ...@@ -218,7 +218,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
oldsegment->SetFlags( SELECTED ); oldsegment->SetFlags( SELECTED );
newsegment->SetFlags( IS_NEW ); newsegment->SetFlags( IS_NEW );
GetScreen()->SetCurItem( newsegment ); GetScreen()->SetCurItem( newsegment );
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
/* This is the first segment: Now we know the start segment position. /* This is the first segment: Now we know the start segment position.
* Create a junction if needed. Note: a junction can be needed later, * Create a junction if needed. Note: a junction can be needed later,
...@@ -444,7 +444,7 @@ void SCH_EDIT_FRAME::DeleteCurrentSegment( wxDC* DC ) ...@@ -444,7 +444,7 @@ void SCH_EDIT_FRAME::DeleteCurrentSegment( wxDC* DC )
} }
screen->RemoveFromDrawList( screen->GetCurItem() ); screen->RemoveFromDrawList( screen->GetCurItem() );
m_canvas->m_mouseCaptureCallback = NULL; m_canvas->SetMouseCaptureCallback( NULL );
screen->SetCurItem( NULL ); screen->SetCurItem( NULL );
} }
......
...@@ -43,15 +43,17 @@ ...@@ -43,15 +43,17 @@
static int s_LastShape = '\\'; static int s_LastShape = '\\';
SCH_BUS_ENTRY* SCH_EDIT_FRAME::CreateBusEntry( wxDC* DC, int entry_type ) SCH_BUS_ENTRY* SCH_EDIT_FRAME::CreateBusEntry( wxDC* aDC, int aType )
{ {
SCH_SCREEN* screen = GetScreen();
// Create and place a new bus entry at cursor position // Create and place a new bus entry at cursor position
SCH_BUS_ENTRY* BusEntry = new SCH_BUS_ENTRY( GetScreen()->GetCrossHairPosition(), s_LastShape, SCH_BUS_ENTRY* busEntry = new SCH_BUS_ENTRY( screen->GetCrossHairPosition(), s_LastShape,
entry_type ); aType );
BusEntry->SetFlags( IS_NEW ); busEntry->SetFlags( IS_NEW );
BusEntry->Place( this, DC ); GetScreen()->SetCurItem( busEntry );
OnModify(); addCurrentItemToList( aDC );
return BusEntry; return busEntry;
} }
......
...@@ -362,9 +362,9 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff ...@@ -362,9 +362,9 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff
#if 0 #if 0
int len = aDc->DeviceToLogicalXRel( 3 ); int len = aDc->DeviceToLogicalXRel( 3 );
GRLine( &aPanel->m_ClipBox, aDc, aOffset.x, aOffset.y - len, aOffset.x, GRLine( aPanel->GetClipBox(), aDc, aOffset.x, aOffset.y - len, aOffset.x,
aOffset.y + len, 0, aColor ); aOffset.y + len, 0, aColor );
GRLine( &aPanel->m_ClipBox, aDc, aOffset.x - len, aOffset.y, aOffset.x + len, GRLine( aPanel->GetClipBox(), aDc, aOffset.x - len, aOffset.y, aOffset.x + len,
aOffset.y, 0, aColor ); aOffset.y, 0, aColor );
#endif #endif
...@@ -372,7 +372,7 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff ...@@ -372,7 +372,7 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff
* the bounding box calculations. */ * the bounding box calculations. */
#if 0 #if 0
EDA_RECT bBox = GetBoundingBox( aMulti, aConvert ); EDA_RECT bBox = GetBoundingBox( aMulti, aConvert );
GRRect( &aPanel->m_ClipBox, aDc, bBox.GetOrigin().x, bBox.GetOrigin().y, GRRect( aPanel->GetClipBox(), aDc, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif #endif
} }
...@@ -756,7 +756,7 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) ...@@ -756,7 +756,7 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
if( ( p = strtok( NULL, " \t\n" ) ) != NULL && *p == 'P' ) if( ( p = strtok( NULL, " \t\n" ) ) != NULL && *p == 'P' )
m_options = ENTRY_POWER; m_options = ENTRY_POWER;
/* Read next lines */ // Read next lines, until "ENDDEF" is found
while( aLineReader.ReadLine() ) while( aLineReader.ReadLine() )
{ {
line = aLineReader.Line(); line = aLineReader.Line();
...@@ -766,11 +766,14 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) ...@@ -766,11 +766,14 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
/* This is the error flag ( if an error occurs, Res = FALSE) */ /* This is the error flag ( if an error occurs, Res = FALSE) */
Res = true; Res = true;
if( *line == '#' ) // a comment
continue;
if( (*line == 'T') && (*(line + 1) == 'i') ) if( (*line == 'T') && (*(line + 1) == 'i') )
Res = LoadDateAndTime( aLineReader ); Res = LoadDateAndTime( aLineReader );
else if( *line == 'F' ) else if( *line == 'F' )
Res = LoadField( aLineReader, Msg ); Res = LoadField( aLineReader, Msg );
else if( strcmp( p, "ENDDEF" ) == 0 ) else if( strcmp( p, "ENDDEF" ) == 0 ) // End of component description
break; break;
else if( strcmp( p, "DRAW" ) == 0 ) else if( strcmp( p, "DRAW" ) == 0 )
Res = LoadDrawEntries( aLineReader, Msg ); Res = LoadDrawEntries( aLineReader, Msg );
......
...@@ -62,9 +62,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC ...@@ -62,9 +62,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
// If the user aborted the clarification context menu, don't show it again at the // If the user aborted the clarification context menu, don't show it again at the
// off grid position. // off grid position.
if( !item && m_canvas->m_AbortRequest ) if( !item && m_canvas->GetAbortRequest() )
{ {
m_canvas->m_AbortRequest = false; m_canvas->SetAbortRequest( false );
return NULL; return NULL;
} }
...@@ -73,7 +73,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC ...@@ -73,7 +73,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
if( !item ) if( !item )
{ {
m_canvas->m_AbortRequest = false; // Just in case the user aborted the context menu. m_canvas->SetAbortRequest( false ); // Just in case the user aborted the context menu.
return NULL; return NULL;
} }
...@@ -171,7 +171,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF ...@@ -171,7 +171,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF
// Set to NULL in case user aborts the clarification context menu. // Set to NULL in case user aborts the clarification context menu.
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
m_canvas->m_AbortRequest = true; // Changed to false if an item is selected m_canvas->SetAbortRequest( true ); // Changed to false if an item is selected
PopupMenu( &selectMenu ); PopupMenu( &selectMenu );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
item = GetScreen()->GetCurItem(); item = GetScreen()->GetCurItem();
...@@ -247,16 +247,18 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -247,16 +247,18 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC ); wxDCOverlay oDC( m_overlay, (wxWindowDC*)aDC );
oDC.Clear(); oDC.Clear();
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false ); m_canvas->CallMouseCapture( aDC, aPosition, false );
#else #else
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true ); m_canvas->CallMouseCapture( aDC, aPosition, true );
#endif #endif
} }
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
else else
m_canvas->m_overlay.Reset(); {
m_overlay.Reset();
}
#endif #endif
} }
...@@ -330,16 +332,18 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -330,16 +332,18 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC ); wxDCOverlay oDC( m_overlay, (wxWindowDC*)aDC );
oDC.Clear(); oDC.Clear();
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false ); m_canvas->CallMouseCapture( aDC, aPosition, false );
#else #else
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true ); m_canvas->CallMouseCapture( aDC, aPosition, true );
#endif #endif
} }
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
else else
m_canvas->m_overlay.Reset(); {
m_overlay.Reset();
}
#endif #endif
} }
...@@ -409,7 +413,7 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -409,7 +413,7 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
{ {
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true ); m_canvas->CallMouseCapture( aDC, aPosition, true );
} }
} }
......
...@@ -219,15 +219,13 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame, ...@@ -219,15 +219,13 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
float dpi = (float) frame->GetInternalUnits(); float dpi = (float) frame->GetInternalUnits();
wxSVGFileDC dc( FullFileName, sheetSize.x, sheetSize.y, dpi ); wxSVGFileDC dc( FullFileName, sheetSize.x, sheetSize.y, dpi );
EDA_RECT tmp = panel->m_ClipBox; EDA_RECT tmp = *panel->GetClipBox();
GRResetPenAndBrush( &dc ); GRResetPenAndBrush( &dc );
GRForceBlackPen( aPrintBlackAndWhite ); GRForceBlackPen( aPrintBlackAndWhite );
panel->m_ClipBox.SetX( -0x3FFFFF0 ); panel->SetClipBox( EDA_RECT( wxPoint( -0x3FFFFF0, -0x3FFFFF0 ),
panel->m_ClipBox.SetY( -0x3FFFFF0 ); wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) );
panel->m_ClipBox.SetWidth( 0x7FFFFF0 );
panel->m_ClipBox.SetHeight( 0x7FFFFF0 );
screen->m_IsPrinting = true; screen->m_IsPrinting = true;
screen->Draw( panel, &dc, GR_COPY ); screen->Draw( panel, &dc, GR_COPY );
...@@ -236,7 +234,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame, ...@@ -236,7 +234,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
frame->TraceWorkSheet( &dc, screen, g_DrawDefaultLineThickness ); frame->TraceWorkSheet( &dc, screen, g_DrawDefaultLineThickness );
screen->m_IsPrinting = false; screen->m_IsPrinting = false;
panel->m_ClipBox = tmp; panel->SetClipBox( tmp );
GRForceBlackPen( false ); GRForceBlackPen( false );
......
...@@ -29,7 +29,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent ) ...@@ -29,7 +29,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T, wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T,
wxT( "Invalid component object pointer. Bad Programmer!" ) ); wxT( "Invalid component object pointer. Bad Programmer!" ) );
m_canvas->m_IgnoreMouseEvents = true; m_canvas->SetIgnoreMouseEvents( true );
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC* dlg = new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( this ); DIALOG_EDIT_COMPONENT_IN_SCHEMATIC* dlg = new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( this );
...@@ -55,7 +55,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent ) ...@@ -55,7 +55,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dlg->GetSize(); DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dlg->GetSize();
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
dlg->Destroy(); dlg->Destroy();
} }
...@@ -685,12 +685,12 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField() ...@@ -685,12 +685,12 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField()
rotateCheckBox->SetValue( field.m_Orient == TEXT_ORIENT_VERT ); rotateCheckBox->SetValue( field.m_Orient == TEXT_ORIENT_VERT );
// Copy the text justification // Copy the text justification
GRTextHorizJustifyType hjustify[3] = { EDA_TEXT_HJUSTIFY_T hjustify[3] = {
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_CENTER,
GR_TEXT_HJUSTIFY_RIGHT GR_TEXT_HJUSTIFY_RIGHT
}; };
GRTextVertJustifyType vjustify[3] = { EDA_TEXT_VJUSTIFY_T vjustify[3] = {
GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER,
GR_TEXT_VJUSTIFY_TOP GR_TEXT_VJUSTIFY_TOP
}; };
......
...@@ -712,12 +712,12 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField() ...@@ -712,12 +712,12 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField()
field.m_Orient = TEXT_ORIENT_HORIZ; field.m_Orient = TEXT_ORIENT_HORIZ;
// Copy the text justification // Copy the text justification
static const GRTextHorizJustifyType hjustify[3] = { static const EDA_TEXT_HJUSTIFY_T hjustify[3] = {
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_CENTER,
GR_TEXT_HJUSTIFY_RIGHT GR_TEXT_HJUSTIFY_RIGHT
}; };
static const GRTextVertJustifyType vjustify[3] = { static const EDA_TEXT_VJUSTIFY_T vjustify[3] = {
GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER,
GR_TEXT_VJUSTIFY_TOP GR_TEXT_VJUSTIFY_TOP
}; };
......
...@@ -324,19 +324,20 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen ) ...@@ -324,19 +324,20 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
tmp_startvisu = aScreen->m_StartVisu; tmp_startvisu = aScreen->m_StartVisu;
oldZoom = aScreen->GetZoom(); oldZoom = aScreen->GetZoom();
old_org = aScreen->m_DrawOrg; old_org = aScreen->m_DrawOrg;
oldClipBox = panel->m_ClipBox;
// Change scale factor, offsets, and clip box to print the whole page. oldClipBox = *panel->GetClipBox();
panel->m_ClipBox.SetOrigin( wxPoint( 0, 0 ) );
panel->m_ClipBox.SetSize( wxSize( 0x7FFFFF0, 0x7FFFFF0 ) );
// Change clip box to print the whole page.
#define MAX_VALUE (INT_MAX/2) // MAX_VALUE is the max we can use in an integer
// and that allows calculations without overflow
panel->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( MAX_VALUE, MAX_VALUE ) ) );
// Change scale factor and offset to print the whole page.
bool printReference = parent->GetPrintSheetReference(); bool printReference = parent->GetPrintSheetReference();
if( printReference ) if( printReference )
{ {
/* Draw the page to a memory and let the dc calculate the drawing // Draw the page to a memory and let the dc calculate the drawing limits.
* limits.
*/
wxBitmap psuedoBitmap( 1, 1 ); wxBitmap psuedoBitmap( 1, 1 );
wxMemoryDC memDC; wxMemoryDC memDC;
memDC.SelectObject( psuedoBitmap ); memDC.SelectObject( psuedoBitmap );
...@@ -379,7 +380,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen ) ...@@ -379,7 +380,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
g_DrawBgColor = bg_color; g_DrawBgColor = bg_color;
aScreen->m_IsPrinting = false; aScreen->m_IsPrinting = false;
panel->m_ClipBox = oldClipBox; panel->SetClipBox( oldClipBox );
GRForceBlackPen( false ); GRForceBlackPen( false );
......
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010) // C++ code generated with wxFormBuilder (version Jun 30 2011)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -117,14 +117,13 @@ DIALOG_SCH_FIND_BASE::DIALOG_SCH_FIND_BASE( wxWindow* parent, wxWindowID id, con ...@@ -117,14 +117,13 @@ DIALOG_SCH_FIND_BASE::DIALOG_SCH_FIND_BASE( wxWindow* parent, wxWindowID id, con
rightSizer->Add( m_buttonReplaceAll, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 6 ); rightSizer->Add( m_buttonReplaceAll, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 6 );
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
rightSizer->Add( m_buttonCancel, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 6 ); rightSizer->Add( m_buttonCancel, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 6 );
mainSizer->Add( rightSizer, 0, wxALL|wxEXPAND, 6 ); mainSizer->Add( rightSizer, 0, wxALL|wxEXPAND, 6 );
this->SetSizer( mainSizer ); this->SetSizer( mainSizer );
this->Layout(); this->Layout();
mainSizer->Fit( this );
this->Centre( wxBOTH ); this->Centre( wxBOTH );
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010) // C++ code generated with wxFormBuilder (version Jun 30 2011)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_schematic_find_base__ #ifndef __DIALOG_SCHEMATIC_FIND_BASE_H__
#define __dialog_schematic_find_base__ #define __DIALOG_SCHEMATIC_FIND_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
...@@ -69,9 +70,9 @@ class DIALOG_SCH_FIND_BASE : public wxDialog ...@@ -69,9 +70,9 @@ class DIALOG_SCH_FIND_BASE : public wxDialog
public: public:
DIALOG_SCH_FIND_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Find"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_SCH_FIND_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Find"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 334,225 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_SCH_FIND_BASE(); ~DIALOG_SCH_FIND_BASE();
}; };
#endif //__dialog_schematic_find_base__ #endif //__DIALOG_SCHEMATIC_FIND_BASE_H__
...@@ -74,7 +74,7 @@ create a new power component with the new value." ), GetChars( entry->GetName() ...@@ -74,7 +74,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
// Don't use GetText() here. If the field is the reference designator and it's parent // Don't use GetText() here. If the field is the reference designator and it's parent
// component has multiple parts, we don't want the part suffix added to the field. // component has multiple parts, we don't want the part suffix added to the field.
wxString newtext = aField->m_Text; wxString newtext = aField->m_Text;
m_canvas->m_IgnoreMouseEvents = true; m_canvas->SetIgnoreMouseEvents( true );
wxString title; wxString title;
title.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) ); title.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) );
...@@ -83,7 +83,7 @@ create a new power component with the new value." ), GetChars( entry->GetName() ...@@ -83,7 +83,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
int response = dlg.ShowModal(); int response = dlg.ShowModal();
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
newtext = dlg.GetValue( ); newtext = dlg.GetValue( );
newtext.Trim( true ); newtext.Trim( true );
newtext.Trim( false ); newtext.Trim( false );
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2009-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/** /**
* @file eeredraw.cpp * @file eeredraw.cpp
*/ */
...@@ -29,7 +54,7 @@ void DrawDanglingSymbol( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& pos, in ...@@ -29,7 +54,7 @@ void DrawDanglingSymbol( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& pos, in
if( !screen->m_IsPrinting ) /* Draw but do not print the Dangling Symbol */ if( !screen->m_IsPrinting ) /* Draw but do not print the Dangling Symbol */
{ {
GRRect( &panel->m_ClipBox, DC, GRRect( panel->GetClipBox(), DC,
pos.x - DANGLING_SYMBOL_SIZE, pos.y - DANGLING_SYMBOL_SIZE, pos.x - DANGLING_SYMBOL_SIZE, pos.y - DANGLING_SYMBOL_SIZE,
pos.x + DANGLING_SYMBOL_SIZE, pos.y + DANGLING_SYMBOL_SIZE, pos.x + DANGLING_SYMBOL_SIZE, pos.y + DANGLING_SYMBOL_SIZE,
0, Color ); 0, Color );
...@@ -54,7 +79,7 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -54,7 +79,7 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness ); TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness );
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, FALSE ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, FALSE );
m_canvas->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
......
...@@ -191,7 +191,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) ...@@ -191,7 +191,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 ); dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 );
dlg.SetShowGrid( IsGridVisible() ); dlg.SetShowGrid( IsGridVisible() );
dlg.SetShowHiddenPins( m_showAllPins ); dlg.SetShowHiddenPins( m_showAllPins );
dlg.SetEnableAutoPan( m_canvas->m_AutoPAN_Enable ); dlg.SetEnableAutoPan( m_canvas->GetEnableAutoPan() );
dlg.SetEnableHVBusOrientation( g_HVLines ); dlg.SetEnableHVBusOrientation( g_HVLines );
dlg.SetShowPageLimits( g_ShowPageLimits ); dlg.SetShowPageLimits( g_ShowPageLimits );
dlg.Layout(); dlg.Layout();
...@@ -222,7 +222,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) ...@@ -222,7 +222,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 ); SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 );
SetGridVisibility( dlg.GetShowGrid() ); SetGridVisibility( dlg.GetShowGrid() );
m_showAllPins = dlg.GetShowHiddenPins(); m_showAllPins = dlg.GetShowHiddenPins();
m_canvas->m_AutoPAN_Enable = dlg.GetEnableAutoPan(); m_canvas->SetEnableAutoPan( dlg.GetEnableAutoPan() );
g_HVLines = dlg.GetEnableHVBusOrientation(); g_HVLines = dlg.GetEnableHVBusOrientation();
g_ShowPageLimits = dlg.GetShowPageLimits(); g_ShowPageLimits = dlg.GetShowPageLimits();
......
...@@ -403,6 +403,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent ) ...@@ -403,6 +403,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent )
if( m_foundItems.ReplaceItem() ) if( m_foundItems.ReplaceItem() )
{ {
OnModify();
SaveUndoItemInUndoList( undoItem ); SaveUndoItemInUndoList( undoItem );
RedrawScreen( data.GetPosition(), warpCursor ); RedrawScreen( data.GetPosition(), warpCursor );
} }
...@@ -411,9 +412,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent ) ...@@ -411,9 +412,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent )
if( aEvent.GetEventType() == wxEVT_COMMAND_FIND_REPLACE_ALL ) if( aEvent.GetEventType() == wxEVT_COMMAND_FIND_REPLACE_ALL )
{ {
item = (SCH_ITEM*) m_foundItems.GetItem( data ); while( ( item = (SCH_ITEM*) m_foundItems.GetItem( data ) ) != NULL )
while( item != NULL )
{ {
wxLogTrace( traceFindReplace, wxT( "Replacing %s with %s in item %s" ), wxLogTrace( traceFindReplace, wxT( "Replacing %s with %s in item %s" ),
GetChars( aEvent.GetFindString() ), GetChars( aEvent.GetReplaceString() ), GetChars( aEvent.GetFindString() ), GetChars( aEvent.GetReplaceString() ),
...@@ -429,6 +428,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent ) ...@@ -429,6 +428,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent )
if( m_foundItems.ReplaceItem() ) if( m_foundItems.ReplaceItem() )
{ {
OnModify();
SaveUndoItemInUndoList( undoItem ); SaveUndoItemInUndoList( undoItem );
RedrawScreen( data.GetPosition(), warpCursor ); RedrawScreen( data.GetPosition(), warpCursor );
} }
......
...@@ -96,7 +96,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -96,7 +96,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
static wxString lastCommponentName; static wxString lastCommponentName;
m_itemToRepeat = NULL; m_itemToRepeat = NULL;
m_canvas->m_IgnoreMouseEvents = true; m_canvas->SetIgnoreMouseEvents( true );
if( !libname.IsEmpty() ) if( !libname.IsEmpty() )
{ {
...@@ -122,7 +122,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -122,7 +122,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if ( dlg.ShowModal() == wxID_CANCEL ) if ( dlg.ShowModal() == wxID_CANCEL )
{ {
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
...@@ -140,7 +140,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -140,7 +140,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() ) if( Name.IsEmpty() )
{ {
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
...@@ -157,7 +157,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -157,7 +157,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() ) if( Name.IsEmpty() )
{ {
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
...@@ -168,7 +168,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -168,7 +168,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( GetNameOfPartToLoad( this, Library, Name ) == 0 ) if( GetNameOfPartToLoad( this, Library, Name ) == 0 )
{ {
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
...@@ -180,7 +180,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -180,7 +180,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() ) if( Name.IsEmpty() )
{ {
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
...@@ -200,13 +200,13 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC, ...@@ -200,13 +200,13 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Entry == NULL ) if( Entry == NULL )
{ {
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
return NULL; return NULL;
} }
} }
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
if( Entry == NULL ) if( Entry == NULL )
......
...@@ -280,7 +280,7 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet() ...@@ -280,7 +280,7 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
// update the References // update the References
m_CurrentSheet->UpdateAllScreenReferences(); m_CurrentSheet->UpdateAllScreenReferences();
SetSheetNumberAndCount(); SetSheetNumberAndCount();
m_canvas->m_CanStartBlock = -1; m_canvas->SetCanStartBlock( -1 );
if( screen->m_FirstRedraw ) if( screen->m_FirstRedraw )
{ {
......
...@@ -416,21 +416,27 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf ...@@ -416,21 +416,27 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
fill = NO_FILL; fill = NO_FILL;
if( fill == FILLED_WITH_BG_BODYCOLOR ) if( fill == FILLED_WITH_BG_BODYCOLOR )
GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2, {
GRFilledArc( aPanel->GetClipBox(), aDC, posc.x, posc.y, pt1, pt2,
m_Radius, GetPenSize( ), m_Radius, GetPenSize( ),
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ), (m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
}
else if( fill == FILLED_SHAPE && !aData ) else if( fill == FILLED_SHAPE && !aData )
GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2, m_Radius, color, color ); {
GRFilledArc( aPanel->GetClipBox(), aDC, posc.x, posc.y, pt1, pt2, m_Radius,
color, color );
}
else else
{ {
#ifdef DRAW_ARC_WITH_ANGLE #ifdef DRAW_ARC_WITH_ANGLE
GRArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2, m_Radius, GetPenSize(), color ); GRArc( aPanel->GetClipBox(), aDC, posc.x, posc.y, pt1, pt2, m_Radius,
GetPenSize(), color );
#else #else
GRArc1( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GRArc1( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y,
posc.x, posc.y, GetPenSize(), color ); posc.x, posc.y, GetPenSize(), color );
#endif #endif
} }
...@@ -439,7 +445,7 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf ...@@ -439,7 +445,7 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
* calculation. */ * calculation. */
#if 0 #if 0
EDA_RECT bBox = GetBoundingBox(); EDA_RECT bBox = GetBoundingBox();
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif #endif
} }
......
...@@ -332,15 +332,15 @@ void LIB_BEZIER::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& ...@@ -332,15 +332,15 @@ void LIB_BEZIER::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
GRSetDrawMode( aDC, aDrawMode ); GRSetDrawMode( aDC, aDrawMode );
if( fill == FILLED_WITH_BG_BODYCOLOR ) if( fill == FILLED_WITH_BG_BODYCOLOR )
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(),
&PolyPointsTraslated[0], 1, GetPenSize(), &PolyPointsTraslated[0], 1, GetPenSize(),
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ), (m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE ) else if( fill == FILLED_SHAPE )
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(),
&PolyPointsTraslated[0], 1, GetPenSize(), color, color ); &PolyPointsTraslated[0], 1, GetPenSize(), color, color );
else else
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(),
&PolyPointsTraslated[0], 0, GetPenSize(), color, color ); &PolyPointsTraslated[0], 0, GetPenSize(), color, color );
/* Set to one (1) to draw bounding box around bezier curve to validate /* Set to one (1) to draw bounding box around bezier curve to validate
...@@ -348,7 +348,7 @@ void LIB_BEZIER::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& ...@@ -348,7 +348,7 @@ void LIB_BEZIER::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
#if 0 #if 0
EDA_RECT bBox = GetBoundingBox(); EDA_RECT bBox = GetBoundingBox();
bBox.Inflate( m_Thickness + 1, m_Thickness + 1 ); bBox.Inflate( m_Thickness + 1, m_Thickness + 1 );
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif #endif
} }
......
...@@ -244,19 +244,19 @@ void LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& ...@@ -244,19 +244,19 @@ void LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
fill = NO_FILL; fill = NO_FILL;
if( fill == FILLED_WITH_BG_BODYCOLOR ) if( fill == FILLED_WITH_BG_BODYCOLOR )
GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), GRFilledCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, GetPenSize(),
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ), (m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE ) else if( fill == FILLED_SHAPE )
GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, m_Radius, 0, color, color ); GRFilledCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, 0, color, color );
else else
GRCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), color ); GRCircle( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, m_Radius, GetPenSize(), color );
/* Set to one (1) to draw bounding box around circle to validate bounding /* Set to one (1) to draw bounding box around circle to validate bounding
* box calculation. */ * box calculation. */
#if 0 #if 0
EDA_RECT bBox = GetBoundingBox(); EDA_RECT bBox = GetBoundingBox();
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif #endif
} }
......
...@@ -140,7 +140,7 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, ...@@ -140,7 +140,7 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
if( m_eraseLastDrawItem ) if( m_eraseLastDrawItem )
{ {
GRSetDrawMode( aDC, g_XorMode ); GRSetDrawMode( aDC, g_XorMode );
drawEditGraphics( &aPanel->m_ClipBox, aDC, color ); drawEditGraphics( aPanel->GetClipBox(), aDC, color );
drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData, aTransform ); drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData, aTransform );
} }
...@@ -148,7 +148,7 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, ...@@ -148,7 +148,7 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
calcEdit( aOffset ); calcEdit( aOffset );
// Draw the items using the new attributes. // Draw the items using the new attributes.
drawEditGraphics( &aPanel->m_ClipBox, aDC, color ); drawEditGraphics( aPanel->GetClipBox(), aDC, color );
drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData, aTransform ); drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData, aTransform );
m_Fill = fillMode; m_Fill = fillMode;
......
...@@ -325,7 +325,7 @@ void LIB_FIELD::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a ...@@ -325,7 +325,7 @@ void LIB_FIELD::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a
grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) ); grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) );
grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) ); grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) );
grBox.Move( aOffset ); grBox.Move( aOffset );
GRRect( &aPanel->m_ClipBox, aDC, grBox, 0, LIGHTMAGENTA ); GRRect( aPanel->GetClipBox(), aDC, grBox, 0, LIGHTMAGENTA );
#endif #endif
} }
......
...@@ -853,7 +853,7 @@ void LIB_PIN::drawGraphic( EDA_DRAW_PANEL* aPanel, ...@@ -853,7 +853,7 @@ void LIB_PIN::drawGraphic( EDA_DRAW_PANEL* aPanel,
/* Set to one (1) to draw bounding box around pin to validate bounding /* Set to one (1) to draw bounding box around pin to validate bounding
* box calculation. */ * box calculation. */
#if 0 #if 0
EDA_RECT* clipbox = aPanel ? &aPanel->m_ClipBox : NULL; EDA_RECT* clipbox = aPanel ? aPanel->GetClipBox() : NULL;
TRANSFORM transform = DefaultTransform; TRANSFORM transform = DefaultTransform;
DefaultTransform = aTransform; DefaultTransform = aTransform;
EDA_RECT bBox = GetBoundingBox(); EDA_RECT bBox = GetBoundingBox();
...@@ -876,7 +876,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel, ...@@ -876,7 +876,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
int color; int color;
int width = GetPenSize(); int width = GetPenSize();
int posX = aPinPos.x, posY = aPinPos.y, len = m_length; int posX = aPinPos.x, posY = aPinPos.y, len = m_length;
EDA_RECT* clipbox = aPanel ? &aPanel->m_ClipBox : NULL; EDA_RECT* clipbox = aPanel ? aPanel->GetClipBox() : NULL;
color = ReturnLayerColor( LAYER_PIN ); color = ReturnLayerColor( LAYER_PIN );
......
...@@ -305,14 +305,14 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint ...@@ -305,14 +305,14 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint
GRSetDrawMode( aDC, aDrawMode ); GRSetDrawMode( aDC, aDrawMode );
if( fill == FILLED_WITH_BG_BODYCOLOR ) if( fill == FILLED_WITH_BG_BODYCOLOR )
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(), GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(),
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ), (m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( fill == FILLED_SHAPE ) else if( fill == FILLED_SHAPE )
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(), GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), buffer, 1, GetPenSize(),
color, color ); color, color );
else else
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), buffer, 0, GetPenSize(), GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), buffer, 0, GetPenSize(),
color, color ); color, color );
delete[] buffer; delete[] buffer;
...@@ -322,7 +322,7 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint ...@@ -322,7 +322,7 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint
#if 0 #if 0
EDA_RECT bBox = GetBoundingBox(); EDA_RECT bBox = GetBoundingBox();
bBox.Inflate( m_Thickness + 1, m_Thickness + 1 ); bBox.Inflate( m_Thickness + 1, m_Thickness + 1 );
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif #endif
} }
......
...@@ -233,21 +233,21 @@ void LIB_RECTANGLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, ...@@ -233,21 +233,21 @@ void LIB_RECTANGLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
GRSetDrawMode( aDC, aDrawMode ); GRSetDrawMode( aDC, aDrawMode );
if( fill == FILLED_WITH_BG_BODYCOLOR && !aData ) if( fill == FILLED_WITH_BG_BODYCOLOR && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize( ), GRFilledRect( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize( ),
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ), (m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) ); ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
else if( m_Fill == FILLED_SHAPE && !aData ) else if( m_Fill == FILLED_SHAPE && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GRFilledRect( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y,
GetPenSize(), color, color ); GetPenSize(), color, color );
else else
GRRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize(), color ); GRRect( aPanel->GetClipBox(), aDC, pos1.x, pos1.y, pos2.x, pos2.y, GetPenSize(), color );
/* Set to one (1) to draw bounding box around rectangle to validate /* Set to one (1) to draw bounding box around rectangle to validate
* bounding box calculation. */ * bounding box calculation. */
#if 0 #if 0
EDA_RECT bBox = GetBoundingBox(); EDA_RECT bBox = GetBoundingBox();
bBox.Inflate( m_Thickness + 1, m_Thickness + 1 ); bBox.Inflate( m_Thickness + 1, m_Thickness + 1 );
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y, GRRect( aPanel->GetClipBox(), aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA ); bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif #endif
} }
......
...@@ -403,7 +403,7 @@ void LIB_TEXT::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aO ...@@ -403,7 +403,7 @@ void LIB_TEXT::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aO
grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) ); grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) );
grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) ); grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) );
grBox.Move( aOffset ); grBox.Move( aOffset );
GRRect( &aPanel->m_ClipBox, aDC, grBox, 0, LIGHTMAGENTA ); GRRect( aPanel->GetClipBox(), aDC, grBox, 0, LIGHTMAGENTA );
#endif #endif
} }
......
...@@ -252,7 +252,7 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -252,7 +252,7 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
} }
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->DrawCrossHair( DC ); m_canvas->DrawCrossHair( DC );
...@@ -322,6 +322,7 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event ) ...@@ -322,6 +322,7 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event )
if( libFileName.FileExists() ) if( libFileName.FileExists() )
{ {
backupFileName.SetExt( wxT( "bak" ) ); backupFileName.SetExt( wxT( "bak" ) );
if( backupFileName.FileExists() )
wxRemoveFile( backupFileName.GetFullPath() ); wxRemoveFile( backupFileName.GetFullPath() );
if( !wxRenameFile( libFileName.GetFullPath(), backupFileName.GetFullPath() ) ) if( !wxRenameFile( libFileName.GetFullPath(), backupFileName.GetFullPath() ) )
...@@ -361,6 +362,7 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event ) ...@@ -361,6 +362,7 @@ void LIB_EDIT_FRAME::SaveActiveLibrary( wxCommandEvent& event )
if( docFileName.FileExists() ) if( docFileName.FileExists() )
{ {
backupFileName.SetExt( wxT( "bck" ) ); backupFileName.SetExt( wxT( "bck" ) );
if( backupFileName.FileExists() )
wxRemoveFile( backupFileName.GetFullPath() ); wxRemoveFile( backupFileName.GetFullPath() );
if( !wxRenameFile( docFileName.GetFullPath(), backupFileName.GetFullPath() ) ) if( !wxRenameFile( docFileName.GetFullPath(), backupFileName.GetFullPath() ) )
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2010 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/** /**
* @file libedit_onleftclick.cpp * @file libedit_onleftclick.cpp
* @brief Eeschema library editor event handler for a mouse left button single or double click. * @brief Eeschema library editor event handler for a mouse left button single or double click.
...@@ -27,13 +52,16 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition ) ...@@ -27,13 +52,16 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
item = LocateItemUsingCursor( aPosition ); item = LocateItemUsingCursor( aPosition );
if( item ) if( item )
{
item->DisplayInfo( this ); item->DisplayInfo( this );
}
else else
{ {
DisplayCmpDoc(); DisplayCmpDoc();
if( m_canvas->m_AbortRequest ) if( m_canvas->GetAbortRequest() )
m_canvas->m_AbortRequest = false; m_canvas->SetAbortRequest( false );
} }
} }
...@@ -135,7 +163,7 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition ) ...@@ -135,7 +163,7 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
else else
return; return;
m_canvas->m_IgnoreMouseEvents = true; m_canvas->SetIgnoreMouseEvents( true );
switch( m_drawItem->Type() ) switch( m_drawItem->Type() )
{ {
...@@ -188,5 +216,5 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition ) ...@@ -188,5 +216,5 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
} }
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
} }
...@@ -51,9 +51,9 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -51,9 +51,9 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
item = LocateItemUsingCursor( aPosition ); item = LocateItemUsingCursor( aPosition );
// If the clarify item selection context menu is aborted, don't show the context menu. // If the clarify item selection context menu is aborted, don't show the context menu.
if( item == NULL && m_canvas->m_AbortRequest ) if( item == NULL && m_canvas->GetAbortRequest() )
{ {
m_canvas->m_AbortRequest = false; m_canvas->SetAbortRequest( false );
return false; return false;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -76,7 +76,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -76,7 +76,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
bool BlockActive = GetScreen()->IsBlockActive(); bool BlockActive = GetScreen()->IsBlockActive();
// Do not start a block command on context menu. // Do not start a block command on context menu.
m_canvas->m_CanStartBlock = -1; m_canvas->SetCanStartBlock( -1 );
if( BlockActive ) if( BlockActive )
{ {
...@@ -91,9 +91,9 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) ...@@ -91,9 +91,9 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
item = LocateAndShowItem( aPosition, SCH_COLLECTOR::AllItemsButPins ); item = LocateAndShowItem( aPosition, SCH_COLLECTOR::AllItemsButPins );
// If the clarify item selection context menu is aborted, don't show the context menu. // If the clarify item selection context menu is aborted, don't show the context menu.
if( item == NULL && m_canvas->m_AbortRequest ) if( item == NULL && m_canvas->GetAbortRequest() )
{ {
m_canvas->m_AbortRequest = false; m_canvas->SetAbortRequest( false );
return false; return false;
} }
} }
......
...@@ -220,12 +220,12 @@ void LIB_EDIT_FRAME::PlacePin( wxDC* DC ) ...@@ -220,12 +220,12 @@ void LIB_EDIT_FRAME::PlacePin( wxDC* DC )
if( ask_for_pin && SynchronizePins() ) if( ask_for_pin && SynchronizePins() )
{ {
m_canvas->m_IgnoreMouseEvents = true; m_canvas->SetIgnoreMouseEvents( true );
status = status =
IsOK( this, _( "This position is already occupied by \ IsOK( this, _( "This position is already occupied by \
another pin. Continue?" ) ); another pin. Continue?" ) );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
if( !status ) if( !status )
return; return;
...@@ -398,12 +398,12 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC ) ...@@ -398,12 +398,12 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
pin->SetUnit( LastPinCommonUnit ? 0 : m_unit ); pin->SetUnit( LastPinCommonUnit ? 0 : m_unit );
pin->SetVisible( LastPinVisible ); pin->SetVisible( LastPinVisible );
PinPreviousPos = pin->GetPosition(); PinPreviousPos = pin->GetPosition();
m_canvas->m_IgnoreMouseEvents = true; m_canvas->SetIgnoreMouseEvents( true );
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetId( ID_LIBEDIT_EDIT_PIN ); cmd.SetId( ID_LIBEDIT_EDIT_PIN );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = false; m_canvas->SetIgnoreMouseEvents( false );
if( pin->GetFlags() & IS_CANCELLED ) if( pin->GetFlags() & IS_CANCELLED )
{ {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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