+ * 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 );
}
}
diff --git a/gerbview/draw_gerber_screen.cpp b/gerbview/draw_gerber_screen.cpp
index eb87c3fabf..e7f2ce8ed3 100644
--- a/gerbview/draw_gerber_screen.cpp
+++ b/gerbview/draw_gerber_screen.cpp
@@ -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();
diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp
index 2c8c6354a1..7f7f8340ed 100644
--- a/gerbview/events_called_functions.cpp
+++ b/gerbview/events_called_functions.cpp
@@ -183,7 +183,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;
diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp
index 73f5416e24..830f0b7cb9 100644
--- a/gerbview/gerbview_frame.cpp
+++ b/gerbview/gerbview_frame.cpp
@@ -77,7 +77,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;
diff --git a/gerbview/gerbview_frame.h b/gerbview/gerbview_frame.h
index 0733388363..d2d14baefe 100644
--- a/gerbview/gerbview_frame.h
+++ b/gerbview/gerbview_frame.h
@@ -459,12 +459,12 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
void Genere_GERBER( const wxString& FullFileName, int Layers );
void Genere_PS( const wxString& FullFileName, int Layers );
void Plot_Layer_HPGL( FILE* File, int masque_layer,int garde, bool trace_via,
- GRTraceMode trace_mode );
+ EDA_DRAW_MODE_T trace_mode );
void Plot_Layer_GERBER( FILE* File, int masque_layer, int garde, bool trace_via,
- GRTraceMode trace_mode );
+ EDA_DRAW_MODE_T trace_mode );
int Gen_D_CODE_File( const wxString& Name_File );
void Plot_Layer_PS( FILE* File, int masque_layer, int garde, bool trace_via,
- GRTraceMode trace_mode );
+ EDA_DRAW_MODE_T trace_mode );
void Files_io( wxCommandEvent& event );
diff --git a/gerbview/onrightclick.cpp b/gerbview/onrightclick.cpp
index a262709c43..4e46ba7b51 100644
--- a/gerbview/onrightclick.cpp
+++ b/gerbview/onrightclick.cpp
@@ -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 ) )
diff --git a/include/base_struct.h b/include/base_struct.h
index f286735f31..2c441b541b 100644
--- a/include/base_struct.h
+++ b/include/base_struct.h
@@ -746,25 +746,24 @@ typedef std::vector< EDA_ITEM* > EDA_ITEMS;
// Graphic Text justify:
// Values -1,0,1 are used in computations, do not change them
-enum GRTextHorizJustifyType {
+enum EDA_TEXT_HJUSTIFY_T {
GR_TEXT_HJUSTIFY_LEFT = -1,
GR_TEXT_HJUSTIFY_CENTER = 0,
GR_TEXT_HJUSTIFY_RIGHT = 1
};
-enum GRTextVertJustifyType {
- GR_TEXT_VJUSTIFY_TOP = -1,
+enum EDA_TEXT_VJUSTIFY_T {
+ GR_TEXT_VJUSTIFY_TOP = -1,
GR_TEXT_VJUSTIFY_CENTER = 0,
GR_TEXT_VJUSTIFY_BOTTOM = 1
};
/* Options to show solid segments (segments, texts...) */
-enum GRTraceMode {
- FILAIRE = 0, // segments are drawn as lines
+enum EDA_DRAW_MODE_T {
+ LINE = 0, // segments are drawn as lines
FILLED, // normal mode: segments have thickness
- SKETCH // sketch mode: segments have thickness, but are not
- // filled
+ SKETCH // sketch mode: segments have thickness, but are not filled
};
/**
@@ -803,8 +802,8 @@ public:
int m_Attributs; ///< bit flags such as visible, etc.
bool m_Italic; ///< should be italic font (if available)
bool m_Bold; ///< should be bold font (if available)
- GRTextHorizJustifyType m_HJustify; ///< horizontal justification
- GRTextVertJustifyType m_VJustify; ///< vertical justification
+ EDA_TEXT_HJUSTIFY_T m_HJustify; ///< horizontal justification
+ EDA_TEXT_VJUSTIFY_T m_VJustify; ///< vertical justification
bool m_MultilineAllowed; /**< true to use multiline option, false
* to use only single line text
@@ -866,12 +865,12 @@ public:
* @param aOffset = draw offset (usually (0,0))
* @param aColor = text color
* @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
- * @param aDisplay_mode = FILAIRE, FILLED or SKETCH
+ * @param aDisplay_mode = LINE, FILLED or SKETCH
* @param aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
*/
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, EDA_Colors aColor,
- int aDrawMode, GRTraceMode aDisplay_mode = FILAIRE,
+ int aDrawMode, EDA_DRAW_MODE_T aDisplay_mode = LINE,
EDA_Colors aAnchor_color = UNSPECIFIED_COLOR );
private:
@@ -885,14 +884,14 @@ private:
* @param aOffset = draw offset (usually (0,0))
* @param aColor = text color
* @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
- * @param aFillMode = FILAIRE, FILLED or SKETCH
+ * @param aFillMode = LINE, FILLED or SKETCH
* @param aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
* @param aText = the single line of text to draw.
* @param aPos = the position of this line ).
*/
void DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, EDA_Colors aColor,
- int aDrawMode, GRTraceMode aFillMode,
+ int aDrawMode, EDA_DRAW_MODE_T aFillMode,
EDA_Colors aAnchor_color, wxString& aText,
wxPoint aPos );
@@ -972,10 +971,10 @@ public:
*/
virtual const wxString GetText() const { return m_Text; }
- GRTextHorizJustifyType GetHorizJustify() const { return m_HJustify; };
- GRTextVertJustifyType GetVertJustify() const { return m_VJustify; };
- void SetHorizJustify( GRTextHorizJustifyType aType ) { m_HJustify = aType; };
- void SetVertJustify( GRTextVertJustifyType aType ) { m_VJustify = aType; };
+ EDA_TEXT_HJUSTIFY_T GetHorizJustify() const { return m_HJustify; };
+ EDA_TEXT_VJUSTIFY_T GetVertJustify() const { return m_VJustify; };
+ void SetHorizJustify( EDA_TEXT_HJUSTIFY_T aType ) { m_HJustify = aType; };
+ void SetVertJustify( EDA_TEXT_VJUSTIFY_T aType ) { m_VJustify = aType; };
};
#endif // BASE_STRUCT_H_
diff --git a/include/class_base_screen.h b/include/class_base_screen.h
index 5c42b72182..786180e6d7 100644
--- a/include/class_base_screen.h
+++ b/include/class_base_screen.h
@@ -74,7 +74,6 @@ typedef std::vector< GRID_TYPE > GRIDS;
*/
class BASE_SCREEN : public EDA_ITEM
{
- EDA_ITEMS m_items; ///< The drawing items associated with this screen.
GRIDS m_grids; ///< List of valid grid sizes.
wxString m_fileName; ///< File used to load the screen.
char m_FlagRefreshReq; ///< Indicates that the screen should be redrawn.
@@ -432,18 +431,6 @@ public:
return wxT( "BASE_SCREEN" );
}
- /**
- * Helpers for accessing the draw item list.
- */
- EDA_ITEMS::iterator Begin() { return m_items.begin(); }
- EDA_ITEMS::iterator End() { return m_items.end(); }
- virtual void AddItem( EDA_ITEM* aItem );
- virtual void InsertItem( EDA_ITEMS::iterator aIter, EDA_ITEM* aItem );
-
- /**
- * Function IsBlockActive
- * returns true if a block command is in progress.
- */
inline bool IsBlockActive() const { return !m_BlockLocate.IsIdle(); }
void ClearBlockCommand() { m_BlockLocate.Clear(); }
@@ -455,7 +442,7 @@ public:
}
#if defined(DEBUG)
- void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
+ void Show( int nestLevel, std::ostream& os ) const; // overload
#endif
};
diff --git a/include/class_drawpanel.h b/include/class_drawpanel.h
index ac6b14dd9a..536e8e845f 100644
--- a/include/class_drawpanel.h
+++ b/include/class_drawpanel.h
@@ -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.
*
- * 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.
*
@@ -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
diff --git a/include/class_sch_screen.h b/include/class_sch_screen.h
index 6eca332e66..5127e2e8fb 100644
--- a/include/class_sch_screen.h
+++ b/include/class_sch_screen.h
@@ -468,13 +468,6 @@ public:
*/
int UpdatePickList();
- virtual void AddItem( SCH_ITEM* aItem ) { BASE_SCREEN::AddItem( (EDA_ITEM*) aItem ); }
-
- virtual void InsertItem( EDA_ITEMS::iterator aIter, SCH_ITEM* aItem )
- {
- BASE_SCREEN::InsertItem( aIter, (EDA_ITEM*) aItem );
- }
-
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload
#endif
diff --git a/include/common.h b/include/common.h
index 7e908372ae..0ae5db0a17 100644
--- a/include/common.h
+++ b/include/common.h
@@ -40,9 +40,6 @@
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
diff --git a/include/dialog_helpers.h b/include/dialog_helpers.h
index 2c025bcba2..ff98234161 100644
--- a/include/dialog_helpers.h
+++ b/include/dialog_helpers.h
@@ -11,6 +11,10 @@
#include "common.h" // EDA_UNITS_T
+class EDA_DRAW_FRAME;
+
+
+
/**
* class EDA_LIST_DIALOG
*
diff --git a/include/drawtxt.h b/include/drawtxt.h
index 6ebadf6034..00db99f3b4 100644
--- a/include/drawtxt.h
+++ b/include/drawtxt.h
@@ -75,8 +75,8 @@ void DrawGraphicText( EDA_DRAW_PANEL * aPanel,
const wxString &aText,
int aOrient,
const wxSize &aSize,
- enum GRTextHorizJustifyType aH_justify,
- enum GRTextVertJustifyType aV_justify,
+ enum EDA_TEXT_HJUSTIFY_T aH_justify,
+ enum EDA_TEXT_VJUSTIFY_T aV_justify,
int aWidth,
bool aItalic,
bool aBold,
diff --git a/include/plot_common.h b/include/plot_common.h
index 7a9178eddf..d34dde25ab 100644
--- a/include/plot_common.h
+++ b/include/plot_common.h
@@ -114,22 +114,22 @@ public:
virtual void PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFactor ) = 0;
virtual void thick_segment( wxPoint start, wxPoint end, int width,
- GRTraceMode tracemode );
+ EDA_DRAW_MODE_T tracemode );
virtual void thick_arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
- int width, GRTraceMode tracemode );
+ int width, EDA_DRAW_MODE_T tracemode );
virtual void thick_rect( wxPoint p1, wxPoint p2, int width,
- GRTraceMode tracemode );
+ EDA_DRAW_MODE_T tracemode );
virtual void thick_circle( wxPoint pos, int diametre, int width,
- GRTraceMode tracemode );
+ EDA_DRAW_MODE_T tracemode );
virtual void pen_to( wxPoint pos, char plume ) = 0;
// Flash primitives
virtual void flash_pad_circle( wxPoint pos, int diametre,
- GRTraceMode trace_mode ) = 0;
+ EDA_DRAW_MODE_T trace_mode ) = 0;
virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient,
- GRTraceMode trace_mode ) = 0;
+ EDA_DRAW_MODE_T trace_mode ) = 0;
virtual void flash_pad_rect( wxPoint pos, wxSize size,
- int orient, GRTraceMode trace_mode ) = 0;
+ int orient, EDA_DRAW_MODE_T trace_mode ) = 0;
/** virtual function flash_pad_trapez
* flash a trapezoidal pad
@@ -139,7 +139,7 @@ public:
* @param aTrace_Mode = FILLED or SKETCH
*/
virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
- int aPadOrient, GRTraceMode aTrace_Mode ) = 0;
+ int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode ) = 0;
// Convenience functions
void move_to( wxPoint pos )
@@ -169,8 +169,8 @@ public:
const wxString& aText,
int aOrient,
const wxSize& aSize,
- enum GRTextHorizJustifyType aH_justify,
- enum GRTextVertJustifyType aV_justify,
+ enum EDA_TEXT_HJUSTIFY_T aH_justify,
+ enum EDA_TEXT_VJUSTIFY_T aV_justify,
int aWidth,
bool aItalic,
bool aBold );
@@ -192,7 +192,7 @@ protected:
// Helper function for sketched filler segment
void segment_as_oval( wxPoint start, wxPoint end, int width,
- GRTraceMode tracemode );
+ EDA_DRAW_MODE_T tracemode );
void sketch_oval( wxPoint pos, wxSize size, int orient, int width );
virtual void user_to_device_coordinates( wxPoint& pos );
@@ -300,19 +300,19 @@ public:
virtual void PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFactor );
virtual void thick_segment( wxPoint start, wxPoint end, int width,
- GRTraceMode tracemode );
+ EDA_DRAW_MODE_T tracemode );
virtual void arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
FILL_T fill, int width = -1 );
virtual void pen_to( wxPoint pos, char plume );
virtual void flash_pad_circle( wxPoint pos, int diametre,
- GRTraceMode trace_mode );
+ EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient,
- GRTraceMode trace_mode );
+ EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_rect( wxPoint pos, wxSize size,
- int orient, GRTraceMode trace_mode );
+ int orient, EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
- int aPadOrient, GRTraceMode aTrace_Mode );
+ int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode );
virtual void SetLayerPolarity( bool aPositive ) {}
@@ -377,14 +377,14 @@ public:
virtual void pen_to( wxPoint pos, char plume );
virtual void flash_pad_circle( wxPoint pos, int diametre,
- GRTraceMode trace_mode );
+ EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient,
- GRTraceMode trace_mode );
+ EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_rect( wxPoint pos, wxSize size,
- int orient, GRTraceMode trace_mode );
+ int orient, EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
- int aPadOrient, GRTraceMode aTrace_Mode );
+ int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode );
virtual void SetLayerPolarity( bool aPositive ) {}
@@ -458,14 +458,14 @@ public:
virtual void pen_to( wxPoint pos, char plume );
virtual void flash_pad_circle( wxPoint pos, int diametre,
- GRTraceMode trace_mode );
+ EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient,
- GRTraceMode trace_mode );
+ EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_rect( wxPoint pos, wxSize size,
- int orient, GRTraceMode trace_mode );
+ int orient, EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
- int aPadOrient, GRTraceMode aTrace_Mode );
+ int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode );
virtual void SetLayerPolarity( bool aPositive );
@@ -539,19 +539,19 @@ public:
virtual void PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFactor );
virtual void thick_segment( wxPoint start, wxPoint end, int width,
- GRTraceMode tracemode );
+ EDA_DRAW_MODE_T tracemode );
virtual void arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
FILL_T fill, int width = -1 );
virtual void pen_to( wxPoint pos, char plume );
virtual void flash_pad_circle( wxPoint pos, int diametre,
- GRTraceMode trace_mode );
+ EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient,
- GRTraceMode trace_mode );
+ EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_rect( wxPoint pos, wxSize size,
- int orient, GRTraceMode trace_mode );
+ int orient, EDA_DRAW_MODE_T trace_mode );
virtual void flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
- int aPadOrient, GRTraceMode aTrace_Mode );
+ int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode );
virtual void SetLayerPolarity( bool aPositive ) {}
diff --git a/include/sch_item_struct.h b/include/sch_item_struct.h
index e459759588..42c1e3717e 100644
--- a/include/sch_item_struct.h
+++ b/include/sch_item_struct.h
@@ -179,15 +179,6 @@ public:
int aDrawMode,
int aColor = -1 ) = 0;
- /**
- * Function Place
- * place the schematic item into the draw list.
- *
- * If the schematic item is a new item or is modified, it is added to undo list.
- *
- */
- virtual void Place( SCH_EDIT_FRAME* aFrame, wxDC* aDC );
-
/**
* Function Move
* moves the item by \a aMoveVector to a new position.
diff --git a/include/wxBasePcbFrame.h b/include/wxBasePcbFrame.h
index ee8b5053cb..9045cd6f02 100644
--- a/include/wxBasePcbFrame.h
+++ b/include/wxBasePcbFrame.h
@@ -327,7 +327,26 @@ public:
void PlacePad( D_PAD* Pad, wxDC* DC );
void Export_Pad_Settings( D_PAD* aPad );
void Import_Pad_Settings( D_PAD* aPad, bool aDraw );
- void Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw );
+
+ /**
+ * Function GlobalChange_PadSettings
+ * Function to change pad caracteristics for the given footprint
+ * or all footprints which look like the given footprint
+ * @param aPad is the pattern. The given footprint is the parent of this pad
+ * @param aSameFootprints: if true, make changes on all identical footprints
+ * @param aPadShapeFilter: if true, make changes only on pads having the same shape as aPad
+ * @param aPadOrientFilter: if true, make changes only on pads having the same orientation as aPad
+ * @param aPadLayerFilter: if true, make changes only on pads having the same layers as aPad
+ * @param aRedraw: if true: redraws the footprint
+ * @param aSaveForUndo: if true: create an entry in the Undo/Redo list
+ * (usually: true in Schematic editor, false in Module editor)
+ */
+ void GlobalChange_PadSettings( D_PAD* aPad,
+ bool aSameFootprints,
+ bool aPadShapeFilter,
+ bool aPadOrientFilter,
+ bool aPadLayerFilter,
+ bool aRedraw, bool aSaveForUndo );
// loading footprints
@@ -490,24 +509,24 @@ public:
bool ExportToGerberFile( const wxString& aFullFileName,
int aLayer,
bool aPlotOriginIsAuxAxis,
- GRTraceMode aTraceMode );
+ EDA_DRAW_MODE_T aTraceMode );
bool ExportToHpglFile( const wxString& aFullFileName,
int aLayer,
- GRTraceMode aTraceMode );
+ EDA_DRAW_MODE_T aTraceMode );
bool ExportToPostScriptFile( const wxString& aFullFileName,
int aLayer,
bool aUseA4,
- GRTraceMode aTraceMode );
+ EDA_DRAW_MODE_T aTraceMode );
bool ExportToDxfFile( const wxString& aFullFileName,
int aLayer,
- GRTraceMode aTraceMode );
+ EDA_DRAW_MODE_T aTraceMode );
- void Plot_Layer( PLOTTER* plotter,
- int Layer,
- GRTraceMode trace_mode );
+ void Plot_Layer( PLOTTER* plotter,
+ int Layer,
+ EDA_DRAW_MODE_T trace_mode );
/**
* Function Plot_Standard_Layer
@@ -523,10 +542,10 @@ public:
* have the same size. Used in GERBER format only.
*/
void Plot_Standard_Layer( PLOTTER* aPlotter, int aLayerMask,
- bool aPlotVia, GRTraceMode aPlotMode,
+ bool aPlotVia, EDA_DRAW_MODE_T aPlotMode,
bool aSkipNPTH_Pads = false );
- void PlotSilkScreen( PLOTTER* plotter, int masque_layer, GRTraceMode trace_mode );
+ void PlotSilkScreen( PLOTTER* plotter, int masque_layer, EDA_DRAW_MODE_T trace_mode );
/**
* Function PlotDrillMark
@@ -539,7 +558,7 @@ public:
* @param aSmallDrillShape = true to plot a small drill shape, false to
* plot the actual drill shape
*/
- void PlotDrillMark( PLOTTER* aPlotter, GRTraceMode aTraceMode, bool aSmallDrillShape );
+ void PlotDrillMark( PLOTTER* aPlotter, EDA_DRAW_MODE_T aTraceMode, bool aSmallDrillShape );
/* Functions relative to Undo/redo commands:
*/
diff --git a/include/wxEeschemaStruct.h b/include/wxEeschemaStruct.h
index 6edb2254a6..1ae678bb48 100644
--- a/include/wxEeschemaStruct.h
+++ b/include/wxEeschemaStruct.h
@@ -181,6 +181,14 @@ protected:
*/
virtual bool isAutoSaveRequired() const;
+ /**
+ * Function addCurrentItemToList
+ * adds the item currently being edited to the schematic and adds the changes to
+ * the undo/redo container.
+ *
+ * @param aDC A pointer the device context to draw on when not NULL.
+ */
+ void addCurrentItemToList( wxDC* aDC );
public:
SCH_EDIT_FRAME( wxWindow* father,
diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h
index 261942cc4c..fe54718b26 100644
--- a/include/wxPcbStruct.h
+++ b/include/wxPcbStruct.h
@@ -877,6 +877,16 @@ public:
void InstallModuleOptionsFrame( MODULE* Module, wxDC* DC );
void StartMove_Module( MODULE* module, wxDC* DC );
+ /**
+ * Function DlgGlobalChange_PadSettings
+ * Function to change pad caracteristics for the given footprint
+ * or all footprints which look like the given footprint
+ * Options are set by the opened dialog.
+ * @param aPad is the pattern. The given footprint is the parent of this pad
+ * @param aRedraw: if true: redraws the footprint
+ */
+ void DlgGlobalChange_PadSettings( D_PAD* aPad, bool aRedraw );
+
/**
* Function Delete Module
* Remove a footprint from m_Modules linked list and put it in undelete buffer
diff --git a/include/wxstruct.h b/include/wxstruct.h
index cae1550d42..9f7348830b 100644
--- a/include/wxstruct.h
+++ b/include/wxstruct.h
@@ -370,6 +370,9 @@ class EDA_DRAW_FRAME : public EDA_BASE_FRAME
///< 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;
@@ -420,9 +423,10 @@ protected:
/// Panel used to display information at the bottom of the main window.
EDA_MSG_PANEL* m_messagePanel;
-private:
- BASE_SCREEN* m_currentScreen; ///< current used SCREEN
- bool m_snapToGrid; ///< Indicates if cursor should be snapped to grid.
+#ifdef USE_WX_OVERLAY
+ // MAC Uses overlay to workaround the wxINVERT and wxXOR miss
+ wxOverlay m_overlay;
+#endif
protected:
diff --git a/pcbnew/automove.cpp b/pcbnew/automove.cpp
index 94349b4045..5d13966ffc 100644
--- a/pcbnew/automove.cpp
+++ b/pcbnew/automove.cpp
@@ -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;
diff --git a/pcbnew/autoplac.cpp b/pcbnew/autoplac.cpp
index c97c6706fe..694df6989e 100644
--- a/pcbnew/autoplac.cpp
+++ b/pcbnew/autoplac.cpp
@@ -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. */
diff --git a/pcbnew/autorout.cpp b/pcbnew/autorout.cpp
index 7b02d43065..730d561c5a 100644
--- a/pcbnew/autorout.cpp
+++ b/pcbnew/autorout.cpp
@@ -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 );
diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp
index 86d6940d04..a6b3f3683c 100644
--- a/pcbnew/basepcbframe.cpp
+++ b/pcbnew/basepcbframe.cpp
@@ -405,7 +405,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 );
@@ -583,12 +583,12 @@ void PCB_BASE_FRAME::LoadSettings()
cfg->Read( m_FrameName + FastGrid2Entry, &itmp, ( long )0);
m_FastGrid2 = itmp;
- if( m_DisplayModEdge < FILAIRE || m_DisplayModEdge > SKETCH )
+ if( m_DisplayModEdge < LINE || m_DisplayModEdge > SKETCH )
m_DisplayModEdge = FILLED;
cfg->Read( m_FrameName + DisplayModuleTextEntry, &m_DisplayModText, ( long )FILLED );
- if( m_DisplayModText < FILAIRE || m_DisplayModText > SKETCH )
+ if( m_DisplayModText < LINE || m_DisplayModText > SKETCH )
m_DisplayModText = FILLED;
// WxWidgets 2.9.1 seems call setlocale( LC_NUMERIC, "" )
diff --git a/pcbnew/block.cpp b/pcbnew/block.cpp
index 9b97410b5d..1a6925e869 100644
--- a/pcbnew/block.cpp
+++ b/pcbnew/block.cpp
@@ -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;
diff --git a/pcbnew/block_module_editor.cpp b/pcbnew/block_module_editor.cpp
index e3de67fd99..6343f9dde9 100644
--- a/pcbnew/block_module_editor.cpp
+++ b/pcbnew/block_module_editor.cpp
@@ -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;
diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp
index 651224eafc..72c5b74e57 100644
--- a/pcbnew/class_board.cpp
+++ b/pcbnew/class_board.cpp
@@ -1583,12 +1583,12 @@ D_PAD* BOARD::GetPad( std::vector& aPadList, const wxPoint& aPosition, i
int idxmax = aPadList.size()-1;
int delta = aPadList.size();
- if( delta & 1 && delta > 1 )
- delta += 1;
- delta /= 2;
- int idx = delta; // Starting index is the middle of list
+
+ int idx = 0; // Starting index is the beginning of list
while( delta )
{
+ // Calculate half size of remaining interval to test.
+ // Ensure the computed value is not truncated (too small)
if( (delta & 1) && ( delta > 1 ) )
delta++;
delta /= 2;
diff --git a/pcbnew/class_dimension.cpp b/pcbnew/class_dimension.cpp
index 06547a6021..6960f5cc50 100644
--- a/pcbnew/class_dimension.cpp
+++ b/pcbnew/class_dimension.cpp
@@ -347,63 +347,63 @@ void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wxP
width = m_Width;
if( DC->LogicalToDeviceXRel( width ) < 2 )
- typeaff = FILAIRE;
+ typeaff = LINE;
switch( typeaff )
{
- case FILAIRE:
+ case LINE:
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 );
diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp
index 7f81a4e665..187ec05fed 100644
--- a/pcbnew/class_drawsegment.cpp
+++ b/pcbnew/class_drawsegment.cpp
@@ -187,25 +187,25 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
mode = SKETCH;
if( l_trace < DC->DeviceToLogicalXRel( MIN_DRAW_WIDTH ) )
- mode = FILAIRE;
+ mode = LINE;
switch( m_Shape )
{
case S_CIRCLE:
radius = (int) hypot( (double) (dx - ux0), (double) (dy - uy0) );
- if( mode == FILAIRE )
+ if( mode == LINE )
{
- 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 );
@@ -228,20 +228,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,
- radius, color );
+ if( mode == LINE )
+ 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;
@@ -249,21 +248,21 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
m_BezierPoints = Bezier2Poly(m_Start,m_BezierC1, m_BezierC2, m_End);
for (unsigned int i=1; i < m_BezierPoints.size(); i++) {
- if( mode == FILAIRE )
- GRLine( &panel->m_ClipBox, DC,
+ if( mode == LINE )
+ 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 );
@@ -271,19 +270,17 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
}
break;
default:
- if( mode == FILAIRE )
+ if( mode == LINE )
{
- 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;
diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp
index b930dc0bcc..81d7a3ff49 100644
--- a/pcbnew/class_edge_mod.cpp
+++ b/pcbnew/class_edge_mod.cpp
@@ -119,38 +119,38 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
}
if( DC->LogicalToDeviceXRel( m_Width ) < MIN_DRAW_WIDTH )
- typeaff = FILAIRE;
+ typeaff = LINE;
switch( type_trace )
{
case S_SEGMENT:
- if( typeaff == FILAIRE )
- GRLine( &panel->m_ClipBox, DC, ux0, uy0, dx, dy, 0, color );
+ if( typeaff == LINE )
+ 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;
case S_CIRCLE:
radius = (int) hypot( (double) (dx - ux0), (double) (dy - uy0) );
- if( typeaff == FILAIRE )
+ if( typeaff == LINE )
{
- 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 );
}
}
@@ -164,19 +164,19 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
if( StAngle > EndAngle )
EXCHG( StAngle, EndAngle );
- if( typeaff == FILAIRE )
+ if( typeaff == LINE )
{
- 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;
}
}
diff --git a/pcbnew/class_mire.cpp b/pcbnew/class_mire.cpp
index ff109f4f25..2bd3867c00 100644
--- a/pcbnew/class_mire.cpp
+++ b/pcbnew/class_mire.cpp
@@ -88,22 +88,22 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wx
width = m_Width;
if( DC->LogicalToDeviceXRel( width ) < 2 )
- typeaff = FILAIRE;
+ typeaff = LINE;
radius = m_Size / 4;
switch( typeaff )
{
- case FILAIRE:
+ case LINE:
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;
}
@@ -123,15 +123,15 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wx
switch( typeaff )
{
- case FILAIRE:
+ case LINE:
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;
}
}
diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp
index 39301a9213..fbf8df60b1 100644
--- a/pcbnew/class_module.cpp
+++ b/pcbnew/class_module.cpp
@@ -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
}
diff --git a/pcbnew/class_netinfo_item.cpp b/pcbnew/class_netinfo_item.cpp
index 38bdbcaadb..c2057cd80b 100644
--- a/pcbnew/class_netinfo_item.cpp
+++ b/pcbnew/class_netinfo_item.cpp
@@ -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 );
}
diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp
index d28ae08bb4..d830a8cebb 100644
--- a/pcbnew/class_pad_draw_functions.cpp
+++ b/pcbnew/class_pad_draw_functions.cpp
@@ -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 );
}
diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp
index 71b5ea812c..c7235784a6 100644
--- a/pcbnew/class_pcb_text.cpp
+++ b/pcbnew/class_pcb_text.cpp
@@ -66,7 +66,8 @@ void TEXTE_PCB::Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
int color = brd->GetLayerColor( m_Layer );
- GRTraceMode fillmode = FILLED;
+ EDA_DRAW_MODE_T fillmode = FILLED;
+
if( DisplayOpt.DisplayDrawItems == SKETCH )
fillmode = SKETCH;
diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp
index 07a4abdf04..2b9ea2bcaf 100644
--- a/pcbnew/class_text_mod.cpp
+++ b/pcbnew/class_text_mod.cpp
@@ -238,7 +238,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
orient = GetDrawRotation();
width = m_Thickness;
- if( ( frame->m_DisplayModText == FILAIRE )
+ if( ( frame->m_DisplayModText == LINE )
|| ( DC->LogicalToDeviceXRel( width ) < MIN_DRAW_WIDTH ) )
width = 0;
else if( frame->m_DisplayModText == SKETCH )
@@ -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);
}
diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp
index 4a1990f02c..f410eb94a4 100644
--- a/pcbnew/class_track.cpp
+++ b/pcbnew/class_track.cpp
@@ -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 );
diff --git a/pcbnew/class_track.h b/pcbnew/class_track.h
index 21ebc5910f..7dadefb440 100644
--- a/pcbnew/class_track.h
+++ b/pcbnew/class_track.h
@@ -198,7 +198,7 @@ public:
double aCorrectionFactor );
/**
* Function SetDrill
- * Set the drill value for vias
+ * sets the drill value for vias.
* @param aDrill is the new drill diameter
*/
void SetDrill( int aDrill ) { m_Drill = aDrill; }
diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp
index bd31196f2c..31243a78f9 100644
--- a/pcbnew/class_zone.cpp
+++ b/pcbnew/class_zone.cpp
@@ -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 );
}
}
diff --git a/pcbnew/clean.cpp b/pcbnew/clean.cpp
index 94d3362277..940bfc100d 100644
--- a/pcbnew/clean.cpp
+++ b/pcbnew/clean.cpp
@@ -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 );
diff --git a/pcbnew/connect.cpp b/pcbnew/connect.cpp
index 5d44c7b19e..2439bd5d58 100644
--- a/pcbnew/connect.cpp
+++ b/pcbnew/connect.cpp
@@ -342,12 +342,12 @@ void CONNECTIONS::CollectItemsNearTo( std::vector& aList,
int idxmax = m_candidates.size()-1;
int delta = m_candidates.size();
- if( delta & 1 && delta > 1 )
- delta += 1;
- delta /= 2;
- int idx = delta; // Starting index is the middle of list
+
+ int idx = 0; // Starting index is the beginning of list
while( delta )
{
+ // Calculate half size of remaining interval to test.
+ // Ensure the computed value is not truncated (too small)
if( (delta & 1) && ( delta > 1 ) )
delta++;
delta /= 2;
@@ -530,12 +530,12 @@ int CONNECTIONS::searchEntryPointInCandidatesList( const wxPoint & aPoint)
int idxmax = m_candidates.size()-1;
int delta = m_candidates.size();
- if( delta & 1 && delta > 1 )
- delta += 1;
- delta /= 2;
- int idx = delta; // Starting index is the middle of list
+
+ int idx = 0; // Starting index is the beginning of list
while( delta )
{
+ // Calculate half size of remaining interval to test.
+ // Ensure the computed value is not truncated (too small)
if( (delta & 1) && ( delta > 1 ) )
delta++;
delta /= 2;
diff --git a/pcbnew/controle.cpp b/pcbnew/controle.cpp
index a161e12e49..041482351b 100644
--- a/pcbnew/controle.cpp
+++ b/pcbnew/controle.cpp
@@ -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
}
diff --git a/pcbnew/deltrack.cpp b/pcbnew/deltrack.cpp
index f0e65c4330..50524adaf1 100644
--- a/pcbnew/deltrack.cpp
+++ b/pcbnew/deltrack.cpp
@@ -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;
}
diff --git a/pcbnew/dialogs/dialog_SVG_print.cpp b/pcbnew/dialogs/dialog_SVG_print.cpp
index e98a609d26..0e4dd1eabf 100644
--- a/pcbnew/dialogs/dialog_SVG_print.cpp
+++ b/pcbnew/dialogs/dialog_SVG_print.cpp
@@ -252,19 +252,15 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
wxSVGFileDC dc( FullFileName, pageSize.x, pageSize.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;
@@ -278,7 +274,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
g_DrawBgColor = bg_color;
screen->m_IsPrinting = false;
- panel->m_ClipBox = tmp;
+ panel->SetClipBox( tmp );
GRForceBlackPen( false );
diff --git a/pcbnew/dialogs/dialog_edit_module_text.cpp b/pcbnew/dialogs/dialog_edit_module_text.cpp
index 359dd23b16..46255339db 100644
--- a/pcbnew/dialogs/dialog_edit_module_text.cpp
+++ b/pcbnew/dialogs/dialog_edit_module_text.cpp
@@ -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 );
}
diff --git a/pcbnew/dialogs/dialog_general_options.cpp b/pcbnew/dialogs/dialog_general_options.cpp
index 4be3c567cd..3ec86912b8 100644
--- a/pcbnew/dialogs/dialog_general_options.cpp
+++ b/pcbnew/dialogs/dialog_general_options.cpp
@@ -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();
diff --git a/pcbnew/dialogs/dialog_global_pads_edition_base.cpp b/pcbnew/dialogs/dialog_global_pads_edition_base.cpp
index 5f9467ce77..a98f780fdb 100644
--- a/pcbnew/dialogs/dialog_global_pads_edition_base.cpp
+++ b/pcbnew/dialogs/dialog_global_pads_edition_base.cpp
@@ -1,78 +1,76 @@
-///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Apr 16 2008)
-// http://www.wxformbuilder.org/
-//
-// PLEASE DO "NOT" EDIT THIS FILE!
-///////////////////////////////////////////////////////////////////////////
-
-#include "dialog_global_pads_edition_base.h"
-
-///////////////////////////////////////////////////////////////////////////
-
-DIALOG_GLOBAL_PADS_EDITION_BASE::DIALOG_GLOBAL_PADS_EDITION_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
-{
- this->SetSizeHints( wxDefaultSize, wxDefaultSize );
-
- wxBoxSizer* bMainSizer;
- bMainSizer = new wxBoxSizer( wxHORIZONTAL );
-
- wxBoxSizer* bLeftSizer;
- bLeftSizer = new wxBoxSizer( wxVERTICAL );
-
- wxStaticBoxSizer* sbSizer1;
- sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pad Filter :") ), wxVERTICAL );
-
- m_Pad_Shape_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having a different shape"), wxDefaultPosition, wxDefaultSize, 0 );
-
- sbSizer1->Add( m_Pad_Shape_Filter_CB, 0, wxALL, 5 );
-
- m_Pad_Layer_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having different layers"), wxDefaultPosition, wxDefaultSize, 0 );
-
- sbSizer1->Add( m_Pad_Layer_Filter_CB, 0, wxALL, 5 );
-
- m_Pad_Orient_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having a different orientation"), wxDefaultPosition, wxDefaultSize, 0 );
-
- sbSizer1->Add( m_Pad_Orient_Filter_CB, 0, wxALL, 5 );
-
- bLeftSizer->Add( sbSizer1, 1, wxEXPAND, 5 );
-
- bMainSizer->Add( bLeftSizer, 1, wxEXPAND, 5 );
-
- wxBoxSizer* bRightSizer;
- bRightSizer = new wxBoxSizer( wxVERTICAL );
-
- m_buttonPadEditor = new wxButton( this, ID_CHANGE_GET_PAD_SETTINGS, _("Pad Editor"), wxDefaultPosition, wxDefaultSize, 0 );
- bRightSizer->Add( m_buttonPadEditor, 0, wxALL|wxEXPAND, 5 );
-
-
- bRightSizer->Add( 10, 10, 0, 0, 5 );
-
- m_button2 = new wxButton( this, ID_CHANGE_CURRENT_MODULE, _("Change Pads on Module"), wxDefaultPosition, wxDefaultSize, 0 );
- bRightSizer->Add( m_button2, 0, wxALL|wxEXPAND, 5 );
-
- m_button3 = new wxButton( this, ID_CHANGE_ID_MODULES, _("Change Pads on Same Modules"), wxDefaultPosition, wxDefaultSize, 0 );
- bRightSizer->Add( m_button3, 0, wxALL|wxEXPAND, 5 );
-
- m_button4 = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
- bRightSizer->Add( m_button4, 0, wxALL|wxEXPAND, 5 );
-
- bMainSizer->Add( bRightSizer, 0, wxEXPAND, 5 );
-
- this->SetSizer( bMainSizer );
- this->Layout();
-
- // Connect Events
- m_buttonPadEditor->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::InstallPadEditor ), NULL, this );
- m_button2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
- m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
- m_button4->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::OnCancelClick ), NULL, this );
-}
-
-DIALOG_GLOBAL_PADS_EDITION_BASE::~DIALOG_GLOBAL_PADS_EDITION_BASE()
-{
- // Disconnect Events
- m_buttonPadEditor->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::InstallPadEditor ), NULL, this );
- m_button2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
- m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
- m_button4->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::OnCancelClick ), NULL, this );
-}
+///////////////////////////////////////////////////////////////////////////
+// C++ code generated with wxFormBuilder (version Jun 30 2011)
+// http://www.wxformbuilder.org/
+//
+// PLEASE DO "NOT" EDIT THIS FILE!
+///////////////////////////////////////////////////////////////////////////
+
+#include "dialog_global_pads_edition_base.h"
+
+///////////////////////////////////////////////////////////////////////////
+
+DIALOG_GLOBAL_PADS_EDITION_BASE::DIALOG_GLOBAL_PADS_EDITION_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
+{
+ this->SetSizeHints( wxDefaultSize, wxDefaultSize );
+
+ wxBoxSizer* bMainSizer;
+ bMainSizer = new wxBoxSizer( wxHORIZONTAL );
+
+ wxBoxSizer* bLeftSizer;
+ bLeftSizer = new wxBoxSizer( wxVERTICAL );
+
+ wxStaticBoxSizer* sbSizer1;
+ sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pad Filter :") ), wxVERTICAL );
+
+ m_Pad_Shape_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having a different shape"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizer1->Add( m_Pad_Shape_Filter_CB, 0, wxALL, 5 );
+
+ m_Pad_Layer_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having different layers"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizer1->Add( m_Pad_Layer_Filter_CB, 0, wxALL, 5 );
+
+ m_Pad_Orient_Filter_CB = new wxCheckBox( this, wxID_ANY, _("Do not modify pads having a different orientation"), wxDefaultPosition, wxDefaultSize, 0 );
+ sbSizer1->Add( m_Pad_Orient_Filter_CB, 0, wxALL, 5 );
+
+ bLeftSizer->Add( sbSizer1, 1, wxEXPAND, 5 );
+
+ bMainSizer->Add( bLeftSizer, 1, wxEXPAND, 5 );
+
+ wxBoxSizer* bRightSizer;
+ bRightSizer = new wxBoxSizer( wxVERTICAL );
+
+ m_buttonPadEditor = new wxButton( this, ID_CHANGE_GET_PAD_SETTINGS, _("Pad Editor"), wxDefaultPosition, wxDefaultSize, 0 );
+ bRightSizer->Add( m_buttonPadEditor, 0, wxALL|wxEXPAND, 5 );
+
+
+ bRightSizer->Add( 10, 10, 0, 0, 5 );
+
+ m_buttonChangeModule = new wxButton( this, ID_CHANGE_CURRENT_MODULE, _("Change Pads on Module"), wxDefaultPosition, wxDefaultSize, 0 );
+ bRightSizer->Add( m_buttonChangeModule, 0, wxALL|wxEXPAND, 5 );
+
+ m_buttonIdModules = new wxButton( this, ID_CHANGE_ID_MODULES, _("Change Pads on Same Modules"), wxDefaultPosition, wxDefaultSize, 0 );
+ bRightSizer->Add( m_buttonIdModules, 0, wxALL|wxEXPAND, 5 );
+
+ m_buttonCancel = new wxButton( this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
+ bRightSizer->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 );
+
+ bMainSizer->Add( bRightSizer, 0, wxEXPAND, 5 );
+
+ this->SetSizer( bMainSizer );
+ this->Layout();
+
+ // Connect Events
+ m_buttonPadEditor->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::InstallPadEditor ), NULL, this );
+ m_buttonChangeModule->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
+ m_buttonIdModules->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
+ m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::OnCancelClick ), NULL, this );
+}
+
+DIALOG_GLOBAL_PADS_EDITION_BASE::~DIALOG_GLOBAL_PADS_EDITION_BASE()
+{
+ // Disconnect Events
+ m_buttonPadEditor->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::InstallPadEditor ), NULL, this );
+ m_buttonChangeModule->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
+ m_buttonIdModules->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
+ m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::OnCancelClick ), NULL, this );
+
+}
diff --git a/pcbnew/dialogs/dialog_global_pads_edition_base.fbp b/pcbnew/dialogs/dialog_global_pads_edition_base.fbp
index 17ae2af460..f2a40819b7 100644
--- a/pcbnew/dialogs/dialog_global_pads_edition_base.fbp
+++ b/pcbnew/dialogs/dialog_global_pads_edition_base.fbp
@@ -2,76 +2,124 @@