From 7841f8a466d47a8db44d1701ea7366d6e0560ff3 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 14 May 2018 18:34:18 +0100 Subject: [PATCH] Unified preferences dialog framework. (cherry picked from commit 8ee3e77) --- bitmaps_png/cpp_26/lang_catalan.cpp | 2 +- bitmaps_png/cpp_26/lang_chinese.cpp | 2 +- common/CMakeLists.txt | 7 +- common/bitmap.cpp | 15 +- common/dialog_about/AboutDialog_main.cpp | 2 +- common/dialog_shim.cpp | 19 +- common/dialogs/dialog_hotkeys_editor.cpp | 97 - common/dialogs/dialog_hotkeys_editor_base.cpp | 67 - common/dialogs/dialog_hotkeys_editor_base.fbp | 485 -- common/dialogs/panel_common_settings.cpp | 178 + common/dialogs/panel_common_settings.h | 53 + common/dialogs/panel_common_settings_base.cpp | 183 + common/dialogs/panel_common_settings_base.fbp | 1828 ++++++ common/dialogs/panel_common_settings_base.h | 82 + common/dialogs/panel_hotkeys_editor.cpp | 81 + common/dialogs/panel_hotkeys_editor_base.cpp | 67 + common/dialogs/panel_hotkeys_editor_base.fbp | 553 ++ ...tor_base.h => panel_hotkeys_editor_base.h} | 31 +- common/draw_frame.cpp | 15 + common/draw_panel.cpp | 12 - common/eda_base_frame.cpp | 89 +- common/hotkeys_basic.cpp | 38 +- common/kiway.cpp | 6 +- common/kiway_player.cpp | 7 - common/pgm_base.cpp | 240 +- common/tool/context_menu.cpp | 8 +- common/widgets/gal_options_panel.cpp | 10 +- common/widgets/paged_dialog.cpp | 264 + common/widgets/widget_hotkey_list.cpp | 2 +- cvpcb/cvpcb_mainframe.cpp | 9 +- cvpcb/menubar.cpp | 5 +- eeschema/CMakeLists.txt | 12 +- .../dialogs/dialog_edit_components_libid.cpp | 2 +- eeschema/dialogs/dialog_edit_line_style.h | 2 - eeschema/dialogs/dialog_eeschema_options.cpp | 392 -- eeschema/dialogs/dialog_eeschema_options.h | 412 -- .../dialogs/dialog_eeschema_options_base.cpp | 411 -- .../dialogs/dialog_eeschema_options_base.fbp | 5269 ----------------- .../dialogs/dialog_eeschema_options_base.h | 143 - eeschema/dialogs/dialog_libedit_options.cpp | 130 - eeschema/dialogs/dialog_libedit_options.h | 105 - .../dialogs/dialog_libedit_options_base.cpp | 213 - .../dialogs/dialog_libedit_options_base.fbp | 3120 ---------- .../dialogs/dialog_libedit_options_base.h | 98 - .../panel_eeschema_display_options.cpp | 114 + .../dialogs/panel_eeschema_display_options.h | 41 + .../panel_eeschema_display_options_base.cpp | 128 + .../panel_eeschema_display_options_base.fbp | 1500 +++++ .../panel_eeschema_display_options_base.h | 59 + eeschema/dialogs/panel_eeschema_settings.cpp | 81 + eeschema/dialogs/panel_eeschema_settings.h | 41 + .../dialogs/panel_eeschema_settings_base.cpp | 123 + .../dialogs/panel_eeschema_settings_base.fbp | 1624 +++++ .../dialogs/panel_eeschema_settings_base.h | 71 + .../panel_eeschema_template_fieldnames.cpp | 170 + .../panel_eeschema_template_fieldnames.h | 76 + ...anel_eeschema_template_fieldnames_base.cpp | 87 + ...anel_eeschema_template_fieldnames_base.fbp | 440 ++ .../panel_eeschema_template_fieldnames_base.h | 55 + eeschema/dialogs/panel_libedit_settings.cpp | 87 + eeschema/dialogs/panel_libedit_settings.h | 41 + .../dialogs/panel_libedit_settings_base.cpp | 190 + .../dialogs/panel_libedit_settings_base.fbp | 2655 +++++++++ .../dialogs/panel_libedit_settings_base.h | 74 + eeschema/eeschema_config.cpp | 200 +- eeschema/lib_edit_frame.cpp | 17 +- eeschema/lib_edit_frame.h | 17 +- eeschema/menubar.cpp | 117 +- eeschema/menubar_libedit.cpp | 13 +- eeschema/sch_base_frame.cpp | 7 +- eeschema/sch_edit_frame.cpp | 15 +- eeschema/sch_edit_frame.h | 26 +- eeschema/sim/sim_plot_frame.cpp | 6 +- .../widgets/widget_eeschema_color_config.cpp | 25 +- .../widgets/widget_eeschema_color_config.h | 19 +- gerbview/CMakeLists.txt | 8 +- gerbview/dialogs/dialog_show_page_borders.cpp | 84 - .../dialogs/dialog_show_page_borders_base.cpp | 65 - .../dialogs/dialog_show_page_borders_base.fbp | 318 - .../dialogs/dialog_show_page_borders_base.h | 55 - .../gerbview_dialog_display_options_frame.cpp | 259 - ...view_dialog_display_options_frame_base.cpp | 175 - ...rbview_dialog_display_options_frame_base.h | 75 - .../panel_gerbview_display_options.cpp | 109 + .../dialogs/panel_gerbview_display_options.h | 51 + .../panel_gerbview_display_options_base.cpp | 66 + .../panel_gerbview_display_options_base.fbp | 504 ++ .../panel_gerbview_display_options_base.h | 49 + gerbview/dialogs/panel_gerbview_settings.cpp | 68 + ...ge_borders.h => panel_gerbview_settings.h} | 29 +- .../dialogs/panel_gerbview_settings_base.cpp | 57 + .../dialogs/panel_gerbview_settings_base.fbp | 469 ++ .../dialogs/panel_gerbview_settings_base.h | 48 + gerbview/events_called_functions.cpp | 18 +- gerbview/gbr_display_options.h | 2 + gerbview/gerbview.cpp | 6 +- gerbview/gerbview.h | 2 +- gerbview/gerbview_config.cpp | 28 +- gerbview/gerbview_frame.cpp | 12 +- gerbview/gerbview_frame.h | 12 +- gerbview/gerbview_id.h | 1 - gerbview/menubar.cpp | 65 +- gerbview/toolbars_gerber.cpp | 4 - include/bitmaps.h | 4 +- include/draw_frame.h | 5 + include/eda_base_frame.h | 61 +- include/id.h | 5 - include/kiway.h | 9 +- include/kiway_player.h | 9 +- ...otkeys_editor.h => panel_hotkeys_editor.h} | 53 +- include/pgm_base.h | 38 +- include/widgets/paged_dialog.h | 64 + kicad/CMakeLists.txt | 1 - kicad/import_project.cpp | 10 +- kicad/kicad.h | 22 +- kicad/mainframe.cpp | 57 +- kicad/menubar.cpp | 74 +- kicad/preferences.cpp | 92 - kicad/prjconfig.cpp | 2 +- pagelayout_editor/events_functions.cpp | 3 +- pagelayout_editor/menubar.cpp | 66 +- pagelayout_editor/pl_editor_config.cpp | 22 +- pcbnew/CMakeLists.txt | 18 +- pcbnew/dialogs/dialog_general_options.cpp | 197 - ...ialog_general_options_BoardEditor_base.cpp | 282 - ...ialog_general_options_BoardEditor_base.fbp | 2606 -------- .../dialog_general_options_BoardEditor_base.h | 100 - pcbnew/dialogs/dialog_modedit_options.cpp | 163 - .../dialogs/dialog_modedit_options_base.cpp | 225 - pcbnew/dialogs/dialog_modedit_options_base.h | 88 - pcbnew/dialogs/panel_modedit_defaults.cpp | 82 + pcbnew/dialogs/panel_modedit_defaults.h | 52 + .../dialogs/panel_modedit_defaults_base.cpp | 163 + ...se.fbp => panel_modedit_defaults_base.fbp} | 4519 +++++++------- pcbnew/dialogs/panel_modedit_defaults_base.h | 68 + ....cpp => panel_modedit_display_options.cpp} | 53 +- .../dialogs/panel_modedit_display_options.h | 42 + pcbnew/dialogs/panel_modedit_settings.cpp | 73 + ...lay_options.h => panel_modedit_settings.h} | 26 +- .../dialogs/panel_modedit_settings_base.cpp | 75 + .../dialogs/panel_modedit_settings_base.fbp | 580 ++ pcbnew/dialogs/panel_modedit_settings_base.h | 52 + ...s.cpp => panel_pcbnew_display_options.cpp} | 57 +- ...tions.h => panel_pcbnew_display_options.h} | 13 +- ... => panel_pcbnew_display_options_base.cpp} | 47 +- ... => panel_pcbnew_display_options_base.fbp} | 79 +- ....h => panel_pcbnew_display_options_base.h} | 25 +- pcbnew/dialogs/panel_pcbnew_settings.cpp | 98 + ...eral_options.h => panel_pcbnew_settings.h} | 23 +- pcbnew/dialogs/panel_pcbnew_settings_base.cpp | 148 + .../dialogs/panel_pcbnew_settings_base.fbp | 2124 ++++--- pcbnew/dialogs/panel_pcbnew_settings_base.h | 70 + pcbnew/footprint_edit_frame.cpp | 60 +- pcbnew/footprint_edit_frame.h | 13 +- pcbnew/invoke_pcb_dialog.h | 8 - pcbnew/menubar_footprint_editor.cpp | 24 +- pcbnew/menubar_pcb_editor.cpp | 22 +- pcbnew/pcb_edit_frame.cpp | 36 +- pcbnew/pcb_edit_frame.h | 11 +- pcbnew/pcbnew_config.cpp | 36 +- pcbnew/pcbnew_id.h | 1 - pcbnew/tool_pcb_editor.cpp | 4 +- 162 files changed, 17656 insertions(+), 20828 deletions(-) delete mode 100644 common/dialogs/dialog_hotkeys_editor.cpp delete mode 100644 common/dialogs/dialog_hotkeys_editor_base.cpp delete mode 100644 common/dialogs/dialog_hotkeys_editor_base.fbp create mode 100644 common/dialogs/panel_common_settings.cpp create mode 100644 common/dialogs/panel_common_settings.h create mode 100644 common/dialogs/panel_common_settings_base.cpp create mode 100644 common/dialogs/panel_common_settings_base.fbp create mode 100644 common/dialogs/panel_common_settings_base.h create mode 100644 common/dialogs/panel_hotkeys_editor.cpp create mode 100644 common/dialogs/panel_hotkeys_editor_base.cpp create mode 100644 common/dialogs/panel_hotkeys_editor_base.fbp rename common/dialogs/{dialog_hotkeys_editor_base.h => panel_hotkeys_editor_base.h} (58%) create mode 100644 common/widgets/paged_dialog.cpp delete mode 100644 eeschema/dialogs/dialog_eeschema_options.cpp delete mode 100644 eeschema/dialogs/dialog_eeschema_options.h delete mode 100644 eeschema/dialogs/dialog_eeschema_options_base.cpp delete mode 100644 eeschema/dialogs/dialog_eeschema_options_base.fbp delete mode 100644 eeschema/dialogs/dialog_eeschema_options_base.h delete mode 100644 eeschema/dialogs/dialog_libedit_options.cpp delete mode 100644 eeschema/dialogs/dialog_libedit_options.h delete mode 100644 eeschema/dialogs/dialog_libedit_options_base.cpp delete mode 100644 eeschema/dialogs/dialog_libedit_options_base.fbp delete mode 100644 eeschema/dialogs/dialog_libedit_options_base.h create mode 100644 eeschema/dialogs/panel_eeschema_display_options.cpp create mode 100644 eeschema/dialogs/panel_eeschema_display_options.h create mode 100644 eeschema/dialogs/panel_eeschema_display_options_base.cpp create mode 100644 eeschema/dialogs/panel_eeschema_display_options_base.fbp create mode 100644 eeschema/dialogs/panel_eeschema_display_options_base.h create mode 100644 eeschema/dialogs/panel_eeschema_settings.cpp create mode 100644 eeschema/dialogs/panel_eeschema_settings.h create mode 100644 eeschema/dialogs/panel_eeschema_settings_base.cpp create mode 100644 eeschema/dialogs/panel_eeschema_settings_base.fbp create mode 100644 eeschema/dialogs/panel_eeschema_settings_base.h create mode 100644 eeschema/dialogs/panel_eeschema_template_fieldnames.cpp create mode 100644 eeschema/dialogs/panel_eeschema_template_fieldnames.h create mode 100644 eeschema/dialogs/panel_eeschema_template_fieldnames_base.cpp create mode 100644 eeschema/dialogs/panel_eeschema_template_fieldnames_base.fbp create mode 100644 eeschema/dialogs/panel_eeschema_template_fieldnames_base.h create mode 100644 eeschema/dialogs/panel_libedit_settings.cpp create mode 100644 eeschema/dialogs/panel_libedit_settings.h create mode 100644 eeschema/dialogs/panel_libedit_settings_base.cpp create mode 100644 eeschema/dialogs/panel_libedit_settings_base.fbp create mode 100644 eeschema/dialogs/panel_libedit_settings_base.h delete mode 100644 gerbview/dialogs/dialog_show_page_borders.cpp delete mode 100644 gerbview/dialogs/dialog_show_page_borders_base.cpp delete mode 100644 gerbview/dialogs/dialog_show_page_borders_base.fbp delete mode 100644 gerbview/dialogs/dialog_show_page_borders_base.h delete mode 100644 gerbview/dialogs/gerbview_dialog_display_options_frame.cpp delete mode 100644 gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp delete mode 100644 gerbview/dialogs/gerbview_dialog_display_options_frame_base.h create mode 100644 gerbview/dialogs/panel_gerbview_display_options.cpp create mode 100644 gerbview/dialogs/panel_gerbview_display_options.h create mode 100644 gerbview/dialogs/panel_gerbview_display_options_base.cpp create mode 100644 gerbview/dialogs/panel_gerbview_display_options_base.fbp create mode 100644 gerbview/dialogs/panel_gerbview_display_options_base.h create mode 100644 gerbview/dialogs/panel_gerbview_settings.cpp rename gerbview/dialogs/{dialog_show_page_borders.h => panel_gerbview_settings.h} (61%) create mode 100644 gerbview/dialogs/panel_gerbview_settings_base.cpp create mode 100644 gerbview/dialogs/panel_gerbview_settings_base.fbp create mode 100644 gerbview/dialogs/panel_gerbview_settings_base.h rename include/{dialog_hotkeys_editor.h => panel_hotkeys_editor.h} (57%) create mode 100644 include/widgets/paged_dialog.h delete mode 100644 kicad/preferences.cpp delete mode 100644 pcbnew/dialogs/dialog_general_options.cpp delete mode 100644 pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp delete mode 100644 pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp delete mode 100644 pcbnew/dialogs/dialog_general_options_BoardEditor_base.h delete mode 100644 pcbnew/dialogs/dialog_modedit_options.cpp delete mode 100644 pcbnew/dialogs/dialog_modedit_options_base.cpp delete mode 100644 pcbnew/dialogs/dialog_modedit_options_base.h create mode 100644 pcbnew/dialogs/panel_modedit_defaults.cpp create mode 100644 pcbnew/dialogs/panel_modedit_defaults.h create mode 100644 pcbnew/dialogs/panel_modedit_defaults_base.cpp rename pcbnew/dialogs/{dialog_modedit_options_base.fbp => panel_modedit_defaults_base.fbp} (78%) create mode 100644 pcbnew/dialogs/panel_modedit_defaults_base.h rename pcbnew/dialogs/{dialog_modedit_display_options.cpp => panel_modedit_display_options.cpp} (51%) create mode 100644 pcbnew/dialogs/panel_modedit_display_options.h create mode 100644 pcbnew/dialogs/panel_modedit_settings.cpp rename pcbnew/dialogs/{dialog_modedit_display_options.h => panel_modedit_settings.h} (73%) create mode 100644 pcbnew/dialogs/panel_modedit_settings_base.cpp create mode 100644 pcbnew/dialogs/panel_modedit_settings_base.fbp create mode 100644 pcbnew/dialogs/panel_modedit_settings_base.h rename pcbnew/dialogs/{dialog_display_options.cpp => panel_pcbnew_display_options.cpp} (68%) rename pcbnew/dialogs/{dialog_display_options.h => panel_pcbnew_display_options.h} (79%) rename pcbnew/dialogs/{dialog_display_options_base.cpp => panel_pcbnew_display_options_base.cpp} (55%) rename pcbnew/dialogs/{dialog_display_options_base.fbp => panel_pcbnew_display_options_base.fbp} (93%) rename pcbnew/dialogs/{dialog_display_options_base.h => panel_pcbnew_display_options_base.h} (57%) create mode 100644 pcbnew/dialogs/panel_pcbnew_settings.cpp rename pcbnew/dialogs/{dialog_general_options.h => panel_pcbnew_settings.h} (68%) create mode 100644 pcbnew/dialogs/panel_pcbnew_settings_base.cpp rename gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp => pcbnew/dialogs/panel_pcbnew_settings_base.fbp (57%) create mode 100644 pcbnew/dialogs/panel_pcbnew_settings_base.h diff --git a/bitmaps_png/cpp_26/lang_catalan.cpp b/bitmaps_png/cpp_26/lang_catalan.cpp index 450a990415..fe9f692aae 100644 --- a/bitmaps_png/cpp_26/lang_catalan.cpp +++ b/bitmaps_png/cpp_26/lang_catalan.cpp @@ -24,6 +24,6 @@ static const unsigned char png[] = { 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, }; -const BITMAP_OPAQUE lang_catalan_xpm[1] = {{ png, sizeof( png ), "lang_catalan_xpm" }}; +const BITMAP_OPAQUE lang_ca_xpm[1] = {{ png, sizeof( png ), "lang_ca_xpm" }}; //EOF diff --git a/bitmaps_png/cpp_26/lang_chinese.cpp b/bitmaps_png/cpp_26/lang_chinese.cpp index 9af056ef34..e423ce8510 100644 --- a/bitmaps_png/cpp_26/lang_chinese.cpp +++ b/bitmaps_png/cpp_26/lang_chinese.cpp @@ -25,6 +25,6 @@ static const unsigned char png[] = { 0x2b, 0xeb, 0x17, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, }; -const BITMAP_OPAQUE lang_chinese_xpm[1] = {{ png, sizeof( png ), "lang_chinese_xpm" }}; +const BITMAP_OPAQUE lang_zh_xpm[1] = {{ png, sizeof( png ), "lang_zh_xpm" }}; //EOF diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 37f8ac8880..986ab281c8 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -158,14 +158,16 @@ set( COMMON_DLG_SRCS dialogs/dialog_display_info_HTML_base.cpp dialogs/dialog_exit_base.cpp dialogs/dialog_file_dir_picker.cpp - dialogs/dialog_hotkeys_editor.cpp - dialogs/dialog_hotkeys_editor_base.cpp dialogs/dialog_image_editor.cpp dialogs/dialog_image_editor_base.cpp dialogs/dialog_list_selector_base.cpp dialogs/dialog_page_settings_base.cpp dialogs/dialog_text_entry_base.cpp dialogs/dialog_text_entry.cpp + dialogs/panel_common_settings.cpp + dialogs/panel_common_settings_base.cpp + dialogs/panel_hotkeys_editor.cpp + dialogs/panel_hotkeys_editor_base.cpp dialogs/wx_html_report_panel.cpp dialogs/wx_html_report_panel_base.cpp ) @@ -182,6 +184,7 @@ set( COMMON_WIDGET_SRCS widgets/grid_icon_text_helpers.cpp widgets/indicator_icon.cpp widgets/mathplot.cpp + widgets/paged_dialog.cpp widgets/progress_reporter.cpp widgets/text_ctrl_eval.cpp widgets/two_column_tree_list.cpp diff --git a/common/bitmap.cpp b/common/bitmap.cpp index d86d537e43..031b2cc556 100644 --- a/common/bitmap.cpp +++ b/common/bitmap.cpp @@ -102,7 +102,8 @@ int KiIconScale( wxWindow* aWindow ) static int get_scale_factor( EDA_BASE_FRAME* aWindow ) { - const int requested_scale = aWindow->GetIconScale(); + int requested_scale; + Pgm().CommonSettings()->Read( ICON_SCALE_KEY, &requested_scale, 0 ); if( requested_scale > 0 ) return requested_scale; @@ -179,7 +180,8 @@ wxMenuItem* AddMenuItem( wxMenu* aMenu, int aId, const wxString& aText, item = new wxMenuItem( aMenu, aId, aText, wxEmptyString, aType ); // Retrieve the global applicaton show icon option: - bool useImagesInMenus = Pgm().GetUseIconsInMenus(); + bool useImagesInMenus; + Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus ); if( useImagesInMenus ) { @@ -214,7 +216,8 @@ wxMenuItem* AddMenuItem( wxMenu* aMenu, int aId, const wxString& aText, item = new wxMenuItem( aMenu, aId, aText, aHelpText, aType ); // Retrieve the global applicaton show icon option: - bool useImagesInMenus = Pgm().GetUseIconsInMenus(); + bool useImagesInMenus; + Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus ); if( useImagesInMenus ) { @@ -249,7 +252,8 @@ wxMenuItem* AddMenuItem( wxMenu* aMenu, wxMenu* aSubMenu, int aId, item->SetSubMenu( aSubMenu ); // Retrieve the global applicaton show icon option: - bool useImagesInMenus = Pgm().GetUseIconsInMenus(); + bool useImagesInMenus; + Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus ); if( useImagesInMenus ) item->SetBitmap( aImage ); @@ -270,7 +274,8 @@ wxMenuItem* AddMenuItem( wxMenu* aMenu, wxMenu* aSubMenu, int aId, item->SetSubMenu( aSubMenu ); // Retrieve the global applicaton show icon option: - bool useImagesInMenus = Pgm().GetUseIconsInMenus(); + bool useImagesInMenus; + Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus ); if( useImagesInMenus ) item->SetBitmap( aImage ); diff --git a/common/dialog_about/AboutDialog_main.cpp b/common/dialog_about/AboutDialog_main.cpp index a6842ca227..b0b1af5701 100644 --- a/common/dialog_about/AboutDialog_main.cpp +++ b/common/dialog_about/AboutDialog_main.cpp @@ -258,7 +258,7 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf wxEmptyString, wxEmptyString, "Catalan (CA)", - aInfo.CreateKiBitmap( lang_catalan_xpm ) ) ); + aInfo.CreateKiBitmap( lang_ca_xpm ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Martin Kratoška" ), wxEmptyString, wxEmptyString, diff --git a/common/dialog_shim.cpp b/common/dialog_shim.cpp index 6bbd534866..42874a7c80 100644 --- a/common/dialog_shim.cpp +++ b/common/dialog_shim.cpp @@ -71,20 +71,13 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl h = dynamic_cast( aParent ); } - if( h ) - { - // Inherit units from parent - m_units = h->GetUserUnits(); + wxASSERT_MSG( h, "Dialog parent is not a KIWAY_HOLDER" ); - // Set up the message bus - SetKiway( this, &h->Kiway() ); - } - else - { - // There are a few dialogs, such as Configure Paths, which are called - // from the top-level wxFrame. - m_units = MILLIMETRES; - } + // Inherit units from parent + m_units = h->GetUserUnits(); + + // Set up the message bus + SetKiway( this, &h->Kiway() ); Bind( wxEVT_CLOSE_WINDOW, &DIALOG_SHIM::OnCloseWindow, this ); Bind( wxEVT_BUTTON, &DIALOG_SHIM::OnButton, this ); diff --git a/common/dialogs/dialog_hotkeys_editor.cpp b/common/dialogs/dialog_hotkeys_editor.cpp deleted file mode 100644 index c355bb2c45..0000000000 --- a/common/dialogs/dialog_hotkeys_editor.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * This program source code file is part of KICAD, a free EDA CAD application. - * - * Copyright (C) 1992-2018 Kicad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include - -void InstallHotkeyFrame( EDA_BASE_FRAME* aParent, EDA_HOTKEY_CONFIG* aHotkeys, - EDA_HOTKEY_CONFIG* aShowHotkeys ) -{ - if( !aShowHotkeys ) - aShowHotkeys = aHotkeys; - - HOTKEYS_EDITOR_DIALOG dialog( aParent, aHotkeys, aShowHotkeys ); - - int diag = dialog.ShowModal(); - - if( diag == wxID_OK ) - { - aParent->ReCreateMenuBar(); - aParent->Refresh(); - } -} - - -HOTKEYS_EDITOR_DIALOG::HOTKEYS_EDITOR_DIALOG( EDA_BASE_FRAME* aParent, - EDA_HOTKEY_CONFIG* aHotkeys, EDA_HOTKEY_CONFIG* aShowHotkeys ) : - HOTKEYS_EDITOR_DIALOG_BASE( aParent ), - m_hotkeys( aHotkeys ), - m_showhotkeys( aShowHotkeys ) -{ - m_hotkeyListCtrl = new WIDGET_HOTKEY_LIST( m_panelHotkeys, - WIDGET_HOTKEY_LIST::GenSections( aShowHotkeys ) ); - m_hotkeyListCtrl->InstallOnPanel( m_panelHotkeys ); - - m_sdbSizerOK->SetDefault(); - - Layout(); - SetSizeInDU( 350, 300 ); - Center(); -} - - -bool HOTKEYS_EDITOR_DIALOG::TransferDataToWindow() -{ - if( !wxDialog::TransferDataToWindow() ) - return false; - - if( !m_hotkeyListCtrl->TransferDataToControl() ) - return false; - - return true; -} - - -bool HOTKEYS_EDITOR_DIALOG::TransferDataFromWindow() -{ - if( !wxDialog::TransferDataToWindow() ) - return false; - - if( !m_hotkeyListCtrl->TransferDataFromControl() ) - return false; - - // save the hotkeys - GetParent()->WriteHotkeyConfig( m_hotkeys ); - - return true; -} - - -void HOTKEYS_EDITOR_DIALOG::ResetClicked( wxCommandEvent& aEvent ) -{ - m_hotkeyListCtrl->TransferDataToControl(); -} - -void HOTKEYS_EDITOR_DIALOG::DefaultsClicked( wxCommandEvent& aEvent ) -{ - m_hotkeyListCtrl->TransferDefaultsToControl(); -} diff --git a/common/dialogs/dialog_hotkeys_editor_base.cpp b/common/dialogs/dialog_hotkeys_editor_base.cpp deleted file mode 100644 index b1f302e028..0000000000 --- a/common/dialogs/dialog_hotkeys_editor_base.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 22 2017) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_hotkeys_editor_base.h" - -/////////////////////////////////////////////////////////////////////////// - -HOTKEYS_EDITOR_DIALOG_BASE::HOTKEYS_EDITOR_DIALOG_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - m_mainSizer = new wxBoxSizer( wxVERTICAL ); - - m_staticText1 = new wxStaticText( this, wxID_ANY, _("Double-click to edit"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1->Wrap( 400 ); - m_mainSizer->Add( m_staticText1, 0, wxALL|wxEXPAND, 5 ); - - m_panelHotkeys = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelHotkeys->SetMinSize( wxSize( -1,350 ) ); - - m_mainSizer->Add( m_panelHotkeys, 1, wxEXPAND | wxALL, 5 ); - - wxBoxSizer* b_buttonsSizer; - b_buttonsSizer = new wxBoxSizer( wxHORIZONTAL ); - - m_resetButton = new wxButton( this, wxID_RESET, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 ); - b_buttonsSizer->Add( m_resetButton, 0, wxALL|wxEXPAND, 5 ); - - m_defaultButton = new wxButton( this, wxID_ANY, _("Defaults"), wxDefaultPosition, wxDefaultSize, 0 ); - b_buttonsSizer->Add( m_defaultButton, 0, wxALL|wxEXPAND, 5 ); - - - b_buttonsSizer->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_sdbSizer = new wxStdDialogButtonSizer(); - m_sdbSizerOK = new wxButton( this, wxID_OK ); - m_sdbSizer->AddButton( m_sdbSizerOK ); - m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); - m_sdbSizer->AddButton( m_sdbSizerCancel ); - m_sdbSizer->Realize(); - - b_buttonsSizer->Add( m_sdbSizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - - m_mainSizer->Add( b_buttonsSizer, 0, wxALIGN_RIGHT|wxEXPAND, 5 ); - - - this->SetSizer( m_mainSizer ); - this->Layout(); - m_mainSizer->Fit( this ); - - // Connect Events - m_resetButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HOTKEYS_EDITOR_DIALOG_BASE::ResetClicked ), NULL, this ); - m_defaultButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HOTKEYS_EDITOR_DIALOG_BASE::DefaultsClicked ), NULL, this ); -} - -HOTKEYS_EDITOR_DIALOG_BASE::~HOTKEYS_EDITOR_DIALOG_BASE() -{ - // Disconnect Events - m_resetButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HOTKEYS_EDITOR_DIALOG_BASE::ResetClicked ), NULL, this ); - m_defaultButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HOTKEYS_EDITOR_DIALOG_BASE::DefaultsClicked ), NULL, this ); - -} diff --git a/common/dialogs/dialog_hotkeys_editor_base.fbp b/common/dialogs/dialog_hotkeys_editor_base.fbp deleted file mode 100644 index feec3e6306..0000000000 --- a/common/dialogs/dialog_hotkeys_editor_base.fbp +++ /dev/null @@ -1,485 +0,0 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_hotkeys_editor_base - 1000 - none - 1 - dialog_hotkeys_editor_base - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - HOTKEYS_EDITOR_DIALOG_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Hotkeys Editor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - m_mainSizer - wxVERTICAL - protected - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Double-click to edit - - 0 - - - 0 - - 1 - m_staticText1 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - 400 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND | wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - -1,350 - 1 - m_panelHotkeys - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_RIGHT|wxEXPAND - 0 - - - b_buttonsSizer - wxHORIZONTAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_RESET - Reset - - 0 - - - 0 - - 1 - m_resetButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - ResetClicked - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Defaults - - 0 - - - 0 - - 1 - m_defaultButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - DefaultsClicked - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND|wxTOP|wxBOTTOM - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer - protected - - - - - - - - - - - - - - - - diff --git a/common/dialogs/panel_common_settings.cpp b/common/dialogs/panel_common_settings.cpp new file mode 100644 index 0000000000..0c53646fb0 --- /dev/null +++ b/common/dialogs/panel_common_settings.cpp @@ -0,0 +1,178 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include +#include "panel_common_settings.h" + + +PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( DIALOG_SHIM* aParent ) : + PANEL_COMMON_SETTINGS_BASE( aParent ), + m_parent( aParent ), + m_last_scale( -1 ) +{ + m_scaleSlider->SetStep( 25 ); + + m_textEditorBtn->SetBitmap( KiBitmap( folder_xpm ) ); + m_pdfViewerBtn->SetBitmap( KiBitmap( folder_xpm ) ); +} + + +PANEL_COMMON_SETTINGS::~PANEL_COMMON_SETTINGS() +{ +} + + +bool PANEL_COMMON_SETTINGS::TransferDataToWindow() +{ + wxConfigBase* commonSettings = Pgm().CommonSettings(); + + int timevalue; + wxString msg; + + commonSettings->Read( AUTOSAVE_INTERVAL_KEY, &timevalue ); + msg << timevalue / 60; + m_SaveTime->SetValue( msg ); + + int scale_fourths; + commonSettings->Read( ICON_SCALE_KEY, &scale_fourths ); + + if( scale_fourths <= 0 ) + { + m_scaleAuto->SetValue( true ); + m_scaleSlider->SetValue( 25 * KiIconScale( GetParent() ) ); + } + else + { + m_scaleAuto->SetValue( false ); + m_scaleSlider->SetValue( scale_fourths * 25 ); + } + + bool option; + commonSettings->Read( USE_ICONS_IN_MENUS_KEY, &option ); + m_checkBoxIconsInMenus->SetValue( option ); + + commonSettings->Read( ENBL_ZOOM_NO_CENTER_KEY, &option ); + m_ZoomCenterOpt->SetValue( !option ); + + commonSettings->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option ); + m_MousewheelPANOpt->SetValue( option ); + + commonSettings->Read( ENBL_AUTO_PAN_KEY, &option ); + m_AutoPANOpt->SetValue( option ); + + m_textEditorPath->SetValue( Pgm().GetEditorName( false ) ); + m_defaultPDFViewer->SetValue( Pgm().UseSystemPdfBrowser() ); + m_otherPDFViewer->SetValue( !Pgm().UseSystemPdfBrowser() ); + m_PDFViewerPath->SetValue( Pgm().GetPdfBrowserName() ); + + return true; +} + + +bool PANEL_COMMON_SETTINGS::TransferDataFromWindow() +{ + wxConfigBase* commonSettings = Pgm().CommonSettings(); + + commonSettings->Write( AUTOSAVE_INTERVAL_KEY, m_SaveTime->GetValue() * 60 ); + + const int scale_fourths = m_scaleAuto->GetValue() ? -1 : m_scaleSlider->GetValue() / 25; + commonSettings->Write( ICON_SCALE_KEY, scale_fourths ); + + commonSettings->Write( USE_ICONS_IN_MENUS_KEY, m_checkBoxIconsInMenus->GetValue() ); + commonSettings->Write( ENBL_ZOOM_NO_CENTER_KEY, !m_ZoomCenterOpt->GetValue() ); + commonSettings->Write( ENBL_MOUSEWHEEL_PAN_KEY, m_MousewheelPANOpt->GetValue() ); + commonSettings->Write( ENBL_AUTO_PAN_KEY, m_AutoPANOpt->GetValue() ); + + Pgm().SetEditorName( m_textEditorPath->GetValue() ); + + Pgm().SetPdfBrowserName( m_PDFViewerPath->GetValue() ); + Pgm().ForceSystemPdfBrowser( m_defaultPDFViewer->GetValue() ); + Pgm().WritePdfBrowserInfos(); + + m_parent->Kiway().CommonSettingsChanged(); + + return true; +} + + +void PANEL_COMMON_SETTINGS::OnScaleSlider( wxScrollEvent& aEvent ) +{ + m_scaleAuto->SetValue( false ); +} + + +void PANEL_COMMON_SETTINGS::OnScaleAuto( wxCommandEvent& aEvent ) +{ + if( m_scaleAuto->GetValue() ) + { + m_last_scale = m_scaleSlider->GetValue(); + m_scaleSlider->SetValue( 25 * KiIconScale( GetParent() ) ); + } + else + { + if( m_last_scale >= 0 ) + m_scaleSlider->SetValue( m_last_scale ); + } +} + + +void PANEL_COMMON_SETTINGS::OnTextEditorClick( wxCommandEvent& event ) +{ + // Ask the user to select a new editor, but suggest the current one as the default. + wxString editorname = Pgm().AskUserForPreferredEditor( m_textEditorPath->GetValue() ); + + // If we have a new editor name request it to be copied to m_editor_name and saved + // to the preferences file. If the user cancelled the dialog then the previous + // value will be retained. + if( !editorname.IsEmpty() ) + m_textEditorPath->SetValue( editorname ); +} + + +void PANEL_COMMON_SETTINGS::OnPDFViewerClick( wxCommandEvent& event ) +{ + wxString mask( wxT( "*" ) ); + +#ifdef __WINDOWS__ + mask += wxT( ".exe" ); +#endif + + wxString wildcard = _( "Executable files (" ) + mask + wxT( ")|" ) + mask; + + Pgm().ReadPdfBrowserInfos(); + wxFileName fn = Pgm().GetPdfBrowserName(); + + wxFileDialog dlg( this, _( "Select Preferred PDF Browser" ), fn.GetPath(), + fn.GetFullPath(), wildcard, + wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + + if( dlg.ShowModal() == wxID_CANCEL ) + return; + + m_otherPDFViewer->SetValue( true ); + m_PDFViewerPath->SetValue( dlg.GetPath() ); +} diff --git a/common/dialogs/panel_common_settings.h b/common/dialogs/panel_common_settings.h new file mode 100644 index 0000000000..2a7e1bce7d --- /dev/null +++ b/common/dialogs/panel_common_settings.h @@ -0,0 +1,53 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef KICAD_DIALOG_SUITE_OPTIONS_H +#define KICAD_DIALOG_SUITE_OPTIONS_H + +#include "panel_common_settings_base.h" + + +class DIALOG_SHIM; + + +class PANEL_COMMON_SETTINGS : public PANEL_COMMON_SETTINGS_BASE +{ +public: + PANEL_COMMON_SETTINGS( DIALOG_SHIM* aParent ); + ~PANEL_COMMON_SETTINGS() override; + +protected: + bool TransferDataFromWindow() override; + bool TransferDataToWindow() override; + + void OnScaleSlider( wxScrollEvent& aEvent ) override; + void OnScaleAuto( wxCommandEvent& aEvent ) override; + void OnTextEditorClick( wxCommandEvent& event ) override; + void OnPDFViewerClick( wxCommandEvent& event ) override; + + DIALOG_SHIM* m_parent; + + int m_last_scale; ///< saved icon scale when Auto selected +}; + +#endif //KICAD_DIALOG_SUITE_OPTIONS_H diff --git a/common/dialogs/panel_common_settings_base.cpp b/common/dialogs/panel_common_settings_base.cpp new file mode 100644 index 0000000000..42f3df0621 --- /dev/null +++ b/common/dialogs/panel_common_settings_base.cpp @@ -0,0 +1,183 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_common_settings_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bPanelSizer; + bPanelSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bLeftSizer; + bLeftSizer = new wxBoxSizer( wxVERTICAL ); + + wxGridBagSizer* gbSizer1; + gbSizer1 = new wxGridBagSizer( 0, 0 ); + gbSizer1->SetFlexibleDirection( wxBOTH ); + gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + gbSizer1->SetEmptyCellSize( wxSize( -1,10 ) ); + + m_staticTextautosave = new wxStaticText( this, wxID_ANY, _("&Auto save:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextautosave->Wrap( -1 ); + gbSizer1->Add( m_staticTextautosave, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + + wxBoxSizer* bSizer6; + bSizer6 = new wxBoxSizer( wxHORIZONTAL ); + + m_SaveTime = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 ); + bSizer6->Add( m_SaveTime, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + wxStaticText* minutesLabel; + minutesLabel = new wxStaticText( this, wxID_ANY, _("minutes"), wxDefaultPosition, wxDefaultSize, 0 ); + minutesLabel->Wrap( -1 ); + bSizer6->Add( minutesLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + gbSizer1->Add( bSizer6, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 ); + + wxStaticText* textEditorLabel; + textEditorLabel = new wxStaticText( this, wxID_ANY, _("Text editor:"), wxDefaultPosition, wxDefaultSize, 0 ); + textEditorLabel->Wrap( -1 ); + gbSizer1->Add( textEditorLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + + m_textEditorPath = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_textEditorPath->Enable( false ); + m_textEditorPath->SetMinSize( wxSize( 300,-1 ) ); + + gbSizer1->Add( m_textEditorPath, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_textEditorBtn = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + m_textEditorBtn->SetMinSize( wxSize( 29,29 ) ); + + gbSizer1->Add( m_textEditorBtn, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + + m_defaultPDFViewer = new wxRadioButton( this, wxID_ANY, _("System default PDF viewer"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_defaultPDFViewer, wxGBPosition( 4, 0 ), wxGBSpan( 1, 3 ), wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_otherPDFViewer = new wxRadioButton( this, wxID_ANY, _("Other:"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_otherPDFViewer, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + + m_PDFViewerPath = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_PDFViewerPath->Enable( false ); + m_PDFViewerPath->SetMinSize( wxSize( 300,-1 ) ); + + gbSizer1->Add( m_PDFViewerPath, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_pdfViewerBtn = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + m_pdfViewerBtn->SetMinSize( wxSize( 29,29 ) ); + + gbSizer1->Add( m_pdfViewerBtn, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + + + gbSizer1->AddGrowableCol( 1 ); + + bLeftSizer->Add( gbSizer1, 1, wxEXPAND|wxALL, 5 ); + + wxStaticBoxSizer* sbSizer5; + sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User Interface") ), wxVERTICAL ); + + wxFlexGridSizer* fgSizer11; + fgSizer11 = new wxFlexGridSizer( 0, 3, 0, 0 ); + fgSizer11->AddGrowableCol( 1 ); + fgSizer11->SetFlexibleDirection( wxBOTH ); + fgSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticText1 = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, _("Icon scale:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1->Wrap( -1 ); + fgSizer11->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 ); + + m_scaleSlider = new STEPPED_SLIDER( sbSizer5->GetStaticBox(), wxID_ANY, 50, 50, 275, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS ); + fgSizer11->Add( m_scaleSlider, 0, wxBOTTOM|wxEXPAND, 4 ); + + m_staticText2 = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText2->Wrap( -1 ); + fgSizer11->Add( m_staticText2, 0, wxALIGN_BOTTOM|wxBOTTOM, 2 ); + + + fgSizer11->Add( 0, 0, 0, wxEXPAND, 5 ); + + m_scaleAuto = new wxCheckBox( sbSizer5->GetStaticBox(), wxID_ANY, _("Auto"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer11->Add( m_scaleAuto, 0, wxTOP|wxLEFT, 9 ); + + + fgSizer11->Add( 0, 0, 0, wxEXPAND, 5 ); + + + sbSizer5->Add( fgSizer11, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + sbSizer5->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_checkBoxIconsInMenus = new wxCheckBox( sbSizer5->GetStaticBox(), wxID_ANY, _("Show icons in menus"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer5->Add( m_checkBoxIconsInMenus, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bLeftSizer->Add( sbSizer5, 0, wxEXPAND|wxALL, 5 ); + + wxStaticBoxSizer* sbSizer51; + sbSizer51 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pan and Zoom") ), wxVERTICAL ); + + m_ZoomCenterOpt = new wxCheckBox( sbSizer51->GetStaticBox(), wxID_ANY, _("Ce&nter and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 ); + m_ZoomCenterOpt->SetToolTip( _("Center the cursor on screen when zooming.") ); + + sbSizer51->Add( m_ZoomCenterOpt, 0, wxRIGHT|wxLEFT, 5 ); + + m_MousewheelPANOpt = new wxCheckBox( sbSizer51->GetStaticBox(), wxID_ANY, _("Use touchpad to pan"), wxDefaultPosition, wxDefaultSize, 0 ); + m_MousewheelPANOpt->SetToolTip( _("Enable touchpad-friendly controls (pan with scroll action, zoom with Ctrl+scroll).") ); + + sbSizer51->Add( m_MousewheelPANOpt, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + + m_AutoPANOpt = new wxCheckBox( sbSizer51->GetStaticBox(), wxID_AUTOPAN, _("&Pan while moving object"), wxDefaultPosition, wxDefaultSize, 0 ); + m_AutoPANOpt->SetToolTip( _("When drawing a track or moving an item, pan when approaching the edge of the display.") ); + + sbSizer51->Add( m_AutoPANOpt, 0, wxALL, 5 ); + + + bLeftSizer->Add( sbSizer51, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + + bPanelSizer->Add( bLeftSizer, 0, wxTOP|wxLEFT, 10 ); + + + this->SetSizer( bPanelSizer ); + this->Layout(); + bPanelSizer->Fit( this ); + + // Connect Events + m_textEditorBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnTextEditorClick ), NULL, this ); + m_pdfViewerBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnPDFViewerClick ), NULL, this ); + m_scaleSlider->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleAuto->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleAuto ), NULL, this ); +} + +PANEL_COMMON_SETTINGS_BASE::~PANEL_COMMON_SETTINGS_BASE() +{ + // Disconnect Events + m_textEditorBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnTextEditorClick ), NULL, this ); + m_pdfViewerBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnPDFViewerClick ), NULL, this ); + m_scaleSlider->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleSlider->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this ); + m_scaleAuto->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleAuto ), NULL, this ); + +} diff --git a/common/dialogs/panel_common_settings_base.fbp b/common/dialogs/panel_common_settings_base.fbp new file mode 100644 index 0000000000..b5df8f18e0 --- /dev/null +++ b/common/dialogs/panel_common_settings_base.fbp @@ -0,0 +1,1828 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + panel_common_settings_base + 1000 + none + 1 + PanelCommonSettings + + . + + 1 + 1 + 1 + 1 + UI + 1 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_COMMON_SETTINGS_BASE + + -1,-1 + ; forward_declare + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bPanelSizer + wxVERTICAL + none + + 10 + wxTOP|wxLEFT + 0 + + + bLeftSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 1 + + -1,10 + wxBOTH + 1 + + 0 + + gbSizer1 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Auto save: + + 0 + + + 0 + + 1 + m_staticTextautosave + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxEXPAND + 0 + 1 + + + bSizer6 + wxHORIZONTAL + none + + 5 + wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 10 + + 0 + + 0 + + 0 + + 1 + m_SaveTime + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS + ; forward_declare + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + minutes + + 0 + + + 0 + + 1 + minutesLabel + 1 + + + none + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Text editor: + + 0 + + + 0 + + 1 + textEditorLabel + 1 + + + none + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALIGN_CENTER_VERTICAL|wxLEFT + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + 300,-1 + 1 + m_textEditorPath + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_ANY + Browse + + 0 + + + 0 + 29,29 + 1 + m_textEditorBtn + 1 + + + protected + 1 + + Resizable + + 1 + + wxBU_AUTODRAW + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnTextEditorClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 3 + 0 + wxTOP|wxRIGHT|wxLEFT + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + System default PDF viewer + + 0 + + + 0 + + 1 + m_defaultPDFViewer + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Other: + + 0 + + + 0 + + 1 + m_otherPDFViewer + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALIGN_CENTER_VERTICAL|wxLEFT + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + 300,-1 + 1 + m_PDFViewerPath + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 2 + wxALIGN_CENTER_VERTICAL + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_ANY + Browse + + 0 + + + 0 + 29,29 + 1 + m_pdfViewerBtn + 1 + + + protected + 1 + + Resizable + + 1 + + wxBU_AUTODRAW + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnPDFViewerClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + wxID_ANY + User Interface + + sbSizer5 + wxVERTICAL + 1 + none + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 3 + wxBOTH + 1 + + 0 + + fgSizer11 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 3 + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Icon scale: + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 4 + wxBOTTOM|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 275 + + 0 + + 50 + + 0 + + 1 + m_scaleSlider + 1 + + + protected + 1 + + Resizable + 1 + + wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS + STEPPED_SLIDER; widgets/stepped_slider.h; Not forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 50 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnScaleSlider + + + + + + + + + + + + + + + + 2 + wxALIGN_BOTTOM|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + % + + 0 + + + 0 + + 1 + m_staticText2 + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + 0 + protected + 0 + + + + 9 + wxTOP|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Auto + + 0 + + + 0 + + 1 + m_scaleAuto + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnScaleAuto + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + 0 + protected + 0 + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 0 + protected + 0 + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show icons in menus + + 0 + + + 0 + + 1 + m_checkBoxIconsInMenus + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + wxID_ANY + Pan and Zoom + + sbSizer51 + wxVERTICAL + 1 + none + + + 5 + wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Ce&nter and warp cursor on zoom + + 0 + + + 0 + + 1 + m_ZoomCenterOpt + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Center the cursor on screen when zooming. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Use touchpad to pan + + 0 + + + 0 + + 1 + m_MousewheelPANOpt + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Enable touchpad-friendly controls (pan with scroll action, zoom with Ctrl+scroll). + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_AUTOPAN + &Pan while moving object + + 0 + + + 0 + + 1 + m_AutoPANOpt + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + When drawing a track or moving an item, pan when approaching the edge of the display. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dialogs/panel_common_settings_base.h b/common/dialogs/panel_common_settings_base.h new file mode 100644 index 0000000000..89731d5e0d --- /dev/null +++ b/common/dialogs/panel_common_settings_base.h @@ -0,0 +1,82 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __PANEL_COMMON_SETTINGS_BASE_H__ +#define __PANEL_COMMON_SETTINGS_BASE_H__ + +#include +#include +#include +#include "widgets/stepped_slider.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_COMMON_SETTINGS_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_COMMON_SETTINGS_BASE : public wxPanel +{ + private: + + protected: + enum + { + wxID_AUTOPAN = 1000 + }; + + wxStaticText* m_staticTextautosave; + wxSpinCtrl* m_SaveTime; + wxTextCtrl* m_textEditorPath; + wxBitmapButton* m_textEditorBtn; + wxRadioButton* m_defaultPDFViewer; + wxRadioButton* m_otherPDFViewer; + wxTextCtrl* m_PDFViewerPath; + wxBitmapButton* m_pdfViewerBtn; + wxStaticText* m_staticText1; + STEPPED_SLIDER* m_scaleSlider; + wxStaticText* m_staticText2; + wxCheckBox* m_scaleAuto; + wxCheckBox* m_checkBoxIconsInMenus; + wxCheckBox* m_ZoomCenterOpt; + wxCheckBox* m_MousewheelPANOpt; + wxCheckBox* m_AutoPANOpt; + + // Virtual event handlers, overide them in your derived class + virtual void OnTextEditorClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnPDFViewerClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnScaleSlider( wxScrollEvent& event ) { event.Skip(); } + virtual void OnScaleAuto( wxCommandEvent& event ) { event.Skip(); } + + + public: + + PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_COMMON_SETTINGS_BASE(); + +}; + +#endif //__PANEL_COMMON_SETTINGS_BASE_H__ diff --git a/common/dialogs/panel_hotkeys_editor.cpp b/common/dialogs/panel_hotkeys_editor.cpp new file mode 100644 index 0000000000..662633ea3c --- /dev/null +++ b/common/dialogs/panel_hotkeys_editor.cpp @@ -0,0 +1,81 @@ +/* + * This program source code file is part of KICAD, a free EDA CAD application. + * + * Copyright (C) 1992-2018 Kicad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +PANEL_HOTKEYS_EDITOR::PANEL_HOTKEYS_EDITOR( EDA_BASE_FRAME* aFrame, wxWindow* aWindow, + EDA_HOTKEY_CONFIG* aHotkeys, + EDA_HOTKEY_CONFIG* aShowHotkeys, + const wxString& aNickname ) : + PANEL_HOTKEYS_EDITOR_BASE( aWindow ), + m_frame( aFrame ), + m_hotkeys( aHotkeys ), + m_showHotkeys( aShowHotkeys ), + m_nickname( aNickname ) +{ + HOTKEY_SECTIONS sections = WIDGET_HOTKEY_LIST::GenSections( m_showHotkeys ); + m_hotkeyListCtrl = new WIDGET_HOTKEY_LIST( m_panelHotkeys, sections ); + m_hotkeyListCtrl->InstallOnPanel( m_panelHotkeys ); +} + + +bool PANEL_HOTKEYS_EDITOR::TransferDataToWindow() +{ + return m_hotkeyListCtrl->TransferDataToControl(); +} + + +bool PANEL_HOTKEYS_EDITOR::TransferDataFromWindow() +{ + if( !m_hotkeyListCtrl->TransferDataFromControl() ) + return false; + + // save the hotkeys + m_frame->WriteHotkeyConfig( m_hotkeys ); + + return true; +} + + +void PANEL_HOTKEYS_EDITOR::ResetClicked( wxCommandEvent& aEvent ) +{ + m_hotkeyListCtrl->TransferDataToControl(); +} + +void PANEL_HOTKEYS_EDITOR::DefaultsClicked( wxCommandEvent& aEvent ) +{ + m_hotkeyListCtrl->TransferDefaultsToControl(); +} + + +void PANEL_HOTKEYS_EDITOR::OnExport( wxCommandEvent& aEvent ) +{ + m_frame->ExportHotkeyConfigToFile( m_hotkeys, m_nickname ); +} + + +void PANEL_HOTKEYS_EDITOR::OnImport( wxCommandEvent& aEvent ) +{ + m_frame->ImportHotkeyConfigFromFile( m_hotkeys, m_nickname ); +} diff --git a/common/dialogs/panel_hotkeys_editor_base.cpp b/common/dialogs/panel_hotkeys_editor_base.cpp new file mode 100644 index 0000000000..ba9f71eafd --- /dev/null +++ b/common/dialogs/panel_hotkeys_editor_base.cpp @@ -0,0 +1,67 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_hotkeys_editor_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_HOTKEYS_EDITOR_BASE::PANEL_HOTKEYS_EDITOR_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + m_mainSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bMargins; + bMargins = new wxBoxSizer( wxVERTICAL ); + + m_panelHotkeys = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelHotkeys->SetMinSize( wxSize( -1,350 ) ); + + bMargins->Add( m_panelHotkeys, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 10 ); + + wxBoxSizer* b_buttonsSizer; + b_buttonsSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_resetButton = new wxButton( this, wxID_RESET, _("Reset Hotkeys"), wxDefaultPosition, wxDefaultSize, 0 ); + b_buttonsSizer->Add( m_resetButton, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_defaultButton = new wxButton( this, wxID_ANY, _("Set to Defaults"), wxDefaultPosition, wxDefaultSize, 0 ); + b_buttonsSizer->Add( m_defaultButton, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + + b_buttonsSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + btnImport = new wxButton( this, wxID_ANY, _("Import..."), wxDefaultPosition, wxDefaultSize, 0 ); + b_buttonsSizer->Add( btnImport, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + btnExport = new wxButton( this, wxID_ANY, _("Export..."), wxDefaultPosition, wxDefaultSize, 0 ); + b_buttonsSizer->Add( btnExport, 0, wxTOP|wxLEFT, 5 ); + + + bMargins->Add( b_buttonsSizer, 0, wxALIGN_RIGHT|wxEXPAND, 5 ); + + + m_mainSizer->Add( bMargins, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + + this->SetSizer( m_mainSizer ); + this->Layout(); + + // Connect Events + m_resetButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_HOTKEYS_EDITOR_BASE::ResetClicked ), NULL, this ); + m_defaultButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_HOTKEYS_EDITOR_BASE::DefaultsClicked ), NULL, this ); + btnImport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_HOTKEYS_EDITOR_BASE::OnImport ), NULL, this ); + btnExport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_HOTKEYS_EDITOR_BASE::OnExport ), NULL, this ); +} + +PANEL_HOTKEYS_EDITOR_BASE::~PANEL_HOTKEYS_EDITOR_BASE() +{ + // Disconnect Events + m_resetButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_HOTKEYS_EDITOR_BASE::ResetClicked ), NULL, this ); + m_defaultButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_HOTKEYS_EDITOR_BASE::DefaultsClicked ), NULL, this ); + btnImport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_HOTKEYS_EDITOR_BASE::OnImport ), NULL, this ); + btnExport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_HOTKEYS_EDITOR_BASE::OnExport ), NULL, this ); + +} diff --git a/common/dialogs/panel_hotkeys_editor_base.fbp b/common/dialogs/panel_hotkeys_editor_base.fbp new file mode 100644 index 0000000000..8a9d98bbe7 --- /dev/null +++ b/common/dialogs/panel_hotkeys_editor_base.fbp @@ -0,0 +1,553 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + panel_hotkeys_editor_base + 1000 + none + 1 + PanelHotkeysEditorBase + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_HOTKEYS_EDITOR_BASE + + 500,300 + ; forward_declare + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + m_mainSizer + wxHORIZONTAL + protected + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + + bMargins + wxVERTICAL + none + + 10 + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + -1,350 + 1 + m_panelHotkeys + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_RIGHT|wxEXPAND + 0 + + + b_buttonsSizer + wxHORIZONTAL + none + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_RESET + Reset Hotkeys + + 0 + + + 0 + + 1 + m_resetButton + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + ResetClicked + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Set to Defaults + + 0 + + + 0 + + 1 + m_defaultButton + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + DefaultsClicked + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Import... + + 0 + + + 0 + + 1 + btnImport + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnImport + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Export... + + 0 + + + 0 + + 1 + btnExport + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnExport + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dialogs/dialog_hotkeys_editor_base.h b/common/dialogs/panel_hotkeys_editor_base.h similarity index 58% rename from common/dialogs/dialog_hotkeys_editor_base.h rename to common/dialogs/panel_hotkeys_editor_base.h index 9f5136849e..22bed871ed 100644 --- a/common/dialogs/dialog_hotkeys_editor_base.h +++ b/common/dialogs/panel_hotkeys_editor_base.h @@ -1,58 +1,55 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 22 2017) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __DIALOG_HOTKEYS_EDITOR_BASE_H__ -#define __DIALOG_HOTKEYS_EDITOR_BASE_H__ +#ifndef __PANEL_HOTKEYS_EDITOR_BASE_H__ +#define __PANEL_HOTKEYS_EDITOR_BASE_H__ #include #include #include -#include "dialog_shim.h" -#include -#include +#include #include #include #include #include -#include +#include #include #include -#include /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -/// Class HOTKEYS_EDITOR_DIALOG_BASE +/// Class PANEL_HOTKEYS_EDITOR_BASE /////////////////////////////////////////////////////////////////////////////// -class HOTKEYS_EDITOR_DIALOG_BASE : public DIALOG_SHIM +class PANEL_HOTKEYS_EDITOR_BASE : public wxPanel { private: protected: wxBoxSizer* m_mainSizer; - wxStaticText* m_staticText1; wxPanel* m_panelHotkeys; wxButton* m_resetButton; wxButton* m_defaultButton; - wxStdDialogButtonSizer* m_sdbSizer; - wxButton* m_sdbSizerOK; - wxButton* m_sdbSizerCancel; + wxButton* btnImport; + wxButton* btnExport; // Virtual event handlers, overide them in your derived class virtual void ResetClicked( wxCommandEvent& event ) { event.Skip(); } virtual void DefaultsClicked( wxCommandEvent& event ) { event.Skip(); } + virtual void OnImport( wxCommandEvent& event ) { event.Skip(); } + virtual void OnExport( wxCommandEvent& event ) { event.Skip(); } public: - HOTKEYS_EDITOR_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Hotkeys Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~HOTKEYS_EDITOR_DIALOG_BASE(); + PANEL_HOTKEYS_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_HOTKEYS_EDITOR_BASE(); }; -#endif //__DIALOG_HOTKEYS_EDITOR_BASE_H__ +#endif //__PANEL_HOTKEYS_EDITOR_BASE_H__ diff --git a/common/draw_frame.cpp b/common/draw_frame.cpp index 29d308348d..ffd11edc3c 100644 --- a/common/draw_frame.cpp +++ b/common/draw_frame.cpp @@ -274,6 +274,21 @@ void EDA_DRAW_FRAME::unitsChangeRefresh() UpdateMsgPanel(); } +void EDA_DRAW_FRAME::CommonSettingsChanged() +{ + EDA_BASE_FRAME::CommonSettingsChanged(); + + bool option; + Pgm().CommonSettings()->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option ); + m_canvas->SetEnableMousewheelPan( option ); + + Pgm().CommonSettings()->Read( ENBL_ZOOM_NO_CENTER_KEY, &option ); + m_canvas->SetEnableZoomNoCenter( option ); + + Pgm().CommonSettings()->Read( ENBL_AUTO_PAN_KEY, &option ); + m_canvas->SetEnableAutoPan( option ); +} + void EDA_DRAW_FRAME::EraseMsgBox() { diff --git a/common/draw_panel.cpp b/common/draw_panel.cpp index 4d4fa3d526..2d22268821 100644 --- a/common/draw_panel.cpp +++ b/common/draw_panel.cpp @@ -49,18 +49,6 @@ static const int CURSOR_SIZE = 12; ///< Cursor size in pixels #define CLIP_BOX_PADDING 2 -///@{ -/// \ingroup config - -#define ENBL_ZOOM_NO_CENTER_KEY wxT( "ZoomNoCenter" ) -#define ENBL_MOUSEWHEEL_PAN_KEY wxT( "MousewheelPAN" ) -#define ENBL_MIDDLE_BUTT_PAN_KEY wxT( "MiddleButtonPAN" ) -#define MIDDLE_BUTT_PAN_LIMITED_KEY wxT( "MiddleBtnPANLimited" ) -#define ENBL_AUTO_PAN_KEY wxT( "AutoPAN" ) - -///@} - - // Definitions for enabling and disabling debugging features in drawpanel.cpp. // Please don't forget to turn these off before making any commits to Launchpad. #define DEBUG_SHOW_CLIP_RECT 0 // Set to 1 to draw clipping rectangle. diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index 1c015a5fef..7417ba9d64 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -31,19 +31,17 @@ #include #include +#include #include #include #include #include #include -#include -#include -#include #include - -#include -#include +#include +#include +#include /// The default auto save interval is 10 minutes. @@ -259,8 +257,13 @@ void EDA_BASE_FRAME::ShowChangedLanguage() } -void EDA_BASE_FRAME::ShowChangedIcons() +void EDA_BASE_FRAME::CommonSettingsChanged() { + int autosaveInterval; + Pgm().CommonSettings()->Read( AUTOSAVE_INTERVAL_KEY, &autosaveInterval ); + SetAutoSaveInterval( autosaveInterval ); + + // For icons in menus & icon scaling ReCreateMenuBar(); GetMenuBar()->Refresh(); } @@ -507,23 +510,6 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event ) } -void EDA_BASE_FRAME::OnSelectPreferredEditor( wxCommandEvent& event ) -{ - // Ask for the current editor and instruct GetEditorName() to not show - // unless we pass false as argument. - wxString editorname = Pgm().GetEditorName( false ); - - // Ask the user to select a new editor, but suggest the current one as the default. - editorname = Pgm().AskUserForPreferredEditor( editorname ); - - // If we have a new editor name request it to be copied to m_editor_name and saved - // to the preferences file. If the user cancelled the dialog then the previous - // value will be retained. - if( !editorname.IsEmpty() ) - Pgm().SetEditorName( editorname ); -} - - void EDA_BASE_FRAME::GetKicadContribute( wxCommandEvent& event ) { if( !wxLaunchDefaultBrowser( URL_GET_INVOLVED ) ) @@ -544,6 +530,28 @@ void EDA_BASE_FRAME::GetKicadAbout( wxCommandEvent& event ) } +bool EDA_BASE_FRAME::ShowPreferences( EDA_HOTKEY_CONFIG* aHotkeys, EDA_HOTKEY_CONFIG* aShowHotkeys, + const wxString& aHotkeysNickname ) +{ + PAGED_DIALOG dlg( this, _( "Preferences" ) ); + + dlg.AddPage( new PANEL_COMMON_SETTINGS( &dlg ), + _( "Common" ) ); + dlg.AddPage( new PANEL_HOTKEYS_EDITOR( this, &dlg, aHotkeys, aShowHotkeys, aHotkeysNickname ), + _( "Hotkeys" ) ); + + for( unsigned i = 0; i < KIWAY_PLAYER_COUNT; ++i ) + { + KIWAY_PLAYER* frame = dlg.Kiway().Player( (FRAME_T) i, false ); + + if( frame ) + frame->InstallPreferences( &dlg ); + } + + return( dlg.ShowModal() != wxID_CANCEL ); +} + + bool EDA_BASE_FRAME::IsWritable( const wxFileName& aFileName ) { wxString msg; @@ -671,36 +679,3 @@ bool EDA_BASE_FRAME::PostCommandMenuEvent( int evt_type ) return false; } - -void EDA_BASE_FRAME::OnChangeIconsOptions( wxCommandEvent& event ) -{ - if( event.GetId() == ID_KICAD_SELECT_ICONS_IN_MENUS ) - { - Pgm().SetUseIconsInMenus( event.IsChecked() ); - } - - ReCreateMenuBar(); -} - - -void EDA_BASE_FRAME::AddMenuIconsOptions( wxMenu* MasterMenu ) -{ - wxMenu* menu = NULL; - wxMenuItem* item = MasterMenu->FindItem( ID_KICAD_SELECT_ICONS_OPTIONS ); - - if( item ) // This menu exists, do nothing - return; - - menu = new wxMenu; - - menu->Append( new wxMenuItem( menu, ID_KICAD_SELECT_ICONS_IN_MENUS, - _( "Icons in Menus" ), wxEmptyString, - wxITEM_CHECK ) ); - menu->Check( ID_KICAD_SELECT_ICONS_IN_MENUS, Pgm().GetUseIconsInMenus() ); - - AddMenuItem( MasterMenu, menu, - ID_KICAD_SELECT_ICONS_OPTIONS, - _( "Icons Options" ), - _( "Select show icons in menus and icons sizes" ), - KiBitmap( icon_xpm ) ); -} diff --git a/common/hotkeys_basic.cpp b/common/hotkeys_basic.cpp index 2198c5f630..82f3a03107 100644 --- a/common/hotkeys_basic.cpp +++ b/common/hotkeys_basic.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -801,39 +801,3 @@ void EDA_BASE_FRAME::ExportHotkeyConfigToFile( EDA_HOTKEY_CONFIG* aDescList, SetMruPath( wxFileName( filename ).GetPath() ); } - -/* add hotkey config options submenu to aMenu - */ -void AddHotkeyConfigMenu( wxMenu* aMenu ) -{ - if( aMenu == nullptr ) - return; - - wxMenu* HotkeySubmenu = new wxMenu(); - - // Call hotkeys editor - AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR, - _( "&Edit Hotkeys..." ), - _( "Edit hotkeys list" ), - KiBitmap( config_xpm ) ); - - HotkeySubmenu->AppendSeparator(); - - // create hotkey file to export current hotkeys config - AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG, - _( "E&xport Hotkeys..." ), - _( "Export current hotkeys into configuration file" ), - KiBitmap( hotkeys_export_xpm ) ); - - // Reload hotkey file - AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG, - _( "&Import Hotkeys..." ), - _( "Load existing hotkey configuration file" ), - KiBitmap( hotkeys_import_xpm ) ); - - // Append HotkeySubmenu to menu - AddMenuItem( aMenu, HotkeySubmenu, - wxID_ANY, _( "&Hotkeys Options" ), - _( "Edit hotkeys configuration and preferences" ), - KiBitmap( hotkeys_xpm ) ); -} diff --git a/common/kiway.cpp b/common/kiway.cpp index 5d6f7e476b..ad7423726a 100644 --- a/common/kiway.cpp +++ b/common/kiway.cpp @@ -428,7 +428,7 @@ void KIWAY::SetLanguage( int aLanguage ) } } -void KIWAY::ShowChangedIcons() +void KIWAY::CommonSettingsChanged() { #if 1 if( m_ctl & KFCTL_CPP_PROJECT_SUITE ) @@ -439,7 +439,7 @@ void KIWAY::ShowChangedIcons() EDA_BASE_FRAME* top = static_cast( m_top ); if( top ) - top->ShowChangedIcons(); + top->CommonSettingsChanged(); } #endif @@ -449,7 +449,7 @@ void KIWAY::ShowChangedIcons() if( frame ) { - frame->ShowChangedIcons(); + frame->CommonSettingsChanged(); } } } diff --git a/common/kiway_player.cpp b/common/kiway_player.cpp index 17c9383f51..4784d33820 100644 --- a/common/kiway_player.cpp +++ b/common/kiway_player.cpp @@ -37,8 +37,6 @@ BEGIN_EVENT_TABLE( KIWAY_PLAYER, EDA_BASE_FRAME ) EVT_KIWAY_EXPRESS( KIWAY_PLAYER::kiway_express ) EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, KIWAY_PLAYER::language_change ) - EVT_MENU_RANGE( ID_KICAD_SELECT_ICONS_OPTIONS, ID_KICAD_SELECT_ICON_OPTIONS_END, - KIWAY_PLAYER::OnChangeIconsOptions ) END_EVENT_TABLE() @@ -192,8 +190,3 @@ void KIWAY_PLAYER::language_change( wxCommandEvent& event ) } -void KIWAY_PLAYER::OnChangeIconsOptions( wxCommandEvent& event ) -{ - EDA_BASE_FRAME::OnChangeIconsOptions( event ); - Kiway().ShowChangedIcons(); -} diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 3a1344da15..5b78620e45 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -54,7 +54,6 @@ #include #include - #define KICAD_COMMON wxT( "kicad_common" ) // some key strings used to store parameters in KICAD_COMMON @@ -65,8 +64,7 @@ static const wxChar languageCfgKey[] = wxT( "LanguageID" ); static const wxChar pathEnvVariables[] = wxT( "EnvironmentVariables" ); static const wxChar showEnvVarWarningDialog[] = wxT( "ShowEnvVarWarningDialog" ); static const wxChar traceEnvVars[] = wxT( "KIENVVARS" ); -///< enable/disable icons in menus -static const wxChar entryUseIconsInMenus[] = wxT( "UseIconsInMenus" ); + /** @@ -105,181 +103,28 @@ struct LANGUAGE_DESCR static LANGUAGE_DESCR s_Languages[] = { // Default language - { - wxLANGUAGE_DEFAULT, - ID_LANGUAGE_DEFAULT, - lang_def_xpm, - _( "Default" ) - }, - - // English language - { - wxLANGUAGE_ENGLISH, - ID_LANGUAGE_ENGLISH, - lang_en_xpm, - wxT( "English" ), - true - }, - - // French language - { - wxLANGUAGE_FRENCH, - ID_LANGUAGE_FRENCH, - lang_fr_xpm, - _( "French" ) - }, - - // Finnish language - { - wxLANGUAGE_FINNISH, - ID_LANGUAGE_FINNISH, - lang_fi_xpm, - _( "Finnish" ) - }, - - // Spanish language - { - wxLANGUAGE_SPANISH, - ID_LANGUAGE_SPANISH, - lang_es_xpm, - _( "Spanish" ) - }, - - // Portuguese language - { - wxLANGUAGE_PORTUGUESE, - ID_LANGUAGE_PORTUGUESE, - lang_pt_xpm, - _( "Portuguese" ) - }, - - // Italian language - { - wxLANGUAGE_ITALIAN, - ID_LANGUAGE_ITALIAN, - lang_it_xpm, - _( "Italian" ) - }, - - // German language - { - wxLANGUAGE_GERMAN, - ID_LANGUAGE_GERMAN, - lang_de_xpm, - _( "German" ) - }, - - // Greek language - { - wxLANGUAGE_GREEK, - ID_LANGUAGE_GREEK, - lang_gr_xpm, - _( "Greek" ) - }, - - // Slovenian language - { - wxLANGUAGE_SLOVENIAN, - ID_LANGUAGE_SLOVENIAN, - lang_sl_xpm, - _( "Slovenian" ) - }, - - // Slovenian language - { - wxLANGUAGE_SLOVAK, - ID_LANGUAGE_SLOVAK, - lang_sk_xpm, - _( "Slovak" ) - }, - - // Hungarian language - { - wxLANGUAGE_HUNGARIAN, - ID_LANGUAGE_HUNGARIAN, - lang_hu_xpm, - _( "Hungarian" ) - }, - - // Polish language - { - wxLANGUAGE_POLISH, - ID_LANGUAGE_POLISH, - lang_pl_xpm, - _( "Polish" ) - }, - - // Czech language - { - wxLANGUAGE_CZECH, - ID_LANGUAGE_CZECH, - lang_cs_xpm, - _( "Czech" ) - }, - - // Russian language - { - wxLANGUAGE_RUSSIAN, - ID_LANGUAGE_RUSSIAN, - lang_ru_xpm, - _( "Russian" ) - }, - - // Korean language - { - wxLANGUAGE_KOREAN, - ID_LANGUAGE_KOREAN, - lang_ko_xpm, - _( "Korean" ) - }, - - // Chinese simplified - { - wxLANGUAGE_CHINESE_SIMPLIFIED, - ID_LANGUAGE_CHINESE_SIMPLIFIED, - lang_chinese_xpm, - _( "Chinese simplified" ) - }, - - // Catalan language - { - wxLANGUAGE_CATALAN, - ID_LANGUAGE_CATALAN, - lang_catalan_xpm, - _( "Catalan" ) - }, - - // Dutch language - { - wxLANGUAGE_DUTCH, - ID_LANGUAGE_DUTCH, - lang_nl_xpm, - _( "Dutch" ) - }, - - // Japanese language - { - wxLANGUAGE_JAPANESE, - ID_LANGUAGE_JAPANESE, - lang_jp_xpm, - _( "Japanese" ) - }, - - // Bulgarian language - { - wxLANGUAGE_BULGARIAN, - ID_LANGUAGE_BULGARIAN, - lang_bg_xpm, - _( "Bulgarian" ) - }, - - // Lithuanian language - { - wxLANGUAGE_LITHUANIAN, - ID_LANGUAGE_LITHUANIAN, - lang_lt_xpm, - _( "Lithuanian" ) - } + { wxLANGUAGE_DEFAULT, ID_LANGUAGE_DEFAULT, lang_def_xpm, _( "Default" ) }, + { wxLANGUAGE_ENGLISH, ID_LANGUAGE_ENGLISH, lang_en_xpm, wxT( "English" ), true }, + { wxLANGUAGE_FRENCH, ID_LANGUAGE_FRENCH, lang_fr_xpm, _( "French" ) }, + { wxLANGUAGE_FINNISH, ID_LANGUAGE_FINNISH, lang_fi_xpm, _( "Finnish" ) }, + { wxLANGUAGE_SPANISH, ID_LANGUAGE_SPANISH, lang_es_xpm, _( "Spanish" ) }, + { wxLANGUAGE_PORTUGUESE, ID_LANGUAGE_PORTUGUESE, lang_pt_xpm, _( "Portuguese" ) }, + { wxLANGUAGE_ITALIAN, ID_LANGUAGE_ITALIAN, lang_it_xpm, _( "Italian" ) }, + { wxLANGUAGE_GERMAN, ID_LANGUAGE_GERMAN, lang_de_xpm, _( "German" ) }, + { wxLANGUAGE_GREEK, ID_LANGUAGE_GREEK, lang_gr_xpm, _( "Greek" ) }, + { wxLANGUAGE_SLOVENIAN, ID_LANGUAGE_SLOVENIAN, lang_sl_xpm, _( "Slovenian" ) }, + { wxLANGUAGE_SLOVAK, ID_LANGUAGE_SLOVAK, lang_sk_xpm, _( "Slovak" ) }, + { wxLANGUAGE_HUNGARIAN, ID_LANGUAGE_HUNGARIAN, lang_hu_xpm, _( "Hungarian" ) }, + { wxLANGUAGE_POLISH, ID_LANGUAGE_POLISH, lang_pl_xpm, _( "Polish" ) }, + { wxLANGUAGE_CZECH, ID_LANGUAGE_CZECH, lang_cs_xpm, _( "Czech" ) }, + { wxLANGUAGE_RUSSIAN, ID_LANGUAGE_RUSSIAN, lang_ru_xpm, _( "Russian" ) }, + { wxLANGUAGE_KOREAN, ID_LANGUAGE_KOREAN, lang_ko_xpm, _( "Korean" ) }, + { wxLANGUAGE_CHINESE_SIMPLIFIED, ID_LANGUAGE_CHINESE_SIMPLIFIED, lang_zh_xpm, _( "Chinese simplified" ) }, + { wxLANGUAGE_CATALAN, ID_LANGUAGE_CATALAN, lang_ca_xpm, _( "Catalan" ) }, + { wxLANGUAGE_DUTCH, ID_LANGUAGE_DUTCH, lang_nl_xpm, _( "Dutch" ) }, + { wxLANGUAGE_JAPANESE, ID_LANGUAGE_JAPANESE, lang_jp_xpm, _( "Japanese" ) }, + { wxLANGUAGE_BULGARIAN, ID_LANGUAGE_BULGARIAN, lang_bg_xpm, _( "Bulgarian" ) }, + { wxLANGUAGE_LITHUANIAN, ID_LANGUAGE_LITHUANIAN, lang_lt_xpm, _( "Lithuanian" ) } }; @@ -288,8 +133,6 @@ PGM_BASE::PGM_BASE() m_pgm_checker = NULL; m_locale = NULL; m_common_settings = NULL; - m_iconsScale = 1.0; - m_useIconsInMenus = true; // will be set later after reading the config m_show_env_var_dialog = true; @@ -675,18 +518,39 @@ void PGM_BASE::loadCommonSettings() m_help_size.x = 500; m_help_size.y = 400; - m_iconsScale = 1.0; // This only effect the first time KiCad is run. The user's setting will be used for all // subsequent runs. Menu icons are off by default on OSX and on for all other platforms. #if defined( __WXMAC__ ) - m_useIconsInMenus = false; + bool defaultUseIconsInMenus = false; #else - m_useIconsInMenus = true; + bool defaultUseIconsInMenus = true; #endif m_common_settings->Read( showEnvVarWarningDialog, &m_show_env_var_dialog ); - m_common_settings->Read( entryUseIconsInMenus, &m_useIconsInMenus, m_useIconsInMenus ); + + if( !m_common_settings->HasEntry( USE_ICONS_IN_MENUS_KEY ) ) + m_common_settings->Write( USE_ICONS_IN_MENUS_KEY, defaultUseIconsInMenus ); + + if( !m_common_settings->HasEntry( ICON_SCALE_KEY ) ) + { + // 5.0 and earlier saved these for each app; we arbitrarily pick pcbnew to fetch them from + wxConfigBase* cfg = GetNewConfig( wxString::FromUTF8( "pcbnew" ) ); + wxString value; + bool option; + + cfg->Read( "PcbIconScale", &value ); + m_common_settings->Write( ICON_SCALE_KEY, value ); + + cfg->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option, false ); + m_common_settings->Write( ENBL_MOUSEWHEEL_PAN_KEY, option ); + + cfg->Read( ENBL_ZOOM_NO_CENTER_KEY, &option, false ); + m_common_settings->Write( ENBL_ZOOM_NO_CENTER_KEY, option ); + + cfg->Read( ENBL_AUTO_PAN_KEY, &option, true ); + m_common_settings->Write( ENBL_AUTO_PAN_KEY, option ); + } m_editor_name = m_common_settings->Read( wxT( "Editor" ) ); @@ -731,7 +595,6 @@ void PGM_BASE::SaveCommonSettings() m_common_settings->Write( workingDirKey, cur_dir ); m_common_settings->Write( showEnvVarWarningDialog, m_show_env_var_dialog ); - m_common_settings->Write( entryUseIconsInMenus, m_useIconsInMenus); // Save the local environment variables. m_common_settings->SetPath( pathEnvVariables ); @@ -973,10 +836,3 @@ void PGM_BASE::SetLocalEnvVariables( const ENV_VAR_MAP& aEnvVarMap ) wxSetEnv( it->first, it->second.GetValue() ); } } - - -void PGM_BASE::ConfigurePaths( wxWindow* aParent, FILENAME_RESOLVER* aResolver ) -{ - DIALOG_CONFIGURE_PATHS dlg( aParent, aResolver ); - dlg.ShowModal(); -} diff --git a/common/tool/context_menu.cpp b/common/tool/context_menu.cpp index 36d4d9fc8d..0f40797591 100644 --- a/common/tool/context_menu.cpp +++ b/common/tool/context_menu.cpp @@ -61,12 +61,11 @@ CONTEXT_MENU::~CONTEXT_MENU() static void set_wxMenuIcon( wxMenuItem* aMenu, const BITMAP_OPAQUE* aIcon ) { // Retrieve the global applicaton show icon option: - bool useImagesInMenus = Pgm().GetUseIconsInMenus(); + bool useImagesInMenus; + Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus ); if( aIcon && useImagesInMenus ) - { aMenu->SetBitmap( KiBitmap( aIcon ) ); - } } @@ -455,7 +454,8 @@ wxMenuItem* CONTEXT_MENU::appendCopy( const wxMenuItem* aSource ) wxMenuItem* newItem = new wxMenuItem( this, aSource->GetId(), aSource->GetItemLabel(), aSource->GetHelp(), aSource->GetKind() ); - bool useImagesInMenus = Pgm().GetUseIconsInMenus(); + bool useImagesInMenus; + Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus ); if( aSource->GetKind() == wxITEM_NORMAL && useImagesInMenus ) newItem->SetBitmap( aSource->GetBitmap() ); diff --git a/common/widgets/gal_options_panel.cpp b/common/widgets/gal_options_panel.cpp index 928a7b2ed8..a494edd52c 100644 --- a/common/widgets/gal_options_panel.cpp +++ b/common/widgets/gal_options_panel.cpp @@ -130,7 +130,7 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI sGridSettingsGrid->Add( l_gridLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_gridLineWidth = new wxTextCtrl( sGridSettings->GetStaticBox(), wxID_ANY ); - sGridSettingsGrid->Add( m_gridLineWidth, 0, wxEXPAND, 5 ); + sGridSettingsGrid->Add( m_gridLineWidth, 0, wxEXPAND | wxTOP | wxBOTTOM, 5 ); m_gridLineWidthSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS ); @@ -147,7 +147,7 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI sGridSettingsGrid->Add( l_gridMinSpacing, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_gridMinSpacing = new wxTextCtrl( sGridSettings->GetStaticBox(), wxID_ANY); - sGridSettingsGrid->Add( m_gridMinSpacing, 0, wxEXPAND, 5 ); + sGridSettingsGrid->Add( m_gridMinSpacing, 0, wxEXPAND | wxTOP | wxBOTTOM, 5 ); m_gridMinSpacingSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS ); @@ -209,14 +209,14 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI sCursorSettings->Add( m_cursorShape, 0, wxALL | wxEXPAND, 5 ); -#ifndef __APPLE__ +#ifdef __APPLE__ // Whole section is galOnly on OSX; no need for further qualifier here - m_forceCursorDisplay = new wxCheckBox( this, wxID_ANY, _( "Always display crosshairs" ) ); + m_forceCursorDisplay = new wxCheckBox( this, wxID_ANY, _( "Always show crosshairs" ) ); #else // User a shorter galOnly qualifier as otherwise the label is obnoxiously long // @todo LEGACY remove this m_forceCursorDisplay = new wxCheckBox( this, wxID_ANY, - _( "Always display crosshairs (not in Legacy)" ) ); + _( "Always show crosshairs (not in Legacy)" ) ); #endif sCursorSettings->Add( m_forceCursorDisplay, 0, wxALL | wxEXPAND, 5 ); diff --git a/common/widgets/paged_dialog.cpp b/common/widgets/paged_dialog.cpp new file mode 100644 index 0000000000..635d5bd733 --- /dev/null +++ b/common/widgets/paged_dialog.cpp @@ -0,0 +1,264 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include +#include +#include +#include + +#include + + +// Maps from dialogTitle <-> pageTitle for keeping track of last-selected pages. +// This is not a simple page index because some dialogs have dynamic page sets. +std::map g_lastPage; +std::map g_lastParentPage; + + +PAGED_DIALOG::PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, + const wxString& aAuxiliaryAction ) : + DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ), + m_title( aTitle ), + m_errorCtrl( nullptr ), + m_errorRow( 0 ), + m_errorCol( 0 ), + m_auxiliaryButton( nullptr ) +{ + auto mainSizer = new wxBoxSizer( wxVERTICAL ); + SetSizer( mainSizer ); + + m_treebook = new wxTreebook( this, wxID_ANY ); + mainSizer->Add( m_treebook, 1, wxEXPAND|wxLEFT|wxTOP, 10 ); + + auto line = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + mainSizer->Add( line, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 10 ); + + auto buttonsSizer = new wxBoxSizer( wxHORIZONTAL ); + + if( !aAuxiliaryAction.IsEmpty() ) + { + m_auxiliaryButton = new wxButton( this, wxID_ANY, aAuxiliaryAction ); + buttonsSizer->Add( m_auxiliaryButton, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); + } + + auto sdbSizer = new wxStdDialogButtonSizer(); + auto sdbSizerOK = new wxButton( this, wxID_OK ); + sdbSizer->AddButton( sdbSizerOK ); + auto sdbSizerCancel = new wxButton( this, wxID_CANCEL ); + sdbSizer->AddButton( sdbSizerCancel ); + sdbSizer->Realize(); + + buttonsSizer->Add( sdbSizer, 1, wxEXPAND, 5 ); + mainSizer->Add( buttonsSizer, 0, wxALL|wxEXPAND, 5 ); + + sdbSizerOK->SetDefault(); + + // We normally save the dialog size and position based on its class-name. This class + // substitutes the title so that each distinctly-titled dialog can have its own saved + // size and position. + m_hash_key = aTitle; + + if( m_auxiliaryButton ) + m_auxiliaryButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PAGED_DIALOG::OnAuxiliaryAction ), nullptr, this ); + Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PAGED_DIALOG::OnUpdateUI ), nullptr, this ); +} + + +// Finish initialization after the bookctrl pages have been added. +void PAGED_DIALOG::finishInitialization() +{ + // For some reason adding page labels to the treeCtrl doesn't invalidate its bestSize + // cache so we have to do it by hand + m_treebook->GetTreeCtrl()->InvalidateBestSize(); + + for( size_t i = 0; i < m_treebook->GetPageCount(); ++i ) + { + m_treebook->ExpandNode( i ); + m_treebook->GetPage( i )->Layout(); + } + + m_treebook->Fit(); + m_treebook->Layout(); + + FinishDialogSettings(); +} + + +PAGED_DIALOG::~PAGED_DIALOG() +{ + // Store the current parentPageTitle/pageTitle hierarchy so we can re-select it + // next time. + wxString lastPage = wxEmptyString; + wxString lastParentPage = wxEmptyString; + + int selected = m_treebook->GetSelection(); + + if( selected != wxNOT_FOUND ) + { + lastPage = m_treebook->GetPageText( (unsigned) selected ); + + int parent = m_treebook->GetPageParent( (unsigned) selected ); + + if( parent != wxNOT_FOUND ) + lastParentPage = m_treebook->GetPageText( (unsigned) parent ); + } + + g_lastPage[ m_title ] = lastPage; + g_lastParentPage[ m_title ] = lastParentPage; + + if( m_auxiliaryButton ) + m_auxiliaryButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PAGED_DIALOG::OnAuxiliaryAction ), nullptr, this ); + Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PAGED_DIALOG::OnUpdateUI ), nullptr, this ); +} + + +void PAGED_DIALOG::AddPage( wxPanel* aPage, const wxString& aTitle ) +{ + m_treebook->AddPage( aPage, aTitle ); +} + + +void PAGED_DIALOG::AddSubPage( wxPanel* aPage, const wxString& aTitle ) +{ + m_treebook->AddSubPage( aPage, aTitle ); +} + + +bool PAGED_DIALOG::TransferDataToWindow() +{ + finishInitialization(); + + if( !DIALOG_SHIM::TransferDataToWindow() ) + return false; + + for( size_t i = 0; i < m_treebook->GetPageCount(); ++i ) + { + wxWindow* page = m_treebook->GetPage( i ); + + if( !page->TransferDataToWindow() ) + return false; + } + + // Search for a page matching the lastParentPageTitle/lastPageTitle hierarchy + wxString lastPage = g_lastPage[ m_title ]; + wxString lastParentPage = g_lastParentPage[ m_title ]; + int lastPageIndex = wxNOT_FOUND; + + for( size_t i = 0; i < m_treebook->GetPageCount(); ++i ) + { + if( m_treebook->GetPageText( i ) == lastPage ) + { + int parent = m_treebook->GetPageParent( i ); + + if( parent == wxNOT_FOUND ) + { + if( lastParentPage.IsEmpty() ) + lastPageIndex = i; + } + else + { + if( lastParentPage == m_treebook->GetPageText( (unsigned) parent ) ) + lastPageIndex = i; + } + } + } + + m_treebook->SetSelection( (unsigned) std::max( 0, lastPageIndex ) ); + + return true; +} + + +bool PAGED_DIALOG::TransferDataFromWindow() +{ + if( !DIALOG_SHIM::TransferDataFromWindow() ) + return false; + + for( size_t i = 0; i < m_treebook->GetPageCount(); ++i ) + { + wxWindow* page = m_treebook->GetPage( i ); + + if( !page->TransferDataFromWindow() ) + return false; + } + + return true; +} + + +void PAGED_DIALOG::SetError( const wxString& aMessage, wxWindow* aPage, wxObject* aCtrl, + int aRow, int aCol ) +{ + for( size_t i = 0; i < m_treebook->GetPageCount(); ++i ) + { + if( m_treebook->GetPage( i ) == aPage ) + { + m_treebook->SetSelection( i ); + break; + } + } + + // Once the page has been changed we want to wait for it to update before displaying + // the error dialog. So store the rest of the error info and wait for OnUpdateUI. + m_errorMessage = aMessage; + m_errorCtrl = aCtrl; + m_errorRow = aRow; + m_errorCol = aCol; +} + + +void PAGED_DIALOG::OnUpdateUI( wxUpdateUIEvent& event ) +{ + // Handle an error. This is delayed to OnUpdateUI so that we can change the focus + // even when the original validation was triggered from a killFocus event, and so + // that the corresponding notebook page can be shown in the background when triggered + // from an OK. + if( m_errorCtrl ) + { + // We will re-enter this routine when the error dialog is displayed, so make + // sure we don't keep putting up more dialogs. + wxObject* ctrl = m_errorCtrl; + m_errorCtrl = nullptr; + + DisplayErrorMessage( this, m_errorMessage ); + + auto textCtrl = dynamic_cast( ctrl ); + if( textCtrl ) + { + auto textEntry = dynamic_cast( textCtrl ); + textEntry->SetSelection( -1, -1 ); + textCtrl->SetFocus(); + return; + } + + auto grid = dynamic_cast( ctrl ); + + if( grid ) + { + grid->SetFocus(); + grid->MakeCellVisible( m_errorRow, m_errorCol ); + grid->SetGridCursor( m_errorRow, m_errorCol ); + + grid->EnableCellEditControl( true ); + grid->ShowCellEditControl(); + return; + } + } +} diff --git a/common/widgets/widget_hotkey_list.cpp b/common/widgets/widget_hotkey_list.cpp index 66b38ad045..3c3871f70c 100644 --- a/common/widgets/widget_hotkey_list.cpp +++ b/common/widgets/widget_hotkey_list.cpp @@ -510,7 +510,7 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, const HOTKEY_SECTIONS : TWO_COLUMN_TREE_LIST( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTL_SINGLE ), m_sections( aSections ) { - AppendColumn( _( "Command" ) ); + AppendColumn( _( "Command (double-click to edit)" ) ); AppendColumn( _( "Hotkey" ) ); SetRubberBandColumn( 0 ); SetClampedMinWidth( HOTKEY_MIN_WIDTH ); diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index 31d612af9b..87932421e6 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -42,14 +41,15 @@ #include #include #include <3d_cache/3d_cache.h> - -#include +#include #include #include #include #include #include +#include + wxSize const FRAME_MIN_SIZE_DU( 350, 250 ); wxSize const FRAME_DEFAULT_SIZE_DU( 450, 300 ); @@ -975,7 +975,8 @@ void CVPCB_MAINFRAME::SetStatusText( const wxString& aText, int aNumber ) void CVPCB_MAINFRAME::OnConfigurePaths( wxCommandEvent& aEvent ) { - Pgm().ConfigurePaths( this, Prj().Get3DCacheManager()->GetResolver() ); + DIALOG_CONFIGURE_PATHS dlg( this, Prj().Get3DCacheManager()->GetResolver() ); + dlg.ShowModal(); } diff --git a/cvpcb/menubar.cpp b/cvpcb/menubar.cpp index 817a0b3387..a4df65ee34 100644 --- a/cvpcb/menubar.cpp +++ b/cvpcb/menubar.cpp @@ -99,10 +99,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() KiBitmap( help_xpm ) ); // About CvPcb - AddMenuItem( helpMenu, wxID_ABOUT, - _( "&About KiCad" ), - _( "About KiCad" ), - KiBitmap( about_xpm ) ); + AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) ); // Create the menubar and append all submenus menuBar->Append( filesMenu, _( "&File" ) ); diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 70a377e11d..fcf21d74fa 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -42,8 +42,6 @@ set( EESCHEMA_DLGS dialogs/dialog_edit_line_style.cpp dialogs/dialog_edit_line_style_base.cpp dialogs/dialog_edit_one_field.cpp - dialogs/dialog_eeschema_options.cpp - dialogs/dialog_eeschema_options_base.cpp dialogs/dialog_erc.cpp dialogs/dialog_erc_base.cpp dialogs/dialog_global_sym_lib_table_config.cpp @@ -58,8 +56,6 @@ set( EESCHEMA_DLGS dialogs/dialog_lib_edit_text_base.cpp dialogs/dialog_lib_new_component.cpp dialogs/dialog_lib_new_component_base.cpp - dialogs/dialog_libedit_options.cpp - dialogs/dialog_libedit_options_base.cpp dialogs/dialog_netlist.cpp dialogs/dialog_netlist_base.cpp dialogs/dialog_plot_schematic.cpp @@ -80,6 +76,14 @@ set( EESCHEMA_DLGS dialogs/dialog_symbol_remap_base.cpp dialogs/dialog_update_fields.cpp dialogs/dialog_update_fields_base.cpp + dialogs/panel_eeschema_template_fieldnames.cpp + dialogs/panel_eeschema_template_fieldnames_base.cpp + dialogs/panel_eeschema_display_options.cpp + dialogs/panel_eeschema_display_options_base.cpp + dialogs/panel_eeschema_settings.cpp + dialogs/panel_eeschema_settings_base.cpp + dialogs/panel_libedit_settings.cpp + dialogs/panel_libedit_settings_base.cpp ) set( EESCHEMA_WIDGETS diff --git a/eeschema/dialogs/dialog_edit_components_libid.cpp b/eeschema/dialogs/dialog_edit_components_libid.cpp index ccbef8466d..c57e3a4d24 100644 --- a/eeschema/dialogs/dialog_edit_components_libid.cpp +++ b/eeschema/dialogs/dialog_edit_components_libid.cpp @@ -511,7 +511,7 @@ bool DIALOG_EDIT_COMPONENTS_LIBID::setLibIdByBrowser( int aRow ) // Use dialog symbol selector to choose a symbol SCH_BASE_FRAME::HISTORY_LIST dummy; SCH_BASE_FRAME::COMPONENT_SELECTION sel = - m_parent->SelectComponentFromLibrary( NULL, dummy, true, 0, 0, false ); + m_frame->SelectComponentFromLibrary( NULL, dummy, true, 0, 0, false ); #else // Use library viewer to choose a symbol LIB_ID aPreselectedLibid; diff --git a/eeschema/dialogs/dialog_edit_line_style.h b/eeschema/dialogs/dialog_edit_line_style.h index cd7e127490..8fc20f5376 100644 --- a/eeschema/dialogs/dialog_edit_line_style.h +++ b/eeschema/dialogs/dialog_edit_line_style.h @@ -34,8 +34,6 @@ #include #include -class WIDGET_EESCHEMA_COLOR_CONFIG; - class DIALOG_EDIT_LINE_STYLE : public DIALOG_EDIT_LINE_STYLE_BASE { public: diff --git a/eeschema/dialogs/dialog_eeschema_options.cpp b/eeschema/dialogs/dialog_eeschema_options.cpp deleted file mode 100644 index 56bb00bf02..0000000000 --- a/eeschema/dialogs/dialog_eeschema_options.cpp +++ /dev/null @@ -1,392 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2009 Wayne Stambaugh - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file dialog_eeschema_options.cpp - */ - -#include -#include - -#include -#include -#include "../widgets/widget_eeschema_color_config.h" -#include -#include -#include - -#include - -int DIALOG_EESCHEMA_OPTIONS::m_lastPageSelected = 0; - -DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( SCH_EDIT_FRAME* parent ) : - DIALOG_EESCHEMA_OPTIONS_BASE( parent ), - m_last_scale( -1 ) -{ - m_choiceUnits->SetFocus(); - m_sdbSizerOK->SetDefault(); - - // wxformbuilder doesn't seem to let us set minimal sizes. Copy the default - // sizes into the minimal sizes, then, and autosize: - for( int i = 0; i < m_fieldGrid->GetNumberCols(); ++i ) - { - m_fieldGrid->SetColMinimalWidth( i, m_fieldGrid->GetColSize( i ) ); - m_fieldGrid->AutoSizeColLabelSize( i ); - } - - m_scaleSlider->SetStep( 25 ); - - // Embed the hotkeys list - HOTKEY_SECTIONS sections = WIDGET_HOTKEY_LIST::GenSections( g_Schematic_Hokeys_Descr ); - m_hotkeyListCtrl = new WIDGET_HOTKEY_LIST( m_panelHotkeys, sections ); - m_hotkeyListCtrl->InstallOnPanel( m_panelHotkeys ); - - // Embed the color configurator - m_colorConfigCtrl = new WIDGET_EESCHEMA_COLOR_CONFIG( m_panelColors, GetParent() ); - m_colorConfigCtrl->InstallOnPanel( m_panelColors ); - - // Make sure we select the last used tab of the options tab page - m_notebook->SetSelection( m_lastPageSelected ); - - // Lay out all child pages - // No, I don't know why this->Layout() doesn't propagate through to these, - // but at least on MSW, it does not. - for( size_t i = 0; i < m_notebook->GetPageCount(); ++i ) - { - m_notebook->GetPage( i )->Layout(); - } - - Layout(); - - // Now all widgets have the size fixed, call FinishDialogSettings - FinishDialogSettings(); -} - - -SCH_EDIT_FRAME* DIALOG_EESCHEMA_OPTIONS::GetParent() -{ - return static_cast( DIALOG_EESCHEMA_OPTIONS_BASE::GetParent() ); -} - - -void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& aUnits, int aSelect ) -{ - wxASSERT( aUnits.GetCount() > 0 - && ( aSelect >= 0 && (size_t) aSelect < aUnits.GetCount() ) ); - - m_choiceUnits->Append( aUnits ); - m_choiceUnits->SetSelection( aSelect ); -} - - -void DIALOG_EESCHEMA_OPTIONS::SetRefIdSeparator( wxChar aSep, wxChar aFirstId) -{ - // m_choiceSeparatorRefId displays one of - // "A" ".A" "-A" "_A" ".1" "-1" "_1" option - - int sel = 0; - switch( aSep ) - { - default: - case 0: - aFirstId = 'A'; // cannot use a number without separator - break; - - case '.': - sel = 1; - break; - - case '-': - sel = 2; - break; - - case '_': - sel = 3; - break; - } - - if( aFirstId == '1' ) - sel += 3; - - m_choiceSeparatorRefId->SetSelection( sel ); -} - - -void DIALOG_EESCHEMA_OPTIONS::GetRefIdSeparator( int& aSep, int& aFirstId) -{ - // m_choiceSeparatorRefId displays one of - // "A" ".A" "-A" "_A" ".1" "-1" "_1" option - - aFirstId = 'A'; - switch( m_choiceSeparatorRefId->GetSelection() ) - { - default: - case 0: aSep = 0; break; - case 1: aSep = '.'; break; - case 2: aSep = '-'; break; - case 3: aSep = '_'; break; - case 4: aFirstId = '1'; aSep = '.'; break; - case 5: aFirstId = '1'; aSep = '-'; break; - case 6: aFirstId = '1'; aSep = '_'; break; - } -} - - -void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& aGridSizes, int aGridId ) -{ - wxASSERT( aGridSizes.size() > 0 ); - - int select = wxNOT_FOUND; - - for( size_t i = 0; i < aGridSizes.size(); i++ ) - { - wxString tmp; - tmp.Printf( wxT( "%0.1f" ), aGridSizes[i].m_Size.x ); - m_choiceGridSize->Append( tmp ); - - if( aGridSizes[i].m_CmdId == aGridId ) - select = (int) i; - } - - m_choiceGridSize->SetSelection( select ); -} - - -void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event ) -{ - // If a single row is selected, insert after that row. - int selected_row = -1; - int n_found = 0; - - for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row ) - { - bool this_row_selected = false; - - for( int col = 0; col < m_fieldGrid->GetNumberCols(); ++col ) - { - if( m_fieldGrid->IsInSelection( row, col ) ) - this_row_selected = true; - } - - if( this_row_selected ) - { - selected_row = row; - ++n_found; - } - } - - TransferDataFromFieldGrid(); - - TEMPLATE_FIELDNAMES::iterator pos; - - if( n_found == 1 ) - pos = templateFields.begin() + selected_row + 1; - else - pos = templateFields.end(); - - // Add a new fieldname to the fieldname list - TEMPLATE_FIELDNAME newFieldname = TEMPLATE_FIELDNAME( "Fieldname" ); - newFieldname.m_Visible = false; - templateFields.insert( pos, newFieldname ); - TransferDataToFieldGrid(); - - event.Skip(); -} - - -void DIALOG_EESCHEMA_OPTIONS::OnDeleteButtonClick( wxCommandEvent& event ) -{ - // wxGrid has a somewhat complex way of detemining selection. - // This is pretty much the easiest way to do it, here. - - std::vector rows_to_delete( templateFields.size(), false ); - - for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row ) - { - for( int col = 0; col < m_fieldGrid->GetNumberCols(); ++col ) - { - if( m_fieldGrid->IsInSelection( row, col ) ) - rows_to_delete[row] = true; - } - } - - TransferDataFromFieldGrid(); - - int n_rows = m_fieldGrid->GetNumberRows(); - - for( int count = 0; count < n_rows; ++count ) - { - // Iterate backwards, unsigned-friendly way for future - int row = n_rows - count - 1; - - if( rows_to_delete[row] ) - { - templateFields.erase( templateFields.begin() + row ); - } - } - - TransferDataToFieldGrid(); -} - - -void DIALOG_EESCHEMA_OPTIONS::OnScaleSlider( wxScrollEvent& aEvent ) -{ - m_scaleAuto->SetValue( false ); -} - - -void DIALOG_EESCHEMA_OPTIONS::OnScaleAuto( wxCommandEvent& aEvent ) -{ - if( m_scaleAuto->GetValue() ) - { - m_last_scale = m_scaleSlider->GetValue(); - m_scaleSlider->SetValue( 25 * KiIconScale( GetParent() ) ); - } - else - { - if( m_last_scale >= 0 ) - m_scaleSlider->SetValue( m_last_scale ); - } -} - - -bool DIALOG_EESCHEMA_OPTIONS::TransferDataToWindow() -{ - if( !wxDialog::TransferDataToWindow() ) - return false; - - if( !m_hotkeyListCtrl->TransferDataToControl() ) - return false; - - if( !TransferDataToFieldGrid() ) - return false; - - int scale_fourths = GetParent()->GetIconScale(); - - if( scale_fourths <= 0 ) - { - m_scaleAuto->SetValue( true ); - m_scaleSlider->SetValue( 25 * KiIconScale( GetParent() ) ); - } - else - { - m_scaleAuto->SetValue( false ); - m_scaleSlider->SetValue( scale_fourths * 25 ); - } - - Layout(); - return true; -} - - -bool DIALOG_EESCHEMA_OPTIONS::TransferDataFromWindow() -{ - m_lastPageSelected = m_notebook->GetSelection(); - - if( !wxDialog::TransferDataFromWindow() ) - return false; - - if( !m_hotkeyListCtrl->TransferDataFromControl() ) - return false; - - GetParent()->WriteHotkeyConfig( g_Eeschema_Hokeys_Descr ); - - if( !m_colorConfigCtrl->TransferDataFromControl() ) - return false; - - if( !TransferDataFromFieldGrid() ) - return false; - - const int scale_fourths = m_scaleAuto->GetValue() ? -1 : m_scaleSlider->GetValue() / 25; - - if( GetParent()->GetIconScale() != scale_fourths ) - GetParent()->SetIconScale( scale_fourths ); - - // Refresh hotkeys - GetParent()->ReCreateMenuBar(); - GetParent()->Refresh(); - - - return true; -} - - -bool DIALOG_EESCHEMA_OPTIONS::TransferDataToFieldGrid() -{ - m_fieldGrid->Freeze(); - - if( m_fieldGrid->GetNumberRows() ) - m_fieldGrid->DeleteRows( 0, m_fieldGrid->GetNumberRows() ); - - m_fieldGrid->AppendRows( templateFields.size() ); - - for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row ) - { - m_fieldGrid->SetCellValue( row, 0, templateFields[row].m_Name ); - m_fieldGrid->SetCellValue( row, 1, templateFields[row].m_Visible ? wxT( "1" ) : wxEmptyString ); - - // Set cell properties - m_fieldGrid->SetCellAlignment( row, 0, wxALIGN_LEFT, wxALIGN_CENTRE ); - - // Render the Visible column as a check box - m_fieldGrid->SetCellEditor( row, 1, new wxGridCellBoolEditor() ); - m_fieldGrid->SetCellRenderer( row, 1, new wxGridCellBoolRenderer() ); - m_fieldGrid->SetCellAlignment( row, 1, wxALIGN_CENTRE, wxALIGN_CENTRE ); - } - - m_fieldGrid->AutoSizeRows(); - m_fieldGrid->Thaw(); - - return true; -} - - -bool DIALOG_EESCHEMA_OPTIONS::TransferDataFromFieldGrid() -{ - // Commit any pending in-place edits and close the editor - m_fieldGrid->DisableCellEditControl(); - - for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row ) - { - templateFields[row].m_Name = m_fieldGrid->GetCellValue( row, 0 ); - templateFields[row].m_Visible = ( m_fieldGrid->GetCellValue( row, 1 ) != wxEmptyString ); - } - - return true; -} - -void DIALOG_EESCHEMA_OPTIONS::SetTemplateFields( const TEMPLATE_FIELDNAMES& aFields ) -{ - // Set the template fields object - templateFields = aFields; - - // Build and refresh the view - TransferDataToFieldGrid(); -} - - -TEMPLATE_FIELDNAMES DIALOG_EESCHEMA_OPTIONS::GetTemplateFields( void ) -{ - return templateFields; -} diff --git a/eeschema/dialogs/dialog_eeschema_options.h b/eeschema/dialogs/dialog_eeschema_options.h deleted file mode 100644 index 65978ccb0c..0000000000 --- a/eeschema/dialogs/dialog_eeschema_options.h +++ /dev/null @@ -1,412 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2009 Wayne Stambaugh - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file dialog_eeschema_options.h - * - * Subclass of DIALOG_EESCHEMA_OPTIONS_BASE, which is generated by wxFormBuilder. - */ - -#ifndef __dialog_eeschema_options__ -#define __dialog_eeschema_options__ - -#include -#include - -class WIDGET_EESCHEMA_COLOR_CONFIG; -class WIDGET_HOTKEY_LIST; -class SCH_EDIT_FRAME; - -class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE -{ -private: - static int m_lastPageSelected; ///< the active notebook page when closing this dialog - ///< strored to keep selection during a session - - int m_last_scale; ///< saved icon scale when Auto selected - -protected: - WIDGET_HOTKEY_LIST* m_hotkeyListCtrl; - WIDGET_EESCHEMA_COLOR_CONFIG* m_colorConfigCtrl; - - /** @brief The template fieldnames for this dialog */ - TEMPLATE_FIELDNAMES templateFields; - - /** - * Function OnAddButtonClick - * Process the wxWidgets @a event produced when the user presses the Add buton for the - * template fieldnames control - * - * @param event The wxWidgets produced event information - * - * Adds a new template fieldname (with default values) to the template fieldnames data - */ - void OnAddButtonClick( wxCommandEvent& event ) override; - - /** - * Function OnDeleteButtonClick - * Process the wxWidgets @a event produced when the user presses the Delete button for the - * template fieldnames control - * - * @param event The wxWidgets produced event information - * - * Deletes the selected template fieldname from the template fieldnames data - */ - void OnDeleteButtonClick( wxCommandEvent& event ) override; - - void OnScaleSlider( wxScrollEvent& aEvent ) override; - void OnScaleAuto( wxCommandEvent& aEvent ) override; - - /** - * Function TransferDataToWindow - * Transfer data into the GUI. - */ - bool TransferDataToWindow() override; - - /** - * Function TransferDataFromWindow - * Transfer data out of the GUI. - */ - bool TransferDataFromWindow() override; - - bool TransferDataToFieldGrid(); - bool TransferDataFromFieldGrid(); - -public: - /** - * Public constructor - * - * @param parent The dialog's parent - */ - DIALOG_EESCHEMA_OPTIONS( SCH_EDIT_FRAME* parent ); - - virtual SCH_EDIT_FRAME* GetParent(); - - /** - * Function GetUnitsSelection - * Returns the currently selected grid size in the dialog - */ - int GetUnitsSelection( void ) { return m_choiceUnits->GetSelection(); } - - /** - * Function SetUnits - * Set the unit options - * - * @param aUnits The array of strings representing the unit options - * @param aSelect The unit to select from the unit options - * - * Appends the @a units options to the list of unit options and selects the @a aSelect option - */ - void SetUnits( const wxArrayString& aUnits, int aSelect = 0 ); - - /** - * Function GetGridSelection - * Returns the curent grid size selected in the dialog - */ - int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); } - - /** - * Function SetGridSizes - * Sets the available grid size choices @a aGridSizes and selectd the current option @a aGridId - * - * @param aGridSizes The grid sizes that are able to be chosen from - * @param aGridId The grid size to select from the grid size options - */ - void SetGridSizes( const GRIDS& aGridSizes, int aGridId ); - - /** - * Function GetBusWidth - * Get the current bus width setting from the dialog - */ - int GetBusWidth( void ) { return m_spinBusWidth->GetValue(); } - - /** - * Function SetBusWidth - * Sets the bus width setting in the dialog - * - * @param aWidth The bus width to set the dialog edit spinbox with - */ - void SetBusWidth( int aWidth ) { m_spinBusWidth->SetValue( aWidth ); } - - /** - * Function SetLineWidth - * Sets the current LineWidth value in the dialog - * @param aWidth The line width to set in the dialog - */ - void SetLineWidth( int aWidth ) { m_spinLineWidth->SetValue( aWidth ); } - - /** - * Function GetLineWidth - * Returns the current LineWidth value from the dialog - */ - int GetLineWidth( void ) { return m_spinLineWidth->GetValue(); } - - /** - * Function SetTextSize - * Sets the current default TextSize value in the dialog - * @param text_size The text size to set in the dialog - */ - void SetTextSize( int text_size ) { m_spinTextSize->SetValue( text_size ); } - - /** - * Function GetTextSize - * Returns the current default TextSize value from the dialog - */ - int GetTextSize( void ) { return m_spinTextSize->GetValue(); } - - /** - * Function SetRepeatHorizontal - * Sets the current RepeatHorizontal displacement value in the dialog - * @param displacement The displacement to set in the dialog - */ - void SetRepeatHorizontal( int displacement ) - { - m_spinRepeatHorizontal->SetValue( displacement ); - } - - /** - * Function GetRepeatHorizontal - * Returns the current RepeatHorizontal displacement value from the dialog - */ - int GetRepeatHorizontal( void ) { return m_spinRepeatHorizontal->GetValue(); } - - /** - * Function SetRepeatVertical - * Sets the current RepeatVertical displacement value in the dialog - * @param displacement The displacement to set in the dialog - */ - void SetRepeatVertical( int displacement ) { m_spinRepeatVertical->SetValue( displacement ); } - - /** - * Function GetRepeatVertical - * Returns the current RepeatVertical displacement value from the dialog - */ - int GetRepeatVertical( void ) { return m_spinRepeatVertical->GetValue(); } - - /** - * Function SetRepeatLabel - * Sets the current RepeatLabel increment value in the dialog - * @param increment The increment to set in the dialog - */ - void SetRepeatLabel( int increment ) { m_spinRepeatLabel->SetValue( increment ); } - - /** - * Function GetRepeatLabel - * Returns the current RepeatLabel increment value from the dialog - */ - int GetRepeatLabel( void ) { return m_spinRepeatLabel->GetValue(); } - - /** - * Function SetAutoSaveInterval - * Sets the current AutoSaveInterval value in the dialog - * @param aInterval The interval to set in the dialog - */ - void SetAutoSaveInterval( int aInterval ) { m_spinAutoSaveInterval->SetValue( aInterval ); } - - /** - * Function GetAutoSaveInterval - * Returns the current AutoSaveInterval value from the dialog - */ - int GetAutoSaveInterval() const { return m_spinAutoSaveInterval->GetValue(); } - - /** - * Function SetRefIdSeparator - * Sets the current RefIdSeparator value in the dialog - * @param aSep The seperator to use between the reference and the part ID - * @param aFirstId The first part ID, currently either 'A' or '1' - */ - void SetRefIdSeparator( wxChar aSep, wxChar aFirstId); - - /** - * Function GetRefIdSeparator - * Returns the current RefIdSeparator value from the dialog - * @param aSep The OUTPUT seperator value - * @param aFirstId The OUTPUT reference first ID - */ - void GetRefIdSeparator( int& aSep, int& aFirstId); - - /** - * Function SetShowGrid - * Sets the current ShowGrid value in the dialog - * @param show The ShowGrid value to set in the dialog - */ - void SetShowGrid( bool show ) { m_checkShowGrid->SetValue( show ); } - - /** - * Function GetShowGrid - * Returns the current ShowGrid value from the dialog - */ - bool GetShowGrid( void ) { return m_checkShowGrid->GetValue(); } - - /** - * Function SetShowHiddenPins - * Sets the current ShowHiddenPins value in the dialog - * @param show The ShowHiddenPins value to set in the dialog - */ - void SetShowHiddenPins( bool show ) { m_checkShowHiddenPins->SetValue( show ); } - - /** - * Function GetShowHiddenPins - * Returns the current ShowHiddenPins value from the dialog - */ - bool GetShowHiddenPins( void ) { return m_checkShowHiddenPins->GetValue(); } - - /** - * Function SetEnableZoomNoCenter - * Sets the current ZoomNoCenter value in the dialog - * @param enable The ZoomNoCenter value to set in the dialog - */ - void SetEnableZoomNoCenter( bool enable ) - { - m_checkEnableZoomCenter->SetValue( !enable ); - } - - /** - * Function GetEnableZoomNoCenter - * Returns the current ZoomNoCenter value from the dialog - */ - bool GetEnableZoomNoCenter( void ) - { - return !m_checkEnableZoomCenter->GetValue(); - } - - /** - * Function SetEnableMousewheelPan - * Sets the MousewheelPan setting in the dialog - * - * @param enable The boolean value to set the AutoPan value in the dialog - */ - void SetEnableMousewheelPan( bool enable ) { m_checkEnableMousewheelPan->SetValue( enable ); } - - /** - * Function GetEnableMousewheelPan - * Return the MousewheelPan setting from the dialog - */ - bool GetEnableMousewheelPan( void ) { return m_checkEnableMousewheelPan->GetValue(); } - - /** - * Function SetEnableAutoPan - * Sets the AutoPan setting in the dialog - * - * @param enable The boolean value to set the AutoPan value in the dialog - */ - void SetEnableAutoPan( bool enable ) { m_checkAutoPan->SetValue( enable ); } - - /** - * Function GetEnableAutoPan - * Return the AutoPan setting from the dialog - */ - bool GetEnableAutoPan( void ) { return m_checkAutoPan->GetValue(); } - - /** - * Function SetEnableHVBusOrientation - * Set the HVBusOrientation setting in the dialog - * - * @param enable The boolean value to set the HVBusOrientation value in the dialog - */ - void SetEnableHVBusOrientation( bool enable ) { m_checkHVOrientation->SetValue( enable ); } - - /** - * Function GetEnableHVBusOrientation - * Get the HVBusOrientation setting from the dialog - */ - bool GetEnableHVBusOrientation( void ) { return m_checkHVOrientation->GetValue(); } - - /** - * Function - * Set the ShowPageLimits setting in the dialog - */ - void SetShowPageLimits( bool show ) { m_checkPageLimits->SetValue( show ); } - - /** - * Function - * Return the current ShowPageLimits setting from the dialog - */ - bool GetShowPageLimits( void ) { return m_checkPageLimits->GetValue(); } - - /** - * Function - * Set the FootprintPreview setting in the dialog. - */ - void SetFootprintPreview( bool show ) { m_footprintPreview->SetValue( show ); } - - /** - * Function - * Return the current FootprintPreview setting from the dialog - */ - bool GetFootprintPreview( void ) { return m_footprintPreview->GetValue(); } - - /** - * Function - * Set the AutoplaceFields setting in the dialog - */ - void SetAutoplaceFields( bool enable ) { m_checkAutoplaceFields->SetValue( enable ); } - - /** - * Function - * Return the current AutoplaceFields setting from the dialog - */ - bool GetAutoplaceFields() { return m_checkAutoplaceFields->GetValue(); } - - /** - * Function - * Set the AutoplaceJustify setting in the dialog - */ - void SetAutoplaceJustify( bool enable ) { m_checkAutoplaceJustify->SetValue( enable ); } - - /** - * Function - * Return the current AutoplaceJustify setting from the dialog - */ - bool GetAutoplaceJustify() { return m_checkAutoplaceJustify->GetValue(); } - - /** - * Function - * Set the AutoplaceAlign setting in the dialog - */ - void SetAutoplaceAlign( bool enable ) { m_checkAutoplaceAlign->SetValue( enable ); } - - /** - * Function - * Return the current AutoplaceAlign setting from the dialog - */ - bool GetAutoplaceAlign() { return m_checkAutoplaceAlign->GetValue(); } - - /** - * Function SetTemplateFields - * Set the template field data in the dialog - * - * @param aFields The template fieldnames that the dialog should start with before any editing - */ - void SetTemplateFields( const TEMPLATE_FIELDNAMES& aFields ); - - /** - * Function GetTemplateFields - * Get the dialog's template field data - * - */ - TEMPLATE_FIELDNAMES GetTemplateFields( void ); -}; - -#endif // __dialog_eeschema_options__ diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp deleted file mode 100644 index e75aab50ff..0000000000 --- a/eeschema/dialogs/dialog_eeschema_options_base.cpp +++ /dev/null @@ -1,411 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_eeschema_options_base.h" - -/////////////////////////////////////////////////////////////////////////// - -BEGIN_EVENT_TABLE( DIALOG_EESCHEMA_OPTIONS_BASE, DIALOG_SHIM ) - EVT_SIZE( DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnSize ) - EVT_SCROLL( DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnScaleSlider ) - EVT_CHECKBOX( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnScaleAuto ) - EVT_CHOICE( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnChooseUnits ) - EVT_BUTTON( wxID_ADD_FIELD, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnAddButtonClick ) - EVT_BUTTON( wxID_DELETE_FIELD, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnDeleteButtonClick ) -END_EVENT_TABLE() - -DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* mainSizer; - mainSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bOptionsSizer; - bOptionsSizer = new wxBoxSizer( wxVERTICAL ); - - m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_panel5 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer82; - bSizer82 = new wxBoxSizer( wxVERTICAL ); - - wxFlexGridSizer* fgSizer32; - fgSizer32 = new wxFlexGridSizer( 0, 3, 0, 0 ); - fgSizer32->AddGrowableCol( 0 ); - fgSizer32->AddGrowableCol( 1 ); - fgSizer32->AddGrowableCol( 2 ); - fgSizer32->SetFlexibleDirection( wxBOTH ); - fgSizer32->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticText3 = new wxStaticText( m_panel5, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText3->Wrap( -1 ); - fgSizer32->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - wxArrayString m_choiceGridSizeChoices; - m_choiceGridSize = new wxChoice( m_panel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceGridSizeChoices, 0 ); - m_choiceGridSize->SetSelection( 0 ); - fgSizer32->Add( m_choiceGridSize, 0, wxEXPAND|wxALL, 3 ); - - m_staticGridUnits = new wxStaticText( m_panel5, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticGridUnits->Wrap( -1 ); - fgSizer32->Add( m_staticGridUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_staticText51 = new wxStaticText( m_panel5, wxID_ANY, _("&Bus thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText51->Wrap( -1 ); - fgSizer32->Add( m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_spinBusWidth = new wxSpinCtrl( m_panel5, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 ); - fgSizer32->Add( m_spinBusWidth, 0, wxALL|wxEXPAND, 3 ); - - m_staticBusWidthUnits = new wxStaticText( m_panel5, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticBusWidthUnits->Wrap( -1 ); - fgSizer32->Add( m_staticBusWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_staticText5 = new wxStaticText( m_panel5, wxID_ANY, _("&Line thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText5->Wrap( -1 ); - fgSizer32->Add( m_staticText5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_spinLineWidth = new wxSpinCtrl( m_panel5, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 ); - fgSizer32->Add( m_spinLineWidth, 0, wxALL|wxEXPAND, 3 ); - - m_staticLineWidthUnits = new wxStaticText( m_panel5, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticLineWidthUnits->Wrap( -1 ); - fgSizer32->Add( m_staticLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_staticText26 = new wxStaticText( m_panel5, wxID_ANY, _("&Part ID notation:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText26->Wrap( -1 ); - fgSizer32->Add( m_staticText26, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 3 ); - - wxString m_choiceSeparatorRefIdChoices[] = { _("A"), _(".A"), _("-A"), _("_A"), _(".1"), _("-1"), _("_1") }; - int m_choiceSeparatorRefIdNChoices = sizeof( m_choiceSeparatorRefIdChoices ) / sizeof( wxString ); - m_choiceSeparatorRefId = new wxChoice( m_panel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceSeparatorRefIdNChoices, m_choiceSeparatorRefIdChoices, 0 ); - m_choiceSeparatorRefId->SetSelection( 0 ); - fgSizer32->Add( m_choiceSeparatorRefId, 0, wxALL|wxEXPAND, 3 ); - - - fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_stIconScale = new wxStaticText( m_panel5, wxID_ANY, _("Icon scale:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_stIconScale->Wrap( -1 ); - fgSizer32->Add( m_stIconScale, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 ); - - m_scaleSlider = new STEPPED_SLIDER( m_panel5, wxID_ANY, 50, 50, 275, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS ); - fgSizer32->Add( m_scaleSlider, 0, wxALL|wxEXPAND, 3 ); - - m_staticText211 = new wxStaticText( m_panel5, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText211->Wrap( -1 ); - fgSizer32->Add( m_staticText211, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 ); - - - fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_scaleAuto = new wxCheckBox( m_panel5, wxID_ANY, _("Auto"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer32->Add( m_scaleAuto, 0, wxALL|wxEXPAND, 3 ); - - - fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 ); - - - bSizer82->Add( fgSizer32, 0, wxALL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer92; - bSizer92 = new wxBoxSizer( wxVERTICAL ); - - m_staticline3 = new wxStaticLine( m_panel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer92->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 ); - - m_checkShowGrid = new wxCheckBox( m_panel5, wxID_ANY, _("&Show grid"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer92->Add( m_checkShowGrid, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 ); - - m_checkHVOrientation = new wxCheckBox( m_panel5, wxID_ANY, _("&Restrict buses and wires to H and V orientation"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer92->Add( m_checkHVOrientation, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 ); - - m_checkShowHiddenPins = new wxCheckBox( m_panel5, wxID_ANY, _("S&how hidden pins"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer92->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 ); - - m_checkPageLimits = new wxCheckBox( m_panel5, wxID_ANY, _("Show page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkPageLimits->SetValue(true); - bSizer92->Add( m_checkPageLimits, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 ); - - m_footprintPreview = new wxCheckBox( m_panel5, wxID_ANY, _("Footprint previews in symbol chooser (experimental)"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer92->Add( m_footprintPreview, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 3 ); - - - bSizer82->Add( bSizer92, 0, wxALL|wxEXPAND, 5 ); - - - m_panel5->SetSizer( bSizer82 ); - m_panel5->Layout(); - bSizer82->Fit( m_panel5 ); - m_notebook->AddPage( m_panel5, _("Display"), true ); - m_panel3 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer8; - bSizer8 = new wxBoxSizer( wxVERTICAL ); - - wxFlexGridSizer* fgSizer3; - fgSizer3 = new wxFlexGridSizer( 0, 3, 0, 0 ); - fgSizer3->AddGrowableCol( 0 ); - fgSizer3->AddGrowableCol( 1 ); - fgSizer3->AddGrowableCol( 2 ); - fgSizer3->SetFlexibleDirection( wxBOTH ); - fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticText2 = new wxStaticText( m_panel3, wxID_ANY, _("&Measurement units:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText2->Wrap( -1 ); - fgSizer3->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - wxArrayString m_choiceUnitsChoices; - m_choiceUnits = new wxChoice( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitsChoices, 0 ); - m_choiceUnits->SetSelection( 0 ); - fgSizer3->Add( m_choiceUnits, 0, wxALL|wxEXPAND, 3 ); - - - fgSizer3->Add( 0, 0, 1, wxEXPAND, 3 ); - - m_staticTextHpitch = new wxStaticText( m_panel3, wxID_ANY, _("&Horizontal pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextHpitch->Wrap( -1 ); - fgSizer3->Add( m_staticTextHpitch, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_spinRepeatHorizontal = new wxSpinCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 0 ); - fgSizer3->Add( m_spinRepeatHorizontal, 0, wxALL|wxEXPAND, 3 ); - - m_staticRepeatXUnits = new wxStaticText( m_panel3, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticRepeatXUnits->Wrap( -1 ); - fgSizer3->Add( m_staticRepeatXUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_staticTextVpitch = new wxStaticText( m_panel3, wxID_ANY, _("&Vertical pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextVpitch->Wrap( -1 ); - fgSizer3->Add( m_staticTextVpitch, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_spinRepeatVertical = new wxSpinCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 100 ); - fgSizer3->Add( m_spinRepeatVertical, 0, wxALL|wxEXPAND, 3 ); - - m_staticRepeatYUnits = new wxStaticText( m_panel3, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticRepeatYUnits->Wrap( -1 ); - fgSizer3->Add( m_staticRepeatYUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_staticText16 = new wxStaticText( m_panel3, wxID_ANY, _("&Increment of repeated labels:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText16->Wrap( -1 ); - fgSizer3->Add( m_staticText16, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_spinRepeatLabel = new wxSpinCtrl( m_panel3, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -10, 10, 1 ); - fgSizer3->Add( m_spinRepeatLabel, 0, wxALL|wxEXPAND, 3 ); - - - fgSizer3->Add( 0, 0, 1, wxEXPAND, 3 ); - - m_staticTextTsize = new wxStaticText( m_panel3, wxID_ANY, _("Def&ault text size:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTsize->Wrap( -1 ); - fgSizer3->Add( m_staticTextTsize, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_spinTextSize = new wxSpinCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 1000, 0 ); - fgSizer3->Add( m_spinTextSize, 0, wxALL|wxEXPAND, 3 ); - - m_staticTextSizeUnits = new wxStaticText( m_panel3, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextSizeUnits->Wrap( -1 ); - fgSizer3->Add( m_staticTextSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_staticTextTimeInterval = new wxStaticText( m_panel3, wxID_ANY, _("&Auto-save time interval:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTimeInterval->Wrap( -1 ); - fgSizer3->Add( m_staticTextTimeInterval, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_spinAutoSaveInterval = new wxSpinCtrl( m_panel3, ID_M_SPINAUTOSAVEINTERVAL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 1000, 10 ); - m_spinAutoSaveInterval->SetToolTip( _("Delay after the first change to create a backup file of the board on disk.\nIf set to 0, auto backup is disabled") ); - - fgSizer3->Add( m_spinAutoSaveInterval, 0, wxALL|wxEXPAND, 3 ); - - m_staticText23 = new wxStaticText( m_panel3, wxID_ANY, _("minutes"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText23->Wrap( -1 ); - fgSizer3->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - - bSizer8->Add( fgSizer3, 0, wxALL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer9; - bSizer9 = new wxBoxSizer( wxVERTICAL ); - - m_staticline2 = new wxStaticLine( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer9->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 ); - - m_checkAutoplaceFields = new wxCheckBox( m_panel3, wxID_ANY, _("A&utomatically place symbol fields"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer9->Add( m_checkAutoplaceFields, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 ); - - m_checkAutoplaceJustify = new wxCheckBox( m_panel3, wxID_ANY, _("A&llow field autoplace to change justification"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer9->Add( m_checkAutoplaceJustify, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 ); - - m_checkAutoplaceAlign = new wxCheckBox( m_panel3, wxID_ANY, _("Al&ways align autoplaced fields to the 50 mil grid"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer9->Add( m_checkAutoplaceAlign, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 ); - - - bSizer8->Add( bSizer9, 0, wxALL|wxEXPAND, 5 ); - - - m_panel3->SetSizer( bSizer8 ); - m_panel3->Layout(); - bSizer8->Fit( m_panel3 ); - m_notebook->AddPage( m_panel3, _("Editing"), false ); - m_tabControls = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer81; - bSizer81 = new wxBoxSizer( wxVERTICAL ); - - wxFlexGridSizer* fgSizer31; - fgSizer31 = new wxFlexGridSizer( 0, 3, 0, 0 ); - fgSizer31->AddGrowableCol( 0 ); - fgSizer31->AddGrowableCol( 1 ); - fgSizer31->AddGrowableCol( 2 ); - fgSizer31->SetFlexibleDirection( wxBOTH ); - fgSizer31->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - - bSizer81->Add( fgSizer31, 0, wxALL|wxEXPAND, 5 ); - - m_controlsSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer13; - bSizer13 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText20 = new wxStaticText( m_tabControls, wxID_ANY, _("Hotkeys:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText20->Wrap( -1 ); - bSizer13->Add( m_staticText20, 1, wxALL, 5 ); - - m_staticText21 = new wxStaticText( m_tabControls, wxID_ANY, _("Double-click to edit"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText21->Wrap( -1 ); - bSizer13->Add( m_staticText21, 0, wxALL, 5 ); - - - m_controlsSizer->Add( bSizer13, 0, wxEXPAND, 5 ); - - m_panelHotkeys = new wxPanel( m_tabControls, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_controlsSizer->Add( m_panelHotkeys, 1, wxEXPAND | wxALL, 5 ); - - m_checkEnableZoomCenter = new wxCheckBox( m_tabControls, wxID_ANY, _("Cen&ter and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkEnableZoomCenter->SetToolTip( _("Keep the cursor at its current location when zooming") ); - - m_controlsSizer->Add( m_checkEnableZoomCenter, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); - - m_checkEnableMousewheelPan = new wxCheckBox( m_tabControls, xwID_ANY, _("Use touchpa&d to pan"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkEnableMousewheelPan->SetToolTip( _("Use touchpad to pan canvas") ); - - m_controlsSizer->Add( m_checkEnableMousewheelPan, 0, wxLEFT|wxRIGHT|wxTOP, 3 ); - - m_checkAutoPan = new wxCheckBox( m_tabControls, wxID_ANY, _("&Pan while moving object"), wxDefaultPosition, wxDefaultSize, 0 ); - m_controlsSizer->Add( m_checkAutoPan, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 ); - - - bSizer81->Add( m_controlsSizer, 1, wxALL|wxEXPAND, 5 ); - - - m_tabControls->SetSizer( bSizer81 ); - m_tabControls->Layout(); - bSizer81->Fit( m_tabControls ); - m_notebook->AddPage( m_tabControls, _("Controls"), false ); - m_tabColors = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer14; - bSizer14 = new wxBoxSizer( wxVERTICAL ); - - m_panelColors = new wxPanel( m_tabColors, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - bSizer14->Add( m_panelColors, 1, wxEXPAND | wxALL, 5 ); - - - m_tabColors->SetSizer( bSizer14 ); - m_tabColors->Layout(); - bSizer14->Fit( m_tabColors ); - m_notebook->AddPage( m_tabColors, _("Colors"), false ); - m_panel2 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panel2->SetToolTip( _("User defined field names for schematic components. ") ); - - wxBoxSizer* bSizer6; - bSizer6 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer11; - bSizer11 = new wxBoxSizer( wxVERTICAL ); - - m_fieldGrid = new wxGrid( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - - // Grid - m_fieldGrid->CreateGrid( 0, 2 ); - m_fieldGrid->EnableEditing( true ); - m_fieldGrid->EnableGridLines( true ); - m_fieldGrid->EnableDragGridSize( false ); - m_fieldGrid->SetMargins( 0, 0 ); - - // Columns - m_fieldGrid->SetColSize( 0, 300 ); - m_fieldGrid->SetColSize( 1, 75 ); - m_fieldGrid->EnableDragColMove( false ); - m_fieldGrid->EnableDragColSize( true ); - m_fieldGrid->SetColLabelSize( 22 ); - m_fieldGrid->SetColLabelValue( 0, _("Name") ); - m_fieldGrid->SetColLabelValue( 1, _("Visible") ); - m_fieldGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Rows - m_fieldGrid->EnableDragRowSize( true ); - m_fieldGrid->SetRowLabelSize( 80 ); - m_fieldGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Label Appearance - - // Cell Defaults - m_fieldGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); - bSizer11->Add( m_fieldGrid, 1, wxALL|wxEXPAND, 5 ); - - - bSizer6->Add( bSizer11, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizer10; - bSizer10 = new wxBoxSizer( wxVERTICAL ); - - addFieldButton = new wxButton( m_panel2, wxID_ADD_FIELD, _("&Add"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer10->Add( addFieldButton, 0, wxALL|wxEXPAND, 5 ); - - deleteFieldButton = new wxButton( m_panel2, wxID_DELETE_FIELD, _("De&lete"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer10->Add( deleteFieldButton, 0, wxALL|wxEXPAND, 5 ); - - - bSizer10->Add( 0, 0, 1, wxEXPAND, 5 ); - - - bSizer6->Add( bSizer10, 0, wxEXPAND, 5 ); - - - m_panel2->SetSizer( bSizer6 ); - m_panel2->Layout(); - bSizer6->Fit( m_panel2 ); - m_notebook->AddPage( m_panel2, _("Field Name Templates"), false ); - - bOptionsSizer->Add( m_notebook, 1, wxALL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer12; - bSizer12 = new wxBoxSizer( wxHORIZONTAL ); - - m_sdbSizer = new wxStdDialogButtonSizer(); - m_sdbSizerOK = new wxButton( this, wxID_OK ); - m_sdbSizer->AddButton( m_sdbSizerOK ); - m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); - m_sdbSizer->AddButton( m_sdbSizerCancel ); - m_sdbSizer->Realize(); - - bSizer12->Add( m_sdbSizer, 1, wxALL|wxEXPAND, 5 ); - - - bOptionsSizer->Add( bSizer12, 0, wxBOTTOM|wxEXPAND, 5 ); - - - mainSizer->Add( bOptionsSizer, 1, wxEXPAND, 12 ); - - - this->SetSizer( mainSizer ); - this->Layout(); - mainSizer->Fit( this ); - - this->Centre( wxBOTH ); -} - -DIALOG_EESCHEMA_OPTIONS_BASE::~DIALOG_EESCHEMA_OPTIONS_BASE() -{ -} diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp deleted file mode 100644 index 6f77c893da..0000000000 --- a/eeschema/dialogs/dialog_eeschema_options_base.fbp +++ /dev/null @@ -1,5269 +0,0 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - table - dialog_eeschema_options_base - 1000 - none - 1 - dialog_eeschema_options - - . - - 1 - 1 - 1 - 1 - UI - 1 - 0 - - 0 - wxAUI_MGR_DEFAULT - - wxBOTH - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - DIALOG_EESCHEMA_OPTIONS_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Schematic Editor Options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnSize - - - - mainSizer - wxVERTICAL - none - - 12 - wxEXPAND - 1 - - - bOptionsSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_notebook - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Display - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panel5 - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - bSizer82 - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 3 - wxBOTH - 0,1,2 - - 0 - - fgSizer32 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Grid size: - - 0 - - - 0 - - 1 - m_staticText3 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceGridSize - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticGridUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Bus thickness: - - 0 - - - 0 - - 1 - m_staticText51 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 1 - 100 - - 0 - - 1 - - 0 - - 1 - m_spinBusWidth - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticBusWidthUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Line thickness: - - 0 - - - 0 - - 1 - m_staticText5 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 1 - 100 - - 0 - - 1 - - 0 - - 1 - m_spinLineWidth - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticLineWidthUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Part ID notation: - - 0 - - - 0 - - 1 - m_staticText26 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "A" ".A" "-A" "_A" ".1" "-1" "_1" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceSeparatorRefId - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 3 - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Icon scale: - - 0 - - - 0 - - 1 - m_stIconScale - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 275 - - 0 - - 50 - - 0 - - 1 - m_scaleSlider - 1 - - - protected - 1 - - Resizable - 1 - - wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS - STEPPED_SLIDER; widgets/stepped_slider.h; Not forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 50 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnScaleSlider - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - % - - 0 - - - 0 - - 1 - m_staticText211 - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Auto - - 0 - - - 0 - - 1 - m_scaleAuto - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - OnScaleAuto - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - - - 5 - wxALL|wxEXPAND - 0 - - - bSizer92 - wxVERTICAL - none - - 5 - wxEXPAND | wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline3 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Show grid - - 0 - - - 0 - - 1 - m_checkShowGrid - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Restrict buses and wires to H and V orientation - - 0 - - - 0 - - 1 - m_checkHVOrientation - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - S&how hidden pins - - 0 - - - 0 - - 1 - m_checkShowHiddenPins - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxLEFT|wxTOP|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show page limi&ts - - 0 - - - 0 - - 1 - m_checkPageLimits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Footprint previews in symbol chooser (experimental) - - 0 - - - 0 - - 1 - m_footprintPreview - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Editing - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panel3 - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - bSizer8 - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 3 - wxBOTH - 0,1,2 - - 0 - - fgSizer3 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Measurement units: - - 0 - - - 0 - - 1 - m_staticText2 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceUnits - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - OnChooseUnits - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Horizontal pitch of repeated items: - - 0 - - - 0 - - 1 - m_staticTextHpitch - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 0 - 5000 - - 0 - - -5000 - - 0 - - 1 - m_spinRepeatHorizontal - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticRepeatXUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Vertical pitch of repeated items: - - 0 - - - 0 - - 1 - m_staticTextVpitch - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 100 - 5000 - - 0 - - -5000 - - 0 - - 1 - m_spinRepeatVertical - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticRepeatYUnits - 1 - - - protected - 1 - - Fixed - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Increment of repeated labels: - - 0 - - - 0 - - 1 - m_staticText16 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 1 - 10 - - 0 - - -10 - - 0 - - 1 - m_spinRepeatLabel - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Def&ault text size: - - 0 - - - 0 - - 1 - m_staticTextTsize - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 0 - 1000 - - 0 - - 0 - - 0 - - 1 - m_spinTextSize - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticTextSizeUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Auto-save time interval: - - 0 - - - 0 - - 1 - m_staticTextTimeInterval - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_M_SPINAUTOSAVEINTERVAL - 10 - 1000 - - 0 - - 0 - - 0 - - 1 - m_spinAutoSaveInterval - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS - - 0 - Delay after the first change to create a backup file of the board on disk. If set to 0, auto backup is disabled - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - minutes - - 0 - - - 0 - - 1 - m_staticText23 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - bSizer9 - wxVERTICAL - none - - 5 - wxEXPAND | wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline2 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxLEFT|wxTOP|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - A&utomatically place symbol fields - - 0 - - - 0 - - 1 - m_checkAutoplaceFields - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxLEFT|wxTOP|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - A&llow field autoplace to change justification - - 0 - - - 0 - - 1 - m_checkAutoplaceJustify - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxLEFT|wxTOP|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Al&ways align autoplaced fields to the 50 mil grid - - 0 - - - 0 - - 1 - m_checkAutoplaceAlign - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Controls - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_tabControls - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - bSizer81 - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 3 - wxBOTH - 0,1,2 - - 0 - - fgSizer31 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - - - 5 - wxALL|wxEXPAND - 1 - - - m_controlsSizer - wxVERTICAL - protected - - 5 - wxEXPAND - 0 - - - bSizer13 - wxHORIZONTAL - none - - 5 - wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Hotkeys: - - 0 - - - 0 - - 1 - m_staticText20 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Double-click to edit - - 0 - - - 0 - - 1 - m_staticText21 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND | wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panelHotkeys - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Cen&ter and warp cursor on zoom - - 0 - - - 0 - - 1 - m_checkEnableZoomCenter - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Keep the cursor at its current location when zooming - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - xwID_ANY - Use touchpa&d to pan - - 0 - - - 0 - - 1 - m_checkEnableMousewheelPan - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Use touchpad to pan canvas - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Pan while moving object - - 0 - - - 0 - - 1 - m_checkAutoPan - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Colors - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_tabColors - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - bSizer14 - wxVERTICAL - none - - 5 - wxEXPAND | wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panelColors - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Field Name Templates - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panel2 - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - User defined field names for schematic components. - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - bSizer6 - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - - bSizer11 - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - 0 - 0 - - - - 1 - - - wxALIGN_LEFT - - wxALIGN_TOP - 0 - 1 - wxALIGN_CENTRE - 22 - "Name" "Visible" - wxALIGN_CENTRE - 2 - 300,75 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - 0 - 1 - 1 - 1 - - 1 - - - 1 - 0 - 0 - wxID_ANY - - - - 0 - 0 - - 0 - - - 0 - - 1 - m_fieldGrid - 1 - - - protected - 1 - - Resizable - wxALIGN_CENTRE - 80 - - wxALIGN_CENTRE - - 0 - 1 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bSizer10 - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ADD_FIELD - &Add - - 0 - - - 0 - - 1 - addFieldButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnAddButtonClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_DELETE_FIELD - De&lete - - 0 - - - 0 - - 1 - deleteFieldButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnDeleteButtonClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND - 0 - - - bSizer12 - wxHORIZONTAL - none - - 5 - wxALL|wxEXPAND - 1 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer - protected - - - - - - - - - - - - - - - - - - diff --git a/eeschema/dialogs/dialog_eeschema_options_base.h b/eeschema/dialogs/dialog_eeschema_options_base.h deleted file mode 100644 index d5ef39be00..0000000000 --- a/eeschema/dialogs/dialog_eeschema_options_base.h +++ /dev/null @@ -1,143 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __DIALOG_EESCHEMA_OPTIONS_BASE_H__ -#define __DIALOG_EESCHEMA_OPTIONS_BASE_H__ - -#include -#include -#include -#include "widgets/stepped_slider.h" -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_EESCHEMA_OPTIONS_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM -{ - DECLARE_EVENT_TABLE() - private: - - // Private event handlers - void _wxFB_OnSize( wxSizeEvent& event ){ OnSize( event ); } - void _wxFB_OnScaleSlider( wxScrollEvent& event ){ OnScaleSlider( event ); } - void _wxFB_OnScaleAuto( wxCommandEvent& event ){ OnScaleAuto( event ); } - void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); } - void _wxFB_OnAddButtonClick( wxCommandEvent& event ){ OnAddButtonClick( event ); } - void _wxFB_OnDeleteButtonClick( wxCommandEvent& event ){ OnDeleteButtonClick( event ); } - - - protected: - enum - { - ID_M_SPINAUTOSAVEINTERVAL = 1000, - xwID_ANY, - wxID_ADD_FIELD, - wxID_DELETE_FIELD - }; - - wxNotebook* m_notebook; - wxPanel* m_panel5; - wxStaticText* m_staticText3; - wxChoice* m_choiceGridSize; - wxStaticText* m_staticGridUnits; - wxStaticText* m_staticText51; - wxSpinCtrl* m_spinBusWidth; - wxStaticText* m_staticBusWidthUnits; - wxStaticText* m_staticText5; - wxSpinCtrl* m_spinLineWidth; - wxStaticText* m_staticLineWidthUnits; - wxStaticText* m_staticText26; - wxChoice* m_choiceSeparatorRefId; - wxStaticText* m_stIconScale; - STEPPED_SLIDER* m_scaleSlider; - wxStaticText* m_staticText211; - wxCheckBox* m_scaleAuto; - wxStaticLine* m_staticline3; - wxCheckBox* m_checkShowGrid; - wxCheckBox* m_checkHVOrientation; - wxCheckBox* m_checkShowHiddenPins; - wxCheckBox* m_checkPageLimits; - wxCheckBox* m_footprintPreview; - wxPanel* m_panel3; - wxStaticText* m_staticText2; - wxChoice* m_choiceUnits; - wxStaticText* m_staticTextHpitch; - wxSpinCtrl* m_spinRepeatHorizontal; - wxStaticText* m_staticRepeatXUnits; - wxStaticText* m_staticTextVpitch; - wxSpinCtrl* m_spinRepeatVertical; - wxStaticText* m_staticRepeatYUnits; - wxStaticText* m_staticText16; - wxSpinCtrl* m_spinRepeatLabel; - wxStaticText* m_staticTextTsize; - wxSpinCtrl* m_spinTextSize; - wxStaticText* m_staticTextSizeUnits; - wxStaticText* m_staticTextTimeInterval; - wxSpinCtrl* m_spinAutoSaveInterval; - wxStaticText* m_staticText23; - wxStaticLine* m_staticline2; - wxCheckBox* m_checkAutoplaceFields; - wxCheckBox* m_checkAutoplaceJustify; - wxCheckBox* m_checkAutoplaceAlign; - wxPanel* m_tabControls; - wxBoxSizer* m_controlsSizer; - wxStaticText* m_staticText20; - wxStaticText* m_staticText21; - wxPanel* m_panelHotkeys; - wxCheckBox* m_checkEnableZoomCenter; - wxCheckBox* m_checkEnableMousewheelPan; - wxCheckBox* m_checkAutoPan; - wxPanel* m_tabColors; - wxPanel* m_panelColors; - wxPanel* m_panel2; - wxGrid* m_fieldGrid; - wxButton* addFieldButton; - wxButton* deleteFieldButton; - wxStdDialogButtonSizer* m_sdbSizer; - wxButton* m_sdbSizerOK; - wxButton* m_sdbSizerCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnSize( wxSizeEvent& event ) { event.Skip(); } - virtual void OnScaleSlider( wxScrollEvent& event ) { event.Skip(); } - virtual void OnScaleAuto( wxCommandEvent& event ) { event.Skip(); } - virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); } - virtual void OnAddButtonClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnDeleteButtonClick( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_EESCHEMA_OPTIONS_BASE(); - -}; - -#endif //__DIALOG_EESCHEMA_OPTIONS_BASE_H__ diff --git a/eeschema/dialogs/dialog_libedit_options.cpp b/eeschema/dialogs/dialog_libedit_options.cpp deleted file mode 100644 index 59c0f495e5..0000000000 --- a/eeschema/dialogs/dialog_libedit_options.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2009 Wayne Stambaugh - * Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file dialog_libedit_options.cpp - */ - -#include -#include - -#include -#include - - -DIALOG_LIBEDIT_OPTIONS::DIALOG_LIBEDIT_OPTIONS( LIB_EDIT_FRAME* parent ) : - DIALOG_LIBEDIT_OPTIONS_BASE( parent ), - m_last_scale( -1 ) -{ - m_sdbSizerOK->SetDefault(); - - SetRepeatLabelInc( Parent()->GetRepeatDeltaLabel() ); - SetItemRepeatStep( Parent()->GetRepeatStep() ); - SetPinRepeatStep( Parent()->GetRepeatPinStep() ); - - m_scaleSlider->SetStep( 25 ); - - // Now all widgets have the size fixed, call FinishDialogSettings - FinishDialogSettings(); -} - - -void DIALOG_LIBEDIT_OPTIONS::OnScaleSlider( wxScrollEvent& aEvent ) -{ - m_scaleAuto->SetValue( false ); -} - - -void DIALOG_LIBEDIT_OPTIONS::OnScaleAuto( wxCommandEvent& aEvent ) -{ - if( m_scaleAuto->GetValue() ) - { - m_last_scale = m_scaleSlider->GetValue(); - m_scaleSlider->SetValue( 25 * KiIconScale( GetParent() ) ); - } - else - { - if( m_last_scale >= 0 ) - m_scaleSlider->SetValue( m_last_scale ); - } -} - - -bool DIALOG_LIBEDIT_OPTIONS::TransferDataToWindow() -{ - if( !wxDialog::TransferDataToWindow() ) - return false; - - const auto parent = static_cast( GetParent() ); - const int scale_fourths = parent->GetIconScale(); - - if( scale_fourths <= 0 ) - { - m_scaleAuto->SetValue( true ); - m_scaleSlider->SetValue( 25 * KiIconScale( GetParent() ) ); - } - else - { - m_scaleAuto->SetValue( false ); - m_scaleSlider->SetValue( scale_fourths * 25 ); - } - - return true; -} - - -bool DIALOG_LIBEDIT_OPTIONS::TransferDataFromWindow() -{ - if( !wxDialog::TransferDataFromWindow() ) - return false; - - const int scale_fourths = m_scaleAuto->GetValue() ? -1 : m_scaleSlider->GetValue() / 25; - const auto parent = static_cast( GetParent() ); - - if( parent->GetIconScale() != scale_fourths ) - parent->SetIconScale( scale_fourths ); - - return true; -} - - -void DIALOG_LIBEDIT_OPTIONS::SetGridSizes( const GRIDS& grid_sizes, int grid_id ) -{ - wxASSERT( grid_sizes.size() > 0 ); - - int select = wxNOT_FOUND; - - for( size_t i = 0; i < grid_sizes.size(); i++ ) - { - wxString tmp; - tmp.Printf( wxT( "%0.1f" ), grid_sizes[i].m_Size.x ); - m_choiceGridSize->Append( tmp ); - - if( grid_sizes[i].m_CmdId == grid_id ) - select = (int) i; - } - - m_choiceGridSize->SetSelection( select ); -} diff --git a/eeschema/dialogs/dialog_libedit_options.h b/eeschema/dialogs/dialog_libedit_options.h deleted file mode 100644 index 2d02903a70..0000000000 --- a/eeschema/dialogs/dialog_libedit_options.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2009 Wayne Stambaugh - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file dialog_libedit_options.h - * - * Subclass of DIALOG_LIBEDIT_OPTIONS_BASE, which is generated by wxFormBuilder. - */ - -#ifndef __DIALOG_LIBEDIT_OPTIONS__ -#define __DIALOG_LIBEDIT_OPTIONS__ - -#include - -class LIB_EDIT_FRAME; - -class DIALOG_LIBEDIT_OPTIONS : public DIALOG_LIBEDIT_OPTIONS_BASE -{ -public: - DIALOG_LIBEDIT_OPTIONS( LIB_EDIT_FRAME* parent ); - - LIB_EDIT_FRAME* Parent() { return (LIB_EDIT_FRAME*) GetParent(); } - - void SetGridSelection( int select ) { m_choiceGridSize->SetSelection( select ); } - int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); } - void SetGridSizes( const GRIDS& grid_sizes, int grid_id ); - - void SetShowGrid( bool show ) { m_checkShowGrid->SetValue( show ); } - bool GetShowGrid( void ) { return m_checkShowGrid->GetValue(); } - - void SetLineWidth( int aWidth ) { m_spinLineWidth->SetValue( aWidth ); } - int GetLineWidth( void ) { return m_spinLineWidth->GetValue(); } - - void SetPinLength( int aLength ) { m_spinPinLength->SetValue( aLength ); } - int GetPinLength( void ) { return m_spinPinLength->GetValue(); } - - void SetPinNumSize( int text_size ) { m_spinPinNumSize->SetValue( text_size ); } - int GetPinNumSize( void ) { return m_spinPinNumSize->GetValue(); } - - void SetPinNameSize( int text_size ) { m_spinPinNameSize->SetValue( text_size ); } - int GetPinNameSize( void ) { return m_spinPinNameSize->GetValue(); } - - void SetPinRepeatStep( int aValue ) { m_choicePinDisplacement->SetSelection( aValue == 50 ? 1 : 0 ); } - int GetPinRepeatStep( void ) - { - return m_choicePinDisplacement->GetSelection() == 1 ? 50 : 100; - } - - void SetItemRepeatStep( wxPoint aValue ) - { - m_spinRepeatHorizontal->SetValue( aValue.x ); - m_spinRepeatVertical->SetValue( aValue.y ); - } - wxPoint GetItemRepeatStep( void ) - { - wxPoint step; - step.x = m_spinRepeatHorizontal->GetValue(); - step.y = m_spinRepeatVertical->GetValue(); - return step; - } - - void SetRepeatLabelInc( int aValue ) { m_spinRepeatLabel->SetValue( aValue ); } - int GetRepeatLabelInc( void ) - { - return m_spinRepeatLabel->GetValue(); - } - - void SetShowElectricalType( bool show ) { m_checkShowPinElectricalType->SetValue( show ); } - bool GetShowElectricalType( void ) - { - return m_checkShowPinElectricalType->GetValue(); - } - -protected: - void OnScaleSlider( wxScrollEvent& aEvent ) override; - void OnScaleAuto( wxCommandEvent& aEvent ) override; - bool TransferDataToWindow() override; - bool TransferDataFromWindow() override; - -private: - int m_last_scale; -}; - -#endif // __DIALOG_LIBEDIT_OPTIONS__ diff --git a/eeschema/dialogs/dialog_libedit_options_base.cpp b/eeschema/dialogs/dialog_libedit_options_base.cpp deleted file mode 100644 index 2f4ccaf0b6..0000000000 --- a/eeschema/dialogs/dialog_libedit_options_base.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jan 2 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_libedit_options_base.h" - -/////////////////////////////////////////////////////////////////////////// - -BEGIN_EVENT_TABLE( DIALOG_LIBEDIT_OPTIONS_BASE, DIALOG_SHIM ) - EVT_SCROLL( DIALOG_LIBEDIT_OPTIONS_BASE::_wxFB_OnScaleSlider ) - EVT_CHECKBOX( wxID_ANY, DIALOG_LIBEDIT_OPTIONS_BASE::_wxFB_OnScaleAuto ) -END_EVENT_TABLE() - -DIALOG_LIBEDIT_OPTIONS_BASE::DIALOG_LIBEDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* mainSizer; - mainSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bOptionsSizer; - bOptionsSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* p1mainSizer; - p1mainSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer3; - bSizer3 = new wxBoxSizer( wxVERTICAL ); - - wxFlexGridSizer* fgSizer; - fgSizer = new wxFlexGridSizer( 0, 3, 0, 0 ); - fgSizer->AddGrowableCol( 0 ); - fgSizer->AddGrowableCol( 1 ); - fgSizer->AddGrowableCol( 2 ); - fgSizer->SetFlexibleDirection( wxBOTH ); - fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticText3 = new wxStaticText( this, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText3->Wrap( -1 ); - fgSizer->Add( m_staticText3, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - wxArrayString m_choiceGridSizeChoices; - m_choiceGridSize = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceGridSizeChoices, 0 ); - m_choiceGridSize->SetSelection( 0 ); - fgSizer->Add( m_choiceGridSize, 0, wxEXPAND|wxALL, 3 ); - - m_staticGridUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticGridUnits->Wrap( -1 ); - fgSizer->Add( m_staticGridUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_staticText5 = new wxStaticText( this, wxID_ANY, _("&Default line width:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText5->Wrap( -1 ); - fgSizer->Add( m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_spinLineWidth = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 6 ); - fgSizer->Add( m_spinLineWidth, 0, wxALL|wxEXPAND, 3 ); - - m_staticLineWidthUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticLineWidthUnits->Wrap( -1 ); - fgSizer->Add( m_staticLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_staticText52 = new wxStaticText( this, wxID_ANY, _("D&efault pin length:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText52->Wrap( -1 ); - fgSizer->Add( m_staticText52, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 ); - - m_spinPinLength = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 50, 1000, 200 ); - fgSizer->Add( m_spinPinLength, 0, wxALL|wxEXPAND, 3 ); - - m_staticPinLengthUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticPinLengthUnits->Wrap( -1 ); - fgSizer->Add( m_staticPinLengthUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 ); - - m_staticText7 = new wxStaticText( this, wxID_ANY, _("De&fault pin number size:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText7->Wrap( -1 ); - fgSizer->Add( m_staticText7, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_spinPinNumSize = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 1000, 0 ); - fgSizer->Add( m_spinPinNumSize, 0, wxALL|wxEXPAND, 3 ); - - m_staticTextSizeUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextSizeUnits->Wrap( -1 ); - fgSizer->Add( m_staticTextSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_staticText9 = new wxStaticText( this, wxID_ANY, _("Def&ault pin name size:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText9->Wrap( -1 ); - fgSizer->Add( m_staticText9, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_spinPinNameSize = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 0 ); - fgSizer->Add( m_spinPinNameSize, 0, wxALL|wxEXPAND, 3 ); - - m_staticRepeatXUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticRepeatXUnits->Wrap( -1 ); - fgSizer->Add( m_staticRepeatXUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - m_staticText11 = new wxStaticText( this, wxID_ANY, _("&Horizontal pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText11->Wrap( -1 ); - fgSizer->Add( m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_spinRepeatHorizontal = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -1000, 1000, 0 ); - fgSizer->Add( m_spinRepeatHorizontal, 0, wxALL|wxEXPAND, 5 ); - - m_staticText12 = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText12->Wrap( -1 ); - fgSizer->Add( m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_staticText13 = new wxStaticText( this, wxID_ANY, _("&Vertical pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText13->Wrap( -1 ); - fgSizer->Add( m_staticText13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_spinRepeatVertical = new wxSpinCtrl( this, wxID_ANY, wxT("100"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -1000, 1000, 0 ); - fgSizer->Add( m_spinRepeatVertical, 0, wxALL|wxEXPAND, 5 ); - - m_staticText14 = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText14->Wrap( -1 ); - fgSizer->Add( m_staticText14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_staticText15 = new wxStaticText( this, wxID_ANY, _("&Pitch of repeated pins:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText15->Wrap( -1 ); - fgSizer->Add( m_staticText15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxString m_choicePinDisplacementChoices[] = { _("100"), _("50") }; - int m_choicePinDisplacementNChoices = sizeof( m_choicePinDisplacementChoices ) / sizeof( wxString ); - m_choicePinDisplacement = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choicePinDisplacementNChoices, m_choicePinDisplacementChoices, 0 ); - m_choicePinDisplacement->SetSelection( 0 ); - fgSizer->Add( m_choicePinDisplacement, 0, wxALL|wxEXPAND, 5 ); - - m_staticText16 = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText16->Wrap( -1 ); - fgSizer->Add( m_staticText16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_staticText17 = new wxStaticText( this, wxID_ANY, _("&Increment of repeated labels:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText17->Wrap( -1 ); - fgSizer->Add( m_staticText17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_spinRepeatLabel = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -10, 10, 1 ); - fgSizer->Add( m_spinRepeatLabel, 0, wxALL|wxEXPAND, 5 ); - - - fgSizer->Add( 0, 0, 0, 0, 5 ); - - m_staticText18 = new wxStaticText( this, wxID_ANY, _("Icon scale:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText18->Wrap( -1 ); - fgSizer->Add( m_staticText18, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_scaleSlider = new STEPPED_SLIDER( this, wxID_ANY, 50, 50, 275, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS ); - fgSizer->Add( m_scaleSlider, 0, wxALL|wxEXPAND, 5 ); - - m_staticText19 = new wxStaticText( this, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText19->Wrap( -1 ); - fgSizer->Add( m_staticText19, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_scaleAuto = new wxCheckBox( this, wxID_ANY, _("Auto"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer->Add( m_scaleAuto, 0, wxALL, 5 ); - - - fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); - - - bSizer3->Add( fgSizer, 0, wxEXPAND, 0 ); - - wxBoxSizer* bSizer2; - bSizer2 = new wxBoxSizer( wxVERTICAL ); - - m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer2->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 ); - - m_checkShowGrid = new wxCheckBox( this, wxID_ANY, _("&Show grid"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer2->Add( m_checkShowGrid, 0, wxEXPAND|wxALL, 3 ); - - m_checkShowPinElectricalType = new wxCheckBox( this, wxID_ANY, _("Show pin &electrical type"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer2->Add( m_checkShowPinElectricalType, 0, wxALL, 3 ); - - - bSizer3->Add( bSizer2, 0, wxEXPAND, 0 ); - - - p1mainSizer->Add( bSizer3, 1, wxALL|wxEXPAND, 6 ); - - - bOptionsSizer->Add( p1mainSizer, 1, wxEXPAND, 5 ); - - m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bOptionsSizer->Add( m_staticline2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - m_sdbSizer = new wxStdDialogButtonSizer(); - m_sdbSizerOK = new wxButton( this, wxID_OK ); - m_sdbSizer->AddButton( m_sdbSizerOK ); - m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); - m_sdbSizer->AddButton( m_sdbSizerCancel ); - m_sdbSizer->Realize(); - - bOptionsSizer->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 6 ); - - - mainSizer->Add( bOptionsSizer, 1, wxEXPAND, 12 ); - - - this->SetSizer( mainSizer ); - this->Layout(); - mainSizer->Fit( this ); - - this->Centre( wxBOTH ); -} - -DIALOG_LIBEDIT_OPTIONS_BASE::~DIALOG_LIBEDIT_OPTIONS_BASE() -{ -} diff --git a/eeschema/dialogs/dialog_libedit_options_base.fbp b/eeschema/dialogs/dialog_libedit_options_base.fbp deleted file mode 100644 index bc677c71a6..0000000000 --- a/eeschema/dialogs/dialog_libedit_options_base.fbp +++ /dev/null @@ -1,3120 +0,0 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - table - dialog_libedit_options_base - 1000 - none - 1 - dialog_libedit_options - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - wxBOTH - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - DIALOG_LIBEDIT_OPTIONS_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Library Editor Options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mainSizer - wxVERTICAL - none - - 12 - wxEXPAND - 1 - - - bOptionsSizer - wxVERTICAL - none - - 5 - wxEXPAND - 1 - - - p1mainSizer - wxHORIZONTAL - none - - 6 - wxALL|wxEXPAND - 1 - - - bSizer3 - wxVERTICAL - none - - 0 - wxEXPAND - 0 - - 3 - wxBOTH - 0,1,2 - - 0 - - fgSizer - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Grid size: - - 0 - - - 0 - - 1 - m_staticText3 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceGridSize - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticGridUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Default line width: - - 0 - - - 0 - - 1 - m_staticText5 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 6 - 100 - - 0 - - 1 - - 0 - - 1 - m_spinLineWidth - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticLineWidthUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - D&efault pin length: - - 0 - - - 0 - - 1 - m_staticText52 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 200 - 1000 - - 0 - - 50 - - 0 - - 1 - m_spinPinLength - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticPinLengthUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - De&fault pin number size: - - 0 - - - 0 - - 1 - m_staticText7 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 0 - 1000 - - 0 - - 0 - - 0 - - 1 - m_spinPinNumSize - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticTextSizeUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Def&ault pin name size: - - 0 - - - 0 - - 1 - m_staticText9 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 0 - 5000 - - 0 - - -5000 - - 0 - - 1 - m_spinPinNameSize - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticRepeatXUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Horizontal pitch of repeated items: - - 0 - - - 0 - - 1 - m_staticText11 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 0 - 1000 - - 0 - - -1000 - - 0 - - 1 - m_spinRepeatHorizontal - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticText12 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Vertical pitch of repeated items: - - 0 - - - 0 - - 1 - m_staticText13 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 0 - 1000 - - 0 - - -1000 - - 0 - - 1 - m_spinRepeatVertical - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS - - 0 - - 100 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticText14 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Pitch of repeated pins: - - 0 - - - 0 - - 1 - m_staticText15 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "100" "50" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choicePinDisplacement - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - - 0 - - - 0 - - 1 - m_staticText16 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Increment of repeated labels: - - 0 - - - 0 - - 1 - m_staticText17 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 1 - 10 - - 0 - - -10 - - 0 - - 1 - m_spinRepeatLabel - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 0 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Icon scale: - - 0 - - - 0 - - 1 - m_staticText18 - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 275 - - 0 - - 50 - - 0 - - 1 - m_scaleSlider - 1 - - - protected - 1 - - Resizable - 1 - - wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS - STEPPED_SLIDER; widgets/stepped_slider.h; Not forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 50 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnScaleSlider - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - % - - 0 - - - 0 - - 1 - m_staticText19 - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Auto - - 0 - - - 0 - - 1 - m_scaleAuto - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - OnScaleAuto - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - - - 0 - wxEXPAND - 0 - - - bSizer2 - wxVERTICAL - none - - 5 - wxEXPAND | wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline3 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxEXPAND|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Show grid - - 0 - - - 0 - - 1 - m_checkShowGrid - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show pin &electrical type - - 0 - - - 0 - - 1 - m_checkShowPinElectricalType - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline2 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - wxALL|wxEXPAND - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer - protected - - - - - - - - - - - - - - - - diff --git a/eeschema/dialogs/dialog_libedit_options_base.h b/eeschema/dialogs/dialog_libedit_options_base.h deleted file mode 100644 index 2f18b6b29d..0000000000 --- a/eeschema/dialogs/dialog_libedit_options_base.h +++ /dev/null @@ -1,98 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jan 2 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __DIALOG_LIBEDIT_OPTIONS_BASE_H__ -#define __DIALOG_LIBEDIT_OPTIONS_BASE_H__ - -#include -#include -#include -#include "widgets/stepped_slider.h" -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_LIBEDIT_OPTIONS_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_LIBEDIT_OPTIONS_BASE : public DIALOG_SHIM -{ - DECLARE_EVENT_TABLE() - private: - - // Private event handlers - void _wxFB_OnScaleSlider( wxScrollEvent& event ){ OnScaleSlider( event ); } - void _wxFB_OnScaleAuto( wxCommandEvent& event ){ OnScaleAuto( event ); } - - - protected: - wxStaticText* m_staticText3; - wxChoice* m_choiceGridSize; - wxStaticText* m_staticGridUnits; - wxStaticText* m_staticText5; - wxSpinCtrl* m_spinLineWidth; - wxStaticText* m_staticLineWidthUnits; - wxStaticText* m_staticText52; - wxSpinCtrl* m_spinPinLength; - wxStaticText* m_staticPinLengthUnits; - wxStaticText* m_staticText7; - wxSpinCtrl* m_spinPinNumSize; - wxStaticText* m_staticTextSizeUnits; - wxStaticText* m_staticText9; - wxSpinCtrl* m_spinPinNameSize; - wxStaticText* m_staticRepeatXUnits; - wxStaticText* m_staticText11; - wxSpinCtrl* m_spinRepeatHorizontal; - wxStaticText* m_staticText12; - wxStaticText* m_staticText13; - wxSpinCtrl* m_spinRepeatVertical; - wxStaticText* m_staticText14; - wxStaticText* m_staticText15; - wxChoice* m_choicePinDisplacement; - wxStaticText* m_staticText16; - wxStaticText* m_staticText17; - wxSpinCtrl* m_spinRepeatLabel; - wxStaticText* m_staticText18; - STEPPED_SLIDER* m_scaleSlider; - wxStaticText* m_staticText19; - wxCheckBox* m_scaleAuto; - wxStaticLine* m_staticline3; - wxCheckBox* m_checkShowGrid; - wxCheckBox* m_checkShowPinElectricalType; - wxStaticLine* m_staticline2; - wxStdDialogButtonSizer* m_sdbSizer; - wxButton* m_sdbSizerOK; - wxButton* m_sdbSizerCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnScaleSlider( wxScrollEvent& event ) { event.Skip(); } - virtual void OnScaleAuto( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_LIBEDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Library Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_LIBEDIT_OPTIONS_BASE(); - -}; - -#endif //__DIALOG_LIBEDIT_OPTIONS_BASE_H__ diff --git a/eeschema/dialogs/panel_eeschema_display_options.cpp b/eeschema/dialogs/panel_eeschema_display_options.cpp new file mode 100644 index 0000000000..5871fbb566 --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_display_options.cpp @@ -0,0 +1,114 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Wayne Stambaugh + * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include + + +PANEL_EESCHEMA_DISPLAY_OPTIONS::PANEL_EESCHEMA_DISPLAY_OPTIONS( SCH_EDIT_FRAME* aFrame, + wxWindow* aWindow ) : + PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( aWindow ), + m_frame( aFrame ) +{} + + +bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow() +{ + const GRIDS& gridSizes = m_frame->GetScreen()->GetGrids(); + + for( size_t i = 0; i < gridSizes.size(); i++ ) + { + m_choiceGridSize->Append( wxString::Format( wxT( "%0.1f" ), gridSizes[i].m_Size.x ) ); + + if( gridSizes[i].m_CmdId == m_frame->GetScreen()->GetGridCmdId() ) + m_choiceGridSize->SetSelection( (int) i ); + } + + // Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1" + int refStyleSelection; + + switch( LIB_PART::GetSubpartIdSeparator() ) + { + default: + case 0: refStyleSelection = 0; break; + case '.': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 4 : 1; break; + case '-': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 5 : 2; break; + case '_': refStyleSelection = LIB_PART::GetSubpartFirstId() == '1' ? 6 : 3; break; + } + + m_choiceSeparatorRefId->SetSelection( refStyleSelection ); + + m_busWidthCtrl->SetValue( StringFromValue( INCHES, GetDefaultBusThickness(), false, true ) ); + m_lineWidthCtrl->SetValue( StringFromValue( INCHES, GetDefaultLineThickness(), false, true ) ); + m_checkShowGrid->SetValue( m_frame->IsGridVisible() ); + m_checkShowHiddenPins->SetValue( m_frame->GetShowAllPins() ); + m_checkPageLimits->SetValue( m_frame->ShowPageLimits() ); + m_footprintPreview->SetValue( m_frame->GetFootprintPreview() ); + + return true; +} + + +bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow() +{ + const GRIDS& gridSizes = m_frame->GetScreen()->GetGrids(); + wxRealPoint gridsize = gridSizes[ (size_t) m_choiceGridSize->GetSelection() ].m_Size; + m_frame->SetLastGridSizeId( m_frame->GetScreen()->SetGrid( gridsize ) ); + m_frame->SetGridVisibility( m_checkShowGrid->GetValue() ); + + // Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1" + int firstRefId, refSeparator; + + switch( m_choiceSeparatorRefId->GetSelection() ) + { + default: + case 0: firstRefId = 'A'; refSeparator = 0; break; + case 1: firstRefId = 'A'; refSeparator = '.'; break; + case 2: firstRefId = 'A'; refSeparator = '-'; break; + case 3: firstRefId = 'A'; refSeparator = '_'; break; + case 4: firstRefId = '1'; refSeparator = '.'; break; + case 5: firstRefId = '1'; refSeparator = '-'; break; + case 6: firstRefId = '1'; refSeparator = '_'; break; + } + + if( refSeparator != LIB_PART::GetSubpartIdSeparator() || + firstRefId != LIB_PART::GetSubpartFirstId() ) + { + LIB_PART::SetSubpartIdNotation( refSeparator, firstRefId ); + m_frame->SaveProjectSettings( false ); + } + + SetDefaultBusThickness( ValueFromString( INCHES, m_busWidthCtrl->GetValue(), true ) ); + SetDefaultLineThickness( ValueFromString( INCHES, m_lineWidthCtrl->GetValue(), true ) ); + m_frame->SetShowAllPins( m_checkShowHiddenPins->GetValue() ); + m_frame->SetShowPageLimits( m_checkPageLimits->GetValue() ); + m_frame->SetFootprintPreview( m_footprintPreview->GetValue() ); + + return true; +} + + diff --git a/eeschema/dialogs/panel_eeschema_display_options.h b/eeschema/dialogs/panel_eeschema_display_options.h new file mode 100644 index 0000000000..2ad4ad2bc8 --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_display_options.h @@ -0,0 +1,41 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef KICAD_PANEL_EESCHEMA_DISPLAY_OPTIONS_H +#define KICAD_PANEL_EESCHEMA_DISPLAY_OPTIONS_H + +#include "panel_eeschema_display_options_base.h" + +class SCH_EDIT_FRAME; + + +class PANEL_EESCHEMA_DISPLAY_OPTIONS : public PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE +{ + SCH_EDIT_FRAME* m_frame; + +public: + PANEL_EESCHEMA_DISPLAY_OPTIONS( SCH_EDIT_FRAME* aFrame, wxWindow* aWindow ); + +private: + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; +}; + + +#endif //KICAD_PANEL_EESCHEMA_DISPLAY_OPTIONS_H diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.cpp b/eeschema/dialogs/panel_eeschema_display_options_base.cpp new file mode 100644 index 0000000000..6167beed20 --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_display_options_base.cpp @@ -0,0 +1,128 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_eeschema_display_options_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bPanelSizer; + bPanelSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bLeftColumn; + bLeftColumn = new wxBoxSizer( wxVERTICAL ); + + wxFlexGridSizer* fgSizer32; + fgSizer32 = new wxFlexGridSizer( 0, 3, 0, 0 ); + fgSizer32->AddGrowableCol( 1 ); + fgSizer32->SetFlexibleDirection( wxBOTH ); + fgSizer32->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticText3 = new wxStaticText( this, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText3->Wrap( -1 ); + fgSizer32->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + wxArrayString m_choiceGridSizeChoices; + m_choiceGridSize = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceGridSizeChoices, 0 ); + m_choiceGridSize->SetSelection( 0 ); + fgSizer32->Add( m_choiceGridSize, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_staticGridUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticGridUnits->Wrap( -1 ); + fgSizer32->Add( m_staticGridUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + + fgSizer32->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + + fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_busWidthLabel = new wxStaticText( this, wxID_ANY, _("&Bus thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_busWidthLabel->Wrap( -1 ); + fgSizer32->Add( m_busWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_busWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + fgSizer32->Add( m_busWidthCtrl, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_busWidthUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_busWidthUnits->Wrap( -1 ); + fgSizer32->Add( m_busWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_lineWidthLabel = new wxStaticText( this, wxID_ANY, _("&Line thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lineWidthLabel->Wrap( -1 ); + fgSizer32->Add( m_lineWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_lineWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + fgSizer32->Add( m_lineWidthCtrl, 0, wxEXPAND|wxBOTTOM, 5 ); + + m_lineWidthUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lineWidthUnits->Wrap( -1 ); + fgSizer32->Add( m_lineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + fgSizer32->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + + fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticText26 = new wxStaticText( this, wxID_ANY, _("&Part ID notation:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText26->Wrap( -1 ); + fgSizer32->Add( m_staticText26, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + wxString m_choiceSeparatorRefIdChoices[] = { _("A"), _(".A"), _("-A"), _("_A"), _(".1"), _("-1"), _("_1") }; + int m_choiceSeparatorRefIdNChoices = sizeof( m_choiceSeparatorRefIdChoices ) / sizeof( wxString ); + m_choiceSeparatorRefId = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceSeparatorRefIdNChoices, m_choiceSeparatorRefIdChoices, 0 ); + m_choiceSeparatorRefId->SetSelection( 0 ); + fgSizer32->Add( m_choiceSeparatorRefId, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + + fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 ); + + + bLeftColumn->Add( fgSizer32, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + wxBoxSizer* bSizer92; + bSizer92 = new wxBoxSizer( wxVERTICAL ); + + m_checkShowGrid = new wxCheckBox( this, wxID_ANY, _("&Show grid"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer92->Add( m_checkShowGrid, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_checkShowHiddenPins = new wxCheckBox( this, wxID_ANY, _("S&how hidden pins"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer92->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_checkPageLimits = new wxCheckBox( this, wxID_ANY, _("Show page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkPageLimits->SetValue(true); + bSizer92->Add( m_checkPageLimits, 0, wxEXPAND|wxALL, 5 ); + + + bSizer92->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_footprintPreview = new wxCheckBox( this, wxID_ANY, _("Show footprint previews in symbol chooser (experimental)"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer92->Add( m_footprintPreview, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); + + + bLeftColumn->Add( bSizer92, 0, wxTOP|wxRIGHT, 5 ); + + + bPanelSizer->Add( bLeftColumn, 0, wxTOP|wxLEFT|wxEXPAND, 10 ); + + + this->SetSizer( bPanelSizer ); + this->Layout(); + bPanelSizer->Fit( this ); +} + +PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::~PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE() +{ +} diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.fbp b/eeschema/dialogs/panel_eeschema_display_options_base.fbp new file mode 100644 index 0000000000..e8f4d0e964 --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_display_options_base.fbp @@ -0,0 +1,1500 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + table + panel_eeschema_display_options_base + 1000 + none + 1 + PanelEeschemaDisplayOptions + + . + + 1 + 1 + 1 + 1 + UI + 1 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE + + -1,-1 + ; forward_declare + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bPanelSizer + wxVERTICAL + none + + 10 + wxTOP|wxLEFT|wxEXPAND + 0 + + + bLeftColumn + wxVERTICAL + none + + 5 + wxTOP|wxBOTTOM|wxRIGHT + 0 + + 3 + wxBOTH + 1 + + 0 + -1,-1 + fgSizer32 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Grid size: + + 0 + + + 0 + + 1 + m_staticText3 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceGridSize + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_staticGridUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Bus thickness: + + 0 + + + 0 + + 1 + m_busWidthLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_busWidthCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_busWidthUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Line thickness: + + 0 + + + 0 + + 1 + m_lineWidthLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_lineWidthCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_lineWidthUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Part ID notation: + + 0 + + + 0 + + 1 + m_staticText26 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "A" ".A" "-A" "_A" ".1" "-1" "_1" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceSeparatorRefId + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + + + 5 + wxTOP|wxRIGHT + 0 + + + bSizer92 + wxVERTICAL + none + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Show grid + + 0 + + + 0 + + 1 + m_checkShowGrid + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + S&how hidden pins + + 0 + + + 0 + + 1 + m_checkShowHiddenPins + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show page limi&ts + + 0 + + + 0 + + 1 + m_checkPageLimits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show footprint previews in symbol chooser (experimental) + + 0 + + + 0 + + 1 + m_footprintPreview + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.h b/eeschema/dialogs/panel_eeschema_display_options_base.h new file mode 100644 index 0000000000..7cb492c206 --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_display_options_base.h @@ -0,0 +1,59 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE_H__ +#define __PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public wxPanel +{ + private: + + protected: + wxStaticText* m_staticText3; + wxChoice* m_choiceGridSize; + wxStaticText* m_staticGridUnits; + wxStaticText* m_busWidthLabel; + wxTextCtrl* m_busWidthCtrl; + wxStaticText* m_busWidthUnits; + wxStaticText* m_lineWidthLabel; + wxTextCtrl* m_lineWidthCtrl; + wxStaticText* m_lineWidthUnits; + wxStaticText* m_staticText26; + wxChoice* m_choiceSeparatorRefId; + wxCheckBox* m_checkShowGrid; + wxCheckBox* m_checkShowHiddenPins; + wxCheckBox* m_checkPageLimits; + wxCheckBox* m_footprintPreview; + + public: + + PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE(); + +}; + +#endif //__PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE_H__ diff --git a/eeschema/dialogs/panel_eeschema_settings.cpp b/eeschema/dialogs/panel_eeschema_settings.cpp new file mode 100644 index 0000000000..0570ab063c --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_settings.cpp @@ -0,0 +1,81 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Wayne Stambaugh + * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include + +#include "panel_eeschema_settings.h" + + +PANEL_EESCHEMA_SETTINGS::PANEL_EESCHEMA_SETTINGS( SCH_EDIT_FRAME* aFrame, wxWindow* aWindow ) : + PANEL_EESCHEMA_SETTINGS_BASE( aWindow ), + m_frame( aFrame ) +{} + + +bool PANEL_EESCHEMA_SETTINGS::TransferDataToWindow() +{ + m_choiceUnits->SetSelection( m_frame->GetUserUnits() == INCHES ? 0 : 1 ); + + m_textSizeCtrl->SetValue( StringFromValue( INCHES, GetDefaultTextSize(), false, true ) ); + m_hPitchCtrl->SetValue( StringFromValue( INCHES, m_frame->GetRepeatStep().x, false, true ) ); + m_vPitchCtrl->SetValue( StringFromValue( INCHES, m_frame->GetRepeatStep().y, false, true ) ); + m_spinRepeatLabel->SetValue( m_frame->GetRepeatDeltaLabel() ); + + m_checkHVOrientation->SetValue( m_frame->GetForceHVLines() ); + m_checkAutoplaceFields->SetValue( m_frame->GetAutoplaceFields() ); + m_checkAutoplaceJustify->SetValue( m_frame->GetAutoplaceJustify() ); + m_checkAutoplaceAlign->SetValue( m_frame->GetAutoplaceAlign() ); + + return true; +} + + +bool PANEL_EESCHEMA_SETTINGS::TransferDataFromWindow() +{ + m_frame->SetUserUnits( m_choiceUnits->GetSelection() == 0 ? INCHES : MILLIMETRES ); + g_UserUnit = m_frame->GetUserUnits(); // JEY TODO: double-up while in transition... + + int textSize = ValueFromString( INCHES, m_textSizeCtrl->GetValue(), true ); + + if( textSize != GetDefaultTextSize() ) + { + SetDefaultTextSize( textSize ); + m_frame->SaveProjectSettings( false ); + } + + m_frame->SetRepeatStep( wxPoint( ValueFromString( INCHES, m_hPitchCtrl->GetValue(), true ), + ValueFromString( INCHES, m_vPitchCtrl->GetValue(), true ) ) ); + m_frame->SetRepeatDeltaLabel( m_spinRepeatLabel->GetValue() ); + + m_frame->SetForceHVLines( m_checkHVOrientation->GetValue() ); + m_frame->SetAutoplaceFields( m_checkAutoplaceFields->GetValue() ); + m_frame->SetAutoplaceJustify( m_checkAutoplaceJustify->GetValue() ); + m_frame->SetAutoplaceAlign( m_checkAutoplaceAlign->GetValue() ); + + return true; +} + + diff --git a/eeschema/dialogs/panel_eeschema_settings.h b/eeschema/dialogs/panel_eeschema_settings.h new file mode 100644 index 0000000000..c07b308878 --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_settings.h @@ -0,0 +1,41 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef KICAD_PANEL_EESCHEMA_SETTINGS_H +#define KICAD_PANEL_EESCHEMA_SETTINGS_H + +#include "panel_eeschema_settings_base.h" + +class SCH_EDIT_FRAME; + + +class PANEL_EESCHEMA_SETTINGS : public PANEL_EESCHEMA_SETTINGS_BASE +{ + SCH_EDIT_FRAME* m_frame; + +public: + PANEL_EESCHEMA_SETTINGS( SCH_EDIT_FRAME* aFrame, wxWindow* aWindow ); + +private: + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; +}; + + +#endif //KICAD_PANEL_EESCHEMA_SETTINGS_H diff --git a/eeschema/dialogs/panel_eeschema_settings_base.cpp b/eeschema/dialogs/panel_eeschema_settings_base.cpp new file mode 100644 index 0000000000..256815de3f --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_settings_base.cpp @@ -0,0 +1,123 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_eeschema_settings_base.h" + +/////////////////////////////////////////////////////////////////////////// + +BEGIN_EVENT_TABLE( PANEL_EESCHEMA_SETTINGS_BASE, wxPanel ) + EVT_CHOICE( wxID_ANY, PANEL_EESCHEMA_SETTINGS_BASE::_wxFB_OnChooseUnits ) +END_EVENT_TABLE() + +PANEL_EESCHEMA_SETTINGS_BASE::PANEL_EESCHEMA_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bPanelSizer; + bPanelSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bLeftColumn; + bLeftColumn = new wxBoxSizer( wxVERTICAL ); + + wxFlexGridSizer* fgSizer3; + fgSizer3 = new wxFlexGridSizer( 0, 3, 3, 0 ); + fgSizer3->AddGrowableCol( 0 ); + fgSizer3->AddGrowableCol( 1 ); + fgSizer3->AddGrowableCol( 2 ); + fgSizer3->SetFlexibleDirection( wxBOTH ); + fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticText2 = new wxStaticText( this, wxID_ANY, _("&Measurement units:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText2->Wrap( -1 ); + fgSizer3->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + wxString m_choiceUnitsChoices[] = { _("inches"), _("millimeters") }; + int m_choiceUnitsNChoices = sizeof( m_choiceUnitsChoices ) / sizeof( wxString ); + m_choiceUnits = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitsNChoices, m_choiceUnitsChoices, 0 ); + m_choiceUnits->SetSelection( 0 ); + fgSizer3->Add( m_choiceUnits, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + + fgSizer3->Add( 0, 0, 1, wxEXPAND, 3 ); + + m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Def&ault text size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textSizeLabel->Wrap( -1 ); + fgSizer3->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + m_textSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + fgSizer3->Add( m_textSizeCtrl, 0, wxEXPAND|wxTOP|wxBOTTOM, 10 ); + + m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textSizeUnits->Wrap( -1 ); + fgSizer3->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_hPitchLabel = new wxStaticText( this, wxID_ANY, _("&Horizontal pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_hPitchLabel->Wrap( -1 ); + fgSizer3->Add( m_hPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 10 ); + + m_hPitchCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + fgSizer3->Add( m_hPitchCtrl, 0, wxEXPAND|wxTOP, 5 ); + + m_hPitchUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_hPitchUnits->Wrap( -1 ); + fgSizer3->Add( m_hPitchUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_vPitchLabel = new wxStaticText( this, wxID_ANY, _("&Vertical pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_vPitchLabel->Wrap( -1 ); + fgSizer3->Add( m_vPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_vPitchCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + fgSizer3->Add( m_vPitchCtrl, 0, wxEXPAND, 5 ); + + m_vPitchUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_vPitchUnits->Wrap( -1 ); + fgSizer3->Add( m_vPitchUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_staticText16 = new wxStaticText( this, wxID_ANY, _("&Increment of repeated labels:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText16->Wrap( -1 ); + fgSizer3->Add( m_staticText16, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + + m_spinRepeatLabel = new wxSpinCtrl( this, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -10, 10, 1 ); + fgSizer3->Add( m_spinRepeatLabel, 0, wxEXPAND|wxBOTTOM, 5 ); + + + fgSizer3->Add( 0, 0, 1, wxEXPAND, 3 ); + + + bLeftColumn->Add( fgSizer3, 0, wxALL, 5 ); + + wxBoxSizer* bSizer9; + bSizer9 = new wxBoxSizer( wxVERTICAL ); + + m_checkHVOrientation = new wxCheckBox( this, wxID_ANY, _("&Restrict buses and wires to H and V orientation"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer9->Add( m_checkHVOrientation, 0, wxEXPAND|wxALL, 5 ); + + + bSizer9->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_checkAutoplaceFields = new wxCheckBox( this, wxID_ANY, _("A&utomatically place symbol fields"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer9->Add( m_checkAutoplaceFields, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_checkAutoplaceJustify = new wxCheckBox( this, wxID_ANY, _("A&llow field autoplace to change justification"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer9->Add( m_checkAutoplaceJustify, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_checkAutoplaceAlign = new wxCheckBox( this, wxID_ANY, _("Al&ways align autoplaced fields to the 50 mil grid"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer9->Add( m_checkAutoplaceAlign, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 5 ); + + + bLeftColumn->Add( bSizer9, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bPanelSizer->Add( bLeftColumn, 0, wxALL|wxEXPAND, 10 ); + + + this->SetSizer( bPanelSizer ); + this->Layout(); + bPanelSizer->Fit( this ); +} + +PANEL_EESCHEMA_SETTINGS_BASE::~PANEL_EESCHEMA_SETTINGS_BASE() +{ +} diff --git a/eeschema/dialogs/panel_eeschema_settings_base.fbp b/eeschema/dialogs/panel_eeschema_settings_base.fbp new file mode 100644 index 0000000000..f867210afa --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_settings_base.fbp @@ -0,0 +1,1624 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + table + panel_eeschema_settings_base + 1000 + none + 1 + PanelEeschemaSettingsBase + + . + + 1 + 1 + 1 + 1 + UI + 1 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_EESCHEMA_SETTINGS_BASE + + -1,-1 + ; forward_declare + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bPanelSizer + wxVERTICAL + none + + 10 + wxALL|wxEXPAND + 0 + + + bLeftColumn + wxVERTICAL + none + + 5 + wxALL + 0 + + 3 + wxBOTH + 0,1,2 + + 0 + + fgSizer3 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 3 + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Measurement units: + + 0 + + + 0 + + 1 + m_staticText2 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "inches" "millimeters" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceUnits + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnChooseUnits + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Def&ault text size: + + 0 + + + 0 + + 1 + m_textSizeLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_textSizeCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_textSizeUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Horizontal pitch of repeated items: + + 0 + + + 0 + + 1 + m_hPitchLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_hPitchCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_hPitchUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Vertical pitch of repeated items: + + 0 + + + 0 + + 1 + m_vPitchLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_vPitchCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_vPitchUnits + 1 + + + protected + 1 + + Fixed + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Increment of repeated labels: + + 0 + + + 0 + + 1 + m_staticText16 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 1 + 10 + + 0 + + -10 + + 0 + + 1 + m_spinRepeatLabel + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxEXPAND + 1 + + 0 + protected + 0 + + + + + + 5 + wxTOP|wxBOTTOM|wxRIGHT + 0 + + + bSizer9 + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Restrict buses and wires to H and V orientation + + 0 + + + 0 + + 1 + m_checkHVOrientation + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + A&utomatically place symbol fields + + 0 + + + 0 + + 1 + m_checkAutoplaceFields + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + A&llow field autoplace to change justification + + 0 + + + 0 + + 1 + m_checkAutoplaceJustify + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxLEFT|wxTOP|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Al&ways align autoplaced fields to the 50 mil grid + + 0 + + + 0 + + 1 + m_checkAutoplaceAlign + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialogs/panel_eeschema_settings_base.h b/eeschema/dialogs/panel_eeschema_settings_base.h new file mode 100644 index 0000000000..ccc65c2425 --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_settings_base.h @@ -0,0 +1,71 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __PANEL_EESCHEMA_SETTINGS_BASE_H__ +#define __PANEL_EESCHEMA_SETTINGS_BASE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_EESCHEMA_SETTINGS_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_EESCHEMA_SETTINGS_BASE : public wxPanel +{ + DECLARE_EVENT_TABLE() + private: + + // Private event handlers + void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); } + + + protected: + wxStaticText* m_staticText2; + wxChoice* m_choiceUnits; + wxStaticText* m_textSizeLabel; + wxTextCtrl* m_textSizeCtrl; + wxStaticText* m_textSizeUnits; + wxStaticText* m_hPitchLabel; + wxTextCtrl* m_hPitchCtrl; + wxStaticText* m_hPitchUnits; + wxStaticText* m_vPitchLabel; + wxTextCtrl* m_vPitchCtrl; + wxStaticText* m_vPitchUnits; + wxStaticText* m_staticText16; + wxSpinCtrl* m_spinRepeatLabel; + wxCheckBox* m_checkHVOrientation; + wxCheckBox* m_checkAutoplaceFields; + wxCheckBox* m_checkAutoplaceJustify; + wxCheckBox* m_checkAutoplaceAlign; + + // Virtual event handlers, overide them in your derived class + virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); } + + + public: + + PANEL_EESCHEMA_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_EESCHEMA_SETTINGS_BASE(); + +}; + +#endif //__PANEL_EESCHEMA_SETTINGS_BASE_H__ diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp b/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp new file mode 100644 index 0000000000..53c2b4f57c --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp @@ -0,0 +1,170 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Wayne Stambaugh + * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include +#include + +#include + +PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( SCH_EDIT_FRAME* aFrame, + wxWindow* aWindow ) : + PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE( aWindow ), + m_frame( aFrame ) +{ + m_addFieldButton->SetBitmap( KiBitmap( small_plus_xpm ) ); + m_deleteFieldButton->SetBitmap( KiBitmap( trash_xpm ) ); + + m_checkboxWidth = m_grid->GetColSize( 1 ); + + m_grid->PushEventHandler( new GRID_TRICKS( m_grid ) ); +} + + +PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::~PANEL_EESCHEMA_TEMPLATE_FIELDNAMES() +{ + // Delete the GRID_TRICKS. + m_grid->PopEventHandler( true ); +} + + +bool PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::TransferDataToWindow() +{ + m_fields = m_frame->GetTemplateFieldNames(); + return TransferDataToGrid(); +} + + +void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::OnAddButtonClick( wxCommandEvent& event ) +{ + int row = m_grid->GetNumberRows(); + TransferDataFromGrid(); + + TEMPLATE_FIELDNAME newFieldname = TEMPLATE_FIELDNAME( "Fieldname" ); + newFieldname.m_Visible = false; + m_fields.insert( m_fields.end(), newFieldname ); + TransferDataToGrid(); + + // wx documentation is wrong, SetGridCursor does not make visible. + m_grid->MakeCellVisible( row, 0 ); + m_grid->SetGridCursor( row, 0 ); +} + + +void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::OnDeleteButtonClick( wxCommandEvent& event ) +{ + int curRow = m_grid->GetGridCursorRow(); + + if( curRow >= 0 ) + { + m_fields.erase( m_fields.begin() + curRow ); + m_grid->DeleteRows( curRow ); + } + + curRow = std::max( 0, curRow - 1 ); + m_grid->MakeCellVisible( curRow, m_grid->GetGridCursorCol() ); + m_grid->SetGridCursor( curRow, m_grid->GetGridCursorCol() ); +} + + +bool PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::TransferDataToGrid() +{ + m_grid->Freeze(); + + if( m_grid->GetNumberRows() ) + m_grid->DeleteRows( 0, m_grid->GetNumberRows() ); + + m_grid->AppendRows( m_fields.size() ); + + for( int row = 0; row < m_grid->GetNumberRows(); ++row ) + { + m_grid->SetCellValue( row, 0, m_fields[row].m_Name ); + m_grid->SetCellValue( row, 1, m_fields[row].m_Visible ? wxT( "1" ) : wxEmptyString ); + + // Set cell properties + m_grid->SetCellAlignment( row, 0, wxALIGN_LEFT, wxALIGN_CENTRE ); + + // Render the Visible column as a check box + m_grid->SetCellRenderer( row, 1, new wxGridCellBoolRenderer() ); + m_grid->SetReadOnly( row, 1 ); // Not really; we delegate interactivity to GRID_TRICKS + m_grid->SetCellAlignment( row, 1, wxALIGN_CENTRE, wxALIGN_CENTRE ); + } + + m_grid->Thaw(); + + return true; +} + + +bool PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::TransferDataFromGrid() +{ + // Commit any pending edits + m_grid->DisableCellEditControl(); + + for( int row = 0; row < m_grid->GetNumberRows(); ++row ) + { + m_fields[row].m_Name = m_grid->GetCellValue( row, 0 ); + m_fields[row].m_Visible = ( m_grid->GetCellValue( row, 1 ) != wxEmptyString ); + } + + return true; +} + + +bool PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::TransferDataFromWindow() +{ + if( !TransferDataFromGrid() ) + return false; + + m_frame->DeleteAllTemplateFieldNames(); + + for( const TEMPLATE_FIELDNAME& field : m_fields ) + m_frame->AddTemplateFieldName( field ); + + return true; +} + + +void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::AdjustGridColumns( int aWidth ) +{ + if( aWidth <= 0 ) + return; + + // Account for scroll bars + aWidth -= ( m_grid->GetSize().x - m_grid->GetClientSize().x ); + + m_grid->SetColSize( 0, aWidth - m_checkboxWidth ); + m_grid->SetColSize( 1, m_checkboxWidth ); +} + + +void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::OnSizeGrid( wxSizeEvent& event ) +{ + AdjustGridColumns( event.GetSize().GetX() ); + + event.Skip(); +} diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames.h b/eeschema/dialogs/panel_eeschema_template_fieldnames.h new file mode 100644 index 0000000000..46e24d2e54 --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames.h @@ -0,0 +1,76 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef PANEL_EESCHEMA_DEFUALT_FIELDS_H +#define PANEL_EESCHEMA_DEFUALT_FIELDS_H + +#include +#include "panel_eeschema_template_fieldnames_base.h" + +class SCH_EDIT_FRAME; + + +class PANEL_EESCHEMA_TEMPLATE_FIELDNAMES : public PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE +{ +protected: + SCH_EDIT_FRAME* m_frame; + TEMPLATE_FIELDNAMES m_fields; + + int m_checkboxWidth; + + /** + * Function OnAddButtonClick + * Process the wxWidgets @a event produced when the user presses the Add buton for the + * template fieldnames control + * + * @param event The wxWidgets produced event information + * + * Adds a new template fieldname (with default values) to the template fieldnames data + */ + void OnAddButtonClick( wxCommandEvent& event ) override; + + /** + * Function OnDeleteButtonClick + * Process the wxWidgets @a event produced when the user presses the Delete button for the + * template fieldnames control + * + * @param event The wxWidgets produced event information + * + * Deletes the selected template fieldname from the template fieldnames data + */ + void OnDeleteButtonClick( wxCommandEvent& event ) override; + +public: + PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( SCH_EDIT_FRAME* aFrame, wxWindow* aWindow ); + ~PANEL_EESCHEMA_TEMPLATE_FIELDNAMES() override; + +private: + void AdjustGridColumns( int aWidth ); + + void OnSizeGrid( wxSizeEvent& event ) override; + + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; + + bool TransferDataToGrid(); + bool TransferDataFromGrid(); +}; + + +#endif //PANEL_EESCHEMA_DEFUALT_FIELDS_H diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames_base.cpp b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.cpp new file mode 100644 index 0000000000..21487c07a9 --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.cpp @@ -0,0 +1,87 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_eeschema_template_fieldnames_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bPanelSizer; + bPanelSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bMargins; + bMargins = new wxBoxSizer( wxVERTICAL ); + + m_grid = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + + // Grid + m_grid->CreateGrid( 0, 2 ); + m_grid->EnableEditing( true ); + m_grid->EnableGridLines( true ); + m_grid->EnableDragGridSize( false ); + m_grid->SetMargins( 0, 0 ); + + // Columns + m_grid->SetColSize( 0, 300 ); + m_grid->SetColSize( 1, 60 ); + m_grid->EnableDragColMove( false ); + m_grid->EnableDragColSize( true ); + m_grid->SetColLabelSize( 22 ); + m_grid->SetColLabelValue( 0, _("Name") ); + m_grid->SetColLabelValue( 1, _("Visible") ); + m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Rows + m_grid->EnableDragRowSize( true ); + m_grid->SetRowLabelSize( 0 ); + m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Label Appearance + + // Cell Defaults + m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); + bMargins->Add( m_grid, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bSizer10; + bSizer10 = new wxBoxSizer( wxHORIZONTAL ); + + m_addFieldButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + m_addFieldButton->SetMinSize( wxSize( 29,29 ) ); + + bSizer10->Add( m_addFieldButton, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_deleteFieldButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + m_deleteFieldButton->SetMinSize( wxSize( 29,29 ) ); + + bSizer10->Add( m_deleteFieldButton, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bMargins->Add( bSizer10, 0, wxEXPAND, 5 ); + + + bPanelSizer->Add( bMargins, 1, wxEXPAND|wxTOP|wxLEFT, 10 ); + + + this->SetSizer( bPanelSizer ); + this->Layout(); + bPanelSizer->Fit( this ); + + // Connect Events + m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnSizeGrid ), NULL, this ); + m_addFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnAddButtonClick ), NULL, this ); + m_deleteFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnDeleteButtonClick ), NULL, this ); +} + +PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::~PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE() +{ + // Disconnect Events + m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnSizeGrid ), NULL, this ); + m_addFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnAddButtonClick ), NULL, this ); + m_deleteFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnDeleteButtonClick ), NULL, this ); + +} diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames_base.fbp b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.fbp new file mode 100644 index 0000000000..d1dd4f3b68 --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.fbp @@ -0,0 +1,440 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + panel_eeschema_template_fieldnames_base + 1000 + none + 1 + PanelEeschemaTemplateFieldnames + + . + + 1 + 1 + 1 + 1 + UI + 1 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE + + -1,-1 + ; forward_declare + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bPanelSizer + wxHORIZONTAL + none + + 10 + wxEXPAND|wxTOP|wxLEFT + 1 + + + bMargins + wxVERTICAL + none + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + 0 + 0 + + + + 1 + + + wxALIGN_LEFT + + wxALIGN_TOP + 0 + 1 + wxALIGN_CENTRE + 22 + "Name" "Visible" + wxALIGN_CENTRE + 2 + 300,60 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + 0 + 1 + 1 + 1 + + 1 + + + 1 + 0 + 0 + wxID_ANY + + + + 0 + 0 + + 0 + + + 0 + + 1 + m_grid + 1 + + + protected + 1 + + Resizable + wxALIGN_CENTRE + 0 + + wxALIGN_CENTRE + + 0 + 1 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnSizeGrid + + + + + 5 + wxEXPAND + 0 + + + bSizer10 + wxHORIZONTAL + none + + 5 + wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_ANY + Add Field + + 0 + + + 0 + 29,29 + 1 + m_addFieldButton + 1 + + + protected + 1 + + Resizable + + 1 + + wxBU_AUTODRAW + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_ANY + Delete Field + + 0 + + + 0 + 29,29 + 1 + m_deleteFieldButton + 1 + + + protected + 1 + + Resizable + + 1 + + wxBU_AUTODRAW + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnDeleteButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames_base.h b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.h new file mode 100644 index 0000000000..fc449f181f --- /dev/null +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames_base.h @@ -0,0 +1,55 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE_H__ +#define __PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE : public wxPanel +{ + private: + + protected: + wxGrid* m_grid; + wxBitmapButton* m_addFieldButton; + wxBitmapButton* m_deleteFieldButton; + + // Virtual event handlers, overide them in your derived class + virtual void OnSizeGrid( wxSizeEvent& event ) { event.Skip(); } + virtual void OnAddButtonClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnDeleteButtonClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE(); + +}; + +#endif //__PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE_H__ diff --git a/eeschema/dialogs/panel_libedit_settings.cpp b/eeschema/dialogs/panel_libedit_settings.cpp new file mode 100644 index 0000000000..427d005fe3 --- /dev/null +++ b/eeschema/dialogs/panel_libedit_settings.cpp @@ -0,0 +1,87 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Wayne Stambaugh + * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include + +#include "panel_libedit_settings.h" + + +PANEL_LIBEDIT_SETTINGS::PANEL_LIBEDIT_SETTINGS( LIB_EDIT_FRAME* aFrame, wxWindow* aWindow ) : + PANEL_LIBEDIT_SETTINGS_BASE( aWindow ), + m_frame( aFrame ) +{} + + +bool PANEL_LIBEDIT_SETTINGS::TransferDataToWindow() +{ + const GRIDS& gridSizes = m_frame->GetScreen()->GetGrids(); + + for( size_t i = 0; i < gridSizes.size(); i++ ) + { + m_choiceGridSize->Append( wxString::Format( wxT( "%0.1f" ), gridSizes[i].m_Size.x ) ); + + if( gridSizes[i].m_CmdId == m_frame->GetScreen()->GetGridCmdId() ) + m_choiceGridSize->SetSelection( (int) i ); + } + + m_lineWidthCtrl->SetValue( StringFromValue( INCHES, GetDefaultLineThickness(), false, true ) ); + m_pinLengthCtrl->SetValue( StringFromValue( INCHES, m_frame->GetDefaultPinLength(), false, true ) ); + m_pinNumSizeCtrl->SetValue( StringFromValue( INCHES, m_frame->GetPinNumDefaultSize(), false, true ) ); + m_pinNameSizeCtrl->SetValue( StringFromValue( INCHES, m_frame->GetPinNameDefaultSize(), false, true ) ); + m_hPitchCtrl->SetValue( StringFromValue( INCHES, m_frame->GetRepeatStep().x, false, true ) ); + m_vPitchCtrl->SetValue( StringFromValue( INCHES, m_frame->GetRepeatStep().y, false, true ) ); + m_choicePinDisplacement->SetSelection( m_frame->GetRepeatPinStep() == 50 ? 1 : 0 ); + m_spinRepeatLabel->SetValue( m_frame->GetRepeatDeltaLabel() ); + + m_checkShowGrid->SetValue( m_frame->IsGridVisible() ); + m_checkShowPinElectricalType->SetValue( m_frame->GetShowElectricalType() ); + + return true; +} + + +bool PANEL_LIBEDIT_SETTINGS::TransferDataFromWindow() +{ + const GRIDS& gridSizes = m_frame->GetScreen()->GetGrids(); + wxRealPoint gridsize = gridSizes[ (size_t) m_choiceGridSize->GetSelection() ].m_Size; + m_frame->SetLastGridSizeId( m_frame->GetScreen()->SetGrid( gridsize ) ); + m_frame->SetGridVisibility( m_checkShowGrid->GetValue() ); + + SetDefaultLineThickness( ValueFromString( INCHES, m_lineWidthCtrl->GetValue(), true ) ); + m_frame->SetDefaultPinLength( ValueFromString( INCHES, m_pinLengthCtrl->GetValue(), true ) ); + m_frame->SetPinNumDefaultSize( ValueFromString( INCHES, m_pinNumSizeCtrl->GetValue(), true ) ); + m_frame->SetPinNameDefaultSize( ValueFromString( INCHES, m_pinNameSizeCtrl->GetValue(), true ) ); + m_frame->SetRepeatStep( wxPoint( ValueFromString( INCHES, m_hPitchCtrl->GetValue(), true ), + ValueFromString( INCHES, m_vPitchCtrl->GetValue(), true ) ) ); + m_frame->SetRepeatPinStep( m_choicePinDisplacement->GetSelection() == 1 ? 50 : 100 ); + m_frame->SetRepeatDeltaLabel( m_spinRepeatLabel->GetValue() ); + + m_frame->SetShowElectricalType( m_checkShowPinElectricalType->GetValue() ); + + return true; +} + + diff --git a/eeschema/dialogs/panel_libedit_settings.h b/eeschema/dialogs/panel_libedit_settings.h new file mode 100644 index 0000000000..d74b3036a4 --- /dev/null +++ b/eeschema/dialogs/panel_libedit_settings.h @@ -0,0 +1,41 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef PANEL_LIBEDIT_SETTINGS_H +#define PANEL_LIBEDIT_SETTINGS_H + +#include "panel_libedit_settings_base.h" + +class LIB_EDIT_FRAME; + + +class PANEL_LIBEDIT_SETTINGS : public PANEL_LIBEDIT_SETTINGS_BASE +{ + LIB_EDIT_FRAME* m_frame; + +public: + PANEL_LIBEDIT_SETTINGS( LIB_EDIT_FRAME* aFrame, wxWindow* aWindow ); + +private: + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; +}; + + +#endif //PANEL_LIBEDIT_SETTINGS_H diff --git a/eeschema/dialogs/panel_libedit_settings_base.cpp b/eeschema/dialogs/panel_libedit_settings_base.cpp new file mode 100644 index 0000000000..6c64d141dd --- /dev/null +++ b/eeschema/dialogs/panel_libedit_settings_base.cpp @@ -0,0 +1,190 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_libedit_settings_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_LIBEDIT_SETTINGS_BASE::PANEL_LIBEDIT_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* p1mainSizer; + p1mainSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bLeftColumn; + bLeftColumn = new wxBoxSizer( wxVERTICAL ); + + wxFlexGridSizer* fgSizer; + fgSizer = new wxFlexGridSizer( 0, 3, 3, 0 ); + fgSizer->AddGrowableCol( 0 ); + fgSizer->AddGrowableCol( 1 ); + fgSizer->AddGrowableCol( 2 ); + fgSizer->SetFlexibleDirection( wxBOTH ); + fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_gridSizeLabel = new wxStaticText( this, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_gridSizeLabel->Wrap( -1 ); + fgSizer->Add( m_gridSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + wxArrayString m_choiceGridSizeChoices; + m_choiceGridSize = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceGridSizeChoices, 0 ); + m_choiceGridSize->SetSelection( 0 ); + fgSizer->Add( m_choiceGridSize, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_gridSizeUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_gridSizeUnits->Wrap( -1 ); + fgSizer->Add( m_gridSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 ); + + m_checkShowGrid = new wxCheckBox( this, wxID_ANY, _("&Show grid"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer->Add( m_checkShowGrid, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 3 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 10 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_lineWidthLabel = new wxStaticText( this, wxID_ANY, _("&Default line width:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lineWidthLabel->Wrap( -1 ); + fgSizer->Add( m_lineWidthLabel, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_lineWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + fgSizer->Add( m_lineWidthCtrl, 0, wxALL|wxEXPAND, 5 ); + + m_lineWidthUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lineWidthUnits->Wrap( -1 ); + fgSizer->Add( m_lineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 10 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_pinLengthLabel = new wxStaticText( this, wxID_ANY, _("D&efault pin length:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_pinLengthLabel->Wrap( -1 ); + fgSizer->Add( m_pinLengthLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); + + m_pinLengthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + fgSizer->Add( m_pinLengthCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_pinLengthUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_pinLengthUnits->Wrap( -1 ); + fgSizer->Add( m_pinLengthUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 3 ); + + m_pinNumSizeLabel = new wxStaticText( this, wxID_ANY, _("De&fault pin number size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_pinNumSizeLabel->Wrap( -1 ); + fgSizer->Add( m_pinNumSizeLabel, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_pinNumSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + fgSizer->Add( m_pinNumSizeCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_pinNumSizeUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_pinNumSizeUnits->Wrap( -1 ); + fgSizer->Add( m_pinNumSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 ); + + m_pinNameSizeLabel = new wxStaticText( this, wxID_ANY, _("Def&ault pin name size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_pinNameSizeLabel->Wrap( -1 ); + fgSizer->Add( m_pinNameSizeLabel, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_pinNameSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + fgSizer->Add( m_pinNameSizeCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_pinNameSizeUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_pinNameSizeUnits->Wrap( -1 ); + fgSizer->Add( m_pinNameSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 ); + + m_checkShowPinElectricalType = new wxCheckBox( this, wxID_ANY, _("Show pin &electrical type"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer->Add( m_checkShowPinElectricalType, 0, wxTOP|wxBOTTOM|wxRIGHT, 3 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 10 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_hPitchLabel = new wxStaticText( this, wxID_ANY, _("&Horizontal pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_hPitchLabel->Wrap( -1 ); + fgSizer->Add( m_hPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); + + m_hPitchCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS ); + fgSizer->Add( m_hPitchCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_hPitchUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_hPitchUnits->Wrap( -1 ); + fgSizer->Add( m_hPitchUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); + + m_vPitchLabel = new wxStaticText( this, wxID_ANY, _("&Vertical pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_vPitchLabel->Wrap( -1 ); + fgSizer->Add( m_vPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_vPitchCtrl = new wxTextCtrl( this, wxID_ANY, _("100"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS ); + fgSizer->Add( m_vPitchCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_vPitchUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_vPitchUnits->Wrap( -1 ); + fgSizer->Add( m_vPitchUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_pinPitchLabel = new wxStaticText( this, wxID_ANY, _("&Pitch of repeated pins:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_pinPitchLabel->Wrap( -1 ); + fgSizer->Add( m_pinPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + wxString m_choicePinDisplacementChoices[] = { _("100"), _("50") }; + int m_choicePinDisplacementNChoices = sizeof( m_choicePinDisplacementChoices ) / sizeof( wxString ); + m_choicePinDisplacement = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choicePinDisplacementNChoices, m_choicePinDisplacementChoices, 0 ); + m_choicePinDisplacement->SetSelection( 0 ); + fgSizer->Add( m_choicePinDisplacement, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_pinPitchUnis = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_pinPitchUnis->Wrap( -1 ); + fgSizer->Add( m_pinPitchUnis, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_labelIncrementLabel = new wxStaticText( this, wxID_ANY, _("&Increment of repeated labels:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelIncrementLabel->Wrap( -1 ); + fgSizer->Add( m_labelIncrementLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + + m_spinRepeatLabel = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -10, 10, 1 ); + fgSizer->Add( m_spinRepeatLabel, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + fgSizer->Add( 0, 0, 0, 0, 5 ); + + + bLeftColumn->Add( fgSizer, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + p1mainSizer->Add( bLeftColumn, 1, wxEXPAND|wxALL, 15 ); + + + this->SetSizer( p1mainSizer ); + this->Layout(); + p1mainSizer->Fit( this ); +} + +PANEL_LIBEDIT_SETTINGS_BASE::~PANEL_LIBEDIT_SETTINGS_BASE() +{ +} diff --git a/eeschema/dialogs/panel_libedit_settings_base.fbp b/eeschema/dialogs/panel_libedit_settings_base.fbp new file mode 100644 index 0000000000..743ad3b50e --- /dev/null +++ b/eeschema/dialogs/panel_libedit_settings_base.fbp @@ -0,0 +1,2655 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + table + panel_libedit_settings_base + 1000 + none + 1 + PanelLibeditSettingsBase + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_LIBEDIT_SETTINGS_BASE + + -1,-1 + ; forward_declare + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + p1mainSizer + wxHORIZONTAL + none + + 15 + wxEXPAND|wxALL + 1 + + + bLeftColumn + wxVERTICAL + none + + 5 + wxTOP|wxBOTTOM|wxRIGHT + 0 + + 3 + wxBOTH + 0,1,2 + + 0 + + fgSizer + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 3 + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Grid size: + + 0 + + + 0 + + 1 + m_gridSizeLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceGridSize + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_gridSizeUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Show grid + + 0 + + + 0 + + 1 + m_checkShowGrid + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 10 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Default line width: + + 0 + + + 0 + + 1 + m_lineWidthLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_lineWidthCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_lineWidthUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + D&efault pin length: + + 0 + + + 0 + + 1 + m_pinLengthLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_pinLengthCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_pinLengthUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + De&fault pin number size: + + 0 + + + 0 + + 1 + m_pinNumSizeLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_pinNumSizeCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_pinNumSizeUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Def&ault pin name size: + + 0 + + + 0 + + 1 + m_pinNameSizeLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_pinNameSizeCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_pinNameSizeUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxTOP|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show pin &electrical type + + 0 + + + 0 + + 1 + m_checkShowPinElectricalType + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 10 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Horizontal pitch of repeated items: + + 0 + + + 0 + + 1 + m_hPitchLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_hPitchCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_hPitchUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Vertical pitch of repeated items: + + 0 + + + 0 + + 1 + m_vPitchLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_vPitchCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 100 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_vPitchUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Pitch of repeated pins: + + 0 + + + 0 + + 1 + m_pinPitchLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "100" "50" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choicePinDisplacement + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + + 0 + + + 0 + + 1 + m_pinPitchUnis + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Increment of repeated labels: + + 0 + + + 0 + + 1 + m_labelIncrementLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 1 + 10 + + 0 + + -10 + + 0 + + 1 + m_spinRepeatLabel + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + 0 + + 0 + protected + 0 + + + + + + + + + + diff --git a/eeschema/dialogs/panel_libedit_settings_base.h b/eeschema/dialogs/panel_libedit_settings_base.h new file mode 100644 index 0000000000..5ded827214 --- /dev/null +++ b/eeschema/dialogs/panel_libedit_settings_base.h @@ -0,0 +1,74 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __PANEL_LIBEDIT_SETTINGS_BASE_H__ +#define __PANEL_LIBEDIT_SETTINGS_BASE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_LIBEDIT_SETTINGS_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_LIBEDIT_SETTINGS_BASE : public wxPanel +{ + private: + + protected: + wxStaticText* m_gridSizeLabel; + wxChoice* m_choiceGridSize; + wxStaticText* m_gridSizeUnits; + wxCheckBox* m_checkShowGrid; + wxStaticText* m_lineWidthLabel; + wxTextCtrl* m_lineWidthCtrl; + wxStaticText* m_lineWidthUnits; + wxStaticText* m_pinLengthLabel; + wxTextCtrl* m_pinLengthCtrl; + wxStaticText* m_pinLengthUnits; + wxStaticText* m_pinNumSizeLabel; + wxTextCtrl* m_pinNumSizeCtrl; + wxStaticText* m_pinNumSizeUnits; + wxStaticText* m_pinNameSizeLabel; + wxTextCtrl* m_pinNameSizeCtrl; + wxStaticText* m_pinNameSizeUnits; + wxCheckBox* m_checkShowPinElectricalType; + wxStaticText* m_hPitchLabel; + wxTextCtrl* m_hPitchCtrl; + wxStaticText* m_hPitchUnits; + wxStaticText* m_vPitchLabel; + wxTextCtrl* m_vPitchCtrl; + wxStaticText* m_vPitchUnits; + wxStaticText* m_pinPitchLabel; + wxChoice* m_choicePinDisplacement; + wxStaticText* m_pinPitchUnis; + wxStaticText* m_labelIncrementLabel; + wxSpinCtrl* m_spinRepeatLabel; + + public: + + PANEL_LIBEDIT_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_LIBEDIT_SETTINGS_BASE(); + +}; + +#endif //__PANEL_LIBEDIT_SETTINGS_BASE_H__ diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index d4394c0c92..8bc0a901a9 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -33,27 +33,20 @@ #include #include #include -#include - -#include -#include #include #include #include -#include -#include #include #include #include - -#include - -#include -#include -#include #include - #include +#include +#include +#include +#include +#include +#include #define FR_HISTORY_LIST_CNT 10 ///< Maximum number of find and replace strings. @@ -129,23 +122,10 @@ COLOR4D GetInvisibleItemColor() void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) { - int id = event.GetId(); + int id = event.GetId(); switch( id ) { - // Hotkey IDs - case ID_PREFERENCES_HOTKEY_SHOW_EDITOR: - InstallHotkeyFrame( this, g_Eeschema_Hokeys_Descr, g_Libedit_Hokeys_Descr ); - break; - - case ID_PREFERENCES_HOTKEY_EXPORT_CONFIG: - ExportHotkeyConfigToFile( g_Eeschema_Hokeys_Descr, wxT( "eeschema" ) ); - break; - - case ID_PREFERENCES_HOTKEY_IMPORT_CONFIG: - ImportHotkeyConfigFromFile( g_Eeschema_Hokeys_Descr, wxT( "eeschema" ) ); - break; - case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST: // Display current hotkey list for LibEdit. DisplayHotkeyList( this, g_Libedit_Hokeys_Descr ); @@ -196,19 +176,6 @@ void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event ) } break; - // Hotkey IDs - case ID_PREFERENCES_HOTKEY_EXPORT_CONFIG: - ExportHotkeyConfigToFile( g_Eeschema_Hokeys_Descr, wxT( "eeschema" ) ); - break; - - case ID_PREFERENCES_HOTKEY_IMPORT_CONFIG: - ImportHotkeyConfigFromFile( g_Eeschema_Hokeys_Descr, wxT( "eeschema" ) ); - break; - - case ID_PREFERENCES_HOTKEY_SHOW_EDITOR: - InstallHotkeyFrame( this, g_Eeschema_Hokeys_Descr, g_Schematic_Hokeys_Descr ); - break; - case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST: // Display current hotkey list for eeschema. DisplayHotkeyList( this, g_Schematic_Hokeys_Descr ); @@ -222,114 +189,25 @@ void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event ) { - wxArrayString units; - GRIDS grid_list = GetScreen()->GetGrids(); - bool saveProjectConfig = false; - - DIALOG_EESCHEMA_OPTIONS dlg( this ); - - units.Add( GetUnitsLabel( INCHES ) ); - units.Add( GetUnitsLabel( MILLIMETRES ) ); - - dlg.SetUnits( units, GetUserUnits() ); - dlg.SetGridSizes( grid_list, GetScreen()->GetGridCmdId() ); - dlg.SetBusWidth( GetDefaultBusThickness() ); - dlg.SetLineWidth( GetDefaultLineThickness() ); - dlg.SetTextSize( GetDefaultTextSize() ); - dlg.SetRepeatHorizontal( GetRepeatStep().x ); - dlg.SetRepeatVertical( GetRepeatStep().y ); - dlg.SetRepeatLabel( GetRepeatDeltaLabel() ); - dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 ); - dlg.SetRefIdSeparator( LIB_PART::GetSubpartIdSeparator(), - LIB_PART::GetSubpartFirstId() ); - - dlg.SetShowGrid( IsGridVisible() ); - dlg.SetShowHiddenPins( m_showAllPins ); - dlg.SetEnableMousewheelPan( m_canvas->GetEnableMousewheelPan() ); - dlg.SetEnableZoomNoCenter( m_canvas->GetEnableZoomNoCenter() ); - dlg.SetEnableAutoPan( m_canvas->GetEnableAutoPan() ); - dlg.SetEnableHVBusOrientation( GetForceHVLines() ); - dlg.SetShowPageLimits( m_showPageLimits ); - dlg.SetFootprintPreview( m_footprintPreview ); - dlg.SetAutoplaceFields( m_autoplaceFields ); - dlg.SetAutoplaceJustify( m_autoplaceJustify ); - dlg.SetAutoplaceAlign( m_autoplaceAlign ); - dlg.Layout(); - dlg.Fit(); - dlg.SetMinSize( dlg.GetSize() ); - dlg.SetTemplateFields( m_TemplateFieldNames.GetTemplateFieldNames() ); - - if( dlg.ShowModal() == wxID_CANCEL ) - return; - - wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); - cmd.SetId( (dlg.GetUnitsSelection() == MILLIMETRES) ? - ID_TB_OPTIONS_SELECT_UNIT_MM : ID_TB_OPTIONS_SELECT_UNIT_INCH ); - GetEventHandler()->ProcessEvent( cmd ); - - wxRealPoint gridsize = grid_list[ (size_t) dlg.GetGridSelection() ].m_Size; - m_LastGridSizeId = GetScreen()->SetGrid( gridsize ); - - int sep, firstId; - dlg.GetRefIdSeparator( sep, firstId); - - if( sep != (int)LIB_PART::GetSubpartIdSeparator() || - firstId != (int)LIB_PART::GetSubpartFirstId() ) + if( ShowPreferences( g_Eeschema_Hokeys_Descr, g_Schematic_Hokeys_Descr, wxT( "eeschema" ) ) ) { - LIB_PART::SetSubpartIdNotation( sep, firstId ); - saveProjectConfig = true; + SaveSettings( config() ); // save values shared by eeschema applications. + m_canvas->Refresh( true ); } +} - SetDefaultBusThickness( dlg.GetBusWidth() ); - SetDefaultLineThickness( dlg.GetLineWidth() ); - if( dlg.GetTextSize() != GetDefaultTextSize() ) - { - SetDefaultTextSize( dlg.GetTextSize() ); - saveProjectConfig = true; - } - - wxPoint step; - step.x = dlg.GetRepeatHorizontal(); - step.y = dlg.GetRepeatVertical(); - SetRepeatStep( step ); - SetRepeatDeltaLabel( dlg.GetRepeatLabel() ); - - SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 ); - SetGridVisibility( dlg.GetShowGrid() ); - m_showAllPins = dlg.GetShowHiddenPins(); - m_canvas->SetEnableMousewheelPan( dlg.GetEnableMousewheelPan() ); - m_canvas->SetEnableZoomNoCenter( dlg.GetEnableZoomNoCenter() ); - m_canvas->SetEnableAutoPan( dlg.GetEnableAutoPan() ); - SetForceHVLines( dlg.GetEnableHVBusOrientation() ); - m_showPageLimits = dlg.GetShowPageLimits(); - m_autoplaceFields = dlg.GetAutoplaceFields(); - m_autoplaceJustify = dlg.GetAutoplaceJustify(); - m_autoplaceAlign = dlg.GetAutoplaceAlign(); - m_footprintPreview = dlg.GetFootprintPreview(); - - // Delete all template fieldnames and then restore them using the template field data from - // the options dialog - DeleteAllTemplateFieldNames(); - TEMPLATE_FIELDNAMES newFieldNames = dlg.GetTemplateFields(); - - for( TEMPLATE_FIELDNAMES::iterator dlgfld = newFieldNames.begin(); - dlgfld != newFieldNames.end(); ++dlgfld ) - { - TEMPLATE_FIELDNAME fld = *dlgfld; - AddTemplateFieldName( fld ); - } - - SaveSettings( config() ); // save values shared by eeschema applications. - - if( saveProjectConfig ) - SaveProjectSettings( true ); - - m_canvas->Refresh( true ); +void SCH_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent ) +{ + aParent->AddPage( new PANEL_EESCHEMA_SETTINGS( this, aParent ), _( "Eeschema" ) ); + aParent->AddSubPage( new PANEL_EESCHEMA_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) ); + aParent->AddSubPage( new PANEL_EESCHEMA_COLOR_CONFIG( this, aParent ), _( "Colors" ) ); + aParent->AddSubPage( new PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( this, aParent ), _( "Field Name Templates" ) ); } PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParametersList() + { if( !m_projectFileParams.empty() ) return m_projectFileParams; @@ -722,41 +600,17 @@ void LIB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg ) void LIB_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event ) { - wxArrayString units; - GRIDS grid_list = GetScreen()->GetGrids(); + if( ShowPreferences( g_Eeschema_Hokeys_Descr, g_Libedit_Hokeys_Descr, wxT( "eeschema" ) ) ) + { + SaveSettings( config() ); // save values shared by eeschema applications. + m_canvas->Refresh( true ); + } +} - DIALOG_LIBEDIT_OPTIONS dlg( this ); - dlg.SetGridSizes( grid_list, GetScreen()->GetGridCmdId() ); - dlg.SetLineWidth( GetDefaultLineThickness() ); - dlg.SetPinLength( GetDefaultPinLength() ); - dlg.SetPinNumSize( m_textPinNumDefaultSize ); - dlg.SetPinNameSize( m_textPinNameDefaultSize ); - - dlg.SetShowGrid( IsGridVisible() ); - dlg.SetShowElectricalType( GetShowElectricalType() ); - dlg.Layout(); - dlg.Fit(); - - if( dlg.ShowModal() == wxID_CANCEL ) - return; - - wxRealPoint gridsize = grid_list[ (size_t) dlg.GetGridSelection() ].m_Size; - m_LastGridSizeId = GetScreen()->SetGrid( gridsize ); - - SetDefaultLineThickness( dlg.GetLineWidth() ); - SetDefaultPinLength( dlg.GetPinLength() ); - m_textPinNumDefaultSize = dlg.GetPinNumSize(); - m_textPinNameDefaultSize = dlg.GetPinNameSize(); - SetGridVisibility( dlg.GetShowGrid() ); - SetRepeatPinStep( dlg.GetPinRepeatStep() ); - SetRepeatStep( dlg.GetItemRepeatStep() ); - SetRepeatDeltaLabel( dlg.GetRepeatLabelInc() ); - SetShowElectricalType( dlg.GetShowElectricalType() ); - - SaveSettings( config() ); // save values shared by eeschema applications. - - m_canvas->Refresh( true ); +void LIB_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent ) +{ + aParent->AddPage( new PANEL_LIBEDIT_SETTINGS( this, aParent ), _( "Symbol Editor" ) ); } diff --git a/eeschema/lib_edit_frame.cpp b/eeschema/lib_edit_frame.cpp index 41c9af3b8a..7b6e19489b 100644 --- a/eeschema/lib_edit_frame.cpp +++ b/eeschema/lib_edit_frame.cpp @@ -155,8 +155,7 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME ) // Multiple item selection context menu commands. EVT_MENU_RANGE( ID_SELECT_ITEM_START, ID_SELECT_ITEM_END, LIB_EDIT_FRAME::OnSelectItem ) - EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, - LIB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, LIB_EDIT_FRAME::Process_Config ) // Context menu events and commands. EVT_MENU( ID_LIBEDIT_EDIT_PIN, LIB_EDIT_FRAME::OnEditPin ) @@ -1779,20 +1778,12 @@ void LIB_EDIT_FRAME::emptyScreen() } -int LIB_EDIT_FRAME::GetIconScale() +void LIB_EDIT_FRAME::CommonSettingsChanged() { - int scale = 0; - Kiface().KifaceSettings()->Read( LibIconScaleEntry, &scale, 0 ); - return scale; -} + SCH_BASE_FRAME::CommonSettingsChanged(); - -void LIB_EDIT_FRAME::SetIconScale( int aScale ) -{ - Kiface().KifaceSettings()->Write( LibIconScaleEntry, aScale ); - ReCreateMenuBar(); - ReCreateVToolbar(); ReCreateHToolbar(); + ReCreateVToolbar(); ReCreateOptToolbar(); Layout(); SendSizeEvent(); diff --git a/eeschema/lib_edit_frame.h b/eeschema/lib_edit_frame.h index f496b3fcab..0ac94f5512 100644 --- a/eeschema/lib_edit_frame.h +++ b/eeschema/lib_edit_frame.h @@ -35,10 +35,8 @@ #include #include - #include #include - #include class SCH_EDIT_FRAME; @@ -179,10 +177,12 @@ public: /** @return the default pin num text size. */ static int GetPinNumDefaultSize() { return m_textPinNumDefaultSize; } + static void SetPinNumDefaultSize( int aSize ) { m_textPinNumDefaultSize = aSize; } - /** @return The default pin name text size setting. + /** @return The default pin name text size setting. */ static int GetPinNameDefaultSize() { return m_textPinNameDefaultSize; } + static void SetPinNameDefaultSize( int aSize ) { m_textPinNameDefaultSize = aSize; } /** @return The default pin len setting. */ @@ -710,8 +710,15 @@ public: */ void SyncLibraries( bool aLoad ); - int GetIconScale() override; - void SetIconScale( int aScale ) override; + /** + * Allows Libedit to install its preferences panel into the preferences dialog. + */ + void InstallPreferences( PAGED_DIALOG* aParent ) override; + + /** + * Called after the preferences dialog is run. + */ + void CommonSettingsChanged() override; private: ///> Helper screen used when no part is loaded diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index 4c7f59882d..b43f874baf 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -550,69 +550,52 @@ void prepareToolsMenu( wxMenu* aParentMenu ) KiBitmap( import_brd_file_xpm ) ); // Run Pcbnew - AddMenuItem( aParentMenu, - ID_RUN_PCB, - _( "&Open PCB Editor" ), + AddMenuItem( aParentMenu, ID_RUN_PCB, _( "&Open PCB Editor" ), _( "Run Pcbnew" ), KiBitmap( pcbnew_xpm ) ); aParentMenu->AppendSeparator(); - AddMenuItem( aParentMenu, - ID_RUN_LIBRARY, - _( "Symbol Library &Editor" ), HELP_RUN_LIB_EDITOR, + AddMenuItem( aParentMenu, ID_RUN_LIBRARY, _( "Symbol Library &Editor" ), + HELP_RUN_LIB_EDITOR, KiBitmap( libedit_xpm ) ); - AddMenuItem( aParentMenu, - ID_RESCUE_CACHED, - _( "&Rescue Symbols..." ), + AddMenuItem( aParentMenu, ID_RESCUE_CACHED, _( "&Rescue Symbols..." ), _( "Find old symbols in project and rename/rescue them" ), KiBitmap( rescue_xpm ) ); - AddMenuItem( aParentMenu, - ID_REMAP_SYMBOLS, - _( "Remap Symbols..." ), + AddMenuItem( aParentMenu, ID_REMAP_SYMBOLS, _( "Remap Symbols..." ), _( "Remap legacy library symbols to symbol library table" ), KiBitmap( rescue_xpm ) ); aParentMenu->AppendSeparator(); - AddMenuItem( aParentMenu, - ID_OPEN_CMP_TABLE, - _( "Edit Symbol Field&s..." ), + AddMenuItem( aParentMenu, ID_OPEN_CMP_TABLE, _( "Edit Symbol Field&s..." ), KiBitmap( spreadsheet_xpm ) ); - AddMenuItem( aParentMenu, - ID_EDIT_COMPONENTS_TO_SYMBOLS_LIB_ID, + AddMenuItem( aParentMenu, ID_EDIT_COMPONENTS_TO_SYMBOLS_LIB_ID, _( "Edit Symbol Library References..." ), _( "Edit links between schematic symbols and library symbols" ), KiBitmap( edit_cmp_symb_links_xpm ) ); aParentMenu->AppendSeparator(); - AddMenuItem( aParentMenu, - ID_GET_ANNOTATE, - _( "&Annotate Schematic..." ), HELP_ANNOTATE, + AddMenuItem( aParentMenu, ID_GET_ANNOTATE, _( "&Annotate Schematic..." ), + HELP_ANNOTATE, KiBitmap( annotate_xpm ) ); - AddMenuItem( aParentMenu, - ID_GET_NETLIST, - _( "Generate &Netlist File..." ), + AddMenuItem( aParentMenu, ID_GET_NETLIST, _( "Generate &Netlist File..." ), _( "Generate netlist file" ), KiBitmap( netlist_xpm ) ); - AddMenuItem( aParentMenu, - ID_GET_TOOLS, - _( "Generate Bill of &Materials..." ), + AddMenuItem( aParentMenu, ID_GET_TOOLS, _( "Generate Bill of &Materials..." ), HELP_GENERATE_BOM, KiBitmap( bom_xpm ) ); aParentMenu->AppendSeparator(); // Run CvPcb - AddMenuItem( aParentMenu, - ID_RUN_CVPCB, - _( "A&ssign Footprints..." ), + AddMenuItem( aParentMenu, ID_RUN_CVPCB, _( "A&ssign Footprints..." ), _( "Assign PCB footprints to schematic symbols" ), KiBitmap( cvpcb_xpm ) ); @@ -620,9 +603,8 @@ void prepareToolsMenu( wxMenu* aParentMenu ) #ifdef KICAD_SPICE // Simulator - AddMenuItem( aParentMenu, - ID_SIM_SHOW, - _("Simula&tor"), _( "Simulate circuit" ), + AddMenuItem( aParentMenu, ID_SIM_SHOW, _("Simula&tor"), + _( "Simulate circuit" ), KiBitmap( simulator_xpm ) ); #endif /* KICAD_SPICE */ @@ -631,108 +613,59 @@ void prepareToolsMenu( wxMenu* aParentMenu ) void prepareHelpMenu( wxMenu* aParentMenu ) { - AddMenuItem( aParentMenu, - wxID_HELP, - _( "Eeschema &Manual" ), + AddMenuItem( aParentMenu, wxID_HELP, _( "Eeschema &Manual" ), _( "Open Eeschema Manual" ), KiBitmap( online_help_xpm ) ); - AddMenuItem( aParentMenu, - wxID_INDEX, - _( "&Getting Started in KiCad" ), + AddMenuItem( aParentMenu, wxID_INDEX, _( "&Getting Started in KiCad" ), _( "Open \"Getting Started in KiCad\" guide for beginners" ), KiBitmap( help_xpm ) ); wxString text = AddHotkeyName( _( "&List Hotkeys..." ), g_Eeschema_Hokeys_Descr, HK_HELP ); - AddMenuItem( aParentMenu, - ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, - text, + AddMenuItem( aParentMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, text, _( "Displays current hotkeys table and corresponding commands" ), KiBitmap( hotkeys_xpm ) ); aParentMenu->AppendSeparator(); - AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED, - _( "Get &Involved" ), + AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED, _( "Get &Involved" ), _( "Contribute to KiCad (opens a web browser)" ), KiBitmap( info_xpm ) ); aParentMenu->AppendSeparator(); - AddMenuItem( aParentMenu, - wxID_ABOUT, - _( "&About KiCad" ), - _( "About KiCad" ), - KiBitmap( about_xpm ) ); + AddMenuItem( aParentMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) ); } static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu ) { // Path configuration edit dialog. - AddMenuItem( aParentMenu, - ID_PREFERENCES_CONFIGURE_PATHS, - _( "Configure Pa&ths..." ), + AddMenuItem( aParentMenu, ID_PREFERENCES_CONFIGURE_PATHS, _( "Configure Pa&ths..." ), _( "Edit path configuration environment variables" ), KiBitmap( path_xpm ) ); // Library - AddMenuItem( aParentMenu, - ID_EDIT_SYM_LIB_TABLE, - _( "Manage Symbol Libraries..." ), + AddMenuItem( aParentMenu, ID_EDIT_SYM_LIB_TABLE, _( "Manage Symbol Libraries..." ), _( "Edit the global and project symbol library lists" ), KiBitmap( library_table_xpm ) ); // Options (Preferences on WXMAC) -#ifdef __WXMAC__ - aParentMenu->Append( wxID_PREFERENCES ); -#else - AddMenuItem( aParentMenu, - wxID_PREFERENCES, - _( "General &Options" ), - _( "Edit Eeschema preferences" ), + AddMenuItem( aParentMenu, wxID_PREFERENCES, _( "Preferences..." ), + _( "Show preferences for all open tools" ), KiBitmap( preference_xpm ) ); -#endif // __WXMAC__ - - aParentMenu->AppendSeparator(); - - // Icons options submenu - aFrame->AddMenuIconsOptions( aParentMenu ); aParentMenu->AppendSeparator(); // Language submenu Pgm().AddMenuLanguageList( aParentMenu ); - // Hotkeys submenu - wxMenu* HotkeySubmenu = new wxMenu; - AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG, - _( "E&xport Hotkeys..." ), - _( "Export current hotkeys into configuration file" ), - KiBitmap( hotkeys_export_xpm ) ); - - // Reload hotkey file - AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG, - _( "&Import Hotkeys..." ), - _( "Load existing hotkey configuration file" ), - KiBitmap( hotkeys_import_xpm ) ); - - AddMenuItem( aParentMenu, HotkeySubmenu, -1, - _( "&Hotkeys Options" ), - _( "Edit hotkeys configuration and preferences" ), - KiBitmap( hotkeys_xpm ) ); - - aParentMenu->AppendSeparator(); // Import/export - AddMenuItem( aParentMenu, - ID_CONFIG_SAVE, - _( "&Save Project File..." ), + AddMenuItem( aParentMenu, ID_CONFIG_SAVE, _( "&Save Project File..." ), _( "Save project preferences into a project file" ), KiBitmap( save_setup_xpm ) ); - AddMenuItem( aParentMenu, - ID_CONFIG_READ, - _( "Load P&roject File..." ), + AddMenuItem( aParentMenu, ID_CONFIG_READ, _( "Load P&roject File..." ), _( "Load project preferences from a project file" ), KiBitmap( import_setup_xpm ) ); } diff --git a/eeschema/menubar_libedit.cpp b/eeschema/menubar_libedit.cpp index de3bb5267c..f4f38d5613 100644 --- a/eeschema/menubar_libedit.cpp +++ b/eeschema/menubar_libedit.cpp @@ -304,16 +304,13 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() // Default values and options AddMenuItem( preferencesMenu, wxID_PREFERENCES, - _( "General &Options..." ), - _( "Set Symbol Editor default values and options" ), + _( "Preferences..." ), + _( "Show preferences for all open tools" ), KiBitmap( preference_xpm ) ); // Language submenu Pgm().AddMenuLanguageList( preferencesMenu ); - // Hotkey submenu - AddHotkeyConfigMenu( preferencesMenu ); - // Menu Help: wxMenu* helpMenu = new wxMenu; @@ -346,11 +343,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() // About Eeschema helpMenu->AppendSeparator(); - AddMenuItem( helpMenu, - wxID_ABOUT, - _( "&About KiCad" ), - _( "About KiCad" ), - KiBitmap( about_xpm ) ); + AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) ); // Create the menubar and append all submenus menuBar->Append( fileMenu, _( "&File" ) ); diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index d72fa995f4..09bcb783d9 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -26,14 +26,14 @@ #include #include #include - #include #include #include #include #include #include -#include +#include + #include "dialogs/dialog_sym_lib_table.h" @@ -263,7 +263,8 @@ void SCH_BASE_FRAME::UpdateStatusBar() void SCH_BASE_FRAME::OnConfigurePaths( wxCommandEvent& aEvent ) { - Pgm().ConfigurePaths( this, nullptr ); + DIALOG_CONFIGURE_PATHS dlg( this, nullptr ); + dlg.ShowModal(); } diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 207fdb6052..d73c135fba 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -243,8 +243,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) EVT_MENU( ID_CONFIG_SAVE, SCH_EDIT_FRAME::Process_Config ) EVT_MENU( ID_CONFIG_READ, SCH_EDIT_FRAME::Process_Config ) - EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, - SCH_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, SCH_EDIT_FRAME::Process_Config ) EVT_TOOL( wxID_PREFERENCES, SCH_EDIT_FRAME::OnPreferencesOptions ) EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, SCH_EDIT_FRAME::OnConfigurePaths ) @@ -1499,18 +1498,10 @@ void SCH_EDIT_FRAME::UpdateTitle() } -int SCH_EDIT_FRAME::GetIconScale() +void SCH_EDIT_FRAME::CommonSettingsChanged() { - int scale = 0; - Kiface().KifaceSettings()->Read( SchIconScaleEntry, &scale, 0 ); - return scale; -} + SCH_BASE_FRAME::CommonSettingsChanged(); - -void SCH_EDIT_FRAME::SetIconScale( int aScale ) -{ - Kiface().KifaceSettings()->Write( SchIconScaleEntry, aScale ); - ReCreateMenuBar(); ReCreateHToolbar(); ReCreateVToolbar(); ReCreateOptToolbar(); diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index fc130c6bac..b406e0514b 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -237,15 +237,24 @@ public: void SetForceHVLines( bool aForceHVdirection ) { m_forceHVLines = aForceHVdirection; } bool GetShowAllPins() const { return m_showAllPins; } - void SetShowAllPins( bool aEnable ) { m_showAllPins = aEnable; } - const wxString GetNetListFormatName() const { return m_netListFormat; } + bool GetFootprintPreview() const { return m_footprintPreview; } + void SetFootprintPreview( bool aEnable ) { m_footprintPreview = aEnable; } + bool GetAutoplaceFields() const { return m_autoplaceFields; } + void SetAutoplaceFields( bool aEnable ) { m_autoplaceFields = aEnable; } + + bool GetAutoplaceAlign() const { return m_autoplaceAlign; } + void SetAutoplaceAlign( bool aEnable ) { m_autoplaceAlign = aEnable; } + + bool GetAutoplaceJustify() const { return m_autoplaceJustify; } + void SetAutoplaceJustify( bool aEnable ) { m_autoplaceJustify = aEnable; } + + const wxString GetNetListFormatName() const { return m_netListFormat; } void SetNetListFormatName( const wxString& aFormat ) { m_netListFormat = aFormat; } bool GetSpiceAjustPassiveValues() const { return m_spiceAjustPassiveValues; } - void SetSpiceAjustPassiveValues( bool aEnable ) { m_spiceAjustPassiveValues = aEnable; } /// accessor to the destination directory to use when generating plot files. @@ -1504,8 +1513,15 @@ public: */ void doUpdatePcb( const wxString& aUpdateOptions = "" ); - int GetIconScale() override; - void SetIconScale( int aScale ) override; + /** + * Allows Eeschema to install its preferences panels into the preferences dialog. + */ + void InstallPreferences( PAGED_DIALOG* aParent ) override; + + /** + * Called after the preferences dialog is run. + */ + void CommonSettingsChanged() override; ///> Probe cursor, used by circuit simulator const static wxCursor CURSOR_PROBE; diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index b84ee280e4..3812d0c3bd 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -1300,11 +1300,9 @@ SIM_PLOT_FRAME::SIGNAL_CONTEXT_MENU::SIGNAL_CONTEXT_MENU( const wxString& aSigna TRACE* trace = plot->GetTrace( m_signal ); if( trace->HasCursor() ) - AddMenuItem( this, HIDE_CURSOR, _( "Hide Cursor" ), - wxEmptyString, KiBitmap( pcb_target_xpm ) ); + AddMenuItem( this, HIDE_CURSOR, _( "Hide Cursor" ), KiBitmap( pcb_target_xpm ) ); else - AddMenuItem( this, SHOW_CURSOR, _( "Show Cursor" ), - wxEmptyString, KiBitmap( pcb_target_xpm ) ); + AddMenuItem( this, SHOW_CURSOR, _( "Show Cursor" ), KiBitmap( pcb_target_xpm ) ); Connect( wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( SIGNAL_CONTEXT_MENU::onMenuEvent ), NULL, this ); } diff --git a/eeschema/widgets/widget_eeschema_color_config.cpp b/eeschema/widgets/widget_eeschema_color_config.cpp index de0fc925c9..0b83f7793e 100644 --- a/eeschema/widgets/widget_eeschema_color_config.cpp +++ b/eeschema/widgets/widget_eeschema_color_config.cpp @@ -135,7 +135,7 @@ void WIDGET_EESCHEMA_COLOR_CONFIG::CreateControls() COLORBUTTON* buttons = groups->m_Buttons; columnBoxSizer = new wxBoxSizer( wxVERTICAL ); - m_mainBoxSizer->Add( columnBoxSizer, 1, wxALIGN_TOP | wxLEFT | wxTOP, 5 ); + m_mainBoxSizer->Add( columnBoxSizer, 1, wxALIGN_TOP | wxLEFT, 5 ); wxBoxSizer* rowBoxSizer = new wxBoxSizer( wxHORIZONTAL ); columnBoxSizer->Add( rowBoxSizer, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); @@ -315,10 +315,25 @@ bool WIDGET_EESCHEMA_COLOR_CONFIG::TransferDataFromControl() } -void WIDGET_EESCHEMA_COLOR_CONFIG::InstallOnPanel( wxPanel* aPanel ) +PANEL_EESCHEMA_COLOR_CONFIG::PANEL_EESCHEMA_COLOR_CONFIG( EDA_DRAW_FRAME* aFrame, + wxWindow* aParent ) : + wxPanel( aParent ) { - wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL ); + auto sizer = new wxBoxSizer( wxVERTICAL ); + SetSizer( sizer ); - sizer->Add( this, 1, wxALL | wxEXPAND, 0 ); - aPanel->SetSizer( sizer ); + m_colorConfig = new WIDGET_EESCHEMA_COLOR_CONFIG( this, aFrame ); + sizer->Add( m_colorConfig, 1, wxEXPAND | wxTOP | wxLEFT, 10 ); +} + + +bool PANEL_EESCHEMA_COLOR_CONFIG::TransferDataToWindow() +{ + return true; +} + + +bool PANEL_EESCHEMA_COLOR_CONFIG::TransferDataFromWindow() +{ + return m_colorConfig->TransferDataFromControl(); } diff --git a/eeschema/widgets/widget_eeschema_color_config.h b/eeschema/widgets/widget_eeschema_color_config.h index 1f9cdd8936..996a9523c1 100644 --- a/eeschema/widgets/widget_eeschema_color_config.h +++ b/eeschema/widgets/widget_eeschema_color_config.h @@ -59,14 +59,19 @@ public: WIDGET_EESCHEMA_COLOR_CONFIG( wxWindow* aParent, EDA_DRAW_FRAME* aDrawFrame ); bool TransferDataFromControl(); +}; - /** - * Method InstallOnPanel - * Install this WIDGET_EESCHEMA_COLOR_CONFIG onto an empty panel. This is useful - * when combining with wxFormBuilder, as an empty panel can be left as a - * placeholder in the layout. - */ - void InstallOnPanel( wxPanel* aPanel ); + +class PANEL_EESCHEMA_COLOR_CONFIG : public wxPanel +{ +public: + PANEL_EESCHEMA_COLOR_CONFIG( EDA_DRAW_FRAME* aFrame, wxWindow* aParent ); + +protected: + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; + + WIDGET_EESCHEMA_COLOR_CONFIG* m_colorConfig; }; #endif // WIDGET_EESCHEMA_COLOR_CONFIG_H_ diff --git a/gerbview/CMakeLists.txt b/gerbview/CMakeLists.txt index ad8b1771d2..7b6bfb01df 100644 --- a/gerbview/CMakeLists.txt +++ b/gerbview/CMakeLists.txt @@ -16,14 +16,14 @@ include_directories( set( DIALOGS_SRCS - dialogs/gerbview_dialog_display_options_frame_base.cpp - dialogs/gerbview_dialog_display_options_frame.cpp + dialogs/panel_gerbview_display_options.cpp + dialogs/panel_gerbview_display_options_base.cpp + dialogs/panel_gerbview_settings.cpp + dialogs/panel_gerbview_settings_base.cpp dialogs/dialog_layers_select_to_pcb_base.cpp dialogs/dialog_print_using_printer.cpp dialogs/dialog_print_using_printer_base.cpp dialogs/dialog_select_one_pcb_layer.cpp - dialogs/dialog_show_page_borders.cpp - dialogs/dialog_show_page_borders_base.cpp ) set( GERBVIEW_SRCS diff --git a/gerbview/dialogs/dialog_show_page_borders.cpp b/gerbview/dialogs/dialog_show_page_borders.cpp deleted file mode 100644 index 7c2dcfd7ea..0000000000 --- a/gerbview/dialogs/dialog_show_page_borders.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file dialog_show_page_borders.cpp - * Dialog to show/hide frame reference and select paper size for printing - */ - -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2011 jean-pierre.charras@gipsa-lab.inpg.fr - * Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include - -#include -#include -#include - - -DIALOG_PAGE_SHOW_PAGE_BORDERS::DIALOG_PAGE_SHOW_PAGE_BORDERS( GERBVIEW_FRAME *parent) : - DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE( parent, wxID_ANY ) -{ - m_Parent = parent; - SetFocus(); - - m_ShowPageLimits->SetSelection(0); - - if( m_Parent->GetShowBorderAndTitleBlock() ) - { - wxString curPaperType = m_Parent->GetPageSettings().GetType(); - - for( unsigned i = 1; iSetSelection( i ); - break; - } - } - } - - GetSizer()->Fit( this ); - GetSizer()->SetSizeHints( this ); - Center(); - m_sdbSizer1OK->SetDefault(); -} - - -void DIALOG_PAGE_SHOW_PAGE_BORDERS::OnCancelButtonClick( wxCommandEvent& event ) -{ - EndModal( wxID_CANCEL ); -} - - -void DIALOG_PAGE_SHOW_PAGE_BORDERS::OnOKBUttonClick( wxCommandEvent& event ) -{ - int idx = m_ShowPageLimits->GetSelection(); - - m_Parent->SetShowBorderAndTitleBlock( idx > 0 ? true : false ); - - m_Parent->SetPageSettings( PAGE_INFO( g_GerberPageSizeList[idx] ) ); - - EndModal( wxID_OK ); -} - diff --git a/gerbview/dialogs/dialog_show_page_borders_base.cpp b/gerbview/dialogs/dialog_show_page_borders_base.cpp deleted file mode 100644 index d177230456..0000000000 --- a/gerbview/dialogs/dialog_show_page_borders_base.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 22 2017) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_show_page_borders_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE::DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bDialogSizer; - bDialogSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bUpperSizer; - bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bRightSizer; - bRightSizer = new wxBoxSizer( wxVERTICAL ); - - wxString m_ShowPageLimitsChoices[] = { _("Full size without page limits"), _("Full size"), _("Size A4"), _("Size A3"), _("Size A2"), _("Size A"), _("Size B"), _("Size C") }; - int m_ShowPageLimitsNChoices = sizeof( m_ShowPageLimitsChoices ) / sizeof( wxString ); - m_ShowPageLimits = new wxRadioBox( this, wxID_ANY, _("Show Page Limits:"), wxDefaultPosition, wxDefaultSize, m_ShowPageLimitsNChoices, m_ShowPageLimitsChoices, 1, wxRA_SPECIFY_COLS ); - m_ShowPageLimits->SetSelection( 0 ); - bRightSizer->Add( m_ShowPageLimits, 0, wxALL|wxEXPAND, 5 ); - - - bUpperSizer->Add( bRightSizer, 1, wxEXPAND, 5 ); - - - bDialogSizer->Add( bUpperSizer, 1, wxEXPAND, 5 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bDialogSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 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(); - - bDialogSizer->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 ); - - - this->SetSizer( bDialogSizer ); - this->Layout(); - bDialogSizer->Fit( this ); - - // Connect Events - m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE::OnCancelButtonClick ), NULL, this ); - m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE::OnOKBUttonClick ), NULL, this ); -} - -DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE::~DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE() -{ - // Disconnect Events - m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE::OnCancelButtonClick ), NULL, this ); - m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE::OnOKBUttonClick ), NULL, this ); - -} diff --git a/gerbview/dialogs/dialog_show_page_borders_base.fbp b/gerbview/dialogs/dialog_show_page_borders_base.fbp deleted file mode 100644 index 7724b759b9..0000000000 --- a/gerbview/dialogs/dialog_show_page_borders_base.fbp +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_show_page_borders_base - 1000 - none - 1 - dialog_show_page_borders_base - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Page Borders - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bDialogSizer - wxVERTICAL - none - - 5 - wxEXPAND - 1 - - - bUpperSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - - bRightSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Full size without page limits" "Full size" "Size A4" "Size A3" "Size A2" "Size A" "Size B" "Size C" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show Page Limits: - 1 - - 0 - - - 0 - - 1 - m_ShowPageLimits - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxALL - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer1 - protected - - OnCancelButtonClick - - - - OnOKBUttonClick - - - - - - - - diff --git a/gerbview/dialogs/dialog_show_page_borders_base.h b/gerbview/dialogs/dialog_show_page_borders_base.h deleted file mode 100644 index 8f5b5f7777..0000000000 --- a/gerbview/dialogs/dialog_show_page_borders_base.h +++ /dev/null @@ -1,55 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 22 2017) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __DIALOG_SHOW_PAGE_BORDERS_BASE_H__ -#define __DIALOG_SHOW_PAGE_BORDERS_BASE_H__ - -#include -#include -#include -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE : public DIALOG_SHIM -{ - private: - - protected: - wxRadioBox* m_ShowPageLimits; - wxStaticLine* m_staticline1; - wxStdDialogButtonSizer* m_sdbSizer1; - wxButton* m_sdbSizer1OK; - wxButton* m_sdbSizer1Cancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOKBUttonClick( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Page Borders"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE(); - -}; - -#endif //__DIALOG_SHOW_PAGE_BORDERS_BASE_H__ diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp b/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp deleted file mode 100644 index bd032e8a1d..0000000000 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2010-2014 Jean-Pierre Charras jp.charras at wanadoo.fr - * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/** - * @file gerbview_dialog_display_options_frame.cpp - * Set some display options for GerbView - */ - - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - - -/*******************************************/ -/* Dialog frame to select display options */ -/*******************************************/ -class DIALOG_DISPLAY_OPTIONS : public DIALOG_DISPLAY_OPTIONS_BASE -{ -private: - GERBVIEW_FRAME* m_Parent; - GAL_OPTIONS_PANEL* m_galOptsPanel; - int m_last_scale; - -public: - - DIALOG_DISPLAY_OPTIONS( GERBVIEW_FRAME* parent ); - ~DIALOG_DISPLAY_OPTIONS() {}; - -protected: - void OnScaleSlider( wxScrollEvent& aEvent ) override; - void OnScaleAuto( wxCommandEvent& aEvent ) override; - bool TransferDataToWindow() override; - bool TransferDataFromWindow() override; - -private: - void OnOKBUttonClick( wxCommandEvent& event ) override; - void OnCancelButtonClick( wxCommandEvent& event ) override; - void initOptDialog( ); -}; - - -void GERBVIEW_FRAME::InstallGerberOptionsDialog( wxCommandEvent& event ) -{ - DIALOG_DISPLAY_OPTIONS dlg( this ); - int opt = dlg.ShowModal(); - - if( opt > 0 ) - m_canvas->Refresh(); -} - - -DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( GERBVIEW_FRAME *parent) : - DIALOG_DISPLAY_OPTIONS_BASE( parent, wxID_ANY ), - m_last_scale( -1 ) -{ - m_Parent = parent; - m_scaleSlider->SetStep( 25 ); - SetFocus(); - initOptDialog( ); - - GetSizer()->Fit( this ); - GetSizer()->SetSizeHints( this ); - Center(); - m_sdbSizer1OK->SetDefault(); - - FinishDialogSettings(); -} - - -void DIALOG_DISPLAY_OPTIONS::OnCancelButtonClick( wxCommandEvent& event ) -{ - EndModal( 0 ); -} - - -void DIALOG_DISPLAY_OPTIONS::initOptDialog( ) -{ - KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_Parent->GetGalDisplayOptions(); - m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions ); - m_UpperSizer->Add( m_galOptsPanel, 0, wxEXPAND, 0 ); - m_galOptsPanel->TransferDataToWindow(); - - m_PolarDisplay->SetSelection( m_Parent->m_DisplayOptions.m_DisplayPolarCood ? 1 : 0 ); - m_BoxUnits->SetSelection( g_UserUnit ? 1 : 0 ); - - // Show Option Draw Lines. We use DisplayPcbTrackFill as Lines draw option - m_OptDisplayLines->SetSelection( m_Parent->m_DisplayOptions.m_DisplayLinesFill ? 1 : 0 ); - m_OptDisplayFlashedItems->SetSelection( m_Parent->m_DisplayOptions.m_DisplayFlashedItemsFill ? 1 : 0); - - // Show Option Draw polygons - m_OptDisplayPolygons->SetSelection( m_Parent->m_DisplayOptions.m_DisplayPolygonsFill ? 1 : 0 ); - - m_ShowPageLimits->SetSelection(0); - - if( m_Parent->GetShowBorderAndTitleBlock() ) - { - wxString curPaperType = m_Parent->GetPageSettings().GetType(); - - for( unsigned i = 1; i < DIM( g_GerberPageSizeList ); ++i ) - { - if( g_GerberPageSizeList[i] == curPaperType ) - { - m_ShowPageLimits->SetSelection( i ); - break; - } - } - } - - m_OptDisplayDCodes->SetValue( m_Parent->IsElementVisible( LAYER_DCODES ) ); - m_OptZoomNoCenter->SetValue( m_Parent->GetCanvas()->GetEnableZoomNoCenter() ); - m_OptMousewheelPan->SetValue( m_Parent->GetCanvas()->GetEnableMousewheelPan() ); -} - - -void DIALOG_DISPLAY_OPTIONS::OnOKBUttonClick( wxCommandEvent& event ) -{ - TransferDataFromWindow(); - auto displayOptions = (GBR_DISPLAY_OPTIONS*) m_Parent->GetDisplayOptions(); - - bool needs_repaint = false, option; - - m_Parent->m_DisplayOptions.m_DisplayPolarCood = - (m_PolarDisplay->GetSelection() == 0) ? false : true; - g_UserUnit = (m_BoxUnits->GetSelection() == 0) ? INCHES : MILLIMETRES; - - option = ( m_OptDisplayLines->GetSelection() == 1 ); - - if( option != m_Parent->m_DisplayOptions.m_DisplayLinesFill ) - needs_repaint = true; - - m_Parent->m_DisplayOptions.m_DisplayLinesFill = option; - - option = ( m_OptDisplayFlashedItems->GetSelection() == 1 ); - - if( option != m_Parent->m_DisplayOptions.m_DisplayFlashedItemsFill ) - needs_repaint = true; - - m_Parent->m_DisplayOptions.m_DisplayFlashedItemsFill = option; - - option = ( m_OptDisplayPolygons->GetSelection() == 1 ); - - if( option != m_Parent->m_DisplayOptions.m_DisplayPolygonsFill ) - needs_repaint = true; - - m_Parent->m_DisplayOptions.m_DisplayPolygonsFill = option; - - m_Parent->SetElementVisibility( LAYER_DCODES, m_OptDisplayDCodes->GetValue() ); - - int idx = m_ShowPageLimits->GetSelection(); - - m_Parent->SetShowBorderAndTitleBlock( idx > 0 ? true : false ); - - PAGE_INFO pageInfo( g_GerberPageSizeList[idx] ); - - m_Parent->SetPageSettings( pageInfo ); - - m_Parent->GetCanvas()->SetEnableZoomNoCenter( m_OptZoomNoCenter->GetValue() ); - m_Parent->GetCanvas()->SetEnableMousewheelPan( m_OptMousewheelPan->GetValue() ); - - m_galOptsPanel->TransferDataFromWindow(); - - // Apply changes to the GAL - auto view = m_Parent->GetGalCanvas()->GetView(); - auto painter = static_cast( view->GetPainter() ); - auto settings = static_cast( painter->GetSettings() ); - settings->LoadDisplayOptions( displayOptions ); - view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); - - if( needs_repaint ) - view->UpdateAllItems( KIGFX::REPAINT ); - - m_Parent->GetCanvas()->Refresh(); - - EndModal( 1 ); -} - - -bool DIALOG_DISPLAY_OPTIONS::TransferDataToWindow() -{ - const auto parent = static_cast( GetParent() ); - const int scale_fourths = parent->GetIconScale(); - - if( scale_fourths <= 0 ) - { - m_scaleAuto->SetValue( true ); - m_scaleSlider->SetValue( 25 * KiIconScale( parent ) ); - } - else - { - m_scaleAuto->SetValue( false ); - m_scaleSlider->SetValue( scale_fourths * 25 ); - } - - return true; -} - - -bool DIALOG_DISPLAY_OPTIONS::TransferDataFromWindow() -{ - const auto parent = static_cast( GetParent() ); - const int scale_fourths = m_scaleAuto->GetValue() ? -1 : m_scaleSlider->GetValue() / 25; - - if( parent->GetIconScale() != scale_fourths ) - parent->SetIconScale( scale_fourths ); - - return true; -} - - -void DIALOG_DISPLAY_OPTIONS::OnScaleSlider( wxScrollEvent& aEvent ) -{ - m_scaleAuto->SetValue( false ); - aEvent.Skip(); -} - - -void DIALOG_DISPLAY_OPTIONS::OnScaleAuto( wxCommandEvent& aEvent ) -{ - if( m_scaleAuto->GetValue() ) - { - m_last_scale = m_scaleSlider->GetValue(); - m_scaleSlider->SetValue( 25 * KiIconScale( GetParent() ) ); - } - else - { - if( m_last_scale >= 0 ) - m_scaleSlider->SetValue( m_last_scale ); - } -} diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp deleted file mode 100644 index 8f858fc71e..0000000000 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "gerbview_dialog_display_options_frame_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bDialogSizer; - bDialogSizer = new wxBoxSizer( wxVERTICAL ); - - m_UpperSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bLeftSizer; - bLeftSizer = new wxBoxSizer( wxVERTICAL ); - - wxString m_PolarDisplayChoices[] = { _("Cartesian coordinates"), _("Polar coordinates") }; - int m_PolarDisplayNChoices = sizeof( m_PolarDisplayChoices ) / sizeof( wxString ); - m_PolarDisplay = new wxRadioBox( this, wxID_ANY, _("Coordinates:"), wxDefaultPosition, wxDefaultSize, m_PolarDisplayNChoices, m_PolarDisplayChoices, 1, wxRA_SPECIFY_COLS ); - m_PolarDisplay->SetSelection( 0 ); - bLeftSizer->Add( m_PolarDisplay, 0, wxALL|wxEXPAND, 5 ); - - wxString m_BoxUnitsChoices[] = { _("Inches"), _("Millimeters") }; - int m_BoxUnitsNChoices = sizeof( m_BoxUnitsChoices ) / sizeof( wxString ); - m_BoxUnits = new wxRadioBox( this, wxID_ANY, _("Units:"), wxDefaultPosition, wxDefaultSize, m_BoxUnitsNChoices, m_BoxUnitsChoices, 1, wxRA_SPECIFY_COLS ); - m_BoxUnits->SetSelection( 0 ); - bLeftSizer->Add( m_BoxUnits, 0, wxALL|wxEXPAND, 5 ); - - wxString m_OptDisplayFlashedItemsChoices[] = { _("Sketch"), _("Filled") }; - int m_OptDisplayFlashedItemsNChoices = sizeof( m_OptDisplayFlashedItemsChoices ) / sizeof( wxString ); - m_OptDisplayFlashedItems = new wxRadioBox( this, wxID_ANY, _("Flashed items:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayFlashedItemsNChoices, m_OptDisplayFlashedItemsChoices, 1, wxRA_SPECIFY_COLS ); - m_OptDisplayFlashedItems->SetSelection( 1 ); - bLeftSizer->Add( m_OptDisplayFlashedItems, 0, wxALL|wxEXPAND, 5 ); - - wxString m_OptDisplayLinesChoices[] = { _("Sketch"), _("Filled") }; - int m_OptDisplayLinesNChoices = sizeof( m_OptDisplayLinesChoices ) / sizeof( wxString ); - m_OptDisplayLines = new wxRadioBox( this, wxID_ANY, _("Lines:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayLinesNChoices, m_OptDisplayLinesChoices, 1, wxRA_SPECIFY_COLS ); - m_OptDisplayLines->SetSelection( 1 ); - bLeftSizer->Add( m_OptDisplayLines, 0, wxALL|wxEXPAND, 5 ); - - wxString m_OptDisplayPolygonsChoices[] = { _("Sketch"), _("Filled") }; - int m_OptDisplayPolygonsNChoices = sizeof( m_OptDisplayPolygonsChoices ) / sizeof( wxString ); - m_OptDisplayPolygons = new wxRadioBox( this, wxID_ANY, _("Polygons:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayPolygonsNChoices, m_OptDisplayPolygonsChoices, 1, wxRA_SPECIFY_COLS ); - m_OptDisplayPolygons->SetSelection( 1 ); - bLeftSizer->Add( m_OptDisplayPolygons, 0, wxALL|wxEXPAND, 5 ); - - m_OptDisplayDCodes = new wxCheckBox( this, wxID_ANY, _("Show D codes"), wxDefaultPosition, wxDefaultSize, 0 ); - m_OptDisplayDCodes->SetValue(true); - bLeftSizer->Add( m_OptDisplayDCodes, 0, wxALL, 5 ); - - - m_UpperSizer->Add( bLeftSizer, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - wxBoxSizer* bRightSizer; - bRightSizer = new wxBoxSizer( wxVERTICAL ); - - wxString m_ShowPageLimitsChoices[] = { _("Full size without limits"), _("Full size"), _("Size A4"), _("Size A3"), _("Size A2"), _("Size A"), _("Size B"), _("Size C") }; - int m_ShowPageLimitsNChoices = sizeof( m_ShowPageLimitsChoices ) / sizeof( wxString ); - m_ShowPageLimits = new wxRadioBox( this, wxID_ANY, _("Page:"), wxDefaultPosition, wxDefaultSize, m_ShowPageLimitsNChoices, m_ShowPageLimitsChoices, 1, wxRA_SPECIFY_COLS ); - m_ShowPageLimits->SetSelection( 0 ); - bRightSizer->Add( m_ShowPageLimits, 0, wxALL|wxEXPAND, 5 ); - - wxStaticBoxSizer* bLeftBottomSizer; - bLeftBottomSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pan and Zoom:") ), wxVERTICAL ); - - m_OptZoomNoCenter = new wxCheckBox( bLeftBottomSizer->GetStaticBox(), wxID_ANY, _("Do not center and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 ); - m_OptZoomNoCenter->SetToolTip( _("Keep the cursor at its current location when zooming") ); - - bLeftBottomSizer->Add( m_OptZoomNoCenter, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); - - m_OptMousewheelPan = new wxCheckBox( bLeftBottomSizer->GetStaticBox(), wxID_ANY, _("Use touchpad to pan"), wxDefaultPosition, wxDefaultSize, 0 ); - m_OptMousewheelPan->SetToolTip( _("Use touchpad to pan canvas") ); - - bLeftBottomSizer->Add( m_OptMousewheelPan, 0, wxALL, 5 ); - - - bRightSizer->Add( bLeftBottomSizer, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - wxStaticBoxSizer* sbSizer2; - sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User Interface:") ), wxVERTICAL ); - - wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 0, 3, 0, 0 ); - fgSizer1->AddGrowableCol( 1 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); - fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticText1 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Icon scale:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1->Wrap( -1 ); - fgSizer1->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); - - m_scaleSlider = new STEPPED_SLIDER( sbSizer2->GetStaticBox(), wxID_ANY, 50, 50, 275, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS ); - fgSizer1->Add( m_scaleSlider, 0, wxALL|wxEXPAND, 3 ); - - m_staticText2 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText2->Wrap( -1 ); - fgSizer1->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); - - - fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_scaleAuto = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Auto"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_scaleAuto, 0, wxALL, 5 ); - - - fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); - - - sbSizer2->Add( fgSizer1, 1, wxALL|wxEXPAND, 5 ); - - - bRightSizer->Add( sbSizer2, 1, wxALL|wxEXPAND, 5 ); - - - m_UpperSizer->Add( bRightSizer, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - - bDialogSizer->Add( m_UpperSizer, 1, wxEXPAND, 5 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bDialogSizer->Add( m_staticline1, 0, wxEXPAND|wxLEFT|wxRIGHT, 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(); - - bDialogSizer->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 ); - - - this->SetSizer( bDialogSizer ); - this->Layout(); - bDialogSizer->Fit( this ); - - // Connect Events - m_scaleSlider->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleAuto->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleAuto ), NULL, this ); - m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnCancelButtonClick ), NULL, this ); - m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnOKBUttonClick ), NULL, this ); -} - -DIALOG_DISPLAY_OPTIONS_BASE::~DIALOG_DISPLAY_OPTIONS_BASE() -{ - // Disconnect Events - m_scaleSlider->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleSlider ), NULL, this ); - m_scaleAuto->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnScaleAuto ), NULL, this ); - m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnCancelButtonClick ), NULL, this ); - m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnOKBUttonClick ), NULL, this ); - -} diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.h b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.h deleted file mode 100644 index 9064e6d499..0000000000 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.h +++ /dev/null @@ -1,75 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __GERBVIEW_DIALOG_DISPLAY_OPTIONS_FRAME_BASE_H__ -#define __GERBVIEW_DIALOG_DISPLAY_OPTIONS_FRAME_BASE_H__ - -#include -#include -#include -#include "widgets/stepped_slider.h" -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_DISPLAY_OPTIONS_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM -{ - private: - - protected: - wxBoxSizer* m_UpperSizer; - wxRadioBox* m_PolarDisplay; - wxRadioBox* m_BoxUnits; - wxRadioBox* m_OptDisplayFlashedItems; - wxRadioBox* m_OptDisplayLines; - wxRadioBox* m_OptDisplayPolygons; - wxCheckBox* m_OptDisplayDCodes; - wxRadioBox* m_ShowPageLimits; - wxCheckBox* m_OptZoomNoCenter; - wxCheckBox* m_OptMousewheelPan; - wxStaticText* m_staticText1; - STEPPED_SLIDER* m_scaleSlider; - wxStaticText* m_staticText2; - wxCheckBox* m_scaleAuto; - wxStaticLine* m_staticline1; - wxStdDialogButtonSizer* m_sdbSizer1; - wxButton* m_sdbSizer1OK; - wxButton* m_sdbSizer1Cancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnScaleSlider( wxScrollEvent& event ) { event.Skip(); } - virtual void OnScaleAuto( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOKBUttonClick( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Gerbview Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_DISPLAY_OPTIONS_BASE(); - -}; - -#endif //__GERBVIEW_DIALOG_DISPLAY_OPTIONS_FRAME_BASE_H__ diff --git a/gerbview/dialogs/panel_gerbview_display_options.cpp b/gerbview/dialogs/panel_gerbview_display_options.cpp new file mode 100644 index 0000000000..c47f76aec3 --- /dev/null +++ b/gerbview/dialogs/panel_gerbview_display_options.cpp @@ -0,0 +1,109 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2010-2014 Jean-Pierre Charras jp.charras at wanadoo.fr + * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include "panel_gerbview_display_options.h" + + +PANEL_GERBVIEW_DISPLAY_OPTIONS::PANEL_GERBVIEW_DISPLAY_OPTIONS( GERBVIEW_FRAME *aFrame, + wxWindow* aWindow ) : + PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( aWindow, wxID_ANY ), + m_Parent( aFrame ) +{ + KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_Parent->GetGalDisplayOptions(); + m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions ); + m_galOptionsSizer->Add( m_galOptsPanel, 0, wxEXPAND | wxTOP | wxLEFT, 5 ); +} + + +bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataToWindow( ) +{ + m_galOptsPanel->TransferDataToWindow(); + + // Show Option Draw Lines. We use DisplayPcbTrackFill as Lines draw option + m_OptDisplayLines->SetValue( !m_Parent->m_DisplayOptions.m_DisplayLinesFill ); + m_OptDisplayFlashedItems->SetValue( !m_Parent->m_DisplayOptions.m_DisplayFlashedItemsFill ); + + // Show Option Draw polygons + m_OptDisplayPolygons->SetValue( !m_Parent->m_DisplayOptions.m_DisplayPolygonsFill ); + + m_OptDisplayDCodes->SetValue( m_Parent->IsElementVisible( LAYER_DCODES ) ); + + return true; +} + + +bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow() +{ + auto displayOptions = (GBR_DISPLAY_OPTIONS*) m_Parent->GetDisplayOptions(); + + bool needs_repaint = false, option; + + option = !m_OptDisplayLines->GetValue(); + + if( option != m_Parent->m_DisplayOptions.m_DisplayLinesFill ) + needs_repaint = true; + + m_Parent->m_DisplayOptions.m_DisplayLinesFill = option; + + option = !m_OptDisplayFlashedItems->GetValue(); + + if( option != m_Parent->m_DisplayOptions.m_DisplayFlashedItemsFill ) + needs_repaint = true; + + m_Parent->m_DisplayOptions.m_DisplayFlashedItemsFill = option; + + option = !m_OptDisplayPolygons->GetValue(); + + if( option != m_Parent->m_DisplayOptions.m_DisplayPolygonsFill ) + needs_repaint = true; + + m_Parent->m_DisplayOptions.m_DisplayPolygonsFill = option; + + m_Parent->SetElementVisibility( LAYER_DCODES, m_OptDisplayDCodes->GetValue() ); + + m_galOptsPanel->TransferDataFromWindow(); + + // Apply changes to the GAL + auto view = m_Parent->GetGalCanvas()->GetView(); + auto painter = dynamic_cast( view->GetPainter() ); + auto settings = painter->GetSettings(); + settings->LoadDisplayOptions( displayOptions ); + view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); + + if( needs_repaint ) + view->UpdateAllItems( KIGFX::REPAINT ); + + m_Parent->GetCanvas()->Refresh(); + + return true; +} + diff --git a/gerbview/dialogs/panel_gerbview_display_options.h b/gerbview/dialogs/panel_gerbview_display_options.h new file mode 100644 index 0000000000..a2ca7ad8aa --- /dev/null +++ b/gerbview/dialogs/panel_gerbview_display_options.h @@ -0,0 +1,51 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef KICAD_PANEL_GERBVIEW_DISPLAY_OPTIONS_H +#define KICAD_PANEL_GERBVIEW_DISPLAY_OPTIONS_H + +#include "panel_gerbview_display_options_base.h" + + +class GERBVIEW_FRAME; +class GAL_OPTIONS_PANEL; + + +class PANEL_GERBVIEW_DISPLAY_OPTIONS : public PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE +{ +private: + GERBVIEW_FRAME* m_Parent; + GAL_OPTIONS_PANEL* m_galOptsPanel; + +public: + PANEL_GERBVIEW_DISPLAY_OPTIONS( GERBVIEW_FRAME* aFrame, wxWindow* aWindow ); + ~PANEL_GERBVIEW_DISPLAY_OPTIONS() {}; + +private: + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; +}; + + + +#endif //KICAD_PANEL_GERBVIEW_DISPLAY_OPTIONS_H diff --git a/gerbview/dialogs/panel_gerbview_display_options_base.cpp b/gerbview/dialogs/panel_gerbview_display_options_base.cpp new file mode 100644 index 0000000000..05083ebe9c --- /dev/null +++ b/gerbview/dialogs/panel_gerbview_display_options_base.cpp @@ -0,0 +1,66 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_gerbview_display_options_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bDialogSizer; + bDialogSizer = new wxBoxSizer( wxVERTICAL ); + + m_UpperSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_galOptionsSizer = new wxBoxSizer( wxVERTICAL ); + + + m_UpperSizer->Add( m_galOptionsSizer, 1, wxEXPAND|wxTOP|wxLEFT, 5 ); + + wxBoxSizer* bRightSizer; + bRightSizer = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer1; + sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Annotations") ), wxVERTICAL ); + + m_OptDisplayDCodes = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Show D codes"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayDCodes->SetValue(true); + sbSizer1->Add( m_OptDisplayDCodes, 0, wxBOTTOM|wxLEFT, 5 ); + + + bRightSizer->Add( sbSizer1, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + wxStaticBoxSizer* sbSizer2; + sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Drawing Mode") ), wxVERTICAL ); + + m_OptDisplayFlashedItems = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Sketch flashed items"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer2->Add( m_OptDisplayFlashedItems, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_OptDisplayLines = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Sketch lines"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer2->Add( m_OptDisplayLines, 0, wxALL, 5 ); + + m_OptDisplayPolygons = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Sketch polygons"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer2->Add( m_OptDisplayPolygons, 0, wxALL, 5 ); + + + bRightSizer->Add( sbSizer2, 0, wxEXPAND|wxTOP|wxLEFT, 5 ); + + + m_UpperSizer->Add( bRightSizer, 1, wxEXPAND|wxTOP|wxLEFT, 10 ); + + + bDialogSizer->Add( m_UpperSizer, 1, wxEXPAND, 5 ); + + + this->SetSizer( bDialogSizer ); + this->Layout(); + bDialogSizer->Fit( this ); +} + +PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::~PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE() +{ +} diff --git a/gerbview/dialogs/panel_gerbview_display_options_base.fbp b/gerbview/dialogs/panel_gerbview_display_options_base.fbp new file mode 100644 index 0000000000..0a9a171696 --- /dev/null +++ b/gerbview/dialogs/panel_gerbview_display_options_base.fbp @@ -0,0 +1,504 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + panel_gerbview_display_options_base + 1000 + none + 1 + PanelGerbviewDisplayOptions + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE + + -1,-1 + ; forward_declare + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bDialogSizer + wxVERTICAL + none + + 5 + wxEXPAND + 1 + + + m_UpperSizer + wxHORIZONTAL + protected + + 5 + wxEXPAND|wxTOP|wxLEFT + 1 + + + m_galOptionsSizer + wxVERTICAL + protected + + + + 10 + wxEXPAND|wxTOP|wxLEFT + 1 + + + bRightSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT + 0 + + wxID_ANY + Annotations + + sbSizer1 + wxVERTICAL + 1 + none + + + 5 + wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show D codes + + 0 + + + 0 + + 1 + m_OptDisplayDCodes + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxLEFT + 0 + + wxID_ANY + Drawing Mode + + sbSizer2 + wxVERTICAL + 1 + none + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Sketch flashed items + + 0 + + + 0 + + 1 + m_OptDisplayFlashedItems + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Sketch lines + + 0 + + + 0 + + 1 + m_OptDisplayLines + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Sketch polygons + + 0 + + + 0 + + 1 + m_OptDisplayPolygons + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gerbview/dialogs/panel_gerbview_display_options_base.h b/gerbview/dialogs/panel_gerbview_display_options_base.h new file mode 100644 index 0000000000..f50a64698a --- /dev/null +++ b/gerbview/dialogs/panel_gerbview_display_options_base.h @@ -0,0 +1,49 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE_H__ +#define __PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE : public wxPanel +{ + private: + + protected: + wxBoxSizer* m_UpperSizer; + wxBoxSizer* m_galOptionsSizer; + wxCheckBox* m_OptDisplayDCodes; + wxCheckBox* m_OptDisplayFlashedItems; + wxCheckBox* m_OptDisplayLines; + wxCheckBox* m_OptDisplayPolygons; + + public: + + PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE(); + +}; + +#endif //__PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE_H__ diff --git a/gerbview/dialogs/panel_gerbview_settings.cpp b/gerbview/dialogs/panel_gerbview_settings.cpp new file mode 100644 index 0000000000..c4bb8bb336 --- /dev/null +++ b/gerbview/dialogs/panel_gerbview_settings.cpp @@ -0,0 +1,68 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2010-2014 Jean-Pierre Charras jp.charras at wanadoo.fr + * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + + +#include +#include +#include +#include +#include + +#include "panel_gerbview_settings.h" + + +PANEL_GERBVIEW_SETTINGS::PANEL_GERBVIEW_SETTINGS( GERBVIEW_FRAME *aFrame, wxWindow* aWindow ) : + PANEL_GERBVIEW_SETTINGS_BASE( aWindow, wxID_ANY ), + m_Parent( aFrame ) +{ +} + + +bool PANEL_GERBVIEW_SETTINGS::TransferDataToWindow( ) +{ + m_PolarDisplay->SetSelection( m_Parent->m_DisplayOptions.m_DisplayPolarCood ? 1 : 0 ); + m_BoxUnits->SetSelection( m_Parent->GetUserUnits() ? 1 : 0 ); + m_ShowPageLimitsOpt->SetValue( m_Parent->m_DisplayOptions.m_DisplayPageLimits ); + + for( unsigned i = 0; i < DIM( g_GerberPageSizeList ); ++i ) + { + if( g_GerberPageSizeList[i] == m_Parent->GetPageSettings().GetType() ) + { + m_PageSize->SetSelection( i ); + break; + } + } + + return true; +} + + +bool PANEL_GERBVIEW_SETTINGS::TransferDataFromWindow() +{ + m_Parent->m_DisplayOptions.m_DisplayPolarCood = ( m_PolarDisplay->GetSelection() != 0 ); + m_Parent->SetUserUnits( m_BoxUnits->GetSelection() == 0 ? INCHES : MILLIMETRES ); + m_Parent->m_DisplayOptions.m_DisplayPageLimits = m_ShowPageLimitsOpt->GetValue(); + + PAGE_INFO pageInfo( g_GerberPageSizeList[ m_PageSize->GetSelection() ] ); + m_Parent->SetPageSettings( pageInfo ); + + return true; +} + diff --git a/gerbview/dialogs/dialog_show_page_borders.h b/gerbview/dialogs/panel_gerbview_settings.h similarity index 61% rename from gerbview/dialogs/dialog_show_page_borders.h rename to gerbview/dialogs/panel_gerbview_settings.h index 6c341f4464..4815b751a3 100644 --- a/gerbview/dialogs/dialog_show_page_borders.h +++ b/gerbview/dialogs/panel_gerbview_settings.h @@ -1,13 +1,7 @@ -/** - * @file dialog_show_page_borders.h - * Dialog to show/hide frame reference and select paper size for printing - */ - /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2011 jean-pierre.charras@gipsa-lab.inpg.fr - * Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -27,21 +21,26 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#ifndef KICAD_PANEL_GERBVIEW_SETTINGS_H +#define KICAD_PANEL_GERBVIEW_SETTINGS_H -class DIALOG_PAGE_SHOW_PAGE_BORDERS : public DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE +#include "panel_gerbview_settings_base.h" + +class GERBVIEW_FRAME; + +class PANEL_GERBVIEW_SETTINGS : public PANEL_GERBVIEW_SETTINGS_BASE { private: - GERBVIEW_FRAME* m_Parent; + GERBVIEW_FRAME* m_Parent; public: - - DIALOG_PAGE_SHOW_PAGE_BORDERS( GERBVIEW_FRAME* parent ); - ~DIALOG_PAGE_SHOW_PAGE_BORDERS() {}; + PANEL_GERBVIEW_SETTINGS( GERBVIEW_FRAME* aFrame, wxWindow* aWindow ); + ~PANEL_GERBVIEW_SETTINGS() {}; private: - void OnOKBUttonClick( wxCommandEvent& event ) override; - void OnCancelButtonClick( wxCommandEvent& event ) override; + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; }; +#endif //KICAD_PANEL_GERBVIEW_SETTINGS_H diff --git a/gerbview/dialogs/panel_gerbview_settings_base.cpp b/gerbview/dialogs/panel_gerbview_settings_base.cpp new file mode 100644 index 0000000000..02240bb7a4 --- /dev/null +++ b/gerbview/dialogs/panel_gerbview_settings_base.cpp @@ -0,0 +1,57 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_gerbview_settings_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_GERBVIEW_SETTINGS_BASE::PANEL_GERBVIEW_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bDialogSizer; + bDialogSizer = new wxBoxSizer( wxVERTICAL ); + + m_UpperSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bLeftSizer; + bLeftSizer = new wxBoxSizer( wxVERTICAL ); + + wxString m_PolarDisplayChoices[] = { _("Cartesian coordinates"), _("Polar coordinates") }; + int m_PolarDisplayNChoices = sizeof( m_PolarDisplayChoices ) / sizeof( wxString ); + m_PolarDisplay = new wxRadioBox( this, wxID_ANY, _("Coordinates"), wxDefaultPosition, wxDefaultSize, m_PolarDisplayNChoices, m_PolarDisplayChoices, 1, wxRA_SPECIFY_COLS ); + m_PolarDisplay->SetSelection( 0 ); + bLeftSizer->Add( m_PolarDisplay, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + wxString m_BoxUnitsChoices[] = { _("Inches"), _("Millimeters") }; + int m_BoxUnitsNChoices = sizeof( m_BoxUnitsChoices ) / sizeof( wxString ); + m_BoxUnits = new wxRadioBox( this, wxID_ANY, _("Units"), wxDefaultPosition, wxDefaultSize, m_BoxUnitsNChoices, m_BoxUnitsChoices, 1, wxRA_SPECIFY_COLS ); + m_BoxUnits->SetSelection( 0 ); + bLeftSizer->Add( m_BoxUnits, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + wxString m_PageSizeChoices[] = { _("Full size"), _("Size A4"), _("Size A3"), _("Size A2"), _("Size A"), _("Size B"), _("Size C") }; + int m_PageSizeNChoices = sizeof( m_PageSizeChoices ) / sizeof( wxString ); + m_PageSize = new wxRadioBox( this, wxID_ANY, _("Page Size"), wxDefaultPosition, wxDefaultSize, m_PageSizeNChoices, m_PageSizeChoices, 1, wxRA_SPECIFY_COLS ); + m_PageSize->SetSelection( 0 ); + bLeftSizer->Add( m_PageSize, 0, wxEXPAND|wxTOP|wxLEFT, 5 ); + + m_ShowPageLimitsOpt = new wxCheckBox( this, wxID_ANY, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 0 ); + bLeftSizer->Add( m_ShowPageLimitsOpt, 0, wxALL, 10 ); + + + m_UpperSizer->Add( bLeftSizer, 0, wxEXPAND|wxTOP|wxLEFT, 10 ); + + + bDialogSizer->Add( m_UpperSizer, 0, wxEXPAND|wxTOP|wxLEFT, 5 ); + + + this->SetSizer( bDialogSizer ); + this->Layout(); + bDialogSizer->Fit( this ); +} + +PANEL_GERBVIEW_SETTINGS_BASE::~PANEL_GERBVIEW_SETTINGS_BASE() +{ +} diff --git a/gerbview/dialogs/panel_gerbview_settings_base.fbp b/gerbview/dialogs/panel_gerbview_settings_base.fbp new file mode 100644 index 0000000000..9fa0d7969c --- /dev/null +++ b/gerbview/dialogs/panel_gerbview_settings_base.fbp @@ -0,0 +1,469 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + panel_gerbview_settings_base + 1000 + none + 1 + PanelGerbviewSettings + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_GERBVIEW_SETTINGS_BASE + + -1,-1 + ; forward_declare + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bDialogSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxTOP|wxLEFT + 0 + + + m_UpperSizer + wxVERTICAL + protected + + 10 + wxEXPAND|wxTOP|wxLEFT + 0 + + + bLeftSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Cartesian coordinates" "Polar coordinates" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Coordinates + 1 + + 0 + + + 0 + + 1 + m_PolarDisplay + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Inches" "Millimeters" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Units + 1 + + 0 + + + 0 + + 1 + m_BoxUnits + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Full size" "Size A4" "Size A3" "Size A2" "Size A" "Size B" "Size C" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Page Size + 1 + + 0 + + + 0 + + 1 + m_PageSize + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show page limits + + 0 + + + 0 + + 1 + m_ShowPageLimitsOpt + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gerbview/dialogs/panel_gerbview_settings_base.h b/gerbview/dialogs/panel_gerbview_settings_base.h new file mode 100644 index 0000000000..587f7206bb --- /dev/null +++ b/gerbview/dialogs/panel_gerbview_settings_base.h @@ -0,0 +1,48 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __PANEL_GERBVIEW_SETTINGS_BASE_H__ +#define __PANEL_GERBVIEW_SETTINGS_BASE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_GERBVIEW_SETTINGS_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_GERBVIEW_SETTINGS_BASE : public wxPanel +{ + private: + + protected: + wxBoxSizer* m_UpperSizer; + wxRadioBox* m_PolarDisplay; + wxRadioBox* m_BoxUnits; + wxRadioBox* m_PageSize; + wxCheckBox* m_ShowPageLimitsOpt; + + public: + + PANEL_GERBVIEW_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_GERBVIEW_SETTINGS_BASE(); + +}; + +#endif //__PANEL_GERBVIEW_SETTINGS_BASE_H__ diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index 668c5c3d24..a87c25538e 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include #include @@ -62,7 +61,6 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, EDA_DRAW_FRAME ) EVT_TOOL( ID_GERBVIEW_LOAD_ZIP_ARCHIVE_FILE, GERBVIEW_FRAME::Files_io ) EVT_TOOL( ID_GERBVIEW_LOAD_JOB_FILE, GERBVIEW_FRAME::Files_io ) EVT_TOOL( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io ) - EVT_TOOL( ID_GERBVIEW_SET_PAGE_BORDER, GERBVIEW_FRAME::Process_Special_Functions ) // Menu Files: EVT_MENU( wxID_FILE, GERBVIEW_FRAME::Files_io ) @@ -83,10 +81,9 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, EDA_DRAW_FRAME ) EVT_MENU( wxID_EXIT, GERBVIEW_FRAME::OnQuit ) // menu Preferences - EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, - GERBVIEW_FRAME::Process_Config ) + EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, GERBVIEW_FRAME::Process_Config ) - EVT_MENU( wxID_PREFERENCES, GERBVIEW_FRAME::InstallGerberOptionsDialog ) + EVT_MENU( wxID_PREFERENCES, GERBVIEW_FRAME::Process_Config ) EVT_UPDATE_UI( ID_MENU_CANVAS_LEGACY, GERBVIEW_FRAME::OnUpdateSwitchCanvas ) EVT_UPDATE_UI( ID_MENU_CANVAS_CAIRO, GERBVIEW_FRAME::OnUpdateSwitchCanvas ) EVT_UPDATE_UI( ID_MENU_CANVAS_OPENGL, GERBVIEW_FRAME::OnUpdateSwitchCanvas ) @@ -97,8 +94,6 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, EDA_DRAW_FRAME ) // menu Postprocess EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, GERBVIEW_FRAME::Process_Special_Functions ) EVT_MENU( ID_GERBVIEW_SHOW_SOURCE, GERBVIEW_FRAME::OnShowGerberSourceFile ) - EVT_MENU( ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR, - EDA_BASE_FRAME::OnSelectPreferredEditor ) // menu Miscellaneous EVT_MENU( ID_GERBVIEW_ERASE_CURR_LAYER, GERBVIEW_FRAME::Process_Special_Functions ) @@ -215,15 +210,6 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) switch( id ) { - case ID_GERBVIEW_SET_PAGE_BORDER: - { - DIALOG_PAGE_SHOW_PAGE_BORDERS dlg( this ); - - if( dlg.ShowModal() == wxID_OK ) - m_canvas->Refresh(); - } - break; - case ID_GERBVIEW_ERASE_CURR_LAYER: Erase_Current_DrawLayer( true ); ClearMsgPanel(); diff --git a/gerbview/gbr_display_options.h b/gerbview/gbr_display_options.h index b46e42ae4f..f830e86051 100644 --- a/gerbview/gbr_display_options.h +++ b/gerbview/gbr_display_options.h @@ -44,6 +44,7 @@ public: bool m_DisplayPolygonsFill; ///< Option to draw polygons (filled/sketch) bool m_DisplayPolarCood; ///< Option to display coordinates in status bar in X,Y or Polar coords bool m_DisplayDCodes; ///< Option to show dcode values on items drawn with a dcode tool + bool m_DisplayPageLimits; bool m_DisplayNegativeObjects; ///< Option to draw negative objects in a specific color bool m_IsPrinting; ///< true when printing a page, false when drawing on screen bool m_ForceBlackAndWhite; ///< Option print in blackand white (ont used id draw mode @@ -62,6 +63,7 @@ public: m_DisplayPolygonsFill = true; m_DisplayPolarCood = false; m_DisplayDCodes = false; + m_DisplayPageLimits = false; m_IsPrinting = false; m_DisplayNegativeObjects = false; m_ForceBlackAndWhite = false; diff --git a/gerbview/gerbview.cpp b/gerbview/gerbview.cpp index eb7248dae1..ae6f4147d4 100644 --- a/gerbview/gerbview.cpp +++ b/gerbview/gerbview.cpp @@ -35,9 +35,9 @@ #include #include -const wxChar* g_GerberPageSizeList[] = { - wxT( "GERBER" ), // index 0: full size page selection, and do not show page limits - wxT( "GERBER" ), // index 1: full size page selection, and show page limits +const wxChar* g_GerberPageSizeList[] = +{ + wxT( "GERBER" ), // index 0: full size page selection wxT( "A4" ), wxT( "A3" ), wxT( "A2" ), diff --git a/gerbview/gerbview.h b/gerbview/gerbview.h index 15f7d0e062..60c2c760c2 100644 --- a/gerbview/gerbview.h +++ b/gerbview/gerbview.h @@ -33,7 +33,7 @@ #define CURSEUR_OFF_GRILLE 1 /// List of page sizes -extern const wxChar* g_GerberPageSizeList[8]; +extern const wxChar* g_GerberPageSizeList[7]; // Interpolation type diff --git a/gerbview/gerbview_config.cpp b/gerbview/gerbview_config.cpp index 0cd1b3e983..5933b1b7b3 100644 --- a/gerbview/gerbview_config.cpp +++ b/gerbview/gerbview_config.cpp @@ -33,12 +33,11 @@ #include #include #include - -#include #include #include -#include - +#include +#include +#include void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event ) { @@ -46,21 +45,11 @@ void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event ) switch( id ) { - // Hotkey IDs - case ID_PREFERENCES_HOTKEY_EXPORT_CONFIG: - ExportHotkeyConfigToFile( GerbviewHokeysDescr, wxT( "gerbview" ) ); - break; - - case ID_PREFERENCES_HOTKEY_IMPORT_CONFIG: - ImportHotkeyConfigFromFile( GerbviewHokeysDescr, wxT( "gerbview" ) ); - break; - - case ID_PREFERENCES_HOTKEY_SHOW_EDITOR: - InstallHotkeyFrame( this, GerbviewHokeysDescr ); + case wxID_PREFERENCES: + ShowPreferences( GerbviewHokeysDescr, GerbviewHokeysDescr, wxT( "gerbview" ) ); break; case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST: - // Display current hotkey list for GerbView. DisplayHotkeyList( this, GerbviewHokeysDescr ); break; @@ -72,6 +61,13 @@ void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event ) } +void GERBVIEW_FRAME::InstallPreferences( PAGED_DIALOG* aParent ) +{ + aParent->AddPage( new PANEL_GERBVIEW_SETTINGS( this, aParent ), _( "Gerbview" ) ); + aParent->AddSubPage( new PANEL_GERBVIEW_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) ); +} + + PARAM_CFG_ARRAY& GERBVIEW_FRAME::GetConfigurationSettings() { if( !m_configSettings.empty() ) diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index ccd60dd26b..97fba85bfe 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -1279,18 +1279,10 @@ void GERBVIEW_FRAME::setupTools() } -int GERBVIEW_FRAME::GetIconScale() +void GERBVIEW_FRAME::CommonSettingsChanged() { - int scale = 0; - Kiface().KifaceSettings()->Read( IconScaleEntry, &scale, 0 ); - return scale; -} + EDA_DRAW_FRAME::CommonSettingsChanged(); - -void GERBVIEW_FRAME::SetIconScale( int aScale ) -{ - Kiface().KifaceSettings()->Write( IconScaleEntry, aScale ); - ReCreateMenuBar(); ReCreateHToolbar(); ReCreateOptToolbar(); ReCreateAuxiliaryToolbar(); diff --git a/gerbview/gerbview_frame.h b/gerbview/gerbview_frame.h index 5365bde69f..413b76eb00 100644 --- a/gerbview/gerbview_frame.h +++ b/gerbview/gerbview_frame.h @@ -30,7 +30,6 @@ #include #include #include - #include #include #include @@ -756,8 +755,15 @@ public: */ void OnUpdateSwitchCanvas( wxUpdateUIEvent& aEvent ); - int GetIconScale() override; - void SetIconScale( int aScale ) override; + /** + * Allows Gerbview to install its preferences panels into the preferences dialog. + */ + void InstallPreferences( PAGED_DIALOG* aParent ) override; + + /** + * Called after the preferences dialog is run. + */ + void CommonSettingsChanged() override; DECLARE_EVENT_TABLE() }; diff --git a/gerbview/gerbview_id.h b/gerbview/gerbview_id.h index e33568848e..39a2478430 100644 --- a/gerbview/gerbview_id.h +++ b/gerbview/gerbview_id.h @@ -93,7 +93,6 @@ enum gerbview_ids ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER, ID_GERBVIEW_ERASE_CURR_LAYER, ID_GERBVIEW_OPTIONS_SETUP, - ID_GERBVIEW_SET_PAGE_BORDER, ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR, ID_TB_OPTIONS_SHOW_DCODES, ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH, diff --git a/gerbview/menubar.cpp b/gerbview/menubar.cpp index fb6c3fb696..d5687f53a5 100644 --- a/gerbview/menubar.cpp +++ b/gerbview/menubar.cpp @@ -285,89 +285,63 @@ void GERBVIEW_FRAME::ReCreateMenuBar() wxMenu* configMenu = new wxMenu; // Options (Preferences on WXMAC) -#ifdef __WXMAC__ - configMenu->Append(wxID_PREFERENCES); -#else AddMenuItem( configMenu, wxID_PREFERENCES, - _( "&Options" ), - _( "Set options to draw items" ), + _( "&Preferences..." ), + wxEmptyString, KiBitmap( preference_xpm ) ); -#endif // __WXMAC__ - - // Language submenu - Pgm().AddMenuLanguageList( configMenu ); - - // Icons options submenu - AddMenuIconsOptions( configMenu ); - - // Hotkey submenu - AddHotkeyConfigMenu( configMenu ); // Canvas selection configMenu->AppendSeparator(); - text = AddHotkeyName( _( "Legacy Tool&set" ), GerbviewHokeysDescr, - HK_CANVAS_LEGACY ); + text = AddHotkeyName( _( "Legacy Tool&set" ), GerbviewHokeysDescr, HK_CANVAS_LEGACY ); AddMenuItem( configMenu, ID_MENU_CANVAS_LEGACY, text, _( "Use Legacy Toolset (not all features will be available)" ), KiBitmap( tools_xpm ), wxITEM_RADIO ); - text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), GerbviewHokeysDescr, - HK_CANVAS_OPENGL ); + text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), GerbviewHokeysDescr, HK_CANVAS_OPENGL ); AddMenuItem( configMenu, ID_MENU_CANVAS_OPENGL, text, _( "Use Modern Toolset with hardware-accelerated graphics (recommended)" ), KiBitmap( tools_xpm ), wxITEM_RADIO ); - text = AddHotkeyName( _( "Modern Toolset (Fallba&ck)" ), GerbviewHokeysDescr, - HK_CANVAS_CAIRO ); + text = AddHotkeyName( _( "Modern Toolset (Fallba&ck)" ), GerbviewHokeysDescr, HK_CANVAS_CAIRO ); AddMenuItem( configMenu, ID_MENU_CANVAS_CAIRO, text, _( "Use Modern Toolset with software graphics (fall-back)" ), KiBitmap( tools_xpm ), wxITEM_RADIO ); + configMenu->AppendSeparator(); + + // Language submenu + Pgm().AddMenuLanguageList( configMenu ); + // Menu miscellaneous wxMenu* miscellaneousMenu = new wxMenu; // List dcodes - AddMenuItem( miscellaneousMenu, ID_GERBVIEW_SHOW_LIST_DCODES, - _( "&List DCodes" ), + AddMenuItem( miscellaneousMenu, ID_GERBVIEW_SHOW_LIST_DCODES, _( "&List DCodes..." ), _( "List D-codes defined in Gerber files" ), KiBitmap( show_dcodenumber_xpm ) ); // Show source - AddMenuItem( miscellaneousMenu, ID_GERBVIEW_SHOW_SOURCE, - _( "&Show Source" ), + AddMenuItem( miscellaneousMenu, ID_GERBVIEW_SHOW_SOURCE, _( "&Show Source..." ), _( "Show source file for the current layer" ), KiBitmap( tools_xpm ) ); - // Separator miscellaneousMenu->AppendSeparator(); // Erase graphic layer - AddMenuItem( miscellaneousMenu, ID_GERBVIEW_ERASE_CURR_LAYER, - _( "&Clear Current Layer" ), + AddMenuItem( miscellaneousMenu, ID_GERBVIEW_ERASE_CURR_LAYER, _( "&Clear Current Layer..." ), _( "Clear the graphic layer currently selected" ), KiBitmap( delete_sheet_xpm ) ); - // Separator - miscellaneousMenu->AppendSeparator(); - - // Text editor (usefull to browse source files) - AddMenuItem( miscellaneousMenu, ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR, - _( "Set &Text Editor..." ), - _( "Select your preferred text editor" ), - KiBitmap( editor_xpm ) ); - // Help menu wxMenu* helpMenu = new wxMenu; - AddMenuItem( helpMenu, wxID_HELP, - _( "Gerbview &Manual" ), + AddMenuItem( helpMenu, wxID_HELP, _( "Gerbview &Manual" ), _( "Open the GerbView Manual" ), KiBitmap( online_help_xpm ) ); text = AddHotkeyName( _( "&List Hotkeys..." ), GerbviewHokeysDescr, HK_HELP ); - AddMenuItem( helpMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, - text, + AddMenuItem( helpMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, text, _( "Displays the current hotkeys list and corresponding commands" ), KiBitmap( hotkeys_xpm ) ); @@ -375,23 +349,20 @@ void GERBVIEW_FRAME::ReCreateMenuBar() helpMenu->AppendSeparator(); // Get involved with KiCad - AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED, - _( "Get &Involved" ), + AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED, _( "Get &Involved" ), _( "Contribute to KiCad (opens a web browser)" ), KiBitmap( info_xpm ) ); helpMenu->AppendSeparator(); // About Kicad - AddMenuItem( helpMenu, wxID_ABOUT, - _( "&About KiCad" ), _( "About KiCad" ), - KiBitmap( about_xpm ) ); + AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) ); // Append menus to the menubar menuBar->Append( fileMenu, _( "&File" ) ); menuBar->Append( viewMenu, _( "&View" ) ); + menuBar->Append( miscellaneousMenu, _( "&Tools" ) ); menuBar->Append( configMenu, _( "&Preferences" ) ); - menuBar->Append( miscellaneousMenu, _( "&Miscellaneous" ) ); menuBar->Append( helpMenu, _( "&Help" ) ); // Associate the menu bar with the frame, if no previous menubar diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp index 74b3dc6085..27e4de97ef 100644 --- a/gerbview/toolbars_gerber.cpp +++ b/gerbview/toolbars_gerber.cpp @@ -64,10 +64,6 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void ) _( "Open Excellon drill file(s) on the current layer. Previous data will be deleted" ) ); KiScaledSeparator( m_mainToolBar, this ); - m_mainToolBar->AddTool( ID_GERBVIEW_SET_PAGE_BORDER, wxEmptyString, KiScaledBitmap( sheetset_xpm, this ), - _( "Show/hide frame reference and select paper size for printing" ) ); - - m_mainToolBar->AddSeparator(); m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiScaledBitmap( print_button_xpm, this ), _( "Print layers" ) ); diff --git a/include/bitmaps.h b/include/bitmaps.h index a875e83771..6a33252d11 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -248,8 +248,8 @@ EXTERN_BITMAP( label2glabel_xpm ) EXTERN_BITMAP( label2text_xpm ) EXTERN_BITMAP( label_xpm ) EXTERN_BITMAP( lang_bg_xpm ) -EXTERN_BITMAP( lang_catalan_xpm ) -EXTERN_BITMAP( lang_chinese_xpm ) +EXTERN_BITMAP( lang_ca_xpm ) +EXTERN_BITMAP( lang_zh_xpm ) EXTERN_BITMAP( lang_cs_xpm ) EXTERN_BITMAP( lang_def_xpm ) EXTERN_BITMAP( lang_de_xpm ) diff --git a/include/draw_frame.h b/include/draw_frame.h index d06c4448df..beecc9ac3b 100644 --- a/include/draw_frame.h +++ b/include/draw_frame.h @@ -178,6 +178,8 @@ protected: */ virtual void unitsChangeRefresh(); + void CommonSettingsChanged() override; + /** * Function GeneralControlKeyMovement * Handle the common part of GeneralControl dedicated to global @@ -277,6 +279,9 @@ public: virtual const wxPoint& GetGridOrigin() const = 0; virtual void SetGridOrigin( const wxPoint& aPosition ) = 0; + int GetLastGridSizeId() const { return m_LastGridSizeId; } + void SetLastGridSizeId( int aId ) { m_LastGridSizeId = aId; } + //----------------------------------------------- /** * Function GetCrossHairPosition diff --git a/include/eda_base_frame.h b/include/eda_base_frame.h index 43285dbc3f..25b4afa75e 100644 --- a/include/eda_base_frame.h +++ b/include/eda_base_frame.h @@ -46,6 +46,7 @@ #include #include #include +#include "hotkeys_basic.h" #ifdef USE_WX_OVERLAY #include @@ -85,6 +86,7 @@ class MSG_PANEL_ITEM; class TOOL_MANAGER; class TOOL_DISPATCHER; class ACTIONS; +class PAGED_DIALOG; enum id_librarytype { @@ -226,8 +228,19 @@ public: void GetKicadAbout( wxCommandEvent& event ); + bool ShowPreferences( EDA_HOTKEY_CONFIG* aHotkeys, EDA_HOTKEY_CONFIG* aShowHotkeys, + const wxString& aHotkeysNickname ); + void PrintMsg( const wxString& text ); + /** + * Function InstallPreferences + * allows a Frame to load its preference panels (if any) into the preferences + * dialog. + * @param aParent a paged dialog into which the preference panels should be installed + */ + virtual void InstallPreferences( PAGED_DIALOG* aParent ) { } + /** * Function LoadSettings * loads common frame parameters from a configuration file. @@ -273,14 +286,6 @@ public: */ virtual void SaveProjectSettings( bool aAskForSave ) {}; - /** - * Function OnSelectPreferredEditor - * Open a dialog to select the editor that will used in KiCad - * to edit or display files (reports ... ) - * The full filename editor is saved in configuration (global params) - */ - virtual void OnSelectPreferredEditor( wxCommandEvent& event ); - // Read/Save and Import/export hotkeys config /** @@ -397,28 +402,11 @@ public: virtual void ShowChangedLanguage(); /** - * Function OnChangeIconsOptions - * Selects the current icons options in menus (or toolbars) in Kicad - * (the default for toolbars/menus is 26x26 pixels, and shows icons in menus). + * Function CommonSettingsChanged + * Notification event that some of the common (suite-wide) settings have changed. + * Update menus, toolbars, local variables, etc. */ - virtual void OnChangeIconsOptions( wxCommandEvent& event ); - - /** - * Function ShowChangedIcons - * redraws items menus after a icon was changed option. - */ - virtual void ShowChangedIcons(); - - /** - * Function AddMenuIconsOptions - * creates a menu list for icons in menu and icon sizes choice, - * and add it as submenu to \a MasterMenu. - * - * @param MasterMenu The main menu. The sub menu list will be accessible from the menu - * item with id ID_KICAD_SELECT_ICONS_OPTIONS - */ - void AddMenuIconsOptions( wxMenu* MasterMenu ); - + virtual void CommonSettingsChanged(); /** * Function PostCommandMenuEvent @@ -427,21 +415,6 @@ public: * bound to menu items. */ bool PostCommandMenuEvent( int evt_type ); - - /** - * Function GetIconScale - * - * Return the desired scaling for toolbar/menubar icons in fourths (e.g. 4 is unity). - * A negative number indicates autoscale based on font size. - */ - virtual int GetIconScale() { return -1; } - - /** - * Function SetIconScale - * - * Modify the scale of icons in the window; should refresh them and save the setting. - */ - virtual void SetIconScale( int aScale ) {} }; diff --git a/include/id.h b/include/id.h index d327816df4..5a22d8d020 100644 --- a/include/id.h +++ b/include/id.h @@ -89,12 +89,7 @@ enum main_id ID_MENU_CANVAS_OPENGL, ID_MENU_CANVAS_CAIRO, - ID_PREFERENCES_HOTKEY_START, - ID_PREFERENCES_HOTKEY_EXPORT_CONFIG, - ID_PREFERENCES_HOTKEY_IMPORT_CONFIG, - ID_PREFERENCES_HOTKEY_SHOW_EDITOR, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, - ID_PREFERENCES_HOTKEY_END, ID_PREFERENCES_CONFIGURE_PATHS, ID_GEN_PLOT, diff --git a/include/kiway.h b/include/kiway.h index fd58d912ca..6e27bbf6f6 100644 --- a/include/kiway.h +++ b/include/kiway.h @@ -361,12 +361,11 @@ public: VTBL_ENTRY void SetLanguage( int aLanguage ); /** - * Function ShowChangedIcons - * Calls ShowChangedIcons() on all KIWAY_PLAYERs. - * Used after changing options related to icons in menus and toolbars - * (like enable/disable icons in menus) + * Function CommonSettingsChanged + * Calls CommonSettingsChanged() on all KIWAY_PLAYERs. + * Used after changing suite-wide options such as panning, autosave interval, etc. */ - VTBL_ENTRY void ShowChangedIcons(); + VTBL_ENTRY void CommonSettingsChanged(); KIWAY( PGM_BASE* aProgram, int aCtlBits, wxFrame* aTop = NULL ); diff --git a/include/kiway_player.h b/include/kiway_player.h index 694205c409..4376d1fcd3 100644 --- a/include/kiway_player.h +++ b/include/kiway_player.h @@ -43,7 +43,7 @@ class KIFACE_I; * is a mix in class which holds the location of a wxWindow's KIWAY. It allows * calls to Kiway() and SetKiway(). * - * Known to be used in at least DIALOG_SHIM and KIWAY_PLAYER classes. + * Known to be used in at least DIALOG_SHIM, KICAD_MANAGER_FRAME and KIWAY_PLAYER classes. */ class KIWAY_HOLDER { @@ -245,13 +245,6 @@ protected: */ void language_change( wxCommandEvent& event ); - /** - * Function OnChangeIconsOptions - * is an event handler called on a icons options in menus or toolbars - * menu selection. - */ - void OnChangeIconsOptions( wxCommandEvent& event ) override; - // variables for modal behavior support, only used by a few derivatives. bool m_modal; // true if frame is intended to be modal, not modeless WX_EVENT_LOOP* m_modal_loop; // points to nested event_loop, NULL means not modal and dismissed diff --git a/include/dialog_hotkeys_editor.h b/include/panel_hotkeys_editor.h similarity index 57% rename from include/dialog_hotkeys_editor.h rename to include/panel_hotkeys_editor.h index 1138cc9d84..5087b8666d 100644 --- a/include/dialog_hotkeys_editor.h +++ b/include/panel_hotkeys_editor.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2004-2016 KiCad Developers, see CHANGELOG.TXT for contributors. + * Copyright (C) 2004-2018 KiCad Developers, see CHANGELOG.TXT for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -21,43 +21,33 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file dialog_hotkeys_editor.h - */ - -#ifndef __dialog_hotkeys_editor__ -#define __dialog_hotkeys_editor__ +#ifndef PANEL_HOTKEYS_EDITOR_H +#define PANEL_HOTKEYS_EDITOR_H #include -#include <../common/dialogs/dialog_hotkeys_editor_base.h> +#include "../common/dialogs/panel_hotkeys_editor_base.h" #include -/** - * Class HOTKEYS_EDITOR_DIALOG - * is the child class of HOTKEYS_EDITOR_DIALOG_BASE. This is the class - * used to create a hotkey editor. - */ -class HOTKEYS_EDITOR_DIALOG : public HOTKEYS_EDITOR_DIALOG_BASE + +class PANEL_HOTKEYS_EDITOR : public PANEL_HOTKEYS_EDITOR_BASE { protected: + EDA_BASE_FRAME* m_frame; struct EDA_HOTKEY_CONFIG* m_hotkeys; - struct EDA_HOTKEY_CONFIG* m_showhotkeys; + struct EDA_HOTKEY_CONFIG* m_showHotkeys; + wxString m_nickname; - WIDGET_HOTKEY_LIST* m_hotkeyListCtrl; + WIDGET_HOTKEY_LIST* m_hotkeyListCtrl; bool TransferDataToWindow() override; bool TransferDataFromWindow() override; - virtual EDA_BASE_FRAME* GetParent() - { - return static_cast( HOTKEYS_EDITOR_DIALOG_BASE::GetParent() ); - } - public: - HOTKEYS_EDITOR_DIALOG( EDA_BASE_FRAME* aParent, EDA_HOTKEY_CONFIG* aHotkeys, - EDA_HOTKEY_CONFIG* aShowHotkeys ); + PANEL_HOTKEYS_EDITOR( EDA_BASE_FRAME* aFrame, wxWindow* aWindow, + EDA_HOTKEY_CONFIG* aHotkeys, EDA_HOTKEY_CONFIG* aShowHotkeys, + const wxString& aNickname ); - ~HOTKEYS_EDITOR_DIALOG() {}; + ~PANEL_HOTKEYS_EDITOR() {}; private: @@ -76,17 +66,10 @@ private: * @param aEvent is the button press event, unused */ void DefaultsClicked( wxCommandEvent& aEvent ) override; + + void OnExport( wxCommandEvent& aEvent ) override; + void OnImport( wxCommandEvent& aEvent ) override; }; -/** - * Function InstallHotkeyFrame - * Create a hotkey editor dialog window with the provided hotkey configuration array - * - * @param aParent is the parent window - * @param aHotkeys is the hotkey configuration array for read/writing - * @param aShowHotkeys is the hotkey configuration array that is displayed (subset) - */ -void InstallHotkeyFrame( EDA_BASE_FRAME* aParent, EDA_HOTKEY_CONFIG* aHotkeys, - EDA_HOTKEY_CONFIG* aShowHotkeys = NULL ); -#endif +#endif // PANEL_HOTKEYS_EDITOR_H diff --git a/include/pgm_base.h b/include/pgm_base.h index 92a67cd176..9ccd58db02 100644 --- a/include/pgm_base.h +++ b/include/pgm_base.h @@ -37,6 +37,20 @@ #include +///@{ +/// \ingroup config + +#define USE_ICONS_IN_MENUS_KEY wxT( "UseIconsInMenus" ) +#define ICON_SCALE_KEY wxT( "IconScale" ) +#define AUTOSAVE_INTERVAL_KEY wxT( "AutoSaveInterval" ) +#define ENBL_ZOOM_NO_CENTER_KEY wxT( "ZoomNoCenter" ) +#define ENBL_MOUSEWHEEL_PAN_KEY wxT( "MousewheelPAN" ) +#define MIDDLE_BUTT_PAN_LIMITED_KEY wxT( "MiddleBtnPANLimited" ) +#define ENBL_AUTO_PAN_KEY wxT( "AutoPAN" ) + +///@} + + class wxConfigBase; class wxSingleInstanceChecker; class wxApp; @@ -44,6 +58,7 @@ class wxMenu; class wxWindow; class FILENAME_RESOLVER; +class EDA_DRAW_FRAME; // inter program module calling @@ -274,16 +289,6 @@ public: return m_local_env_vars; } - /** - * Function ConfigurePaths - * - * presents a dialog to the user to edit local environment variable settings for use in - * the footprint library table and the 3D model importer. It was added to PGM_BASE because - * it will eventually find use for in schematic I/O design so it needs to accessible by - * almost every KiCad application. - */ - VTBL_ENTRY void ConfigurePaths( wxWindow* aParent, FILENAME_RESOLVER* aResolver ); - /** * Function App * returns a bare naked wxApp, which may come from wxPython, SINGLE_TOP, or kicad.exe. @@ -319,14 +324,6 @@ public: */ void SaveCommonSettings(); - /// Scaling factor for menus and tool icons - void SetIconsScale( double aValue ) { m_iconsScale = aValue; } - double GetIconsScale() { return m_iconsScale; } - /// True to use menu icons - void SetUseIconsInMenus( bool aUseIcons ) { m_useIconsInMenus = aUseIcons; } - bool GetUseIconsInMenus() { return m_useIconsInMenus; } - - protected: /** @@ -357,11 +354,6 @@ protected: /// true to use the selected PDF browser, if exists, or false to use the default bool m_use_system_pdf_browser; - /// Scaling factor for menus and tool icons - double m_iconsScale; - /// True to use menu icons - bool m_useIconsInMenus; - /// Trap all changes in here, simplifies debugging void setLanguageId( int aId ) { m_language_id = aId; } diff --git a/include/widgets/paged_dialog.h b/include/widgets/paged_dialog.h new file mode 100644 index 0000000000..0745ba214c --- /dev/null +++ b/include/widgets/paged_dialog.h @@ -0,0 +1,64 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + + +#ifndef PAGED_DIALOG_H +#define PAGED_DIALOG_H + +#include + +class wxTreebook; + + +class PAGED_DIALOG : public DIALOG_SHIM +{ +private: + wxString m_title; + + wxString m_errorMessage; + wxObject* m_errorCtrl; // the control associated with m_errorMessage + int m_errorRow; // the row if m_errorCtrl is a grid + int m_errorCol; // the column if m_errorCtrl is a grid + +public: + PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, + const wxString& aAuxiliaryAction = wxEmptyString ); + ~PAGED_DIALOG() override; + + void AddPage( wxPanel* aPage, const wxString& aTitle ); + void AddSubPage( wxPanel* aPage, const wxString& aTitle ); + + void SetError( const wxString& aMessage, wxWindow* aPage, wxObject* aCtrl, + int aRow = -1, int aCol = -1 ); + +protected: + void finishInitialization(); + + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; + + virtual void OnAuxiliaryAction( wxCommandEvent& event ) { event.Skip(); } + void OnUpdateUI( wxUpdateUIEvent& event ); + + wxTreebook* m_treebook; + wxButton* m_auxiliaryButton; +}; + + +#endif //PAGED_DIALOG_H diff --git a/kicad/CMakeLists.txt b/kicad/CMakeLists.txt index 029402b0bd..0c001a31e8 100644 --- a/kicad/CMakeLists.txt +++ b/kicad/CMakeLists.txt @@ -22,7 +22,6 @@ set( KICAD_SRCS kicad.cpp mainframe.cpp menubar.cpp - preferences.cpp prjconfig.cpp project_template.cpp tree_project_frame.cpp diff --git a/kicad/import_project.cpp b/kicad/import_project.cpp index 3bcc7bb9fe..f2cf75c223 100644 --- a/kicad/import_project.cpp +++ b/kicad/import_project.cpp @@ -53,7 +53,7 @@ void KICAD_MANAGER_FRAME::OnImportEagleFiles( wxCommandEvent& event ) { // Close other windows. - if( !Kiway.PlayersClose( false ) ) + if( !Kiway().PlayersClose( false ) ) return; @@ -122,13 +122,13 @@ void KICAD_MANAGER_FRAME::OnImportEagleFiles( wxCommandEvent& event ) if( sch.FileExists() ) { - KIWAY_PLAYER* schframe = Kiway.Player( FRAME_SCH, false ); + KIWAY_PLAYER* schframe = Kiway().Player( FRAME_SCH, false ); if( !schframe ) { try // SCH frame was not available, try to start it { - schframe = Kiway.Player( FRAME_SCH, true ); + schframe = Kiway().Player( FRAME_SCH, true ); } catch( const IO_ERROR& err ) { @@ -157,13 +157,13 @@ void KICAD_MANAGER_FRAME::OnImportEagleFiles( wxCommandEvent& event ) if( pcb.FileExists() ) { - KIWAY_PLAYER* pcbframe = Kiway.Player( FRAME_PCB, false ); + KIWAY_PLAYER* pcbframe = Kiway().Player( FRAME_PCB, false ); if( !pcbframe ) { try // PCB frame was not available, try to start it { - pcbframe = Kiway.Player( FRAME_PCB, true ); + pcbframe = Kiway().Player( FRAME_PCB, true ); } catch( const IO_ERROR& err ) { diff --git a/kicad/kicad.h b/kicad/kicad.h index 06c198e7f1..53ff660dd1 100644 --- a/kicad/kicad.h +++ b/kicad/kicad.h @@ -35,7 +35,7 @@ #include #include - +#include #define KICAD_MANAGER_FRAME_NAME wxT( "KicadFrame" ) @@ -116,10 +116,6 @@ enum id_kicad_frm { ID_TO_TEXT_EDITOR, ID_BROWSE_AN_SELECT_FILE, - ID_SELECT_PREFERED_EDITOR, - ID_SELECT_PREFERED_PDF_BROWSER_NAME, - ID_SELECT_PREFERED_PDF_BROWSER, - ID_SELECT_DEFAULT_PDF_BROWSER, ID_SAVE_AND_ZIP_FILES, ID_READ_ZIP_ARCHIVE, ID_INIT_WATCHED_PATHS, @@ -134,7 +130,7 @@ enum id_kicad_frm { /** * The main KiCad project manager frame. It is not a KIWAY_PLAYER. */ -class KICAD_MANAGER_FRAME : public EDA_BASE_FRAME +class KICAD_MANAGER_FRAME : public EDA_BASE_FRAME, public KIWAY_HOLDER { public: KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& title, @@ -145,12 +141,6 @@ public: void OnCloseWindow( wxCloseEvent& Event ); void OnSize( wxSizeEvent& event ); - /** - * Select the current icons options in menus (or toolbars) in Kicad - * (the default for toolbars/menus is 26x26 pixels, and shows icons in menus). - */ - void OnChangeIconsOptions( wxCommandEvent& event ) override; - /** * Load an exiting project (.pro) file. */ @@ -182,13 +172,12 @@ public: void OnRunPageLayoutEditor( wxCommandEvent& event ); void OnConfigurePaths( wxCommandEvent& aEvent ); + void OnPreferences( wxCommandEvent& aEvent ); void OnOpenTextEditor( wxCommandEvent& event ); void OnOpenFileInTextEditor( wxCommandEvent& event ); - void OnOpenFileInEditor( wxCommandEvent& event ); void OnFileHistory( wxCommandEvent& event ); void OnExit( wxCommandEvent& event ); - void Process_Preferences( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event ); @@ -218,11 +207,6 @@ public: void ClearMsg(); void OnRefresh( wxCommandEvent& event ); - void OnSelectDefaultPdfBrowser( wxCommandEvent& event ); - void OnSelectPreferredPdfBrowser( wxCommandEvent& event ); - - void OnUpdateDefaultPdfBrowser( wxUpdateUIEvent& event ); - void OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event ); void OnUpdateRequiresProject( wxUpdateUIEvent& event ); /** diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp index 4368bec1a5..c03c218537 100644 --- a/kicad/mainframe.cpp +++ b/kicad/mainframe.cpp @@ -30,7 +30,7 @@ #include -#include +#include #include #include #include @@ -38,7 +38,7 @@ #include #include #include - +#include #include "pgm_kicad.h" #include "tree_project_frame.h" @@ -50,7 +50,8 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size ) : EDA_BASE_FRAME( parent, KICAD_MAIN_FRAME_T, title, pos, size, - KICAD_DEFAULT_DRAWFRAME_STYLE, KICAD_MANAGER_FRAME_NAME ) + KICAD_DEFAULT_DRAWFRAME_STYLE, KICAD_MANAGER_FRAME_NAME ), + KIWAY_HOLDER( &::Kiway ) { m_active_project = false; m_leftWinWidth = 60; @@ -215,7 +216,7 @@ void KICAD_MANAGER_FRAME::OnSize( wxSizeEvent& event ) void KICAD_MANAGER_FRAME::OnCloseWindow( wxCloseEvent& Event ) { - if( Kiway.PlayersClose( false ) ) + if( Kiway().PlayersClose( false ) ) { int px, py; @@ -295,7 +296,7 @@ void KICAD_MANAGER_FRAME::Execute( wxWindow* frame, const wxString& execFile, void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName ) { - KIWAY_PLAYER* frame = Kiway.Player( FRAME_SCH, false ); + KIWAY_PLAYER* frame = Kiway().Player( FRAME_SCH, false ); // Please: note: DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers() calls // Kiway.Player( FRAME_SCH, true ) @@ -309,7 +310,7 @@ void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName { try { - frame = Kiway.Player( FRAME_SCH, true ); + frame = Kiway().Player( FRAME_SCH, true ); } catch( const IO_ERROR& err ) { @@ -350,13 +351,13 @@ void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event ) void KICAD_MANAGER_FRAME::OnRunSchLibEditor( wxCommandEvent& event ) { - KIWAY_PLAYER* frame = Kiway.Player( FRAME_SCH_LIB_EDITOR, false ); + KIWAY_PLAYER* frame = Kiway().Player( FRAME_SCH_LIB_EDITOR, false ); if( !frame ) { try { - frame = Kiway.Player( FRAME_SCH_LIB_EDITOR, true ); + frame = Kiway().Player( FRAME_SCH_LIB_EDITOR, true ); } catch( const IO_ERROR& err ) { @@ -382,7 +383,7 @@ void KICAD_MANAGER_FRAME::RunPcbNew( const wxString& aProjectBoardFileName ) try { - frame = Kiway.Player( FRAME_PCB, true ); + frame = Kiway().Player( FRAME_PCB, true ); } catch( const IO_ERROR& err ) { @@ -422,13 +423,13 @@ void KICAD_MANAGER_FRAME::OnRunPcbNew( wxCommandEvent& event ) void KICAD_MANAGER_FRAME::OnRunPcbFpEditor( wxCommandEvent& event ) { - KIWAY_PLAYER* frame = Kiway.Player( FRAME_PCB_MODULE_EDITOR, false ); + KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB_MODULE_EDITOR, false ); if( !frame ) { try { - frame = Kiway.Player( FRAME_PCB_MODULE_EDITOR, true ); + frame = Kiway().Player( FRAME_PCB_MODULE_EDITOR, true ); } catch( const IO_ERROR& err ) { @@ -448,13 +449,6 @@ void KICAD_MANAGER_FRAME::OnRunPcbFpEditor( wxCommandEvent& event ) } -void KICAD_MANAGER_FRAME::OnChangeIconsOptions( wxCommandEvent& event ) -{ - EDA_BASE_FRAME::OnChangeIconsOptions( event ); - Kiway.ShowChangedIcons(); -} - - void KICAD_MANAGER_FRAME::OnRunBitmapConverter( wxCommandEvent& event ) { Execute( this, BITMAPCONVERTER_EXE ); @@ -522,7 +516,7 @@ void KICAD_MANAGER_FRAME::OnRefresh( wxCommandEvent& event ) void KICAD_MANAGER_FRAME::language_change( wxCommandEvent& event ) { int id = event.GetId(); - Kiway.SetLanguage( id ); + Kiway().SetLanguage( id ); } @@ -556,24 +550,10 @@ void KICAD_MANAGER_FRAME::PrintPrjInfo() void KICAD_MANAGER_FRAME::Process_Config( wxCommandEvent& event ) { - int id = event.GetId(); - wxFileName fn; + int id = event.GetId(); switch( id ) { - // Hotkey IDs - case ID_PREFERENCES_HOTKEY_SHOW_EDITOR: - InstallHotkeyFrame( this, m_manager_Hokeys_Descr ); - break; - - case ID_PREFERENCES_HOTKEY_EXPORT_CONFIG: - ExportHotkeyConfigToFile( m_manager_Hokeys_Descr, wxT( "kicad" ) ); - break; - - case ID_PREFERENCES_HOTKEY_IMPORT_CONFIG: - ImportHotkeyConfigFromFile( m_manager_Hokeys_Descr, wxT( "kicad" ) ); - break; - case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST: // Display current hotkey list for LibEdit. DisplayHotkeyList( this, m_manager_Hokeys_Descr ); @@ -588,5 +568,12 @@ void KICAD_MANAGER_FRAME::Process_Config( wxCommandEvent& event ) void KICAD_MANAGER_FRAME::OnConfigurePaths( wxCommandEvent& aEvent ) { - Pgm().ConfigurePaths( this, nullptr ); + DIALOG_CONFIGURE_PATHS dlg( this, nullptr ); + dlg.ShowModal(); +} + + +void KICAD_MANAGER_FRAME::OnPreferences( wxCommandEvent& aEvent ) +{ + ShowPreferences( m_manager_Hokeys_Descr, m_manager_Hokeys_Descr, wxT( "kicad" ) ); } diff --git a/kicad/menubar.cpp b/kicad/menubar.cpp index 7411452b84..8661cf4791 100644 --- a/kicad/menubar.cpp +++ b/kicad/menubar.cpp @@ -54,11 +54,7 @@ BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME ) EVT_MENU( ID_TO_TEXT_EDITOR, KICAD_MANAGER_FRAME::OnOpenTextEditor ) EVT_MENU( ID_BROWSE_AN_SELECT_FILE, KICAD_MANAGER_FRAME::OnOpenFileInTextEditor ) EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, KICAD_MANAGER_FRAME::OnConfigurePaths ) - EVT_MENU( ID_SELECT_PREFERED_EDITOR, EDA_BASE_FRAME::OnSelectPreferredEditor ) - EVT_MENU( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectDefaultPdfBrowser ) - EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser ) - EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER_NAME, - KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser ) + EVT_MENU( wxID_PREFERENCES, KICAD_MANAGER_FRAME::OnPreferences ) EVT_MENU( ID_SAVE_AND_ZIP_FILES, KICAD_MANAGER_FRAME::OnArchiveFiles ) EVT_MENU( ID_READ_ZIP_ARCHIVE, KICAD_MANAGER_FRAME::OnUnarchiveFiles ) EVT_MENU( ID_PROJECT_TREE_REFRESH, KICAD_MANAGER_FRAME::OnRefresh ) @@ -74,9 +70,8 @@ BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME ) EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, KICAD_MANAGER_FRAME::OnFileHistory ) - // Hotkey management (show list, edit ...) events - EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, - KICAD_MANAGER_FRAME::Process_Config ) + // Show hotkeys + EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, KICAD_MANAGER_FRAME::Process_Config ) // Special functions @@ -107,12 +102,6 @@ BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME ) EVT_BUTTON( ID_TO_PL_EDITOR, KICAD_MANAGER_FRAME::OnRunPageLayoutEditor ) EVT_MENU( ID_TO_PL_EDITOR, KICAD_MANAGER_FRAME::OnRunPageLayoutEditor ) - EVT_MENU_RANGE( ID_KICAD_SELECT_ICONS_OPTIONS, ID_KICAD_SELECT_ICON_OPTIONS_END, - KICAD_MANAGER_FRAME::OnChangeIconsOptions ) - - EVT_UPDATE_UI( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnUpdateDefaultPdfBrowser ) - EVT_UPDATE_UI( ID_SELECT_PREFERED_PDF_BROWSER, - KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser ) EVT_UPDATE_UI_RANGE( ID_TO_SCH, ID_TO_PCB_FP_EDITOR, KICAD_MANAGER_FRAME::OnUpdateRequiresProject ) @@ -338,60 +327,16 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() _( "Edit path configuration environment variables" ), KiBitmap( path_xpm ) ); - // Text editor AddMenuItem( preferencesMenu, - ID_SELECT_PREFERED_EDITOR, - _( "&Set Text Editor..." ), - _( "Set your preferred text editor" ), - KiBitmap( editor_xpm ) ); - - // PDF Viewer submenu:System browser or user defined checkbox - wxMenu* SubMenuPdfBrowserChoice = new wxMenu; - - // Default - AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_DEFAULT_PDF_BROWSER, - _( "System &Default PDF Viewer" ), - _( "Use system default PDF viewer" ), - KiBitmap( datasheet_xpm ), - wxITEM_CHECK ); - SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER, - Pgm().UseSystemPdfBrowser() ); - - // Favourite - AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_PREFERED_PDF_BROWSER, - _( "&Favorite PDF Viewer" ), - _( "Use favorite PDF viewer" ), - KiBitmap( datasheet_xpm ), - wxITEM_CHECK ); - SubMenuPdfBrowserChoice->Check( ID_SELECT_PREFERED_PDF_BROWSER, - !Pgm().UseSystemPdfBrowser() ); - - SubMenuPdfBrowserChoice->AppendSeparator(); - // Append PDF Viewer submenu to preferences - AddMenuItem( SubMenuPdfBrowserChoice, - ID_SELECT_PREFERED_PDF_BROWSER_NAME, - _( "Set &PDF Viewer..." ), - _( "Set favorite PDF viewer" ), - KiBitmap( datasheet_xpm ) ); - - // PDF viewer submenu - AddMenuItem( preferencesMenu, SubMenuPdfBrowserChoice, -1, - _( "&PDF Viewer" ), - _( "PDF viewer preferences" ), - KiBitmap( datasheet_xpm ) ); - - preferencesMenu->AppendSeparator(); - - // Icons options submenu - AddMenuIconsOptions( preferencesMenu ); + wxID_PREFERENCES, + _( "&Preferences..." ), + _( "Show preferences for all open tools" ), + KiBitmap( preference_xpm ) ); preferencesMenu->AppendSeparator(); // Language submenu Pgm().AddMenuLanguageList( preferencesMenu ); - // Hotkey submenu - AddHotkeyConfigMenu( preferencesMenu ); - // Menu Tools: wxMenu* toolsMenu = new wxMenu; @@ -464,10 +409,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar() helpMenu->AppendSeparator(); // About - AddMenuItem( helpMenu, wxID_ABOUT, - _( "&About KiCad" ), - _( "About KiCad" ), - KiBitmap( about_xpm ) ); + AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) ); // Create the menubar and append all submenus menuBar->Append( fileMenu, _( "&File" ) ); diff --git a/kicad/preferences.cpp b/kicad/preferences.cpp deleted file mode 100644 index 12738f2c49..0000000000 --- a/kicad/preferences.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2008-2014 Wayne Stambaugh - * Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file preferences.cpp - */ - - -#include - -#include "kicad.h" -#include "pgm_kicad.h" - - -void KICAD_MANAGER_FRAME::OnUpdateDefaultPdfBrowser( wxUpdateUIEvent& event ) -{ - event.Check( Pgm().UseSystemPdfBrowser() ); -} - - -void KICAD_MANAGER_FRAME::OnSelectDefaultPdfBrowser( wxCommandEvent& event ) -{ - Pgm().ForceSystemPdfBrowser( true ); - Pgm().WritePdfBrowserInfos(); -} - - -void KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event ) -{ - event.Check( !Pgm().UseSystemPdfBrowser() ); -} - - -void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event ) -{ - bool setPdfBrowserName = event.GetId() == ID_SELECT_PREFERED_PDF_BROWSER_NAME; - - if( !Pgm().GetPdfBrowserName() && !setPdfBrowserName ) - { - DisplayError( this, - _( "You must choose a PDF viewer before using this option." ) ); - setPdfBrowserName = true; - } - - if( setPdfBrowserName ) - { - wxString mask( wxT( "*" ) ); - - #ifdef __WINDOWS__ - mask += wxT( ".exe" ); - #endif - - wxString wildcard = _( "Executable files (" ) + mask + wxT( ")|" ) + mask; - - Pgm().ReadPdfBrowserInfos(); - wxFileName fn = Pgm().GetPdfBrowserName(); - - wxFileDialog dlg( this, _( "Select Preferred PDF Browser" ), fn.GetPath(), - fn.GetFullPath(), wildcard, - wxFD_OPEN | wxFD_FILE_MUST_EXIST ); - - if( dlg.ShowModal() == wxID_CANCEL ) - return; - - Pgm().SetPdfBrowserName( dlg.GetPath() ); - } - - Pgm().ForceSystemPdfBrowser( false ); - Pgm().WritePdfBrowserInfos(); -} diff --git a/kicad/prjconfig.cpp b/kicad/prjconfig.cpp index ffebdc9299..cc1437c2d9 100644 --- a/kicad/prjconfig.cpp +++ b/kicad/prjconfig.cpp @@ -67,7 +67,7 @@ void KICAD_MANAGER_FRAME::LoadProject( const wxFileName& aProjectFileName ) // Any open KIFACE's must be closed if they are not part of the new project. // (We never want a KIWAY_PLAYER open on a KIWAY that isn't in the same project.) // User is prompted here to close those KIWAY_PLAYERs: - if( !Kiway.PlayersClose( false ) ) + if( !Kiway().PlayersClose( false ) ) return; SetTitle( wxString( "KiCad " ) + GetBuildVersion() ); diff --git a/pagelayout_editor/events_functions.cpp b/pagelayout_editor/events_functions.cpp index 61237977c8..726841f45d 100644 --- a/pagelayout_editor/events_functions.cpp +++ b/pagelayout_editor/events_functions.cpp @@ -71,8 +71,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME ) EVT_MENU( wxID_EXIT, PL_EDITOR_FRAME::OnQuit ) // menu Preferences - EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, PL_EDITOR_FRAME::Process_Config ) - EVT_MENU( ID_MENU_PL_EDITOR_SELECT_PREFERED_EDITOR, EDA_BASE_FRAME::OnSelectPreferredEditor ) + EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, PL_EDITOR_FRAME::Process_Config ) EVT_MENU( wxID_PREFERENCES, PL_EDITOR_FRAME::Process_Config ) EVT_MENU( ID_MENU_SWITCH_BGCOLOR, PL_EDITOR_FRAME::Process_Config ) EVT_MENU( ID_MENU_GRID_ONOFF, PL_EDITOR_FRAME::Process_Config ) diff --git a/pagelayout_editor/menubar.cpp b/pagelayout_editor/menubar.cpp index b5024fc5e4..d5190da7de 100644 --- a/pagelayout_editor/menubar.cpp +++ b/pagelayout_editor/menubar.cpp @@ -72,9 +72,7 @@ void PL_EDITOR_FRAME::ReCreateMenuBar() openRecentMenu = new wxMenu(); Kiface().GetFileHistory().UseMenu( openRecentMenu ); Kiface().GetFileHistory().AddFilesToMenu(); - AddMenuItem( fileMenu, openRecentMenu, - wxID_ANY, - _( "Open &Recent" ), + AddMenuItem( fileMenu, openRecentMenu, wxID_ANY, _( "Open &Recent" ), _( "Open recent page layout design file" ), KiBitmap( recent_xpm ) ); @@ -93,16 +91,15 @@ void PL_EDITOR_FRAME::ReCreateMenuBar() fileMenu->AppendSeparator(); msg = AddHotkeyName( _( "&Print..." ), PlEditorHokeysDescr, HK_PRINT ); - AddMenuItem( fileMenu, wxID_PRINT, msg, - wxEmptyString, KiBitmap( print_button_xpm ) ); + AddMenuItem( fileMenu, wxID_PRINT, msg, KiBitmap( print_button_xpm ) ); - AddMenuItem( fileMenu, wxID_PREVIEW, _( "Print Pre&view..." ), - wxEmptyString, KiBitmap( print_button_xpm ) ); + AddMenuItem( fileMenu, wxID_PREVIEW, _( "Print Pre&view..." ), KiBitmap( print_button_xpm ) ); fileMenu->AppendSeparator(); AddMenuItem( fileMenu, wxID_EXIT, _( "&Close" ), - _( "Close Page Layout Editor" ), KiBitmap( exit_xpm ) ); + _( "Close Page Layout Editor" ), + KiBitmap( exit_xpm ) ); // Edit Menu: @@ -136,6 +133,16 @@ void PL_EDITOR_FRAME::ReCreateMenuBar() viewMenu->AppendSeparator(); + AddMenuItem( viewMenu, ID_MENU_SWITCH_BGCOLOR, + GetDrawBgColor() == WHITE ? _( "&Background Black" ) : _( "&Background White" ), + wxEmptyString, KiBitmap( palette_xpm ) ); + + AddMenuItem( viewMenu, ID_MENU_GRID_ONOFF, + IsGridVisible() ? _( "Hide &Grid" ) : _( "Show &Grid" ), + wxEmptyString, KiBitmap( grid_xpm ) ); + + viewMenu->AppendSeparator(); + msg = AddHotkeyName( _( "Redraw View" ), PlEditorHokeysDescr, HK_ZOOM_REDRAW ); AddMenuItem( viewMenu, ID_ZOOM_REDRAW, msg, wxEmptyString, KiBitmap( zoom_redraw_xpm ) ); @@ -165,46 +172,22 @@ void PL_EDITOR_FRAME::ReCreateMenuBar() // Menu for preferences wxMenu* preferencesMenu = new wxMenu; - AddMenuItem( preferencesMenu, - ID_MENU_SWITCH_BGCOLOR, - GetDrawBgColor() == WHITE ? - _( "&Background Black" ) : _( "&Background White" ), - wxEmptyString, KiBitmap( palette_xpm ) ); - - AddMenuItem( preferencesMenu, - ID_MENU_GRID_ONOFF, - IsGridVisible() ? _( "Hide &Grid" ) : _( "Show &Grid" ), - wxEmptyString, KiBitmap( grid_xpm ) ); - - // Text editor selection - AddMenuItem( preferencesMenu, - ID_MENU_PL_EDITOR_SELECT_PREFERED_EDITOR, - _( "Set &Text Editor..." ), - _( "Select your preferred text editor" ), - KiBitmap( editor_xpm ) ); + AddMenuItem( preferencesMenu, wxID_PREFERENCES, _( "&Preferences..." ), + _( "Show preferences for all open tools" ), + KiBitmap( preference_xpm ) ); // Language submenu Pgm().AddMenuLanguageList( preferencesMenu ); - // Icons options submenu - AddMenuIconsOptions( preferencesMenu ); - - // Hotkey submenu - AddHotkeyConfigMenu( preferencesMenu ); - // Menu Help wxMenu* helpMenu = new wxMenu; // Contents - AddMenuItem( helpMenu, - wxID_HELP, - _( "Page Layout Editor &Manual" ), + AddMenuItem( helpMenu, wxID_HELP, _( "Page Layout Editor &Manual" ), _( "Open the Page Layout Editor Manual" ), KiBitmap( online_help_xpm ) ); - AddMenuItem( helpMenu, - wxID_INDEX, - _( "&Getting Started in KiCad" ), + AddMenuItem( helpMenu, wxID_INDEX, _( "&Getting Started in KiCad" ), _( "Open \"Getting Started in KiCad\" guide for beginners" ), KiBitmap( help_xpm ) ); @@ -214,8 +197,7 @@ void PL_EDITOR_FRAME::ReCreateMenuBar() KiBitmap( hotkeys_xpm ) ); helpMenu->AppendSeparator(); - AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED, - _( "Get &Involved" ), + AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED, _( "Get &Involved" ), _( "Contribute to KiCad (opens a web browser)" ), KiBitmap( info_xpm ) ); @@ -223,11 +205,7 @@ void PL_EDITOR_FRAME::ReCreateMenuBar() helpMenu->AppendSeparator(); // About Kicad - AddMenuItem( helpMenu, - wxID_ABOUT, - _( "&About KiCad" ), - _( "About KiCad" ), - KiBitmap( about_xpm ) ); + AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), wxEmptyString, KiBitmap( about_xpm ) ); // Append menus to the menubar menuBar->Append( fileMenu, _( "&File" ) ); diff --git a/pagelayout_editor/pl_editor_config.cpp b/pagelayout_editor/pl_editor_config.cpp index 703c1ec317..347e6c655b 100644 --- a/pagelayout_editor/pl_editor_config.cpp +++ b/pagelayout_editor/pl_editor_config.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include #define GROUP wxT("/pl_editor") @@ -54,31 +54,19 @@ void PL_EDITOR_FRAME::Process_Config( wxCommandEvent& event ) SetDrawBgColor( WHITE ); GetMenuBar()->SetLabel( ID_MENU_SWITCH_BGCOLOR, - GetDrawBgColor() == WHITE ? - _( "&Background Black" ) : - _( "&Background White" ) ); + GetDrawBgColor() == WHITE ? _( "&Background Black" ) : _( "&Background White" ) ); m_canvas->Refresh(); break; case ID_MENU_GRID_ONOFF: SetGridVisibility( ! IsGridVisible() ); GetMenuBar()->SetLabel( ID_MENU_GRID_ONOFF, - IsGridVisible() ? _( "Hide &Grid" ) : - _( "Show &Grid" ) ); + IsGridVisible() ? _( "Hide &Grid" ) : _( "Show &Grid" ) ); m_canvas->Refresh(); break; - // Standard basic hotkey IDs - case ID_PREFERENCES_HOTKEY_SHOW_EDITOR: - InstallHotkeyFrame( this, PlEditorHokeysDescr ); - break; - - case ID_PREFERENCES_HOTKEY_EXPORT_CONFIG: - ExportHotkeyConfigToFile( PlEditorHokeysDescr, wxT( "pl_editor" ) ); - break; - - case ID_PREFERENCES_HOTKEY_IMPORT_CONFIG: - ImportHotkeyConfigFromFile( PlEditorHokeysDescr, wxT( "pl_editor" ) ); + case wxID_PREFERENCES: + ShowPreferences( PlEditorHokeysDescr, PlEditorHokeysDescr, wxT( "pl_editor" ) ); break; case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST: diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 1084e82335..1591c9168e 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -64,8 +64,6 @@ set( PCBNEW_DIALOGS dialogs/dialog_design_rules.cpp dialogs/dialog_design_rules_base.cpp dialogs/dialog_dimension_editor_base.cpp - dialogs/dialog_display_options.cpp - dialogs/dialog_display_options_base.cpp dialogs/dialog_drc.cpp dialogs/dialog_drc_base.cpp dialogs/dialog_edit_footprint_for_BoardEditor.cpp @@ -96,8 +94,6 @@ set( PCBNEW_DIALOGS dialogs/dialog_gencad_export_options.cpp dialogs/dialog_gendrill.cpp dialogs/dialog_gendrill_base.cpp - dialogs/dialog_general_options.cpp - dialogs/dialog_general_options_BoardEditor_base.cpp dialogs/dialog_get_footprint.cpp dialogs/dialog_get_footprint_base.cpp dialogs/dialog_get_footprint_by_name_base.cpp @@ -121,9 +117,6 @@ set( PCBNEW_DIALOGS dialogs/dialog_layers_setup_base.cpp dialogs/dialog_mask_clearance.cpp dialogs/dialog_mask_clearance_base.cpp - dialogs/dialog_modedit_display_options.cpp - dialogs/dialog_modedit_options.cpp - dialogs/dialog_modedit_options_base.cpp dialogs/dialog_move_exact.cpp dialogs/dialog_move_exact_base.cpp dialogs/dialog_netlist.cpp @@ -162,6 +155,17 @@ set( PCBNEW_DIALOGS dialogs/dialog_track_via_size_base.cpp dialogs/dialog_update_pcb.cpp dialogs/dialog_update_pcb_base.cpp + dialogs/panel_modedit_defaults.cpp + dialogs/panel_modedit_defaults_base.cpp + dialogs/panel_modedit_display_options.cpp + dialogs/panel_modedit_settings.cpp + dialogs/panel_modedit_settings_base.cpp + dialogs/panel_pcbnew_display_options.cpp + dialogs/panel_pcbnew_display_options_base.cpp + dialogs/panel_pcbnew_display_options.cpp + dialogs/panel_pcbnew_display_options_base.cpp + dialogs/panel_pcbnew_settings.cpp + dialogs/panel_pcbnew_settings_base.cpp footprint_wizard.cpp footprint_wizard_frame.cpp footprint_wizard_frame_functions.cpp diff --git a/pcbnew/dialogs/dialog_general_options.cpp b/pcbnew/dialogs/dialog_general_options.cpp deleted file mode 100644 index 09412ec29b..0000000000 --- a/pcbnew/dialogs/dialog_general_options.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com - * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file dialog_general_options.cpp - */ - -/* functions relatives to the dialogs opened from the main menu : - * Preferences/general - * Preferences/display - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -DIALOG_GENERALOPTIONS::DIALOG_GENERALOPTIONS( PCB_EDIT_FRAME* parent ) : - DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE( parent ), - m_last_scale( -1 ) -{ - init(); - - m_scaleSlider->SetStep( 25 ); - - GetSizer()->SetSizeHints( this ); - Center(); -} - - -void DIALOG_GENERALOPTIONS::init() -{ - SetFocus(); - m_sdbSizerOK->SetDefault(); - - m_Board = GetParent()->GetBoard(); - auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetParent()->GetDisplayOptions(); - - /* Set display options */ - m_PolarDisplay->SetSelection( displ_opts->m_DisplayPolarCood ? 1 : 0 ); - m_UnitsSelection->SetSelection( g_UserUnit ? 1 : 0 ); - - wxString rotationAngle; - rotationAngle = AngleToStringDegrees( (double)GetParent()->GetRotationAngle() ); - m_RotationAngle->SetValue( rotationAngle ); - - wxString timevalue; - timevalue << GetParent()->GetAutoSaveInterval() / 60; - m_SaveTime->SetValue( timevalue ); - - m_DrcOn->SetValue( GetParent()->Settings().m_legacyDrcOn ); - m_ShowGlobalRatsnest->SetValue( m_Board->IsElementVisible( LAYER_RATSNEST ) ); - m_TrackAutodel->SetValue( GetParent()->Settings().m_legacyAutoDeleteOldTrack ); - m_Track_45_Only_Ctrl->SetValue( GetParent()->Settings().m_legacyUse45DegreeTracks ); - m_Segments_45_Only_Ctrl->SetValue( GetParent()->Settings().m_use45DegreeGraphicSegments ); - m_ZoomCenterOpt->SetValue( ! GetParent()->GetCanvas()->GetEnableZoomNoCenter() ); - m_MousewheelPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableMousewheelPan() ); - m_AutoPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableAutoPan() ); - m_Track_DoubleSegm_Ctrl->SetValue( GetParent()->Settings().m_legacyUseTwoSegmentTracks ); - m_MagneticPadOptCtrl->SetSelection( GetParent()->Settings().m_magneticPads ); - m_MagneticTrackOptCtrl->SetSelection( GetParent()->Settings().m_magneticTracks ); - m_UseEditKeyForWidth->SetValue( GetParent()->Settings().m_editActionChangesTrackWidth ); - m_dragSelects->SetValue( GetParent()->Settings().m_dragSelects ); - - m_Show_Page_Limits->SetValue( GetParent()->ShowPageLimits() ); - - const int scale_fourths = GetParent()->GetIconScale(); - - if( scale_fourths <= 0 ) - { - m_scaleAuto->SetValue( true ); - m_scaleSlider->SetValue( 25 * KiIconScale( GetParent() ) ); - } - else - { - m_scaleAuto->SetValue( false ); - m_scaleSlider->SetValue( scale_fourths * 25 ); - } - - m_checkBoxIconsInMenus->SetValue( Pgm().GetUseIconsInMenus() ); -} - - -void DIALOG_GENERALOPTIONS::OnScaleSlider( wxScrollEvent& aEvent ) -{ - m_scaleAuto->SetValue( false ); - aEvent.Skip(); -} - - -void DIALOG_GENERALOPTIONS::OnScaleAuto( wxCommandEvent& aEvent ) -{ - if( m_scaleAuto->GetValue() ) - { - m_last_scale = m_scaleSlider->GetValue(); - m_scaleSlider->SetValue( 25 * KiIconScale( GetParent() ) ); - } - else - { - if( m_last_scale >= 0 ) - m_scaleSlider->SetValue( m_last_scale ); - } -} - - -void DIALOG_GENERALOPTIONS::OnCancelClick( wxCommandEvent& event ) -{ - event.Skip(); -} - - -void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event ) -{ - EDA_UNITS_T ii; - auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetParent()->GetDisplayOptions(); - - displ_opts->m_DisplayPolarCood = ( m_PolarDisplay->GetSelection() == 0 ) ? false : true; - ii = g_UserUnit; - g_UserUnit = ( m_UnitsSelection->GetSelection() == 0 ) ? INCHES : MILLIMETRES; - - if( ii != g_UserUnit ) - GetParent()->ReCreateAuxiliaryToolbar(); - - GetParent()->SetAutoSaveInterval( m_SaveTime->GetValue() * 60 ); - GetParent()->SetRotationAngle( wxRound( 10.0 * wxAtof( m_RotationAngle->GetValue() ) ) ); - - /* Updating the combobox to display the active layer. */ - GetParent()->Settings().m_legacyDrcOn = m_DrcOn->GetValue(); - - if( m_Board->IsElementVisible( LAYER_RATSNEST ) != m_ShowGlobalRatsnest->GetValue() ) - { - GetParent()->SetElementVisibility( LAYER_RATSNEST, m_ShowGlobalRatsnest->GetValue() ); - GetParent()->GetCanvas()->Refresh(); - GetParent()->OnModify(); - } - - GetParent()->Settings().m_legacyAutoDeleteOldTrack = m_TrackAutodel->GetValue(); - GetParent()->Settings().m_use45DegreeGraphicSegments = m_Segments_45_Only_Ctrl->GetValue(); - GetParent()->Settings().m_legacyUse45DegreeTracks = m_Track_45_Only_Ctrl->GetValue(); - - GetParent()->GetCanvas()->SetEnableZoomNoCenter( ! m_ZoomCenterOpt->GetValue() ); - GetParent()->GetCanvas()->SetEnableMousewheelPan( m_MousewheelPANOpt->GetValue() ); - GetParent()->GetCanvas()->SetEnableAutoPan( m_AutoPANOpt->GetValue() ); - - GetParent()->Settings().m_legacyUseTwoSegmentTracks = m_Track_DoubleSegm_Ctrl->GetValue(); - GetParent()->Settings().m_magneticPads = (MAGNETIC_PAD_OPTION_VALUES) m_MagneticPadOptCtrl->GetSelection(); - GetParent()->Settings().m_magneticTracks = (MAGNETIC_PAD_OPTION_VALUES) m_MagneticTrackOptCtrl->GetSelection(); - GetParent()->Settings().m_editActionChangesTrackWidth = m_UseEditKeyForWidth->GetValue(); - GetParent()->Settings().m_dragSelects = m_dragSelects->GetValue(); - - GetParent()->SetShowPageLimits( m_Show_Page_Limits->GetValue() ); - - const int scale_fourths = m_scaleAuto->GetValue() ? -1 : m_scaleSlider->GetValue() / 25; - - if( GetParent()->GetIconScale() != scale_fourths ) - GetParent()->SetIconScale( scale_fourths ); - - if( Pgm().GetUseIconsInMenus() != m_checkBoxIconsInMenus->GetValue() ) - { - Pgm().SetUseIconsInMenus( m_checkBoxIconsInMenus->GetValue() ); - GetParent()->ReCreateMenuBar(); - } - - EndModal( wxID_OK ); -} - - diff --git a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp deleted file mode 100644 index 84e8a87dd8..0000000000 --- a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp +++ /dev/null @@ -1,282 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_general_options_BoardEditor_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bMainSizer; - bMainSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizerUpper; - bSizerUpper = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bLeftSizer; - bLeftSizer = new wxBoxSizer( wxVERTICAL ); - - wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 0, 2, 0, 0 ); - fgSizer1->AddGrowableCol( 1 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); - fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticTextautosave = new wxStaticText( this, wxID_ANY, _("&Auto save (minutes):"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextautosave->Wrap( -1 ); - fgSizer1->Add( m_staticTextautosave, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_SaveTime = new wxSpinCtrl( this, wxID_ANY, wxT("0"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 60, 0 ); - m_SaveTime->SetToolTip( _("Delay after the first change to create a backup file of the board on disk. If set to 0, auto backup is disabled.") ); - - fgSizer1->Add( m_SaveTime, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); - - - bLeftSizer->Add( fgSizer1, 0, wxALL|wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizer5; - sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User Interface:") ), wxVERTICAL ); - - wxFlexGridSizer* fgSizer11; - fgSizer11 = new wxFlexGridSizer( 0, 3, 0, 0 ); - fgSizer11->AddGrowableCol( 1 ); - fgSizer11->SetFlexibleDirection( wxBOTH ); - fgSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticText1 = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, _("Icon scale:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1->Wrap( -1 ); - fgSizer11->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 ); - - m_scaleSlider = new STEPPED_SLIDER( sbSizer5->GetStaticBox(), wxID_ANY, 50, 50, 275, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS ); - fgSizer11->Add( m_scaleSlider, 0, wxBOTTOM|wxEXPAND, 4 ); - - m_staticText2 = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText2->Wrap( -1 ); - fgSizer11->Add( m_staticText2, 0, wxALIGN_BOTTOM|wxBOTTOM, 2 ); - - - fgSizer11->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_scaleAuto = new wxCheckBox( sbSizer5->GetStaticBox(), wxID_ANY, _("Auto"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer11->Add( m_scaleAuto, 0, wxLEFT, 9 ); - - - fgSizer11->Add( 0, 0, 1, wxEXPAND, 5 ); - - - sbSizer5->Add( fgSizer11, 0, wxALL|wxEXPAND, 5 ); - - m_checkBoxIconsInMenus = new wxCheckBox( sbSizer5->GetStaticBox(), wxID_ANY, _("Show icons in menus"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer5->Add( m_checkBoxIconsInMenus, 0, wxALL, 5 ); - - - bLeftSizer->Add( sbSizer5, 1, wxALL|wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizer2PAN; - sbSizer2PAN = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pan and Zoom:") ), wxVERTICAL ); - - m_ZoomCenterOpt = new wxCheckBox( sbSizer2PAN->GetStaticBox(), wxID_ANY, _("Ce&nter and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ZoomCenterOpt->SetToolTip( _("Center the cursor on screen when zooming.") ); - - sbSizer2PAN->Add( m_ZoomCenterOpt, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); - - m_MousewheelPANOpt = new wxCheckBox( sbSizer2PAN->GetStaticBox(), wxID_ANY, _("Use touchpad to pan"), wxDefaultPosition, wxDefaultSize, 0 ); - m_MousewheelPANOpt->SetToolTip( _("Enable touchpad-friendly controls (pan with scroll action, zoom with Ctrl+scroll).") ); - - sbSizer2PAN->Add( m_MousewheelPANOpt, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); - - m_AutoPANOpt = new wxCheckBox( sbSizer2PAN->GetStaticBox(), wxID_AUTOPAN, _("&Pan while moving object"), wxDefaultPosition, wxDefaultSize, 0 ); - m_AutoPANOpt->SetToolTip( _("When drawing a track or moving an item, pan when approaching the edge of the display.") ); - - sbSizer2PAN->Add( m_AutoPANOpt, 0, wxALL, 5 ); - - - bLeftSizer->Add( sbSizer2PAN, 1, wxEXPAND|wxALL, 5 ); - - - bSizerUpper->Add( bLeftSizer, 2, wxALL|wxEXPAND, 5 ); - - wxBoxSizer* bMiddleLeftSizer; - bMiddleLeftSizer = new wxBoxSizer( wxVERTICAL ); - - wxString m_PolarDisplayChoices[] = { _("Cartesian coordinates"), _("Polar coordinates") }; - int m_PolarDisplayNChoices = sizeof( m_PolarDisplayChoices ) / sizeof( wxString ); - m_PolarDisplay = new wxRadioBox( this, wxID_POLAR_CTRL, _("Coordinates:"), wxDefaultPosition, wxDefaultSize, m_PolarDisplayNChoices, m_PolarDisplayChoices, 1, wxRA_SPECIFY_COLS ); - m_PolarDisplay->SetSelection( 0 ); - m_PolarDisplay->SetToolTip( _("Set display of relative (dx/dy) coordinates to Cartesian (rectangular) or polar (angle/distance).") ); - - bMiddleLeftSizer->Add( m_PolarDisplay, 0, wxALL|wxEXPAND, 5 ); - - wxString m_UnitsSelectionChoices[] = { _("Inches"), _("Millimeters") }; - int m_UnitsSelectionNChoices = sizeof( m_UnitsSelectionChoices ) / sizeof( wxString ); - m_UnitsSelection = new wxRadioBox( this, wxID_UNITS, _("Units:"), wxDefaultPosition, wxDefaultSize, m_UnitsSelectionNChoices, m_UnitsSelectionChoices, 1, wxRA_SPECIFY_COLS ); - m_UnitsSelection->SetSelection( 0 ); - m_UnitsSelection->SetToolTip( _("Set units used to display dimensions and positions.") ); - - bMiddleLeftSizer->Add( m_UnitsSelection, 0, wxALL|wxEXPAND, 5 ); - - wxStaticBoxSizer* bOptionsSizer; - bOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL ); - - m_ShowGlobalRatsnest = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_GENERAL_RATSNEST, _("&Show ratsnest"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ShowGlobalRatsnest->SetValue(true); - m_ShowGlobalRatsnest->SetToolTip( _("Show the full ratsnest.") ); - - bOptionsSizer->Add( m_ShowGlobalRatsnest, 0, wxALL, 5 ); - - m_Show_Page_Limits = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 0 ); - m_Show_Page_Limits->SetValue(true); - bOptionsSizer->Add( m_Show_Page_Limits, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - - bOptionsSizer->Add( 0, 0, 0, wxALL|wxEXPAND, 5 ); - - m_Segments_45_Only_Ctrl = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_SEGMENTS45, _("L&imit graphic lines to 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); - m_Segments_45_Only_Ctrl->SetToolTip( _("Force line segment directions to H, V or 45 degrees when drawing on technical layers.") ); - - bOptionsSizer->Add( m_Segments_45_Only_Ctrl, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - m_UseEditKeyForWidth = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Edit action changes track width"), wxDefaultPosition, wxDefaultSize, 0 ); - m_UseEditKeyForWidth->SetToolTip( _("When active, hitting Edit hotkey or double-clicking on a track or via changes its width/diameter to the one selected in the main toolbar. ") ); - - bOptionsSizer->Add( m_UseEditKeyForWidth, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - m_dragSelects = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Prefer selection to dragging"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dragSelects->SetToolTip( _("When enabled and nothing is selected, drag gesture will draw a selection box, even if there are items under the cursor that could be immediately dragged.") ); - - bOptionsSizer->Add( m_dragSelects, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - wxFlexGridSizer* fgSizer12; - fgSizer12 = new wxFlexGridSizer( 0, 2, 0, 0 ); - fgSizer12->AddGrowableCol( 1 ); - fgSizer12->SetFlexibleDirection( wxBOTH ); - fgSizer12->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticTextRotationAngle = new wxStaticText( bOptionsSizer->GetStaticBox(), wxID_ANY, _("&Rotation angle:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextRotationAngle->Wrap( -1 ); - fgSizer12->Add( m_staticTextRotationAngle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_RotationAngle = new wxTextCtrl( bOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_RotationAngle->SetToolTip( _("Set increment (in degrees) for context menu and hotkey rotation.") ); - - fgSizer12->Add( m_RotationAngle, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); - - - bOptionsSizer->Add( fgSizer12, 1, wxEXPAND, 5 ); - - - bMiddleLeftSizer->Add( bOptionsSizer, 1, wxEXPAND|wxALL, 5 ); - - - bSizerUpper->Add( bMiddleLeftSizer, 0, wxALL|wxEXPAND, 5 ); - - wxBoxSizer* bRightSizer; - bRightSizer = new wxBoxSizer( wxVERTICAL ); - - wxString m_MagneticPadOptCtrlChoices[] = { _("Never"), _("When creating tracks"), _("Always") }; - int m_MagneticPadOptCtrlNChoices = sizeof( m_MagneticPadOptCtrlChoices ) / sizeof( wxString ); - m_MagneticPadOptCtrl = new wxRadioBox( this, wxID_ANY, _("Magnetic Pads:"), wxDefaultPosition, wxDefaultSize, m_MagneticPadOptCtrlNChoices, m_MagneticPadOptCtrlChoices, 1, wxRA_SPECIFY_COLS ); - m_MagneticPadOptCtrl->SetSelection( 2 ); - m_MagneticPadOptCtrl->SetToolTip( _("Control capture of the cursor when the mouse enters a pad area.") ); - - bRightSizer->Add( m_MagneticPadOptCtrl, 0, wxALL|wxEXPAND, 5 ); - - wxString m_MagneticTrackOptCtrlChoices[] = { _("Never"), _("When creating tracks"), _("Always") }; - int m_MagneticTrackOptCtrlNChoices = sizeof( m_MagneticTrackOptCtrlChoices ) / sizeof( wxString ); - m_MagneticTrackOptCtrl = new wxRadioBox( this, wxID_MAGNETIC_TRACKS, _("Magnetic Tracks:"), wxDefaultPosition, wxDefaultSize, m_MagneticTrackOptCtrlNChoices, m_MagneticTrackOptCtrlChoices, 1, wxRA_SPECIFY_COLS ); - m_MagneticTrackOptCtrl->SetSelection( 0 ); - m_MagneticTrackOptCtrl->SetToolTip( _("Control capture of the cursor when the mouse approaches a track.") ); - - bRightSizer->Add( m_MagneticTrackOptCtrl, 0, wxALL|wxEXPAND, 5 ); - - wxStaticBoxSizer* bLegacyOptionsSizer; - bLegacyOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Legacy Routing Options:") ), wxVERTICAL ); - - m_DrcOn = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_DRC_ONOFF, _("&Enforce design rules when routing"), wxDefaultPosition, wxDefaultSize, 0 ); - m_DrcOn->SetValue(true); - m_DrcOn->SetToolTip( _("Enable DRC control. When DRC control is disabled, all connections are allowed.") ); - - bLegacyOptionsSizer->Add( m_DrcOn, 0, wxALL|wxEXPAND, 5 ); - - m_TrackAutodel = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_TRACK_AUTODEL, _("Auto-delete old tracks"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TrackAutodel->SetValue(true); - m_TrackAutodel->SetToolTip( _("Enable automatic track deletion when redrawing a track.") ); - - bLegacyOptionsSizer->Add( m_TrackAutodel, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - m_Track_45_Only_Ctrl = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_TRACKS45, _("&Limit tracks to 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); - m_Track_45_Only_Ctrl->SetValue(true); - m_Track_45_Only_Ctrl->SetToolTip( _("Force track directions to H, V or 45 degrees when drawing a track.") ); - - bLegacyOptionsSizer->Add( m_Track_45_Only_Ctrl, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - m_Track_DoubleSegm_Ctrl = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_ANY, _("&Use double segmented tracks"), wxDefaultPosition, wxDefaultSize, 0 ); - m_Track_DoubleSegm_Ctrl->SetValue(true); - m_Track_DoubleSegm_Ctrl->SetToolTip( _("Use two track segments, with 45 degrees angle between them, when drawing a new track ") ); - - bLegacyOptionsSizer->Add( m_Track_DoubleSegm_Ctrl, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - - - bRightSizer->Add( bLegacyOptionsSizer, 1, wxEXPAND|wxALL, 5 ); - - - bSizerUpper->Add( bRightSizer, 0, wxALL|wxEXPAND, 5 ); - - - bMainSizer->Add( bSizerUpper, 0, wxEXPAND, 5 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bMainSizer->Add( m_staticline1, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - m_sdbSizer = new wxStdDialogButtonSizer(); - m_sdbSizerOK = new wxButton( this, wxID_OK ); - m_sdbSizer->AddButton( m_sdbSizerOK ); - m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); - m_sdbSizer->AddButton( m_sdbSizerCancel ); - m_sdbSizer->Realize(); - - bMainSizer->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 ); - - - this->SetSizer( bMainSizer ); - this->Layout(); - bMainSizer->Fit( this ); - - // Connect Events - m_scaleSlider->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleAuto->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleAuto ), NULL, this ); - m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnCancelClick ), NULL, this ); - m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnOkClick ), NULL, this ); -} - -DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::~DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE() -{ - // Disconnect Events - m_scaleSlider->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleSlider->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleSlider ), NULL, this ); - m_scaleAuto->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnScaleAuto ), NULL, this ); - m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnCancelClick ), NULL, this ); - m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnOkClick ), NULL, this ); - -} diff --git a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp deleted file mode 100644 index d6af44d422..0000000000 --- a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp +++ /dev/null @@ -1,2606 +0,0 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_general_options_BoardEditor_base - 1000 - none - - 1 - DialogGeneralOptionsBoardEditor_base - - . - - 1 - 1 - 1 - 1 - UI - 1 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - General Settings - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxVERTICAL - none - - 5 - wxEXPAND - 0 - - - bSizerUpper - wxHORIZONTAL - none - - 5 - wxALL|wxEXPAND - 2 - - - bLeftSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 2 - wxBOTH - 1 - - 0 - - fgSizer1 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Auto save (minutes): - - 0 - - - 0 - - 1 - m_staticTextautosave - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 0 - 60 - - 0 - - 0 - - 0 - - 1 - m_SaveTime - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS - - 0 - Delay after the first change to create a backup file of the board on disk. If set to 0, auto backup is disabled. - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 1 - - wxID_ANY - User Interface: - - sbSizer5 - wxVERTICAL - 1 - none - - - 5 - wxALL|wxEXPAND - 0 - - 3 - wxBOTH - 1 - - 0 - - fgSizer11 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 3 - wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Icon scale: - - 0 - - - 0 - - 1 - m_staticText1 - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 4 - wxBOTTOM|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 275 - - 0 - - 50 - - 0 - - 1 - m_scaleSlider - 1 - - - protected - 1 - - Resizable - 1 - - wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS - STEPPED_SLIDER; widgets/stepped_slider.h; Not forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 50 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnScaleSlider - - - - - - - - - - - - - - - - 2 - wxALIGN_BOTTOM|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - % - - 0 - - - 0 - - 1 - m_staticText2 - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 9 - wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Auto - - 0 - - - 0 - - 1 - m_scaleAuto - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - OnScaleAuto - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show icons in menus - - 0 - - - 0 - - 1 - m_checkBoxIconsInMenus - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxALL - 1 - - wxID_ANY - Pan and Zoom: - - sbSizer2PAN - wxVERTICAL - 1 - none - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Ce&nter and warp cursor on zoom - - 0 - - - 0 - - 1 - m_ZoomCenterOpt - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Center the cursor on screen when zooming. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Use touchpad to pan - - 0 - - - 0 - - 1 - m_MousewheelPANOpt - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Enable touchpad-friendly controls (pan with scroll action, zoom with Ctrl+scroll). - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_AUTOPAN - &Pan while moving object - - 0 - - - 0 - - 1 - m_AutoPANOpt - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - When drawing a track or moving an item, pan when approaching the edge of the display. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - bMiddleLeftSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Cartesian coordinates" "Polar coordinates" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_POLAR_CTRL - Coordinates: - 1 - - 0 - - - 0 - - 1 - m_PolarDisplay - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Set display of relative (dx/dy) coordinates to Cartesian (rectangular) or polar (angle/distance). - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Inches" "Millimeters" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_UNITS - Units: - 1 - - 0 - - - 0 - - 1 - m_UnitsSelection - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Set units used to display dimensions and positions. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxALL - 1 - - wxID_ANY - Options: - - bOptionsSizer - wxVERTICAL - 1 - none - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_GENERAL_RATSNEST - &Show ratsnest - - 0 - - - 0 - - 1 - m_ShowGlobalRatsnest - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Show the full ratsnest. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show page limits - - 0 - - - 0 - - 1 - m_Show_Page_Limits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 0 - protected - 0 - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_SEGMENTS45 - L&imit graphic lines to 45 degrees - - 0 - - - 0 - - 1 - m_Segments_45_Only_Ctrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Force line segment directions to H, V or 45 degrees when drawing on technical layers. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Edit action changes track width - - 0 - - - 0 - - 1 - m_UseEditKeyForWidth - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - When active, hitting Edit hotkey or double-clicking on a track or via changes its width/diameter to the one selected in the main toolbar. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Prefer selection to dragging - - 0 - - - 0 - - 1 - m_dragSelects - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - When enabled and nothing is selected, drag gesture will draw a selection box, even if there are items under the cursor that could be immediately dragged. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 2 - wxBOTH - 1 - - 0 - - fgSizer12 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Rotation angle: - - 0 - - - 0 - - 1 - m_staticTextRotationAngle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_RotationAngle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Set increment (in degrees) for context menu and hotkey rotation. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - bRightSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Never" "When creating tracks" "Always" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Magnetic Pads: - 1 - - 0 - - - 0 - - 1 - m_MagneticPadOptCtrl - 1 - - - protected - 1 - - Resizable - 2 - 1 - - wxRA_SPECIFY_COLS - - 0 - Control capture of the cursor when the mouse enters a pad area. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Never" "When creating tracks" "Always" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_MAGNETIC_TRACKS - Magnetic Tracks: - 1 - - 0 - - - 0 - - 1 - m_MagneticTrackOptCtrl - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Control capture of the cursor when the mouse approaches a track. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxALL - 1 - - wxID_ANY - Legacy Routing Options: - - bLegacyOptionsSizer - wxVERTICAL - 1 - none - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_DRC_ONOFF - &Enforce design rules when routing - - 0 - - - 0 - - 1 - m_DrcOn - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Enable DRC control. When DRC control is disabled, all connections are allowed. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_TRACK_AUTODEL - Auto-delete old tracks - - 0 - - - 0 - - 1 - m_TrackAutodel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Enable automatic track deletion when redrawing a track. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_TRACKS45 - &Limit tracks to 45 degrees - - 0 - - - 0 - - 1 - m_Track_45_Only_Ctrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Force track directions to H, V or 45 degrees when drawing a track. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Use double segmented tracks - - 0 - - - 0 - - 1 - m_Track_DoubleSegm_Ctrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Use two track segments, with 45 degrees angle between them, when drawing a new track - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer - protected - - OnCancelClick - - - - OnOkClick - - - - - - - - diff --git a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h deleted file mode 100644 index 5d9acd78fe..0000000000 --- a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h +++ /dev/null @@ -1,100 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __DIALOG_GENERAL_OPTIONS_BOARDEDITOR_BASE_H__ -#define __DIALOG_GENERAL_OPTIONS_BOARDEDITOR_BASE_H__ - -#include -#include -#include -#include "widgets/stepped_slider.h" -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE : public DIALOG_SHIM -{ - private: - - protected: - enum - { - wxID_AUTOPAN = 1000, - wxID_POLAR_CTRL, - wxID_UNITS, - wxID_GENERAL_RATSNEST, - wxID_SEGMENTS45, - wxID_MAGNETIC_TRACKS, - wxID_DRC_ONOFF, - wxID_TRACK_AUTODEL, - wxID_TRACKS45 - }; - - wxStaticText* m_staticTextautosave; - wxSpinCtrl* m_SaveTime; - wxStaticText* m_staticText1; - STEPPED_SLIDER* m_scaleSlider; - wxStaticText* m_staticText2; - wxCheckBox* m_scaleAuto; - wxCheckBox* m_checkBoxIconsInMenus; - wxCheckBox* m_ZoomCenterOpt; - wxCheckBox* m_MousewheelPANOpt; - wxCheckBox* m_AutoPANOpt; - wxRadioBox* m_PolarDisplay; - wxRadioBox* m_UnitsSelection; - wxCheckBox* m_ShowGlobalRatsnest; - wxCheckBox* m_Show_Page_Limits; - wxCheckBox* m_Segments_45_Only_Ctrl; - wxCheckBox* m_UseEditKeyForWidth; - wxCheckBox* m_dragSelects; - wxStaticText* m_staticTextRotationAngle; - wxTextCtrl* m_RotationAngle; - wxRadioBox* m_MagneticPadOptCtrl; - wxRadioBox* m_MagneticTrackOptCtrl; - wxCheckBox* m_DrcOn; - wxCheckBox* m_TrackAutodel; - wxCheckBox* m_Track_45_Only_Ctrl; - wxCheckBox* m_Track_DoubleSegm_Ctrl; - wxStaticLine* m_staticline1; - wxStdDialogButtonSizer* m_sdbSizer; - wxButton* m_sdbSizerOK; - wxButton* m_sdbSizerCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnScaleSlider( wxScrollEvent& event ) { event.Skip(); } - virtual void OnScaleAuto( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("General Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE(); - -}; - -#endif //__DIALOG_GENERAL_OPTIONS_BOARDEDITOR_BASE_H__ diff --git a/pcbnew/dialogs/dialog_modedit_options.cpp b/pcbnew/dialogs/dialog_modedit_options.cpp deleted file mode 100644 index e7bfdf57fc..0000000000 --- a/pcbnew/dialogs/dialog_modedit_options.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ -/** - * @file dialog_modedit_options.cpp - */ - -#include -#include -#include -#include -#include -#include - -#include - -#include - - -class DIALOG_MODEDIT_OPTIONS : public DIALOG_MODEDIT_OPTIONS_BASE -{ - BOARD_DESIGN_SETTINGS m_brdSettings; - FOOTPRINT_EDIT_FRAME * m_parent; - -public: - DIALOG_MODEDIT_OPTIONS( FOOTPRINT_EDIT_FRAME* aParent ); - -private: - void OnCancelClick( wxCommandEvent& event ) override { EndModal( wxID_CANCEL ); } - void OnOkClick( wxCommandEvent& event ) override; - - void initValues( ); -}; - - -DIALOG_MODEDIT_OPTIONS::DIALOG_MODEDIT_OPTIONS( FOOTPRINT_EDIT_FRAME* aParent ) : - DIALOG_MODEDIT_OPTIONS_BASE( aParent ) -{ - m_parent = aParent; - m_brdSettings = m_parent->GetDesignSettings(); - initValues(); - - m_sdbSizer1OK->SetDefault(); - GetSizer()->SetSizeHints( this ); - - Centre(); -} - - -bool InvokeFPEditorPrefsDlg( FOOTPRINT_EDIT_FRAME* aCaller ) -{ - DIALOG_MODEDIT_OPTIONS dlg( aCaller ); - - int ret = dlg.ShowModal(); - - return ret == wxID_OK; -} - - -void DIALOG_MODEDIT_OPTIONS::initValues() -{ - EDA_UNITS_T units = g_UserUnit; - auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_parent->GetDisplayOptions(); - - // Modules: graphic lines width: - m_staticTextGrLineUnit->SetLabel( GetAbbreviatedUnitsLabel( units ) ); - PutValueInLocalUnits( *m_OptModuleGrLineWidth, m_brdSettings.m_ModuleSegmentWidth ); - - // Modules: Texts: Size & width: - m_staticTextTextWidthUnit->SetLabel( GetAbbreviatedUnitsLabel( units ) ); - PutValueInLocalUnits( *m_OptModuleTextWidth, m_brdSettings.m_ModuleTextWidth ); - - m_staticTextTextVSizeUnit->SetLabel( GetAbbreviatedUnitsLabel( units ) ); - PutValueInLocalUnits( *m_OptModuleTextVSize, m_brdSettings.m_ModuleTextSize.y ); - - m_staticTextTextHSizeUnit->SetLabel( GetAbbreviatedUnitsLabel( units ) ); - PutValueInLocalUnits( *m_OptModuleTextHSize, m_brdSettings.m_ModuleTextSize.x ); - - // Ref: default values - m_textCtrlRefText->SetValue( m_brdSettings.m_RefDefaultText ); - int sel = m_brdSettings.m_RefDefaultlayer == F_SilkS ? 0 : 1; - m_choiceLayerReference->SetSelection( sel ); - sel = m_brdSettings.m_RefDefaultVisibility ? 0 : 1; - m_choiceVisibleReference->SetSelection( sel ); - - // Value: default values - m_textCtrlValueText->SetValue( m_brdSettings.m_ValueDefaultText ); - sel = m_brdSettings.m_ValueDefaultlayer == F_SilkS ? 0 : 1; - m_choiceLayerValue->SetSelection( sel ); - sel = m_brdSettings.m_ValueDefaultVisibility ? 0 : 1; - m_choiceVisibleValue->SetSelection( sel ); - - // Display options - m_PolarDisplay->SetSelection( displ_opts->m_DisplayPolarCood ? 1 : 0 ); - m_UnitsSelection->SetSelection( g_UserUnit == INCHES ? 0 : 1 ); - - // Editing options - m_Segments_45_Only_Ctrl->SetValue( m_parent->Settings().m_use45DegreeGraphicSegments ); - m_MagneticPads->SetValue( m_parent->Settings().m_magneticPads == CAPTURE_ALWAYS ); - m_dragSelects->SetValue( m_parent->Settings().m_dragSelects ); -} - - -void DIALOG_MODEDIT_OPTIONS::OnOkClick( wxCommandEvent& event ) -{ - m_brdSettings.m_ModuleSegmentWidth = ValueFromTextCtrl( *m_OptModuleGrLineWidth ); - m_brdSettings.m_ModuleTextWidth = ValueFromTextCtrl( *m_OptModuleTextWidth ); - m_brdSettings.m_ModuleTextSize.y = ValueFromTextCtrl( *m_OptModuleTextVSize ); - m_brdSettings.m_ModuleTextSize.x = ValueFromTextCtrl( *m_OptModuleTextHSize ); - - // Ref: default values - m_brdSettings.m_RefDefaultText = m_textCtrlRefText->GetValue(); - int sel = m_choiceLayerReference->GetSelection(); - m_brdSettings.m_RefDefaultlayer = sel == 1 ? F_Fab : F_SilkS; - sel = m_choiceVisibleReference->GetSelection(); - m_brdSettings.m_RefDefaultVisibility = sel != 1; - - // Value: default values - m_brdSettings.m_ValueDefaultText = m_textCtrlValueText->GetValue(); - sel = m_choiceLayerValue->GetSelection(); - m_brdSettings.m_ValueDefaultlayer = sel == 1 ? F_Fab : F_SilkS; - sel = m_choiceVisibleValue->GetSelection(); - m_brdSettings.m_ValueDefaultVisibility = sel != 1; - - m_parent->SetDesignSettings( m_brdSettings ); - - // Display options - auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_parent->GetDisplayOptions(); - displ_opts->m_DisplayPolarCood = m_PolarDisplay->GetSelection() != 0; - - EDA_UNITS_T units = ( m_UnitsSelection->GetSelection() == 0 ) ? INCHES : MILLIMETRES; - if( units != g_UserUnit ) - { - g_UserUnit = units; - m_parent->ReCreateAuxiliaryToolbar(); - } - - // Editing options - m_parent->Settings().m_use45DegreeGraphicSegments = m_Segments_45_Only_Ctrl->GetValue(); - m_parent->Settings().m_magneticPads = m_MagneticPads->GetValue() ? CAPTURE_ALWAYS : NO_EFFECT; - m_parent->Settings().m_dragSelects = m_dragSelects->GetValue(); - - EndModal( wxID_OK ); -} diff --git a/pcbnew/dialogs/dialog_modedit_options_base.cpp b/pcbnew/dialogs/dialog_modedit_options_base.cpp deleted file mode 100644 index b832bf1619..0000000000 --- a/pcbnew/dialogs/dialog_modedit_options_base.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 20 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "widgets/text_ctrl_eval.h" - -#include "dialog_modedit_options_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_MODEDIT_OPTIONS_BASE::DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizerMain; - bSizerMain = new wxBoxSizer( wxVERTICAL ); - - wxFlexGridSizer* fgSizer3; - fgSizer3 = new wxFlexGridSizer( 0, 2, 0, 0 ); - fgSizer3->AddGrowableCol( 0 ); - fgSizer3->SetFlexibleDirection( wxBOTH ); - fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - wxStaticBoxSizer* sbSizerNewGraphicItems; - sbSizerNewGraphicItems = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Default Values for New Graphic Items") ), wxVERTICAL ); - - wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 0, 3, 5, 5 ); - fgSizer1->AddGrowableCol( 1 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); - fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_EdgeModEWidthTitle = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("&Graphic line width:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_EdgeModEWidthTitle->Wrap( -1 ); - fgSizer1->Add( m_EdgeModEWidthTitle, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_OptModuleGrLineWidth = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_OptModuleGrLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticTextGrLineUnit = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextGrLineUnit->Wrap( -1 ); - fgSizer1->Add( m_staticTextGrLineUnit, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_TextModWidthTitle = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("&Text line width:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextModWidthTitle->Wrap( -1 ); - fgSizer1->Add( m_TextModWidthTitle, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_OptModuleTextWidth = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_OptModuleTextWidth, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticTextTextWidthUnit = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTextWidthUnit->Wrap( -1 ); - fgSizer1->Add( m_staticTextTextWidthUnit, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_TextModSizeVTitle = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("Text &height:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextModSizeVTitle->Wrap( -1 ); - fgSizer1->Add( m_TextModSizeVTitle, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_OptModuleTextVSize = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_OptModuleTextVSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticTextTextVSizeUnit = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTextVSizeUnit->Wrap( -1 ); - fgSizer1->Add( m_staticTextTextVSizeUnit, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_TextModSizeHTitle = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("Text &width:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextModSizeHTitle->Wrap( -1 ); - fgSizer1->Add( m_TextModSizeHTitle, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_OptModuleTextHSize = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_OptModuleTextHSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticTextTextHSizeUnit = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTextHSizeUnit->Wrap( -1 ); - fgSizer1->Add( m_staticTextTextHSizeUnit, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - sbSizerNewGraphicItems->Add( fgSizer1, 0, wxEXPAND, 20 ); - - - fgSizer3->Add( sbSizerNewGraphicItems, 0, wxALL|wxEXPAND, 5 ); - - wxBoxSizer* bSizerDisplayOptions; - bSizerDisplayOptions = new wxBoxSizer( wxVERTICAL ); - - wxString m_PolarDisplayChoices[] = { _("Cartesian coordinates"), _("Polar coordinates") }; - int m_PolarDisplayNChoices = sizeof( m_PolarDisplayChoices ) / sizeof( wxString ); - m_PolarDisplay = new wxRadioBox( this, wxID_POLAR_CTRL, _("Coordinates"), wxDefaultPosition, wxDefaultSize, m_PolarDisplayNChoices, m_PolarDisplayChoices, 1, wxRA_SPECIFY_COLS ); - m_PolarDisplay->SetSelection( 0 ); - m_PolarDisplay->SetToolTip( _("Set display of relative (dx/dy) coordinates to Cartesian (rectangular) or polar (angle/distance).") ); - - bSizerDisplayOptions->Add( m_PolarDisplay, 1, wxALL|wxEXPAND, 5 ); - - wxString m_UnitsSelectionChoices[] = { _("Inches"), _("Millimeters") }; - int m_UnitsSelectionNChoices = sizeof( m_UnitsSelectionChoices ) / sizeof( wxString ); - m_UnitsSelection = new wxRadioBox( this, wxID_UNITS, _("Units"), wxDefaultPosition, wxDefaultSize, m_UnitsSelectionNChoices, m_UnitsSelectionChoices, 1, wxRA_SPECIFY_COLS ); - m_UnitsSelection->SetSelection( 0 ); - m_UnitsSelection->SetToolTip( _("Set units used to display dimensions and positions.") ); - - bSizerDisplayOptions->Add( m_UnitsSelection, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - fgSizer3->Add( bSizerDisplayOptions, 0, wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizerNewFootprints; - sbSizerNewFootprints = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Default Values for New Footprints") ), wxVERTICAL ); - - wxFlexGridSizer* fgSizer2; - fgSizer2 = new wxFlexGridSizer( 0, 4, 5, 5 ); - fgSizer2->AddGrowableCol( 1 ); - fgSizer2->SetFlexibleDirection( wxBOTH ); - fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticTextRef = new wxStaticText( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, _("&Reference:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextRef->Wrap( -1 ); - fgSizer2->Add( m_staticTextRef, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlRefText = new wxTextCtrl( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_textCtrlRefText->SetToolTip( _("Default text for reference\nLeave blank to use the footprint name") ); - - fgSizer2->Add( m_textCtrlRefText, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxString m_choiceLayerReferenceChoices[] = { _("SilkScreen"), _("Fab. Layer") }; - int m_choiceLayerReferenceNChoices = sizeof( m_choiceLayerReferenceChoices ) / sizeof( wxString ); - m_choiceLayerReference = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceLayerReferenceNChoices, m_choiceLayerReferenceChoices, 0 ); - m_choiceLayerReference->SetSelection( 0 ); - fgSizer2->Add( m_choiceLayerReference, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxString m_choiceVisibleReferenceChoices[] = { _("Visible"), _("Invisible") }; - int m_choiceVisibleReferenceNChoices = sizeof( m_choiceVisibleReferenceChoices ) / sizeof( wxString ); - m_choiceVisibleReference = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceVisibleReferenceNChoices, m_choiceVisibleReferenceChoices, 0 ); - m_choiceVisibleReference->SetSelection( 0 ); - fgSizer2->Add( m_choiceVisibleReference, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextValue = new wxStaticText( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, _("V&alue:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextValue->Wrap( -1 ); - fgSizer2->Add( m_staticTextValue, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlValueText = new wxTextCtrl( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_textCtrlValueText->SetToolTip( _("Default text for value\nLeave blank to use the footprint name") ); - - fgSizer2->Add( m_textCtrlValueText, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxString m_choiceLayerValueChoices[] = { _("SilkScreen"), _("Fab. Layer") }; - int m_choiceLayerValueNChoices = sizeof( m_choiceLayerValueChoices ) / sizeof( wxString ); - m_choiceLayerValue = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceLayerValueNChoices, m_choiceLayerValueChoices, 0 ); - m_choiceLayerValue->SetSelection( 1 ); - fgSizer2->Add( m_choiceLayerValue, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxString m_choiceVisibleValueChoices[] = { _("Visible"), _("Invisible") }; - int m_choiceVisibleValueNChoices = sizeof( m_choiceVisibleValueChoices ) / sizeof( wxString ); - m_choiceVisibleValue = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceVisibleValueNChoices, m_choiceVisibleValueChoices, 0 ); - m_choiceVisibleValue->SetSelection( 0 ); - fgSizer2->Add( m_choiceVisibleValue, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - sbSizerNewFootprints->Add( fgSizer2, 0, wxEXPAND, 20 ); - - m_staticTextInfo = new wxStaticText( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, _("Leave reference and/or value blank to use footprint name."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextInfo->Wrap( -1 ); - sbSizerNewFootprints->Add( m_staticTextInfo, 0, wxTOP, 5 ); - - - fgSizer3->Add( sbSizerNewFootprints, 0, wxALL|wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizerEditOptions; - sbSizerEditOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Editing Options") ), wxVERTICAL ); - - m_MagneticPads = new wxCheckBox( sbSizerEditOptions->GetStaticBox(), wxID_ANY, _("Magnetic pads"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerEditOptions->Add( m_MagneticPads, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - sbSizerEditOptions->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - m_Segments_45_Only_Ctrl = new wxCheckBox( sbSizerEditOptions->GetStaticBox(), wxID_SEGMENTS45, _("L&imit graphic lines to 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); - m_Segments_45_Only_Ctrl->SetToolTip( _("Force line segment directions to H, V or 45 degrees when drawing on technical layers.") ); - - sbSizerEditOptions->Add( m_Segments_45_Only_Ctrl, 0, wxALL, 5 ); - - m_dragSelects = new wxCheckBox( sbSizerEditOptions->GetStaticBox(), wxID_ANY, _("Prefer selection to dragging"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dragSelects->SetToolTip( _("When enabled and nothing is selected, drag gesture will draw a selection box, even if there are items under the cursor that could be immediately dragged.") ); - - sbSizerEditOptions->Add( m_dragSelects, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - fgSizer3->Add( sbSizerEditOptions, 0, wxALL|wxEXPAND, 5 ); - - - bSizerMain->Add( fgSizer3, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxBoxSizer* bSizerColumns; - bSizerColumns = new wxBoxSizer( wxHORIZONTAL ); - - - bSizerMain->Add( bSizerColumns, 1, wxEXPAND, 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(); - - bSizerMain->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); - - - this->SetSizer( bSizerMain ); - this->Layout(); - bSizerMain->Fit( this ); - - // Connect Events - m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODEDIT_OPTIONS_BASE::OnCancelClick ), NULL, this ); - m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODEDIT_OPTIONS_BASE::OnOkClick ), NULL, this ); -} - -DIALOG_MODEDIT_OPTIONS_BASE::~DIALOG_MODEDIT_OPTIONS_BASE() -{ - // Disconnect Events - m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODEDIT_OPTIONS_BASE::OnCancelClick ), NULL, this ); - m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODEDIT_OPTIONS_BASE::OnOkClick ), NULL, this ); - -} diff --git a/pcbnew/dialogs/dialog_modedit_options_base.h b/pcbnew/dialogs/dialog_modedit_options_base.h deleted file mode 100644 index fbfd57b7c9..0000000000 --- a/pcbnew/dialogs/dialog_modedit_options_base.h +++ /dev/null @@ -1,88 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 20 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __DIALOG_MODEDIT_OPTIONS_BASE_H__ -#define __DIALOG_MODEDIT_OPTIONS_BASE_H__ - -#include -#include -#include -class TEXT_CTRL_EVAL; - -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -#define wxID_POLAR_CTRL 1000 -#define wxID_UNITS 1001 -#define wxID_SEGMENTS45 1002 - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_MODEDIT_OPTIONS_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_MODEDIT_OPTIONS_BASE : public DIALOG_SHIM -{ - private: - - protected: - wxStaticText* m_EdgeModEWidthTitle; - TEXT_CTRL_EVAL* m_OptModuleGrLineWidth; - wxStaticText* m_staticTextGrLineUnit; - wxStaticText* m_TextModWidthTitle; - TEXT_CTRL_EVAL* m_OptModuleTextWidth; - wxStaticText* m_staticTextTextWidthUnit; - wxStaticText* m_TextModSizeVTitle; - TEXT_CTRL_EVAL* m_OptModuleTextVSize; - wxStaticText* m_staticTextTextVSizeUnit; - wxStaticText* m_TextModSizeHTitle; - TEXT_CTRL_EVAL* m_OptModuleTextHSize; - wxStaticText* m_staticTextTextHSizeUnit; - wxRadioBox* m_PolarDisplay; - wxRadioBox* m_UnitsSelection; - wxStaticText* m_staticTextRef; - wxTextCtrl* m_textCtrlRefText; - wxChoice* m_choiceLayerReference; - wxChoice* m_choiceVisibleReference; - wxStaticText* m_staticTextValue; - wxTextCtrl* m_textCtrlValueText; - wxChoice* m_choiceLayerValue; - wxChoice* m_choiceVisibleValue; - wxStaticText* m_staticTextInfo; - wxCheckBox* m_MagneticPads; - wxCheckBox* m_Segments_45_Only_Ctrl; - wxCheckBox* m_dragSelects; - wxStdDialogButtonSizer* m_sdbSizer1; - wxButton* m_sdbSizer1OK; - wxButton* m_sdbSizer1Cancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprint Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_MODEDIT_OPTIONS_BASE(); - -}; - -#endif //__DIALOG_MODEDIT_OPTIONS_BASE_H__ diff --git a/pcbnew/dialogs/panel_modedit_defaults.cpp b/pcbnew/dialogs/panel_modedit_defaults.cpp new file mode 100644 index 0000000000..252b935d8e --- /dev/null +++ b/pcbnew/dialogs/panel_modedit_defaults.cpp @@ -0,0 +1,82 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include +#include + +#include + +PANEL_MODEDIT_DEFAULTS::PANEL_MODEDIT_DEFAULTS( FOOTPRINT_EDIT_FRAME* aFrame, PAGED_DIALOG* aParent) : + PANEL_MODEDIT_DEFAULTS_BASE( aParent ), + m_brdSettings( aFrame->GetDesignSettings() ), + m_frame( aFrame ), + m_lineWidth( aFrame, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits, true, 0 ), + m_textThickness( aFrame, m_textThickLabel, m_textThickCtrl, m_textThickUnits, true, 0 ), + m_textWidth( aFrame, m_textWidthLabel, m_textWidthCtrl, m_textWidthUnits, true, 0 ), + m_textHeight( aFrame, m_textHeightLabel, m_textHeightCtrl, m_textHeightUnits, true, 0 ) +{} + + +bool PANEL_MODEDIT_DEFAULTS::TransferDataToWindow() +{ + m_lineWidth.SetValue( m_brdSettings.m_ModuleSegmentWidth ); + + m_textThickness.SetValue( m_brdSettings.m_ModuleTextWidth ); + m_textWidth.SetValue( m_brdSettings.m_ModuleTextSize.x ); + m_textHeight.SetValue( m_brdSettings.m_ModuleTextSize.y ); + + m_textCtrlRefText->SetValue( m_brdSettings.m_RefDefaultText ); + m_choiceLayerReference->SetSelection( m_brdSettings.m_RefDefaultlayer == F_SilkS ? 0 : 1 ); + m_choiceVisibleReference->SetSelection( m_brdSettings.m_RefDefaultVisibility ? 0 : 1 ); + + m_textCtrlValueText->SetValue( m_brdSettings.m_ValueDefaultText ); + m_choiceLayerValue->SetSelection( m_brdSettings.m_ValueDefaultlayer == F_SilkS ? 0 : 1 ); + m_choiceVisibleValue->SetSelection( m_brdSettings.m_ValueDefaultVisibility ? 0 : 1 ); + + return true; +} + + +bool PANEL_MODEDIT_DEFAULTS::TransferDataFromWindow() +{ + m_brdSettings.m_ModuleSegmentWidth = m_lineWidth.GetValue(); + m_brdSettings.m_ModuleTextWidth = m_textThickness.GetValue(); + m_brdSettings.m_ModuleTextSize.x = m_textWidth.GetValue(); + m_brdSettings.m_ModuleTextSize.y = m_textHeight.GetValue(); + + m_brdSettings.m_RefDefaultText = m_textCtrlRefText->GetValue(); + m_brdSettings.m_RefDefaultlayer = m_choiceLayerReference->GetSelection() == 1 ? F_Fab : F_SilkS; + m_brdSettings.m_RefDefaultVisibility = m_choiceVisibleReference->GetSelection() != 1; + + m_brdSettings.m_ValueDefaultText = m_textCtrlValueText->GetValue(); + m_brdSettings.m_ValueDefaultlayer = m_choiceLayerValue->GetSelection() == 1 ? F_Fab : F_SilkS; + m_brdSettings.m_ValueDefaultVisibility = m_choiceVisibleValue->GetSelection() != 1; + + m_frame->SetDesignSettings( m_brdSettings ); + + return true; +} diff --git a/pcbnew/dialogs/panel_modedit_defaults.h b/pcbnew/dialogs/panel_modedit_defaults.h new file mode 100644 index 0000000000..13bdf27e70 --- /dev/null +++ b/pcbnew/dialogs/panel_modedit_defaults.h @@ -0,0 +1,52 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef KICAD_PANEL_MODEDIT_DEFAULTS_H +#define KICAD_PANEL_MODEDIT_DEFAULTS_H + +#include +#include +#include + +class FOOTPRINT_EDIT_FRAME; + + +class PANEL_MODEDIT_DEFAULTS : public PANEL_MODEDIT_DEFAULTS_BASE +{ + BOARD_DESIGN_SETTINGS m_brdSettings; + FOOTPRINT_EDIT_FRAME* m_frame; + + UNIT_BINDER m_lineWidth; + UNIT_BINDER m_textThickness; + UNIT_BINDER m_textWidth; + UNIT_BINDER m_textHeight; + +public: + PANEL_MODEDIT_DEFAULTS( FOOTPRINT_EDIT_FRAME* aFrame, PAGED_DIALOG* aParent ); + +private: + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; +}; + + + + +#endif //KICAD_PANEL_MODEDIT_DEFAULTS_H + diff --git a/pcbnew/dialogs/panel_modedit_defaults_base.cpp b/pcbnew/dialogs/panel_modedit_defaults_base.cpp new file mode 100644 index 0000000000..d8f625ce57 --- /dev/null +++ b/pcbnew/dialogs/panel_modedit_defaults_base.cpp @@ -0,0 +1,163 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "widgets/text_ctrl_eval.h" + +#include "panel_modedit_defaults_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_MODEDIT_DEFAULTS_BASE::PANEL_MODEDIT_DEFAULTS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bSizerMain; + bSizerMain = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizerMargins; + bSizerMargins = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizerNewGraphicItems; + sbSizerNewGraphicItems = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Default Values for New Graphic Items") ), wxVERTICAL ); + + wxFlexGridSizer* fgSizer1; + fgSizer1 = new wxFlexGridSizer( 0, 3, 5, 5 ); + fgSizer1->AddGrowableCol( 1 ); + fgSizer1->SetFlexibleDirection( wxBOTH ); + fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_lineWidthLabel = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("&Graphic line width:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lineWidthLabel->Wrap( -1 ); + fgSizer1->Add( m_lineWidthLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_lineWidthCtrl = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_lineWidthCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_lineWidthUnits = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lineWidthUnits->Wrap( -1 ); + fgSizer1->Add( m_lineWidthUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer1->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 ); + + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_textThickLabel = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("&Text thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textThickLabel->Wrap( -1 ); + fgSizer1->Add( m_textThickLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textThickCtrl = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_textThickCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_textThickUnits = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textThickUnits->Wrap( -1 ); + fgSizer1->Add( m_textThickUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textHeightLabel = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("Text &height:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textHeightLabel->Wrap( -1 ); + fgSizer1->Add( m_textHeightLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textHeightCtrl = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_textHeightCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_textHeightUnits = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textHeightUnits->Wrap( -1 ); + fgSizer1->Add( m_textHeightUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textWidthLabel = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("Text &width:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textWidthLabel->Wrap( -1 ); + fgSizer1->Add( m_textWidthLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textWidthCtrl = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_textWidthCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_textWidthUnits = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textWidthUnits->Wrap( -1 ); + fgSizer1->Add( m_textWidthUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + sbSizerNewGraphicItems->Add( fgSizer1, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 ); + + + bSizerMargins->Add( sbSizerNewGraphicItems, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + wxStaticBoxSizer* sbSizerNewFootprints; + sbSizerNewFootprints = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Default Values for New Footprints") ), wxVERTICAL ); + + wxFlexGridSizer* fgSizer2; + fgSizer2 = new wxFlexGridSizer( 0, 4, 5, 5 ); + fgSizer2->AddGrowableCol( 1 ); + fgSizer2->SetFlexibleDirection( wxBOTH ); + fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticTextRef = new wxStaticText( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, _("&Reference:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextRef->Wrap( -1 ); + fgSizer2->Add( m_staticTextRef, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlRefText = new wxTextCtrl( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_textCtrlRefText->SetToolTip( _("Default text for reference\nLeave blank to use the footprint name") ); + + fgSizer2->Add( m_textCtrlRefText, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 ); + + wxString m_choiceLayerReferenceChoices[] = { _("SilkScreen"), _("Fab. Layer") }; + int m_choiceLayerReferenceNChoices = sizeof( m_choiceLayerReferenceChoices ) / sizeof( wxString ); + m_choiceLayerReference = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceLayerReferenceNChoices, m_choiceLayerReferenceChoices, 0 ); + m_choiceLayerReference->SetSelection( 0 ); + fgSizer2->Add( m_choiceLayerReference, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + wxString m_choiceVisibleReferenceChoices[] = { _("Visible"), _("Invisible") }; + int m_choiceVisibleReferenceNChoices = sizeof( m_choiceVisibleReferenceChoices ) / sizeof( wxString ); + m_choiceVisibleReference = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceVisibleReferenceNChoices, m_choiceVisibleReferenceChoices, 0 ); + m_choiceVisibleReference->SetSelection( 0 ); + fgSizer2->Add( m_choiceVisibleReference, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextValue = new wxStaticText( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, _("V&alue:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextValue->Wrap( -1 ); + fgSizer2->Add( m_staticTextValue, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlValueText = new wxTextCtrl( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_textCtrlValueText->SetToolTip( _("Default text for value\nLeave blank to use the footprint name") ); + m_textCtrlValueText->SetMinSize( wxSize( 160,-1 ) ); + + fgSizer2->Add( m_textCtrlValueText, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 ); + + wxString m_choiceLayerValueChoices[] = { _("SilkScreen"), _("Fab. Layer") }; + int m_choiceLayerValueNChoices = sizeof( m_choiceLayerValueChoices ) / sizeof( wxString ); + m_choiceLayerValue = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceLayerValueNChoices, m_choiceLayerValueChoices, 0 ); + m_choiceLayerValue->SetSelection( 1 ); + fgSizer2->Add( m_choiceLayerValue, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + wxString m_choiceVisibleValueChoices[] = { _("Visible"), _("Invisible") }; + int m_choiceVisibleValueNChoices = sizeof( m_choiceVisibleValueChoices ) / sizeof( wxString ); + m_choiceVisibleValue = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceVisibleValueNChoices, m_choiceVisibleValueChoices, 0 ); + m_choiceVisibleValue->SetSelection( 0 ); + fgSizer2->Add( m_choiceVisibleValue, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + sbSizerNewFootprints->Add( fgSizer2, 0, wxEXPAND|wxBOTTOM, 5 ); + + m_staticTextInfo = new wxStaticText( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, _("Leave reference and/or value blank to use footprint name."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfo->Wrap( -1 ); + sbSizerNewFootprints->Add( m_staticTextInfo, 0, wxTOP|wxBOTTOM, 5 ); + + + bSizerMargins->Add( sbSizerNewFootprints, 0, wxEXPAND|wxTOP|wxLEFT, 5 ); + + + bSizerMain->Add( bSizerMargins, 0, wxEXPAND|wxTOP|wxLEFT, 10 ); + + + this->SetSizer( bSizerMain ); + this->Layout(); + bSizerMain->Fit( this ); +} + +PANEL_MODEDIT_DEFAULTS_BASE::~PANEL_MODEDIT_DEFAULTS_BASE() +{ +} diff --git a/pcbnew/dialogs/dialog_modedit_options_base.fbp b/pcbnew/dialogs/panel_modedit_defaults_base.fbp similarity index 78% rename from pcbnew/dialogs/dialog_modedit_options_base.fbp rename to pcbnew/dialogs/panel_modedit_defaults_base.fbp index 4eafd161b5..879c175f48 100644 --- a/pcbnew/dialogs/dialog_modedit_options_base.fbp +++ b/pcbnew/dialogs/panel_modedit_defaults_base.fbp @@ -1,2512 +1,2007 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_modedit_options_base - 1000 - none - - 1 - dialog_graphic_items_options - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - DIALOG_MODEDIT_OPTIONS_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Footprint Editor Options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bSizerMain - wxVERTICAL - none - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 1 - - 2 - wxBOTH - 0 - - 0 - - fgSizer3 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 5 - wxALL|wxEXPAND - 0 - - wxID_ANY - Default Values for New Graphic Items - - sbSizerNewGraphicItems - wxVERTICAL - 1 - none - - - 20 - wxEXPAND - 0 - - 3 - wxBOTH - 1 - - 5 - - fgSizer1 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 5 - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Graphic line width: - - 0 - - - 0 - - 1 - m_EdgeModEWidthTitle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_OptModuleGrLineWidth - 1 - - - protected - 1 - - Resizable - 1 - - - TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - unit - - 0 - - - 0 - - 1 - m_staticTextGrLineUnit - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Text line width: - - 0 - - - 0 - - 1 - m_TextModWidthTitle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_OptModuleTextWidth - 1 - - - protected - 1 - - Resizable - 1 - - - TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - unit - - 0 - - - 0 - - 1 - m_staticTextTextWidthUnit - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Text &height: - - 0 - - - 0 - - 1 - m_TextModSizeVTitle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_OptModuleTextVSize - 1 - - - protected - 1 - - Resizable - 1 - - - TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - unit - - 0 - - - 0 - - 1 - m_staticTextTextVSizeUnit - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Text &width: - - 0 - - - 0 - - 1 - m_TextModSizeHTitle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_OptModuleTextHSize - 1 - - - protected - 1 - - Resizable - 1 - - - TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - unit - - 0 - - - 0 - - 1 - m_staticTextTextHSizeUnit - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bSizerDisplayOptions - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Cartesian coordinates" "Polar coordinates" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_POLAR_CTRL - Coordinates - 1 - - 0 - - - 0 - - 1 - m_PolarDisplay - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Set display of relative (dx/dy) coordinates to Cartesian (rectangular) or polar (angle/distance). - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Inches" "Millimeters" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_UNITS - Units - 1 - - 0 - - - 0 - - 1 - m_UnitsSelection - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Set units used to display dimensions and positions. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - wxID_ANY - Default Values for New Footprints - - sbSizerNewFootprints - wxVERTICAL - 1 - none - - - 20 - wxEXPAND - 0 - - 4 - wxBOTH - 1 - - 5 - - fgSizer2 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 5 - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Reference: - - 0 - - - 0 - - 1 - m_staticTextRef - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_textCtrlRefText - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Default text for reference Leave blank to use the footprint name - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "SilkScreen" "Fab. Layer" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceLayerReference - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Visible" "Invisible" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceVisibleReference - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - V&alue: - - 0 - - - 0 - - 1 - m_staticTextValue - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_textCtrlValueText - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Default text for value Leave blank to use the footprint name - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "SilkScreen" "Fab. Layer" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceLayerValue - 1 - - - protected - 1 - - Resizable - 1 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Visible" "Invisible" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceVisibleValue - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Leave reference and/or value blank to use footprint name. - - 0 - - - 0 - - 1 - m_staticTextInfo - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - wxID_ANY - Editing Options - - sbSizerEditOptions - wxVERTICAL - 1 - none - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Magnetic pads - - 0 - - - 0 - - 1 - m_MagneticPads - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxBOTTOM - 0 - - 0 - protected - 0 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_SEGMENTS45 - L&imit graphic lines to 45 degrees - - 0 - - - 0 - - 1 - m_Segments_45_Only_Ctrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Force line segment directions to H, V or 45 degrees when drawing on technical layers. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Prefer selection to dragging - - 0 - - - 0 - - 1 - m_dragSelects - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - When enabled and nothing is selected, drag gesture will draw a selection box, even if there are items under the cursor that could be immediately dragged. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - - bSizerColumns - wxHORIZONTAL - none - - - - 5 - wxALL|wxEXPAND - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer1 - protected - - OnCancelClick - - - - OnOkClick - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + panel_modedit_defaults_base + 1000 + none + 1 + PanelModeditDefaults + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_MODEDIT_DEFAULTS_BASE + + -1,-1 + ; forward_declare + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerMain + wxHORIZONTAL + none + + 10 + wxEXPAND|wxTOP|wxLEFT + 0 + + + bSizerMargins + wxVERTICAL + none + + 5 + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT + 0 + + wxID_ANY + Default Values for New Graphic Items + + sbSizerNewGraphicItems + wxVERTICAL + 1 + none + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT + 0 + + 3 + wxBOTH + 1 + + 5 + + fgSizer1 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 5 + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Graphic line width: + + 0 + + + 0 + + 1 + m_lineWidthLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_lineWidthCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + unit + + 0 + + + 0 + + 1 + m_lineWidthUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND|wxTOP + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Text thickness: + + 0 + + + 0 + + 1 + m_textThickLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_textThickCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + unit + + 0 + + + 0 + + 1 + m_textThickUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Text &height: + + 0 + + + 0 + + 1 + m_textHeightLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_textHeightCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + unit + + 0 + + + 0 + + 1 + m_textHeightUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Text &width: + + 0 + + + 0 + + 1 + m_textWidthLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_textWidthCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + unit + + 0 + + + 0 + + 1 + m_textWidthUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxLEFT + 0 + + wxID_ANY + Default Values for New Footprints + + sbSizerNewFootprints + wxVERTICAL + 1 + none + + + 5 + wxEXPAND|wxBOTTOM + 0 + + 4 + wxBOTH + 1 + + 5 + + fgSizer2 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 5 + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Reference: + + 0 + + + 0 + + 1 + m_staticTextRef + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + -1,-1 + 1 + m_textCtrlRefText + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Default text for reference Leave blank to use the footprint name + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "SilkScreen" "Fab. Layer" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceLayerReference + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Visible" "Invisible" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceVisibleReference + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + V&alue: + + 0 + + + 0 + + 1 + m_staticTextValue + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + 160,-1 + 1 + m_textCtrlValueText + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Default text for value Leave blank to use the footprint name + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "SilkScreen" "Fab. Layer" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceLayerValue + 1 + + + protected + 1 + + Resizable + 1 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Visible" "Invisible" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceVisibleValue + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Leave reference and/or value blank to use footprint name. + + 0 + + + 0 + + 1 + m_staticTextInfo + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/panel_modedit_defaults_base.h b/pcbnew/dialogs/panel_modedit_defaults_base.h new file mode 100644 index 0000000000..2e9d6a4995 --- /dev/null +++ b/pcbnew/dialogs/panel_modedit_defaults_base.h @@ -0,0 +1,68 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __PANEL_MODEDIT_DEFAULTS_BASE_H__ +#define __PANEL_MODEDIT_DEFAULTS_BASE_H__ + +#include +#include +#include +class TEXT_CTRL_EVAL; + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_MODEDIT_DEFAULTS_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_MODEDIT_DEFAULTS_BASE : public wxPanel +{ + private: + + protected: + wxStaticText* m_lineWidthLabel; + TEXT_CTRL_EVAL* m_lineWidthCtrl; + wxStaticText* m_lineWidthUnits; + wxStaticText* m_textThickLabel; + TEXT_CTRL_EVAL* m_textThickCtrl; + wxStaticText* m_textThickUnits; + wxStaticText* m_textHeightLabel; + TEXT_CTRL_EVAL* m_textHeightCtrl; + wxStaticText* m_textHeightUnits; + wxStaticText* m_textWidthLabel; + TEXT_CTRL_EVAL* m_textWidthCtrl; + wxStaticText* m_textWidthUnits; + wxStaticText* m_staticTextRef; + wxTextCtrl* m_textCtrlRefText; + wxChoice* m_choiceLayerReference; + wxChoice* m_choiceVisibleReference; + wxStaticText* m_staticTextValue; + wxTextCtrl* m_textCtrlValueText; + wxChoice* m_choiceLayerValue; + wxChoice* m_choiceVisibleValue; + wxStaticText* m_staticTextInfo; + + public: + + PANEL_MODEDIT_DEFAULTS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_MODEDIT_DEFAULTS_BASE(); + +}; + +#endif //__PANEL_MODEDIT_DEFAULTS_BASE_H__ diff --git a/pcbnew/dialogs/dialog_modedit_display_options.cpp b/pcbnew/dialogs/panel_modedit_display_options.cpp similarity index 51% rename from pcbnew/dialogs/dialog_modedit_display_options.cpp rename to pcbnew/dialogs/panel_modedit_display_options.cpp index 693ddc4892..54d87a1f35 100644 --- a/pcbnew/dialogs/dialog_modedit_display_options.cpp +++ b/pcbnew/dialogs/panel_modedit_display_options.cpp @@ -17,73 +17,50 @@ * with this program. If not, see . */ -#include +#include #include #include - #include - #include -#include -#include -#include -bool DIALOG_MODEDIT_DISPLAY_OPTIONS::Invoke( FOOTPRINT_EDIT_FRAME& aCaller ) +PANEL_MODEDIT_DISPLAY_OPTIONS::PANEL_MODEDIT_DISPLAY_OPTIONS( FOOTPRINT_EDIT_FRAME* aFrame, + wxWindow* aWindow ) : + wxPanel( aWindow, wxID_ANY ), + m_frame( aFrame ) { - DIALOG_MODEDIT_DISPLAY_OPTIONS dlg( aCaller ); - - int ret = dlg.ShowModal(); - - return ret == wxID_OK; -} - - -DIALOG_MODEDIT_DISPLAY_OPTIONS::DIALOG_MODEDIT_DISPLAY_OPTIONS( FOOTPRINT_EDIT_FRAME& aParent ) : - DIALOG_SHIM( &aParent, wxID_ANY, _( "Display Options" ) ), - m_parent( aParent ) -{ - auto mainSizer = new wxBoxSizer( wxVERTICAL ); + auto mainSizer = new wxBoxSizer( wxHORIZONTAL ); SetSizer( mainSizer ); // install GAL options pane - KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_parent.GetGalDisplayOptions(); + KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_frame->GetGalDisplayOptions(); m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions ); - mainSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 ); + mainSizer->Add( m_galOptsPanel, 1, wxEXPAND | wxTOP | wxLEFT, 10 ); - auto btnSizer = new wxStdDialogButtonSizer(); - mainSizer->Add( btnSizer, 0, wxEXPAND | wxBOTTOM | wxLEFT | wxRIGHT, 5 ); - - btnSizer->AddButton( new wxButton( this, wxID_OK ) ); - btnSizer->AddButton( new wxButton( this, wxID_CANCEL ) ); - - btnSizer->Realize(); - - GetSizer()->SetSizeHints( this ); - Centre(); + // a spacer to take up the other half of the width + auto spacer = new wxPanel( this, wxID_ANY ); + mainSizer->Add( spacer, 1, wxEXPAND | wxLEFT | wxTOP, 5 ); } -bool DIALOG_MODEDIT_DISPLAY_OPTIONS::TransferDataToWindow() +bool PANEL_MODEDIT_DISPLAY_OPTIONS::TransferDataToWindow() { - // update GAL options m_galOptsPanel->TransferDataToWindow(); return true; } -bool DIALOG_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow() +bool PANEL_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow() { - // update GAL options m_galOptsPanel->TransferDataFromWindow(); // refresh view - KIGFX::VIEW* view = m_parent.GetGalCanvas()->GetView(); + KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView(); view->RecacheAllItems(); view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); - m_parent.GetCanvas()->Refresh(); + m_frame->GetCanvas()->Refresh(); return true; } diff --git a/pcbnew/dialogs/panel_modedit_display_options.h b/pcbnew/dialogs/panel_modedit_display_options.h new file mode 100644 index 0000000000..f31aff89eb --- /dev/null +++ b/pcbnew/dialogs/panel_modedit_display_options.h @@ -0,0 +1,42 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2017-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + + +#ifndef KICAD_PANEL_MODEDIT_DISPLAY_OPTIONS_H +#define KICAD_PANEL_MODEDIT_DISPLAY_OPTIONS_H + +#include + +class GAL_OPTIONS_PANEL; +class FOOTPRINT_EDIT_FRAME; + +class PANEL_MODEDIT_DISPLAY_OPTIONS : public wxPanel +{ +public: + PANEL_MODEDIT_DISPLAY_OPTIONS( FOOTPRINT_EDIT_FRAME* aParent, wxWindow* aWindow ); + +private: + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; + + FOOTPRINT_EDIT_FRAME* m_frame; + GAL_OPTIONS_PANEL* m_galOptsPanel; +}; + +#endif //KICAD_PANEL_MODEDIT_DISPLAY_OPTIONS_H diff --git a/pcbnew/dialogs/panel_modedit_settings.cpp b/pcbnew/dialogs/panel_modedit_settings.cpp new file mode 100644 index 0000000000..30d499ce3f --- /dev/null +++ b/pcbnew/dialogs/panel_modedit_settings.cpp @@ -0,0 +1,73 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include +#include + +#include + + +PANEL_MODEDIT_SETTINGS::PANEL_MODEDIT_SETTINGS( FOOTPRINT_EDIT_FRAME* aFrame, + wxWindow* aWindow) : + PANEL_MODEDIT_SETTINGS_BASE( aWindow ), + m_frame( aFrame ) +{} + + +bool PANEL_MODEDIT_SETTINGS::TransferDataToWindow() +{ + auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions(); + + // Display options + m_PolarDisplay->SetSelection( displ_opts->m_DisplayPolarCood ? 1 : 0 ); + m_UnitsSelection->SetSelection( m_frame->GetUserUnits() == INCHES ? 0 : 1 ); + + // Editing options + m_Segments_45_Only_Ctrl->SetValue( m_frame->Settings().m_use45DegreeGraphicSegments ); + m_MagneticPads->SetValue( m_frame->Settings().m_magneticPads == CAPTURE_ALWAYS ); + m_dragSelects->SetValue( m_frame->Settings().m_dragSelects ); + + return true; +} + + +bool PANEL_MODEDIT_SETTINGS::TransferDataFromWindow() +{ + // Display options + auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions(); + displ_opts->m_DisplayPolarCood = m_PolarDisplay->GetSelection() != 0; + + m_frame->SetUserUnits( m_UnitsSelection->GetSelection() == 0 ? INCHES : MILLIMETRES ); + g_UserUnit = m_frame->GetUserUnits(); // JEY TODO: double-up while in transition... + + // Editing options + m_frame->Settings().m_use45DegreeGraphicSegments = m_Segments_45_Only_Ctrl->GetValue(); + m_frame->Settings().m_magneticPads = m_MagneticPads->GetValue() ? CAPTURE_ALWAYS : NO_EFFECT; + m_frame->Settings().m_dragSelects = m_dragSelects->GetValue(); + + return true; +} diff --git a/pcbnew/dialogs/dialog_modedit_display_options.h b/pcbnew/dialogs/panel_modedit_settings.h similarity index 73% rename from pcbnew/dialogs/dialog_modedit_display_options.h rename to pcbnew/dialogs/panel_modedit_settings.h index 811e49dc8c..d8ffa80475 100644 --- a/pcbnew/dialogs/dialog_modedit_display_options.h +++ b/pcbnew/dialogs/panel_modedit_settings.h @@ -17,25 +17,25 @@ * with this program. If not, see . */ -#include +#ifndef KICAD_PANEL_MODEDIT_SETTINGS_H +#define KICAD_PANEL_MODEDIT_SETTINGS_H + +#include -class GAL_OPTIONS_PANEL; class FOOTPRINT_EDIT_FRAME; -class DIALOG_MODEDIT_DISPLAY_OPTIONS : public DIALOG_SHIM -{ -public: - DIALOG_MODEDIT_DISPLAY_OPTIONS( FOOTPRINT_EDIT_FRAME& aParent ); - static bool Invoke( FOOTPRINT_EDIT_FRAME& aCaller ); +class PANEL_MODEDIT_SETTINGS : public PANEL_MODEDIT_SETTINGS_BASE +{ + FOOTPRINT_EDIT_FRAME* m_frame; + +public: + PANEL_MODEDIT_SETTINGS( FOOTPRINT_EDIT_FRAME* aFrame, wxWindow* aWindow ); private: - bool TransferDataToWindow() override; bool TransferDataFromWindow() override; - - FOOTPRINT_EDIT_FRAME& m_parent; - - // subpanel - GAL_OPTIONS_PANEL* m_galOptsPanel; }; + + +#endif //KICAD_PANEL_MODEDIT_SETTINGS_H diff --git a/pcbnew/dialogs/panel_modedit_settings_base.cpp b/pcbnew/dialogs/panel_modedit_settings_base.cpp new file mode 100644 index 0000000000..7d40444960 --- /dev/null +++ b/pcbnew/dialogs/panel_modedit_settings_base.cpp @@ -0,0 +1,75 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_modedit_settings_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_MODEDIT_SETTINGS_BASE::PANEL_MODEDIT_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bSizerMain; + bSizerMain = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizerColumns; + bSizerColumns = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizerDisplayOptions; + bSizerDisplayOptions = new wxBoxSizer( wxVERTICAL ); + + wxString m_PolarDisplayChoices[] = { _("Cartesian coordinates"), _("Polar coordinates") }; + int m_PolarDisplayNChoices = sizeof( m_PolarDisplayChoices ) / sizeof( wxString ); + m_PolarDisplay = new wxRadioBox( this, wxID_POLAR_CTRL, _("Coordinates"), wxDefaultPosition, wxDefaultSize, m_PolarDisplayNChoices, m_PolarDisplayChoices, 1, wxRA_SPECIFY_COLS ); + m_PolarDisplay->SetSelection( 0 ); + m_PolarDisplay->SetToolTip( _("Set display of relative (dx/dy) coordinates to Cartesian (rectangular) or polar (angle/distance).") ); + + bSizerDisplayOptions->Add( m_PolarDisplay, 0, wxALL|wxEXPAND, 5 ); + + wxString m_UnitsSelectionChoices[] = { _("Inches"), _("Millimeters") }; + int m_UnitsSelectionNChoices = sizeof( m_UnitsSelectionChoices ) / sizeof( wxString ); + m_UnitsSelection = new wxRadioBox( this, wxID_UNITS, _("Units"), wxDefaultPosition, wxDefaultSize, m_UnitsSelectionNChoices, m_UnitsSelectionChoices, 1, wxRA_SPECIFY_COLS ); + m_UnitsSelection->SetSelection( 0 ); + m_UnitsSelection->SetToolTip( _("Set units used to display dimensions and positions.") ); + + bSizerDisplayOptions->Add( m_UnitsSelection, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizerColumns->Add( bSizerDisplayOptions, 0, wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizerEditOptions; + sbSizerEditOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Editing Options") ), wxVERTICAL ); + + m_MagneticPads = new wxCheckBox( sbSizerEditOptions->GetStaticBox(), wxID_ANY, _("Magnetic pads"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerEditOptions->Add( m_MagneticPads, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + sbSizerEditOptions->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_Segments_45_Only_Ctrl = new wxCheckBox( sbSizerEditOptions->GetStaticBox(), wxID_SEGMENTS45, _("L&imit graphic lines to H, V and 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Segments_45_Only_Ctrl->SetToolTip( _("Force line segment directions to H, V or 45 degrees when drawing on technical layers.") ); + + sbSizerEditOptions->Add( m_Segments_45_Only_Ctrl, 0, wxALL, 5 ); + + m_dragSelects = new wxCheckBox( sbSizerEditOptions->GetStaticBox(), wxID_ANY, _("Prefer selection to dragging"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dragSelects->SetToolTip( _("When enabled and nothing is selected, drag gesture will draw a selection box, even if there are items under the cursor that could be immediately dragged.") ); + + sbSizerEditOptions->Add( m_dragSelects, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizerColumns->Add( sbSizerEditOptions, 0, wxEXPAND|wxALL, 5 ); + + + bSizerMain->Add( bSizerColumns, 0, wxEXPAND|wxTOP|wxLEFT, 10 ); + + + this->SetSizer( bSizerMain ); + this->Layout(); + bSizerMain->Fit( this ); +} + +PANEL_MODEDIT_SETTINGS_BASE::~PANEL_MODEDIT_SETTINGS_BASE() +{ +} diff --git a/pcbnew/dialogs/panel_modedit_settings_base.fbp b/pcbnew/dialogs/panel_modedit_settings_base.fbp new file mode 100644 index 0000000000..3843080eb9 --- /dev/null +++ b/pcbnew/dialogs/panel_modedit_settings_base.fbp @@ -0,0 +1,580 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + panel_modedit_settings_base + 1000 + none + 1 + PanelModeditSettings + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_MODEDIT_SETTINGS_BASE + + -1,-1 + ; forward_declare + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerMain + wxHORIZONTAL + none + + 10 + wxEXPAND|wxTOP|wxLEFT + 0 + + + bSizerColumns + wxVERTICAL + none + + 5 + wxEXPAND + 0 + + + bSizerDisplayOptions + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Cartesian coordinates" "Polar coordinates" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_POLAR_CTRL + Coordinates + 1 + + 0 + + + 0 + + 1 + m_PolarDisplay + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + Set display of relative (dx/dy) coordinates to Cartesian (rectangular) or polar (angle/distance). + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Inches" "Millimeters" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_UNITS + Units + 1 + + 0 + + + 0 + + 1 + m_UnitsSelection + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + Set units used to display dimensions and positions. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + wxID_ANY + Editing Options + + sbSizerEditOptions + wxVERTICAL + 1 + none + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Magnetic pads + + 0 + + + 0 + + 1 + m_MagneticPads + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_SEGMENTS45 + L&imit graphic lines to H, V and 45 degrees + + 0 + + + 0 + + 1 + m_Segments_45_Only_Ctrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Force line segment directions to H, V or 45 degrees when drawing on technical layers. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Prefer selection to dragging + + 0 + + + 0 + + 1 + m_dragSelects + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + When enabled and nothing is selected, drag gesture will draw a selection box, even if there are items under the cursor that could be immediately dragged. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/panel_modedit_settings_base.h b/pcbnew/dialogs/panel_modedit_settings_base.h new file mode 100644 index 0000000000..930201fa01 --- /dev/null +++ b/pcbnew/dialogs/panel_modedit_settings_base.h @@ -0,0 +1,52 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __PANEL_MODEDIT_SETTINGS_BASE_H__ +#define __PANEL_MODEDIT_SETTINGS_BASE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +#define wxID_POLAR_CTRL 1000 +#define wxID_UNITS 1001 +#define wxID_SEGMENTS45 1002 + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_MODEDIT_SETTINGS_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_MODEDIT_SETTINGS_BASE : public wxPanel +{ + private: + + protected: + wxRadioBox* m_PolarDisplay; + wxRadioBox* m_UnitsSelection; + wxCheckBox* m_MagneticPads; + wxCheckBox* m_Segments_45_Only_Ctrl; + wxCheckBox* m_dragSelects; + + public: + + PANEL_MODEDIT_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_MODEDIT_SETTINGS_BASE(); + +}; + +#endif //__PANEL_MODEDIT_SETTINGS_BASE_H__ diff --git a/pcbnew/dialogs/dialog_display_options.cpp b/pcbnew/dialogs/panel_pcbnew_display_options.cpp similarity index 68% rename from pcbnew/dialogs/dialog_display_options.cpp rename to pcbnew/dialogs/panel_pcbnew_display_options.cpp index 2711f4d11d..1d92e9651b 100644 --- a/pcbnew/dialogs/dialog_display_options.cpp +++ b/pcbnew/dialogs/panel_pcbnew_display_options.cpp @@ -18,23 +18,14 @@ * with this program. If not, see . */ -/* functions relatives to the dialog opened from the main menu : - Preferences/display -*/ - #include #include -#include #include #include #include #include - #include - -#include -#include - +#include #include #include #include @@ -52,41 +43,28 @@ static const UTIL::CFG_MAP }; -void PCB_EDIT_FRAME::InstallDisplayOptionsDialog( wxCommandEvent& aEvent ) +PANEL_PCBNEW_DISPLAY_OPTIONS::PANEL_PCBNEW_DISPLAY_OPTIONS( PCB_EDIT_FRAME* aFrame, + wxWindow* aWindow ) : + PANEL_PCBNEW_DISPLAY_OPTIONS_BASE( aWindow ), + m_frame( aFrame ) { - DIALOG_DISPLAY_OPTIONS dlg( this ); - dlg.ShowModal(); -} - - -DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( PCB_EDIT_FRAME* parent ) : - DIALOG_DISPLAY_OPTIONS_BASE( parent ), - m_parent( parent ) -{ - KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_parent->GetGalDisplayOptions(); + KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_frame->GetGalDisplayOptions(); m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions ); - sLeftSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 ); - - SetFocus(); - - m_sdbSizerOK->SetDefault(); - - // Now all widgets have the size fixed, call FinishDialogSettings - FinishDialogSettings(); + m_galOptionsSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 ); } -bool DIALOG_DISPLAY_OPTIONS::TransferDataToWindow() +bool PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataToWindow() { - const PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*) m_parent->GetDisplayOptions(); + const PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*) m_frame->GetDisplayOptions(); m_OptDisplayTracksClearance->SetSelection( UTIL::GetConfigForVal( traceClearanceSelectMap, displ_opts->m_ShowTrackClearanceMode ) ); m_OptDisplayPadClearence->SetValue( displ_opts->m_DisplayPadIsol ); m_OptDisplayPadNumber->SetValue( displ_opts->m_DisplayPadNum ); - m_OptDisplayPadNoConn->SetValue( m_parent->IsElementVisible( LAYER_NO_CONNECTS ) ); + m_OptDisplayPadNoConn->SetValue( m_frame->IsElementVisible( LAYER_NO_CONNECTS ) ); m_ShowNetNamesOption->SetSelection( displ_opts->m_DisplayNetNamesMode ); m_galOptsPanel->TransferDataToWindow(); @@ -98,34 +76,31 @@ bool DIALOG_DISPLAY_OPTIONS::TransferDataToWindow() /* * Update variables with new options */ -bool DIALOG_DISPLAY_OPTIONS::TransferDataFromWindow() +bool PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataFromWindow() { - PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*) m_parent->GetDisplayOptions(); + PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*) m_frame->GetDisplayOptions(); displ_opts->m_ShowTrackClearanceMode = UTIL::GetValFromConfig( traceClearanceSelectMap, m_OptDisplayTracksClearance->GetSelection() ); displ_opts->m_DisplayPadIsol = m_OptDisplayPadClearence->GetValue(); - displ_opts->m_DisplayPadNum = m_OptDisplayPadNumber->GetValue(); - m_parent->SetElementVisibility( LAYER_NO_CONNECTS, - m_OptDisplayPadNoConn->GetValue() ); + m_frame->SetElementVisibility( LAYER_NO_CONNECTS, m_OptDisplayPadNoConn->GetValue() ); displ_opts->m_DisplayNetNamesMode = m_ShowNetNamesOption->GetSelection(); m_galOptsPanel->TransferDataFromWindow(); // Apply changes to the GAL - KIGFX::VIEW* view = m_parent->GetGalCanvas()->GetView(); + KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView(); KIGFX::PCB_PAINTER* painter = static_cast( view->GetPainter() ); - KIGFX::PCB_RENDER_SETTINGS* settings = - static_cast( painter->GetSettings() ); + KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings(); settings->LoadDisplayOptions( displ_opts ); view->RecacheAllItems(); view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); - m_parent->GetCanvas()->Refresh(); + m_frame->GetCanvas()->Refresh(); return true; } diff --git a/pcbnew/dialogs/dialog_display_options.h b/pcbnew/dialogs/panel_pcbnew_display_options.h similarity index 79% rename from pcbnew/dialogs/dialog_display_options.h rename to pcbnew/dialogs/panel_pcbnew_display_options.h index f6bac18a47..7584ac1129 100644 --- a/pcbnew/dialogs/dialog_display_options.h +++ b/pcbnew/dialogs/panel_pcbnew_display_options.h @@ -18,24 +18,21 @@ * with this program. If not, see . */ -/** - * @file pcbnew/dialogs/dialog_display_options.h - */ -#include +#include "panel_pcbnew_display_options_base.h" class GAL_OPTIONS_PANEL; -class DIALOG_DISPLAY_OPTIONS : public DIALOG_DISPLAY_OPTIONS_BASE +class PANEL_PCBNEW_DISPLAY_OPTIONS : public PANEL_PCBNEW_DISPLAY_OPTIONS_BASE { public: - DIALOG_DISPLAY_OPTIONS( PCB_EDIT_FRAME* parent ); - ~DIALOG_DISPLAY_OPTIONS() {}; + PANEL_PCBNEW_DISPLAY_OPTIONS( PCB_EDIT_FRAME* aFrame, wxWindow* aWindow ); + ~PANEL_PCBNEW_DISPLAY_OPTIONS() {}; bool TransferDataFromWindow() override; bool TransferDataToWindow() override; private: - PCB_EDIT_FRAME* m_parent; + PCB_EDIT_FRAME* m_frame; GAL_OPTIONS_PANEL* m_galOptsPanel; }; diff --git a/pcbnew/dialogs/dialog_display_options_base.cpp b/pcbnew/dialogs/panel_pcbnew_display_options_base.cpp similarity index 55% rename from pcbnew/dialogs/dialog_display_options_base.cpp rename to pcbnew/dialogs/panel_pcbnew_display_options_base.cpp index 8eb16cbfef..00c1c4b50f 100644 --- a/pcbnew/dialogs/dialog_display_options_base.cpp +++ b/pcbnew/dialogs/panel_pcbnew_display_options_base.cpp @@ -1,42 +1,40 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#include "dialog_display_options_base.h" +#include "panel_pcbnew_display_options_base.h" /////////////////////////////////////////////////////////////////////////// -DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +PANEL_PCBNEW_DISPLAY_OPTIONS_BASE::PANEL_PCBNEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) { - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* bupperSizer; bupperSizer = new wxBoxSizer( wxHORIZONTAL ); - sLeftSizer = new wxBoxSizer( wxVERTICAL ); + m_galOptionsSizer = new wxBoxSizer( wxVERTICAL ); - bupperSizer->Add( sLeftSizer, 1, wxEXPAND, 5 ); + bupperSizer->Add( m_galOptionsSizer, 1, wxEXPAND, 5 ); wxBoxSizer* bRightSizer; bRightSizer = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer* sbAnnotations; - sbAnnotations = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Annotations:") ), wxVERTICAL ); + sbAnnotations = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Annotations") ), wxVERTICAL ); wxString m_ShowNetNamesOptionChoices[] = { _("Do not show"), _("On pads"), _("On tracks"), _("On pads and tracks") }; int m_ShowNetNamesOptionNChoices = sizeof( m_ShowNetNamesOptionChoices ) / sizeof( wxString ); - m_ShowNetNamesOption = new wxRadioBox( sbAnnotations->GetStaticBox(), wxID_ANY, _("Show net names:"), wxDefaultPosition, wxDefaultSize, m_ShowNetNamesOptionNChoices, m_ShowNetNamesOptionChoices, 1, wxRA_SPECIFY_COLS ); + m_ShowNetNamesOption = new wxRadioBox( sbAnnotations->GetStaticBox(), wxID_ANY, _("Net Names"), wxDefaultPosition, wxDefaultSize, m_ShowNetNamesOptionNChoices, m_ShowNetNamesOptionChoices, 1, wxRA_SPECIFY_COLS ); m_ShowNetNamesOption->SetSelection( 0 ); m_ShowNetNamesOption->SetToolTip( _("Show or hide net names on pads and/or tracks.") ); - sbAnnotations->Add( m_ShowNetNamesOption, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); + sbAnnotations->Add( m_ShowNetNamesOption, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptDisplayPadNumber = new wxCheckBox( sbAnnotations->GetStaticBox(), wxID_ANY, _("Show pad numbers"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptDisplayPadNumber->SetValue(true); @@ -47,39 +45,30 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi sbAnnotations->Add( m_OptDisplayPadNoConn, 0, wxBOTTOM|wxLEFT|wxRIGHT, 10 ); - bRightSizer->Add( sbAnnotations, 0, wxALL|wxEXPAND, 5 ); + bRightSizer->Add( sbAnnotations, 0, wxEXPAND|wxBOTTOM, 5 ); wxStaticBoxSizer* sbClearance; - sbClearance = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Clearance Outlines:") ), wxVERTICAL ); + sbClearance = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Clearance Outlines") ), wxVERTICAL ); - wxString m_OptDisplayTracksClearanceChoices[] = { _("Never"), _("New track"), _("New track with via area"), _("New and edited tracks with via area"), _("Always") }; + wxString m_OptDisplayTracksClearanceChoices[] = { _("Do not show"), _("Show when creating tracks"), _("Show with via clearance at end"), _("Show when creating and editing tracks"), _("Show always") }; int m_OptDisplayTracksClearanceNChoices = sizeof( m_OptDisplayTracksClearanceChoices ) / sizeof( wxString ); - m_OptDisplayTracksClearance = new wxRadioBox( sbClearance->GetStaticBox(), ID_SHOW_CLEARANCE, _("Show track clearance:"), wxDefaultPosition, wxDefaultSize, m_OptDisplayTracksClearanceNChoices, m_OptDisplayTracksClearanceChoices, 1, wxRA_SPECIFY_COLS ); - m_OptDisplayTracksClearance->SetSelection( 1 ); + m_OptDisplayTracksClearance = new wxRadioBox( sbClearance->GetStaticBox(), ID_SHOW_CLEARANCE, _("Track Clearance"), wxDefaultPosition, wxDefaultSize, m_OptDisplayTracksClearanceNChoices, m_OptDisplayTracksClearanceChoices, 1, wxRA_SPECIFY_COLS ); + m_OptDisplayTracksClearance->SetSelection( 2 ); m_OptDisplayTracksClearance->SetToolTip( _("Show or hide the track and via clearance area. If \"New track\" is selected, track clearance area is shown only when creating the track.") ); - sbClearance->Add( m_OptDisplayTracksClearance, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); + sbClearance->Add( m_OptDisplayTracksClearance, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); m_OptDisplayPadClearence = new wxCheckBox( sbClearance->GetStaticBox(), wxID_ANY, _("Show pad clearance"), wxDefaultPosition, wxDefaultSize, 0 ); sbClearance->Add( m_OptDisplayPadClearence, 0, wxALL, 10 ); - bRightSizer->Add( sbClearance, 1, wxALL|wxEXPAND, 5 ); + bRightSizer->Add( sbClearance, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - bupperSizer->Add( bRightSizer, 1, wxEXPAND, 5 ); + bupperSizer->Add( bRightSizer, 1, wxEXPAND|wxTOP, 5 ); - bMainSizer->Add( bupperSizer, 1, wxEXPAND, 5 ); - - m_sdbSizer = new wxStdDialogButtonSizer(); - m_sdbSizerOK = new wxButton( this, wxID_OK ); - m_sdbSizer->AddButton( m_sdbSizerOK ); - m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); - m_sdbSizer->AddButton( m_sdbSizerCancel ); - m_sdbSizer->Realize(); - - bMainSizer->Add( m_sdbSizer, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + bMainSizer->Add( bupperSizer, 0, wxEXPAND|wxTOP|wxLEFT, 10 ); this->SetSizer( bMainSizer ); @@ -87,6 +76,6 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi bMainSizer->Fit( this ); } -DIALOG_DISPLAY_OPTIONS_BASE::~DIALOG_DISPLAY_OPTIONS_BASE() +PANEL_PCBNEW_DISPLAY_OPTIONS_BASE::~PANEL_PCBNEW_DISPLAY_OPTIONS_BASE() { } diff --git a/pcbnew/dialogs/dialog_display_options_base.fbp b/pcbnew/dialogs/panel_pcbnew_display_options_base.fbp similarity index 93% rename from pcbnew/dialogs/dialog_display_options_base.fbp rename to pcbnew/dialogs/panel_pcbnew_display_options_base.fbp index e8ecd1f23b..eaa4368886 100644 --- a/pcbnew/dialogs/dialog_display_options_base.fbp +++ b/pcbnew/dialogs/panel_pcbnew_display_options_base.fbp @@ -11,12 +11,11 @@ res UTF-8 connect - dialog_display_options_base + panel_pcbnew_display_options_base 1000 none - 1 - DialogDisplayOptions_base + PanelPcbnewDisplayOptions . @@ -27,34 +26,28 @@ UI 1 0 - + 0 wxAUI_MGR_DEFAULT - 1 1 impl_virtual - 0 wxID_ANY - DIALOG_DISPLAY_OPTIONS_BASE + PANEL_PCBNEW_DISPLAY_OPTIONS_BASE -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Display Options + ; forward_declare - - - + wxTAB_TRAVERSAL @@ -62,12 +55,8 @@ - - - - @@ -95,9 +84,9 @@ wxVERTICAL none - 5 - wxEXPAND - 1 + 10 + wxEXPAND|wxTOP|wxLEFT + 0 bupperSizer @@ -109,14 +98,14 @@ 1 - sLeftSizer + m_galOptionsSizer wxVERTICAL protected 5 - wxEXPAND + wxEXPAND|wxTOP 1 @@ -125,11 +114,11 @@ none 5 - wxALL|wxEXPAND + wxEXPAND|wxBOTTOM 0 wxID_ANY - Annotations: + Annotations sbAnnotations wxVERTICAL @@ -138,7 +127,7 @@ 5 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -169,7 +158,7 @@ 0 0 wxID_ANY - Show net names: + Net Names 1 0 @@ -406,11 +395,11 @@ 5 - wxALL|wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM 1 wxID_ANY - Clearance Outlines: + Clearance Outlines sbClearance wxVERTICAL @@ -419,7 +408,7 @@ 5 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -435,7 +424,7 @@ 1 0 - "Never" "New track" "New track with via area" "New and edited tracks with via area" "Always" + "Do not show" "Show when creating tracks" "Show with via clearance at end" "Show when creating and editing tracks" "Show always" 1 1 @@ -450,7 +439,7 @@ 0 0 ID_SHOW_CLEARANCE - Show track clearance: + Track Clearance 1 0 @@ -467,7 +456,7 @@ 1 Resizable - 1 + 2 1 wxRA_SPECIFY_COLS @@ -601,32 +590,6 @@ - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer - protected - - - - - - - - - - diff --git a/pcbnew/dialogs/dialog_display_options_base.h b/pcbnew/dialogs/panel_pcbnew_display_options_base.h similarity index 57% rename from pcbnew/dialogs/dialog_display_options_base.h rename to pcbnew/dialogs/panel_pcbnew_display_options_base.h index 967e4a8a32..63f79d57a4 100644 --- a/pcbnew/dialogs/dialog_display_options_base.h +++ b/pcbnew/dialogs/panel_pcbnew_display_options_base.h @@ -1,17 +1,16 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 19 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __DIALOG_DISPLAY_OPTIONS_BASE_H__ -#define __DIALOG_DISPLAY_OPTIONS_BASE_H__ +#ifndef __PANEL_PCBNEW_DISPLAY_OPTIONS_BASE_H__ +#define __PANEL_PCBNEW_DISPLAY_OPTIONS_BASE_H__ #include #include #include -#include "dialog_shim.h" #include #include #include @@ -21,15 +20,14 @@ #include #include #include -#include -#include +#include /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_DISPLAY_OPTIONS_BASE +/// Class PANEL_PCBNEW_DISPLAY_OPTIONS_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM +class PANEL_PCBNEW_DISPLAY_OPTIONS_BASE : public wxPanel { private: @@ -39,21 +37,18 @@ class DIALOG_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM ID_SHOW_CLEARANCE = 1000 }; - wxBoxSizer* sLeftSizer; + wxBoxSizer* m_galOptionsSizer; wxRadioBox* m_ShowNetNamesOption; wxCheckBox* m_OptDisplayPadNumber; wxCheckBox* m_OptDisplayPadNoConn; wxRadioBox* m_OptDisplayTracksClearance; wxCheckBox* m_OptDisplayPadClearence; - wxStdDialogButtonSizer* m_sdbSizer; - wxButton* m_sdbSizerOK; - wxButton* m_sdbSizerCancel; public: - DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_DISPLAY_OPTIONS_BASE(); + PANEL_PCBNEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_PCBNEW_DISPLAY_OPTIONS_BASE(); }; -#endif //__DIALOG_DISPLAY_OPTIONS_BASE_H__ +#endif //__PANEL_PCBNEW_DISPLAY_OPTIONS_BASE_H__ diff --git a/pcbnew/dialogs/panel_pcbnew_settings.cpp b/pcbnew/dialogs/panel_pcbnew_settings.cpp new file mode 100644 index 0000000000..f0fc821c9d --- /dev/null +++ b/pcbnew/dialogs/panel_pcbnew_settings.cpp @@ -0,0 +1,98 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +PANEL_PCBNEW_SETTINGS::PANEL_PCBNEW_SETTINGS( PCB_EDIT_FRAME* aFrame, wxWindow* aWindow ) : + PANEL_PCBNEW_SETTINGS_BASE( aWindow ), + m_Frame( aFrame ) +{} + + +bool PANEL_PCBNEW_SETTINGS::TransferDataToWindow() +{ + m_Board = m_Frame->GetBoard(); + auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_Frame->GetDisplayOptions(); + + /* Set display options */ + m_PolarDisplay->SetSelection( displ_opts->m_DisplayPolarCood ? 1 : 0 ); + m_UnitsSelection->SetSelection( m_Frame->GetUserUnits() == INCHES ? 0 : 1 ); + + wxString rotationAngle; + rotationAngle = AngleToStringDegrees( (double)m_Frame->GetRotationAngle() ); + m_RotationAngle->SetValue( rotationAngle ); + + m_DrcOn->SetValue( m_Frame->Settings().m_legacyDrcOn ); + m_TrackAutodel->SetValue( m_Frame->Settings().m_legacyAutoDeleteOldTrack ); + m_Track_45_Only_Ctrl->SetValue( m_Frame->Settings().m_legacyUse45DegreeTracks ); + m_Segments_45_Only_Ctrl->SetValue( m_Frame->Settings().m_use45DegreeGraphicSegments ); + m_Track_DoubleSegm_Ctrl->SetValue( m_Frame->Settings().m_legacyUseTwoSegmentTracks ); + m_MagneticPadOptCtrl->SetSelection( m_Frame->Settings().m_magneticPads ); + m_MagneticTrackOptCtrl->SetSelection( m_Frame->Settings().m_magneticTracks ); + m_UseEditKeyForWidth->SetValue( m_Frame->Settings().m_editActionChangesTrackWidth ); + m_dragSelects->SetValue( m_Frame->Settings().m_dragSelects ); + + m_Show_Page_Limits->SetValue( m_Frame->ShowPageLimits() ); + + return true; +} + + +bool PANEL_PCBNEW_SETTINGS::TransferDataFromWindow() +{ + auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_Frame->GetDisplayOptions(); + displ_opts->m_DisplayPolarCood = m_PolarDisplay->GetSelection() != 0; + + m_Frame->SetUserUnits( m_UnitsSelection->GetSelection() == 0 ? INCHES : MILLIMETRES ); + g_UserUnit = m_Frame->GetUserUnits(); // JEY TODO: double-up while in transition... + + m_Frame->SetRotationAngle( wxRound( 10.0 * wxAtof( m_RotationAngle->GetValue() ) ) ); + + /* Updating the combobox to display the active layer. */ + m_Frame->Settings().m_legacyDrcOn = m_DrcOn->GetValue(); + + m_Frame->Settings().m_legacyAutoDeleteOldTrack = m_TrackAutodel->GetValue(); + m_Frame->Settings().m_use45DegreeGraphicSegments = m_Segments_45_Only_Ctrl->GetValue(); + m_Frame->Settings().m_legacyUse45DegreeTracks = m_Track_45_Only_Ctrl->GetValue(); + + m_Frame->Settings().m_legacyUseTwoSegmentTracks = m_Track_DoubleSegm_Ctrl->GetValue(); + m_Frame->Settings().m_magneticPads = (MAGNETIC_PAD_OPTION_VALUES) m_MagneticPadOptCtrl->GetSelection(); + m_Frame->Settings().m_magneticTracks = (MAGNETIC_PAD_OPTION_VALUES) m_MagneticTrackOptCtrl->GetSelection(); + m_Frame->Settings().m_editActionChangesTrackWidth = m_UseEditKeyForWidth->GetValue(); + m_Frame->Settings().m_dragSelects = m_dragSelects->GetValue(); + + m_Frame->SetShowPageLimits( m_Show_Page_Limits->GetValue() ); + + return true; +} + + diff --git a/pcbnew/dialogs/dialog_general_options.h b/pcbnew/dialogs/panel_pcbnew_settings.h similarity index 68% rename from pcbnew/dialogs/dialog_general_options.h rename to pcbnew/dialogs/panel_pcbnew_settings.h index cd1ec01ad1..a0843b0eb3 100644 --- a/pcbnew/dialogs/dialog_general_options.h +++ b/pcbnew/dialogs/panel_pcbnew_settings.h @@ -25,28 +25,21 @@ #ifndef __dialog_general_options_h #define __dialog_general_options_h -#include +#include "panel_pcbnew_settings_base.h" -class DIALOG_GENERALOPTIONS : public DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE +class PANEL_PCBNEW_SETTINGS : public PANEL_PCBNEW_SETTINGS_BASE { private: - BOARD* m_Board; - int m_last_scale; - - void init(); + PCB_EDIT_FRAME* m_Frame; + BOARD* m_Board; public: - DIALOG_GENERALOPTIONS( PCB_EDIT_FRAME* parent ); - ~DIALOG_GENERALOPTIONS() {}; + PANEL_PCBNEW_SETTINGS( PCB_EDIT_FRAME* aFrame, wxWindow* aWindow ); + ~PANEL_PCBNEW_SETTINGS() {}; protected: - void OnScaleSlider( wxScrollEvent& aEvent ) override; - void OnScaleAuto( wxCommandEvent& aEvent ) override; - - void OnOkClick( wxCommandEvent& event ) override; - void OnCancelClick( wxCommandEvent& event ) override; - - PCB_EDIT_FRAME* GetParent() const { return (PCB_EDIT_FRAME*) wxDialog::GetParent(); } + bool TransferDataToWindow() override; + bool TransferDataFromWindow() override; }; diff --git a/pcbnew/dialogs/panel_pcbnew_settings_base.cpp b/pcbnew/dialogs/panel_pcbnew_settings_base.cpp new file mode 100644 index 0000000000..2d43984f27 --- /dev/null +++ b/pcbnew/dialogs/panel_pcbnew_settings_base.cpp @@ -0,0 +1,148 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_pcbnew_settings_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_PCBNEW_SETTINGS_BASE::PANEL_PCBNEW_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bPanelSizer; + bPanelSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bMargins; + bMargins = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bMiddleLeftSizer; + bMiddleLeftSizer = new wxBoxSizer( wxVERTICAL ); + + wxString m_PolarDisplayChoices[] = { _("Cartesian coordinates"), _("Polar coordinates") }; + int m_PolarDisplayNChoices = sizeof( m_PolarDisplayChoices ) / sizeof( wxString ); + m_PolarDisplay = new wxRadioBox( this, wxID_POLAR_CTRL, _("Coordinates"), wxDefaultPosition, wxDefaultSize, m_PolarDisplayNChoices, m_PolarDisplayChoices, 1, wxRA_SPECIFY_COLS ); + m_PolarDisplay->SetSelection( 0 ); + m_PolarDisplay->SetToolTip( _("Set display of relative (dx/dy) coordinates to Cartesian (rectangular) or polar (angle/distance).") ); + + bMiddleLeftSizer->Add( m_PolarDisplay, 0, wxALL|wxEXPAND, 5 ); + + wxString m_UnitsSelectionChoices[] = { _("Inches"), _("Millimeters") }; + int m_UnitsSelectionNChoices = sizeof( m_UnitsSelectionChoices ) / sizeof( wxString ); + m_UnitsSelection = new wxRadioBox( this, wxID_UNITS, _("Units"), wxDefaultPosition, wxDefaultSize, m_UnitsSelectionNChoices, m_UnitsSelectionChoices, 1, wxRA_SPECIFY_COLS ); + m_UnitsSelection->SetSelection( 0 ); + m_UnitsSelection->SetToolTip( _("Set units used to display dimensions and positions.") ); + + bMiddleLeftSizer->Add( m_UnitsSelection, 0, wxALL|wxEXPAND, 5 ); + + wxStaticBoxSizer* bOptionsSizer; + bOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Editing Options") ), wxVERTICAL ); + + m_Show_Page_Limits = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Show_Page_Limits->SetValue(true); + bOptionsSizer->Add( m_Show_Page_Limits, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + m_Segments_45_Only_Ctrl = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_SEGMENTS45, _("L&imit graphic lines to H, V and 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Segments_45_Only_Ctrl->SetToolTip( _("Force line segment directions to H, V or 45 degrees when drawing on technical layers.") ); + + bOptionsSizer->Add( m_Segments_45_Only_Ctrl, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + m_UseEditKeyForWidth = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Edit action changes track width"), wxDefaultPosition, wxDefaultSize, 0 ); + m_UseEditKeyForWidth->SetToolTip( _("When active, hitting Edit hotkey or double-clicking on a track or via changes its width/diameter to the one selected in the main toolbar. ") ); + + bOptionsSizer->Add( m_UseEditKeyForWidth, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + m_dragSelects = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Prefer selection to dragging"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dragSelects->SetToolTip( _("When enabled and nothing is selected, drag gesture will draw a selection box, even if there are items under the cursor that could be immediately dragged.") ); + + bOptionsSizer->Add( m_dragSelects, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + wxFlexGridSizer* fgSizer12; + fgSizer12 = new wxFlexGridSizer( 0, 2, 0, 0 ); + fgSizer12->AddGrowableCol( 1 ); + fgSizer12->SetFlexibleDirection( wxBOTH ); + fgSizer12->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticTextRotationAngle = new wxStaticText( bOptionsSizer->GetStaticBox(), wxID_ANY, _("&Rotation angle:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextRotationAngle->Wrap( -1 ); + fgSizer12->Add( m_staticTextRotationAngle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_RotationAngle = new wxTextCtrl( bOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_RotationAngle->SetToolTip( _("Set increment (in degrees) for context menu and hotkey rotation.") ); + + fgSizer12->Add( m_RotationAngle, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); + + + bOptionsSizer->Add( fgSizer12, 1, wxEXPAND, 5 ); + + + bMiddleLeftSizer->Add( bOptionsSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + + bMargins->Add( bMiddleLeftSizer, 1, wxEXPAND, 5 ); + + wxBoxSizer* bRightSizer; + bRightSizer = new wxBoxSizer( wxVERTICAL ); + + wxString m_MagneticPadOptCtrlChoices[] = { _("Never"), _("When creating tracks"), _("Always") }; + int m_MagneticPadOptCtrlNChoices = sizeof( m_MagneticPadOptCtrlChoices ) / sizeof( wxString ); + m_MagneticPadOptCtrl = new wxRadioBox( this, wxID_ANY, _("Magnetic Pads"), wxDefaultPosition, wxDefaultSize, m_MagneticPadOptCtrlNChoices, m_MagneticPadOptCtrlChoices, 1, wxRA_SPECIFY_COLS ); + m_MagneticPadOptCtrl->SetSelection( 2 ); + m_MagneticPadOptCtrl->SetToolTip( _("Control capture of the cursor when the mouse enters a pad area.") ); + + bRightSizer->Add( m_MagneticPadOptCtrl, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + wxString m_MagneticTrackOptCtrlChoices[] = { _("Never"), _("When creating tracks"), _("Always") }; + int m_MagneticTrackOptCtrlNChoices = sizeof( m_MagneticTrackOptCtrlChoices ) / sizeof( wxString ); + m_MagneticTrackOptCtrl = new wxRadioBox( this, wxID_MAGNETIC_TRACKS, _("Magnetic Tracks"), wxDefaultPosition, wxDefaultSize, m_MagneticTrackOptCtrlNChoices, m_MagneticTrackOptCtrlChoices, 1, wxRA_SPECIFY_COLS ); + m_MagneticTrackOptCtrl->SetSelection( 0 ); + m_MagneticTrackOptCtrl->SetToolTip( _("Control capture of the cursor when the mouse approaches a track.") ); + + bRightSizer->Add( m_MagneticTrackOptCtrl, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + wxStaticBoxSizer* bLegacyOptionsSizer; + bLegacyOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Legacy Toolset Routing Options") ), wxVERTICAL ); + + m_DrcOn = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_DRC_ONOFF, _("&Enforce design rules when routing"), wxDefaultPosition, wxDefaultSize, 0 ); + m_DrcOn->SetValue(true); + m_DrcOn->SetToolTip( _("Enable DRC control. When DRC control is disabled, all connections are allowed.") ); + + bLegacyOptionsSizer->Add( m_DrcOn, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_TrackAutodel = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_TRACK_AUTODEL, _("Auto-delete old tracks"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TrackAutodel->SetValue(true); + m_TrackAutodel->SetToolTip( _("Enable automatic track deletion when redrawing a track.") ); + + bLegacyOptionsSizer->Add( m_TrackAutodel, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + m_Track_45_Only_Ctrl = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_TRACKS45, _("&Limit tracks to H, V and 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Track_45_Only_Ctrl->SetValue(true); + m_Track_45_Only_Ctrl->SetToolTip( _("Force track directions to H, V or 45 degrees when drawing a track.") ); + + bLegacyOptionsSizer->Add( m_Track_45_Only_Ctrl, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + m_Track_DoubleSegm_Ctrl = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_ANY, _("&Use double segmented tracks"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Track_DoubleSegm_Ctrl->SetValue(true); + m_Track_DoubleSegm_Ctrl->SetToolTip( _("Use two track segments, with 45 degrees angle between them, when drawing a new track ") ); + + bLegacyOptionsSizer->Add( m_Track_DoubleSegm_Ctrl, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + + bRightSizer->Add( bLegacyOptionsSizer, 1, wxEXPAND|wxTOP|wxLEFT, 5 ); + + + bMargins->Add( bRightSizer, 1, wxEXPAND|wxLEFT, 5 ); + + + bPanelSizer->Add( bMargins, 1, wxTOP|wxLEFT, 10 ); + + + this->SetSizer( bPanelSizer ); + this->Layout(); + bPanelSizer->Fit( this ); +} + +PANEL_PCBNEW_SETTINGS_BASE::~PANEL_PCBNEW_SETTINGS_BASE() +{ +} diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp b/pcbnew/dialogs/panel_pcbnew_settings_base.fbp similarity index 57% rename from gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp rename to pcbnew/dialogs/panel_pcbnew_settings_base.fbp index 9294e0facd..4654bbb87a 100644 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp +++ b/pcbnew/dialogs/panel_pcbnew_settings_base.fbp @@ -11,12 +11,11 @@ res UTF-8 connect - gerbview_dialog_display_options_frame_base + panel_pcbnew_settings_base 1000 none - 1 - gerbview_dialog_display_options_frame_base + PanelPcbnewSettings . @@ -25,36 +24,30 @@ 1 1 UI - 0 + 1 0 - + 0 wxAUI_MGR_DEFAULT - 1 1 impl_virtual - 0 wxID_ANY - DIALOG_DISPLAY_OPTIONS_BASE + PANEL_PCBNEW_SETTINGS_BASE -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Gerbview Options + ; forward_declare - - - + wxTAB_TRAVERSAL @@ -62,12 +55,8 @@ - - - - @@ -91,32 +80,32 @@ - bDialogSizer - wxVERTICAL + bPanelSizer + wxHORIZONTAL none - 5 - wxEXPAND + 10 + wxTOP|wxLEFT 1 - m_UpperSizer + bMargins wxHORIZONTAL - protected + none 5 - wxEXPAND|wxLEFT|wxRIGHT - 0 + wxEXPAND + 1 - bLeftSizer + bMiddleLeftSizer wxVERTICAL none - + 5 wxALL|wxEXPAND 0 - + 1 1 1 @@ -144,8 +133,8 @@ 0 0 - wxID_ANY - Coordinates: + wxID_POLAR_CTRL + Coordinates 1 0 @@ -168,7 +157,7 @@ wxRA_SPECIFY_COLS 0 - + Set display of relative (dx/dy) coordinates to Cartesian (rectangular) or polar (angle/distance). wxFILTER_NONE wxDefaultValidator @@ -202,11 +191,11 @@ - + 5 wxALL|wxEXPAND 0 - + 1 1 1 @@ -234,8 +223,8 @@ 0 0 - wxID_ANY - Units: + wxID_UNITS + Units 1 0 @@ -244,7 +233,7 @@ 0 1 - m_BoxUnits + m_UnitsSelection 1 @@ -258,7 +247,7 @@ wxRA_SPECIFY_COLS 0 - + Set units used to display dimensions and positions. wxFILTER_NONE wxDefaultValidator @@ -294,378 +283,579 @@ 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Sketch" "Filled" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + wxID_ANY - Flashed items: - 1 - - 0 - - - 0 + Editing Options - 1 - m_OptDisplayFlashedItems - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Sketch" "Filled" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Lines: - 1 - - 0 - - - 0 - - 1 - m_OptDisplayLines - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Sketch" "Filled" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Polygons: - 1 - - 0 - - - 0 - - 1 - m_OptDisplayPolygons - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show D codes - - 0 - - - 0 - - 1 - m_OptDisplayDCodes - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + bOptionsSizer + wxVERTICAL + 1 + none + + 5 + wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show page limits + + 0 + + + 0 + + 1 + m_Show_Page_Limits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_SEGMENTS45 + L&imit graphic lines to H, V and 45 degrees + + 0 + + + 0 + + 1 + m_Segments_45_Only_Ctrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Force line segment directions to H, V or 45 degrees when drawing on technical layers. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Edit action changes track width + + 0 + + + 0 + + 1 + m_UseEditKeyForWidth + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + When active, hitting Edit hotkey or double-clicking on a track or via changes its width/diameter to the one selected in the main toolbar. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Prefer selection to dragging + + 0 + + + 0 + + 1 + m_dragSelects + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + When enabled and nothing is selected, drag gesture will draw a selection box, even if there are items under the cursor that could be immediately dragged. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 2 + wxBOTH + 1 + + 0 + + fgSizer12 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Rotation angle: + + 0 + + + 0 + + 1 + m_staticTextRotationAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_RotationAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Set increment (in degrees) for context menu and hotkey rotation. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - wxEXPAND|wxLEFT|wxRIGHT - 0 + wxEXPAND|wxLEFT + 1 bRightSizer wxVERTICAL none - + 5 - wxALL|wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT 0 - + 1 1 1 @@ -679,7 +869,7 @@ 1 0 - "Full size without limits" "Full size" "Size A4" "Size A3" "Size A2" "Size A" "Size B" "Size C" + "Never" "When creating tracks" "Always" 1 1 @@ -694,7 +884,7 @@ 0 0 wxID_ANY - Page: + Magnetic Pads 1 0 @@ -703,7 +893,97 @@ 0 1 - m_ShowPageLimits + m_MagneticPadOptCtrl + 1 + + + protected + 1 + + Resizable + 2 + 1 + + wxRA_SPECIFY_COLS + + 0 + Control capture of the cursor when the mouse enters a pad area. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Never" "When creating tracks" "Always" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_MAGNETIC_TRACKS + Magnetic Tracks + 1 + + 0 + + + 0 + + 1 + m_MagneticTrackOptCtrl 1 @@ -717,7 +997,7 @@ wxRA_SPECIFY_COLS 0 - + Control capture of the cursor when the mouse approaches a track. wxFILTER_NONE wxDefaultValidator @@ -753,606 +1033,367 @@ 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - wxID_ANY - Pan and Zoom: - - bLeftBottomSizer - wxVERTICAL - 1 - none - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Do not center and warp cursor on zoom - - 0 - - - 0 - - 1 - m_OptZoomNoCenter - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Keep the cursor at its current location when zooming - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Use touchpad to pan - - 0 - - - 0 - - 1 - m_OptMousewheelPan - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Use touchpad to pan canvas - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND + wxEXPAND|wxTOP|wxLEFT 1 wxID_ANY - User Interface: + Legacy Toolset Routing Options - sbSizer2 + bLegacyOptionsSizer wxVERTICAL 1 none - + 5 - wxALL|wxEXPAND - 1 - - 3 - wxBOTH - 1 - - 0 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_DRC_ONOFF + &Enforce design rules when routing + + 0 + + + 0 - fgSizer1 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 3 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Icon scale: - - 0 - - - 0 - - 1 - m_staticText1 - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 275 - - 0 - - 50 - - 0 - - 1 - m_scaleSlider - 1 - - - protected - 1 - - Resizable - 1 - - wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS - STEPPED_SLIDER; widgets/stepped_slider.h; Not forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 50 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnScaleSlider - - - - - - - - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - % - - 0 - - - 0 - - 1 - m_staticText2 - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Auto - - 0 - - - 0 - - 1 - m_scaleAuto - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - OnScaleAuto - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - + 1 + m_DrcOn + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Enable DRC control. When DRC control is disabled, all connections are allowed. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_TRACK_AUTODEL + Auto-delete old tracks + + 0 + + + 0 + + 1 + m_TrackAutodel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Enable automatic track deletion when redrawing a track. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_TRACKS45 + &Limit tracks to H, V and 45 degrees + + 0 + + + 0 + + 1 + m_Track_45_Only_Ctrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Force track directions to H, V or 45 degrees when drawing a track. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Use double segmented tracks + + 0 + + + 0 + + 1 + m_Track_DoubleSegm_Ctrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Use two track segments, with 45 degrees angle between them, when drawing a new track + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1361,113 +1402,6 @@ - - 5 - wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxALL - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer1 - protected - - OnCancelButtonClick - - - - OnOKBUttonClick - - - - diff --git a/pcbnew/dialogs/panel_pcbnew_settings_base.h b/pcbnew/dialogs/panel_pcbnew_settings_base.h new file mode 100644 index 0000000000..5400fc9a6b --- /dev/null +++ b/pcbnew/dialogs/panel_pcbnew_settings_base.h @@ -0,0 +1,70 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __PANEL_PCBNEW_SETTINGS_BASE_H__ +#define __PANEL_PCBNEW_SETTINGS_BASE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_PCBNEW_SETTINGS_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_PCBNEW_SETTINGS_BASE : public wxPanel +{ + private: + + protected: + enum + { + wxID_POLAR_CTRL = 1000, + wxID_UNITS, + wxID_SEGMENTS45, + wxID_MAGNETIC_TRACKS, + wxID_DRC_ONOFF, + wxID_TRACK_AUTODEL, + wxID_TRACKS45 + }; + + wxRadioBox* m_PolarDisplay; + wxRadioBox* m_UnitsSelection; + wxCheckBox* m_Show_Page_Limits; + wxCheckBox* m_Segments_45_Only_Ctrl; + wxCheckBox* m_UseEditKeyForWidth; + wxCheckBox* m_dragSelects; + wxStaticText* m_staticTextRotationAngle; + wxTextCtrl* m_RotationAngle; + wxRadioBox* m_MagneticPadOptCtrl; + wxRadioBox* m_MagneticTrackOptCtrl; + wxCheckBox* m_DrcOn; + wxCheckBox* m_TrackAutodel; + wxCheckBox* m_Track_45_Only_Ctrl; + wxCheckBox* m_Track_DoubleSegm_Ctrl; + + public: + + PANEL_PCBNEW_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~PANEL_PCBNEW_SETTINGS_BASE(); + +}; + +#endif //__PANEL_PCBNEW_SETTINGS_BASE_H__ diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 270980d2b7..e8d6ea5c1c 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -26,7 +26,6 @@ */ #include -#include #include #include #include @@ -48,8 +47,6 @@ #include #include #include -#include -#include #include #include #include @@ -61,6 +58,12 @@ #include #include +#include +#include +#include +#include +#include + #include "tools/selection_tool.h" #include "tools/edit_tool.h" #include "tools/drawing_tool.h" @@ -130,20 +133,12 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME ) EVT_TOOL( ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE, FOOTPRINT_EDIT_FRAME::OnSelectOptionToolbar ) // Preferences and option menus - EVT_MENU( ID_PREFERENCES_HOTKEY_EXPORT_CONFIG, - FOOTPRINT_EDIT_FRAME::ProcessPreferences ) - EVT_MENU( ID_PREFERENCES_HOTKEY_IMPORT_CONFIG, - FOOTPRINT_EDIT_FRAME::ProcessPreferences ) - EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_EDITOR, - FOOTPRINT_EDIT_FRAME::ProcessPreferences ) EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, FOOTPRINT_EDIT_FRAME::ProcessPreferences ) EVT_MENU( ID_PCB_LIB_TABLE_EDIT, FOOTPRINT_EDIT_FRAME::ProcessPreferences ) EVT_MENU( wxID_PREFERENCES, FOOTPRINT_EDIT_FRAME::ProcessPreferences ) - EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP, - FOOTPRINT_EDIT_FRAME::ProcessPreferences ) EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, FOOTPRINT_EDIT_FRAME::OnConfigurePaths ) // popup commands @@ -227,7 +222,6 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : wxIcon icon; icon.CopyFromBitmap( KiBitmap( icon_modedit_xpm ) ); SetIcon( icon ); - m_iconScale = -1; // Show a title (frame title + footprint name): updateTitle(); @@ -821,18 +815,6 @@ void FOOTPRINT_EDIT_FRAME::ProcessPreferences( wxCommandEvent& event ) switch( id ) { // Hotkey IDs - case ID_PREFERENCES_HOTKEY_EXPORT_CONFIG: - ExportHotkeyConfigToFile( g_Module_Editor_Hotkeys_Descr, "pcbnew" ); - break; - - case ID_PREFERENCES_HOTKEY_IMPORT_CONFIG: - ImportHotkeyConfigFromFile( g_Module_Editor_Hotkeys_Descr, "pcbnew" ); - break; - - case ID_PREFERENCES_HOTKEY_SHOW_EDITOR: - InstallHotkeyFrame( this, g_Pcbnew_Editor_Hotkeys_Descr, g_Module_Editor_Hotkeys_Descr ); - break; - case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST: // Display current hotkey list for the footprint editor. DisplayHotkeyList( this, g_Module_Editor_Hotkeys_Descr ); @@ -892,11 +874,7 @@ void FOOTPRINT_EDIT_FRAME::ProcessPreferences( wxCommandEvent& event ) break; case wxID_PREFERENCES: - InvokeFPEditorPrefsDlg( this ); - break; - - case ID_PCB_DISPLAY_OPTIONS_SETUP: - DIALOG_MODEDIT_DISPLAY_OPTIONS::Invoke( *this ); + ShowPreferences( g_Pcbnew_Editor_Hotkeys_Descr, g_Module_Editor_Hotkeys_Descr, wxT( "pcbnew" ) ); break; default: @@ -905,9 +883,18 @@ void FOOTPRINT_EDIT_FRAME::ProcessPreferences( wxCommandEvent& event ) } +void FOOTPRINT_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent ) +{ + aParent->AddPage( new PANEL_MODEDIT_SETTINGS( this, aParent ), _( "Footprint Editor" ) ); + aParent->AddSubPage( new PANEL_MODEDIT_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) ); + aParent->AddSubPage( new PANEL_MODEDIT_DEFAULTS( this, aParent ), _( "Default Values" ) ); +} + + void FOOTPRINT_EDIT_FRAME::OnConfigurePaths( wxCommandEvent& aEvent ) { - Pgm().ConfigurePaths( this, Prj().Get3DCacheManager()->GetResolver() ); + DIALOG_CONFIGURE_PATHS dlg( this, Prj().Get3DCacheManager()->GetResolver() ); + dlg.ShowModal(); } @@ -962,11 +949,16 @@ void FOOTPRINT_EDIT_FRAME::UseGalCanvas( bool aEnable ) } -int FOOTPRINT_EDIT_FRAME::GetIconScale() +void FOOTPRINT_EDIT_FRAME::CommonSettingsChanged() { - int scale = 0; - Kiface().KifaceSettings()->Read( IconScaleEntry, &scale, 0 ); - return scale; + PCB_BASE_EDIT_FRAME::CommonSettingsChanged(); + + ReCreateHToolbar(); + ReCreateAuxiliaryToolbar(); + ReCreateVToolbar(); + ReCreateOptToolbar(); + Layout(); + SendSizeEvent(); } diff --git a/pcbnew/footprint_edit_frame.h b/pcbnew/footprint_edit_frame.h index 42065af74f..37ebea58bd 100644 --- a/pcbnew/footprint_edit_frame.h +++ b/pcbnew/footprint_edit_frame.h @@ -477,7 +477,15 @@ public: */ bool OpenProjectFiles( const std::vector& aFileSet, int aCtl = 0 ) override; - int GetIconScale() override; + /** + * Allows Modedit to install its preferences panel into the preferences dialog. + */ + void InstallPreferences( PAGED_DIALOG* aParent ) override; + + /** + * Called after the preferences dialog is run. + */ + void CommonSettingsChanged() override; /** * redraws the message panel. @@ -500,9 +508,6 @@ protected: /// List of footprint editor configuration parameters. PARAM_CFG_ARRAY m_configParams; - /// Pretty much what it says on the tin. - int m_iconScale; - /** * Function UpdateTitle * updates window title according to getLibNickName(). diff --git a/pcbnew/invoke_pcb_dialog.h b/pcbnew/invoke_pcb_dialog.h index c27904dcdd..b392cd76c2 100644 --- a/pcbnew/invoke_pcb_dialog.h +++ b/pcbnew/invoke_pcb_dialog.h @@ -136,12 +136,4 @@ bool InvokeLayerSetup( PCB_EDIT_FRAME* aCaller, BOARD* aBoard ); */ bool InvokeSVGPrint( wxTopLevelWindow* aCaller, BOARD* aBoard, PCB_PLOT_PARAMS* aSettings ); -/** - * Function InvokeSVGPrint - * shows the SVG print dialog - * @param aCaller is the FOOTPRINT_EDIT_FRAME which is invoking the dialog. - * @return bool - true if user pressed OK (did not abort), else false. - */ -bool InvokeFPEditorPrefsDlg( FOOTPRINT_EDIT_FRAME* aCaller ); - #endif // INVOKE_A_DIALOG_H_ diff --git a/pcbnew/menubar_footprint_editor.cpp b/pcbnew/menubar_footprint_editor.cpp index 95710ee90c..838182d454 100644 --- a/pcbnew/menubar_footprint_editor.cpp +++ b/pcbnew/menubar_footprint_editor.cpp @@ -447,30 +447,22 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() // Settings AddMenuItem( prefs_menu, wxID_PREFERENCES, - _( "General &Settings..." ), _( "Change footprint editor settings." ), + _( "&Preferences..." ), _( "Show preferences for all open tools" ), KiBitmap( preference_xpm ) ); prefs_menu->AppendSeparator(); - AddMenuItem( prefs_menu, ID_PCB_DISPLAY_OPTIONS_SETUP, - _( "&Display Options..." ), - _( "Graphics acceleration, grid and cursor settings." ), - KiBitmap( display_options_xpm ) ); - - text = AddHotkeyName( _( "Legacy Tool&set" ), m_hotkeysDescrList, - HK_CANVAS_LEGACY ); + text = AddHotkeyName( _( "Legacy Tool&set" ), m_hotkeysDescrList, HK_CANVAS_LEGACY ); AddMenuItem( prefs_menu, ID_MENU_CANVAS_LEGACY, text, _( "Use Legacy Toolset (not all features will be available)" ), KiBitmap( tools_xpm ), wxITEM_RADIO ); - text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), - m_hotkeysDescrList, HK_CANVAS_OPENGL ); + text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), m_hotkeysDescrList, HK_CANVAS_OPENGL ); AddMenuItem( prefs_menu, ID_MENU_CANVAS_OPENGL, text, _( "Use Modern Toolset with hardware-accelerated graphics (recommended)" ), KiBitmap( tools_xpm ), wxITEM_RADIO ); - text = AddHotkeyName( _( "Modern Toolset (&Fallback)" ), - m_hotkeysDescrList, HK_CANVAS_CAIRO ); + text = AddHotkeyName( _( "Modern Toolset (&Fallback)" ), m_hotkeysDescrList, HK_CANVAS_CAIRO ); AddMenuItem( prefs_menu, ID_MENU_CANVAS_CAIRO, text, _( "Use Modern Toolset with software graphics (fall-back)" ), KiBitmap( tools_xpm ), wxITEM_RADIO ); @@ -480,9 +472,6 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() // Language submenu Pgm().AddMenuLanguageList( prefs_menu ); - // Hotkey submenu - AddHotkeyConfigMenu( prefs_menu ); - //----- Help menu -------------------- wxMenu* helpMenu = new wxMenu; @@ -512,10 +501,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() // About Pcbnew helpMenu->AppendSeparator(); - AddMenuItem( helpMenu, wxID_ABOUT, - _( "&About KiCad" ), - _( "About KiCad" ), - KiBitmap( about_xpm ) ); + AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) ); // Append menus to the menubar menuBar->Append( fileMenu, _( "&File" ) ); diff --git a/pcbnew/menubar_pcb_editor.cpp b/pcbnew/menubar_pcb_editor.cpp index 3c9c855064..a77f0090dd 100644 --- a/pcbnew/menubar_pcb_editor.cpp +++ b/pcbnew/menubar_pcb_editor.cpp @@ -199,19 +199,9 @@ void preparePreferencesMenu( PCB_EDIT_FRAME* aFrame, wxMenu* aParentMenu ) wxString text; -#ifdef __WXMAC__ - aParentMenu->Append( wxID_PREFERENCES ); -#else AddMenuItem( aParentMenu, wxID_PREFERENCES, - _( "&General Settings" ), _( "Select general options for Pcbnew" ), + _( "&Preferences..." ), _( "Show preferences for all open tools" ), KiBitmap( preference_xpm ) ); -#endif - - // Display Settings - AddMenuItem( aParentMenu, ID_PCB_DISPLAY_OPTIONS_SETUP, - _( "&Display Options..." ), - _( "Graphics acceleration, grid, cursor, annotation and clearance outline settings." ), - KiBitmap( display_options_xpm ) ); text = AddHotkeyName( _( "Legacy Tool&set" ), g_Board_Editor_Hotkeys_Descr, HK_CANVAS_LEGACY ); @@ -236,11 +226,6 @@ void preparePreferencesMenu( PCB_EDIT_FRAME* aFrame, wxMenu* aParentMenu ) // Language submenu Pgm().AddMenuLanguageList( aParentMenu ); - // Hotkey submenu - AddHotkeyConfigMenu( aParentMenu ); - - aParentMenu->AppendSeparator(); - AddMenuItem( aParentMenu, ID_CONFIG_SAVE, _( "&Save Project File..." ), _( "Save project preferences into a project file" ), @@ -493,10 +478,7 @@ void prepareHelpMenu( wxMenu* aParentMenu ) aParentMenu->AppendSeparator(); - AddMenuItem( aParentMenu, wxID_ABOUT, - _( "&About KiCad" ), - _( "Display KiCad About dialog" ), - KiBitmap( about_xpm ) ); + AddMenuItem( aParentMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) ); } diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index e4b091a401..acd6cb46cf 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -33,13 +33,10 @@ #include #include #include -#include #include <3d_viewer/eda_3d_viewer.h> -#include #include #include #include - #include #include #include @@ -58,28 +55,26 @@ #include #include #include - +#include #include #include #include #include #include #include - +#include +#include +#include +#include +#include #include #include #include -#include -#include - #if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON) #include #endif -#include -#include -#include using namespace std::placeholders; @@ -150,15 +145,13 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, PCB_EDIT_FRAME::OnConfigurePaths ) EVT_MENU( ID_CONFIG_SAVE, PCB_EDIT_FRAME::Process_Config ) EVT_MENU( ID_CONFIG_READ, PCB_EDIT_FRAME::Process_Config ) - EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, - PCB_EDIT_FRAME::Process_Config ) + EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, PCB_EDIT_FRAME::Process_Config ) EVT_MENU( wxID_PREFERENCES, PCB_EDIT_FRAME::Process_Config ) EVT_MENU( ID_PCB_LAYERS_SETUP, PCB_EDIT_FRAME::Process_Config ) EVT_MENU( ID_PCB_MASK_CLEARANCE, PCB_EDIT_FRAME::Process_Config ) EVT_MENU( ID_PCB_PAD_SETUP, PCB_EDIT_FRAME::Process_Config ) EVT_MENU( ID_CONFIG_SAVE, PCB_EDIT_FRAME::Process_Config ) EVT_MENU( ID_CONFIG_READ, PCB_EDIT_FRAME::Process_Config ) - EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP, PCB_EDIT_FRAME::InstallDisplayOptionsDialog ) EVT_MENU( ID_PCB_USER_GRID_SETUP, PCB_EDIT_FRAME::Process_Special_Functions ) // menu Postprocess @@ -1216,7 +1209,8 @@ bool PCB_EDIT_FRAME::SetCurrentNetClass( const wxString& aNetClassName ) void PCB_EDIT_FRAME::OnConfigurePaths( wxCommandEvent& aEvent ) { - Pgm().ConfigurePaths( this, Prj().Get3DCacheManager()->GetResolver() ); + DIALOG_CONFIGURE_PATHS dlg( this, Prj().Get3DCacheManager()->GetResolver() ); + dlg.ShowModal(); } @@ -1343,18 +1337,10 @@ int PCB_EDIT_FRAME::InstallExchangeModuleFrame( MODULE* Module, bool updateMode } -int PCB_EDIT_FRAME::GetIconScale() +void PCB_EDIT_FRAME::CommonSettingsChanged() { - int scale = 0; - Kiface().KifaceSettings()->Read( IconScaleEntry, &scale, 0 ); - return scale; -} + PCB_BASE_EDIT_FRAME::CommonSettingsChanged(); - -void PCB_EDIT_FRAME::SetIconScale( int aScale ) -{ - Kiface().KifaceSettings()->Write( IconScaleEntry, aScale ); - ReCreateMenuBar(); ReCreateHToolbar(); ReCreateAuxiliaryToolbar(); ReCreateVToolbar(); diff --git a/pcbnew/pcb_edit_frame.h b/pcbnew/pcb_edit_frame.h index d52834790a..3bb2a6a8df 100644 --- a/pcbnew/pcb_edit_frame.h +++ b/pcbnew/pcb_edit_frame.h @@ -1720,8 +1720,15 @@ public: */ void UpdateTitle(); - int GetIconScale() override; - void SetIconScale( int aScale ) override; + /** + * Allows Pcbnew to install its preferences panel into the preferences dialog. + */ + void InstallPreferences( PAGED_DIALOG* aParent ) override; + + /** + * Called after the preferences dialog is run. + */ + void CommonSettingsChanged() override; void SyncMenusAndToolbars( wxEvent& aEvent ) override; diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index d892207497..33787180ac 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -42,24 +42,22 @@ #include #include #include -#include +#include +#include +#include #include #include - #include #include #include -#include +#include #include #include #include - #include -#include -#include #include #include - +#include void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) { @@ -167,10 +165,7 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) break; case wxID_PREFERENCES: - { - DIALOG_GENERALOPTIONS dlg( this ); - dlg.ShowModal(); - } + ShowPreferences( g_Pcbnew_Editor_Hotkeys_Descr, g_Board_Editor_Hotkeys_Descr, wxT( "pcbnew" ) ); break; case ID_PCB_PAD_SETUP: @@ -210,18 +205,6 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) break; // Hotkey IDs - case ID_PREFERENCES_HOTKEY_EXPORT_CONFIG: - ExportHotkeyConfigToFile( g_Pcbnew_Editor_Hotkeys_Descr, wxT( "pcbnew" ) ); - break; - - case ID_PREFERENCES_HOTKEY_IMPORT_CONFIG: - ImportHotkeyConfigFromFile( g_Pcbnew_Editor_Hotkeys_Descr, wxT( "pcbnew" ) ); - break; - - case ID_PREFERENCES_HOTKEY_SHOW_EDITOR: - InstallHotkeyFrame( this, g_Pcbnew_Editor_Hotkeys_Descr, g_Board_Editor_Hotkeys_Descr ); - break; - case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST: // Display current hotkey list for Pcbnew. DisplayHotkeyList( this, g_Board_Editor_Hotkeys_Descr ); @@ -235,6 +218,13 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) } +void PCB_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent ) +{ + aParent->AddPage( new PANEL_PCBNEW_SETTINGS( this, aParent ), _( "Pcbnew" ) ); + aParent->AddSubPage( new PANEL_PCBNEW_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) ); +} + + bool PCB_EDIT_FRAME::LoadProjectSettings() { wxLogDebug( wxT( "Loading project '%s' settings." ), diff --git a/pcbnew/pcbnew_id.h b/pcbnew/pcbnew_id.h index b72523a28e..b2c6792ee3 100644 --- a/pcbnew/pcbnew_id.h +++ b/pcbnew/pcbnew_id.h @@ -333,7 +333,6 @@ enum pcbnew_ids ID_PCB_GLOBAL_DELETE, ID_POPUP_PCB_DELETE_TRACKSEG, ID_TOOLBARH_PCB_SELECT_LAYER, - ID_PCB_DISPLAY_OPTIONS_SETUP, // Module editor right vertical tool bar commands. ID_MODEDIT_PAD_TOOL, diff --git a/pcbnew/tool_pcb_editor.cpp b/pcbnew/tool_pcb_editor.cpp index 502ac3bbd8..66d672b9d4 100644 --- a/pcbnew/tool_pcb_editor.cpp +++ b/pcbnew/tool_pcb_editor.cpp @@ -48,6 +48,7 @@ #include #include +#include extern bool IsWxPythonLoaded(); @@ -102,7 +103,8 @@ void PCB_EDIT_FRAME::PrepareLayerIndicator() previous_Route_Layer_BOTTOM_color, previous_via_color, previous_background_color; - const int requested_scale = GetIconScale(); + int requested_scale; + Pgm().CommonSettings()->Read( ICON_SCALE_KEY, &requested_scale, 0 ); if( requested_scale != previous_requested_scale ) {