Commit 2c251196 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Minor dialog fixes and code cleaning.

* Grammar and spelling fixes in Eeschema, CvPcb, and Pcbnew path and
  library dialog tool tips.
* Translate the French file name subrill.cpp to highlight.cpp.
* Lots of coding style policy fixes.
parent 13324c06
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_cvpcb_config_fbp__ #ifndef __dialog_cvpcb_config_fbp__
#define __dialog_cvpcb_config_fbp__ #define __dialog_cvpcb_config_fbp__
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/listbox.h> #include <wx/listbox.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/statline.h> #include <wx/statline.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_CVPCB_CONFIG_FBP /// Class DIALOG_CVPCB_CONFIG_FBP
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_CVPCB_CONFIG_FBP : public wxDialog class DIALOG_CVPCB_CONFIG_FBP : public wxDialog
{ {
private: private:
protected: protected:
enum enum
{ {
ID_ADD_LIB = 1000, ID_ADD_LIB = 1000,
ID_INSERT_LIB, ID_INSERT_LIB,
ID_REMOVE_LIB, ID_REMOVE_LIB,
ID_LIB_UP, ID_LIB_UP,
ID_LIB_DOWN, ID_LIB_DOWN,
ID_ADD_EQU, ID_ADD_EQU,
ID_INSERT_EQU, ID_INSERT_EQU,
ID_REMOVE_EQU, ID_REMOVE_EQU,
ID_EQU_UP, ID_EQU_UP,
ID_EQU_DOWN, ID_EQU_DOWN,
ID_BROWSE_MOD_DOC, ID_BROWSE_MOD_DOC,
ID_LIB_PATH_SEL, ID_LIB_PATH_SEL,
ID_INSERT_PATH, ID_INSERT_PATH,
ID_REMOVE_PATH, ID_REMOVE_PATH,
}; };
wxListBox* m_ListLibr; wxListBox* m_ListLibr;
wxButton* m_buttonAddLib; wxButton* m_buttonAddLib;
wxButton* m_buttonInsLib; wxButton* m_buttonInsLib;
wxButton* m_buttonRemoveLib; wxButton* m_buttonRemoveLib;
wxButton* m_buttonLibUp; wxButton* m_buttonLibUp;
wxButton* m_buttonLibDown; wxButton* m_buttonLibDown;
wxListBox* m_ListEquiv; wxListBox* m_ListEquiv;
wxButton* m_buttonAddEqu; wxButton* m_buttonAddEqu;
wxButton* m_buttonInsEqu; wxButton* m_buttonInsEqu;
wxButton* m_buttonRemoveEqu; wxButton* m_buttonRemoveEqu;
wxButton* m_buttonEquUp; wxButton* m_buttonEquUp;
wxButton* m_buttonEquDown; wxButton* m_buttonEquDown;
wxTextCtrl* m_TextHelpModulesFileName; wxTextCtrl* m_TextHelpModulesFileName;
wxButton* m_buttonModDoc; wxButton* m_buttonModDoc;
wxListBox* m_listUserPaths; wxListBox* m_listUserPaths;
wxButton* m_buttonAddPath; wxButton* m_buttonAddPath;
wxButton* m_buttonInsPath; wxButton* m_buttonInsPath;
wxButton* m_buttonRemovePath; wxButton* m_buttonRemovePath;
wxListBox* m_DefaultLibraryPathslistBox; wxListBox* m_DefaultLibraryPathslistBox;
wxStaticLine* m_staticline2; wxStaticLine* m_staticline2;
wxStdDialogButtonSizer* m_sdbSizer2; wxStdDialogButtonSizer* m_sdbSizer2;
wxButton* m_sdbSizer2OK; wxButton* m_sdbSizer2OK;
wxButton* m_sdbSizer2Cancel; wxButton* m_sdbSizer2Cancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
virtual void OnAddOrInsertLibClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddOrInsertLibClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemoveLibClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveLibClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonUpClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnButtonUpClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonDownClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnButtonDownClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnBrowseModDocFile( wxCommandEvent& event ){ event.Skip(); } virtual void OnBrowseModDocFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddOrInsertPath( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveUserPath( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 570,625 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_CVPCB_CONFIG_FBP(); DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 570,625 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_CVPCB_CONFIG_FBP();
};
};
#endif //__dialog_cvpcb_config_fbp__
#endif //__dialog_cvpcb_config_fbp__
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 6 2011) // C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_eeschema_config_fbp__ #ifndef __dialog_eeschema_config_fbp__
#define __dialog_eeschema_config_fbp__ #define __dialog_eeschema_config_fbp__
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/listbox.h> #include <wx/listbox.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/statline.h> #include <wx/statline.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_EESCHEMA_CONFIG_FBP /// Class DIALOG_EESCHEMA_CONFIG_FBP
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog
{ {
private: private:
protected: protected:
enum enum
{ {
ID_ADD_LIB = 1000, ID_ADD_LIB = 1000,
ID_REMOVE_LIB, ID_REMOVE_LIB,
ID_LIB_PATH_SEL, ID_LIB_PATH_SEL,
wxID_INSERT_PATH, wxID_INSERT_PATH,
wxID_REMOVE_PATH, wxID_REMOVE_PATH,
}; };
wxListBox* m_ListLibr; wxListBox* m_ListLibr;
wxButton* m_buttonAddLib; wxButton* m_buttonAddLib;
wxButton* m_buttonIns; wxButton* m_buttonIns;
wxButton* m_buttonRemoveLib; wxButton* m_buttonRemoveLib;
wxButton* m_buttonUp; wxButton* m_buttonUp;
wxButton* m_buttonDown; wxButton* m_buttonDown;
wxListBox* m_listUserPaths; wxListBox* m_listUserPaths;
wxButton* m_buttonAddPath; wxButton* m_buttonAddPath;
wxButton* m_buttonInsPath; wxButton* m_buttonInsPath;
wxButton* m_buttonRemovePath; wxButton* m_buttonRemovePath;
wxListBox* m_DefaultLibraryPathslistBox; wxListBox* m_DefaultLibraryPathslistBox;
wxStaticLine* m_staticline3; wxStaticLine* m_staticline3;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
virtual void OnFilesListClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnFilesListClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAddOrInsertLibClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnAddOrInsertLibClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemoveLibClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnRemoveLibClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonUpClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnButtonUpClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonDownClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnButtonDownClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAddOrInsertPath( wxCommandEvent& event ) { event.Skip(); } virtual void OnAddOrInsertPath( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemoveUserPath( wxCommandEvent& event ) { event.Skip(); } virtual void OnRemoveUserPath( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
wxStdDialogButtonSizer* m_sdbSizer1; wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel; wxButton* m_sdbSizer1Cancel;
DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EESCHEMA_CONFIG_FBP(); ~DIALOG_EESCHEMA_CONFIG_FBP();
}; };
#endif //__dialog_eeschema_config_fbp__ #endif //__dialog_eeschema_config_fbp__
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
*/ */
/** /**
* @file files-io.cpp * @file eeschema/files-io.cpp
*/ */
#include "fctsys.h" #include "fctsys.h"
......
This diff is collapsed.
/**
* @file class_gerber_draw_item.h
*/
#ifndef CLASS_GERBER_DRAW_ITEM_H
#define CLASS_GERBER_DRAW_ITEM_H
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
...@@ -29,10 +22,20 @@ ...@@ -29,10 +22,20 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file class_gerber_draw_item.h
*/
#ifndef CLASS_GERBER_DRAW_ITEM_H
#define CLASS_GERBER_DRAW_ITEM_H
#include "base_struct.h" #include "base_struct.h"
#include "class_board_item.h" #include "class_board_item.h"
class GERBER_IMAGE; class GERBER_IMAGE;
/* Shapes id for basic shapes ( .m_Shape member ) */ /* Shapes id for basic shapes ( .m_Shape member ) */
enum Gbr_Basic_Shapes { enum Gbr_Basic_Shapes {
GBR_SEGMENT = 0, // usual segment : line with rounded ends GBR_SEGMENT = 0, // usual segment : line with rounded ends
...@@ -42,7 +45,7 @@ enum Gbr_Basic_Shapes { ...@@ -42,7 +45,7 @@ enum Gbr_Basic_Shapes {
GBR_SPOT_CIRCLE, // flashed shape: round shape (can have hole) GBR_SPOT_CIRCLE, // flashed shape: round shape (can have hole)
GBR_SPOT_RECT, // flashed shape: rectangular shape can have hole) GBR_SPOT_RECT, // flashed shape: rectangular shape can have hole)
GBR_SPOT_OVAL, // flashed shape: oval shape GBR_SPOT_OVAL, // flashed shape: oval shape
GBR_SPOT_POLY, // flashed shape: regulat polygon, 3 to 12 edges GBR_SPOT_POLY, // flashed shape: regular polygon, 3 to 12 edges
GBR_SPOT_MACRO, // complex shape described by a macro GBR_SPOT_MACRO, // complex shape described by a macro
GBR_LAST // last value for this list GBR_LAST // last value for this list
}; };
...@@ -59,8 +62,8 @@ private: ...@@ -59,8 +62,8 @@ private:
public: public:
bool m_UnitsMetric; /* store here the gerber units (inch/mm). bool m_UnitsMetric; /* store here the gerber units (inch/mm). Used
* Used only to calculate aperture macros shapes sizes */ * only to calculate aperture macros shapes sizes */
int m_Shape; // Shape and type of this gerber item int m_Shape; // Shape and type of this gerber item
wxPoint m_Start; // Line or arc start point or position of the shape wxPoint m_Start; // Line or arc start point or position of the shape
// for flashed items // for flashed items
...@@ -77,16 +80,16 @@ public: ...@@ -77,16 +80,16 @@ public:
// values 0 to 9 can be used for special purposes // values 0 to 9 can be used for special purposes
GERBER_IMAGE* m_imageParams; /* main GERBER info for this item GERBER_IMAGE* m_imageParams; /* main GERBER info for this item
* Note: some params stored in this class are common * Note: some params stored in this class are common
* to the whole gerber file (i.e) the whole graphic layer * to the whole gerber file (i.e) the whole graphic
* and some can change when reaging the file, so they * layer and some can change when reaging the file,
* are stored inside this item * so they are stored inside this item there is no
* there is no redundancy for these parameters * redundancy for these parameters
*/ */
private: private:
// These values are used to draw this item, according to gerber layers parameters // These values are used to draw this item, according to gerber layers parameters
// Because they can change inside a gerber image, thery are stored here // Because they can change inside a gerber image, they are stored here
// for each item // for each item
bool m_LayerNegative; // TRUE = item in negative Layer bool m_LayerNegative; // true = item in negative Layer
bool m_swapAxis; // false if A = X, B = Y; true if A =Y, B = Y bool m_swapAxis; // false if A = X, B = Y; true if A =Y, B = Y
bool m_mirrorA; // true: mirror / axe A bool m_mirrorA; // true: mirror / axe A
bool m_mirrorB; // true: mirror / axe B bool m_mirrorB; // true: mirror / axe B
...@@ -137,7 +140,7 @@ public: ...@@ -137,7 +140,7 @@ public:
* m_MirrorA, m_MirrorB, * m_MirrorA, m_MirrorB,
* m_DrawScale, m_DrawOffset * m_DrawScale, m_DrawOffset
*/ */
void SetLayerParameters( ); void SetLayerParameters();
void SetLayerPolarity( bool aNegative) void SetLayerPolarity( bool aNegative)
{ {
...@@ -194,15 +197,15 @@ public: ...@@ -194,15 +197,15 @@ public:
* returns the GetDcodeDescr of this object, or NULL. * returns the GetDcodeDescr of this object, or NULL.
* @return D_CODE* - a pointer to the DCode description (for flashed items). * @return D_CODE* - a pointer to the DCode description (for flashed items).
*/ */
D_CODE* GetDcodeDescr(); D_CODE* GetDcodeDescr();
EDA_RECT GetBoundingBox() const; EDA_RECT GetBoundingBox() const;
/* Display on screen: */ /* Display on screen: */
void Draw( EDA_DRAW_PANEL* aPanel, void Draw( EDA_DRAW_PANEL* aPanel,
wxDC* aDC, wxDC* aDC,
int aDrawMode, int aDrawMode,
const wxPoint& aOffset = ZeroOffset ); const wxPoint&aOffset = ZeroOffset );
/** /**
* Function ConvertSegmentToPolygon * Function ConvertSegmentToPolygon
...@@ -210,7 +213,7 @@ public: ...@@ -210,7 +213,7 @@ public:
* Useful when a line is plotted using a rectangular pen. * Useful when a line is plotted using a rectangular pen.
* In this case, the usual segment plot function cannot be used * In this case, the usual segment plot function cannot be used
*/ */
void ConvertSegmentToPolygon( ); void ConvertSegmentToPolygon();
/** /**
* Function DrawGbrPoly * Function DrawGbrPoly
...@@ -231,7 +234,7 @@ public: ...@@ -231,7 +234,7 @@ public:
* Display info about this GERBER item * Display info about this GERBER item
* @param frame A EDA_DRAW_FRAME in which to print status information. * @param frame A EDA_DRAW_FRAME in which to print status information.
*/ */
void DisplayInfo( EDA_DRAW_FRAME* frame ); void DisplayInfo( EDA_DRAW_FRAME* frame );
wxString ShowGBRShape(); wxString ShowGBRShape();
...@@ -241,16 +244,16 @@ public: ...@@ -241,16 +244,16 @@ public:
* @param aRefPos a wxPoint to test * @param aRefPos a wxPoint to test
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( const wxPoint& aRefPos ); bool HitTest( const wxPoint& aRefPos );
/** /**
* Function HitTest (overlayed) * Function HitTest (overloaded)
* tests if the given wxRect intersect this object. * tests if the given wxRect intersect this object.
* For now, an ending point must be inside this rect. * For now, an ending point must be inside this rect.
* @param aRefArea a wxPoint to test * @param aRefArea a wxPoint to test
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( EDA_RECT& aRefArea ); bool HitTest( EDA_RECT& aRefArea );
/** /**
* Function GetClass * Function GetClass
...@@ -263,7 +266,12 @@ public: ...@@ -263,7 +266,12 @@ public:
} }
bool Save( FILE* aFile ) const; /**
* Function Save.
* currently: no nothing, but must be defined to meet requirements
* of the basic class
*/
bool Save( FILE* aFile ) const;
#if defined(DEBUG) #if defined(DEBUG)
...@@ -271,7 +279,7 @@ public: ...@@ -271,7 +279,7 @@ public:
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
virtual void Show( int nestLevel, std::ostream& os ); virtual void Show( int nestLevel, std::ostream& os );
......
This diff is collapsed.
/**
* @file dcode.h
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
...@@ -27,15 +23,21 @@ ...@@ -27,15 +23,21 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file dcode.h
*/
#ifndef _DCODE_H_ #ifndef _DCODE_H_
#define _DCODE_H_ #define _DCODE_H_
#include <vector> #include <vector>
//#include <set>
#include "base_struct.h" #include "base_struct.h"
class GERBER_DRAW_ITEM; class GERBER_DRAW_ITEM;
/** /**
* Enum APERTURE_T * Enum APERTURE_T
* is the set of all gerber aperture types allowed, according to page 16 of * is the set of all gerber aperture types allowed, according to page 16 of
...@@ -51,7 +53,7 @@ enum APERTURE_T { ...@@ -51,7 +53,7 @@ enum APERTURE_T {
}; };
// In aperture definition, round, oval and rectangular flashed shapes // In aperture definition, round, oval and rectangular flashed shapes
// can have a hole (ropund or rectangular) // can have a hole (round or rectangular)
// this option is stored in .m_DrillShape D_CODE member // this option is stored in .m_DrillShape D_CODE member
enum APERTURE_DEF_HOLETYPE { enum APERTURE_DEF_HOLETYPE {
APT_DEF_NO_HOLE = 0, APT_DEF_NO_HOLE = 0,
...@@ -60,7 +62,7 @@ enum APERTURE_DEF_HOLETYPE { ...@@ -60,7 +62,7 @@ enum APERTURE_DEF_HOLETYPE {
}; };
/* define min and max values for D Codes values. /* define min and max values for D Codes values.
* note: values >= 0 and > FIRST_DCODE can be used for specila purposes * note: values >= 0 and > FIRST_DCODE can be used for special purposes
*/ */
#define FIRST_DCODE 10 #define FIRST_DCODE 10
#define LAST_DCODE 999 #define LAST_DCODE 999
...@@ -163,13 +165,14 @@ public: ...@@ -163,13 +165,14 @@ public:
* @param aClipBox = DC clip box (NULL is no clip) * @param aClipBox = DC clip box (NULL is no clip)
* @param aDC = device context * @param aDC = device context
* @param aColor = the normal color to use * @param aColor = the normal color to use
* @param aAltColor = the color used to draw with "reverse" exposure mode (used in aperture macros only) * @param aAltColor = the color used to draw with "reverse" exposure mode (used in
* aperture macros only)
* @param aShapePos = the actual shape position * @param aShapePos = the actual shape position
* @param aFilledShape = true to draw in filled mode, false to draw in skecth mode * @param aFilledShape = true to draw in filled mode, false to draw in sketch mode
*/ */
void DrawFlashedShape( GERBER_DRAW_ITEM* aParent, EDA_RECT* aClipBox, void DrawFlashedShape( GERBER_DRAW_ITEM* aParent, EDA_RECT* aClipBox,
wxDC* aDC, int aColor, int aAltColor, wxDC* aDC, int aColor, int aAltColor,
wxPoint aShapePos, bool aFilledShape ); wxPoint aShapePos, bool aFilledShape );
/** /**
* Function DrawFlashedPolygon * Function DrawFlashedPolygon
...@@ -181,12 +184,12 @@ public: ...@@ -181,12 +184,12 @@ public:
* @param aClipBox = DC clip box (NULL is no clip) * @param aClipBox = DC clip box (NULL is no clip)
* @param aDC = device context * @param aDC = device context
* @param aColor = the normal color to use * @param aColor = the normal color to use
* @param aFilled = true to draw in filled mode, false to draw in skecth mode * @param aFilled = true to draw in filled mode, false to draw in sketch mode
* @param aPosition = the actual shape position * @param aPosition = the actual shape position
*/ */
void DrawFlashedPolygon( GERBER_DRAW_ITEM* aParent, void DrawFlashedPolygon( GERBER_DRAW_ITEM* aParent,
EDA_RECT* aClipBox, wxDC* aDC, int aColor, EDA_RECT* aClipBox, wxDC* aDC, int aColor,
bool aFilled, const wxPoint& aPosition ); bool aFilled, const wxPoint& aPosition );
/** /**
* Function ConvertShapeToPolygon * Function ConvertShapeToPolygon
...@@ -195,10 +198,11 @@ public: ...@@ -195,10 +198,11 @@ public:
* Useful when a shape is not a graphic primitive (shape with hole, * Useful when a shape is not a graphic primitive (shape with hole,
* rotated shape ... ) and cannot be easily drawn. * rotated shape ... ) and cannot be easily drawn.
*/ */
void ConvertShapeToPolygon(); void ConvertShapeToPolygon();
/** GetShapeDim /**
* Calculate a value that can be used to evaluate the size of text * Function GetShapeDim
* calculates a value that can be used to evaluate the size of text
* when displaying the D-Code of an item * when displaying the D-Code of an item
* due to the complexity of some shapes, * due to the complexity of some shapes,
* one cannot calculate the "size" of a shape (only a bounding box) * one cannot calculate the "size" of a shape (only a bounding box)
......
This diff is collapsed.
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2009 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 gerbview_config.cpp * @file gerbview_config.cpp
* @brief GerbView configuration. * @brief GerbView configuration.
...@@ -9,14 +34,20 @@ ...@@ -9,14 +34,20 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "gestfich.h" #include "gestfich.h"
#include "pcbcommon.h" #include "pcbcommon.h"
#include "param_config.h"
#include "colors_selection.h"
#include "gerbview.h" #include "gerbview.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
#include "gerbview_config.h"
#include "dialog_hotkeys_editor.h" #include "dialog_hotkeys_editor.h"
#define GROUP wxT("/gerbview")
#define INSETUP true
void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event ) void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
...@@ -50,24 +81,6 @@ void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event ) ...@@ -50,24 +81,6 @@ void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event )
} }
/*
* Return the GerbView applications settings list.
* (list of parameters that must be saved in GerbView parameters)
*
* This replaces the old statically define list that had the project
* file settings and the application settings mixed together. This
* was confusing and caused some settings to get saved and loaded
* incorrectly. Currently, only the settings that are needed at start
* up by the main window are defined here. There are other locally used
* settings scattered thoughout the GerbView source code. If you need
* to define a configuration setting that need to be loaded at run time,
* this is the place to define it.
*
* TODO: Define the configuration variables as member variables instead of
* global variables or move them to the object class where they are
* used.
*/
PARAM_CFG_ARRAY& GERBVIEW_FRAME::GetConfigurationSettings( void ) PARAM_CFG_ARRAY& GERBVIEW_FRAME::GetConfigurationSettings( void )
{ {
if( !m_configSettings.empty() ) if( !m_configSettings.empty() )
......
/*************************/
/** gerberview_config.h **/
/*************************/
#include "param_config.h"
#include "colors_selection.h"
#define GROUP wxT("/gerbview")
#define INSETUP TRUE
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 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
*/
/** /**
* @file gerbview_frame.h * @file gerbview_frame.h
*/ */
...@@ -73,8 +98,20 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, ...@@ -73,8 +98,20 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
// Virtual basic functions: // Virtual basic functions:
void RedrawActiveWindow( wxDC* DC, bool EraseBg ); void RedrawActiveWindow( wxDC* DC, bool EraseBg );
void ReCreateHToolbar(); void ReCreateHToolbar();
/**
* Function ReCreateVToolbar
* creates or updates the right vertical toolbar.
*
* @note This is currently not used.
*/
void ReCreateVToolbar(); void ReCreateVToolbar();
/**
* Create or update the left vertical toolbar (option toolbar
*/
void ReCreateOptToolbar(); void ReCreateOptToolbar();
void ReCreateMenuBar(); void ReCreateMenuBar();
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
...@@ -250,11 +287,10 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, ...@@ -250,11 +287,10 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
* Function GetConfigurationSettings * Function GetConfigurationSettings
* Populates the GerbView applications settings list. * Populates the GerbView applications settings list.
* (list of parameters that must be saved in GerbView parameters) * (list of parameters that must be saved in GerbView parameters)
* Currently, only the settings that are needed at start * Currently, only the settings that are needed at start up by the main window are
* up by the main window are defined here. There are other locally used * defined here. There are other locally used settings scattered throughout the
* settings scattered thoughout the GerbView source code (mainle in dialogs). * GerbView source code (mainly in dialogs). If you need to define a configuration
* If you need to define a configuration setting that need to be loaded at run time, * setting that need to be loaded at run time, this is the place to define it.
* this is the place to define it.
*/ */
PARAM_CFG_ARRAY& GetConfigurationSettings( void ); PARAM_CFG_ARRAY& GetConfigurationSettings( void );
...@@ -292,7 +328,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, ...@@ -292,7 +328,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
/** /**
* Function OnSelectActiveDCode * Function OnSelectActiveDCode
* Selects the active DCode for the current active layer. * Selects the active DCode for the current active layer.
* Items using this DCode are hightlighted * Items using this DCode are highlighted.
*/ */
void OnSelectActiveDCode( wxCommandEvent& event ); void OnSelectActiveDCode( wxCommandEvent& event );
...@@ -488,6 +524,10 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, ...@@ -488,6 +524,10 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
* 1 = read OK<br> * 1 = read OK<br>
*/ */
int ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName ); int ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName );
/**
* Set Size Items (Lines, Flashes) from DCodes List
*/
void CopyDCodesSizeToItems(); void CopyDCodesSizeToItems();
void Liste_D_Codes(); void Liste_D_Codes();
...@@ -536,7 +576,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, ...@@ -536,7 +576,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
* Function DrawItemsDCodeID * Function DrawItemsDCodeID
* Draw the DCode value (if exists) corresponding to gerber item * Draw the DCode value (if exists) corresponding to gerber item
* (polygons do not have a DCode) * (polygons do not have a DCode)
* @param aDC = the current device contect * @param aDC = the current device context
* @param aDrawMode = GR_COPY, GR_OR ... * @param aDrawMode = GR_COPY, GR_OR ...
*/ */
void DrawItemsDCodeID( wxDC* aDC, int aDrawMode ); void DrawItemsDCodeID( wxDC* aDC, int aDrawMode );
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 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 gerbview/initpcb.cpp * @file gerbview/initpcb.cpp
*/ */
...@@ -49,7 +73,7 @@ bool GERBVIEW_FRAME::Clear_Pcb( bool query ) ...@@ -49,7 +73,7 @@ bool GERBVIEW_FRAME::Clear_Pcb( bool query )
setActiveLayer(FIRST_COPPER_LAYER); setActiveLayer(FIRST_COPPER_LAYER);
m_LayersManager->UpdateLayerIcons(); m_LayersManager->UpdateLayerIcons();
syncLayerBox(); syncLayerBox();
return TRUE; return true;
} }
......
/******************/ /*
/* file pcbplot.h */ * This program source code file is part of KiCad, a free EDA CAD application.
/******************/ *
* Copyright (C) 2007 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 gerbview/pcbplot.h
*/
#ifndef PCBPLOT_H #ifndef PCBPLOT_H
#define PCBPLOT_H #define PCBPLOT_H
...@@ -26,7 +50,7 @@ struct PCB_Plot_Options ...@@ -26,7 +50,7 @@ struct PCB_Plot_Options
int HPGL_Pen_Speed; int HPGL_Pen_Speed;
int HPGL_Pen_Diam; int HPGL_Pen_Diam;
int HPGL_Pen_Recouvrement; int HPGL_Pen_Recouvrement;
bool HPGL_Org_Centre; // TRUE if, HPGL originally the center of the node bool HPGL_Org_Centre; // true if, HPGL originally the center of the node
int PlotPSColorOpt; // True for color Postscript output int PlotPSColorOpt; // True for color Postscript output
bool Plot_PS_Negative; // True to create a negative board ps plot bool Plot_PS_Negative; // True to create a negative board ps plot
......
/*************************************/ /*
/* tool_gerber.cpp: Build tool bars */ * This program source code file is part of KiCad, a free EDA CAD application.
/*************************************/ *
* Copyright (C) 2009 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
*/
/**
* @file toolbars_gerber.cpp
* @brief Build tool bars
*/
#include "fctsys.h" #include "fctsys.h"
...@@ -23,7 +49,7 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void ) ...@@ -23,7 +49,7 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
if( m_HToolBar != NULL ) if( m_HToolBar != NULL )
return; return;
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString, m_HToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString,
...@@ -98,10 +124,6 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void ) ...@@ -98,10 +124,6 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
} }
/**
* Create or update the right vertical toolbar
* Current no used
*/
void GERBVIEW_FRAME::ReCreateVToolbar( void ) void GERBVIEW_FRAME::ReCreateVToolbar( void )
{ {
if( m_VToolBar ) if( m_VToolBar )
...@@ -117,9 +139,6 @@ void GERBVIEW_FRAME::ReCreateVToolbar( void ) ...@@ -117,9 +139,6 @@ void GERBVIEW_FRAME::ReCreateVToolbar( void )
} }
/**
* Create or update the left vertical toolbar (option toolbar
*/
void GERBVIEW_FRAME::ReCreateOptToolbar( void ) void GERBVIEW_FRAME::ReCreateOptToolbar( void )
{ {
if( m_OptionsToolBar ) if( m_OptionsToolBar )
...@@ -175,12 +194,12 @@ void GERBVIEW_FRAME::ReCreateOptToolbar( void ) ...@@ -175,12 +194,12 @@ void GERBVIEW_FRAME::ReCreateOptToolbar( void )
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, wxEmptyString,
KiBitmap( gbr_select_mode1_xpm ), KiBitmap( gbr_select_mode1_xpm ),
_( "Show layers in stacked mode \ _( "Show layers in stacked mode \
(show negative items without artefact, sometimes slow)" ), (show negative items without artifacts, sometimes slow)" ),
wxITEM_CHECK ); wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, wxEmptyString,
KiBitmap( gbr_select_mode2_xpm ), KiBitmap( gbr_select_mode2_xpm ),
_( "Show layers in tranparency mode \ _( "Show layers in transparency mode \
(show negative items without artefact, sometimes slow)" ), (show negative items without artifacts, sometimes slow)" ),
wxITEM_CHECK ); wxITEM_CHECK );
// Tools to show/hide toolbars: // Tools to show/hide toolbars:
......
/**************/ /*
/* gr_basic.h */ * 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) 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
*/
/**
* @file gr_basic.h
*/
#ifndef GR_BASIC #ifndef GR_BASIC
#define GR_BASIC #define GR_BASIC
...@@ -17,7 +42,7 @@ class EDA_RECT; ...@@ -17,7 +42,7 @@ class EDA_RECT;
#define GR_NXOR 0x08000000 #define GR_NXOR 0x08000000
#define GR_INVERT 0x10000000 #define GR_INVERT 0x10000000
#define GR_SURBRILL 0x80000000 #define GR_HIGHLIGHT 0x80000000
#define GR_M_LEFT_DOWN 0x10000000 #define GR_M_LEFT_DOWN 0x10000000
#define GR_M_RIGHT_DOWN 0x20000000 #define GR_M_RIGHT_DOWN 0x20000000
......
...@@ -887,12 +887,20 @@ public: ...@@ -887,12 +887,20 @@ public:
*/ */
void OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem ); void OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem );
// Highlight functions: /**
int Select_High_Light( wxDC* DC ); * Locate track or pad and highlight the corresponding net.
void High_Light( wxDC* DC ); * @return The Netcode, or -1 if no net located.
*/
int SelectHighLight( wxDC* DC );
/**
* Function HighLight.
* highlights the net at the current cursor position.
*/
void HighLight( wxDC* DC );
// Track and via edition: // Track and via edition:
void Via_Edit_Control( wxCommandEvent& event ); void Via_Edit_Control( wxCommandEvent& event );
/** /**
* Function IsMicroViaAcceptable * Function IsMicroViaAcceptable
...@@ -928,9 +936,24 @@ public: ...@@ -928,9 +936,24 @@ public:
*/ */
void DisplayNetStatus( wxDC* DC ); void DisplayNetStatus( wxDC* DC );
/**
* Function Delete_Segment
* removes 1 segment of track.
* 2 cases:
* If There is evidence of new track: delete new segment.
* Otherwise, delete segment under the cursor.
*/
TRACK* Delete_Segment( wxDC* DC, TRACK* Track ); TRACK* Delete_Segment( wxDC* DC, TRACK* Track );
void Delete_Track( wxDC* DC, TRACK* Track ); void Delete_Track( wxDC* DC, TRACK* Track );
void Delete_net( wxDC* DC, TRACK* Track ); void Delete_net( wxDC* DC, TRACK* Track );
/**
* Function Remove_One_Track
* removes 1 track/
* The leading segment is removed and all adjacent segments
* until a pad or a junction point of more than 2 segments is found
*/
void Remove_One_Track( wxDC* DC, TRACK* pt_segm ); void Remove_One_Track( wxDC* DC, TRACK* pt_segm );
/** /**
...@@ -1087,12 +1110,17 @@ public: ...@@ -1087,12 +1110,17 @@ public:
* Remove and delete the current outline segment in progress * Remove and delete the current outline segment in progress
* @return 0 if no corner in list, or corner number * @return 0 if no corner in list, or corner number
*/ */
int Delete_LastCreatedCorner( wxDC* DC ); int Delete_LastCreatedCorner( wxDC* DC );
/** /**
* Function Begin_Zone * Function Begin_Zone
* initiates a zone edge creation process, * either initializes the first segment of a new zone, or adds an
* or terminates the current zone edge and creates a new zone edge stub * intermediate segment.
* A new zone can be:
* created from scratch: the user will be prompted to define parameters (layer, clearence ...)
* created from a similar zone (s_CurrentZone is used): parameters are copied from
* s_CurrentZone
* created as a cutout (an hole) inside s_CurrentZone
*/ */
int Begin_Zone( wxDC* DC ); int Begin_Zone( wxDC* DC );
...@@ -1114,7 +1142,7 @@ public: ...@@ -1114,7 +1142,7 @@ public:
* @param verbose = true to show error messages * @param verbose = true to show error messages
* @return error level (0 = no error) * @return error level (0 = no error)
*/ */
int Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose = TRUE ); int Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose = true );
/** /**
* Function Fill_All_Zones * Function Fill_All_Zones
...@@ -1123,7 +1151,7 @@ public: ...@@ -1123,7 +1151,7 @@ public:
* @param verbose = true to show error messages * @param verbose = true to show error messages
* @return error level (0 = no error) * @return error level (0 = no error)
*/ */
int Fill_All_Zones( bool verbose = TRUE ); int Fill_All_Zones( bool verbose = true );
/** /**
......
...@@ -129,6 +129,7 @@ set(PCBNEW_SRCS ...@@ -129,6 +129,7 @@ set(PCBNEW_SRCS
globaleditpad.cpp globaleditpad.cpp
gpcb_exchange.cpp gpcb_exchange.cpp
graphpcb.cpp graphpcb.cpp
highlight.cpp
hotkeys.cpp hotkeys.cpp
hotkeys_board_editor.cpp hotkeys_board_editor.cpp
hotkeys_module_editor.cpp hotkeys_module_editor.cpp
...@@ -174,7 +175,6 @@ set(PCBNEW_SRCS ...@@ -174,7 +175,6 @@ set(PCBNEW_SRCS
specctra_export.cpp specctra_export.cpp
specctra_import.cpp specctra_import.cpp
specctra_keywords.cpp specctra_keywords.cpp
surbrill.cpp
swap_layers.cpp swap_layers.cpp
tool_modedit.cpp tool_modedit.cpp
tool_onrightclick.cpp tool_onrightclick.cpp
......
/******************************************/ /*
/* Track editing: attribute flags editing */ * 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) 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
*/
/**
* @file attribut.cpp
* @brief Track attribute flags editing.
*/
#include "fctsys.h" #include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
...@@ -27,7 +53,7 @@ void PCB_EDIT_FRAME::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On ) ...@@ -27,7 +53,7 @@ void PCB_EDIT_FRAME::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On )
OnModify(); OnModify();
DrawPanel->CrossHairOff( DC ); // Erase cursor shape DrawPanel->CrossHairOff( DC ); // Erase cursor shape
track->SetState( TRACK_LOCKED, Flag_On ); track->SetState( TRACK_LOCKED, Flag_On );
track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); track->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT );
DrawPanel->CrossHairOn( DC ); // Display cursor shape DrawPanel->CrossHairOn( DC ); // Display cursor shape
track->DisplayInfo( this ); track->DisplayInfo( this );
} }
...@@ -44,7 +70,7 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ) ...@@ -44,7 +70,7 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
DrawPanel->CrossHairOff( DC ); // Erase cursor shape DrawPanel->CrossHairOff( DC ); // Erase cursor shape
Track = GetBoard()->MarkTrace( track, &nb_segm, NULL, NULL, true ); Track = GetBoard()->MarkTrace( track, &nb_segm, NULL, NULL, true );
DrawTraces( DrawPanel, DC, Track, nb_segm, GR_OR | GR_SURBRILL ); DrawTraces( DrawPanel, DC, Track, nb_segm, GR_OR | GR_HIGHLIGHT );
for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- ) for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- )
{ {
...@@ -86,7 +112,7 @@ void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On ) ...@@ -86,7 +112,7 @@ void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
OnModify(); OnModify();
Track->SetState( TRACK_LOCKED, Flag_On ); Track->SetState( TRACK_LOCKED, Flag_On );
Track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); Track->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT );
Track = Track->Next(); Track = Track->Next();
} }
......
...@@ -254,7 +254,7 @@ public: ...@@ -254,7 +254,7 @@ public:
* Draw a pad: * Draw a pad:
* @param aPanel = the EDA_DRAW_PANEL panel * @param aPanel = the EDA_DRAW_PANEL panel
* @param aDC = the current device context * @param aDC = the current device context
* @param aDraw_mode = mode: GR_OR, GR_XOR, GR_AND... * @param aDrawMode = mode: GR_OR, GR_XOR, GR_AND...
* @param aOffset = draw offset * @param aOffset = draw offset
*/ */
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
...@@ -265,7 +265,12 @@ public: ...@@ -265,7 +265,12 @@ public:
/** /**
* Function DrawShape * Function DrawShape
* basic function to draw a pad. * basic function to draw a pad.
* used by Draw after calculation of parameters (color, ) final orientation ... * <p>
* This function is used by Draw after calculation of parameters (color, ) final
* orientation transforms are set. It can also be called to draw a pad on any panel
* even if this panel is not a EDA_DRAW_PANEL for instance on a wxPanel inside the
* pad editor.
* </p>
*/ */
void DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ); void DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo );
......
/*
* 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) 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
*/
/** /**
* @file class_pad_draw_functions.cpp * @file class_pad_draw_functions.cpp
*/ */
...@@ -49,19 +74,14 @@ PAD_DRAWINFO::PAD_DRAWINFO() ...@@ -49,19 +74,14 @@ PAD_DRAWINFO::PAD_DRAWINFO()
} }
/** Draw a pad:
* @param aPanel = the EDA_DRAW_PANEL panel
* @param aDraw_mode = mode: GR_OR, GR_XOR, GR_AND...
* @param aOffset = draw offset
*/
void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoint& aOffset ) void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoint& aOffset )
{ {
int color = 0; int color = 0;
wxSize mask_margin; // margin (clearance) used for some non copper layers wxSize mask_margin; // margin (clearance) used for some non copper layers
#ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR #ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
int showActualMaskSize = 0; /* == layer number if the actual pad size on mask layer can be displayed int showActualMaskSize = 0; /* Layer number if the actual pad size on mask layer can
* i.e. if only one layer is shown for this pad * be displayed i.e. if only one layer is shown for this pad
* and this layer is a mask (solder mask or sloder paste * and this layer is a mask (solder mask or sloder paste
*/ */
#endif #endif
...@@ -133,8 +153,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi ...@@ -133,8 +153,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi
if( color == 0 ) /* Not on copper layer */ if( color == 0 ) /* Not on copper layer */
{ {
// If the pad in on only one tech layer, use the layer color // If the pad in on only one tech layer, use the layer color else use DARKGRAY
// else use DARKGRAY
int mask_non_copper_layers = m_layerMask & ~ALL_CU_LAYERS; int mask_non_copper_layers = m_layerMask & ~ALL_CU_LAYERS;
#ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR #ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
mask_non_copper_layers &= brd->GetVisibleLayers(); mask_non_copper_layers &= brd->GetVisibleLayers();
...@@ -311,7 +330,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi ...@@ -311,7 +330,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi
} }
if( aDraw_mode & GR_SURBRILL ) if( aDraw_mode & GR_HIGHLIGHT )
{ {
if( aDraw_mode & GR_AND ) if( aDraw_mode & GR_AND )
color &= ~HIGHLIGHT_FLAG; color &= ~HIGHLIGHT_FLAG;
...@@ -361,13 +380,6 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi ...@@ -361,13 +380,6 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi
} }
/**
* Function DrawShape
* basic function to draw a pad.
* used by D_PAD::Draw after calculation of parameters (color, final orientation ...)
* this function can be called to draw a pad on a panel
* even if this panel is not a EDA_DRAW_PANEL (for instance on a wxPanel inside the pad editor)
*/
void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
{ {
wxPoint coord[4]; wxPoint coord[4];
...@@ -553,10 +565,9 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) ...@@ -553,10 +565,9 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
if( !aDrawInfo.m_Display_padnum && !aDrawInfo.m_Display_netname ) if( !aDrawInfo.m_Display_padnum && !aDrawInfo.m_Display_netname )
return; return;
wxPoint tpos0 = shape_pos; // Position of the centre of text wxPoint tpos0 = shape_pos; // Position of the centre of text
wxPoint tpos = tpos0; wxPoint tpos = tpos0;
wxSize AreaSize; // size of text area, normalized to wxSize AreaSize; // size of text area, normalized to AreaSize.y < AreaSize.x
// AreaSize.y < AreaSize.x
int shortname_len = m_ShortNetname.Len(); int shortname_len = m_ShortNetname.Len();
if( !aDrawInfo.m_Display_netname ) if( !aDrawInfo.m_Display_netname )
...@@ -682,15 +693,6 @@ int D_PAD::BuildSegmentFromOvalShape(wxPoint& aSegStart, wxPoint& aSegEnd, int a ...@@ -682,15 +693,6 @@ int D_PAD::BuildSegmentFromOvalShape(wxPoint& aSegStart, wxPoint& aSegEnd, int a
} }
/**
* Function BuildPadPolygon
* Has meaning only for polygonal pads (trapeziod and rectangular)
* Build the Corner list of the polygonal shape,
* depending on shape, extra size (clearance ...) and orientation
* @param aCoord = a buffer to fill.
* @param aInflateValue = wxSize: the clearance or margin value. value > 0: inflate, < 0 deflate
* @param aRotation = full rotation of the polygon, usually m_Orient
*/
void D_PAD::BuildPadPolygon( wxPoint aCoord[4], wxSize aInflateValue, int aRotation ) const void D_PAD::BuildPadPolygon( wxPoint aCoord[4], wxSize aInflateValue, int aRotation ) const
{ {
if( (GetShape() != PAD_RECT) && (GetShape() != PAD_TRAPEZOID) ) if( (GetShape() != PAD_RECT) && (GetShape() != PAD_TRAPEZOID) )
......
...@@ -641,7 +641,7 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& ...@@ -641,7 +641,7 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint&
} }
} }
if( draw_mode & GR_SURBRILL ) if( draw_mode & GR_HIGHLIGHT )
{ {
if( draw_mode & GR_AND ) if( draw_mode & GR_AND )
color &= ~HIGHLIGHT_FLAG; color &= ~HIGHLIGHT_FLAG;
...@@ -815,7 +815,7 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint ...@@ -815,7 +815,7 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint
} }
} }
if( draw_mode & GR_SURBRILL ) if( draw_mode & GR_HIGHLIGHT )
{ {
if( draw_mode & GR_AND ) if( draw_mode & GR_AND )
color &= ~HIGHLIGHT_FLAG; color &= ~HIGHLIGHT_FLAG;
...@@ -1275,18 +1275,6 @@ TRACK* TRACK::GetVia( TRACK* aEndTrace, const wxPoint& aPosition, int aLayerMask ...@@ -1275,18 +1275,6 @@ TRACK* TRACK::GetVia( TRACK* aEndTrace, const wxPoint& aPosition, int aLayerMask
} }
/*
* GetTrace is a helper function to locate a trace segment having an end point at aPosition
* on aLayerMask starting at aStartTrace and end at aEndTrace.
* The segments of track that are flagged as deleted or busy are ignored.
* To speed up the search, this search is made:
* first on the previous and next neightbour (NEIGHTBOUR_COUNT_MAX size)
* of this.
* After, only if no track found, on aStartTrace to aEndTrace
* Because tracks are grouped when entered in list, most of time the first search
* find the connection.
* The speedup is *very* large
*/
TRACK* TRACK::GetTrace( TRACK* aStartTrace, TRACK* aEndTrace, int aEndPoint ) TRACK* TRACK::GetTrace( TRACK* aStartTrace, TRACK* aEndTrace, int aEndPoint )
{ {
const int NEIGHTBOUR_COUNT_MAX = 50; const int NEIGHTBOUR_COUNT_MAX = 50;
......
/*
* 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) 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
*/
/** /**
* @file class_zone.cpp * @file class_zone.cpp
* @brief Implementation of class to handle copper zones. * @brief Implementation of class to handle copper zones.
...@@ -46,12 +71,7 @@ ZONE_CONTAINER::~ZONE_CONTAINER() ...@@ -46,12 +71,7 @@ ZONE_CONTAINER::~ZONE_CONTAINER()
m_Poly = NULL; m_Poly = NULL;
} }
/**
* Function UnFill
* Removes the zone filling
* @return true if a previous filling is removed, false if no change
* (when no filling found)
*/
bool ZONE_CONTAINER::UnFill() bool ZONE_CONTAINER::UnFill()
{ {
bool change = ( m_FilledPolysList.size() > 0 ) || ( m_FillSegmList.size() > 0 ); bool change = ( m_FilledPolysList.size() > 0 ) || ( m_FillSegmList.size() > 0 );
...@@ -63,10 +83,7 @@ bool ZONE_CONTAINER::UnFill() ...@@ -63,10 +83,7 @@ bool ZONE_CONTAINER::UnFill()
return change; return change;
} }
/**
* Function GetPosition (virtual)
* @return a wxPoint, position of the first point of the outline
*/
wxPoint& ZONE_CONTAINER::GetPosition() wxPoint& ZONE_CONTAINER::GetPosition()
{ {
static wxPoint pos; static wxPoint pos;
...@@ -82,23 +99,18 @@ wxPoint& ZONE_CONTAINER::GetPosition() ...@@ -82,23 +99,18 @@ wxPoint& ZONE_CONTAINER::GetPosition()
} }
/** void ZONE_CONTAINER::SetNet( int aNetCode )
* Set the netcode and the netname
* if netcode >= 0, set the netname
* if netcode < 0: keep old netname (used to set an necode error flag)
*/
void ZONE_CONTAINER::SetNet( int anet_code )
{ {
m_NetCode = anet_code; m_NetCode = aNetCode;
if( anet_code < 0 ) if( aNetCode < 0 )
return; return;
BOARD* board = GetBoard(); BOARD* board = GetBoard();
if( board ) if( board )
{ {
NETINFO_ITEM* net = board->FindNet( anet_code ); NETINFO_ITEM* net = board->FindNet( aNetCode );
if( net ) if( net )
m_Netname = net->GetNetname(); m_Netname = net->GetNetname();
...@@ -541,7 +553,7 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const ...@@ -541,7 +553,7 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const
} }
} }
if( aDrawMode & GR_SURBRILL ) if( aDrawMode & GR_HIGHLIGHT )
{ {
if( aDrawMode & GR_AND ) if( aDrawMode & GR_AND )
color &= ~HIGHLIGHT_FLAG; color &= ~HIGHLIGHT_FLAG;
...@@ -597,14 +609,6 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const ...@@ -597,14 +609,6 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const
} }
/**
* Function DrawDrawFilledArea
* Draws the filled areas for this zone (polygon list .m_FilledPolysList)
* @param panel = current Draw Panel
* @param DC = current Device Context
* @param offset = Draw offset (usually wxPoint(0,0))
* @param aDrawMode = GR_OR, GR_XOR, GR_COPY ..
*/
void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel, void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
wxDC* DC, int aDrawMode, const wxPoint& offset ) wxDC* DC, int aDrawMode, const wxPoint& offset )
{ {
...@@ -642,7 +646,7 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel, ...@@ -642,7 +646,7 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
} }
} }
if( aDrawMode & GR_SURBRILL ) if( aDrawMode & GR_HIGHLIGHT )
{ {
if( aDrawMode & GR_AND ) if( aDrawMode & GR_AND )
color &= ~HIGHLIGHT_FLAG; color &= ~HIGHLIGHT_FLAG;
...@@ -763,16 +767,6 @@ EDA_RECT ZONE_CONTAINER::GetBoundingBox() const ...@@ -763,16 +767,6 @@ EDA_RECT ZONE_CONTAINER::GetBoundingBox() const
} }
/**
* Function DrawWhileCreateOutline
* Draws the zone outline when ir is created.
* The moving edges (last segment and the closing edge segment) are in XOR graphic mode,
* old segment in OR graphic mode
* The closing edge has its own shape
* @param panel = current Draw Panel
* @param DC = current Device Context
* @param draw_mode = draw mode: OR, XOR ..
*/
void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode ) void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode )
{ {
int current_gr_mode = draw_mode; int current_gr_mode = draw_mode;
...@@ -838,13 +832,6 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, in ...@@ -838,13 +832,6 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, in
} }
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param refPos A wxPoint to test
* @return bool - true if a hit, else false
* return true if refPos is near a corner or an edge
*/
bool ZONE_CONTAINER::HitTest( const wxPoint& refPos ) bool ZONE_CONTAINER::HitTest( const wxPoint& refPos )
{ {
if( HitTestForCorner( refPos ) ) if( HitTestForCorner( refPos ) )
...@@ -857,20 +844,13 @@ bool ZONE_CONTAINER::HitTest( const wxPoint& refPos ) ...@@ -857,20 +844,13 @@ bool ZONE_CONTAINER::HitTest( const wxPoint& refPos )
} }
/**
* Function HitTestForCorner
* tests if the given wxPoint near a corner, or near the segment define by 2 corners.
* Choose the nearest corner
* "near" means grid size (or CORNER_MIN_DIST if grid is not known)
* Set m_CornerSelection to corner index in .m_Poly-&gtcorner or -1 if no corner found
* @return true if a corner found
* @param refPos : A wxPoint to test
*/
bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos ) bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos )
{ {
m_CornerSelection = -1; // Set to not found m_CornerSelection = -1; // Set to not found
#define CORNER_MIN_DIST 100 // distance (in internal units) to detect a corner in a zone outline // distance (in internal units) to detect a corner in a zone outline.
#define CORNER_MIN_DIST 100
int min_dist = CORNER_MIN_DIST + 1; int min_dist = CORNER_MIN_DIST + 1;
if( GetBoard() && GetBoard()->m_PcbFrame ) if( GetBoard() && GetBoard()->m_PcbFrame )
...@@ -901,16 +881,6 @@ bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos ) ...@@ -901,16 +881,6 @@ bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos )
} }
/**
* Function HitTestForEdge
* tests if the given wxPoint near a corner, or near the segment define by 2 corners.
* choose the nearest segment
* "near" means grid size (or EDGE_MIN_DIST if grid is not known)
* Set m_CornerSelection to -1 if nothing found, or index of the starting corner of edge
* in .m_Poly-&gtcorner
* @return true if found
* @param refPos : A wxPoint to test
*/
bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos ) bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos )
{ {
unsigned lim = m_Poly->corner.size(); unsigned lim = m_Poly->corner.size();
...@@ -963,12 +933,6 @@ bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos ) ...@@ -963,12 +933,6 @@ bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos )
} }
/**
* Function HitTest (overlayed)
* tests if the given EDA_RECT contains the bounds of this object.
* @param refArea : the given EDA_RECT
* @return bool - true if a hit, else false
*/
bool ZONE_CONTAINER::HitTest( EDA_RECT& refArea ) bool ZONE_CONTAINER::HitTest( EDA_RECT& refArea )
{ {
bool is_out_of_box = false; bool is_out_of_box = false;
...@@ -1018,12 +982,6 @@ int ZONE_CONTAINER::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const ...@@ -1018,12 +982,6 @@ int ZONE_CONTAINER::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const
} }
/**
* Function HitTestFilledArea
* tests if the given wxPoint is within the bounds of a filled area of this zone.
* @param aRefPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool ZONE_CONTAINER::HitTestFilledArea( const wxPoint& aRefPos ) bool ZONE_CONTAINER::HitTestFilledArea( const wxPoint& aRefPos )
{ {
unsigned indexstart = 0, indexend; unsigned indexstart = 0, indexend;
...@@ -1124,11 +1082,6 @@ void ZONE_CONTAINER::DisplayInfo( EDA_DRAW_FRAME* frame ) ...@@ -1124,11 +1082,6 @@ void ZONE_CONTAINER::DisplayInfo( EDA_DRAW_FRAME* frame )
/* Geometric transforms: */ /* Geometric transforms: */
/**
* Function Move
* Move the outlines
* @param offset = moving vector
*/
void ZONE_CONTAINER::Move( const wxPoint& offset ) void ZONE_CONTAINER::Move( const wxPoint& offset )
{ {
/* move outlines */ /* move outlines */
...@@ -1155,11 +1108,6 @@ void ZONE_CONTAINER::Move( const wxPoint& offset ) ...@@ -1155,11 +1108,6 @@ void ZONE_CONTAINER::Move( const wxPoint& offset )
} }
/**
* Function MoveEdge
* Move the outline Edge. m_CornerSelection is the start point of the outline edge
* @param offset = moving vector
*/
void ZONE_CONTAINER::MoveEdge( const wxPoint& offset ) void ZONE_CONTAINER::MoveEdge( const wxPoint& offset )
{ {
int ii = m_CornerSelection; int ii = m_CornerSelection;
...@@ -1184,12 +1132,6 @@ void ZONE_CONTAINER::MoveEdge( const wxPoint& offset ) ...@@ -1184,12 +1132,6 @@ void ZONE_CONTAINER::MoveEdge( const wxPoint& offset )
} }
/**
* Function Rotate
* Move the outlines
* @param centre = rot centre
* @param angle = in 0.1 degree
*/
void ZONE_CONTAINER::Rotate( const wxPoint& centre, int angle ) void ZONE_CONTAINER::Rotate( const wxPoint& centre, int angle )
{ {
wxPoint pos; wxPoint pos;
...@@ -1224,12 +1166,6 @@ void ZONE_CONTAINER::Rotate( const wxPoint& centre, int angle ) ...@@ -1224,12 +1166,6 @@ void ZONE_CONTAINER::Rotate( const wxPoint& centre, int angle )
} }
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
* (like Mirror() but changes layer)
* @param aCentre - the rotation point.
*/
void ZONE_CONTAINER::Flip( const wxPoint& aCentre ) void ZONE_CONTAINER::Flip( const wxPoint& aCentre )
{ {
Mirror( aCentre ); Mirror( aCentre );
...@@ -1237,11 +1173,6 @@ void ZONE_CONTAINER::Flip( const wxPoint& aCentre ) ...@@ -1237,11 +1173,6 @@ void ZONE_CONTAINER::Flip( const wxPoint& aCentre )
} }
/**
* Function Mirror
* flip the outlines , relative to a given horizontal axis
* @param mirror_ref = vertical axis position
*/
void ZONE_CONTAINER::Mirror( const wxPoint& mirror_ref ) void ZONE_CONTAINER::Mirror( const wxPoint& mirror_ref )
{ {
for( unsigned ii = 0; ii < m_Poly->corner.size(); ii++ ) for( unsigned ii = 0; ii < m_Poly->corner.size(); ii++ )
...@@ -1274,11 +1205,6 @@ void ZONE_CONTAINER::Mirror( const wxPoint& mirror_ref ) ...@@ -1274,11 +1205,6 @@ void ZONE_CONTAINER::Mirror( const wxPoint& mirror_ref )
} }
/**
* Function copy
* copy useful data from the source.
* flags and linked list pointers are NOT copied
*/
void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src ) void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src )
{ {
m_Parent = src->m_Parent; m_Parent = src->m_Parent;
...@@ -1304,11 +1230,6 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src ) ...@@ -1304,11 +1230,6 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src )
} }
/**
* Function SetNetNameFromNetCode
* Find the net name corresponding to the net code.
* @return bool - true if net found, else false
*/
bool ZONE_CONTAINER::SetNetNameFromNetCode( void ) bool ZONE_CONTAINER::SetNetNameFromNetCode( void )
{ {
NETINFO_ITEM* net; NETINFO_ITEM* net;
......
...@@ -202,7 +202,15 @@ public: ...@@ -202,7 +202,15 @@ public:
return ( GetLayer() < FIRST_NO_COPPER_LAYER ) ? true : false; return ( GetLayer() < FIRST_NO_COPPER_LAYER ) ? true : false;
} }
virtual void SetNet( int anet_code ); /**
* Functio SetNet
* set the netcode and the netname.
*
* @param aNetCode The net code of the zone container if greater than or equal to
* zero. Otherwise the current net code is kept and set the net
* code error flag.
*/
virtual void SetNet( int aNetCode );
/** /**
* Function SetNetNameFromNetCode * Function SetNetNameFromNetCode
......
/******************************************/ /*
/* Edit Track: Erase Routines */ * This program source code file is part of KiCad, a free EDA CAD application.
/* Delete segments, tracks, and net areas */ *
/******************************************/ * Copyright (C) 2009 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
*/
/**
* @file deltrack.cpp
*/
#include "fctsys.h" #include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
...@@ -17,11 +41,6 @@ ...@@ -17,11 +41,6 @@
#include "protos.h" #include "protos.h"
/* Removes 1 segment of track.
* 2 cases:
* If There is evidence of new track: delete new segment.
* Otherwise, delete segment under the cursor.
*/
TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack ) TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
{ {
int current_net_code; int current_net_code;
...@@ -84,7 +103,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack ) ...@@ -84,7 +103,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
DrawPanel->SetMouseCapture( NULL, NULL ); DrawPanel->SetMouseCapture( NULL, NULL );
if( GetBoard()->IsHighLightNetON() ) if( GetBoard()->IsHighLightNetON() )
High_Light( DC ); HighLight( DC );
SetCurItem( NULL ); SetCurItem( NULL );
return NULL; return NULL;
...@@ -170,10 +189,6 @@ void PCB_EDIT_FRAME::Delete_net( wxDC* DC, TRACK* aTrack ) ...@@ -170,10 +189,6 @@ void PCB_EDIT_FRAME::Delete_net( wxDC* DC, TRACK* aTrack )
} }
/* Remove 1 track:
* The leading segment is removed and all adjacent segments
* until a pad or a junction point of more than 2 segments is found
*/
void PCB_EDIT_FRAME::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) void PCB_EDIT_FRAME::Remove_One_Track( wxDC* DC, TRACK* pt_segm )
{ {
int segments_to_delete_count; int segments_to_delete_count;
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_pcbnew_config_libs_and_paths_fbp__ #ifndef __dialog_pcbnew_config_libs_and_paths_fbp__
#define __dialog_pcbnew_config_libs_and_paths_fbp__ #define __dialog_pcbnew_config_libs_and_paths_fbp__
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/listbox.h> #include <wx/listbox.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/statline.h> #include <wx/statline.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PCBNEW_CONFIG_LIBS_FBP /// Class DIALOG_PCBNEW_CONFIG_LIBS_FBP
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_PCBNEW_CONFIG_LIBS_FBP : public wxDialog class DIALOG_PCBNEW_CONFIG_LIBS_FBP : public wxDialog
{ {
private: private:
protected: protected:
enum enum
{ {
ID_ADD_LIB = 1000, ID_ADD_LIB = 1000,
ID_REMOVE_LIB, ID_REMOVE_LIB,
wxID_BROWSE_MOD_DOC, wxID_BROWSE_MOD_DOC,
ID_LIB_PATH_SEL, ID_LIB_PATH_SEL,
wxID_INSERT_PATH, wxID_INSERT_PATH,
wxID_REMOVE_PATH, wxID_REMOVE_PATH,
}; };
wxListBox* m_ListLibr; wxListBox* m_ListLibr;
wxButton* m_buttonAddLib; wxButton* m_buttonAddLib;
wxButton* m_buttonIns; wxButton* m_buttonIns;
wxButton* m_buttonRemoveLib; wxButton* m_buttonRemoveLib;
wxButton* m_buttonUp; wxButton* m_buttonUp;
wxButton* m_buttonDown; wxButton* m_buttonDown;
wxTextCtrl* m_TextHelpModulesFileName; wxTextCtrl* m_TextHelpModulesFileName;
wxButton* m_buttonModDoc; wxButton* m_buttonModDoc;
wxListBox* m_listUserPaths; wxListBox* m_listUserPaths;
wxButton* m_buttonAddPath; wxButton* m_buttonAddPath;
wxButton* m_buttonInsPath; wxButton* m_buttonInsPath;
wxButton* m_buttonRemovePath; wxButton* m_buttonRemovePath;
wxListBox* m_DefaultLibraryPathslistBox; wxListBox* m_DefaultLibraryPathslistBox;
wxStaticLine* m_staticline1; wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer1; wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel; wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
virtual void OnAddOrInsertLibClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddOrInsertLibClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemoveLibClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveLibClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonUpClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnButtonUpClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonDownClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnButtonDownClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnBrowseModDocFile( wxCommandEvent& event ){ event.Skip(); } virtual void OnBrowseModDocFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddOrInsertPath( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveUserPath( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PCBNEW_CONFIG_LIBS_FBP(); DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PCBNEW_CONFIG_LIBS_FBP();
};
};
#endif //__dialog_pcbnew_config_libs_and_paths_fbp__
#endif //__dialog_pcbnew_config_libs_and_paths_fbp__
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 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
*/
/** /**
* @file edit.cpp * @file edit.cpp
* @brief Edit PCB implementation. * @brief Edit PCB implementation.
...@@ -1296,7 +1321,7 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) ...@@ -1296,7 +1321,7 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
DisplayInfoMessage( this, _( "Warning: zone display is OFF!!!" ) ); DisplayInfoMessage( this, _( "Warning: zone display is OFF!!!" ) );
if( !GetBoard()->IsHighLightNetON() && (GetBoard()->GetHighLightNetCode() > 0 ) ) if( !GetBoard()->IsHighLightNetON() && (GetBoard()->GetHighLightNetCode() > 0 ) )
High_Light( &dc ); HighLight( &dc );
break; break;
......
/************************/ /*
/* Edit tracks */ * 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) 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
*/
/**
* @file editrack-part2.cpp
*/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -309,7 +335,7 @@ void PCB_EDIT_FRAME::HighlightUnconnectedPads( wxDC* DC ) ...@@ -309,7 +335,7 @@ void PCB_EDIT_FRAME::HighlightUnconnectedPads( wxDC* DC )
if( (net->m_Status & CH_ACTIF) == 0 ) if( (net->m_Status & CH_ACTIF) == 0 )
continue; continue;
net->m_PadStart->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); net->m_PadStart->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT );
net->m_PadEnd->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); net->m_PadEnd->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT );
} }
} }
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 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
*/
/** /**
* @file editrack.cpp * @file editrack.cpp
*/ */
...@@ -42,7 +67,7 @@ static void Abort_Create_Track( EDA_DRAW_PANEL* Panel, wxDC* DC ) ...@@ -42,7 +67,7 @@ static void Abort_Create_Track( EDA_DRAW_PANEL* Panel, wxDC* DC )
ShowNewTrackWhenMovingCursor( Panel, DC, wxDefaultPosition, false ); ShowNewTrackWhenMovingCursor( Panel, DC, wxDefaultPosition, false );
if( pcb->IsHighLightNetON() ) if( pcb->IsHighLightNetON() )
frame->High_Light( DC ); frame->HighLight( DC );
pcb->PopHighLight(); pcb->PopHighLight();
...@@ -83,7 +108,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) ...@@ -83,7 +108,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
// erase old highlight // erase old highlight
if( GetBoard()->IsHighLightNetON() ) if( GetBoard()->IsHighLightNetON() )
High_Light( aDC ); HighLight( aDC );
g_CurrentTrackList.PushBack( new TRACK( GetBoard() ) ); g_CurrentTrackList.PushBack( new TRACK( GetBoard() ) );
g_CurrentTrackSegment->m_Flags = IS_NEW; g_CurrentTrackSegment->m_Flags = IS_NEW;
...@@ -496,7 +521,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC ) ...@@ -496,7 +521,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC )
wxASSERT( g_CurrentTrackList.GetCount() == 0 ); wxASSERT( g_CurrentTrackList.GetCount() == 0 );
if( GetBoard()->IsHighLightNetON() ) if( GetBoard()->IsHighLightNetON() )
High_Light( aDC ); HighLight( aDC );
GetBoard()->PopHighLight(); GetBoard()->PopHighLight();
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 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 surbrill.cpp * @file highlight.cpp
* @brief Highlight nets. * @brief Highlight nets.
*/ */
...@@ -21,12 +45,6 @@ ...@@ -21,12 +45,6 @@
#define Pad_fill ( Pad_Fill_Item.State == RUN ) #define Pad_fill ( Pad_Fill_Item.State == RUN )
/**
* Function ListNetsAndSelect
* called by a command event
* displays the sorted list of nets in a dialog frame
* If a net is selected, it is highlighted
*/
void PCB_EDIT_FRAME::ListNetsAndSelect( wxCommandEvent& event ) void PCB_EDIT_FRAME::ListNetsAndSelect( wxCommandEvent& event )
{ {
NETINFO_ITEM* net; NETINFO_ITEM* net;
...@@ -86,23 +104,20 @@ void PCB_EDIT_FRAME::ListNetsAndSelect( wxCommandEvent& event ) ...@@ -86,23 +104,20 @@ void PCB_EDIT_FRAME::ListNetsAndSelect( wxCommandEvent& event )
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, DrawPanel );
if( GetBoard()->IsHighLightNetON() ) if( GetBoard()->IsHighLightNetON() )
High_Light( &dc ); HighLight( &dc );
GetBoard()->SetHighLightNet( netcode ); GetBoard()->SetHighLightNet( netcode );
High_Light( &dc ); HighLight( &dc );
} }
} }
/* Locate track or pad and highlight the corresponding net int PCB_EDIT_FRAME::SelectHighLight( wxDC* DC )
* Returns the Netcode, or -1 if no net located.
*/
int PCB_EDIT_FRAME::Select_High_Light( wxDC* DC )
{ {
int netcode = -1; int netcode = -1;
if( GetBoard()->IsHighLightNetON() ) if( GetBoard()->IsHighLightNetON() )
High_Light( DC ); HighLight( DC );
// use this scheme because a pad is a higher priority than a track in the // use this scheme because a pad is a higher priority than a track in the
// search, and finding a pad, instead of a track on a pad, // search, and finding a pad, instead of a track on a pad,
...@@ -147,7 +162,7 @@ int PCB_EDIT_FRAME::Select_High_Light( wxDC* DC ) ...@@ -147,7 +162,7 @@ int PCB_EDIT_FRAME::Select_High_Light( wxDC* DC )
if( netcode >= 0 ) if( netcode >= 0 )
{ {
GetBoard()->SetHighLightNet( netcode ); GetBoard()->SetHighLightNet( netcode );
High_Light( DC ); HighLight( DC );
} }
...@@ -155,12 +170,7 @@ int PCB_EDIT_FRAME::Select_High_Light( wxDC* DC ) ...@@ -155,12 +170,7 @@ int PCB_EDIT_FRAME::Select_High_Light( wxDC* DC )
} }
/* void PCB_EDIT_FRAME::HighLight( wxDC* DC )
* Highlight command.
*
* Show or removes the net at the current cursor position.
*/
void PCB_EDIT_FRAME::High_Light( wxDC* DC )
{ {
if( GetBoard()->IsHighLightNetON() ) if( GetBoard()->IsHighLightNetON() )
GetBoard()->HighLightOFF(); GetBoard()->HighLightOFF();
......
/*
* 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) 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
*/
/** /**
* @file move_or_drag_track.cpp * @file move_or_drag_track.cpp
* @brief Track editing routines to move and drag track segments or node. * @brief Track editing routines to move and drag track segments or node.
...@@ -143,7 +168,7 @@ static void Show_MoveNode( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPo ...@@ -143,7 +168,7 @@ static void Show_MoveNode( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPo
TRACK* Track; TRACK* Track;
BASE_SCREEN* screen = aPanel->GetScreen(); BASE_SCREEN* screen = aPanel->GetScreen();
int track_fill_copy = DisplayOpt.DisplayPcbTrackFill; int track_fill_copy = DisplayOpt.DisplayPcbTrackFill;
int draw_mode = GR_XOR | GR_SURBRILL; int draw_mode = GR_XOR | GR_HIGHLIGHT;
DisplayOpt.DisplayPcbTrackFill = false; DisplayOpt.DisplayPcbTrackFill = false;
...@@ -286,7 +311,7 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( EDA_DRAW_PANEL* aPanel, wxDC ...@@ -286,7 +311,7 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( EDA_DRAW_PANEL* aPanel, wxDC
} }
} }
int draw_mode = GR_XOR | GR_SURBRILL; int draw_mode = GR_XOR | GR_HIGHLIGHT;
/* Undraw the current moved track segments before modification*/ /* Undraw the current moved track segments before modification*/
...@@ -664,7 +689,7 @@ void PCB_EDIT_FRAME::StartMoveOneNodeOrSegment( TRACK* aTrack, wxDC* aDC, int aC ...@@ -664,7 +689,7 @@ void PCB_EDIT_FRAME::StartMoveOneNodeOrSegment( TRACK* aTrack, wxDC* aDC, int aC
GetBoard()->PushHighLight(); GetBoard()->PushHighLight();
if( GetBoard()->IsHighLightNetON() ) if( GetBoard()->IsHighLightNetON() )
High_Light( aDC ); HighLight( aDC );
PosInit = GetScreen()->GetCrossHairPosition(); PosInit = GetScreen()->GetCrossHairPosition();
...@@ -895,7 +920,7 @@ void PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC ...@@ -895,7 +920,7 @@ void PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC
GetBoard()->PushHighLight(); GetBoard()->PushHighLight();
if( GetBoard()->IsHighLightNetON() ) if( GetBoard()->IsHighLightNetON() )
High_Light( DC ); HighLight( DC );
EraseDragList(); EraseDragList();
...@@ -988,7 +1013,7 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ) ...@@ -988,7 +1013,7 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
} }
} }
int draw_mode = GR_OR | GR_SURBRILL; int draw_mode = GR_OR | GR_HIGHLIGHT;
// DRC Ok: place track segments // DRC Ok: place track segments
Track->m_Flags = 0; Track->m_Flags = 0;
...@@ -1028,7 +1053,7 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ) ...@@ -1028,7 +1053,7 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
s_ItemsListPicker.ClearItemsList(); // s_ItemsListPicker is no more owner of picked items s_ItemsListPicker.ClearItemsList(); // s_ItemsListPicker is no more owner of picked items
if( GetBoard()->IsHighLightNetON() ) if( GetBoard()->IsHighLightNetON() )
High_Light( DC ); HighLight( DC );
GetBoard()->PopHighLight(); GetBoard()->PopHighLight();
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 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
*/
/** /**
* @file pcbnew/onleftclick.cpp * @file pcbnew/onleftclick.cpp
* @brief Functions called when the left button is clicked or double clicked. * @brief Functions called when the left button is clicked or double clicked.
...@@ -156,12 +181,14 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -156,12 +181,14 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
case ID_PCB_HIGHLIGHT_BUTT: case ID_PCB_HIGHLIGHT_BUTT:
{ {
int netcode = Select_High_Light( aDC ); int netcode = SelectHighLight( aDC );
if( netcode < 0 ) if( netcode < 0 )
GetBoard()->DisplayInfo( this ); GetBoard()->DisplayInfo( this );
else else
{ {
NETINFO_ITEM* net = GetBoard()->FindNet( netcode ); NETINFO_ITEM* net = GetBoard()->FindNet( netcode );
if( net ) if( net )
net->DisplayInfo( this ); net->DisplayInfo( this );
} }
...@@ -174,6 +201,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -174,6 +201,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( DrawStruct ) if( DrawStruct )
SendMessageToEESCHEMA( DrawStruct ); SendMessageToEESCHEMA( DrawStruct );
break; break;
case ID_PCB_MIRE_BUTT: case ID_PCB_MIRE_BUTT:
......
/*
* 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) 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
*/
/** /**
* @file solve.cpp * @file solve.cpp
*/ */
...@@ -301,8 +326,8 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) ...@@ -301,8 +326,8 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides )
segm_fY, segm_fY,
0, 0,
WHITE | GR_XOR ); WHITE | GR_XOR );
pt_cur_ch->m_PadStart->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); pt_cur_ch->m_PadStart->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT );
pt_cur_ch->m_PadEnd->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); pt_cur_ch->m_PadEnd->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT );
success = Autoroute_One_Track( this, success = Autoroute_One_Track( this,
DC, DC,
......
/*
* 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) 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
*/
/** /**
* @file tr_modif.cpp * @file tr_modif.cpp
* @brief Trace editing. * @brief Trace editing.
...@@ -213,7 +238,7 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, ...@@ -213,7 +238,7 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC,
/* Marked track can be erased. */ /* Marked track can be erased. */
TRACK* NextS; TRACK* NextS;
DrawTraces( DrawPanel, aDC, pt_del, nb_segm, GR_XOR | GR_SURBRILL ); DrawTraces( DrawPanel, aDC, pt_del, nb_segm, GR_XOR | GR_HIGHLIGHT );
for( jj = 0; jj < nb_segm; jj++, pt_del = NextS ) for( jj = 0; jj < nb_segm; jj++, pt_del = NextS )
{ {
......
/*
* 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) 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
*/
/** /**
* @file tracepcb.cpp * @file tracepcb.cpp
* @brief Functions to redraw the current board. * @brief Functions to redraw the current board.
...@@ -89,7 +114,7 @@ void PCB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -89,7 +114,7 @@ void PCB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawGeneralRatsnest( DC ); DrawGeneralRatsnest( DC );
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
if(IsShown()) if( IsShown() )
{ {
DrawPanel->m_overlay.Reset(); DrawPanel->m_overlay.Reset();
wxDCOverlay overlaydc( DrawPanel->m_overlay, (wxWindowDC*)DC ); wxDCOverlay overlaydc( DrawPanel->m_overlay, (wxWindowDC*)DC );
...@@ -212,9 +237,9 @@ void BOARD::DrawHighLight( EDA_DRAW_PANEL* aDrawPanel, wxDC* DC, int aNetCode ) ...@@ -212,9 +237,9 @@ void BOARD::DrawHighLight( EDA_DRAW_PANEL* aDrawPanel, wxDC* DC, int aNetCode )
int draw_mode; int draw_mode;
if( IsHighLightNetON() ) if( IsHighLightNetON() )
draw_mode = GR_SURBRILL | GR_OR; draw_mode = GR_HIGHLIGHT | GR_OR;
else else
draw_mode = GR_AND | GR_SURBRILL; draw_mode = GR_AND | GR_HIGHLIGHT;
// Redraw ZONE_CONTAINERS // Redraw ZONE_CONTAINERS
BOARD::ZONE_CONTAINERS& zones = m_ZoneDescriptorList; BOARD::ZONE_CONTAINERS& zones = m_ZoneDescriptorList;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment