From 0652ab4fd2d8064d21e66b9264203d4004ccfd5b Mon Sep 17 00:00:00 2001 From: stambaughw Date: Fri, 1 May 2009 18:06:03 +0000 Subject: [PATCH] PCBNew UI normalization and global variable reductions. * All: remove all remaining occurrences of g_DialogFont and dialog font menu handers. * All: remove all remaining non-standard fonts and button text colors from common dialogs. * PCBNew: remove all non-standard fonts and button text colors from dialogs. * PCBNew: update project library and path dialog to match changes to CVPCB version. * EESchema: update project library and path dialog to match changes to CVPCB version. * EESchema: save vertical/horizontal line direction setting between sessions. --- common/basicframe.cpp | 35 - common/common.cpp | 2 - common/drawframe.cpp | 43 - common/edaappl.cpp | 23 - common/selcolor.cpp | 134 +- eeschema/dialog_build_BOM.cpp | 2 - eeschema/dialog_eeschema_config.cpp | 63 +- eeschema/dialog_eeschema_config_fbp.cpp | 156 +- eeschema/dialog_eeschema_config_fbp.fbp | 1418 +++++------------ eeschema/dialog_eeschema_config_fbp.h | 28 +- eeschema/dialog_options.cpp | 4 +- eeschema/eeconfig.cpp | 4 +- eeschema/eeschema.cpp | 2 +- eeschema/general.h | 3 +- eeschema/schframe.cpp | 1 + include/common.h | 2 - include/id.h | 9 - include/wxstruct.h | 15 +- pcbnew/block.cpp | 6 +- pcbnew/cotation.cpp | 3 - pcbnew/dialog_SVG_print.cpp | 1 - pcbnew/dialog_display_options_base.cpp | 4 - pcbnew/dialog_display_options_base.fbp | 4 +- pcbnew/dialog_drc.cpp | 8 +- pcbnew/dialog_drc.h | 2 +- pcbnew/dialog_drc.pjd | 16 +- pcbnew/dialog_edit_module.cpp | 14 - pcbnew/dialog_edit_module_text.cpp | 1 - pcbnew/dialog_edit_module_text_base.cpp | 4 - pcbnew/dialog_edit_module_text_base.fbp | 4 +- pcbnew/dialog_gendrill.cpp | 11 +- pcbnew/dialog_gendrill.pjd | 9 +- pcbnew/dialog_general_options.cpp | 1 - ...ialog_general_options_BoardEditor_base.cpp | 16 +- ...ialog_general_options_BoardEditor_base.fbp | 89 +- .../dialog_general_options_BoardEditor_base.h | 7 +- pcbnew/dialog_graphic_item_properties.cpp | 1 - pcbnew/dialog_graphic_items_options.cpp | 6 +- pcbnew/dialog_graphic_items_options.pjd | 12 +- pcbnew/dialog_initpcb.cpp | 2 - pcbnew/dialog_pad_properties.cpp | 2 - pcbnew/dialog_pad_properties_base.cpp | 6 +- pcbnew/dialog_pad_properties_base.fbp | 4 +- pcbnew/dialog_pcb_text_properties.cpp | 1 - .../dialog_pcbnew_config_libs_and_paths.cpp | 74 +- ...ialog_pcbnew_config_libs_and_paths_fbp.cpp | 129 +- ...ialog_pcbnew_config_libs_and_paths_fbp.fbp | 1230 +++++--------- .../dialog_pcbnew_config_libs_and_paths_fbp.h | 34 +- pcbnew/dialog_print_using_printer.cpp | 1 - pcbnew/dialog_track_options.cpp | 1 - pcbnew/dialog_track_options_base.cpp | 4 - pcbnew/dialog_track_options_base.fbp | 4 +- pcbnew/find.cpp | 89 +- pcbnew/find.h | 10 +- pcbnew/find.pjd | 196 ++- pcbnew/globaleditpad.cpp | 9 - pcbnew/menubarpcb.cpp | 3 - pcbnew/mirepcb.cpp | 3 - pcbnew/muonde.cpp | 4 - pcbnew/pcbframe.cpp | 3 - pcbnew/pcbplot.cpp | 5 - pcbnew/sel_layer.cpp | 6 - pcbnew/set_color.cpp | 6 - pcbnew/set_grid.cpp | 16 +- pcbnew/set_grid.h | 6 +- pcbnew/set_grid.pjd | 140 +- pcbnew/swap_layers.cpp | 229 +-- pcbnew/xchgmod.cpp | 184 ++- 68 files changed, 1655 insertions(+), 2909 deletions(-) diff --git a/common/basicframe.cpp b/common/basicframe.cpp index 1c96b67b64..cce106b678 100644 --- a/common/basicframe.cpp +++ b/common/basicframe.cpp @@ -285,38 +285,3 @@ void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) ) InitKiCadAbout(info); wxAboutBox(info); } - - -/* - * - */ -/********************************************************************/ -void WinEDA_BasicFrame::ProcessFontPreferences( int id ) -/********************************************************************/ -{ - wxFont font; - - switch( id ) - { - case ID_PREFERENCES_FONT: - break; - - case ID_PREFERENCES_FONT_DIALOG: - font = wxGetFontFromUser( this, *g_DialogFont ); - if( font.Ok() ) - { - int pointsize = font.GetPointSize(); - *g_DialogFont = font; - SetFont( *g_DialogFont ); - g_DialogFontPointSize = pointsize; - g_FixedFontPointSize = pointsize; - g_FixedFont->SetPointSize( g_FixedFontPointSize ); - } - break; - - default: - DisplayError( this, wxT( "WinEDA_BasicFrame::ProcessFontPreferences Internal Error" ) ); - break; - } -} - diff --git a/common/common.cpp b/common/common.cpp index 83042a23eb..5b241e1ef4 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -72,10 +72,8 @@ wxString g_UserLibDirBuffer; int g_DebugLevel; int g_MouseOldButtons; int g_KeyPressed; -wxFont* g_DialogFont = NULL; /* Normal font used in dialog box */ wxFont* g_FixedFont = NULL; /* Affichage de Texte en fenetres de dialogue, * fonte a pas fixe)*/ -int g_DialogFontPointSize; /* taille de la fonte */ int g_FixedFontPointSize; /* taille de la fonte */ int g_FontMinPointSize; /* taille minimum des fontes */ diff --git a/common/drawframe.cpp b/common/drawframe.cpp index e9638d9e7a..8810a1d2da 100644 --- a/common/drawframe.cpp +++ b/common/drawframe.cpp @@ -114,49 +114,6 @@ WinEDA_DrawFrame::~WinEDA_DrawFrame() } -/****************************************************************/ -void WinEDA_DrawFrame::AddFontSelectionMenu( wxMenu* main_menu ) -/*****************************************************************/ - -/* create the submenu for font selection and setup font size - */ -{ - wxMenu* fontmenu = new wxMenu(); - - ADD_MENUITEM( fontmenu, - ID_PREFERENCES_FONT_DIALOG, - _( "Dialog boxes" ), - fonts_xpm ); - - ADD_MENUITEM_WITH_HELP_AND_SUBMENU( main_menu, - fontmenu, - ID_PREFERENCES_FONT, - _( "&Font" ), - _( "Choose font type and size for dialogs, infos and status box" ), - fonts_xpm ); -} - -/********************************************************************/ -void WinEDA_DrawFrame::ProcessFontPreferences( wxCommandEvent& event ) -/********************************************************************/ -{ - int id = event.GetId(); - - switch( id ) - { - case ID_PREFERENCES_FONT: - case ID_PREFERENCES_FONT_DIALOG: - WinEDA_BasicFrame::ProcessFontPreferences( id ); - break; - - default: - DisplayError( this, wxT( "WinEDA_DrawFrame::ProcessFontPreferences " \ - "Internal Error" ) ); - break; - } -} - - /**************************************************************/ void WinEDA_DrawFrame::Affiche_Message( const wxString& message ) /**************************************************************/ diff --git a/common/edaappl.cpp b/common/edaappl.cpp index 8cfb6e05c3..31d86b7d64 100644 --- a/common/edaappl.cpp +++ b/common/edaappl.cpp @@ -248,7 +248,6 @@ WinEDA_App::~WinEDA_App() if( m_EDA_CommonConfig ) delete m_EDA_CommonConfig; delete m_EDA_Config; - delete g_DialogFont; delete g_FixedFont; if( m_Checker ) delete m_Checker; @@ -305,12 +304,8 @@ void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId ) wxASSERT( m_EDA_CommonConfig != NULL ); /* Create the fonts used in dialogs and messages */ - g_DialogFontPointSize = FONT_DEFAULT_SIZE; g_FixedFontPointSize = FONT_DEFAULT_SIZE; - g_DialogFont = new wxFont( g_DialogFontPointSize, wxFONTFAMILY_ROMAN, - wxNORMAL, wxNORMAL ); - g_FixedFont = new wxFont( g_FixedFontPointSize, wxFONTFAMILY_MODERN, wxNORMAL, wxNORMAL ); @@ -645,21 +640,9 @@ void WinEDA_App::GetSettings() m_fileHistory.Load( *m_EDA_Config ); /* Set default font sizes */ - g_DialogFontPointSize = m_EDA_Config->Read( wxT( "DialogFontSize" ), - FONT_DEFAULT_SIZE ); g_FixedFontPointSize = m_EDA_Config->Read( wxT( "FixedFontSize" ), FONT_DEFAULT_SIZE ); - Line = m_EDA_Config->Read( wxT( "DialogFontType" ), wxEmptyString ); - if( !Line.IsEmpty() ) - g_DialogFont->SetFaceName( Line ); - - ii = m_EDA_Config->Read( wxT( "DialogFontStyle" ), wxFONTFAMILY_ROMAN ); - g_DialogFont->SetStyle( ii ); - ii = m_EDA_Config->Read( wxT( "DialogFontWeight" ), wxNORMAL ); - g_DialogFont->SetWeight( ii ); - g_DialogFont->SetPointSize( g_DialogFontPointSize ); - g_FixedFont->SetPointSize( g_FixedFontPointSize ); m_EDA_Config->Read( wxT( "ShowPageLimits" ), &g_ShowPageLimits ); @@ -687,12 +670,6 @@ void WinEDA_App::SaveSettings() #if wxCHECK_VERSION( 2, 9, 0 ) #warning TODO: under wxWidgets 3.0, see how to replace the next lines #else - /* Dialog font settings */ - m_EDA_Config->Write( wxT( "DialogFontSize" ), g_DialogFontPointSize ); - m_EDA_Config->Write( wxT( "DialogFontType" ), g_DialogFont->GetFaceName() ); - m_EDA_Config->Write( wxT( "DialogFontStyle" ), g_DialogFont->GetStyle() ); - m_EDA_Config->Write( wxT( "DialogFontWeight" ), g_DialogFont->GetWeight() ); - /* Misc settings */ m_EDA_Config->Write( wxT( "FixedFontSize" ), g_FixedFontPointSize ); m_EDA_Config->Write( wxT( "ShowPageLimits" ), g_ShowPageLimits ); diff --git a/common/selcolor.cpp b/common/selcolor.cpp index 6c083d061a..3e3ff6e2d9 100644 --- a/common/selcolor.cpp +++ b/common/selcolor.cpp @@ -2,6 +2,7 @@ /****************/ /* SELCOLOR.CPP */ /****************/ + /* Affichage et selection de la palette des couleurs disponibles * dans une frame */ @@ -22,8 +23,9 @@ enum colors_id { /*******************************************/ -class WinEDA_SelColorFrame: public wxDialog +class WinEDA_SelColorFrame : public wxDialog /*******************************************/ + /* Frame d'affichage de la palette des couleurs disponibles */ { @@ -31,19 +33,20 @@ private: public: // Constructor and destructor - WinEDA_SelColorFrame( wxWindow *parent, + WinEDA_SelColorFrame( wxWindow* parent, const wxPoint& framepos, int OldColor ); ~WinEDA_SelColorFrame() {}; private: - void OnCancel(wxCommandEvent& event); - void SelColor(wxCommandEvent& event); + void OnCancel( wxCommandEvent& event ); + void SelColor( wxCommandEvent& event ); + DECLARE_EVENT_TABLE() }; /* Construction de la table des evenements pour FrameClassMain */ -BEGIN_EVENT_TABLE(WinEDA_SelColorFrame, wxDialog) +BEGIN_EVENT_TABLE( WinEDA_SelColorFrame, wxDialog ) EVT_BUTTON( wxID_CANCEL, WinEDA_SelColorFrame::OnCancel ) EVT_COMMAND_RANGE( ID_COLOR_BLACK, ID_COLOR_BLACK + 31, wxEVT_COMMAND_BUTTON_CLICKED, @@ -51,17 +54,15 @@ BEGIN_EVENT_TABLE(WinEDA_SelColorFrame, wxDialog) END_EVENT_TABLE() -/***************************************/ -int DisplayColorFrame(wxWindow * parent, int OldColor) -/***************************************/ +int DisplayColorFrame( wxWindow* parent, int OldColor ) { -wxPoint framepos; -int color; + wxPoint framepos; + int color; - wxGetMousePosition(&framepos.x, &framepos.y); + wxGetMousePosition( &framepos.x, &framepos.y ); - WinEDA_SelColorFrame * frame = new WinEDA_SelColorFrame( parent, - framepos, OldColor ); + WinEDA_SelColorFrame* frame = new WinEDA_SelColorFrame( parent, + framepos, OldColor ); color = frame->ShowModal(); frame->Destroy(); if( color > NBCOLOR ) @@ -70,78 +71,76 @@ int color; } -/*******************************************************************/ -WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow *parent, - const wxPoint& framepos, int OldColor ): - wxDialog( parent, -1, _("Colors"), framepos, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER ) -/*******************************************************************/ +WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow* parent, + const wxPoint& framepos, + int OldColor ) : + wxDialog( parent, -1, _( "Colors" ), framepos, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER ) { - wxBoxSizer* OuterBoxSizer = NULL; - wxBoxSizer* MainBoxSizer = NULL; - wxFlexGridSizer* FlexColumnBoxSizer = NULL; - wxBitmapButton* BitmapButton = NULL; - wxStaticText* Label = NULL; - wxStaticLine* Line = NULL; + wxBoxSizer* OuterBoxSizer = NULL; + wxBoxSizer* MainBoxSizer = NULL; + wxFlexGridSizer* FlexColumnBoxSizer = NULL; + wxBitmapButton* BitmapButton = NULL; + wxStaticText* Label = NULL; + wxStaticLine* Line = NULL; wxStdDialogButtonSizer* StdDialogButtonSizer = NULL; - wxButton* Button = NULL; + wxButton* Button = NULL; - int ii, butt_ID, buttcolor; - int w = 20, h = 20; - bool ColorFound = false; - - SetFont( *g_DialogFont ); + int ii, butt_ID, buttcolor; + int w = 20, h = 20; + bool ColorFound = false; SetReturnCode( -1 ); - OuterBoxSizer = new wxBoxSizer(wxVERTICAL); - SetSizer(OuterBoxSizer); + OuterBoxSizer = new wxBoxSizer( wxVERTICAL ); + SetSizer( OuterBoxSizer ); - MainBoxSizer = new wxBoxSizer(wxHORIZONTAL); - OuterBoxSizer->Add(MainBoxSizer, 1, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); + MainBoxSizer = new wxBoxSizer( wxHORIZONTAL ); + OuterBoxSizer->Add( MainBoxSizer, 1, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); for( ii = 0; ColorRefs[ii].m_Name != NULL; ii++ ) { - // Provide a separate column for every eight buttons (and their associated text - // strings), so provide a FlexGrid Sizer with eight rows and two columns. + // Provide a separate column for every eight buttons (and their + // associated text strings), so provide a FlexGrid Sizer with + // eight rows and two columns. if( ii % 8 == 0 ) { - FlexColumnBoxSizer = new wxFlexGridSizer(8, 2, 0, 0); + FlexColumnBoxSizer = new wxFlexGridSizer( 8, 2, 0, 0 ); // Specify that all of the rows can be expanded. for( int ii = 0; ii < 8; ii++ ) { - FlexColumnBoxSizer->AddGrowableRow(ii); + FlexColumnBoxSizer->AddGrowableRow( ii ); } // Specify that the second column can also be expanded. - FlexColumnBoxSizer->AddGrowableCol(1); + FlexColumnBoxSizer->AddGrowableCol( 1 ); - MainBoxSizer->Add(FlexColumnBoxSizer, 1, wxGROW|wxTOP, 5); + MainBoxSizer->Add( FlexColumnBoxSizer, 1, wxGROW | wxTOP, 5 ); } butt_ID = ID_COLOR_BLACK + ii; wxMemoryDC iconDC; - wxBitmap ButtBitmap( w, h ); - wxBrush Brush; + wxBitmap ButtBitmap( w, h ); + wxBrush Brush; iconDC.SelectObject( ButtBitmap ); buttcolor = ColorRefs[ii].m_Numcolor; iconDC.SetPen( *wxBLACK_PEN ); - Brush.SetColour( - ColorRefs[buttcolor].m_Red, - ColorRefs[buttcolor].m_Green, - ColorRefs[buttcolor].m_Blue - ); + Brush.SetColour( ColorRefs[buttcolor].m_Red, + ColorRefs[buttcolor].m_Green, + ColorRefs[buttcolor].m_Blue ); Brush.SetStyle( wxSOLID ); iconDC.SetBrush( Brush ); iconDC.SetBackground( *wxGREY_BRUSH ); iconDC.Clear(); - iconDC.DrawRoundedRectangle( 0, 0, w, h, (double)h / 3 ); + iconDC.DrawRoundedRectangle( 0, 0, w, h, (double) h / 3 ); BitmapButton = new wxBitmapButton( this, butt_ID, ButtBitmap, wxDefaultPosition, wxSize( w, h ) ); - FlexColumnBoxSizer->Add(BitmapButton, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxBOTTOM, 5); + FlexColumnBoxSizer->Add( BitmapButton, 0, + wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | + wxLEFT | wxBOTTOM, 5 ); // Set focus to this button if its color matches the // color which had been selected previously (for @@ -154,23 +153,26 @@ WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow *parent, Label = new wxStaticText( this, -1, ColorRefs[ii].m_Name, wxDefaultPosition, wxDefaultSize, 0 ); - FlexColumnBoxSizer->Add(Label, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); + FlexColumnBoxSizer->Add( Label, 1, + wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | + wxLEFT | wxRIGHT | wxBOTTOM, 5 ); } // Provide a Cancel button as well, so that this dialog - // box can also be cancelled by pressing the Esc key + // box can also be canceled by pressing the Esc key // (and also provide a horizontal static line to separate // that button from all of the other buttons). - Line = new wxStaticLine( this, -1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - OuterBoxSizer->Add(Line, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); + Line = new wxStaticLine( this, -1, wxDefaultPosition, + wxDefaultSize, wxLI_HORIZONTAL ); + OuterBoxSizer->Add( Line, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); StdDialogButtonSizer = new wxStdDialogButtonSizer; - OuterBoxSizer->Add(StdDialogButtonSizer, 0, wxGROW|wxALL, 10); + OuterBoxSizer->Add( StdDialogButtonSizer, 0, wxGROW | wxALL, 10 ); - Button = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - Button->SetForegroundColour( *wxBLUE ); - StdDialogButtonSizer->AddButton(Button); + Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ), wxDefaultPosition, + wxDefaultSize, 0 ); + StdDialogButtonSizer->AddButton( Button ); StdDialogButtonSizer->Realize(); @@ -183,29 +185,23 @@ WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow *parent, // Resize the dialog if( GetSizer() ) { - GetSizer()->SetSizeHints(this); + GetSizer()->SetSizeHints( this ); } } -/***************************************************************/ -void WinEDA_SelColorFrame::OnCancel(wxCommandEvent& WXUNUSED(event)) -/***************************************************************/ -/* Called by the Cancel button - */ +void WinEDA_SelColorFrame::OnCancel( wxCommandEvent& WXUNUSED( event ) ) { // Setting the return value to -1 indicates that the - // dialog box has been cancelled (and thus that the + // dialog box has been canceled (and thus that the // previously selected color is to be retained). EndModal( -1 ); } -/*********************************************************/ -void WinEDA_SelColorFrame::SelColor(wxCommandEvent& event) -/*********************************************************/ +void WinEDA_SelColorFrame::SelColor( wxCommandEvent& event ) { -int id = event.GetId(); + int id = event.GetId(); EndModal( id - ID_COLOR_BLACK ); } diff --git a/eeschema/dialog_build_BOM.cpp b/eeschema/dialog_build_BOM.cpp index 5db1ae41e7..841b0fb9d2 100644 --- a/eeschema/dialog_build_BOM.cpp +++ b/eeschema/dialog_build_BOM.cpp @@ -98,8 +98,6 @@ DIALOG_BUILD_BOM::DIALOG_BUILD_BOM( WinEDA_DrawFrame* parent ): void DIALOG_BUILD_BOM::Init() { - SetFont( *g_DialogFont ); - SetFocus(); /* Get options */ diff --git a/eeschema/dialog_eeschema_config.cpp b/eeschema/dialog_eeschema_config.cpp index 6f456aeff6..0e9a411851 100644 --- a/eeschema/dialog_eeschema_config.cpp +++ b/eeschema/dialog_eeschema_config.cpp @@ -1,5 +1,4 @@ ///////////////////////////////////////////////////////////////////////////// - // Name: dialog_eeschema_config.cpp // Purpose: // Author: jean-pierre Charras @@ -32,14 +31,13 @@ private: WinEDA_SchematicFrame* m_Parent; bool m_LibListChanged; bool m_LibPathChanged; - wxString m_UserLibDirBufferImg; // Copy of original g_UserLibDirBuffer + wxString m_UserLibDirBufferImg; // Copy of original g_UserLibDirBuffer private: // event handlers, overiding the fbp handlers void Init(); void OnCloseWindow( wxCloseEvent& event ); - void OnSaveCfgClick( wxCommandEvent& event ); void OnRemoveLibClick( wxCommandEvent& event ); void OnAddOrInsertLibClick( wxCommandEvent& event ); void OnAddOrInsertPath( wxCommandEvent& event ); @@ -87,27 +85,13 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent ) void DIALOG_EESCHEMA_CONFIG::Init() /***********************************/ { + wxString msg; + SetFocus(); m_LibListChanged = false; m_LibPathChanged = false; - m_UserLibDirBufferImg = m_Parent->m_UserLibraryPath; // Save the original lib path - - // Display current files extension (info) - wxString msg = m_InfoCmpFileExt->GetLabel() + g_NetCmpExtBuffer; - m_InfoCmpFileExt->SetLabel( msg ); - - msg = m_InfoNetFileExt->GetLabel() + NetlistFileExtension; - m_InfoNetFileExt->SetLabel( msg ); - - msg = m_InfoLibFileExt->GetLabel() + CompLibFileExtension; - m_InfoLibFileExt->SetLabel( msg ); - - msg = m_InfoSymbFileExt->GetLabel() + g_SymbolExtBuffer; - m_InfoSymbFileExt->SetLabel( msg ); - - msg = m_InfoSchFileExt->GetLabel() + SchematicFileExtension; - m_InfoSchFileExt->SetLabel( msg ); + m_UserLibDirBufferImg = m_Parent->m_UserLibraryPath; // Init currently availlable netlist formats wxArrayString NetlistNameItems; @@ -165,7 +149,8 @@ void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event ) wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString(ii)) ; wxGetApp().InsertLibraryPath( m_Parent->m_UserLibraryPath, 1); } - EndModal( -1 ); + + EndModal( wxID_CANCEL ); } @@ -188,8 +173,9 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event ) } } - - // Set new active library list if the lib list of if default path list was modified + /* Set new active library list if the lib list of if default path list + * was modified + */ if( m_LibListChanged || m_LibPathChanged ) { // Recreate lib list @@ -202,15 +188,16 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event ) if( m_Parent->m_ViewlibFrame ) m_Parent->m_ViewlibFrame->ReCreateListLib(); } - if ( event.GetId() != ID_SAVE_CFG ) - EndModal( 0 ); + + m_Parent->SaveProjectFile( this ); + EndModal( wxID_OK ); } /**************************************************************/ void DIALOG_EESCHEMA_CONFIG::OnCloseWindow( wxCloseEvent& event ) /**************************************************************/ { - EndModal( 0 ); + EndModal( wxID_CANCEL ); } @@ -277,9 +264,9 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) * list, just add the library name to the list. Otherwise, add * the library name with the full or relative path. * the relative path, when possible is preferable, - * because it preserve use of default libraries paths, when the path is a sub path of these default paths - * - */ + * because it preserve use of default libraries paths, when the path + * is a sub path of these default paths + */ if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case libfilename = fn.GetName(); else // not in the default, : see if this file is in a subpath: @@ -315,26 +302,15 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) -/*******************************************************************/ -void DIALOG_EESCHEMA_CONFIG::OnSaveCfgClick( wxCommandEvent& event ) -/*******************************************************************/ -{ - OnOkClick( event ); - m_Parent->SaveProjectFile( this ); -} - - /***********************************************************************/ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event ) /***********************************************************************/ { wxString path = wxGetApp().ReturnLastVisitedLibraryPath(); - bool select = EDA_DirectorySelector( _( "Default Path for Libraries" ), /* Titre de la fenetre */ - path, /* Chemin par defaut */ - wxDD_DEFAULT_STYLE, - this, /* parent frame */ - wxDefaultPosition ); + bool select = EDA_DirectorySelector( _( "Default Path for Libraries" ), + path, wxDD_DEFAULT_STYLE, + this, wxDefaultPosition ); if( !select ) return; @@ -365,7 +341,6 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event ) m_DefaultLibraryPathslistBox->Append( libpaths[ii]); } } - else DisplayError(this, _("Path already in use") ); diff --git a/eeschema/dialog_eeschema_config_fbp.cpp b/eeschema/dialog_eeschema_config_fbp.cpp index 1f20b35d3e..671bbcb6cc 100644 --- a/eeschema/dialog_eeschema_config_fbp.cpp +++ b/eeschema/dialog_eeschema_config_fbp.cpp @@ -16,68 +16,30 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bUpperSizer; - bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); + wxStaticBoxSizer* sbSizer5; + sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Default netlist format") ), wxHORIZONTAL ); + + m_NetFormatBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxSize( 150,70 ), 0, NULL, wxLB_NEEDED_SB|wxLB_SINGLE ); + sbSizer5->Add( m_NetFormatBox, 0, wxALL|wxEXPAND, 5 ); + + + sbSizer5->Add( 0, 15, 0, wxEXPAND, 5 ); + + bMainSizer->Add( sbSizer5, 0, wxALL, 5 ); wxBoxSizer* bLeftSizer; - bLeftSizer = new wxBoxSizer( wxVERTICAL ); + bLeftSizer = new wxBoxSizer( wxHORIZONTAL ); - m_staticTextNetListFormats = new wxStaticText( this, wxID_ANY, _("NetList Formats:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextNetListFormats->Wrap( -1 ); - bLeftSizer->Add( m_staticTextNetListFormats, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_NetFormatBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE ); - bLeftSizer->Add( m_NetFormatBox, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - - bLeftSizer->Add( 0, 20, 0, wxEXPAND, 5 ); - - wxStaticBoxSizer* sFileExtBox; - sFileExtBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Files ext:") ), wxVERTICAL ); - - m_InfoCmpFileExt = new wxStaticText( this, wxID_ANY, _("Cmp file Ext: "), wxDefaultPosition, wxDefaultSize, 0 ); - m_InfoCmpFileExt->Wrap( -1 ); - sFileExtBox->Add( m_InfoCmpFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_InfoNetFileExt = new wxStaticText( this, wxID_ANY, _("Net file Ext: "), wxDefaultPosition, wxDefaultSize, 0 ); - m_InfoNetFileExt->Wrap( -1 ); - sFileExtBox->Add( m_InfoNetFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_InfoLibFileExt = new wxStaticText( this, wxID_ANY, _("Library file Ext: "), wxDefaultPosition, wxDefaultSize, 0 ); - m_InfoLibFileExt->Wrap( -1 ); - sFileExtBox->Add( m_InfoLibFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_InfoSymbFileExt = new wxStaticText( this, wxID_ANY, _("Symbol file Ext: "), wxDefaultPosition, wxDefaultSize, 0 ); - m_InfoSymbFileExt->Wrap( -1 ); - sFileExtBox->Add( m_InfoSymbFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_InfoSchFileExt = new wxStaticText( this, wxID_ANY, _("Schematic file Ext: "), wxDefaultPosition, wxDefaultSize, 0 ); - m_InfoSchFileExt->Wrap( -1 ); - sFileExtBox->Add( m_InfoSchFileExt, 0, wxALL, 5 ); - - bLeftSizer->Add( sFileExtBox, 0, wxEXPAND, 5 ); - - bUpperSizer->Add( bLeftSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + bMainSizer->Add( bLeftSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); wxStaticBoxSizer* sbLibsChoiceSizer; - sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Libraries") ), wxVERTICAL ); - - wxBoxSizer* bLibsButtonsSizer; - bLibsButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); - - sbLibsChoiceSizer->Add( bLibsButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticTextlibList = new wxStaticText( this, wxID_ANY, _("Active Libraries:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextlibList->Wrap( -1 ); - sbLibsChoiceSizer->Add( m_staticTextlibList, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Component library files") ), wxHORIZONTAL ); m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Eeschema.\nThe order of this list is important:\nEeschema searchs for a given component using this list order priority.") ); - m_ListLibr->SetMinSize( wxSize( 300,-1 ) ); + m_ListLibr->SetMinSize( wxSize( 400,90 ) ); - sbLibsChoiceSizer->Add( m_ListLibr, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - bUpperSizer->Add( sbLibsChoiceSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + sbLibsChoiceSizer->Add( m_ListLibr, 1, wxALL|wxEXPAND, 5 ); wxBoxSizer* bRightSizer; bRightSizer = new wxBoxSizer( wxVERTICAL ); @@ -85,102 +47,85 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") ); - bRightSizer->Add( m_buttonAddLib, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + bRightSizer->Add( m_buttonAddLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5 ); m_buttonIns = new wxButton( this, wxID_ANY, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") ); - bRightSizer->Add( m_buttonIns, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + bRightSizer->Add( m_buttonIns, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5 ); m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); bRightSizer->Add( m_buttonRemoveLib, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + sbLibsChoiceSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - bRightSizer->Add( 0, 20, 1, wxEXPAND, 5 ); - - m_buttonOk = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_buttonSave = new wxButton( this, ID_SAVE_CFG, _("Save Cfg"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSave->SetToolTip( _("Accept and save current configuration setting in the local .pro file") ); - - bRightSizer->Add( m_buttonSave, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - bUpperSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); - - wxStaticBoxSizer* sbLibPathSizer; - sbLibPathSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Path for Libraries Files:") ), wxVERTICAL ); - - wxBoxSizer* bUserLibPathSizer; - bUserLibPathSizer = new wxBoxSizer( wxHORIZONTAL ); + bMainSizer->Add( sbLibsChoiceSizer, 1, wxALL|wxEXPAND, 5 ); wxStaticBoxSizer* sbSizer4; - sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User Path:") ), wxHORIZONTAL ); + sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User defined search path") ), wxHORIZONTAL ); - wxBoxSizer* bUserListSizer; - bUserListSizer = new wxBoxSizer( wxVERTICAL ); - - m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is highter than default Kicad paths.") ); + m_listUserPaths->SetMinSize( wxSize( 400,90 ) ); - bUserListSizer->Add( m_listUserPaths, 1, wxEXPAND, 5 ); - - sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + sbSizer4->Add( m_listUserPaths, 1, wxALL|wxEXPAND, 5 ); wxBoxSizer* bUserPathsButtonsSizer; bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); m_buttonAddPath = new wxButton( this, ID_LIB_PATH_SEL, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); m_buttonInsPath = new wxButton( this, wxID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxRIGHT|wxLEFT, 5 ); + bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxALL, 5 ); - sbSizer4->Add( bUserPathsButtonsSizer, 0, wxEXPAND, 5 ); + sbSizer4->Add( bUserPathsButtonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - bUserLibPathSizer->Add( sbSizer4, 1, wxEXPAND, 5 ); + bMainSizer->Add( sbSizer4, 0, wxALL|wxEXPAND, 5 ); - sbLibPathSizer->Add( bUserLibPathSizer, 1, wxEXPAND, 5 ); - - m_staticTextcurrenpaths = new wxStaticText( this, wxID_ANY, _("Current Full Paths (for Libraries and Doc Files) in Use:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextcurrenpaths->Wrap( -1 ); - sbLibPathSizer->Add( m_staticTextcurrenpaths, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + wxStaticBoxSizer* sbLibPathSizer; + sbLibPathSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Current search path list") ), wxVERTICAL ); m_DefaultLibraryPathslistBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); m_DefaultLibraryPathslistBox->SetToolTip( _("Paths (system paths and user paths) used to search and load libraries files and component doc files.\nSorted by decreasing priority order.") ); m_DefaultLibraryPathslistBox->SetMinSize( wxSize( -1,70 ) ); - sbLibPathSizer->Add( m_DefaultLibraryPathslistBox, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + sbLibPathSizer->Add( m_DefaultLibraryPathslistBox, 0, wxALL|wxEXPAND, 5 ); - bMainSizer->Add( sbLibPathSizer, 0, wxEXPAND, 5 ); + bMainSizer->Add( sbLibPathSizer, 0, wxALL|wxEXPAND, 5 ); + + m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bMainSizer->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( bMainSizer ); this->Layout(); + bMainSizer->Fit( this ); + + this->Centre( wxBOTH ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonIns->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); - m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnSaveCfgClick ), NULL, this ); m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); + m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); } DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP() @@ -190,10 +135,9 @@ DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP() m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonIns->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); - m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); - m_buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnSaveCfgClick ), NULL, this ); m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); + m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); } diff --git a/eeschema/dialog_eeschema_config_fbp.fbp b/eeschema/dialog_eeschema_config_fbp.fbp index b90217331f..16629ef103 100644 --- a/eeschema/dialog_eeschema_config_fbp.fbp +++ b/eeschema/dialog_eeschema_config_fbp.fbp @@ -20,7 +20,7 @@ 0 - + wxBOTH 1 @@ -32,7 +32,7 @@ DIALOG_EESCHEMA_CONFIG_FBP - 593,559 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER @@ -77,537 +77,158 @@ none 5 - wxEXPAND - 1 - + wxALL + 0 + + wxID_ANY + Default netlist format - bUpperSizer + sbSizer5 wxHORIZONTAL none + 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT + wxALL|wxEXPAND 0 - - - bLeftSizer - wxVERTICAL - none - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - NetList Formats: - - - m_staticTextNetListFormats - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - - - - 1 - - - 0 - wxID_ANY - - - m_NetFormatBox - protected - - - wxLB_SINGLE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - 20 - protected - 0 - - - - 5 - wxEXPAND - 0 - - wxID_ANY - Files ext: - - sFileExtBox - wxVERTICAL - none - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Cmp file Ext: - - - m_InfoCmpFileExt - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Net file Ext: - - - m_InfoNetFileExt - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Library file Ext: - - - m_InfoLibFileExt - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Symbol file Ext: - - - m_InfoSymbFileExt - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - - 1 - - - 0 - wxID_ANY - Schematic file Ext: - - - m_InfoSchFileExt - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 1 - + + + + + 1 + + + 0 wxID_ANY - Libraries + - sbLibsChoiceSizer - wxVERTICAL - none + m_NetFormatBox + protected + + 150,70 + wxLB_NEEDED_SB|wxLB_SINGLE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - 5 - wxALIGN_CENTER_HORIZONTAL - 0 - - - bLibsButtonsSizer - wxHORIZONTAL - none - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Active Libraries: - - - m_staticTextlibList - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 1 - - - - - 1 - - - 0 - wxID_ANY - - 300,-1 - m_ListLibr - protected - - - wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE - - List of active library files. Only library files in this list are loaded by Eeschema. The order of this list is important: Eeschema searchs for a given component using this list order priority. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL + wxEXPAND + 0 + + 15 + protected + 0 + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + + bLeftSizer + wxHORIZONTAL + none + + + + 5 + wxALL|wxEXPAND + 1 + + wxID_ANY + Component library files + + sbLibsChoiceSizer + wxHORIZONTAL + none + + + 5 + wxALL|wxEXPAND + 1 + + + + + 1 + + + 0 + wxID_ANY + + 400,90 + m_ListLibr + protected + + + wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE + + List of active library files. Only library files in this list are loaded by Eeschema. The order of this list is important: Eeschema searchs for a given component using this list order priority. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL 0 @@ -616,7 +237,7 @@ none 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP 0 @@ -668,7 +289,7 @@ 5 - wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP 0 @@ -770,518 +391,47 @@ - - 5 - wxEXPAND - 1 - - 20 - protected - 0 - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - - - 0 - 1 - - - 0 - wxID_OK - Ok - - - m_buttonOk - protected - - - - - - - - - OnOkClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_CANCEL - Cancel - - - m_buttonCancel - protected - - - - - - - - - OnCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - - - 0 - 1 - - - 0 - ID_SAVE_CFG - Save Cfg - - - m_buttonSave - protected - - - - - Accept and save current configuration setting in the local .pro file - - - - OnSaveCfgClick - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND | wxALL - 0 - - - - 1 - - - 0 - wxID_ANY - - - m_staticline1 - protected - - - wxLI_HORIZONTAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND + wxALL|wxEXPAND 0 wxID_ANY - Path for Libraries Files: + User defined search path - sbLibPathSizer - wxVERTICAL + sbSizer4 + wxHORIZONTAL none 5 - wxEXPAND + wxALL|wxEXPAND 1 - - - bUserLibPathSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - wxID_ANY - User Path: - - sbSizer4 - wxHORIZONTAL - none - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 1 - - - bUserListSizer - wxVERTICAL - none - - 5 - wxEXPAND - 1 - - - - - 1 - - - 0 - wxID_ANY - - - m_listUserPaths - protected - - - - - Additional paths used in this project. The priority is highter than default Kicad paths. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bUserPathsButtonsSizer - wxVERTICAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_LIB_PATH_SEL - Add - - - m_buttonAddPath - protected - - - - - - - - - OnAddOrInsertPath - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_INSERT_PATH - Insert - - - m_buttonInsPath - protected - - - - - - - - - OnAddOrInsertPath - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_REMOVE_PATH - Remove - - - m_buttonRemovePath - protected - - - - - - - - - OnRemoveUserPath - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - + + 1 0 wxID_ANY - Current Full Paths (for Libraries and Doc Files) in Use: - - m_staticTextcurrenpaths + 400,90 + m_listUserPaths protected - + wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE - + Additional paths used in this project. The priority is highter than default Kicad paths. - -1 @@ -1292,6 +442,8 @@ + + @@ -1309,7 +461,188 @@ 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + bUserPathsButtonsSizer + wxVERTICAL + none + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + + + 0 + 1 + + + 0 + ID_LIB_PATH_SEL + Add + + + m_buttonAddPath + protected + + + + + + + + + OnAddOrInsertPath + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + + + 0 + 1 + + + 0 + wxID_INSERT_PATH + Insert + + + m_buttonInsPath + protected + + + + + + + + + OnAddOrInsertPath + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 0 + 1 + + + 0 + wxID_REMOVE_PATH + Remove + + + m_buttonRemovePath + protected + + + + + + + + + OnRemoveUserPath + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + wxID_ANY + Current search path list + + sbLibPathSizer + wxVERTICAL + none + + + 5 + wxALL|wxEXPAND 0 @@ -1361,6 +694,81 @@ + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline3 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + public + + OnCancelClick + + + + OnOkClick + + + + diff --git a/eeschema/dialog_eeschema_config_fbp.h b/eeschema/dialog_eeschema_config_fbp.h index 28fda307b4..654c03dc1d 100644 --- a/eeschema/dialog_eeschema_config_fbp.h +++ b/eeschema/dialog_eeschema_config_fbp.h @@ -11,12 +11,11 @@ #include #include -#include +#include #include #include #include #include -#include #include #include #include @@ -37,50 +36,39 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog { ID_ADD_LIB = 1000, ID_REMOVE_LIB, - ID_SAVE_CFG, ID_LIB_PATH_SEL, wxID_INSERT_PATH, wxID_REMOVE_PATH, }; - wxStaticText* m_staticTextNetListFormats; wxListBox* m_NetFormatBox; - wxStaticText* m_InfoCmpFileExt; - wxStaticText* m_InfoNetFileExt; - wxStaticText* m_InfoLibFileExt; - wxStaticText* m_InfoSymbFileExt; - wxStaticText* m_InfoSchFileExt; - wxStaticText* m_staticTextlibList; wxListBox* m_ListLibr; wxButton* m_buttonAddLib; wxButton* m_buttonIns; wxButton* m_buttonRemoveLib; - - wxButton* m_buttonOk; - wxButton* m_buttonCancel; - wxButton* m_buttonSave; - wxStaticLine* m_staticline1; wxListBox* m_listUserPaths; wxButton* m_buttonAddPath; wxButton* m_buttonInsPath; wxButton* m_buttonRemovePath; - wxStaticText* m_staticTextcurrenpaths; wxListBox* m_DefaultLibraryPathslistBox; + wxStaticLine* m_staticline3; // Virtual event handlers, overide them in your derived class virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } virtual void OnAddOrInsertLibClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveLibClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnSaveCfgClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } public: - DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 593,559 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; + DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_EESCHEMA_CONFIG_FBP(); }; diff --git a/eeschema/dialog_options.cpp b/eeschema/dialog_options.cpp index e0928fb80d..5cc2f4f489 100644 --- a/eeschema/dialog_options.cpp +++ b/eeschema/dialog_options.cpp @@ -420,9 +420,9 @@ void WinEDA_SetOptionsFrame::Accept( wxCommandEvent& event ) g_ShowPageLimits = FALSE; if( m_SelDirWires->GetSelection() == 0 ) - g_HVLines = 1; + g_HVLines = true; else - g_HVLines = 0; + g_HVLines = false; if( m_Selunits->GetSelection() == 0 ) g_UnitMetric = 1; diff --git a/eeschema/eeconfig.cpp b/eeschema/eeconfig.cpp index 04eae661cf..04f443ab8a 100644 --- a/eeschema/eeconfig.cpp +++ b/eeschema/eeconfig.cpp @@ -303,6 +303,7 @@ void WinEDA_SchematicFrame::SaveProjectFile( wxWindow* displayframe ) static const wxString MinDrawLineWidthEntry( wxT( "MinimunDrawLineWidth" ) ); static const wxString PlotLineWidthEntry( wxT( "PlotLineWidth" ) ); static const wxString ShowHiddenPinsEntry( wxT( "ShowHiddenPins" ) ); +static const wxString HorzVertLinesOnlyEntry( wxT( "HorizVertLinesOnly" ) ); /* @@ -428,7 +429,7 @@ void WinEDA_SchematicFrame::LoadSettings() g_DrawMinimunLineWidth = cfg->Read( MinDrawLineWidthEntry, (long) 0 ); g_PlotLine_Width = cfg->Read( PlotLineWidthEntry, (long) 4 ); cfg->Read( ShowHiddenPinsEntry, &m_ShowAllPins, false ); - + cfg->Read( HorzVertLinesOnlyEntry, &g_HVLines, true ); } @@ -448,4 +449,5 @@ void WinEDA_SchematicFrame::SaveSettings() cfg->Write( MinDrawLineWidthEntry, (long) g_DrawMinimunLineWidth ); cfg->Write( PlotLineWidthEntry, (long) g_PlotLine_Width ); cfg->Write( ShowHiddenPinsEntry, m_ShowAllPins ); + cfg->Write( HorzVertLinesOnlyEntry, g_HVLines ); } diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index 1866a284a2..6940d62e4c 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -43,7 +43,7 @@ bool g_LastSearchIsMarker; /* True if last seach is a marker serach SCH_ITEM* g_BlockSaveDataList; // List of items to paste (Created by Block Save) // Gestion d'options -int g_HVLines = 1; // Bool: force H or V directions (Wires, Bus ..) +bool g_HVLines = true; // Bool: force H or V directions (Wires, Bus ..) int g_PlotPSColorOpt; // True = plot postcript color (see plotps.cpp) diff --git a/eeschema/general.h b/eeschema/general.h index f1ef9b1e83..ce04898fe0 100644 --- a/eeschema/general.h +++ b/eeschema/general.h @@ -115,8 +115,7 @@ extern bool g_LastSearchIsMarker; // True if last seach is a marker se extern SCH_ITEM* g_BlockSaveDataList; // List of items to paste (Created by Block Save) // Gestion d'options -extern int g_ShowAllPins; -extern int g_HVLines; +extern bool g_HVLines; extern int g_PlotPSColorOpt; // True = plot postcript color (see plotps.cpp) diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index acb4bd2bd5..a446ccd680 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -160,6 +160,7 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, m_LibeditFrame = NULL; // Component editor frame. m_ViewlibFrame = NULL; // Frame for browsing component libraries m_DefaultSchematicFileName = wxT( "noname.sch" ); + m_ShowAllPins = false; CreateScreens(); diff --git a/include/common.h b/include/common.h index a4ba52d14a..56c540b2d7 100644 --- a/include/common.h +++ b/include/common.h @@ -152,10 +152,8 @@ extern int g_KeyPressed; // Font used by kicad. // these font have a size which do not depend on default size system font -extern wxFont* g_DialogFont; /* Normal font used in dialog box */ extern wxFont* g_FixedFont; /* Affichage de Texte en fenetres de dialogue, * fonte a pas fixe)*/ -extern int g_DialogFontPointSize; /* taille de la fonte */ extern int g_FixedFontPointSize; /* taille de la fonte */ extern int g_FontMinPointSize; /* taille minimum des fontes */ diff --git a/include/id.h b/include/id.h index a718559c51..2ba4dbe7b5 100644 --- a/include/id.h +++ b/include/id.h @@ -92,15 +92,6 @@ enum main_id { ID_EXIT, ID_OPTIONS_SETUP, - ID_PREFERENCES_FONT, - ID_PREFERENCES_FONT_DIALOG, - ID_PREFERENCES_FONT_UNUSED3, - ID_PREFERENCES_FONT_UNUSED4, - ID_PREFERENCES_FONT_UNUSED5, - ID_PREFERENCES_FONT_UNUSED6, - ID_PREFERENCES_FONT_UNUSED7, - ID_PREFERENCES_FONT_END, - // Find id menu ID_H_TOOLBAR, ID_V_TOOLBAR, diff --git a/include/wxstruct.h b/include/wxstruct.h index 3635a21f63..e2afd38ad4 100644 --- a/include/wxstruct.h +++ b/include/wxstruct.h @@ -70,7 +70,7 @@ enum id_drawframe { enum id_toolbar { TOOLBAR_MAIN = 1, // Main horizontal Toolbar - TOOLBAR_TOOL, // Rigth vertical Toolbar (list of tools) + TOOLBAR_TOOL, // Right vertical Toolbar (list of tools) TOOLBAR_OPTION, // Left vertical Toolbar (option toolbar TOOLBAR_AUX // Secondary horizontal Toolbar }; @@ -98,7 +98,7 @@ public: WinEDA_Toolbar* m_HToolBar; // Standard horizontal Toolbar bool m_FrameIsActive; - wxString m_FrameName; // name used for writting and reading setup + wxString m_FrameName; // name used for writing and reading setup // It is "SchematicFrame", "PcbFrame" .... wxString m_AboutTitle; // Name of program displayed in About. @@ -129,7 +129,6 @@ public: struct Ki_HotkeyInfoSectionDescriptor* DescList, bool verbose ); void SetLanguage( wxCommandEvent& event ); - void ProcessFontPreferences( int id ); wxString GetFileFromHistory( int cmdId, const wxString& type ); void SetLastProject( const wxString& FullFileName ); @@ -193,17 +192,15 @@ public: /** * Function GetBaseScreen - * is virtual and returns a pointer to a BASE_SCREEN or one of its derivatives. - * It may be overloaded by derived classes. + * is virtual and returns a pointer to a BASE_SCREEN or one of its + * derivatives. It may be overloaded by derived classes. */ virtual BASE_SCREEN* GetBaseScreen() const { return m_CurrentScreen; } void OnMenuOpen( wxMenuEvent& event ); void OnMouseEvent( wxMouseEvent& event ); - virtual void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ); - void AddFontSelectionMenu( wxMenu* main_menu ); - void ProcessFontPreferences( wxCommandEvent& event ); - + virtual void OnHotKey( wxDC* DC, int hotkey, + EDA_BaseStruct* DrawStruct ); void Affiche_Message( const wxString& message ); void EraseMsgBox(); diff --git a/pcbnew/block.cpp b/pcbnew/block.cpp index f9be20a748..0faae9fa0b 100644 --- a/pcbnew/block.cpp +++ b/pcbnew/block.cpp @@ -110,10 +110,10 @@ WinEDA_ExecBlockCmdFrame::WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent, wxButton* m_button2; m_Parent = parent; - SetFont( *g_DialogFont ); Centre(); this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - this->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) ); + this->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, + false, wxEmptyString ) ); /* Sizer 1 creation */ wxFlexGridSizer* fgSizer1; @@ -155,10 +155,8 @@ WinEDA_ExecBlockCmdFrame::WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent, /* Creation des boutons de commande */ m_button2 = new wxButton( this, wxID_CANCEL, _( "Cancel" ), wxDefaultPosition, wxDefaultSize, 0 ); - m_button2->SetForegroundColour( *wxBLUE ); fgSizer2->Add( m_button2, 0, wxALL, 5 ); m_button1 = new wxButton( this, wxID_OK, _( "OK" ), wxDefaultPosition, wxDefaultSize, 0 ); - m_button1->SetForegroundColour( *wxRED ); m_button1->SetDefault(); fgSizer2->Add( m_button1, 0, wxALL, 5 ); diff --git a/pcbnew/cotation.cpp b/pcbnew/cotation.cpp index 719f5efb42..5a80113bc7 100644 --- a/pcbnew/cotation.cpp +++ b/pcbnew/cotation.cpp @@ -87,7 +87,6 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* wxButton* Button; m_Parent = parent; - SetFont( *g_DialogFont ); m_DC = DC; Centre(); @@ -102,11 +101,9 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* /* Creation des boutons de commande */ Button = new wxButton( this, wxID_OK, _( "OK" ) ); - Button->SetForegroundColour( *wxRED ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) ); - Button->SetForegroundColour( *wxBLUE ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); wxString display_msg[2] = { _( "Normal" ), _( "Mirror" ) }; diff --git a/pcbnew/dialog_SVG_print.cpp b/pcbnew/dialog_SVG_print.cpp index e0c2cb838a..768e637dc0 100644 --- a/pcbnew/dialog_SVG_print.cpp +++ b/pcbnew/dialog_SVG_print.cpp @@ -88,7 +88,6 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( WinEDA_DrawFrame* parent ) : void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) /*************************************************************/ { - SetFont( *g_DialogFont ); SetFocus(); // Make ESC key working m_ImageXSize_mm = 270; diff --git a/pcbnew/dialog_display_options_base.cpp b/pcbnew/dialog_display_options_base.cpp index cad2695ade..444c0e1d56 100644 --- a/pcbnew/dialog_display_options_base.cpp +++ b/pcbnew/dialog_display_options_base.cpp @@ -129,13 +129,9 @@ DialogDisplayOptions_base::DialogDisplayOptions_base( wxWindow* parent, wxWindow bRightSizer->Add( 10, 10, 0, 0, 5 ); m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonOK->SetForegroundColour( wxColour( 204, 0, 0 ) ); - bRightSizer->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonCANCEL->SetForegroundColour( wxColour( 0, 0, 200 ) ); - bRightSizer->Add( m_buttonCANCEL, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bMainSizer->Add( bRightSizer, 0, wxEXPAND|wxALL, 5 ); diff --git a/pcbnew/dialog_display_options_base.fbp b/pcbnew/dialog_display_options_base.fbp index 65fded32d6..b3bc577acd 100644 --- a/pcbnew/dialog_display_options_base.fbp +++ b/pcbnew/dialog_display_options_base.fbp @@ -826,7 +826,7 @@ 0 1 - 204,0,0 + 0 wxID_OK @@ -878,7 +878,7 @@ 0 1 - 0,0,200 + 0 wxID_CANCEL diff --git a/pcbnew/dialog_drc.cpp b/pcbnew/dialog_drc.cpp index 87138da689..ce5361f671 100644 --- a/pcbnew/dialog_drc.cpp +++ b/pcbnew/dialog_drc.cpp @@ -416,10 +416,8 @@ bool DrcDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption void DrcDialog::CreateControls() { - SetFont( *g_DialogFont ); - ////@begin DrcDialog content construction - // Generated by DialogBlocks, Wed 19 Mar 2008 11:39:08 CDT (unregistered) + // Generated by DialogBlocks, 29/04/2009 15:13:47 (unregistered) DrcDialog* itemDialog1 = this; @@ -495,19 +493,16 @@ void DrcDialog::CreateControls() wxButton* itemButton18 = new wxButton( itemDialog1, ID_STARTDRC, _("Start DRC"), wxDefaultPosition, wxDefaultSize, 0 ); if (DrcDialog::ShowToolTips()) itemButton18->SetToolTip(_("Start the Design Rule Checker")); - itemButton18->SetForegroundColour(wxColour(202, 0, 0)); itemBoxSizer17->Add(itemButton18, 0, wxGROW|wxALL, 5); wxButton* itemButton19 = new wxButton( itemDialog1, ID_LIST_UNCONNECTED, _("List Unconnected"), wxDefaultPosition, wxDefaultSize, 0 ); if (DrcDialog::ShowToolTips()) itemButton19->SetToolTip(_("List unconnected pads or tracks")); - itemButton19->SetForegroundColour(wxColour(0, 0, 255)); itemBoxSizer17->Add(itemButton19, 0, wxGROW|wxALL, 5); m_DeleteAllButton = new wxButton( itemDialog1, ID_DELETE_ALL, _("Delete All Markers"), wxDefaultPosition, wxDefaultSize, 0 ); if (DrcDialog::ShowToolTips()) m_DeleteAllButton->SetToolTip(_("Delete every marker")); - m_DeleteAllButton->SetForegroundColour(wxColour(0, 128, 0)); itemBoxSizer17->Add(m_DeleteAllButton, 0, wxGROW|wxALL, 5); m_DeleteCurrentMarkerButton = new wxButton( itemDialog1, ID_DELETE_ONE, _("Delete Current Marker"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -546,7 +541,6 @@ void DrcDialog::CreateControls() m_MainSizer->Add(StdDialogButtonSizer, 0, wxGROW|wxALL, 10); wxButton* itemButton27 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton27->SetForegroundColour(wxColour(0, 0, 255)); StdDialogButtonSizer->AddButton(itemButton27); wxButton* itemButton28 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); diff --git a/pcbnew/dialog_drc.h b/pcbnew/dialog_drc.h index c9a8500332..c34042a58e 100644 --- a/pcbnew/dialog_drc.h +++ b/pcbnew/dialog_drc.h @@ -62,7 +62,7 @@ class wxStdDialogButtonSizer; #define SYMBOL_DRCDIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxMAXIMIZE_BOX|wxMINIMIZE_BOX #define SYMBOL_DRCDIALOG_TITLE _("DRC Control") #define SYMBOL_DRCDIALOG_IDNAME ID_DIALOG -#define SYMBOL_DRCDIALOG_SIZE wxSize(450, 300) +#define SYMBOL_DRCDIALOG_SIZE wxSize(400, 300) #define SYMBOL_DRCDIALOG_POSITION wxDefaultPosition ////@end control identifiers diff --git a/pcbnew/dialog_drc.pjd b/pcbnew/dialog_drc.pjd index d12c65b60e..562803b4f9 100644 --- a/pcbnew/dialog_drc.pjd +++ b/pcbnew/dialog_drc.pjd @@ -20,6 +20,7 @@ "" 0 0 + 0 "<All platforms>" "<Any>" "///////////////////////////////////////////////////////////////////////////// @@ -114,6 +115,7 @@ 0 1 0 + 0 @@ -136,6 +138,7 @@ 0 "" 1 + 0 "" "Debug" "ANSI" @@ -156,6 +159,7 @@ "%AUTO%" "%AUTO%" "%AUTO%" + "%AUTO%" "%AUTO%" "%AUTO%" "%AUTO%" @@ -167,6 +171,7 @@ "%AUTO%" "%AUTO%" "%AUTO%" + "%AUTO%" "%AUTO%" "%AUTO%" "%AUTO%" @@ -177,6 +182,9 @@ "%AUTO%" "%AUTO%" "%AUTO%" + 0 + 1 + "" @@ -1094,7 +1102,7 @@ "" "" "" - "CA0000" + "" "" 0 1 @@ -1161,7 +1169,7 @@ "" "" "" - "0000FF" + "" "" 0 1 @@ -1228,7 +1236,7 @@ "" "" "" - "008000" + "" "" 0 1 @@ -1690,7 +1698,7 @@ "" "" "" - "0000FF" + "" "" 0 1 diff --git a/pcbnew/dialog_edit_module.cpp b/pcbnew/dialog_edit_module.cpp index 0f388da0e0..dfafde79b2 100644 --- a/pcbnew/dialog_edit_module.cpp +++ b/pcbnew/dialog_edit_module.cpp @@ -47,7 +47,6 @@ WinEDA_ModulePropertiesFrame::WinEDA_ModulePropertiesFrame( WinEDA_BasePcbFrame* SetIcon( wxICON( icon_modedit ) ); // Give an icon m_Parent = parent; - SetFont( *g_DialogFont ); m_DC = DC; m_LayerCtrl = NULL; @@ -85,12 +84,10 @@ void WinEDA_ModulePropertiesFrame::CreateControls() SetSizer( m_GeneralBoxSizer ); m_NoteBook = new wxNotebook( this, ID_NOTEBOOK ); - m_NoteBook->SetFont( *g_DialogFont ); m_GeneralBoxSizer->Add( m_NoteBook, 0, wxGROW | wxALL, 5 ); // Add panels m_PanelProperties = new wxPanel( m_NoteBook, -1 ); - m_PanelProperties->SetFont( *g_DialogFont ); m_PanelPropertiesBoxSizer = new wxBoxSizer( wxHORIZONTAL ); m_PanelProperties->SetSizer( m_PanelPropertiesBoxSizer ); BuildPanelModuleProperties( FullOptions ); @@ -118,11 +115,9 @@ void WinEDA_ModulePropertiesFrame::CreateControls() m_GeneralBoxSizer->Add( ButtonsBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 ); Button = new wxButton( this, wxID_OK, _( "OK" ) ); - Button->SetForegroundColour( *wxRED ); ButtonsBoxSizer->Add( Button, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) ); - Button->SetForegroundColour( *wxBLUE ); ButtonsBoxSizer->Add( Button, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); } @@ -187,11 +182,9 @@ void WinEDA_ModulePropertiesFrame::BuildPanelModuleProperties( bool FullOptions wxStaticText* YPositionStatic = new wxStaticText(m_PanelProperties, -1, _("Y")); Button = new wxButton( m_PanelProperties, ID_MODULE_PROPERTIES_EXCHANGE, _( "Change module(s)" ) ); - Button->SetForegroundColour( wxColor( 80, 40, 0 ) ); PropRightSizer->Add( Button, 0, wxGROW | wxALL, 5 ); Button = new wxButton( m_PanelProperties, ID_GOTO_MODULE_EDITOR, _( "Edit Module" ) ); - Button->SetForegroundColour( wxColor( 0, 128, 80 ) ); PropRightSizer->Add( Button, 0, wxGROW | wxALL, 5 ); wxStaticBox* positionBox = new wxStaticBox(m_PanelProperties, -1, _("Position") ); @@ -244,17 +237,14 @@ void WinEDA_ModulePropertiesFrame::BuildPanelModuleProperties( bool FullOptions Button = new wxButton( m_PanelProperties, ID_MODULE_EDIT_ADD_TEXT, _( "Add Field" ) ); - Button->SetForegroundColour( *wxBLACK ); StaticBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); Button = new wxButton( m_PanelProperties, ID_MODULE_EDIT_EDIT_TEXT, _( "Edit Field" ) ); - Button->SetForegroundColour( *wxBLACK ); StaticBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT, 5 ); m_DeleteFieddButton = Button = new wxButton( m_PanelProperties, ID_MODULE_EDIT_DELETE_TEXT, _( "Delete Field" ) ); - m_DeleteFieddButton->SetForegroundColour( *wxBLACK ); m_DeleteFieddButton->Enable( FALSE ); // Enable pour fields autres que ref et valeur StaticBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); @@ -400,7 +390,6 @@ Panel3D_Ctrl::Panel3D_Ctrl( WinEDA_ModulePropertiesFrame* parentframe, m_Parent = parent; m_ParentFrame = parentframe; - SetFont( *g_DialogFont ); wxBoxSizer* Panel3DBoxSizer = new wxBoxSizer( wxVERTICAL ); SetSizer( Panel3DBoxSizer ); @@ -422,17 +411,14 @@ Panel3D_Ctrl::Panel3D_Ctrl( WinEDA_ModulePropertiesFrame* parentframe, LowerBoxSizer->Add( PropRightSizer, 0, wxGROW | wxALL, 5 ); button = new wxButton( this, ID_BROWSE_3D_LIB, _( "Browse" ) ); - button->SetForegroundColour( *wxBLUE ); PropRightSizer->Add( button, 0, wxGROW | wxLEFT | wxRIGHT, 5 ); button = new wxButton( this, ID_ADD_3D_SHAPE, _( "Add 3D Shape" ) ); - button->SetForegroundColour( *wxRED ); PropRightSizer->Add( button, 0, wxGROW | wxLEFT | wxRIGHT, 5 ); if( (struct3D == NULL) || (struct3D->Back() != NULL) ) { button = new wxButton( this, ID_REMOVE_3D_SHAPE, _( "Remove 3D Shape" ) ); - button->SetForegroundColour( *wxRED ); PropRightSizer->Add( button, 0, wxGROW | wxLEFT | wxRIGHT, 5 ); } diff --git a/pcbnew/dialog_edit_module_text.cpp b/pcbnew/dialog_edit_module_text.cpp index f5a1d4dc00..b252f4960c 100644 --- a/pcbnew/dialog_edit_module_text.cpp +++ b/pcbnew/dialog_edit_module_text.cpp @@ -77,7 +77,6 @@ void DialogEditModuleText::OnCancelClick( wxCommandEvent& event ) void DialogEditModuleText::OnInitDialog( wxInitDialogEvent& event ) /********************************************************/ { - SetFont( *g_DialogFont ); SetFocus(); wxString msg; diff --git a/pcbnew/dialog_edit_module_text_base.cpp b/pcbnew/dialog_edit_module_text_base.cpp index 432e989e86..d21e9c6597 100644 --- a/pcbnew/dialog_edit_module_text_base.cpp +++ b/pcbnew/dialog_edit_module_text_base.cpp @@ -104,13 +104,9 @@ DialogEditModuleText_base::DialogEditModuleText_base( wxWindow* parent, wxWindow m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonOK->SetDefault(); - m_buttonOK->SetForegroundColour( wxColour( 202, 0, 0 ) ); - bSizer5->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonCANCEL->SetForegroundColour( wxColour( 0, 0, 220 ) ); - bSizer5->Add( m_buttonCANCEL, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); bSizer2->Add( bSizer5, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); diff --git a/pcbnew/dialog_edit_module_text_base.fbp b/pcbnew/dialog_edit_module_text_base.fbp index 1dd570f3e8..beb49f8436 100644 --- a/pcbnew/dialog_edit_module_text_base.fbp +++ b/pcbnew/dialog_edit_module_text_base.fbp @@ -1032,7 +1032,7 @@ 1 1 - 202,0,0 + 0 wxID_OK @@ -1084,7 +1084,7 @@ 0 1 - 0,0,220 + 0 wxID_CANCEL diff --git a/pcbnew/dialog_gendrill.cpp b/pcbnew/dialog_gendrill.cpp index 149bf0188b..3f2df9519a 100644 --- a/pcbnew/dialog_gendrill.cpp +++ b/pcbnew/dialog_gendrill.cpp @@ -73,7 +73,6 @@ WinEDA_DrillFrame::WinEDA_DrillFrame( WinEDA_PcbFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { m_Parent = parent; - //SetFont( *g_DialogFont ); SetReturnCode( 1 ); Init(); @@ -152,7 +151,7 @@ void WinEDA_DrillFrame::Init() void WinEDA_DrillFrame::CreateControls() { ////@begin WinEDA_DrillFrame content construction - // Generated by DialogBlocks, 12/08/2008 13:05:18 (unregistered) + // Generated by DialogBlocks, 29/04/2009 15:14:32 (unregistered) WinEDA_DrillFrame* itemDialog1 = this; @@ -177,7 +176,7 @@ void WinEDA_DrillFrame::CreateControls() m_Choice_Zeros_Format = new wxRadioBox( itemDialog1, ID_SEL_ZEROS_FMT, _("Zeros Format"), wxDefaultPosition, wxDefaultSize, m_Choice_Zeros_FormatStrings, 1, wxRA_SPECIFY_COLS ); m_Choice_Zeros_Format->SetSelection(0); if (WinEDA_DrillFrame::ShowToolTips()) - m_Choice_Zeros_Format->SetToolTip(_("Choose excellon numbers notation")); + m_Choice_Zeros_Format->SetToolTip(_("Choose EXCELLON numbers notation")); m_LeftBoxSizer->Add(m_Choice_Zeros_Format, 0, wxALIGN_LEFT|wxALL, 5); wxArrayString m_Choice_PrecisionStrings; @@ -186,7 +185,7 @@ void WinEDA_DrillFrame::CreateControls() m_Choice_Precision = new wxRadioBox( itemDialog1, ID_SEL_PRECISION, _("Precision"), wxDefaultPosition, wxDefaultSize, m_Choice_PrecisionStrings, 1, wxRA_SPECIFY_COLS ); m_Choice_Precision->SetSelection(0); if (WinEDA_DrillFrame::ShowToolTips()) - m_Choice_Precision->SetToolTip(_("Choose excellon numbers precision")); + m_Choice_Precision->SetToolTip(_("Choose EXCELLON numbers precision")); m_LeftBoxSizer->Add(m_Choice_Precision, 0, wxGROW|wxALL, 5); wxArrayString m_Choice_Drill_OffsetStrings; @@ -247,7 +246,7 @@ void WinEDA_DrillFrame::CreateControls() m_Check_Minimal = new wxCheckBox( itemDialog1, ID_CHECKBOX3, _("minimal header"), wxDefaultPosition, wxDefaultSize, 0 ); m_Check_Minimal->SetValue(false); if (WinEDA_DrillFrame::ShowToolTips()) - m_Check_Minimal->SetToolTip(_("If checked, the excellon header is minimal")); + m_Check_Minimal->SetToolTip(_("If checked, the EXCELLON header is minimal")); itemStaticBoxSizer16->Add(m_Check_Minimal, 0, wxGROW|wxALL, 5); wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxVERTICAL); @@ -291,11 +290,9 @@ void WinEDA_DrillFrame::CreateControls() m_OkButton = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); m_OkButton->SetDefault(); - m_OkButton->SetForegroundColour(wxColour(156, 1, 5)); itemBoxSizer19->Add(m_OkButton, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); m_CancelButton = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_CancelButton->SetForegroundColour(wxColour(16, 1, 205)); itemBoxSizer19->Add(m_CancelButton, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); // Set validators diff --git a/pcbnew/dialog_gendrill.pjd b/pcbnew/dialog_gendrill.pjd index 4b23319eeb..3d8be7b6f3 100644 --- a/pcbnew/dialog_gendrill.pjd +++ b/pcbnew/dialog_gendrill.pjd @@ -20,6 +20,7 @@ "" 0 0 + 0 "<All platforms>" "2.8.7" "///////////////////////////////////////////////////////////////////////////// @@ -106,6 +107,7 @@ 0 1 0 + 0 @@ -149,6 +151,7 @@ "%AUTO%" "%AUTO%" "%AUTO%" + "%AUTO%" "%AUTO%" "%AUTO%" "%AUTO%" @@ -160,6 +163,7 @@ "%AUTO%" "%AUTO%" "%AUTO%" + "%AUTO%" "%AUTO%" "%AUTO%" "%AUTO%" @@ -172,6 +176,7 @@ "%AUTO%" 0 1 + "" @@ -1876,7 +1881,7 @@ "" "" "" - "9C0105" + "" "" 0 1 @@ -1943,7 +1948,7 @@ "" "" "" - "1001CD" + "" "" 0 1 diff --git a/pcbnew/dialog_general_options.cpp b/pcbnew/dialog_general_options.cpp index 1569be3969..00e30e6f2a 100644 --- a/pcbnew/dialog_general_options.cpp +++ b/pcbnew/dialog_general_options.cpp @@ -35,7 +35,6 @@ Dialog_GeneralOptions::Dialog_GeneralOptions( WinEDA_PcbFrame* parent, wxDC* DC void Dialog_GeneralOptions::init() /********************************************************************/ { - SetFont( *g_DialogFont ); SetFocus(); /* Set display options */ diff --git a/pcbnew/dialog_general_options_BoardEditor_base.cpp b/pcbnew/dialog_general_options_BoardEditor_base.cpp index 8a6a04411c..1b0fc72f1a 100644 --- a/pcbnew/dialog_general_options_BoardEditor_base.cpp +++ b/pcbnew/dialog_general_options_BoardEditor_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Feb 8 2009) +// C++ code generated with wxFormBuilder (version Apr 16 2008) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -80,42 +80,50 @@ DialogGeneralOptionsBoardEditor_base::DialogGeneralOptionsBoardEditor_base( wxWi bMiddleRightBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL ); m_DrcOn = new wxCheckBox( this, wxID_DRC_ONOFF, _("Drc ON"), wxDefaultPosition, wxDefaultSize, 0 ); - m_DrcOn->SetValue(true); + m_DrcOn->SetValue(true); + m_DrcOn->SetToolTip( _("Enable/disable the DRC control.\nWhen DRC is disable, all connections are allowed.") ); bMiddleRightBoxSizer->Add( m_DrcOn, 0, wxALL|wxEXPAND, 5 ); m_ShowGlobalRatsnest = new wxCheckBox( this, wxID_GENERAL_RATSNEST, _("Show Ratsnest"), wxDefaultPosition, wxDefaultSize, 0 ); + m_ShowGlobalRatsnest->SetToolTip( _("Show (or not) the full rastnest.") ); bMiddleRightBoxSizer->Add( m_ShowGlobalRatsnest, 0, wxALL, 5 ); m_ShowModuleRatsnest = new wxCheckBox( this, wxID_RATSNEST_MODULE, _("Show Mod Ratsnest"), wxDefaultPosition, wxDefaultSize, 0 ); + m_ShowModuleRatsnest->SetToolTip( _("Shows (or not) the local ratsnest relative to a footprint, when moving it.\nThis ratsnest is useful to place a footprint.") ); bMiddleRightBoxSizer->Add( m_ShowModuleRatsnest, 0, wxALL, 5 ); m_TrackAutodel = new wxCheckBox( this, wxID_TRACK_AUTODEL, _("Tracks Auto Del"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TrackAutodel->SetToolTip( _("Enable/disable the automatic track deletion when recreating a track.") ); bMiddleRightBoxSizer->Add( m_TrackAutodel, 0, wxALL, 5 ); m_Track_45_Only_Ctrl = new wxCheckBox( this, wxID_TRACKS45, _("Track only 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Track_45_Only_Ctrl->SetToolTip( _("If enabled, force tracks directions to H, V or 45 degrees, when creating a track.") ); bMiddleRightBoxSizer->Add( m_Track_45_Only_Ctrl, 0, wxALL, 5 ); m_Segments_45_Only_Ctrl = new wxCheckBox( this, wxID_SEGMENTS45, _("Segments 45 Only"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Segments_45_Only_Ctrl->SetToolTip( _("If enabled, force segments directions to H, V or 45 degrees, when creating a segment on technical layers.") ); bMiddleRightBoxSizer->Add( m_Segments_45_Only_Ctrl, 0, wxALL, 5 ); m_AutoPANOpt = new wxCheckBox( this, wxID_AUTOPAN, _("Auto PAN"), wxDefaultPosition, wxDefaultSize, 0 ); + m_AutoPANOpt->SetToolTip( _("Allows auto pan when creating a track, or moving an item.") ); bMiddleRightBoxSizer->Add( m_AutoPANOpt, 0, wxALL, 5 ); m_Track_DoubleSegm_Ctrl = new wxCheckBox( this, wxID_ANY, _("Double Segm Track"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Track_DoubleSegm_Ctrl->SetToolTip( _("If enabled, uses two track segments, with 45 degrees angle between them when creating a new track ") ); bMiddleRightBoxSizer->Add( m_Track_DoubleSegm_Ctrl, 0, wxALL, 5 ); @@ -143,13 +151,9 @@ DialogGeneralOptionsBoardEditor_base::DialogGeneralOptionsBoardEditor_base( wxWi m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonOK->SetDefault(); - m_buttonOK->SetForegroundColour( wxColour( 174, 0, 0 ) ); - bRightSizer->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonCANCEL->SetForegroundColour( wxColour( 0, 0, 200 ) ); - bRightSizer->Add( m_buttonCANCEL, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); bMainSizer->Add( bRightSizer, 1, wxEXPAND, 5 ); diff --git a/pcbnew/dialog_general_options_BoardEditor_base.fbp b/pcbnew/dialog_general_options_BoardEditor_base.fbp index b4e29c29a3..dea664e13f 100644 --- a/pcbnew/dialog_general_options_BoardEditor_base.fbp +++ b/pcbnew/dialog_general_options_BoardEditor_base.fbp @@ -7,7 +7,6 @@ 1 UTF-8 connect - impl_virtual dialog_general_options_BoardEditor_base 1000 none @@ -38,10 +37,6 @@ General settings - - wxFILTER_NONE - wxDefaultValidator - @@ -114,10 +109,6 @@ wxRA_SPECIFY_COLS Activates the display of relative coordinates from relative origin (set by the space key) to the cursor, in polar coordinates (angle and distance) - - wxFILTER_NONE - wxDefaultValidator - @@ -172,10 +163,6 @@ wxRA_SPECIFY_COLS Selection of units used to display dimensions and positions of items - - wxFILTER_NONE - wxDefaultValidator - @@ -230,10 +217,6 @@ wxRA_SPECIFY_COLS Main cursor shape selection (small cross or large cursor) - - wxFILTER_NONE - wxDefaultValidator - @@ -299,10 +282,6 @@ wxRA_SPECIFY_COLS Active copper layers count selection - - wxFILTER_NONE - wxDefaultValidator - @@ -354,10 +333,6 @@ - - wxFILTER_NONE - wxDefaultValidator - @@ -411,10 +386,6 @@ wxSP_ARROW_KEYS Adjust the number of ratsnets shown from cursor to closest pads - - wxFILTER_NONE - wxDefaultValidator - 1 @@ -468,10 +439,6 @@ - - wxFILTER_NONE - wxDefaultValidator - @@ -525,10 +492,6 @@ wxSP_ARROW_KEYS Delay after the first change to create a backup file of the board on disk. - - wxFILTER_NONE - wxDefaultValidator - 0 @@ -597,10 +560,6 @@ Enable/disable the DRC control. When DRC is disable, all connections are allowed. - - wxFILTER_NONE - wxDefaultValidator - @@ -653,10 +612,6 @@ Show (or not) the full rastnest. - - wxFILTER_NONE - wxDefaultValidator - @@ -709,10 +664,6 @@ Shows (or not) the local ratsnest relative to a footprint, when moving it. This ratsnest is useful to place a footprint. - - wxFILTER_NONE - wxDefaultValidator - @@ -765,10 +716,6 @@ Enable/disable the automatic track deletion when recreating a track. - - wxFILTER_NONE - wxDefaultValidator - @@ -821,10 +768,6 @@ If enabled, force tracks directions to H, V or 45 degrees, when creating a track. - - wxFILTER_NONE - wxDefaultValidator - @@ -877,10 +820,6 @@ If enabled, force segments directions to H, V or 45 degrees, when creating a segment on technical layers. - - wxFILTER_NONE - wxDefaultValidator - @@ -933,10 +872,6 @@ Allows auto pan when creating a track, or moving an item. - - wxFILTER_NONE - wxDefaultValidator - @@ -989,10 +924,6 @@ If enabled, uses two track segments, with 45 degrees angle between them when creating a new track - - wxFILTER_NONE - wxDefaultValidator - @@ -1058,10 +989,6 @@ wxRA_SPECIFY_COLS control the capture of the pcb cursor when the mouse cursor enters a pad area - - wxFILTER_NONE - wxDefaultValidator - @@ -1116,10 +1043,6 @@ wxRA_SPECIFY_COLS Control the capture of the pcb cursor when the mouse cursor enters a track - - wxFILTER_NONE - wxDefaultValidator - @@ -1158,7 +1081,7 @@ 1 1 - 174,0,0 + 0 wxID_OK @@ -1172,10 +1095,6 @@ - - wxFILTER_NONE - wxDefaultValidator - @@ -1214,7 +1133,7 @@ 0 1 - 0,0,200 + 0 wxID_CANCEL @@ -1228,10 +1147,6 @@ - - wxFILTER_NONE - wxDefaultValidator - diff --git a/pcbnew/dialog_general_options_BoardEditor_base.h b/pcbnew/dialog_general_options_BoardEditor_base.h index 5062099722..d0e05afcf3 100644 --- a/pcbnew/dialog_general_options_BoardEditor_base.h +++ b/pcbnew/dialog_general_options_BoardEditor_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Feb 8 2009) +// C++ code generated with wxFormBuilder (version Apr 16 2008) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -72,12 +72,11 @@ class DialogGeneralOptionsBoardEditor_base : public wxDialog wxButton* m_buttonCANCEL; // Virtual event handlers, overide them in your derived class - virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } public: - DialogGeneralOptionsBoardEditor_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("General settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 585,280 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DialogGeneralOptionsBoardEditor_base(); diff --git a/pcbnew/dialog_graphic_item_properties.cpp b/pcbnew/dialog_graphic_item_properties.cpp index 18debc8efa..fe723e4d60 100644 --- a/pcbnew/dialog_graphic_item_properties.cpp +++ b/pcbnew/dialog_graphic_item_properties.cpp @@ -72,7 +72,6 @@ void DialogGraphicItemProperties::OnInitDialog( wxInitDialogEvent& event ) * according to the item parameters values */ { - SetFont( *g_DialogFont ); SetFocus(); wxString msg; diff --git a/pcbnew/dialog_graphic_items_options.cpp b/pcbnew/dialog_graphic_items_options.cpp index 84af1cc2c6..c738e9785b 100644 --- a/pcbnew/dialog_graphic_items_options.cpp +++ b/pcbnew/dialog_graphic_items_options.cpp @@ -181,10 +181,8 @@ bool WinEDA_GraphicItemsOptionsDialog::Create( wxWindow* parent, wxWindowID id, void WinEDA_GraphicItemsOptionsDialog::CreateControls() { - SetFont(*g_DialogFont); - ////@begin WinEDA_GraphicItemsOptionsDialog content construction - // Generated by DialogBlocks, Mon 26 Nov 2007 18:58:29 CST (unregistered) + // Generated by DialogBlocks, 29/04/2009 15:15:02 (unregistered) WinEDA_GraphicItemsOptionsDialog* itemDialog1 = this; @@ -261,11 +259,9 @@ void WinEDA_GraphicItemsOptionsDialog::CreateControls() itemBoxSizer2->Add(itemBoxSizer25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxButton* itemButton26 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton26->SetForegroundColour(wxColour(206, 0, 0)); itemBoxSizer25->Add(itemButton26, 0, wxGROW|wxALL, 5); wxButton* itemButton27 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton27->SetForegroundColour(wxColour(0, 0, 255)); itemBoxSizer25->Add(itemButton27, 0, wxGROW|wxALL, 5); ////@end WinEDA_GraphicItemsOptionsDialog content construction diff --git a/pcbnew/dialog_graphic_items_options.pjd b/pcbnew/dialog_graphic_items_options.pjd index 6f17f7425b..d85b123590 100644 --- a/pcbnew/dialog_graphic_items_options.pjd +++ b/pcbnew/dialog_graphic_items_options.pjd @@ -20,6 +20,7 @@ "" 0 0 + 0 "<All platforms>" "<Any>" "///////////////////////////////////////////////////////////////////////////// @@ -114,6 +115,7 @@ 0 1 0 + 0 @@ -136,6 +138,7 @@ 0 "" 1 + 0 "" "Debug" "ANSI" @@ -156,6 +159,7 @@ "%AUTO%" "%AUTO%" "%AUTO%" + "%AUTO%" "%AUTO%" "%AUTO%" "%AUTO%" @@ -167,6 +171,7 @@ "%AUTO%" "%AUTO%" "%AUTO%" + "%AUTO%" "%AUTO%" "%AUTO%" "%AUTO%" @@ -177,6 +182,9 @@ "%AUTO%" "%AUTO%" "%AUTO%" + 0 + 1 + "" @@ -1852,7 +1860,7 @@ "" "" "" - "CE0000" + "" "" 0 1 @@ -1919,7 +1927,7 @@ "" "" "" - "0000FF" + "" "" 0 1 diff --git a/pcbnew/dialog_initpcb.cpp b/pcbnew/dialog_initpcb.cpp index c72bc828ff..ed6932bbf5 100644 --- a/pcbnew/dialog_initpcb.cpp +++ b/pcbnew/dialog_initpcb.cpp @@ -92,8 +92,6 @@ bool WinEDA_PcbGlobalDeleteFrame::Create( wxWindow* parent, wxWindowID id, const void WinEDA_PcbGlobalDeleteFrame::CreateControls() { - - SetFont(*g_DialogFont); ////@begin WinEDA_PcbGlobalDeleteFrame content construction // Generated by DialogBlocks, 15/02/2006 22:10:20 (unregistered) diff --git a/pcbnew/dialog_pad_properties.cpp b/pcbnew/dialog_pad_properties.cpp index b40ec373e5..5acb1d784a 100644 --- a/pcbnew/dialog_pad_properties.cpp +++ b/pcbnew/dialog_pad_properties.cpp @@ -110,8 +110,6 @@ void DialogPadProperties::InitDialog( wxInitDialogEvent& event ) int tmp; wxCommandEvent cmd_event; - SetFont( *g_DialogFont ); - SetFocus(); // Required under wxGTK if we want to demiss the dialog with the ESC key m_PadNumCtrl->SetValue( g_Current_PadName ); diff --git a/pcbnew/dialog_pad_properties_base.cpp b/pcbnew/dialog_pad_properties_base.cpp index 995d9f880a..0b8d8eb7d7 100644 --- a/pcbnew/dialog_pad_properties_base.cpp +++ b/pcbnew/dialog_pad_properties_base.cpp @@ -53,7 +53,7 @@ DialogPadPropertiesBase::DialogPadPropertiesBase( wxWindow* parent, wxWindowID i wxString m_DrillShapeCtrlChoices[] = { _("Circle"), _("Oval") }; int m_DrillShapeCtrlNChoices = sizeof( m_DrillShapeCtrlChoices ) / sizeof( wxString ); m_DrillShapeCtrl = new wxRadioBox( this, ID_RADIOBOX_DRILL_SHAPE, _("Drill Shape:"), wxDefaultPosition, wxDefaultSize, m_DrillShapeCtrlNChoices, m_DrillShapeCtrlChoices, 1, wxRA_SPECIFY_COLS ); - m_DrillShapeCtrl->SetSelection( 0 ); + m_DrillShapeCtrl->SetSelection( 1 ); m_DrillShapeBoxSizer->Add( m_DrillShapeCtrl, 0, wxALL|wxEXPAND, 5 ); m_MainSizer->Add( m_DrillShapeBoxSizer, 1, wxBOTTOM, 5 ); @@ -90,13 +90,9 @@ DialogPadPropertiesBase::DialogPadPropertiesBase( wxWindow* parent, wxWindowID i m_buttonOk = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonOk->SetDefault(); - m_buttonOk->SetForegroundColour( wxColour( 209, 26, 5 ) ); - m_RightBoxSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonCancel->SetForegroundColour( wxColour( 14, 2, 164 ) ); - m_RightBoxSizer->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); diff --git a/pcbnew/dialog_pad_properties_base.fbp b/pcbnew/dialog_pad_properties_base.fbp index 07e4795be8..02bb0e6078 100644 --- a/pcbnew/dialog_pad_properties_base.fbp +++ b/pcbnew/dialog_pad_properties_base.fbp @@ -691,7 +691,7 @@ 1 1 - 209,26,5 + 0 wxID_OK @@ -743,7 +743,7 @@ 0 1 - 14,2,164 + 0 wxID_CANCEL diff --git a/pcbnew/dialog_pcb_text_properties.cpp b/pcbnew/dialog_pcb_text_properties.cpp index 9d4ac242fb..113af185c0 100644 --- a/pcbnew/dialog_pcb_text_properties.cpp +++ b/pcbnew/dialog_pcb_text_properties.cpp @@ -79,7 +79,6 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p m_Parent = parent; - SetFont( *g_DialogFont ); m_DC = DC; Centre(); diff --git a/pcbnew/dialog_pcbnew_config_libs_and_paths.cpp b/pcbnew/dialog_pcbnew_config_libs_and_paths.cpp index b384580150..f13354b23d 100644 --- a/pcbnew/dialog_pcbnew_config_libs_and_paths.cpp +++ b/pcbnew/dialog_pcbnew_config_libs_and_paths.cpp @@ -48,25 +48,11 @@ DIALOG_PCBNEW_CONFIG_LIBS::DIALOG_PCBNEW_CONFIG_LIBS( WinEDA_PcbFrame* parent ): void DIALOG_PCBNEW_CONFIG_LIBS::Init() /*************************************/ { - SetFont( *g_DialogFont ); SetFocus(); m_LibListChanged = false; m_LibPathChanged = false; - m_UserLibDirBufferImg = g_UserLibDirBuffer; // Save the original lib path - - // Display current files extension (info) - wxString msg = m_InfoBoardFileExt->GetLabel() + PcbExtBuffer; - m_InfoBoardFileExt->SetLabel( msg ); - - msg = m_InfoCmpFileExt->GetLabel() + NetCmpExtBuffer; - m_InfoCmpFileExt->SetLabel( msg ); - - msg = m_InfoLibFileExt->GetLabel() + ModuleFileExtension; - m_InfoLibFileExt->SetLabel( msg ); - - msg = m_InfoNetlistFileExt->GetLabel() + NetExtBuffer; - m_InfoNetlistFileExt->SetLabel( msg ); + m_UserLibDirBufferImg = g_UserLibDirBuffer; // Save the original lib path m_ListLibr->InsertItems( g_LibName_List, 0 ); @@ -90,7 +76,7 @@ void DIALOG_PCBNEW_CONFIG_LIBS::Init() m_DefaultLibraryPathslistBox->Append( libpaths[ii]); } - // select the first path afer the current path project + // select the first path after the current path project if ( libpaths.GetCount() > 1 ) m_DefaultLibraryPathslistBox->Select( 1 ); } @@ -107,7 +93,8 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnCancelClick( wxCommandEvent& event ) wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString(ii)) ; wxGetApp().InsertLibraryPath( g_UserLibDirBuffer, 1); } - EndModal( -1 ); + + EndModal( wxID_CANCEL ); } @@ -116,7 +103,7 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnOkClick( wxCommandEvent& event ) /**************************************************************/ { m_Config->Write( wxT( "module_doc_file" ), - m_TextHelpModulesFileName->GetValue() ); + m_TextHelpModulesFileName->GetValue() ); // Recreate the user lib path if ( m_LibPathChanged ) @@ -130,8 +117,8 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnOkClick( wxCommandEvent& event ) } } - - // Set new active library list if the lib list of if default path list was modified + // Set new active library list if the lib list of if default path list + // was modified if( m_LibListChanged || m_LibPathChanged ) { // Recreate lib list @@ -139,15 +126,17 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnOkClick( wxCommandEvent& event ) for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) g_LibName_List.Add(m_ListLibr->GetString(ii) ); } - if ( event.GetId() != ID_SAVE_CFG ) - EndModal( 0 ); + + m_Parent->Update_config( this ); + EndModal( wxID_OK ); } + /**************************************************************/ void DIALOG_PCBNEW_CONFIG_LIBS::OnCloseWindow( wxCloseEvent& event ) /**************************************************************/ { - EndModal( 0 ); + EndModal( wxID_CANCEL ); } @@ -156,7 +145,7 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnCloseWindow( wxCloseEvent& event ) void DIALOG_PCBNEW_CONFIG_LIBS::OnRemoveLibClick( wxCommandEvent& event ) /*********************************************************************/ /* Remove a library to the library list. - * The real list (g_LibName_List) is not changed, so the change can be cancelled + * The real list (g_LibName_List) is not changed, so the change can be canceled */ { int ii; @@ -177,7 +166,7 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnAddOrInsertLibClick( wxCommandEvent& event ) /* Insert or add a library to the library list: * The new library is put in list before (insert button) the selection, * or added (add button) to end of list - * The real list (g_LibName_List) is not changed, so the change can be cancelled + * The real list (g_LibName_List) is not changed, so the change can be canceled */ { int ii; @@ -213,9 +202,9 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnAddOrInsertLibClick( wxCommandEvent& event ) * list, just add the library name to the list. Otherwise, add * the library name with the full or relative path. * the relative path, when possible is preferable, - * because it preserve use of default libraries paths, when the path is a sub path of these default paths - * - */ + * because it preserve use of default libraries paths, when the + * path is a sub path of these default paths + */ if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case libfilename = fn.GetName(); else // not in the default, : see if this file is in a subpath: @@ -250,27 +239,15 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnAddOrInsertLibClick( wxCommandEvent& event ) } - -/*******************************************************************/ -void DIALOG_PCBNEW_CONFIG_LIBS::OnSaveCfgClick( wxCommandEvent& event ) -/*******************************************************************/ -{ - OnOkClick( event ); - m_Parent->Update_config( this ); -} - - /***********************************************************************/ void DIALOG_PCBNEW_CONFIG_LIBS::OnAddOrInsertPath( wxCommandEvent& event ) /***********************************************************************/ { wxString path = wxGetApp().ReturnLastVisitedLibraryPath(); - bool select = EDA_DirectorySelector( _( "Default Path for Libraries" ), /* Titre de la fenetre */ - path, /* Chemin par defaut */ - wxDD_DEFAULT_STYLE, - this, /* parent frame */ - wxDefaultPosition ); + bool select = EDA_DirectorySelector( _( "Default Path for Libraries" ), + path, wxDD_DEFAULT_STYLE, + this, wxDefaultPosition ); if( !select ) return; @@ -306,7 +283,6 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnAddOrInsertPath( wxCommandEvent& event ) DisplayError(this, _("Path already in use") ); wxGetApp().SaveLastVisitedLibraryPath( path ); - } @@ -333,19 +309,18 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnRemoveUserPath( wxCommandEvent& event ) } } + /**************************************************************************/ void DIALOG_PCBNEW_CONFIG_LIBS::OnBrowseModDocFile( wxCommandEvent& event ) /**************************************************************************/ { - wxString FullFileName, mask; + wxString FullFileName; wxString docpath, filename; docpath = wxGetApp().ReturnLastVisitedLibraryPath(wxT( "doc" )); - mask = wxT( "*.pdf" ); - wxFileDialog FilesDialog( this, _( "Footprint document file:" ), docpath, - wxEmptyString, mask, + wxEmptyString, PdfFileWildcard, wxFD_DEFAULT_STYLE ); if( FilesDialog.ShowModal() != wxID_OK ) @@ -356,7 +331,8 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnBrowseModDocFile( wxCommandEvent& event ) * list, just add the library name to the list. Otherwise, add * the library name with the full or relative path. * the relative path, when possible is preferable, - * because it preserve use of default libraries paths, when the path is a sub path of these default paths + * because it preserve use of default libraries paths, when the path is + * a sub path of these default paths */ wxFileName fn = FullFileName; wxGetApp().SaveLastVisitedLibraryPath( fn.GetPath() ); diff --git a/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp index 118c5c790a..55e841805a 100644 --- a/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp +++ b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp @@ -16,54 +16,19 @@ DIALOG_PCBNEW_CONFIG_LIBS_FBP::DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bUpperSizer; - bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bLeftSizer; - bLeftSizer = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sFileExtBox; - sFileExtBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Files ext:") ), wxVERTICAL ); - - m_InfoBoardFileExt = new wxStaticText( this, wxID_ANY, _("Board file Ext: "), wxDefaultPosition, wxDefaultSize, 0 ); - m_InfoBoardFileExt->Wrap( -1 ); - sFileExtBox->Add( m_InfoBoardFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_InfoCmpFileExt = new wxStaticText( this, wxID_ANY, _("Cmp file Ext: "), wxDefaultPosition, wxDefaultSize, 0 ); - m_InfoCmpFileExt->Wrap( -1 ); - sFileExtBox->Add( m_InfoCmpFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_InfoLibFileExt = new wxStaticText( this, wxID_ANY, _("Library file Ext: "), wxDefaultPosition, wxDefaultSize, 0 ); - m_InfoLibFileExt->Wrap( -1 ); - sFileExtBox->Add( m_InfoLibFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_InfoNetlistFileExt = new wxStaticText( this, wxID_ANY, _("Netlist file Ext: "), wxDefaultPosition, wxDefaultSize, 0 ); - m_InfoNetlistFileExt->Wrap( -1 ); - sFileExtBox->Add( m_InfoNetlistFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - bLeftSizer->Add( sFileExtBox, 0, wxEXPAND, 5 ); - - bUpperSizer->Add( bLeftSizer, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - wxStaticBoxSizer* sbLibsChoiceSizer; - sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Libraries") ), wxVERTICAL ); + sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint library files") ), wxHORIZONTAL ); wxBoxSizer* bLibsButtonsSizer; bLibsButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); sbLibsChoiceSizer->Add( bLibsButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - m_staticTextlibList = new wxStaticText( this, wxID_ANY, _("Active Libraries:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextlibList->Wrap( -1 ); - sbLibsChoiceSizer->Add( m_staticTextlibList, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Pcbnew.\nThe order of this list is important:\nPcbnew searchs for a given footprint using this list order priority.") ); - m_ListLibr->SetMinSize( wxSize( 300,-1 ) ); + m_ListLibr->SetMinSize( wxSize( 400,90 ) ); - sbLibsChoiceSizer->Add( m_ListLibr, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - bUpperSizer->Add( sbLibsChoiceSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + sbLibsChoiceSizer->Add( m_ListLibr, 1, wxALL|wxEXPAND, 5 ); wxBoxSizer* bRightSizer; bRightSizer = new wxBoxSizer( wxVERTICAL ); @@ -71,7 +36,7 @@ DIALOG_PCBNEW_CONFIG_LIBS_FBP::DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") ); - bRightSizer->Add( m_buttonAddLib, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + bRightSizer->Add( m_buttonAddLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5 ); m_buttonIns = new wxButton( this, wxID_ANY, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") ); @@ -83,54 +48,32 @@ DIALOG_PCBNEW_CONFIG_LIBS_FBP::DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, bRightSizer->Add( m_buttonRemoveLib, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + sbLibsChoiceSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - bRightSizer->Add( 0, 20, 1, wxEXPAND, 5 ); - - m_buttonOk = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_buttonSave = new wxButton( this, ID_SAVE_CFG, _("Save Cfg"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSave->SetToolTip( _("Accept and save current configuration setting in the local .pro file") ); - - bRightSizer->Add( m_buttonSave, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - bUpperSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + bMainSizer->Add( sbLibsChoiceSizer, 1, wxALL|wxEXPAND, 5 ); wxStaticBoxSizer* sbModulesDocSizer; - sbModulesDocSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Module Doc File:") ), wxHORIZONTAL ); + sbModulesDocSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint documentation file") ), wxHORIZONTAL ); m_TextHelpModulesFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbModulesDocSizer->Add( m_TextHelpModulesFileName, 1, wxALL, 5 ); + sbModulesDocSizer->Add( m_TextHelpModulesFileName, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_buttonModDoc = new wxButton( this, wxID_BROWSE_MOD_DOC, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - sbModulesDocSizer->Add( m_buttonModDoc, 0, wxALL, 5 ); + sbModulesDocSizer->Add( m_buttonModDoc, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 10 ); - bMainSizer->Add( sbModulesDocSizer, 0, wxEXPAND, 5 ); - - wxStaticBoxSizer* sbLibPathSizer; - sbLibPathSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Path for Libraries Files:") ), wxVERTICAL ); - - wxBoxSizer* bUserLibPathSizer; - bUserLibPathSizer = new wxBoxSizer( wxHORIZONTAL ); + bMainSizer->Add( sbModulesDocSizer, 0, wxALL|wxEXPAND, 5 ); wxStaticBoxSizer* sbSizer4; - sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User Path:") ), wxHORIZONTAL ); + sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User defined search paths") ), wxHORIZONTAL ); + sbSizer4->SetMinSize( wxSize( 400,70 ) ); wxBoxSizer* bUserListSizer; bUserListSizer = new wxBoxSizer( wxVERTICAL ); m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is highter than default Kicad paths.") ); - bUserListSizer->Add( m_listUserPaths, 1, wxEXPAND, 5 ); + bUserListSizer->Add( m_listUserPaths, 1, wxALL|wxEXPAND, 5 ); sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); @@ -141,44 +84,59 @@ DIALOG_PCBNEW_CONFIG_LIBS_FBP::DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); m_buttonInsPath = new wxButton( this, wxID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxRIGHT|wxLEFT, 5 ); + bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxALL|wxBOTTOM, 5 ); - sbSizer4->Add( bUserPathsButtonsSizer, 0, wxEXPAND, 5 ); + sbSizer4->Add( bUserPathsButtonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); - bUserLibPathSizer->Add( sbSizer4, 1, wxEXPAND, 5 ); + bMainSizer->Add( sbSizer4, 0, wxALL|wxEXPAND, 5 ); + + wxStaticBoxSizer* sbLibPathSizer; + sbLibPathSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Current search path list") ), wxVERTICAL ); + + wxBoxSizer* bUserLibPathSizer; + bUserLibPathSizer = new wxBoxSizer( wxHORIZONTAL ); sbLibPathSizer->Add( bUserLibPathSizer, 1, wxEXPAND, 5 ); - m_staticTextcurrenpaths = new wxStaticText( this, wxID_ANY, _("Current Full Paths for Libraries Files in Use:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextcurrenpaths->Wrap( -1 ); - sbLibPathSizer->Add( m_staticTextcurrenpaths, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_DefaultLibraryPathslistBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); m_DefaultLibraryPathslistBox->SetToolTip( _("Paths (system paths and user paths) used to search and load libraries files and component doc files.\nSorted by decreasing priority order.") ); m_DefaultLibraryPathslistBox->SetMinSize( wxSize( -1,70 ) ); - sbLibPathSizer->Add( m_DefaultLibraryPathslistBox, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + sbLibPathSizer->Add( m_DefaultLibraryPathslistBox, 0, wxALL|wxEXPAND, 5 ); - bMainSizer->Add( sbLibPathSizer, 0, wxEXPAND, 5 ); + bMainSizer->Add( sbLibPathSizer, 0, wxALL|wxEXPAND, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( bMainSizer ); this->Layout(); + bMainSizer->Fit( this ); + + this->Centre( wxBOTH ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCloseWindow ) ); m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonIns->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnOkClick ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCancelClick ), NULL, this ); - m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnSaveCfgClick ), NULL, this ); m_buttonModDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnBrowseModDocFile ), NULL, this ); m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveUserPath ), NULL, this ); + m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCancelClick ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnOkClick ), NULL, this ); } DIALOG_PCBNEW_CONFIG_LIBS_FBP::~DIALOG_PCBNEW_CONFIG_LIBS_FBP() @@ -188,11 +146,10 @@ DIALOG_PCBNEW_CONFIG_LIBS_FBP::~DIALOG_PCBNEW_CONFIG_LIBS_FBP() m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonIns->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnOkClick ), NULL, this ); - m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCancelClick ), NULL, this ); - m_buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnSaveCfgClick ), NULL, this ); m_buttonModDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnBrowseModDocFile ), NULL, this ); m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveUserPath ), NULL, this ); + m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCancelClick ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnOkClick ), NULL, this ); } diff --git a/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.fbp b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.fbp index 8a4a42d7b2..35d697f6c6 100644 --- a/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.fbp +++ b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.fbp @@ -20,7 +20,7 @@ 0 - + wxBOTH 1 @@ -32,7 +32,7 @@ DIALOG_PCBNEW_CONFIG_LIBS_FBP - 593,612 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER @@ -77,373 +77,82 @@ none 5 - wxEXPAND + wxALL|wxEXPAND 1 - + + wxID_ANY + Footprint library files - bUpperSizer + sbLibsChoiceSizer wxHORIZONTAL none + 5 - wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_HORIZONTAL 0 - bLeftSizer - wxVERTICAL + bLibsButtonsSizer + wxHORIZONTAL none - - 5 - wxEXPAND - 0 - - wxID_ANY - Files ext: - - sFileExtBox - wxVERTICAL - none - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Board file Ext: - - - m_InfoBoardFileExt - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Cmp file Ext: - - - m_InfoCmpFileExt - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Library file Ext: - - - m_InfoLibFileExt - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Netlist file Ext: - - - m_InfoNetlistFileExt - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT + wxALL|wxEXPAND 1 - + + + + + 1 + + + 0 wxID_ANY - Libraries - - sbLibsChoiceSizer - wxVERTICAL - none + + 400,90 + m_ListLibr + protected + + + wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE + + List of active library files. Only library files in this list are loaded by Pcbnew. The order of this list is important: Pcbnew searchs for a given footprint using this list order priority. + + + + + + + + + + + + + + + + + + + + + + + + + + + - - 5 - wxALIGN_CENTER_HORIZONTAL - 0 - - - bLibsButtonsSizer - wxHORIZONTAL - none - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Active Libraries: - - - m_staticTextlibList - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 1 - - - - - 1 - - - 0 - wxID_ANY - - 300,-1 - m_ListLibr - protected - - - wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE - - List of active library files. Only library files in this list are loaded by Pcbnew. The order of this list is important: Pcbnew searchs for a given footprint using this list order priority. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxALL 0 @@ -452,7 +161,7 @@ none 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP 0 @@ -606,19 +315,218 @@ + + + + + + 5 + wxALL|wxEXPAND + 0 + + wxID_ANY + Footprint documentation file + + sbModulesDocSizer + wxHORIZONTAL + none + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 1 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_TextHelpModulesFileName + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 0 + + + + 0 + 1 + + + 0 + wxID_BROWSE_MOD_DOC + Browse + + + m_buttonModDoc + protected + + + + + + + + + OnBrowseModDocFile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + wxID_ANY + User defined search paths + 400,70 + sbSizer4 + wxHORIZONTAL + none + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 1 + + + bUserListSizer + wxVERTICAL + none 5 - wxEXPAND + wxALL|wxEXPAND 1 - - 20 + + + + + 1 + + + 0 + wxID_ANY + + + m_listUserPaths protected - 0 + + + + + Additional paths used in this project. The priority is highter than default Kicad paths. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + 0 + + + bUserPathsButtonsSizer + wxVERTICAL + none 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 @@ -628,11 +536,11 @@ 0 - wxID_OK - Ok + ID_LIB_PATH_SEL + Add - m_buttonOk + m_buttonAddPath protected @@ -642,7 +550,7 @@ - OnOkClick + OnAddOrInsertPath @@ -670,7 +578,7 @@ 5 - wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT + wxLEFT|wxRIGHT|wxTOP 0 @@ -680,11 +588,11 @@ 0 - wxID_CANCEL - Cancel + wxID_INSERT_PATH + Insert - m_buttonCancel + m_buttonInsPath protected @@ -694,7 +602,7 @@ - OnCancelClick + OnAddOrInsertPath @@ -722,7 +630,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALL|wxBOTTOM 0 @@ -732,21 +640,21 @@ 0 - ID_SAVE_CFG - Save Cfg + wxID_REMOVE_PATH + Remove - m_buttonSave + m_buttonRemovePath protected - Accept and save current configuration setting in the local .pro file + - OnSaveCfgClick + OnRemoveUserPath @@ -776,6 +684,83 @@ + + 5 + wxALL|wxEXPAND + 0 + + wxID_ANY + Current search path list + + sbLibPathSizer + wxVERTICAL + none + + + 5 + wxEXPAND + 1 + + + bUserLibPathSizer + wxHORIZONTAL + none + + + + 5 + wxALL|wxEXPAND + 0 + + + + + 1 + + + 0 + wxID_ANY + + -1,70 + m_DefaultLibraryPathslistBox + protected + + + wxLB_NEEDED_SB + + Paths (system paths and user paths) used to search and load libraries files and component doc files. Sorted by decreasing priority order. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxEXPAND | wxALL @@ -827,495 +812,28 @@ 5 - wxEXPAND + wxALL|wxEXPAND 0 - - wxID_ANY - Module Doc File: + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 - sbModulesDocSizer - wxHORIZONTAL - none - - - 5 - wxALL - 1 - - - - 1 - - - 0 - wxID_ANY - - 0 - - m_TextHelpModulesFileName - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - - 0 - 1 - - - 0 - wxID_BROWSE_MOD_DOC - Browse - - - m_buttonModDoc - protected - - - - - - - - - OnBrowseModDocFile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - wxID_ANY - Path for Libraries Files: - - sbLibPathSizer - wxVERTICAL - none - - - 5 - wxEXPAND - 1 - - - bUserLibPathSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - wxID_ANY - User Path: - - sbSizer4 - wxHORIZONTAL - none - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 1 - - - bUserListSizer - wxVERTICAL - none - - 5 - wxEXPAND - 1 - - - - - 1 - - - 0 - wxID_ANY - - - m_listUserPaths - protected - - - - - Additional paths used in this project. The priority is highter than default Kicad paths. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bUserPathsButtonsSizer - wxVERTICAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_LIB_PATH_SEL - Add - - - m_buttonAddPath - protected - - - - - - - - - OnAddOrInsertPath - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_INSERT_PATH - Insert - - - m_buttonInsPath - protected - - - - - - - - - OnAddOrInsertPath - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_REMOVE_PATH - Remove - - - m_buttonRemovePath - protected - - - - - - - - - OnRemoveUserPath - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Current Full Paths for Libraries Files in Use: - - - m_staticTextcurrenpaths - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - - - 1 - - - 0 - wxID_ANY - - -1,70 - m_DefaultLibraryPathslistBox - protected - - - wxLB_NEEDED_SB - - Paths (system paths and user paths) used to search and load libraries files and component doc files. Sorted by decreasing priority order. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + m_sdbSizer1 + protected + + OnCancelClick + + + + OnOkClick + + diff --git a/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.h b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.h index dd83032020..2dedfd75c0 100644 --- a/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.h +++ b/pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.h @@ -10,18 +10,17 @@ #include -#include -#include +#include #include +#include +#include #include #include #include -#include -#include -#include #include -#include +#include #include +#include #include /////////////////////////////////////////////////////////////////////////// @@ -38,50 +37,41 @@ class DIALOG_PCBNEW_CONFIG_LIBS_FBP : public wxDialog { ID_ADD_LIB = 1000, ID_REMOVE_LIB, - ID_SAVE_CFG, wxID_BROWSE_MOD_DOC, ID_LIB_PATH_SEL, wxID_INSERT_PATH, wxID_REMOVE_PATH, }; - wxStaticText* m_InfoBoardFileExt; - wxStaticText* m_InfoCmpFileExt; - wxStaticText* m_InfoLibFileExt; - wxStaticText* m_InfoNetlistFileExt; - wxStaticText* m_staticTextlibList; wxListBox* m_ListLibr; wxButton* m_buttonAddLib; wxButton* m_buttonIns; wxButton* m_buttonRemoveLib; - - wxButton* m_buttonOk; - wxButton* m_buttonCancel; - wxButton* m_buttonSave; - wxStaticLine* m_staticline1; wxTextCtrl* m_TextHelpModulesFileName; wxButton* m_buttonModDoc; wxListBox* m_listUserPaths; wxButton* m_buttonAddPath; wxButton* m_buttonInsPath; wxButton* m_buttonRemovePath; - wxStaticText* m_staticTextcurrenpaths; wxListBox* m_DefaultLibraryPathslistBox; + wxStaticLine* m_staticline1; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } virtual void OnAddOrInsertLibClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveLibClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnSaveCfgClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnBrowseModDocFile( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } public: - DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 593,612 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_PCBNEW_CONFIG_LIBS_FBP(); }; diff --git a/pcbnew/dialog_print_using_printer.cpp b/pcbnew/dialog_print_using_printer.cpp index 8114e15556..ab26c04de6 100644 --- a/pcbnew/dialog_print_using_printer.cpp +++ b/pcbnew/dialog_print_using_printer.cpp @@ -154,7 +154,6 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( WinEDA_DrawFrame* parent void DIALOG_PRINT_USING_PRINTER::OnInitDialog( wxInitDialogEvent& event ) /************************************************************************/ { - SetFont( *g_DialogFont ); SetFocus(); int layer_max = NB_LAYERS; wxString msg; diff --git a/pcbnew/dialog_track_options.cpp b/pcbnew/dialog_track_options.cpp index 24a348092d..8b126edac8 100644 --- a/pcbnew/dialog_track_options.cpp +++ b/pcbnew/dialog_track_options.cpp @@ -29,7 +29,6 @@ DIALOG_TRACKS_OPTIONS::DIALOG_TRACKS_OPTIONS( WinEDA_PcbFrame* parent ) void DIALOG_TRACKS_OPTIONS::OnInitDialog( wxInitDialogEvent& event ) { - SetFont( *g_DialogFont ); SetFocus(); // deselect the existing text, seems SetFocus() wants to emulate Microsoft, which is not desireable here. diff --git a/pcbnew/dialog_track_options_base.cpp b/pcbnew/dialog_track_options_base.cpp index 0aa57db941..44ac60f5cd 100644 --- a/pcbnew/dialog_track_options_base.cpp +++ b/pcbnew/dialog_track_options_base.cpp @@ -131,13 +131,9 @@ DIALOG_TRACKS_OPTIONS_BASE::DIALOG_TRACKS_OPTIONS_BASE( wxWindow* parent, wxWind m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonOK->SetDefault(); - m_buttonOK->SetForegroundColour( wxColour( 194, 0, 0 ) ); - bRightSizer->Add( m_buttonOK, 0, wxALL, 5 ); m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonCANCEL->SetForegroundColour( wxColour( 2, 2, 196 ) ); - bRightSizer->Add( m_buttonCANCEL, 0, wxALL, 5 ); bMainSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); diff --git a/pcbnew/dialog_track_options_base.fbp b/pcbnew/dialog_track_options_base.fbp index 2059c5db9e..1cbdcbe506 100644 --- a/pcbnew/dialog_track_options_base.fbp +++ b/pcbnew/dialog_track_options_base.fbp @@ -1109,7 +1109,7 @@ 1 1 - 194,0,0 + 0 wxID_OK @@ -1161,7 +1161,7 @@ 0 1 - 2,2,196 + 0 wxID_CANCEL diff --git a/pcbnew/find.cpp b/pcbnew/find.cpp index b3ce0f0750..543c28869d 100644 --- a/pcbnew/find.cpp +++ b/pcbnew/find.cpp @@ -151,13 +151,13 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_PcbFindFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_PcbFindFrame, wxDialog ) ////@begin WinEDA_PcbFindFrame event table entries -EVT_BUTTON( ID_FIND_ITEM, WinEDA_PcbFindFrame::OnFindItemClick ) + EVT_BUTTON( ID_FIND_ITEM, WinEDA_PcbFindFrame::OnFindItemClick ) -EVT_BUTTON( ID_FIND_NEXT_ITEM, WinEDA_PcbFindFrame::OnFindNextItemClick ) + EVT_BUTTON( ID_FIND_NEXT_ITEM, WinEDA_PcbFindFrame::OnFindNextItemClick ) -EVT_BUTTON( ID_FIND_MARKER, WinEDA_PcbFindFrame::OnFindMarkerClick ) + EVT_BUTTON( ID_FIND_MARKER, WinEDA_PcbFindFrame::OnFindMarkerClick ) -EVT_BUTTON( ID_FIND_NEXT_MARKER, WinEDA_PcbFindFrame::OnFindNextMarkerClick ) + EVT_BUTTON( ID_FIND_NEXT_MARKER, WinEDA_PcbFindFrame::OnFindNextMarkerClick ) ////@end WinEDA_PcbFindFrame event table entries @@ -202,18 +202,18 @@ bool WinEDA_PcbFindFrame::Create( wxWindow* parent, { ////@begin WinEDA_PcbFindFrame member initialisation m_NewText = NULL; - ////@end WinEDA_PcbFindFrame member initialisation ////@begin WinEDA_PcbFindFrame creation - SetExtraStyle( GetExtraStyle() | wxWS_EX_BLOCK_EVENTS ); + SetExtraStyle(wxWS_EX_BLOCK_EVENTS); wxDialog::Create( parent, id, caption, pos, size, style ); CreateControls(); - GetSizer()->Fit( this ); - GetSizer()->SetSizeHints( this ); + if (GetSizer()) + { + GetSizer()->SetSizeHints(this); + } Centre(); - ////@end WinEDA_PcbFindFrame creation return true; } @@ -225,64 +225,41 @@ bool WinEDA_PcbFindFrame::Create( wxWindow* parent, void WinEDA_PcbFindFrame::CreateControls() { - SetFont( *g_DialogFont ); - ////@begin WinEDA_PcbFindFrame content construction - // Generated by DialogBlocks, 04/03/2006 14:04:20 (unregistered) + // Generated by DialogBlocks, 29/04/2009 15:15:49 (unregistered) WinEDA_PcbFindFrame* itemDialog1 = this; - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL ); - itemDialog1->SetSizer( itemBoxSizer2 ); + wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); + itemDialog1->SetSizer(itemBoxSizer2); - wxStaticText* itemStaticText3 = new wxStaticText( itemDialog1, wxID_STATIC, - _( - "Item to find:" ), - wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer2->Add( itemStaticText3, - 0, - wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, - 5 ); + wxStaticText* itemStaticText3 = new wxStaticText( itemDialog1, wxID_STATIC, _("Item to find:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer2->Add(itemStaticText3, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - m_NewText = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( - "" ), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer2->Add( m_NewText, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); + m_NewText = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer2->Add(m_NewText, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - wxBoxSizer* itemBoxSizer5 = new wxBoxSizer( wxHORIZONTAL ); - itemBoxSizer2->Add( itemBoxSizer5, - 0, - wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT | wxBOTTOM, - 5 ); + wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); - wxBoxSizer* itemBoxSizer6 = new wxBoxSizer( wxVERTICAL ); - itemBoxSizer5->Add( itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5 ); + wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer5->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5); - wxButton* itemButton7 = new wxButton( itemDialog1, ID_FIND_ITEM, _( - "Find Item" ), wxDefaultPosition, wxDefaultSize, 0 ); + wxButton* itemButton7 = new wxButton( itemDialog1, ID_FIND_ITEM, _("Find Item"), wxDefaultPosition, wxDefaultSize, 0 ); itemButton7->SetDefault(); - itemButton7->SetForegroundColour( wxColour( 102, 0, 0 ) ); - itemBoxSizer6->Add( itemButton7, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); + itemBoxSizer6->Add(itemButton7, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); - wxButton* itemButton8 = new wxButton( itemDialog1, ID_FIND_NEXT_ITEM, _( - "Find Next Item" ), wxDefaultPosition, wxDefaultSize, - 0 ); - itemButton8->SetForegroundColour( wxColour( 111, 0, 0 ) ); - itemBoxSizer6->Add( itemButton8, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); + wxButton* itemButton8 = new wxButton( itemDialog1, ID_FIND_NEXT_ITEM, _("Find Next Item"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer6->Add(itemButton8, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - wxBoxSizer* itemBoxSizer9 = new wxBoxSizer( wxVERTICAL ); - itemBoxSizer5->Add( itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5 ); + wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer5->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5); - wxButton* itemButton10 = new wxButton( itemDialog1, ID_FIND_MARKER, _( - "Find Marker" ), wxDefaultPosition, wxDefaultSize, - 0 ); - itemButton10->SetForegroundColour( wxColour( 0, 0, 255 ) ); - itemBoxSizer9->Add( itemButton10, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); + wxButton* itemButton10 = new wxButton( itemDialog1, ID_FIND_MARKER, _("Find Marker"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer9->Add(itemButton10, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); - wxButton* itemButton11 = new wxButton( itemDialog1, ID_FIND_NEXT_MARKER, _( - "Find Next Marker" ), wxDefaultPosition, - wxDefaultSize, 0 ); - itemButton11->SetForegroundColour( wxColour( 0, 0, 255 ) ); - itemBoxSizer9->Add( itemButton11, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); + wxButton* itemButton11 = new wxButton( itemDialog1, ID_FIND_NEXT_MARKER, _("Find Next Marker"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer9->Add(itemButton11, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); ////@end WinEDA_PcbFindFrame content construction } @@ -306,9 +283,8 @@ wxBitmap WinEDA_PcbFindFrame::GetBitmapResource( const wxString& name ) { // Bitmap retrieval ////@begin WinEDA_PcbFindFrame bitmap retrieval - wxUnusedVar( name ); + wxUnusedVar(name); return wxNullBitmap; - ////@end WinEDA_PcbFindFrame bitmap retrieval } @@ -321,9 +297,8 @@ wxIcon WinEDA_PcbFindFrame::GetIconResource( const wxString& name ) { // Icon retrieval ////@begin WinEDA_PcbFindFrame icon retrieval - wxUnusedVar( name ); + wxUnusedVar(name); return wxNullIcon; - ////@end WinEDA_PcbFindFrame icon retrieval } diff --git a/pcbnew/find.h b/pcbnew/find.h index 2702720567..c12e531f57 100644 --- a/pcbnew/find.h +++ b/pcbnew/find.h @@ -34,16 +34,16 @@ ////@begin control identifiers #define ID_DIALOG 10000 -#define SYMBOL_WINEDA_PCBFINDFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER -#define SYMBOL_WINEDA_PCBFINDFRAME_TITLE _("Find") -#define SYMBOL_WINEDA_PCBFINDFRAME_IDNAME ID_DIALOG -#define SYMBOL_WINEDA_PCBFINDFRAME_SIZE wxSize(400, 300) -#define SYMBOL_WINEDA_PCBFINDFRAME_POSITION wxDefaultPosition #define ID_TEXTCTRL 10001 #define ID_FIND_ITEM 10002 #define ID_FIND_NEXT_ITEM 10003 #define ID_FIND_MARKER 10004 #define ID_FIND_NEXT_MARKER 10005 +#define SYMBOL_WINEDA_PCBFINDFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER +#define SYMBOL_WINEDA_PCBFINDFRAME_TITLE _("Find") +#define SYMBOL_WINEDA_PCBFINDFRAME_IDNAME ID_DIALOG +#define SYMBOL_WINEDA_PCBFINDFRAME_SIZE wxSize(400, 300) +#define SYMBOL_WINEDA_PCBFINDFRAME_POSITION wxDefaultPosition ////@end control identifiers /*! diff --git a/pcbnew/find.pjd b/pcbnew/find.pjd index 7c2a6b9dd6..f079ddc8ba 100644 --- a/pcbnew/find.pjd +++ b/pcbnew/find.pjd @@ -1,4 +1,4 @@ - +
0 @@ -6,18 +6,21 @@ "" "" "" - 18 "" 0 0 0 + 1 1 1 + 1 0 "jean-pierre Charras" "License GNU" "" 0 + 0 + 0 "<All platforms>" "<Any>" "///////////////////////////////////////////////////////////////////////////// @@ -43,12 +46,6 @@ // Licence: ///////////////////////////////////////////////////////////////////////////// -" - " -/*! - * %BODY% - */ - " "///////////////////////////////////////////////////////////////////////////// // Name: %SYMBOLS-FILENAME% @@ -82,6 +79,14 @@ #include "wx/wx.h" #endif +" + " /// %BODY% +" + " +/*! + * %BODY% + */ + " "app_resources.h" "app_resources.cpp" @@ -93,11 +98,24 @@ "" "<None>" "<System>" + "utf-8" "<System>" "" + 0 + 0 + 4 + " " + "" 0 + 0 + 1 + 0 1 1 + 0 + 1 + 0 + 0
@@ -120,6 +138,53 @@ 0 "" 1 + 0 + "" + "Debug" + "ANSI" + "Static" + "Modular" + "GUI" + "wxMSW" + "Dynamic" + "Yes" + "No" + "No" + "%WXVERSION%" + "%EXECUTABLE%" + "" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + "%AUTO%" + 0 + 1 + "" @@ -133,7 +198,7 @@ 1 1 0 - 0 + 1 "Windows" "html-document" @@ -157,7 +222,10 @@ 10000 0 "" + 0 + "" 0 + 0 "ID_DIALOG" 10000 "WinEDA_PcbFindFrame" @@ -178,10 +246,16 @@ 0 1 "<Any platform>" + "" + "" + "" + "" + "" + "" + "Tiled" 0 1 0 - 0 1 0 0 @@ -196,7 +270,9 @@ 0 0 0 - 0 + 0 + 0 + 0 0 0 1 @@ -208,6 +284,7 @@ -1 400 300 + 0 "" "wxBoxSizer V" @@ -238,9 +315,16 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "" "Item to find:" + -1 "" "" "" @@ -251,6 +335,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -262,6 +351,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -294,7 +385,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL" 10001 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_NewText" "" 0 @@ -308,6 +405,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -321,8 +423,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -330,6 +433,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -348,6 +453,7 @@ 0 "" "" + 0 "wxBoxSizer H" @@ -413,14 +519,27 @@ "wxEVT_COMMAND_BUTTON_CLICKED|OnFindItemClick" "ID_FIND_ITEM" 10002 + "" "wxButton" + "wxButton" + 1 + 0 + "" + "" "" "Find Item" 1 "" "" + "" + "" + "" + "" + "" + "" + "" "" - "660000" + "" "" 0 1 @@ -432,6 +551,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -465,12 +586,25 @@ "wxEVT_COMMAND_BUTTON_CLICKED|OnFindNextItemClick" "ID_FIND_NEXT_ITEM" 10003 + "" "wxButton" + "wxButton" + 1 + 0 + "" + "" "" "Find Next Item" 0 "" "" + "" + "" + "" + "" + "" + "" + "" "" "6F0000" "" @@ -484,6 +618,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -543,14 +679,27 @@ "wxEVT_COMMAND_BUTTON_CLICKED|OnFindMarkerClick" "ID_FIND_MARKER" 10004 + "" "wxButton" + "wxButton" + 1 + 0 + "" + "" "" "Find Marker" 0 "" "" + "" + "" + "" + "" + "" + "" + "" "" - "0000FF" + "" "" 0 1 @@ -562,6 +711,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -595,14 +746,27 @@ "wxEVT_COMMAND_BUTTON_CLICKED|OnFindNextMarkerClick" "ID_FIND_NEXT_MARKER" 10005 + "" "wxButton" + "wxButton" + 1 + 0 + "" + "" "" "Find Next Marker" 0 "" "" + "" + "" + "" + "" + "" + "" + "" "" - "0000FF" + "" "" 0 1 @@ -614,6 +778,8 @@ 0 0 0 + 0 + 0 "" -1 -1 diff --git a/pcbnew/globaleditpad.cpp b/pcbnew/globaleditpad.cpp index 347b8d2218..73105a04e6 100644 --- a/pcbnew/globaleditpad.cpp +++ b/pcbnew/globaleditpad.cpp @@ -81,7 +81,6 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren wxButton* Button; m_Parent = parent; - SetFont( *g_DialogFont ); Centre(); CurrentPad = Pad; @@ -92,25 +91,17 @@ WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* paren Button = new wxButton( this, ID_CHANGE_GET_PAD_SETTINGS, _( "Pad Settings..." ), pos ); - Button->SetForegroundColour( wxColor( 0, 80, 0 ) ); - pos.y += Button->GetDefaultSize().y + 50; Button = new wxButton( this, ID_CHANGE_CURRENT_MODULE, _( "Change Module" ), pos ); - Button->SetForegroundColour( *wxRED ); - pos.y += Button->GetDefaultSize().y + 10; Button = new wxButton( this, ID_CHANGE_ID_MODULES, _( "Change ID Modules" ), pos ); - Button->SetForegroundColour( *wxRED ); - pos.y += Button->GetDefaultSize().y + 10; Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ), pos ); - Button->SetForegroundColour( *wxBLUE ); - // Selection des filtres de selection des pads : pos.x = 5; pos.y = 5; diff --git a/pcbnew/menubarpcb.cpp b/pcbnew/menubarpcb.cpp index ce729490bf..26cba42872 100644 --- a/pcbnew/menubarpcb.cpp +++ b/pcbnew/menubarpcb.cpp @@ -189,9 +189,6 @@ void WinEDA_PcbFrame::ReCreateMenuBar() item->SetBitmap( display_options_xpm ); configmenu->Append( item ); - // Font selection and setup - AddFontSelectionMenu( configmenu ); - wxGetApp().AddMenuLanguageList( configmenu ); configmenu->AppendSeparator(); diff --git a/pcbnew/mirepcb.cpp b/pcbnew/mirepcb.cpp index 9050d1f2f6..43d4090243 100644 --- a/pcbnew/mirepcb.cpp +++ b/pcbnew/mirepcb.cpp @@ -82,7 +82,6 @@ WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, wxButton* Button; m_Parent = parent; - SetFont( *g_DialogFont ); m_DC = DC; Centre(); @@ -97,11 +96,9 @@ WinEDA_MirePropertiesFrame::WinEDA_MirePropertiesFrame( WinEDA_PcbFrame* parent, /* Creation des boutons de commande */ Button = new wxButton( this, wxID_OK, _( "OK" ) ); - Button->SetForegroundColour( *wxRED ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) ); - Button->SetForegroundColour( *wxBLUE ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); // Size: diff --git a/pcbnew/muonde.cpp b/pcbnew/muonde.cpp index e6bf7a7a89..b37b6ed844 100644 --- a/pcbnew/muonde.cpp +++ b/pcbnew/muonde.cpp @@ -849,7 +849,6 @@ WinEDA_SetParamShapeFrame::WinEDA_SetParamShapeFrame( WinEDA_PcbFrame* parent, DIALOG_STYLE ) { m_Parent = parent; - SetFont( *g_DialogFont ); if( PolyEdges ) free( PolyEdges ); @@ -864,15 +863,12 @@ WinEDA_SetParamShapeFrame::WinEDA_SetParamShapeFrame( WinEDA_PcbFrame* parent, MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); wxButton* Button = new wxButton( this, wxID_OK, _( "OK" ) ); - Button->SetForegroundColour( *wxRED ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) ); - Button->SetForegroundColour( *wxBLUE ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); Button = new wxButton( this, ID_READ_SHAPE_FILE, _( "Read Shape Descr File..." ) ); - Button->SetForegroundColour( wxColor( 0, 100, 0 ) ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); wxString shapelist[3] = { _( "Normal" ), _( "Symmetrical" ), _( "Mirrored" ) }; diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 5e1fed222c..ae44a85132 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -46,9 +46,6 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) EVT_TOOL( ID_SAVE_BOARD, WinEDA_PcbFrame::Files_io ) EVT_TOOL( ID_OPEN_MODULE_EDITOR, WinEDA_PcbFrame::Process_Special_Functions ) - EVT_MENU_RANGE( ID_PREFERENCES_FONT_DIALOG, ID_PREFERENCES_FONT_END, - WinEDA_DrawFrame::ProcessFontPreferences ) - // Menu Files: EVT_MENU( ID_MAIN_MENUBAR, WinEDA_PcbFrame::Process_Special_Functions ) diff --git a/pcbnew/pcbplot.cpp b/pcbnew/pcbplot.cpp index b9859dd490..7948dafd0f 100644 --- a/pcbnew/pcbplot.cpp +++ b/pcbnew/pcbplot.cpp @@ -171,7 +171,6 @@ void WinEDA_PlotFrame::OnInitDialog( wxInitDialogEvent& event ) wxConfig* config = wxGetApp().m_EDA_Config; // Current config used by application - SetFont( *g_DialogFont ); m_Plot_Sheet_Ref = NULL; wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxHORIZONTAL ); @@ -285,19 +284,15 @@ void WinEDA_PlotFrame::OnInitDialog( wxInitDialogEvent& event ) /* Create the command buttons */ m_PlotButton = new wxButton( this, ID_EXEC_PLOT, _( "Plot" ) ); - m_PlotButton->SetForegroundColour( *wxRED ); RightBoxSizer->Add( m_PlotButton, 0, wxGROW | wxALL, 5 ); button = new wxButton( this, ID_SAVE_OPT_PLOT, _( "Save Options" ) ); - button->SetForegroundColour( wxColour( 0, 80, 0 ) ); RightBoxSizer->Add( button, 0, wxGROW | wxALL, 5 ); button = new wxButton( this, ID_CREATE_DRILL_FILE, _( "Generate drill file" ) ); - button->SetForegroundColour( wxColour( 0, 80, 80 ) ); RightBoxSizer->Add( button, 0, wxGROW | wxALL, 5 ); button = new wxButton( this, wxID_CANCEL, _( "Close" ) ); - button->SetForegroundColour( *wxBLUE ); RightBoxSizer->Add( button, 0, wxGROW | wxALL, 5 ); diff --git a/pcbnew/sel_layer.cpp b/pcbnew/sel_layer.cpp index 1c39162867..a109d37207 100644 --- a/pcbnew/sel_layer.cpp +++ b/pcbnew/sel_layer.cpp @@ -108,7 +108,6 @@ WinEDA_SelLayerFrame::WinEDA_SelLayerFrame( WinEDA_BasePcbFrame* parent, wxString LayerList[NB_LAYERS + 1]; // One extra element for "(Deselect)" radiobutton int LayerCount, LayerSelect = -1; m_Parent = parent; - SetFont( *g_DialogFont ); /* Build the layer list */ LayerCount = 0; @@ -158,11 +157,9 @@ WinEDA_SelLayerFrame::WinEDA_SelLayerFrame( WinEDA_BasePcbFrame* parent, FrameBoxSizer->Add(ButtonBoxSizer, 0, wxALIGN_BOTTOM|wxALL, 0); Button = new wxButton( this, wxID_OK, _("OK") ); - Button->SetForegroundColour( *wxRED ); ButtonBoxSizer->Add(Button, 0, wxGROW|wxALL, 5); Button = new wxButton( this, wxID_CANCEL, _("Cancel") ); - Button->SetForegroundColour( *wxBLUE ); ButtonBoxSizer->Add(Button, 0, wxGROW|wxALL, 5); if( GetSizer() ) @@ -273,7 +270,6 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( WinEDA_BasePcbFrame* parent int LayerTopSelect = 0, LayerBottomSelect = 0; m_Parent = parent; - SetFont( *g_DialogFont ); PCB_SCREEN* screen = (PCB_SCREEN*) m_Parent->GetScreen(); /* Construction de la liste des couches autoris�s */ @@ -317,11 +313,9 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( WinEDA_BasePcbFrame* parent RadioBoxSizer->Add(m_LayerListBOTTOM, 0, wxALIGN_TOP|wxALL, 5); Button = new wxButton( this, wxID_OK, _("OK") ); - Button->SetForegroundColour( *wxRED ); ButtonBoxSizer->Add(Button, 0, wxGROW|wxALL, 5); Button = new wxButton( this, wxID_CANCEL, _("Cancel") ); - Button->SetForegroundColour( *wxBLUE ); ButtonBoxSizer->Add(Button, 0, wxGROW|wxALL, 5); if( GetSizer() ) diff --git a/pcbnew/set_color.cpp b/pcbnew/set_color.cpp index 24b0aed5e0..96131638f3 100644 --- a/pcbnew/set_color.cpp +++ b/pcbnew/set_color.cpp @@ -123,8 +123,6 @@ void WinEDA_SetColorsFrame::CreateControls() wxSize CorrectRowSize; // Used while specifying height of various spacers int ButtonHeight; // Used while specifying height of other spacers - SetFont( *g_DialogFont ); - OuterBoxSizer = new wxBoxSizer(wxVERTICAL); SetSizer(OuterBoxSizer); @@ -280,7 +278,6 @@ void WinEDA_SetColorsFrame::CreateControls() if (WinEDA_SetColorsFrame::ShowToolTips()) Button->SetToolTip( _("Switch on all of the copper layers") ); Button->SetMinSize( wxSize( GoodWidth, ButtonHeight ) ); - Button->SetForegroundColour( wxColor( 0, 100, 0 ) ); FlexColumnBoxSizer->Add(Button, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP, 5); // Now do everything required for providing the second button. @@ -289,7 +286,6 @@ void WinEDA_SetColorsFrame::CreateControls() if (WinEDA_SetColorsFrame::ShowToolTips()) Button->SetToolTip( _("Switch off all of the copper layers") ); Button->SetMinSize( wxSize( GoodWidth, ButtonHeight ) ); - Button->SetForegroundColour( wxColor( 100, 0, 0 ) ); FlexColumnBoxSizer->Add(Button, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP, 5); } else @@ -342,11 +338,9 @@ void WinEDA_SetColorsFrame::CreateControls() OuterBoxSizer->Add(StdDialogButtonSizer, 0, wxGROW|wxALL, 10); Button = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - Button->SetForegroundColour( *wxRED ); StdDialogButtonSizer->AddButton(Button); Button = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - Button->SetForegroundColour( *wxBLUE ); StdDialogButtonSizer->AddButton(Button); Button = new wxButton( this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxDefaultSize, 0 ); diff --git a/pcbnew/set_grid.cpp b/pcbnew/set_grid.cpp index 5b33a57141..ef0140826b 100644 --- a/pcbnew/set_grid.cpp +++ b/pcbnew/set_grid.cpp @@ -90,7 +90,7 @@ bool WinEDA_PcbGridFrame::Create( wxWindow* parent, wxWindowID id, const wxStrin ////@end WinEDA_PcbGridFrame member initialisation ////@begin WinEDA_PcbGridFrame creation - SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); + SetExtraStyle(wxWS_EX_BLOCK_EVENTS); wxDialog::Create( parent, id, caption, pos, size, style ); CreateControls(); @@ -108,9 +108,8 @@ bool WinEDA_PcbGridFrame::Create( wxWindow* parent, wxWindowID id, const wxStrin void WinEDA_PcbGridFrame::CreateControls() { - SetFont(*g_DialogFont); ////@begin WinEDA_PcbGridFrame content construction - // Generated by DialogBlocks, 17/08/2006 09:27:19 (unregistered) + // Generated by DialogBlocks, 29/04/2009 15:16:09 (unregistered) WinEDA_PcbGridFrame* itemDialog1 = this; @@ -120,11 +119,10 @@ void WinEDA_PcbGridFrame::CreateControls() wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5); - wxString m_UnitGridStrings[] = { - _("Inches"), - _("mm") - }; - m_UnitGrid = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Grid Size Units"), wxDefaultPosition, wxDefaultSize, 2, m_UnitGridStrings, 1, wxRA_SPECIFY_COLS ); + wxArrayString m_UnitGridStrings; + m_UnitGridStrings.Add(_("Inches")); + m_UnitGridStrings.Add(_("mm")); + m_UnitGrid = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Grid Size Units"), wxDefaultPosition, wxDefaultSize, m_UnitGridStrings, 1, wxRA_SPECIFY_COLS ); m_UnitGrid->SetSelection(0); itemBoxSizer3->Add(m_UnitGrid, 0, wxGROW|wxALL, 5); @@ -147,11 +145,9 @@ void WinEDA_PcbGridFrame::CreateControls() wxButton* itemButton11 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); itemButton11->SetDefault(); - itemButton11->SetForegroundColour(wxColour(202, 0, 0)); itemBoxSizer10->Add(itemButton11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); wxButton* itemButton12 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton12->SetForegroundColour(wxColour(0, 0, 255)); itemBoxSizer10->Add(itemButton12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); ////@end WinEDA_PcbGridFrame content construction diff --git a/pcbnew/set_grid.h b/pcbnew/set_grid.h index fb3985ae6d..427c4d2ce7 100644 --- a/pcbnew/set_grid.h +++ b/pcbnew/set_grid.h @@ -35,14 +35,14 @@ ////@begin control identifiers #define ID_DIALOG 10000 +#define ID_RADIOBOX 10001 +#define ID_TEXTCTRL 10002 +#define ID_TEXTCTRL1 10003 #define SYMBOL_WINEDA_PCBGRIDFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER #define SYMBOL_WINEDA_PCBGRIDFRAME_TITLE _("User Grid Size") #define SYMBOL_WINEDA_PCBGRIDFRAME_IDNAME ID_DIALOG #define SYMBOL_WINEDA_PCBGRIDFRAME_SIZE wxSize(400, 300) #define SYMBOL_WINEDA_PCBGRIDFRAME_POSITION wxDefaultPosition -#define ID_RADIOBOX 10001 -#define ID_TEXTCTRL 10002 -#define ID_TEXTCTRL1 10003 ////@end control identifiers /*! diff --git a/pcbnew/set_grid.pjd b/pcbnew/set_grid.pjd index 07b9261abe..3c90792154 100644 --- a/pcbnew/set_grid.pjd +++ b/pcbnew/set_grid.pjd @@ -1,4 +1,4 @@ - +
0 @@ -6,18 +6,21 @@ "" "" "" - 19 "" 0 0 0 + 1 1 1 + 1 0 "jean-pierre Charras" "License GNU" "" 0 + 0 + 0 "<All platforms>" "<Any>" "///////////////////////////////////////////////////////////////////////////// @@ -43,12 +46,6 @@ // Licence: ///////////////////////////////////////////////////////////////////////////// -" - " -/*! - * %BODY% - */ - " "///////////////////////////////////////////////////////////////////////////// // Name: %SYMBOLS-FILENAME% @@ -82,6 +79,14 @@ #include "wx/wx.h" #endif +" + " /// %BODY% +" + " +/*! + * %BODY% + */ + " "app_resources.h" "app_resources.cpp" @@ -93,18 +98,24 @@ "" "<None>" "<System>" + "utf-8" "<System>" "" 0 0 4 + " " "" 0 0 1 + 0 1 1 + 0 1 + 0 + 0
@@ -127,6 +138,7 @@ 0 "" 1 + 0 "" "Debug" "ANSI" @@ -147,6 +159,7 @@ "%AUTO%" "%AUTO%" "%AUTO%" + "%AUTO%" "%AUTO%" "%AUTO%" "%AUTO%" @@ -158,6 +171,7 @@ "%AUTO%" "%AUTO%" "%AUTO%" + "%AUTO%" "%AUTO%" "%AUTO%" "%AUTO%" @@ -168,6 +182,9 @@ "%AUTO%" "%AUTO%" "%AUTO%" + 0 + 1 + ""
@@ -181,7 +198,7 @@ 1 1 0 - 0 + 1 "Windows" "html-document" @@ -205,7 +222,10 @@ 10000 0 "" + 0 + "" 0 + 0 "ID_DIALOG" 10000 "WinEDA_PcbGridFrame" @@ -226,10 +246,16 @@ 0 1 "<Any platform>" + "" + "" + "" + "" + "" + "" + "Tiled" 0 1 0 - 0 1 0 0 @@ -258,6 +284,7 @@ -1 400 300 + 0 "" "wxBoxSizer H" @@ -313,7 +340,13 @@ "wbRadioBoxProxy" "ID_RADIOBOX" 10001 + "" "wxRadioBox" + "wxRadioBox" + 1 + 0 + "" + "" "m_UnitGrid" "Grid Size Units" 1 @@ -329,6 +362,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 1 0 @@ -392,7 +430,13 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "" "User Grid Size X" -1 @@ -406,6 +450,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -451,7 +500,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL" 10002 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_OptGridSizeX" "" 0 @@ -465,6 +520,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -478,8 +538,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -507,6 +568,7 @@ 0 "" "" + 0 "wxStaticText: wxID_STATIC" @@ -521,7 +583,13 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "" "User Grid Size Y" -1 @@ -535,6 +603,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -580,7 +653,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL1" 10003 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_OptGridSizeY" "" 0 @@ -594,6 +673,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -607,8 +691,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -636,6 +721,7 @@ 0 "" "" + 0 @@ -677,14 +763,27 @@ "wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick" "wxID_OK" 5100 + "" "wxButton" + "wxButton" + 1 + 0 + "" + "" "" "&OK" 1 "" "" + "" + "" + "" + "" + "" + "" + "" "" - "CA0000" + "" "" 0 1 @@ -731,14 +830,27 @@ "wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick" "wxID_CANCEL" 5101 + "" "wxButton" + "wxButton" + 1 + 0 + "" + "" "" "&Cancel" 0 "" "" + "" + "" + "" + "" + "" + "" + "" "" - "0000FF" + "" "" 0 1 diff --git a/pcbnew/swap_layers.cpp b/pcbnew/swap_layers.cpp index 44ad913e05..7b3568466b 100644 --- a/pcbnew/swap_layers.cpp +++ b/pcbnew/swap_layers.cpp @@ -16,7 +16,7 @@ /* Variables locales */ #define LAYER_NO_CHANGE NB_LAYERS -static int New_Layer[NB_LAYERS]; +static int New_Layer[NB_LAYERS]; wxStaticText* layer_list[NB_LAYERS]; enum swap_layer_id { @@ -46,13 +46,13 @@ private: public: // Constructor and destructor - WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame * parent ); + WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ); ~WinEDA_SwapLayerFrame() { }; private: - void Sel_Layer( wxCommandEvent& event ); - void OnOkClick( wxCommandEvent& event ); - void OnCancelClick( wxCommandEvent& event ); + void Sel_Layer( wxCommandEvent& event ); + void OnOkClick( wxCommandEvent& event ); + void OnCancelClick( wxCommandEvent& event ); DECLARE_EVENT_TABLE() }; @@ -67,34 +67,34 @@ BEGIN_EVENT_TABLE( WinEDA_SwapLayerFrame, wxDialog ) END_EVENT_TABLE() -/*************************************************************************/ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) : wxDialog( parent, -1, _( "Swap Layers:" ), wxPoint( -1, -1 ), - wxDefaultSize, wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER ) -/*************************************************************************/ + wxDefaultSize, wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER ) { - BOARD* board = parent->GetBoard(); +/*************************************************************************/ + BOARD* board = parent->GetBoard(); OuterBoxSizer = NULL; - MainBoxSizer = NULL; + MainBoxSizer = NULL; FlexColumnBoxSizer = NULL; - label = NULL; + label = NULL; Button = NULL; - text = NULL; - Line = NULL; + text = NULL; + Line = NULL; StdDialogButtonSizer = NULL; m_Parent = parent; - SetFont( *g_DialogFont ); - int item_ID; + int item_ID; wxSize goodSize; - // Experimentation has shown that buttons in the Windows version can be 20 pixels - // wide and 20 pixels high, but that they need to be 26 pixels wide and 26 pixels - // high in the Linux version. (And although the dimensions of those buttons could - // be set to 26 pixels wide and 26 pixels high in both of those versions, that would - // result in a dialog box which would be excessively high in the Windows version.) + /* Experimentation has shown that buttons in the Windows version can be + * 20 pixels wide and 20 pixels high, but that they need to be 26 pixels + * wide and 26 pixels high in the Linux version. (And although the + * dimensions of those buttons could be set to 26 pixels wide and 26 + * pixels high in both of those versions, that would result in a dialog + * box which would be excessively high in the Windows version.) + */ #ifdef __WINDOWS__ int w = 20; int h = 20; @@ -102,147 +102,176 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) : int w = 26; int h = 26; #endif - // As currently implemented, the dimensions of the buttons in the Mac version are - // also 26 pixels wide and 26 pixels high. If appropriate, the above code should be - // modified as required in the event that those buttons should be some other size - // in that version. - OuterBoxSizer = new wxBoxSizer(wxVERTICAL); - SetSizer(OuterBoxSizer); + /* As currently implemented, the dimensions of the buttons in the Mac + * version are also 26 pixels wide and 26 pixels high. If appropriate, + * the above code should be modified as required in the event that those + * buttons should be some other size in that version. + */ - MainBoxSizer = new wxBoxSizer(wxHORIZONTAL); - OuterBoxSizer->Add(MainBoxSizer, 1, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); + OuterBoxSizer = new wxBoxSizer( wxVERTICAL ); + SetSizer( OuterBoxSizer ); + + MainBoxSizer = new wxBoxSizer( wxHORIZONTAL ); + OuterBoxSizer->Add( MainBoxSizer, 1, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); for( int ii = 0; ii < NB_LAYERS; ii++ ) { // Provide a vertical line to separate the two FlexGrid sizers if( ii == 16 ) { - Line = new wxStaticLine( this, -1, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - MainBoxSizer->Add(Line, 0, wxGROW|wxLEFT|wxRIGHT, 5); + Line = new wxStaticLine( this, + -1, + wxDefaultPosition, + wxDefaultSize, + wxLI_VERTICAL ); + MainBoxSizer->Add( Line, 0, wxGROW | wxLEFT | wxRIGHT, 5 ); } // Provide a separate FlexGrid sizer for every sixteen sets of controls if( ii % 16 == 0 ) { - // Each layer has an associated static text string (to identify that layer), - // a button (for invoking a child dialog box to change which layer that the - // layer is mapped to), and a second static text string (to depict which layer - // that the layer has been mapped to). Each of those items are placed into - // the left hand column, middle column, and right hand column (respectively) - // of the Flexgrid sizer, and the color of the second text string is set to - // fushia or blue (to respectively indicate whether the layer has been - // swapped to another layer or is not being swapped at all). - // (Experimentation has shown that if a text control is used to depict which - // layer that each layer is mapped to (instead of a static text string), then - // those controls do not behave in a fully satisfactory manner in the Linux - // version. Even when the read-only attribute is specified for all of those - // controls, they can still be selected when the arrow keys or Tab key is used - // to step through all of the controls within the dialog box, and directives - // to set the foreground color of the text of each such control to blue (to - // indicate that the text is of a read-only nature) are disregarded.) - - // Specify a FlexGrid sizer with sixteen rows and three columns. - FlexColumnBoxSizer = new wxFlexGridSizer(16, 3, 0, 0); + /* Each layer has an associated static text string (to identify + * that layer), a button (for invoking a child dialog box to + * change which layer that the layer is mapped to), and a second + * static text string (to depict which layer that the layer has + * been mapped to). Each of those items are placed into the left + * hand column, middle column, and right hand column (respectively) + * of the Flexgrid sizer, and the color of the second text string + * is set to fuchsia or blue (to respectively indicate whether the + * layer has been swapped to another layer or is not being swapped + * at all). (Experimentation has shown that if a text control is + * used to depict which layer that each layer is mapped to (instead + * of a static text string), then those controls do not behave in + * a fully satisfactory manner in the Linux version. Even when the + * read-only attribute is specified for all of those controls, they + * can still be selected when the arrow keys or Tab key is used + * to step through all of the controls within the dialog box, and + * directives to set the foreground color of the text of each such + * control to blue (to indicate that the text is of a read-only + * nature) are disregarded.) + * + * Specify a FlexGrid sizer with sixteen rows and three columns. + */ + FlexColumnBoxSizer = new wxFlexGridSizer( 16, 3, 0, 0 ); // Specify that all of the rows can be expanded. for( int jj = 0; jj < 16; jj++ ) { - FlexColumnBoxSizer->AddGrowableRow(jj); + FlexColumnBoxSizer->AddGrowableRow( jj ); } // Specify that (just) the right-hand column can be expanded. - FlexColumnBoxSizer->AddGrowableCol(2); + FlexColumnBoxSizer->AddGrowableCol( 2 ); - MainBoxSizer->Add(FlexColumnBoxSizer, 1, wxGROW|wxTOP, 5); + MainBoxSizer->Add( FlexColumnBoxSizer, 1, wxGROW | wxTOP, 5 ); } - // Provide a text string to identify this layer (with trailing spaces within that string being purged) + /* Provide a text string to identify this layer (with trailing spaces + * within that string being purged). + */ label = new wxStaticText( this, wxID_STATIC, board->GetLayerName( ii ), - wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); - FlexColumnBoxSizer->Add(label, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxBOTTOM, 5); + wxDefaultPosition, wxDefaultSize, + wxALIGN_RIGHT ); + FlexColumnBoxSizer->Add( label, 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | + wxLEFT | wxBOTTOM, + 5 ); // Provide a button for this layer (which will invoke a child dialog box) item_ID = ID_BUTTON_0 + ii; - Button = new wxButton( this, item_ID, wxT("..."), wxDefaultPosition, wxSize(w, h), 0 ); - FlexColumnBoxSizer->Add(Button, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxBOTTOM, 5); + Button = new wxButton( this, item_ID, wxT( "..." ), wxDefaultPosition, + wxSize( w, h ), 0 ); + FlexColumnBoxSizer->Add( Button, 0, + wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | + wxLEFT | wxBOTTOM, 5 ); - // Provide another text string to specify which layer that this layer is - // mapped to, set the initial text to "No Change" (to indicate that this - // layer is currently unmapped to any other layer), and set the foreground - // color of the text to blue (which also indicates that the layer is - // currently unmapped to any other layer). + /* Provide another text string to specify which layer that this layer + * is mapped to, set the initial text to "No Change" (to indicate that + * this layer is currently unmapped to any other layer), and set the + * foreground color of the text to blue (which also indicates that the + * layer is currently unmapped to any other layer). + */ item_ID = ID_TEXT_0 + ii; - // When the first of these text strings is being added, determine what size is necessary to - // to be able to display any possible string without it being truncated. Then specify that - // size as the minimum size for all of these text strings. (If this minimum size is not - // determined in this fashion, then it is possible for the display of one or more of these - // strings to be truncated after different layers are selected.) + /* When the first of these text strings is being added, determine + * what size is necessary to to be able to display any possible + * string without it being truncated. Then specify that size as the + * minimum size for all of these text strings. (If this minimum + * size is not determined in this fashion, then it is possible for + * the display of one or more of these strings to be truncated after + * different layers are selected.) + */ if( ii == 0 ) { - text = new wxStaticText( this, item_ID, board->GetLayerName( 0 ), wxDefaultPosition, wxDefaultSize, 0 ); + text = new wxStaticText( this, item_ID, board->GetLayerName( 0 ), + wxDefaultPosition, wxDefaultSize, 0 ); goodSize = text->GetSize(); + for( int jj = 1; jj < NB_LAYERS; jj++ ) { text->SetLabel( board->GetLayerName( jj ) ); if( goodSize.x < text->GetSize().x ) goodSize.x = text->GetSize().x; } - text->SetLabel( _("No Change") ); + + text->SetLabel( _( "No Change" ) ); if( goodSize.x < text->GetSize().x ) goodSize.x = text->GetSize().x; } else - text = new wxStaticText( this, item_ID, _("No Change"), wxDefaultPosition, wxDefaultSize, 0 ); + text = new wxStaticText( this, item_ID, _( "No Change" ), + wxDefaultPosition, wxDefaultSize, 0 ); text->SetMinSize( goodSize ); - text->SetForegroundColour( *wxBLUE ); - FlexColumnBoxSizer->Add(text, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); - + FlexColumnBoxSizer->Add( text, 1, + wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | + wxLEFT | wxRIGHT | wxBOTTOM, 5 ); layer_list[ii] = text; } - // Provide spacers to occupy otherwise blank cells within the second FlexGrid sizer. (As it - // incorporates three columns, three spacers are thus required for each otherwise unused row.) + /* Provide spacers to occupy otherwise blank cells within the second + * FlexGrid sizer. (As it incorporates three columns, three spacers + * are thus required for each otherwise unused row.) + */ for( int ii = 3 * NB_LAYERS; ii < 96; ii++ ) { - FlexColumnBoxSizer->Add(5, h, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); + FlexColumnBoxSizer->Add( 5, h, 0, wxALIGN_CENTER_HORIZONTAL | + wxALIGN_CENTER_VERTICAL | wxLEFT | + wxRIGHT | wxBOTTOM, 5 ); } // Provide a line to separate the controls which have been provided so far // from the OK and Cancel buttons (which will be provided after this line) - Line = new wxStaticLine( this, -1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - OuterBoxSizer->Add(Line, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); + Line = new wxStaticLine( this, -1, wxDefaultPosition, wxDefaultSize, + wxLI_HORIZONTAL ); + OuterBoxSizer->Add( Line, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); // Provide a StdDialogButtonSizer to accommodate the OK and Cancel buttons; // using that type of sizer results in those buttons being automatically // located in positions appropriate for each (OS) version of KiCad. StdDialogButtonSizer = new wxStdDialogButtonSizer; - OuterBoxSizer->Add(StdDialogButtonSizer, 0, wxGROW|wxALL, 10); + OuterBoxSizer->Add( StdDialogButtonSizer, 0, wxGROW | wxALL, 10 ); - Button = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); - Button->SetForegroundColour( *wxRED ); - StdDialogButtonSizer->AddButton(Button); - - Button = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - Button->SetForegroundColour( *wxBLUE ); - StdDialogButtonSizer->AddButton(Button); + Button = new wxButton( this, wxID_OK, _( "&OK" ), wxDefaultPosition, + wxDefaultSize, 0 ); + StdDialogButtonSizer->AddButton( Button ); + Button = new wxButton( this, wxID_CANCEL, _( "&Cancel" ), + wxDefaultPosition, wxDefaultSize, 0 ); + StdDialogButtonSizer->AddButton( Button ); StdDialogButtonSizer->Realize(); // Resize the dialog if( GetSizer() ) { - GetSizer()->SetSizeHints(this); + GetSizer()->SetSizeHints( this ); } } -/***************************************************************/ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event ) -/***************************************************************/ { int ii, jj; @@ -279,6 +308,7 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event ) if( jj >= LAYER_NO_CHANGE ) { layer_list[ii]->SetLabel( _( "No Change" ) ); + // Change the text color to blue (to highlight // that this layer is *not* being swapped) layer_list[ii]->SetForegroundColour( *wxBLUE ); @@ -286,41 +316,34 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event ) else { layer_list[ii]->SetLabel( m_Parent->GetBoard()->GetLayerName( jj ) ); - // Change the text color to fushia (to highlight + + // Change the text color to fuchsia (to highlight // that this layer *is* being swapped) - layer_list[ii]->SetForegroundColour( wxColour(255, 0, 128) ); + layer_list[ii]->SetForegroundColour( wxColour( 255, 0, 128 ) ); } } } -/*********************************************************/ void WinEDA_SwapLayerFrame::OnCancelClick( wxCommandEvent& event ) -/*********************************************************/ { EndModal( -1 ); } -/*********************************************************/ void WinEDA_SwapLayerFrame::OnOkClick( wxCommandEvent& event ) -/*********************************************************/ { EndModal( 1 ); } -/********************************************************/ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event ) -/********************************************************/ -/* Swap layers */ { int ii, jj; TRACK* pt_segm; DRAWSEGMENT* pt_drawsegm; EDA_BaseStruct* PtStruct; - /* Init default values */ for( ii = 0; ii < NB_LAYERS; ii++ ) New_Layer[ii] = LAYER_NO_CHANGE; @@ -331,7 +354,7 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event ) frame->Destroy(); if( ii != 1 ) - return; // (Cancelled dialog box returns -1 instead) + return; // (Canceled dialog box returns -1 instead) /* Modifications des pistes */ pt_segm = GetBoard()->m_Track; @@ -345,9 +368,11 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event ) continue; int top_layer, bottom_layer; Via->ReturnLayerPair( &top_layer, &bottom_layer ); - if( New_Layer[bottom_layer] >= 0 && New_Layer[bottom_layer] < LAYER_NO_CHANGE ) + if( New_Layer[bottom_layer] >= 0 && New_Layer[bottom_layer] < + LAYER_NO_CHANGE ) bottom_layer = New_Layer[bottom_layer]; - if( New_Layer[top_layer] >= 0 && New_Layer[top_layer] < LAYER_NO_CHANGE ) + if( New_Layer[top_layer] >= 0 + && New_Layer[top_layer] < LAYER_NO_CHANGE ) top_layer = New_Layer[top_layer]; Via->SetLayerPair( top_layer, bottom_layer ); } diff --git a/pcbnew/xchgmod.cpp b/pcbnew/xchgmod.cpp index 404711873f..ab1dcf9981 100644 --- a/pcbnew/xchgmod.cpp +++ b/pcbnew/xchgmod.cpp @@ -45,22 +45,23 @@ private: public: // Constructor and destructor - WinEDA_ExchangeModuleFrame( WinEDA_BasePcbFrame * parent, - MODULE * Module, wxDC * DC, const wxPoint &pos ); + WinEDA_ExchangeModuleFrame( WinEDA_BasePcbFrame* parent, + MODULE* Module, wxDC* DC, const wxPoint& pos ); ~WinEDA_ExchangeModuleFrame() { } + private: void OnQuit( wxCommandEvent& event ); void Change_Module( wxCommandEvent& event ); void Change_ModuleId( wxCommandEvent& event ); void Change_ModuleAll( wxCommandEvent& event ); - int Maj_ListeCmp( - const wxString& reference, - const wxString& old_name, - const wxString& new_name, bool ShowError ); - MODULE* Change_1_Module( MODULE* Module, const wxString& new_module, bool ShowError ); + int Maj_ListeCmp( const wxString& reference, const wxString& old_name, + const wxString& new_name, bool ShowError ); + MODULE* Change_1_Module( MODULE* Module, + const wxString& new_module, + bool ShowError ); void Sel_NewMod_By_Liste( wxCommandEvent& event ); @@ -83,17 +84,19 @@ BEGIN_EVENT_TABLE( WinEDA_ExchangeModuleFrame, wxDialog ) END_EVENT_TABLE() -WinEDA_ExchangeModuleFrame::WinEDA_ExchangeModuleFrame( WinEDA_BasePcbFrame* parent, - MODULE* Module, wxDC* DC, - const wxPoint& framepos ) : +WinEDA_ExchangeModuleFrame::WinEDA_ExchangeModuleFrame( + WinEDA_BasePcbFrame* parent, + MODULE* Module, + wxDC* DC, + const wxPoint& + framepos ) : wxDialog( parent, -1, _( "Exchange Modules" ), framepos, wxSize( 360, 460 ), DIALOG_STYLE ) { wxButton* Button; m_Parent = parent; - SetFont( *g_DialogFont ); - m_DC = DC; + m_DC = DC; Centre(); m_CurrentModule = Module; @@ -115,60 +118,56 @@ WinEDA_ExchangeModuleFrame::WinEDA_ExchangeModuleFrame( WinEDA_BasePcbFrame* par Button = new wxButton( this, ID_EXEC_EXCHANGE_MODULE, _( "Change module" ) ); - Button->SetForegroundColour( *wxBLUE ); RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); Button = new wxButton( this, ID_EXEC_EXCHANGE_ID_MODULES, _( "Change same modules" ) ); - Button->SetForegroundColour( *wxRED ); RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT, 5 ); Button = new wxButton( this, ID_EXEC_EXCHANGE_ID_MODULE_AND_VALUE, _( "Ch. same module+value" ) ); - Button->SetForegroundColour( *wxRED ); RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT, 5 ); Button = new wxButton( this, ID_EXEC_EXCHANGE_ALL_MODULES, _( "Change all" ) ); - Button->SetForegroundColour( *wxRED ); RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT, 5 ); Button = new wxButton( this, ID_BROWSE_LIB_MODULES, _( "Browse Libs modules" ) ); - Button->SetForegroundColour( wxColour( 0, 100, 0 ) ); RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT, 5 ); Button = new wxButton( this, ID_CLOSE_EXCHANGE_MODULE, _( "Close" ) ); - Button->SetForegroundColour( *wxBLUE ); RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); m_OldModule = new WinEDA_EnterText( this, _( "Current Module" ), m_CurrentModule ? - m_CurrentModule->m_LibRef.GetData () : wxEmptyString, + m_CurrentModule->m_LibRef.GetData() : + wxEmptyString, LeftBoxSizer, wxSize( 150, -1 ) ); m_OldModule->Enable( FALSE ); m_OldValue = new WinEDA_EnterText( this, _( "Current Value" ), m_CurrentModule ? - m_CurrentModule->m_Value->m_Text.GetData () : wxEmptyString, + m_CurrentModule->m_Value->m_Text.GetData() : + wxEmptyString, LeftBoxSizer, wxSize( 150, -1 ) ); m_OldValue->Enable( FALSE ); - m_NewModule = new WinEDA_EnterText( this, _( "New Module" ), - m_OldModule->GetValue(), - LeftBoxSizer, wxSize( 150, -1 ) ); + m_NewModule = new WinEDA_EnterText( this, _( "New Module" ), + m_OldModule->GetValue(), + LeftBoxSizer, wxSize( 150, -1 ) ); - m_WinMsg = new wxTextCtrl( this, -1, wxEmptyString, wxDefaultPosition, - wxSize( 340, 230 ), - wxTE_READONLY | wxTE_MULTILINE ); + m_WinMsg = new wxTextCtrl( this, -1, wxEmptyString, wxDefaultPosition, + wxSize( 340, 230 ), + wxTE_READONLY | wxTE_MULTILINE ); MainBoxSizer->Add( m_WinMsg, 0, wxGROW | wxALL, 5 ); @@ -177,9 +176,8 @@ WinEDA_ExchangeModuleFrame::WinEDA_ExchangeModuleFrame( WinEDA_BasePcbFrame* par } -/*********************************************************************/ -void WinEDA_BasePcbFrame::InstallExchangeModuleFrame( MODULE* Module, - wxDC* DC, +void WinEDA_BasePcbFrame::InstallExchangeModuleFrame( MODULE* Module, + wxDC* DC, const wxPoint& pos ) { WinEDA_ExchangeModuleFrame* frame = @@ -190,21 +188,13 @@ void WinEDA_BasePcbFrame::InstallExchangeModuleFrame( MODULE* Module, } -/**********************************************************************/ -void WinEDA_ExchangeModuleFrame::OnQuit( wxCommandEvent& WXUNUSED (event) ) -/**********************************************************************/ +void WinEDA_ExchangeModuleFrame::OnQuit( wxCommandEvent& WXUNUSED( event ) ) { Close( true ); // true is to force the frame to close } /************************************************************************/ -int WinEDA_ExchangeModuleFrame::Maj_ListeCmp( - const wxString& reference, - const wxString& old_name, - const wxString& new_name, bool ShowError ) -/************************************************************************/ - /* * Met a jour le fichier name.CMP (s'il existe) apres un echange de module * (par la commande changeMod), si les modules sont geres par ce fichier @@ -213,6 +203,10 @@ int WinEDA_ExchangeModuleFrame::Maj_ListeCmp( * trouve. * Retoure 1 si erreur */ +int WinEDA_ExchangeModuleFrame::Maj_ListeCmp( const wxString& reference, + const wxString& old_name, + const wxString& new_name, + bool ShowError ) { wxFileName fn; wxFileName tmpFileName; @@ -255,7 +249,8 @@ int WinEDA_ExchangeModuleFrame::Maj_ListeCmp( } fgets( Line, sizeof(Line), FichCmp ); - fprintf( NewFile, "Cmp-Mod V01 Genere par PcbNew le %s\n", DateAndTime( Line ) ); + fprintf( NewFile, "Cmp-Mod V01 Genere par PcbNew le %s\n", + DateAndTime( Line ) ); bool start_descr = FALSE; while( fgets( Line, sizeof(Line), FichCmp ) != NULL ) @@ -272,7 +267,7 @@ int WinEDA_ExchangeModuleFrame::Maj_ListeCmp( } if( (strnicmp( Line, "Begin", 5 ) == 0) - || (strnicmp( Line, "End", 3 ) == 0) ) + || (strnicmp( Line, "End", 3 ) == 0) ) { start_descr = FALSE; } @@ -297,17 +292,15 @@ int WinEDA_ExchangeModuleFrame::Maj_ListeCmp( } -/********************************************************************/ -void WinEDA_ExchangeModuleFrame::Change_Module( wxCommandEvent& event ) -/********************************************************************/ - -/* Routine de changement d'un module: +/* + * Routine de changement d'un module: * Change le module pointe par la souris, par un autre en conservant * - meme orientation * - meme position * - memes textes valeur et ref * - memes netnames pour pads de meme nom */ +void WinEDA_ExchangeModuleFrame::Change_Module( wxCommandEvent& event ) { wxString newmodulename = m_NewModule->GetValue(); @@ -322,11 +315,8 @@ void WinEDA_ExchangeModuleFrame::Change_Module( wxCommandEvent& event ) } -/*********************************************************************/ -void WinEDA_ExchangeModuleFrame::Change_ModuleId( wxCommandEvent& event ) -/**********************************************************************/ - -/* Routine de changement de tous les modules de meme nom lib que celui +/* + * Routine de changement de tous les modules de meme nom lib que celui * selectionne, en conservant * - meme orientation * - meme position @@ -336,6 +326,7 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleId( wxCommandEvent& event ) * Attention: m_CurrentModule ne pointe plus sur le module de reference * puisque celui ci a ete change!! */ +void WinEDA_ExchangeModuleFrame::Change_ModuleId( wxCommandEvent& event ) { wxString msg; MODULE* Module, * PtBack; @@ -356,14 +347,14 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleId( wxCommandEvent& event ) check_module_value = TRUE; value = m_CurrentModule->m_Value->m_Text; msg.Printf( _( "Change modules <%s> -> <%s> (val = %s)?" ), - m_CurrentModule->m_LibRef.GetData(), - newmodulename.GetData(), - m_CurrentModule->m_Value->m_Text.GetData() ); + m_CurrentModule->m_LibRef.GetData(), + newmodulename.GetData(), + m_CurrentModule->m_Value->m_Text.GetData() ); } else { msg.Printf( _( "Change modules <%s> -> <%s> ?" ), - lib_reference.GetData(), newmodulename.GetData() ); + lib_reference.GetData(), newmodulename.GetData() ); } if( !IsOK( this, msg ) ) @@ -381,7 +372,9 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleId( wxCommandEvent& event ) } /* Ici Module pointe le dernier module de la liste */ - for( ; Module && ((BOARD*) Module != m_Parent->GetBoard()); Module = PtBack ) + for( ; + Module && ( (BOARD*) Module != m_Parent->GetBoard() ); + Module = PtBack ) { MODULE* module; PtBack = Module->Back(); @@ -407,19 +400,17 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleId( wxCommandEvent& event ) } -/***********************************************************************/ -void WinEDA_ExchangeModuleFrame::Change_ModuleAll( wxCommandEvent& event ) -/***********************************************************************/ - -/* Routine de changement de tous les modules par les modules de meme nom lib: +/* + * Routine de changement de tous les modules par les modules de meme nom lib: * en conservant * - meme orientation * - meme position * - memes textes valeur et ref * - memes netnames pour pads de meme nom */ +void WinEDA_ExchangeModuleFrame::Change_ModuleAll( wxCommandEvent& event ) { - MODULE * Module, * PtBack; + MODULE* Module, * PtBack; bool change = FALSE; int ShowErr = 5; // Affiche 5 messages d'err maxi @@ -441,7 +432,9 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleAll( wxCommandEvent& event ) } /* Ici Module pointe le dernier module de la liste */ - for( ; Module && ((BOARD*) Module != m_Parent->GetBoard()); Module = PtBack ) + for( ; + Module && ( (BOARD*) Module != m_Parent->GetBoard() ); + Module = PtBack ) { PtBack = Module->Back(); if( Change_1_Module( Module, Module->m_LibRef.GetData(), ShowErr ) ) @@ -458,12 +451,8 @@ void WinEDA_ExchangeModuleFrame::Change_ModuleAll( wxCommandEvent& event ) } -/******************************************************************/ -MODULE* WinEDA_ExchangeModuleFrame::Change_1_Module( MODULE* Module, - const wxString& new_module, bool ShowError ) -/*******************************************************************/ - -/* Routine de changement d'un module: +/* + * Routine de changement d'un module: * Change le module de numero empr, avec le module de nom new_module * - meme orientation * - meme position @@ -473,6 +462,9 @@ MODULE* WinEDA_ExchangeModuleFrame::Change_1_Module( MODULE* Module, * 0 si pas de changement ( si le nouveau module n'est pas en libr) * 1 si OK */ +MODULE* WinEDA_ExchangeModuleFrame::Change_1_Module( MODULE* Module, + const wxString& new_module, + bool ShowError ) { wxString namecmp, oldnamecmp; MODULE* NewModule; @@ -489,12 +481,14 @@ MODULE* WinEDA_ExchangeModuleFrame::Change_1_Module( MODULE* Module, /* Chargement du module */ Line.Printf( _( "Change module %s (%s) " ), - Module->m_Reference->m_Text.GetData(), oldnamecmp.GetData() ); + Module->m_Reference->m_Text.GetData(), oldnamecmp.GetData() ); m_WinMsg->WriteText( Line ); namecmp.Trim( TRUE ); namecmp.Trim( FALSE ); - NewModule = m_Parent->Get_Librairie_Module( wxEmptyString, namecmp, ShowError ); + NewModule = m_Parent->Get_Librairie_Module( wxEmptyString, + namecmp, + ShowError ); if( NewModule == NULL ) /* Nouveau module NON trouve, reaffichage de l'ancien */ { m_WinMsg->WriteText( wxT( "No\n" ) ); @@ -513,29 +507,33 @@ MODULE* WinEDA_ExchangeModuleFrame::Change_1_Module( MODULE* Module, /* Affichage du nouveau module */ NewModule->Draw( m_Parent->DrawPanel, m_DC, GR_OR ); - Maj_ListeCmp( NewModule->m_Reference->m_Text, oldnamecmp, namecmp, ShowError ); + Maj_ListeCmp( NewModule->m_Reference->m_Text, + oldnamecmp, + namecmp, + ShowError ); return NewModule; } -/***********************************************************************************/ -MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff, - MODULE* OldModule, MODULE* NewModule ) -/***********************************************************************************/ - /* - * Remplace le module OldModule par le module NewModule (en conservant position, orientation..) - * OldModule est supprim� de la memoire. + * Remplace le module OldModule par le module NewModule (en conservant + * position, orientation..) + * OldModule est supprim� de la memoire. */ +MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff, + MODULE* OldModule, + MODULE* NewModule ) { - wxPoint oldpos;/* memorisation temporaire pos curseur */ + wxPoint oldpos; /* memorisation temporaire pos curseur */ D_PAD* pad, * old_pad; - if( (OldModule->Type() != TYPE_MODULE) || (NewModule->Type() != TYPE_MODULE) ) + if( (OldModule->Type() != TYPE_MODULE) + || (NewModule->Type() != TYPE_MODULE) ) { - DisplayError( winaff, wxT( "WinEDA_BasePcbFrame::Exchange_Module() StuctType error" ) ); + DisplayError( winaff, wxT( "WinEDA_BasePcbFrame::Exchange_Module() " \ + "StuctType error" ) ); } NewModule->SetParent( GetBoard() ); @@ -560,7 +558,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff, /* Mise a jour des textes ref et val */ NewModule->m_Reference->m_Text = OldModule->m_Reference->m_Text; - NewModule->m_Value->m_Text = OldModule->m_Value->m_Text; + NewModule->m_Value->m_Text = OldModule->m_Value->m_Text; /* Mise a jour des autres parametres */ NewModule->m_TimeStamp = OldModule->m_TimeStamp; @@ -576,29 +574,29 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff, for( ; old_pad != NULL; old_pad = old_pad->Next() ) { if( strnicmp( pad->m_Padname, old_pad->m_Padname, - sizeof(pad->m_Padname) ) == 0 ) + sizeof(pad->m_Padname) ) == 0 ) { - pad->SetNetname(old_pad->GetNetname() ); + pad->SetNetname( old_pad->GetNetname() ); pad->SetNet( old_pad->GetNet() ); } } } /* Effacement de l'ancien module */ - OldModule ->DeleteStructure(); + OldModule->DeleteStructure(); GetBoard()->m_Status_Pcb = 0; - NewModule->m_Flags = 0; + NewModule->m_Flags = 0; GetScreen()->SetModify(); return NewModule; } -/***************************************************************************/ +/* + * affiche la liste des modules en librairie et selectione 1 nom + */ void WinEDA_ExchangeModuleFrame::Sel_NewMod_By_Liste( wxCommandEvent& event ) -/***************************************************************************/ -/*affiche la liste des modules en librairie et selectione 1 nom */ { wxString newname; @@ -611,15 +609,13 @@ void WinEDA_ExchangeModuleFrame::Sel_NewMod_By_Liste( wxCommandEvent& event ) } -/***************************************************/ -void WinEDA_PcbFrame::RecreateCmpFileFromBoard(wxCommandEvent& aEvent) -/***************************************************/ /** * Function RecreateBOMFileFromBoard * Recreates a .cmp file from the current loaded board * this is the same as created by cvpcb. * can be used if this file is lost */ +void WinEDA_PcbFrame::RecreateCmpFileFromBoard( wxCommandEvent& aEvent ) { wxFileName fn; FILE* FichCmp; @@ -638,7 +634,7 @@ void WinEDA_PcbFrame::RecreateCmpFileFromBoard(wxCommandEvent& aEvent) fn = GetScreen()->m_FileName; fn.SetExt( NetCmpExtBuffer ); wildcard = _( "Component files (." ) + NetCmpExtBuffer + wxT( ")|*." ) + - NetCmpExtBuffer; + NetCmpExtBuffer; wxFileDialog dlg( this, _( "Save Component Files" ), wxEmptyString, fn.GetFullName(), wildcard, @@ -665,7 +661,7 @@ void WinEDA_PcbFrame::RecreateCmpFileFromBoard(wxCommandEvent& aEvent) { fprintf( FichCmp, "\nBeginCmp\n" ); fprintf( FichCmp, "TimeStamp = %8.8lX\n", Module->m_TimeStamp ); - fprintf( FichCmp, "Path = %s\n", CONV_TO_UTF8(Module->m_Path) ); + fprintf( FichCmp, "Path = %s\n", CONV_TO_UTF8( Module->m_Path ) ); fprintf( FichCmp, "Reference = %s;\n", !Module->m_Reference->m_Text.IsEmpty() ? CONV_TO_UTF8( Module->m_Reference->m_Text ) : "[NoRef]" );