Encapsulation and other minor improvements.

* EDA_DRAW_PANEL completely encapsulated.
* Moved OSX m_overlay member from EDA_DRAW_PANEL to EDA_DRAW_FRAME where
  it is used.
* Doxygen comment warning fixes.
This commit is contained in:
Wayne Stambaugh 2011-12-29 15:11:42 -05:00
parent b7db108cd7
commit 8985a1807b
117 changed files with 933 additions and 619 deletions

View File

@ -494,10 +494,10 @@ void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
int cX = aPos.x + aOffset.x;
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 );
GRLine( &aPanel->m_ClipBox, aDC, cX, cY - anchor_size,
GRLine( aPanel->GetClipBox(), aDC, cX, cY - anchor_size,
cX, cY + anchor_size, 0, aAnchor_color );
}

View File

@ -131,10 +131,10 @@ void BLOCK_SELECTOR::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
GRSetDrawMode( aDC, aDrawMode );
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 );
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 );
}
@ -241,7 +241,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
{
DisplayError( this, wxT( "No Block to paste" ), 20 );
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
m_canvas->m_mouseCaptureCallback = NULL;
m_canvas->SetMouseCaptureCallback( NULL );
return true;
}
@ -254,7 +254,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
}
Block->m_State = STATE_BLOCK_MOVE;
m_canvas->m_mouseCaptureCallback( m_canvas, DC, startpos, false );
m_canvas->CallMouseCapture( DC, startpos, false );
break;
default:
@ -314,7 +314,7 @@ void AbortBlockCurrentCommand( EDA_DRAW_PANEL* Panel, wxDC* DC )
if( Panel->IsMouseCaptured() ) /* Erase current drawing on screen */
{
/* Clear block outline. */
Panel->m_mouseCaptureCallback( Panel, DC, wxDefaultPosition, false );
Panel->CallMouseCapture( DC, wxDefaultPosition, false );
Panel->SetMouseCapture( NULL, NULL );
screen->SetCurItem( NULL );

View File

@ -162,7 +162,7 @@ void MARKER_BASE::DrawMarker( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
corners[ii] += m_Pos + aOffset;
}
GRClosedPoly( &aPanel->m_ClipBox, aDC, CORNERS_COUNT, corners,
GRClosedPoly( aPanel->GetClipBox(), aDC, CORNERS_COUNT, corners,
true, // = Filled
0, // outline width
m_Color, // outline color

View File

@ -1,9 +1,30 @@
/////////////////////////////////////////////////////////////////////////////
// Name: copy_to_clipboard.cpp
// Author: jean-pierre Charras
// Created: 18 aug 2006
// Licence: License GNU
/////////////////////////////////////////////////////////////////////////////
/*
* 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) 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 "fctsys.h"
@ -73,7 +94,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
wxMetafileDC dc;
EDA_RECT tmp = aFrame->GetCanvas()->m_ClipBox;
EDA_RECT tmp = *aFrame->GetCanvas()->GetClipBox();
GRResetPenAndBrush( &dc );
const bool plotBlackAndWhite = false;
GRForceBlackPen( plotBlackAndWhite );
@ -81,10 +102,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
dc.SetUserScale( scale, scale );
ClipboardSizeX = dc.MaxX() + 10;
ClipboardSizeY = dc.MaxY() + 10;
aFrame->GetCanvas()->m_ClipBox.SetX( 0 );
aFrame->GetCanvas()->m_ClipBox.SetY( 0 );
aFrame->GetCanvas()->m_ClipBox.SetWidth( 0x7FFFFF0 );
aFrame->GetCanvas()->m_ClipBox.SetHeight( 0x7FFFFF0 );
aFrame->GetCanvas()->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) );
if( DrawBlock )
{
@ -94,7 +112,7 @@ bool DrawPageOnClipboard( EDA_DRAW_FRAME* aFrame )
const int maskLayer = 0xFFFFFFFF;
aFrame->PrintPage( &dc, maskLayer, false );
screen->m_IsPrinting = false;
aFrame->GetCanvas()->m_ClipBox = tmp;
aFrame->GetCanvas()->SetClipBox( tmp );
wxMetafile* mf = dc.Close();
if( mf )

View File

@ -28,10 +28,7 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "class_bitmap_base.h"
#include "dialog_image_editor.h"

View File

@ -183,7 +183,7 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
m_FrameIsActive = event.GetActive();
if( m_canvas )
m_canvas->m_CanStartBlock = -1;
m_canvas->SetCanStartBlock( -1 );
event.Skip(); // required under wxMAC
}
@ -192,7 +192,7 @@ void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event )
{
if( m_canvas )
m_canvas->m_CanStartBlock = -1;
m_canvas->SetCanStartBlock( -1 );
event.Skip();
}
@ -486,7 +486,7 @@ int EDA_DRAW_FRAME::ReturnBlockCommand( int key )
void EDA_DRAW_FRAME::InitBlockPasteInfos()
{
GetScreen()->m_BlockLocate.ClearItemsList();
m_canvas->m_mouseCaptureCallback = NULL;
m_canvas->SetMouseCaptureCallback( NULL );
}

View File

@ -94,19 +94,19 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
m_ClipBox.SetSize( size );
m_ClipBox.SetX( 0 );
m_ClipBox.SetY( 0 );
m_CanStartBlock = -1; // Command block can start if >= 0
m_AbortEnable = m_AbortRequest = false;
m_AutoPAN_Enable = true;
m_IgnoreMouseEvents = 0;
m_canStartBlock = -1; // Command block can start if >= 0
m_abortRequest = false;
m_enableAutoPan = true;
m_ignoreMouseEvents = false;
m_mouseCaptureCallback = NULL;
m_endMouseCaptureCallback = NULL;
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_Block_Enable = false;
m_requestAutoPan = false;
m_enableBlockCommands = false;
#ifdef __WXMAC__
m_defaultCursor = m_currentCursor = wxCURSOR_CROSS;
@ -116,14 +116,14 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
m_showCrossHair = true;
#endif
m_cursorLevel = 0;
m_cursorLevel = 0;
m_PrintIsMirrored = false;
}
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 )
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();
}
@ -747,10 +747,10 @@ bool EDA_DRAW_PANEL::OnRightClick( wxMouseEvent& event )
GetParent()->AddMenuZoomAndGrid( &MasterMenu );
pos = event.GetPosition();
m_IgnoreMouseEvents = true;
m_ignoreMouseEvents = true;
PopupMenu( &MasterMenu, pos );
MoveCursorToCrossHair();
m_IgnoreMouseEvents = false;
m_ignoreMouseEvents = false;
return true;
}
@ -759,9 +759,9 @@ bool EDA_DRAW_PANEL::OnRightClick( wxMouseEvent& event )
void EDA_DRAW_PANEL::OnMouseLeaving( wxMouseEvent& event )
{
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;
// Auto pan if mouse is leave working area:
@ -781,7 +781,7 @@ void EDA_DRAW_PANEL::OnMouseLeaving( wxMouseEvent& event )
void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
{
if( m_IgnoreMouseEvents )
if( m_ignoreMouseEvents )
return;
wxRect rect = wxRect( wxPoint( 0, 0 ), GetClientSize() );
@ -853,18 +853,18 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
/* Count the drag events. Used to filter mouse moves before starting a
* block command. A block command can be started only if
* MinDragEventCount > MIN_DRAG_COUNT_FOR_START_BLOCK_COMMAND
* and m_CanStartBlock >= 0
* and m_canStartBlock >= 0
* in order to avoid spurious block commands.
*/
static int MinDragEventCount;
if( event.Leaving() )
{
m_CanStartBlock = -1;
m_canStartBlock = -1;
}
if( !IsMouseCaptured() ) // No mouse capture in progress.
m_AutoPAN_Request = false;
m_requestAutoPan = false;
if( GetParent()->IsActive() )
SetFocus();
@ -882,7 +882,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
return;
}
if( m_IgnoreMouseEvents )
if( m_ignoreMouseEvents )
return;
if( event.LeftIsDown() )
@ -969,7 +969,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
if( LastPanel != this )
{
MinDragEventCount = 0;
m_CanStartBlock = -1;
m_canStartBlock = -1;
}
/* A new command block can start after a release buttons
@ -981,7 +981,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
if( !event.LeftIsDown() && !event.MiddleIsDown() )
{
MinDragEventCount = 0;
m_CanStartBlock = 0;
m_canStartBlock = 0;
/* Remember the last cursor position when a drag mouse starts
* this is the last position ** before ** clicking a button
@ -993,7 +993,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
m_CursorStartPos = screen->GetCrossHairPosition();
}
if( m_Block_Enable && !(localbutt & GR_M_DCLICK) )
if( m_enableBlockCommands && !(localbutt & GR_M_DCLICK) )
{
if( !screen->IsBlockActive() )
{
@ -1004,12 +1004,12 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
{
if( screen->m_BlockLocate.m_State == STATE_BLOCK_MOVE )
{
m_AutoPAN_Request = false;
m_requestAutoPan = false;
GetParent()->HandleBlockPlace( &DC );
ignoreNextLeftButtonRelease = true;
}
}
else if( ( m_CanStartBlock >= 0 )
else if( ( m_canStartBlock >= 0 )
&& ( event.LeftIsDown() || event.MiddleIsDown() )
&& !IsMouseCaptured() )
{
@ -1038,7 +1038,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
}
else
{
m_AutoPAN_Request = true;
m_requestAutoPan = true;
SetCursor( wxCURSOR_SIZING );
}
}
@ -1064,19 +1064,19 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
if( m_endMouseCaptureCallback )
{
m_endMouseCaptureCallback( this, &DC );
m_AutoPAN_Request = false;
m_requestAutoPan = false;
}
SetCursor( m_currentCursor );
}
else if( screen->m_BlockLocate.m_State == STATE_BLOCK_END )
{
m_AutoPAN_Request = false;
m_requestAutoPan = false;
GetParent()->HandleBlockEnd( &DC );
SetCursor( m_currentCursor );
if( screen->m_BlockLocate.m_State == STATE_BLOCK_MOVE )
{
m_AutoPAN_Request = true;
m_requestAutoPan = true;
SetCursor( wxCURSOR_HAND );
}
}
@ -1124,7 +1124,7 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
break;
case WXK_ESCAPE:
m_AbortRequest = true;
m_abortRequest = true;
if( IsMouseCaptured() )
EndMouseCapture();
@ -1227,7 +1227,7 @@ void EDA_DRAW_PANEL::EndMouseCapture( int id, int cursor, const wxString& title,
m_mouseCaptureCallback = NULL;
m_endMouseCaptureCallback = NULL;
m_AutoPAN_Request = false;
m_requestAutoPan = false;
if( id != -1 && cursor != -1 )
{
@ -1235,3 +1235,21 @@ void EDA_DRAW_PANEL::EndMouseCapture( int id, int cursor, const wxString& 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 );
}

View File

@ -249,7 +249,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
int overbar_italic_comp; // Italic compensation for overbar
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
wxPoint coord[BUF_SIZE + 1]; // Buffer coordinate used to draw polylines (one char shape)
bool sketch_mode = false;
@ -292,10 +292,10 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
xc = current_char_pos.x;
yc = current_char_pos.y;
x0 = aPanel->m_ClipBox.GetX() - ll;
y0 = aPanel->m_ClipBox.GetY() - ll;
xm = aPanel->m_ClipBox.GetRight() + ll;
ym = aPanel->m_ClipBox.GetBottom() + ll;
x0 = aPanel->GetClipBox()->GetX() - ll;
y0 = aPanel->GetClipBox()->GetY() - ll;
xm = aPanel->GetClipBox()->GetRight() + ll;
ym = aPanel->GetClipBox()->GetBottom() + ll;
if( xc < x0 )
return;
@ -366,7 +366,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
aCallback( current_char_pos.x, current_char_pos.y, end.x, end.y );
}
else
GRLine( &aPanel->m_ClipBox, aDC,
GRLine( aPanel->GetClipBox(), aDC,
current_char_pos.x, current_char_pos.y, end.x, end.y, aWidth, aColor );
return;

View File

@ -24,7 +24,7 @@
*/
/**
* @file edaapl.cpp
* @file edaappl.cpp
*
* @brief For the main application: init functions, and language selection
* (locale handling)

View File

@ -1028,7 +1028,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
if( !screen->m_IsPrinting & g_ShowPageLimits )
{
GRSetDrawMode( DC, GR_COPY );
GRRect( &m_canvas->m_ClipBox, DC, 0, 0,
GRRect( m_canvas->GetClipBox(), DC, 0, 0,
Sheet->m_Size.x * scale, Sheet->m_Size.y * scale, width,
g_DrawBgColor == WHITE ? LIGHTGRAY : DARKDARKGRAY );
}
@ -1041,13 +1041,13 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
yg = Sheet->m_Size.y - Sheet->m_BottomMargin; /* lower right corner */
#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 );
#else
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 );
refx += GRID_REF_W; refy += GRID_REF_W;
@ -1082,7 +1082,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
case WS_SEGMENT_LU:
xg = Sheet->m_LeftMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y - Sheet->m_BottomMargin - 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 );
break;
}
@ -1099,7 +1099,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
case WS_SEGMENT_LT:
xg = Sheet->m_LeftMargin + WsItem->m_Endx;
yg = Sheet->m_BottomMargin + 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 );
break;
}
@ -1117,7 +1117,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
Line.Printf( wxT( "%d" ), jj );
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 );
}
DrawGraphicText( m_canvas, DC,
@ -1128,7 +1128,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
width, false, false );
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 );
}
DrawGraphicText( m_canvas, DC,
@ -1141,17 +1141,20 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
ipas = ( yg - refy ) / PAS_REF;
gypas = ( yg - refy ) / ipas;
for( ii = refy + gypas, jj = 0; ipas > 0; ii += gypas, jj++, ipas-- )
{
if( jj < 26 )
Line.Printf( wxT( "%c" ), jj + 'A' );
else // I hope 52 identifiers are enought...
Line.Printf( wxT( "%c" ), 'a' + jj - 26 );
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 );
}
DrawGraphicText( m_canvas, DC,
wxPoint( ( refx + GRID_REF_W / 2 ) * scale,
( ii - gypas / 2 ) * scale ),
@ -1160,7 +1163,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
width, false, false );
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 );
}
DrawGraphicText( m_canvas, DC,
@ -1312,7 +1315,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
Sheet->m_RightMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y -
Sheet->m_BottomMargin - 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 );
break;
}
@ -1375,7 +1378,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
Sheet->m_RightMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y -
Sheet->m_BottomMargin - 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 );
break;
}
@ -1570,7 +1573,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
GRID_REF_W - Sheet->m_RightMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y -
GRID_REF_W - Sheet->m_BottomMargin - 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 );
break;
}

View File

@ -415,7 +415,7 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPositi
if( m_canvas->IsMouseCaptured() )
{
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, 0 );
m_canvas->CallMouseCapture( aDC, aPosition, 0 );
}
}

View File

@ -105,7 +105,7 @@ void SCH_EDIT_FRAME::InitBlockPasteInfos()
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
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 )
case BLOCK_DRAG: /* Drag */
case BLOCK_MOVE: /* Move */
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 );
MoveItemsInList( block->m_ItemsSelection, block->m_MoveVector );
@ -149,7 +149,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_COPY: /* Copy */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
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 );
@ -161,7 +161,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_PASTE:
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
PasteListOfItems( DC );
block->ClearItemsList();
@ -206,8 +206,7 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
BlockState state = block->m_State;
CmdBlockType command = block->m_Command;
if( m_canvas->m_endMouseCaptureCallback )
m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
m_canvas->CallEndMouseCapture( DC );
block->m_State = state;
block->m_Command = command;
@ -243,14 +242,14 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{
nextcmd = true;
GetScreen()->SelectBlockItems();
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
block->m_State = STATE_BLOCK_MOVE;
}
else
{
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->SetMouseCapture( NULL, NULL );
}
break;
@ -352,7 +351,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_DRAG: /* move to Drag */
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:
block->ClearItemsList();
@ -366,7 +365,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
GetScreen()->SelectBlockItems();
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;
}
@ -374,7 +373,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_DELETE: /* move to Delete */
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( block->GetCount() )
{
@ -388,7 +387,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_SAVE: /* Save list in paste buffer*/
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( block->GetCount() )
{
@ -399,7 +398,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
break;
case BLOCK_ZOOM: /* Window Zoom */
m_canvas->m_endMouseCaptureCallback( m_canvas, DC );
m_canvas->CallEndMouseCapture( DC );
m_canvas->SetCursor( m_canvas->GetDefaultCursor() );
Window_Zoom( GetScreen()->m_BlockLocate );
break;
@ -407,7 +406,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_ROTATE:
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( block->GetCount() )
{
@ -426,7 +425,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_MIRROR_X:
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( block->GetCount() )
{
@ -444,7 +443,7 @@ void SCH_EDIT_FRAME::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_MIRROR_Y:
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( block->GetCount() )
{

View File

@ -92,7 +92,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{
BlockState state = GetScreen()->m_BlockLocate.m_State;
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_Command = command;
m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
@ -120,9 +120,9 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
if( m_canvas->IsMouseCaptured() )
{
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
}
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
@ -132,7 +132,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
nextCmd = true;
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
break;

View File

@ -181,7 +181,7 @@ void SCH_EDIT_FRAME::BeginSegment( wxDC* DC, int type )
return;
}
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
/* Creates the new segment, or terminates the command
* 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 )
oldsegment->SetFlags( SELECTED );
newsegment->SetFlags( IS_NEW );
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.
* Create a junction if needed. Note: a junction can be needed later,
@ -444,7 +444,7 @@ void SCH_EDIT_FRAME::DeleteCurrentSegment( wxDC* DC )
}
screen->RemoveFromDrawList( screen->GetCurItem() );
m_canvas->m_mouseCaptureCallback = NULL;
m_canvas->SetMouseCaptureCallback( NULL );
screen->SetCurItem( NULL );
}

View File

@ -362,9 +362,9 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff
#if 0
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 );
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 );
#endif
@ -372,7 +372,7 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff
* the bounding box calculations. */
#if 0
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 );
#endif
}

View File

@ -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
// 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;
}
@ -73,7 +73,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
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;
}
@ -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.
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 );
m_canvas->MoveCursorToCrossHair();
item = GetScreen()->GetCurItem();
@ -247,16 +247,18 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( m_canvas->IsMouseCaptured() )
{
#ifdef USE_WX_OVERLAY
wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
wxDCOverlay oDC( m_overlay, (wxWindowDC*)aDC );
oDC.Clear();
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
m_canvas->CallMouseCapture( aDC, aPosition, false );
#else
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
m_canvas->CallMouseCapture( aDC, aPosition, true );
#endif
}
#ifdef USE_WX_OVERLAY
else
m_canvas->m_overlay.Reset();
{
m_overlay.Reset();
}
#endif
}
@ -330,16 +332,18 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( m_canvas->IsMouseCaptured() )
{
#ifdef USE_WX_OVERLAY
wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
wxDCOverlay oDC( m_overlay, (wxWindowDC*)aDC );
oDC.Clear();
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
m_canvas->CallMouseCapture( aDC, aPosition, false );
#else
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
m_canvas->CallMouseCapture( aDC, aPosition, true );
#endif
}
#ifdef USE_WX_OVERLAY
else
m_canvas->m_overlay.Reset();
{
m_overlay.Reset();
}
#endif
}
@ -409,7 +413,7 @@ void LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( m_canvas->IsMouseCaptured() )
{
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
m_canvas->CallMouseCapture( aDC, aPosition, true );
}
}

View File

@ -220,15 +220,13 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
float dpi = (float) frame->GetInternalUnits();
wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi );
EDA_RECT tmp = panel->m_ClipBox;
EDA_RECT tmp = *panel->GetClipBox();
GRResetPenAndBrush( &dc );
GRForceBlackPen( aPrintBlackAndWhite );
panel->m_ClipBox.SetX( -0x3FFFFF0 );
panel->m_ClipBox.SetY( -0x3FFFFF0 );
panel->m_ClipBox.SetWidth( 0x7FFFFF0 );
panel->m_ClipBox.SetHeight( 0x7FFFFF0 );
panel->SetClipBox( EDA_RECT( wxPoint( -0x3FFFFF0, -0x3FFFFF0 ),
wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) );
screen->m_IsPrinting = true;
screen->Draw( panel, &dc, GR_COPY );
@ -238,7 +236,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
SetLocaleTo_Default(); // revert to the current locale
screen->m_IsPrinting = false;
panel->m_ClipBox = tmp;
panel->SetClipBox( tmp );
GRForceBlackPen( false );

View File

@ -29,7 +29,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T,
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 );
@ -55,7 +55,7 @@ void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent )
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_LastSize = dlg->GetSize();
m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
dlg->Destroy();
}

View File

@ -324,11 +324,10 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
tmp_startvisu = aScreen->m_StartVisu;
oldZoom = aScreen->GetZoom();
old_org = aScreen->m_DrawOrg;
oldClipBox = panel->m_ClipBox;
oldClipBox = *panel->GetClipBox();
/* Change scale factor, offsets, and clip box to print the whole page. */
panel->m_ClipBox.SetOrigin( wxPoint( 0, 0 ) );
panel->m_ClipBox.SetSize( wxSize( 0x7FFFFF0, 0x7FFFFF0 ) );
panel->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) );
bool printReference = parent->GetPrintSheetReference();
@ -378,7 +377,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
g_DrawBgColor = bg_color;
aScreen->m_IsPrinting = false;
panel->m_ClipBox = oldClipBox;
panel->SetClipBox( oldClipBox );
GRForceBlackPen( false );

View File

@ -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
// component has multiple parts, we don't want the part suffix added to the field.
wxString newtext = aField->m_Text;
m_canvas->m_IgnoreMouseEvents = true;
m_canvas->SetIgnoreMouseEvents( true );
wxString title;
title.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) );
@ -83,7 +83,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
int response = dlg.ShowModal();
m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
newtext = dlg.GetValue( );
newtext.Trim( true );
newtext.Trim( false );

View File

@ -1,3 +1,28 @@
/*
* 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
*/
@ -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 */
{
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,
0, Color );
@ -54,7 +79,7 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness );
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, FALSE );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, FALSE );
m_canvas->DrawCrossHair( DC );

View File

@ -191,7 +191,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 );
dlg.SetShowGrid( IsGridVisible() );
dlg.SetShowHiddenPins( m_showAllPins );
dlg.SetEnableAutoPan( m_canvas->m_AutoPAN_Enable );
dlg.SetEnableAutoPan( m_canvas->GetEnableAutoPan() );
dlg.SetEnableHVBusOrientation( g_HVLines );
dlg.SetShowPageLimits( g_ShowPageLimits );
dlg.Layout();
@ -222,7 +222,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 );
SetGridVisibility( dlg.GetShowGrid() );
m_showAllPins = dlg.GetShowHiddenPins();
m_canvas->m_AutoPAN_Enable = dlg.GetEnableAutoPan();
m_canvas->SetEnableAutoPan( dlg.GetEnableAutoPan() );
g_HVLines = dlg.GetEnableHVBusOrientation();
g_ShowPageLimits = dlg.GetShowPageLimits();

View File

@ -96,7 +96,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
static wxString lastCommponentName;
m_itemToRepeat = NULL;
m_canvas->m_IgnoreMouseEvents = true;
m_canvas->SetIgnoreMouseEvents( true );
if( !libname.IsEmpty() )
{
@ -122,7 +122,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if ( dlg.ShowModal() == wxID_CANCEL )
{
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair();
return NULL;
}
@ -140,7 +140,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() )
{
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair();
return NULL;
}
@ -157,7 +157,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() )
{
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair();
return NULL;
}
@ -168,7 +168,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( GetNameOfPartToLoad( this, Library, Name ) == 0 )
{
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair();
return NULL;
}
@ -180,7 +180,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Name.IsEmpty() )
{
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair();
return NULL;
}
@ -200,13 +200,13 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
if( Entry == NULL )
{
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair();
return NULL;
}
}
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair();
if( Entry == NULL )

View File

@ -280,7 +280,7 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
// update the References
m_CurrentSheet->UpdateAllScreenReferences();
SetSheetNumberAndCount();
m_canvas->m_CanStartBlock = -1;
m_canvas->SetCanStartBlock( -1 );
if( screen->m_FirstRedraw )
{

View File

@ -416,21 +416,27 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
fill = NO_FILL;
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_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
}
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
{
#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
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 );
#endif
}
@ -439,7 +445,7 @@ void LIB_ARC::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
* calculation. */
#if 0
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 );
#endif
}

View File

@ -332,15 +332,15 @@ void LIB_BEZIER::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
GRSetDrawMode( aDC, aDrawMode );
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(),
(m_Flags & IS_MOVED) ? color : ReturnLayerColor( LAYER_DEVICE_BACKGROUND ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
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 );
else
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(),
&PolyPointsTraslated[0], 0, GetPenSize(), color, color );
/* 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&
#if 0
EDA_RECT bBox = GetBoundingBox();
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 );
#endif
}

View File

@ -244,19 +244,19 @@ void LIB_CIRCLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
fill = NO_FILL;
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 ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
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
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
* box calculation. */
#if 0
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 );
#endif
}

View File

@ -140,7 +140,7 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
if( m_eraseLastDrawItem )
{
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 );
}
@ -148,7 +148,7 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
calcEdit( aOffset );
// 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 );
m_Fill = fillMode;

View File

@ -325,7 +325,7 @@ void LIB_FIELD::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a
grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) );
grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) );
grBox.Move( aOffset );
GRRect( &aPanel->m_ClipBox, aDC, grBox, 0, LIGHTMAGENTA );
GRRect( aPanel->GetClipBox(), aDC, grBox, 0, LIGHTMAGENTA );
#endif
}

View File

@ -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
* box calculation. */
#if 0
EDA_RECT* clipbox = aPanel ? &aPanel->m_ClipBox : NULL;
EDA_RECT* clipbox = aPanel ? aPanel->GetClipBox() : NULL;
TRANSFORM transform = DefaultTransform;
DefaultTransform = aTransform;
EDA_RECT bBox = GetBoundingBox();
@ -876,7 +876,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
int color;
int width = GetPenSize();
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 );

View File

@ -305,14 +305,14 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint
GRSetDrawMode( aDC, aDrawMode );
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 ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
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 );
else
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(), buffer, 0, GetPenSize(),
GRPoly( aPanel->GetClipBox(), aDC, m_PolyPoints.size(), buffer, 0, GetPenSize(),
color, color );
delete[] buffer;
@ -322,7 +322,7 @@ void LIB_POLYLINE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint
#if 0
EDA_RECT bBox = GetBoundingBox();
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 );
#endif
}

View File

@ -233,21 +233,21 @@ void LIB_RECTANGLE::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
GRSetDrawMode( aDC, aDrawMode );
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 ),
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
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 );
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
* bounding box calculation. */
#if 0
EDA_RECT bBox = GetBoundingBox();
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 );
#endif
}

View File

@ -403,7 +403,7 @@ void LIB_TEXT::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aO
grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) );
grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) );
grBox.Move( aOffset );
GRRect( &aPanel->m_ClipBox, aDC, grBox, 0, LIGHTMAGENTA );
GRRect( aPanel->GetClipBox(), aDC, grBox, 0, LIGHTMAGENTA );
#endif
}

View File

@ -252,7 +252,7 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
}
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->DrawCrossHair( DC );

View File

@ -1,3 +1,28 @@
/*
* 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
* @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 )
item = LocateItemUsingCursor( aPosition );
if( item )
{
item->DisplayInfo( this );
}
else
{
DisplayCmpDoc();
if( m_canvas->m_AbortRequest )
m_canvas->m_AbortRequest = false;
if( m_canvas->GetAbortRequest() )
m_canvas->SetAbortRequest( false );
}
}
@ -135,7 +163,7 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
else
return;
m_canvas->m_IgnoreMouseEvents = true;
m_canvas->SetIgnoreMouseEvents( true );
switch( m_drawItem->Type() )
{
@ -188,5 +216,5 @@ void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
}
m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
}

View File

@ -51,9 +51,9 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
item = LocateItemUsingCursor( aPosition );
// 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;
}

View File

@ -224,7 +224,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
if( m_canvas )
m_canvas->m_Block_Enable = true;
m_canvas->SetEnableBlockCommands( true );
EnsureActiveLibExists();
ReCreateMenuBar();
@ -616,7 +616,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
int id = event.GetId();
wxPoint pos;
m_canvas->m_IgnoreMouseEvents = true;
m_canvas->SetIgnoreMouseEvents( true );
wxGetMousePosition( &pos.x, &pos.y );
pos.y += 20;
@ -788,55 +788,55 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_POPUP_ZOOM_BLOCK:
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->m_BlockLocate.m_Command = BLOCK_ZOOM;
HandleBlockEnd( &dc );
break;
case ID_POPUP_DELETE_BLOCK:
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->m_BlockLocate.m_Command = BLOCK_DELETE;
m_canvas->MoveCursorToCrossHair();
HandleBlockEnd( &dc );
break;
case ID_POPUP_COPY_BLOCK:
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY;
m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc );
break;
case ID_POPUP_SELECT_ITEMS_BLOCK:
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->m_BlockLocate.m_Command = BLOCK_SELECT_ITEMS_ONLY;
m_canvas->MoveCursorToCrossHair();
HandleBlockEnd( &dc );
break;
case ID_POPUP_MIRROR_Y_BLOCK:
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->m_BlockLocate.m_Command = BLOCK_MIRROR_Y;
m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc );
break;
case ID_POPUP_MIRROR_X_BLOCK:
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->m_BlockLocate.m_Command = BLOCK_MIRROR_X;
m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc );
break;
case ID_POPUP_ROTATE_BLOCK:
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->m_BlockLocate.m_Command = BLOCK_ROTATE;
m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc );
break;
case ID_POPUP_PLACE_BLOCK:
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc );
break;
@ -846,7 +846,7 @@ void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
}
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
if( GetToolId() == ID_NO_TOOL_SELECTED )
m_lastDrawItem = NULL;
@ -1072,7 +1072,7 @@ void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
break;
}
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
}
@ -1160,7 +1160,7 @@ LIB_ITEM* LIB_EDIT_FRAME::locateItem( const wxPoint& aPosition, const KICAD_T aF
// Set to NULL in case user aborts the clarification context menu.
m_drawItem = 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 );
m_canvas->MoveCursorToCrossHair();
item = m_drawItem;
@ -1212,7 +1212,7 @@ void LIB_EDIT_FRAME::deleteItem( wxDC* aDC )
{
if( m_canvas->IsMouseCaptured() )
{
m_canvas->m_endMouseCaptureCallback( m_canvas, aDC );
m_canvas->CallEndMouseCapture( aDC );
}
else
{
@ -1237,7 +1237,7 @@ void LIB_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent )
&& (index >= 0 && index < m_collectedItems.GetCount()) )
{
LIB_ITEM* item = m_collectedItems[index];
m_canvas->m_AbortRequest = false;
m_canvas->SetAbortRequest( false );
m_drawItem = item;
}
}

View File

@ -57,7 +57,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( GetToolId() == ID_NO_TOOL_SELECTED ) || ( item && item->GetFlags() ) )
{
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
m_itemToRepeat = NULL;
if( item && item->GetFlags() )
@ -129,12 +129,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{
m_itemToRepeat = AddNoConnect( aDC, gridPosition );
GetScreen()->SetCurItem( m_itemToRepeat );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
}
else
{
item->Place( this, aDC );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
}
GetScreen()->TestDanglingEnds();
@ -146,12 +146,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{
m_itemToRepeat = AddJunction( aDC, gridPosition, true );
GetScreen()->SetCurItem( m_itemToRepeat );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
}
else
{
item->Place( this, aDC );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
}
GetScreen()->TestDanglingEnds();
@ -165,7 +165,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
item = CreateBusEntry( aDC, ( GetToolId() == ID_WIRETOBUS_ENTRY_BUTT ) ?
WIRE_TO_BUS : BUS_TO_BUS );
GetScreen()->SetCurItem( item );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
}
else
{
@ -173,7 +173,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
GetScreen()->SetCurItem( NULL );
GetScreen()->TestDanglingEnds();
m_canvas->Refresh( true );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
}
break;
@ -183,29 +183,29 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
case ID_WIRE_BUTT:
BeginSegment( aDC, LAYER_WIRE );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
break;
case ID_BUS_BUTT:
BeginSegment( aDC, LAYER_BUS );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
break;
case ID_LINE_COMMENT_BUTT:
BeginSegment( aDC, LAYER_NOTES );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
break;
case ID_TEXT_COMMENT_BUTT:
if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_NOTES ) );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
}
else
{
item->Place( this, aDC );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
}
break;
@ -213,12 +213,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{
GetScreen()->SetCurItem( CreateNewImage( aDC ) );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
}
else
{
item->Place( this, aDC );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
}
break;
@ -226,12 +226,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_LOCLABEL ) );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
}
else
{
item->Place( this, aDC );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->TestDanglingEnds();
m_canvas->Refresh( true );
}
@ -247,12 +247,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( GetToolId() == ID_HIERLABEL_BUTT )
GetScreen()->SetCurItem( CreateNewText( aDC, LAYER_HIERLABEL ) );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
}
else
{
item->Place( this, aDC );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->TestDanglingEnds();
m_canvas->Refresh( true );
}
@ -262,12 +262,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{
GetScreen()->SetCurItem( CreateSheet( aDC ) );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
}
else
{
item->Place( this, aDC );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->TestDanglingEnds();
m_canvas->Refresh( true );
}
@ -300,12 +300,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( (item == NULL) || (item->GetFlags() == 0) )
{
GetScreen()->SetCurItem( Load_Component( aDC, wxEmptyString, s_CmpNameList, true ) );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
}
else
{
item->Place( this, aDC );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->TestDanglingEnds();
m_canvas->Refresh( true );
}
@ -316,12 +316,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{
GetScreen()->SetCurItem( Load_Component( aDC, wxT( "power" ),
s_PowerNameList, false ) );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
}
else
{
item->Place( this, aDC );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
GetScreen()->TestDanglingEnds();
m_canvas->Refresh( true );
}

View File

@ -76,7 +76,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
bool BlockActive = GetScreen()->IsBlockActive();
// Do not start a block command on context menu.
m_canvas->m_CanStartBlock = -1;
m_canvas->SetCanStartBlock( -1 );
if( BlockActive )
{
@ -91,15 +91,15 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
item = LocateAndShowItem( aPosition, SCH_COLLECTOR::AllItemsButPins );
// 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;
}
}
// If Command in progress: add "cancel" and "end tool" menu
if( GetToolId() != ID_NO_TOOL_SELECTED )
if( GetToolId() != ID_NO_TOOL_SELECTED )
{
if( item && item->GetFlags() )
{

View File

@ -220,12 +220,12 @@ void LIB_EDIT_FRAME::PlacePin( wxDC* DC )
if( ask_for_pin && SynchronizePins() )
{
m_canvas->m_IgnoreMouseEvents = true;
m_canvas->SetIgnoreMouseEvents( true );
status =
IsOK( this, _( "This position is already occupied by \
another pin. Continue?" ) );
m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
if( !status )
return;
@ -398,12 +398,12 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
pin->SetUnit( LastPinCommonUnit ? 0 : m_unit );
pin->SetVisible( LastPinVisible );
PinPreviousPos = pin->GetPosition();
m_canvas->m_IgnoreMouseEvents = true;
m_canvas->SetIgnoreMouseEvents( true );
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
GetEventHandler()->ProcessEvent( cmd );
m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
if( pin->GetFlags() & IS_CANCELLED )
{

View File

@ -190,7 +190,7 @@ void SCH_BITMAP::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset
wxSize size = m_Image->GetSize();
pos.x -= size.x / 2;
pos.y -= size.y / 2;
GRRect( &aPanel->m_ClipBox, aDC, pos.x, pos.y,
GRRect( aPanel->GetClipBox(), aDC, pos.x, pos.y,
pos.x + size.x, pos.y + size.y, 0, aColor );
}
}

View File

@ -199,7 +199,7 @@ void SCH_BUS_ENTRY::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOff
GRSetDrawMode( aDC, aDrawMode );
GRLine( &aPanel->m_ClipBox, aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y,
GRLine( aPanel->GetClipBox(), aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y,
m_End().x + aOffset.x, m_End().y + aOffset.y, GetPenSize(), color );
}

View File

@ -334,18 +334,18 @@ void SCH_COMPONENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset
{
EDA_RECT BoundaryBox;
BoundaryBox = GetBoundingBox();
GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN );
GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN );
#if 1
if( GetField( REFERENCE )->IsVisible() )
{
BoundaryBox = GetField( REFERENCE )->GetBoundingBox();
GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN );
GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN );
}
if( GetField( VALUE )->IsVisible() )
{
BoundaryBox = GetField( VALUE )->GetBoundingBox();
GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN );
GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN );
}
#endif
}

View File

@ -201,7 +201,7 @@ void SCH_FIELD::Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
#if 0
// Draw boundary box:
GRRect( &panel->m_ClipBox, DC, boundaryBox, 0, BROWN );
GRRect( panel->GetClipBox(), DC, boundaryBox, 0, BROWN );
// Draw the text anchor point
@ -211,9 +211,9 @@ void SCH_FIELD::Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
textpos = parentComponent->GetScreenCoord( textpos );
textpos += parentComponent->GetPosition();
const int len = 10;
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
textpos.x - len, textpos.y, textpos.x + len, textpos.y, 0, BLUE );
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
textpos.x, textpos.y - len, textpos.x, textpos.y + len, 0, BLUE );
#endif
}

View File

@ -134,7 +134,7 @@ void SCH_JUNCTION::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffs
GRSetDrawMode( aDC, aDrawMode );
GRFilledCircle( &aPanel->m_ClipBox, aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y,
GRFilledCircle( aPanel->GetClipBox(), aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y,
( m_size.x / 2 ), 0, color, color );
}

View File

@ -240,13 +240,14 @@ void SCH_LINE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
if( ( m_Flags & STARTPOINT ) == 0 )
start += offset;
if( ( m_Flags & ENDPOINT ) == 0 )
end += offset;
if( m_Layer == LAYER_NOTES )
GRDashedLine( &panel->m_ClipBox, DC, start.x, start.y, end.x, end.y, width, color );
GRDashedLine( panel->GetClipBox(), DC, start.x, start.y, end.x, end.y, width, color );
else
GRLine( &panel->m_ClipBox, DC, start, end, width, color );
GRLine( panel->GetClipBox(), DC, start, end, width, color );
if( m_startIsDangling )
DrawDanglingSymbol( panel, DC, start, color );

View File

@ -148,8 +148,10 @@ void SCH_NO_CONNECT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOf
GRSetDrawMode( aDC, aDrawMode );
GRLine( &aPanel->m_ClipBox, aDC, pX - delta, pY - delta, pX + delta, pY + delta, width, color );
GRLine( &aPanel->m_ClipBox, aDC, pX + delta, pY - delta, pX - delta, pY + delta, width, color );
GRLine( aPanel->GetClipBox(), aDC, pX - delta, pY - delta, pX + delta, pY + delta,
width, color );
GRLine( aPanel->GetClipBox(), aDC, pX + delta, pY - delta, pX - delta, pY + delta,
width, color );
}

View File

@ -187,13 +187,13 @@ void SCH_POLYLINE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffs
if( m_Layer == LAYER_NOTES )
{
for( unsigned i = 1; i < GetCornerCount(); i++ )
GRDashedLineTo( &aPanel->m_ClipBox, aDC, m_points[i].x + aOffset.x,
GRDashedLineTo( aPanel->GetClipBox(), aDC, m_points[i].x + aOffset.x,
m_points[i].y + aOffset.y, width, color );
}
else
{
for( unsigned i = 1; i < GetCornerCount(); i++ )
GRLineTo( &aPanel->m_ClipBox, aDC, m_points[i].x + aOffset.x,
GRLineTo( aPanel->GetClipBox(), aDC, m_points[i].x + aOffset.x,
m_points[i].y + aOffset.y, width, color );
}
}

View File

@ -608,7 +608,7 @@ void SCH_SCREEN::Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, int aDrawMode, int aC
// uncomment line below when there is a virtual
// EDA_ITEM::GetBoundingBox()
// if( panel->m_ClipBox.Intersects( Structs->GetBoundingBox()
// if( panel->GetClipBox().Intersects( Structs->GetBoundingBox()
// ) )
item->Draw( aCanvas, aDC, wxPoint( 0, 0 ), aDrawMode, aColor );
}

View File

@ -608,7 +608,7 @@ void SCH_SHEET::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
GRSetDrawMode( aDC, aDrawMode );
GRRect( &aPanel->m_ClipBox, aDC, pos.x, pos.y,
GRRect( aPanel->GetClipBox(), aDC, pos.x, pos.y,
pos.x + m_size.x, pos.y + m_size.y, lineWidth, color );
pos_sheetname = GetSheetNamePosition() + aOffset;

View File

@ -397,7 +397,7 @@ void SCH_TEXT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& aOffset,
#if 0
{
EDA_RECT BoundaryBox = GetBoundingBox();
GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN );
GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN );
}
#endif
}
@ -1225,7 +1225,7 @@ void SCH_GLOBALLABEL::Draw( EDA_DRAW_PANEL* panel,
EXCHG( linewidth, m_Thickness ); // set initial value
CreateGraphicShape( Poly, m_Pos + aOffset );
GRPoly( &panel->m_ClipBox, DC, Poly.size(), &Poly[0], 0, linewidth, color, color );
GRPoly( panel->GetClipBox(), DC, Poly.size(), &Poly[0], 0, linewidth, color, color );
if( m_isDangling )
DrawDanglingSymbol( panel, DC, m_Pos + aOffset, color );
@ -1234,7 +1234,7 @@ void SCH_GLOBALLABEL::Draw( EDA_DRAW_PANEL* panel,
#if 0
{
EDA_RECT BoundaryBox = GetBoundingBox();
GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN );
GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN );
}
#endif
}
@ -1562,7 +1562,7 @@ void SCH_HIERLABEL::Draw( EDA_DRAW_PANEL* panel,
EXCHG( linewidth, m_Thickness ); // set initial value
CreateGraphicShape( Poly, m_Pos + offset );
GRPoly( &panel->m_ClipBox, DC, Poly.size(), &Poly[0], 0, linewidth, color, color );
GRPoly( panel->GetClipBox(), DC, Poly.size(), &Poly[0], 0, linewidth, color, color );
if( m_isDangling )
DrawDanglingSymbol( panel, DC, m_Pos + offset, color );
@ -1571,7 +1571,7 @@ void SCH_HIERLABEL::Draw( EDA_DRAW_PANEL* panel,
#if 0
{
EDA_RECT BoundaryBox = GetBoundingBox();
GRRect( &panel->m_ClipBox, DC, BoundaryBox, 0, BROWN );
GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN );
}
#endif
}

View File

@ -291,7 +291,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_POPUP_PLACE_BLOCK:
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
m_canvas->MoveCursorToCrossHair();
HandleBlockPlace( &dc );
break;

View File

@ -225,7 +225,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
if( m_canvas )
m_canvas->m_Block_Enable = true;
m_canvas->SetEnableBlockCommands( true );
ReCreateMenuBar();
ReCreateHToolbar();
@ -653,7 +653,7 @@ void SCH_EDIT_FRAME::OnFindItems( wxCommandEvent& aEvent )
wxCHECK_RET( m_findReplaceData != NULL,
wxT( "Forgot to create find/replace data. Bad Programmer!" ) );
this->GetCanvas()->m_IgnoreMouseEvents = true;
this->GetCanvas()->SetIgnoreMouseEvents( true );
if( m_dlgFindReplace )
{
@ -704,7 +704,7 @@ void SCH_EDIT_FRAME::OnFindDialogClose( wxFindDialogEvent& event )
m_dlgFindReplace = NULL;
}
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
}
@ -890,7 +890,7 @@ void SCH_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent )
&& (index >= 0 && index < m_collectedItems.GetCount()) )
{
SCH_ITEM* item = m_collectedItems[index];
m_canvas->m_AbortRequest = false;
m_canvas->SetAbortRequest( false );
GetScreen()->SetCurItem( item );
}
}

View File

@ -164,7 +164,7 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
}
aSheet->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
m_canvas->m_IgnoreMouseEvents = true;
m_canvas->SetIgnoreMouseEvents( true );
if( isUndoable )
SaveCopyInUndoList( aSheet, UR_CHANGED );
@ -204,7 +204,7 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
aSheet->SetName( wxString::Format( wxT( "Sheet%8.8lX" ), aSheet->GetTimeStamp() ) );
m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
aSheet->Draw( m_canvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
OnModify();
@ -321,7 +321,7 @@ SCH_SHEET* SCH_EDIT_FRAME::CreateSheet( wxDC* aDC )
// a sheet to a screen that already has multiple instances (!)
GetScreen()->SetCurItem( sheet );
m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( aDC, wxDefaultPosition, false );
m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( sheet->GetResizePosition() );
m_canvas->MoveCursorToCrossHair();
@ -349,7 +349,7 @@ void SCH_EDIT_FRAME::ReSizeSheet( SCH_SHEET* aSheet, wxDC* aDC )
aSheet->SetFlags( IS_RESIZED );
m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, true );
m_canvas->CallMouseCapture( aDC, wxDefaultPosition, true );
if( aSheet->IsNew() ) // not already in edit, save a copy for undo/redo
SetUndoItem( aSheet );
@ -370,6 +370,6 @@ void SCH_EDIT_FRAME::StartMoveSheet( SCH_SHEET* aSheet, wxDC* aDC )
aSheet->SetFlags( IS_MOVED );
m_canvas->SetMouseCapture( MoveOrResizeSheet, ExitSheet );
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, true );
m_canvas->CallMouseCapture( aDC, wxDefaultPosition, true );
m_canvas->CrossHairOn( aDC );
}

View File

@ -1,3 +1,28 @@
/*
* 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 symbdraw.cpp
* @brief Create, move .. graphic shapes used to build and draw a component (lines, arcs ..)
@ -155,9 +180,9 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
Text->m_Orient = m_textOrientation;
// Enter the graphic text info
m_canvas->m_IgnoreMouseEvents = true;
m_canvas->SetIgnoreMouseEvents( true );
EditSymbolText( NULL, Text );
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair();
if( Text->m_Text.IsEmpty() )
@ -188,7 +213,7 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
m_drawItem->SetConvert( m_convert );
// Draw initial symbol:
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
}
else
{
@ -197,7 +222,7 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC )
}
m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = FALSE;
m_canvas->SetIgnoreMouseEvents( false );
return m_drawItem;
}
@ -263,7 +288,7 @@ void LIB_EDIT_FRAME::StartMoveDrawSymbol( wxDC* DC )
TempCopyComponent();
m_drawItem->BeginEdit( IS_MOVED, GetScreen()->GetCrossHairPosition( true ) );
m_canvas->SetMouseCapture( RedrawWhileMovingCursor, AbortSymbolTraceOn );
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, true );
}
@ -276,7 +301,7 @@ void LIB_EDIT_FRAME::StartModifyDrawSymbol( wxDC* DC )
TempCopyComponent();
m_drawItem->BeginEdit( IS_RESIZED, GetScreen()->GetCrossHairPosition( true ) );
m_canvas->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn );
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, true );
}

View File

@ -57,7 +57,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
if( m_component == NULL || ( m_drawItem && m_drawItem->GetFlags() ) )
return;
m_canvas->m_IgnoreMouseEvents = true;
m_canvas->SetIgnoreMouseEvents( true );
wxString default_path = wxGetApp().ReturnLastVisitedLibraryPath();
@ -70,7 +70,7 @@ void LIB_EDIT_FRAME::LoadOneSymbol()
GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) );
m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = FALSE;
m_canvas->SetIgnoreMouseEvents( false );
wxFileName fn = dlg.GetPath();
wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() );

View File

@ -85,7 +85,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
{
case BLOCK_MOVE: /* Move */
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
Block_Move( DC );
GetScreen()->m_BlockLocate.ClearItemsList();
@ -93,7 +93,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_COPY: /* Copy */
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
Block_Duplicate( DC );
GetScreen()->m_BlockLocate.ClearItemsList();
@ -139,14 +139,14 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_COPY: /* Copy */
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
nextcmd = true;
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
break;
case BLOCK_DELETE: /* Delete */
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
Block_Delete( DC );
break;
@ -257,7 +257,7 @@ void GERBVIEW_FRAME::Block_Move( wxDC* DC )
wxPoint oldpos;
oldpos = GetScreen()->GetCrossHairPosition();
m_canvas->m_mouseCaptureCallback = NULL;
m_canvas->SetMouseCaptureCallback( NULL );
GetScreen()->SetCrossHairPosition( oldpos );
m_canvas->MoveCursorToCrossHair();
@ -286,7 +286,7 @@ void GERBVIEW_FRAME::Block_Duplicate( wxDC* DC )
wxPoint oldpos;
oldpos = GetScreen()->GetCrossHairPosition();
m_canvas->m_mouseCaptureCallback = NULL;
m_canvas->SetMouseCaptureCallback( NULL );
GetScreen()->SetCrossHairPosition( oldpos );
m_canvas->MoveCursorToCrossHair();

View File

@ -364,7 +364,7 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
if( !isDark )
isFilled = true;
DrawGbrPoly( &aPanel->m_ClipBox, aDC, color, aOffset, isFilled );
DrawGbrPoly( aPanel->GetClipBox(), aDC, color, aOffset, isFilled );
break;
case GBR_CIRCLE:
@ -376,14 +376,14 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
if( !isFilled )
{
// draw the border of the pen's path using two circles, each as narrow as possible
GRCircle( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ),
GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
radius - halfPenWidth, 0, color );
GRCircle( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ),
GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
radius + halfPenWidth, 0, color );
}
else // Filled mode
{
GRCircle( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ),
GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
radius, m_Size.x, color );
}
break;
@ -393,21 +393,21 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
// a round pen only is expected.
#if 0 // for arc debug only
GRLine( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ),
GRLine( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
GetABPosition( m_ArcCentre ), 0, color );
GRLine( &aPanel->m_ClipBox, aDC, GetABPosition( m_End ),
GRLine( aPanel->GetClipBox(), aDC, GetABPosition( m_End ),
GetABPosition( m_ArcCentre ), 0, color );
#endif
if( !isFilled )
{
GRArc1( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ),
GRArc1( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
GetABPosition( m_End ), GetABPosition( m_ArcCentre ),
0, color );
}
else
{
GRArc1( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ),
GRArc1( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
GetABPosition( m_End ), GetABPosition( m_ArcCentre ),
m_Size.x, color );
}
@ -420,7 +420,7 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
case GBR_SPOT_POLY:
case GBR_SPOT_MACRO:
isFilled = DisplayOpt.DisplayPadFill ? true : false;
d_codeDescr->DrawFlashedShape( this, &aPanel->m_ClipBox, aDC, color, alt_color,
d_codeDescr->DrawFlashedShape( this, aPanel->GetClipBox(), aDC, color, alt_color,
m_Start, isFilled );
break;
@ -435,18 +435,18 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
if( m_PolyCorners.size() == 0 )
ConvertSegmentToPolygon( );
DrawGbrPoly( &aPanel->m_ClipBox, aDC, color, aOffset, isFilled );
DrawGbrPoly( aPanel->GetClipBox(), aDC, color, aOffset, isFilled );
}
else
{
if( !isFilled )
{
GRCSegm( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ),
GRCSegm( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
GetABPosition( m_End ), m_Size.x, color );
}
else
{
GRFilledSegment( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ),
GRFilledSegment( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
GetABPosition( m_End ), m_Size.x, color );
}
}

View File

@ -1,6 +1,30 @@
/****************/
/* controle.cpp */
/****************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2010 <Jean-Pierre Charras>
* Copyright (C) 1992-2010 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 gerbview/controle.cpp
*/
#include "fctsys.h"
#include "common.h"
@ -61,7 +85,7 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( m_canvas->IsMouseCaptured() )
{
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
m_canvas->CallMouseCapture( aDC, aPosition, true );
}
}

View File

@ -56,11 +56,11 @@ void GERBVIEW_FRAME::PrintPage( wxDC* aDC, int aPrintMasklayer,
DisplayOpt.DisplayZonesMode = 0;
g_DisplayPolygonsModeSketch = 0;
m_canvas->m_PrintIsMirrored = aPrintMirrorMode;
m_canvas->SetPrintMirrored( aPrintMirrorMode );
GetBoard()->Draw( m_canvas, aDC, -1, wxPoint( 0, 0 ) );
m_canvas->m_PrintIsMirrored = false;
m_canvas->SetPrintMirrored( false );
// Restore draw options:
GetBoard()->SetVisibleLayers( visiblemask );
@ -109,7 +109,7 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
TraceWorkSheet( DC, screen, 0 );
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->DrawCrossHair( DC );
@ -158,7 +158,7 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin
// these parameters are saved here, because they are modified
// and restored later
EDA_RECT drawBox = aPanel->m_ClipBox;
EDA_RECT drawBox = *aPanel->GetClipBox();
double scale;
aDC->GetUserScale(&scale, &scale);
wxPoint dev_org = aDC->GetDeviceOrigin();
@ -171,7 +171,7 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin
screenBitmap = new wxBitmap( bitmapWidth, bitmapHeight );
layerDC.SelectObject( *layerBitmap );
aPanel->DoPrepareDC( layerDC );
aPanel->m_ClipBox = drawBox;
aPanel->SetClipBox( drawBox );
layerDC.SetBackground( bgBrush );
layerDC.SetBackgroundMode( wxSOLID );
layerDC.Clear();

View File

@ -184,7 +184,7 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PLACE_BLOCK:
GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE;
m_canvas->m_AutoPAN_Request = FALSE;
m_canvas->SetAutoPanRequest( false );
HandleBlockPlace( &dc );
break;

View File

@ -76,7 +76,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( wxWindow* father,
m_drillFileHistory.SetBaseId( ID_GERBVIEW_DRILL_FILE1 );
if( m_canvas )
m_canvas->m_Block_Enable = true;
m_canvas->SetEnableBlockCommands( true );
// Give an icon
wxIcon icon;

View File

@ -20,7 +20,7 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
// Do not initiate a start block validation on menu.
m_canvas->m_CanStartBlock = -1;
m_canvas->SetCanStartBlock( -1 );
// Simple location of elements where possible.
if( ( DrawStruct == NULL ) || ( DrawStruct->GetFlags() == 0 ) )

View File

@ -63,37 +63,34 @@ private:
int m_scrollIncrementY; ///< Y axis scroll increment in pixels per unit.
wxPoint m_CursorStartPos; ///< Used for testing the cursor movement.
public:
EDA_RECT m_ClipBox; // the clipbox used in screen redraw (usually gives the
// visible area in internal units)
bool m_AbortRequest; // Flag to abort long commands
bool m_AbortEnable; // true if abort button or menu to be displayed
/// The drawing area used to redraw the screen which is usually the visible area
/// of the drawing in internal units.
EDA_RECT m_ClipBox;
bool m_AutoPAN_Enable; // true to allow auto pan
bool m_AutoPAN_Request; // true to request an auto pan (will be made only if
// m_AutoPAN_Enable = true)
int m_IgnoreMouseEvents; // when non-zero (true), then ignore mouse events
bool m_Block_Enable; // true to accept Block Commands
bool m_abortRequest; ///< Flag used to abort long commands.
bool m_enableAutoPan; ///< True to enable automatic panning.
/// true to request an auto pan. Valid only when m_enableAutoPan = true.
bool m_requestAutoPan;
bool m_ignoreMouseEvents; ///< Ignore mouse events when true.
bool m_enableBlockCommands; ///< True enables block commands.
/// True when drawing in mirror mode. Used by the draw arc function, because arcs
/// are oriented, and in mirror mode, orientations are reversed.
bool m_PrintIsMirrored;
/// Mouse capture move callback function.
MOUSE_CAPTURE_CALLBACK m_mouseCaptureCallback;
/// Abort mouse capture callback function.
END_MOUSE_CAPTURE_CALLBACK m_endMouseCaptureCallback;
// useful to avoid false start block in certain cases
// (like switch from a sheet to an other sheet
int m_CanStartBlock; // >= 0 (or >= n) if a block can start
bool m_PrintIsMirrored; // True when drawing in mirror mode. Used in draw arc function,
// because arcs are oriented, and in mirror mode, orientations
// are reversed
#ifdef USE_WX_OVERLAY
// MAC Uses overlay to workaround the wxINVERT and wxXOR miss
wxOverlay m_overlay;
#endif
/* Cursor management (used in editing functions) */
/* Mouse capture move callback function. */
MOUSE_CAPTURE_CALLBACK m_mouseCaptureCallback;
/* Abort mouse capture callback function. */
END_MOUSE_CAPTURE_CALLBACK m_endMouseCaptureCallback;
int m_canStartBlock; // >= 0 (or >= n) if a block can start
public:
@ -106,6 +103,29 @@ public:
void OnPaint( wxPaintEvent& event );
EDA_RECT* GetClipBox() { return &m_ClipBox; }
void SetClipBox( const EDA_RECT& aRect ) { m_ClipBox = aRect; }
bool GetAbortRequest() const { return m_abortRequest; }
void SetAbortRequest( bool aAbortRequest ) { m_abortRequest = aAbortRequest; }
bool GetEnableAutoPan() const { return m_enableAutoPan; }
void SetEnableAutoPan( bool aEnable ) { m_enableAutoPan = aEnable; }
void SetAutoPanRequest( bool aEnable ) { m_requestAutoPan = aEnable; }
void SetIgnoreMouseEvents( bool aIgnore ) { m_ignoreMouseEvents = aIgnore; }
void SetEnableBlockCommands( bool aEnable ) { m_enableBlockCommands = aEnable; }
bool GetPrintMirrored() const { return m_PrintIsMirrored; }
void SetPrintMirrored( bool aMirror ) { m_PrintIsMirrored = aMirror; }
void SetCanStartBlock( int aStartBlock ) { m_canStartBlock = aStartBlock; }
/**
* Function DrawBackGround
@ -151,7 +171,7 @@ public:
* Function OnActivate
* handles window activation events.
* <p>
* The member m_CanStartBlock is initialize to avoid a block start command on activation
* The member m_canStartBlock is initialize to avoid a block start command on activation
* (because a left mouse button can be pressed and no block command wanted. This happens
* when enter on a hierarchy sheet on double click.
*</p>
@ -310,6 +330,13 @@ public:
m_endMouseCaptureCallback = aEndMouseCaptureCallback;
}
void SetMouseCaptureCallback( MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback )
{
m_mouseCaptureCallback = aMouseCaptureCallback;
}
/**
* Function EndMouseCapture
* ends mouse a capture.
@ -328,6 +355,26 @@ public:
inline bool IsMouseCaptured() const { return m_mouseCaptureCallback != NULL; }
/**
* Function CallMouseCapture
* calls the mouse capture callback.
*
* @param aDC A point to a wxDC object to perform any drawing upon.
* @param aPosition A referecnce to a wxPoint object containing the current cursor
* position.
* @param aErase True indicates the item being drawn should be erase before drawing
* it a \a aPosition.
*/
void CallMouseCapture( wxDC* aDC, const wxPoint& aPosition, bool aErase );
/**
* Function CallEndMouseCapture
* calls the end mouse capture callback.
*
* @param aDC A point to a wxDC object to perform any drawing upon.
*/
void CallEndMouseCapture( wxDC* aDC );
/**
* Function SetCurrentCursor
* Set the current cursor shape for drawpanel

View File

@ -37,9 +37,6 @@
#include "wx/fileconf.h"
class wxAboutDialogInfo;
class BASE_SCREEN;
class EDA_DRAW_FRAME;
class EDA_DRAW_PANEL;
/* Flag for special keys */
#define GR_KB_RIGHTSHIFT 0x10000000 /* Keybd states: right

View File

@ -11,6 +11,10 @@
#include "common.h" // EDA_UNITS_T
class EDA_DRAW_FRAME;
/**
* class EDA_LIST_DIALOG
*

View File

@ -363,9 +363,13 @@ public:
*/
class EDA_DRAW_FRAME : public EDA_BASE_FRAME
{
private:
///< Id of active button on the vertical toolbar.
int m_toolId;
BASE_SCREEN* m_currentScreen; ///< current used SCREEN
bool m_snapToGrid; ///< Indicates if cursor should be snapped to grid.
protected:
EDA_HOTKEY_CONFIG* m_HotkeysZoomAndGridList;
int m_LastGridSizeId;
@ -419,14 +423,15 @@ protected:
/// Panel used to display information at the bottom of the main window.
EDA_MSG_PANEL* m_messagePanel;
#ifdef USE_WX_OVERLAY
// MAC Uses overlay to workaround the wxINVERT and wxXOR miss
wxOverlay m_overlay;
#endif
/// Let the #EDA_DRAW_PANEL object have access to the protected data since
/// it is closely tied to the #EDA_DRAW_FRAME.
friend class EDA_DRAW_PANEL;
private:
BASE_SCREEN* m_currentScreen; ///< current used SCREEN
bool m_snapToGrid; ///< Indicates if cursor should be snapped to grid.
protected:
void SetScreen( BASE_SCREEN* aScreen )
{

View File

@ -95,7 +95,7 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event )
case ID_POPUP_CANCEL_CURRENT_COMMAND:
if( m_canvas->IsMouseCaptured() )
{
m_canvas->m_endMouseCaptureCallback( m_canvas, &dc );
m_canvas->CallEndMouseCapture( &dc );
}
break;

View File

@ -117,8 +117,7 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC )
if( GetBoard()->m_Modules == NULL )
return;
m_canvas->m_AbortRequest = false;
m_canvas->m_AbortEnable = true;
m_canvas->SetAbortRequest( false );
switch( place_mode )
{
@ -391,7 +390,6 @@ end_of_tst:
GetBoard()->m_Status_Pcb = 0;
Compile_Ratsnest( DC, true );
m_canvas->ReDraw( DC, true );
m_canvas->m_AbortEnable = false;
}
@ -431,7 +429,7 @@ void PCB_EDIT_FRAME::DrawInfoPlace( wxDC* DC )
color = DARKGRAY;
}
GRPutPixel( &m_canvas->m_ClipBox, DC, ox, oy, color );
GRPutPixel( m_canvas->GetClipBox(), DC, ox, oy, color );
}
}
}
@ -690,12 +688,12 @@ int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC )
{
wxYield();
if( m_canvas->m_AbortRequest )
if( m_canvas->GetAbortRequest() )
{
if( IsOK( this, _( "Ok to abort?" ) ) )
return ESC;
else
m_canvas->m_AbortRequest = false;
m_canvas->SetAbortRequest( false );
}
cx = aModule->m_Pos.x; cy = aModule->m_Pos.y;
@ -956,7 +954,7 @@ float PCB_EDIT_FRAME::Compute_Ratsnest_PlaceModule( wxDC* DC )
if( AutoPlaceShowAll )
{
GRLine( &m_canvas->m_ClipBox, DC, ox, oy, fx, fy, 0, color );
GRLine( m_canvas->GetClipBox(), DC, ox, oy, fx, fy, 0, color );
}
/* Cost of the ratsnest. */

View File

@ -253,7 +253,7 @@ void DisplayBoard( EDA_DRAW_PANEL* panel, wxDC* DC )
{
for( i = 0; i < maxi; i++ )
for( j = 0; j < maxi; j++ )
GRPutPixel( &panel->m_ClipBox, DC,
GRPutPixel( panel->GetClipBox(), DC,
( col * maxi ) + i + DRAW_OFFSET_X,
( row * maxi ) + j + DRAW_OFFSET_Y, color );

View File

@ -371,7 +371,7 @@ void PCB_BASE_FRAME::ProcessItemSelection( wxCommandEvent& aEvent )
if( id >= ID_POPUP_PCB_ITEM_SELECTION_START && id <= ID_POPUP_PCB_ITEM_SELECTION_END )
{
BOARD_ITEM* item = (*m_Collector)[itemNdx];
m_canvas->m_AbortRequest = false;
m_canvas->SetAbortRequest( false );
#if 0 && defined (DEBUG)
item->Show( 0, std::cout );

View File

@ -121,7 +121,7 @@ static bool InstallBlockCmdFrame( PCB_BASE_FRAME* parent, const wxString& title
{
wxPoint oldpos = parent->GetScreen()->GetCrossHairPosition();
parent->GetCanvas()->m_IgnoreMouseEvents = true;
parent->GetCanvas()->SetIgnoreMouseEvents( true );
DIALOG_BLOCK_OPTIONS * dlg = new DIALOG_BLOCK_OPTIONS( parent, title );
int cmd = dlg->ShowModal();
@ -129,7 +129,7 @@ static bool InstallBlockCmdFrame( PCB_BASE_FRAME* parent, const wxString& title
parent->GetScreen()->SetCrossHairPosition( oldpos );
parent->GetCanvas()->MoveCursorToCrossHair();
parent->GetCanvas()->m_IgnoreMouseEvents = false;
parent->GetCanvas()->SetIgnoreMouseEvents( false );
return cmd == wxID_OK;
}
@ -235,7 +235,7 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_MOVE: /* Move */
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
Block_Move();
GetScreen()->m_BlockLocate.ClearItemsList();
@ -243,7 +243,7 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_COPY: /* Copy */
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
Block_Duplicate();
GetScreen()->m_BlockLocate.ClearItemsList();
@ -293,7 +293,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
cancelCmd = true;
// undraw block outline
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
}
else
{
@ -320,24 +320,24 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
nextcmd = true;
m_canvas->m_mouseCaptureCallback = drawMovingBlock;
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->SetMouseCaptureCallback( drawMovingBlock );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
break;
case BLOCK_DELETE: /* Delete */
m_canvas->m_mouseCaptureCallback = NULL;
m_canvas->SetMouseCaptureCallback( NULL );
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
Block_Delete();
break;
case BLOCK_ROTATE: /* Rotation */
m_canvas->m_mouseCaptureCallback = NULL;
m_canvas->SetMouseCaptureCallback( NULL );
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
Block_Rotate();
break;
case BLOCK_FLIP: /* Flip */
m_canvas->m_mouseCaptureCallback = NULL;
m_canvas->SetMouseCaptureCallback( NULL );
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
Block_Flip();
break;
@ -357,7 +357,7 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
// Turn off the redraw block routine now so it is not displayed
// with one corner at the new center of the screen
m_canvas->m_mouseCaptureCallback = NULL;
m_canvas->SetMouseCaptureCallback( NULL );
Window_Zoom( GetScreen()->m_BlockLocate );
break;

View File

@ -122,7 +122,7 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
{
BlockState state = GetScreen()->m_BlockLocate.m_State;
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_Command = command;
m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
@ -148,9 +148,9 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
if( m_canvas->IsMouseCaptured() )
{
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
}
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
@ -160,7 +160,7 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
nextcmd = true;
m_canvas->m_mouseCaptureCallback = DrawMovingBlockOutlines;
m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
break;

View File

@ -355,55 +355,55 @@ void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wxP
width = 0;
case FILLED:
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
m_crossBarOx - ox, m_crossBarOy - oy,
m_crossBarFx - ox, m_crossBarFy - oy, width, gcolor );
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
m_featureLineGOx - ox, m_featureLineGOy - oy,
m_featureLineGFx - ox, m_featureLineGFy - oy, width, gcolor );
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
m_featureLineDOx - ox, m_featureLineDOy - oy,
m_featureLineDFx - ox, m_featureLineDFy - oy, width, gcolor );
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
m_arrowD1Ox - ox, m_arrowD1Oy - oy,
m_arrowD1Fx - ox, m_arrowD1Fy - oy, width, gcolor );
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
m_arrowD2Ox - ox, m_arrowD2Oy - oy,
m_arrowD2Fx - ox, m_arrowD2Fy - oy, width, gcolor );
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
m_arrowG1Ox - ox, m_arrowG1Oy - oy,
m_arrowG1Fx - ox, m_arrowG1Fy - oy, width, gcolor );
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
m_arrowG2Ox - ox, m_arrowG2Oy - oy,
m_arrowG2Fx - ox, m_arrowG2Fy - oy, width, gcolor );
break;
case SKETCH:
GRCSegm( &panel->m_ClipBox, DC,
GRCSegm( panel->GetClipBox(), DC,
m_crossBarOx - ox, m_crossBarOy - oy,
m_crossBarFx - ox, m_crossBarFy - oy,
width, gcolor );
GRCSegm( &panel->m_ClipBox, DC,
GRCSegm( panel->GetClipBox(), DC,
m_featureLineGOx - ox, m_featureLineGOy - oy,
m_featureLineGFx - ox, m_featureLineGFy - oy,
width, gcolor );
GRCSegm( &panel->m_ClipBox, DC,
GRCSegm( panel->GetClipBox(), DC,
m_featureLineDOx - ox, m_featureLineDOy - oy,
m_featureLineDFx - ox, m_featureLineDFy - oy,
width, gcolor );
GRCSegm( &panel->m_ClipBox, DC,
GRCSegm( panel->GetClipBox(), DC,
m_arrowD1Ox - ox, m_arrowD1Oy - oy,
m_arrowD1Fx - ox, m_arrowD1Fy - oy,
width, gcolor );
GRCSegm( &panel->m_ClipBox, DC,
GRCSegm( panel->GetClipBox(), DC,
m_arrowD2Ox - ox, m_arrowD2Oy - oy,
m_arrowD2Fx - ox, m_arrowD2Fy - oy,
width, gcolor );
GRCSegm( &panel->m_ClipBox, DC,
GRCSegm( panel->GetClipBox(), DC,
m_arrowG1Ox - ox, m_arrowG1Oy - oy,
m_arrowG1Fx - ox, m_arrowG1Fy - oy,
width, gcolor );
GRCSegm( &panel->m_ClipBox, DC,
GRCSegm( panel->GetClipBox(), DC,
m_arrowG2Ox - ox, m_arrowG2Oy - oy,
m_arrowG2Fx - ox, m_arrowG2Fy - oy,
width, gcolor );

View File

@ -196,16 +196,16 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
if( mode == FILAIRE )
{
GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius, color );
GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius, color );
}
else if( mode == SKETCH )
{
GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius - l_trace, color );
GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius + l_trace, color );
GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius - l_trace, color );
GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius + l_trace, color );
}
else
{
GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius, m_Width, color );
GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius, m_Width, color );
}
break;
@ -216,7 +216,7 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
StAngle = (int) ArcTangente( dy - uy0, dx - ux0 );
EndAngle = StAngle + m_Angle;
if( !panel->m_PrintIsMirrored )
if( !panel->GetPrintMirrored() )
{
if( StAngle > EndAngle )
EXCHG( StAngle, EndAngle );
@ -229,19 +229,19 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
if( mode == FILAIRE )
GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle,
GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle,
radius, color );
else if( mode == SKETCH )
{
GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle,
GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle,
radius - l_trace, color );
GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle,
GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle,
radius + l_trace, color );
}
else
{
GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle,
GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle,
radius, m_Width, color );
}
break;
@ -250,20 +250,20 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
for (unsigned int i=1; i < m_BezierPoints.size(); i++) {
if( mode == FILAIRE )
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
m_BezierPoints[i].x, m_BezierPoints[i].y,
m_BezierPoints[i-1].x, m_BezierPoints[i-1].y, 0,
color );
else if( mode == SKETCH )
{
GRCSegm( &panel->m_ClipBox, DC,
m_BezierPoints[i].x, m_BezierPoints[i].y,
m_BezierPoints[i-1].x, m_BezierPoints[i-1].y,
GRCSegm( panel->GetClipBox(), DC,
m_BezierPoints[i].x, m_BezierPoints[i].y,
m_BezierPoints[i-1].x, m_BezierPoints[i-1].y,
m_Width, color );
}
else
{
GRFillCSegm( &panel->m_ClipBox, DC,
GRFillCSegm( panel->GetClipBox(), DC,
m_BezierPoints[i].x, m_BezierPoints[i].y,
m_BezierPoints[i-1].x, m_BezierPoints[i-1].y,
m_Width, color );
@ -273,17 +273,15 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
default:
if( mode == FILAIRE )
{
GRLine( &panel->m_ClipBox, DC, ux0, uy0, dx, dy, 0, color );
GRLine( panel->GetClipBox(), DC, ux0, uy0, dx, dy, 0, color );
}
else if( mode == SKETCH )
{
GRCSegm( &panel->m_ClipBox, DC, ux0, uy0, dx, dy,
m_Width, color );
GRCSegm( panel->GetClipBox(), DC, ux0, uy0, dx, dy, m_Width, color );
}
else
{
GRFillCSegm( &panel->m_ClipBox, DC, ux0, uy0, dx, dy,
m_Width, color );
GRFillCSegm( panel->GetClipBox(), DC, ux0, uy0, dx, dy, m_Width, color );
}
break;

View File

@ -125,12 +125,12 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
{
case S_SEGMENT:
if( typeaff == FILAIRE )
GRLine( &panel->m_ClipBox, DC, ux0, uy0, dx, dy, 0, color );
GRLine( panel->GetClipBox(), DC, ux0, uy0, dx, dy, 0, color );
else if( typeaff == FILLED )
GRLine( &panel->m_ClipBox, DC, ux0, uy0, dx, dy, m_Width, color );
GRLine( panel->GetClipBox(), DC, ux0, uy0, dx, dy, m_Width, color );
else
// SKETCH Mode
GRCSegm( &panel->m_ClipBox, DC, ux0, uy0, dx, dy, m_Width, color );
GRCSegm( panel->GetClipBox(), DC, ux0, uy0, dx, dy, m_Width, color );
break;
@ -139,18 +139,18 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
if( typeaff == FILAIRE )
{
GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius, color );
GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius, color );
}
else
{
if( typeaff == FILLED )
{
GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius, m_Width, color );
GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius, m_Width, color );
}
else // SKETCH Mode
{
GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius + (m_Width / 2), color );
GRCircle( &panel->m_ClipBox, DC, ux0, uy0, radius - (m_Width / 2), color );
GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius + (m_Width / 2), color );
GRCircle( panel->GetClipBox(), DC, ux0, uy0, radius - (m_Width / 2), color );
}
}
@ -166,17 +166,17 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
if( typeaff == FILAIRE )
{
GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle, radius, color );
GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius, color );
}
else if( typeaff == FILLED )
{
GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle, radius, m_Width, color );
GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius, m_Width, color );
}
else // SKETCH Mode
{
GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle,
GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle,
radius + (m_Width / 2), color );
GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle,
GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle,
radius - (m_Width / 2), color );
}
break;
@ -196,7 +196,7 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
pt += module->m_Pos - offset;
}
GRPoly( &panel->m_ClipBox, DC, points.size(), &points[0], true, m_Width, color, color );
GRPoly( panel->GetClipBox(), DC, points.size(), &points[0], true, m_Width, color, color );
break;
}
}

View File

@ -98,12 +98,12 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wx
width = 0;
case FILLED:
GRCircle( &panel->m_ClipBox, DC, ox, oy, radius, width, gcolor );
GRCircle( panel->GetClipBox(), DC, ox, oy, radius, width, gcolor );
break;
case SKETCH:
GRCircle( &panel->m_ClipBox, DC, ox, oy, radius + (width / 2), gcolor );
GRCircle( &panel->m_ClipBox, DC, ox, oy, radius - (width / 2), gcolor );
GRCircle( panel->GetClipBox(), DC, ox, oy, radius + (width / 2), gcolor );
GRCircle( panel->GetClipBox(), DC, ox, oy, radius - (width / 2), gcolor );
break;
}
@ -125,13 +125,13 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wx
{
case FILAIRE:
case FILLED:
GRLine( &panel->m_ClipBox, DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor );
GRLine( &panel->m_ClipBox, DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor );
GRLine( panel->GetClipBox(), DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor );
GRLine( panel->GetClipBox(), DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor );
break;
case SKETCH:
GRCSegm( &panel->m_ClipBox, DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor );
GRCSegm( &panel->m_ClipBox, DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor );
GRCSegm( panel->GetClipBox(), DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor );
GRCSegm( panel->GetClipBox(), DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor );
break;
}
}

View File

@ -99,11 +99,11 @@ void MODULE::DrawAncre( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
if( GetBoard()->IsElementVisible( ANCHOR_VISIBLE ) )
{
int color = g_ColorsSettings.GetItemColor( ANCHOR_VISIBLE );
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
m_Pos.x - offset.x - anchor_size, m_Pos.y - offset.y,
m_Pos.x - offset.x + anchor_size, m_Pos.y - offset.y,
0, color );
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
m_Pos.x - offset.x, m_Pos.y - offset.y - anchor_size,
m_Pos.x - offset.x, m_Pos.y - offset.y + anchor_size,
0, color );
@ -261,7 +261,7 @@ void MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoi
// Enable these line to draw m_BoundaryBox (debug tests purposes only)
#if 0
GRRect( &aPanel->m_ClipBox, aDC, m_BoundaryBox, 0, BROWN );
GRRect( aPanel->GetClipBox(), aDC, m_BoundaryBox, 0, BROWN );
#endif
}

View File

@ -172,6 +172,6 @@ void RATSNEST_ITEM::Draw( EDA_DRAW_PANEL* panel,
int color = g_ColorsSettings.GetItemColor(RATSNEST_VISIBLE);
GRLine( &panel->m_ClipBox, DC, m_PadStart->m_Pos - aOffset,
GRLine( panel->GetClipBox(), DC, m_PadStart->m_Pos - aOffset,
m_PadEnd->m_Pos - aOffset, 0, color );
}

View File

@ -376,7 +376,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi
if( !IsOnLayer( screen->m_Active_Layer ) && DisplayOpt.ContrastModeDisplay )
drawInfo.m_Display_netname = false;
DrawShape( &aPanel->m_ClipBox, aDC, drawInfo );
DrawShape( aPanel->GetClipBox(), aDC, drawInfo );
}

View File

@ -253,10 +253,10 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
int anchor_size = DC->DeviceToLogicalXRel( 2 );
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
pos.x - anchor_size, pos.y,
pos.x + anchor_size, pos.y, 0, color );
GRLine( &panel->m_ClipBox, DC,
GRLine( panel->GetClipBox(), DC,
pos.x, pos.y - anchor_size,
pos.x, pos.y + anchor_size, 0, color );
}
@ -300,11 +300,12 @@ void TEXTE_MODULE::DrawUmbilical( EDA_DRAW_PANEL* aPanel,
const wxPoint& aOffset )
{
MODULE* parent = (MODULE*) GetParent();
if( !parent )
return;
GRSetDrawMode( aDC, GR_XOR );
GRLine( &aPanel->m_ClipBox, aDC,
GRLine( aPanel->GetClipBox(), aDC,
parent->GetPosition(), GetPosition() + aOffset,
0, UMBILICAL_COLOR);
}

View File

@ -648,7 +648,7 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint&
if( DC->LogicalToDeviceXRel( l_trace ) < MIN_DRAW_WIDTH )
{
GRCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x,
GRCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x,
m_Start.y + aOffset.y, radius, color );
}
else
@ -656,19 +656,19 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint&
if( DC->LogicalToDeviceXRel( l_trace ) <= 1 ) /* Sketch mode if l_trace/zoom <= 1 */
{
GRCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x,
GRCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x,
m_Start.y + aOffset.y, radius, color );
}
else if( ( !DisplayOpt.DisplayPcbTrackFill) || GetState( FORCE_SKETCH ) )
{
GRCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x,
GRCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x,
m_Start.y + aOffset.y, radius - l_trace, color );
GRCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x,
GRCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x,
m_Start.y + aOffset.y, radius + l_trace, color );
}
else
{
GRCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x,
GRCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x,
m_Start.y + aOffset.y, radius, m_Width, color );
}
}
@ -678,17 +678,17 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint&
if( DC->LogicalToDeviceXRel( l_trace ) < MIN_DRAW_WIDTH )
{
GRLine( &panel->m_ClipBox, DC, m_Start + aOffset, m_End + aOffset, 0, color );
GRLine( panel->GetClipBox(), DC, m_Start + aOffset, m_End + aOffset, 0, color );
return;
}
if( !DisplayOpt.DisplayPcbTrackFill || GetState( FORCE_SKETCH ) )
{
GRCSegm( &panel->m_ClipBox, DC, m_Start + aOffset, m_End + aOffset, m_Width, color );
GRCSegm( panel->GetClipBox(), DC, m_Start + aOffset, m_End + aOffset, m_Width, color );
}
else
{
GRFillCSegm( &panel->m_ClipBox, DC, m_Start.x + aOffset.x,
GRFillCSegm( panel->GetClipBox(), DC, m_Start.x + aOffset.x,
m_Start.y + aOffset.y,
m_End.x + aOffset.x, m_End.y + aOffset.y, m_Width, color );
}
@ -699,7 +699,7 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint&
// Show clearance for tracks, not for zone segments
if( ShowClearance( this ) )
{
GRCSegm( &panel->m_ClipBox, DC, m_Start + aOffset, m_End + aOffset,
GRCSegm( panel->GetClipBox(), DC, m_Start + aOffset, m_End + aOffset,
m_Width + (GetClearance() * 2), color );
}
@ -831,14 +831,16 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint
if( fillvia )
{
GRFilledCircle( &panel->m_ClipBox, DC, m_Start + aOffset, radius, color );
GRFilledCircle( panel->GetClipBox(), DC, m_Start + aOffset, radius, color );
}
else
{
GRCircle( &panel->m_ClipBox, DC, m_Start + aOffset,radius, 0, color );
GRCircle( panel->GetClipBox(), DC, m_Start + aOffset,radius, 0, color );
if ( fast_draw )
return;
GRCircle( &panel->m_ClipBox, DC, m_Start + aOffset, inner_radius, 0, color );
GRCircle( panel->GetClipBox(), DC, m_Start + aOffset, inner_radius, 0, color );
}
// Draw the via hole if the display option allows it
@ -869,7 +871,7 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint
GRSetDrawMode( DC, GR_XOR );
if( DC->LogicalToDeviceXRel( drill_radius ) > 1 ) // Draw hole if large enough.
GRFilledCircle( &panel->m_ClipBox, DC, m_Start.x + aOffset.x,
GRFilledCircle( panel->GetClipBox(), DC, m_Start.x + aOffset.x,
m_Start.y + aOffset.y, drill_radius, 0, color, color );
if( screen->m_IsPrinting )
@ -878,13 +880,13 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint
else
{
if( drill_radius < inner_radius ) // We can show the via hole
GRCircle( &panel->m_ClipBox, DC, m_Start + aOffset, drill_radius, 0, color );
GRCircle( panel->GetClipBox(), DC, m_Start + aOffset, drill_radius, 0, color );
}
}
}
if( DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS )
GRCircle( &panel->m_ClipBox, DC, m_Start + aOffset, radius + GetClearance(), 0, color );
GRCircle( panel->GetClipBox(), DC, m_Start + aOffset, radius + GetClearance(), 0, color );
// for Micro Vias, draw a partial cross : X on component layer, or + on copper layer
// (so we can see 2 superimposed microvias ):
@ -904,21 +906,21 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint
}
/* lines | or \ */
GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x - ax,
GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x - ax,
m_Start.y + aOffset.y - ay,
m_Start.x + aOffset.x - bx,
m_Start.y + aOffset.y - by, 0, color );
GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x + bx,
GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x + bx,
m_Start.y + aOffset.y + by,
m_Start.x + aOffset.x + ax,
m_Start.y + aOffset.y + ay, 0, color );
/* lines - or / */
GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x + ay,
GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x + ay,
m_Start.y + aOffset.y - ax,
m_Start.x + aOffset.x + by,
m_Start.y + aOffset.y - bx, 0, color );
GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x - by,
GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x - by,
m_Start.y + aOffset.y + bx,
m_Start.x + aOffset.x - ay,
m_Start.y + aOffset.y + ax, 0, color );
@ -936,7 +938,7 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint
/* lines for the top layer */
RotatePoint( &ax, &ay, layer_top * 3600 / brd->GetCopperLayerCount( ) );
RotatePoint( &bx, &by, layer_top * 3600 / brd->GetCopperLayerCount( ) );
GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x - ax,
GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x - ax,
m_Start.y + aOffset.y - ay,
m_Start.x + aOffset.x - bx,
m_Start.y + aOffset.y - by, 0, color );
@ -945,7 +947,7 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint
ax = 0; ay = radius; bx = 0; by = drill_radius;
RotatePoint( &ax, &ay, layer_bottom * 3600 / brd->GetCopperLayerCount( ) );
RotatePoint( &bx, &by, layer_bottom * 3600 / brd->GetCopperLayerCount( ) );
GRLine( &panel->m_ClipBox, DC, m_Start.x + aOffset.x - ax,
GRLine( panel->GetClipBox(), DC, m_Start.x + aOffset.x - ax,
m_Start.y + aOffset.y - ay,
m_Start.x + aOffset.x - bx,
m_Start.y + aOffset.y - by, 0, color );

View File

@ -198,8 +198,8 @@ public:
double aCorrectionFactor );
/**
* Function SetDrillValue
* Set the drill value for vias
* @param drill_value = new drill value
* sets the drill value for vias.
* @param aDrill = new drill value
*/
void SetDrill( int aDrill ) { m_Drill = aDrill; }

View File

@ -179,7 +179,7 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const
lines.push_back( seg_end );
}
GRLineArray( &panel->m_ClipBox, DC, lines, 0, color );
GRLineArray( panel->GetClipBox(), DC, lines, 0, color );
// draw hatches
lines.clear();
@ -195,7 +195,7 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const
lines.push_back( seg_end );
}
GRLineArray( &panel->m_ClipBox, DC, lines, 0, color );
GRLineArray( panel->GetClipBox(), DC, lines, 0, color );
}
@ -290,11 +290,11 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
if( CornersTypeBuffer[ie] == 0 ) // Draw only basic outlines, not extra segments
{
if( !DisplayOpt.DisplayPcbTrackFill || GetState( FORCE_SKETCH ) )
GRCSegm( &panel->m_ClipBox, DC,
GRCSegm( panel->GetClipBox(), DC,
x0, y0, x1, y1,
m_ZoneMinThickness, color );
else
GRFillCSegm( &panel->m_ClipBox, DC,
GRFillCSegm( panel->GetClipBox(), DC,
x0, y0, x1, y1,
m_ZoneMinThickness, color );
}
@ -303,7 +303,7 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
// Draw areas:
if( m_FillMode==0 && !outline_mode )
GRPoly( &panel->m_ClipBox, DC, CornersBuffer.size(), &CornersBuffer[0],
GRPoly( panel->GetClipBox(), DC, CornersBuffer.size(), &CornersBuffer[0],
true, 0, color, color );
}
@ -320,10 +320,10 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
wxPoint end = m_FillSegmList[ic].m_End + offset;
if( !DisplayOpt.DisplayPcbTrackFill || GetState( FORCE_SKETCH ) )
GRCSegm( &panel->m_ClipBox, DC, start.x, start.y, end.x, end.y,
GRCSegm( panel->GetClipBox(), DC, start.x, start.y, end.x, end.y,
m_ZoneMinThickness, color );
else
GRFillCSegm( &panel->m_ClipBox, DC, start.x, start.y, end.x, end.y,
GRFillCSegm( panel->GetClipBox(), DC, start.x, start.y, end.x, end.y,
m_ZoneMinThickness, color );
}
}
@ -415,9 +415,9 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, in
GRSetDrawMode( DC, current_gr_mode );
if( is_close_segment )
GRLine( &panel->m_ClipBox, DC, xi, yi, xf, yf, 0, WHITE );
GRLine( panel->GetClipBox(), DC, xi, yi, xf, yf, 0, WHITE );
else
GRLine( &panel->m_ClipBox, DC, xi, yi, xf, yf, 0, color );
GRLine( panel->GetClipBox(), DC, xi, yi, xf, yf, 0, color );
}
}

View File

@ -207,7 +207,7 @@ static void DeleteUnconnectedTracks( PCB_EDIT_FRAME* aFrame )
if( aFrame->GetBoard()->m_Track == NULL )
return;
aFrame->GetCanvas()->m_AbortRequest = false;
aFrame->GetCanvas()->SetAbortRequest( false );
// correct via m_End defects
for( segment = aFrame->GetBoard()->m_Track; segment; segment = next )
@ -231,7 +231,7 @@ static void DeleteUnconnectedTracks( PCB_EDIT_FRAME* aFrame )
{
next = segment->Next();
if( aFrame->GetCanvas()->m_AbortRequest )
if( aFrame->GetCanvas()->GetAbortRequest() )
break;
if( segment->GetNet() != oldnetcode )
@ -412,7 +412,7 @@ static void clean_segments( PCB_EDIT_FRAME* aFrame )
int flag, no_inc;
wxString msg;
aFrame->GetCanvas()->m_AbortRequest = false;
aFrame->GetCanvas()->SetAbortRequest( false );
// Delete null segments
for( segment = aFrame->GetBoard()->m_Track; segment; segment = nextsegment )
@ -475,7 +475,7 @@ static void clean_segments( PCB_EDIT_FRAME* aFrame )
nextsegment = segment->Next();
if( aFrame->GetCanvas()->m_AbortRequest )
if( aFrame->GetCanvas()->GetAbortRequest() )
return;
if( segment->Type() != PCB_TRACE_T )
@ -856,13 +856,13 @@ void ConnectDanglingEndToPad( PCB_EDIT_FRAME* aFrame )
int nb_new_trace = 0;
wxString msg;
aFrame->GetCanvas()->m_AbortRequest = false;
aFrame->GetCanvas()->SetAbortRequest( false );
for( segment = aFrame->GetBoard()->m_Track; segment; segment = segment->Next() )
{
D_PAD* pad;
if( aFrame->GetCanvas()->m_AbortRequest )
if( aFrame->GetCanvas()->GetAbortRequest() )
return;
pad = aFrame->GetBoard()->GetPad( segment, START );

View File

@ -234,18 +234,18 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
* a m_IgnoreMouseEvents++ )
* was not balanced with the -- (now m_IgnoreMouseEvents=false), so I had to revert.
* Somebody should track down these and make them balanced.
* m_canvas->m_IgnoreMouseEvents = true;
* m_canvas->SetIgnoreMouseEvents( true );
*/
// this menu's handler is void PCB_BASE_FRAME::ProcessItemSelection()
// and it calls SetCurItem() which in turn calls DisplayInfo() on the item.
m_canvas->m_AbortRequest = true; // changed in false if an item is selected
m_canvas->SetAbortRequest( true ); // changed in false if an item is selected
PopupMenu( &itemMenu );
m_canvas->MoveCursorToCrossHair();
// The function ProcessItemSelection() has set the current item, return it.
if( m_canvas->m_AbortRequest ) // Nothing selected
if( m_canvas->GetAbortRequest() ) // Nothing selected
item = NULL;
else
item = GetCurItem();
@ -352,17 +352,17 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( m_canvas->IsMouseCaptured() )
{
#ifdef USE_WX_OVERLAY
wxDCOverlay oDC( m_canvas->m_overlay, (wxWindowDC*)aDC );
wxDCOverlay oDC( m_overlay, (wxWindowDC*)aDC );
oDC.Clear();
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, false );
m_canvas->CallMouseCapture( aDC, aPosition, false );
#else
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, aPosition, true );
m_canvas->CallMouseCapture( aDC, aPosition, true );
#endif
}
#ifdef USE_WX_OVERLAY
else
{
m_canvas->m_overlay.Reset();
m_overlay.Reset();
}
#endif
}

View File

@ -111,7 +111,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
else
{
if( m_canvas->IsMouseCaptured() )
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
return g_CurrentTrackSegment;
}

View File

@ -251,19 +251,16 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
// to print floating point numbers like 1.3)
wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi );
EDA_RECT tmp = panel->m_ClipBox;
EDA_RECT tmp = *panel->GetClipBox();
GRResetPenAndBrush( &dc );
GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? false : true );
s_Parameters.m_DrillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE;
panel->m_ClipBox.SetX( 0 );
panel->m_ClipBox.SetY( 0 );
// Set clip box to the max size
#define MAX_VALUE (INT_MAX/2) // MAX_VALUE is the max we can use in an integer
// and that allows calculations without overflow
panel->m_ClipBox.SetWidth( MAX_VALUE );
panel->m_ClipBox.SetHeight( MAX_VALUE );
panel->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( MAX_VALUE, MAX_VALUE ) ) );
screen->m_IsPrinting = true;
@ -277,7 +274,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
g_DrawBgColor = bg_color;
SetLocaleTo_Default(); // revert to the current locale
screen->m_IsPrinting = false;
panel->m_ClipBox = tmp;
panel->SetClipBox( tmp );
GRForceBlackPen( false );

View File

@ -48,10 +48,10 @@ private:
void PCB_BASE_FRAME::InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC )
{
m_canvas->m_IgnoreMouseEvents = TRUE;
m_canvas->SetIgnoreMouseEvents( true );
DialogEditModuleText dialog( this, TextMod, DC );
dialog.ShowModal();
m_canvas->m_IgnoreMouseEvents = FALSE;
m_canvas->SetIgnoreMouseEvents( false );
}

View File

@ -88,7 +88,7 @@ void Dialog_GeneralOptions::init()
m_TrackAutodel->SetValue( g_AutoDeleteOldTrack );
m_Track_45_Only_Ctrl->SetValue( g_Track_45_Only_Allowed );
m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only );
m_AutoPANOpt->SetValue( GetParent()->GetCanvas()->m_AutoPAN_Enable );
m_AutoPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableAutoPan() );
m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only );
m_Track_DoubleSegm_Ctrl->SetValue( g_TwoSegmentTrackBuild );
@ -133,9 +133,8 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
g_AutoDeleteOldTrack = m_TrackAutodel->GetValue();
Segments_45_Only = m_Segments_45_Only_Ctrl->GetValue();
g_Track_45_Only_Allowed = m_Track_45_Only_Ctrl->GetValue();
GetParent()->GetCanvas()->m_AutoPAN_Enable = m_AutoPANOpt->GetValue();
GetParent()->GetCanvas()->SetEnableAutoPan( m_AutoPANOpt->GetValue() );
g_TwoSegmentTrackBuild = m_Track_DoubleSegm_Ctrl->GetValue();
g_MagneticPadOption = m_MagneticPadOptCtrl->GetSelection();
g_MagneticTrackOption = m_MagneticTrackOptCtrl->GetSelection();

View File

@ -71,12 +71,11 @@ void PCB_EDIT_FRAME::InstallGraphicItemPropertiesDialog(DRAWSEGMENT * aItem, wxD
return;
}
m_canvas->m_IgnoreMouseEvents = TRUE;
DialogGraphicItemProperties* dialog = new DialogGraphicItemProperties( this,
aItem, aDC );
m_canvas->SetIgnoreMouseEvents( true );
DialogGraphicItemProperties* dialog = new DialogGraphicItemProperties( this, aItem, aDC );
dialog->ShowModal(); dialog->Destroy();
m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = FALSE;
m_canvas->SetIgnoreMouseEvents( false );
}
/**************************************************************************/

View File

@ -68,11 +68,11 @@ DIALOG_PCB_TEXT_PROPERTIES::DIALOG_PCB_TEXT_PROPERTIES( PCB_EDIT_FRAME* parent,
*/
void PCB_EDIT_FRAME::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC )
{
m_canvas->m_IgnoreMouseEvents = TRUE;
m_canvas->SetIgnoreMouseEvents( true );
DIALOG_PCB_TEXT_PROPERTIES dlg( this, TextPCB, DC );
dlg.ShowModal();
m_canvas->MoveCursorToCrossHair();
m_canvas->m_IgnoreMouseEvents = FALSE;
m_canvas->SetIgnoreMouseEvents( false );
}

View File

@ -388,7 +388,7 @@ void PCB_EDIT_FRAME::BeginMoveDimensionText( DIMENSION* aItem, wxDC* DC )
m_canvas->SetMouseCapture( MoveDimensionText, AbortMoveDimensionText );
SetCurItem( aItem );
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
}

View File

@ -1,9 +1,31 @@
/*******************************/
/* Footprint outlines editing. */
/*******************************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 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
*/
/**
* Functions to edit graphic items used to draw footprint edges.
* @file edgemod.cpp:
* @brief Functions to edit graphic items used to draw footprint edges.
*
* @todo - Arc functions not compete but menus are ready to use.
*/
@ -45,7 +67,7 @@ void FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod( EDGE_MODULE* Edge, wxDC* DC )
CursorInitialPosition = GetScreen()->GetCrossHairPosition();
m_canvas->SetMouseCapture( ShowCurrentOutlineWhileMoving, Abort_Move_ModuleOutline );
SetCurItem( Edge );
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
}

View File

@ -165,7 +165,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
default: // Finish (abort) the command
if( m_canvas->IsMouseCaptured() )
m_canvas->m_endMouseCaptureCallback( m_canvas, &dc );
m_canvas->CallEndMouseCapture( &dc );
if( GetToolId() != id )
{
@ -213,14 +213,14 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PLACE_BLOCK:
GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE;
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
HandleBlockPlace( &dc );
break;
case ID_POPUP_COPY_BLOCK:
GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY;
GetScreen()->m_BlockLocate.SetMessageBlock( this );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
HandleBlockPlace( &dc );
break;
@ -332,13 +332,13 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
* switch from _/ to -\ .
* If a track is in progress, it will be redrawn
*/
if( m_canvas->m_mouseCaptureCallback == ShowNewTrackWhenMovingCursor )
ShowNewTrackWhenMovingCursor( m_canvas, &dc, wxDefaultPosition, false );
if( m_canvas->IsMouseCaptured() )
m_canvas->CallMouseCapture( &dc, wxDefaultPosition, false );
g_Alternate_Track_Posture = !g_Alternate_Track_Posture;
if( m_canvas->m_mouseCaptureCallback == ShowNewTrackWhenMovingCursor )
ShowNewTrackWhenMovingCursor( m_canvas, &dc, wxDefaultPosition, false );
if( m_canvas->IsMouseCaptured() )
m_canvas->CallMouseCapture( &dc, wxDefaultPosition, false );
break;
@ -445,13 +445,13 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE:
m_canvas->MoveCursorToCrossHair();
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
Add_Similar_Zone( &dc, (ZONE_CONTAINER*) GetCurItem() );
break;
case ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE:
m_canvas->MoveCursorToCrossHair();
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
Add_Zone_Cutout( &dc, (ZONE_CONTAINER*) GetCurItem() );
break;
@ -476,7 +476,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
{
m_canvas->MoveCursorToCrossHair();
ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem();
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
Start_Move_Zone_Corner( &dc, zone_cont, zone_cont->m_CornerSelection, false );
break;
}
@ -485,7 +485,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
{
m_canvas->MoveCursorToCrossHair();
ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem();
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
Start_Move_Zone_Drag_Outline_Edge( &dc, zone_cont, zone_cont->m_CornerSelection );
break;
}
@ -494,7 +494,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
{
m_canvas->MoveCursorToCrossHair();
ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem();
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
Start_Move_Zone_Outlines( &dc, zone_cont );
break;
}
@ -513,7 +513,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
zone_cont->m_Poly->InsertCorner( zone_cont->m_CornerSelection, pos.x, pos.y );
zone_cont->m_CornerSelection++;
zone_cont->Draw( m_canvas, &dc, GR_XOR );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
Start_Move_Zone_Corner( &dc, zone_cont, zone_cont->m_CornerSelection, true );
break;
}
@ -524,7 +524,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
m_canvas->MoveCursorToCrossHair();
ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem();
End_Move_Zone_Corner_Or_Outlines( &dc, zone_cont );
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
break;
}
@ -576,7 +576,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST:
StartMoveTextePcb( (TEXTE_PCB*) GetCurItem(), &dc );
m_canvas->m_AutoPAN_Request = true;
m_canvas->SetAutoPanRequest( true );
break;
case ID_POPUP_PCB_DRAG_MODULE_REQUEST:
@ -1000,7 +1000,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
SetCurItem( NULL );
}
m_canvas->m_AutoPAN_Request = false;
m_canvas->SetAutoPanRequest( false );
break;
case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER:
@ -1092,7 +1092,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
}
m_canvas->CrossHairOn( &dc );
m_canvas->m_IgnoreMouseEvents = false;
m_canvas->SetIgnoreMouseEvents( false );
}

View File

@ -1,6 +1,31 @@
/*********************************************************************/
/* Edition of texts on copper and technical layers (TEXTE_PCB class) */
/*********************************************************************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* 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 edit_pcb_text.cpp
* @brief Editimg of text on copper and technical layers (TEXTE_PCB class)
*/
#include "fctsys.h"
#include "gr_basic.h"
@ -115,7 +140,7 @@ void PCB_EDIT_FRAME::StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC )
m_canvas->SetMouseCapture( Move_Texte_Pcb, Abort_Edit_Pcb_Text );
SetCurItem( TextePcb );
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
}

View File

@ -1,6 +1,31 @@
/***********************************/
/* Edit segments and edges of PCB. */
/***********************************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* 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 editedge.cpp
* @brief Edit segments and edges of PCB.
*/
#include "fctsys.h"
#include "class_drawpanel.h"
@ -38,7 +63,7 @@ void PCB_EDIT_FRAME::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC )
drawitem->DisplayInfo( this );
m_canvas->SetMouseCapture( Move_Segment, Abort_EditEdge );
SetCurItem( drawitem );
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
}
@ -185,7 +210,7 @@ static void Abort_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC )
if( Segment->IsNew() )
{
Panel->m_mouseCaptureCallback( Panel, DC, wxDefaultPosition, false );
Panel->CallMouseCapture( DC, wxDefaultPosition, false );
Segment ->DeleteStructure();
Segment = NULL;
}
@ -193,7 +218,7 @@ static void Abort_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC )
{
wxPoint pos = Panel->GetScreen()->GetCrossHairPosition();
Panel->GetScreen()->SetCrossHairPosition( s_InitialPosition );
Panel->m_mouseCaptureCallback( Panel, DC, wxDefaultPosition, true );
Panel->CallMouseCapture( DC, wxDefaultPosition, true );
Panel->GetScreen()->SetCrossHairPosition( pos );
Segment->ClearFlags();
Segment->Draw( Panel, DC, GR_OR );

View File

@ -92,7 +92,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
itmp = g_CurrentTrackList.GetCount();
Begin_Route( g_CurrentTrackSegment, DC );
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
/* create the via */
SEGVIA* via = new SEGVIA( GetBoard() );
@ -153,7 +153,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
/* DRC fault: the Via cannot be placed here ... */
delete via;
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
// delete the track(s) added in Begin_Route()
while( g_CurrentTrackList.GetCount() > itmp )
@ -207,7 +207,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
g_CurrentTrackList.PushBack( g_CurrentTrackSegment->Copy() );
}
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
via->DisplayInfo( this );
UpdateStatusBar();

View File

@ -200,7 +200,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
g_CurrentTrackSegment->DisplayInfoBase( this );
SetCurItem( g_CurrentTrackSegment, false );
m_canvas->m_mouseCaptureCallback( m_canvas, aDC, wxDefaultPosition, false );
m_canvas->CallMouseCapture( aDC, wxDefaultPosition, false );
if( Drc_On )
{
@ -686,7 +686,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
{
int color = g_ColorsSettings.GetLayerColor( g_CurrentTrackSegment->GetLayer() );
GRCircle( &aPanel->m_ClipBox, aDC, g_CurrentTrackSegment->m_End.x,
GRCircle( aPanel->GetClipBox(), aDC, g_CurrentTrackSegment->m_End.x,
g_CurrentTrackSegment->m_End.y,
( netclass->GetViaDiameter() / 2 ) + netclass->GetClearance(),
color );
@ -754,7 +754,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
{
int color = g_ColorsSettings.GetLayerColor(g_CurrentTrackSegment->GetLayer());
GRCircle( &aPanel->m_ClipBox, aDC, g_CurrentTrackSegment->m_End.x,
GRCircle( aPanel->GetClipBox(), aDC, g_CurrentTrackSegment->m_End.x,
g_CurrentTrackSegment->m_End.y,
( netclass->GetViaDiameter() / 2 ) + netclass->GetClearance(),
color );

View File

@ -1,3 +1,27 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* 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 edtxtmod.cpp
* @brief Edit module text.
@ -194,7 +218,7 @@ void PCB_BASE_FRAME::StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC )
SetCurItem( Text );
m_canvas->SetMouseCapture( Show_MoveTexte_Module, AbortMoveTextModule );
m_canvas->m_mouseCaptureCallback( m_canvas, DC, wxDefaultPosition, true );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, true );
}

Some files were not shown because too many files have changed in this diff Show More