Commit d2fe629b authored by dickelbeck's avatar dickelbeck

drc dialog fixes

parent f406e9d9
...@@ -66,7 +66,8 @@ ...@@ -66,7 +66,8 @@
* information held is the board coordinate and the MenuText for each item. * information held is the board coordinate and the MenuText for each item.
* Also held is the type of error by number and the location of the MARKER. * Also held is the type of error by number and the location of the MARKER.
* A function is provided to translate that number into text. * A function is provided to translate that number into text.
* Some errors involve only one item (item with an incorrect param) so m_AsSecondItem is set to false in this case * Some errors involve only one item (item with an incorrect param) so
* m_hasSecondItem is set to false in this case.
*/ */
class DRC_ITEM class DRC_ITEM
{ {
...@@ -77,7 +78,7 @@ protected: ...@@ -77,7 +78,7 @@ protected:
wxString m_BText; ///< text for the second BOARD_ITEM wxString m_BText; ///< text for the second BOARD_ITEM
wxPoint m_APos; ///< the location of the first (or main ) BOARD_ITEM wxPoint m_APos; ///< the location of the first (or main ) BOARD_ITEM
wxPoint m_BPos; ///< the location of the second BOARD_ITEM wxPoint m_BPos; ///< the location of the second BOARD_ITEM
bool m_AsSecondItem; ///< true when 2 items create a DRC error, false if only one item bool m_hasSecondItem; ///< true when 2 items create a DRC error, false if only one item
public: public:
...@@ -110,7 +111,7 @@ public: ...@@ -110,7 +111,7 @@ public:
SetData( aErrorCode, aIssuePos, SetData( aErrorCode, aIssuePos,
aText, aText, aText, aText,
aPos, aPos ); aPos, aPos );
m_AsSecondItem = false; m_hasSecondItem = false;
} }
void SetData( int aErrorCode, const wxPoint& aIssuePos, void SetData( int aErrorCode, const wxPoint& aIssuePos,
...@@ -123,10 +124,12 @@ public: ...@@ -123,10 +124,12 @@ public:
m_BText = bText; m_BText = bText;
m_APos = aPos; m_APos = aPos;
m_BPos = bPos; m_BPos = bPos;
m_AsSecondItem = true; m_hasSecondItem = true;
} }
bool AsSecondItem(void) const { return m_AsSecondItem; } bool HasSecondItem() const { return m_hasSecondItem; }
/** /**
* Function ShowHtml * Function ShowHtml
* translates this object into a fragment of HTML suitable for the * translates this object into a fragment of HTML suitable for the
...@@ -137,6 +140,8 @@ public: ...@@ -137,6 +140,8 @@ public:
{ {
wxString ret; wxString ret;
if( m_hasSecondItem )
{
// an html fragment for the entire message in the listbox. feel free // an html fragment for the entire message in the listbox. feel free
// to add color if you want: // to add color if you want:
ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li><li> %s: %s </li></ul>" ), ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li><li> %s: %s </li></ul>" ),
...@@ -144,6 +149,14 @@ public: ...@@ -144,6 +149,14 @@ public:
GetErrorText().GetData(), GetErrorText().GetData(),
ShowCoord( m_APos ).GetData(), m_AText.GetData(), ShowCoord( m_APos ).GetData(), m_AText.GetData(),
ShowCoord( m_BPos ).GetData(), m_BText.GetData() ); ShowCoord( m_BPos ).GetData(), m_BText.GetData() );
}
else
{
ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li></ul>" ),
m_ErrorCode,
GetErrorText().GetData(),
ShowCoord( m_APos ).GetData(), m_AText.GetData() );
}
return ret; return ret;
} }
...@@ -159,11 +172,21 @@ public: ...@@ -159,11 +172,21 @@ public:
{ {
wxString ret; wxString ret;
if( m_hasSecondItem )
{
ret.Printf( wxT( "ErrType(%d): %s\n %s: %s\n %s: %s\n" ), ret.Printf( wxT( "ErrType(%d): %s\n %s: %s\n %s: %s\n" ),
m_ErrorCode, m_ErrorCode,
GetErrorText().GetData(), GetErrorText().GetData(),
ShowCoord( m_APos ).GetData(), m_AText.GetData(), ShowCoord( m_APos ).GetData(), m_AText.GetData(),
ShowCoord( m_BPos ).GetData(), m_BText.GetData() ); ShowCoord( m_BPos ).GetData(), m_BText.GetData() );
}
else
{
ret.Printf( wxT( "ErrType(%d): %s\n %s: %s\n" ),
m_ErrorCode,
GetErrorText().GetData(),
ShowCoord( m_APos ).GetData(), m_AText.GetData() );
}
return ret; return ret;
} }
......
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