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 Original line 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 );
        m_hotkeyGrid->SetReadOnly( i, 1, true );
    }
    }


    SetFocus();
    m_OKButton->SetDefault();
    m_hotkeyGrid->SetFocus();
    GetSizer()->SetSizeHints( this );
    GetSizer()->SetSizeHints( this );
    Center();
    Center();
}
}
+71 −73
Original line number Original line Diff line number Diff line
@@ -32,15 +32,11 @@ Ki_PageDescr * SheetList[NB_ITEMS + 1] =
};
};





/******************************************************************/
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();
}
}
@@ -61,10 +57,12 @@ DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent ):
    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;
@@ -129,6 +127,9 @@ void DIALOG_PAGES_SETTINGS::initDialog()
    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 )
{
{
    SavePageSettings( event );
    SavePageSettings( event );
    m_Modified = 1;
    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 )
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;
@@ -229,8 +226,10 @@ 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() )
    {
    {
@@ -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,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
/* 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;
+896 −896

File changed.

Preview size limit exceeded, changes collapsed.

+3 −0
Original line number Original line Diff line number Diff line
@@ -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();
}
}




+6 −2
Original line number Original line Diff line number Diff line
@@ -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
	
	
	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
	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
	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 );
	
	
Loading