Commit 6bedc7e0 authored by charras's avatar charras

More about ERC and markers in eeschema ( work in progress )

parent c61cce48
......@@ -78,7 +78,7 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
*/
{
DeleteAllMarkers( MARK_ERC );
m_MessagesList->ClearList();
m_MarkersList->ClearList();
m_Parent->DrawPanel->Refresh();
}
......@@ -101,23 +101,25 @@ void DIALOG_ERC::OnResetMatrixClick( wxCommandEvent& event )
void DIALOG_ERC::OnErcCmpClick( wxCommandEvent& event )
{
wxBusyCursor();
m_MarkersList->Clear();
m_MessagesList->Clear();
wxSafeYield(); // m_MessagesList must be redraw
wxSafeYield(); // m_MarkersList must be redraw
wxArrayString messageList;
TestErc( &messageList );
#warning m_MessagesList->Append(messageList);
for ( unsigned ii = 0; ii < messageList.GetCount(); ii++ )
m_MessagesList->AppendText(messageList[ii]);
}
// Double click on a marker info:
void DIALOG_ERC::OnLeftDClickMarkersList( wxCommandEvent& event )
{
int index = m_MessagesList->GetSelection();
int index = m_MarkersList->GetSelection();
if( index < 0 )
return;
const MARKER_SCH* marker = m_MessagesList->GetItem( (unsigned) index );
const MARKER_SCH* marker = m_MarkersList->GetItem( (unsigned) index );
EndModal( 1 );
......@@ -294,7 +296,7 @@ void DIALOG_ERC::DisplayERC_MarkersList()
{
EDA_SheetList SheetList;
m_MessagesList->ClearList();
m_MarkersList->ClearList();
for( DrawSheetPath* Sheet = SheetList.GetFirst(); Sheet != NULL; Sheet = SheetList.GetNext() )
{
......@@ -314,8 +316,8 @@ void DIALOG_ERC::DisplayERC_MarkersList()
// wxString msg;
// msg.Printf( _( "<b>sheet %s</b><ul>\n" ), Sheet->PathHumanReadable().GetData() );
// msg += Marker->GetReporter().ShowHtml();
// m_MessagesList->Append( msg );
m_MessagesList->AppendToList( Marker );
// m_MarkersList->Append( msg );
m_MarkersList->AppendToList( Marker );
}
}
}
......
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_erc.h
// Author: jean-pierre Charras
// Licence: GPL
......
......@@ -68,8 +68,19 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
bupperSizer->Add( sdiagSizer, 0, 0, 5 );
wxBoxSizer* bSizeMessages;
bSizeMessages = new wxBoxSizer( wxVERTICAL );
bupperSizer->Add( 10, 10, 1, wxEXPAND, 5 );
m_titleMessages = new wxStaticText( m_PanelERC, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
m_titleMessages->Wrap( -1 );
bSizeMessages->Add( m_titleMessages, 0, wxRIGHT|wxLEFT, 5 );
m_MessagesList = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_MessagesList->SetMinSize( wxSize( 300,-1 ) );
bSizeMessages->Add( m_MessagesList, 1, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
bupperSizer->Add( bSizeMessages, 1, wxEXPAND, 5 );
wxBoxSizer* bbuttonsSizer;
bbuttonsSizer = new wxBoxSizer( wxVERTICAL );
......@@ -94,14 +105,14 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
m_staticline2 = new wxStaticLine( m_PanelERC, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bercSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
m_textMessage = new wxStaticText( m_PanelERC, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textMessage->Wrap( -1 );
bercSizer->Add( m_textMessage, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_textMarkers = new wxStaticText( m_PanelERC, wxID_ANY, _("Markers:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textMarkers->Wrap( -1 );
bercSizer->Add( m_textMarkers, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_MessagesList = new ERC_HTML_LISTBOX( m_PanelERC, ID_MAKER_HTMLLISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_MessagesList->SetMinSize( wxSize( 500,350 ) );
m_MarkersList = new ERC_HTML_LISTBOX( m_PanelERC, ID_MAKER_HTMLLISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, 0|wxSIMPLE_BORDER );
m_MarkersList->SetMinSize( wxSize( 500,350 ) );
bercSizer->Add( m_MessagesList, 1, wxALL|wxEXPAND, 5 );
bercSizer->Add( m_MarkersList, 1, wxALL|wxEXPAND, 5 );
m_PanelERC->SetSizer( bercSizer );
m_PanelERC->Layout();
......
This diff is collapsed.
......@@ -20,6 +20,7 @@ class ERC_HTML_LISTBOX;
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/statline.h>
......@@ -66,14 +67,15 @@ class DIALOG_ERC_BASE : public wxDialog
wxStaticText* m_LastWarningCount;
wxStaticText* m_LastErrCountText;
wxStaticText* m_LastErrCount;
wxStaticText* m_titleMessages;
wxTextCtrl* m_MessagesList;
wxButton* m_buttonERC;
wxButton* m_buttondelmarkers;
wxButton* m_buttonClose;
wxCheckBox* m_WriteResultOpt;
wxStaticLine* m_staticline2;
wxStaticText* m_textMessage;
ERC_HTML_LISTBOX* m_MessagesList;
wxStaticText* m_textMarkers;
ERC_HTML_LISTBOX* m_MarkersList;
wxPanel* m_PanelERCOptions;
wxBoxSizer* m_PanelMatrixSizer;
wxButton* m_ResetOptButton;
......
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