Unified preferences dialog framework.

(cherry picked from commit 8ee3e77)
This commit is contained in:
Jeff Young 2018-05-14 18:34:18 +01:00
parent 2283bcda4c
commit 7841f8a466
162 changed files with 17656 additions and 20828 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 );

View File

@ -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,

View File

@ -71,20 +71,13 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl
h = dynamic_cast<KIWAY_HOLDER*>( 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 );

View File

@ -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 <dialog_hotkeys_editor.h>
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();
}

View File

@ -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 );
}

View File

@ -1,485 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_hotkeys_editor_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">dialog_hotkeys_editor_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">HOTKEYS_EDITOR_DIALOG_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Hotkeys Editor</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">m_mainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Double-click to edit</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText1</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">400</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">1</property>
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,350</property>
<property name="moveable">1</property>
<property name="name">m_panelHotkeys</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">b_buttonsSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_RESET</property>
<property name="label">Reset</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_resetButton</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">ResetClicked</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Defaults</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_defaultButton</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">DefaultsClicked</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="0">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="0">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="name">m_sdbSizer</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick"></event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick"></event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -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 <pgm_base.h>
#include <dialog_shim.h>
#include <kiface_i.h>
#include <bitmap_types.h>
#include <bitmaps.h>
#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() );
}

View File

@ -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

View File

@ -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 );
}

File diff suppressed because it is too large Load Diff

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "widgets/stepped_slider.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/spinctrl.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/bmpbuttn.h>
#include <wx/button.h>
#include <wx/radiobut.h>
#include <wx/gbsizer.h>
#include <wx/slider.h>
#include <wx/checkbox.h>
#include <wx/statbox.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -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 <eda_base_frame.h>
#include <panel_hotkeys_editor.h>
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 );
}

View File

@ -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 );
}

View File

@ -0,0 +1,553 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">panel_hotkeys_editor_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">PanelHotkeysEditorBase</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">PANEL_HOTKEYS_EDITOR_BASE</property>
<property name="pos"></property>
<property name="size">500,300</property>
<property name="subclass">; forward_declare</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_mainSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMargins</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,350</property>
<property name="moveable">1</property>
<property name="name">m_panelHotkeys</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">b_buttonsSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_RESET</property>
<property name="label">Reset Hotkeys</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_resetButton</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">ResetClicked</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Set to Defaults</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_defaultButton</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">DefaultsClicked</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Import...</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">btnImport</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnImport</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Export...</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">btnExport</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnExport</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/panel.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/panel.h>
#include <wx/string.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -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()
{

View File

@ -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.

View File

@ -31,19 +31,17 @@
#include <wx/stdpaths.h>
#include <wx/string.h>
#include <wx/display.h>
#include <dialog_shim.h>
#include <eda_doc.h>
#include <id.h>
#include <kiface_i.h>
#include <pgm_base.h>
#include <eda_base_frame.h>
#include <menus_helpers.h>
#include <bitmaps.h>
#include <trace_helpers.h>
#include <wx/display.h>
#include <wx/utils.h>
#include <panel_hotkeys_editor.h>
#include <dialogs/panel_common_settings.h>
#include <widgets/paged_dialog.h>
/// 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 ) );
}

View File

@ -37,7 +37,7 @@
#include <gestfich.h>
#include <eda_base_frame.h>
#include <macros.h>
#include <dialog_hotkeys_editor.h>
#include <panel_hotkeys_editor.h>
#include <menus_helpers.h>
#include <draw_frame.h>
#include <tool/tool_manager.h>
@ -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 ) );
}

View File

@ -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<EDA_BASE_FRAME*>( m_top );
if( top )
top->ShowChangedIcons();
top->CommonSettingsChanged();
}
#endif
@ -449,7 +449,7 @@ void KIWAY::ShowChangedIcons()
if( frame )
{
frame->ShowChangedIcons();
frame->CommonSettingsChanged();
}
}
}

View File

@ -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();
}

View File

@ -54,7 +54,6 @@
#include <lockfile.h>
#include <systemdirsappend.h>
#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();
}

View File

@ -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() );

View File

@ -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 );

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include <confirm.h>
#include <wx/treebook.h>
#include <wx/grid.h>
#include <wx/statline.h>
#include <widgets/paged_dialog.h>
// 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<wxString, wxString> g_lastPage;
std::map<wxString, wxString> 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<wxTextCtrl*>( ctrl );
if( textCtrl )
{
auto textEntry = dynamic_cast<wxTextEntry*>( textCtrl );
textEntry->SetSelection( -1, -1 );
textCtrl->SetFocus();
return;
}
auto grid = dynamic_cast<wxGrid*>( ctrl );
if( grid )
{
grid->SetFocus();
grid->MakeCellVisible( m_errorRow, m_errorCol );
grid->SetGridCursor( m_errorRow, m_errorCol );
grid->EnableCellEditControl( true );
grid->ShowCellEditControl();
return;
}
}
}

View File

@ -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 );

View File

@ -30,7 +30,6 @@
#include <fctsys.h>
#include <build_version.h>
#include <kiway_express.h>
#include <pgm_base.h>
#include <kiface_i.h>
#include <kiface_ids.h>
#include <macros.h>
@ -42,14 +41,15 @@
#include <bitmaps.h>
#include <widgets/progress_reporter.h>
#include <3d_cache/3d_cache.h>
#include <cvpcb_mainframe.h>
#include <dialog_configure_paths.h>
#include <cvpcb.h>
#include <listboxes.h>
#include <invoke_pcb_dialog.h>
#include <display_footprints_frame.h>
#include <cvpcb_id.h>
#include <cvpcb_mainframe.h>
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();
}

View File

@ -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" ) );

View File

@ -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

View File

@ -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;

View File

@ -34,8 +34,6 @@
#include <dialog_edit_line_style_base.h>
#include <sch_line.h>
class WIDGET_EESCHEMA_COLOR_CONFIG;
class DIALOG_EDIT_LINE_STYLE : public DIALOG_EDIT_LINE_STYLE_BASE
{
public:

View File

@ -1,392 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* 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 <fctsys.h>
#include <base_screen.h>
#include <dialog_eeschema_options.h>
#include <widgets/widget_hotkey_list.h>
#include "../widgets/widget_eeschema_color_config.h"
#include <sch_edit_frame.h>
#include <hotkeys.h>
#include <bitmap_types.h>
#include <wx/settings.h>
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<SCH_EDIT_FRAME*>( 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<bool> 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;
}

View File

@ -1,412 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* 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 <dialog_eeschema_options_base.h>
#include <template_fieldnames.h>
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__

View File

@ -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()
{
}

File diff suppressed because it is too large Load Diff

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "widgets/stepped_slider.h"
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/choice.h>
#include <wx/spinctrl.h>
#include <wx/slider.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/grid.h>
#include <wx/button.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -1,130 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* 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 <fctsys.h>
#include <base_screen.h>
#include <dialog_libedit_options.h>
#include <lib_edit_frame.h>
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<LIB_EDIT_FRAME*>( 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<LIB_EDIT_FRAME*>( 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 );
}

View File

@ -1,105 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* 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 <dialog_libedit_options_base.h>
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__

View File

@ -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()
{
}

File diff suppressed because it is too large Load Diff

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "widgets/stepped_slider.h"
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/choice.h>
#include <wx/spinctrl.h>
#include <wx/slider.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -0,0 +1,114 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* 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 <fctsys.h>
#include <base_screen.h>
#include <sch_edit_frame.h>
#include <class_libentry.h>
#include <panel_eeschema_display_options.h>
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;
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#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

View File

@ -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()
{
}

File diff suppressed because it is too large Load Diff

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/choice.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -0,0 +1,81 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* 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 <fctsys.h>
#include <base_screen.h>
#include <sch_edit_frame.h>
#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;
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#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

View File

@ -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()
{
}

File diff suppressed because it is too large Load Diff

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/choice.h>
#include <wx/textctrl.h>
#include <wx/spinctrl.h>
#include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -0,0 +1,170 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* 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 <fctsys.h>
#include <base_screen.h>
#include <template_fieldnames.h>
#include <grid_tricks.h>
#include <sch_edit_frame.h>
#include <bitmaps.h>
#include <panel_eeschema_template_fieldnames.h>
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();
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef PANEL_EESCHEMA_DEFUALT_FIELDS_H
#define PANEL_EESCHEMA_DEFUALT_FIELDS_H
#include <template_fieldnames.h>
#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

View File

@ -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 );
}

View File

@ -0,0 +1,440 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">panel_eeschema_template_fieldnames_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">PanelEeschemaTemplateFieldnames</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="subclass">; forward_declare</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bPanelSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMargins</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="cell_bg"></property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_TOP</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="col_label_size">22</property>
<property name="col_label_values">&quot;Name&quot; &quot;Visible&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="cols">2</property>
<property name="column_sizes">300,60</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_col_move">0</property>
<property name="drag_col_size">1</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">1</property>
<property name="editing">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_grid</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="row_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="row_label_size">0</property>
<property name="row_label_values"></property>
<property name="row_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="row_sizes"></property>
<property name="rows">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnGridCellChange"></event>
<event name="OnGridCellLeftClick"></event>
<event name="OnGridCellLeftDClick"></event>
<event name="OnGridCellRightClick"></event>
<event name="OnGridCellRightDClick"></event>
<event name="OnGridCmdCellChange"></event>
<event name="OnGridCmdCellLeftClick"></event>
<event name="OnGridCmdCellLeftDClick"></event>
<event name="OnGridCmdCellRightClick"></event>
<event name="OnGridCmdCellRightDClick"></event>
<event name="OnGridCmdColSize"></event>
<event name="OnGridCmdEditorCreated"></event>
<event name="OnGridCmdEditorHidden"></event>
<event name="OnGridCmdEditorShown"></event>
<event name="OnGridCmdLabelLeftClick"></event>
<event name="OnGridCmdLabelLeftDClick"></event>
<event name="OnGridCmdLabelRightClick"></event>
<event name="OnGridCmdLabelRightDClick"></event>
<event name="OnGridCmdRangeSelect"></event>
<event name="OnGridCmdRowSize"></event>
<event name="OnGridCmdSelectCell"></event>
<event name="OnGridColSize"></event>
<event name="OnGridEditorCreated"></event>
<event name="OnGridEditorHidden"></event>
<event name="OnGridEditorShown"></event>
<event name="OnGridLabelLeftClick"></event>
<event name="OnGridLabelLeftDClick"></event>
<event name="OnGridLabelRightClick"></event>
<event name="OnGridLabelRightDClick"></event>
<event name="OnGridRangeSelect"></event>
<event name="OnGridRowSize"></event>
<event name="OnGridSelectCell"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize">OnSizeGrid</event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer10</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="hover"></property>
<property name="id">wxID_ANY</property>
<property name="label">Add Field</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">29,29</property>
<property name="moveable">1</property>
<property name="name">m_addFieldButton</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selected"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxBU_AUTODRAW</property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnAddButtonClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="hover"></property>
<property name="id">wxID_ANY</property>
<property name="label">Delete Field</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">29,29</property>
<property name="moveable">1</property>
<property name="name">m_deleteFieldButton</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selected"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxBU_AUTODRAW</property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnDeleteButtonClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/font.h>
#include <wx/grid.h>
#include <wx/gdicmn.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/bmpbuttn.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -0,0 +1,87 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* 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 <fctsys.h>
#include <base_screen.h>
#include <lib_edit_frame.h>
#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;
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#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

View File

@ -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()
{
}

File diff suppressed because it is too large Load Diff

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/choice.h>
#include <wx/checkbox.h>
#include <wx/textctrl.h>
#include <wx/spinctrl.h>
#include <wx/sizer.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -33,27 +33,20 @@
#include <gestfich.h>
#include <sch_edit_frame.h>
#include <invoke_sch_dialog.h>
#include <common.h>
#include <eeschema_id.h>
#include <general.h>
#include <lib_edit_frame.h>
#include <eeschema_config.h>
#include <hotkeys.h>
#include <sch_sheet.h>
#include <class_libentry.h>
#include <worksheet_shape_builder.h>
#include <class_library.h>
#include <symbol_lib_table.h>
#include <dialog_hotkeys_editor.h>
#include <dialogs/dialog_eeschema_options.h>
#include <dialogs/dialog_libedit_options.h>
#include <dialogs/dialog_schematic_find.h>
#include <dialog_erc.h>
#include <wildcards_and_files_ext.h>
#include <widgets/paged_dialog.h>
#include <dialogs/panel_eeschema_template_fieldnames.h>
#include <dialogs/panel_eeschema_settings.h>
#include <dialogs/panel_eeschema_display_options.h>
#include <widgets/widget_eeschema_color_config.h>
#include <dialogs/panel_libedit_settings.h>
#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" ) );
}

View File

@ -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();

View File

@ -35,10 +35,8 @@
#include <sch_base_frame.h>
#include <sch_screen.h>
#include <lib_draw_item.h>
#include <lib_collectors.h>
#include <core/optional.h>
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

View File

@ -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 ) );
}

View File

@ -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" ) );

View File

@ -26,14 +26,14 @@
#include <kiway.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <class_library.h>
#include <eeschema_id.h>
#include <lib_edit_frame.h>
#include <viewlib_frame.h>
#include <sch_base_frame.h>
#include <symbol_lib_table.h>
#include <pgm_base.h>
#include <dialog_configure_paths.h>
#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();
}

View File

@ -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();

View File

@ -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;

View File

@ -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 );
}

View File

@ -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();
}

View File

@ -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_

View File

@ -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

View File

@ -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 <fctsys.h>
#include <common.h>
#include <macros.h>
#include <gerbview.h>
#include <gerbview_frame.h>
#include <dialog_show_page_borders.h>
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; i<DIM( g_GerberPageSizeList ); ++i )
{
if( curPaperType == g_GerberPageSizeList[i] )
{
m_ShowPageLimits->SetSelection( 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 );
}

View File

@ -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 );
}

View File

@ -1,318 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_show_page_borders_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">dialog_show_page_borders_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DIALOG_PAGE_SHOW_PAGE_BORDERS_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Page Borders</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bDialogSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bUpperSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bRightSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Full size without page limits&quot; &quot;Full size&quot; &quot;Size A4&quot; &quot;Size A3&quot; &quot;Size A2&quot; &quot;Size A&quot; &quot;Size B&quot; &quot;Size C&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show Page Limits:</property>
<property name="majorDimension">1</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_ShowPageLimits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticline1</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxLI_HORIZONTAL</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="name">m_sdbSizer1</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick">OnCancelButtonClick</event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick">OnOKBUttonClick</event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
/**
* @file gerbview_dialog_display_options_frame.cpp
* Set some display options for GerbView
*/
#include <fctsys.h>
#include <common.h>
#include <macros.h>
#include <class_drawpanel.h>
#include <config_map.h>
#include <gerbview.h>
#include <gerbview_frame.h>
#include <gerbview_dialog_display_options_frame_base.h>
#include <class_draw_panel_gal.h>
#include <view/view.h>
#include <gerbview_painter.h>
#include <gal/gal_display_options.h>
#include <widgets/gal_options_panel.h>
/*******************************************/
/* 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<KIGFX::GERBVIEW_PAINTER*>( view->GetPainter() );
auto settings = static_cast<KIGFX::GERBVIEW_RENDER_SETTINGS*>( 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<GERBVIEW_FRAME*>( 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<GERBVIEW_FRAME*>( 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 );
}
}

View File

@ -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 );
}

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "widgets/stepped_slider.h"
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/stattext.h>
#include <wx/slider.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include <fctsys.h>
#include <common.h>
#include <class_drawpanel.h>
#include <gerbview.h>
#include <gerbview_frame.h>
#include <class_draw_panel_gal.h>
#include <view/view.h>
#include <gerbview_painter.h>
#include <gal/gal_display_options.h>
#include <widgets/gal_options_panel.h>
#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<KIGFX::GERBVIEW_PAINTER*>( 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;
}

View File

@ -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

View File

@ -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()
{
}

View File

@ -0,0 +1,504 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">panel_gerbview_display_options_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">PanelGerbviewDisplayOptions</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="subclass">; forward_declare</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bDialogSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_UpperSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_galOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bRightSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Annotations</property>
<property name="minimum_size"></property>
<property name="name">sbSizer1</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show D codes</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_OptDisplayDCodes</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Drawing Mode</property>
<property name="minimum_size"></property>
<property name="name">sbSizer2</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Sketch flashed items</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_OptDisplayFlashedItems</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Sketch lines</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_OptDisplayLines</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Sketch polygons</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_OptDisplayPolygons</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/sizer.h>
#include <wx/gdicmn.h>
#include <wx/string.h>
#include <wx/checkbox.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/statbox.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include <fctsys.h>
#include <common.h>
#include <class_drawpanel.h>
#include <gerbview.h>
#include <gerbview_frame.h>
#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;
}

View File

@ -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 <dialog_show_page_borders_base.h>
#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

View File

@ -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()
{
}

View File

@ -0,0 +1,469 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">panel_gerbview_settings_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">PanelGerbviewSettings</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">PANEL_GERBVIEW_SETTINGS_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="subclass">; forward_declare</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bDialogSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_UpperSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bLeftSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Cartesian coordinates&quot; &quot;Polar coordinates&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Coordinates</property>
<property name="majorDimension">1</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_PolarDisplay</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Inches&quot; &quot;Millimeters&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Units</property>
<property name="majorDimension">1</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_BoxUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Full size&quot; &quot;Size A4&quot; &quot;Size A3&quot; &quot;Size A2&quot; &quot;Size A&quot; &quot;Size B&quot; &quot;Size C&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Page Size</property>
<property name="majorDimension">1</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_PageSize</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show page limits</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_ShowPageLimitsOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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__

View File

@ -41,7 +41,6 @@
#include <dialog_helpers.h>
#include <DCodeSelectionbox.h>
#include <gerbview_layer_widget.h>
#include <dialog_show_page_borders.h>
#include <gerbview_draw_panel_gal.h>
#include <gal/graphics_abstraction_layer.h>
@ -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();

View File

@ -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;

View File

@ -35,9 +35,9 @@
#include <hotkeys.h>
#include <gerbview_frame.h>
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" ),

View File

@ -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

View File

@ -33,12 +33,11 @@
#include <common.h>
#include <class_drawpanel.h>
#include <config_params.h>
#include <gerbview.h>
#include <gerbview_frame.h>
#include <hotkeys.h>
#include <dialog_hotkeys_editor.h>
#include <widgets/paged_dialog.h>
#include <dialogs/panel_gerbview_settings.h>
#include <dialogs/panel_gerbview_display_options.h>
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() )

View File

@ -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();

View File

@ -30,7 +30,6 @@
#include <config_params.h>
#include <draw_frame.h>
#include <layers_id_colors_and_visibility.h>
#include <gerbview.h>
#include <convert_to_biu.h>
#include <gbr_layout.h>
@ -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()
};

Some files were not shown because too many files have changed in this diff Show More