Commit 91d5bb58 authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: dialog ERC: minor enhancements and code cleaning.

parent 6559d6a5
...@@ -60,7 +60,7 @@ END_EVENT_TABLE() ...@@ -60,7 +60,7 @@ END_EVENT_TABLE()
DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) : DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
DIALOG_ERC_BASE( parent ) DIALOG_ERC_BASE( parent )
{ {
m_Parent = parent; m_parent = parent;
Init(); Init();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
...@@ -70,11 +70,11 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) : ...@@ -70,11 +70,11 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
void DIALOG_ERC::Init() void DIALOG_ERC::Init()
{ {
m_Initialized = false; m_initialized = false;
for( int ii = 0; ii < PIN_NMAX; ii++ ) for( int ii = 0; ii < PIN_NMAX; ii++ )
for( int jj = 0; jj < PIN_NMAX; jj++ ) for( int jj = 0; jj < PIN_NMAX; jj++ )
m_ButtonList[ii][jj] = NULL; m_buttonList[ii][jj] = NULL;
m_WriteResultOpt->SetValue( m_writeErcFile ); m_WriteResultOpt->SetValue( m_writeErcFile );
...@@ -111,7 +111,7 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event ) ...@@ -111,7 +111,7 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
ScreenList.DeleteAllMarkers( MARK_ERC ); ScreenList.DeleteAllMarkers( MARK_ERC );
m_MarkersList->ClearList(); m_MarkersList->ClearList();
m_Parent->GetCanvas()->Refresh(); m_parent->GetCanvas()->Refresh();
} }
...@@ -143,10 +143,11 @@ void DIALOG_ERC::OnErcCmpClick( wxCommandEvent& event ) ...@@ -143,10 +143,11 @@ void DIALOG_ERC::OnErcCmpClick( wxCommandEvent& event )
m_MessagesList->AppendText( messageList[ii] ); m_MessagesList->AppendText( messageList[ii] );
} }
// Single click on a marker info:
// Double click on a marker info: void DIALOG_ERC::OnLeftClickMarkersList( wxCommandEvent& event )
void DIALOG_ERC::OnLeftDClickMarkersList( wxCommandEvent& event )
{ {
m_lastMarkerFound = NULL;
int index = m_MarkersList->GetSelection(); int index = m_MarkersList->GetSelection();
if( index < 0 ) if( index < 0 )
...@@ -154,55 +155,58 @@ void DIALOG_ERC::OnLeftDClickMarkersList( wxCommandEvent& event ) ...@@ -154,55 +155,58 @@ void DIALOG_ERC::OnLeftDClickMarkersList( wxCommandEvent& event )
const SCH_MARKER* marker = m_MarkersList->GetItem( (unsigned) index ); const SCH_MARKER* marker = m_MarkersList->GetItem( (unsigned) index );
EndModal( 1 );
// Search for the selected marker // Search for the selected marker
SCH_SHEET_PATH* sheet; SCH_SHEET_PATH* sheet;
bool NotFound;
wxPoint pos = marker->m_Pos;
wxPoint curpos, old_cursor_position;
SCH_SHEET_LIST SheetList; SCH_SHEET_LIST SheetList;
bool notFound = true;
NotFound = true; for( sheet = SheetList.GetFirst(); sheet; sheet = SheetList.GetNext() )
/* Search for the selected marker */
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
{ {
SCH_ITEM* item = (SCH_ITEM*) sheet->LastDrawList(); SCH_ITEM* item = (SCH_ITEM*) sheet->LastDrawList();
for( ; item; item = item->Next() )
while( item && NotFound )
{ {
if( item == marker ) if( item == marker )
{ {
NotFound = false; notFound = false;
break; break;
} }
item = item->Next();
} }
if( NotFound == false ) if( notFound == false )
break; break;
} }
if( notFound ) // Error
if( NotFound ) // Error
{ {
wxMessageBox( wxT( "OnLeftDClickMarkersList() error: Marker Not Found" ) ); wxMessageBox( _( "Marker not found" ) );
return; return;
} }
if( *sheet != m_Parent->GetCurrentSheet() ) if( *sheet != m_parent->GetCurrentSheet() )
{ {
sheet->LastScreen()->SetZoom( m_Parent->GetScreen()->GetZoom() ); sheet->LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
m_Parent->SetCurrentSheet( *sheet ); m_parent->SetCurrentSheet( *sheet );
m_Parent->GetCurrentSheet().UpdateAllScreenReferences(); m_parent->GetCurrentSheet().UpdateAllScreenReferences();
} }
m_Parent->GetScreen()->SetCrossHairPosition( pos ); m_lastMarkerFound = marker;
m_Parent->RedrawScreen( pos, true ); m_parent->GetScreen()->SetCrossHairPosition( marker->m_Pos );
m_parent->RedrawScreen( marker->m_Pos, false);
}
// Double click on a marker info:
// Close the dialog and jump to the selected marker
void DIALOG_ERC::OnLeftDblClickMarkersList( wxCommandEvent& event )
{
// Remember: OnLeftClickMarkersList was called just berfore
// and therefore m_lastMarkerFound was initialized.
// (NULL if not found)
if( m_lastMarkerFound )
{
m_parent->GetScreen()->SetCrossHairPosition( m_lastMarkerFound->m_Pos );
m_parent->RedrawScreen( m_lastMarkerFound->m_Pos, true);
EndModal( 1 );
}
} }
...@@ -210,13 +214,8 @@ void DIALOG_ERC::OnLeftDClickMarkersList( wxCommandEvent& event ) ...@@ -210,13 +214,8 @@ void DIALOG_ERC::OnLeftDClickMarkersList( wxCommandEvent& event )
*/ */
void DIALOG_ERC::ReBuildMatrixPanel() void DIALOG_ERC::ReBuildMatrixPanel()
{ {
int ii, jj, event_id, text_height;
wxPoint pos, BoxMatrixPosition;
wxStaticText* text;
wxSize BoxMatrixMinSize;
// Try to know the size of bitmap button used in drc matrix // Try to know the size of bitmap button used in drc matrix
wxBitmapButton * dummy = new wxBitmapButton( m_PanelERCOptions, wxID_ANY, wxBitmapButton * dummy = new wxBitmapButton( m_matrixPanel, wxID_ANY,
KiBitmap( ercerr_xpm ) ); KiBitmap( ercerr_xpm ) );
wxSize bitmap_size = dummy->GetSize(); wxSize bitmap_size = dummy->GetSize();
delete dummy; delete dummy;
...@@ -227,35 +226,23 @@ void DIALOG_ERC::ReBuildMatrixPanel() ...@@ -227,35 +226,23 @@ void DIALOG_ERC::ReBuildMatrixPanel()
DiagErcTableInit = true; DiagErcTableInit = true;
} }
// Get the current text size: this is a dummy text. wxPoint pos;
text = new wxStaticText( m_PanelERCOptions, -1, wxT( "W" ), pos ); // Get the current text size:use a dummy text.
wxStaticText* text = new wxStaticText( m_matrixPanel, -1, wxT( "W" ), pos );
text_height = text->GetRect().GetHeight(); int text_height = text->GetRect().GetHeight();
bitmap_size.y = std::max( bitmap_size.y, text_height ); bitmap_size.y = std::max( bitmap_size.y, text_height );
SAFE_DELETE( text ); SAFE_DELETE( text );
// compute the Y pos interval: // compute the Y pos interval:
BoxMatrixMinSize.y = ( bitmap_size.y * (PIN_NMAX + 1) ) + 5; pos.y = text_height;
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
pos = m_MatrixSizer->GetPosition();
// Size computation is not made in constructor, in some wxWidgets version, if( m_initialized == false )
// and m_BoxSizerForERC_Opt position is always 0,0. and we can't use it
pos.x = std::max( pos.x, 5 );
pos.y = std::max( pos.y, m_ResetOptButton->GetRect().GetHeight() + 30 );
BoxMatrixPosition = pos;
pos.y += text_height;
if( m_Initialized == false )
{ {
// Print row labels // Print row labels
for( ii = 0; ii < PIN_NMAX; ii++ ) for( int ii = 0; ii < PIN_NMAX; ii++ )
{ {
int y = pos.y + (ii * bitmap_size.y); int y = pos.y + (ii * bitmap_size.y);
text = new wxStaticText( m_PanelERCOptions, -1, CommentERC_H[ii], text = new wxStaticText( m_matrixPanel, -1, CommentERC_H[ii],
wxPoint( 5, y + ( bitmap_size.y / 2) - (text_height / 2) ) ); wxPoint( 5, y + ( bitmap_size.y / 2) - (text_height / 2) ) );
int x = text->GetRect().GetRight(); int x = text->GetRect().GetRight();
...@@ -265,98 +252,81 @@ void DIALOG_ERC::ReBuildMatrixPanel() ...@@ -265,98 +252,81 @@ void DIALOG_ERC::ReBuildMatrixPanel()
pos.x += 5; pos.x += 5;
} }
else else
{ pos = m_buttonList[0][0]->GetPosition();
pos = m_ButtonList[0][0]->GetPosition();
}
for( ii = 0; ii < PIN_NMAX; ii++ ) for( int ii = 0; ii < PIN_NMAX; ii++ )
{ {
int y = pos.y + (ii * bitmap_size.y); int y = pos.y + (ii * bitmap_size.y);
for( jj = 0; jj <= ii; jj++ ) for( int jj = 0; jj <= ii; jj++ )
{ {
// Add column labels (only once) // Add column labels (only once)
int diag = DiagErc[ii][jj]; int diag = DiagErc[ii][jj];
int x = pos.x + (jj * bitmap_size.x); int x = pos.x + (jj * bitmap_size.x);
if( (ii == jj) && !m_Initialized ) if( (ii == jj) && !m_initialized )
{ {
wxPoint txtpos; wxPoint txtpos;
txtpos.x = x + (bitmap_size.x / 2); txtpos.x = x + (bitmap_size.x / 2);
txtpos.y = y - text_height; txtpos.y = y - text_height;
text = new wxStaticText( m_PanelERCOptions, text = new wxStaticText( m_matrixPanel,
-1, -1,
CommentERC_V[ii], CommentERC_V[ii],
txtpos ); txtpos );
BoxMatrixMinSize.x = std::max( BoxMatrixMinSize.x, text->GetRect().GetRight() );
} }
event_id = ID_MATRIX_0 + ii + ( jj * PIN_NMAX ); int event_id = ID_MATRIX_0 + ii + ( jj * PIN_NMAX );
delete m_ButtonList[ii][jj]; BITMAP_DEF bitmap_butt = NULL;
// Add button on matrix // Add button on matrix
switch( diag ) switch( diag )
{ {
case OK: case OK:
m_ButtonList[ii][jj] = new wxBitmapButton( m_PanelERCOptions, bitmap_butt = erc_green_xpm;
event_id,
KiBitmap( erc_green_xpm ),
wxPoint( x, y ) );
break; break;
case WAR: case WAR:
m_ButtonList[ii][jj] = new wxBitmapButton( m_PanelERCOptions, bitmap_butt = ercwarn_xpm ;
event_id,
KiBitmap( ercwarn_xpm ),
wxPoint( x, y ) );
break; break;
default:
case ERR: case ERR:
m_ButtonList[ii][jj] = new wxBitmapButton( m_PanelERCOptions, bitmap_butt = ercerr_xpm;
event_id,
KiBitmap( ercerr_xpm ),
wxPoint( x, y ) );
break; break;
} }
}
}
if( !m_Initialized ) delete m_buttonList[ii][jj];
{ m_buttonList[ii][jj] = new wxBitmapButton( m_matrixPanel,
BoxMatrixMinSize.x += 5; event_id,
m_MatrixSizer->SetMinSize( BoxMatrixMinSize ); KiBitmap( bitmap_butt ),
BoxMatrixMinSize.y += BoxMatrixPosition.y; wxPoint( x, y ) );
m_PanelMatrixSizer->SetMinSize( BoxMatrixMinSize ); }
} }
m_Initialized = true; m_initialized = true;
} }
/** /*
* Function DisplayERC_MarkersList * Function DisplayERC_MarkersList
* read the schematic and display the list of ERC markers * read the schematic and display the list of ERC markers
*/ */
void DIALOG_ERC::DisplayERC_MarkersList() void DIALOG_ERC::DisplayERC_MarkersList()
{ {
SCH_SHEET_LIST SheetList; SCH_SHEET_LIST sheetList;
m_MarkersList->ClearList(); m_MarkersList->ClearList();
for( SCH_SHEET_PATH* Sheet = SheetList.GetFirst(); Sheet != NULL; Sheet = SheetList.GetNext() ) SCH_SHEET_PATH* sheet = sheetList.GetFirst();
for( ; sheet != NULL; sheet = sheetList.GetNext() )
{ {
SCH_ITEM* DrawStruct = Sheet->LastDrawList(); SCH_ITEM* item = sheet->LastDrawList();
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() ) for( ; item != NULL; item = item->Next() )
{ {
if( DrawStruct->Type() != SCH_MARKER_T ) if( item->Type() != SCH_MARKER_T )
continue; continue;
SCH_MARKER* Marker = (SCH_MARKER*) DrawStruct; SCH_MARKER* Marker = (SCH_MARKER*) item;
if( Marker->GetMarkerType() != MARK_ERC ) if( Marker->GetMarkerType() != MARK_ERC )
continue; continue;
...@@ -384,14 +354,13 @@ void DIALOG_ERC::ResetDefaultERCDiag( wxCommandEvent& event ) ...@@ -384,14 +354,13 @@ void DIALOG_ERC::ResetDefaultERCDiag( wxCommandEvent& event )
void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event ) void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event )
{ {
int id, level, ii, x, y; int id, level, ii, x, y;
wxBitmapButton* Butt; BITMAP_DEF new_bitmap_butt = NULL;
BITMAP_DEF new_bitmap_xpm = NULL;
wxPoint pos; wxPoint pos;
id = event.GetId(); id = event.GetId();
ii = id - ID_MATRIX_0; ii = id - ID_MATRIX_0;
Butt = (wxBitmapButton*) event.GetEventObject(); wxBitmapButton* butt = (wxBitmapButton*) event.GetEventObject();
pos = Butt->GetPosition(); pos = butt->GetPosition();
x = ii / PIN_NMAX; y = ii % PIN_NMAX; x = ii / PIN_NMAX; y = ii % PIN_NMAX;
...@@ -401,26 +370,27 @@ void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event ) ...@@ -401,26 +370,27 @@ void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event )
{ {
case OK: case OK:
level = WAR; level = WAR;
new_bitmap_xpm = ercwarn_xpm; new_bitmap_butt = ercwarn_xpm;
break; break;
case WAR: case WAR:
level = ERR; level = ERR;
new_bitmap_xpm = ercerr_xpm; new_bitmap_butt = ercerr_xpm;
break; break;
case ERR: case ERR:
level = OK; level = OK;
new_bitmap_xpm = erc_green_xpm; new_bitmap_butt = erc_green_xpm;
break; break;
} }
if( new_bitmap_xpm ) if( new_bitmap_butt )
{ {
delete Butt; delete butt;
Butt = new wxBitmapButton( m_PanelERCOptions, id, KiBitmap( new_bitmap_xpm ), pos ); butt = new wxBitmapButton( m_matrixPanel, id,
KiBitmap( new_bitmap_butt ), pos );
m_ButtonList[y][x] = Butt; m_buttonList[y][x] = butt;
DiagErc[y][x] = DiagErc[x][y] = level; DiagErc[y][x] = DiagErc[x][y] = level;
} }
} }
...@@ -429,11 +399,6 @@ void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event ) ...@@ -429,11 +399,6 @@ void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event )
void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
{ {
wxFileName fn; wxFileName fn;
unsigned net;
unsigned lastNet;
unsigned nextNet;
int NetNbItems, MinConn;
if( !DiagErcTableInit ) if( !DiagErcTableInit )
{ {
...@@ -447,7 +412,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) ...@@ -447,7 +412,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
SCH_SHEET_LIST sheets; SCH_SHEET_LIST sheets;
sheets.AnnotatePowerSymbols(); sheets.AnnotatePowerSymbols();
if( m_Parent->CheckAnnotate( aMessagesList, false ) ) if( m_parent->CheckAnnotate( aMessagesList, false ) )
{ {
if( aMessagesList ) if( aMessagesList )
{ {
...@@ -478,17 +443,18 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) ...@@ -478,17 +443,18 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
*/ */
TestDuplicateSheetNames( true ); TestDuplicateSheetNames( true );
m_Parent->BuildNetListBase(); m_parent->BuildNetListBase();
/* Reset the flag m_FlagOfConnection, that will be used next, in calculations */ /* Reset the flag m_FlagOfConnection, that will be used next, in calculations */
for( unsigned ii = 0; ii < g_NetObjectslist.size(); ii++ ) for( unsigned ii = 0; ii < g_NetObjectslist.size(); ii++ )
g_NetObjectslist[ii]->m_FlagOfConnection = UNCONNECTED; g_NetObjectslist[ii]->m_FlagOfConnection = UNCONNECTED;
nextNet = lastNet = 0; unsigned lastNet;
NetNbItems = 0; unsigned nextNet = lastNet = 0;
MinConn = NOC; int NetNbItems = 0;
int MinConn = NOC;
for( net = 0; net < g_NetObjectslist.size(); net++ ) for( unsigned net = 0; net < g_NetObjectslist.size(); net++ )
{ {
if( g_NetObjectslist[lastNet]->GetNet() != g_NetObjectslist[net]->GetNet() ) if( g_NetObjectslist[lastNet]->GetNet() != g_NetObjectslist[net]->GetNet() )
{ {
...@@ -561,7 +527,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) ...@@ -561,7 +527,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
DisplayERC_MarkersList(); DisplayERC_MarkersList();
// Display new markers: // Display new markers:
m_Parent->GetCanvas()->Refresh(); m_parent->GetCanvas()->Refresh();
if( m_writeErcFile ) if( m_writeErcFile )
{ {
......
...@@ -32,9 +32,10 @@ class DIALOG_ERC : public DIALOG_ERC_BASE ...@@ -32,9 +32,10 @@ class DIALOG_ERC : public DIALOG_ERC_BASE
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
private: private:
SCH_EDIT_FRAME* m_Parent; SCH_EDIT_FRAME* m_parent;
wxBitmapButton* m_ButtonList[PIN_NMAX][PIN_NMAX]; wxBitmapButton* m_buttonList[PIN_NMAX][PIN_NMAX];
bool m_Initialized; bool m_initialized;
const SCH_MARKER* m_lastMarkerFound;
static bool m_writeErcFile; static bool m_writeErcFile;
public: public:
...@@ -56,8 +57,11 @@ public: ...@@ -56,8 +57,11 @@ public:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RESET_MATRIX /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RESET_MATRIX
void OnResetMatrixClick( wxCommandEvent& event ); void OnResetMatrixClick( wxCommandEvent& event );
// Single click on a marker info:
void OnLeftClickMarkersList( wxCommandEvent& event );
// Double click on a marker info: // Double click on a marker info:
void OnLeftDClickMarkersList( wxCommandEvent& event ); void OnLeftDblClickMarkersList( wxCommandEvent& event );
void TestErc( wxArrayString* aMessagesList ); void TestErc( wxArrayString* aMessagesList );
void DisplayERC_MarkersList(); void DisplayERC_MarkersList();
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 11 2012) // C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "dialog_erc_base.h" #include "dialog_erc_base.h"
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( DIALOG_ERC_BASE, DIALOG_SHIM ) BEGIN_EVENT_TABLE( DIALOG_ERC_BASE, DIALOG_SHIM )
EVT_BUTTON( ID_ERC_CMP, DIALOG_ERC_BASE::_wxFB_OnErcCmpClick ) EVT_BUTTON( ID_ERC_CMP, DIALOG_ERC_BASE::_wxFB_OnErcCmpClick )
EVT_BUTTON( ID_ERASE_DRC_MARKERS, DIALOG_ERC_BASE::_wxFB_OnEraseDrcMarkersClick ) EVT_BUTTON( ID_ERASE_DRC_MARKERS, DIALOG_ERC_BASE::_wxFB_OnEraseDrcMarkersClick )
EVT_BUTTON( wxID_CANCEL, DIALOG_ERC_BASE::_wxFB_OnCancelClick ) EVT_BUTTON( wxID_CANCEL, DIALOG_ERC_BASE::_wxFB_OnCancelClick )
EVT_LISTBOX_DCLICK( ID_MAKER_HTMLLISTBOX, DIALOG_ERC_BASE::_wxFB_OnLeftDClickMarkersList ) EVT_LISTBOX( ID_MAKER_HTMLLISTBOX, DIALOG_ERC_BASE::_wxFB_OnLeftClickMarkersList )
EVT_BUTTON( ID_RESET_MATRIX, DIALOG_ERC_BASE::_wxFB_OnResetMatrixClick ) EVT_LISTBOX_DCLICK( ID_MAKER_HTMLLISTBOX, DIALOG_ERC_BASE::_wxFB_OnLeftDblClickMarkersList )
END_EVENT_TABLE() EVT_BUTTON( ID_RESET_MATRIX, DIALOG_ERC_BASE::_wxFB_OnResetMatrixClick )
END_EVENT_TABLE()
DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); {
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL );
m_NoteBook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_PanelERC = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_NoteBook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
wxBoxSizer* bercSizer; m_PanelERC = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
bercSizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* bercSizer;
bercSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bupperSizer;
bupperSizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer* bupperSizer;
bupperSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sdiagSizer;
sdiagSizer = new wxStaticBoxSizer( new wxStaticBox( m_PanelERC, wxID_ANY, _("Erc File Report:") ), wxVERTICAL ); wxStaticBoxSizer* sdiagSizer;
sdiagSizer = new wxStaticBoxSizer( new wxStaticBox( m_PanelERC, wxID_ANY, _("Erc report:") ), wxVERTICAL );
wxGridSizer* gSizer1;
gSizer1 = new wxGridSizer( 3, 2, 0, 0 ); wxGridSizer* gSizeDiag;
gSizeDiag = new wxGridSizer( 3, 2, 0, 0 );
m_ErcTotalErrorsText = new wxStaticText( m_PanelERC, wxID_ANY, _("Total Errors Count: "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
m_ErcTotalErrorsText->Wrap( -1 ); m_ErcTotalErrorsText = new wxStaticText( m_PanelERC, wxID_ANY, _("Total errors count: "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
gSizer1->Add( m_ErcTotalErrorsText, 0, wxALL, 5 ); m_ErcTotalErrorsText->Wrap( -1 );
gSizeDiag->Add( m_ErcTotalErrorsText, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_TotalErrCount = new wxStaticText( m_PanelERC, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 );
m_TotalErrCount->Wrap( -1 ); m_TotalErrCount = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
gSizer1->Add( m_TotalErrCount, 0, wxALL, 5 ); gSizeDiag->Add( m_TotalErrCount, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_WarnErcErrorsText = new wxStaticText( m_PanelERC, wxID_ANY, _("Warnings Count:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); m_WarnErcErrorsText = new wxStaticText( m_PanelERC, wxID_ANY, _("Warnings count:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
m_WarnErcErrorsText->Wrap( -1 ); m_WarnErcErrorsText->Wrap( -1 );
gSizer1->Add( m_WarnErcErrorsText, 0, wxALL, 5 ); gSizeDiag->Add( m_WarnErcErrorsText, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_LastWarningCount = new wxStaticText( m_PanelERC, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 ); m_LastWarningCount = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
m_LastWarningCount->Wrap( -1 ); gSizeDiag->Add( m_LastWarningCount, 0, wxALIGN_CENTER_VERTICAL, 5 );
gSizer1->Add( m_LastWarningCount, 0, wxALL, 5 );
m_LastErrCountText = new wxStaticText( m_PanelERC, wxID_ANY, _("Errors count:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
m_LastErrCountText = new wxStaticText( m_PanelERC, wxID_ANY, _("Errors Count:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); m_LastErrCountText->Wrap( -1 );
m_LastErrCountText->Wrap( -1 ); gSizeDiag->Add( m_LastErrCountText, 0, wxALIGN_CENTER_VERTICAL, 5 );
gSizer1->Add( m_LastErrCountText, 0, wxALL, 5 );
m_LastErrCount = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
m_LastErrCount = new wxStaticText( m_PanelERC, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 ); gSizeDiag->Add( m_LastErrCount, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_LastErrCount->Wrap( -1 );
gSizer1->Add( m_LastErrCount, 0, wxALL, 5 );
sdiagSizer->Add( gSizeDiag, 0, 0, 5 );
sdiagSizer->Add( gSizer1, 0, 0, 5 ); m_WriteResultOpt = new wxCheckBox( m_PanelERC, wxID_ANY, _("Create ERC file report"), wxDefaultPosition, wxDefaultSize, 0 );
sdiagSizer->Add( m_WriteResultOpt, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
bupperSizer->Add( sdiagSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
bupperSizer->Add( sdiagSizer, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP, 5 );
wxBoxSizer* bSizeMessages;
bSizeMessages = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* bSizerMessages;
bSizerMessages = new wxBoxSizer( wxVERTICAL );
m_titleMessages = new wxStaticText( m_PanelERC, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
m_titleMessages->Wrap( -1 ); m_titleMessages = new wxStaticText( m_PanelERC, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
bSizeMessages->Add( m_titleMessages, 0, wxRIGHT|wxLEFT, 5 ); m_titleMessages->Wrap( -1 );
bSizerMessages->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 ) ); m_MessagesList = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
bSizerMessages->Add( m_MessagesList, 1, wxEXPAND|wxLEFT, 5 );
bSizeMessages->Add( m_MessagesList, 1, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
bupperSizer->Add( bSizerMessages, 1, wxEXPAND, 5 );
bupperSizer->Add( bSizeMessages, 1, wxEXPAND, 5 );
wxBoxSizer* bbuttonsSizer;
wxBoxSizer* bbuttonsSizer; bbuttonsSizer = new wxBoxSizer( wxVERTICAL );
bbuttonsSizer = new wxBoxSizer( wxVERTICAL );
m_buttonERC = new wxButton( m_PanelERC, ID_ERC_CMP, _("&Test Erc"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonERC = new wxButton( m_PanelERC, ID_ERC_CMP, _("&Test Erc"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonERC->SetDefault();
bbuttonsSizer->Add( m_buttonERC, 0, wxALL|wxEXPAND, 5 ); bbuttonsSizer->Add( m_buttonERC, 0, wxALL|wxEXPAND, 5 );
m_buttondelmarkers = new wxButton( m_PanelERC, ID_ERASE_DRC_MARKERS, _("&Del Markers"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttondelmarkers = new wxButton( m_PanelERC, ID_ERASE_DRC_MARKERS, _("&Del Markers"), wxDefaultPosition, wxDefaultSize, 0 );
bbuttonsSizer->Add( m_buttondelmarkers, 0, wxALL|wxEXPAND, 5 ); bbuttonsSizer->Add( m_buttondelmarkers, 0, wxALL|wxEXPAND, 5 );
m_buttonClose = new wxButton( m_PanelERC, wxID_CANCEL, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonClose = new wxButton( m_PanelERC, wxID_CANCEL, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 );
bbuttonsSizer->Add( m_buttonClose, 0, wxALL|wxEXPAND, 5 ); bbuttonsSizer->Add( m_buttonClose, 0, wxALL|wxEXPAND, 5 );
bupperSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); bupperSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
bercSizer->Add( bupperSizer, 0, wxEXPAND, 5 ); bercSizer->Add( bupperSizer, 0, wxEXPAND, 5 );
m_WriteResultOpt = new wxCheckBox( m_PanelERC, wxID_ANY, _("Create ERC report"), wxDefaultPosition, wxDefaultSize, 0 ); m_textMarkers = new wxStaticText( m_PanelERC, wxID_ANY, _("Error list:"), wxDefaultPosition, wxDefaultSize, 0 );
bercSizer->Add( m_WriteResultOpt, 0, wxALL, 5 ); m_textMarkers->Wrap( -1 );
bercSizer->Add( m_textMarkers, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticline2 = new wxStaticLine( m_PanelERC, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bercSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 ); m_MarkersList = new ERC_HTML_LISTBOX( m_PanelERC, ID_MAKER_HTMLLISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, 0|wxSIMPLE_BORDER );
m_MarkersList->SetMinSize( wxSize( 450,250 ) );
m_textMarkers = new wxStaticText( m_PanelERC, wxID_ANY, _("Markers:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textMarkers->Wrap( -1 ); bercSizer->Add( m_MarkersList, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bercSizer->Add( m_textMarkers, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_MarkersList = new ERC_HTML_LISTBOX( m_PanelERC, ID_MAKER_HTMLLISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, 0|wxSIMPLE_BORDER ); m_PanelERC->SetSizer( bercSizer );
m_MarkersList->SetMinSize( wxSize( 500,350 ) ); m_PanelERC->Layout();
bercSizer->Fit( m_PanelERC );
bercSizer->Add( m_MarkersList, 1, wxALL|wxEXPAND, 5 ); m_NoteBook->AddPage( m_PanelERC, _("ERC"), true );
m_PanelERCOptions = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* m_panelMatrixSizer;
m_PanelERC->SetSizer( bercSizer ); m_panelMatrixSizer = new wxBoxSizer( wxVERTICAL );
m_PanelERC->Layout();
bercSizer->Fit( m_PanelERC ); m_ResetOptButton = new wxButton( m_PanelERCOptions, ID_RESET_MATRIX, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 );
m_NoteBook->AddPage( m_PanelERC, _("ERC"), true ); m_panelMatrixSizer->Add( m_ResetOptButton, 0, wxALIGN_RIGHT|wxTOP|wxRIGHT|wxLEFT, 5 );
m_PanelERCOptions = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_PanelMatrixSizer = new wxBoxSizer( wxVERTICAL ); m_matrixPanel = new wxPanel( m_PanelERCOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panelMatrixSizer->Add( m_matrixPanel, 1, wxEXPAND | wxALL, 5 );
m_ResetOptButton = new wxButton( m_PanelERCOptions, ID_RESET_MATRIX, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 );
m_PanelMatrixSizer->Add( m_ResetOptButton, 0, wxALL, 5 );
m_PanelERCOptions->SetSizer( m_panelMatrixSizer );
m_staticline1 = new wxStaticLine( m_PanelERCOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_PanelERCOptions->Layout();
m_PanelMatrixSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); m_panelMatrixSizer->Fit( m_PanelERCOptions );
m_NoteBook->AddPage( m_PanelERCOptions, _("Options"), false );
m_MatrixSizer = new wxBoxSizer( wxVERTICAL );
bSizer1->Add( m_NoteBook, 1, wxEXPAND | wxALL, 5 );
m_PanelMatrixSizer->Add( m_MatrixSizer, 1, wxEXPAND, 5 );
this->SetSizer( bSizer1 );
this->Layout();
m_PanelERCOptions->SetSizer( m_PanelMatrixSizer ); }
m_PanelERCOptions->Layout();
m_PanelMatrixSizer->Fit( m_PanelERCOptions ); DIALOG_ERC_BASE::~DIALOG_ERC_BASE()
m_NoteBook->AddPage( m_PanelERCOptions, _("Options"), false ); {
}
bSizer1->Add( m_NoteBook, 1, wxEXPAND | wxALL, 5 );
this->SetSizer( bSizer1 );
this->Layout();
bSizer1->Fit( this );
}
DIALOG_ERC_BASE::~DIALOG_ERC_BASE()
{
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 11 2012) // C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_ERC_BASE_H__ #ifndef __DIALOG_ERC_BASE_H__
#define __DIALOG_ERC_BASE_H__ #define __DIALOG_ERC_BASE_H__
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
#include "dialog_erc_listbox.h" #include "dialog_erc_listbox.h"
#include "dialog_shim.h" #include "dialog_shim.h"
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/sizer.h> #include <wx/textctrl.h>
#include <wx/statbox.h> #include <wx/sizer.h>
#include <wx/textctrl.h> #include <wx/checkbox.h>
#include <wx/button.h> #include <wx/statbox.h>
#include <wx/checkbox.h> #include <wx/button.h>
#include <wx/statline.h> #include <wx/listbox.h>
#include <wx/listbox.h> #include <wx/panel.h>
#include <wx/panel.h> #include <wx/bitmap.h>
#include <wx/bitmap.h> #include <wx/image.h>
#include <wx/image.h> #include <wx/icon.h>
#include <wx/icon.h> #include <wx/notebook.h>
#include <wx/notebook.h> #include <wx/dialog.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_ERC_BASE
/// Class DIALOG_ERC_BASE ///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// class DIALOG_ERC_BASE : public DIALOG_SHIM
class DIALOG_ERC_BASE : public DIALOG_SHIM {
{ DECLARE_EVENT_TABLE()
DECLARE_EVENT_TABLE() private:
private:
// Private event handlers
// Private event handlers void _wxFB_OnErcCmpClick( wxCommandEvent& event ){ OnErcCmpClick( event ); }
void _wxFB_OnErcCmpClick( wxCommandEvent& event ){ OnErcCmpClick( event ); } void _wxFB_OnEraseDrcMarkersClick( wxCommandEvent& event ){ OnEraseDrcMarkersClick( event ); }
void _wxFB_OnEraseDrcMarkersClick( wxCommandEvent& event ){ OnEraseDrcMarkersClick( event ); } void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); }
void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); } void _wxFB_OnLeftClickMarkersList( wxCommandEvent& event ){ OnLeftClickMarkersList( event ); }
void _wxFB_OnLeftDClickMarkersList( wxCommandEvent& event ){ OnLeftDClickMarkersList( event ); } void _wxFB_OnLeftDblClickMarkersList( wxCommandEvent& event ){ OnLeftDblClickMarkersList( event ); }
void _wxFB_OnResetMatrixClick( wxCommandEvent& event ){ OnResetMatrixClick( event ); } void _wxFB_OnResetMatrixClick( wxCommandEvent& event ){ OnResetMatrixClick( event ); }
protected: protected:
enum enum
{ {
ID_ERC_CMP = 1000, ID_ERC_CMP = 1000,
ID_ERASE_DRC_MARKERS, ID_ERASE_DRC_MARKERS,
ID_MAKER_HTMLLISTBOX, ID_MAKER_HTMLLISTBOX,
ID_RESET_MATRIX ID_RESET_MATRIX
}; };
wxNotebook* m_NoteBook; wxNotebook* m_NoteBook;
wxPanel* m_PanelERC; wxPanel* m_PanelERC;
wxStaticText* m_ErcTotalErrorsText; wxStaticText* m_ErcTotalErrorsText;
wxStaticText* m_TotalErrCount; wxTextCtrl* m_TotalErrCount;
wxStaticText* m_WarnErcErrorsText; wxStaticText* m_WarnErcErrorsText;
wxStaticText* m_LastWarningCount; wxTextCtrl* m_LastWarningCount;
wxStaticText* m_LastErrCountText; wxStaticText* m_LastErrCountText;
wxStaticText* m_LastErrCount; wxTextCtrl* m_LastErrCount;
wxStaticText* m_titleMessages; wxCheckBox* m_WriteResultOpt;
wxTextCtrl* m_MessagesList; wxStaticText* m_titleMessages;
wxButton* m_buttonERC; wxTextCtrl* m_MessagesList;
wxButton* m_buttondelmarkers; wxButton* m_buttonERC;
wxButton* m_buttonClose; wxButton* m_buttondelmarkers;
wxCheckBox* m_WriteResultOpt; wxButton* m_buttonClose;
wxStaticLine* m_staticline2; wxStaticText* m_textMarkers;
wxStaticText* m_textMarkers; ERC_HTML_LISTBOX* m_MarkersList;
ERC_HTML_LISTBOX* m_MarkersList; wxPanel* m_PanelERCOptions;
wxPanel* m_PanelERCOptions; wxButton* m_ResetOptButton;
wxBoxSizer* m_PanelMatrixSizer; wxPanel* m_matrixPanel;
wxButton* m_ResetOptButton;
wxStaticLine* m_staticline1; // Virtual event handlers, overide them in your derived class
wxBoxSizer* m_MatrixSizer; virtual void OnErcCmpClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnEraseDrcMarkersClick( wxCommandEvent& event ) { event.Skip(); }
// Virtual event handlers, overide them in your derived class virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnErcCmpClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnLeftClickMarkersList( wxCommandEvent& event ) { event.Skip(); }
virtual void OnEraseDrcMarkersClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnLeftDblClickMarkersList( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnResetMatrixClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLeftDClickMarkersList( wxCommandEvent& event ) { event.Skip(); }
virtual void OnResetMatrixClick( wxCommandEvent& event ) { event.Skip(); }
public:
public: DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("EESchema Erc"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 519,392 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_ERC_BASE();
DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("EESchema Erc"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_ERC_BASE(); };
}; #endif //__DIALOG_ERC_BASE_H__
#endif //__DIALOG_ERC_BASE_H__
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