kicad/pcbnew/class_marker.cpp

87 lines
2.2 KiB
C++
Raw Normal View History

/*****************************************************************************/
/* Functions to handle markers used to show somthing (usually a drc problem) */
/*****************************************************************************/
/* file class_marker.cpp */
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "pcbnew.h"
#include "class_marker.h"
/*******************/
2007-11-27 22:49:35 +00:00
/* Classe MARKER */
/*******************/
MARKER::MARKER( BOARD_ITEM* aParent ) :
BOARD_ITEM( aParent, TYPE_MARKER ),
MARKER_BASE( )
2007-12-01 03:42:52 +00:00
{
}
2008-02-23 04:53:44 +00:00
MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos,
2007-12-01 03:42:52 +00:00
const wxString& bText, const wxPoint& bPos ) :
BOARD_ITEM( NULL, TYPE_MARKER ), // parent set during BOARD::Add()
MARKER_BASE( aErrorCode, aMarkerPos, aText, aPos, bText, bPos )
2007-12-01 03:42:52 +00:00
{
2007-12-01 03:42:52 +00:00
}
2008-02-23 04:53:44 +00:00
MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos ) :
BOARD_ITEM( NULL, TYPE_MARKER ), // parent set during BOARD::Add()
MARKER_BASE( aErrorCode, aMarkerPos, aText, aPos )
{
}
/* Effacement memoire de la structure */
2007-11-27 22:49:35 +00:00
MARKER::~MARKER()
{
}
/* supprime du chainage la structure Struct
* les structures arrieres et avant sont chainees directement
*/
2007-11-27 22:49:35 +00:00
void MARKER::UnLink()
{
2007-11-27 22:49:35 +00:00
wxFAIL_MSG( wxT("MARKER::UnLink is deprecated") );
}
void MARKER::DisplayInfo( WinEDA_DrawFrame* frame )
{
int text_pos;
frame->MsgPanel->EraseMsgBox();
2007-12-01 05:37:44 +00:00
const DRC_ITEM& rpt = m_drc;
2008-02-23 04:53:44 +00:00
text_pos = 1;
Affiche_1_Parametre( frame, text_pos, _( "Type" ), _("Marker"), DARKCYAN );
2007-12-01 05:37:44 +00:00
wxString errorTxt;
2008-02-23 04:53:44 +00:00
errorTxt << _("ErrType") << wxT("(") << rpt.GetErrorCode() << wxT(")- ") << rpt.GetErrorText() << wxT(":");
2008-02-23 04:53:44 +00:00
2007-12-01 05:37:44 +00:00
text_pos = 5;
Affiche_1_Parametre( frame, text_pos, errorTxt, wxEmptyString, RED );
wxString txtA;
txtA << DRC_ITEM::ShowCoord( rpt.GetPointA() ) << wxT(": ") << rpt.GetTextA();
2008-02-23 04:53:44 +00:00
2007-12-01 05:37:44 +00:00
wxString txtB;
2008-02-23 04:53:44 +00:00
if ( rpt.HasSecondItem() )
txtB << DRC_ITEM::ShowCoord( rpt.GetPointB() ) << wxT(": ") << rpt.GetTextB();
text_pos = 25;
Affiche_1_Parametre( frame, text_pos, txtA, txtB, DARKBROWN );
}