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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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();
}
+71 −73
Original line number Diff line number Diff line
@@ -32,15 +32,11 @@ Ki_PageDescr * SheetList[NB_ITEMS + 1] =
};



/******************************************************************/
void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event )
/******************************************************************/
/* Creation de la fenetre de configuration
 */
{
    DIALOG_PAGES_SETTINGS frame( this );
    int diag = frame.ShowModal();

    if( DrawPanel && diag )
        DrawPanel->Refresh();
}
@@ -61,10 +57,12 @@ DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent ):
    Centre();
}


DIALOG_PAGES_SETTINGS::~DIALOG_PAGES_SETTINGS()
{
}


void DIALOG_PAGES_SETTINGS::initDialog()
{
    wxString msg;
@@ -129,6 +127,9 @@ void DIALOG_PAGES_SETTINGS::initDialog()
    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,15 +161,11 @@ 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
 */
{
    double      dtmp;
    wxString    msg;
@@ -229,8 +226,10 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event)
#ifdef EESCHEMA
    /* Exports settings to other sheets if requested: */
    SCH_SCREEN* screen;

    /* Build the screen list */
    SCH_SCREENS ScreenList;

    /* Update the datas */
    for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() )
    {
@@ -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,12 +265,10 @@ 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;
Loading