KiCad PCB EDA Suite
ERC_HTML_LISTFRAME Class Reference

Class ERC_HTML_LISTFRAME is used to display a DRC_ITEM_LIST. More...

#include <dialog_erc_listbox.h>

Inheritance diagram for ERC_HTML_LISTFRAME:

Public Member Functions

 ERC_HTML_LISTFRAME (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
 
 ~ERC_HTML_LISTFRAME ()
 
void AppendToList (SCH_MARKER *aMarker)
 Function AppendToList. More...
 
void DisplayList ()
 Function DisplayList(); Build the Html marker list and show it. More...
 
const SCH_MARKERGetItem (unsigned aIndex)
 Function GetItem returns a requested DRC_ITEM* or NULL. More...
 
void ClearList ()
 Function ClearList deletes all items shown in the list. More...
 

Private Attributes

std::vector< SCH_MARKER * > m_MarkerListReferences
 

Detailed Description

Class ERC_HTML_LISTFRAME is used to display a DRC_ITEM_LIST.

Definition at line 38 of file dialog_erc_listbox.h.

Constructor & Destructor Documentation

ERC_HTML_LISTFRAME::ERC_HTML_LISTFRAME ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = 0 
)
inline

Definition at line 44 of file dialog_erc_listbox.h.

47  :
48  wxHtmlWindow( parent, id, pos, size, style | wxHW_NO_SELECTION )
49  {
50  }
ERC_HTML_LISTFRAME::~ERC_HTML_LISTFRAME ( )
inline

Definition at line 52 of file dialog_erc_listbox.h.

53  {
54  }

Member Function Documentation

void ERC_HTML_LISTFRAME::AppendToList ( SCH_MARKER aMarker)
inline

Function AppendToList.

Parameters
aMarkeris the SCH_MARKER* to add to the current list which will be later displayed in the wxHtmlWindow

Definition at line 62 of file dialog_erc_listbox.h.

Referenced by DIALOG_ERC::DisplayERC_MarkersList().

63  {
64  m_MarkerListReferences.push_back( aMarker );
65  }
std::vector< SCH_MARKER * > m_MarkerListReferences
void ERC_HTML_LISTFRAME::ClearList ( )
inline

Function ClearList deletes all items shown in the list.

Does not erase markers in schematic

Definition at line 118 of file dialog_erc_listbox.h.

Referenced by DIALOG_ERC::DisplayERC_MarkersList(), DIALOG_ERC::OnEraseDrcMarkersClick(), and DIALOG_ERC::OnErcCmpClick().

119  {
120  m_MarkerListReferences.clear();
121  SetPage( wxEmptyString );
122  }
std::vector< SCH_MARKER * > m_MarkerListReferences
void ERC_HTML_LISTFRAME::DisplayList ( )
inline

Function DisplayList(); Build the Html marker list and show it.

Definition at line 71 of file dialog_erc_listbox.h.

References Format().

Referenced by DIALOG_ERC::DisplayERC_MarkersList().

72  {
73  wxString htmlpage;
74  wxColour bgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
75  wxColour lncolor = wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT );
76  wxColour fgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
77  // for each marker, build a link like:
78  // <A HREF="marker_index">text to click</A>
79  // The "text to click" is the error name (first line of the full error text).
80  wxString marker_text;
81 
82  for( unsigned ii = 0; ii < m_MarkerListReferences.size(); ii++ )
83  {
84  marker_text.Printf( wxT( "<font color='%s'><a href='%d'>%s</font>" ),
85  lncolor.GetAsString( wxC2S_HTML_SYNTAX ),
86  ii,
87  m_MarkerListReferences[ii]->GetReporter().ShowHtml() );
88  marker_text.Replace( wxT( "<ul>" ), wxT( "</a><ul>" ), false );
89  htmlpage += marker_text;
90  }
91 
92  SetPage( wxString::Format( wxT( "<html><body bgcolor='%s' text='%s'>%s</body></html>" ),
93  bgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
94  fgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
95  htmlpage ) );
96  }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
std::vector< SCH_MARKER * > m_MarkerListReferences
const SCH_MARKER* ERC_HTML_LISTFRAME::GetItem ( unsigned  aIndex)
inline

Function GetItem returns a requested DRC_ITEM* or NULL.

Definition at line 102 of file dialog_erc_listbox.h.

Referenced by DIALOG_ERC::OnLeftClickMarkersList().

103  {
104  if( m_MarkerListReferences.size() > aIndex )
105  {
106  return m_MarkerListReferences[ aIndex ];
107  }
108 
109  return NULL;
110  }
std::vector< SCH_MARKER * > m_MarkerListReferences

Member Data Documentation

std::vector<SCH_MARKER*> ERC_HTML_LISTFRAME::m_MarkerListReferences
private

Definition at line 41 of file dialog_erc_listbox.h.


The documentation for this class was generated from the following file: