Commit 2884d125 authored by stambaughw's avatar stambaughw

Replace library editor pin properties dialog box and minor update.

* Replaced library pin properties dialog with wxFormBuilder version.
* Remove DialogBlocks version of pin properties dialog.
* Add pin properties dialog support code to pin object.
* Create single event handler for displaying pin properties dialog.
* Remove left over DialogBlocks project file for annotate dialog.
* Fixed escape key bug in library editor new component dialog.
* Add GetUnitsLabel() to get human readable units for dialog labels.
* Translate French comments in all modified files.
* Some minor clean up of Doxygen comments.
parent 29e217d3
...@@ -73,10 +73,7 @@ int g_DebugLevel; ...@@ -73,10 +73,7 @@ int g_DebugLevel;
int g_MouseOldButtons; int g_MouseOldButtons;
int g_KeyPressed; int g_KeyPressed;
// Nom (full file name) du file Configuration par defaut (kicad.pro)
wxString g_Prj_Default_Config_FullFilename; wxString g_Prj_Default_Config_FullFilename;
// Nom du file Configuration local (<curr projet>.pro)
wxString g_Prj_Config_LocalFilename; wxString g_Prj_Config_LocalFilename;
// Handle the preferd editor for browsing report files: // Handle the preferd editor for browsing report files:
...@@ -257,6 +254,31 @@ wxString ReturnUnitSymbol( int Units ) ...@@ -257,6 +254,31 @@ wxString ReturnUnitSymbol( int Units )
} }
wxString GetUnitsLabel( int units )
{
wxString label;
switch( units )
{
case INCHES:
label = _( "inches" );
break;
case MILLIMETRE:
label = _( "millimeters" );
break;
case CENTIMETRE:
label = _( "centimeters" );
break;
default:
label = _( "Unknown" );
break;
}
return label;
}
/* /*
* 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
...@@ -669,17 +691,6 @@ void WinEDA_TextFrame::OnClose( wxCloseEvent& event ) ...@@ -669,17 +691,6 @@ void WinEDA_TextFrame::OnClose( wxCloseEvent& event )
} }
/**
* Routine d'affichage d'un parametre.
* pos_X = cadrage horizontal
* si pos_X < 0 : la position horizontale est la derniere
* valeur demandee >= 0
* texte_H = texte a afficher en ligne superieure.
* si "", par d'affichage sur cette ligne
* texte_L = texte a afficher en ligne inferieure.
* si "", par d'affichage sur cette ligne
* color = couleur d'affichage
*/
/*****************************************************************************/ /*****************************************************************************/
void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X, void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X,
const wxString& texte_H, const wxString& texte_L, const wxString& texte_H, const wxString& texte_L,
...@@ -693,10 +704,6 @@ void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X, ...@@ -693,10 +704,6 @@ void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X,
/***********************/ /***********************/
int GetTimeStamp() int GetTimeStamp()
/***********************/ /***********************/
/*
* Retourne une identification temporelle (Time stamp) differente a chaque appel
*/
{ {
static int OldTimeStamp, NewTimeStamp; static int OldTimeStamp, NewTimeStamp;
...@@ -708,16 +715,12 @@ int GetTimeStamp() ...@@ -708,16 +715,12 @@ int GetTimeStamp()
} }
/** /* Returns to display the value of a parameter, by type of units selected
* TODO replace this obsolete funtion by ReturnStringFromValue * Input: value in mils, buffer text
* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies * Returns to buffer: text: value expressed in inches or millimeters
* entree : valeur en mils , buffer de texte * Followed by " or mm
* retourne en buffer : texte : valeur exprimee en pouces ou millimetres
* suivie de " ou mm
*/ */
/*********************************************/
const wxString& valeur_param( int valeur, wxString& buf_texte ) const wxString& valeur_param( int valeur, wxString& buf_texte )
/*********************************************/
{ {
if( g_UnitMetric ) if( g_UnitMetric )
{ {
......
...@@ -57,6 +57,8 @@ set(EESCHEMA_SRCS ...@@ -57,6 +57,8 @@ set(EESCHEMA_SRCS
# dialog_find.cpp # dialog_find.cpp
dialog_lib_edit_draw_item.cpp dialog_lib_edit_draw_item.cpp
dialog_lib_edit_draw_item_base.cpp dialog_lib_edit_draw_item_base.cpp
dialog_lib_edit_pin.cpp
dialog_lib_edit_pin_base.cpp
dialog_lib_new_component.cpp dialog_lib_new_component.cpp
dialog_lib_new_component_base.cpp dialog_lib_new_component_base.cpp
dialog_options.cpp dialog_options.cpp
...@@ -97,7 +99,6 @@ set(EESCHEMA_SRCS ...@@ -97,7 +99,6 @@ set(EESCHEMA_SRCS
onrightclick.cpp onrightclick.cpp
operations_on_items_lists.cpp operations_on_items_lists.cpp
pinedit.cpp pinedit.cpp
# pinedit-dialog.cpp
plot.cpp plot.cpp
plothpgl.cpp plothpgl.cpp
plotps.cpp plotps.cpp
......
This diff is collapsed.
...@@ -30,7 +30,7 @@ LIB_TEXT::LIB_TEXT(LIB_COMPONENT * aParent) : ...@@ -30,7 +30,7 @@ LIB_TEXT::LIB_TEXT(LIB_COMPONENT * aParent) :
} }
bool LIB_TEXT::Save( FILE* ExportFile ) const bool LIB_TEXT::Save( FILE* ExportFile )
{ {
wxString text = m_Text; wxString text = m_Text;
......
...@@ -81,7 +81,6 @@ bool CMP_LIB_ENTRY::SaveDoc( FILE* aFile ) ...@@ -81,7 +81,6 @@ bool CMP_LIB_ENTRY::SaveDoc( FILE* aFile )
if( m_Doc.IsEmpty() && m_KeyWord.IsEmpty() && m_DocFile.IsEmpty() ) if( m_Doc.IsEmpty() && m_KeyWord.IsEmpty() && m_DocFile.IsEmpty() )
return true; return true;
/* Generation des lignes utiles */
if( fprintf( aFile, "#\n$CMP %s\n", CONV_TO_UTF8( m_Name ) ) < 0 ) if( fprintf( aFile, "#\n$CMP %s\n", CONV_TO_UTF8( m_Name ) ) < 0 )
return false; return false;
...@@ -427,6 +426,27 @@ void LIB_COMPONENT::GetPins( LIB_PIN_LIST& pins, int unit, int convert ) ...@@ -427,6 +426,27 @@ void LIB_COMPONENT::GetPins( LIB_PIN_LIST& pins, int unit, int convert )
} }
LIB_PIN* LIB_COMPONENT::GetPin( const wxString& number, int unit, int convert )
{
wxString pNumber;
LIB_PIN_LIST pinList;
GetPins( pinList, unit, convert );
for( size_t i = 0; i < pinList.size(); i++ )
{
wxASSERT( pinList[i]->Type() == COMPONENT_PIN_DRAW_TYPE );
pinList[i]->ReturnPinStringNum( pNumber );
if( number == pNumber )
return pinList[i];
}
return NULL;
}
bool LIB_COMPONENT::Save( FILE* aFile ) bool LIB_COMPONENT::Save( FILE* aFile )
{ {
size_t i; size_t i;
...@@ -930,7 +950,7 @@ LIB_FIELD& LIB_COMPONENT::GetReferenceField( void ) ...@@ -930,7 +950,7 @@ LIB_FIELD& LIB_COMPONENT::GetReferenceField( void )
/* /*
* lit date et time de modif composant sous le format: * Read date and time of component in the format:
* "Ti yy/mm/jj hh:mm:ss" * "Ti yy/mm/jj hh:mm:ss"
*/ */
bool LIB_COMPONENT::SaveDateAndTime( FILE* file ) bool LIB_COMPONENT::SaveDateAndTime( FILE* file )
...@@ -964,7 +984,7 @@ bool LIB_COMPONENT::LoadDateAndTime( char* Line ) ...@@ -964,7 +984,7 @@ bool LIB_COMPONENT::LoadDateAndTime( char* Line )
year = mon = day = hour = min = sec = 0; year = mon = day = hour = min = sec = 0;
text = strtok( Line, " \r\t\n" ); text = strtok( Line, " \r\t\n" );
text = strtok( NULL, " \r\t\n" ); // text pointe donnees utiles text = strtok( NULL, " \r\t\n" );
if (sscanf( Line, "%d/%d/%d %d:%d:%d", if (sscanf( Line, "%d/%d/%d %d:%d:%d",
&year, &mon, &day, &hour, &min, &sec ) != 6 ) &year, &mon, &day, &hour, &min, &sec ) != 6 )
......
...@@ -69,8 +69,7 @@ public: ...@@ -69,8 +69,7 @@ public:
* Write the entry document information to a FILE in "*.dcm" format. * Write the entry document information to a FILE in "*.dcm" format.
* *
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* * @return True if success writing else false.
* @return bool - true if success writing else false.
*/ */
bool SaveDoc( FILE* aFile ); bool SaveDoc( FILE* aFile );
...@@ -157,8 +156,7 @@ public: ...@@ -157,8 +156,7 @@ public:
* Write the data structures out to a FILE in "*.lib" format. * Write the data structures out to a FILE in "*.lib" format.
* *
* @param aFile - The FILE to write to. * @param aFile - The FILE to write to.
* * @return True if success writing else false.
* @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ); bool Save( FILE* aFile );
...@@ -169,8 +167,7 @@ public: ...@@ -169,8 +167,7 @@ public:
* @param line - The first line of the component definition. * @param line - The first line of the component definition.
* @param lineNum - The current line number in the file. * @param lineNum - The current line number in the file.
* @param errorMsg - Description of error on load failure. * @param errorMsg - Description of error on load failure.
* * @return True if the load was successful, false if there was an error.
* @return bool - Result of the load, false if there was an error.
*/ */
bool Load( FILE* file, char* line, int* lineNum, wxString& errorMsg ); bool Load( FILE* file, char* line, int* lineNum, wxString& errorMsg );
bool LoadField( char* line, wxString& errorMsg ); bool LoadField( char* line, wxString& errorMsg );
...@@ -198,9 +195,7 @@ public: ...@@ -198,9 +195,7 @@ public:
* Return pointer to the requested field. * Return pointer to the requested field.
* *
* @param id - Id of field to return. * @param id - Id of field to return.
* * @return The field if found, otherwise NULL.
* @return LIB_FIELD* - Pointer to field if found. NULL is returned if
* field not found.
*/ */
LIB_FIELD* GetField( int id ); LIB_FIELD* GetField( int id );
...@@ -220,7 +215,7 @@ public: ...@@ -220,7 +215,7 @@ public:
* @param convert - Component conversion (DeMorgan) if available. * @param convert - Component conversion (DeMorgan) if available.
* @param drawMode - Device context drawing mode, see wxDC. * @param drawMode - Device context drawing mode, see wxDC.
* @param color - Color to draw component. * @param color - Color to draw component.
* @param transformMatrix - Cooridinate adjustment settings. * @param transformMatrix - Coordinate adjustment settings.
* @param showPinText - Show pin text if true. * @param showPinText - Show pin text if true.
* @param drawFields - Draw field text if true otherwise just draw * @param drawFields - Draw field text if true otherwise just draw
* body items (useful to draw a body in schematic, * body items (useful to draw a body in schematic,
...@@ -264,16 +259,14 @@ public: ...@@ -264,16 +259,14 @@ public:
WinEDA_DrawPanel* panel = NULL, WinEDA_DrawPanel* panel = NULL,
wxDC* dc = NULL ); wxDC* dc = NULL );
/** GetNextDrawItem() /**
* Return the next draw object pointer. * Return the next draw object pointer.
* *
* @param item - Pointer to the current draw item. Setting item NULL * @param item - Pointer to the current draw item. Setting item NULL
* with return the first item of type in the list. * with return the first item of type in the list.
* @param type - type of searched item (filter). * @param type - type of searched item (filter).
* if TYPE_NOT_INIT search for all items types * if TYPE_NOT_INIT search for all items types
* * @return - The next drawing object in the list if found, otherwise NULL.
* @return - Pointer to the next drawing object in the list if found,
* otherwise NULL.
*/ */
LIB_DRAW_ITEM* GetNextDrawItem( LIB_DRAW_ITEM* item = NULL, LIB_DRAW_ITEM* GetNextDrawItem( LIB_DRAW_ITEM* item = NULL,
...@@ -286,9 +279,7 @@ public: ...@@ -286,9 +279,7 @@ public:
* *
* @param item - Pointer to the previous pin item, or NULL to get the * @param item - Pointer to the previous pin item, or NULL to get the
* first pin in the draw object list. * first pin in the draw object list.
* * @return - The next pin object in the list if found, otherwise NULL.
* @return - Pointer to the next pin object in the list if found,
* otherwise NULL.
*/ */
LIB_PIN* GetNextPin( LIB_PIN* item = NULL ) LIB_PIN* GetNextPin( LIB_PIN* item = NULL )
{ {
...@@ -312,6 +303,18 @@ public: ...@@ -312,6 +303,18 @@ public:
*/ */
void GetPins( LIB_PIN_LIST& pins, int unit = 0, int convert = 0 ); void GetPins( LIB_PIN_LIST& pins, int unit = 0, int convert = 0 );
/**
* Return pin object with the requested pin number.
*
* @param number - Number of the pin to find.
* @param unit - Unit of the component to find. Set to 0 if a specific
* unit number is not required.
* @param convert - Alternate body style filter (DeMorgan). Set to 0 if
* no alternate body style is required.
* @return The pin object if found. Otherwise NULL.
*/
LIB_PIN* GetPin( const wxString& number, int unit = 0, int convert = 0 );
/** /**
* Move the component offset. * Move the component offset.
* *
...@@ -327,7 +330,7 @@ public: ...@@ -327,7 +330,7 @@ public:
/** /**
* Test if component has more than one body conversion type (DeMorgan). * Test if component has more than one body conversion type (DeMorgan).
* *
* @return bool - True if component has more than one conversion. * @return True if component has more than one conversion.
*/ */
bool HasConversion() const; bool HasConversion() const;
...@@ -337,8 +340,7 @@ public: ...@@ -337,8 +340,7 @@ public:
* Alias name comparisons are case insensitive. * Alias name comparisons are case insensitive.
* *
* @param name - Name of alias. * @param name - Name of alias.
* * @return True if alias name in alias list.
* @return bool - True if alias name in alias list.
*/ */
bool HasAlias( const wxChar* name ) bool HasAlias( const wxChar* name )
{ {
...@@ -362,9 +364,8 @@ public: ...@@ -362,9 +364,8 @@ public:
* @param convert - Are the draw items being selected a conversion. * @param convert - Are the draw items being selected a conversion.
* @param editPinByPin - Used to ignore pin selections when in edit pin * @param editPinByPin - Used to ignore pin selections when in edit pin
* by pin mode is enabled. * by pin mode is enabled.
* * @return The number of draw objects found inside the block select
* @return int - The number of draw object found inside the block select * rectangle.
* rectangle.
*/ */
int SelectItems( EDA_Rect& rect, int unit, int convert, int SelectItems( EDA_Rect& rect, int unit, int convert,
bool editPinByPin ); bool editPinByPin );
...@@ -378,7 +379,7 @@ public: ...@@ -378,7 +379,7 @@ public:
* Deletes the select draw items marked by a block select. * Deletes the select draw items marked by a block select.
* *
* The name and reference field will not be deleted. They are the * The name and reference field will not be deleted. They are the
* minimum drawing items required for any component. Thier properties * minimum drawing items required for any component. Their properties
* can be changed but the cannot be removed. * can be changed but the cannot be removed.
*/ */
void DeleteSelectedItems( void ); void DeleteSelectedItems( void );
...@@ -411,9 +412,7 @@ public: ...@@ -411,9 +412,7 @@ public:
* @param convert - Body style of draw item. * @param convert - Body style of draw item.
* @param type - Draw object type, set to 0 to search for any type. * @param type - Draw object type, set to 0 to search for any type.
* @param pt - Coordinate for hit testing. * @param pt - Coordinate for hit testing.
* * @return The draw object if found. Otherwise NULL.
* @return LIB_DRAW_ITEM - Pointer the the draw object if found.
* Otherwise NULL.
*/ */
LIB_DRAW_ITEM* LocateDrawItem( int unit, int convert, KICAD_T type, LIB_DRAW_ITEM* LocateDrawItem( int unit, int convert, KICAD_T type,
const wxPoint& pt ); const wxPoint& pt );
...@@ -426,9 +425,7 @@ public: ...@@ -426,9 +425,7 @@ public:
* @param type - Draw object type, set to 0 to search for any type. * @param type - Draw object type, set to 0 to search for any type.
* @param pt - Coordinate for hit testing. * @param pt - Coordinate for hit testing.
* @param aTransMat = the transform matrix * @param aTransMat = the transform matrix
* * @return The draw object if found. Otherwise NULL.
* @return LIB_DRAW_ITEM - Pointer the the draw object if found.
* Otherwise NULL.
*/ */
LIB_DRAW_ITEM* LocateDrawItem( int unit, int convert, KICAD_T type, LIB_DRAW_ITEM* LocateDrawItem( int unit, int convert, KICAD_T type,
const wxPoint& pt, const wxPoint& pt,
......
...@@ -84,7 +84,7 @@ void LIB_FIELD::Init( int id ) ...@@ -84,7 +84,7 @@ void LIB_FIELD::Init( int id )
} }
bool LIB_FIELD::Save( FILE* ExportFile ) const bool LIB_FIELD::Save( FILE* ExportFile )
{ {
int hjustify, vjustify; int hjustify, vjustify;
wxString text = m_Text; wxString text = m_Text;
...@@ -144,14 +144,13 @@ bool LIB_FIELD::Load( char* line, wxString& errorMsg ) ...@@ -144,14 +144,13 @@ bool LIB_FIELD::Load( char* line, wxString& errorMsg )
return false; return false;
} }
/* Recherche du debut des donnees (debut du texte suivant) */ /* Search the beginning of the data. */
while( *line != 0 ) while( *line != 0 )
line++; line++;
while( *line == 0 ) while( *line == 0 )
line++; line++;
/* recherche du texte */
while( *line && (*line != '"') ) while( *line && (*line != '"') )
line++; line++;
...@@ -161,7 +160,7 @@ bool LIB_FIELD::Load( char* line, wxString& errorMsg ) ...@@ -161,7 +160,7 @@ bool LIB_FIELD::Load( char* line, wxString& errorMsg )
text = line; text = line;
/* recherche fin de texte */ /* Find end of text. */
while( *line && (*line != '"') ) while( *line && (*line != '"') )
line++; line++;
......
...@@ -63,18 +63,18 @@ public: ...@@ -63,18 +63,18 @@ public:
int GetPenSize( ); int GetPenSize( );
/** /**
* Function Save * Writes field object out to a FILE in "*.lib" format.
* writes the data structures for this object out to a FILE in "*.brd" *
* format.
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return True if success writing else false.
*/ */
virtual bool Save( FILE* aFile ) const; virtual bool Save( FILE* aFile );
virtual bool Load( char* line, wxString& errorMsg ); virtual bool Load( char* line, wxString& errorMsg );
/** Function Copy /**
* copy parameters of this to Target. Pointers are not copied * Copy parameters of this field to another field. Pointers are not copied.
* @param aTarget = the LIB_FIELD to set with "this" values *
* @param aTarget = Target field to copy values to.
*/ */
void Copy( LIB_FIELD* aTarget ) const; void Copy( LIB_FIELD* aTarget ) const;
...@@ -87,26 +87,25 @@ public: ...@@ -87,26 +87,25 @@ public:
/** /**
* Return the bounding rectangle of the field text. * Return the bounding rectangle of the field text.
* *
* @return EDA_Rect - Bounding rectangle. * @return Bounding rectangle.
*/ */
virtual EDA_Rect GetBoundingBox(); virtual EDA_Rect GetBoundingBox();
/** /**
* Function HitTest * Test if the given point is within the bounds of this object.
* tests if the given wxPoint is within the bounds of this object. *
* @param refPos A wxPoint to test, in Field coordinate system * @param refPos A point to test in field coordinate system
* @return bool - true if a hit, else false * @return True if a hit, else false
*/ */
bool HitTest( const wxPoint& refPos ); bool HitTest( const wxPoint& refPos );
/** /**
* Function HitTest * @param aPosRef = a wxPoint to test
* @return true if the point aPosRef is near this object * @param aThreshold = max distance to this object (usually the half
* @param aPosRef = a wxPoint to test * thickness of a line)
* @param aThreshold = max distance to this object (usually the half * @param aTransMat = the transform matrix
* thickness of a line) * @return True if the point aPosRef is near this object
* @param aTransMat = the transform matrix */
*/
virtual bool HitTest( wxPoint aPosRef, int aThreshold, virtual bool HitTest( wxPoint aPosRef, int aThreshold,
const int aTransMat[2][2] ); const int aTransMat[2][2] );
...@@ -135,8 +134,7 @@ public: ...@@ -135,8 +134,7 @@ public:
* the string U?A will be returned for unit = 1. * the string U?A will be returned for unit = 1.
* *
* @param unit - The package unit number. Only effects reference field. * @param unit - The package unit number. Only effects reference field.
* * @return Field text.
* @return wxString - Field text.
*/ */
wxString GetFullText( int unit = 1 ); wxString GetFullText( int unit = 1 );
......
This diff is collapsed.
...@@ -178,8 +178,8 @@ void SCH_COMPONENT::Init( const wxPoint& pos ) ...@@ -178,8 +178,8 @@ void SCH_COMPONENT::Init( const wxPoint& pos )
/***************************************************************************** /*****************************************************************************
* Routine to draw the given part at given position, transformed/mirror as * * Routine to draw the given part at given position, transformed/mirror as *
* specified, and in the given drawing mode. Only this one is visible... * * specified, and in the given drawing mode. Only this one is visible... *
*****************************************************************************/ *****************************************************************************/
void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color, const wxPoint& offset, int DrawMode, int Color,
...@@ -261,7 +261,7 @@ void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -261,7 +261,7 @@ void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
/** /**
* Function AddHierarchicalReference * Function AddHierarchicalReference
* adds a full hierachical reference (path + local reference) * adds a full hierarchical reference (path + local reference)
* @param aPath = hierarchical path (/<sheet timestamp>/component timestamp> * @param aPath = hierarchical path (/<sheet timestamp>/component timestamp>
* like /05678E50/A23EF560) * like /05678E50/A23EF560)
* @param aRef = local reference like C45, R56 * @param aRef = local reference like C45, R56
...@@ -408,7 +408,7 @@ void SCH_COMPONENT::SetRef( DrawSheetPath* sheet, const wxString& ref ) ...@@ -408,7 +408,7 @@ void SCH_COMPONENT::SetRef( DrawSheetPath* sheet, const wxString& ref )
} }
rf->m_Text = ref; // for drawing. rf->m_Text = ref; // for drawing.
// Reinit the m_PrefixString member if needed // Reinit the m_PrefixString member if needed
wxString prefix = ref; wxString prefix = ref;
while( prefix.Last() == '?' or isdigit(prefix.Last()) ) while( prefix.Last() == '?' or isdigit(prefix.Last()) )
...@@ -525,6 +525,19 @@ void SCH_COMPONENT::AddField( const SCH_CMP_FIELD& aField ) ...@@ -525,6 +525,19 @@ void SCH_COMPONENT::AddField( const SCH_CMP_FIELD& aField )
} }
LIB_PIN* SCH_COMPONENT::GetPin( const wxString& number )
{
LIB_COMPONENT* Entry = CMP_LIBRARY::FindLibraryComponent( m_ChipName );
if( Entry == NULL )
return NULL;
wxASSERT( Entry->Type == ROOT );
return Entry->GetPin( number, m_Multi, m_Convert );
}
EDA_Rect SCH_COMPONENT::GetBoundaryBox() const EDA_Rect SCH_COMPONENT::GetBoundaryBox() const
{ {
LIB_COMPONENT* Entry = CMP_LIBRARY::FindLibraryComponent( m_ChipName ); LIB_COMPONENT* Entry = CMP_LIBRARY::FindLibraryComponent( m_ChipName );
...@@ -663,7 +676,7 @@ void SCH_COMPONENT::ClearAnnotation( DrawSheetPath* aSheet ) ...@@ -663,7 +676,7 @@ void SCH_COMPONENT::ClearAnnotation( DrawSheetPath* aSheet )
path = GetPath( aSheet ); path = GetPath( aSheet );
for( unsigned int ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ ) for( unsigned int ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ )
{ {
// Break hierachical reference in path, ref and multi selection: // Break hierarchical reference in path, ref and multi selection:
reference_fields = wxStringTokenize( m_PathsAndReferences[ii], reference_fields = wxStringTokenize( m_PathsAndReferences[ii],
separators ); separators );
if( aSheet == NULL || reference_fields[0].Cmp( path ) == 0 ) if( aSheet == NULL || reference_fields[0].Cmp( path ) == 0 )
...@@ -882,9 +895,9 @@ int SCH_COMPONENT::GetRotationMiroir() ...@@ -882,9 +895,9 @@ int SCH_COMPONENT::GetRotationMiroir()
/** /**
* Renvoie la coordonn�e du point coord, en fonction de l'orientation * Returns the coordinated point, depending on the orientation of the
* du composant (rotation, miroir). * component (rotation, mirror).
* Les coord sont toujours relatives a l'ancre (coord 0,0) du composant * The coordinates are always relative to the anchor position of the component.
*/ */
wxPoint SCH_COMPONENT::GetScreenCoord( const wxPoint& coord ) wxPoint SCH_COMPONENT::GetScreenCoord( const wxPoint& coord )
{ {
...@@ -986,7 +999,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const ...@@ -986,7 +999,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const
if( fprintf( f, "L %s %s\n", Name2, Name1 ) == EOF ) if( fprintf( f, "L %s %s\n", Name2, Name1 ) == EOF )
return false; return false;
/* Generation de numero d'unit, convert et Time Stamp*/ /* Generate unit number, convert and time stamp*/
if( fprintf( f, "U %d %d %8.8lX\n", m_Multi, m_Convert, if( fprintf( f, "U %d %d %8.8lX\n", m_Multi, m_Convert,
m_TimeStamp ) == EOF ) m_TimeStamp ) == EOF )
return false; return false;
...@@ -998,7 +1011,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const ...@@ -998,7 +1011,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const
/* If this is a complex hierarchy; save hierarchical references. /* If this is a complex hierarchy; save hierarchical references.
* but for simple hierarchies it is not necessary. * but for simple hierarchies it is not necessary.
* the reference inf is already saved * the reference inf is already saved
* this is usefull for old eeschema version compatibility * this is useful for old eeschema version compatibility
*/ */
if( m_PathsAndReferences.GetCount() > 1 ) if( m_PathsAndReferences.GetCount() > 1 )
{ {
......
...@@ -17,8 +17,7 @@ WX_DECLARE_OBJARRAY( DrawSheetPath, ArrayOfSheetLists ); ...@@ -17,8 +17,7 @@ WX_DECLARE_OBJARRAY( DrawSheetPath, ArrayOfSheetLists );
/** /**
* Struct Error * Holder of an error message and may be thrown from functions.
* is a holder of an error message and may be thrown from functions.
*/ */
struct Error struct Error
{ {
...@@ -87,7 +86,7 @@ public: ...@@ -87,7 +86,7 @@ public:
* first non-digits in the reference * first non-digits in the reference
* fields. */ * fields. */
int m_Convert; /* Handle mutiple shape (for instance int m_Convert; /* Handle multiple shape (for instance
* De Morgan conversion) */ * De Morgan conversion) */
int m_Transform[2][2]; /* The rotation/mirror transformation int m_Transform[2][2]; /* The rotation/mirror transformation
* matrix. */ * matrix. */
...@@ -101,7 +100,7 @@ private: ...@@ -101,7 +100,7 @@ private:
* format is * format is
* path reference multi * path reference multi
* with: * with:
* path = /<timestamp1>/<timestamp2> (subsheet path, = / for the root scheet) * path = /<timestamp1>/<timestamp2> (subsheet path, = / for the root sheet)
* reference = reference for this path (C23, R5, U78 ... ) * reference = reference for this path (C23, R5, U78 ... )
* multi = part selection in multi parts per package (0 or 1 for one part per package) * multi = part selection in multi parts per package (0 or 1 for one part per package)
*/ */
...@@ -118,7 +117,7 @@ public: ...@@ -118,7 +117,7 @@ public:
* *
* @param libComponent - Component library object to create schematic * @param libComponent - Component library object to create schematic
* component from. * component from.
* @param sheet - Schemitic sheet the component is place into. * @param sheet - Schematic sheet the component is place into.
* @param unit - Part for components that have multiple parts per * @param unit - Part for components that have multiple parts per
* package. * package.
* @param convert - Use the alternate body style for the schematic * @param convert - Use the alternate body style for the schematic
...@@ -249,6 +248,14 @@ public: ...@@ -249,6 +248,14 @@ public:
*/ */
int GetFieldCount() const { return (int) m_Fields.size(); } int GetFieldCount() const { return (int) m_Fields.size(); }
/**
* Find a component pin by number.
*
* @param number - The number of the pin to find.
* @return Pin object if found, otherwise NULL.
*/
LIB_PIN* GetPin( const wxString& number );
virtual void Draw( WinEDA_DrawPanel* panel, virtual void Draw( WinEDA_DrawPanel* panel,
wxDC* DC, wxDC* DC,
const wxPoint& offset, const wxPoint& offset,
...@@ -310,7 +317,7 @@ public: ...@@ -310,7 +317,7 @@ public:
// Geometric transforms (used in block operations): // Geometric transforms (used in block operations):
/** virtual function Move /** virtual function Move
* move item to a new position. * move item to a new position.
* @param aMoveVector = the deplacement vector * @param aMoveVector = the displacement vector
*/ */
virtual void Move(const wxPoint& aMoveVector) virtual void Move(const wxPoint& aMoveVector)
{ {
......
...@@ -63,7 +63,6 @@ void LIB_DRAW_ITEM::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -63,7 +63,6 @@ void LIB_DRAW_ITEM::DisplayInfo( WinEDA_DrawFrame* frame )
frame->ClearMsgPanel(); frame->ClearMsgPanel();
frame->AppendMsgPanel( _( "Type" ), m_typeName, CYAN ); frame->AppendMsgPanel( _( "Type" ), m_typeName, CYAN );
/* Affichage de l'appartenance */
if( m_Unit == 0 ) if( m_Unit == 0 )
msg = _( "All" ); msg = _( "All" );
else else
...@@ -147,7 +146,7 @@ LIB_ARC::LIB_ARC( const LIB_ARC& arc ) : LIB_DRAW_ITEM( arc ) ...@@ -147,7 +146,7 @@ LIB_ARC::LIB_ARC( const LIB_ARC& arc ) : LIB_DRAW_ITEM( arc )
* A centre_posx centre_posy rayon start_angle end_angle unit convert * A centre_posx centre_posy rayon start_angle end_angle unit convert
* fill('N', 'F' ou 'f') startx starty endx endy * fill('N', 'F' ou 'f') startx starty endx endy
*/ */
bool LIB_ARC::Save( FILE* ExportFile ) const bool LIB_ARC::Save( FILE* ExportFile )
{ {
int x1 = m_t1; int x1 = m_t1;
...@@ -559,7 +558,7 @@ LIB_CIRCLE::LIB_CIRCLE( const LIB_CIRCLE& circle ) : ...@@ -559,7 +558,7 @@ LIB_CIRCLE::LIB_CIRCLE( const LIB_CIRCLE& circle ) :
} }
bool LIB_CIRCLE::Save( FILE* ExportFile ) const bool LIB_CIRCLE::Save( FILE* ExportFile )
{ {
if( fprintf( ExportFile, "C %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y, if( fprintf( ExportFile, "C %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y,
m_Radius, m_Unit, m_Convert, m_Width, fill_tab[m_Fill] ) < 0 ) m_Radius, m_Unit, m_Convert, m_Width, fill_tab[m_Fill] ) < 0 )
...@@ -825,7 +824,7 @@ LIB_RECTANGLE::LIB_RECTANGLE( const LIB_RECTANGLE& rect ) : ...@@ -825,7 +824,7 @@ LIB_RECTANGLE::LIB_RECTANGLE( const LIB_RECTANGLE& rect ) :
} }
bool LIB_RECTANGLE::Save( FILE* ExportFile ) const bool LIB_RECTANGLE::Save( FILE* ExportFile )
{ {
if( fprintf( ExportFile, "S %d %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y, if( fprintf( ExportFile, "S %d %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y,
m_End.x, m_End.y, m_Unit, m_Convert, m_Width, m_End.x, m_End.y, m_Unit, m_Convert, m_Width,
...@@ -1110,7 +1109,7 @@ LIB_SEGMENT::LIB_SEGMENT( const LIB_SEGMENT& segment ) : ...@@ -1110,7 +1109,7 @@ LIB_SEGMENT::LIB_SEGMENT( const LIB_SEGMENT& segment ) :
} }
bool LIB_SEGMENT::Save( FILE* ExportFile ) const bool LIB_SEGMENT::Save( FILE* ExportFile )
{ {
if( fprintf( ExportFile, "L %d %d %d", m_Unit, m_Convert, m_Width ) ) if( fprintf( ExportFile, "L %d %d %d", m_Unit, m_Convert, m_Width ) )
return false; return false;
...@@ -1330,7 +1329,7 @@ LIB_POLYLINE::LIB_POLYLINE( const LIB_POLYLINE& polyline ) : ...@@ -1330,7 +1329,7 @@ LIB_POLYLINE::LIB_POLYLINE( const LIB_POLYLINE& polyline ) :
} }
bool LIB_POLYLINE::Save( FILE* ExportFile ) const bool LIB_POLYLINE::Save( FILE* ExportFile )
{ {
int ccount = GetCornerCount(); int ccount = GetCornerCount();
...@@ -1705,7 +1704,7 @@ LIB_BEZIER::LIB_BEZIER( const LIB_BEZIER& bezier ) : LIB_DRAW_ITEM( bezier ) ...@@ -1705,7 +1704,7 @@ LIB_BEZIER::LIB_BEZIER( const LIB_BEZIER& bezier ) : LIB_DRAW_ITEM( bezier )
} }
bool LIB_BEZIER::Save( FILE* ExportFile ) const bool LIB_BEZIER::Save( FILE* ExportFile )
{ {
int ccount = GetCornerCount(); int ccount = GetCornerCount();
......
This diff is collapsed.
...@@ -3,5 +3,6 @@ ...@@ -3,5 +3,6 @@
DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ) : DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ) :
DIALOG_LIB_NEW_COMPONENT_BASE( parent ) DIALOG_LIB_NEW_COMPONENT_BASE( parent )
{ {
SetDefaultItem( m_sdbSizerOK ); /* Required to make escape key work correctly in wxGTK. */
m_sdbSizerOK->SetFocus();
} }
...@@ -161,7 +161,7 @@ enum id_eeschema_frm ...@@ -161,7 +161,7 @@ enum id_eeschema_frm
ID_LIBEDIT_EXPORT_BODY_BUTT, ID_LIBEDIT_EXPORT_BODY_BUTT,
/* Library editor context menu IDs */ /* Library editor context menu IDs */
ID_POPUP_LIBEDIT_PIN_EDIT, ID_LIBEDIT_EDIT_PIN,
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM, ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM, ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM,
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM, ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM,
......
...@@ -114,7 +114,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem( ...@@ -114,7 +114,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem(
case 1: // find a pin case 1: // find a pin
pos = pSch->m_Pos; // temporary: will be changed if the pin is found pos = pSch->m_Pos; // temporary: will be changed if the pin is found
pin = LocatePinByNumber( text_to_find, pSch ); pin = pSch->GetPin( text_to_find );
if( pin == NULL ) if( pin == NULL )
break; break;
NotFound = FALSE; NotFound = FALSE;
...@@ -167,10 +167,10 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem( ...@@ -167,10 +167,10 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem(
&( GetScreen()->m_StartVisu.x ), &( GetScreen()->m_StartVisu.x ),
&( GetScreen()->m_StartVisu.y ) ); &( GetScreen()->m_StartVisu.y ) );
// calcul des coord curseur avec origine = screen // Calculating cursor position with original screen.
curpos -= GetScreen()->m_StartVisu; curpos -= GetScreen()->m_StartVisu;
/* Il y a peut-etre necessite de recadrer le dessin: */ /* There may be need to reframe the drawing */
#define MARGIN 30 #define MARGIN 30
if( (curpos.x <= MARGIN) || (curpos.x >= DrawAreaSize.x - MARGIN) if( (curpos.x <= MARGIN) || (curpos.x >= DrawAreaSize.x - MARGIN)
|| (curpos.y <= MARGIN) || (curpos.y >= DrawAreaSize.y - MARGIN) ) || (curpos.y <= MARGIN) || (curpos.y >= DrawAreaSize.y - MARGIN) )
...@@ -342,7 +342,6 @@ SCH_ITEM* WinEDA_SchematicFrame::FindMarker( int SearchType ) ...@@ -342,7 +342,6 @@ SCH_ITEM* WinEDA_SchematicFrame::FindMarker( int SearchType )
sheet->LastScreen()->m_Curseur = pos; sheet->LastScreen()->m_Curseur = pos;
curpos = DrawPanel->CursorScreenPosition(); curpos = DrawPanel->CursorScreenPosition();
// calcul des coord curseur avec origine = screen
DrawPanel->GetViewStart( &m_CurrentSheet->LastScreen()->m_StartVisu.x, DrawPanel->GetViewStart( &m_CurrentSheet->LastScreen()->m_StartVisu.x,
&m_CurrentSheet->LastScreen()->m_StartVisu.y ); &m_CurrentSheet->LastScreen()->m_StartVisu.y );
curpos.x -= m_CurrentSheet->LastScreen()->m_StartVisu.x; curpos.x -= m_CurrentSheet->LastScreen()->m_StartVisu.x;
...@@ -511,7 +510,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindSchematicItem( ...@@ -511,7 +510,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindSchematicItem(
StartCount++; StartCount++;
if( s_ItemsCount >= StartCount ) if( s_ItemsCount >= StartCount )
{ {
NotFound = TRUE; /* Continue recherche de l'element suivant */ NotFound = TRUE; /* Continue search of the next element */
} }
else else
{ {
...@@ -573,10 +572,9 @@ SCH_ITEM* WinEDA_SchematicFrame::FindSchematicItem( ...@@ -573,10 +572,9 @@ SCH_ITEM* WinEDA_SchematicFrame::FindSchematicItem(
&( GetScreen()->m_StartVisu.x ), &( GetScreen()->m_StartVisu.x ),
&( GetScreen()->m_StartVisu.y ) ); &( GetScreen()->m_StartVisu.y ) );
// calcul des coord curseur avec origine = screen
curpos -= m_CurrentSheet->LastScreen()->m_StartVisu; curpos -= m_CurrentSheet->LastScreen()->m_StartVisu;
/* Il y a peut-etre necessite de recadrer le dessin: */ /* There may be need to reframe the drawing */
#define MARGIN 30 #define MARGIN 30
if( (curpos.x <= MARGIN) || (curpos.x >= DrawAreaSize.x - MARGIN) if( (curpos.x <= MARGIN) || (curpos.x >= DrawAreaSize.x - MARGIN)
|| (curpos.y <= MARGIN) || (curpos.y >= DrawAreaSize.y - MARGIN) ) || (curpos.y <= MARGIN) || (curpos.y >= DrawAreaSize.y - MARGIN) )
......
...@@ -633,7 +633,10 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -633,7 +633,10 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
m_drawItem = LocateItemUsingCursor(); m_drawItem = LocateItemUsingCursor();
if( m_drawItem && m_drawItem->Type() == COMPONENT_PIN_DRAW_TYPE ) if( m_drawItem && m_drawItem->Type() == COMPONENT_PIN_DRAW_TYPE )
InstallPineditFrame( this, DC, MousePos ); {
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
GetEventHandler()->ProcessEvent( cmd );
}
break; break;
......
...@@ -194,10 +194,12 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -194,10 +194,12 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
switch( DrawEntry->Type() ) switch( DrawEntry->Type() )
{ {
case COMPONENT_PIN_DRAW_TYPE: case COMPONENT_PIN_DRAW_TYPE:
if( DrawEntry->m_Flags == 0 ) if( DrawEntry->m_Flags == 0 )
{ {
InstallPineditFrame( this, DC, pos ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
GetEventHandler()->ProcessEvent( cmd );
} }
break; break;
......
...@@ -233,7 +233,7 @@ void AddMenusForPin( wxMenu* PopMenu, ...@@ -233,7 +233,7 @@ void AddMenusForPin( wxMenu* PopMenu,
wxString msg; wxString msg;
msg = AddHotkeyName( _( "Edit Pin " ), s_Libedit_Hokeys_Descr, HK_EDIT_PIN ); msg = AddHotkeyName( _( "Edit Pin " ), s_Libedit_Hokeys_Descr, HK_EDIT_PIN );
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_PIN_EDIT, msg, edit_xpm ); ADD_MENUITEM( PopMenu, ID_LIBEDIT_EDIT_PIN, msg, edit_xpm );
if( not_in_move ) if( not_in_move )
{ {
......
...@@ -47,6 +47,7 @@ public: ...@@ -47,6 +47,7 @@ public:
void OnViewEntryDoc( wxCommandEvent& event ); void OnViewEntryDoc( wxCommandEvent& event );
void OnCheckComponent( wxCommandEvent& event ); void OnCheckComponent( wxCommandEvent& event );
void OnSelectBodyStyle( wxCommandEvent& event ); void OnSelectBodyStyle( wxCommandEvent& event );
void OnEditPin( wxCommandEvent& event );
void OnUpdateEditingPart( wxUpdateUIEvent& event ); void OnUpdateEditingPart( wxUpdateUIEvent& event );
void OnUpdateNotEditingPart( wxUpdateUIEvent& event ); void OnUpdateNotEditingPart( wxUpdateUIEvent& event );
...@@ -69,7 +70,7 @@ public: ...@@ -69,7 +70,7 @@ public:
void ReCreateVToolbar(); void ReCreateVToolbar();
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
int BestZoom(); // Retourne le meilleur zoom int BestZoom(); // Returns the best zoom
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); } SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
...@@ -146,17 +147,17 @@ private: ...@@ -146,17 +147,17 @@ private:
void GetComponentFromUndoList( wxCommandEvent& event ); void GetComponentFromUndoList( wxCommandEvent& event );
void GetComponentFromRedoList( wxCommandEvent& event ); void GetComponentFromRedoList( wxCommandEvent& event );
// Edition des Pins: // Editing pins
void CreatePin( wxDC* DC ); void CreatePin( wxDC* DC );
void DeletePin( wxDC* DC, void DeletePin( wxDC* DC,
LIB_COMPONENT* LibEntry, LIB_COMPONENT* LibEntry,
LIB_PIN* Pin ); LIB_PIN* Pin );
void StartMovePin( wxDC* DC ); void StartMovePin( wxDC* DC );
// Edition de l'ancre // Editing anchor
void PlaceAncre(); void PlaceAncre();
// Edition des graphismes: // Editing graphic items
LIB_DRAW_ITEM* CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC ); LIB_DRAW_ITEM* CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC );
void GraphicItemBeginDraw( wxDC* DC ); void GraphicItemBeginDraw( wxDC* DC );
void StartMoveDrawSymbol( wxDC* DC ); void StartMoveDrawSymbol( wxDC* DC );
...@@ -181,10 +182,9 @@ public: ...@@ -181,10 +182,9 @@ public:
int HandleBlockEnd( wxDC* DC ); int HandleBlockEnd( wxDC* DC );
void PlacePin( wxDC* DC ); void PlacePin( wxDC* DC );
void InitEditOnePin();
void GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id ); void GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id );
// Repetition automatique de placement de pins // Automatic placement of pins
void RepeatPinItem( wxDC* DC, LIB_PIN* Pin ); void RepeatPinItem( wxDC* DC, LIB_PIN* Pin );
protected: protected:
......
...@@ -109,7 +109,9 @@ BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame ) ...@@ -109,7 +109,9 @@ BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame )
WinEDA_LibeditFrame::Process_Special_Functions ) WinEDA_LibeditFrame::Process_Special_Functions )
/* Context menu events and commands. */ /* Context menu events and commands. */
EVT_MENU_RANGE( ID_POPUP_LIBEDIT_PIN_EDIT, EVT_MENU( ID_LIBEDIT_EDIT_PIN, WinEDA_LibeditFrame::OnEditPin )
EVT_MENU_RANGE( ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT, ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT,
WinEDA_LibeditFrame::Process_Special_Functions ) WinEDA_LibeditFrame::Process_Special_Functions )
...@@ -155,8 +157,8 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father, ...@@ -155,8 +157,8 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
WinEDA_DrawFrame( father, LIBEDITOR_FRAME, title, pos, size, style ) WinEDA_DrawFrame( father, LIBEDITOR_FRAME, title, pos, size, style )
{ {
m_FrameName = wxT( "LibeditFrame" ); m_FrameName = wxT( "LibeditFrame" );
m_Draw_Axis = true; // true pour avoir les axes dessines m_Draw_Axis = true; // true to draw axis
m_Draw_Grid = true; // true pour avoir la axes dessinee m_Draw_Grid = true; // true to draw grid
m_ConfigPath = wxT( "LibraryEditor" ); m_ConfigPath = wxT( "LibraryEditor" );
SetShowDeMorgan( false ); SetShowDeMorgan( false );
m_drawSpecificConvert = true; m_drawSpecificConvert = true;
...@@ -579,10 +581,10 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -579,10 +581,10 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
wxGetMousePosition( &pos.x, &pos.y ); wxGetMousePosition( &pos.x, &pos.y );
pos.y += 20; pos.y += 20;
switch( id ) // Arret de la commande de d�placement en cours switch( id ) // Stop placement commands before handling new command.
{ {
case ID_POPUP_LIBEDIT_END_CREATE_ITEM: case ID_POPUP_LIBEDIT_END_CREATE_ITEM:
case ID_POPUP_LIBEDIT_PIN_EDIT: case ID_LIBEDIT_EDIT_PIN:
case ID_POPUP_LIBEDIT_BODY_EDIT_ITEM: case ID_POPUP_LIBEDIT_BODY_EDIT_ITEM:
case ID_POPUP_LIBEDIT_FIELD_ROTATE_ITEM: case ID_POPUP_LIBEDIT_FIELD_ROTATE_ITEM:
case ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM: case ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM:
...@@ -626,10 +628,6 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -626,10 +628,6 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
g_EditPinByPinIsOn = g_EditPinByPinIsOn ? false : true; g_EditPinByPinIsOn = g_EditPinByPinIsOn ? false : true;
break; break;
case ID_POPUP_LIBEDIT_PIN_EDIT:
InstallPineditFrame( this, &dc, pos );
break;
case ID_LIBEDIT_PIN_BUTT: case ID_LIBEDIT_PIN_BUTT:
if( m_component ) if( m_component )
{ {
...@@ -638,7 +636,9 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -638,7 +636,9 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
else else
{ {
SetToolID( id, wxCURSOR_ARROW, _( "Set pin options" ) ); SetToolID( id, wxCURSOR_ARROW, _( "Set pin options" ) );
InstallPineditFrame( this, &dc, pos ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
GetEventHandler()->ProcessEvent( cmd );
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
} }
break; break;
......
/******************************************************/ /******************************************************/
/* Routines de localisation d'un element d'un schema. */ /* Routines for locating an element of a schematic. */
/******************************************************/ /******************************************************/
#include "fctsys.h" #include "fctsys.h"
...@@ -480,8 +480,8 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, SCH_ITEM* DrawStruct ) ...@@ -480,8 +480,8 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, SCH_ITEM* DrawStruct )
case TYPE_SCH_GLOBALLABEL: case TYPE_SCH_GLOBALLABEL:
#undef STRUCT #undef STRUCT
#define STRUCT ( (SCH_LABEL*) DrawStruct ) #define STRUCT ( (SCH_LABEL*) DrawStruct )
dx = STRUCT->m_Size.x * ( STRUCT->GetLength() + 1); /* longueur totale */ dx = STRUCT->m_Size.x * ( STRUCT->GetLength() + 1); /* total length */
dy = STRUCT->m_Size.y / 2; /* Demi hauteur */ dy = STRUCT->m_Size.y / 2; /* half height */
xt1 = xt2 = STRUCT->m_Pos.x; xt1 = xt2 = STRUCT->m_Pos.x;
yt1 = yt2 = STRUCT->m_Pos.y; yt1 = yt2 = STRUCT->m_Pos.y;
...@@ -525,7 +525,7 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, SCH_ITEM* DrawStruct ) ...@@ -525,7 +525,7 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, SCH_ITEM* DrawStruct )
case DRAW_SHEET_STRUCT_TYPE: case DRAW_SHEET_STRUCT_TYPE:
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawSheetStruct*) DrawStruct ) #define STRUCT ( (DrawSheetStruct*) DrawStruct )
/* Recalcul des coordonnees de l'encadrement du composant */ /* Recalculate the coordinates of the worksheet component */
xt1 = STRUCT->m_Pos.x; xt1 = STRUCT->m_Pos.x;
yt1 = STRUCT->m_Pos.y; yt1 = STRUCT->m_Pos.y;
xt2 = STRUCT->m_Pos.x + STRUCT->m_Size.x; xt2 = STRUCT->m_Pos.x + STRUCT->m_Size.x;
...@@ -556,12 +556,12 @@ static bool IsBox1InBox2( int StartX1, int StartY1, int EndX1, int EndY1, ...@@ -556,12 +556,12 @@ static bool IsBox1InBox2( int StartX1, int StartY1, int EndX1, int EndY1,
int StartX2, int StartY2, int EndX2, int EndY2 ) int StartX2, int StartY2, int EndX2, int EndY2 )
/****************************************************************************/ /****************************************************************************/
/* Routine detectant que le rectangle 1 (Box1) et le rectangle 2 (Box2) se /* Routine detects that the rectangle 1 (Box1) and the rectangle 2 (Box2) is
* recouvrent. * Overlap.
* Retourne TRUE ou FALSE. * Returns TRUE or FALSE.
* *
* On Considere ici qu'il y a recouvrement si l'un au moins des coins * These assume that there is recovery if at least one corner
* d'un 'Box' est compris dans l'autre * A 'Box' is included in the other
*/ */
{ {
int cX, cY; int cX, cY;
...@@ -575,87 +575,52 @@ static bool IsBox1InBox2( int StartX1, int StartY1, int EndX1, int EndY1, ...@@ -575,87 +575,52 @@ static bool IsBox1InBox2( int StartX1, int StartY1, int EndX1, int EndY1,
if( StartY2 > EndY2 ) if( StartY2 > EndY2 )
EXCHG( StartY2, EndY2 ); EXCHG( StartY2, EndY2 );
/* Tst des 4 coins du rectangle 1 */ /* Test the 4 corners of the rectangle 1 */
cX = StartX1; cY = StartY1; /* 1er coin */ cX = StartX1;
cY = StartY1;
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) ) if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
return TRUE; return TRUE;
cX = EndX1; cY = StartY1; /* 2er coin */ cX = EndX1;
cY = StartY1;
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) ) if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
return TRUE; return TRUE;
cX = EndX1; cY = EndY1; /* 3eme coin */ cX = EndX1;
cY = EndY1;
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) ) if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
return TRUE; return TRUE;
cX = StartX1; cY = EndY1; /* 4eme coin */ cX = StartX1;
cY = EndY1;
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) ) if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
return TRUE; return TRUE;
/* Tst des 4 coins du rectangle 2 */ /* Test the 4 corners of the rectangle 2 */
cX = StartX2; cY = StartY2; /* 1er coin */ cX = StartX2;
cY = StartY2;
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) ) if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
return TRUE; return TRUE;
cX = EndX2; cY = StartY2; /* 2er coin */ cX = EndX2;
cY = StartY2;
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) ) if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
return TRUE; return TRUE;
cX = EndX2; cY = EndY2; /* 3er coin */ cX = EndX2;
cY = EndY2;
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) ) if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
return TRUE; return TRUE;
cX = StartX2; cY = EndY2; /* 4er coin */ cX = StartX2;
cY = EndY2;
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) ) if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
/**
* Find a PIN in a component by pin number.
*
* @param ePin_Number - pin number to locate.
* @param eComponent - schematic component object to search.
*
* @return a pointer to the located the pin, or NULL if not found
*/
LIB_PIN* LocatePinByNumber( const wxString& ePin_Number,
SCH_COMPONENT* eComponent )
{
LIB_COMPONENT* Entry;
LIB_PIN_LIST pinList;
int Unit, Convert;
Entry = CMP_LIBRARY::FindLibraryComponent( eComponent->m_ChipName );
if( Entry == NULL )
return NULL;
wxASSERT( Entry->Type == ROOT );
Unit = eComponent->m_Multi;
Convert = eComponent->m_Convert;
Entry->GetPins( pinList, Unit, Convert );
for( size_t i = 0; i < pinList.size(); i++ )
{
wxASSERT( pinList[i]->Type() == COMPONENT_PIN_DRAW_TYPE );
wxString pNumber;
pinList[i]->ReturnPinStringNum( pNumber );
if( ePin_Number == pNumber )
return pinList[i];
}
return NULL;
}
Hierarchical_PIN_Sheet_Struct* LocateSheetLabel( DrawSheetStruct* Sheet, Hierarchical_PIN_Sheet_Struct* LocateSheetLabel( DrawSheetStruct* Sheet,
const wxPoint& pos ) const wxPoint& pos )
{ {
......
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////////
// Name: pinedit-dialog.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 11/02/2006 13:30:59
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 11/02/2006 13:30:59
#ifndef _PINEDIT_DIALOG_H_
#define _PINEDIT_DIALOG_H_
/* #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) */
/* #pragma interface "pinedit-dialog.h" */
/* #endif */
/*!
* Includes
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "class_drawpanel.h"
#include "common.h"
#include "program.h"
#include "general.h"
#include "eeschema_id.h"
#include "libeditfrm.h"
#include "protos.h"
////@begin includes
#include "wx/spinbutt.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class wxSpinButton;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define ID_TEXTCTRL_PINNAME 10001
#define ID_TEXTCTRL_PINNUM 10002
#define ID_TEXTCTRL_PINSIZE 10003
#define ID_SPINBUTTON_INC_DEC_PINSIZE 10010
#define ID_CHECKBOX_COMMON_UNITS 10004
#define ID_CHECKBOX_COMMON_CONVERT 10005
#define ID_CHECKBOX_NOT_DRAWN 10006
#define ID_TEXTCTRL_PINNAME_SIZE 10007
#define ID_TEXTCTRL_PINNUM_SIZE 10008
#define ID_RADIOBOX 10009
#define ID_RADIOBOX1 10012
#define ID_RADIOBOX2 10013
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE _("Pin properties")
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_PinPropertiesFrame class declaration
*/
class WinEDA_PinPropertiesFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_PinPropertiesFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_PinPropertiesFrame( );
WinEDA_PinPropertiesFrame( WinEDA_LibeditFrame* parent, wxWindowID id = SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_PinPropertiesFrame event handler declarations
/// wxEVT_SCROLL_LINEUP event handler for ID_SPINBUTTON_INC_DEC_PINSIZE
void OnSpinbuttonIncDecPinsizeUp( wxSpinEvent& event );
/// wxEVT_SCROLL_LINEDOWN event handler for ID_SPINBUTTON_INC_DEC_PINSIZE
void OnSpinbuttonIncDecPinsizeDown( wxSpinEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event );
////@end WinEDA_PinPropertiesFrame event handler declarations
////@begin WinEDA_PinPropertiesFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_PinPropertiesFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
void SetValuesInDialog(void);
void PinPropertiesAccept(wxCommandEvent& event);
void SetPinName(const wxString & newname, int newsize);
void SetPinNum(const wxString & newnum, int newsize);
void NewSizePin(int newsize);
void SetPinShape( int newshape);
void SetPinType(int newtype);
void SetPinOrientation(int neworient);
void SetPinAttributes(bool draw, bool unit, bool convert);
////@begin WinEDA_PinPropertiesFrame member variables
wxTextCtrl* m_PinNameCtrl;
wxTextCtrl* m_PinNumCtrl;
wxTextCtrl* m_PinSizeCtrl;
wxSpinButton* m_PinSizeIncDecButton;
wxStaticText* m_PinSizeText;
wxCheckBox* m_CommonUnit;
wxCheckBox* m_CommonConvert;
wxCheckBox* m_NoDraw;
wxStaticText* m_PinNameSizeText;
wxTextCtrl* m_PinNameSizeCtrl;
wxStaticText* m_PinNumSizeText;
wxTextCtrl* m_PinNumSizeCtrl;
wxRadioBox* m_PinOrient;
wxButton* m_btClose;
wxRadioBox* m_PinShape;
wxRadioBox* m_PinElectricalType;
////@end WinEDA_PinPropertiesFrame member variables
WinEDA_LibeditFrame * m_Parent;
};
#endif
// _PINEDIT_DIALOG_H_
This diff is collapsed.
This diff is collapsed.
//*****************************************/
/* prototypage des fonctions de EESchema */
/*****************************************/
#ifndef __PROTOS_H__ #ifndef __PROTOS_H__
#define __PROTOS_H__ #define __PROTOS_H__
...@@ -58,7 +55,6 @@ bool MapAngles( int* Angle1, ...@@ -58,7 +55,6 @@ bool MapAngles( int* Angle1,
* *
* @param aTransformMatrix = rotation, mirror .. matrix * @param aTransformMatrix = rotation, mirror .. matrix
* @param aPosition = the position to transform * @param aPosition = the position to transform
*
* @return the new coordinate * @return the new coordinate
*/ */
wxPoint TransformCoordinate( const int aTransformMatrix[2][2], wxPoint TransformCoordinate( const int aTransformMatrix[2][2],
...@@ -71,10 +67,6 @@ void SnapLibItemPoint( int OrigX, ...@@ -71,10 +67,6 @@ void SnapLibItemPoint( int OrigX,
SCH_COMPONENT* DrawLibItem ); SCH_COMPONENT* DrawLibItem );
bool LibItemInBox( int x1, int y1, int x2, int y2, bool LibItemInBox( int x1, int y1, int x2, int y2,
SCH_COMPONENT* DrawLibItem ); SCH_COMPONENT* DrawLibItem );
char* StrPurge( char* text );
/* Supprime les caracteres Space en debut de la ligne text
* retourne un pointeur sur le 1er caractere non Space de text */
/************/ /************/
/* BLOCK.CPP */ /* BLOCK.CPP */
...@@ -87,13 +79,10 @@ void DeleteStruct( WinEDA_DrawPanel* panel, ...@@ -87,13 +79,10 @@ void DeleteStruct( WinEDA_DrawPanel* panel,
/*************/ /*************/
/* LOCATE.CPP */ /* LOCATE.CPP */
/*************/ /*************/
LIB_PIN* LocatePinByNumber( const wxString& ePin_Number,
SCH_COMPONENT* eComponent );
SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen ); SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen );
/* Recherche du plus petit (en surface) composant pointe par la souris */ /* Find the item within block selection. */
int PickItemsInBlock( BLOCK_SELECTOR& aBlock, int PickItemsInBlock( BLOCK_SELECTOR& aBlock,
BASE_SCREEN* screen ); BASE_SCREEN* screen );
...@@ -123,14 +112,10 @@ int PickItemsInBlock( BLOCK_SELECTOR& aBlock, ...@@ -123,14 +112,10 @@ int PickItemsInBlock( BLOCK_SELECTOR& aBlock,
* *
* *
* Return: * Return:
* -Bloc search: * Pointer to list of pointers to structures if several items are selected.
* pointeur sur liste de pointeurs de structures si Plusieurs * Pointer to the structure if only 1 item is selected.
* structures selectionnees. * NULL if no items are selects.
* pointeur sur la structure si 1 seule */
*
* Positon search:
* pointeur sur la structure.
* Si pas de structures selectionnees: retourne NULL */
SCH_ITEM* PickStruct( const wxPoint& refpos, SCH_ITEM* PickStruct( const wxPoint& refpos,
BASE_SCREEN* screen, BASE_SCREEN* screen,
int SearchMask ); int SearchMask );
...@@ -237,13 +222,14 @@ void InstallPineditFrame( WinEDA_LibeditFrame* parent, ...@@ -237,13 +222,14 @@ void InstallPineditFrame( WinEDA_LibeditFrame* parent,
/** /**
* Function DisplayComponentsNamesInLib * Function DisplayComponentsNamesInLib
* Routine de selection d'un composant en librairie, par affichage de la * Select component from list of components in this library
* liste des composants de cette librairie *
* Si Library == NULL, selection de librairie demandee * If == NULL Library, selection of library REQUESTED
* sinon recherche uniquement dans library * If only in research library
* Retourne *
* 1 si composant selectionne * Returns
* 0 si commande annulee * 1 if selected component
* 0 if canceled order
*/ */
int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame, int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame,
CMP_LIBRARY* Library, CMP_LIBRARY* Library,
...@@ -259,15 +245,13 @@ int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame, ...@@ -259,15 +245,13 @@ int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame,
CMP_LIBRARY* SelectLibraryFromList( WinEDA_DrawFrame* frame ); CMP_LIBRARY* SelectLibraryFromList( WinEDA_DrawFrame* frame );
/** /**
* Function GetNameOfPartToLoad * Get the name component from a library to load.
* Routine de selection du nom d'un composant en librairie pour chargement, *
* dans la librairie Library. * If no library specified, there will be demand for selection of a library.
* Si Library == NULL, il y aura demande de selection d'une librairie * Returns
* Retourne * 1 if selected component
* 1 si composant selectionne * 0 if canceled order
* 0 si commande annulee * Place the name of the selected component list in BufName
* place le nom du composant a charger, selectionne a partir d'une liste dans
* BufName
*/ */
int GetNameOfPartToLoad( WinEDA_DrawFrame* frame, int GetNameOfPartToLoad( WinEDA_DrawFrame* frame,
CMP_LIBRARY* Lib, CMP_LIBRARY* Lib,
...@@ -292,9 +276,6 @@ void SchematicCleanUp( SCH_SCREEN* screen, wxDC* DC ); ...@@ -292,9 +276,6 @@ void SchematicCleanUp( SCH_SCREEN* screen, wxDC* DC );
void BreakSegmentOnJunction( SCH_SCREEN* Screen ); void BreakSegmentOnJunction( SCH_SCREEN* Screen );
/* Routine creant des debuts / fin de segment (BUS ou WIRES) sur les jonctions
* et les raccords */
/* Break a segment ( BUS, WIRE ) int 2 segments at location aBreakpoint, /* Break a segment ( BUS, WIRE ) int 2 segments at location aBreakpoint,
* if aBreakpoint in on segment segment * if aBreakpoint in on segment segment
* ( excluding ends) * ( excluding ends)
......
...@@ -65,11 +65,9 @@ enum pseudokeys { ...@@ -65,11 +65,9 @@ enum pseudokeys {
#define TEXT_ORIENT_HORIZ 0 #define TEXT_ORIENT_HORIZ 0
#define TEXT_ORIENT_VERT 900 #define TEXT_ORIENT_VERT 900
/* Affichage ou Effacement d'Item */ #define ON 1
#define ON 1 /* Affichage */ #define OFF 0
#define OFF 0 /* Effacement */
/* unites d'affichage sur ecran et autres */
#define INCHES 0 #define INCHES 0
#define MILLIMETRE 1 #define MILLIMETRE 1
#define CENTIMETRE 2 #define CENTIMETRE 2
...@@ -86,7 +84,7 @@ class LibNameList; ...@@ -86,7 +84,7 @@ class LibNameList;
/***********************************/ /***********************************/
/* Classe pour affichage de textes */ /* Class to display text */
/***********************************/ /***********************************/
class WinEDA_TextFrame : public wxDialog class WinEDA_TextFrame : public wxDialog
{ {
...@@ -169,9 +167,9 @@ extern const wxString PdfFileWildcard; ...@@ -169,9 +167,9 @@ extern const wxString PdfFileWildcard;
extern const wxString AllFilesWildcard; extern const wxString AllFilesWildcard;
// Nom (full file name) du file Configuration par defaut (kicad.pro) // Name of default configuration file. (kicad.pro)
extern wxString g_Prj_Default_Config_FullFilename; extern wxString g_Prj_Default_Config_FullFilename;
// Nom du file Configuration local (<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
...@@ -273,15 +271,15 @@ wxString GetAboutBuildVersion(); /* Return custom build date for about dialog ...@@ -273,15 +271,15 @@ wxString GetAboutBuildVersion(); /* Return custom build date for about dialog
/** /**
* function Affiche_1_Parametre * function Affiche_1_Parametre
* Routine d'affichage d'un parametre. * Routine to display a parameter.
* pos_X = cadrage horizontal * = POS_X horizontal framing
* si pos_X < 0 : la position horizontale est la derniere * If POS_X <0: horizontal position is the last
* valeur demandee >= 0 * Required value> = 0
* texte_H = texte a afficher en ligne superieure. * Texte_H = text to be displayed in top line.
* si "", par d'affichage sur cette ligne * If "by posting on this line
* texte_L = texte a afficher en ligne inferieure. * Texte_L = text to be displayed in bottom line.
* si "", par d'affichage sur cette ligne * If "by posting on this line
* color = couleur d'affichage * Color = color display
*/ */
void Affiche_1_Parametre( WinEDA_DrawFrame* frame, void Affiche_1_Parametre( WinEDA_DrawFrame* frame,
int pos_X, int pos_X,
...@@ -289,25 +287,34 @@ void Affiche_1_Parametre( WinEDA_DrawFrame* frame, ...@@ -289,25 +287,34 @@ void Affiche_1_Parametre( WinEDA_DrawFrame* frame,
const wxString& texte_L, const wxString& texte_L,
int color ); int color );
/* Routine d'affichage de la documentation associee a un composant */
int GetTimeStamp(); int GetTimeStamp();
/* Retoure une identification temporelle (Time stamp) differente a chaque appel */
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 );
/* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies /* Returns to display the value of a parameter, by type of units selected
* entree : valeur en mils , buffer de texte * Input: value in mils, buffer text
* retourne en buffer : texte : valeur exprimee en pouces ou millimetres * Returns to buffer: text: value expressed in inches or millimeters
* suivie de " ou mm * Followed by " or mm
*/ */
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.
*
* The strings returned are full text name and not abbreviations or symbolic
* representations of units. Set ReturnUnitSymbol() for that.
*
* @param units - The units text to return.
* @return The human readable units string.
*/
wxString GetUnitsLabel( int units );
int ReturnValueFromString( int Units, const wxString& TextValue, int ReturnValueFromString( int Units, const wxString& TextValue,
int Internal_Unit ); int Internal_Unit );
......
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