Commit 76adcc60 authored by jean-pierre charras's avatar jean-pierre charras

Design rules dialog: use wxLC_VIRTUAL options in wxListBoxes to speed up nets...

Design rules dialog: use wxLC_VIRTUAL options in wxListBoxes to speed  up nets lists display (which was *very long* for boards with a lot of nets)
parents d00f3744 86210d10
...@@ -113,8 +113,10 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -113,8 +113,10 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
description << wxT( "<p>" ); description << wxT( "<p>" );
description << wxT( "<b><u>" ) << _( "Description" ) << wxT( "</u></b>" ); // bold & underlined font for caption description << wxT( "<b><u>" ) << _( "Description" ) << wxT( "</u></b>" ); // bold & underlined font for caption
description << wxT( description << wxT( "<p>" ) <<
"<p>The KiCad EDA Suite is a set of open source applications for the creation of electronic schematics and to design printed circuit boards.</p>" ); _(
"The KiCad EDA Suite is a set of open source applications for the creation of electronic schematics and to design printed circuit boards." )
<< wxT( "</p>" );
description << wxT( "</p>" ); description << wxT( "</p>" );
...@@ -170,7 +172,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -170,7 +172,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
<< HtmlNewline( 4 ) << HtmlNewline( 4 )
<< _( "The complete KiCad EDA Suite is released under the" ) << HtmlNewline( 2 ) << _( "The complete KiCad EDA Suite is released under the" ) << HtmlNewline( 2 )
<< HtmlHyperlink( wxT( "http://www.gnu.org/licenses" ), << HtmlHyperlink( wxT( "http://www.gnu.org/licenses" ),
_( "GNU General Public License version 2" ) ) _( "GNU General Public License (GPL) version 2" ) )
<< wxT( "</div>" ); << wxT( "</div>" );
info.SetLicense( license ); info.SetLicense( license );
...@@ -201,7 +203,8 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -201,7 +203,8 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
info.AddDeveloper( new Contributor( wxT( "Lorenzo Marcantonio" ), wxT( "lomarcan@tin.it" ) ) ); info.AddDeveloper( new Contributor( wxT( "Lorenzo Marcantonio" ), wxT( "lomarcan@tin.it" ) ) );
info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ), wxT( "marco.serantoni@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ), wxT( "marco.serantoni@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Marco Mattila" ), wxT( "marcom99@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Marco Mattila" ), wxT( "marcom99@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Rafael Sokolowski" ), wxT( "rafael.sokolowski@web.de" ) ) ); info.AddDeveloper( new Contributor( wxT( "Rafael Sokolowski" ),
wxT( "rafael.sokolowski@web.de" ) ) );
info.AddDeveloper( new Contributor( wxT( "Rok Markovic" ), wxT( "rok@kanardia.eu" ) ) ); info.AddDeveloper( new Contributor( wxT( "Rok Markovic" ), wxT( "rok@kanardia.eu" ) ) );
info.AddDeveloper( new Contributor( wxT( "Tim Hanson" ), wxT( "sideskate@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Tim Hanson" ), wxT( "sideskate@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Vesa Solonen" ), wxT( "vesa.solonen@hut.fi" ) ) ); info.AddDeveloper( new Contributor( wxT( "Vesa Solonen" ), wxT( "vesa.solonen@hut.fi" ) ) );
......
This diff is collapsed.
...@@ -76,7 +76,7 @@ private: ...@@ -76,7 +76,7 @@ private:
void CopyGlobalRulesToBoard(); void CopyGlobalRulesToBoard();
void CopyDimensionsListsToBoard( ); void CopyDimensionsListsToBoard( );
void SetRoutableLayerStatus(); void SetRoutableLayerStatus();
void FillListBoxWithNetNames( wxListCtrl* aListCtrl, const wxString& aNetClass ); void FillListBoxWithNetNames( NETS_LIST_CTRL* aListCtrl, const wxString& aNetClass );
void PrintCurrentSettings( ); void PrintCurrentSettings( );
/** /**
...@@ -96,9 +96,7 @@ private: ...@@ -96,9 +96,7 @@ private:
void setNetClass( const wxString& aNetName, const wxString& aClassName ); void setNetClass( const wxString& aNetName, const wxString& aClassName );
static void setRowItem( wxListCtrl* aListCtrl, int aRow, NETCUP* aNetAndClass ); void moveSelectedItems( NETS_LIST_CTRL* src, const wxString& newClassName );
void moveSelectedItems( wxListCtrl* src, const wxString& newClassName );
public: public:
......
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_DESIGN_RULES
///////////////////////////////////////////////////////////////////////////////
#ifndef __dialog_design_rules_aux_helper_class_h_
#define __dialog_design_rules_aux_helper_class_h_
#include <wx/listctrl.h>
/* helper class to display lists of nets and associated netclasses
* used in dialog design rules.
* It s needed because the 2 wxListCtlr used to display lists of nets
* use the wxLC_VIRTUAL option.
* The virtual wxString OnGetItemText(long item, long column) const method
* must be overlaid.
*/
class NETS_LIST_CTRL: public wxListCtrl
{
private:
wxArrayString m_Netnames; ///< an array to store the list of nets (column 0)
wxArrayString m_Classnames; ///< an array to store the list of netclasse (column 1)
public:
NETS_LIST_CTRL(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON):
wxListCtrl( parent, id, pos, size, style )
{
};
NETS_LIST_CTRL()
{
};
void setRowItems(unsigned aRow, const wxString & aNetname, const wxString & aNetclassName );
void ClearList()
{
SetItemCount(0);
m_Netnames.Clear();
m_Classnames.Clear();
}
virtual wxString OnGetItemText(long item, long column) const;
};
#endif //__dialog_design_rules_aux_helper_class_h_
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "dialog_design_rules_aux_helper_class.h"
#include "dialog_design_rules_base.h" #include "dialog_design_rules_base.h"
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
...@@ -99,7 +101,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -99,7 +101,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_leftClassChoice->SetSelection( 0 ); m_leftClassChoice->SetSelection( 0 );
leftNetSelectBoxSizer->Add( m_leftClassChoice, 0, wxEXPAND, 5 ); leftNetSelectBoxSizer->Add( m_leftClassChoice, 0, wxEXPAND, 5 );
m_leftListCtrl = new wxListCtrl( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES|wxSUNKEN_BORDER ); m_leftListCtrl = new NETS_LIST_CTRL( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES|wxSUNKEN_BORDER );
m_leftListCtrl->SetMinSize( wxSize( 220,200 ) ); m_leftListCtrl->SetMinSize( wxSize( 220,200 ) );
leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxEXPAND|wxTOP, 5 ); leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxEXPAND|wxTOP, 5 );
...@@ -139,7 +141,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -139,7 +141,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_rightClassChoice->SetSelection( 0 ); m_rightClassChoice->SetSelection( 0 );
rghtNetSelectBoxSizer->Add( m_rightClassChoice, 0, wxEXPAND, 5 ); rghtNetSelectBoxSizer->Add( m_rightClassChoice, 0, wxEXPAND, 5 );
m_rightListCtrl = new wxListCtrl( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES|wxSUNKEN_BORDER ); m_rightListCtrl = new NETS_LIST_CTRL( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES|wxSUNKEN_BORDER );
m_rightListCtrl->SetMinSize( wxSize( 220,-1 ) ); m_rightListCtrl->SetMinSize( wxSize( 220,-1 ) );
rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxEXPAND|wxTOP, 5 ); rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxEXPAND|wxTOP, 5 );
......
...@@ -558,8 +558,8 @@ ...@@ -558,8 +558,8 @@
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style">wxLC_HRULES|wxLC_REPORT|wxLC_VRULES</property> <property name="style">wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES</property>
<property name="subclass"></property> <property name="subclass">NETS_LIST_CTRL; dialog_design_rules_aux_helper_class.h</property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
...@@ -908,8 +908,8 @@ ...@@ -908,8 +908,8 @@
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style">wxLC_HRULES|wxLC_REPORT|wxLC_VRULES</property> <property name="style">wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES</property>
<property name="subclass"></property> <property name="subclass">NETS_LIST_CTRL; dialog_design_rules_aux_helper_class.h</property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include <wx/intl.h> #include <wx/intl.h>
class NETS_LIST_CTRL;
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/string.h> #include <wx/string.h>
...@@ -60,13 +62,13 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog ...@@ -60,13 +62,13 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog
wxButton* m_removeButton; wxButton* m_removeButton;
wxButton* m_moveUpButton; wxButton* m_moveUpButton;
wxChoice* m_leftClassChoice; wxChoice* m_leftClassChoice;
wxListCtrl* m_leftListCtrl; NETS_LIST_CTRL* m_leftListCtrl;
wxButton* m_buttonRightToLeft; wxButton* m_buttonRightToLeft;
wxButton* m_buttonLeftToRight; wxButton* m_buttonLeftToRight;
wxButton* m_buttonLeftSelAll; wxButton* m_buttonLeftSelAll;
wxButton* m_buttonRightSelAll; wxButton* m_buttonRightSelAll;
wxChoice* m_rightClassChoice; wxChoice* m_rightClassChoice;
wxListCtrl* m_rightListCtrl; NETS_LIST_CTRL* m_rightListCtrl;
wxPanel* m_panelGolbalDesignRules; wxPanel* m_panelGolbalDesignRules;
wxRadioBox* m_OptViaType; wxRadioBox* m_OptViaType;
wxStaticText* m_ViaMinTitle; wxStaticText* m_ViaMinTitle;
......
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