Commit d2eac37d authored by stambaughw's avatar stambaughw

Comment translation complete, Yeah!!!!

parent 8d8bdc3e
...@@ -136,7 +136,7 @@ static void TriPinsModule( COMPONENT* CurrentCmp ) ...@@ -136,7 +136,7 @@ static void TriPinsModule( COMPONENT* CurrentCmp )
} }
/* **** JP translate **** /* ???
* *
* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet * Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
* suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999 * suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999
......
...@@ -162,7 +162,7 @@ void WriteFootprintFilterInfos( FILE* file, COMPONENT_LIST& list ) ...@@ -162,7 +162,7 @@ void WriteFootprintFilterInfos( FILE* file, COMPONENT_LIST& list )
} }
/* *** JP translate *** /* ???
* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet * Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
* suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999 * suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999
*/ */
......
...@@ -377,7 +377,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) ...@@ -377,7 +377,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
case BLOCK_DRAG: /* move to Drag */ case BLOCK_DRAG: /* move to Drag */
/* *JP translate* /* ???
* Effacement de la liste des structures de pointage, * Effacement de la liste des structures de pointage,
* qui est devenue erronnee * qui est devenue erronnee
*/ */
......
...@@ -145,7 +145,8 @@ void BreakSegment( SCH_SCREEN* aScreen, wxPoint aBreakpoint ) ...@@ -145,7 +145,8 @@ void BreakSegment( SCH_SCREEN* aScreen, wxPoint aBreakpoint )
if( !TestSegmentHit( aBreakpoint, segment->m_Start, segment->m_End, 0 ) ) if( !TestSegmentHit( aBreakpoint, segment->m_Start, segment->m_End, 0 ) )
continue; continue;
/* * JP translate * Segment connecte: doit etre coupe en 2 si px,py /* ???
* Segment connecte: doit etre coupe en 2 si px,py
* n'est * n'est
* pas une extremite */ * pas une extremite */
if( ( segment->m_Start == aBreakpoint ) if( ( segment->m_Start == aBreakpoint )
......
...@@ -891,8 +891,7 @@ static void PointToPointConnect( NETLIST_OBJECT* Ref, int IsBus, int start ) ...@@ -891,8 +891,7 @@ static void PointToPointConnect( NETLIST_OBJECT* Ref, int IsBus, int start )
* Search if a junction is connected to segments and include the Netcode * Search if a junction is connected to segments and include the Netcode
* objects connect to the junction. * objects connect to the junction.
* The junction must have a valid Netcode * The junction must have a valid Netcode
* The list of objects is SUPPOSED class by NumSheet *JP translate* * The list of objects is SUPPOSED class by NumSheet ??? Croissants,
* Croissants,
* And research is done from the start element, 1st element * And research is done from the start element, 1st element
* Leaf schema * Leaf schema
* (There can be no physical connection between elements of different sheets) * (There can be no physical connection between elements of different sheets)
......
/************************************************************/ /******************************************/
/* appl_wxstruct.h: */ /* appl_wxstruct.h */
/* descriptions des principales classes derivees utilisees: */ /* Base application class implementation. */
/* Class "EDA_Appl: classe de l'application generale */ /******************************************/
/************************************************************/
/* Ce fichier doit etre inclus dans "wxstruct.h"
*/
#ifndef APPL_WXSTRUCT_H #ifndef APPL_WXSTRUCT_H
#define APPL_WXSTRUCT_H #define APPL_WXSTRUCT_H
...@@ -39,10 +35,12 @@ class wxHtmlHelpController; ...@@ -39,10 +35,12 @@ class wxHtmlHelpController;
class WinEDA_App : public wxApp class WinEDA_App : public wxApp
{ {
public: public:
id_app_type m_Id; /* Used mainly to handle default paths libs id_app_type m_Id; /* Used mainly to handle
* m_Id = APP_TYPE_EESCHEMA, APP_TYPE_PCBNEW ... * default paths libs
*/ * m_Id = APP_TYPE_EESCHEMA,
wxString m_Project; * APP_TYPE_PCBNEW ...
*/
wxString m_Project;
wxSingleInstanceChecker* m_Checker; wxSingleInstanceChecker* m_Checker;
wxPoint m_HelpPos; wxPoint m_HelpPos;
...@@ -53,32 +51,30 @@ public: ...@@ -53,32 +51,30 @@ public:
wxFileConfig* m_ProjectConfig; wxFileConfig* m_ProjectConfig;
wxString m_HelpFileName; wxString m_HelpFileName;
wxString m_EditorName; wxString m_EditorName;
wxString m_CurrentOptionFile; // dernier fichier .cnf utilis wxString m_CurrentOptionFile;
wxString m_CurrentOptionFileDateAndTime; wxString m_CurrentOptionFileDateAndTime;
wxString m_BinDir; /* Chemin ou reside l'executable wxString m_BinDir; /* Kicad executable path.*/
* (utilis si KICAD non dfini)*/ wxString m_KicadEnv; /* environment variable KICAD */
wxString m_KicadEnv; /* Chemin de kicad dfini dans la bool m_Env_Defined; // TRUE if environment KICAD is
* variable d'environnement KICAD, // defined.
* typiquement /usr/local/kicad ou
* c:\kicad */ wxLocale* m_Locale; // The current locale.
bool m_Env_Defined; // TRUE si variable d'environnement KICAD definie int m_LanguageId; // The current language setting.
wxString m_PdfBrowser; // Name of the selected browser,
wxLocale* m_Locale; // Gestion de la localisation // for browsing pdf datasheets
int m_LanguageId; // indicateur de choix du langage ( 0 = defaut) bool m_PdfBrowserIsDefault; // True if the pdf browser is the
wxString m_PdfBrowser; // Name of the selected browser, for browsing pdf datasheets // default (m_PdfBrowser not used)
bool m_PdfBrowserIsDefault; // True if the pdf browser is the default (m_PdfBrowser not used) wxPathList m_searchPaths;
wxPathList m_searchPaths; wxFileHistory m_fileHistory;
wxFileHistory m_fileHistory;
protected: protected:
wxString m_Title; wxString m_Title;
wxPathList m_libSearchPaths; wxPathList m_libSearchPaths;
wxFileName m_projectFileName; wxFileName m_projectFileName;
wxString m_LastVisitedLibPath; wxString m_LastVisitedLibPath;
public: public: WinEDA_App();
WinEDA_App();
~WinEDA_App(); ~WinEDA_App();
bool OnInit(); bool OnInit();
int OnRun(); int OnRun();
...@@ -87,15 +83,16 @@ public: ...@@ -87,15 +83,16 @@ public:
void SetDefaultSearchPaths( void ); void SetDefaultSearchPaths( void );
/** Function InitEDA_Appl /** Function InitEDA_Appl
* initialise some general parameters * initialize some general parameters
* - Default paths (help, libs, bin)and configuration files names * - Default paths (help, libs, bin)and configuration files names
* - Language and locale * - Language and locale
* - fonts * - fonts
* @param aName : used as paths in configuration files * @param aName : used as paths in configuration files
* @param aId = flag : LIBRARY_TYPE_EESCHEMA or LIBRARY_TYPE_PCBNEW * @param aId = flag : LIBRARY_TYPE_EESCHEMA or LIBRARY_TYPE_PCBNEW
* used to choose what default library path must be used * used to choose what default library path must be used
*/ */
void InitEDA_Appl( const wxString& aName, id_app_type aId = APP_TYPE_UNKOWN); void InitEDA_Appl( const wxString& aName,
id_app_type aId = APP_TYPE_UNKOWN );
bool SetLanguage( bool first_time = FALSE ); bool SetLanguage( bool first_time = FALSE );
...@@ -104,8 +101,9 @@ public: ...@@ -104,8 +101,9 @@ public:
* Create menu list for language choice, and add it as submenu to a main * Create menu list for language choice, and add it as submenu to a main
* menu * menu
* *
* @param MasterMenu : The main menu. The sub menu list will be accessible * @param MasterMenu : The main menu. The sub menu list will be
* from the menu item with id ID_LANGUAGE_CHOICE * accessible from the menu item with id
* ID_LANGUAGE_CHOICE
* *
* @return the sub menu Language list * @return the sub menu Language list
*/ */
...@@ -114,13 +112,13 @@ public: ...@@ -114,13 +112,13 @@ public:
void SetLanguagePath( void ); void SetLanguagePath( void );
void InitOnLineHelp(); void InitOnLineHelp();
// Sauvegarde de configurations et options:
/** Function GetSettings /** Function GetSettings
* Get application settings * Get application settings
* @param aReopenLastUsedDirectory = true to switch to last opened directory, false to use current CWD * @param aReopenLastUsedDirectory = true to switch to last opened
* directory, false to use current CWD
* @return none * @return none
*/ */
void GetSettings(bool aReopenLastUsedDirectory); void GetSettings( bool aReopenLastUsedDirectory );
void SaveSettings(); void SaveSettings();
...@@ -133,7 +131,8 @@ public: ...@@ -133,7 +131,8 @@ public:
/** Function SaveCurrentSetupValues() /** Function SaveCurrentSetupValues()
* Save the current setup values in m_EDA_Config * Save the current setup values in m_EDA_Config
* saved parameters are parameters that have the .m_Setup member set to true * saved parameters are parameters that have the .m_Setup member set to
* true
* @param aList = array of PARAM_CFG_BASE pointers * @param aList = array of PARAM_CFG_BASE pointers
*/ */
void SaveCurrentSetupValues( PARAM_CFG_BASE** aList ); void SaveCurrentSetupValues( PARAM_CFG_BASE** aList );
...@@ -141,20 +140,21 @@ public: ...@@ -141,20 +140,21 @@ public:
/** Function ReadCurrentSetupValues() /** Function ReadCurrentSetupValues()
* Raed the current setup values previously saved, from m_EDA_Config * Raed the current setup values previously saved, from m_EDA_Config
* saved parameters are parameters that have the .m_Setup member set to true * saved parameters are parameters that have the .m_Setup member set to
* true
* @param aList = array of PARAM_CFG_BASE pointers * @param aList = array of PARAM_CFG_BASE pointers
*/ */
void ReadCurrentSetupValues( PARAM_CFG_BASE** aList ); void ReadCurrentSetupValues( PARAM_CFG_BASE** aList );
void ReadCurrentSetupValues( PARAM_CFG_ARRAY& List ); void ReadCurrentSetupValues( PARAM_CFG_ARRAY& List );
bool ReadProjectConfig( const wxString& local_config_filename, bool ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
PARAM_CFG_BASE** List, PARAM_CFG_BASE** List,
bool Load_Only_if_New ); bool Load_Only_if_New );
bool ReadProjectConfig( const wxString& local_config_filename, bool ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
PARAM_CFG_ARRAY& List, PARAM_CFG_ARRAY& List,
bool Load_Only_if_New ); bool Load_Only_if_New );
bool ReCreatePrjConfig( const wxString& local_config_filename, bool ReCreatePrjConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
bool ForceUseLocalConfig ); bool ForceUseLocalConfig );
...@@ -188,33 +188,37 @@ public: ...@@ -188,33 +188,37 @@ public:
return FindLibraryPath( fileName.GetFullPath() ); return FindLibraryPath( fileName.GetFullPath() );
} }
/** ReturnLastVisitedLibraryPath /** ReturnLastVisitedLibraryPath
* Returns the last visited library directory, or (if void) the first * Returns the last visited library directory, or (if void) the first
* path in lib path list ( but not the CWD ) * path in lib path list ( but not the CWD )
* @param aSubPathToSearch = Prefered sub path to search in path list * @param aSubPathToSearch = Preferred sub path to search in path list
*/ */
wxString ReturnLastVisitedLibraryPath( const wxString & aSubPathToSearch = wxEmptyString); wxString ReturnLastVisitedLibraryPath(
void SaveLastVisitedLibraryPath( const wxString & aPath); const wxString& aSubPathToSearch = wxEmptyString );
void SaveLastVisitedLibraryPath( const wxString& aPath );
/** ReturnFilenameWithRelativePathInLibPath /** ReturnFilenameWithRelativePathInLibPath
* @return a short filename (with extension) with only a relative path if this filename * @return a short filename (with extension) with only a relative path if
* can be found in library paths * this filename can be found in library paths
* @param aFullFilename = filename with path and extension. * @param aFullFilename = filename with path and extension.
*/ */
wxString ReturnFilenameWithRelativePathInLibPath(const wxString & aFullFilename); wxString ReturnFilenameWithRelativePathInLibPath(
const wxString& aFullFilename );
/** Function RemoveLibraryPath /** Function RemoveLibraryPath
* Removes the given path(s) from the library path list * Removes the given path(s) from the library path list
* @param aPaths = path or path list to remove. paths must be separated by ";" * @param aPaths = path or path list to remove. paths must be separated by
* ";"
*/ */
void RemoveLibraryPath( const wxString& aPaths ); void RemoveLibraryPath( const wxString& aPaths );
/** Function InsertLibraryPath /** Function InsertLibraryPath
* insert path(s) int lib paths list. * insert path(s) int lib paths list.
* @param aPaths = path or path list to add. paths must be separated by ";" * @param aPaths = path or path list to add. paths must be separated by ";"
* @param aIndex = insertion point * @param aIndex = insertion point
*/ */
void InsertLibraryPath( const wxString& aPaths, size_t aIndex ); void InsertLibraryPath( const wxString& aPaths, size_t aIndex );
}; };
/* /*
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
#include "colors.h" #include "colors.h"
#if defined (DEBUG) #if defined(DEBUG)
#include <iostream> // needed for Show() #include <iostream> // needed for Show()
extern std::ostream& operator <<( std::ostream& out, const wxSize& size ); extern std::ostream& operator <<( std::ostream& out, const wxSize& size );
extern std::ostream& operator <<( std::ostream& out, const wxPoint& pt ); extern std::ostream& operator <<( std::ostream& out, const wxPoint& pt );
#endif #endif
...@@ -35,7 +35,8 @@ enum KICAD_T { ...@@ -35,7 +35,8 @@ enum KICAD_T {
TYPE_EDGE_MODULE, // a footprint edge TYPE_EDGE_MODULE, // a footprint edge
TYPE_TRACK, // a track segment (segment on a copper layer) TYPE_TRACK, // a track segment (segment on a copper layer)
TYPE_VIA, // a via (like atrack segment on a copper layer) TYPE_VIA, // a via (like atrack segment on a copper layer)
TYPE_ZONE, // a segment used to fill a zome area (segment on a copper layer) TYPE_ZONE, // a segment used to fill a zone area (segment on a
// copper layer)
TYPE_MARKER_PCB, // a marker used to show something TYPE_MARKER_PCB, // a marker used to show something
TYPE_COTATION, // a dimension (graphic item) TYPE_COTATION, // a dimension (graphic item)
TYPE_MIRE, // a target (graphic item) TYPE_MIRE, // a target (graphic item)
...@@ -123,7 +124,8 @@ public: ...@@ -123,7 +124,8 @@ public:
/** /**
* Function Inspect * Function Inspect
* is the examining function within the INSPECTOR which is passed to the * is the examining function within the INSPECTOR which is passed to the
* Iterate function. It is used primarily for searching, but not limited to * Iterate function. It is used primarily for searching, but not limited
*to
* that. It can also collect or modify the scanned objects. * that. It can also collect or modify the scanned objects.
* *
* @param testItem An EDA_BaseStruct to examine. * @param testItem An EDA_BaseStruct to examine.
...@@ -132,8 +134,8 @@ public: ...@@ -132,8 +134,8 @@ public:
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan, * @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* else SCAN_CONTINUE; * else SCAN_CONTINUE;
*/ */
SEARCH_RESULT virtual Inspect( EDA_BaseStruct * testItem, SEARCH_RESULT virtual Inspect( EDA_BaseStruct* testItem,
const void* testData ) = 0; const void* testData ) = 0;
}; };
...@@ -153,18 +155,20 @@ public: ...@@ -153,18 +155,20 @@ public:
EDA_Rect() { }; EDA_Rect() { };
EDA_Rect( const wxPoint& aPos, const wxSize& aSize ) : EDA_Rect( const wxPoint& aPos, const wxSize& aSize ) :
m_Pos( aPos ) m_Pos( aPos ),
, m_Size( aSize ) m_Size( aSize )
{ } { }
wxPoint Centre() wxPoint Centre()
{ {
return wxPoint( m_Pos.x + (m_Size.x >> 1), m_Pos.y + (m_Size.y >> 1) ); return wxPoint( m_Pos.x + ( m_Size.x >> 1 ),
m_Pos.y + ( m_Size.y >> 1 ) );
} }
void Normalize(); // Ensure the height and width are >= 0 void Normalize(); // Ensure the height and width are
bool Inside( const wxPoint& point ); // Return TRUE if point is in Rect // >= 0
bool Inside( const wxPoint& point ); // Return TRUE if point is in Rect
bool Inside( int x, int y ) { return Inside( wxPoint( x, y ) ); } bool Inside( int x, int y ) { return Inside( wxPoint( x, y ) ); }
wxSize GetSize() { return m_Size; } wxSize GetSize() { return m_Size; }
...@@ -182,7 +186,8 @@ public: ...@@ -182,7 +186,8 @@ public:
void SetSize( const wxSize& size ) { m_Size = size; } void SetSize( const wxSize& size ) { m_Size = size; }
void SetSize( int w, int h ) { m_Size.x = w; m_Size.y = h; } void SetSize( int w, int h ) { m_Size.x = w; m_Size.y = h; }
void Offset( int dx, int dy ) { m_Pos.x += dx; m_Pos.y += dy; } void Offset( int dx, int dy ) { m_Pos.x += dx; m_Pos.y += dy; }
void Offset( const wxPoint& offset ) { m_Pos.x += offset.x; m_Pos.y += offset.y; } void Offset( const wxPoint& offset ) { m_Pos.x += offset.x; m_Pos.y +=
offset.y; }
void SetX( int val ) { m_Pos.x = val; } void SetX( int val ) { m_Pos.x = val; }
void SetY( int val ) { m_Pos.y = val; } void SetY( int val ) { m_Pos.y = val; }
void SetWidth( int val ) { m_Size.x = val; } void SetWidth( int val ) { m_Size.x = val; }
...@@ -208,27 +213,27 @@ public: ...@@ -208,27 +213,27 @@ public:
operator wxRect() const { return wxRect( m_Pos, m_Size ); } operator wxRect() const { return wxRect( m_Pos, m_Size ); }
/** Inflate /** Inflate
* Inflate this object: move each horizontal edge by dx and each vertical edge by dy * Inflate this object: move each horizontal edge by dx and each vertical
* toward rect outside * edge by dy toward rect outside
* if dx and/or dy is negative, move toward rect inside (deflate) * if dx and/or dy is negative, move toward rect inside (deflate)
* Works for positive and negative rect size * Works for positive and negative rect size
*/ */
EDA_Rect& Inflate( wxCoord dx, wxCoord dy ); EDA_Rect& Inflate( wxCoord dx, wxCoord dy );
/** Inflate /** Inflate
* Inflate this object: move each horizontal edge and each vertical edge by aDelta * Inflate this object: move each horizontal edge and each vertical edge by
* toward rect outside * aDelta toward rect outside
* if aDelta is negative, move toward rect inside (deflate) * if aDelta is negative, move toward rect inside (deflate)
* Works for positive and negative rect size * Works for positive and negative rect size
*/ */
EDA_Rect& Inflate( int aDelta ); EDA_Rect& Inflate( int aDelta );
/** Function Merge /** Function Merge
* Modify Position and Size of this in order to contain the given rect * Modify Position and Size of this in order to contain the given rect
* mainly used to calculate bounding boxes * mainly used to calculate bounding boxes
* @param aRect = given rect to merge with this * @param aRect = given rect to merge with this
*/ */
void Merge( const EDA_Rect& aRect ); void Merge( const EDA_Rect& aRect );
}; };
...@@ -240,28 +245,40 @@ class DHEAD; ...@@ -240,28 +245,40 @@ class DHEAD;
/** /**
* Class EDA_BaseStruct * Class EDA_BaseStruct
* is a base class for most all the kicad significant classes, used in schematics and boards. * is a base class for most all the kicad significant classes, used in
* schematics and boards.
*/ */
// These define are used for the .m_Flags and .m_UndoRedoStatus member of the class EDA_BaseStruct
#define IS_CHANGED (1 << 0) // These define are used for the .m_Flags and .m_UndoRedoStatus member of the
#define IS_LINKED (1 << 1) // class EDA_BaseStruct
#define IN_EDIT (1 << 2) #define IS_CHANGED (1 << 0)
#define IS_MOVED (1 << 3) #define IS_LINKED (1 << 1)
#define IS_NEW (1 << 4) #define IN_EDIT (1 << 2)
#define IS_RESIZED (1 << 5) #define IS_MOVED (1 << 3)
#define IS_DRAGGED (1 << 6) #define IS_NEW (1 << 4)
#define IS_DELETED (1 << 7) #define IS_RESIZED (1 << 5)
#define IS_WIRE_IMAGE (1 << 8) #define IS_DRAGGED (1 << 6)
#define STARTPOINT (1 << 9) #define IS_DELETED (1 << 7)
#define ENDPOINT (1 << 10) #define IS_WIRE_IMAGE (1 << 8)
#define SELECTED (1 << 11) #define STARTPOINT (1 << 9)
#define SELECTEDNODE (1 << 12) ///< flag indiquant que la structure a deja selectionnee #define ENDPOINT (1 << 10)
#define STRUCT_DELETED (1 << 13) ///< Bit flag de Status pour structures effacee #define SELECTED (1 << 11)
#define CANDIDATE (1 << 14) ///< flag indiquant que la structure est connectee #define SELECTEDNODE (1 << 12) ///< flag indicating that the structure
#define SKIP_STRUCT (1 << 15) ///< flag indiquant que la structure ne doit pas etre traitee // has already selected
#define DO_NOT_DRAW (1 << 16) ///< Used to disable draw function
#define DRAW_ERASED (1 << 17) ///< draw in background color, used by classs TRACK in gerbview #define STRUCT_DELETED (1 << 13) ///< flag indication structures to be
#define IS_CANCELLED (1 << 18) ///< flag set when edit dialogs are canceled when editing a new object // erased
#define CANDIDATE (1 << 14) ///< flag indicating that the structure
// is connected
#define SKIP_STRUCT (1 << 15) ///< flag indicating that the structure
// should be ignored
#define DO_NOT_DRAW (1 << 16) ///< Used to disable draw function
#define DRAW_ERASED (1 << 17) ///< draw in background color, used by
// class TRACK in gerbview
#define IS_CANCELLED (1 << 18) ///< flag set when edit dialogs are
// canceled when editing a new object
class EDA_BaseStruct class EDA_BaseStruct
{ {
...@@ -269,26 +286,29 @@ private: ...@@ -269,26 +286,29 @@ private:
/** /**
* Run time identification, _keep private_ so it can never be changed after * Run time identification, _keep private_ so it can never be changed after
* a constructor sets it. See comment near SetType() regarding virtual functions. * a constructor sets it. See comment near SetType() regarding virtual
*functions.
*/ */
KICAD_T m_StructType; KICAD_T m_StructType;
protected: protected:
EDA_BaseStruct* Pnext; /* Linked list: Link (next struct) */ EDA_BaseStruct* Pnext; /* Linked list: Link (next struct) */
EDA_BaseStruct* Pback; /* Linked list: Link (previous struct) */ EDA_BaseStruct* Pback; /* Linked list: Link (previous struct) */
EDA_BaseStruct* m_Parent; /* Linked list: Link (parent struct) */ EDA_BaseStruct* m_Parent; /* Linked list: Link (parent struct) */
EDA_BaseStruct* m_Son; /* Linked list: Link (son struct) */ EDA_BaseStruct* m_Son; /* Linked list: Link (son struct) */
DHEAD* m_List; ///< which DLIST I am on. DHEAD* m_List; ///< which DLIST I am on.
public: public:
int m_Flags; // flags for editing and other uses. int m_Flags; // flags for editing and other uses.
unsigned long m_TimeStamp; // Time stamp used for logical links unsigned long m_TimeStamp; // Time stamp used for logical links
int m_Selected; /* Used by block commands, and selective editing */ int m_Selected; /* Used by block commands, and selective
* editing */
// member used in undo/redo function // member used in undo/redo function
EDA_BaseStruct* m_Image; // Link to an image copy to save a copy of old parmeters values EDA_BaseStruct* m_Image; // Link to an image copy to save a copy of
// old parameters values
private: private:
int m_Status; int m_Status;
...@@ -306,8 +326,8 @@ public: ...@@ -306,8 +326,8 @@ public:
/** /**
* Function Type * Function Type
* returns the type of object. This attribute should never be changed after * returns the type of object. This attribute should never be changed
* a constructor sets it, so there is no public "setter" method. * after a constructor sets it, so there is no public "setter" method.
* @return KICAD_T - the type of object. * @return KICAD_T - the type of object.
*/ */
KICAD_T Type() const { return m_StructType; } KICAD_T Type() const { return m_StructType; }
...@@ -325,7 +345,6 @@ public: ...@@ -325,7 +345,6 @@ public:
void SetSon( EDA_BaseStruct* aSon ) { m_Son = aSon; } void SetSon( EDA_BaseStruct* aSon ) { m_Son = aSon; }
void SetList( DHEAD* aList ) { m_List = aList; } void SetList( DHEAD* aList ) { m_List = aList; }
/* Gestion de l'etat (status) de la structure (active, deleted..) */
int GetState( int type ) const int GetState( int type ) const
{ {
...@@ -352,8 +371,8 @@ public: ...@@ -352,8 +371,8 @@ public:
/** /**
* Function DisplayInfo * Function DisplayInfo
* has knowledge about the frame and how and where to put status information * has knowledge about the frame and how and where to put status
* about this object into the frame's message panel. * information about this object into the frame's message panel.
* @param frame A WinEDA_DrawFrame in which to print status information. * @param frame A WinEDA_DrawFrame in which to print status information.
*/ */
virtual void DisplayInfo( WinEDA_DrawFrame* frame ) virtual void DisplayInfo( WinEDA_DrawFrame* frame )
...@@ -375,7 +394,7 @@ public: ...@@ -375,7 +394,7 @@ public:
/** /**
* Function HitTest (overlayed) * Function HitTest (overlaid)
* tests if the given EDA_Rect intersect this object. * tests if the given EDA_Rect intersect this object.
* For now, an ending point must be inside this rect. * For now, an ending point must be inside this rect.
* @param refArea : the given EDA_Rect * @param refArea : the given EDA_Rect
...@@ -389,19 +408,23 @@ public: ...@@ -389,19 +408,23 @@ public:
/** /**
* Function GetBoundingBox * Function GetBoundingBox
* returns the orthogonal, bounding box of this object for display purposes. * returns the orthogonal, bounding box of this object for display
* purposes.
* This box should be an enclosing perimeter for visible components of this * This box should be an enclosing perimeter for visible components of this
* object, and the units should be in the pcb or schematic coordinate system. * object, and the units should be in the pcb or schematic coordinate
* system.
* It is OK to overestimate the size by a few counts. * It is OK to overestimate the size by a few counts.
*/ */
virtual EDA_Rect GetBoundingBox() virtual EDA_Rect GetBoundingBox()
{ {
#if defined (DEBUG) #if defined(DEBUG)
printf( "Missing GetBoundingBox()\n" ); printf( "Missing GetBoundingBox()\n" );
Show( 0, std::cout ); // tell me which classes still need GetBoundingBox support Show( 0, std::cout ); // tell me which classes still need
// GetBoundingBox support
#endif #endif
// return a zero-sized box per default. derived classes should override this // return a zero-sized box per default. derived classes should override
// this
return EDA_Rect( wxPoint( 0, 0 ), wxSize( 0, 0 ) ); return EDA_Rect( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
} }
...@@ -423,17 +446,18 @@ public: ...@@ -423,17 +446,18 @@ public:
* @return SEARCH_RESULT - SEARCH_QUIT if the called INSPECTOR returned * @return SEARCH_RESULT - SEARCH_QUIT if the called INSPECTOR returned
* SEARCH_QUIT, else SCAN_CONTINUE; * SEARCH_QUIT, else SCAN_CONTINUE;
*/ */
static SEARCH_RESULT IterateForward( EDA_BaseStruct* listStart, static SEARCH_RESULT IterateForward( EDA_BaseStruct* listStart,
INSPECTOR* inspector, INSPECTOR* inspector,
const void* testData, const void* testData,
const KICAD_T scanTypes[] ); const KICAD_T scanTypes[] );
/** /**
* Function Visit * Function Visit
* may be re-implemented for each derived class in order to handle * may be re-implemented for each derived class in order to handle
* all the types given by its member data. Implementations should call * all the types given by its member data. Implementations should call
* inspector->Inspect() on types in scanTypes[], and may use IterateForward() * inspector->Inspect() on types in scanTypes[], and may use
* IterateForward()
* to do so on lists of such data. * to do so on lists of such data.
* @param inspector An INSPECTOR instance to use in the inspection. * @param inspector An INSPECTOR instance to use in the inspection.
* @param testData Arbitrary data used by the inspector. * @param testData Arbitrary data used by the inspector.
...@@ -442,8 +466,8 @@ public: ...@@ -442,8 +466,8 @@ public:
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan, * @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* else SCAN_CONTINUE, and determined by the inspector. * else SCAN_CONTINUE, and determined by the inspector.
*/ */
virtual SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData, virtual SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData,
const KICAD_T scanTypes[] ); const KICAD_T scanTypes[] );
/** /**
...@@ -457,7 +481,7 @@ public: ...@@ -457,7 +481,7 @@ public:
} }
#if defined (DEBUG) #if defined(DEBUG)
/** /**
* Function Show * Function Show
...@@ -466,7 +490,7 @@ public: ...@@ -466,7 +490,7 @@ public:
* 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 );
/** /**
...@@ -476,7 +500,7 @@ public: ...@@ -476,7 +500,7 @@ public:
* @param os The ostream&, where to output * @param os The ostream&, where to output
* @return std::ostream& - for continuation. * @return std::ostream& - for continuation.
**/ **/
static std::ostream& NestedSpace( int nestLevel, std::ostream& os ); static std::ostream& NestedSpace( int nestLevel, std::ostream& os );
#endif #endif
}; };
...@@ -492,16 +516,17 @@ enum GRTextHorizJustifyType { ...@@ -492,16 +516,17 @@ enum GRTextHorizJustifyType {
enum GRTextVertJustifyType { enum GRTextVertJustifyType {
GR_TEXT_VJUSTIFY_TOP = -1, GR_TEXT_VJUSTIFY_TOP = -1,
GR_TEXT_VJUSTIFY_CENTER = 0, GR_TEXT_VJUSTIFY_CENTER = 0,
GR_TEXT_VJUSTIFY_BOTTOM = 1 GR_TEXT_VJUSTIFY_BOTTOM = 1
}; };
/* Options to show solid segments (segments, texts...) */ /* Options to show solid segments (segments, texts...) */
enum GRTraceMode { enum GRTraceMode {
FILAIRE = 0, // segments are drawn as lines FILAIRE = 0, // segments are drawn as lines
FILLED, // normal mode: segments have thickness FILLED, // normal mode: segments have thickness
SKETCH // skect mode: segments have thickness, but are not filled SKETCH // sketcg mode: segments have thickness, but are not
// filled
}; };
/** /**
...@@ -524,8 +549,8 @@ enum FILL_T { ...@@ -524,8 +549,8 @@ enum FILL_T {
/** /**
* Class EDA_TextStruct * Class EDA_TextStruct
* is a basic class to handle texts (labels, texts on components or footprints ..) * is a basic class to handle texts (labels, texts on components or footprints
* not used directly. * ..) not used directly.
* The text classes are derived from EDA_BaseStruct and EDA_TextStruct * The text classes are derived from EDA_BaseStruct and EDA_TextStruct
*/ */
class EDA_TextStruct class EDA_TextStruct
...@@ -538,12 +563,15 @@ public: ...@@ -538,12 +563,15 @@ public:
int m_Orient; /* Orient in 0.1 degrees */ int m_Orient; /* Orient in 0.1 degrees */
bool m_Mirror; /* Display Normal / mirror */ bool m_Mirror; /* Display Normal / mirror */
int m_Attributs; /* flags (visible...) */ int m_Attributs; /* flags (visible...) */
bool m_Italic; /* true to simulate (or use if exists) an italic font... */ bool m_Italic; /* true to simulate (or use if exists)
* an italic font... */
bool m_Bold; /* true to simulate a bold font ... */ bool m_Bold; /* true to simulate a bold font ... */
GRTextHorizJustifyType m_HJustify; /* Horiz justification */ GRTextHorizJustifyType m_HJustify; /* Horiz justification */
GRTextVertJustifyType m_VJustify; /* Vertical justification */ GRTextVertJustifyType m_VJustify; /* Vertical justification */
bool m_MultilineAllowed; /* true to use multiline option, false to use only single line text bool m_MultilineAllowed; /* true to use multiline option, false
* Single line is faster in calculations than multiline */ * to use only single line text
* Single line is faster in
* calculations than multiline */
public: public:
EDA_TextStruct( const wxString& text = wxEmptyString ); EDA_TextStruct( const wxString& text = wxEmptyString );
...@@ -558,14 +586,16 @@ public: ...@@ -558,14 +586,16 @@ public:
* @param EDA_Colors aColor = text color * @param EDA_Colors aColor = text color
* @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode. * @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
* @param GRTraceMode aDisplay_mode = FILAIRE, FILLED or SKETCH * @param GRTraceMode aDisplay_mode = FILAIRE, FILLED or SKETCH
* @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ). * @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do
* not draw anchor ).
*/ */
void Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, void Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
const wxPoint& aOffset, EDA_Colors aColor, const wxPoint& aOffset, EDA_Colors aColor,
int aDrawMode, GRTraceMode aDisplay_mode = FILAIRE, int aDrawMode, GRTraceMode aDisplay_mode = FILAIRE,
EDA_Colors aAnchor_color = UNSPECIFIED_COLOR ); EDA_Colors aAnchor_color = UNSPECIFIED_COLOR );
private: private:
/** Function DrawOneLineOfText /** Function DrawOneLineOfText
* Draw a single text line. * Draw a single text line.
* Used to draw each line of this EDA_TextStruct, that can be multiline * Used to draw each line of this EDA_TextStruct, that can be multiline
...@@ -575,50 +605,56 @@ private: ...@@ -575,50 +605,56 @@ private:
* @param EDA_Colors aColor = text color * @param EDA_Colors aColor = text color
* @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode. * @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
* @param aFillMode = FILAIRE, FILLED or SKETCH * @param aFillMode = FILAIRE, FILLED or SKETCH
* @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ). * @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do
* not draw anchor ).
* @param EDA_Colors aText = the single line of text to draw. * @param EDA_Colors aText = the single line of text to draw.
* @param EDA_Colors aPos = the position of this line ). * @param EDA_Colors aPos = the position of this line ).
*/ */
void DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC, void DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
const wxPoint& aOffset, EDA_Colors aColor, const wxPoint& aOffset, EDA_Colors aColor,
int aDrawMode, GRTraceMode aFillMode, int aDrawMode, GRTraceMode aFillMode,
EDA_Colors aAnchor_color, wxString& aText, EDA_Colors aAnchor_color, wxString& aText,
wxPoint aPos ); wxPoint aPos );
public: public:
/** /**
* Function TextHitTest * Function TextHitTest
* tests if the given wxPoint is within the bounds of this object. * tests if the given wxPoint is within the bounds of this object.
* @param ref_pos A wxPoint to test * @param ref_pos A wxPoint to test
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool TextHitTest( const wxPoint& ref_pos ); bool TextHitTest( const wxPoint& ref_pos );
/** /**
* Function TextHitTest (overlayed) * Function TextHitTest (overloaded)
* tests if the given EDA_Rect intersect this object. * tests if the given EDA_Rect intersect this object.
* For now, the anchor must be inside this rect. * For now, the anchor must be inside this rect.
* @param refArea : the given EDA_Rect * @param refArea : the given EDA_Rect
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool TextHitTest( EDA_Rect& refArea ); bool TextHitTest( EDA_Rect& refArea );
/** /**
* Function LenSize * Function LenSize
* @return the text lenght in internal units * @return the text length in internal units
* @param aLine : the line of text to consider. * @param aLine : the line of text to consider.
* For single line text, this parameter is always m_Text * For single line text, this parameter is always m_Text
*/ */
int LenSize(const wxString & aLine) const; int LenSize( const wxString& aLine ) const;
/** Function GetTextBox /** Function GetTextBox
* useful in multiline texts to calculate the full text or a line area (for zones filling, locate functions....) * useful in multiline texts to calculate the full text or a line area (for
* @return the rect containing the line of text (i.e. the position and the size of one line) * zones filling, locate functions....)
* this rectangle is calculated for 0 orient text. if orient is not 0 the rect must be rotated to match the physical area * @return the rect containing the line of text (i.e. the position and the
* size of one line)
* this rectangle is calculated for 0 orient text. if orient is not 0 the
* rect must be rotated to match the physical area
* @param aLine : the line of text to consider. * @param aLine : the line of text to consider.
* for single line text, aLine is unused * for single line text, aLine is unused
* If aLine == -1, the full area (considering all lines) is returned * If aLine == -1, the full area (considering all lines) is returned
*/ */
EDA_Rect GetTextBox( int aLine = -1); EDA_Rect GetTextBox( int aLine = -1 );
/** Function GetInterline /** Function GetInterline
* return the distance between 2 text lines * return the distance between 2 text lines
...@@ -626,7 +662,7 @@ public: ...@@ -626,7 +662,7 @@ public:
*/ */
int GetInterline() int GetInterline()
{ {
return (( m_Size.y * 13 ) / 10) + m_Width; return ( ( m_Size.y * 13 ) / 10 ) + m_Width;
} }
}; };
......
// Largeur du toolbar vertical
#define VTOOLBAR_WIDTH 26 #define VTOOLBAR_WIDTH 26
// dimension d'un tool vertical
#define TOOL_SIZE 23 #define TOOL_SIZE 23
// Please keep list sorted alphabetically, ignoring case. // Please keep list sorted alphabetically, ignoring case.
......
/** /**
* This file is part of the common libary. * This file is part of the common library.
* @file block_commande.h * @file block_commande.h
* @see common.h * @see common.h
*/ */
...@@ -18,19 +18,22 @@ ...@@ -18,19 +18,22 @@
/**************************/ /**************************/
/* class BLOCK_SELECTOR */ /* class BLOCK_SELECTOR */
/**************************/ /**************************/
/** /**
* class BLOCK_SELECTOR is used to handle block selection and commands * class BLOCK_SELECTOR is used to handle block selection and commands
*/ */
/* Block state codes. */
typedef enum { typedef enum {
/* definition de l'etat du block */ STATE_NO_BLOCK,
STATE_NO_BLOCK, /* Block non initialise */ STATE_BLOCK_INIT,
STATE_BLOCK_INIT, /* Block initialise: 1er point defini */ STATE_BLOCK_END,
STATE_BLOCK_END, /* Block initialise: 2eme point defini */ STATE_BLOCK_MOVE,
STATE_BLOCK_MOVE, /* Block en deplacement */ STATE_BLOCK_STOP
STATE_BLOCK_STOP /* Block fixe (fin de deplacement) */
} BlockState; } BlockState;
/* codes des differentes commandes sur block: */
/* Block command codes. */
typedef enum { typedef enum {
BLOCK_IDLE, BLOCK_IDLE,
BLOCK_MOVE, BLOCK_MOVE,
...@@ -53,45 +56,56 @@ typedef enum { ...@@ -53,45 +56,56 @@ typedef enum {
class BLOCK_SELECTOR : public EDA_BaseStruct, public EDA_Rect class BLOCK_SELECTOR : public EDA_BaseStruct, public EDA_Rect
{ {
public: public:
BlockState m_State; /* Stae (enum BlockState) of the block */ BlockState m_State; /* State (enum BlockState)
CmdBlockType m_Command; /* Type (enum CmdBlockType) d'operation */ * of the block */
PICKED_ITEMS_LIST m_ItemsSelection; /* list of items selected in this block */ CmdBlockType m_Command; /* Type (enum CmdBlockType)
int m_Color; /* Block Color (for drawings) */ * operation */
wxPoint m_MoveVector; /* Move distance in move, drag, copy ... command */ PICKED_ITEMS_LIST m_ItemsSelection; /* list of items selected
wxPoint m_BlockLastCursorPosition; /* Last Mouse position in block command * in this block */
* = last cursor position in move commands int m_Color; /* Block Color (for
* = 0,0 in block paste */ * drawings) */
wxPoint m_MoveVector; /* Move distance in move,
* drag, copy ... command */
wxPoint m_BlockLastCursorPosition; /* Last Mouse position in
* block command
* = last cursor position in
* move commands
* = 0,0 in block paste */
public: public:
BLOCK_SELECTOR(); BLOCK_SELECTOR();
~BLOCK_SELECTOR(); ~BLOCK_SELECTOR();
/** function InitData /** function InitData
* Init the initial values of a BLOCK_SELECTOR, before starting a block command * Init the initial values of a BLOCK_SELECTOR, before starting a block
*command
*/ */
void InitData( WinEDA_DrawPanel* Panel, const wxPoint& startpos ); void InitData( WinEDA_DrawPanel* Panel, const wxPoint& startpos );
/** Function SetMessageBlock /** Function SetMessageBlock
* Displays the type of block command in the status bar of the window * Displays the type of block command in the status bar of the window
*/ */
void SetMessageBlock( WinEDA_DrawFrame* frame ); void SetMessageBlock( WinEDA_DrawFrame* frame );
void Draw( WinEDA_DrawPanel* aPanel, void Draw( WinEDA_DrawPanel* aPanel,
wxDC* aDC, const wxPoint& aOffset, wxDC* aDC, const wxPoint& aOffset,
int aDrawMode, int aDrawMode,
int aColor ); int aColor );
/** Function PushItem /** Function PushItem
* Add aItem to the list of items * Add aItem to the list of items
* @param aItem = an ITEM_PICKER to add to the list * @param aItem = an ITEM_PICKER to add to the list
*/ */
void PushItem( ITEM_PICKER& aItem ); void PushItem( ITEM_PICKER& aItem );
/** Function ClearListAndDeleteItems /** Function ClearListAndDeleteItems
* delete only the list of EDA_BaseStruct * pointers, AND the data pinted by m_Item * delete only the list of EDA_BaseStruct * pointers, AND the data printed
* by m_Item
*/ */
void ClearListAndDeleteItems(); void ClearListAndDeleteItems();
void ClearItemsList();
void ClearItemsList();
unsigned GetCount() unsigned GetCount()
{ {
return m_ItemsSelection.GetCount(); return m_ItemsSelection.GetCount();
...@@ -100,17 +114,17 @@ public: ...@@ -100,17 +114,17 @@ public:
/* Cancel Current block operation. /* Cancel Current block operation.
*/ */
void AbortBlockCurrentCommand( WinEDA_DrawPanel* Panel, wxDC* DC ); void AbortBlockCurrentCommand( WinEDA_DrawPanel* Panel, wxDC* DC );
/* Redraw the outlines of the block which shows the search area for block commands /* Redraw the outlines of the block which shows the search area for block
* The first point of the rectangle showing the area is initialised * commands
* The first point of the rectangle showing the area is initialized
* by InitBlockLocateDatas(). * by InitBlockLocateDatas().
* The other point of the rectangle is the mouse cursor * The other point of the rectangle is the mouse cursor
*/ */
void DrawAndSizingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); void DrawAndSizingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
#endif /* __INCLUDE__BLOCK_COMMANDE_H__ */ #endif /* __INCLUDE__BLOCK_COMMANDE_H__ */
/********************** /**********************
* class_base_screen.h * class_base_screen.h
**********************/ **********************/
/* define : /* define :
...@@ -30,16 +30,17 @@ public: ...@@ -30,16 +30,17 @@ public:
{ {
if( this != &item ) if( this != &item )
{ {
m_Id = item.m_Id; m_Id = item.m_Id;
m_Size = item.m_Size; m_Size = item.m_Size;
} }
return *this; return *this;
} }
const bool operator==( const GRID_TYPE& item ) const const bool operator==( const GRID_TYPE& item ) const
{ {
return ( m_Size == item.m_Size && m_Id == item.m_Id ); return m_Size == item.m_Size && m_Id == item.m_Id;
} }
}; };
...@@ -55,72 +56,80 @@ WX_DECLARE_OBJARRAY( GRID_TYPE, GridArray ); ...@@ -55,72 +56,80 @@ WX_DECLARE_OBJARRAY( GRID_TYPE, GridArray );
class BASE_SCREEN : public EDA_BaseStruct class BASE_SCREEN : public EDA_BaseStruct
{ {
public: public:
wxPoint m_DrawOrg; /* offsets pour tracer le circuit sur l'ecran */ wxPoint m_DrawOrg; /* offsets for drawing the circuit on the
wxPoint m_Curseur; /* Screen cursor coordinate (on grid) in user units. */ * screen */
wxPoint m_MousePosition; /* Mouse cursor coordinate (off grid) in user units. */ wxPoint m_Curseur; /* Screen cursor coordinate (on grid) in user
* units. */
wxPoint m_MousePosition; /* Mouse cursor coordinate (off grid) in user
* units. */
wxPoint m_MousePositionInPixels; wxPoint m_MousePositionInPixels;
wxPoint m_O_Curseur; /* Relative Screen cursor coordinate (on grid) in user units. wxPoint m_O_Curseur; /* Relative Screen cursor coordinate (on grid)
* in user units.
* (coordinates from last reset position)*/ * (coordinates from last reset position)*/
wxPoint m_ScrollbarPos; // Position effective des Curseurs de scroll wxPoint m_ScrollbarPos; // Position effective des Curseurs de scroll
wxSize m_ScrollbarNumber; /* Valeur effective des Nombres de Scrool wxSize m_ScrollbarNumber; /* Current scroll bar posiition in scroll
* c.a.d taille en unites de scroll de la * units. */
* surface totale affichable */ wxPoint m_StartVisu; /* Coordinates in drawing units of the current
wxPoint m_StartVisu; /* Coord absolues du 1er pixel visualis�a * view position (upper left corner of device)
* l'ecran (en nombre de pixels) */ */
wxSize m_SizeVisu; /* taille en pixels de l'ecran (fenetre de visu wxSize m_SizeVisu; /* taille en pixels de l'ecran (fenetre de visu
* Utile pour recadrer les affichages lors de la * Utile pour recadrer les affichages lors de la
* navigation dans la hierarchie */ * navigation dans la hierarchie */
bool m_Center; /* fix the coordinate (0,0) position on bool m_Center; /* Center on screen. If TRUE (0.0) is centered
* screen : if TRUE (0,0) in centered on screen * on screen coordinates can be < 0 and
* TRUE: when coordinates can be < 0 and * > 0 except for schematics.
* > 0 all but schematic * FALSE: when coordinates can only be >= 0
* FALSE: when coordinates can be only >= 0
* Schematic */ * Schematic */
bool m_FirstRedraw; bool m_FirstRedraw;
SCH_ITEM* EEDrawList; /* Object list (main data) for schematic */ SCH_ITEM* EEDrawList; /* Object list (main data) for schematic */
// Undo/redo list of commands // Undo/redo list of commands
UNDO_REDO_CONTAINER m_UndoList; /* Objects list for the undo command (old data) */ UNDO_REDO_CONTAINER m_UndoList; /* Objects list for the undo
UNDO_REDO_CONTAINER m_RedoList; /* Objects list for the redo command (old data) */ * command (old data) */
unsigned m_UndoRedoCountMax; // undo/Redo command Max depth UNDO_REDO_CONTAINER m_RedoList; /* Objects list for the redo
* command (old data) */
unsigned m_UndoRedoCountMax; // undo/Redo command Max depth
/* block control */ /* block control */
BLOCK_SELECTOR m_BlockLocate; /* Block description for block commands */ BLOCK_SELECTOR m_BlockLocate; /* Block description for block
* commands */
/* Page description */ /* Page description */
Ki_PageDescr* m_CurrentSheetDesc; Ki_PageDescr* m_CurrentSheetDesc;
int m_ScreenNumber; int m_ScreenNumber;
int m_NumberOfScreen; int m_NumberOfScreen;
wxString m_FileName; wxString m_FileName;
wxString m_Title; /* titre de la feuille */ wxString m_Title;
wxString m_Date; /* date de mise a jour */ wxString m_Date;
wxString m_Revision; /* code de revision */ wxString m_Revision;
wxString m_Company; /* nom du proprietaire */ wxString m_Company;
wxString m_Commentaire1; wxString m_Commentaire1;
wxString m_Commentaire2; wxString m_Commentaire2;
wxString m_Commentaire3; wxString m_Commentaire3;
wxString m_Commentaire4; wxString m_Commentaire4;
private: private:
/* indicateurs divers */ char m_FlagRefreshReq; /* indicates that the screen should
char m_FlagRefreshReq; /* indique que l'ecran doit redessine */ * be redrawn */
char m_FlagModified; // indique modif du PCB,utilise pour eviter une sortie sans sauvegarde char m_FlagModified; // indicates current drawing has
char m_FlagSave; // indique sauvegarde auto faite // been modified
char m_FlagSave; // Perform automatica file save.
EDA_BaseStruct* m_CurrentItem; ///< Currently selected object EDA_BaseStruct* m_CurrentItem; ///< Currently selected object
GRID_TYPE m_Grid; ///< Current grid selection. GRID_TYPE m_Grid; ///< Current grid selection.
/* Valeurs du pas de grille et du zoom */ /* Grid and zoom values. */
public: public:
GridArray m_GridList; GridArray m_GridList;
bool m_UserGridIsON; bool m_UserGridIsON;
wxArrayInt m_ZoomList; /* Array of standard zoom coefficients. */ wxArrayInt m_ZoomList; /* Array of standard zoom coefficients. */
int m_Zoom; /* Current zoom coefficient. */ int m_Zoom; /* Current zoom coefficient. */
int m_ZoomScalar; /* Allow zooming to non-integer increments. */ int m_ZoomScalar; /* Allow zooming to non-integer increments.
bool m_IsPrinting; */
bool m_IsPrinting;
public: public:
BASE_SCREEN( KICAD_T aType = SCREEN_STRUCT_TYPE ); BASE_SCREEN( KICAD_T aType = SCREEN_STRUCT_TYPE );
...@@ -138,47 +147,54 @@ public: ...@@ -138,47 +147,54 @@ public:
void SetCurItem( EDA_BaseStruct* current ) { m_CurrentItem = current; } void SetCurItem( EDA_BaseStruct* current ) { m_CurrentItem = current; }
EDA_BaseStruct* GetCurItem() const { return m_CurrentItem; } EDA_BaseStruct* GetCurItem() const { return m_CurrentItem; }
void InitDatas(); /* Inits completes des variables */ void InitDatas();
wxSize ReturnPageSize( void ); wxSize ReturnPageSize( void );
virtual int GetInternalUnits( void ); virtual int GetInternalUnits( void );
/** Function CursorRealPosition /** Function CursorRealPosition
* @return the position in user units of location ScreenPos * @return the position in user units of location ScreenPos
* @param ScreenPos = the screen (in pixel) position co convert * @param ScreenPos = the screen (in pixel) position co convert
*/ */
wxPoint CursorRealPosition( const wxPoint& ScreenPos ); wxPoint CursorRealPosition( const wxPoint& ScreenPos );
/* general Undo/Redo command control */ /* general Undo/Redo command control */
/** function ClearUndoORRedoList (virtual). /** function ClearUndoORRedoList (virtual).
* this function must remove the aItemCount old commands from aList * this function must remove the aItemCount old commands from aList
* and delete commands, pickers and picked items if needed * and delete commands, pickers and picked items if needed
* Because picked items must be deleted only if they are not in use, this is a virtual pure * Because picked items must be deleted only if they are not in use, this
* function that must be created for SCH_SCREEN and PCB_SCREEN * is a virtual pure function that must be created for SCH_SCREEN and
* PCB_SCREEN
* @param aList = the UNDO_REDO_CONTAINER of commands * @param aList = the UNDO_REDO_CONTAINER of commands
* @param aItemCount = number of old commands to delete. -1 to remove all old commands * @param aItemCount = number of old commands to delete. -1 to remove all
* this will empty the list of commands. * old commands this will empty the list of commands.
* Commands are deleted from the older to the last. * Commands are deleted from the older to the last.
*/ */
virtual void ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount = -1) = 0; virtual void ClearUndoORRedoList(
UNDO_REDO_CONTAINER& aList,
int
aItemCount = -1 ) = 0;
/** Function ClearUndoRedoList /** Function ClearUndoRedoList
* clear undo and redo list, using ClearUndoORRedoList() * clear undo and redo list, using ClearUndoORRedoList()
* picked items are deleted by ClearUndoORRedoList() according to their status * picked items are deleted by ClearUndoORRedoList() according to their
* status
*/ */
virtual void ClearUndoRedoList(); virtual void ClearUndoRedoList();
/** function PushCommandToUndoList /** function PushCommandToUndoList
* add a command to undo in undo list * add a command to undo in undo list
* delete the very old commands when the max count of undo commands is reached * delete the very old commands when the max count of undo commands is
* reached
* ( using ClearUndoORRedoList) * ( using ClearUndoORRedoList)
*/ */
virtual void PushCommandToUndoList( PICKED_ITEMS_LIST* aItem ); virtual void PushCommandToUndoList( PICKED_ITEMS_LIST* aItem );
/** function PushCommandToRedoList /** function PushCommandToRedoList
* add a command to redo in redo list * add a command to redo in redo list
* delete the very old commands when the max count of redo commands is reached * delete the very old commands when the max count of redo commands is
* reached
* ( using ClearUndoORRedoList) * ( using ClearUndoORRedoList)
*/ */
virtual void PushCommandToRedoList( PICKED_ITEMS_LIST* aItem ); virtual void PushCommandToRedoList( PICKED_ITEMS_LIST* aItem );
...@@ -207,7 +223,6 @@ public: ...@@ -207,7 +223,6 @@ public:
} }
/* Manipulation des flags */
void SetRefreshReq() { m_FlagRefreshReq = 1; } void SetRefreshReq() { m_FlagRefreshReq = 1; }
void ClrRefreshReq() { m_FlagRefreshReq = 0; } void ClrRefreshReq() { m_FlagRefreshReq = 0; }
void SetModify() { m_FlagModified = 1; m_FlagSave = 0; } void SetModify() { m_FlagModified = 1; m_FlagSave = 0; }
...@@ -219,7 +234,7 @@ public: ...@@ -219,7 +234,7 @@ public:
int IsSave() { return m_FlagSave & 1; } int IsSave() { return m_FlagSave & 1; }
//----<zoom stuff>---------------------------------------------------------- //----<zoom stuff>---------------------------------------------------------
/** Function GetScalingFactor /** Function GetScalingFactor
* @return the the current scale used to draw items on screen * @return the the current scale used to draw items on screen
...@@ -253,7 +268,8 @@ public: ...@@ -253,7 +268,8 @@ public:
/** /**
* Function SetZoomList * Function SetZoomList
* sets the list of zoom factors. * sets the list of zoom factors.
* @param aZoomList An array of zoom factors in ascending order, zero terminated * @param aZoomList An array of zoom factors in ascending order, zero
* terminated
*/ */
void SetZoomList( const wxArrayInt& zoomlist ); void SetZoomList( const wxArrayInt& zoomlist );
...@@ -267,12 +283,13 @@ public: ...@@ -267,12 +283,13 @@ public:
void Unscale( wxPoint& pt ); void Unscale( wxPoint& pt );
void Unscale( wxSize& sz ); void Unscale( wxSize& sz );
bool SetNextZoom(); /* ajuste le prochain coeff de zoom */ bool SetNextZoom();
bool SetPreviousZoom(); /* ajuste le precedent coeff de zoom */ bool SetPreviousZoom();
bool SetFirstZoom(); /* ajuste le coeff de zoom a 1*/ bool SetFirstZoom();
bool SetLastZoom(); /* ajuste le coeff de zoom au max */ bool SetLastZoom();
//----<grid stuff>---------------------------------------------------------- //----<grid
// stuff>----------------------------------------------------------
/** /**
* Return the command ID of the currently selected grid. * Return the command ID of the currently selected grid.
......
...@@ -3,22 +3,22 @@ ...@@ -3,22 +3,22 @@
* *
* Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> * Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2004-2007 Kicad Developers, see change_log.txt for contributors. * Copyright (C) 2004-2007 Kicad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here: * along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * 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 search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc., * or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
...@@ -37,14 +37,14 @@ class EDA_BaseStruct; ...@@ -37,14 +37,14 @@ class EDA_BaseStruct;
/** /**
* Class COLLECTOR * Class COLLECTOR
* is an abstract class that will find and hold all the objects according to * is an abstract class that will find and hold all the objects according to
* an inspection done by the Inspect() function which must be implemented by * an inspection done by the Inspect() function which must be implemented by
* any derived class. When Inspect() finds an object that it wants to collect, * any derived class. When Inspect() finds an object that it wants to collect,
* i.e. one that it "likes", then it only has to do an Append( testItem ) * i.e. one that it "likes", then it only has to do an Append( testItem )
* on it to add it to its collection, but in all cases for the scan to continue, * on it to add it to its collection, but in all cases for the scan to continue,
* Inspect() must return SEARCH_CONTINUE. * Inspect() must return SEARCH_CONTINUE.
* *
* Later, after collection, the user can iterate through all the objects * Later, after collection, the user can iterate through all the objects
* in the remembered collection using GetCount() and the [int] operator. * in the remembered collection using GetCount() and the [int] operator.
*/ */
class COLLECTOR : public INSPECTOR class COLLECTOR : public INSPECTOR
...@@ -61,11 +61,11 @@ protected: ...@@ -61,11 +61,11 @@ protected:
/// A bounding box to test against, and that was used to make the collection. /// A bounding box to test against, and that was used to make the collection.
EDA_Rect m_RefBox; EDA_Rect m_RefBox;
/// The time at which the collection was made. /// The time at which the collection was made.
int m_TimeAtCollection; int m_TimeAtCollection;
public: public:
COLLECTOR() COLLECTOR()
...@@ -77,7 +77,7 @@ public: ...@@ -77,7 +77,7 @@ public:
{ {
} }
/** /**
* Function GetCount * Function GetCount
* returns the number of objects in the list * returns the number of objects in the list
...@@ -87,7 +87,7 @@ public: ...@@ -87,7 +87,7 @@ public:
return (int) m_List.size(); return (int) m_List.size();
} }
/** /**
* Function Empty * Function Empty
* sets the list to empty * sets the list to empty
...@@ -97,7 +97,7 @@ public: ...@@ -97,7 +97,7 @@ public:
m_List.clear(); m_List.clear();
} }
/** /**
* Function Append * Function Append
* adds an item to the end of the list. * adds an item to the end of the list.
...@@ -142,7 +142,7 @@ public: ...@@ -142,7 +142,7 @@ public:
return &m_List[0]; return &m_List[0];
} }
/** /**
* Function SetScanTypes * Function SetScanTypes
* records the list of KICAD_T types to consider for collection by * records the list of KICAD_T types to consider for collection by
...@@ -154,7 +154,7 @@ public: ...@@ -154,7 +154,7 @@ public:
{ {
m_ScanTypes = scanTypes; m_ScanTypes = scanTypes;
} }
void SetTimeNow() void SetTimeNow()
{ {
m_TimeAtCollection = GetTimeStamp(); m_TimeAtCollection = GetTimeStamp();
...@@ -169,12 +169,12 @@ public: ...@@ -169,12 +169,12 @@ public:
void SetBoundingBox( const EDA_Rect& aRefBox ) { m_RefBox = aRefBox; } void SetBoundingBox( const EDA_Rect& aRefBox ) { m_RefBox = aRefBox; }
const EDA_Rect& GetBoundingBox() const { return m_RefBox; } const EDA_Rect& GetBoundingBox() const { return m_RefBox; }
/** /**
* Function IsSimilarPointAndTime * Function IsSimilarPointAndTime
* returns true if the given reference point is "similar" (defined here) * returns true if the given reference point is "similar" (defined here)
* to the internal reference point and the current time is within a few * to the internal reference point and the current time is within a few
* seconds of the internal m_TimeAtCollection. * seconds of the internal m_TimeAtCollection.
* *
* @param aRefPos A wxPoint to compare to. * @param aRefPos A wxPoint to compare to.
...@@ -184,21 +184,21 @@ public: ...@@ -184,21 +184,21 @@ public:
{ {
const int distMax = 2; // adjust these here const int distMax = 2; // adjust these here
const int timeMax = 3; // seconds, I think const int timeMax = 3; // seconds, I think
int dx = abs( aRefPos.x - m_RefPos.x ); int dx = abs( aRefPos.x - m_RefPos.x );
int dy = abs( aRefPos.y - m_RefPos.y ); int dy = abs( aRefPos.y - m_RefPos.y );
if( dx <= distMax && dy <= distMax if( dx <= distMax && dy <= distMax
&& GetTimeStamp()-m_TimeAtCollection <= timeMax ) && GetTimeStamp()-m_TimeAtCollection <= timeMax )
return true; return true;
else else
return false; return false;
} }
/** /**
* Function Inspect * Function Inspect
* is the examining function within the INSPECTOR which is passed to the * is the examining function within the INSPECTOR which is passed to the
* Iterate function. It is used primarily for searching, but not limited to * Iterate function. It is used primarily for searching, but not limited to
* that. It can also collect or modify the scanned objects. * that. It can also collect or modify the scanned objects.
* *
...@@ -209,14 +209,14 @@ public: ...@@ -209,14 +209,14 @@ public:
* else SCAN_CONTINUE; * else SCAN_CONTINUE;
* *
* implement in derived class: * implement in derived class:
SEARCH_RESULT virtual Inspect( EDA_BaseStruct* testItem, SEARCH_RESULT virtual Inspect( EDA_BaseStruct* testItem,
const void* testData ) = 0; const void* testData ) = 0;
*/ */
/** /**
* Function Collect * Function Collect
* scans an EDA_BaseStruct using this class's Inspector method, which does * scans an EDA_BaseStruct using this class's Inspector method, which does
* the collection. * the collection.
* @param container An EDA_BaseStruct to scan, including those items it contains. * @param container An EDA_BaseStruct to scan, including those items it contains.
* @param aRefPos A wxPoint to use in hit-testing. * @param aRefPos A wxPoint to use in hit-testing.
...@@ -226,14 +226,14 @@ public: ...@@ -226,14 +226,14 @@ public:
virtual void Collect( EDA_BaseStruct* container, const wxPoint& aRefPos ) virtual void Collect( EDA_BaseStruct* container, const wxPoint& aRefPos )
{ {
example implementation: example implementation:
SetRefPos( aRefPos ); // remember where the snapshot was taken from SetRefPos( aRefPos ); // remember where the snapshot was taken from
Empty(); // empty the collection Empty(); // empty the collection
// visit the board with the INSPECTOR (me). // visit the board with the INSPECTOR (me).
container->Visit( this, // INSPECTOR* inspector container->Visit( this, // INSPECTOR* inspector
NULL, // const void* testData, NULL, // const void* testData,
m_ScanTypes); m_ScanTypes);
SetTimeNow(); // when it was taken SetTimeNow(); // when it was taken
} }
......
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
* define class WinEDA_DrawPanel * define class WinEDA_DrawPanel
*************************************/ *************************************/
/* Doit etre inclus dans "wxstruch.h"
*/
#ifndef PANEL_WXSTRUCT_H #ifndef PANEL_WXSTRUCT_H
#define PANEL_WXSTRUCT_H #define PANEL_WXSTRUCT_H
...@@ -17,49 +14,64 @@ class BASE_SCREEN; ...@@ -17,49 +14,64 @@ class BASE_SCREEN;
class PCB_SCREEN; class PCB_SCREEN;
/****************************************************/
/* classe representant un ecran graphique de dessin */
/****************************************************/
class WinEDA_DrawPanel : public wxScrolledWindow class WinEDA_DrawPanel : public wxScrolledWindow
{ {
public: public:
WinEDA_DrawFrame* m_Parent; WinEDA_DrawFrame* m_Parent;
EDA_Rect m_ClipBox; // the clipbox used in screen redraw (usually gives the visible area in internal units) EDA_Rect m_ClipBox; // the clipbox used in screen
wxPoint m_CursorStartPos; // utile dans controles du mouvement curseur // redraw (usually gives the
int m_ScrollButt_unit; // Valeur de l'unite de scroll en pixels pour les boutons de scroll // visible area in internal units)
wxPoint m_CursorStartPos; // useful in testing the cursor
// movement
int m_ScrollButt_unit; // scroll bar pixels per unit value
bool m_AbortRequest; // Flag to abort long commands
bool m_AbortEnable; // TRUE if abort button or menu to
// be displayed
bool m_AbortRequest; // Flag d'arret de commandes longues
bool m_AbortEnable; // TRUE si menu ou bouton Abort doit etre affiche
bool m_AutoPAN_Enable; // TRUE to allow auto pan bool m_AutoPAN_Enable; // TRUE to allow auto pan
bool m_AutoPAN_Request; // TRUE to request an auto pan (will be made only if m_AutoPAN_Enable = true) bool m_AutoPAN_Request; // TRUE to request an auto pan
// (will be made only if
// m_AutoPAN_Enable = true)
int m_IgnoreMouseEvents; // when non-zero (true), then ignore mouse events int m_IgnoreMouseEvents; // when non-zero (true), then
// ignore mouse events
bool m_Block_Enable; // TRUE to accept Block Commands bool m_Block_Enable; // TRUE to accept Block Commands
int m_CanStartBlock; // >= 0 (or >= n) if a block can start int m_CanStartBlock; // >= 0 (or >= n) if a block can
bool m_PrintIsMirrored; // True when drawing in mirror mode. Used in draw arc function, // start
// because arcs are oriented, and in mirror mode, orientations are reversed bool m_PrintIsMirrored; // True when drawing in mirror
// usefull to avoid false start block in certain cases (like switch from a sheet to an other scheet // mode. Used in draw arc function,
int m_PanelDefaultCursor; // Current mouse cursor default shape id for this window // because arcs are oriented, and
int m_PanelCursor; // Current mouse cursor shape id for this window // in mirror mode, orientations are
int m_CursorLevel; // Index for cursor redraw in XOR mode // reversed
// useful to avoid false start block in certain cases (like switch from a
// sheet to an other sheet
int m_PanelDefaultCursor; // Current mouse cursor default
// shape id for this window
int m_PanelCursor; // Current mouse cursor shape id
// for this window
int m_CursorLevel; // Index for cursor redraw in XOR
// mode
/* Cursor management (used in editing functions) */ /* Cursor management (used in editing functions) */
void (*ManageCurseur)( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); /* Fonction d'affichage sur deplacement souris
* si erase : effacement ancien affichage */ /* Mouse capture move callback function prototype. */
void (*ForceCloseManageCurseur)( WinEDA_DrawPanel* panel, wxDC* DC ); /* Fonction de fermeture forc� void (*ManageCurseur)( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
* de la fonction ManageCurseur */
/* Abort managed cursor callback function prototype. */
void (*ForceCloseManageCurseur)( WinEDA_DrawPanel* panel, wxDC* DC );
public: public:
// Constructor and destructor
WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id, const wxPoint& pos, WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id, const wxPoint& pos,
const wxSize& size ); const wxSize& size );
~WinEDA_DrawPanel(); ~WinEDA_DrawPanel();
/****************************/
BASE_SCREEN* GetScreen(); BASE_SCREEN* GetScreen();
...@@ -69,7 +81,10 @@ public: ...@@ -69,7 +81,10 @@ public:
void OnSize( wxSizeEvent& event ); void OnSize( wxSizeEvent& event );
void SetBoundaryBox(); void SetBoundaryBox();
void ReDraw( wxDC* DC, bool erasebg = TRUE ); void ReDraw( wxDC* DC, bool erasebg = TRUE );
void PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask, bool aPrintMirrorMode ); void PrintPage( wxDC* DC,
bool Print_Sheet_Ref,
int PrintMask,
bool aPrintMirrorMode );
void DrawBackGround( wxDC* DC ); void DrawBackGround( wxDC* DC );
void DrawAuxiliaryAxis( wxDC* DC, int drawmode ); void DrawAuxiliaryAxis( wxDC* DC, int drawmode );
void OnEraseBackground( wxEraseEvent& event ); void OnEraseBackground( wxEraseEvent& event );
...@@ -83,8 +98,6 @@ public: ...@@ -83,8 +98,6 @@ public:
void OnPan( wxCommandEvent& event ); void OnPan( wxCommandEvent& event );
/*************************/
void EraseScreen( wxDC* DC ); void EraseScreen( wxDC* DC );
void OnScrollWin( wxCommandEvent& event ); void OnScrollWin( wxCommandEvent& event );
void OnScroll( wxScrollWinEvent& event ); void OnScroll( wxScrollWinEvent& event );
...@@ -100,7 +113,7 @@ public: ...@@ -100,7 +113,7 @@ public:
/** Function CursorRealPosition /** Function CursorRealPosition
* @return the position in user units of location ScreenPos * @return the position in user units of location ScreenPos
* @param ScreenPos = the screen (in pixel) position co convert * @param ScreenPos = the screen (in pixel) position to convert
*/ */
wxPoint CursorRealPosition( const wxPoint& ScreenPos ); wxPoint CursorRealPosition( const wxPoint& ScreenPos );
...@@ -116,8 +129,8 @@ public: ...@@ -116,8 +129,8 @@ public:
* along with any other recently posted rectangles is redrawn. Conversion * along with any other recently posted rectangles is redrawn. Conversion
* to pixels is done in here. * to pixels is done in here.
* @param aRect The rectangle to append, it must be orthogonal * @param aRect The rectangle to append, it must be orthogonal
* (vertical and horizontal edges only), and it must be [,) in nature, i.e. * (vertical and horizontal edges only), and it must be [,) in nature,
* [pos, dim) == [inclusive, exclusive) * i.e. [pos, dim) == [inclusive, exclusive)
*/ */
void PostDirtyRect( EDA_Rect aRect ); void PostDirtyRect( EDA_Rect aRect );
...@@ -132,8 +145,9 @@ public: ...@@ -132,8 +145,9 @@ public:
/** /**
* Function ConvertPcbUnitsToPixelsUnits * Function ConvertPcbUnitsToPixelsUnits
* converts a given wxPoint position (in internal units) to units of pixels, * converts a given wxPoint position (in internal units) to units of
* relative to the current draw area (origin 0,0 is the left top visible * pixels, relative to the current draw area (origin 0,0 is the left
* top visible
* corner of draw area) according to the current scroll and zoom. * corner of draw area) according to the current scroll and zoom.
* @param aPosition = the position to convert * @param aPosition = the position to convert
*/ */
...@@ -144,9 +158,16 @@ public: ...@@ -144,9 +158,16 @@ public:
void MouseTo( const wxPoint& Mouse ); void MouseTo( const wxPoint& Mouse );
/* Cursor functions */ /* Cursor functions */
void Trace_Curseur( wxDC* DC, int color = WHITE ); // Draw the user cursor (grid cursor) void Trace_Curseur( wxDC* DC, int color = WHITE ); // Draw the
void CursorOff( wxDC* DC ); // remove the grid cursor from the display // user cursor
void CursorOn( wxDC* DC ); // display the grid cursor // (grid
// cursor)
void CursorOff( wxDC* DC ); // remove the
// grid cursor
// from the
// display
void CursorOn( wxDC* DC ); // display the
// grid cursor
/** /**
* Release managed cursor. * Release managed cursor.
......
/**************************************************************/ /****************/
/* pcbstruct.h : definition des structures de donnees type PCB */ /* pcbstruct.h */
/**************************************************************/ /****************/
#ifndef __CLASSPCB_SCREEN_H__ #ifndef __CLASSPCB_SCREEN_H__
#define __CLASSPCB_SCREEN_H__ #define __CLASSPCB_SCREEN_H__
#
/* Handle info to display a board */ /* Handle info to display a board */
class PCB_SCREEN : public BASE_SCREEN class PCB_SCREEN : public BASE_SCREEN
{ {
public: public:
int m_Active_Layer; /* ref couche active */ int m_Active_Layer;
int m_Route_Layer_TOP; /* ref couches actives */ int m_Route_Layer_TOP;
int m_Route_Layer_BOTTOM; /* pour placement vias et routage 2 couches */ int m_Route_Layer_BOTTOM;
public: public:
PCB_SCREEN(); PCB_SCREEN();
...@@ -29,10 +27,14 @@ public: ...@@ -29,10 +27,14 @@ public:
/** /**
* Function GetCurItem * Function GetCurItem
* returns the currently selected BOARD_ITEM, overriding BASE_SCREEN::GetCurItem(). * returns the currently selected BOARD_ITEM, overriding
*BASE_SCREEN::GetCurItem().
* @return BOARD_ITEM* - the one selected, or NULL. * @return BOARD_ITEM* - the one selected, or NULL.
*/ */
BOARD_ITEM* GetCurItem() const { return (BOARD_ITEM*) BASE_SCREEN::GetCurItem(); } BOARD_ITEM* GetCurItem() const
{
return (BOARD_ITEM*) BASE_SCREEN::GetCurItem();
}
/** /**
* Function SetCurItem * Function SetCurItem
...@@ -43,7 +45,7 @@ public: ...@@ -43,7 +45,7 @@ public:
/* Return true if a microvia can be put on board /* Return true if a microvia can be put on board
* A microvia ia a small via restricted to 2 near neighbour layers * A microvia is a small via restricted to 2 near neighbor layers
* because its is hole is made by laser which can penetrate only one layer * because its is hole is made by laser which can penetrate only one layer
* It is mainly used to connect BGA to the first inner layer * It is mainly used to connect BGA to the first inner layer
* And it is allowed from an external layer to the first inner layer * And it is allowed from an external layer to the first inner layer
...@@ -51,6 +53,7 @@ public: ...@@ -51,6 +53,7 @@ public:
bool IsMicroViaAcceptable( void ); bool IsMicroViaAcceptable( void );
/* full undo redo management : */ /* full undo redo management : */
// use BASE_SCREEN::ClearUndoRedoList() // use BASE_SCREEN::ClearUndoRedoList()
// use BASE_SCREEN::PushCommandToUndoList( PICKED_ITEMS_LIST* aItem ) // use BASE_SCREEN::PushCommandToUndoList( PICKED_ITEMS_LIST* aItem )
// use BASE_SCREEN::PushCommandToRedoList( PICKED_ITEMS_LIST* aItem ) // use BASE_SCREEN::PushCommandToRedoList( PICKED_ITEMS_LIST* aItem )
...@@ -59,13 +62,14 @@ public: ...@@ -59,13 +62,14 @@ public:
* free the undo or redo list from List element * free the undo or redo list from List element
* Wrappers are deleted. * Wrappers are deleted.
* datas pointed by wrappers are deleted if not in use in schematic * datas pointed by wrappers are deleted if not in use in schematic
* i.e. when they are copy of a schematic item or they are no more in use (DELETED) * i.e. when they are copy of a schematic item or they are no more in use
* (DELETED)
* @param aList = the UNDO_REDO_CONTAINER to clear * @param aList = the UNDO_REDO_CONTAINER to clear
* @param aItemCount = the count of items to remove. < 0 for all items * @param aItemCount = the count of items to remove. < 0 for all items
* items are removed from the beginning of the list. * items are removed from the beginning of the list.
* So this function can be called to remove old commands * So this function can be called to remove old commands
*/ */
void ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount = -1 ); void ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount = -1 );
}; };
......
/********************/ /************/
/* Fichier colors.h */ /* colors.h */
/********************/ /************/
#ifndef _COLORS_H #ifndef _COLORS_H
#define _COLORS_H #define _COLORS_H
/* Definitions des Numeros des Couleurs ( palette de 32) */ /* Number of colors ( 32 bit palette. ) */
#define NBCOLOR 24 #define NBCOLOR 24
#define MASKCOLOR 31 ///< mask for color index into ColorRefs[] #define MASKCOLOR 31 ///< mask for color index into ColorRefs[]
/// bit indicateur d'affichage (vu / non vu) des items : (defini dans les valeurs des couleurs /// Flag bit display (seen / not seen) items: (defined in the color values
//IMB: Not used anymore #define ITEM_NOT_SHOW (1<<18) // 0x40000 //IMB: Not used anymore #define ITEM_NOT_SHOW (1<<18) // 0x40000
/// Definition du bit de surbrillance #define HIGHT_LIGHT_FLAG ( 1<<19 ) // 0x80000
#define HIGHT_LIGHT_FLAG (1<<19) // 0x80000
/** /**
...@@ -102,14 +101,13 @@ static inline wxColour MakeColour( int aColor ) ...@@ -102,14 +101,13 @@ static inline wxColour MakeColour( int aColor )
#endif #endif
int ndx = aColor & MASKCOLOR; int ndx = aColor & MASKCOLOR;
return wxColour( return wxColour( ColorRefs[ndx].m_Red,
ColorRefs[ndx].m_Red, ColorRefs[ndx].m_Green,
ColorRefs[ndx].m_Green, ColorRefs[ndx].m_Blue
ColorRefs[ndx].m_Blue
#if wxCHECK_VERSION(2,8,5) #if wxCHECK_VERSION(2,8,5)
,(unsigned char) alpha ,(unsigned char) alpha
#endif #endif
); );
} }
#endif /* ifndef _COLORS_H */ #endif /* ifndef _COLORS_H */
...@@ -17,15 +17,19 @@ class WinEDA_DrawPanel; ...@@ -17,15 +17,19 @@ class WinEDA_DrawPanel;
/* Flag for special keys */ /* Flag for special keys */
#define GR_KB_RIGHTSHIFT 0x10000000 /* Keybd states: right shift key depressed */ #define GR_KB_RIGHTSHIFT 0x10000000 /* Keybd states: right
#define GR_KB_LEFTSHIFT 0x20000000 /* left shift key depressed */ * shift key depressed */
#define GR_KB_CTRL 0x40000000 /* CTRL depressed */ #define GR_KB_LEFTSHIFT 0x20000000 /* left shift key depressed
#define GR_KB_ALT 0x80000000 /* ALT depressed */ */
#define GR_KB_SHIFT (GR_KB_LEFTSHIFT | GR_KB_RIGHTSHIFT) #define GR_KB_CTRL 0x40000000 /* CTRL depressed */
#define GR_KB_SHIFTCTRL (GR_KB_SHIFT | GR_KB_CTRL) #define GR_KB_ALT 0x80000000 /* ALT depressed */
#define MOUSE_MIDDLE 0x08000000 /* Middle button mouse flag for block commands */ #define GR_KB_SHIFT (GR_KB_LEFTSHIFT | GR_KB_RIGHTSHIFT)
#define GR_KB_SHIFTCTRL (GR_KB_SHIFT | GR_KB_CTRL)
#define NB_ITEMS 11 #define MOUSE_MIDDLE 0x08000000 /* Middle button mouse
* flag for block commands
*/
#define NB_ITEMS 11
/* Pseudo key codes for command panning */ /* Pseudo key codes for command panning */
enum pseudokeys { enum pseudokeys {
...@@ -62,8 +66,8 @@ enum pseudokeys { ...@@ -62,8 +66,8 @@ enum pseudokeys {
/* Graphic Texts Orientation in 0.1 degree*/ /* Graphic Texts Orientation in 0.1 degree*/
#define TEXT_ORIENT_HORIZ 0 #define TEXT_ORIENT_HORIZ 0
#define TEXT_ORIENT_VERT 900 #define TEXT_ORIENT_VERT 900
#define ON 1 #define ON 1
#define OFF 0 #define OFF 0
...@@ -73,10 +77,10 @@ enum pseudokeys { ...@@ -73,10 +77,10 @@ enum pseudokeys {
#define CENTIMETRE 2 #define CENTIMETRE 2
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
#define LEFTMARGIN 800 /* 20mm */ #define LEFTMARGIN 800 /* 20mm */
#define RIGHTMARGIN 200 /* 5mm */ #define RIGHTMARGIN 200 /* 5mm */
#define TOPMARGIN 200 /* 5mm */ #define TOPMARGIN 200 /* 5mm */
#define BOTTOMMARGIN 200 /* 5mm */ #define BOTTOMMARGIN 200 /* 5mm */
#endif #endif
/* forward declarations: */ /* forward declarations: */
...@@ -94,17 +98,17 @@ private: ...@@ -94,17 +98,17 @@ private:
public: public:
WinEDA_TextFrame( wxWindow* parent, const wxString& title ); WinEDA_TextFrame( wxWindow* parent, const wxString& title );
void Append( const wxString& text ); void Append( const wxString& text );
private: private:
void D_ClickOnList( wxCommandEvent& event ); void D_ClickOnList( wxCommandEvent& event );
void OnClose( wxCloseEvent& event ); void OnClose( wxCloseEvent& event );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
/* Clsass to handle pages sizes: /* Class to handle pages sizes:
*/ */
class Ki_PageDescr class Ki_PageDescr
{ {
...@@ -124,31 +128,31 @@ public: ...@@ -124,31 +128,31 @@ public:
}; };
extern Ki_PageDescr g_Sheet_A4; extern Ki_PageDescr g_Sheet_A4;
extern Ki_PageDescr g_Sheet_A3; extern Ki_PageDescr g_Sheet_A3;
extern Ki_PageDescr g_Sheet_A2; extern Ki_PageDescr g_Sheet_A2;
extern Ki_PageDescr g_Sheet_A1; extern Ki_PageDescr g_Sheet_A1;
extern Ki_PageDescr g_Sheet_A0; extern Ki_PageDescr g_Sheet_A0;
extern Ki_PageDescr g_Sheet_A; extern Ki_PageDescr g_Sheet_A;
extern Ki_PageDescr g_Sheet_B; extern Ki_PageDescr g_Sheet_B;
extern Ki_PageDescr g_Sheet_C; extern Ki_PageDescr g_Sheet_C;
extern Ki_PageDescr g_Sheet_D; extern Ki_PageDescr g_Sheet_D;
extern Ki_PageDescr g_Sheet_E; extern Ki_PageDescr g_Sheet_E;
extern Ki_PageDescr g_Sheet_GERBER; extern Ki_PageDescr g_Sheet_GERBER;
extern Ki_PageDescr g_Sheet_user; extern Ki_PageDescr g_Sheet_user;
extern Ki_PageDescr* g_SheetSizeList[]; extern Ki_PageDescr* g_SheetSizeList[];
extern wxString g_ProductName; extern wxString g_ProductName;
/* Default user lib path can be left void, if the standard lib path is used */ /* Default user lib path can be left void, if the standard lib path is used */
extern wxString g_UserLibDirBuffer; extern wxString g_UserLibDirBuffer;
extern int g_DebugLevel; // 0= Pas de debug */ extern int g_DebugLevel;
extern int g_MouseOldButtons; extern int g_MouseOldButtons;
extern int g_KeyPressed; extern int g_KeyPressed;
extern bool g_ShowPageLimits; // TRUE to display the page limits extern bool g_ShowPageLimits; // TRUE to display the page limits
/* File name extension definitions. */ /* File name extension definitions. */
extern const wxString ProjectFileExtension; extern const wxString ProjectFileExtension;
...@@ -168,17 +172,18 @@ extern const wxString AllFilesWildcard; ...@@ -168,17 +172,18 @@ extern const wxString AllFilesWildcard;
// Name of default configuration file. (kicad.pro) // Name of default configuration file. (kicad.pro)
extern wxString g_Prj_Default_Config_FullFilename; extern wxString g_Prj_Default_Config_FullFilename;
// Name of local configuration file. (<curr projet>.pro) // Name of local configuration file. (<curr projet>.pro)
extern wxString g_Prj_Config_LocalFilename; extern wxString g_Prj_Config_LocalFilename;
extern int g_UnitMetric; // display units mm = 1, inches = 0, cm = 2 extern int g_UnitMetric; // display units mm = 1, inches = 0, cm = 2
/* Draw color for moving objects: */ /* Draw color for moving objects: */
extern int g_GhostColor; extern int g_GhostColor;
/* Draw color for grid: */ /* Draw color for grid: */
extern int g_GridColor; extern int g_GridColor;
/* Current used screen: (not used in eeshema)*/ /* Current used screen: (not used in eeshema)*/
extern BASE_SCREEN* ActiveScreen; extern BASE_SCREEN* ActiveScreen;
...@@ -187,41 +192,46 @@ extern BASE_SCREEN* ActiveScreen; ...@@ -187,41 +192,46 @@ extern BASE_SCREEN* ActiveScreen;
/* COMMON.CPP */ /* COMMON.CPP */
/** function SetLocaleTo_C_standard /** function SetLocaleTo_C_standard
because kicad is internationalized, switch internatization to "C" standard * because kicad is internationalized, switch internalization to "C" standard
i.e. uses the . (dot) as separator in print/read float numbers * i.e. uses the . (dot) as separator in print/read float numbers
(some contries (France, Germany ..) use , (comma) as separator) * (some countries (France, Germany ..) use , (comma) as separator)
This function must be called before read or write ascii files using float numbers in data * This function must be called before read or write ascii files using float
the SetLocaleTo_C_standard function must be called after reading or writing the file * numbers in data the SetLocaleTo_C_standard function must be called after
* reading or writing the file
This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function, *
but could make more easier an optional use of locale in kicad * This is wrapper to the C setlocale( LC_NUMERIC, "C" ) function,
*/ * but could make more easier an optional use of locale in kicad
void SetLocaleTo_C_standard(void); */
void SetLocaleTo_C_standard( void );
/** function SetLocaleTo_Default /** function SetLocaleTo_Default
because kicad is internationalized, switch internatization to default * because kicad is internationalized, switch internalization to default
to use the default separator in print/read float numbers * to use the default separator in print/read float numbers
(. (dot) but some contries (France, Germany ..) use , (comma) as separator) * (. (dot) but some countries (France, Germany ..) use , (comma) as
This function must be called after a call to SetLocaleTo_C_standard * separator)
* This function must be called after a call to SetLocaleTo_C_standard
This is wrapper to the C setlocale( LC_NUMERIC, "" ) function, *
but could make more easier an optional use of locale in kicad * This is wrapper to the C setlocale( LC_NUMERIC, "" ) function,
*/ * but could make more easier an optional use of locale in kicad
void SetLocaleTo_Default(void); */
void SetLocaleTo_Default( void );
/** /**
* Function EnsureTextCtrlWidth * Function EnsureTextCtrlWidth
* sets the minimum pixel width on a text control in order to make a text string * sets the minimum pixel width on a text control in order to make a text
* be fully visible within it. The current font within the text control is considered. * string be fully visible within it. The current font within the text
* control is considered.
* The text can come either from the control or be given as an argument. * The text can come either from the control or be given as an argument.
* If the text control is larger than needed, then nothing is done. * If the text control is larger than needed, then nothing is done.
* @param aCtrl the text control to potentially make wider. * @param aCtrl the text control to potentially make wider.
* @param aString the text that is used in sizing the control's pixel width. If NULL, then * @param aString the text that is used in sizing the control's pixel width.
* If NULL, then
* the text already within the control is used. * the text already within the control is used.
* @return bool - true if the \a aCtrl had its size changed, else false. * @return bool - true if the \a aCtrl had its size changed, else false.
*/ */
bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString = NULL ); bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl,
const wxString* aString = NULL );
/** /**
...@@ -232,19 +242,19 @@ bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString = NULL ); ...@@ -232,19 +242,19 @@ bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString = NULL );
* @param aPoint The point to output. * @param aPoint The point to output.
* @return wxString& - the input string * @return wxString& - the input string
*/ */
wxString& operator <<( wxString& aString, const wxPoint& aPoint ); wxString& operator <<( wxString& aString, const wxPoint& aPoint );
/** /**
* Function ProcessExecute * Function ProcessExecute
* runs a child process. * runs a child process.
* @param aCommandLine The process and any arguments to it all in a single string. * @param aCommandLine The process and any arguments to it all in a single
* string.
* @param aFlags The same args as allowed for wxExecute() * @param aFlags The same args as allowed for wxExecute()
* @return bool - true if success, else false * @return bool - true if success, else false
*/ */
bool ProcessExecute( const wxString& aCommandLine, bool ProcessExecute( const wxString& aCommandLine,
int aFlags = wxEXEC_ASYNC ); int aFlags = wxEXEC_ASYNC );
/** /**
...@@ -252,22 +262,24 @@ bool ProcessExecute( const wxString& aCommandLine, ...@@ -252,22 +262,24 @@ bool ProcessExecute( const wxString& aCommandLine,
* @return a wxString containing the name of the layer number "layer_number". * @return a wxString containing the name of the layer number "layer_number".
* @param layer_number the layer number of the layer * @param layer_number the layer number of the layer
* @param is_filename if TRUE, the name can be used for a file name (not * @param is_filename if TRUE, the name can be used for a file name (not
* internatinalized, no space) * internationalized, no space)
*/ */
wxString ReturnPcbLayerName( int layer_number, bool is_filename = FALSE ); wxString ReturnPcbLayerName( int layer_number,
bool is_filename = FALSE );
/*******************/ /*******************/
/* about_kicad.cpp */ /* about_kicad.cpp */
/*******************/ /*******************/
void InitKiCadAbout( wxAboutDialogInfo& info); void InitKiCadAbout( wxAboutDialogInfo& info );
/**************/ /**************/
/* common.cpp */ /* common.cpp */
/**************/ /**************/
wxString GetBuildVersion(); /* Return the build date */ wxString GetBuildVersion(); /* Return the build date */
wxString GetAboutBuildVersion(); /* Return custom build date for about dialog */ wxString GetAboutBuildVersion(); /* Return custom build date for about
* dialog */
/** /**
* function Affiche_1_Parametre * function Affiche_1_Parametre
...@@ -281,18 +293,18 @@ wxString GetAboutBuildVersion(); /* Return custom build date for about dialog ...@@ -281,18 +293,18 @@ wxString GetAboutBuildVersion(); /* Return custom build date for about dialog
* If "by posting on this line * If "by posting on this line
* Color = color display * Color = color display
*/ */
void Affiche_1_Parametre( WinEDA_DrawFrame* frame, void Affiche_1_Parametre( WinEDA_DrawFrame* frame,
int pos_X, int pos_X,
const wxString& texte_H, const wxString& texte_H,
const wxString& texte_L, const wxString& texte_L,
int color ); int color );
int GetTimeStamp(); int GetTimeStamp();
int DisplayColorFrame( wxWindow* parent, int OldColor ); int DisplayColorFrame( wxWindow* parent, int OldColor );
int GetCommandOptions( const int argc, const char** argv, int GetCommandOptions( const int argc, const char** argv,
const char* stringtst, const char** optarg, const char* stringtst, const char** optarg,
int* optind ); int* optind );
/* Returns to display the value of a parameter, by type of units selected /* Returns to display the value of a parameter, by type of units selected
...@@ -302,7 +314,7 @@ int GetCommandOptions( const int argc, const char** argv, ...@@ -302,7 +314,7 @@ int GetCommandOptions( const int argc, const char** argv,
*/ */
const wxString& valeur_param( int valeur, wxString& buf_texte ); const wxString& valeur_param( int valeur, wxString& buf_texte );
wxString ReturnUnitSymbol( int Units = g_UnitMetric ); wxString ReturnUnitSymbol( int Units = g_UnitMetric );
/** /**
* Get a human readable units string. * Get a human readable units string.
...@@ -313,10 +325,10 @@ wxString ReturnUnitSymbol( int Units = g_UnitMetric ); ...@@ -313,10 +325,10 @@ wxString ReturnUnitSymbol( int Units = g_UnitMetric );
* @param units - The units text to return. * @param units - The units text to return.
* @return The human readable units string. * @return The human readable units string.
*/ */
wxString GetUnitsLabel( int units ); wxString GetUnitsLabel( int units );
int ReturnValueFromString( int Units, const wxString& TextValue, int ReturnValueFromString( int Units, const wxString& TextValue,
int Internal_Unit ); int Internal_Unit );
/** Function ReturnStringFromValue /** Function ReturnStringFromValue
* Return the string from Value, according to units (inch, mm ...) for display, * Return the string from Value, according to units (inch, mm ...) for display,
...@@ -325,40 +337,49 @@ int ReturnValueFromString( int Units, const wxString& TextValue, ...@@ -325,40 +337,49 @@ int ReturnValueFromString( int Units, const wxString& TextValue,
* @param aValue = value in Internal_Unit * @param aValue = value in Internal_Unit
* @param aInternal_Unit = units per inch for Value * @param aInternal_Unit = units per inch for Value
* @param aAdd_unit_symbol = true to add symbol unit to the string value * @param aAdd_unit_symbol = true to add symbol unit to the string value
* @return a wxString what contains value and optionnaly the sumbol unit (like 2.000 mm) * @return a wxString what contains value and optionally the symbol unit (like
* 2.000 mm)
*/ */
wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, wxString ReturnStringFromValue( int aUnits,
bool aAdd_unit_symbol = false ); int aValue,
int aInternal_Unit,
bool aAdd_unit_symbol = false );
void AddUnitSymbol( wxStaticText& Stext, int Units = g_UnitMetric ); void AddUnitSymbol( wxStaticText& Stext, int Units = g_UnitMetric );
/* Add string " (mm):" or " ("):" to the static text Stext. /* Add string " (mm):" or " ("):" to the static text Stext.
* Used in dialog boxes for entering values depending on selected units */ * Used in dialog boxes for entering values depending on selected units */
void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value,
int Internal_Unit ); int Internal_Unit );
/* Convert the number Value in a string according to the internal units /* Convert the number Value in a string according to the internal units
* and the selected unit (g_UnitMetric) and put it in the wxTextCtrl TextCtrl */ * and the selected unit (g_UnitMetric) and put it in the wxTextCtrl TextCtrl
int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, **/
int Internal_Unit ); int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr,
int Internal_Unit );
/* return a String List from a string, whith a specific splitter*/ /* return a String List from a string, with a specific splitter*/
wxArrayString* wxStringSplit(wxString txt, wxChar splitter); wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
/** /**
* Function To_User_Unit * Function To_User_Unit
* Convert in inch or mm the variable "val" (double)given in internal units * Convert in inch or mm the variable "val" (double)given in internal units
* @return the converted value, in double * @return the converted value, in double
* @param is_metric : true if the result must be returned in mm , false if inches * @param is_metric : true if the result must be returned in mm , false if
* inches
* @param val : double : the given value * @param val : double : the given value
* @param internal_unit_value = internal units per inch * @param internal_unit_value = internal units per inch
*/ */
double To_User_Unit( bool is_metric, double val, int internal_unit_value ); double To_User_Unit( bool is_metric,
double val,
int From_User_Unit( bool is_metric, double val, int internal_unit_value ); int internal_unit_value );
wxString GenDate();
void MyFree( void* pt_mem ); int From_User_Unit( bool is_metric,
void* MyZMalloc( size_t nb_octets ); double val,
void* MyMalloc( size_t nb_octets ); int internal_unit_value );
wxString GenDate();
void MyFree( void* pt_mem );
void* MyZMalloc( size_t nb_octets );
void* MyMalloc( size_t nb_octets );
#endif /* __INCLUDE__COMMON_H__ */ #endif /* __INCLUDE__COMMON_H__ */
...@@ -9,27 +9,17 @@ ...@@ -9,27 +9,17 @@
#define __INCLUDE__CONFIRM_H__ 1 #define __INCLUDE__CONFIRM_H__ 1
void DisplayError( wxWindow* parent, const wxString& msg, int displaytime = 0 ); void DisplayError( wxWindow* parent, const wxString& msg,
void DisplayInfoMessage( wxWindow* parent, const wxString& msg, int displaytime = 0 ); int displaytime = 0 );
void DisplayInfoMessage( wxWindow* parent, const wxString& msg,
/* Routines d'affichage messages ( disparait au bout de displaytime 0.1 secondes) */ int displaytime = 0 );
bool IsOK( wxWindow* parent, const wxString& msg ); bool IsOK( wxWindow* parent, const wxString& msg );
/* Routine affichant la fenetre "CONFIRMATION"
* Retourne 1 ou 0 selon reponse Yes / No */
int Get_Message( const wxString& title, int Get_Message( const wxString& title,
const wxString& frame_caption, const wxString& frame_caption,
wxString& buffer, wxString& buffer,
wxWindow* frame ); wxWindow* frame );
/* Fonction d'installation du menu de Dialogue
* entree: titre = titre a afficher
* entree/sortie :buffer : contient la reponse
* si a l'appel buffer n'est pas vide, son contenu est aussi
* affiche, mais disparait a la 1ere correction */
#endif /* __INCLUDE__CONFIRM_H__ */ #endif /* __INCLUDE__CONFIRM_H__ */
/** /**
* This file is part of the common libary. * This file is part of the common library.
* @file eda_doc.h * @file eda_doc.h
* @see common.h * @see common.h
*/ */
...@@ -8,29 +8,27 @@ ...@@ -8,29 +8,27 @@
#define __INCLUDE__EDA_DOC_H__ 1 #define __INCLUDE__EDA_DOC_H__ 1
/* Search the text Database for found all the key words in the KeyList.
/* Recherche si dans le texte Database on retrouve tous les mots *
* cles donnes dans KeyList ( KeyList = suite de mots cles * Returns:
* separes par des espaces * 0 if no keyword is found
* Retourne: * 1 if keyword found.
* 0 si aucun mot cle trouve
* 1 si mot cle trouve
*/ */
int KeyWordOk( const wxString& KeyList, int KeyWordOk( const wxString& KeyList,
const wxString& Database ); const wxString& Database );
/** Function GetAssociatedDocument /** Function GetAssociatedDocument
* open a document (file) with the suitable browser * open a document (file) with the suitable browser
* @param aFrame = main frame * @param aFrame = main frame
* @param aDocName = filename of file to open (Full filename or short filename) * @param aDocName = filename of file to open (Full filename or short filename)
* if DocName is starting by http: or ftp: or www. the default internet browser is launched * if DocName is starting by http: or ftp: or www. the default internet
* browser is launched
* @param aPaths = a wxPathList to explore. * @param aPaths = a wxPathList to explore.
* if NULL or aDocName is a full filename, aPath is not used. * if NULL or aDocName is a full filename, aPath is not used.
*/ */
bool GetAssociatedDocument( wxFrame* aFrame, bool GetAssociatedDocument( wxFrame* aFrame,
const wxString& aDocName, const wxString& aDocName,
const wxPathList* aPaths = NULL ); const wxPathList* aPaths = NULL );
#endif /* __INCLUDE__EDA_DOC_H__ */ #endif /* __INCLUDE__EDA_DOC_H__ */
/********************/ /********************/
/* includes systeme */ /* System includes. */
/********************/ /********************/
#ifndef FCTSYS_H #ifndef FCTSYS_H
#define FCTSYS_H #define FCTSYS_H
...@@ -56,9 +56,10 @@ ...@@ -56,9 +56,10 @@
#define USE_RESIZE_BORDER #define USE_RESIZE_BORDER
#if defined(__UNIX__) || defined(USE_RESIZE_BORDER) #if defined(__UNIX__) || defined(USE_RESIZE_BORDER)
#define MAYBE_RESIZE_BORDER wxRESIZE_BORDER // linux users like resizeable borders #define MAYBE_RESIZE_BORDER wxRESIZE_BORDER // linux users like resizeable
// borders
#else #else
#define MAYBE_RESIZE_BORDER 0 // no resizeable border #define MAYBE_RESIZE_BORDER 0 // no resizeable border
#endif #endif
#include "config.h" #include "config.h"
......
/** /**
* This file is part of the common libary * This file is part of the common library
* TODO brief description * TODO brief description
* @file gestfich.h * @file gestfich.h
* @see common.h * @see common.h
...@@ -21,77 +21,56 @@ class WinEDAListBox; ...@@ -21,77 +21,56 @@ class WinEDAListBox;
* @param file = PDF file to open * @param file = PDF file to open
* @return true is success, false if no PDF viewer found * @return true is success, false if no PDF viewer found
*/ */
bool OpenPDF( const wxString& file ); bool OpenPDF( const wxString& file );
void OpenFile( const wxString& file );
bool EDA_DirectorySelector( const wxString& Title, /* Titre de la fenetre */
wxString& Path, /* Chemin par defaut */
int flag, /* reserve */
wxWindow* Frame, /* parent frame */
const wxPoint& Pos );
wxString EDA_FileSelector( const wxString &Title, /* Window title */
const wxString &Path, /* default path */
const wxString &FileName, /* default filename */
const wxString &Ext, /* default extension */
const wxString &Mask, /* Display filename mask */
wxWindow * Frame, /* parent frame */
int flag, /* wxSAVE, wxOPEN ..*/
const bool keep_working_directory, /* true = do not change the C.W.D. */
const wxPoint& Pos = wxPoint( -1, -1 )
);
/* Calcule le nom complet d'un file d'apres les chaines
* dir = prefixe (chemin)
* shortname = nom avec ou sans chemin ou extension
* ext = extension
*
* si la chaine name possede deja un chemin ou une extension, elles
* ne seront pas modifiees
*
* retourne la chaine calculee */
wxString MakeReducedFileName( const wxString& fullfilename, void OpenFile( const wxString& file );
const wxString& default_path,
const wxString& default_ext );
/* Calcule le nom "reduit" d'un file d'apres les chaines bool EDA_DirectorySelector( const wxString& Title,
* fullfilename = nom complet wxString& Path,
* default_path = prefixe (chemin) par defaut int flag, /* reserve */
* default_ext = extension par defaut wxWindow* Frame,
* const wxPoint& Pos );
* retourne le nom reduit, c'est a dire:
* sans le chemin si le chemin est default_path wxString EDA_FileSelector( const wxString& Title,
* avec ./ si si le chemin est le chemin courant const wxString& Path,
* sans l'extension si l'extension est default_ext const wxString& FileName,
const wxString& Ext,
const wxString& Mask,
wxWindow* Frame,
int flag,
const bool keep_working_directory,
const wxPoint& Pos = wxPoint( -1, -1 ) );
/* Return file name without path or extension.
* *
* Renvoie un chemin en notation unix ('/' en separateur de repertoire) * If the path is in the default kicad path, ./ is prepended to the
* file name. If the file name has the default extension, the file
* name is returned without an extension.
*/ */
WinEDAListBox* GetFileNames( char* Directory, char* Mask ); wxString MakeReducedFileName( const wxString& fullfilename,
const wxString& default_path,
const wxString& default_ext );
WinEDAListBox* GetFileNames( char* Directory, char* Mask );
/* Change l'extension du "filename FullFileName" en NewExt.
* Retourne FullFileName */
int ExecuteFile( wxWindow* frame, const wxString& ExecFile, int ExecuteFile( wxWindow* frame, const wxString& ExecFile,
const wxString& param = wxEmptyString ); const wxString& param = wxEmptyString );
void AddDelimiterString( wxString& string ); void AddDelimiterString( wxString& string );
wxString FindKicadHelpPath();
/* Find absolute path for kicad/help (or kicad/help/<language>) */ /* Find absolute path for kicad/help (or kicad/help/<language>) */
wxString FindKicadHelpPath();
wxString ReturnKicadDatasPath();
/* Retourne le chemin des donnees communes de kicad. */ /* Return the kicad common data path. */
wxString ReturnKicadDatasPath();
wxString FindKicadFile( const wxString& shortname );
/* Search the executable file shortname in kicad binary path and return /* Search the executable file shortname in kicad binary path and return
* full file name if found or shortname */ * full file name if found or shortname */
wxString FindKicadFile( const wxString& shortname );
/** /**
...@@ -105,4 +84,3 @@ extern wxString QuoteFullPath( wxFileName& fn, ...@@ -105,4 +84,3 @@ extern wxString QuoteFullPath( wxFileName& fn,
wxPathFormat format = wxPATH_NATIVE ); wxPathFormat format = wxPATH_NATIVE );
#endif /* __INCLUDE__GESTFICH_H__ */ #endif /* __INCLUDE__GESTFICH_H__ */
/**************/ /**************/
/* gr_basic.h */ /* gr_basic.h */
/**************/ /**************/
#ifndef GR_BASIC #ifndef GR_BASIC
#define GR_BASIC #define GR_BASIC
...@@ -10,121 +10,152 @@ ...@@ -10,121 +10,152 @@
class EDA_Rect; class EDA_Rect;
/* Constantes utiles */ #define GR_COPY 0
#define GR_OR 0x01000000
#define GR_XOR 0x02000000
#define GR_AND 0x04000000
#define GR_NXOR 0x08000000
#define GR_COPY 0 #define GR_SURBRILL 0x80000000
#define GR_OR 0x01000000
#define GR_XOR 0x02000000
#define GR_AND 0x04000000
#define GR_NXOR 0x08000000
#define GR_SURBRILL 0x80000000 #define GR_M_LEFT_DOWN 0x10000000
#define GR_M_RIGHT_DOWN 0x20000000
#define GR_M_MIDDLE_DOWN 0x40000000
#define GR_M_DCLICK 0x80000000
#define GR_M_LEFT_DOWN 0x10000000
#define GR_M_RIGHT_DOWN 0x20000000
#define GR_M_MIDDLE_DOWN 0x40000000
#define GR_M_DCLICK 0x80000000
/* variables generales */
extern int g_XorMode; extern int g_XorMode;
extern int g_DrawBgColor; extern int g_DrawBgColor;
typedef enum { /* Line styles for Get/SetLineStyle. */ typedef enum {
/* Line styles for Get/SetLineStyle. */
GR_SOLID_LINE = 0, GR_SOLID_LINE = 0,
GR_DOTTED_LINE = 1, GR_DOTTED_LINE = 1,
GR_DASHED_LINE = 3 GR_DASHED_LINE = 3
} GRLineStypeType; } GRLineStypeType;
/*******************************************************/ int GRMapX( int x );
/* Prototypage des fonctions definies dans gr_basic.cc */ int GRMapY( int y );
/*******************************************************/
int GRMapX(int x);
int GRMapY(int y);
class WinEDA_DrawPanel; class WinEDA_DrawPanel;
/* routines generales */ void GRSetDrawMode( wxDC* DC, int mode );
void GRSetDrawMode(wxDC * DC, int mode); int GRGetDrawMode( wxDC* DC );
int GRGetDrawMode(wxDC * DC); void GRResetPenAndBrush( wxDC* DC );
void GRResetPenAndBrush(wxDC * DC); void GRSetColorPen( wxDC* DC, int Color, int width = 1, int stype = wxSOLID );
void GRSetColorPen(wxDC * DC, int Color , int width = 1, int stype = wxSOLID); void GRSetBrush( wxDC* DC, int Color, int fill = 0 );
void GRSetBrush(wxDC * DC, int Color , int fill = 0);
/** function GRForceBlackPen /** function GRForceBlackPen
* @param flagforce True to force a black pen whenever the asked color * @param flagforce True to force a black pen whenever the asked color
*/ */
void GRForceBlackPen(bool flagforce ); void GRForceBlackPen( bool flagforce );
/** function GetGRForceBlackPenState /** function GetGRForceBlackPenState
* @return ForceBlackPen (True if a black pen was forced) * @return ForceBlackPen (True if a black pen was forced)
*/ */
bool GetGRForceBlackPenState( void ); bool GetGRForceBlackPenState( void );
void SetPenMinWidth(int minwidth); /* ajustage de la largeur mini de plume */ void SetPenMinWidth( int minwidth );
void GRLine(EDA_Rect * aClipBox, wxDC * aDC, wxPoint aStart, wxPoint aEnd, int aWidth, int aColor); void GRLine( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aStart, wxPoint aEnd,
void GRLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); int aWidth, int aColor );
void GRMixedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); void GRLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2,
void GRSMixedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); int y2, int width, int Color );
void GRDashedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); void GRMixedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
void GRSDashedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); int width, int Color );
void GRDashedLineTo(EDA_Rect * ClipBox,wxDC * DC, int x2, int y2, int width, int Color); void GRSMixedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
void GRSDashedLineTo(EDA_Rect * ClipBox,wxDC * DC, int x2, int y2, int width, int Color); int width, int Color );
void GRSLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); void GRDashedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
void GRMoveTo(int x, int y); int width, int Color );
void GRSMoveTo(int x, int y); void GRSDashedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2,
void GRLineTo(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int width, int Color); int y2, int width, int Color );
void GRSLineTo(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int width, int Color); void GRDashedLineTo( EDA_Rect* ClipBox, wxDC* DC, int x2, int y2, int width,
void GRMoveRel(int x, int y); int Color );
void GRSMoveRel(int x, int y); void GRSDashedLineTo( EDA_Rect* ClipBox, wxDC* DC, int x2, int y2, int width,
void GRLineRel(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int width, int Color); int Color );
void GRSLineRel(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int width, int Color); void GRSLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
int width, int Color );
void GRMoveTo( int x, int y );
void GRPoly(EDA_Rect * ClipBox, wxDC * DC, int n, wxPoint Points[], bool Fill, int width, int Color, int BgColor); void GRSMoveTo( int x, int y );
void GRLineTo( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int width,
void GRBezier(EDA_Rect* ClipBox, wxDC* DC,int x1, int y1, int x2, int y2, int x3, int y3,int width, int Color); int Color );
void GRBezier(EDA_Rect* ClipBox, wxDC* DC,int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4,int width, int Color); void GRSLineTo( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int width,
int Color );
void GRMoveRel( int x, int y );
void GRSMoveRel( int x, int y );
void GRLineRel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int width,
int Color );
void GRSLineRel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int width,
int Color );
void GRPoly( EDA_Rect* ClipBox, wxDC* DC, int n, wxPoint Points[], bool Fill,
int width, int Color, int BgColor );
void GRBezier( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
int x3, int y3, int width, int Color );
void GRBezier( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
int x3, int y3, int x4, int y4, int width, int Color );
/** /**
* Function GRClosedPoly * Function GRClosedPoly
* draws a closed polygon onto the drawing context \a aDC and optionally fills and/or * draws a closed polygon onto the drawing context \a aDC and optionally fills
* draws a border around it. * and/or draws a border around it.
* @param ClipBox defines a rectangular boundary outside of which no drawing will occur. * @param ClipBox defines a rectangular boundary outside of which no drawing
* will occur.
* @param aDC the device context into which drawing should occur. * @param aDC the device context into which drawing should occur.
* @param aPointCount the number of points in the array \a aPointArray. * @param aPointCount the number of points in the array \a aPointArray.
* @param aPointArray an array holding the wxPoints in the polygon. * @param aPointArray an array holding the wxPoints in the polygon.
* @param doFill true if polygon is to be filled, else false and only the boundary is drawn. * @param doFill true if polygon is to be filled, else false and only the
* boundary is drawn.
* @param aPenColor the color index of the border. * @param aPenColor the color index of the border.
* @param aFillColor the fill color of the polygon's interior. * @param aFillColor the fill color of the polygon's interior.
*/ */
void GRClosedPoly(EDA_Rect* ClipBox, wxDC* aDC, int aPointCount, wxPoint aPoints[], bool doFill, int aPenColor, int aFillColor); void GRClosedPoly( EDA_Rect* ClipBox,
wxDC * aDC,
int aPointCount,
wxPoint aPoints[],
bool doFill,
int aPenColor,
int aFillColor );
// @todo could make these 2 closed polygons calls a single function and default the aPenWidth argument // @todo could make these 2 closed polygons calls a single function and default
// the aPenWidth argument
/** /**
* Function GRClosedPoly * Function GRClosedPoly
* draws a closed polygon onto the drawing context \a aDC and optionally fills and/or * draws a closed polygon onto the drawing context \a aDC and optionally fills
* draws a border around it. * and/or draws a border around it.
* @param ClipBox defines a rectangular boundary outside of which no drawing will occur. * @param ClipBox defines a rectangular boundary outside of which no drawing
* will occur.
* @param aDC the device context into which drawing should occur. * @param aDC the device context into which drawing should occur.
* @param aPointCount the number of points in the array \a aPointArray. * @param aPointCount the number of points in the array \a aPointArray.
* @param aPointArray an array holding the wxPoints in the polygon. * @param aPointArray an array holding the wxPoints in the polygon.
* @param doFill true if polygon is to be filled, else false and only the boundary is drawn. * @param doFill true if polygon is to be filled, else false and only the
* @param aPenWidth is the width of the pen to use on the perimeter, can be zero. * boundary is drawn.
* @param aPenWidth is the width of the pen to use on the perimeter, can be
* zero.
* @param aPenColor the color index of the border. * @param aPenColor the color index of the border.
* @param aFillColor the fill color of the polygon's interior. * @param aFillColor the fill color of the polygon's interior.
*/ */
void GRClosedPoly(EDA_Rect * ClipBox, wxDC* aDC, int aPointCount, wxPoint aPoints[], bool doFill, int aPenWidth, int aPenColor, int aFillColor); void GRClosedPoly( EDA_Rect* ClipBox,
wxDC* aDC,
int aPointCount,
wxPoint aPoints[],
bool doFill,
int aPenWidth,
int aPenColor,
int aFillColor );
/** /**
* Function GRCircle * Function GRCircle
* draws a circle onto the drawing context \a aDC centered at the user coordinates (x,y) * draws a circle onto the drawing context \a aDC centered at the user
* coordinates (x,y)
* *
* @param ClipBox defines a rectangular boundary outside of which no drawing will occur. * @param ClipBox defines a rectangular boundary outside of which no drawing
* will occur.
* @param aDC the device context into which drawing should occur. * @param aDC the device context into which drawing should occur.
* @param x The x coordinate in user space of the center of the circle. * @param x The x coordinate in user space of the center of the circle.
* @param x The y coordinate in user space of the center of the circle. * @param x The y coordinate in user space of the center of the circle.
...@@ -132,58 +163,66 @@ void GRClosedPoly(EDA_Rect * ClipBox, wxDC* aDC, int aPointCount, wxPoint aPoint ...@@ -132,58 +163,66 @@ void GRClosedPoly(EDA_Rect * ClipBox, wxDC* aDC, int aPointCount, wxPoint aPoint
* @param aColor is an index into our color table of RGB colors. * @param aColor is an index into our color table of RGB colors.
* @see EDA_Colors and colors.h * @see EDA_Colors and colors.h
*/ */
void GRCircle(EDA_Rect * ClipBox, wxDC * aDC, int x, int y, int aRadius, int aColor); void GRCircle( EDA_Rect* ClipBox, wxDC* aDC, int x, int y, int aRadius,
int aColor );
void GRCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int width, int Color);
void GRFilledCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, void GRCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r, int width,
int width, int Color, int BgColor); int Color );
void GRSCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int width, int Color); void GRFilledCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r,
void GRSFilledCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int width, int Color, int BgColor );
int width, int Color, int BgColor); void GRSCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r, int width,
void GRArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int StAngle, int EndAngle, int r, int Color); int Color );
void GRArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int StAngle, int EndAngle, int r, int width, int Color); void GRSFilledCircle( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int r,
void GRArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color, int BgColor );
int xc, int yc, int Color); void GRArc( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int StAngle,
void GRArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int EndAngle, int r, int Color );
int xc, int yc, int width, int Color); void GRArc( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int StAngle,
void GRSArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int EndAngle, int r, int width, int Color );
int xc, int yc, int width, int Color); void GRArc1( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
void GRSArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int StAngle, int EndAngle, int r, int width, int Color); int xc, int yc, int Color );
void GRFilledArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y, void GRArc1( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
int StAngle, int EndAngle, int r, int Color, int BgColor); int xc, int yc, int width, int Color );
void GRFilledArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y, void GRSArc1( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
int StAngle, int EndAngle, int r, int width, int Color, int BgColor); int xc, int yc, int width, int Color );
void GRSFilledArc(EDA_Rect * ClipBox, wxDC * DC, int x, int y, void GRSArc( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int StAngle,
int StAngle, int EndAngle, int r, int width, int Color, int BgColor); int EndAngle, int r, int width, int Color );
void GRCSegm(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); void GRFilledArc( EDA_Rect* ClipBox, wxDC* DC, int x, int y,
void GRFillCSegm(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); int StAngle, int EndAngle, int r, int Color, int BgColor );
void GRSCSegm(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); void GRFilledArc( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int StAngle,
void GRSFillCSegm(EDA_Rect * ClipBox, wxDC * DC, int EndAngle, int r, int width, int Color, int BgColor );
int x1, int y1, int x2, int y2, int width, int Color); void GRSFilledArc( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int StAngle,
int EndAngle, int r, int width, int Color, int BgColor );
void GRSetColor(int Color); void GRCSegm( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
int width, int Color );
void GRFillCSegm( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
int width, int Color );
void GRSCSegm( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
int width, int Color );
void GRSFillCSegm( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
int width, int Color );
void GRSetColor( int Color );
void GRSetDefaultPalette(); void GRSetDefaultPalette();
int GRGetColor(); int GRGetColor();
void GRPutPixel(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int color); void GRPutPixel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int color );
void GRSPutPixel(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int color); void GRSPutPixel( EDA_Rect* ClipBox, wxDC* DC, int x, int y, int color );
int GRGetPixel(wxDC * DC, int x, int y); int GRGetPixel( wxDC* DC, int x, int y );
void GRFilledRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int Color, int BgColor); int x2, int y2, int Color, int BgColor );
void GRFilledRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, void GRFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int width, int Color, int BgColor); int x2, int y2, int width, int Color, int BgColor );
void GRSFilledRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, void GRSFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int Color, int BgColor); int x2, int y2, int Color, int BgColor );
void GRSFilledRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, void GRSFilledRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int width, int Color, int BgColor); int x2, int y2, int width, int Color, int BgColor );
void GRRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int Color); int x2, int y2, int Color );
void GRRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, void GRRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int width, int Color); int x2, int y2, int width, int Color );
void GRSRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, void GRSRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int Color); int x2, int y2, int Color );
void GRSRect(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, void GRSRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
int x2, int y2, int width, int Color); int x2, int y2, int width, int Color );
#endif /* define GR_BASIC */ #endif /* define GR_BASIC */
/** /**
* This file is part of the common libary \n * This file is part of the common library \n
* Custom string manipulation routines. * Custom string manipulation routines.
* @file kicad_string.h * @file kicad_string.h
* @see common.h, string.cpp * @see common.h, string.cpp
...@@ -10,78 +10,74 @@ ...@@ -10,78 +10,74 @@
#define __INCLUDE__KICAD_STRING_H__ 1 #define __INCLUDE__KICAD_STRING_H__ 1
char* strupper( char* Text ); char* strupper( char* Text );
char* strlower( char* Text ); char* strlower( char* Text );
int ReadDelimitedText( char* dest, /* Read string delimited with (") character.
char* source, * Upload NbMaxChar max
int NbMaxChar ); * Returns the number of codes read in source
* dest is terminated by NULL
/* lit et place dans dest la chaine de caractere trouvee dans source, */
* delimitee par " . int ReadDelimitedText( char* dest,
* transfere NbMaxChar max char* source,
* retourne le nombre de codes lus dans source int NbMaxChar );
* dest est termine par NULL */
char* GetLine( FILE* File,
char* Line,
int* LineNum = NULL,
int SizeLine = 255 );
/* Routine de lecture de 1 ligne utile /* Read one line line from a file.
* retourne la 1ere ligne utile lue. * Returns the first useful line read by eliminating blank lines and comments.
* elimine lignes vides et commentaires */ */
char* StrPurge( char* text ); char* GetLine( FILE* File,
char* Line,
int* LineNum = NULL,
int SizeLine = 255 );
/* Supprime les caracteres Space en debut de la ligne text /* Remove leading and trailing whitespace.
* retourne un pointeur sur le 1er caractere non Space de text */ */
char* StrPurge( char* text );
char* DateAndTime( char* line );
wxString DateAndTime();
/* Retourne la chaine de caractere donnant date+heure */ /*Return a string giving the current date and time.
*/
char* DateAndTime( char* line );
wxString DateAndTime();
int StrLenNumCmp( const wxChar* str1,
const wxChar* str2,
int NbMax );
/* /*
* routine (compatible qsort() ) de comparaision pour classement alphab�tique * Routine (compatible with qsort ()) to sort by alphabetical order.
* Analogue a strncmp() mais les nombres sont compar�s selon leur valeur num�rique * Equivalent to strncmp () but the numbers are compared by their integer
* et non pas par leur code ascii */ * value not by their ASCII code.
*/
int StrNumICmp( const wxChar* str1, int StrLenNumCmp( const wxChar* str1,
const wxChar* str2 ); const wxChar* str2,
int NbMax );
/* routine (compatible qsort() ) de comparaison pour classement alphab�tique,
* avec lower case == upper case.
* Analogue a stricmp() mais les nombres sont compar�s selon leur valeur num�rique
* et non pas par leur code ascii */
int StrLenNumICmp( const wxChar* str1, /*
const wxChar* str2, * Routine (compatible with qsort ()) to sort by case insensitive alphabetical
int NbMax ); * order.
* Equivalent to strnicmp () but the numbers are compared by their integer
* value not by their ASCII code.
*/
int StrNumICmp( const wxChar* str1,
const wxChar* str2 );
/* routine (compatible qsort() ) de comparaison pour classement alphab�tique,
* avec lower case == upper case.
* Analogue a stricmp() mais les nombres sont compar�s selon leur valeur num�rique
* et non pas par leur code ascii */
bool WildCompareString( const wxString& pattern, int StrLenNumICmp( const wxChar* str1,
const wxString& string_to_tst, const wxChar* str2,
bool case_sensitive = TRUE ); int NbMax );
/* compare 2 noms de composants, selon regles usuelles /* Compare string against wild card pattern using the usual rules.
* ( Jokers * , ? , autorises). * (Wildcards *,?).
* la chaine de reference est "pattern" * The reference string is "pattern"
* si case_sensitive == TRUE (default), comparaison exacte * If case_sensitive == TRUE (default), exact comparison
* retourne TRUE si match FALSE si differences */ * Returns TRUE if pattern matched otherwise FALSE.
*/
char* to_point( char* Text ); bool WildCompareString( const wxString& pattern,
const wxString& string_to_tst,
bool case_sensitive = TRUE );
/* convertit les , en . dans une chaine. utilise pour compenser la fct printf /* Replaces decimal point with commas to generated international numbers.
* qui genere les flottants avec une virgule au lieu du point en mode international */ */
char* to_point( char* Text );
#endif /* __INCLUDE__KICAD_STRING_H__ */ #endif /* __INCLUDE__KICAD_STRING_H__ */
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "pcbstruct.h" #include "pcbstruct.h"
#include "dlist.h" #include "dlist.h"
#define L_MIN_DESSIN 1 /* Min width segments to allow draws with tickness */ #define L_MIN_DESSIN 1 /* Min width segments to allow draws with thickness */
class DPAD; class DPAD;
class BOARD_ITEM; class BOARD_ITEM;
...@@ -44,8 +44,6 @@ extern int g_PadCUColor; ...@@ -44,8 +44,6 @@ extern int g_PadCUColor;
extern int g_PadCMPColor; extern int g_PadCMPColor;
/* variables generales */
extern int g_TimeOut; // Timer for automatic saving extern int g_TimeOut; // Timer for automatic saving
extern int g_SaveTime; // Time for next saving extern int g_SaveTime; // Time for next saving
...@@ -59,7 +57,7 @@ extern DLIST<TRACK> g_CurrentTrackList; ...@@ -59,7 +57,7 @@ extern DLIST<TRACK> g_CurrentTrackList;
#define g_FirstTrackSegment \ #define g_FirstTrackSegment \
g_CurrentTrackList.GetFirst() ///< first segment created g_CurrentTrackList.GetFirst() ///< first segment created
extern PCB_SCREEN* ScreenPcb; /* Ecran principal */ extern PCB_SCREEN* ScreenPcb;
extern BOARD* g_ModuleEditor_Pcb; extern BOARD* g_ModuleEditor_Pcb;
/* Pad editing */ /* Pad editing */
......
...@@ -9,50 +9,48 @@ ...@@ -9,50 +9,48 @@
#include "class_base_screen.h" #include "class_base_screen.h"
#include "class_board_item.h" #include "class_board_item.h"
// Definitions relatives aux libariries // Definitions relatives aux libraries
#define ENTETE_LIBRAIRIE "PCBNEW-LibModule-V1" #define ENTETE_LIBRAIRIE "PCBNEW-LibModule-V1"
#define ENTETE_LIBDOC "PCBNEW-LibDoc----V1" #define ENTETE_LIBDOC "PCBNEW-LibDoc----V1"
#define L_ENTETE_LIB 18 #define L_ENTETE_LIB 18
#define EXT_DOC wxT( "mdc" ) #define EXT_DOC wxT( "mdc" )
/* Bits indicateurs du membre .Status, pour pistes, modules... */ #define FLAG1 (1 << 13) /* flag for free local computations */
#define FLAG0 (1 << 12) /* flag for free local computations */
#define BEGIN_ONPAD (1 << 11) /* flag indicating a start of segment pad */
#define END_ONPAD (1 << 10) /* flag indicating an end of segment pad */
#define BUSY (1 << 9) /* flag indicating that the structure has
* already been edited, in some routines */
#define DELETED (1 << 8) /* flag indicating structures erased nd set
* string "DELETED" */
#define NO_TRACE (1 << 7) /* The element must not be displayed */
#define FLAG1 (1 << 13) /* flag libre pour calculs locaux */ #define SURBRILL (1 << 5) /* element highlighted */
#define FLAG0 (1 << 12) /* flag libre pour calculs locaux */ #define DRAG (1 << 4) /* segment in drag mode */
#define BEGIN_ONPAD (1 << 11) /* flag indiquant un debut de segment sur pad */ #define EDIT (1 << 3) /* element being edited */
#define END_ONPAD (1 << 10) /* flag indiquant une fin de segment sur pad */ #define SEGM_FIXE (1 << 2) /* segment fixed (not erase global) */
#define BUSY (1 << 9) /* flag indiquant que la structure a deja #define SEGM_AR (1 << 1) /* segment marked for auto routing */
* ete examinee, dans certaines routines */ #define CHAIN (1 << 0) /* mark segment */
#define DELETED (1 << 8) /* Bit flag de Status pour structures effacee
* et mises en chaine "DELETED" */
#define NO_TRACE (1 << 7) /* l'element ne doit pas etre affiche */
#define SURBRILL (1 << 5) /* element en surbrillance */
#define DRAG (1 << 4) /* segment en mode drag */
#define EDIT (1 << 3) /* element en cours d'edition */
#define SEGM_FIXE (1 << 2) /* segment FIXE ( pas d'effacement global ) */
#define SEGM_AR (1 << 1) /* segment Auto_Route */
#define CHAIN (1 << 0) /* segment marque */
/* Layer identification (layer number) */ /* Layer identification (layer number) */
#define FIRST_COPPER_LAYER 0 #define FIRST_COPPER_LAYER 0
#define COPPER_LAYER_N 0 #define COPPER_LAYER_N 0
#define LAYER_N_2 1 /* Numero layer 2 */ #define LAYER_N_2 1
#define LAYER_N_3 2 /* Numero layer 3 */ #define LAYER_N_3 2
#define LAYER_N_4 3 /* Numero layer 4 */ #define LAYER_N_4 3
#define LAYER_N_5 4 /* Numero layer 5 */ #define LAYER_N_5 4
#define LAYER_N_6 5 /* Numero layer 6 */ #define LAYER_N_6 5
#define LAYER_N_7 6 /* Numero layer 7 */ #define LAYER_N_7 6
#define LAYER_N_8 7 /* Numero layer 8 */ #define LAYER_N_8 7
#define LAYER_N_9 8 /* Numero layer 9 */ #define LAYER_N_9 8
#define LAYER_N_10 9 /* Numero layer 10 */ #define LAYER_N_10 9
#define LAYER_N_11 10 /* Numero layer 11 */ #define LAYER_N_11 10
#define LAYER_N_12 11 /* Numero layer 12 */ #define LAYER_N_12 11
#define LAYER_N_13 12 /* Numero layer 13 */ #define LAYER_N_13 12
#define LAYER_N_14 13 /* Numero layer 14 */ #define LAYER_N_14 13
#define LAYER_N_15 14 /* Numero layer 15 */ #define LAYER_N_15 14
#define LAYER_CMP_N 15 #define LAYER_CMP_N 15
#define CMP_N 15 #define CMP_N 15
#define LAST_COPPER_LAYER 15 #define LAST_COPPER_LAYER 15
...@@ -78,25 +76,22 @@ ...@@ -78,25 +76,22 @@
#define LAYER_COUNT 32 #define LAYER_COUNT 32
/*************************************/ #define CUIVRE_LAYER (1 << COPPER_LAYER_N) ///< bit mask for copper layer
/* constantes de gestion des couches */ #define LAYER_2 (1 << LAYER_N_2) ///< bit mask for layer 2
/*************************************/ #define LAYER_3 (1 << LAYER_N_3) ///< bit mask for layer 3
#define CUIVRE_LAYER (1 << COPPER_LAYER_N) ///< bit mask for copper layer #define LAYER_4 (1 << LAYER_N_4) ///< bit mask for layer 4
#define LAYER_2 (1 << LAYER_N_2) ///< bit mask for layer 2 #define LAYER_5 (1 << LAYER_N_5) ///< bit mask for layer 5
#define LAYER_3 (1 << LAYER_N_3) ///< bit mask for layer 3 #define LAYER_6 (1 << LAYER_N_6) ///< bit mask for layer 6
#define LAYER_4 (1 << LAYER_N_4) ///< bit mask for layer 4 #define LAYER_7 (1 << LAYER_N_7) ///< bit mask for layer 7
#define LAYER_5 (1 << LAYER_N_5) ///< bit mask for layer 5 #define LAYER_8 (1 << LAYER_N_8) ///< bit mask for layer 8
#define LAYER_6 (1 << LAYER_N_6) ///< bit mask for layer 6 #define LAYER_9 (1 << LAYER_N_9) ///< bit mask for layer 9
#define LAYER_7 (1 << LAYER_N_7) ///< bit mask for layer 7 #define LAYER_10 (1 << LAYER_N_10) ///< bit mask for layer 10
#define LAYER_8 (1 << LAYER_N_8) ///< bit mask for layer 8 #define LAYER_11 (1 << LAYER_N_11) ///< bit mask for layer 11
#define LAYER_9 (1 << LAYER_N_9) ///< bit mask for layer 9 #define LAYER_12 (1 << LAYER_N_12) ///< bit mask for layer 12
#define LAYER_10 (1 << LAYER_N_10) ///< bit mask for layer 10 #define LAYER_13 (1 << LAYER_N_13) ///< bit mask for layer 13
#define LAYER_11 (1 << LAYER_N_11) ///< bit mask for layer 11 #define LAYER_14 (1 << LAYER_N_14) ///< bit mask for layer 14
#define LAYER_12 (1 << LAYER_N_12) ///< bit mask for layer 12 #define LAYER_15 (1 << LAYER_N_15) ///< bit mask for layer 15
#define LAYER_13 (1 << LAYER_N_13) ///< bit mask for layer 13 #define CMP_LAYER (1 << LAYER_CMP_N) ///< bit mask for component layer
#define LAYER_14 (1 << LAYER_N_14) ///< bit mask for layer 14
#define LAYER_15 (1 << LAYER_N_15) ///< bit mask for layer 15
#define CMP_LAYER (1 << LAYER_CMP_N) ///< bit mask for component layer
#define ADHESIVE_LAYER_CU (1 << ADHESIVE_N_CU) #define ADHESIVE_LAYER_CU (1 << ADHESIVE_N_CU)
#define ADHESIVE_LAYER_CMP (1 << ADHESIVE_N_CMP) #define ADHESIVE_LAYER_CMP (1 << ADHESIVE_N_CMP)
#define SOLDERPASTE_LAYER_CU (1 << SOLDERPASTE_N_CU) #define SOLDERPASTE_LAYER_CU (1 << SOLDERPASTE_N_CU)
...@@ -115,15 +110,14 @@ ...@@ -115,15 +110,14 @@
#define LAST_NON_COPPER_LAYER EDGE_N #define LAST_NON_COPPER_LAYER EDGE_N
// extra bits 0xE0000000 // extra bits 0xE0000000
/* Helpful global layers maks : */ /* Helpful global layers mask : */
#define ALL_LAYERS 0x1FFFFFFF // Pcbnew used 29 layers #define ALL_LAYERS 0x1FFFFFFF // Pcbnew used 29 layers
#define FULL_LAYERS 0xFFFFFFFF // Gerbview used 32 layers #define FULL_LAYERS 0xFFFFFFFF // Gerbview used 32 layers
#define ALL_NO_CU_LAYERS 0x1FFF0000 #define ALL_NO_CU_LAYERS 0x1FFF0000
#define ALL_CU_LAYERS 0x0000FFFF #define ALL_CU_LAYERS 0x0000FFFF
#define INTERNAL_LAYERS 0x00007FFE /* Bits layers internes */ #define INTERNAL_LAYERS 0x00007FFE
#define EXTERNAL_LAYERS 0x00008001 #define EXTERNAL_LAYERS 0x00008001
/* Forward declaration */
class NETINFO_ITEM; class NETINFO_ITEM;
class MARKER_PCB; class MARKER_PCB;
class RATSNEST_ITEM; class RATSNEST_ITEM;
...@@ -155,7 +149,7 @@ enum ELEMENTS_NUMBERS ...@@ -155,7 +149,7 @@ enum ELEMENTS_NUMBERS
* tests whether a given integer is a valid layer index * tests whether a given integer is a valid layer index
* @param aLayerIndex = Layer index to test * @param aLayerIndex = Layer index to test
* @return true if aLayerIndex is a valid layer index * @return true if aLayerIndex is a valid layer index
*/ */
inline bool IsValidLayerIndex( int aLayerIndex ) inline bool IsValidLayerIndex( int aLayerIndex )
{ {
return aLayerIndex >= 0 && aLayerIndex < NB_LAYERS; return aLayerIndex >= 0 && aLayerIndex < NB_LAYERS;
...@@ -166,10 +160,11 @@ inline bool IsValidLayerIndex( int aLayerIndex ) ...@@ -166,10 +160,11 @@ inline bool IsValidLayerIndex( int aLayerIndex )
* tests whether an integer is a valid copper layer index * tests whether an integer is a valid copper layer index
* @param aLayerIndex = Layer index to test * @param aLayerIndex = Layer index to test
* @return true if aLayerIndex is a valid copper layer index * @return true if aLayerIndex is a valid copper layer index
*/ */
inline bool IsValidCopperLayerIndex( int aLayerIndex ) inline bool IsValidCopperLayerIndex( int aLayerIndex )
{ {
return aLayerIndex >= FIRST_COPPER_LAYER && aLayerIndex <= LAST_COPPER_LAYER; return aLayerIndex >= FIRST_COPPER_LAYER
&& aLayerIndex <= LAST_COPPER_LAYER;
} }
/** /**
...@@ -177,10 +172,11 @@ inline bool IsValidCopperLayerIndex( int aLayerIndex ) ...@@ -177,10 +172,11 @@ inline bool IsValidCopperLayerIndex( int aLayerIndex )
* tests whether an integer is a valid non copper layer index * tests whether an integer is a valid non copper layer index
* @param aLayerIndex = Layer index to test * @param aLayerIndex = Layer index to test
* @return true if aLayerIndex is a valid non copper layer index * @return true if aLayerIndex is a valid non copper layer index
*/ */
inline bool IsValidNonCopperLayerIndex( int aLayerIndex ) inline bool IsValidNonCopperLayerIndex( int aLayerIndex )
{ {
return aLayerIndex >= FIRST_NO_COPPER_LAYER && aLayerIndex <= LAST_NO_COPPER_LAYER; return aLayerIndex >= FIRST_NO_COPPER_LAYER
&& aLayerIndex <= LAST_NO_COPPER_LAYER;
} }
...@@ -205,11 +201,6 @@ enum DisplayViaMode { ...@@ -205,11 +201,6 @@ enum DisplayViaMode {
#include "class_module.h" // Class for the footprint #include "class_module.h" // Class for the footprint
#include "class_netinfo.h" // Class for nets #include "class_netinfo.h" // Class for nets
/***********************************/
/* Description des elements du PCB */
/***********************************/
#include "class_drawsegment.h" #include "class_drawsegment.h"
#include "class_pcb_text.h" #include "class_pcb_text.h"
#include "class_cotation.h" #include "class_cotation.h"
...@@ -219,15 +210,23 @@ enum DisplayViaMode { ...@@ -219,15 +210,23 @@ enum DisplayViaMode {
#include "class_zone.h" #include "class_zone.h"
/* Values for DISPLAY_OPTIONS.ShowTrackClearanceMode parameter option /* Values for DISPLAY_OPTIONS.ShowTrackClearanceMode parameter option
* This parameter controls how to show tracks and vias clerance area * This parameter controls how to show tracks and vias clearance area
*/ */
enum ShowTrackClearanceModeList { enum ShowTrackClearanceModeList {
DO_NOT_SHOW_CLEARANCE = 0, // Do not show clearance areas DO_NOT_SHOW_CLEARANCE = 0, // Do not show clearance areas
SHOW_CLEARANCE_NEW_TRACKS, // Show clearance areas only for new track during track creation SHOW_CLEARANCE_NEW_TRACKS, /* Show clearance areas only
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, /* Show clrearance areas only for new track during track creation, * for new track during track
* and shows a via clearnce area at end of current new segment (guide to place a nev via * creation */
*/ SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, /* Show clearance areas only
SHOW_CLEARANCE_ALWAYS // Show Always clearance areas for track and vias * for new track during track
* creation, and shows a via
* clearance area at end of
* current new segment (guide
* to place a new via
*/
SHOW_CLEARANCE_ALWAYS /* Show Always clearance areas
* for track and vias
*/
}; };
class DISPLAY_OPTIONS class DISPLAY_OPTIONS
...@@ -241,13 +240,15 @@ public: ...@@ -241,13 +240,15 @@ public:
int DisplayModEdge; int DisplayModEdge;
int DisplayModText; int DisplayModText;
bool DisplayPcbTrackFill; /* FALSE = sketch , TRUE = filled */ bool DisplayPcbTrackFill; /* FALSE = sketch , TRUE = filled */
int ShowTrackClearanceMode; /* = 0 , 1 or 2 int ShowTrackClearanceMode; /* = 0 , 1 or 2
* 0 = do not show clearance * 0 = do not show clearance
* 1 = show track clearance * 1 = show track clearance
* 2 = show clearance + via area * 2 = show clearance + via area
* (useful to know what clearance area is neede if we want to put a via on terminal track point) * (useful to know what clearance area is
*/ * needed if we want to put a via on
* terminal track point)
*/
int m_DisplayViaMode; /* 0 do not show via hole, int m_DisplayViaMode; /* 0 do not show via hole,
* 1 show via hole for non default value * 1 show via hole for non default value
......
/****************************/ /****************************/
/* pyhandler.h */ /* pyhandler.h */
/****************************/ /****************************/
#ifndef PYHANDLER_H #ifndef PYHANDLER_H
...@@ -37,15 +37,15 @@ protected: ...@@ -37,15 +37,15 @@ protected:
wxString name; wxString name;
std::vector< initfunc_t > registry; std::vector< initfunc_t > registry;
ModuleRecord( const wxString &modName ) : ModuleRecord( const wxString &modName ) :
name( modName ) name( modName )
{ {
} }
}; };
std::vector< ModuleRecord > m_ModuleRegistry; std::vector< ModuleRecord > m_ModuleRegistry;
void DoInitModules(); void DoInitModules();
// Events // Events
...@@ -54,17 +54,17 @@ protected: ...@@ -54,17 +54,17 @@ protected:
wxString key; wxString key;
std::vector< boost::python::object > functors; std::vector< boost::python::object > functors;
Event( const wxString &strKey ) : Event( const wxString &strKey ) :
key( strKey ) key( strKey )
{ {
} }
}; };
std::vector< Event > m_EventRegistry; std::vector< Event > m_EventRegistry;
public: public:
// Singletton handling: // Singleton handling:
static PyHandler* GetInstance(); static PyHandler* GetInstance();
~PyHandler(); ~PyHandler();
......
/****************************************************/ /*************/
/* TRIGO.H : Tables de fonctions trigonometriques */ /* trigo.h */
/* utilisees dans les rotations d'axes */ /*************/
/****************************************************/
#ifndef TRIGO_H #ifndef TRIGO_H
#define TRIGO_H #define TRIGO_H
/* Prototype des fonctions de trigo.cpp */
void RotatePoint( int *pX, int *pY, int angle ); void RotatePoint( int *pX, int *pY, int angle );
void RotatePoint( int *pX, int *pY, int cx, int cy, int angle ); void RotatePoint( int *pX, int *pY, int cx, int cy, int angle );
void RotatePoint( wxPoint* point, int angle ); void RotatePoint( wxPoint* point, int angle );
...@@ -15,11 +13,11 @@ void RotatePoint( wxPoint *point, const wxPoint & centre, int angle ); ...@@ -15,11 +13,11 @@ void RotatePoint( wxPoint *point, const wxPoint & centre, int angle );
void RotatePoint( double *pX, double *pY, int angle ); void RotatePoint( double *pX, double *pY, int angle );
void RotatePoint( double *pX, double *pY, double cx, double cy, int angle ); void RotatePoint( double *pX, double *pY, double cx, double cy, int angle );
/** function ArcTangente /* Return the arc tangent of 0.1 degrees coord vector dx, dy
Retourne l'arc tangente en 0.1 degres du vecteur de coord dx, dy * between -1800 and 1800
entre -1800 et 1800 * Equivalent to atan2 (but faster for calculations if
Analogue a atan2 ( mais plus rapide pour les caculs si * the angle is 0 to -1800, or + - 900
l'angle est souvent 0, -1800, ou +- 900 */ */
int ArcTangente( int dy, int dx ); int ArcTangente( int dy, int dx );
bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY ); bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY );
...@@ -33,20 +31,21 @@ bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY ); ...@@ -33,20 +31,21 @@ bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY );
* @param aEnd is the second end-point of the line segment * @param aEnd is the second end-point of the line segment
* @param aDist = maximum distance for hit * @param aDist = maximum distance for hit
*/ */
bool TestSegmentHit( wxPoint aRefPoint, wxPoint aStart, wxPoint aEnd, int aDist ); bool TestSegmentHit( wxPoint aRefPoint, wxPoint aStart, wxPoint aEnd,
int aDist );
/*******************/ /*******************/
/* Macro NEW_COORD */ /* Macro NEW_COORD */
/*******************/ /*******************/
/* Macro de calcul de novelles coordonnees par rotation d'axe /* Calculate coordinates to rotate around an axis
coord : xrot = y*sin + x*cos * coord: xrot = y + x * sin * cos
yrot = y*cos - x*sin * yrot = y * cos - sin * x
soit : xrot = (y*tg + x)*cos * either: xrot = (y + x * tg) * cos
yrot = (y - x*tg)*cos * yrot = (y - x * tg) * cos
*
les coeffs COS sont tabules en fct de tg sur 16 valeurs. * Cosine coefficients are loaded from a trigometric table by 16 bit values.
*/ */
#define NEW_COORD( x0, y0 ) \ #define NEW_COORD( x0, y0 ) \
do { \ do { \
int itmp; \ int itmp; \
......
/***************************************************/ /***************/
/* WORKSHEET.H: constantes pour trace du cartouche */ /* worksheet.h */
/***************************************************/ /***************/
/****************************/
/* Description du cartouche */
/****************************/
/* Values are in 1/1000 inch */ /* Values are in 1/1000 inch */
#ifndef __WORKSHEET_H__ #ifndef __WORKSHEET_H__
#define __WORKSHEET_H__ #define __WORKSHEET_H__
#define GRID_REF_W 70 /* hauteur de la bande de reference grille */ #define GRID_REF_W 70 /* height of the band reference grid */
#define SIZETEXT 60 /* Dimension des textes du cartouche */ #define SIZETEXT 60 /* worksheet text size */
#define SIZETEXT_REF 50 /* Dimension des lettres du marquage des reperes */ #define SIZETEXT_REF 50 /* worksheet frame reference text size */
#define PAS_REF 2000 /* pas des marquages de reference des reperes */ #define PAS_REF 2000 /* no reference markings on worksheet frame */
#define TEXT_VTAB_HEIGHT SIZETEXT * 2 #define TEXT_VTAB_HEIGHT SIZETEXT * 2
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
/* Shtamp */
#define STAMP_OX 185 * 10000 / 254 #define STAMP_OX 185 * 10000 / 254
#define STAMP_OY 55 * 10000 / 254 #define STAMP_OY 55 * 10000 / 254
...@@ -69,8 +64,8 @@ ...@@ -69,8 +64,8 @@
#define STAMP_25 25 * 10000 / 254 #define STAMP_25 25 * 10000 / 254
#endif #endif
/* Les coord ci dessous sont relatives au coin bas - droit de la feuille, et /* The coordinates below are relative to the bottom right corner of page and
* seront soustraires de cette origine * will be subtracted from this origin.
*/ */
#define BLOCK_OX 4200 #define BLOCK_OX 4200
#define BLOCK_KICAD_VERSION_X BLOCK_OX - SIZETEXT #define BLOCK_KICAD_VERSION_X BLOCK_OX - SIZETEXT
...@@ -100,15 +95,15 @@ ...@@ -100,15 +95,15 @@
struct Ki_WorkSheetData struct Ki_WorkSheetData
{ {
public: public:
int m_Type; /* nombre permettant de reconnaitre la description */ int m_Type;
Ki_WorkSheetData* Pnext; Ki_WorkSheetData* Pnext;
int m_Posx, m_Posy; /* position de l'element ou point de depart du segment */ int m_Posx, m_Posy;
int m_Endx, m_Endy; /* extremite d'un element type segment ou cadre */ int m_Endx, m_Endy;
const wxChar* m_Legende; /* Pour m_Textes: texte a afficher avant le texte lui meme */ const wxChar* m_Legende;
const wxChar* m_Text; /* Pour m_Textes:pointeur sur le texte a afficher */ const wxChar* m_Text;
}; };
/* Type des descriptions Ki_WorkSheetData */ /* Work sheet structure type definitions. */
enum TypeKi_WorkSheetData { enum TypeKi_WorkSheetData {
WS_DATE, WS_DATE,
WS_REV, WS_REV,
......
...@@ -54,10 +54,11 @@ public: ...@@ -54,10 +54,11 @@ public:
bool m_DisplayViaFill; // How show vias bool m_DisplayViaFill; // How show vias
bool m_DisplayPadNum; // show pads numbers bool m_DisplayPadNum; // show pads numbers
int m_DisplayModEdge; // How show module drawings int m_DisplayModEdge; // How show module drawings
int m_DisplayModText; // How show module texts int m_DisplayModText; // How show module texts
bool m_DisplayPcbTrackFill; /* FALSE : tracks are show in sketch mode, TRUE = filled */ bool m_DisplayPcbTrackFill; /* FALSE : tracks are show in sketch mode,
int m_UserGridUnits; * TRUE = filled */
int m_UserGridUnits;
wxRealPoint m_UserGridSize; wxRealPoint m_UserGridSize;
WinEDA3D_DrawFrame* m_Draw3DFrame; WinEDA3D_DrawFrame* m_Draw3DFrame;
...@@ -91,52 +92,61 @@ public: ...@@ -91,52 +92,61 @@ public:
// General // General
virtual void OnCloseWindow( wxCloseEvent& Event ) = 0; virtual void OnCloseWindow( wxCloseEvent& Event ) = 0;
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) { } virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) { }
virtual void ReCreateHToolbar() = 0; virtual void ReCreateHToolbar() = 0;
virtual void ReCreateVToolbar() = 0; virtual void ReCreateVToolbar() = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftClick( wxDC* DC,
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) = 0; const wxPoint& MousePos ) = 0;
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0; virtual void OnLeftDClick( wxDC* DC,
virtual void ReCreateMenuBar(); const wxPoint& MousePos ) = 0;
virtual void SetToolID( int id, int new_cursor_id, virtual bool OnRightClick( const wxPoint& MousePos,
const wxString& title ); wxMenu* PopMenu ) = 0;
virtual void UpdateStatusBar(); virtual void ReCreateMenuBar();
virtual void SetToolID( int id, int new_cursor_id,
PCB_SCREEN* GetScreen() const { return (PCB_SCREEN*) WinEDA_DrawFrame::GetBaseScreen(); } const wxString& title );
virtual void UpdateStatusBar();
PCB_SCREEN* GetScreen() const
{
return (PCB_SCREEN*) WinEDA_DrawFrame::GetBaseScreen();
}
BASE_SCREEN* GetBaseScreen() const; BASE_SCREEN* GetBaseScreen() const;
int BestZoom(); int BestZoom();
virtual void Show3D_Frame( wxCommandEvent& event ); virtual void Show3D_Frame( wxCommandEvent& event );
public: public:
// Read/write fonctions: // Read/write functions:
EDA_BaseStruct* ReadDrawSegmentDescr( FILE* File, int* LineNum ); EDA_BaseStruct* ReadDrawSegmentDescr( FILE* File, int* LineNum );
int ReadListeSegmentDescr( FILE* File, int ReadListeSegmentDescr( FILE* File,
TRACK* PtSegm, int StructType, TRACK* PtSegm,
int* LineNum, int NumSegm ); int StructType,
int* LineNum,
int NumSegm );
int ReadSetup( FILE* File, int* LineNum ); int ReadSetup( FILE* File, int* LineNum );
int ReadGeneralDescrPcb( FILE* File, int* LineNum ); int ReadGeneralDescrPcb( FILE* File, int* LineNum );
/** /**
* Function PcbGeneralLocateAndDisplay * Function PcbGeneralLocateAndDisplay
* searches for an item under the mouse cursor. * searches for an item under the mouse cursor.
* Items are searched first on the current working layer. * Items are searched first on the current working layer.
* If nothing found, an item will be searched without layer restriction. If * If nothing found, an item will be searched without layer restriction.
* more than one item is found meeting the current working layer criterion, then * If more than one item is found meeting the current working layer
* a popup menu is shown which allows the user to pick which item he/she is * criterion, then a popup menu is shown which allows the user to pick
* interested in. Once an item is chosen, then it is make the "current item" * which item he/she is interested in. Once an item is chosen, then it
* and the status window is updated to reflect this. * is make the "current item" and the status window is updated to reflect
* this.
* *
* @param aHotKeyCode The hotkey which relates to the caller and determines the * @param aHotKeyCode The hotkey which relates to the caller and determines
* type of search to be performed. If zero, then the mouse tools will be * the type of search to be performed. If zero, then
* tested instead. * the mouse tools will be tested instead.
*/ */
BOARD_ITEM* PcbGeneralLocateAndDisplay( int aHotKeyCode = 0 ); BOARD_ITEM* PcbGeneralLocateAndDisplay( int aHotKeyCode = 0 );
...@@ -150,81 +160,97 @@ public: ...@@ -150,81 +160,97 @@ public:
* of "selecting" an item more formal, and to indivisibly tie the operation * of "selecting" an item more formal, and to indivisibly tie the operation
* of selecting an item to displaying it using BOARD_ITEM::Display_Infos(). * of selecting an item to displaying it using BOARD_ITEM::Display_Infos().
* @param aItem The BOARD_ITEM to make the selected item or NULL if none. * @param aItem The BOARD_ITEM to make the selected item or NULL if none.
* @param aDisplayInfo = true to display item info, false if not (default = true) * @param aDisplayInfo = true to display item info, false if not (default =
*true)
*/ */
void SetCurItem( BOARD_ITEM* aItem, bool aDisplayInfo = true ); void SetCurItem( BOARD_ITEM* aItem,
bool aDisplayInfo = true );
BOARD_ITEM* GetCurItem(); BOARD_ITEM* GetCurItem();
/** /**
* Function GetCollectorsGuide * Function GetCollectorsGuide
* @return GENERAL_COLLECTORS_GUIDE - that considers the global configuration options. * @return GENERAL_COLLECTORS_GUIDE - that considers the global
*configuration options.
*/ */
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide(); GENERAL_COLLECTORS_GUIDE GetCollectorsGuide();
/** /**
* Function CursorGoto * Function CursorGoto
* positions the cursor at a given coordinate and reframes the drawing if the * positions the cursor at a given coordinate and reframes the drawing if
*the
* requested point is out of view. * requested point is out of view.
* @param aPos The point to go to. * @param aPos The point to go to.
*/ */
void CursorGoto( const wxPoint& aPos ); void CursorGoto( const wxPoint& aPos );
/* Place un repere sur l'ecran au point de coordonnees PCB pos */ void place_marqueur( wxDC* DC,
void place_marqueur( wxDC* DC, const wxPoint& pos, char* pt_bitmap, const wxPoint& pos,
int DrawMode, int color, int type ); char* pt_bitmap,
int DrawMode,
int color,
int type );
// Gestion des modules MODULE* Copie_Module( MODULE* module );
MODULE* Copie_Module( MODULE* module );
/** Function Save_Module_In_Library /** Function Save_Module_In_Library
* Save in an existing library a given footprint * Save in an existing library a given footprint
* @param aLibName = name of the library to use * @param aLibName = name of the library to use
* @param aModule = the given footprint * @param aModule = the given footprint
* @param aOverwrite = true to overwrite an existing footprint, false to abort an existing footprint is found * @param aOverwrite = true to overwrite an existing footprint, false to
* @param aDisplayDialog = true to display a dialog to enter or confirm the footprint name * abort an existing footprint is found
* @param aDisplayDialog = true to display a dialog to enter or confirm the
* footprint name
* @param aCreateDocFile = true to creates the associated doc file * @param aCreateDocFile = true to creates the associated doc file
* @return : 1 if OK,0 if abort * @return : 1 if OK,0 if abort
*/ */
int Save_Module_In_Library( const wxString& aLibName, int Save_Module_In_Library( const wxString& aLibName,
MODULE* aModule, bool aOverwrite, MODULE* aModule,
bool aDisplayDialog, bool aCreateDocFile ); bool aOverwrite,
bool aDisplayDialog,
bool aCreateDocFile );
void Archive_Modules( const wxString& LibName, bool NewModulesOnly ); void Archive_Modules( const wxString& LibName,
MODULE* Select_1_Module_From_BOARD( BOARD* Pcb ); bool NewModulesOnly );
MODULE* GetModuleByName(); MODULE* Select_1_Module_From_BOARD( BOARD* Pcb );
MODULE* GetModuleByName();
// Modules (footprints) // Modules (footprints)
MODULE* Create_1_Module( wxDC* DC, const wxString& module_name ); MODULE* Create_1_Module( wxDC* DC,
void Edit_Module( MODULE* module, wxDC* DC ); const wxString& module_name );
void Rotate_Module( wxDC* DC, void Edit_Module( MODULE* module, wxDC* DC );
MODULE* module, void Rotate_Module( wxDC* DC,
int angle, MODULE* module,
bool incremental ); int angle,
void Place_Module( MODULE* module, bool incremental );
wxDC* DC, void Place_Module( MODULE* module,
bool aDoNotRecreateRatsnest = false ); wxDC* DC,
bool aDoNotRecreateRatsnest = false );
// module texts // module texts
void RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ); void RotateTextModule( TEXTE_MODULE* Text, wxDC* DC );
void DeleteTextModule( TEXTE_MODULE* Text ); void DeleteTextModule( TEXTE_MODULE* Text );
void PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC ); void PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC );
void StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC ); void StartMoveTexteModule( TEXTE_MODULE* Text,
TEXTE_MODULE* CreateTextModule( MODULE* Module, wxDC* DC ); wxDC* DC );
TEXTE_MODULE* CreateTextModule( MODULE* Module, wxDC* DC );
void InstallPadOptionsFrame( D_PAD* pad, wxDC* DC, const wxPoint& pos );
void InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC ); void InstallPadOptionsFrame( D_PAD* pad,
wxDC* DC,
// Pads sur modules const wxPoint& pos );
void AddPad( MODULE* Module, bool draw ); void InstallTextModOptionsFrame( TEXTE_MODULE* TextMod,
void DeletePad( D_PAD* Pad ); wxDC* DC );
void StartMovePad( D_PAD* Pad, wxDC* DC );
void RotatePad( D_PAD* Pad, wxDC* DC ); void AddPad( MODULE* Module, bool draw );
void PlacePad( D_PAD* Pad, wxDC* DC ); void DeletePad( D_PAD* Pad );
void Export_Pad_Settings( D_PAD* aPad ); void StartMovePad( D_PAD* Pad, wxDC* DC );
void Import_Pad_Settings( D_PAD* aPad, bool aDraw ); void RotatePad( D_PAD* Pad, wxDC* DC );
void Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ); void PlacePad( D_PAD* Pad, wxDC* DC );
void Export_Pad_Settings( D_PAD* aPad );
void Import_Pad_Settings( D_PAD* aPad, bool aDraw );
void Global_Import_Pad_Settings( D_PAD* aPad,
bool aDraw );
// loading footprints // loading footprints
...@@ -232,74 +258,93 @@ public: ...@@ -232,74 +258,93 @@ public:
/** function Get_Librairie_Module /** function Get_Librairie_Module
* *
* Read active libraries or one library to find and load a given module * Read active libraries or one library to find and load a given module
* If found the lodule is linked to the tail of linked list of modules * If found the module is linked to the tail of linked list of modules
* @param aLibrary: the full filename of the library to read. If empty, all active libraries are read * @param aLibrary: the full filename of the library to read. If empty,
* all active libraries are read
* @param aModuleName = module name to load * @param aModuleName = module name to load
* @param aDisplayMessageError = true to display an error message if any. * @param aDisplayMessageError = true to display an error message if any.
* @return a MODULE * pointer to the new module, or NULL * @return a MODULE * pointer to the new module, or NULL
* *
*/ */
MODULE* Get_Librairie_Module( const wxString& aLibraryFullFilename, MODULE* Get_Librairie_Module( const wxString& aLibraryFullFilename,
const wxString& aModuleName, const wxString& aModuleName,
bool aDisplayMessageError ); bool aDisplayMessageError );
/** Function Select_1_Module_From_List /** Function Select_1_Module_From_List
* Display a list of modules found in active libraries or a given library * Display a list of modules found in active libraries or a given library
* @param aLibraryFullFilename = library to list (if aLibraryFullFilename == void, list all modules) * @param aLibraryFullFilename = library to list (if aLibraryFullFilename
* @param aMask = Display filter (wildcart)( Mask = wxEmptyString if not used ) * == void, list all modules)
* @param aKeyWord = keyword list, to display a filtered list of module having one (or more) of these keyworks in their keywork list * @param aMask = Display filter (wildcart)( Mask = wxEmptyString if not
* ( aKeyWord = wxEmptyString if not used ) * used )
* @param aKeyWord = keyword list, to display a filtered list of module
* having one (or more) of these keywords in their
* keyword list ( aKeyWord = wxEmptyString if not used )
* *
* @return wxEmptyString if abort or fails, or the selected module name if Ok * @return wxEmptyString if abort or fails, or the selected module name if
* Ok
*/ */
wxString Select_1_Module_From_List( wxString Select_1_Module_From_List(
WinEDA_DrawFrame* active_window, const wxString& aLibraryFullFilename, WinEDA_DrawFrame* active_window, const wxString& aLibraryFullFilename,
const wxString& aMask, const wxString& aKeyWord ); const wxString& aMask, const wxString& aKeyWord );
MODULE* Load_Module_From_Library( const wxString& library, wxDC* DC ); MODULE* Load_Module_From_Library( const wxString& library, wxDC* DC );
// ratsnest functions // ratsnest functions
void Compile_Ratsnest( wxDC* DC, bool affiche ); /* Recalcul complet du chevelu */ void Compile_Ratsnest( wxDC* DC, bool affiche );
int Test_1_Net_Ratsnest( wxDC* DC, int net_code ); int Test_1_Net_Ratsnest( wxDC* DC, int net_code );
void build_ratsnest_module( wxDC* DC, MODULE* Module ); void build_ratsnest_module( wxDC* DC, MODULE* Module );
void trace_ratsnest_module( wxDC* DC ); void trace_ratsnest_module( wxDC* DC );
void Build_Board_Ratsnest( wxDC* DC ); void Build_Board_Ratsnest( wxDC* DC );
void DrawGeneralRatsnest( wxDC* DC, int net_code = 0 ); void DrawGeneralRatsnest( wxDC* DC, int net_code = 0 );
void trace_ratsnest_pad( wxDC* DC ); void trace_ratsnest_pad( wxDC* DC );
void build_ratsnest_pad( BOARD_ITEM* ref, void build_ratsnest_pad( BOARD_ITEM* ref,
const wxPoint& refpos, const wxPoint& refpos,
bool init ); bool init );
void Tst_Ratsnest( wxDC* DC, int ref_netcode ); void Tst_Ratsnest( wxDC* DC, int ref_netcode );
void test_connexions( wxDC* DC ); void test_connexions( wxDC* DC );
void test_1_net_connexion( wxDC* DC, int net_code ); void test_1_net_connexion( wxDC* DC, int net_code );
void RecalculateAllTracksNetcode(); void RecalculateAllTracksNetcode();
/* Plotting functions: /* Plotting functions:
*/ */
void ToPlotter( wxCommandEvent& event ); void ToPlotter( wxCommandEvent& event );
void Genere_GERBER( const wxString& FullFileName, int Layer, void Genere_GERBER( const wxString& FullFileName,
bool PlotOriginIsAuxAxis, GRTraceMode trace_mode );
void Genere_HPGL( const wxString& FullFileName, int Layer, GRTraceMode trace_mode );
void Genere_PS( const wxString& FullFileName,
int Layer, int Layer,
bool useA4, bool PlotOriginIsAuxAxis,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
void Genere_DXF( const wxString& FullFileName, int Layer, GRTraceMode trace_mode ); void Genere_HPGL( const wxString& FullFileName,
void Plot_Layer( PLOTTER* plotter, int Layer, GRTraceMode trace_mode ); int Layer,
void Plot_Standard_Layer( PLOTTER* aPlotter, int aLayerMask, GRTraceMode trace_mode );
bool aPlotVia, GRTraceMode aPlotMode ); void Genere_PS( const wxString& FullFileName,
void Plot_Serigraphie( PLOTTER* plotter, int masque_layer, GRTraceMode trace_mode ); int Layer,
bool useA4,
GRTraceMode trace_mode );
void Genere_DXF( const wxString& FullFileName,
int Layer,
GRTraceMode trace_mode );
void Plot_Layer( PLOTTER* plotter,
int Layer,
GRTraceMode trace_mode );
void Plot_Standard_Layer( PLOTTER* aPlotter, int aLayerMask,
bool aPlotVia, GRTraceMode aPlotMode );
void Plot_Serigraphie( PLOTTER* plotter,
int masque_layer,
GRTraceMode trace_mode );
/** function PlotDrillMark /** function PlotDrillMark
* Draw a drill mark for pads and vias. * Draw a drill mark for pads and vias.
* Must be called after all drawings, because it * Must be called after all drawings, because it
* redraw the drill mark on a pad or via, as a negative (i.e. white) shape in FILLED plot mode * redraw the drill mark on a pad or via, as a negative (i.e. white) shape
* in FILLED plot mode
* @param aPlotter = the PLOTTER * @param aPlotter = the PLOTTER
* @param aTraceMode = the mode of plot (FILLED, SKETCH) * @param aTraceMode = the mode of plot (FILLED, SKETCH)
* @param aSmallDrillShape = true to plot a small drill shape, false to plot the actual drill shape * @param aSmallDrillShape = true to plot a small drill shape, false to
* plot the actual drill shape
*/ */
void PlotDrillMark( PLOTTER* aPlotter, GRTraceMode aTraceMode, bool aSmallDrillShape ); void PlotDrillMark( PLOTTER* aPlotter,
GRTraceMode aTraceMode,
bool aSmallDrillShape );
/* Functions relative to Undo/redo commands: /* Functions relative to Undo/redo commands:
*/ */
...@@ -314,7 +359,8 @@ public: ...@@ -314,7 +359,8 @@ public:
*/ */
virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy,
UndoRedoOpType aTypeCommand, UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) = 0; const wxPoint& aTransformPoint =
wxPoint( 0, 0 ) ) = 0;
/** Function SaveCopyInUndoList (virtual pure, overloaded). /** Function SaveCopyInUndoList (virtual pure, overloaded).
* Creates a new entry in undo list of commands. * Creates a new entry in undo list of commands.
...@@ -326,7 +372,8 @@ public: ...@@ -326,7 +372,8 @@ public:
*/ */
virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
UndoRedoOpType aTypeCommand, UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) = 0; const wxPoint& aTransformPoint =
wxPoint( 0, 0 ) ) = 0;
// layerhandling: // layerhandling:
...@@ -337,7 +384,6 @@ public: ...@@ -337,7 +384,6 @@ public:
void SelectLayerPair(); void SelectLayerPair();
virtual void SwitchLayer( wxDC* DC, int layer ); virtual void SwitchLayer( wxDC* DC, int layer );
// divers
void InstallGridFrame( const wxPoint& pos ); void InstallGridFrame( const wxPoint& pos );
/** /**
......
...@@ -40,29 +40,35 @@ class GENERAL_COLLECTORS_GUIDE; ...@@ -40,29 +40,35 @@ class GENERAL_COLLECTORS_GUIDE;
/** /**
* @info see also class WinEDA_BasePcbFrame: Basic class for pcbnew and gerbview * @info see also class WinEDA_BasePcbFrame: Basic class for pcbnew and
*/ *gerbview
*/
/*****************************************************/ /*****************************************************/
/* class WinEDA_PcbFrame: the main frame for Pcbnew */ /* class WinEDA_PcbFrame: the main frame for Pcbnew */
/*****************************************************/ /*****************************************************/
class WinEDA_PcbFrame: public WinEDA_BasePcbFrame class WinEDA_PcbFrame : public WinEDA_BasePcbFrame
{ {
public: public:
WinEDAChoiceBox* m_SelLayerBox; // a combo box to display and select active layer WinEDAChoiceBox* m_SelLayerBox; // a combo box to display and
WinEDAChoiceBox* m_SelTrackWidthBox; // a combo box to display and select current track width // select active layer
WinEDAChoiceBox* m_SelViaSizeBox; // a combo box to display and select current via diameter WinEDAChoiceBox* m_SelTrackWidthBox; // a combo box to display and
wxTextCtrl* m_ClearanceBox; // a text ctrl to display the current tracks and vias clearance // select current track width
wxTextCtrl* m_NetClassSelectedBox; // a text ctrl to display the current NetClass WinEDAChoiceBox* m_SelViaSizeBox; // a combo box to display and
bool m_TrackAndViasSizesList_Changed; // select current via diameter
wxTextCtrl* m_ClearanceBox; // a text ctrl to display the
bool m_show_microwave_tools; // current tracks and vias
// clearance
wxTextCtrl* m_NetClassSelectedBox; // a text ctrl to display the
// current NetClass
bool m_TrackAndViasSizesList_Changed;
bool m_show_microwave_tools;
private: private:
DRC* m_drc; ///< the DRC controller, see drc.cpp DRC* m_drc; ///< the DRC controller, see drc.cpp
// we'll use lower case function names for private member functions. // we'll use lower case function names for private member functions.
void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu ); void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu );
...@@ -87,6 +93,7 @@ public: ...@@ -87,6 +93,7 @@ public:
void InstallConfigFrame( const wxPoint& pos ); void InstallConfigFrame( const wxPoint& pos );
void Process_Config( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event );
void Update_config( wxWindow* displayframe ); void Update_config( wxWindow* displayframe );
/** Function Read_Config /** Function Read_Config
* Read the project configuration file * Read the project configuration file
* @param projectFileName = the config filename * @param projectFileName = the config filename
...@@ -96,7 +103,9 @@ public: ...@@ -96,7 +103,9 @@ public:
*/ */
bool Read_Config( const wxString& projectFileName ); bool Read_Config( const wxString& projectFileName );
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); void OnHotKey( wxDC* DC,
int hotkey,
EDA_BaseStruct* DrawStruct );
bool OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct ); bool OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct );
void OnCloseWindow( wxCloseEvent& Event ); void OnCloseWindow( wxCloseEvent& Event );
...@@ -124,6 +133,7 @@ public: ...@@ -124,6 +133,7 @@ public:
void ShowDesignRulesEditor( wxCommandEvent& event ); void ShowDesignRulesEditor( wxCommandEvent& event );
/* toolbars update UI functions: */ /* toolbars update UI functions: */
/** /**
* Function UpdateToolbarLayerInfo * Function UpdateToolbarLayerInfo
* updates the currently selected layer in the layer listbox and * updates the currently selected layer in the layer listbox and
...@@ -138,14 +148,14 @@ public: ...@@ -138,14 +148,14 @@ public:
* update the displayed values on auxiliary horizontal toolbar * update the displayed values on auxiliary horizontal toolbar
* (track width, via sizes, clearance ... * (track width, via sizes, clearance ...
*/ */
void AuxiliaryToolBar_Update_UI( ); void AuxiliaryToolBar_Update_UI();
/** /**
* Function AuxiliaryToolBar_DesignRules_Update_UI * Function AuxiliaryToolBar_DesignRules_Update_UI
* update the displayed values: track width, via sizes, clearance * update the displayed values: track width, via sizes, clearance
* used when a ne netclass is selected * used when a new netclass is selected
*/ */
void AuxiliaryToolBar_DesignRules_Update_UI( ); void AuxiliaryToolBar_DesignRules_Update_UI();
/* mouse functions events: */ /* mouse functions events: */
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
...@@ -153,7 +163,8 @@ public: ...@@ -153,7 +163,8 @@ public:
/** /**
* Function OnRightClick * Function OnRightClick
* populates a popup menu with the choices appropriate for the current context. * populates a popup menu with the choices appropriate for the current
*context.
* The caller will add the ZOOM menu choices afterwards. * The caller will add the ZOOM menu choices afterwards.
* @param aMousePos The current mouse position * @param aMousePos The current mouse position
* @param aPopMenu The menu to add to. * @param aPopMenu The menu to add to.
...@@ -163,56 +174,70 @@ public: ...@@ -163,56 +174,70 @@ public:
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void ToolOnRightClick( wxCommandEvent& event ); void ToolOnRightClick( wxCommandEvent& event );
/** Function SaveCopyInUndoList. /** Function SaveCopyInUndoList.
* Creates a new entry in undo list of commands. * Creates a new entry in undo list of commands.
* add a picker to handle aItemToCopy * add a picker to handle aItemToCopy
* @param aItemToCopy = the board item modified by the command to undo * @param aItemToCopy = the board item modified by the command to undo
* @param aTypeCommand = command type (see enum UndoRedoOpType) * @param aTypeCommand = command type (see enum UndoRedoOpType)
* @param aTransformPoint = the reference point of the transformation, for commands like move * @param aTransformPoint = the reference point of the transformation, for
*commands like move
*/ */
virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, UndoRedoOpType aTypeCommand, virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy,
const wxPoint& aTransformPoint = wxPoint(0,0) ); UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint =
wxPoint( 0, 0 ) );
/** Function SaveCopyInUndoList (overloaded). /** Function SaveCopyInUndoList (overloaded).
* Creates a new entry in undo list of commands. * Creates a new entry in undo list of commands.
* add a list of pickers to handle a list of items * add a list of pickers to handle a list of items
* @param aItemsList = the list of items modified by the command to undo * @param aItemsList = the list of items modified by the command to undo
* @param aTypeCommand = command type (see enum UndoRedoOpType) * @param aTypeCommand = command type (see enum UndoRedoOpType)
* @param aTransformPoint = the reference point of the transformation, for commands like move * @param aTransformPoint = the reference point of the transformation, for
*commands like move
*/ */
virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, UndoRedoOpType aTypeCommand, virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
const wxPoint& aTransformPoint = wxPoint(0,0) ); UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint =
wxPoint( 0, 0 ) );
/** Function PutDataInPreviousState() /** Function PutDataInPreviousState()
* Used in undo or redo command. * Used in undo or redo command.
* Put data pointed by List in the previous state, i.e. the state memorised by List * Put data pointed by List in the previous state, i.e. the state memorized
* @param aList = a PICKED_ITEMS_LIST pointer to the list of items to undo/redo * by List
* @param aList = a PICKED_ITEMS_LIST pointer to the list of items to
* undo/redo
* @param aRedoCommand = a bool: true for redo, false for undo * @param aRedoCommand = a bool: true for redo, false for undo
* @param aRebuildRatsnet = a bool: true to rebuid ratsnet (normal use), false * @param aRebuildRatsnet = a bool: true to rebuild ratsnet (normal use),
* to just retrieve las state (used in abort commands that do not need to rebuild ratsnest) * false
* to just retrieve las state (used in abort commands that do not need to
* rebuild ratsnest)
*/ */
void PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand, bool aRebuildRatsnet = true ); void PutDataInPreviousState( PICKED_ITEMS_LIST* aList,
bool aRedoCommand,
bool aRebuildRatsnet = true );
/** Function GetBoardFromRedoList /** Function GetBoardFromRedoList
* Redo the last edition: * Redo the last edition:
* - Save the current board in Undo list * - Save the current board in Undo list
* - Get an old version of the board from Redo list * - Get an old version of the board from Redo list
* @return none * @return none
*/ */
void GetBoardFromRedoList(wxCommandEvent& event); void GetBoardFromRedoList( wxCommandEvent& event );
/** Function GetBoardFromUndoList /** Function GetBoardFromUndoList
* Undo the last edition: * Undo the last edition:
* - Save the current board in Redo list * - Save the current board in Redo list
* - Get an old version of the board from Undo list * - Get an old version of the board from Undo list
* @return none * @return none
*/ */
void GetBoardFromUndoList(wxCommandEvent& event); void GetBoardFromUndoList( wxCommandEvent& event );
/* Gestion generale des operations sur block */
int ReturnBlockCommand( int key );
void HandleBlockPlace( wxDC* DC );
int HandleBlockEnd( wxDC* DC );
/* Block operations: */ /* Block operations: */
int ReturnBlockCommand( int key );
void HandleBlockPlace( wxDC* DC );
int HandleBlockEnd( wxDC* DC );
/** /**
* Function Block_SelectItems * Function Block_SelectItems
* Uses GetScreen()->m_BlockLocate * Uses GetScreen()->m_BlockLocate
...@@ -220,81 +245,93 @@ public: ...@@ -220,81 +245,93 @@ public:
* selected items are put in the pick list * selected items are put in the pick list
* @param none * @param none
*/ */
void Block_SelectItems( ); void Block_SelectItems();
/** /**
* Function Block_Delete * Function Block_Delete
* deletes all items within the selected block. * deletes all items within the selected block.
* @param none * @param none
*/ */
void Block_Delete( ); void Block_Delete();
/** /**
* Function Block_Rotate * Function Block_Rotate
* Rotate all items within the selected block. * Rotate all items within the selected block.
* The rotation centre is the centre of the block * The rotation center is the center of the block
* @param none * @param none
*/ */
void Block_Rotate( ); void Block_Rotate();
/** /**
* Function Block_Flip * Function Block_Flip
* Flip items within the selected block. * Flip items within the selected block.
* The flip centre is the centre of the block * The flip center is the center of the block
* @param none * @param none
*/ */
void Block_Flip( ); void Block_Flip();
/** /**
* Function Block_Move * Function Block_Move
* move all items within the selected block. * move all items within the selected block.
* New location is determined by the current offset from the selected block's original location. * New location is determined by the current offset from the selected
*block's original location.
* @param none * @param none
*/ */
void Block_Move( ); void Block_Move();
/** /**
* Function Block_Mirror_X * Function Block_Mirror_X
* mirrors all items within the currently selected block in the X axis. * mirrors all items within the currently selected block in the X axis.
* @param none * @param none
*/ */
void Block_Mirror_X( ); void Block_Mirror_X();
/** /**
* Function Block_Duplicate * Function Block_Duplicate
* Duplicate all items within the selected block. * Duplicate all items within the selected block.
* New location is determined by the current offset from the selected block's original location. * New location is determined by the current offset from the selected
* block's original location.
* @param none * @param none
*/ */
void Block_Duplicate( ); void Block_Duplicate();
void SetToolbars(); void SetToolbars();
void Process_Settings( wxCommandEvent& event ); void Process_Settings( wxCommandEvent& event );
void InstallPcbOptionsFrame( const wxPoint& pos, wxDC* DC, int id ); void InstallPcbOptionsFrame( const wxPoint& pos,
void InstallDisplayOptionsDialog( wxCommandEvent& aEvent ); wxDC* DC,
void InstallPcbGlobalDeleteFrame( const wxPoint& pos ); int id );
void InstallDisplayOptionsDialog( wxCommandEvent& aEvent );
void InstallPcbGlobalDeleteFrame( const wxPoint& pos );
void GenModulesPosition( wxCommandEvent& event ); void GenModulesPosition( wxCommandEvent& event );
void GenModuleReport( wxCommandEvent& event ); void GenModuleReport( wxCommandEvent& event );
void InstallDrillFrame( wxCommandEvent& event ); void InstallDrillFrame( wxCommandEvent& event );
void ToPostProcess( wxCommandEvent& event ); void ToPostProcess( wxCommandEvent& event );
void OnFileHistory( wxCommandEvent& event ); void OnFileHistory( wxCommandEvent& event );
void Files_io( wxCommandEvent& event ); void Files_io( wxCommandEvent& event );
bool LoadOnePcbFile( const wxString& FileName, bool Append ); bool LoadOnePcbFile( const wxString& FileName, bool Append );
int ReadPcbFile( FILE* File, bool Append ); int ReadPcbFile( FILE* File, bool Append );
bool SavePcbFile( const wxString& FileName ); bool SavePcbFile( const wxString& FileName );
int SavePcbFormatAscii( FILE* File ); int SavePcbFormatAscii( FILE* File );
bool WriteGeneralDescrPcb( FILE* File ); bool WriteGeneralDescrPcb( FILE* File );
// BOARD handling // BOARD handling
/** function Clear_Pcb() /** function Clear_Pcb()
* delete all and reinitialize the current board * delete all and reinitialize the current board
* @param aQuery = true to prompt user for confirmation, false to initialize silently * @param aQuery = true to prompt user for confirmation, false to
* initialize silently
*/ */
bool Clear_Pcb( bool aQuery ); bool Clear_Pcb( bool aQuery );
// Drc control // Drc control
/* function GetDrcController /* function GetDrcController
* @return the DRC controller * @return the DRC controller
*/ */
DRC* GetDrcController() {return m_drc;} ///< return the DRC controller, see drc.cpp DRC* GetDrcController() { return m_drc; }
/** /**
* Function RecreateBOMFileFromBoard * Function RecreateBOMFileFromBoard
...@@ -302,15 +339,15 @@ public: ...@@ -302,15 +339,15 @@ public:
* this is the same as created by cvpcb. * this is the same as created by cvpcb.
* can be used if this file is lost * can be used if this file is lost
*/ */
void RecreateCmpFileFromBoard(wxCommandEvent & aEvent); void RecreateCmpFileFromBoard( wxCommandEvent& aEvent );
/** /**
* Function RecreateBOMFileFromBoard * Function RecreateBOMFileFromBoard
* Creates a BOM file from the current loaded board * Creates a BOM file from the current loaded board
*/ */
void RecreateBOMFileFromBoard(wxCommandEvent & aEvent); void RecreateBOMFileFromBoard( wxCommandEvent& aEvent );
void ExportToGenCAD( wxCommandEvent& event ); void ExportToGenCAD( wxCommandEvent& event );
/** /**
* Function ExporttoSPECCTRA * Function ExporttoSPECCTRA
...@@ -318,7 +355,7 @@ public: ...@@ -318,7 +355,7 @@ public:
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the * See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
* specification. * specification.
*/ */
void ExportToSpecctra( wxCommandEvent& event ); void ExportToSpecctra( wxCommandEvent& event );
/** /**
* Function ImportSpecctraSession * Function ImportSpecctraSession
...@@ -327,99 +364,104 @@ public: ...@@ -327,99 +364,104 @@ public:
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the * See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
* specification. * specification.
*/ */
void ImportSpecctraSession( wxCommandEvent& event ); void ImportSpecctraSession( wxCommandEvent& event );
/** /**
* Function ImportSpecctraDesign * Function ImportSpecctraDesign
* will import a specctra *.dsn file and use it to replace an entire BOARD. * will import a specctra *.dsn file and use it to replace an entire BOARD.
* The new board will not have any graphics, only components, tracks and vias. * The new board will not have any graphics, only components, tracks and
* vias.
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the * See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
* specification. * specification.
*/ */
void ImportSpecctraDesign( wxCommandEvent& event ); void ImportSpecctraDesign( wxCommandEvent& event );
/** /**
* Function Access_to_External_Tool * Function Access_to_External_Tool
* Run an external tool (like freeroute ) * Run an external tool (like freeroute )
*/ */
void Access_to_External_Tool( wxCommandEvent& event ); void Access_to_External_Tool( wxCommandEvent& event );
/* Fonctions specifiques */ MODULE* ListAndSelectModuleName();
MODULE* ListAndSelectModuleName();
/** Function ListNetsAndSelect /** Function ListNetsAndSelect
* called by a command event * called by a command event
* displays the sorted list of nets in a dialog frame * displays the sorted list of nets in a dialog frame
* If a net is selected, it is hightlighted * If a net is selected, it is highlighted
*/ */
void ListNetsAndSelect( wxCommandEvent& event ); void ListNetsAndSelect( wxCommandEvent& event );
void Swap_Layers( wxCommandEvent& event ); void Swap_Layers( wxCommandEvent& event );
void Install_Test_DRC_Frame( wxDC* DC ); void Install_Test_DRC_Frame( wxDC* DC );
// Handling texts on the board // Handling texts on the board
void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ); void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
TEXTE_PCB* Create_Texte_Pcb( wxDC* DC ); TEXTE_PCB* Create_Texte_Pcb( wxDC* DC );
void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ); void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
void StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC ); void StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC );
void Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ); void Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
void InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC ); void InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC );
// Graphic Segments type DRAWSEGMENT // Graphic Segments type DRAWSEGMENT
void Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ); void Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ); void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
void InstallGraphicItemPropertiesDialog( DRAWSEGMENT* aItem, wxDC* aDC ); // Graphic items edition void InstallGraphicItemPropertiesDialog( DRAWSEGMENT* aItem,
wxDC* aDC );
// Footprint edition (see also WinEDA_BasePcbFrame) // Footprint edition (see also WinEDA_BasePcbFrame)
void InstallModuleOptionsFrame( MODULE* Module, wxDC * DC ); void InstallModuleOptionsFrame( MODULE* Module, wxDC* DC );
void StartMove_Module( MODULE* module, wxDC* DC ); void StartMove_Module( MODULE* module, wxDC* DC );
bool Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDeleting ); bool Delete_Module( MODULE* module,
void Change_Side_Module( MODULE* Module, wxDC* DC ); wxDC* DC,
bool aAskBeforeDeleting );
void Change_Side_Module( MODULE* Module, wxDC* DC );
void InstallExchangeModuleFrame( MODULE* ExchangeModuleModule );
void InstallExchangeModuleFrame( MODULE* ExchangeModuleModule );
/** function Exchange_Module /** function Exchange_Module
* Replaces OldModule by NewModule, using OldModule settings: * Replaces OldModule by NewModule, using OldModule settings:
* position, orientation, pad netnames ...) * position, orientation, pad netnames ...)
* OldModule is deleted or put in undo list. * OldModule is deleted or put in undo list.
* @param aOldModule = footprint to replace * @param aOldModule = footprint to replace
* @param aNewModule = footprint to put * @param aNewModule = footprint to put
* @param aUndoPickList = the undo list used to save OldModule. If null, OldModule is deleted * @param aUndoPickList = the undo list used to save OldModule. If null,
* OldModule is deleted
*/ */
void Exchange_Module( MODULE* aOldModule, void Exchange_Module( MODULE* aOldModule,
MODULE* aNewModule, MODULE* aNewModule,
PICKED_ITEMS_LIST* aUndoPickList); PICKED_ITEMS_LIST* aUndoPickList );
// loading modules: see WinEDA_BasePcbFrame // loading modules: see WinEDA_BasePcbFrame
// Board handling // Board handling
void RemoveStruct( BOARD_ITEM* Item, wxDC* DC ); void RemoveStruct( BOARD_ITEM* Item, wxDC* DC );
// Hightlight functions: // Highlight functions:
int Select_High_Light( wxDC* DC ); int Select_High_Light( wxDC* DC );
void Hight_Light( wxDC* DC ); void Hight_Light( wxDC* DC );
// Track and via edition: // Track and via edition:
void Via_Edit_Control( wxCommandEvent& event ); void Via_Edit_Control( wxCommandEvent& event );
/** /**
* Function Other_Layer_Route * Function Other_Layer_Route
* operates in one of two ways. If argument track is NULL, then swap the active * operates in one of two ways. If argument track is NULL, then swap the
* layer between m_Route_Layer_TOP and m_Route_Layer_BOTTOM. If a track is * active layer between m_Route_Layer_TOP and m_Route_Layer_BOTTOM. If a
* in progress (track is not NULL), and if DRC allows it, place a via on the end * track is in progress (track is not NULL), and if DRC allows it, place
* of the current track, and then swap the current active layer and start a new * a via on the end of the current track, and then swap the current active
* segment on the new layer. * layer and start a new segment on the new layer.
* @param track A TRACK* to append the via to or NULL. * @param track A TRACK* to append the via to or NULL.
* @param DC A device context to draw on. * @param DC A device context to draw on.
* @return bool - true if the operation was successful, else false such as * @return bool - true if the operation was successful, else false such as
* the case where DRC would not allow a via. * the case where DRC would not allow a via.
*/ */
bool Other_Layer_Route( TRACK* track, wxDC* DC ); bool Other_Layer_Route( TRACK* track, wxDC* DC );
void Affiche_PadsNoConnect( wxDC* DC ); void Affiche_PadsNoConnect( wxDC* DC );
void Affiche_Status_Net( wxDC* DC ); void Affiche_Status_Net( wxDC* DC );
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 );
void Remove_One_Track( wxDC* DC, TRACK* pt_segm ); void Remove_One_Track( wxDC* DC, TRACK* pt_segm );
/** function Reset_All_Tracks_And_Vias_To_Netclass_Values /** function Reset_All_Tracks_And_Vias_To_Netclass_Values
* Reset all tracks width and/or vias diameters and drill * Reset all tracks width and/or vias diameters and drill
...@@ -427,76 +469,91 @@ public: ...@@ -427,76 +469,91 @@ public:
* @param aTrack : bool true to modify tracks * @param aTrack : bool true to modify tracks
* @param aVia : bool true to modify vias * @param aVia : bool true to modify vias
*/ */
bool Reset_All_Tracks_And_Vias_To_Netclass_Values( bool aTrack, bool aVia ); bool Reset_All_Tracks_And_Vias_To_Netclass_Values( bool aTrack,
bool aVia );
/** function Change_Net_Tracks_And_Vias_Sizes /** function Change_Net_Tracks_And_Vias_Sizes
* Reset all tracks width and vias diameters and drill * Reset all tracks width and vias diameters and drill
* to their default Netclass value ou current values * to their default Netclass value or current values
* @param aNetcode : the netcode of the net to edit * @param aNetcode : the netcode of the net to edit
* @param aUseNetclassValue : bool. True to use netclass values, false to use current values * @param aUseNetclassValue : bool. True to use netclass values, false to
* use current values
*/ */
bool Change_Net_Tracks_And_Vias_Sizes( int aNetcode, bool aUseNetclassValue ); bool Change_Net_Tracks_And_Vias_Sizes( int aNetcode,
bool aUseNetclassValue );
/** Function Edit_Track_Width /** Function Edit_Track_Width
* Modify a full track width (using DRC control). * Modify a full track width (using DRC control).
* a full track is the set of track segments between 2 ends: pads or a point that has more than 2 segments ends connected * a full track is the set of track segments between 2 ends: pads or a
* point that has more than 2 segments ends connected
* @param DC = the curred device context (can be NULL) * @param DC = the curred device context (can be NULL)
* @param aTrackSegment = a segment or via on the track to change * @param aTrackSegment = a segment or via on the track to change
*/ */
void Edit_Track_Width( wxDC* DC, TRACK* Track ); void Edit_Track_Width( wxDC* DC, TRACK* Track );
/** Function Edit_TrackSegm_Width /** Function Edit_TrackSegm_Width
* Modify one track segment width or one via diameter (using DRC control). * Modify one track segment width or one via diameter (using DRC control).
* @param DC = the current device context (can be NULL) * @param DC = the current device context (can be NULL)
* @param aTrackItem = the track segment or via to modify * @param aTrackItem = the track segment or via to modify
*/ */
void Edit_TrackSegm_Width( wxDC* DC, TRACK* segm ); void Edit_TrackSegm_Width( wxDC* DC, TRACK* segm );
TRACK* Begin_Route( TRACK* track, wxDC* DC ); TRACK* Begin_Route( TRACK* track, wxDC* DC );
void End_Route( TRACK* track, wxDC* DC ); void End_Route( TRACK* track, wxDC* DC );
void ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC ); void ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC );
void Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On ); void Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On );
void Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ); void Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On );
void Attribut_net( wxDC* DC, int net_code, bool Flag_On ); void Attribut_net( wxDC* DC, int net_code, bool Flag_On );
void Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int command ); void Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int command );
bool PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ); bool PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC );
bool MergeCollinearTracks( TRACK* track, wxDC* DC, int end ); bool MergeCollinearTracks( TRACK* track, wxDC* DC, int end );
void Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC ); void Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC );
void SwitchLayer( wxDC* DC, int layer ); void SwitchLayer( wxDC* DC, int layer );
bool Add_45_degrees_Segment( wxDC* DC ); bool Add_45_degrees_Segment( wxDC* DC );
bool Genere_Pad_Connexion( wxDC* DC, int layer ); bool Genere_Pad_Connexion( wxDC* DC, int layer );
/** function EraseRedundantTrack /** function EraseRedundantTrack
* Called after creating a track * Called after creating a track
* Remove (if exists) the old track that have the same starting and the same ending point as the new created track * Remove (if exists) the old track that have the same starting and the
* same ending point as the new created track
* (this is the redunding track) * (this is the redunding track)
* @param aDC = the current device context (can be NULL) * @param aDC = the current device context (can be NULL)
* @param aNewTrack = the new created track (a pointer to a segment of the track list) * @param aNewTrack = the new created track (a pointer to a segment of the
* track list)
* @param aNewTrackSegmentsCount = number of segments in this new track * @param aNewTrackSegmentsCount = number of segments in this new track
* @param aItemsListPicker = the list picker to use for an undo command (can be NULL) * @param aItemsListPicker = the list picker to use for an undo command
* (can be NULL)
*/ */
int EraseRedundantTrack( wxDC* aDC, TRACK* aNewTrack, int aNewTrackSegmentsCount, int EraseRedundantTrack( wxDC* aDC,
PICKED_ITEMS_LIST* aItemsListPicker ); TRACK* aNewTrack,
int aNewTrackSegmentsCount,
PICKED_ITEMS_LIST* aItemsListPicker );
/** Function SetTrackSegmentWidth /** Function SetTrackSegmentWidth
* Modify one track segment width or one via diameter (using DRC control). * Modify one track segment width or one via diameter (using DRC control).
* Basic routine used by other routines when editing tracks or vias * Basic routine used by other routines when editing tracks or vias
* @param aTrackItem = the track segment or via to modify * @param aTrackItem = the track segment or via to modify
* @param aItemsListPicker = the list picker to use for an undo command (can be NULL) * @param aItemsListPicker = the list picker to use for an undo command
* @param aUseNetclassValue = true to use NetClass value, false to use g_DesignSettings value * (can be NULL)
* @param aUseNetclassValue = true to use NetClass value, false to use
* g_DesignSettings value
* @return true if done, false if no not change (because DRC error) * @return true if done, false if no not change (because DRC error)
*/ */
bool SetTrackSegmentWidth( TRACK* aTrackItem, PICKED_ITEMS_LIST* aItemsListPicker, bool aUseNetclassValue ); bool SetTrackSegmentWidth( TRACK* aTrackItem,
PICKED_ITEMS_LIST* aItemsListPicker,
bool aUseNetclassValue );
// zone handling // zone handling
/** Function Delete_Zone_Fill /** Function Delete_Zone_Fill
* Remove the zone filling which include the segment aZone, or the zone which have the given time stamp. * Remove the zone filling which include the segment aZone, or the zone
* A zone is a group of segments which have the same TimeStamp * which have the given time stamp. A zone is a group of segments which
* have the same TimeStamp
* @param aZone = zone segment within the zone to delete. Can be NULL * @param aZone = zone segment within the zone to delete. Can be NULL
* @param aTimestamp = Timestamp for the zone to delete, used if aZone == NULL * @param aTimestamp = Timestamp for the zone to delete, used if aZone ==
* NULL
*/ */
void Delete_Zone_Fill( SEGZONE* Track, long aTimestamp = 0 ); void Delete_Zone_Fill( SEGZONE* Track, long aTimestamp = 0 );
/** Function Delete_LastCreatedCorner /** Function Delete_LastCreatedCorner
...@@ -504,14 +561,14 @@ public: ...@@ -504,14 +561,14 @@ 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, * initiates a zone edge creation process,
* or terminates the current zone edge and creates a new zone edge stub * or terminates the current zone edge and creates a new zone edge stub
*/ */
int Begin_Zone( wxDC* DC ); int Begin_Zone( wxDC* DC );
/** /**
* Function End_Zone * Function End_Zone
...@@ -519,7 +576,7 @@ public: ...@@ -519,7 +576,7 @@ public:
* @param DC = current Device Context * @param DC = current Device Context
* @return true if Ok, false if DRC error * @return true if Ok, false if DRC error
*/ */
bool End_Zone( wxDC* DC ); bool End_Zone( wxDC* DC );
/** Function Fill_Zone() /** Function Fill_Zone()
* Calculate the zone filling for the outline zone_container * Calculate the zone filling for the outline zone_container
...@@ -530,7 +587,7 @@ public: ...@@ -530,7 +587,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()
* Fill all zones on the board * Fill all zones on the board
...@@ -538,7 +595,7 @@ public: ...@@ -538,7 +595,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 );
/** /**
...@@ -547,22 +604,22 @@ public: ...@@ -547,22 +604,22 @@ public:
* @param DC = current Device Context * @param DC = current Device Context
* @param zone_container = parent zone outline * @param zone_container = parent zone outline
*/ */
void Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* zone_container ); void Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* zone_container );
/** /**
* Function Add_Similar_Zone * Function Add_Similar_Zone
* Add a zone to a given zone outline. * Add a zone to a given zone outline.
* if the zones are overlappeing they will be merged * if the zones are overlapping they will be merged
* @param DC = current Device Context * @param DC = current Device Context
* @param zone_container = parent zone outline * @param zone_container = parent zone outline
*/ */
void Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* zone_container ); void Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* zone_container );
/** /**
* Function Edit_Zone_Params * Function Edit_Zone_Params
* Edit params (layer, clearance, ...) for a zone outline * Edit params (layer, clearance, ...) for a zone outline
*/ */
void Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container ); void Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container );
/** /**
* Function Start_Move_Zone_Corner * Function Start_Move_Zone_Corner
...@@ -570,18 +627,20 @@ public: ...@@ -570,18 +627,20 @@ public:
* called from a move corner command (IsNewCorner = false), * called from a move corner command (IsNewCorner = false),
* or a create new cornet command (IsNewCorner = true ) * or a create new cornet command (IsNewCorner = true )
*/ */
void Start_Move_Zone_Corner( wxDC* DC, void Start_Move_Zone_Corner( wxDC* DC,
ZONE_CONTAINER* zone_container, ZONE_CONTAINER* zone_container,
int corner_id, int corner_id,
bool IsNewCorner ); bool IsNewCorner );
/** /**
* Function Start_Move_Zone_Corner * Function Start_Move_Zone_Corner
* Prepares a drag edge in an existing zone outline, * Prepares a drag edge in an existing zone outline,
*/ */
void Start_Move_Zone_Drag_Outline_Edge( wxDC* DC, void Start_Move_Zone_Drag_Outline_Edge(
ZONE_CONTAINER* zone_container, wxDC* DC,
int corner_id ); ZONE_CONTAINER*
zone_container,
int corner_id );
/** /**
* Function End_Move_Zone_Corner_Or_Outlines * Function End_Move_Zone_Corner_Or_Outlines
...@@ -589,7 +648,10 @@ public: ...@@ -589,7 +648,10 @@ public:
* @param DC = current Device Context (can be NULL) * @param DC = current Device Context (can be NULL)
* @param zone_container: the given zone * @param zone_container: the given zone
*/ */
void End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container ); void End_Move_Zone_Corner_Or_Outlines(
wxDC* DC,
ZONE_CONTAINER*
zone_container );
/** /**
* Function End_Move_Zone_Corner_Or_Outlines * Function End_Move_Zone_Corner_Or_Outlines
...@@ -599,8 +661,9 @@ public: ...@@ -599,8 +661,9 @@ public:
void Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container ); void Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container );
/** Function Delete_Zone /** Function Delete_Zone
* Remove the zone which include the segment aZone, or the zone which have the given time stamp. * Remove the zone which include the segment aZone, or the zone which have
* A zone is a group of segments which have the same TimeStamp * the given time stamp. A zone is a group of segments which have the
* same TimeStamp
* @param DC = current Device Context (can be NULL) * @param DC = current Device Context (can be NULL)
* @param zone_container = zone to modify * @param zone_container = zone to modify
* the member .m_CornerSelection is used to find the outline to remove. * the member .m_CornerSelection is used to find the outline to remove.
...@@ -611,18 +674,21 @@ public: ...@@ -611,18 +674,21 @@ public:
/** /**
* Function Start_Move_Zone_Outlines * Function Start_Move_Zone_Outlines
* Initialise parametres to move an existing zone outlines. * Initialize parameters to move an existing zone outlines.
* @param DC = current Device Context (can be NULL) * @param DC = current Device Context (can be NULL)
* @param zone_container: the given zone to move * @param zone_container: the given zone to move
*/ */
void Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container ); void Start_Move_Zone_Outlines( wxDC* DC,
ZONE_CONTAINER* zone_container );
// Target handling // Target handling
MIREPCB* Create_Mire( wxDC* DC ); MIREPCB* Create_Mire( wxDC* DC );
void Delete_Mire( MIREPCB* MirePcb, wxDC* DC ); void Delete_Mire( MIREPCB* MirePcb, wxDC* DC );
void StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ); void StartMove_Mire( MIREPCB* MirePcb, wxDC* DC );
void Place_Mire( MIREPCB* MirePcb, wxDC* DC ); void Place_Mire( MIREPCB* MirePcb, wxDC* DC );
void InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC, const wxPoint& pos ); void InstallMireOptionsFrame( MIREPCB* MirePcb,
wxDC* DC,
const wxPoint& pos );
// Graphic segments type DRAWSEGMENT handling: // Graphic segments type DRAWSEGMENT handling:
DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC ); DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC );
...@@ -631,7 +697,9 @@ public: ...@@ -631,7 +697,9 @@ public:
void Delete_Drawings_All_Layer( int aLayer ); void Delete_Drawings_All_Layer( int aLayer );
// Dimension handling: // Dimension handling:
void Install_Edit_Cotation( COTATION* Cotation, wxDC* DC, const wxPoint& pos ); void Install_Edit_Cotation( COTATION* Cotation,
wxDC* DC,
const wxPoint& pos );
COTATION* Begin_Cotation( COTATION* Cotation, wxDC* DC ); COTATION* Begin_Cotation( COTATION* Cotation, wxDC* DC );
void Delete_Cotation( COTATION* Cotation, wxDC* DC ); void Delete_Cotation( COTATION* Cotation, wxDC* DC );
...@@ -643,7 +711,7 @@ public: ...@@ -643,7 +711,7 @@ public:
void AutoPlace( wxCommandEvent& event ); void AutoPlace( wxCommandEvent& event );
/** function OnOrientFootprints /** function OnOrientFootprints
* install the dialog box for the comman Orient Footprints * install the dialog box for the common Orient Footprints
*/ */
void OnOrientFootprints( void ); void OnOrientFootprints( void );
...@@ -672,7 +740,6 @@ public: ...@@ -672,7 +740,6 @@ public:
void ReadAutoroutedTracks( wxDC* DC ); void ReadAutoroutedTracks( wxDC* DC );
void GlobalRoute( wxDC* DC ); void GlobalRoute( wxDC* DC );
// divers
void Show_1_Ratsnest( EDA_BaseStruct* item, wxDC* DC ); void Show_1_Ratsnest( EDA_BaseStruct* item, wxDC* DC );
void Ratsnest_On_Off( wxDC* DC ); void Ratsnest_On_Off( wxDC* DC );
void Clean_Pcb( wxDC* DC ); void Clean_Pcb( wxDC* DC );
...@@ -683,7 +750,8 @@ public: ...@@ -683,7 +750,8 @@ public:
* Function SendMessageToEESCHEMA * Function SendMessageToEESCHEMA
* sends a message to the schematic editor so that it may move its cursor * sends a message to the schematic editor so that it may move its cursor
* to a part with the same reference as the objectToSync * to a part with the same reference as the objectToSync
* @param objectToSync The object whose reference is used to syncronize eeschema. * @param objectToSync The object whose reference is used to synchronize
* eeschema.
*/ */
void SendMessageToEESCHEMA( BOARD_ITEM* objectToSync ); void SendMessageToEESCHEMA( BOARD_ITEM* objectToSync );
...@@ -767,11 +835,13 @@ public: ...@@ -767,11 +835,13 @@ public:
void ToPrinter( wxCommandEvent& event ); void ToPrinter( wxCommandEvent& event );
// BOARD handling // BOARD handling
/** function Clear_Pcb() /** function Clear_Pcb()
* delete all and reinitialize the current board * delete all and reinitialize the current board
* @param aQuery = true to prompt user for confirmation, false to initialize silently * @param aQuery = true to prompt user for confirmation, false to
* initialize silently
*/ */
bool Clear_Pcb( bool aQuery ); bool Clear_Pcb( bool aQuery );
/* handlers for block commands */ /* handlers for block commands */
int ReturnBlockCommand( int key ); int ReturnBlockCommand( int key );
...@@ -782,51 +852,57 @@ public: ...@@ -782,51 +852,57 @@ public:
/* Undo and redo functions */ /* Undo and redo functions */
public: public:
/** Function SaveCopyInUndoList.
/** Function SaveCopyInUndoList.
* Creates a new entry in undo list of commands. * Creates a new entry in undo list of commands.
* add a picker to handle aItemToCopy * add a picker to handle aItemToCopy
* @param aItem = the board item modified by the command to undo * @param aItem = the board item modified by the command to undo
* @param aTypeCommand = command type (see enum UndoRedoOpType) * @param aTypeCommand = command type (see enum UndoRedoOpType)
* @param aTransformPoint = the reference point of the transformation, for commands like move * @param aTransformPoint = the reference point of the transformation, for
* commands like move
*/ */
virtual void SaveCopyInUndoList( BOARD_ITEM* aItem, UndoRedoOpType aTypeCommand, virtual void SaveCopyInUndoList( BOARD_ITEM* aItem,
const wxPoint& aTransformPoint = wxPoint(0,0) ); UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint =
wxPoint( 0, 0 ) );
/** Function SaveCopyInUndoList (overloaded). /** Function SaveCopyInUndoList (overloaded).
* Creates a new entry in undo list of commands. * Creates a new entry in undo list of commands.
* add a list of pickers to handle a list of items * add a list of pickers to handle a list of items
* @param aItemsList = the list of items modified by the command to undo * @param aItemsList = the list of items modified by the command to undo
* @param aTypeCommand = command type (see enum UndoRedoOpType) * @param aTypeCommand = command type (see enum UndoRedoOpType)
* @param aTransformPoint = the reference point of the transformation, for commands like move * @param aTransformPoint = the reference point of the transformation, for
* commands like move
*/ */
virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, UndoRedoOpType aTypeCommand, virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
const wxPoint& aTransformPoint = wxPoint(0,0) ); UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint =
wxPoint( 0, 0 ) );
private: private:
void GetComponentFromUndoList(wxCommandEvent& event); void GetComponentFromUndoList( wxCommandEvent& event );
void GetComponentFromRedoList(wxCommandEvent& event); void GetComponentFromRedoList( wxCommandEvent& event );
public: public:
// Footprint edition // Footprint edition
void Place_Ancre( MODULE* module ); void Place_Ancre( MODULE* module );
void RemoveStruct( EDA_BaseStruct* Item ); void RemoveStruct( EDA_BaseStruct* Item );
void Transform( MODULE* module, int transform ); void Transform( MODULE* module, int transform );
// loading Footprint // loading Footprint
MODULE* Import_Module( wxDC* DC ); MODULE* Import_Module( wxDC* DC );
void Export_Module( MODULE* ptmod, bool createlib ); void Export_Module( MODULE* ptmod, bool createlib );
void Load_Module_From_BOARD( MODULE* Module ); void Load_Module_From_BOARD( MODULE* Module );
// functions to edit footprint edges // functions to edit footprint edges
/** /**
* Function Edit_Edge_Width * Function Edit_Edge_Width
* changes the width of module perimeter lines, EDGE_MODULEs. * changes the width of module perimeter lines, EDGE_MODULEs.
* @param ModuleSegmentWidth (global) = new width * @param ModuleSegmentWidth (global) = new width
* @param Edge = edge to edit, or NULL. If Edge == NULL change * @param Edge = edge to edit, or NULL. If Edge == NULL change
* the width of all the footprint's edges * the width of all the footprint's edges
* @param DC = current Device Context * @param DC = current Device Context
*/ */
void Edit_Edge_Width( EDGE_MODULE* Edge ); void Edit_Edge_Width( EDGE_MODULE* Edge );
......
/***********************************************************/ /****************/
/* wxstruct.h: */ /* wxstruct.h */
/* descriptions des principales classes derivees utilisees */ /****************/
/***********************************************************/
#ifndef WXSTRUCT_H #ifndef WXSTRUCT_H
#define WXSTRUCT_H #define WXSTRUCT_H
...@@ -32,13 +31,11 @@ ...@@ -32,13 +31,11 @@
#endif #endif
// Option for dialog boxes // Option for dialog boxes
// #define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxFRAME_FLOAT_ON_PARENT|wxSTAY_ON_TOP
#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | \ #define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | \
MAYBE_RESIZE_BORDER MAYBE_RESIZE_BORDER
#define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS #define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS
/* Forward declarations of classes. */
class EDA_BaseStruct; class EDA_BaseStruct;
class EDA_Rect; class EDA_Rect;
class WinEDA_DrawPanel; class WinEDA_DrawPanel;
...@@ -110,8 +107,6 @@ public: ...@@ -110,8 +107,6 @@ public:
#endif #endif
public: public:
// Constructor and destructor
WinEDA_BasicFrame( wxWindow* father, int idtype, WinEDA_BasicFrame( wxWindow* father, int idtype,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
...@@ -152,22 +147,31 @@ class WinEDA_DrawFrame : public WinEDA_BasicFrame ...@@ -152,22 +147,31 @@ class WinEDA_DrawFrame : public WinEDA_BasicFrame
{ {
public: public:
WinEDA_DrawPanel* DrawPanel; // Draw area WinEDA_DrawPanel* DrawPanel; // Draw area
WinEDA_MsgPanel* MsgPanel; // Panel used to display some info (bottom of the screen) WinEDA_MsgPanel* MsgPanel; // Panel used to display some
// info (bottom of the screen)
WinEDA_Toolbar* m_VToolBar; // Vertical (right side) Toolbar WinEDA_Toolbar* m_VToolBar; // Vertical (right side) Toolbar
WinEDA_Toolbar* m_AuxVToolBar; // Auxiliary Vertical (right side) Toolbar WinEDA_Toolbar* m_AuxVToolBar; // Auxiliary Vertical (right side)
// Toolbar
WinEDA_Toolbar* m_OptionsToolBar; // Options Toolbar (left side) WinEDA_Toolbar* m_OptionsToolBar; // Options Toolbar (left side)
WinEDA_Toolbar* m_AuxiliaryToolBar; // Toolbar auxiliaire (utilis� dans pcbnew) WinEDA_Toolbar* m_AuxiliaryToolBar; // Auxiliay Toolbar used in pcbnew
WinEDAChoiceBox* m_SelGridBox; // Dialog box to choose the grid size WinEDAChoiceBox* m_SelGridBox; // Choice box to choose the grid
WinEDAChoiceBox* m_SelZoomBox; // Dialog box to choose the Zoom value // size
WinEDAChoiceBox* m_SelZoomBox; // Choice box to choose the zoom
int m_CursorShape; // shape for cursor (0 = default cursor) // value
int m_ID_current_state; // Id of active button on the vertical toolbar
int m_ID_last_state; // Id of previous active button on the vertical toolbar int m_CursorShape; // shape for cursor (0 = default
int m_HTOOL_current_state; // Id of active button on horizontal toolbar // cursor)
int m_ID_current_state; // Id of active button on the
// vertical toolbar
int m_ID_last_state; // Id of previous active button
// on the vertical toolbar
int m_HTOOL_current_state; // Id of active button on
// horizontal toolbar
int m_InternalUnits; // Internal units count in 1 inch int m_InternalUnits; // Internal units count in 1 inch
// = 1000 for eeschema, = 10000 for PCBnew and Gerbview // = 1000 for eeschema, = 10000
// for PCBnew and Gerbview
int m_UnitType; // Internal Unit type (0 = inch) int m_UnitType; // Internal Unit type (0 = inch)
bool m_Draw_Axis; // TRUE to show X and Y axis bool m_Draw_Axis; // TRUE to show X and Y axis
...@@ -175,8 +179,11 @@ public: ...@@ -175,8 +179,11 @@ public:
bool m_Draw_Sheet_Ref; // TRUE to show frame references bool m_Draw_Sheet_Ref; // TRUE to show frame references
bool m_Print_Sheet_Ref; // TRUE to print frame references bool m_Print_Sheet_Ref; // TRUE to print frame references
bool m_Draw_Auxiliary_Axis; /* TRUE to show auxiliary axis. Used in pcbnew: bool m_Draw_Auxiliary_Axis; /* TRUE to show auxiliary axis.
* the auxiliary axis is the origin of coordinates for drill, gerber and component position files * Used in pcbnew: the auxiliary
* axis is the origin of
* coordinates for drill, gerber
* and component position files
*/ */
wxPoint m_Auxiliary_Axis_Position; /* position of the auxiliary axis */ wxPoint m_Auxiliary_Axis_Position; /* position of the auxiliary axis */
...@@ -187,11 +194,12 @@ private: ...@@ -187,11 +194,12 @@ private:
BASE_SCREEN* m_CurrentScreen; ///< current used SCREEN BASE_SCREEN* m_CurrentScreen; ///< current used SCREEN
protected: protected:
void SetBaseScreen( BASE_SCREEN* aScreen ) { m_CurrentScreen = aScreen; } void SetBaseScreen( BASE_SCREEN* aScreen )
{
m_CurrentScreen = aScreen;
}
public: public:
// Constructor and destructor
WinEDA_DrawFrame( wxWindow* father, int idtype, WinEDA_DrawFrame( wxWindow* father, int idtype,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
...@@ -247,7 +255,9 @@ public: ...@@ -247,7 +255,9 @@ public:
virtual void OnZoom( wxCommandEvent& event ); virtual void OnZoom( wxCommandEvent& event );
void OnGrid( int grid_type ); void OnGrid( int grid_type );
void Recadre_Trace( bool ToMouse ); void Recadre_Trace( bool ToMouse );
void PutOnGrid( wxPoint* coord ); /* set the coordiante "coord" to the nearest grid coordinate */ void PutOnGrid( wxPoint* coord ); /* set the coordinate to
* the nearest grid
* coordinate */
void Zoom_Automatique( bool move_mouse_cursor ); void Zoom_Automatique( bool move_mouse_cursor );
/* Set the zoom level to show the area Rect */ /* Set the zoom level to show the area Rect */
...@@ -271,9 +281,11 @@ public: ...@@ -271,9 +281,11 @@ public:
* Return the X,Y sheet references where the point position is located * Return the X,Y sheet references where the point position is located
* @param aScreen = screen to use * @param aScreen = screen to use
* @param aPosition = position to identify by YX ref * @param aPosition = position to identify by YX ref
* @return a wxString containing the message locator like A3 or B6 (or ?? if out of page limits) * @return a wxString containing the message locator like A3 or B6
* (or ?? if out of page limits)
*/ */
wxString GetXYSheetReferences( BASE_SCREEN* aScreen, const wxPoint& aPosition ); wxString GetXYSheetReferences( BASE_SCREEN* aScreen,
const wxPoint& aPosition );
void DisplayToolMsg( const wxString& msg ); void DisplayToolMsg( const wxString& msg );
void Process_Zoom( wxCommandEvent& event ); void Process_Zoom( wxCommandEvent& event );
...@@ -281,7 +293,8 @@ public: ...@@ -281,7 +293,8 @@ public:
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0; virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0; virtual bool OnRightClick( const wxPoint& MousePos,
wxMenu* PopMenu ) = 0;
virtual void ToolOnRightClick( wxCommandEvent& event ); virtual void ToolOnRightClick( wxCommandEvent& event );
void AdjustScrollBars(); void AdjustScrollBars();
...@@ -295,8 +308,8 @@ public: ...@@ -295,8 +308,8 @@ public:
* a drawing function per se, but rather updates lines of text held by * a drawing function per se, but rather updates lines of text held by
* the components within the status bar which is owned by the wxFrame. * the components within the status bar which is owned by the wxFrame.
* <p> * <p>
* On a MAC, be careful about calling this function when there is an existing * On a MAC, be careful about calling this function when there is an
* wxDC in existence on a sibling window. * existing wxDC in existence on a sibling window.
*/ */
virtual void UpdateStatusBar(); virtual void UpdateStatusBar();
...@@ -305,7 +318,8 @@ public: ...@@ -305,7 +318,8 @@ public:
/* Handlers for block commands */ /* Handlers for block commands */
virtual int ReturnBlockCommand( int key ); virtual int ReturnBlockCommand( int key );
virtual void InitBlockPasteInfos(); virtual void InitBlockPasteInfos();
virtual bool HandleBlockBegin( wxDC* DC, int cmd_type, const wxPoint& startpos ); virtual bool HandleBlockBegin( wxDC* DC, int cmd_type,
const wxPoint& startpos );
virtual void HandleBlockPlace( wxDC* DC ); virtual void HandleBlockPlace( wxDC* DC );
virtual int HandleBlockEnd( wxDC* DC ); virtual int HandleBlockEnd( wxDC* DC );
...@@ -342,10 +356,6 @@ public: ...@@ -342,10 +356,6 @@ public:
}; };
/****************************************************/
/* classe representant un ecran graphique de dessin */
/****************************************************/
/********************************************************* /*********************************************************
* class WinEDA_MsgPanel : this is a panel to display various infos * class WinEDA_MsgPanel : this is a panel to display various infos
* and messages on items in eeschema an pcbnew * and messages on items in eeschema an pcbnew
...@@ -410,12 +420,11 @@ protected: ...@@ -410,12 +420,11 @@ protected:
public: public:
WinEDA_DrawFrame* m_Parent; WinEDA_DrawFrame* m_Parent;
int m_BgColor; // couleur de fond int m_BgColor;
public: public:
WinEDA_MsgPanel( WinEDA_DrawFrame* parent, int id, const wxPoint& pos,
// Constructor and destructor const wxSize& size );
WinEDA_MsgPanel( WinEDA_DrawFrame* parent, int id, const wxPoint& pos, const wxSize& size );
~WinEDA_MsgPanel(); ~WinEDA_MsgPanel();
...@@ -465,8 +474,6 @@ private: ...@@ -465,8 +474,6 @@ private:
wxStaticText* m_Title; wxStaticText* m_Title;
public: public:
// Constructor and destructor
WinEDA_EnterText( wxWindow* parent, const wxString& Title, WinEDA_EnterText( wxWindow* parent, const wxString& Title,
const wxString& TextToEdit, wxBoxSizer* BoxSizer, const wxString& TextToEdit, wxBoxSizer* BoxSizer,
const wxSize& Size, bool Multiline = false ); const wxSize& Size, bool Multiline = false );
...@@ -489,6 +496,7 @@ public: ...@@ -489,6 +496,7 @@ public:
} }
}; };
/************************************************************************/ /************************************************************************/
/* Class to edit/enter a graphic text and its dimension ( INCHES or MM )*/ /* Class to edit/enter a graphic text and its dimension ( INCHES or MM )*/
/************************************************************************/ /************************************************************************/
...@@ -503,8 +511,6 @@ private: ...@@ -503,8 +511,6 @@ private:
wxStaticText* m_Title; wxStaticText* m_Title;
public: public:
// Constructor and destructor
WinEDA_GraphicTextCtrl( wxWindow* parent, const wxString& Title, WinEDA_GraphicTextCtrl( wxWindow* parent, const wxString& Title,
const wxString& TextToEdit, int textsize, const wxString& TextToEdit, int textsize,
int units, wxBoxSizer* BoxSizer, int framelen = 200, int units, wxBoxSizer* BoxSizer, int framelen = 200,
...@@ -527,13 +533,15 @@ public: ...@@ -527,13 +533,15 @@ public:
*/ */
static wxString FormatSize( int internalUnit, int units, int textSize ); static wxString FormatSize( int internalUnit, int units, int textSize );
static int ParseSize( const wxString& sizeText, int internalUnit, int units ); static int ParseSize( const wxString& sizeText, int internalUnit,
int units );
}; };
/*************************************************************************************/ /**************************************************************************/
/*Class to edit/enter a coordinate (pair of values) ( INCHES or MM ) in dialog boxes */ /* Class to edit/enter a coordinate (pair of values) ( INCHES or MM ) in */
/*************************************************************************************/ /* dialog boxes, */
/**************************************************************************/
class WinEDA_PositionCtrl class WinEDA_PositionCtrl
{ {
public: public:
...@@ -546,8 +554,6 @@ private: ...@@ -546,8 +554,6 @@ private:
wxStaticText* m_TextX, * m_TextY; wxStaticText* m_TextX, * m_TextY;
public: public:
// Constructor and destructor
WinEDA_PositionCtrl( wxWindow* parent, const wxString& title, WinEDA_PositionCtrl( wxWindow* parent, const wxString& title,
const wxPoint& pos_to_edit, const wxPoint& pos_to_edit,
int units, wxBoxSizer* BoxSizer, int units, wxBoxSizer* BoxSizer,
...@@ -560,6 +566,7 @@ public: ...@@ -560,6 +566,7 @@ public:
wxPoint GetValue(); wxPoint GetValue();
}; };
/************************************************************* /*************************************************************
* Class to edit/enter a size (pair of values for X and Y size) * Class to edit/enter a size (pair of values for X and Y size)
* ( INCHES or MM ) in dialog boxes * ( INCHES or MM ) in dialog boxes
...@@ -567,8 +574,6 @@ public: ...@@ -567,8 +574,6 @@ public:
class WinEDA_SizeCtrl : public WinEDA_PositionCtrl class WinEDA_SizeCtrl : public WinEDA_PositionCtrl
{ {
public: public:
// Constructor and destructor
WinEDA_SizeCtrl( wxWindow* parent, const wxString& title, WinEDA_SizeCtrl( wxWindow* parent, const wxString& title,
const wxSize& size_to_edit, const wxSize& size_to_edit,
int units, wxBoxSizer* BoxSizer, int units, wxBoxSizer* BoxSizer,
...@@ -582,11 +587,6 @@ public: ...@@ -582,11 +587,6 @@ public:
/****************************************************************/ /****************************************************************/
/* Class to edit/enter a value ( INCHES or MM ) in dialog boxes */ /* Class to edit/enter a value ( INCHES or MM ) in dialog boxes */
/****************************************************************/ /****************************************************************/
/* internal_unit est le nombre d'unites internes par inch
* - 1000 sur EESchema
* - 10000 sur PcbNew
*/
class WinEDA_ValueCtrl class WinEDA_ValueCtrl
{ {
public: public:
...@@ -598,8 +598,6 @@ private: ...@@ -598,8 +598,6 @@ private:
wxStaticText* m_Text; wxStaticText* m_Text;
public: public:
// Constructor and destructor
WinEDA_ValueCtrl( wxWindow* parent, const wxString& title, int value, WinEDA_ValueCtrl( wxWindow* parent, const wxString& title, int value,
int units, wxBoxSizer* BoxSizer, int units, wxBoxSizer* BoxSizer,
int internal_unit = EESCHEMA_INTERNAL_UNIT ); int internal_unit = EESCHEMA_INTERNAL_UNIT );
...@@ -616,6 +614,7 @@ public: ...@@ -616,6 +614,7 @@ public:
} }
}; };
/************************************************************************/ /************************************************************************/
/* Class to edit/enter a pair of float (double) values in dialog boxes */ /* Class to edit/enter a pair of float (double) values in dialog boxes */
/************************************************************************/ /************************************************************************/
...@@ -628,8 +627,6 @@ private: ...@@ -628,8 +627,6 @@ private:
wxStaticText* m_Text; wxStaticText* m_Text;
public: public:
// Constructor and destructor
WinEDA_DFloatValueCtrl( wxWindow* parent, const wxString& title, WinEDA_DFloatValueCtrl( wxWindow* parent, const wxString& title,
double value, wxBoxSizer* BoxSizer ); double value, wxBoxSizer* BoxSizer );
...@@ -671,13 +668,16 @@ public: ...@@ -671,13 +668,16 @@ public:
#if defined(KICAD_AUITOOLBAR) #if defined(KICAD_AUITOOLBAR)
bool GetToolState( int toolId ) { return GetToolToggled(toolId); }; bool GetToolState( int toolId ) { return GetToolToggled(toolId); };
void AddRadioTool( int toolid, const wxString& label, const wxBitmap& bitmap, void AddRadioTool( int toolid,
const wxBitmap& bmpDisabled = wxNullBitmap, const wxString& label,
const wxString& shortHelp = wxEmptyString, const wxBitmap& bitmap,
const wxString& longHelp = wxEmptyString, const wxBitmap& bmpDisabled = wxNullBitmap,
wxObject *data = NULL ) const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString,
wxObject* data = NULL )
{ {
AddTool( toolid, label, bitmap, bmpDisabled, wxITEM_CHECK, shortHelp, longHelp, data ); AddTool( toolid, label, bitmap, bmpDisabled, wxITEM_CHECK,
shortHelp, longHelp, data );
}; };
void SetToolNormalBitmap( int id, const wxBitmap& bitmap ) {}; void SetToolNormalBitmap( int id, const wxBitmap& bitmap ) {};
......
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