Improvements for component table

This commit is contained in:
Oliver Walters 2017-05-03 08:24:45 +02:00 committed by jean-pierre charras
parent b50d3966b5
commit 5fe13c01c7
5 changed files with 35 additions and 28 deletions

View File

@ -395,7 +395,7 @@ bool BOM_TABLE_GROUP::HasValueChanged( BOM_COLUMN* aField ) const
*
* @aSort - Sort the references
*/
wxArrayString BOM_TABLE_GROUP::GetReferences( bool aSort) const
wxArrayString BOM_TABLE_GROUP::GetReferences( bool aSort ) const
{
wxArrayString refs;
@ -805,13 +805,6 @@ wxDataViewColumn* BOM_TABLE_MODEL::AddColumn( BOM_COLUMN* aColumn, int aPosition
if( !found )
m_widget->AppendColumn( column );
//TODO - wxCOL_WIDTH_AUTOSIZE prevents columns from thereafter being resized
// This requires some further attention
/**
column->SetWidth( wxCOL_WIDTH_AUTOSIZE );
column->SetWidth( column->GetWidth() );
**/
column->SetResizeable( true );
return column;

View File

@ -85,6 +85,20 @@ DIALOG_BOM_EDITOR::DIALOG_BOM_EDITOR( SCH_EDIT_FRAME* parent ) :
Update();
m_bomView->Update();
// Set default column widths
for( unsigned int ii = 0; ii < m_bomView->GetColumnCount(); ii++ )
{
auto col = m_bomView->GetColumn( ii );
if( !col )
continue;
col->SetWidth( wxCOL_WIDTH_AUTOSIZE );
col->SetResizeable( true );
}
Layout();
GetSizer()->SetSizeHints( this );
Centre();

View File

@ -93,7 +93,7 @@ DIALOG_BOM_EDITOR_BASE::DIALOG_BOM_EDITOR_BASE( wxWindow* parent, wxWindowID id,
sbSizer4->Add( m_sdbSizer1, 1, wxEXPAND, 5 );
bSizer6->Add( sbSizer4, 1, wxEXPAND, 5 );
bSizer6->Add( sbSizer4, 0, wxEXPAND, 10 );
m_leftPanel->SetSizer( bSizer6 );

View File

@ -44,8 +44,8 @@
<property name="minimum_size"></property>
<property name="name">DIALOG_BOM_EDITOR_BASE</property>
<property name="pos"></property>
<property name="size">1047,649</property>
<property name="style">wxCAPTION|wxMAXIMIZE_BOX|wxRESIZE_BORDER|wxSTAY_ON_TOP</property>
<property name="size">1047,800</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">BOM editor</property>
<property name="tooltip"></property>
@ -344,11 +344,11 @@
<property name="name">bSizer6</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
<property name="label">Options</property>
<property name="minimum_size"></property>
@ -445,11 +445,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -623,20 +623,20 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">5</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizer9</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
<property name="label">Fields</property>
<property name="minimum_size"></property>
@ -717,21 +717,21 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<object class="spacer" expanded="0">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<object class="sizeritem" expanded="0">
<property name="border">10</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
<property name="label">Apply changes</property>
<property name="minimum_size"></property>
@ -740,11 +740,11 @@
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<object class="wxStdDialogButtonSizer" expanded="0">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>

View File

@ -86,7 +86,7 @@ class DIALOG_BOM_EDITOR_BASE : public DIALOG_SHIM
public:
DIALOG_BOM_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("BOM editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 1047,649 ), long style = wxCAPTION|wxMAXIMIZE_BOX|wxRESIZE_BORDER|wxSTAY_ON_TOP );
DIALOG_BOM_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("BOM editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 1047,800 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_BOM_EDITOR_BASE();
void m_splitter1OnIdle( wxIdleEvent& )