From 283cfa67ff84e1bbe3fd693445fe9b8f8d39e475 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Mon, 14 Mar 2011 11:17:18 -0400 Subject: [PATCH] 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. --- common/dialogs/dialog_hotkeys_editor.cpp | 3 +- common/dialogs/dialog_page_settings.cpp | 144 +- common/dialogs/dialog_page_settings_base.fbp | 1792 ++++++++--------- cvpcb/dialogs/dialog_cvpcb_config.cpp | 3 + .../dialogs/dialog_eeschema_options_base.cpp | 8 +- .../dialogs/dialog_eeschema_options_base.fbp | 10 +- eeschema/dialogs/dialog_lib_edit_pin.cpp | 31 +- .../dialogs/dialog_plot_schematic_DXF.cpp | 1 + .../dialogs/dialog_plot_schematic_HPGL.cpp | 1 + eeschema/dialogs/dialog_plot_schematic_PS.cpp | 1 + .../dialogs/dialog_plot_schematic_PS_base.cpp | 2 +- .../dialogs/dialog_plot_schematic_PS_base.fbp | 2 +- eeschema/netlist_control.cpp | 187 +- eeschema/netlist_control.h | 3 +- .../dialogs/dialog_print_using_printer.cpp | 2 + .../gerbview_dialog_display_options_frame.cpp | 1 + include/param_config.h | 5 +- pcbnew/basepcbframe.cpp | 10 +- pcbnew/dialogs/dialog_SVG_print.cpp | 1 + pcbnew/dialogs/dialog_cleaning_options.cpp | 1 + pcbnew/dialogs/dialog_display_options.cpp | 5 +- .../dialog_edit_module_for_BoardEditor.cpp | 1 + .../dialog_edit_module_for_Modedit.cpp | 4 +- pcbnew/dialogs/dialog_edit_module_text.cpp | 3 + pcbnew/dialogs/dialog_freeroute_exchange.cpp | 1 + pcbnew/dialogs/dialog_general_options.cpp | 1 + .../dialogs/dialog_graphic_items_options.cpp | 1 + pcbnew/dialogs/dialog_mask_clearance.cpp | 1 + pcbnew/dialogs/dialog_pad_properties.cpp | 1 + pcbnew/dialogs/dialog_pcb_text_properties.cpp | 1 + .../dialog_pcbnew_config_libs_and_paths.cpp | 3 +- pcbnew/dialogs/dialog_print_for_modedit.cpp | 1 + pcbnew/sel_layer.cpp | 14 +- pcbnew/set_grid.cpp | 1 + 34 files changed, 1127 insertions(+), 1119 deletions(-) diff --git a/common/dialogs/dialog_hotkeys_editor.cpp b/common/dialogs/dialog_hotkeys_editor.cpp index e95dfc7ff7..1af057eb1e 100644 --- a/common/dialogs/dialog_hotkeys_editor.cpp +++ b/common/dialogs/dialog_hotkeys_editor.cpp @@ -66,7 +66,8 @@ HOTKEYS_EDITOR_DIALOG::HOTKEYS_EDITOR_DIALOG( EDA_DRAW_FRAME* pa m_hotkeyGrid->SetReadOnly( i, 1, true ); } - SetFocus(); + m_OKButton->SetDefault(); + m_hotkeyGrid->SetFocus(); GetSizer()->SetSizeHints( this ); Center(); } diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index 9a1fc70f0f..14262ccb61 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -24,47 +24,45 @@ #include "dialog_page_settings.h" #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_A, &g_Sheet_B, &g_Sheet_C, &g_Sheet_D, &g_Sheet_E, + &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_user, NULL }; - -/******************************************************************/ -void EDA_DRAW_FRAME::Process_PageSettings(wxCommandEvent& event) -/******************************************************************/ -/* Creation de la fenetre de configuration - */ +void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event ) { - DIALOG_PAGES_SETTINGS frame(this); + DIALOG_PAGES_SETTINGS frame( this ); int diag = frame.ShowModal(); - if ( DrawPanel && diag ) + + if( DrawPanel && diag ) 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 ) { - m_Parent = parent; - m_Screen = m_Parent->GetScreen(); + m_Parent = parent; + m_Screen = m_Parent->GetScreen(); m_Modified = 0; - m_SelectedSheet = NULL; + m_SelectedSheet = NULL; m_CurrentSelection = 0; - initDialog( ); + initDialog(); - GetSizer()->SetSizeHints(this); + GetSizer()->SetSizeHints( this ); Centre(); } + DIALOG_PAGES_SETTINGS::~DIALOG_PAGES_SETTINGS() { } + void DIALOG_PAGES_SETTINGS::initDialog() { wxString msg; @@ -74,17 +72,17 @@ void DIALOG_PAGES_SETTINGS::initDialog() // Init display value for sheet User size wxString format = m_TextSheetCount->GetLabel(); - msg.Printf(format, m_Screen->m_NumberOfScreen); - m_TextSheetCount->SetLabel(msg); + msg.Printf( format, m_Screen->m_NumberOfScreen ); + m_TextSheetCount->SetLabel( msg ); format = m_TextSheetNumber->GetLabel(); - msg.Printf(format, m_Screen->m_ScreenNumber); - m_TextSheetNumber->SetLabel(msg); + msg.Printf( format, m_Screen->m_ScreenNumber ); + m_TextSheetNumber->SetLabel( msg ); switch( g_UserUnit ) { case MILLIMETRES: - UserSizeX = (double) g_Sheet_user.m_Size.x * 25.4 / 1000; - UserSizeY = (double) g_Sheet_user.m_Size.y * 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; msg.Printf( wxT( "%.2f" ), UserSizeX ); m_TextUserSizeX->SetValue( msg ); msg.Printf( wxT( "%.2f" ), UserSizeY ); @@ -92,8 +90,8 @@ void DIALOG_PAGES_SETTINGS::initDialog() break; case INCHES: - UserSizeX = (double) g_Sheet_user.m_Size.x / 1000; - UserSizeY = (double) g_Sheet_user.m_Size.y / 1000; + UserSizeX = (double) g_Sheet_user.m_Size.x / 1000; + UserSizeY = (double) g_Sheet_user.m_Size.y / 1000; msg.Printf( wxT( "%.3f" ), UserSizeX ); m_TextUserSizeX->SetValue( msg ); msg.Printf( wxT( "%.3f" ), UserSizeY ); @@ -101,8 +99,8 @@ void DIALOG_PAGES_SETTINGS::initDialog() break; case UNSCALED_UNITS: - UserSizeX = g_Sheet_user.m_Size.x; - UserSizeY = g_Sheet_user.m_Size.y; + UserSizeX = g_Sheet_user.m_Size.x; + UserSizeY = g_Sheet_user.m_Size.y; msg.Printf( wxT( "%f" ), UserSizeX ); m_TextUserSizeX->SetValue( msg ); msg.Printf( wxT( "%f" ), UserSizeY ); @@ -111,24 +109,27 @@ void DIALOG_PAGES_SETTINGS::initDialog() } // Set validators - m_PageSizeBox->SetValidator( wxGenericValidator(& m_CurrentSelection) ); - m_TextRevision->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Revision) ); - m_TextTitle->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Title) ); - m_TextCompany->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Company) ); - m_TextComment1->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Commentaire1) ); - m_TextComment2->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Commentaire2) ); - m_TextComment3->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Commentaire3) ); - m_TextComment4->SetValidator( wxTextValidator(wxFILTER_NONE, & m_Screen->m_Commentaire4) ); + m_PageSizeBox->SetValidator( wxGenericValidator( &m_CurrentSelection ) ); + m_TextRevision->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Revision ) ); + m_TextTitle->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Title ) ); + m_TextCompany->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Company ) ); + m_TextComment1->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Commentaire1 ) ); + m_TextComment2->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Commentaire2 ) ); + m_TextComment3->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Commentaire3 ) ); + m_TextComment4->SetValidator( wxTextValidator( wxFILTER_NONE, &m_Screen->m_Commentaire4 ) ); #ifndef EESCHEMA - m_RevisionExport->Show(false); - m_TitleExport->Show(false); - m_CompanyExport->Show(false); - m_Comment1Export->Show(false); - m_Comment2Export->Show(false); - m_Comment3Export->Show(false); - m_Comment4Export->Show(false); + m_RevisionExport->Show( false ); + m_TitleExport->Show( false ); + m_CompanyExport->Show( false ); + m_Comment1Export->Show( false ); + m_Comment2Export->Show( false ); + m_Comment3Export->Show( false ); + m_Comment4Export->Show( false ); #endif + + // Make the OK button the default. + m_sdbSizer1OK->SetDefault(); } @@ -150,7 +151,7 @@ void DIALOG_PAGES_SETTINGS::OnOkClick( wxCommandEvent& event ) { SavePageSettings( event ); m_Modified = 1; - Close( TRUE ); + Close( true ); } @@ -160,32 +161,28 @@ void DIALOG_PAGES_SETTINGS::OnOkClick( wxCommandEvent& event ) void DIALOG_PAGES_SETTINGS::OnCancelClick( wxCommandEvent& event ) { - Close( TRUE ); + Close( true ); } -/*****************************************************************/ -void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event) -/*****************************************************************/ -/* Mise a jour effective des textes et dimensions - */ +void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event ) { - double dtmp; - wxString msg; + double dtmp; + wxString msg; - m_Screen->m_Revision = m_TextRevision->GetValue(); - m_Screen->m_Company = m_TextCompany->GetValue(); - m_Screen->m_Title = m_TextTitle->GetValue(); - m_Screen->m_Commentaire1 = m_TextComment1->GetValue(); - m_Screen->m_Commentaire2 = m_TextComment2->GetValue(); - m_Screen->m_Commentaire3 = m_TextComment3->GetValue(); - m_Screen->m_Commentaire4 = m_TextComment4->GetValue(); + m_Screen->m_Revision = m_TextRevision->GetValue(); + m_Screen->m_Company = m_TextCompany->GetValue(); + m_Screen->m_Title = m_TextTitle->GetValue(); + m_Screen->m_Commentaire1 = m_TextComment1->GetValue(); + m_Screen->m_Commentaire2 = m_TextComment2->GetValue(); + m_Screen->m_Commentaire3 = m_TextComment3->GetValue(); + m_Screen->m_Commentaire4 = m_TextComment4->GetValue(); msg = m_TextUserSizeX->GetValue(); - msg.ToDouble(&dtmp); + msg.ToDouble( &dtmp ); UserSizeX = dtmp; msg = m_TextUserSizeY->GetValue(); - msg.ToDouble(&dtmp); + msg.ToDouble( &dtmp ); UserSizeY = dtmp; int ii = m_PageSizeBox->GetSelection(); @@ -199,18 +196,18 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event) switch( g_UserUnit ) { case MILLIMETRES: - 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.x = (int) ( UserSizeX * 1000 / 25.4 ); + g_Sheet_user.m_Size.y = (int) ( UserSizeY * 1000 / 25.4 ); break; case INCHES: - g_Sheet_user.m_Size.x = (int) ( UserSizeX * 1000 ); - g_Sheet_user.m_Size.y = (int) ( UserSizeY * 1000 ); + g_Sheet_user.m_Size.x = (int) ( UserSizeX * 1000 ); + g_Sheet_user.m_Size.y = (int) ( UserSizeY * 1000 ); break; case UNSCALED_UNITS: - g_Sheet_user.m_Size.x = (int) ( UserSizeX ); - g_Sheet_user.m_Size.y = (int) ( UserSizeY ); + g_Sheet_user.m_Size.x = (int) ( UserSizeX ); + g_Sheet_user.m_Size.y = (int) ( UserSizeY ); break; } @@ -228,9 +225,11 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event) #ifdef EESCHEMA /* Exports settings to other sheets if requested: */ - SCH_SCREEN * screen; + SCH_SCREEN* screen; + /* Build the screen list */ SCH_SCREENS ScreenList; + /* Update the datas */ for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() ) { @@ -241,7 +240,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event) screen->m_Revision = m_Screen->m_Revision; if( m_TitleExport->IsChecked() ) - screen->m_Title =m_Screen->m_Title; + screen->m_Title = m_Screen->m_Title; if( m_CompanyExport->IsChecked() ) screen->m_Company = m_Screen->m_Company; @@ -258,6 +257,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event) if( m_Comment4Export->IsChecked() ) screen->m_Commentaire4 = m_Screen->m_Commentaire4; } + #endif m_Screen->SetModify(); @@ -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 * according to the current page size */ +void DIALOG_PAGES_SETTINGS::SearchPageSizeSelection() { - Ki_PageDescr * sheet; - int ii; + Ki_PageDescr* sheet; + int ii; m_CurrentSelection = NB_ITEMS - 1; diff --git a/common/dialogs/dialog_page_settings_base.fbp b/common/dialogs/dialog_page_settings_base.fbp index f6420eb497..b3b4cb5c9b 100644 --- a/common/dialogs/dialog_page_settings_base.fbp +++ b/common/dialogs/dialog_page_settings_base.fbp @@ -1,8 +1,8 @@ - + - + C++ 1 UTF-8 @@ -12,66 +12,66 @@ none 1 dialog_page_settings_base - + . - + 1 0 0 - - - + + + 1 - - - + + + 0 wxID_ANY - - + + DIALOG_PAGES_SETTINGS_BASE - + 439,497 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + Page Settings - - - - - - - + + + + + + + OnCloseWindow - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + bMainSizer wxVERTICAL none @@ -80,7 +80,7 @@ wxEXPAND 1 - + bUpperSizerH wxHORIZONTAL none @@ -91,10 +91,10 @@ 1 wxBOTH - + 1,3,4,5 0 - + LeftColumnSizer wxFLEX_GROWMODE_SPECIFIED none @@ -105,53 +105,53 @@ wxALL|wxEXPAND 0 - + "Size A4" "Size A3" "Size A2" "Size A1" "Size A0" "Size A" "Size B" "Size C" "Size D" "Size E" "User size" - + 1 - - + + 0 wxID_ANY Page Size: 1 - - + + m_PageSizeBox protected - + 1 - + wxRA_SPECIFY_COLS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -169,7 +169,7 @@ wxEXPAND 1 - + bSizerXsize wxVERTICAL none @@ -178,50 +178,50 @@ wxTOP|wxRIGHT|wxLEFT 0 - - + + 1 - - + + 0 wxID_ANY User Page Size X: - - + + UserPageSizeX protected - - - - - - - - + + + + + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -229,54 +229,54 @@ wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 - - + + 0 ID_TEXTCTRL_USER_PAGE_SIZE_X - + 0 - + m_TextUserSizeX protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnTextctrlUserPageSizeXTextUpdated - - - - + + + + @@ -286,7 +286,7 @@ wxEXPAND 1 - + bSizerYsize wxVERTICAL none @@ -295,50 +295,50 @@ wxTOP|wxRIGHT|wxLEFT 0 - - + + 1 - - + + 0 wxID_ANY User Page Size Y: - - + + UserPageSizeY protected - - - - - - - - + + + + + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -346,54 +346,54 @@ wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 - - + + 0 ID_TEXTCTRL_USER_PAGE_SIZE_Y - + 0 - + m_TextUserSizeY protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnTextctrlUserPageSizeYTextUpdated - - - - + + + + @@ -430,7 +430,7 @@ 0 0,1,2,3,4,5,6,7 0 - + RightColumnSizer wxFLEX_GROWMODE_SPECIFIED none @@ -438,10 +438,10 @@ 0 5 - + 1 - + SheetInfoSizer wxHORIZONTAL none @@ -450,50 +450,50 @@ wxALL 0 - - + + 1 - - + + 0 wxID_ANY Number of sheets: %d - - + + m_TextSheetCount protected - - - - - - - - + + + + + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -511,50 +511,50 @@ wxALL 0 - - + + 1 - - + + 0 wxID_ANY Sheet number: %d - - + + m_TextSheetNumber protected - - - - - - - - + + + + + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -566,64 +566,64 @@ wxID_ANY Revision: - + RevisionSizer wxHORIZONTAL none - + 5 wxBOTTOM|wxRIGHT|wxLEFT 0 - - + + 1 - - + + 0 ID_TEXTCTRL_REVISION - + 0 100,-1 m_TextRevision protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -631,51 +631,51 @@ wxALL 0 - + 0 - + 1 - - + + 0 ID_CHECKBOX_REVISION Export to other sheets - - + + m_RevisionExport protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -687,64 +687,64 @@ wxID_ANY Title: - + TitleSizer wxHORIZONTAL none - + 5 wxBOTTOM|wxRIGHT|wxLEFT 1 - - + + 1 - - + + 0 ID_TEXTCTRL_TITLE - + 0 400,-1 m_TextTitle protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -752,51 +752,51 @@ wxALL 0 - + 0 - + 1 - - + + 0 wxID_ANY Export to other sheets - - + + m_TitleExport protected - - - - - - - - - + + + + + + + + + OnCheckboxTitleClick - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -808,64 +808,64 @@ wxID_ANY Company: - + CompanySizer wxHORIZONTAL none - + 5 wxBOTTOM|wxRIGHT|wxLEFT 1 - - + + 1 - - + + 0 ID_TEXTCTRL_COMPANY - + 0 400,-1 m_TextCompany protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -873,51 +873,51 @@ wxALL 0 - + 0 - + 1 - - + + 0 ID_CHECKBOX_COMPANY Export to other sheets - - + + m_CompanyExport protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -929,64 +929,64 @@ wxID_ANY Comment1: - + Comment1Sizer wxHORIZONTAL none - + 5 wxBOTTOM|wxRIGHT|wxLEFT 1 - - + + 1 - - + + 0 ID_TEXTCTRL_COMMENT1 - + 0 400,-1 m_TextComment1 protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -994,51 +994,51 @@ wxALL 0 - + 0 - + 1 - - + + 0 ID_CHECKBOX_COMMENT1 Export to other sheets - - + + m_Comment1Export protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1050,64 +1050,64 @@ wxID_ANY Comment2: - + Comment2Sizer wxHORIZONTAL none - + 5 wxBOTTOM|wxRIGHT|wxLEFT 1 - - + + 1 - - + + 0 ID_TEXTCTRL_COMMENT2 - + 0 400,-1 m_TextComment2 protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1115,51 +1115,51 @@ wxALL 0 - + 0 - + 1 - - + + 0 ID_CHECKBOX_COMMENT2 Export to other sheets - - + + m_Comment2Export protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1171,64 +1171,64 @@ wxID_ANY Comment3: - + Comment3Sizer wxHORIZONTAL none - + 5 wxBOTTOM|wxRIGHT|wxLEFT 1 - - + + 1 - - + + 0 ID_TEXTCTRL_COMMENT3 - + 0 400,-1 m_TextComment3 protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1236,51 +1236,51 @@ wxALL 0 - + 0 - + 1 - - + + 0 ID_CHECKBOX_COMMENT3 Export to other sheets - - + + m_Comment3Export protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1292,64 +1292,64 @@ wxID_ANY Comment4: - + Comment4Sizer wxHORIZONTAL none - + 5 wxBOTTOM|wxRIGHT|wxLEFT 1 - - + + 1 - - + + 0 ID_TEXTCTRL_COMMENT4 - + 0 400,-1 m_TextComment4 protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1357,51 +1357,51 @@ wxALL 0 - + 0 - + 1 - - + + 0 ID_CHECKBOX_COMMENT4 Export to other sheets - - + + m_Comment4Export protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1423,17 +1423,17 @@ 1 0 0 - + m_sdbSizer1 protected - + OnCancelClick - - - + + + OnOkClick - - + + diff --git a/cvpcb/dialogs/dialog_cvpcb_config.cpp b/cvpcb/dialogs/dialog_cvpcb_config.cpp index b49f65bbb0..2c1da867a9 100644 --- a/cvpcb/dialogs/dialog_cvpcb_config.cpp +++ b/cvpcb/dialogs/dialog_cvpcb_config.cpp @@ -32,10 +32,13 @@ DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( CVPCB_MAINFRAME* parent ) : Init( ); title = _( "Project file: " ) + fn.GetFullPath(); SetTitle( title ); + if( GetSizer() ) { GetSizer()->SetSizeHints( this ); } + + m_sdbSizer2OK->SetDefault(); } diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp index a4ee70b4ad..70b52e0f68 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.cpp +++ b/eeschema/dialogs/dialog_eeschema_options_base.cpp @@ -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 ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); wxBoxSizer* mainSizer; mainSizer = new wxBoxSizer( wxVERTICAL ); @@ -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_panel1 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panel1->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + wxBoxSizer* p1mainSizer; p1mainSizer = new wxBoxSizer( wxHORIZONTAL ); @@ -148,8 +151,9 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_panel1->SetSizer( p1mainSizer ); m_panel1->Layout(); 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->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); m_panel2->SetToolTip( _("User defined field names for schematic components. ") ); wxBoxSizer* bSizer6; @@ -236,7 +240,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_panel2->SetSizer( bSizer6 ); m_panel2->Layout(); 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 ); diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp index b241b1f699..b2e18f1c77 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.fbp +++ b/eeschema/dialogs/dialog_eeschema_options_base.fbp @@ -22,7 +22,7 @@ 1 0 - + wxSYS_COLOUR_BTNFACE wxBOTH 1 @@ -151,9 +151,9 @@ General Options - 1 + 0 - + wxSYS_COLOUR_BTNFACE 1 1 @@ -1649,9 +1649,9 @@ Template Field Names - 0 + 1 - + wxSYS_COLOUR_BTNFACE 1 1 diff --git a/eeschema/dialogs/dialog_lib_edit_pin.cpp b/eeschema/dialogs/dialog_lib_edit_pin.cpp index 49f814092c..f95b1bf33d 100644 --- a/eeschema/dialogs/dialog_lib_edit_pin.cpp +++ b/eeschema/dialogs/dialog_lib_edit_pin.cpp @@ -8,46 +8,43 @@ DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN( wxWindow* parent ) : { /* Required to make escape key work correctly in wxGTK. */ m_textName->SetFocus(); + m_sdbSizer1OK->SetDefault(); } 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 ) - m_choiceOrientation->Append(list[ii]); + m_choiceOrientation->Append( list[ii] ); else - m_choiceOrientation->Insert(list[ii], - wxBitmap(aBitmaps[ii]), ii); - } + m_choiceOrientation->Insert( list[ii], wxBitmap( aBitmaps[ii] ), ii ); + } } 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 ) - m_choiceElectricalType->Append(list[ii]); + m_choiceElectricalType->Append( list[ii] ); else - m_choiceElectricalType->Insert(list[ii], - wxBitmap(aBitmaps[ii]), ii); + m_choiceElectricalType->Insert( list[ii], wxBitmap( aBitmaps[ii] ), ii ); } } -void DIALOG_LIB_EDIT_PIN::SetStyleList( const wxArrayString& list, - const char *** aBitmaps ) +void DIALOG_LIB_EDIT_PIN::SetStyleList( const wxArrayString& list, const char*** aBitmaps ) { - for ( unsigned ii = 0; ii < list.GetCount( ); ii++ ) + for ( unsigned ii = 0; ii < list.GetCount(); ii++ ) { if( aBitmaps == NULL ) - m_choiceStyle->Append(list[ii]); + m_choiceStyle->Append( list[ii] ); else - m_choiceStyle->Insert(list[ii], - wxBitmap(aBitmaps[ii]), ii); + m_choiceStyle->Insert( list[ii], wxBitmap( aBitmaps[ii] ), ii ); } } diff --git a/eeschema/dialogs/dialog_plot_schematic_DXF.cpp b/eeschema/dialogs/dialog_plot_schematic_DXF.cpp index d4e45b8569..21c29fd4a8 100644 --- a/eeschema/dialogs/dialog_plot_schematic_DXF.cpp +++ b/eeschema/dialogs/dialog_plot_schematic_DXF.cpp @@ -90,6 +90,7 @@ DIALOG_PLOT_SCHEMATIC_DXF::DIALOG_PLOT_SCHEMATIC_DXF( SCH_EDIT_FRAME* parent ) GetSizer()->SetSizeHints( this ); Centre(); + m_buttonPlotAll->SetDefault(); } void DIALOG_PLOT_SCHEMATIC_DXF::initDlg() diff --git a/eeschema/dialogs/dialog_plot_schematic_HPGL.cpp b/eeschema/dialogs/dialog_plot_schematic_HPGL.cpp index e05ee24619..b7b35a27ec 100644 --- a/eeschema/dialogs/dialog_plot_schematic_HPGL.cpp +++ b/eeschema/dialogs/dialog_plot_schematic_HPGL.cpp @@ -125,6 +125,7 @@ DIALOG_PLOT_SCHEMATIC_HPGL::DIALOG_PLOT_SCHEMATIC_HPGL( SCH_EDIT_FRAME* parent ) GetSizer()->SetSizeHints( this ); Centre(); + m_buttonPlotAll->SetDefault(); } diff --git a/eeschema/dialogs/dialog_plot_schematic_PS.cpp b/eeschema/dialogs/dialog_plot_schematic_PS.cpp index 86a2cf0374..d5ba6930aa 100644 --- a/eeschema/dialogs/dialog_plot_schematic_PS.cpp +++ b/eeschema/dialogs/dialog_plot_schematic_PS.cpp @@ -97,6 +97,7 @@ DIALOG_PLOT_SCHEMATIC_PS::DIALOG_PLOT_SCHEMATIC_PS( SCH_EDIT_FRAME* parent ) : GetSizer()->SetSizeHints( this ); Centre(); + m_buttonPlotAll->SetDefault(); } diff --git a/eeschema/dialogs/dialog_plot_schematic_PS_base.cpp b/eeschema/dialogs/dialog_plot_schematic_PS_base.cpp index 0acabde520..cd25ba3e37 100644 --- a/eeschema/dialogs/dialog_plot_schematic_PS_base.cpp +++ b/eeschema/dialogs/dialog_plot_schematic_PS_base.cpp @@ -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 ); 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 ); bupperSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); diff --git a/eeschema/dialogs/dialog_plot_schematic_PS_base.fbp b/eeschema/dialogs/dialog_plot_schematic_PS_base.fbp index 032e0f3f0e..e13c9b66f8 100644 --- a/eeschema/dialogs/dialog_plot_schematic_PS_base.fbp +++ b/eeschema/dialogs/dialog_plot_schematic_PS_base.fbp @@ -435,7 +435,7 @@ 0 - wxID_ANY + wxID_CANCEL Close diff --git a/eeschema/netlist_control.cpp b/eeschema/netlist_control.cpp index c851deab8c..9173763ebb 100644 --- a/eeschema/netlist_control.cpp +++ b/eeschema/netlist_control.cpp @@ -86,11 +86,11 @@ END_EVENT_TABLE() * Used in Netlist format Dialog box creation */ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, - const wxString& title, - int id_NetType, - int idCheckBox, - int idCreateFile, - bool selected ) : + const wxString& title, + int id_NetType, + int idCheckBox, + int idCreateFile, + bool selected ) : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_SUNKEN ) { m_IdNetType = id_NetType; @@ -113,18 +113,14 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, m_RightOptionsBoxSizer = new wxBoxSizer( wxVERTICAL ); UpperBoxSizer->Add( m_LeftBoxSizer, 0, wxGROW | wxALL, 5 ); UpperBoxSizer->Add( m_RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); - UpperBoxSizer->Add( m_RightOptionsBoxSizer, - 0, - wxALIGN_CENTER_VERTICAL | wxALL, - 5 ); + UpperBoxSizer->Add( m_RightOptionsBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); if( idCheckBox ) { wxStaticText* text = new wxStaticText( this, -1, _( "Options:" ) ); m_LeftBoxSizer->Add( text, 0, wxGROW | wxALL, 5 ); - m_IsCurrentFormat = - new wxCheckBox( this, idCheckBox, _( "Default format" ) ); + m_IsCurrentFormat = new wxCheckBox( this, idCheckBox, _( "Default format" ) ); m_LeftBoxSizer->Add( m_IsCurrentFormat, 0, wxGROW | wxALL, 5 ); m_IsCurrentFormat->SetValue( selected ); } @@ -134,15 +130,16 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, if( idCreateFile ) { wxButton* Button; + if( idCreateFile == ID_SETUP_PLUGIN ) /* This is the "add plugin" panel */ Button = new wxButton( this, idCreateFile, _( "&Browse Plugin" ) ); else 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 ); + 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: * for panel plugins: added the "delete" button @@ -162,14 +159,9 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, } -/*************************************************************************************/ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : wxDialog( parent, -1, _( "Netlist" ), wxDefaultPosition, wxDefaultSize, DIALOG_STYLE | MAYBE_RESIZE_BORDER ) -/*************************************************************************************/ - -/* Constructor for the netlist generation dialog box - */ { int ii; @@ -184,8 +176,8 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : SetSizer( GeneralBoxSizer ); m_NoteBook = new wxNotebook( this, ID_NETLIST_NOTEBOOK, - wxDefaultPosition, wxDefaultSize, - wxNB_TOP ); // @todo: tabs on top are being hidden on linux + wxDefaultPosition, wxDefaultSize, + wxNB_TOP ); // @todo: tabs on top are being hidden on linux GeneralBoxSizer->Add( m_NoteBook, 0, wxGROW | wxALL, 5 ); @@ -194,29 +186,29 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : // Add Panel FORMAT PCBNEW m_PanelNetType[PANELPCBNEW] = new NETLIST_PAGE_DIALOG( m_NoteBook, - wxT( "Pcbnew" ), - NET_TYPE_PCBNEW, - ID_CURRENT_FORMAT_IS_DEFAULT, - ID_CREATE_NETLIST, - m_Parent->m_NetlistFormat == NET_TYPE_PCBNEW ); + wxT( "Pcbnew" ), + NET_TYPE_PCBNEW, + ID_CURRENT_FORMAT_IS_DEFAULT, + ID_CREATE_NETLIST, + m_Parent->m_NetlistFormat == NET_TYPE_PCBNEW ); // Add Panel FORMAT ORCADPCB2 m_PanelNetType[PANELORCADPCB2] = new NETLIST_PAGE_DIALOG( m_NoteBook, - wxT( "OrcadPCB2" ), - NET_TYPE_ORCADPCB2, - ID_CURRENT_FORMAT_IS_DEFAULT, - ID_CREATE_NETLIST, - m_Parent->m_NetlistFormat == NET_TYPE_ORCADPCB2 ); + wxT( "OrcadPCB2" ), + NET_TYPE_ORCADPCB2, + ID_CURRENT_FORMAT_IS_DEFAULT, + ID_CREATE_NETLIST, + m_Parent->m_NetlistFormat == NET_TYPE_ORCADPCB2 ); // Add Panel FORMAT CADSTAR m_PanelNetType[PANELCADSTAR] = new NETLIST_PAGE_DIALOG( m_NoteBook, - wxT( "CadStar" ), - NET_TYPE_CADSTAR, - ID_CURRENT_FORMAT_IS_DEFAULT, - ID_CREATE_NETLIST, - m_Parent->m_NetlistFormat == NET_TYPE_CADSTAR ); + wxT( "CadStar" ), + NET_TYPE_CADSTAR, + ID_CURRENT_FORMAT_IS_DEFAULT, + ID_CREATE_NETLIST, + m_Parent->m_NetlistFormat == NET_TYPE_CADSTAR ); // Add Panel spice InstallPageSpice(); @@ -231,26 +223,20 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : } -/*************************************************/ void NETLIST_DIALOG::InstallPageSpice() -/*************************************************/ - -/* Create the spice page - */ { - wxButton* Button; + wxButton* Button; NETLIST_PAGE_DIALOG* page; page = m_PanelNetType[PANELSPICE] = - new NETLIST_PAGE_DIALOG( m_NoteBook, - wxT( "Spice" ), - NET_TYPE_SPICE, - 0, 0, - m_Parent->m_NetlistFormat == NET_TYPE_SPICE ); + new NETLIST_PAGE_DIALOG( m_NoteBook, + wxT( "Spice" ), + NET_TYPE_SPICE, + 0, 0, + m_Parent->m_NetlistFormat == NET_TYPE_SPICE ); - page->m_IsCurrentFormat = - new wxCheckBox( page, ID_CURRENT_FORMAT_IS_DEFAULT, - _( "Default format" ) ); + page->m_IsCurrentFormat = new wxCheckBox( page, ID_CURRENT_FORMAT_IS_DEFAULT, + _( "Default format" ) ); page->m_IsCurrentFormat->SetValue( m_Parent->m_NetlistFormat == NET_TYPE_SPICE ); page->m_LeftBoxSizer->Add( page->m_IsCurrentFormat, 0, wxGROW | wxALL, 5 ); @@ -261,6 +247,7 @@ void NETLIST_DIALOG::InstallPageSpice() wxRA_SPECIFY_COLS ); if( !g_OptNetListUseNames ) m_UseNetNamesInNetlist->SetSelection( 1 ); + page->m_LeftBoxSizer->Add( m_UseNetNamesInNetlist, 0, wxGROW | wxALL, 5 ); page->m_CommandStringCtrl = new WinEDA_EnterText( page, @@ -272,6 +259,7 @@ void NETLIST_DIALOG::InstallPageSpice() // Add buttons Button = new wxButton( page, ID_CREATE_NETLIST, _( "Netlist" ) ); page->m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); + Button->SetDefault(); Button = new wxButton( page, ID_RUN_SIMULATOR, _( "&Run Simulator" ) ); page->m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); @@ -281,12 +269,9 @@ void NETLIST_DIALOG::InstallPageSpice() } -/*************************************************/ -void NETLIST_DIALOG::InstallCustomPages() -/*************************************************/ - /* create the pages for custom netlist format selection: */ +void NETLIST_DIALOG::InstallCustomPages() { bool selected; int ii, CustomCount; @@ -295,6 +280,7 @@ void NETLIST_DIALOG::InstallCustomPages() CustomCount = CUSTOMPANEL_COUNTMAX; previoustitle = wxT( "dummy_title" ); + for( ii = 0; ii < CustomCount; ii++ ) { title = ReturnUserNetlistTypeName( ii == 0 ? true : false ); @@ -311,20 +297,20 @@ void NETLIST_DIALOG::InstallCustomPages() CurrPage = m_PanelNetType[PANELCUSTOMBASE + ii] = new NETLIST_PAGE_DIALOG( m_NoteBook, - _( "Add Plugin" ), - NET_TYPE_CUSTOM1 + ii, - ID_CURRENT_FORMAT_IS_DEFAULT, - ID_SETUP_PLUGIN, - selected ); + _( "Add Plugin" ), + NET_TYPE_CUSTOM1 + ii, + ID_CURRENT_FORMAT_IS_DEFAULT, + ID_SETUP_PLUGIN, + selected ); else /* Install a plugin panel */ CurrPage = m_PanelNetType[PANELCUSTOMBASE + ii] = new NETLIST_PAGE_DIALOG( m_NoteBook, - title, - NET_TYPE_CUSTOM1 + ii, - ID_CURRENT_FORMAT_IS_DEFAULT, - ID_CREATE_NETLIST, - selected ); + title, + NET_TYPE_CUSTOM1 + ii, + ID_CURRENT_FORMAT_IS_DEFAULT, + ID_CREATE_NETLIST, + selected ); msg = CUSTOM_NETLIST_COMMAND; msg << ii + 1; @@ -361,13 +347,14 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event ) Mask, this, wxFD_OPEN, - TRUE + true ); if( FullFileName.IsEmpty() ) return; NETLIST_PAGE_DIALOG* CurrPage; CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); + if( CurrPage == NULL ) return; @@ -376,6 +363,7 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event ) wxString cmdLine; wxFileName fn( FullFileName ); wxString ext = fn.GetExt(); + if( ext == wxT("xsl" ) ) cmdLine.Printf(wxT("xsltproc -o \"%%O\" \"%s\" \"%%I\""), GetChars(FullFileName) ); else if( ext == wxT("exe" ) || ext.IsEmpty() ) @@ -389,68 +377,61 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event ) wxString title = CurrPage->m_TitleStringCtrl->GetValue(); if( title.IsEmpty() ) DisplayInfoMessage( this, - _( "Do not forget to choose a title for this \ -netlist control page" ) ); + _( "Do not forget to choose a title for this netlist control page" ) ); } -/*****************************************************************/ -void NETLIST_DIALOG::SelectNetlistType( wxCommandEvent& event ) -/*****************************************************************/ - /* Called when the check box "default format" is clicked */ +void NETLIST_DIALOG::SelectNetlistType( wxCommandEvent& event ) { int ii; NETLIST_PAGE_DIALOG* CurrPage; for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; 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(); + if( CurrPage == NULL ) return; m_Parent->m_NetlistFormat = CurrPage->m_IdNetType; - CurrPage->m_IsCurrentFormat->SetValue( TRUE ); + CurrPage->m_IsCurrentFormat->SetValue( true ); } -/***********************************************/ void NETLIST_DIALOG::NetlistUpdateOpt() -/***********************************************/ { int ii; - g_SimulatorCommandLine = - m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue(); + g_SimulatorCommandLine = m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue(); m_Parent->m_NetlistFormat = NET_TYPE_PCBNEW; for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ ) { if( m_PanelNetType[ii] == NULL ) 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; } - g_OptNetListUseNames = TRUE; // Used for pspice, gnucap + g_OptNetListUseNames = true; // Used for pspice, gnucap + if( m_UseNetNamesInNetlist->GetSelection() == 1 ) - g_OptNetListUseNames = FALSE; + g_OptNetListUseNames = false; } -/**********************************************************/ -void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event ) -/**********************************************************/ - /** * Function GenNetlist * Create the netlist file: * calculate the filename with the suitable extensions * and run the netlist creator */ +void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event ) { wxFileName fn; wxString fileWildcard; @@ -538,9 +519,11 @@ bool SCH_EDIT_FRAME::CreateNetlist( int aFormat, const wxString& aFullFileName, if( !IsOK( NULL, _( "Some items are not annotated\n\ Do you want to annotate schematic?" ) ) ) return false; + // Schematic must be annotated: call Annotate dialog: wxCommandEvent event; OnAnnotate( event ); + if( CheckAnnotate( NULL, 0 ) ) return false; } @@ -575,8 +558,8 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event ) wxString ExecFile, CommandLine; g_SimulatorCommandLine = m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue(); - g_SimulatorCommandLine.Trim( FALSE ); - g_SimulatorCommandLine.Trim( TRUE ); + g_SimulatorCommandLine.Trim( false ); + g_SimulatorCommandLine.Trim( true ); ExecFile = g_SimulatorCommandLine.BeforeFirst( ' ' ); CommandLine = g_SimulatorCommandLine.AfterFirst( ' ' ); @@ -597,14 +580,11 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event ) } -/*********************************************************/ -void NETLIST_DIALOG::WriteCurrentNetlistSetup( void ) -/*********************************************************/ - /** * Function WriteCurrentNetlistSetup * Write the current netlist options setup in the configuration */ +void NETLIST_DIALOG::WriteCurrentNetlistSetup( void ) { wxString msg, Command; wxConfig* config = wxGetApp().m_EDA_Config; @@ -615,13 +595,17 @@ void NETLIST_DIALOG::WriteCurrentNetlistSetup( void ) for( int ii = 0; ii < CUSTOMPANEL_COUNTMAX; ii++ ) { NETLIST_PAGE_DIALOG* CurrPage = m_PanelNetType[ii + PANELCUSTOMBASE]; + if( CurrPage == NULL ) break; + msg = wxT( "Custom" ); msg << ii + 1; + if( CurrPage->m_TitleStringCtrl ) { wxString title = CurrPage->m_TitleStringCtrl->GetValue(); + if( msg != title ) // Title has changed, Update config { msg = CUSTOM_NETLIST_TITLE; @@ -641,47 +625,42 @@ void NETLIST_DIALOG::WriteCurrentNetlistSetup( void ) } -/******************************************************************/ -void NETLIST_DIALOG::DeletePluginPanel( wxCommandEvent& event ) -/******************************************************************/ - /** * Function DeletePluginPanel * Remove a panel relative to a netlist plugin */ +void NETLIST_DIALOG::DeletePluginPanel( wxCommandEvent& event ) { - NETLIST_PAGE_DIALOG* CurrPage = - (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); + NETLIST_PAGE_DIALOG* CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); CurrPage->m_CommandStringCtrl->SetValue( wxEmptyString ); CurrPage->m_TitleStringCtrl->SetValue( wxEmptyString ); + if( CurrPage->m_IsCurrentFormat->IsChecked() ) { - CurrPage->m_IsCurrentFormat->SetValue( FALSE ); - m_PanelNetType[PANELPCBNEW]->m_IsCurrentFormat->SetValue( TRUE ); + CurrPage->m_IsCurrentFormat->SetValue( false ); + m_PanelNetType[PANELPCBNEW]->m_IsCurrentFormat->SetValue( true ); } + WriteCurrentNetlistSetup(); EndModal( NET_PLUGIN_CHANGE ); } -/******************************************************************/ -void NETLIST_DIALOG::ValidatePluginPanel( wxCommandEvent& event ) -/******************************************************************/ - /** * Function ValidatePluginPanel * Validate the panel info relative to a new netlist plugin */ +void NETLIST_DIALOG::ValidatePluginPanel( wxCommandEvent& event ) { - NETLIST_PAGE_DIALOG* CurrPage = - (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); + NETLIST_PAGE_DIALOG* CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); if( CurrPage->m_CommandStringCtrl->GetValue() == wxEmptyString ) { DisplayError( this, _( "Error. You must provide a command String" ) ); return; } + if( CurrPage->m_TitleStringCtrl->GetValue() == wxEmptyString ) { DisplayError( this, _( "Error. You must provide a Title" ) ); diff --git a/eeschema/netlist_control.h b/eeschema/netlist_control.h index 9dd382017f..d098fbbfd3 100644 --- a/eeschema/netlist_control.h +++ b/eeschema/netlist_control.h @@ -18,7 +18,8 @@ enum id_netlist { ID_SETUP_PLUGIN, ID_VALIDATE_PLUGIN, ID_DELETE_PLUGIN, - ID_NETLIST_NOTEBOOK + ID_NETLIST_NOTEBOOK, + ID_CHANGE_NOTEBOOK_PAGE }; /* panel (notebook page) identifiers */ diff --git a/gerbview/dialogs/dialog_print_using_printer.cpp b/gerbview/dialogs/dialog_print_using_printer.cpp index e0085473e5..cc0463de0b 100644 --- a/gerbview/dialogs/dialog_print_using_printer.cpp +++ b/gerbview/dialogs/dialog_print_using_printer.cpp @@ -118,6 +118,8 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( GERBVIEW_FRAME* parent ) { GetSizer()->SetSizeHints( this ); } + + m_buttonPrint->SetDefault(); } diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp b/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp index eaaf1b27b7..5850c77aa9 100644 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp +++ b/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp @@ -51,6 +51,7 @@ DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( GERBVIEW_FRAME *parent) : GetSizer()->Fit( this ); GetSizer()->SetSizeHints( this ); Center(); + m_sdbSizer1OK->SetDefault(); } diff --git a/include/param_config.h b/include/param_config.h index 484f20ddf7..c584e7b86c 100644 --- a/include/param_config.h +++ b/include/param_config.h @@ -159,13 +159,16 @@ public: wxString* m_Pt_param; ///< Pointer to the parameter value 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, const wxChar* ident, wxString* ptparam, const wxString& default_val = wxEmptyString, const wxChar* group = NULL ); + virtual ~PARAM_CFG_WXSTRING() {} + virtual void ReadParam( wxConfigBase* aConfig ); virtual void SaveParam( wxConfigBase* aConfig ); }; diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 4d7d2ddede..4890140ae6 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -55,11 +55,11 @@ END_EVENT_TABLE() PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* father, - int idtype, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) : + int idtype, + const wxString& title, + const wxPoint& pos, + const wxSize& size, + long style) : EDA_DRAW_FRAME( father, idtype, title, pos, size, style ) { m_InternalUnits = PCB_INTERNAL_UNIT; // Internal unit = 1/10000 inch diff --git a/pcbnew/dialogs/dialog_SVG_print.cpp b/pcbnew/dialogs/dialog_SVG_print.cpp index 109dbfee45..65d654f30a 100644 --- a/pcbnew/dialogs/dialog_SVG_print.cpp +++ b/pcbnew/dialogs/dialog_SVG_print.cpp @@ -47,6 +47,7 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) : initDialog( ); GetSizer()->SetSizeHints( this ); Centre(); + m_buttonBoard->SetDefault(); } diff --git a/pcbnew/dialogs/dialog_cleaning_options.cpp b/pcbnew/dialogs/dialog_cleaning_options.cpp index 0c504adef4..4b00c611b5 100644 --- a/pcbnew/dialogs/dialog_cleaning_options.cpp +++ b/pcbnew/dialogs/dialog_cleaning_options.cpp @@ -16,6 +16,7 @@ DIALOG_CLEANING_OPTIONS::DIALOG_CLEANING_OPTIONS( wxWindow* parent ): m_deleteUnconnectedOpt->SetValue( deleteUnconnectedSegm ); m_reconnectToPadsOpt->SetValue( connectToPads ); + m_sdbSizerOK->SetDefault(); GetSizer()->SetSizeHints(this); Centre(); } diff --git a/pcbnew/dialogs/dialog_display_options.cpp b/pcbnew/dialogs/dialog_display_options.cpp index 2b37746b3f..a957710384 100644 --- a/pcbnew/dialogs/dialog_display_options.cpp +++ b/pcbnew/dialogs/dialog_display_options.cpp @@ -25,15 +25,14 @@ void PCB_EDIT_FRAME::InstallDisplayOptionsDialog( wxCommandEvent& aEvent ) } -/*******************************************************************************/ DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( PCB_EDIT_FRAME* parent ) : - DIALOG_DISPLAY_OPTIONS_BASE(parent) -/*******************************************************************************/ + DIALOG_DISPLAY_OPTIONS_BASE( parent ) { m_Parent = parent; init(); + m_buttonOK->SetDefault(); GetSizer()->SetSizeHints( this ); } diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp index 3c0a882c9c..6353565729 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp +++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp @@ -30,6 +30,7 @@ DIALOG_MODULE_BOARD_EDITOR::DIALOG_MODULE_BOARD_EDITOR( PCB_EDIT_FRAME* aParent InitModeditProperties(); InitBoardProperties(); + m_sdbSizerStdButtonsOK->SetDefault(); GetSizer()->Fit( this ); GetSizer()->SetSizeHints( this ); Centre(); diff --git a/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp b/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp index 6b091f3e4d..1c3be5db3e 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp +++ b/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp @@ -16,16 +16,16 @@ #include "module_editor_frame.h" #include "dialog_edit_module_for_Modedit.h" -/**************************************************************************************/ + DIALOG_MODULE_MODULE_EDITOR::DIALOG_MODULE_MODULE_EDITOR( WinEDA_ModuleEditFrame* aParent, MODULE* aModule ) : DIALOG_MODULE_MODULE_EDITOR_BASE( aParent ) -/**************************************************************************************/ { m_Parent = aParent; m_CurrentModule = aModule; SetIcon( wxICON( icon_modedit ) ); // Give an icon InitModeditProperties(); + m_sdbSizerStdButtonsOK->SetDefault(); GetSizer()->Fit( this ); GetSizer()->SetSizeHints( this ); Centre(); diff --git a/pcbnew/dialogs/dialog_edit_module_text.cpp b/pcbnew/dialogs/dialog_edit_module_text.cpp index 692e46eca7..cc25de1bda 100644 --- a/pcbnew/dialogs/dialog_edit_module_text.cpp +++ b/pcbnew/dialogs/dialog_edit_module_text.cpp @@ -58,10 +58,13 @@ DialogEditModuleText::DialogEditModuleText( PCB_BASE_FRAME* parent, m_DC = DC; m_Module = NULL; m_CurrentTextMod = TextMod; + if( m_CurrentTextMod ) m_Module = (MODULE*) m_CurrentTextMod->GetParent(); + Init( ); + m_buttonOK->SetDefault(); GetSizer()->Fit( this ); GetSizer()->SetSizeHints( this ); } diff --git a/pcbnew/dialogs/dialog_freeroute_exchange.cpp b/pcbnew/dialogs/dialog_freeroute_exchange.cpp index be0240f073..272aea38ec 100644 --- a/pcbnew/dialogs/dialog_freeroute_exchange.cpp +++ b/pcbnew/dialogs/dialog_freeroute_exchange.cpp @@ -37,6 +37,7 @@ DIALOG_FREEROUTE::DIALOG_FREEROUTE( PCB_EDIT_FRAME* parent ): m_Parent = parent; MyInit(); + m_sdbSizer1OK->SetDefault(); GetSizer()->SetSizeHints( this ); Centre(); } diff --git a/pcbnew/dialogs/dialog_general_options.cpp b/pcbnew/dialogs/dialog_general_options.cpp index f9b0fd1272..5b41508008 100644 --- a/pcbnew/dialogs/dialog_general_options.cpp +++ b/pcbnew/dialogs/dialog_general_options.cpp @@ -25,6 +25,7 @@ Dialog_GeneralOptions::Dialog_GeneralOptions( PCB_EDIT_FRAME* parent ) : m_Parent = parent; init(); + m_buttonOK->SetDefault(); GetSizer()->SetSizeHints( this ); Center(); } diff --git a/pcbnew/dialogs/dialog_graphic_items_options.cpp b/pcbnew/dialogs/dialog_graphic_items_options.cpp index 3dac269ad7..090ff28a46 100644 --- a/pcbnew/dialogs/dialog_graphic_items_options.cpp +++ b/pcbnew/dialogs/dialog_graphic_items_options.cpp @@ -43,6 +43,7 @@ DIALOG_GRAPHIC_ITEMS_OPTIONS::DIALOG_GRAPHIC_ITEMS_OPTIONS( PCB_BASE_FRAME* pare m_BrdSettings = m_Parent->GetBoard()->GetBoardDesignSettings(); initValues( ); + m_sdbSizer1OK->SetDefault(); GetSizer()->SetSizeHints( this ); Centre(); diff --git a/pcbnew/dialogs/dialog_mask_clearance.cpp b/pcbnew/dialogs/dialog_mask_clearance.cpp index 548cd5b83f..22db1ae505 100644 --- a/pcbnew/dialogs/dialog_mask_clearance.cpp +++ b/pcbnew/dialogs/dialog_mask_clearance.cpp @@ -29,6 +29,7 @@ DIALOG_PADS_MASK_CLEARANCE::DIALOG_PADS_MASK_CLEARANCE( PCB_EDIT_FRAME* parent ) m_BrdSettings = m_Parent->GetBoard()->GetBoardDesignSettings(); MyInit(); + m_sdbButtonsSizerOK->SetDefault(); GetSizer()->SetSizeHints( this ); Centre(); } diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 090ffe4ce1..77c4379863 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -157,6 +157,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* parent, D_PAD* Pad initValues(); + m_sdbSizer1OK->SetDefault(); GetSizer()->SetSizeHints( this ); Center(); m_canUpdate = true; diff --git a/pcbnew/dialogs/dialog_pcb_text_properties.cpp b/pcbnew/dialogs/dialog_pcb_text_properties.cpp index 135249065c..79b1843702 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties.cpp +++ b/pcbnew/dialogs/dialog_pcb_text_properties.cpp @@ -53,6 +53,7 @@ DIALOG_PCB_TEXT_PROPERTIES::DIALOG_PCB_TEXT_PROPERTIES( PCB_EDIT_FRAME* parent, m_SelectedPCBText = passedTextPCB; MyInit(); + m_StandardSizerOK->SetDefault(); GetSizer()->SetSizeHints( this ); Centre(); } diff --git a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp index 8e09e54638..89dfd76942 100644 --- a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp +++ b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp @@ -40,9 +40,10 @@ DIALOG_PCBNEW_CONFIG_LIBS::DIALOG_PCBNEW_CONFIG_LIBS( PCB_EDIT_FRAME* parent ): wxString title = _( "from " ) + wxGetApp().m_CurrentOptionFile; SetTitle( title ); + m_sdbSizer1OK->SetDefault(); + if( GetSizer() ) GetSizer()->SetSizeHints( this ); - } /*************************************/ diff --git a/pcbnew/dialogs/dialog_print_for_modedit.cpp b/pcbnew/dialogs/dialog_print_for_modedit.cpp index f153e07cc8..691c4b594b 100644 --- a/pcbnew/dialogs/dialog_print_for_modedit.cpp +++ b/pcbnew/dialogs/dialog_print_for_modedit.cpp @@ -89,6 +89,7 @@ DIALOG_PRINT_FOR_MODEDIT::DIALOG_PRINT_FOR_MODEDIT( EDA_DRAW_FRAME* parent ) : m_Config = wxGetApp().m_EDA_Config; InitValues(); + m_buttonPrint->SetDefault(); GetSizer()->SetSizeHints( this ); Center(); } diff --git a/pcbnew/sel_layer.cpp b/pcbnew/sel_layer.cpp index 666440a6da..bc515007cd 100644 --- a/pcbnew/sel_layer.cpp +++ b/pcbnew/sel_layer.cpp @@ -258,20 +258,23 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( PCB_BASE_FRAME* parent ) : m_Parent = parent; PCB_SCREEN* screen = (PCB_SCREEN*) m_Parent->GetScreen(); - int Masque_Layer = - g_TabAllCopperLayerMask[board->GetCopperLayerCount() - 1]; + int Masque_Layer = g_TabAllCopperLayerMask[board->GetCopperLayerCount() - 1]; Masque_Layer += ALL_NO_CU_LAYERS; for( ii = 0, LayerCount = 0; ii < NB_COPPER_LAYERS; ii++ ) { m_LayerId[ii] = 0; + if( (g_TabOneLayerMask[ii] & Masque_Layer) ) { LayerList[LayerCount] = board->GetLayerName( ii ); + if( ii == screen->m_Route_Layer_TOP ) LayerTopSelect = LayerCount; + if( ii == screen->m_Route_Layer_BOTTOM ) LayerBottomSelect = LayerCount; + m_LayerId[LayerCount] = ii; LayerCount++; } @@ -306,6 +309,7 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( PCB_BASE_FRAME* parent ) : RadioBoxSizer->Add( m_LayerListBOTTOM, 0, wxALIGN_TOP | wxALL, 5 ); Button = new wxButton( this, wxID_OK, _( "OK" ) ); + Button->SetDefault(); ButtonBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) ); @@ -323,16 +327,14 @@ void WinEDA_SelLayerPairFrame::OnOkClick( wxCommandEvent& event ) // select the same layer for top and bottom is allowed (normal in some // boards) // but could be a mistake. So display an info message - if( m_LayerId[m_LayerListTOP->GetSelection()] - == m_LayerId[m_LayerListBOTTOM->GetSelection()] ) + if( m_LayerId[m_LayerListTOP->GetSelection()] == m_LayerId[m_LayerListBOTTOM->GetSelection()] ) DisplayInfoMessage( this, _( "Warning: The Top Layer and Bottom Layer are same." ) ); PCB_SCREEN* screen = (PCB_SCREEN*) m_Parent->GetScreen(); screen->m_Route_Layer_TOP = m_LayerId[m_LayerListTOP->GetSelection()]; - screen->m_Route_Layer_BOTTOM = - m_LayerId[m_LayerListBOTTOM->GetSelection()]; + screen->m_Route_Layer_BOTTOM = m_LayerId[m_LayerListBOTTOM->GetSelection()]; EndModal( 0 ); } diff --git a/pcbnew/set_grid.cpp b/pcbnew/set_grid.cpp index e56a64ecd0..0334f0df55 100644 --- a/pcbnew/set_grid.cpp +++ b/pcbnew/set_grid.cpp @@ -70,6 +70,7 @@ DIALOG_SET_GRID::DIALOG_SET_GRID( wxWindow* parent, const wxPoint& pos ) : m_TextPosXUnits->SetLabel( GetUnitsLabel( g_UserUnit ) ); m_TextPosYUnits->SetLabel( GetUnitsLabel( g_UserUnit ) ); + m_sdbSizer1OK->SetDefault(); GetSizer()->SetSizeHints( this ); Centre(); }