Naming conventions.

This commit is contained in:
Jeff Young 2021-09-27 12:55:53 +01:00
parent 3e298f1175
commit 7a879c6a2d
5 changed files with 37 additions and 40 deletions

View File

@ -29,7 +29,7 @@ set( CVPCB_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/board_stackup_manager/stackup_predefined_prms.cpp
${CMAKE_SOURCE_DIR}/pcbnew/footprint_info_impl.cpp
auto_associate.cpp
components_listbox.cpp
symbols_listbox.cpp
display_footprints_frame.cpp
footprints_listbox.cpp
library_listbox.cpp

View File

@ -921,11 +921,11 @@ void CVPCB_MAINFRAME::BuildSymbolsListBox()
if( m_symbolsListBox == nullptr )
{
m_symbolsListBox = new COMPONENTS_LISTBOX( this, ID_CVPCB_COMPONENT_LIST );
m_symbolsListBox = new SYMBOLS_LISTBOX( this, ID_CVPCB_COMPONENT_LIST );
m_symbolsListBox->SetFont( KIUI::GetMonospacedUIFont() );
}
m_symbolsListBox->m_ComponentList.Clear();
m_symbolsListBox->m_SymbolList.Clear();
for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
{
@ -935,14 +935,14 @@ void CVPCB_MAINFRAME::BuildSymbolsListBox()
symbol->GetReference(),
symbol->GetValue(),
symbol->GetFPID().Format().wx_str() );
m_symbolsListBox->m_ComponentList.Add( msg );
m_symbolsListBox->m_SymbolList.Add( msg );
}
if( m_symbolsListBox->m_ComponentList.Count() )
if( m_symbolsListBox->m_SymbolList.Count() )
{
m_symbolsListBox->SetItemCount( m_symbolsListBox->m_ComponentList.Count() );
m_symbolsListBox->SetItemCount( m_symbolsListBox->m_SymbolList.Count() );
m_symbolsListBox->SetSelection( 0, true );
m_symbolsListBox->RefreshItems( 0L, m_symbolsListBox->m_ComponentList.Count() - 1 );
m_symbolsListBox->RefreshItems( 0L, m_symbolsListBox->m_SymbolList.Count() - 1 );
m_symbolsListBox->UpdateWidth();
}
}

View File

@ -384,7 +384,7 @@ private:
ACTION_TOOLBAR* m_mainToolBar;
FOOTPRINTS_LISTBOX* m_footprintListBox;
LIBRARY_LISTBOX* m_librariesListBox;
COMPONENTS_LISTBOX* m_symbolsListBox;
SYMBOLS_LISTBOX* m_symbolsListBox;
wxTextCtrl* m_tcFilterString;
wxStaticText* m_statusLine1;
wxStaticText* m_statusLine2;

View File

@ -154,9 +154,6 @@ public:
wxString GetSelectedLibrary();
wxString OnGetItemText( long item, long column ) const override;
// Events functions:
void OnLeftClick( wxListEvent& event );
void OnSelectLibrary( wxListEvent& event );
/**
@ -179,12 +176,12 @@ private:
};
class COMPONENTS_LISTBOX : public ITEMS_LISTBOX_BASE
class SYMBOLS_LISTBOX : public ITEMS_LISTBOX_BASE
{
public:
COMPONENTS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id );
SYMBOLS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id );
~COMPONENTS_LISTBOX();
~SYMBOLS_LISTBOX();
void Clear();
int GetCount();
@ -222,7 +219,7 @@ public:
DECLARE_EVENT_TABLE();
public:
wxArrayString m_ComponentList;
wxArrayString m_SymbolList;
};

View File

@ -33,65 +33,65 @@
#include <wx/log.h>
COMPONENTS_LISTBOX::COMPONENTS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id ) :
SYMBOLS_LISTBOX::SYMBOLS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id ) :
ITEMS_LISTBOX_BASE( parent, id )
{
}
COMPONENTS_LISTBOX::~COMPONENTS_LISTBOX()
SYMBOLS_LISTBOX::~SYMBOLS_LISTBOX()
{
}
BEGIN_EVENT_TABLE( COMPONENTS_LISTBOX, ITEMS_LISTBOX_BASE )
EVT_CHAR( COMPONENTS_LISTBOX::OnChar )
EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST, COMPONENTS_LISTBOX::OnSelectComponent )
BEGIN_EVENT_TABLE( SYMBOLS_LISTBOX, ITEMS_LISTBOX_BASE )
EVT_CHAR( SYMBOLS_LISTBOX::OnChar )
EVT_LIST_ITEM_SELECTED( ID_CVPCB_COMPONENT_LIST, SYMBOLS_LISTBOX::OnSelectComponent )
END_EVENT_TABLE()
void COMPONENTS_LISTBOX::Clear()
void SYMBOLS_LISTBOX::Clear()
{
m_ComponentList.Clear();
m_SymbolList.Clear();
SetItemCount( 0 );
}
int COMPONENTS_LISTBOX::GetCount()
int SYMBOLS_LISTBOX::GetCount()
{
return m_ComponentList.Count();
return m_SymbolList.Count();
}
void COMPONENTS_LISTBOX::SetString( unsigned linecount, const wxString& text )
void SYMBOLS_LISTBOX::SetString( unsigned linecount, const wxString& text )
{
if( linecount >= m_ComponentList.Count() )
linecount = m_ComponentList.Count() - 1;
if( linecount >= m_SymbolList.Count() )
linecount = m_SymbolList.Count() - 1;
if( m_ComponentList.Count() > 0 )
if( m_SymbolList.Count() > 0 )
{
m_ComponentList[linecount] = text;
m_SymbolList[linecount] = text;
UpdateWidth( linecount );
}
}
void COMPONENTS_LISTBOX::AppendLine( const wxString& text )
void SYMBOLS_LISTBOX::AppendLine( const wxString& text )
{
m_ComponentList.Add( text );
int lines = m_ComponentList.Count();
m_SymbolList.Add( text );
int lines = m_SymbolList.Count();
SetItemCount( lines );
UpdateWidth( lines - 1 );
}
wxString COMPONENTS_LISTBOX::OnGetItemText( long item, long column ) const
wxString SYMBOLS_LISTBOX::OnGetItemText( long item, long column ) const
{
return m_ComponentList.Item( item );
return m_SymbolList.Item( item );
}
void COMPONENTS_LISTBOX::SetSelection( int index, bool State )
void SYMBOLS_LISTBOX::SetSelection( int index, bool State )
{
if( index >= GetCount() )
index = GetCount() - 1;
@ -108,9 +108,9 @@ void COMPONENTS_LISTBOX::SetSelection( int index, bool State )
}
void COMPONENTS_LISTBOX::OnChar( wxKeyEvent& event )
void SYMBOLS_LISTBOX::OnChar( wxKeyEvent& event )
{
wxLogTrace( kicadTraceKeyEvent, "COMPONENTS_LISTBOX::OnChar %s", dump( event ) );
wxLogTrace( kicadTraceKeyEvent, "SYMBOLS_LISTBOX::OnChar %s", dump( event ) );
int key = event.GetKeyCode();
@ -133,9 +133,9 @@ void COMPONENTS_LISTBOX::OnChar( wxKeyEvent& event )
// Search for an item name starting by the key code:
key = toupper( key );
for( unsigned ii = 0; ii < m_ComponentList.GetCount(); ii++ )
for( unsigned ii = 0; ii < m_SymbolList.GetCount(); ii++ )
{
wxString text = m_ComponentList.Item( ii );
wxString text = m_SymbolList.Item( ii );
// Search for the start char of the footprint name. Skip the line number.
text.Trim( false ); // Remove leading spaces in line
@ -166,7 +166,7 @@ void COMPONENTS_LISTBOX::OnChar( wxKeyEvent& event )
}
void COMPONENTS_LISTBOX::OnSelectComponent( wxListEvent& event )
void SYMBOLS_LISTBOX::OnSelectComponent( wxListEvent& event )
{
SetFocus();
GetParent()->OnSelectComponent( event );