Commit 45021493 authored by Dick Hollenbeck's avatar Dick Hollenbeck

switch to comboboxes on page size dialogs, fix PLUGIN header

parents 286c62d8 2c84a28f
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 KiCad Developers, see CHANGELOG.TXT for contributors. * Copyright (C) 2012 KiCad Developers, see CHANGELOG.TXT for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -29,9 +30,9 @@ const wxString PAGE_INFO::Custom( wxT( "User" ) ); ...@@ -29,9 +30,9 @@ const wxString PAGE_INFO::Custom( wxT( "User" ) );
// Standard page sizes in mils, all constants // Standard page sizes in mils, all constants
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
const PAGE_INFO PAGE_INFO::pageA4( wxSize( 8283, 11700 ), wxT( "A4" ) ); const PAGE_INFO PAGE_INFO::pageA4( wxSize( 8268, 11700 ), wxT( "A4" ) );
#else #else
const PAGE_INFO PAGE_INFO::pageA4( wxSize( 11700, 8267 ), wxT( "A4" ) ); const PAGE_INFO PAGE_INFO::pageA4( wxSize( 11700, 8268 ), wxT( "A4" ) );
#endif #endif
const PAGE_INFO PAGE_INFO::pageA3( wxSize( 16535, 11700 ), wxT( "A3" ) ); const PAGE_INFO PAGE_INFO::pageA3( wxSize( 16535, 11700 ), wxT( "A3" ) );
const PAGE_INFO PAGE_INFO::pageA2( wxSize( 23400, 16535 ), wxT( "A2" ) ); const PAGE_INFO PAGE_INFO::pageA2( wxSize( 23400, 16535 ), wxT( "A2" ) );
...@@ -42,9 +43,15 @@ const PAGE_INFO PAGE_INFO::pageB( wxSize( 17000, 11000 ), wxT( "B" ) ); ...@@ -42,9 +43,15 @@ const PAGE_INFO PAGE_INFO::pageB( wxSize( 17000, 11000 ), wxT( "B" ) );
const PAGE_INFO PAGE_INFO::pageC( wxSize( 22000, 17000 ), wxT( "C" ) ); const PAGE_INFO PAGE_INFO::pageC( wxSize( 22000, 17000 ), wxT( "C" ) );
const PAGE_INFO PAGE_INFO::pageD( wxSize( 34000, 22000 ), wxT( "D" ) ); const PAGE_INFO PAGE_INFO::pageD( wxSize( 34000, 22000 ), wxT( "D" ) );
const PAGE_INFO PAGE_INFO::pageE( wxSize( 44000, 34000 ), wxT( "E" ) ); const PAGE_INFO PAGE_INFO::pageE( wxSize( 44000, 34000 ), wxT( "E" ) );
const PAGE_INFO PAGE_INFO::pageGERBER(wxSize( 32000, 32000 ), wxT( "GERBER" ) ); const PAGE_INFO PAGE_INFO::pageGERBER( wxSize( 32000, 32000 ), wxT( "GERBER" ) );
const PAGE_INFO PAGE_INFO::pageUser( wxSize( 17000, 11000 ), Custom ); const PAGE_INFO PAGE_INFO::pageUser( wxSize( 17000, 11000 ), Custom );
// US paper sizes
const PAGE_INFO PAGE_INFO::pageUSLetter( wxSize( 11000, 8500 ), wxT( "USLetter" ) );
const PAGE_INFO PAGE_INFO::pageUSLegal( wxSize( 14000, 8500 ), wxT( "USLegal" ) );
const PAGE_INFO PAGE_INFO::pageUSLedger( wxSize( 17000, 11000 ), wxT( "USLedger" ) );
// Custom paper size for next instantiation of type "User"
int PAGE_INFO::s_user_width = 17000; int PAGE_INFO::s_user_width = 17000;
int PAGE_INFO::s_user_height = 11000; int PAGE_INFO::s_user_height = 11000;
...@@ -65,6 +72,9 @@ wxArrayString PAGE_INFO::GetStandardSizes() ...@@ -65,6 +72,9 @@ wxArrayString PAGE_INFO::GetStandardSizes()
&pageD, &pageD,
&pageE, &pageE,
// &pageGERBER, // standard? // &pageGERBER, // standard?
&pageUSLetter,
&pageUSLegal,
&pageUSLedger,
&pageUser, &pageUser,
}; };
...@@ -122,6 +132,12 @@ bool PAGE_INFO::SetType( const wxString& aType ) ...@@ -122,6 +132,12 @@ bool PAGE_INFO::SetType( const wxString& aType )
*this = pageE; *this = pageE;
else if( aType == pageGERBER.GetType() ) else if( aType == pageGERBER.GetType() )
*this = pageGERBER; *this = pageGERBER;
else if( aType == pageUSLetter.GetType() )
*this = pageUSLetter;
else if( aType == pageUSLegal.GetType() )
*this = pageUSLegal;
else if( aType == pageUSLedger.GetType() )
*this = pageUSLedger;
else if( aType == pageUser.GetType() ) else if( aType == pageUser.GetType() )
{ {
// pageUser is const, and may not and does not hold the custom size, // pageUser is const, and may not and does not hold the custom size,
...@@ -201,4 +217,3 @@ void PAGE_INFO::SetHeightMils( int aHeightInMils ) ...@@ -201,4 +217,3 @@ void PAGE_INFO::SetHeightMils( int aHeightInMils )
{ {
m_size.y = clampHeight( aHeightInMils ); m_size.y = clampHeight( aHeightInMils );
} }
...@@ -75,12 +75,14 @@ void DIALOG_PAGES_SETTINGS::initDialog() ...@@ -75,12 +75,14 @@ void DIALOG_PAGES_SETTINGS::initDialog()
const PAGE_INFO& pageInfo = m_Parent->GetPageSettings(); const PAGE_INFO& pageInfo = m_Parent->GetPageSettings();
if( !pageInfo.IsCustom() ) if( !pageInfo.IsCustom() )
m_landscapeCheckbox->SetValue( !pageInfo.IsPortrait() ); m_orientationComboBox->SetSelection( pageInfo.IsPortrait() );
setCurrentPageSizeSelection( pageInfo.GetType() ); setCurrentPageSizeSelection( pageInfo.GetType() );
// only a click fires the radiobutton selected event, so have to fabricate this check // only a click fires the selection changed event, so have to fabricate this check
onRadioButtonSelected(); wxCommandEvent junk;
onPaperSizeChoice( junk );
switch( g_UserUnit ) switch( g_UserUnit )
{ {
...@@ -175,25 +177,19 @@ void DIALOG_PAGES_SETTINGS::OnCancelClick( wxCommandEvent& event ) ...@@ -175,25 +177,19 @@ void DIALOG_PAGES_SETTINGS::OnCancelClick( wxCommandEvent& event )
} }
void DIALOG_PAGES_SETTINGS::onRadioButtonSelected() void DIALOG_PAGES_SETTINGS::onPaperSizeChoice( wxCommandEvent& event )
{ {
if( PAGE_INFO::Custom == m_PageSizeBox->GetStringSelection() ) if( m_paperSizeComboBox->GetStringSelection().Contains( PAGE_INFO::Custom ) )
{ {
m_landscapeCheckbox->Enable( false ); m_orientationComboBox->Enable( false );
} }
else else
{ {
m_landscapeCheckbox->Enable( true ); m_orientationComboBox->Enable( true );
} }
} }
void DIALOG_PAGES_SETTINGS::onRadioButtonSelected( wxCommandEvent& event )
{
onRadioButtonSelected(); // no event arg
}
void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event ) void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event )
{ {
wxString msg; wxString msg;
...@@ -238,19 +234,27 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event ) ...@@ -238,19 +234,27 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event )
*/ */
} }
int radioSelection = m_PageSizeBox->GetSelection();
if( radioSelection < 0 )
radioSelection = 0;
// wxFormBuilder must use "A4", "A3", etc for choices, in all languages/translations // wxFormBuilder must use "A4", "A3", etc for choices, in all languages/translations
wxString paperType = m_PageSizeBox->GetString( radioSelection ); wxString paperType = m_paperSizeComboBox->GetStringSelection();
// construct pageInfo _after_ user settings have been established in case the // construct pageInfo _after_ user settings have been established in case the
// paperType is custom, otherwise User width and height will not go into effect right away. // paperType is custom, otherwise User width and height will not go into effect right away.
PAGE_INFO pageInfo( paperType ); PAGE_INFO pageInfo;
if( paperType.Contains( PAGE_INFO::Custom ) )
{
pageInfo.SetType( PAGE_INFO::Custom );
}
else
{
pageInfo.SetPortrait( m_orientationComboBox->GetSelection() );
if( PAGE_INFO::Custom != paperType ) // here we assume translators will keep original paper size spellings
pageInfo.SetPortrait( !m_landscapeCheckbox->IsChecked() ); if( !pageInfo.SetType( paperType ) )
{
wxASSERT_MSG( FALSE, wxT( "the translation for paper size must preserve original spellings" ) );
}
}
m_Parent->SetPageSettings( pageInfo ); m_Parent->SetPageSettings( pageInfo );
...@@ -305,19 +309,19 @@ void DIALOG_PAGES_SETTINGS::setCurrentPageSizeSelection( const wxString& aPaperS ...@@ -305,19 +309,19 @@ void DIALOG_PAGES_SETTINGS::setCurrentPageSizeSelection( const wxString& aPaperS
// use wxFormBuilder to store the sheet type in the wxRadioButton's label // use wxFormBuilder to store the sheet type in the wxRadioButton's label
// i.e. "A4", "A3", etc, anywhere within the text of the label. // i.e. "A4", "A3", etc, anywhere within the text of the label.
D(printf("m_PageSizeBox->GetCount() = %d\n", (int) m_PageSizeBox->GetCount() );) D(printf("m_paperSizeComboBox->GetCount() = %d\n", (int) m_paperSizeComboBox->GetCount() );)
// search all the child wxRadioButtons for a label containing our paper type // search all the child wxRadioButtons for a label containing our paper type
for( unsigned i = 0; i < m_PageSizeBox->GetCount(); ++i ) for( unsigned i = 0; i < m_paperSizeComboBox->GetCount(); ++i )
{ {
// parse each label looking for aPaperSize within it // parse each label looking for aPaperSize within it
wxStringTokenizer st( m_PageSizeBox->GetString( i ) ); wxStringTokenizer st( m_paperSizeComboBox->GetString( i ) );
while( st.HasMoreTokens() ) while( st.HasMoreTokens() )
{ {
if( st.GetNextToken() == aPaperSize ) if( st.GetNextToken() == aPaperSize )
{ {
m_PageSizeBox->SetSelection( i ); m_paperSizeComboBox->SetSelection( i );
return; return;
} }
} }
......
...@@ -36,14 +36,11 @@ private: ...@@ -36,14 +36,11 @@ private:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
/// wxEVT_COMMAND_RADIOBOX_SELECTED
void onRadioButtonSelected( wxCommandEvent& event );
void setCurrentPageSizeSelection( const wxString& aPaperSize ); void setCurrentPageSizeSelection( const wxString& aPaperSize );
void SavePageSettings(wxCommandEvent& event); void SavePageSettings(wxCommandEvent& event);
void ReturnSizeSelected(wxCommandEvent& event); void ReturnSizeSelected(wxCommandEvent& event);
void onRadioButtonSelected(); void onPaperSizeChoice( wxCommandEvent& event );
}; };
#endif // _DIALOG_PAGES_SETTINGS_H_ #endif // _DIALOG_PAGES_SETTINGS_H_
...@@ -21,62 +21,62 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind ...@@ -21,62 +21,62 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind
wxFlexGridSizer* LeftColumnSizer; wxFlexGridSizer* LeftColumnSizer;
LeftColumnSizer = new wxFlexGridSizer( 6, 1, 0, 0 ); LeftColumnSizer = new wxFlexGridSizer( 6, 1, 0, 0 );
LeftColumnSizer->AddGrowableRow( 0 );
LeftColumnSizer->AddGrowableRow( 1 ); LeftColumnSizer->AddGrowableRow( 1 );
LeftColumnSizer->AddGrowableRow( 3 ); LeftColumnSizer->AddGrowableRow( 2 );
LeftColumnSizer->AddGrowableRow( 4 );
LeftColumnSizer->AddGrowableRow( 5 );
LeftColumnSizer->SetFlexibleDirection( wxBOTH ); LeftColumnSizer->SetFlexibleDirection( wxBOTH );
LeftColumnSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); LeftColumnSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxString m_PageSizeBoxChoices[] = { _("A4"), _("A3"), _("A2"), _("A1"), _("A0"), _("A"), _("B"), _("C"), _("D"), _("E"), _("User") }; wxStaticBoxSizer* sbSizer9;
int m_PageSizeBoxNChoices = sizeof( m_PageSizeBoxChoices ) / sizeof( wxString ); sbSizer9 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Paper Size:") ), wxVERTICAL );
m_PageSizeBox = new wxRadioBox( this, wxID_ANY, _("Page Size:"), wxDefaultPosition, wxDefaultSize, m_PageSizeBoxNChoices, m_PageSizeBoxChoices, 1, wxRA_SPECIFY_COLS );
m_PageSizeBox->SetSelection( 9 );
LeftColumnSizer->Add( m_PageSizeBox, 0, wxALL|wxEXPAND, 5 );
wxString m_paperSizeComboBoxChoices[] = { _("A4"), _("A3"), _("A2"), _("A1"), _("A0"), _("A"), _("B"), _("C"), _("D"), _("E"), _("USLetter"), _("USLegal"), _("USLedger"), _("User (Custom)") };
int m_paperSizeComboBoxNChoices = sizeof( m_paperSizeComboBoxChoices ) / sizeof( wxString );
m_paperSizeComboBox = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_paperSizeComboBoxNChoices, m_paperSizeComboBoxChoices, 0 );
m_paperSizeComboBox->SetSelection( 0 );
sbSizer9->Add( m_paperSizeComboBox, 0, wxALL|wxEXPAND, 5 );
LeftColumnSizer->Add( 5, 0, 1, wxEXPAND, 5 ); LeftColumnSizer->Add( sbSizer9, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbSizer8; wxStaticBoxSizer* sbSizer8;
sbSizer8 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Orientation:") ), wxVERTICAL ); sbSizer8 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Orientation:") ), wxVERTICAL );
m_landscapeCheckbox = new wxCheckBox( this, wxID_ANY, _("Landscape"), wxDefaultPosition, wxDefaultSize, 0 ); wxString m_orientationComboBoxChoices[] = { _("Landscape"), _("Portrait") };
m_landscapeCheckbox->SetValue(true); int m_orientationComboBoxNChoices = sizeof( m_orientationComboBoxChoices ) / sizeof( wxString );
m_landscapeCheckbox->SetToolTip( _("Check for landscape, uncheck for portrait") ); m_orientationComboBox = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_orientationComboBoxNChoices, m_orientationComboBoxChoices, 0 );
m_orientationComboBox->SetSelection( 0 );
sbSizer8->Add( m_orientationComboBox, 0, wxALL|wxEXPAND, 5 );
sbSizer8->Add( m_landscapeCheckbox, 0, wxALL|wxEXPAND, 5 ); LeftColumnSizer->Add( sbSizer8, 0, wxALL|wxEXPAND, 5 );
LeftColumnSizer->Add( sbSizer8, 1, wxALL|wxEXPAND, 5 ); wxStaticBoxSizer* sbSizer10;
sbSizer10 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Custom Page Size:") ), wxVERTICAL );
wxBoxSizer* bSizerXsize; wxBoxSizer* bSizerXsize;
bSizerXsize = new wxBoxSizer( wxVERTICAL ); bSizerXsize = new wxBoxSizer( wxVERTICAL );
UserPageSizeX = new wxStaticText( this, wxID_ANY, _("User Page Size X: "), wxDefaultPosition, wxDefaultSize, 0 ); UserPageSizeX = new wxStaticText( this, wxID_ANY, _("Width:"), wxDefaultPosition, wxDefaultSize, 0 );
UserPageSizeX->Wrap( -1 ); UserPageSizeX->Wrap( -1 );
bSizerXsize->Add( UserPageSizeX, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bSizerXsize->Add( UserPageSizeX, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TextUserSizeX = new wxTextCtrl( this, ID_TEXTCTRL_USER_PAGE_SIZE_X, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_TextUserSizeX = new wxTextCtrl( this, ID_TEXTCTRL_USER_PAGE_SIZE_X, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerXsize->Add( m_TextUserSizeX, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bSizerXsize->Add( m_TextUserSizeX, 0, wxALIGN_LEFT|wxALIGN_TOP|wxALL|wxEXPAND, 5 );
LeftColumnSizer->Add( bSizerXsize, 1, wxEXPAND, 5 ); sbSizer10->Add( bSizerXsize, 1, wxALIGN_TOP|wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizerYsize; wxBoxSizer* bSizerYsize;
bSizerYsize = new wxBoxSizer( wxVERTICAL ); bSizerYsize = new wxBoxSizer( wxVERTICAL );
UserPageSizeY = new wxStaticText( this, wxID_ANY, _("User Page Size Y: "), wxDefaultPosition, wxDefaultSize, 0 ); UserPageSizeY = new wxStaticText( this, wxID_ANY, _("Height:"), wxDefaultPosition, wxDefaultSize, 0 );
UserPageSizeY->Wrap( -1 ); UserPageSizeY->Wrap( -1 );
bSizerYsize->Add( UserPageSizeY, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bSizerYsize->Add( UserPageSizeY, 0, wxALIGN_TOP|wxALL, 5 );
m_TextUserSizeY = new wxTextCtrl( this, ID_TEXTCTRL_USER_PAGE_SIZE_Y, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_TextUserSizeY = new wxTextCtrl( this, ID_TEXTCTRL_USER_PAGE_SIZE_Y, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerYsize->Add( m_TextUserSizeY, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bSizerYsize->Add( m_TextUserSizeY, 0, wxALIGN_TOP|wxALL|wxEXPAND, 5 );
LeftColumnSizer->Add( bSizerYsize, 1, wxEXPAND, 5 ); sbSizer10->Add( bSizerYsize, 1, wxALIGN_TOP|wxALL|wxEXPAND, 5 );
LeftColumnSizer->Add( sbSizer10, 1, wxALL|wxEXPAND, 5 );
LeftColumnSizer->Add( 5, 5, 1, wxEXPAND, 5 );
LeftColumnSizer->Add( 5, 5, 1, wxEXPAND, 5 );
bUpperSizerH->Add( LeftColumnSizer, 0, wxEXPAND, 5 ); bUpperSizerH->Add( LeftColumnSizer, 0, wxEXPAND, 5 );
...@@ -219,7 +219,7 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind ...@@ -219,7 +219,7 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind
// Connect Events // Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnCloseWindow ) ); this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnCloseWindow ) );
m_PageSizeBox->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::onRadioButtonSelected ), NULL, this ); m_paperSizeComboBox->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::onPaperSizeChoice ), NULL, this );
m_TextUserSizeX->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnTextctrlUserPageSizeXTextUpdated ), NULL, this ); m_TextUserSizeX->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnTextctrlUserPageSizeXTextUpdated ), NULL, this );
m_TextUserSizeY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnTextctrlUserPageSizeYTextUpdated ), NULL, this ); m_TextUserSizeY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnTextctrlUserPageSizeYTextUpdated ), NULL, this );
m_TitleExport->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnCheckboxTitleClick ), NULL, this ); m_TitleExport->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnCheckboxTitleClick ), NULL, this );
...@@ -231,7 +231,7 @@ DIALOG_PAGES_SETTINGS_BASE::~DIALOG_PAGES_SETTINGS_BASE() ...@@ -231,7 +231,7 @@ DIALOG_PAGES_SETTINGS_BASE::~DIALOG_PAGES_SETTINGS_BASE()
{ {
// Disconnect Events // Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnCloseWindow ) ); this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnCloseWindow ) );
m_PageSizeBox->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::onRadioButtonSelected ), NULL, this ); m_paperSizeComboBox->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::onPaperSizeChoice ), NULL, this );
m_TextUserSizeX->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnTextctrlUserPageSizeXTextUpdated ), NULL, this ); m_TextUserSizeX->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnTextctrlUserPageSizeXTextUpdated ), NULL, this );
m_TextUserSizeY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnTextctrlUserPageSizeYTextUpdated ), NULL, this ); m_TextUserSizeY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnTextctrlUserPageSizeYTextUpdated ), NULL, this );
m_TitleExport->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnCheckboxTitleClick ), NULL, this ); m_TitleExport->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAGES_SETTINGS_BASE::OnCheckboxTitleClick ), NULL, this );
......
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
<property name="cols">1</property> <property name="cols">1</property>
<property name="flexible_direction">wxBOTH</property> <property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property> <property name="growablecols"></property>
<property name="growablerows">1,3,4,5</property> <property name="growablerows">0,1,2</property>
<property name="hgap">0</property> <property name="hgap">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">LeftColumnSizer</property> <property name="name">LeftColumnSizer</property>
...@@ -152,7 +152,19 @@ ...@@ -152,7 +152,19 @@
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxRadioBox" expanded="1"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Paper Size:</property>
<property name="minimum_size"></property>
<property name="name">sbSizer9</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
...@@ -163,7 +175,7 @@ ...@@ -163,7 +175,7 @@
<property name="caption"></property> <property name="caption"></property>
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="choices">&quot;A4&quot; &quot;A3&quot; &quot;A2&quot; &quot;A1&quot; &quot;A0&quot; &quot;A&quot; &quot;B&quot; &quot;C&quot; &quot;D&quot; &quot;E&quot; &quot;User&quot;</property> <property name="choices">&quot;A4&quot; &quot;A3&quot; &quot;A2&quot; &quot;A1&quot; &quot;A0&quot; &quot;A&quot; &quot;B&quot; &quot;C&quot; &quot;D&quot; &quot;E&quot; &quot;USLetter&quot; &quot;USLegal&quot; &quot;USLedger&quot; &quot;User (Custom)&quot;</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
...@@ -178,9 +190,7 @@ ...@@ -178,9 +190,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Page Size:</property>
<property name="layer"></property> <property name="layer"></property>
<property name="majorDimension">1</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
...@@ -188,7 +198,7 @@ ...@@ -188,7 +198,7 @@
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_PageSizeBox</property> <property name="name">m_paperSizeComboBox</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position"></property>
<property name="pane_size"></property> <property name="pane_size"></property>
...@@ -198,10 +208,9 @@ ...@@ -198,10 +208,9 @@
<property name="position"></property> <property name="position"></property>
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row"></property> <property name="row"></property>
<property name="selection">9</property> <property name="selection">0</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip"></property>
...@@ -213,6 +222,7 @@ ...@@ -213,6 +222,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnChoice">onPaperSizeChoice</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -229,7 +239,6 @@ ...@@ -229,7 +239,6 @@
<event name="OnMouseEvents"></event> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event> <event name="OnMouseWheel"></event>
<event name="OnPaint"></event> <event name="OnPaint"></event>
<event name="OnRadioBox">onRadioButtonSelected</event>
<event name="OnRightDClick"></event> <event name="OnRightDClick"></event>
<event name="OnRightDown"></event> <event name="OnRightDown"></event>
<event name="OnRightUp"></event> <event name="OnRightUp"></event>
...@@ -238,20 +247,12 @@ ...@@ -238,20 +247,12 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">5</property>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Orientation:</property> <property name="label">Orientation:</property>
...@@ -264,7 +265,7 @@ ...@@ -264,7 +265,7 @@
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxCheckBox" expanded="1"> <object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
...@@ -275,7 +276,7 @@ ...@@ -275,7 +276,7 @@
<property name="caption"></property> <property name="caption"></property>
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="checked">1</property> <property name="choices">&quot;Landscape&quot; &quot;Portrait&quot;</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
...@@ -290,7 +291,6 @@ ...@@ -290,7 +291,6 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Landscape</property>
<property name="layer"></property> <property name="layer"></property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_landscapeCheckbox</property> <property name="name">m_orientationComboBox</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position"></property>
<property name="pane_size"></property> <property name="pane_size"></property>
...@@ -309,12 +309,12 @@ ...@@ -309,12 +309,12 @@
<property name="position"></property> <property name="position"></property>
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row"></property> <property name="row"></property>
<property name="selection">0</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip">Check for landscape, uncheck for portrait</property> <property name="tooltip"></property>
<property name="validator_data_type"></property> <property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnChoice"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -352,7 +352,19 @@ ...@@ -352,7 +352,19 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Custom Page Size:</property>
<property name="minimum_size"></property>
<property name="name">sbSizer10</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_TOP|wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
...@@ -388,7 +400,7 @@ ...@@ -388,7 +400,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">User Page Size X: </property> <property name="label">Width:</property>
<property name="layer"></property> <property name="layer"></property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
...@@ -448,7 +460,7 @@ ...@@ -448,7 +460,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property> <property name="flag">wxALIGN_LEFT|wxALIGN_TOP|wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
...@@ -541,7 +553,7 @@ ...@@ -541,7 +553,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALIGN_TOP|wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
...@@ -550,7 +562,7 @@ ...@@ -550,7 +562,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxALIGN_TOP|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
...@@ -577,7 +589,7 @@ ...@@ -577,7 +589,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">User Page Size Y: </property> <property name="label">Height:</property>
<property name="layer"></property> <property name="layer"></property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
...@@ -637,7 +649,7 @@ ...@@ -637,7 +649,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property> <property name="flag">wxALIGN_TOP|wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
...@@ -728,24 +740,6 @@ ...@@ -728,24 +740,6 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">5</property>
<property name="permission">protected</property>
<property name="width">5</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">5</property>
<property name="permission">protected</property>
<property name="width">5</property>
</object> </object>
</object> </object>
</object> </object>
......
...@@ -11,16 +11,16 @@ ...@@ -11,16 +11,16 @@
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/radiobox.h> #include <wx/choice.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/checkbox.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
...@@ -50,15 +50,12 @@ class DIALOG_PAGES_SETTINGS_BASE : public wxDialog ...@@ -50,15 +50,12 @@ class DIALOG_PAGES_SETTINGS_BASE : public wxDialog
private: private:
protected: protected:
wxRadioBox* m_PageSizeBox; wxChoice* m_paperSizeComboBox;
wxChoice* m_orientationComboBox;
wxCheckBox* m_landscapeCheckbox;
wxStaticText* UserPageSizeX; wxStaticText* UserPageSizeX;
wxTextCtrl* m_TextUserSizeX; wxTextCtrl* m_TextUserSizeX;
wxStaticText* UserPageSizeY; wxStaticText* UserPageSizeY;
wxTextCtrl* m_TextUserSizeY; wxTextCtrl* m_TextUserSizeY;
wxStaticText* m_TextSheetCount; wxStaticText* m_TextSheetCount;
wxStaticText* m_TextSheetNumber; wxStaticText* m_TextSheetNumber;
...@@ -82,7 +79,7 @@ class DIALOG_PAGES_SETTINGS_BASE : public wxDialog ...@@ -82,7 +79,7 @@ class DIALOG_PAGES_SETTINGS_BASE : public wxDialog
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
virtual void onRadioButtonSelected( wxCommandEvent& event ) { event.Skip(); } virtual void onPaperSizeChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTextctrlUserPageSizeXTextUpdated( wxCommandEvent& event ) { event.Skip(); } virtual void OnTextctrlUserPageSizeXTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTextctrlUserPageSizeYTextUpdated( wxCommandEvent& event ) { event.Skip(); } virtual void OnTextctrlUserPageSizeYTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCheckboxTitleClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnCheckboxTitleClick( wxCommandEvent& event ) { event.Skip(); }
......
...@@ -247,6 +247,11 @@ private: ...@@ -247,6 +247,11 @@ private:
static const PAGE_INFO pageD; static const PAGE_INFO pageD;
static const PAGE_INFO pageE; static const PAGE_INFO pageE;
static const PAGE_INFO pageGERBER; static const PAGE_INFO pageGERBER;
static const PAGE_INFO pageUSLetter;
static const PAGE_INFO pageUSLegal;
static const PAGE_INFO pageUSLedger;
static const PAGE_INFO pageUser; static const PAGE_INFO pageUser;
// all dimensions here are in mils // all dimensions here are in mils
......
...@@ -478,8 +478,8 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF ...@@ -478,8 +478,8 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
{ {
wxString header = wxString::Format( wxString header = wxString::Format(
wxT( "PCBNEW-BOARD Version %d date %s\n\n# Created by Pcbnew%s\n\n" ), wxT( "PCBNEW-BOARD Version %d date %s\n\n# Created by Pcbnew%s\n\n" ),
BOARD_FILE_VERSION, TO_UTF8( DateAndTime() ), BOARD_FILE_VERSION, DateAndTime().GetData(),
TO_UTF8( GetBuildVersion() ) ); GetBuildVersion().GetData() );
PROPERTIES props; PROPERTIES props;
......
...@@ -2654,8 +2654,9 @@ void KICAD_PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, PROPERTIES* a ...@@ -2654,8 +2654,9 @@ void KICAD_PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, PROPERTIES* a
if( m_props ) if( m_props )
{ {
wxString header = (*m_props)["header"];
// save a file header, if caller provided one (with trailing \n hopefully). // save a file header, if caller provided one (with trailing \n hopefully).
fprintf( m_fp, "%s", TO_UTF8( (*m_props)["header"] ) ); fprintf( m_fp, "%s", TO_UTF8( header ) );
} }
saveAllSections(); saveAllSections();
......
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