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();
......
......@@ -523,10 +523,117 @@
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">10</property>
<property name="permission">protected</property>
<property name="width">10</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizeMessages</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Messages:</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_titleMessages</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="minimum_size">300,-1</property>
<property name="name">m_MessagesList</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxTE_MULTILINE|wxTE_READONLY</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
......@@ -811,10 +918,10 @@
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Messages:</property>
<property name="label">Markers:</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_textMessage</property>
<property name="name">m_textMarkers</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
......@@ -865,7 +972,7 @@
<property name="id">ID_MAKER_HTMLLISTBOX</property>
<property name="maximum_size"></property>
<property name="minimum_size">500,350</property>
<property name="name">m_MessagesList</property>
<property name="name">m_MarkersList</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
......@@ -874,7 +981,7 @@
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="window_style">wxSIMPLE_BORDER</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
......
......@@ -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