Commit 11919da6 authored by Brian Sidebotham's avatar Brian Sidebotham

* Fix issues mainly for windows

parent 37748ad2
......@@ -58,9 +58,9 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) :
templateFieldListCtrl->InsertColumn( 1, col1 );
templateFieldListCtrl->InsertColumn( 2, col2 );
templateFieldListCtrl->SetColumnWidth( 0, 200 );
templateFieldListCtrl->SetColumnWidth( 1, 200 );
templateFieldListCtrl->SetColumnWidth( 2, 75 );
templateFieldListCtrl->SetColumnWidth( 0, templateFieldListCtrl->GetSize().GetWidth() / 3.5 );
templateFieldListCtrl->SetColumnWidth( 1, templateFieldListCtrl->GetSize().GetWidth() / 3.5 );
templateFieldListCtrl->SetColumnWidth( 2, templateFieldListCtrl->GetSize().GetWidth() / 3.5 );
// Invalid field selected and don't ignore selection events because
// they'll be from the user
......@@ -191,7 +191,7 @@ void DIALOG_EESCHEMA_OPTIONS::RefreshTemplateFieldView( void )
void DIALOG_EESCHEMA_OPTIONS::SelectTemplateField( int aItem )
{
// Only select valid items!
if( ( aItem < 0 ) || ( aItem >= templateFieldListCtrl->GetItemCount() ) )
if( !selectionValid || ( aItem >= templateFieldListCtrl->GetItemCount() ) )
return;
// Make sure we select the new item
......@@ -225,6 +225,8 @@ void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event )
// Make sure we select the new item
SelectTemplateField( selectedField );
event.Skip();
}
......@@ -250,6 +252,8 @@ void DIALOG_EESCHEMA_OPTIONS::OnDeleteButtonClick( wxCommandEvent& event )
// Make sure after the refresh that the selected item is correct
SelectTemplateField( selectedField );
}
event.Skip();
}
void DIALOG_EESCHEMA_OPTIONS::copyPanelToSelected( void )
......@@ -269,6 +273,9 @@ void DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus( wxFocusEvent& event )
// Update the data + UI
copyPanelToSelected();
RefreshTemplateFieldView();
SelectTemplateField( selectedField );
event.Skip();
}
......@@ -291,6 +298,7 @@ void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldSelected( wxListEvent& event )
if( ignoreSelection )
{
ignoreSelection = false;
event.Skip();
return;
}
......@@ -312,6 +320,8 @@ void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldSelected( wxListEvent& event )
// If an item was selected, make sure we re-select it, or at least the
// same position in the grid
SelectTemplateField( selectedField );
event.Skip();
}
......
......@@ -218,7 +218,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
bSizer6 = new wxBoxSizer( wxVERTICAL );
templateFieldListCtrl = new wxListCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES );
templateFieldListCtrl->SetMinSize( wxSize( 220,-1 ) );
templateFieldListCtrl->SetMinSize( wxSize( 500,-1 ) );
bSizer6->Add( templateFieldListCtrl, 1, wxALIGN_TOP|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 );
......
......@@ -3536,7 +3536,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">220,-1</property>
<property name="minimum_size">500,-1</property>
<property name="moveable">1</property>
<property name="name">templateFieldListCtrl</property>
<property name="pane_border">1</property>
......
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