Merge: Move eeschema colors into preferences

This commit is contained in:
Chris Pavlina 2016-01-16 18:53:19 -05:00
commit a9216b9a32
20 changed files with 266 additions and 411 deletions

View File

@ -25,8 +25,6 @@ set( EESCHEMA_DLGS
dialogs/dialog_bom.cpp dialogs/dialog_bom.cpp
dialogs/dialog_bom_base.cpp dialogs/dialog_bom_base.cpp
dialogs/dialog_bom_cfg_keywords.cpp dialogs/dialog_bom_cfg_keywords.cpp
dialogs/dialog_color_config.cpp
dialogs/dialog_color_config_base.cpp
dialogs/dialog_choose_component.cpp dialogs/dialog_choose_component.cpp
dialogs/dialog_choose_component_base.cpp dialogs/dialog_choose_component_base.cpp
dialogs/dialog_lib_edit_text.cpp dialogs/dialog_lib_edit_text.cpp
@ -72,6 +70,11 @@ set( EESCHEMA_DLGS
dialogs/dialog_schematic_find_base.cpp dialogs/dialog_schematic_find_base.cpp
) )
set( EESCHEMA_WIDGETS
widgets/widget_eeschema_color_config.cpp
)
set( EESCHEMA_SRCS set( EESCHEMA_SRCS
autoplace_fields.cpp autoplace_fields.cpp
annotate.cpp annotate.cpp
@ -90,6 +93,7 @@ set( EESCHEMA_SRCS
controle.cpp controle.cpp
cross-probing.cpp cross-probing.cpp
${EESCHEMA_DLGS} ${EESCHEMA_DLGS}
${EESCHEMA_WIDGETS}
edit_component_in_schematic.cpp edit_component_in_schematic.cpp
edit_bitmap.cpp edit_bitmap.cpp
edit_label.cpp edit_label.cpp

View File

@ -1,48 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_color_config_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_COLOR_CONFIG_BASE::DIALOG_COLOR_CONFIG_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bmainSizer;
bmainSizer = new wxBoxSizer( wxVERTICAL );
m_mainBoxSizer = new wxBoxSizer( wxHORIZONTAL );
bmainSizer->Add( m_mainBoxSizer, 1, wxEXPAND, 5 );
m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bmainSizer->Add( m_staticline, 0, wxEXPAND | wxALL, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerApply = new wxButton( this, wxID_APPLY );
m_sdbSizer->AddButton( m_sdbSizerApply );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bmainSizer->Add( m_sdbSizer, 0, wxALIGN_RIGHT|wxALL, 5 );
this->SetSizer( bmainSizer );
this->Layout();
bmainSizer->Fit( this );
this->Centre( wxBOTH );
}
DIALOG_COLOR_CONFIG_BASE::~DIALOG_COLOR_CONFIG_BASE()
{
}

View File

@ -1,217 +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_color_config_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">dialog_color_config_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">wxBOTH</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DIALOG_COLOR_CONFIG_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">EESchema Colors</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bmainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_mainBoxSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">protected</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticline</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxLI_HORIZONTAL</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxALL</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">1</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>
</wxFormBuilder_Project>

View File

@ -1,52 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_COLOR_CONFIG_BASE_H__
#define __DIALOG_COLOR_CONFIG_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/sizer.h>
#include <wx/gdicmn.h>
#include <wx/statline.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_COLOR_CONFIG_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_COLOR_CONFIG_BASE : public DIALOG_SHIM
{
private:
protected:
wxBoxSizer* m_mainBoxSizer;
wxStaticLine* m_staticline;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerApply;
wxButton* m_sdbSizerCancel;
public:
DIALOG_COLOR_CONFIG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("EESchema Colors"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_COLOR_CONFIG_BASE();
};
#endif //__DIALOG_COLOR_CONFIG_BASE_H__

View File

@ -31,6 +31,7 @@
#include <dialog_eeschema_options.h> #include <dialog_eeschema_options.h>
#include <widgets/widget_hotkey_list.h> #include <widgets/widget_hotkey_list.h>
#include "../widgets/widget_eeschema_color_config.h"
#include <schframe.h> #include <schframe.h>
#include <hotkeys.h> #include <hotkeys.h>
@ -59,6 +60,10 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( SCH_EDIT_FRAME* parent ) :
m_hotkeyListCtrl = new WIDGET_HOTKEY_LIST( m_panelHotkeys, sections ); m_hotkeyListCtrl = new WIDGET_HOTKEY_LIST( m_panelHotkeys, sections );
m_hotkeyListCtrl->InstallOnPanel( m_panelHotkeys ); m_hotkeyListCtrl->InstallOnPanel( m_panelHotkeys );
// Embed the color configurator
m_colorConfigCtrl = new WIDGET_EESCHEMA_COLOR_CONFIG( m_panelColors, GetParent() );
m_colorConfigCtrl->InstallOnPanel( m_panelColors );
// Make sure we select the first tab of the options tab page // Make sure we select the first tab of the options tab page
m_notebook->SetSelection( 0 ); m_notebook->SetSelection( 0 );
@ -288,6 +293,9 @@ bool DIALOG_EESCHEMA_OPTIONS::TransferDataFromWindow()
if( !m_hotkeyListCtrl->TransferDataFromControl() ) if( !m_hotkeyListCtrl->TransferDataFromControl() )
return false; return false;
if( !m_colorConfigCtrl->TransferDataFromControl() )
return false;
// Refresh hotkeys // Refresh hotkeys
GetParent()->ReCreateMenuBar(); GetParent()->ReCreateMenuBar();
GetParent()->Refresh(); GetParent()->Refresh();

View File

@ -34,13 +34,15 @@
#include <dialog_eeschema_options_base.h> #include <dialog_eeschema_options_base.h>
#include <template_fieldnames.h> #include <template_fieldnames.h>
class WIDGET_EESCHEMA_COLOR_CONFIG;
class WIDGET_HOTKEY_LIST; class WIDGET_HOTKEY_LIST;
class SCH_EDIT_FRAME; class SCH_EDIT_FRAME;
class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE
{ {
protected: protected:
WIDGET_HOTKEY_LIST* m_hotkeyListCtrl; WIDGET_HOTKEY_LIST* m_hotkeyListCtrl;
WIDGET_EESCHEMA_COLOR_CONFIG* m_colorConfigCtrl;
/** @brief The template fieldnames for this dialog */ /** @brief The template fieldnames for this dialog */
TEMPLATE_FIELDNAMES templateFields; TEMPLATE_FIELDNAMES templateFields;

View File

@ -117,7 +117,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_panel5->SetSizer( bSizer82 ); m_panel5->SetSizer( bSizer82 );
m_panel5->Layout(); m_panel5->Layout();
bSizer82->Fit( m_panel5 ); bSizer82->Fit( m_panel5 );
m_notebook->AddPage( m_panel5, _("Display"), true ); m_notebook->AddPage( m_panel5, _("Display"), false );
m_panel3 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panel3 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer8; wxBoxSizer* bSizer8;
bSizer8 = new wxBoxSizer( wxVERTICAL ); bSizer8 = new wxBoxSizer( wxVERTICAL );
@ -233,7 +233,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_panel3->Layout(); m_panel3->Layout();
bSizer8->Fit( m_panel3 ); bSizer8->Fit( m_panel3 );
m_notebook->AddPage( m_panel3, _("Editing"), false ); m_notebook->AddPage( m_panel3, _("Editing"), false );
m_controlsPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_tabControls = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer81; wxBoxSizer* bSizer81;
bSizer81 = new wxBoxSizer( wxVERTICAL ); bSizer81 = new wxBoxSizer( wxVERTICAL );
@ -253,46 +253,58 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
wxBoxSizer* bSizer13; wxBoxSizer* bSizer13;
bSizer13 = new wxBoxSizer( wxHORIZONTAL ); bSizer13 = new wxBoxSizer( wxHORIZONTAL );
m_staticText20 = new wxStaticText( m_controlsPanel, wxID_ANY, _("Hotkeys:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText20 = new wxStaticText( m_tabControls, wxID_ANY, _("Hotkeys:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText20->Wrap( -1 ); m_staticText20->Wrap( -1 );
bSizer13->Add( m_staticText20, 1, wxALL, 5 ); bSizer13->Add( m_staticText20, 1, wxALL, 5 );
m_staticText21 = new wxStaticText( m_controlsPanel, wxID_ANY, _("Double-click to edit"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText21 = new wxStaticText( m_tabControls, wxID_ANY, _("Double-click to edit"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText21->Wrap( -1 ); m_staticText21->Wrap( -1 );
bSizer13->Add( m_staticText21, 0, wxALL, 5 ); bSizer13->Add( m_staticText21, 0, wxALL, 5 );
m_controlsSizer->Add( bSizer13, 0, wxEXPAND, 5 ); m_controlsSizer->Add( bSizer13, 0, wxEXPAND, 5 );
m_panelHotkeys = new wxPanel( m_controlsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelHotkeys = new wxPanel( m_tabControls, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_controlsSizer->Add( m_panelHotkeys, 1, wxEXPAND | wxALL, 5 ); m_controlsSizer->Add( m_panelHotkeys, 1, wxEXPAND | wxALL, 5 );
m_checkEnableZoomCenter = new wxCheckBox( m_controlsPanel, wxID_ANY, _("Cen&ter and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkEnableZoomCenter = new wxCheckBox( m_tabControls, wxID_ANY, _("Cen&ter and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkEnableZoomCenter->SetToolTip( _("Keep the cursor at its current location when zooming") ); m_checkEnableZoomCenter->SetToolTip( _("Keep the cursor at its current location when zooming") );
m_controlsSizer->Add( m_checkEnableZoomCenter, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); m_controlsSizer->Add( m_checkEnableZoomCenter, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkEnableMiddleButtonPan = new wxCheckBox( m_controlsPanel, xwID_ANY, _("&Use middle mouse button to pan"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkEnableMiddleButtonPan = new wxCheckBox( m_tabControls, xwID_ANY, _("&Use middle mouse button to pan"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkEnableMiddleButtonPan->SetToolTip( _("Use middle mouse button dragging to pan") ); m_checkEnableMiddleButtonPan->SetToolTip( _("Use middle mouse button dragging to pan") );
m_controlsSizer->Add( m_checkEnableMiddleButtonPan, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); m_controlsSizer->Add( m_checkEnableMiddleButtonPan, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkMiddleButtonPanLimited = new wxCheckBox( m_controlsPanel, wxID_ANY, _("&Limit panning to scroll size"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkMiddleButtonPanLimited = new wxCheckBox( m_tabControls, wxID_ANY, _("&Limit panning to scroll size"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkMiddleButtonPanLimited->SetToolTip( _("Middle mouse button panning limited by current scrollbar size") ); m_checkMiddleButtonPanLimited->SetToolTip( _("Middle mouse button panning limited by current scrollbar size") );
m_controlsSizer->Add( m_checkMiddleButtonPanLimited, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); m_controlsSizer->Add( m_checkMiddleButtonPanLimited, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkAutoPan = new wxCheckBox( m_controlsPanel, wxID_ANY, _("&Pan while moving object"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkAutoPan = new wxCheckBox( m_tabControls, wxID_ANY, _("&Pan while moving object"), wxDefaultPosition, wxDefaultSize, 0 );
m_controlsSizer->Add( m_checkAutoPan, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 ); m_controlsSizer->Add( m_checkAutoPan, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
bSizer81->Add( m_controlsSizer, 1, wxALL|wxEXPAND, 5 ); bSizer81->Add( m_controlsSizer, 1, wxALL|wxEXPAND, 5 );
m_controlsPanel->SetSizer( bSizer81 ); m_tabControls->SetSizer( bSizer81 );
m_controlsPanel->Layout(); m_tabControls->Layout();
bSizer81->Fit( m_controlsPanel ); bSizer81->Fit( m_tabControls );
m_notebook->AddPage( m_controlsPanel, _("Controls"), false ); m_notebook->AddPage( m_tabControls, _("Controls"), false );
m_tabColors = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer14;
bSizer14 = new wxBoxSizer( wxVERTICAL );
m_panelColors = new wxPanel( m_tabColors, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
bSizer14->Add( m_panelColors, 1, wxEXPAND | wxALL, 5 );
m_tabColors->SetSizer( bSizer14 );
m_tabColors->Layout();
bSizer14->Fit( m_tabColors );
m_notebook->AddPage( m_tabColors, _("Colors"), true );
m_panel2 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panel2 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panel2->SetToolTip( _("User defined field names for schematic components. ") ); m_panel2->SetToolTip( _("User defined field names for schematic components. ") );

View File

@ -187,7 +187,7 @@
<object class="notebookpage" expanded="0"> <object class="notebookpage" expanded="0">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">Display</property> <property name="label">Display</property>
<property name="select">1</property> <property name="select">0</property>
<object class="wxPanel" expanded="0"> <object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
@ -3806,7 +3806,7 @@
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_controlsPanel</property> <property name="name">m_tabControls</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position"></property>
<property name="pane_size"></property> <property name="pane_size"></property>
@ -3845,7 +3845,7 @@
<event name="OnSetFocus"></event> <event name="OnSetFocus"></event>
<event name="OnSize"></event> <event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizer81</property> <property name="name">bSizer81</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
@ -3868,20 +3868,20 @@
<property name="vgap">0</property> <property name="vgap">0</property>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_controlsSizer</property> <property name="name">m_controlsSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizer13</property> <property name="name">bSizer13</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
@ -4054,11 +4054,11 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property> <property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxPanel" expanded="1"> <object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -4491,6 +4491,172 @@
</object> </object>
</object> </object>
</object> </object>
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Colors</property>
<property name="select">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"></property>
<property name="moveable">1</property>
<property name="name">m_tabColors</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 class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer14</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</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"></property>
<property name="moveable">1</property>
<property name="name">m_panelColors</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>
</object>
</object>
<object class="notebookpage" expanded="0"> <object class="notebookpage" expanded="0">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">Default Fields</property> <property name="label">Default Fields</property>

View File

@ -103,7 +103,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
wxCheckBox* m_checkAutoplaceFields; wxCheckBox* m_checkAutoplaceFields;
wxCheckBox* m_checkAutoplaceJustify; wxCheckBox* m_checkAutoplaceJustify;
wxCheckBox* m_checkAutoplaceAlign; wxCheckBox* m_checkAutoplaceAlign;
wxPanel* m_controlsPanel; wxPanel* m_tabControls;
wxBoxSizer* m_controlsSizer; wxBoxSizer* m_controlsSizer;
wxStaticText* m_staticText20; wxStaticText* m_staticText20;
wxStaticText* m_staticText21; wxStaticText* m_staticText21;
@ -112,6 +112,8 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
wxCheckBox* m_checkEnableMiddleButtonPan; wxCheckBox* m_checkEnableMiddleButtonPan;
wxCheckBox* m_checkMiddleButtonPanLimited; wxCheckBox* m_checkMiddleButtonPanLimited;
wxCheckBox* m_checkAutoPan; wxCheckBox* m_checkAutoPan;
wxPanel* m_tabColors;
wxPanel* m_panelColors;
wxPanel* m_panel2; wxPanel* m_panel2;
wxGrid* m_fieldGrid; wxGrid* m_fieldGrid;
wxButton* addFieldButton; wxButton* addFieldButton;

View File

@ -42,7 +42,6 @@
#include <general.h> #include <general.h>
#include <class_libentry.h> #include <class_libentry.h>
#include <hotkeys.h> #include <hotkeys.h>
#include <dialogs/dialog_color_config.h>
#include <transform.h> #include <transform.h>
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>

View File

@ -47,7 +47,6 @@
#include <dialog_hotkeys_editor.h> #include <dialog_hotkeys_editor.h>
#include <dialogs/dialog_color_config.h>
#include <dialogs/dialog_eeschema_options.h> #include <dialogs/dialog_eeschema_options.h>
#include <dialogs/dialog_libedit_options.h> #include <dialogs/dialog_libedit_options.h>
#include <dialogs/dialog_schematic_find.h> #include <dialogs/dialog_schematic_find.h>
@ -157,14 +156,6 @@ void LIB_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
} }
void LIB_EDIT_FRAME::OnColorConfig( wxCommandEvent& aEvent )
{
DIALOG_COLOR_CONFIG dlg( this );
dlg.ShowModal();
}
void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
@ -195,14 +186,6 @@ void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
} }
void SCH_EDIT_FRAME::OnColorConfig( wxCommandEvent& aEvent )
{
DIALOG_COLOR_CONFIG dlg( this );
dlg.ShowModal();
}
void SCH_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event ) void SCH_EDIT_FRAME::InstallConfigFrame( wxCommandEvent& event )
{ {
// Identical to LIB_EDIT_FRAME::InstallConfigFrame() // Identical to LIB_EDIT_FRAME::InstallConfigFrame()

View File

@ -130,10 +130,8 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp ) EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout ) EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
EVT_MENU( ID_COLORS_SETUP, LIB_EDIT_FRAME::OnColorConfig )
EVT_MENU( wxID_PREFERENCES, LIB_EDIT_FRAME::OnPreferencesOptions ) EVT_MENU( wxID_PREFERENCES, LIB_EDIT_FRAME::OnPreferencesOptions )
EVT_MENU( ID_CONFIG_REQ, LIB_EDIT_FRAME::InstallConfigFrame ) EVT_MENU( ID_CONFIG_REQ, LIB_EDIT_FRAME::InstallConfigFrame )
EVT_MENU( ID_COLORS_SETUP, LIB_EDIT_FRAME::Process_Config )
// Multiple item selection context menu commands. // Multiple item selection context menu commands.
EVT_MENU_RANGE( ID_SELECT_ITEM_START, ID_SELECT_ITEM_END, LIB_EDIT_FRAME::OnSelectItem ) EVT_MENU_RANGE( ID_SELECT_ITEM_START, ID_SELECT_ITEM_END, LIB_EDIT_FRAME::OnSelectItem )

View File

@ -193,7 +193,6 @@ public:
static void EnsureActiveLibExists(); static void EnsureActiveLibExists();
void InstallConfigFrame( wxCommandEvent& event ); void InstallConfigFrame( wxCommandEvent& event );
void OnColorConfig( wxCommandEvent& aEvent );
void OnPreferencesOptions( wxCommandEvent& event ); void OnPreferencesOptions( wxCommandEvent& event );
void Process_Config( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event );

View File

@ -375,13 +375,6 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
_( "Configure component libraries and paths" ), _( "Configure component libraries and paths" ),
KiBitmap( library_xpm ) ); KiBitmap( library_xpm ) );
// Colors
AddMenuItem( preferencesMenu,
ID_COLORS_SETUP,
_( "Set &Colors Scheme" ),
_( "Set color preferences" ),
KiBitmap( palette_xpm ) );
// Options (Preferences on WXMAC) // Options (Preferences on WXMAC)
#ifdef __WXMAC__ #ifdef __WXMAC__

View File

@ -238,13 +238,6 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
_( "Set Component Editor default values and options" ), _( "Set Component Editor default values and options" ),
KiBitmap( preference_xpm ) ); KiBitmap( preference_xpm ) );
// Colors
AddMenuItem( preferencesMenu,
ID_COLORS_SETUP,
_( "Set &Colors Scheme" ),
_( "Set color preferences" ),
KiBitmap( palette_xpm ) );
// Language submenu // Language submenu
Pgm().AddMenuLanguageList( preferencesMenu ); Pgm().AddMenuLanguageList( preferencesMenu );

View File

@ -237,7 +237,6 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
SCH_EDIT_FRAME::Process_Config ) SCH_EDIT_FRAME::Process_Config )
EVT_MENU( ID_COLORS_SETUP, SCH_EDIT_FRAME::OnColorConfig )
EVT_TOOL( wxID_PREFERENCES, SCH_EDIT_FRAME::OnPreferencesOptions ) EVT_TOOL( wxID_PREFERENCES, SCH_EDIT_FRAME::OnPreferencesOptions )
EVT_TOOL( ID_RUN_LIBRARY, SCH_EDIT_FRAME::OnOpenLibraryEditor ) EVT_TOOL( ID_RUN_LIBRARY, SCH_EDIT_FRAME::OnOpenLibraryEditor )

View File

@ -266,7 +266,6 @@ public:
void SetPlotDirectoryName( const wxString& aDirName ) { m_plotDirectoryName = aDirName; } void SetPlotDirectoryName( const wxString& aDirName ) { m_plotDirectoryName = aDirName; }
void Process_Special_Functions( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event );
void OnColorConfig( wxCommandEvent& aEvent );
void Process_Config( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event );
void OnSelectTool( wxCommandEvent& aEvent ); void OnSelectTool( wxCommandEvent& aEvent );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors. * Copyright (C) 2016 KiCad Developers, see CHANGELOG.TXT for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -31,10 +31,7 @@
#include <general.h> #include <general.h>
#include <dialog_color_config.h> #include "widget_eeschema_color_config.h"
#define ID_COLOR_SETUP 1800
// Specify the width and height of every (color-displaying / bitmap) button // Specify the width and height of every (color-displaying / bitmap) button
const int BUTT_SIZE_X = 16; const int BUTT_SIZE_X = 16;
@ -110,21 +107,21 @@ static BUTTONINDEX buttonGroups[] = {
static EDA_COLOR_T currentColors[ LAYERSCH_ID_COUNT ]; static EDA_COLOR_T currentColors[ LAYERSCH_ID_COUNT ];
DIALOG_COLOR_CONFIG::DIALOG_COLOR_CONFIG( EDA_DRAW_FRAME* aParent ) : WIDGET_EESCHEMA_COLOR_CONFIG::WIDGET_EESCHEMA_COLOR_CONFIG( wxWindow* aParent, EDA_DRAW_FRAME* aDrawFrame ) :
DIALOG_COLOR_CONFIG_BASE( aParent ) wxPanel( aParent ), m_drawFrame( aDrawFrame )
{ {
m_parent = aParent;
CreateControls(); CreateControls();
GetSizer()->SetSizeHints( this );
} }
void DIALOG_COLOR_CONFIG::CreateControls() void WIDGET_EESCHEMA_COLOR_CONFIG::CreateControls()
{ {
wxStaticText* label; wxStaticText* label;
int buttonId = 1800; int buttonId = 1800;
m_mainBoxSizer = new wxBoxSizer( wxHORIZONTAL );
SetSizer( m_mainBoxSizer );
BUTTONINDEX* groups = buttonGroups; BUTTONINDEX* groups = buttonGroups;
wxBoxSizer* columnBoxSizer = NULL; wxBoxSizer* columnBoxSizer = NULL;
@ -185,7 +182,7 @@ void DIALOG_COLOR_CONFIG::CreateControls()
} }
Connect( 1800, buttonId - 1, wxEVT_COMMAND_BUTTON_CLICKED, Connect( 1800, buttonId - 1, wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler( DIALOG_COLOR_CONFIG::SetColor ) ); wxCommandEventHandler( WIDGET_EESCHEMA_COLOR_CONFIG::SetColor ) );
wxArrayString selBgColorStrings; wxArrayString selBgColorStrings;
selBgColorStrings.Add( _( "White" ) ); selBgColorStrings.Add( _( "White" ) );
@ -193,7 +190,7 @@ void DIALOG_COLOR_CONFIG::CreateControls()
m_SelBgColor = new wxRadioBox( this, wxID_ANY, _( "Background Color" ), m_SelBgColor = new wxRadioBox( this, wxID_ANY, _( "Background Color" ),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
selBgColorStrings, 1, wxRA_SPECIFY_COLS ); selBgColorStrings, 1, wxRA_SPECIFY_COLS );
m_SelBgColor->SetSelection( ( m_parent->GetDrawBgColor() == BLACK ) ? 1 : 0 ); m_SelBgColor->SetSelection( ( GetDrawFrame()->GetDrawBgColor() == BLACK ) ? 1 : 0 );
if( columnBoxSizer ) if( columnBoxSizer )
{ {
@ -202,13 +199,13 @@ void DIALOG_COLOR_CONFIG::CreateControls()
columnBoxSizer->Add( m_SelBgColor, 1, wxGROW | wxRIGHT | wxTOP | wxBOTTOM, 5 ); columnBoxSizer->Add( m_SelBgColor, 1, wxGROW | wxRIGHT | wxTOP | wxBOTTOM, 5 );
} }
currentColors[ LAYER_BACKGROUND ] = m_parent->GetDrawBgColor(); currentColors[ LAYER_BACKGROUND ] = GetDrawFrame()->GetDrawBgColor();
// Dialog now needs to be resized, but the associated command is found elsewhere. // Dialog now needs to be resized, but the associated command is found elsewhere.
} }
void DIALOG_COLOR_CONFIG::SetColor( wxCommandEvent& event ) void WIDGET_EESCHEMA_COLOR_CONFIG::SetColor( wxCommandEvent& event )
{ {
wxBitmapButton* button = (wxBitmapButton*) event.GetEventObject(); wxBitmapButton* button = (wxBitmapButton*) event.GetEventObject();
@ -246,7 +243,7 @@ void DIALOG_COLOR_CONFIG::SetColor( wxCommandEvent& event )
} }
bool DIALOG_COLOR_CONFIG::TransferDataFromWindow() bool WIDGET_EESCHEMA_COLOR_CONFIG::TransferDataFromControl()
{ {
bool warning = false; bool warning = false;
@ -280,7 +277,7 @@ bool DIALOG_COLOR_CONFIG::TransferDataFromWindow()
} }
// Update color of background // Update color of background
m_parent->SetDrawBgColor( bgcolor ); GetDrawFrame()->SetDrawBgColor( bgcolor );
currentColors[ LAYER_BACKGROUND ] = bgcolor; currentColors[ LAYER_BACKGROUND ] = bgcolor;
@ -289,8 +286,17 @@ bool DIALOG_COLOR_CONFIG::TransferDataFromWindow()
SetLayerColor( currentColors[ clyr ], clyr ); SetLayerColor( currentColors[ clyr ], clyr );
} }
m_parent->SetGridColor( GetLayerColor( LAYER_GRID ) ); GetDrawFrame()->SetGridColor( GetLayerColor( LAYER_GRID ) );
m_parent->GetCanvas()->Refresh(); GetDrawFrame()->GetCanvas()->Refresh();
return true; return true;
} }
void WIDGET_EESCHEMA_COLOR_CONFIG::InstallOnPanel( wxPanel* aPanel )
{
wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
sizer->Add( this, 1, wxALL | wxEXPAND, 0 );
aPanel->SetSizer( sizer );
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2007 G. Harland * Copyright (C) 2007 G. Harland
* Copyright (C) 1992-2015 KiCad Developers, see CHANGELOG.TXT for contributors. * Copyright (C) 1992-2016 KiCad Developers, see CHANGELOG.TXT for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -22,11 +22,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef DIALOG_COLOR_CONFIG_H_ #ifndef WIDGET_EESCHEMA_COLOR_CONFIG_H_
#define DIALOG_COLOR_CONFIG_H_ #define WIDGET_EESCHEMA_COLOR_CONFIG_H_
#include <dialog_color_config_base.h>
#include <wx/panel.h>
#include <wx/sizer.h>
class wxBoxSizer; class wxBoxSizer;
class wxStaticLine; class wxStaticLine;
@ -37,22 +37,33 @@ class wxStdDialogButtonSizer;
/* Derived class for the frame color settings. */ /* Derived class for the frame color settings. */
/***********************************************/ /***********************************************/
class DIALOG_COLOR_CONFIG : public DIALOG_COLOR_CONFIG_BASE class WIDGET_EESCHEMA_COLOR_CONFIG : public wxPanel
{ {
private: private:
EDA_DRAW_FRAME* m_parent; EDA_DRAW_FRAME* m_drawFrame;
wxRadioBox* m_SelBgColor; wxRadioBox* m_SelBgColor;
wxBoxSizer* m_mainBoxSizer;
// Creates the controls and sizers // Creates the controls and sizers
void CreateControls(); void CreateControls();
void SetColor( wxCommandEvent& aEvent ); void SetColor( wxCommandEvent& aEvent );
virtual EDA_DRAW_FRAME* GetDrawFrame() { return m_drawFrame; }
public: public:
// Constructors and destructor // Constructors and destructor
DIALOG_COLOR_CONFIG( EDA_DRAW_FRAME* aParent ); WIDGET_EESCHEMA_COLOR_CONFIG( wxWindow* aParent, EDA_DRAW_FRAME* aDrawFrame );
bool TransferDataFromWindow(); bool TransferDataFromControl();
/**
* Method InstallOnPanel
* Install this WIDGET_EESCHEMA_COLOR_CONFIG onto an empty panel. This is useful
* when combining with wxFormBuilder, as an empty panel can be left as a
* placeholder in the layout.
*/
void InstallOnPanel( wxPanel* aPanel );
}; };
#endif // DIALOG_COLOR_CONFIG_H_ #endif // WIDGET_EESCHEMA_COLOR_CONFIG_H_

View File

@ -124,8 +124,6 @@ enum main_id
ID_NO_TOOL_SELECTED, ID_NO_TOOL_SELECTED,
ID_SEL_BG_COLOR, ID_SEL_BG_COLOR,
ID_COLORS_SETUP,
ID_REPEAT_BUTT, ID_REPEAT_BUTT,
ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE,