mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-20 09:51:40 +00:00
Unified preferences dialog framework.
(cherry picked from commit 8ee3e77)
This commit is contained in:
parent
2283bcda4c
commit
7841f8a466
bitmaps_png/cpp_26
common
CMakeLists.txtbitmap.cpp
dialog_about
dialog_shim.cppdialogs
dialog_hotkeys_editor.cppdialog_hotkeys_editor_base.cppdialog_hotkeys_editor_base.fbppanel_common_settings.cpppanel_common_settings.hpanel_common_settings_base.cpppanel_common_settings_base.fbppanel_common_settings_base.hpanel_hotkeys_editor.cpppanel_hotkeys_editor_base.cpppanel_hotkeys_editor_base.fbppanel_hotkeys_editor_base.h
draw_frame.cppdraw_panel.cppeda_base_frame.cpphotkeys_basic.cppkiway.cppkiway_player.cpppgm_base.cpptool
widgets
cvpcb
eeschema
CMakeLists.txt
dialogs
dialog_edit_components_libid.cppdialog_edit_line_style.hdialog_eeschema_options.cppdialog_eeschema_options.hdialog_eeschema_options_base.cppdialog_eeschema_options_base.fbpdialog_eeschema_options_base.hdialog_libedit_options.cppdialog_libedit_options.hdialog_libedit_options_base.cppdialog_libedit_options_base.fbpdialog_libedit_options_base.hpanel_eeschema_display_options.cpppanel_eeschema_display_options.hpanel_eeschema_display_options_base.cpppanel_eeschema_display_options_base.fbppanel_eeschema_display_options_base.hpanel_eeschema_settings.cpppanel_eeschema_settings.hpanel_eeschema_settings_base.cpppanel_eeschema_settings_base.fbppanel_eeschema_settings_base.hpanel_eeschema_template_fieldnames.cpppanel_eeschema_template_fieldnames.hpanel_eeschema_template_fieldnames_base.cpppanel_eeschema_template_fieldnames_base.fbppanel_eeschema_template_fieldnames_base.hpanel_libedit_settings.cpppanel_libedit_settings.hpanel_libedit_settings_base.cpppanel_libedit_settings_base.fbppanel_libedit_settings_base.h
eeschema_config.cpplib_edit_frame.cpplib_edit_frame.hmenubar.cppmenubar_libedit.cppsch_base_frame.cppsch_edit_frame.cppsch_edit_frame.hsim
widgets
gerbview
CMakeLists.txt
dialogs
dialog_show_page_borders.cppdialog_show_page_borders_base.cppdialog_show_page_borders_base.fbpdialog_show_page_borders_base.hgerbview_dialog_display_options_frame.cppgerbview_dialog_display_options_frame_base.cppgerbview_dialog_display_options_frame_base.hpanel_gerbview_display_options.cpppanel_gerbview_display_options.hpanel_gerbview_display_options_base.cpppanel_gerbview_display_options_base.fbppanel_gerbview_display_options_base.hpanel_gerbview_settings.cpppanel_gerbview_settings.hpanel_gerbview_settings_base.cpppanel_gerbview_settings_base.fbppanel_gerbview_settings_base.h
events_called_functions.cppgbr_display_options.hgerbview.cppgerbview.hgerbview_config.cppgerbview_frame.cppgerbview_frame.hgerbview_id.hmenubar.cpptoolbars_gerber.cppinclude
bitmaps.hdraw_frame.heda_base_frame.hid.hkiway.hkiway_player.hpanel_hotkeys_editor.hpgm_base.h
widgets
kicad
pagelayout_editor
pcbnew
CMakeLists.txt
dialogs
dialog_general_options.cppdialog_general_options_BoardEditor_base.cppdialog_general_options_BoardEditor_base.fbpdialog_general_options_BoardEditor_base.hdialog_modedit_options.cppdialog_modedit_options_base.cppdialog_modedit_options_base.hpanel_modedit_defaults.cpppanel_modedit_defaults.hpanel_modedit_defaults_base.cpppanel_modedit_defaults_base.fbppanel_modedit_defaults_base.hpanel_modedit_display_options.cpppanel_modedit_display_options.hpanel_modedit_settings.cpppanel_modedit_settings.hpanel_modedit_settings_base.cpppanel_modedit_settings_base.fbppanel_modedit_settings_base.hpanel_pcbnew_display_options.cpppanel_pcbnew_display_options.hpanel_pcbnew_display_options_base.cpppanel_pcbnew_display_options_base.fbppanel_pcbnew_display_options_base.hpanel_pcbnew_settings.cpppanel_pcbnew_settings.hpanel_pcbnew_settings_base.cpppanel_pcbnew_settings_base.fbppanel_pcbnew_settings_base.h
footprint_edit_frame.cppfootprint_edit_frame.hinvoke_pcb_dialog.hmenubar_footprint_editor.cppmenubar_pcb_editor.cpppcb_edit_frame.cpppcb_edit_frame.hpcbnew_config.cpppcbnew_id.htool_pcb_editor.cpp@ -24,6 +24,6 @@ static const unsigned char png[] = {
|
||||
0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
const BITMAP_OPAQUE lang_catalan_xpm[1] = {{ png, sizeof( png ), "lang_catalan_xpm" }};
|
||||
const BITMAP_OPAQUE lang_ca_xpm[1] = {{ png, sizeof( png ), "lang_ca_xpm" }};
|
||||
|
||||
//EOF
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 );
|
||||
|
@ -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,
|
||||
|
@ -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 );
|
||||
|
@ -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();
|
||||
}
|
@ -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 );
|
||||
|
||||
}
|
@ -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>
|
178
common/dialogs/panel_common_settings.cpp
Normal file
178
common/dialogs/panel_common_settings.cpp
Normal 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() );
|
||||
}
|
53
common/dialogs/panel_common_settings.h
Normal file
53
common/dialogs/panel_common_settings.h
Normal 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
|
183
common/dialogs/panel_common_settings_base.cpp
Normal file
183
common/dialogs/panel_common_settings_base.cpp
Normal 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 );
|
||||
|
||||
}
|
1828
common/dialogs/panel_common_settings_base.fbp
Normal file
1828
common/dialogs/panel_common_settings_base.fbp
Normal file
File diff suppressed because it is too large
Load Diff
82
common/dialogs/panel_common_settings_base.h
Normal file
82
common/dialogs/panel_common_settings_base.h
Normal 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__
|
81
common/dialogs/panel_hotkeys_editor.cpp
Normal file
81
common/dialogs/panel_hotkeys_editor.cpp
Normal 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 );
|
||||
}
|
67
common/dialogs/panel_hotkeys_editor_base.cpp
Normal file
67
common/dialogs/panel_hotkeys_editor_base.cpp
Normal 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 );
|
||||
|
||||
}
|
553
common/dialogs/panel_hotkeys_editor_base.fbp
Normal file
553
common/dialogs/panel_hotkeys_editor_base.fbp
Normal 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>
|
@ -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__
|
@ -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()
|
||||
{
|
||||
|
@ -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.
|
||||
|
@ -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 ) );
|
||||
}
|
||||
|
@ -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 ) );
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user