Commit 283cfa67 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Set default button on all dialogs. Fixes lp:665703

* Set default button on all dialogs that do not already have a defined
  default button.  The only exception is the EESchema net list dialog
  which needs converted over to wxFormBuilder and due to it's design makes
  setting the default button in any tab other than the default tab
  problematic.
* Fix escape key dialog handling bug in EESchema print post script
  dialog.
parent 81509a11
...@@ -66,7 +66,8 @@ HOTKEYS_EDITOR_DIALOG::HOTKEYS_EDITOR_DIALOG( EDA_DRAW_FRAME* pa ...@@ -66,7 +66,8 @@ HOTKEYS_EDITOR_DIALOG::HOTKEYS_EDITOR_DIALOG( EDA_DRAW_FRAME* pa
m_hotkeyGrid->SetReadOnly( i, 1, true ); m_hotkeyGrid->SetReadOnly( i, 1, true );
} }
SetFocus(); m_OKButton->SetDefault();
m_hotkeyGrid->SetFocus();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Center(); Center();
} }
......
...@@ -24,47 +24,45 @@ ...@@ -24,47 +24,45 @@
#include "dialog_page_settings.h" #include "dialog_page_settings.h"
#define NB_ITEMS 11 #define NB_ITEMS 11
Ki_PageDescr * SheetList[NB_ITEMS + 1] = Ki_PageDescr* SheetList[NB_ITEMS + 1] =
{ {
&g_Sheet_A4, &g_Sheet_A3, &g_Sheet_A2, &g_Sheet_A1, &g_Sheet_A0, &g_Sheet_A4, &g_Sheet_A3, &g_Sheet_A2, &g_Sheet_A1, &g_Sheet_A0,
&g_Sheet_A, &g_Sheet_B, &g_Sheet_C, &g_Sheet_D, &g_Sheet_E, &g_Sheet_A, &g_Sheet_B, &g_Sheet_C, &g_Sheet_D, &g_Sheet_E,
&g_Sheet_user, NULL &g_Sheet_user, NULL
}; };
void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event )
/******************************************************************/
void EDA_DRAW_FRAME::Process_PageSettings(wxCommandEvent& event)
/******************************************************************/
/* Creation de la fenetre de configuration
*/
{ {
DIALOG_PAGES_SETTINGS frame(this); DIALOG_PAGES_SETTINGS frame( this );
int diag = frame.ShowModal(); int diag = frame.ShowModal();
if ( DrawPanel && diag )
if( DrawPanel && diag )
DrawPanel->Refresh(); DrawPanel->Refresh();
} }
DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent ): DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent ) :
DIALOG_PAGES_SETTINGS_BASE( parent ) DIALOG_PAGES_SETTINGS_BASE( parent )
{ {
m_Parent = parent; m_Parent = parent;
m_Screen = m_Parent->GetScreen(); m_Screen = m_Parent->GetScreen();
m_Modified = 0; m_Modified = 0;
m_SelectedSheet = NULL; m_SelectedSheet = NULL;
m_CurrentSelection = 0; m_CurrentSelection = 0;
initDialog( ); initDialog();
GetSizer()->SetSizeHints(this); GetSizer()->SetSizeHints( this );
Centre(); Centre();
} }
DIALOG_PAGES_SETTINGS::~DIALOG_PAGES_SETTINGS() DIALOG_PAGES_SETTINGS::~DIALOG_PAGES_SETTINGS()
{ {
} }
void DIALOG_PAGES_SETTINGS::initDialog() void DIALOG_PAGES_SETTINGS::initDialog()
{ {
wxString msg; wxString msg;
...@@ -74,17 +72,17 @@ void DIALOG_PAGES_SETTINGS::initDialog() ...@@ -74,17 +72,17 @@ void DIALOG_PAGES_SETTINGS::initDialog()
// Init display value for sheet User size // Init display value for sheet User size
wxString format = m_TextSheetCount->GetLabel(); wxString format = m_TextSheetCount->GetLabel();
msg.Printf(format, m_Screen->m_NumberOfScreen); msg.Printf( format, m_Screen->m_NumberOfScreen );
m_TextSheetCount->SetLabel(msg); m_TextSheetCount->SetLabel( msg );
format = m_TextSheetNumber->GetLabel(); format = m_TextSheetNumber->GetLabel();
msg.Printf(format, m_Screen->m_ScreenNumber); msg.Printf( format, m_Screen->m_ScreenNumber );
m_TextSheetNumber->SetLabel(msg); m_TextSheetNumber->SetLabel( msg );
switch( g_UserUnit ) switch( g_UserUnit )
{ {
case MILLIMETRES: case MILLIMETRES:
UserSizeX = (double) g_Sheet_user.m_Size.x * 25.4 / 1000; UserSizeX = (double) g_Sheet_user.m_Size.x * 25.4 / 1000;
UserSizeY = (double) g_Sheet_user.m_Size.y * 25.4 / 1000; UserSizeY = (double) g_Sheet_user.m_Size.y * 25.4 / 1000;
msg.Printf( wxT( "%.2f" ), UserSizeX ); msg.Printf( wxT( "%.2f" ), UserSizeX );
m_TextUserSizeX->SetValue( msg ); m_TextUserSizeX->SetValue( msg );
msg.Printf( wxT( "%.2f" ), UserSizeY ); msg.Printf( wxT( "%.2f" ), UserSizeY );
...@@ -92,8 +90,8 @@ void DIALOG_PAGES_SETTINGS::initDialog() ...@@ -92,8 +90,8 @@ void DIALOG_PAGES_SETTINGS::initDialog()
break; break;
case INCHES: case INCHES:
UserSizeX = (double) g_Sheet_user.m_Size.x / 1000; UserSizeX = (double) g_Sheet_user.m_Size.x / 1000;
UserSizeY = (double) g_Sheet_user.m_Size.y / 1000; UserSizeY = (double) g_Sheet_user.m_Size.y / 1000;
msg.Printf( wxT( "%.3f" ), UserSizeX ); msg.Printf( wxT( "%.3f" ), UserSizeX );
m_TextUserSizeX->SetValue( msg ); m_TextUserSizeX->SetValue( msg );
msg.Printf( wxT( "%.3f" ), UserSizeY ); msg.Printf( wxT( "%.3f" ), UserSizeY );
...@@ -101,8 +99,8 @@ void DIALOG_PAGES_SETTINGS::initDialog() ...@@ -101,8 +99,8 @@ void DIALOG_PAGES_SETTINGS::initDialog()
break; break;
case UNSCALED_UNITS: case UNSCALED_UNITS:
UserSizeX = g_Sheet_user.m_Size.x; UserSizeX = g_Sheet_user.m_Size.x;
UserSizeY = g_Sheet_user.m_Size.y; UserSizeY = g_Sheet_user.m_Size.y;
msg.Printf( wxT( "%f" ), UserSizeX ); msg.Printf( wxT( "%f" ), UserSizeX );
m_TextUserSizeX->SetValue( msg ); m_TextUserSizeX->SetValue( msg );
msg.Printf( wxT( "%f" ), UserSizeY ); msg.Printf( wxT( "%f" ), UserSizeY );
...@@ -111,24 +109,27 @@ void DIALOG_PAGES_SETTINGS::initDialog() ...@@ -111,24 +109,27 @@ void DIALOG_PAGES_SETTINGS::initDialog()
} }
// Set validators // Set validators
m_PageSizeBox->SetValidator( wxGenericValidator(& m_CurrentSelection) ); m_PageSizeBox->SetValidator( wxGenericValidator( &m_CurrentSelection ) );
m_TextRevision->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Revision) ); m_TextRevision->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Revision ) );
m_TextTitle->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Title) ); m_TextTitle->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Title ) );
m_TextCompany->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Company) ); m_TextCompany->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Company ) );
m_TextComment1->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Commentaire1) ); m_TextComment1->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Commentaire1 ) );
m_TextComment2->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Commentaire2) ); m_TextComment2->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Commentaire2 ) );
m_TextComment3->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Commentaire3) ); m_TextComment3->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Commentaire3 ) );
m_TextComment4->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Commentaire4) ); m_TextComment4->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Commentaire4 ) );
#ifndef EESCHEMA #ifndef EESCHEMA
m_RevisionExport->Show(false); m_RevisionExport->Show( false );
m_TitleExport->Show(false); m_TitleExport->Show( false );
m_CompanyExport->Show(false); m_CompanyExport->Show( false );
m_Comment1Export->Show(false); m_Comment1Export->Show( false );
m_Comment2Export->Show(false); m_Comment2Export->Show( false );
m_Comment3Export->Show(false); m_Comment3Export->Show( false );
m_Comment4Export->Show(false); m_Comment4Export->Show( false );
#endif #endif
// Make the OK button the default.
m_sdbSizer1OK->SetDefault();
} }
...@@ -150,7 +151,7 @@ void DIALOG_PAGES_SETTINGS::OnOkClick( wxCommandEvent& event ) ...@@ -150,7 +151,7 @@ void DIALOG_PAGES_SETTINGS::OnOkClick( wxCommandEvent& event )
{ {
SavePageSettings( event ); SavePageSettings( event );
m_Modified = 1; m_Modified = 1;
Close( TRUE ); Close( true );
} }
...@@ -160,32 +161,28 @@ void DIALOG_PAGES_SETTINGS::OnOkClick( wxCommandEvent& event ) ...@@ -160,32 +161,28 @@ void DIALOG_PAGES_SETTINGS::OnOkClick( wxCommandEvent& event )
void DIALOG_PAGES_SETTINGS::OnCancelClick( wxCommandEvent& event ) void DIALOG_PAGES_SETTINGS::OnCancelClick( wxCommandEvent& event )
{ {
Close( TRUE ); Close( true );
} }
/*****************************************************************/ void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event )
void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event)
/*****************************************************************/
/* Mise a jour effective des textes et dimensions
*/
{ {
double dtmp; double dtmp;
wxString msg; wxString msg;
m_Screen->m_Revision = m_TextRevision->GetValue(); m_Screen->m_Revision = m_TextRevision->GetValue();
m_Screen->m_Company = m_TextCompany->GetValue(); m_Screen->m_Company = m_TextCompany->GetValue();
m_Screen->m_Title = m_TextTitle->GetValue(); m_Screen->m_Title = m_TextTitle->GetValue();
m_Screen->m_Commentaire1 = m_TextComment1->GetValue(); m_Screen->m_Commentaire1 = m_TextComment1->GetValue();
m_Screen->m_Commentaire2 = m_TextComment2->GetValue(); m_Screen->m_Commentaire2 = m_TextComment2->GetValue();
m_Screen->m_Commentaire3 = m_TextComment3->GetValue(); m_Screen->m_Commentaire3 = m_TextComment3->GetValue();
m_Screen->m_Commentaire4 = m_TextComment4->GetValue(); m_Screen->m_Commentaire4 = m_TextComment4->GetValue();
msg = m_TextUserSizeX->GetValue(); msg = m_TextUserSizeX->GetValue();
msg.ToDouble(&dtmp); msg.ToDouble( &dtmp );
UserSizeX = dtmp; UserSizeX = dtmp;
msg = m_TextUserSizeY->GetValue(); msg = m_TextUserSizeY->GetValue();
msg.ToDouble(&dtmp); msg.ToDouble( &dtmp );
UserSizeY = dtmp; UserSizeY = dtmp;
int ii = m_PageSizeBox->GetSelection(); int ii = m_PageSizeBox->GetSelection();
...@@ -199,18 +196,18 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event) ...@@ -199,18 +196,18 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event)
switch( g_UserUnit ) switch( g_UserUnit )
{ {
case MILLIMETRES: case MILLIMETRES:
g_Sheet_user.m_Size.x = (int) ( UserSizeX * 1000 / 25.4 ); g_Sheet_user.m_Size.x = (int) ( UserSizeX * 1000 / 25.4 );
g_Sheet_user.m_Size.y = (int) ( UserSizeY * 1000 / 25.4 ); g_Sheet_user.m_Size.y = (int) ( UserSizeY * 1000 / 25.4 );
break; break;
case INCHES: case INCHES:
g_Sheet_user.m_Size.x = (int) ( UserSizeX * 1000 ); g_Sheet_user.m_Size.x = (int) ( UserSizeX * 1000 );
g_Sheet_user.m_Size.y = (int) ( UserSizeY * 1000 ); g_Sheet_user.m_Size.y = (int) ( UserSizeY * 1000 );
break; break;
case UNSCALED_UNITS: case UNSCALED_UNITS:
g_Sheet_user.m_Size.x = (int) ( UserSizeX ); g_Sheet_user.m_Size.x = (int) ( UserSizeX );
g_Sheet_user.m_Size.y = (int) ( UserSizeY ); g_Sheet_user.m_Size.y = (int) ( UserSizeY );
break; break;
} }
...@@ -228,9 +225,11 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event) ...@@ -228,9 +225,11 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event)
#ifdef EESCHEMA #ifdef EESCHEMA
/* Exports settings to other sheets if requested: */ /* Exports settings to other sheets if requested: */
SCH_SCREEN * screen; SCH_SCREEN* screen;
/* Build the screen list */ /* Build the screen list */
SCH_SCREENS ScreenList; SCH_SCREENS ScreenList;
/* Update the datas */ /* Update the datas */
for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() ) for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() )
{ {
...@@ -241,7 +240,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event) ...@@ -241,7 +240,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event)
screen->m_Revision = m_Screen->m_Revision; screen->m_Revision = m_Screen->m_Revision;
if( m_TitleExport->IsChecked() ) if( m_TitleExport->IsChecked() )
screen->m_Title =m_Screen->m_Title; screen->m_Title = m_Screen->m_Title;
if( m_CompanyExport->IsChecked() ) if( m_CompanyExport->IsChecked() )
screen->m_Company = m_Screen->m_Company; screen->m_Company = m_Screen->m_Company;
...@@ -258,6 +257,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event) ...@@ -258,6 +257,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event)
if( m_Comment4Export->IsChecked() ) if( m_Comment4Export->IsChecked() )
screen->m_Commentaire4 = m_Screen->m_Commentaire4; screen->m_Commentaire4 = m_Screen->m_Commentaire4;
} }
#endif #endif
m_Screen->SetModify(); m_Screen->SetModify();
...@@ -265,15 +265,13 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event) ...@@ -265,15 +265,13 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event)
} }
/*******************************************************/
void DIALOG_PAGES_SETTINGS::SearchPageSizeSelection()
/*******************************************************/
/* Search the correct index to activate the radiobox list size selection /* Search the correct index to activate the radiobox list size selection
* according to the current page size * according to the current page size
*/ */
void DIALOG_PAGES_SETTINGS::SearchPageSizeSelection()
{ {
Ki_PageDescr * sheet; Ki_PageDescr* sheet;
int ii; int ii;
m_CurrentSelection = NB_ITEMS - 1; m_CurrentSelection = NB_ITEMS - 1;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -32,10 +32,13 @@ DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( CVPCB_MAINFRAME* parent ) : ...@@ -32,10 +32,13 @@ DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( CVPCB_MAINFRAME* parent ) :
Init( ); Init( );
title = _( "Project file: " ) + fn.GetFullPath(); title = _( "Project file: " ) + fn.GetFullPath();
SetTitle( title ); SetTitle( title );
if( GetSizer() ) if( GetSizer() )
{ {
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
} }
m_sdbSizer2OK->SetDefault();
} }
......
...@@ -16,6 +16,7 @@ END_EVENT_TABLE() ...@@ -16,6 +16,7 @@ END_EVENT_TABLE()
DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetSizeHints( wxDefaultSize, wxDefaultSize );
this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
wxBoxSizer* mainSizer; wxBoxSizer* mainSizer;
mainSizer = new wxBoxSizer( wxVERTICAL ); mainSizer = new wxBoxSizer( wxVERTICAL );
...@@ -25,6 +26,8 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx ...@@ -25,6 +26,8 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_panel1 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panel1 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panel1->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
wxBoxSizer* p1mainSizer; wxBoxSizer* p1mainSizer;
p1mainSizer = new wxBoxSizer( wxHORIZONTAL ); p1mainSizer = new wxBoxSizer( wxHORIZONTAL );
...@@ -148,8 +151,9 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx ...@@ -148,8 +151,9 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_panel1->SetSizer( p1mainSizer ); m_panel1->SetSizer( p1mainSizer );
m_panel1->Layout(); m_panel1->Layout();
p1mainSizer->Fit( m_panel1 ); p1mainSizer->Fit( m_panel1 );
m_notebook1->AddPage( m_panel1, _("General Options"), true ); m_notebook1->AddPage( m_panel1, _("General Options"), false );
m_panel2 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panel2 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panel2->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
m_panel2->SetToolTip( _("User defined field names for schematic components. ") ); m_panel2->SetToolTip( _("User defined field names for schematic components. ") );
wxBoxSizer* bSizer6; wxBoxSizer* bSizer6;
...@@ -236,7 +240,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx ...@@ -236,7 +240,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_panel2->SetSizer( bSizer6 ); m_panel2->SetSizer( bSizer6 );
m_panel2->Layout(); m_panel2->Layout();
bSizer6->Fit( m_panel2 ); bSizer6->Fit( m_panel2 );
m_notebook1->AddPage( m_panel2, _("Template Field Names"), false ); m_notebook1->AddPage( m_panel2, _("Template Field Names"), true );
bOptionsSizer->Add( m_notebook1, 1, wxEXPAND, 0 ); bOptionsSizer->Add( m_notebook1, 1, wxEXPAND, 0 );
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<property name="use_enum">1</property> <property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property> <property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1"> <object class="Dialog" expanded="1">
<property name="bg"></property> <property name="bg">wxSYS_COLOUR_BTNFACE</property>
<property name="center">wxBOTH</property> <property name="center">wxBOTH</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
...@@ -151,9 +151,9 @@ ...@@ -151,9 +151,9 @@
<object class="notebookpage" expanded="1"> <object class="notebookpage" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">General Options</property> <property name="label">General Options</property>
<property name="select">1</property> <property name="select">0</property>
<object class="wxPanel" expanded="1"> <object class="wxPanel" expanded="1">
<property name="bg"></property> <property name="bg">wxSYS_COLOUR_BTNFACE</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
...@@ -1649,9 +1649,9 @@ ...@@ -1649,9 +1649,9 @@
<object class="notebookpage" expanded="1"> <object class="notebookpage" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">Template Field Names</property> <property name="label">Template Field Names</property>
<property name="select">0</property> <property name="select">1</property>
<object class="wxPanel" expanded="1"> <object class="wxPanel" expanded="1">
<property name="bg"></property> <property name="bg">wxSYS_COLOUR_BTNFACE</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
......
...@@ -8,46 +8,43 @@ DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN( wxWindow* parent ) : ...@@ -8,46 +8,43 @@ DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN( wxWindow* parent ) :
{ {
/* Required to make escape key work correctly in wxGTK. */ /* Required to make escape key work correctly in wxGTK. */
m_textName->SetFocus(); m_textName->SetFocus();
m_sdbSizer1OK->SetDefault();
} }
void DIALOG_LIB_EDIT_PIN::SetOrientationList( const wxArrayString& list, void DIALOG_LIB_EDIT_PIN::SetOrientationList( const wxArrayString& list,
const char *** aBitmaps ) const char*** aBitmaps )
{ {
for ( unsigned ii = 0; ii < list.GetCount( ); ii++ ) for ( unsigned ii = 0; ii < list.GetCount(); ii++ )
{ {
if( aBitmaps == NULL ) if( aBitmaps == NULL )
m_choiceOrientation->Append(list[ii]); m_choiceOrientation->Append( list[ii] );
else else
m_choiceOrientation->Insert(list[ii], m_choiceOrientation->Insert( list[ii], wxBitmap( aBitmaps[ii] ), ii );
wxBitmap(aBitmaps[ii]), ii); }
}
} }
void DIALOG_LIB_EDIT_PIN::SetElectricalTypeList( const wxArrayString& list, void DIALOG_LIB_EDIT_PIN::SetElectricalTypeList( const wxArrayString& list,
const char *** aBitmaps ) const char*** aBitmaps )
{ {
for ( unsigned ii = 0; ii < list.GetCount( ); ii++ ) for ( unsigned ii = 0; ii < list.GetCount(); ii++ )
{ {
if( aBitmaps == NULL ) if( aBitmaps == NULL )
m_choiceElectricalType->Append(list[ii]); m_choiceElectricalType->Append( list[ii] );
else else
m_choiceElectricalType->Insert(list[ii], m_choiceElectricalType->Insert( list[ii], wxBitmap( aBitmaps[ii] ), ii );
wxBitmap(aBitmaps[ii]), ii);
} }
} }
void DIALOG_LIB_EDIT_PIN::SetStyleList( const wxArrayString& list, void DIALOG_LIB_EDIT_PIN::SetStyleList( const wxArrayString& list, const char*** aBitmaps )
const char *** aBitmaps )
{ {
for ( unsigned ii = 0; ii < list.GetCount( ); ii++ ) for ( unsigned ii = 0; ii < list.GetCount(); ii++ )
{ {
if( aBitmaps == NULL ) if( aBitmaps == NULL )
m_choiceStyle->Append(list[ii]); m_choiceStyle->Append( list[ii] );
else else
m_choiceStyle->Insert(list[ii], m_choiceStyle->Insert( list[ii], wxBitmap( aBitmaps[ii] ), ii );
wxBitmap(aBitmaps[ii]), ii);
} }
} }
...@@ -90,6 +90,7 @@ DIALOG_PLOT_SCHEMATIC_DXF::DIALOG_PLOT_SCHEMATIC_DXF( SCH_EDIT_FRAME* parent ) ...@@ -90,6 +90,7 @@ DIALOG_PLOT_SCHEMATIC_DXF::DIALOG_PLOT_SCHEMATIC_DXF( SCH_EDIT_FRAME* parent )
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
m_buttonPlotAll->SetDefault();
} }
void DIALOG_PLOT_SCHEMATIC_DXF::initDlg() void DIALOG_PLOT_SCHEMATIC_DXF::initDlg()
......
...@@ -125,6 +125,7 @@ DIALOG_PLOT_SCHEMATIC_HPGL::DIALOG_PLOT_SCHEMATIC_HPGL( SCH_EDIT_FRAME* parent ) ...@@ -125,6 +125,7 @@ DIALOG_PLOT_SCHEMATIC_HPGL::DIALOG_PLOT_SCHEMATIC_HPGL( SCH_EDIT_FRAME* parent )
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
m_buttonPlotAll->SetDefault();
} }
......
...@@ -97,6 +97,7 @@ DIALOG_PLOT_SCHEMATIC_PS::DIALOG_PLOT_SCHEMATIC_PS( SCH_EDIT_FRAME* parent ) : ...@@ -97,6 +97,7 @@ DIALOG_PLOT_SCHEMATIC_PS::DIALOG_PLOT_SCHEMATIC_PS( SCH_EDIT_FRAME* parent ) :
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
m_buttonPlotAll->SetDefault();
} }
......
...@@ -55,7 +55,7 @@ DIALOG_PLOT_SCHEMATIC_PS_BASE::DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent, ...@@ -55,7 +55,7 @@ DIALOG_PLOT_SCHEMATIC_PS_BASE::DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent,
m_buttonPlotAll = new wxButton( this, wxID_ANY, _("Plot A&LL"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonPlotAll = new wxButton( this, wxID_ANY, _("Plot A&LL"), wxDefaultPosition, wxDefaultSize, 0 );
bbuttonsSizer->Add( m_buttonPlotAll, 0, wxALL|wxEXPAND, 5 ); bbuttonsSizer->Add( m_buttonPlotAll, 0, wxALL|wxEXPAND, 5 );
m_buttonClose = new wxButton( this, wxID_ANY, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonClose = new wxButton( this, 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 );
......
...@@ -435,7 +435,7 @@ ...@@ -435,7 +435,7 @@
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_CANCEL</property>
<property name="label">Close</property> <property name="label">Close</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
......
...@@ -86,11 +86,11 @@ END_EVENT_TABLE() ...@@ -86,11 +86,11 @@ END_EVENT_TABLE()
* Used in Netlist format Dialog box creation * Used in Netlist format Dialog box creation
*/ */
NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
const wxString& title, const wxString& title,
int id_NetType, int id_NetType,
int idCheckBox, int idCheckBox,
int idCreateFile, int idCreateFile,
bool selected ) : bool selected ) :
wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_SUNKEN ) wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_SUNKEN )
{ {
m_IdNetType = id_NetType; m_IdNetType = id_NetType;
...@@ -113,18 +113,14 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, ...@@ -113,18 +113,14 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
m_RightOptionsBoxSizer = new wxBoxSizer( wxVERTICAL ); m_RightOptionsBoxSizer = new wxBoxSizer( wxVERTICAL );
UpperBoxSizer->Add( m_LeftBoxSizer, 0, wxGROW | wxALL, 5 ); UpperBoxSizer->Add( m_LeftBoxSizer, 0, wxGROW | wxALL, 5 );
UpperBoxSizer->Add( m_RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); UpperBoxSizer->Add( m_RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
UpperBoxSizer->Add( m_RightOptionsBoxSizer, UpperBoxSizer->Add( m_RightOptionsBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
0,
wxALIGN_CENTER_VERTICAL | wxALL,
5 );
if( idCheckBox ) if( idCheckBox )
{ {
wxStaticText* text = new wxStaticText( this, -1, _( "Options:" ) ); wxStaticText* text = new wxStaticText( this, -1, _( "Options:" ) );
m_LeftBoxSizer->Add( text, 0, wxGROW | wxALL, 5 ); m_LeftBoxSizer->Add( text, 0, wxGROW | wxALL, 5 );
m_IsCurrentFormat = m_IsCurrentFormat = new wxCheckBox( this, idCheckBox, _( "Default format" ) );
new wxCheckBox( this, idCheckBox, _( "Default format" ) );
m_LeftBoxSizer->Add( m_IsCurrentFormat, 0, wxGROW | wxALL, 5 ); m_LeftBoxSizer->Add( m_IsCurrentFormat, 0, wxGROW | wxALL, 5 );
m_IsCurrentFormat->SetValue( selected ); m_IsCurrentFormat->SetValue( selected );
} }
...@@ -134,15 +130,16 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, ...@@ -134,15 +130,16 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
if( idCreateFile ) if( idCreateFile )
{ {
wxButton* Button; wxButton* Button;
if( idCreateFile == ID_SETUP_PLUGIN ) /* This is the "add plugin" panel */ if( idCreateFile == ID_SETUP_PLUGIN ) /* This is the "add plugin" panel */
Button = new wxButton( this, idCreateFile, _( "&Browse Plugin" ) ); Button = new wxButton( this, idCreateFile, _( "&Browse Plugin" ) );
else else
Button = new wxButton( this, idCreateFile, _( "&Netlist" ) ); Button = new wxButton( this, idCreateFile, _( "&Netlist" ) );
m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
m_ButtonCancel =
Button = new wxButton( this, wxID_CANCEL, _( "&Cancel" ) );
m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button->SetDefault();
m_ButtonCancel = new wxButton( this, wxID_CANCEL, _( "&Cancel" ) );
m_RightBoxSizer->Add( m_ButtonCancel, 0, wxGROW | wxALL, 5 );
/* Add special buttons to plugin panels: /* Add special buttons to plugin panels:
* for panel plugins: added the "delete" button * for panel plugins: added the "delete" button
...@@ -162,14 +159,9 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, ...@@ -162,14 +159,9 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
} }
/*************************************************************************************/
NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
wxDialog( parent, -1, _( "Netlist" ), wxDefaultPosition, wxDialog( parent, -1, _( "Netlist" ), wxDefaultPosition,
wxDefaultSize, DIALOG_STYLE | MAYBE_RESIZE_BORDER ) wxDefaultSize, DIALOG_STYLE | MAYBE_RESIZE_BORDER )
/*************************************************************************************/
/* Constructor for the netlist generation dialog box
*/
{ {
int ii; int ii;
...@@ -184,8 +176,8 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : ...@@ -184,8 +176,8 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
SetSizer( GeneralBoxSizer ); SetSizer( GeneralBoxSizer );
m_NoteBook = new wxNotebook( this, ID_NETLIST_NOTEBOOK, m_NoteBook = new wxNotebook( this, ID_NETLIST_NOTEBOOK,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxNB_TOP ); // @todo: tabs on top are being hidden on linux wxNB_TOP ); // @todo: tabs on top are being hidden on linux
GeneralBoxSizer->Add( m_NoteBook, 0, wxGROW | wxALL, 5 ); GeneralBoxSizer->Add( m_NoteBook, 0, wxGROW | wxALL, 5 );
...@@ -194,29 +186,29 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : ...@@ -194,29 +186,29 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
// Add Panel FORMAT PCBNEW // Add Panel FORMAT PCBNEW
m_PanelNetType[PANELPCBNEW] = m_PanelNetType[PANELPCBNEW] =
new NETLIST_PAGE_DIALOG( m_NoteBook, new NETLIST_PAGE_DIALOG( m_NoteBook,
wxT( "Pcbnew" ), wxT( "Pcbnew" ),
NET_TYPE_PCBNEW, NET_TYPE_PCBNEW,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_CREATE_NETLIST, ID_CREATE_NETLIST,
m_Parent->m_NetlistFormat == NET_TYPE_PCBNEW ); m_Parent->m_NetlistFormat == NET_TYPE_PCBNEW );
// Add Panel FORMAT ORCADPCB2 // Add Panel FORMAT ORCADPCB2
m_PanelNetType[PANELORCADPCB2] = m_PanelNetType[PANELORCADPCB2] =
new NETLIST_PAGE_DIALOG( m_NoteBook, new NETLIST_PAGE_DIALOG( m_NoteBook,
wxT( "OrcadPCB2" ), wxT( "OrcadPCB2" ),
NET_TYPE_ORCADPCB2, NET_TYPE_ORCADPCB2,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_CREATE_NETLIST, ID_CREATE_NETLIST,
m_Parent->m_NetlistFormat == NET_TYPE_ORCADPCB2 ); m_Parent->m_NetlistFormat == NET_TYPE_ORCADPCB2 );
// Add Panel FORMAT CADSTAR // Add Panel FORMAT CADSTAR
m_PanelNetType[PANELCADSTAR] = m_PanelNetType[PANELCADSTAR] =
new NETLIST_PAGE_DIALOG( m_NoteBook, new NETLIST_PAGE_DIALOG( m_NoteBook,
wxT( "CadStar" ), wxT( "CadStar" ),
NET_TYPE_CADSTAR, NET_TYPE_CADSTAR,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_CREATE_NETLIST, ID_CREATE_NETLIST,
m_Parent->m_NetlistFormat == NET_TYPE_CADSTAR ); m_Parent->m_NetlistFormat == NET_TYPE_CADSTAR );
// Add Panel spice // Add Panel spice
InstallPageSpice(); InstallPageSpice();
...@@ -231,26 +223,20 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : ...@@ -231,26 +223,20 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
} }
/*************************************************/
void NETLIST_DIALOG::InstallPageSpice() void NETLIST_DIALOG::InstallPageSpice()
/*************************************************/
/* Create the spice page
*/
{ {
wxButton* Button; wxButton* Button;
NETLIST_PAGE_DIALOG* page; NETLIST_PAGE_DIALOG* page;
page = m_PanelNetType[PANELSPICE] = page = m_PanelNetType[PANELSPICE] =
new NETLIST_PAGE_DIALOG( m_NoteBook, new NETLIST_PAGE_DIALOG( m_NoteBook,
wxT( "Spice" ), wxT( "Spice" ),
NET_TYPE_SPICE, NET_TYPE_SPICE,
0, 0, 0, 0,
m_Parent->m_NetlistFormat == NET_TYPE_SPICE ); m_Parent->m_NetlistFormat == NET_TYPE_SPICE );
page->m_IsCurrentFormat = page->m_IsCurrentFormat = new wxCheckBox( page, ID_CURRENT_FORMAT_IS_DEFAULT,
new wxCheckBox( page, ID_CURRENT_FORMAT_IS_DEFAULT, _( "Default format" ) );
_( "Default format" ) );
page->m_IsCurrentFormat->SetValue( m_Parent->m_NetlistFormat == NET_TYPE_SPICE ); page->m_IsCurrentFormat->SetValue( m_Parent->m_NetlistFormat == NET_TYPE_SPICE );
page->m_LeftBoxSizer->Add( page->m_IsCurrentFormat, 0, wxGROW | wxALL, 5 ); page->m_LeftBoxSizer->Add( page->m_IsCurrentFormat, 0, wxGROW | wxALL, 5 );
...@@ -261,6 +247,7 @@ void NETLIST_DIALOG::InstallPageSpice() ...@@ -261,6 +247,7 @@ void NETLIST_DIALOG::InstallPageSpice()
wxRA_SPECIFY_COLS ); wxRA_SPECIFY_COLS );
if( !g_OptNetListUseNames ) if( !g_OptNetListUseNames )
m_UseNetNamesInNetlist->SetSelection( 1 ); m_UseNetNamesInNetlist->SetSelection( 1 );
page->m_LeftBoxSizer->Add( m_UseNetNamesInNetlist, 0, wxGROW | wxALL, 5 ); page->m_LeftBoxSizer->Add( m_UseNetNamesInNetlist, 0, wxGROW | wxALL, 5 );
page->m_CommandStringCtrl = new WinEDA_EnterText( page, page->m_CommandStringCtrl = new WinEDA_EnterText( page,
...@@ -272,6 +259,7 @@ void NETLIST_DIALOG::InstallPageSpice() ...@@ -272,6 +259,7 @@ void NETLIST_DIALOG::InstallPageSpice()
// Add buttons // Add buttons
Button = new wxButton( page, ID_CREATE_NETLIST, _( "Netlist" ) ); Button = new wxButton( page, ID_CREATE_NETLIST, _( "Netlist" ) );
page->m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); page->m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button->SetDefault();
Button = new wxButton( page, ID_RUN_SIMULATOR, _( "&Run Simulator" ) ); Button = new wxButton( page, ID_RUN_SIMULATOR, _( "&Run Simulator" ) );
page->m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); page->m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
...@@ -281,12 +269,9 @@ void NETLIST_DIALOG::InstallPageSpice() ...@@ -281,12 +269,9 @@ void NETLIST_DIALOG::InstallPageSpice()
} }
/*************************************************/
void NETLIST_DIALOG::InstallCustomPages()
/*************************************************/
/* create the pages for custom netlist format selection: /* create the pages for custom netlist format selection:
*/ */
void NETLIST_DIALOG::InstallCustomPages()
{ {
bool selected; bool selected;
int ii, CustomCount; int ii, CustomCount;
...@@ -295,6 +280,7 @@ void NETLIST_DIALOG::InstallCustomPages() ...@@ -295,6 +280,7 @@ void NETLIST_DIALOG::InstallCustomPages()
CustomCount = CUSTOMPANEL_COUNTMAX; CustomCount = CUSTOMPANEL_COUNTMAX;
previoustitle = wxT( "dummy_title" ); previoustitle = wxT( "dummy_title" );
for( ii = 0; ii < CustomCount; ii++ ) for( ii = 0; ii < CustomCount; ii++ )
{ {
title = ReturnUserNetlistTypeName( ii == 0 ? true : false ); title = ReturnUserNetlistTypeName( ii == 0 ? true : false );
...@@ -311,20 +297,20 @@ void NETLIST_DIALOG::InstallCustomPages() ...@@ -311,20 +297,20 @@ void NETLIST_DIALOG::InstallCustomPages()
CurrPage = CurrPage =
m_PanelNetType[PANELCUSTOMBASE + ii] = m_PanelNetType[PANELCUSTOMBASE + ii] =
new NETLIST_PAGE_DIALOG( m_NoteBook, new NETLIST_PAGE_DIALOG( m_NoteBook,
_( "Add Plugin" ), _( "Add Plugin" ),
NET_TYPE_CUSTOM1 + ii, NET_TYPE_CUSTOM1 + ii,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_SETUP_PLUGIN, ID_SETUP_PLUGIN,
selected ); selected );
else /* Install a plugin panel */ else /* Install a plugin panel */
CurrPage = CurrPage =
m_PanelNetType[PANELCUSTOMBASE + ii] = m_PanelNetType[PANELCUSTOMBASE + ii] =
new NETLIST_PAGE_DIALOG( m_NoteBook, new NETLIST_PAGE_DIALOG( m_NoteBook,
title, title,
NET_TYPE_CUSTOM1 + ii, NET_TYPE_CUSTOM1 + ii,
ID_CURRENT_FORMAT_IS_DEFAULT, ID_CURRENT_FORMAT_IS_DEFAULT,
ID_CREATE_NETLIST, ID_CREATE_NETLIST,
selected ); selected );
msg = CUSTOM_NETLIST_COMMAND; msg = CUSTOM_NETLIST_COMMAND;
msg << ii + 1; msg << ii + 1;
...@@ -361,13 +347,14 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event ) ...@@ -361,13 +347,14 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event )
Mask, Mask,
this, this,
wxFD_OPEN, wxFD_OPEN,
TRUE true
); );
if( FullFileName.IsEmpty() ) if( FullFileName.IsEmpty() )
return; return;
NETLIST_PAGE_DIALOG* CurrPage; NETLIST_PAGE_DIALOG* CurrPage;
CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
if( CurrPage == NULL ) if( CurrPage == NULL )
return; return;
...@@ -376,6 +363,7 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event ) ...@@ -376,6 +363,7 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event )
wxString cmdLine; wxString cmdLine;
wxFileName fn( FullFileName ); wxFileName fn( FullFileName );
wxString ext = fn.GetExt(); wxString ext = fn.GetExt();
if( ext == wxT("xsl" ) ) if( ext == wxT("xsl" ) )
cmdLine.Printf(wxT("xsltproc -o \"%%O\" \"%s\" \"%%I\""), GetChars(FullFileName) ); cmdLine.Printf(wxT("xsltproc -o \"%%O\" \"%s\" \"%%I\""), GetChars(FullFileName) );
else if( ext == wxT("exe" ) || ext.IsEmpty() ) else if( ext == wxT("exe" ) || ext.IsEmpty() )
...@@ -389,68 +377,61 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event ) ...@@ -389,68 +377,61 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event )
wxString title = CurrPage->m_TitleStringCtrl->GetValue(); wxString title = CurrPage->m_TitleStringCtrl->GetValue();
if( title.IsEmpty() ) if( title.IsEmpty() )
DisplayInfoMessage( this, DisplayInfoMessage( this,
_( "Do not forget to choose a title for this \ _( "Do not forget to choose a title for this netlist control page" ) );
netlist control page" ) );
} }
/*****************************************************************/
void NETLIST_DIALOG::SelectNetlistType( wxCommandEvent& event )
/*****************************************************************/
/* Called when the check box "default format" is clicked /* Called when the check box "default format" is clicked
*/ */
void NETLIST_DIALOG::SelectNetlistType( wxCommandEvent& event )
{ {
int ii; int ii;
NETLIST_PAGE_DIALOG* CurrPage; NETLIST_PAGE_DIALOG* CurrPage;
for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ ) for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
if( m_PanelNetType[ii] ) if( m_PanelNetType[ii] )
m_PanelNetType[ii]->m_IsCurrentFormat->SetValue( FALSE ); m_PanelNetType[ii]->m_IsCurrentFormat->SetValue( false );
CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
if( CurrPage == NULL ) if( CurrPage == NULL )
return; return;
m_Parent->m_NetlistFormat = CurrPage->m_IdNetType; m_Parent->m_NetlistFormat = CurrPage->m_IdNetType;
CurrPage->m_IsCurrentFormat->SetValue( TRUE ); CurrPage->m_IsCurrentFormat->SetValue( true );
} }
/***********************************************/
void NETLIST_DIALOG::NetlistUpdateOpt() void NETLIST_DIALOG::NetlistUpdateOpt()
/***********************************************/
{ {
int ii; int ii;
g_SimulatorCommandLine = g_SimulatorCommandLine = m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue();
m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue();
m_Parent->m_NetlistFormat = NET_TYPE_PCBNEW; m_Parent->m_NetlistFormat = NET_TYPE_PCBNEW;
for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ ) for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
{ {
if( m_PanelNetType[ii] == NULL ) if( m_PanelNetType[ii] == NULL )
break; break;
if( m_PanelNetType[ii]->m_IsCurrentFormat->GetValue() == TRUE )
if( m_PanelNetType[ii]->m_IsCurrentFormat->GetValue() == true )
m_Parent->m_NetlistFormat = m_PanelNetType[ii]->m_IdNetType; m_Parent->m_NetlistFormat = m_PanelNetType[ii]->m_IdNetType;
} }
g_OptNetListUseNames = TRUE; // Used for pspice, gnucap g_OptNetListUseNames = true; // Used for pspice, gnucap
if( m_UseNetNamesInNetlist->GetSelection() == 1 ) if( m_UseNetNamesInNetlist->GetSelection() == 1 )
g_OptNetListUseNames = FALSE; g_OptNetListUseNames = false;
} }
/**********************************************************/
void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event )
/**********************************************************/
/** /**
* Function GenNetlist * Function GenNetlist
* Create the netlist file: * Create the netlist file:
* calculate the filename with the suitable extensions * calculate the filename with the suitable extensions
* and run the netlist creator * and run the netlist creator
*/ */
void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event )
{ {
wxFileName fn; wxFileName fn;
wxString fileWildcard; wxString fileWildcard;
...@@ -538,9 +519,11 @@ bool SCH_EDIT_FRAME::CreateNetlist( int aFormat, const wxString& aFullFileName, ...@@ -538,9 +519,11 @@ bool SCH_EDIT_FRAME::CreateNetlist( int aFormat, const wxString& aFullFileName,
if( !IsOK( NULL, _( "Some items are not annotated\n\ if( !IsOK( NULL, _( "Some items are not annotated\n\
Do you want to annotate schematic?" ) ) ) Do you want to annotate schematic?" ) ) )
return false; return false;
// Schematic must be annotated: call Annotate dialog: // Schematic must be annotated: call Annotate dialog:
wxCommandEvent event; wxCommandEvent event;
OnAnnotate( event ); OnAnnotate( event );
if( CheckAnnotate( NULL, 0 ) ) if( CheckAnnotate( NULL, 0 ) )
return false; return false;
} }
...@@ -575,8 +558,8 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event ) ...@@ -575,8 +558,8 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event )
wxString ExecFile, CommandLine; wxString ExecFile, CommandLine;
g_SimulatorCommandLine = m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue(); g_SimulatorCommandLine = m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue();
g_SimulatorCommandLine.Trim( FALSE ); g_SimulatorCommandLine.Trim( false );
g_SimulatorCommandLine.Trim( TRUE ); g_SimulatorCommandLine.Trim( true );
ExecFile = g_SimulatorCommandLine.BeforeFirst( ' ' ); ExecFile = g_SimulatorCommandLine.BeforeFirst( ' ' );
CommandLine = g_SimulatorCommandLine.AfterFirst( ' ' ); CommandLine = g_SimulatorCommandLine.AfterFirst( ' ' );
...@@ -597,14 +580,11 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event ) ...@@ -597,14 +580,11 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event )
} }
/*********************************************************/
void NETLIST_DIALOG::WriteCurrentNetlistSetup( void )
/*********************************************************/
/** /**
* Function WriteCurrentNetlistSetup * Function WriteCurrentNetlistSetup
* Write the current netlist options setup in the configuration * Write the current netlist options setup in the configuration
*/ */
void NETLIST_DIALOG::WriteCurrentNetlistSetup( void )
{ {
wxString msg, Command; wxString msg, Command;
wxConfig* config = wxGetApp().m_EDA_Config; wxConfig* config = wxGetApp().m_EDA_Config;
...@@ -615,13 +595,17 @@ void NETLIST_DIALOG::WriteCurrentNetlistSetup( void ) ...@@ -615,13 +595,17 @@ void NETLIST_DIALOG::WriteCurrentNetlistSetup( void )
for( int ii = 0; ii < CUSTOMPANEL_COUNTMAX; ii++ ) for( int ii = 0; ii < CUSTOMPANEL_COUNTMAX; ii++ )
{ {
NETLIST_PAGE_DIALOG* CurrPage = m_PanelNetType[ii + PANELCUSTOMBASE]; NETLIST_PAGE_DIALOG* CurrPage = m_PanelNetType[ii + PANELCUSTOMBASE];
if( CurrPage == NULL ) if( CurrPage == NULL )
break; break;
msg = wxT( "Custom" ); msg = wxT( "Custom" );
msg << ii + 1; msg << ii + 1;
if( CurrPage->m_TitleStringCtrl ) if( CurrPage->m_TitleStringCtrl )
{ {
wxString title = CurrPage->m_TitleStringCtrl->GetValue(); wxString title = CurrPage->m_TitleStringCtrl->GetValue();
if( msg != title ) // Title has changed, Update config if( msg != title ) // Title has changed, Update config
{ {
msg = CUSTOM_NETLIST_TITLE; msg = CUSTOM_NETLIST_TITLE;
...@@ -641,47 +625,42 @@ void NETLIST_DIALOG::WriteCurrentNetlistSetup( void ) ...@@ -641,47 +625,42 @@ void NETLIST_DIALOG::WriteCurrentNetlistSetup( void )
} }
/******************************************************************/
void NETLIST_DIALOG::DeletePluginPanel( wxCommandEvent& event )
/******************************************************************/
/** /**
* Function DeletePluginPanel * Function DeletePluginPanel
* Remove a panel relative to a netlist plugin * Remove a panel relative to a netlist plugin
*/ */
void NETLIST_DIALOG::DeletePluginPanel( wxCommandEvent& event )
{ {
NETLIST_PAGE_DIALOG* CurrPage = NETLIST_PAGE_DIALOG* CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
(NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
CurrPage->m_CommandStringCtrl->SetValue( wxEmptyString ); CurrPage->m_CommandStringCtrl->SetValue( wxEmptyString );
CurrPage->m_TitleStringCtrl->SetValue( wxEmptyString ); CurrPage->m_TitleStringCtrl->SetValue( wxEmptyString );
if( CurrPage->m_IsCurrentFormat->IsChecked() ) if( CurrPage->m_IsCurrentFormat->IsChecked() )
{ {
CurrPage->m_IsCurrentFormat->SetValue( FALSE ); CurrPage->m_IsCurrentFormat->SetValue( false );
m_PanelNetType[PANELPCBNEW]->m_IsCurrentFormat->SetValue( TRUE ); m_PanelNetType[PANELPCBNEW]->m_IsCurrentFormat->SetValue( true );
} }
WriteCurrentNetlistSetup(); WriteCurrentNetlistSetup();
EndModal( NET_PLUGIN_CHANGE ); EndModal( NET_PLUGIN_CHANGE );
} }
/******************************************************************/
void NETLIST_DIALOG::ValidatePluginPanel( wxCommandEvent& event )
/******************************************************************/
/** /**
* Function ValidatePluginPanel * Function ValidatePluginPanel
* Validate the panel info relative to a new netlist plugin * Validate the panel info relative to a new netlist plugin
*/ */
void NETLIST_DIALOG::ValidatePluginPanel( wxCommandEvent& event )
{ {
NETLIST_PAGE_DIALOG* CurrPage = NETLIST_PAGE_DIALOG* CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
(NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
if( CurrPage->m_CommandStringCtrl->GetValue() == wxEmptyString ) if( CurrPage->m_CommandStringCtrl->GetValue() == wxEmptyString )
{ {
DisplayError( this, _( "Error. You must provide a command String" ) ); DisplayError( this, _( "Error. You must provide a command String" ) );
return; return;
} }
if( CurrPage->m_TitleStringCtrl->GetValue() == wxEmptyString ) if( CurrPage->m_TitleStringCtrl->GetValue() == wxEmptyString )
{ {
DisplayError( this, _( "Error. You must provide a Title" ) ); DisplayError( this, _( "Error. You must provide a Title" ) );
......
...@@ -18,7 +18,8 @@ enum id_netlist { ...@@ -18,7 +18,8 @@ enum id_netlist {
ID_SETUP_PLUGIN, ID_SETUP_PLUGIN,
ID_VALIDATE_PLUGIN, ID_VALIDATE_PLUGIN,
ID_DELETE_PLUGIN, ID_DELETE_PLUGIN,
ID_NETLIST_NOTEBOOK ID_NETLIST_NOTEBOOK,
ID_CHANGE_NOTEBOOK_PAGE
}; };
/* panel (notebook page) identifiers */ /* panel (notebook page) identifiers */
......
...@@ -118,6 +118,8 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( GERBVIEW_FRAME* parent ) ...@@ -118,6 +118,8 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( GERBVIEW_FRAME* parent )
{ {
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
} }
m_buttonPrint->SetDefault();
} }
......
...@@ -51,6 +51,7 @@ DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( GERBVIEW_FRAME *parent) : ...@@ -51,6 +51,7 @@ DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( GERBVIEW_FRAME *parent) :
GetSizer()->Fit( this ); GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Center(); Center();
m_sdbSizer1OK->SetDefault();
} }
......
...@@ -159,13 +159,16 @@ public: ...@@ -159,13 +159,16 @@ public:
wxString* m_Pt_param; ///< Pointer to the parameter value wxString* m_Pt_param; ///< Pointer to the parameter value
wxString m_default; ///< The default value of the parameter wxString m_default; ///< The default value of the parameter
public: PARAM_CFG_WXSTRING( const wxChar* ident, wxString* ptparam, const wxChar* group = NULL ); public:
PARAM_CFG_WXSTRING( const wxChar* ident, wxString* ptparam, const wxChar* group = NULL );
PARAM_CFG_WXSTRING( bool Insetup, PARAM_CFG_WXSTRING( bool Insetup,
const wxChar* ident, const wxChar* ident,
wxString* ptparam, wxString* ptparam,
const wxString& default_val = wxEmptyString, const wxString& default_val = wxEmptyString,
const wxChar* group = NULL ); const wxChar* group = NULL );
virtual ~PARAM_CFG_WXSTRING() {}
virtual void ReadParam( wxConfigBase* aConfig ); virtual void ReadParam( wxConfigBase* aConfig );
virtual void SaveParam( wxConfigBase* aConfig ); virtual void SaveParam( wxConfigBase* aConfig );
}; };
......
...@@ -55,11 +55,11 @@ END_EVENT_TABLE() ...@@ -55,11 +55,11 @@ END_EVENT_TABLE()
PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* father, PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* father,
int idtype, int idtype,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, const wxSize& size,
long style) : long style) :
EDA_DRAW_FRAME( father, idtype, title, pos, size, style ) EDA_DRAW_FRAME( father, idtype, title, pos, size, style )
{ {
m_InternalUnits = PCB_INTERNAL_UNIT; // Internal unit = 1/10000 inch m_InternalUnits = PCB_INTERNAL_UNIT; // Internal unit = 1/10000 inch
......
...@@ -47,6 +47,7 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) : ...@@ -47,6 +47,7 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) :
initDialog( ); initDialog( );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
m_buttonBoard->SetDefault();
} }
......
...@@ -16,6 +16,7 @@ DIALOG_CLEANING_OPTIONS::DIALOG_CLEANING_OPTIONS( wxWindow* parent ): ...@@ -16,6 +16,7 @@ DIALOG_CLEANING_OPTIONS::DIALOG_CLEANING_OPTIONS( wxWindow* parent ):
m_deleteUnconnectedOpt->SetValue( deleteUnconnectedSegm ); m_deleteUnconnectedOpt->SetValue( deleteUnconnectedSegm );
m_reconnectToPadsOpt->SetValue( connectToPads ); m_reconnectToPadsOpt->SetValue( connectToPads );
m_sdbSizerOK->SetDefault();
GetSizer()->SetSizeHints(this); GetSizer()->SetSizeHints(this);
Centre(); Centre();
} }
......
...@@ -25,15 +25,14 @@ void PCB_EDIT_FRAME::InstallDisplayOptionsDialog( wxCommandEvent& aEvent ) ...@@ -25,15 +25,14 @@ void PCB_EDIT_FRAME::InstallDisplayOptionsDialog( wxCommandEvent& aEvent )
} }
/*******************************************************************************/
DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( PCB_EDIT_FRAME* parent ) : DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( PCB_EDIT_FRAME* parent ) :
DIALOG_DISPLAY_OPTIONS_BASE(parent) DIALOG_DISPLAY_OPTIONS_BASE( parent )
/*******************************************************************************/
{ {
m_Parent = parent; m_Parent = parent;
init(); init();
m_buttonOK->SetDefault();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
} }
......
...@@ -30,6 +30,7 @@ DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR( PCB_EDIT_FRAME* aParent ...@@ -30,6 +30,7 @@ DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR( PCB_EDIT_FRAME* aParent
InitModeditProperties(); InitModeditProperties();
InitBoardProperties(); InitBoardProperties();
m_sdbSizerStdButtonsOK->SetDefault();
GetSizer()->Fit( this ); GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
......
...@@ -16,16 +16,16 @@ ...@@ -16,16 +16,16 @@
#include "module_editor_frame.h" #include "module_editor_frame.h"
#include "dialog_edit_module_for_Modedit.h" #include "dialog_edit_module_for_Modedit.h"
/**************************************************************************************/
DIALOG_MODULE_MODULE_EDITOR::DIALOG_MODULE_MODULE_EDITOR( WinEDA_ModuleEditFrame* aParent, DIALOG_MODULE_MODULE_EDITOR::DIALOG_MODULE_MODULE_EDITOR( WinEDA_ModuleEditFrame* aParent,
MODULE* aModule ) : MODULE* aModule ) :
DIALOG_MODULE_MODULE_EDITOR_BASE( aParent ) DIALOG_MODULE_MODULE_EDITOR_BASE( aParent )
/**************************************************************************************/
{ {
m_Parent = aParent; m_Parent = aParent;
m_CurrentModule = aModule; m_CurrentModule = aModule;
SetIcon( wxICON( icon_modedit ) ); // Give an icon SetIcon( wxICON( icon_modedit ) ); // Give an icon
InitModeditProperties(); InitModeditProperties();
m_sdbSizerStdButtonsOK->SetDefault();
GetSizer()->Fit( this ); GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
......
...@@ -58,10 +58,13 @@ DialogEditModuleText::DialogEditModuleText( PCB_BASE_FRAME* parent, ...@@ -58,10 +58,13 @@ DialogEditModuleText::DialogEditModuleText( PCB_BASE_FRAME* parent,
m_DC = DC; m_DC = DC;
m_Module = NULL; m_Module = NULL;
m_CurrentTextMod = TextMod; m_CurrentTextMod = TextMod;
if( m_CurrentTextMod ) if( m_CurrentTextMod )
m_Module = (MODULE*) m_CurrentTextMod->GetParent(); m_Module = (MODULE*) m_CurrentTextMod->GetParent();
Init( ); Init( );
m_buttonOK->SetDefault();
GetSizer()->Fit( this ); GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
} }
......
...@@ -37,6 +37,7 @@ DIALOG_FREEROUTE::DIALOG_FREEROUTE( PCB_EDIT_FRAME* parent ): ...@@ -37,6 +37,7 @@ DIALOG_FREEROUTE::DIALOG_FREEROUTE( PCB_EDIT_FRAME* parent ):
m_Parent = parent; m_Parent = parent;
MyInit(); MyInit();
m_sdbSizer1OK->SetDefault();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
} }
......
...@@ -25,6 +25,7 @@ Dialog_GeneralOptions::Dialog_GeneralOptions( PCB_EDIT_FRAME* parent ) : ...@@ -25,6 +25,7 @@ Dialog_GeneralOptions::Dialog_GeneralOptions( PCB_EDIT_FRAME* parent ) :
m_Parent = parent; m_Parent = parent;
init(); init();
m_buttonOK->SetDefault();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Center(); Center();
} }
......
...@@ -43,6 +43,7 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS::DIALOG_GRAPHIC_ITEMS_OPTIONS( PCB_BASE_FRAME* pare ...@@ -43,6 +43,7 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS::DIALOG_GRAPHIC_ITEMS_OPTIONS( PCB_BASE_FRAME* pare
m_BrdSettings = m_Parent->GetBoard()->GetBoardDesignSettings(); m_BrdSettings = m_Parent->GetBoard()->GetBoardDesignSettings();
initValues( ); initValues( );
m_sdbSizer1OK->SetDefault();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
......
...@@ -29,6 +29,7 @@ DIALOG_PADS_MASK_CLEARANCE::DIALOG_PADS_MASK_CLEARANCE( PCB_EDIT_FRAME* parent ) ...@@ -29,6 +29,7 @@ DIALOG_PADS_MASK_CLEARANCE::DIALOG_PADS_MASK_CLEARANCE( PCB_EDIT_FRAME* parent )
m_BrdSettings = m_Parent->GetBoard()->GetBoardDesignSettings(); m_BrdSettings = m_Parent->GetBoard()->GetBoardDesignSettings();
MyInit(); MyInit();
m_sdbButtonsSizerOK->SetDefault();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
} }
......
...@@ -157,6 +157,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* parent, D_PAD* Pad ...@@ -157,6 +157,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* parent, D_PAD* Pad
initValues(); initValues();
m_sdbSizer1OK->SetDefault();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Center(); Center();
m_canUpdate = true; m_canUpdate = true;
......
...@@ -53,6 +53,7 @@ DIALOG_PCB_TEXT_PROPERTIES::DIALOG_PCB_TEXT_PROPERTIES( PCB_EDIT_FRAME* parent, ...@@ -53,6 +53,7 @@ DIALOG_PCB_TEXT_PROPERTIES::DIALOG_PCB_TEXT_PROPERTIES( PCB_EDIT_FRAME* parent,
m_SelectedPCBText = passedTextPCB; m_SelectedPCBText = passedTextPCB;
MyInit(); MyInit();
m_StandardSizerOK->SetDefault();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
} }
......
...@@ -40,9 +40,10 @@ DIALOG_PCBNEW_CONFIG_LIBS::DIALOG_PCBNEW_CONFIG_LIBS( PCB_EDIT_FRAME* parent ): ...@@ -40,9 +40,10 @@ DIALOG_PCBNEW_CONFIG_LIBS::DIALOG_PCBNEW_CONFIG_LIBS( PCB_EDIT_FRAME* parent ):
wxString title = _( "from " ) + wxGetApp().m_CurrentOptionFile; wxString title = _( "from " ) + wxGetApp().m_CurrentOptionFile;
SetTitle( title ); SetTitle( title );
m_sdbSizer1OK->SetDefault();
if( GetSizer() ) if( GetSizer() )
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
} }
/*************************************/ /*************************************/
......
...@@ -89,6 +89,7 @@ DIALOG_PRINT_FOR_MODEDIT::DIALOG_PRINT_FOR_MODEDIT( EDA_DRAW_FRAME* parent ) : ...@@ -89,6 +89,7 @@ DIALOG_PRINT_FOR_MODEDIT::DIALOG_PRINT_FOR_MODEDIT( EDA_DRAW_FRAME* parent ) :
m_Config = wxGetApp().m_EDA_Config; m_Config = wxGetApp().m_EDA_Config;
InitValues(); InitValues();
m_buttonPrint->SetDefault();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Center(); Center();
} }
......
...@@ -258,20 +258,23 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( PCB_BASE_FRAME* parent ) : ...@@ -258,20 +258,23 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( PCB_BASE_FRAME* parent ) :
m_Parent = parent; m_Parent = parent;
PCB_SCREEN* screen = (PCB_SCREEN*) m_Parent->GetScreen(); PCB_SCREEN* screen = (PCB_SCREEN*) m_Parent->GetScreen();
int Masque_Layer = int Masque_Layer = g_TabAllCopperLayerMask[board->GetCopperLayerCount() - 1];
g_TabAllCopperLayerMask[board->GetCopperLayerCount() - 1];
Masque_Layer += ALL_NO_CU_LAYERS; Masque_Layer += ALL_NO_CU_LAYERS;
for( ii = 0, LayerCount = 0; ii < NB_COPPER_LAYERS; ii++ ) for( ii = 0, LayerCount = 0; ii < NB_COPPER_LAYERS; ii++ )
{ {
m_LayerId[ii] = 0; m_LayerId[ii] = 0;
if( (g_TabOneLayerMask[ii] & Masque_Layer) ) if( (g_TabOneLayerMask[ii] & Masque_Layer) )
{ {
LayerList[LayerCount] = board->GetLayerName( ii ); LayerList[LayerCount] = board->GetLayerName( ii );
if( ii == screen->m_Route_Layer_TOP ) if( ii == screen->m_Route_Layer_TOP )
LayerTopSelect = LayerCount; LayerTopSelect = LayerCount;
if( ii == screen->m_Route_Layer_BOTTOM ) if( ii == screen->m_Route_Layer_BOTTOM )
LayerBottomSelect = LayerCount; LayerBottomSelect = LayerCount;
m_LayerId[LayerCount] = ii; m_LayerId[LayerCount] = ii;
LayerCount++; LayerCount++;
} }
...@@ -306,6 +309,7 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( PCB_BASE_FRAME* parent ) : ...@@ -306,6 +309,7 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( PCB_BASE_FRAME* parent ) :
RadioBoxSizer->Add( m_LayerListBOTTOM, 0, wxALIGN_TOP | wxALL, 5 ); RadioBoxSizer->Add( m_LayerListBOTTOM, 0, wxALIGN_TOP | wxALL, 5 );
Button = new wxButton( this, wxID_OK, _( "OK" ) ); Button = new wxButton( this, wxID_OK, _( "OK" ) );
Button->SetDefault();
ButtonBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); ButtonBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) ); Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) );
...@@ -323,16 +327,14 @@ void WinEDA_SelLayerPairFrame::OnOkClick( wxCommandEvent& event ) ...@@ -323,16 +327,14 @@ void WinEDA_SelLayerPairFrame::OnOkClick( wxCommandEvent& event )
// select the same layer for top and bottom is allowed (normal in some // select the same layer for top and bottom is allowed (normal in some
// boards) // boards)
// but could be a mistake. So display an info message // but could be a mistake. So display an info message
if( m_LayerId[m_LayerListTOP->GetSelection()] if( m_LayerId[m_LayerListTOP->GetSelection()] == m_LayerId[m_LayerListBOTTOM->GetSelection()] )
== m_LayerId[m_LayerListBOTTOM->GetSelection()] )
DisplayInfoMessage( this, DisplayInfoMessage( this,
_( "Warning: The Top Layer and Bottom Layer are same." ) ); _( "Warning: The Top Layer and Bottom Layer are same." ) );
PCB_SCREEN* screen = (PCB_SCREEN*) m_Parent->GetScreen(); PCB_SCREEN* screen = (PCB_SCREEN*) m_Parent->GetScreen();
screen->m_Route_Layer_TOP = m_LayerId[m_LayerListTOP->GetSelection()]; screen->m_Route_Layer_TOP = m_LayerId[m_LayerListTOP->GetSelection()];
screen->m_Route_Layer_BOTTOM = screen->m_Route_Layer_BOTTOM = m_LayerId[m_LayerListBOTTOM->GetSelection()];
m_LayerId[m_LayerListBOTTOM->GetSelection()];
EndModal( 0 ); EndModal( 0 );
} }
......
...@@ -70,6 +70,7 @@ DIALOG_SET_GRID::DIALOG_SET_GRID( wxWindow* parent, const wxPoint& pos ) : ...@@ -70,6 +70,7 @@ DIALOG_SET_GRID::DIALOG_SET_GRID( wxWindow* parent, const wxPoint& pos ) :
m_TextPosXUnits->SetLabel( GetUnitsLabel( g_UserUnit ) ); m_TextPosXUnits->SetLabel( GetUnitsLabel( g_UserUnit ) );
m_TextPosYUnits->SetLabel( GetUnitsLabel( g_UserUnit ) ); m_TextPosYUnits->SetLabel( GetUnitsLabel( g_UserUnit ) );
m_sdbSizer1OK->SetDefault();
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Centre(); Centre();
} }
......
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