From f0dc54340dcd8e424b4344178106a17aec624729 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 11 Apr 2012 20:54:20 +0200 Subject: [PATCH] All: new middle mouse pan feature, from lajos kamocsay (and jp charras for some enhancements). If enable in preference menu, allow the pan with drag mouse with middle button down. both unlimited and limited pan is allowed. --- common/drawpanel.cpp | 139 +- cvpcb/dialogs/dialog_display_options.cpp | 5 + cvpcb/dialogs/dialog_display_options.h | 49 +- cvpcb/dialogs/dialog_display_options_base.cpp | 47 +- cvpcb/dialogs/dialog_display_options_base.fbp | 706 ++- cvpcb/dialogs/dialog_display_options_base.h | 25 +- eeschema/dialogs/dialog_eeschema_options.h | 26 + .../dialogs/dialog_eeschema_options_base.cpp | 20 +- .../dialogs/dialog_eeschema_options_base.fbp | 1910 +++++++- .../dialogs/dialog_eeschema_options_base.h | 21 +- eeschema/eeschema_config.cpp | 4 + .../gerbview_dialog_display_options_frame.cpp | 13 + ...view_dialog_display_options_frame_base.cpp | 27 +- ...view_dialog_display_options_frame_base.fbp | 622 ++- ...rbview_dialog_display_options_frame_base.h | 23 +- include/class_drawpanel.h | 15 + pcbnew/dialogs/dialog_general_options.cpp | 19 +- pcbnew/dialogs/dialog_general_options.h | 12 +- ...ialog_general_options_BoardEditor_base.cpp | 78 +- ...ialog_general_options_BoardEditor_base.fbp | 3891 +++++++++-------- .../dialog_general_options_BoardEditor_base.h | 27 +- pcbnew/pcbnew_config.cpp | 2 +- 22 files changed, 5385 insertions(+), 2296 deletions(-) diff --git a/common/drawpanel.cpp b/common/drawpanel.cpp index c222e18d20..dab3732318 100644 --- a/common/drawpanel.cpp +++ b/common/drawpanel.cpp @@ -43,6 +43,11 @@ #define CLIP_BOX_PADDING 2 +// keys to store options in config: +#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. */ @@ -96,6 +101,8 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id, m_ClipBox.SetY( 0 ); m_canStartBlock = -1; // Command block can start if >= 0 m_abortRequest = false; + m_enableMiddleButtonPan = false; + m_panScrollbarLimits = false; m_enableAutoPan = true; m_ignoreMouseEvents = false; @@ -103,7 +110,11 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id, m_endMouseCaptureCallback = NULL; if( wxGetApp().GetSettings() ) - wxGetApp().GetSettings()->Read( wxT( "AutoPAN" ), &m_enableAutoPan, true ); + { + wxGetApp().GetSettings()->Read( ENBL_MIDDLE_BUTT_PAN_KEY, &m_enableMiddleButtonPan, false ); + wxGetApp().GetSettings()->Read( MIDDLE_BUTT_PAN_LIMITED_KEY, &m_panScrollbarLimits, false ); + wxGetApp().GetSettings()->Read( ENBL_AUTO_PAN_KEY, &m_enableAutoPan, true ); + } m_requestAutoPan = false; m_enableBlockCommands = false; @@ -123,10 +134,11 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id, EDA_DRAW_PANEL::~EDA_DRAW_PANEL() { - wxGetApp().GetSettings()->Write( wxT( "AutoPAN" ), m_enableAutoPan ); + wxGetApp().GetSettings()->Write( ENBL_MIDDLE_BUTT_PAN_KEY, m_enableMiddleButtonPan ); + wxGetApp().GetSettings()->Write( MIDDLE_BUTT_PAN_LIMITED_KEY, m_panScrollbarLimits ); + wxGetApp().GetSettings()->Write( ENBL_AUTO_PAN_KEY, m_enableAutoPan ); } - EDA_DRAW_FRAME* EDA_DRAW_PANEL::GetParent() { return ( EDA_DRAW_FRAME* ) wxWindow::GetParent(); @@ -317,18 +329,24 @@ void EDA_DRAW_PANEL::OnScroll( wxScrollWinEvent& event ) int dir; int x, y; int ppux, ppuy; + int csizeX, csizeY; int unitsX, unitsY; int maxX, maxY; GetViewStart( &x, &y ); GetScrollPixelsPerUnit( &ppux, &ppuy ); + GetClientSize( &csizeX, &csizeY ); GetVirtualSize( &unitsX, &unitsY ); - maxX = unitsX; - maxY = unitsY; + + csizeX /= ppux; + csizeY /= ppuy; unitsX /= ppux; unitsY /= ppuy; + maxX = unitsX - csizeX; + maxY = unitsY - csizeY; + dir = event.GetOrientation(); // wxHORIZONTAL or wxVERTICAL if( id == wxEVT_SCROLLWIN_LINEUP ) @@ -381,7 +399,7 @@ void EDA_DRAW_PANEL::OnScroll( wxScrollWinEvent& event ) wxT( "Setting scroll bars ppuX=%d, ppuY=%d, unitsX=%d, unitsY=%d, posX=%d, posY=%d" ), ppux, ppuy, unitsX, unitsY, x, y ); - Scroll( x/ppux, y/ppuy ); + Scroll( x, y ); event.Skip(); } @@ -958,8 +976,104 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) ignoreNextLeftButtonRelease = false; } - if( event.ButtonUp( wxMOUSE_BTN_MIDDLE ) - && (screen->m_BlockLocate.GetState() == STATE_NO_BLOCK) ) + if( event.ButtonDown( wxMOUSE_BTN_MIDDLE ) && m_enableMiddleButtonPan ) + { + if( m_panScrollbarLimits ) + { + int ppux, ppuy; + GetScrollPixelsPerUnit( &ppux, &ppuy ); + GetViewStart( &m_PanStartCenter.x, &m_PanStartCenter.y ); + m_PanStartCenter.x *= ppux; + m_PanStartCenter.y *= ppuy; + } + else + m_PanStartCenter = GetParent()->GetScreen()->GetScrollCenterPosition(); + + m_PanStartEventPosition = event.GetPosition(); + + INSTALL_UNBUFFERED_DC( dc, this ); + CrossHairOff( &dc ); + } + + if( event.ButtonUp( wxMOUSE_BTN_MIDDLE ) && m_enableMiddleButtonPan ) + { + INSTALL_UNBUFFERED_DC( dc, this ); + CrossHairOn( &dc ); + } + + if( event.MiddleIsDown() && m_enableMiddleButtonPan ) + { + wxPoint currentPosition = event.GetPosition(); + if( m_panScrollbarLimits ) + { + int x, y; + int ppux, ppuy; + int maxX, maxY; + int vsizeX, vsizeY; + int csizeX, csizeY; + + GetScrollPixelsPerUnit( &ppux, &ppuy ); + GetVirtualSize( &vsizeX, &vsizeY ); + GetClientSize( &csizeX, &csizeY ); + + maxX = vsizeX - csizeX; + maxY = vsizeY - csizeY; + + x = m_PanStartCenter.x + m_PanStartEventPosition.x - currentPosition.x; + y = m_PanStartCenter.y + m_PanStartEventPosition.y - currentPosition.y; + + bool shouldMoveCursor = false; + + if( x < 0 ) + { + currentPosition.x += x; + x = 0; + shouldMoveCursor = true; + } + + if( y < 0 ) + { + currentPosition.y += y; + y = 0; + shouldMoveCursor = true; + } + + if( x > maxX ) + { + currentPosition.x += ( x - maxX ); + x = maxX; + shouldMoveCursor = true; + } + + if( y > maxY ) + { + currentPosition.y += ( y - maxY ); + y = maxY; + shouldMoveCursor = true; + } + + if ( shouldMoveCursor ) + WarpPointer( currentPosition.x, currentPosition.y ); + + Scroll( x/ppux, y/ppuy ); + + Refresh(); + Update(); + } + else + { + double scale = GetParent()->GetScreen()->GetScalingFactor(); + int x = m_PanStartCenter.x + + wxRound( (double) ( m_PanStartEventPosition.x - currentPosition.x ) / scale ); + int y = m_PanStartCenter.y + + wxRound( (double) ( m_PanStartEventPosition.y - currentPosition.y ) / scale ); + + GetParent()->RedrawScreen( wxPoint( x, y ), false ); + } + } + + if( event.ButtonUp( wxMOUSE_BTN_MIDDLE ) && !m_enableMiddleButtonPan && + (screen->m_BlockLocate.GetState() == STATE_NO_BLOCK) ) { // The middle button has been released, with no block command: // We use it for a zoom center at cursor position command @@ -1010,7 +1124,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) screen->m_BlockLocate.SetOrigin( m_CursorStartPos ); } - if( event.LeftDown() || event.MiddleDown() ) + if( event.LeftDown() || ( !m_enableMiddleButtonPan && event.MiddleDown() ) ) { if( screen->m_BlockLocate.GetState() == STATE_BLOCK_MOVE ) { @@ -1020,7 +1134,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) } } else if( ( m_canStartBlock >= 0 ) - && ( event.LeftIsDown() || event.MiddleIsDown() ) + && ( event.LeftIsDown() || ( !m_enableMiddleButtonPan && event.MiddleIsDown() ) ) && !IsMouseCaptured() ) { // Mouse is dragging: if no block in progress, start a block command. @@ -1029,7 +1143,7 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) // Start a block command int cmd_type = kbstat; - if( event.MiddleIsDown() ) + if( !m_enableMiddleButtonPan && event.MiddleIsDown() ) cmd_type |= MOUSE_MIDDLE; /* A block command is started if the drag is enough. A small @@ -1055,7 +1169,8 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) } } - if( event.ButtonUp( wxMOUSE_BTN_LEFT ) || event.ButtonUp( wxMOUSE_BTN_MIDDLE ) ) + if( event.ButtonUp( wxMOUSE_BTN_LEFT ) || + ( !m_enableMiddleButtonPan && event.ButtonUp( wxMOUSE_BTN_MIDDLE ) ) ) { /* Release the mouse button: end of block. * The command can finish (DELETE) or have a next command (MOVE, diff --git a/cvpcb/dialogs/dialog_display_options.cpp b/cvpcb/dialogs/dialog_display_options.cpp index 468aaced11..2140fd0073 100644 --- a/cvpcb/dialogs/dialog_display_options.cpp +++ b/cvpcb/dialogs/dialog_display_options.cpp @@ -54,6 +54,9 @@ void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::initDialog() m_TextDisplayOption->SetSelection( m_Parent->m_DisplayModText ); m_IsShowPadFill->SetValue( m_Parent->m_DisplayPadFill ); m_IsShowPadNum->SetValue( m_Parent->m_DisplayPadNum ); + m_IsMiddleButtonPan->SetValue( m_Parent->GetCanvas()->GetEnableMiddleButtonPan() ); + m_IsMiddleButtonPanLimited->SetValue( m_Parent->GetCanvas()->GetMiddleButtonPanLimited() ); + m_IsMiddleButtonPanLimited->Enable( m_IsMiddleButtonPan->GetValue() ); } @@ -68,6 +71,8 @@ void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::UpdateObjectSettings( void ) m_Parent->m_DisplayModText = m_TextDisplayOption->GetSelection(); m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue(); m_Parent->m_DisplayPadFill = m_IsShowPadFill->GetValue(); + m_Parent->GetCanvas()->SetEnableMiddleButtonPan( m_IsMiddleButtonPan->GetValue() ); + m_Parent->GetCanvas()->SetMiddleButtonPanLimited( m_IsMiddleButtonPanLimited->GetValue() ); m_Parent->GetCanvas()->Refresh(); } diff --git a/cvpcb/dialogs/dialog_display_options.h b/cvpcb/dialogs/dialog_display_options.h index 84f11f3564..3b63d7c849 100644 --- a/cvpcb/dialogs/dialog_display_options.h +++ b/cvpcb/dialogs/dialog_display_options.h @@ -1,18 +1,39 @@ -//////////////////////////////////////////// -// Name: dialog_display_options.h -// Licence: GPL -//////////////////////////////////////////// +/** + * @file dialog_display_options.h + */ #ifndef _DIALOG_DISPLAY_OPTIONS_H_ #define _DIALOG_DISPLAY_OPTIONS_H_ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 1992-2012 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 -//////////////////////////////////////////// -/// Class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS -// derived from DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE, -// created by wxformBuilder -//////////////////////////////////////////// +/* Class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS + * derived from DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE, + * created by wxformBuilder +*/ class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS : public DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE @@ -28,9 +49,13 @@ public: private: void initDialog( ); void UpdateObjectSettings( void ); - virtual void OnApplyClick( wxCommandEvent& event ); - virtual void OnCancelClick( wxCommandEvent& event ); - virtual void OnOkClick( wxCommandEvent& event ); + void OnApplyClick( wxCommandEvent& event ); + void OnCancelClick( wxCommandEvent& event ); + void OnOkClick( wxCommandEvent& event ); + void OnMiddleBtnPanEnbl( wxCommandEvent& event ) + { + m_IsMiddleButtonPanLimited->Enable( m_IsMiddleButtonPan->GetValue() ); + } }; #endif // _DIALOG_DISPLAY_OPTIONS_H_ diff --git a/cvpcb/dialogs/dialog_display_options_base.cpp b/cvpcb/dialogs/dialog_display_options_base.cpp index 1cff3e15d6..ce5dc7c283 100644 --- a/cvpcb/dialogs/dialog_display_options_base.cpp +++ b/cvpcb/dialogs/dialog_display_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -19,30 +19,54 @@ DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( wxBoxSizer* bUpperSizer; bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizerLeft; + bSizerLeft = new wxBoxSizer( wxVERTICAL ); + wxString m_EdgesDisplayOptionChoices[] = { _("Line"), _("Filled"), _("Sketch") }; int m_EdgesDisplayOptionNChoices = sizeof( m_EdgesDisplayOptionChoices ) / sizeof( wxString ); m_EdgesDisplayOption = new wxRadioBox( this, ID_EDGE_SELECT, _("Edges:"), wxDefaultPosition, wxDefaultSize, m_EdgesDisplayOptionNChoices, m_EdgesDisplayOptionChoices, 1, wxRA_SPECIFY_COLS ); m_EdgesDisplayOption->SetSelection( 0 ); - bUpperSizer->Add( m_EdgesDisplayOption, 1, wxALL|wxEXPAND, 5 ); + bSizerLeft->Add( m_EdgesDisplayOption, 1, wxALL|wxEXPAND, 5 ); wxString m_TextDisplayOptionChoices[] = { _("Line"), _("Filled"), _("Sketch") }; int m_TextDisplayOptionNChoices = sizeof( m_TextDisplayOptionChoices ) / sizeof( wxString ); m_TextDisplayOption = new wxRadioBox( this, ID_TEXT_SELECT, _("Texts:"), wxDefaultPosition, wxDefaultSize, m_TextDisplayOptionNChoices, m_TextDisplayOptionChoices, 1, wxRA_SPECIFY_COLS ); m_TextDisplayOption->SetSelection( 0 ); - bUpperSizer->Add( m_TextDisplayOption, 1, wxALL|wxEXPAND, 5 ); + bSizerLeft->Add( m_TextDisplayOption, 1, wxALL|wxEXPAND, 5 ); - wxStaticBoxSizer* sbSizer1; - sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pads:") ), wxVERTICAL ); + + bUpperSizer->Add( bSizerLeft, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizerRight; + bSizerRight = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizerPads; + sbSizerPads = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pads:") ), wxVERTICAL ); m_IsShowPadFill = new wxCheckBox( this, ID_PADFILL_OPT, _("Fill &pad"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbSizer1->Add( m_IsShowPadFill, 0, wxALL|wxEXPAND, 5 ); + sbSizerPads->Add( m_IsShowPadFill, 0, wxALL|wxEXPAND, 5 ); m_IsShowPadNum = new wxCheckBox( this, wxID_ANY, _("Show pad &number"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerPads->Add( m_IsShowPadNum, 0, wxALL|wxEXPAND, 5 ); - sbSizer1->Add( m_IsShowPadNum, 0, wxALL|wxEXPAND, 5 ); - bUpperSizer->Add( sbSizer1, 1, wxEXPAND|wxALL, 5 ); + bSizerRight->Add( sbSizerPads, 1, wxEXPAND|wxALL, 5 ); + + wxStaticBoxSizer* sbSizerViewOpt; + sbSizerViewOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("View:") ), wxVERTICAL ); + + m_IsMiddleButtonPan = new wxCheckBox( this, wxID_ANY, _("Middle Button PAN Enabled"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerViewOpt->Add( m_IsMiddleButtonPan, 0, wxALL|wxEXPAND, 5 ); + + m_IsMiddleButtonPanLimited = new wxCheckBox( this, wxID_ANY, _("Middle Button PAN Limited"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerViewOpt->Add( m_IsMiddleButtonPanLimited, 0, wxALL, 5 ); + + + bSizerRight->Add( sbSizerViewOpt, 1, wxALL|wxEXPAND, 5 ); + + + bUpperSizer->Add( bSizerRight, 1, wxEXPAND, 5 ); + bSizerMain->Add( bUpperSizer, 1, wxEXPAND, 5 ); @@ -57,12 +81,15 @@ DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); + bSizerMain->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 ); + this->SetSizer( bSizerMain ); this->Layout(); // Connect Events + m_IsMiddleButtonPan->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnMiddleBtnPanEnbl ), NULL, this ); m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnApplyClick ), NULL, this ); m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnCancelClick ), NULL, this ); m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnOkClick ), NULL, this ); @@ -71,7 +98,9 @@ DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE() { // Disconnect Events + m_IsMiddleButtonPan->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnMiddleBtnPanEnbl ), NULL, this ); m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnApplyClick ), NULL, this ); m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnCancelClick ), NULL, this ); m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE::OnOkClick ), NULL, this ); + } diff --git a/cvpcb/dialogs/dialog_display_options_base.fbp b/cvpcb/dialogs/dialog_display_options_base.fbp index f386ea182e..28c2d13af8 100644 --- a/cvpcb/dialogs/dialog_display_options_base.fbp +++ b/cvpcb/dialogs/dialog_display_options_base.fbp @@ -1,10 +1,14 @@ - + C++ 1 + source_name + 0 + 0 + res UTF-8 connect dialog_display_options_base @@ -16,32 +20,78 @@ . 1 + 1 + 1 0 0 + 1 + 1 + 1 + 1 + + 0 + + + + + + 1 + 0 + 1 + 1 + 0 + Dock + 0 + Left 1 + impl_virtual + 1 + 0 0 wxID_ANY + + 0 + + 0 + 1 DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE + 1 + + + 1 - 331,164 + Resizable + 1 + 362,251 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER Display Options + 0 + + wxFILTER_NONE + wxDefaultValidator + + + + + + + @@ -86,152 +136,78 @@ none 5 - wxALL|wxEXPAND + wxEXPAND 1 - - - "Line" "Filled" "Sketch" - - 1 - - - 0 - ID_EDGE_SELECT - Edges: - 1 - + - m_EdgesDisplayOption - protected - - 0 - - wxRA_SPECIFY_COLS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 1 - - - "Line" "Filled" "Sketch" - - 1 - - - 0 - ID_TEXT_SELECT - Texts: - 1 - - - m_TextDisplayOption - protected - - 0 - - wxRA_SPECIFY_COLS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxALL - 1 - - wxID_ANY - Pads: - - sbSizer1 + bSizerLeft wxVERTICAL none - 5 wxALL|wxEXPAND - 0 - + 1 + + 1 + 1 + 1 + 1 + + + + + - 0 + + 1 + 0 + "Line" "Filled" "Sketch" + 1 + 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 - ID_PADFILL_OPT - Fill &pad + ID_EDGE_SELECT + Edges: + 1 + + 0 + + 0 - m_IsShowPadFill + 1 + m_EdgesDisplayOption + 1 + + protected + 1 + Resizable + 0 + 1 - + wxRA_SPECIFY_COLS + 0 + + wxFILTER_NONE + wxDefaultValidator + - @@ -248,6 +224,7 @@ + @@ -259,31 +236,68 @@ 5 wxALL|wxEXPAND - 0 - + 1 + + 1 + 1 + 1 + 1 + + + + + - 0 + + 1 + 0 + "Line" "Filled" "Sketch" + 1 + 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 - wxID_ANY - Show pad &number + ID_TEXT_SELECT + Texts: + 1 + + 0 + + 0 - m_IsShowPadNum + 1 + m_TextDisplayOption + 1 + + protected + 1 + Resizable + 0 + 1 - + wxRA_SPECIFY_COLS + 0 + + wxFILTER_NONE + wxDefaultValidator + - @@ -300,6 +314,7 @@ + @@ -310,6 +325,397 @@ + + 5 + wxEXPAND + 1 + + + bSizerRight + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 1 + + wxID_ANY + Pads: + + sbSizerPads + wxVERTICAL + none + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_PADFILL_OPT + Fill &pad + + 0 + + + 0 + + 1 + m_IsShowPadFill + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show pad &number + + 0 + + + 0 + + 1 + m_IsShowPadNum + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + wxID_ANY + Pan: + + sbSizerViewOpt + wxVERTICAL + none + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Middle Button PAN Enabled + + 0 + + + 0 + + 1 + m_IsMiddleButtonPan + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnMiddleBtnPanEnbl + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Middle Button PAN Limited + + 0 + + + 0 + + 1 + m_IsMiddleButtonPanLimited + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -317,22 +723,58 @@ wxEXPAND | wxALL 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 + 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 + + 0 + 1 m_staticline1 + 1 + + protected + 1 + Resizable + 1 wxLI_HORIZONTAL + 0 + + wxFILTER_NONE + wxDefaultValidator + diff --git a/cvpcb/dialogs/dialog_display_options_base.h b/cvpcb/dialogs/dialog_display_options_base.h index b1d5b33f55..4ad10bbd32 100644 --- a/cvpcb/dialogs/dialog_display_options_base.h +++ b/cvpcb/dialogs/dialog_display_options_base.h @@ -1,23 +1,24 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __dialog_display_options_base__ -#define __dialog_display_options_base__ +#ifndef __DIALOG_DISPLAY_OPTIONS_BASE_H__ +#define __DIALOG_DISPLAY_OPTIONS_BASE_H__ +#include +#include #include - #include #include #include #include #include #include -#include #include +#include #include #include #include @@ -41,6 +42,8 @@ class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE : public wxDialog wxRadioBox* m_TextDisplayOption; wxCheckBox* m_IsShowPadFill; wxCheckBox* m_IsShowPadNum; + wxCheckBox* m_IsMiddleButtonPan; + wxCheckBox* m_IsMiddleButtonPanLimited; wxStaticLine* m_staticline1; wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; @@ -48,15 +51,17 @@ class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE : public wxDialog wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class - virtual void OnApplyClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); } + virtual void OnApplyClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } public: - DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 331,164 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 362,251 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE(); }; -#endif //__dialog_display_options_base__ +#endif //__DIALOG_DISPLAY_OPTIONS_BASE_H__ diff --git a/eeschema/dialogs/dialog_eeschema_options.h b/eeschema/dialogs/dialog_eeschema_options.h index 7585ff79ff..686cbba050 100644 --- a/eeschema/dialogs/dialog_eeschema_options.h +++ b/eeschema/dialogs/dialog_eeschema_options.h @@ -96,6 +96,26 @@ public: return m_checkShowHiddenPins->GetValue(); } + void SetEnableMiddleButtonPan( bool enable ) + { + m_checkEnableMiddleButtonPan->SetValue( enable ); + m_checkMiddleButtonPanLimited->Enable( enable ); + } + + bool GetEnableMiddleButtonPan( void ) + { + return m_checkEnableMiddleButtonPan->GetValue(); + } + + void SetMiddleButtonPanLimited( bool enable ) + { + m_checkMiddleButtonPanLimited->SetValue( enable ); + } + bool GetMiddleButtonPanLimited( void ) + { + return m_checkEnableMiddleButtonPan->GetValue(); + } + void SetEnableAutoPan( bool enable ) { m_checkAutoPan->SetValue( enable ); @@ -126,6 +146,12 @@ public: /** Get the field \a aNdx name from the fields textctrl */ wxString GetFieldName( int aNdx ); + +private: + void OnMiddleBtnPanEnbl( wxCommandEvent& event ) + { + m_checkMiddleButtonPanLimited->Enable( GetEnableMiddleButtonPan() ); + } }; #endif // __dialog_eeschema_options__ diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp index 04f2ece650..025fd1a605 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.cpp +++ b/eeschema/dialogs/dialog_eeschema_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,7 @@ BEGIN_EVENT_TABLE( DIALOG_EESCHEMA_OPTIONS_BASE, wxDialog ) EVT_CHOICE( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnChooseUnits ) + EVT_CHECKBOX( xwID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnMiddleBtnPanEnbl ) END_EVENT_TABLE() DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) @@ -131,6 +132,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_staticText23->Wrap( -1 ); fgSizer1->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); + bSizer3->Add( fgSizer1, 0, wxALIGN_CENTER|wxEXPAND, 0 ); wxBoxSizer* bSizer2; @@ -142,6 +144,12 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_checkShowHiddenPins = new wxCheckBox( m_panel1, wxID_ANY, _("Show hi&dden pins"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_checkShowHiddenPins, 0, wxALL|wxEXPAND, 3 ); + m_checkEnableMiddleButtonPan = new wxCheckBox( m_panel1, xwID_ANY, _("Enable middle mouse button panning"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer2->Add( m_checkEnableMiddleButtonPan, 0, wxALL, 3 ); + + m_checkMiddleButtonPanLimited = new wxCheckBox( m_panel1, wxID_ANY, _("Middle mouse button panning limited by current toolbar panning"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer2->Add( m_checkMiddleButtonPanLimited, 0, wxALL, 3 ); + m_checkAutoPan = new wxCheckBox( m_panel1, wxID_ANY, _("Enable automatic &panning"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_checkAutoPan, 0, wxALL|wxEXPAND, 3 ); @@ -151,13 +159,16 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_checkPageLimits = new wxCheckBox( m_panel1, wxID_ANY, _("Show p&age limits"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_checkPageLimits, 0, wxALL|wxEXPAND, 3 ); + bSizer3->Add( bSizer2, 0, wxEXPAND, 0 ); bSizer3->Add( 0, 0, 1, wxALL|wxEXPAND, 10 ); + p1mainSizer->Add( bSizer3, 1, wxALL|wxEXPAND, 12 ); + m_panel1->SetSizer( p1mainSizer ); m_panel1->Layout(); p1mainSizer->Fit( m_panel1 ); @@ -175,6 +186,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_staticText211->Wrap( 400 ); bSizer8->Add( m_staticText211, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + bSizer6->Add( bSizer8, 0, wxEXPAND, 5 ); wxBoxSizer* bSizer7; @@ -242,10 +254,13 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_fieldName8 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgSizer2->Add( m_fieldName8, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); + bSizer7->Add( fgSizer2, 1, wxALIGN_CENTER|wxEXPAND, 5 ); + bSizer6->Add( bSizer7, 1, wxALL|wxEXPAND, 12 ); + m_panel2->SetSizer( bSizer6 ); m_panel2->Layout(); bSizer6->Fit( m_panel2 ); @@ -259,10 +274,13 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); + bOptionsSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 12 ); + mainSizer->Add( bOptionsSizer, 1, 0, 12 ); + this->SetSizer( mainSizer ); this->Layout(); mainSizer->Fit( this ); diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp index c1d27f49f9..ca9fb73e2f 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.fbp +++ b/eeschema/dialogs/dialog_eeschema_options_base.fbp @@ -1,12 +1,14 @@ - + C++ 1 source_name + 0 0 + res UTF-8 table dialog_eeschema_options_base @@ -18,29 +20,62 @@ . 1 + 1 1 1 0 + 1 + 1 + 1 + 1 + + 0 + + + + + + 1 wxBOTH + 0 + 1 1 + 0 + Dock + 0 + Left 1 impl_virtual + 1 + 0 0 wxID_ANY + + 0 + + 0 + 1 DIALOG_EESCHEMA_OPTIONS_BASE + 1 + + + 1 + Resizable + 1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER Schematic Editor Options + 0 wxFILTER_NONE @@ -51,6 +86,12 @@ + + + + + + @@ -84,37 +125,68 @@ mainSizer wxVERTICAL none - + 12 1 - + bOptionsSizer wxVERTICAL none - + 0 wxEXPAND 1 - + + 1 + 1 + 1 + 1 + + + + + wxSYS_COLOUR_BTNFACE + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 + + 0 + 1 m_notebook1 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -148,26 +220,57 @@ - + General Options 1 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 + + 0 + 1 m_panel1 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -199,25 +302,25 @@ - + p1mainSizer wxHORIZONTAL none - + 12 wxALL|wxEXPAND 1 - + bSizer3 wxVERTICAL none - + 0 wxALIGN_CENTER|wxEXPAND 0 - + 3 wxHORIZONTAL 0,1,2 @@ -229,28 +332,59 @@ none 8 0 - + 3 wxALIGN_CENTER_VERTICAL|wxALL 1 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Measurement &units: + + 0 + + 0 + 1 m_staticText2 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -285,28 +419,60 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 1 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 + + 0 + 1 m_choiceUnits + 1 + + protected + 1 + Resizable 0 + 1 + + 0 wxFILTER_NONE @@ -341,38 +507,69 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxEXPAND 1 - + 0 protected 0 - + 3 wxALIGN_CENTER_VERTICAL|wxALL 1 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY &Grid size: + + 0 + + 0 + 1 m_staticText3 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -407,28 +604,60 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 + + 0 + 1 m_choiceGridSize + 1 + + protected + 1 + Resizable 0 + 1 + + 0 wxFILTER_NONE @@ -463,28 +692,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY mils + + 0 + + 0 + 1 m_staticGridUnits + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -519,28 +779,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL 1 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Default &line width: + + 0 + + 0 + 1 m_staticText5 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -575,30 +866,61 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY 0 100 + + 0 0 + + 0 + 1 m_spinLineWidth + 1 + + protected + 1 + Resizable + 1 wxSP_ARROW_KEYS|wxSP_WRAP + 0 wxFILTER_NONE @@ -635,28 +957,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY mils + + 0 + + 0 + 1 m_staticLineWidthUnits + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -691,28 +1044,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL 1 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Default text &size: + + 0 + + 0 + 1 m_staticText7 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -747,30 +1131,61 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY 0 1000 + + 0 0 + + 0 + 1 m_spinTextSize + 1 + + protected + 1 + Resizable + 1 wxSP_ARROW_KEYS|wxSP_WRAP + 0 wxFILTER_NONE @@ -807,28 +1222,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY mils + + 0 + + 0 + 1 m_staticTextSizeUnits + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -863,28 +1309,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL 1 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Repeat draw item &horizontal displacement: + + 0 + + 0 + 1 m_staticText9 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -919,30 +1396,61 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY 0 500 + + 0 -500 + + 0 + 1 m_spinRepeatHorizontal + 1 + + protected + 1 + Resizable + 1 wxSP_ARROW_KEYS|wxSP_WRAP + 0 wxFILTER_NONE @@ -979,28 +1487,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY mils + + 0 + + 0 + 1 m_staticRepeatXUnits + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1035,28 +1574,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL 1 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Repeat draw item &vertical displacement: + + 0 + + 0 + 1 m_staticText12 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1091,30 +1661,61 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY 100 500 + + 0 -500 + + 0 + 1 m_spinRepeatVertical + 1 + + protected + 1 + Resizable + 1 wxSP_ARROW_KEYS|wxSP_WRAP + 0 wxFILTER_NONE @@ -1151,28 +1752,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY mils + + 0 + + 0 + 1 m_staticRepeatYUnits + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1207,28 +1839,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL 1 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY &Repeat label increment: + + 0 + + 0 + 1 m_staticText16 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1263,30 +1926,61 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY 1 10 + + 0 0 + + 0 + 1 m_spinRepeatLabel + 1 + + protected + 1 + Resizable + 1 wxSP_ARROW_KEYS|wxSP_WRAP + 0 wxFILTER_NONE @@ -1323,38 +2017,69 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxEXPAND 1 - + 0 protected 0 - + 3 wxALIGN_CENTER_VERTICAL|wxALL 1 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Auto save time interval: + + 0 + + 0 + 1 m_staticText221 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1389,30 +2114,61 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 ID_M_SPINAUTOSAVEINTERVAL 10 1000 + + 0 0 + + 0 + 1 m_spinAutoSaveInterval + 1 + + protected + 1 + Resizable + 1 wxSP_ARROW_KEYS + 0 wxFILTER_NONE @@ -1449,28 +2205,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY minutes + + 0 + + 0 + 1 m_staticText23 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1507,38 +2294,69 @@ - + 0 wxEXPAND 0 - + bSizer2 wxVERTICAL none - + 3 wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Show g&rid + + 0 + + 0 + 1 m_checkShowGrid + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1573,29 +2391,60 @@ - + 3 wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Show hi&dden pins + + 0 + + 0 + 1 m_checkShowHiddenPins + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1632,27 +2481,234 @@ 3 - wxALL|wxEXPAND + wxALL 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 + 0 + xwID_ANY + Enable middle mouse button panning + + 0 + + + 0 + + 1 + m_checkEnableMiddleButtonPan + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnMiddleBtnPanEnbl + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Middle mouse button panning limited by current toolbar panning + + 0 + + + 0 + + 1 + m_checkMiddleButtonPanLimited + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 0 wxID_ANY Enable automatic &panning + + 0 + + 0 + 1 m_checkAutoPan + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1687,29 +2743,60 @@ - + 3 wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Allow buses and wires to be placed in H or V &orientation only + + 0 + + 0 + 1 m_checkHVOrientation + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1744,29 +2831,60 @@ - + 3 wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Show p&age limits + + 0 + + 0 + 1 m_checkPageLimits + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1803,11 +2921,11 @@ - + 10 wxALL|wxEXPAND 1 - + 0 protected 0 @@ -1818,26 +2936,57 @@ - + Template Field Names 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 + + 0 + 1 m_panel2 + 1 + + protected + 1 + Resizable + 1 + 0 User defined field names for schematic components. wxFILTER_NONE @@ -1869,42 +3018,73 @@ - + bSizer6 wxVERTICAL none - + 5 wxEXPAND 0 - + bSizer8 wxVERTICAL none - + 5 wxALIGN_CENTER_HORIZONTAL|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Please enter fieldnames which you want presented in the component fieldname (property) editors. Names may not include (, ), or " characters. + + 0 + + 0 + 1 m_staticText211 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -1941,16 +3121,16 @@ - + 12 wxALL|wxEXPAND 1 - + bSizer7 wxVERTICAL none - + 5 wxALIGN_CENTER|wxEXPAND 1 @@ -1966,28 +3146,59 @@ none 8 0 - + 3 wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Custom field 1 + + 0 + + 0 + 1 m_staticText15 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2022,28 +3233,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 0 + + 0 + 1 m_fieldName1 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2082,28 +3324,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Custom field 2 + + 0 + + 0 + 1 m_staticText161 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2138,28 +3411,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 0 + + 0 + 1 m_fieldName2 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2198,28 +3502,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Custom field 3 + + 0 + + 0 + 1 m_staticText17 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2254,28 +3589,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 0 + + 0 + 1 m_fieldName3 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2314,28 +3680,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Custom field 4 + + 0 + + 0 + 1 m_staticText18 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2370,28 +3767,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 0 + + 0 + 1 m_fieldName4 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2430,28 +3858,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Custom field 5 + + 0 + + 0 + 1 m_staticText19 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2486,28 +3945,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 0 + + 0 + 1 m_fieldName5 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2546,28 +4036,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Custom field 6 + + 0 + + 0 + 1 m_staticText20 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2602,28 +4123,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 0 + + 0 + 1 m_fieldName6 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2662,28 +4214,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Custom field 7 + + 0 + + 0 + 1 m_staticText21 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2718,28 +4301,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 0 + + 0 + 1 m_fieldName7 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2778,28 +4392,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Custom field 8 + + 0 + + 0 + 1 m_staticText22 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2834,28 +4479,59 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 0 + + 0 + 1 m_fieldName8 + 1 + + protected + 1 + Resizable + 1 + 0 wxFILTER_NONE @@ -2903,11 +4579,11 @@ - + 12 wxALL|wxEXPAND 0 - + 0 1 0 diff --git a/eeschema/dialogs/dialog_eeschema_options_base.h b/eeschema/dialogs/dialog_eeschema_options_base.h index ba3305049c..343cc230c2 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.h +++ b/eeschema/dialogs/dialog_eeschema_options_base.h @@ -1,15 +1,16 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __dialog_eeschema_options_base__ -#define __dialog_eeschema_options_base__ +#ifndef __DIALOG_EESCHEMA_OPTIONS_BASE_H__ +#define __DIALOG_EESCHEMA_OPTIONS_BASE_H__ +#include +#include #include - #include #include #include @@ -41,19 +42,20 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public wxDialog // Private event handlers void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); } + void _wxFB_OnMiddleBtnPanEnbl( wxCommandEvent& event ){ OnMiddleBtnPanEnbl( event ); } protected: enum { ID_M_SPINAUTOSAVEINTERVAL = 1000, + xwID_ANY }; wxNotebook* m_notebook1; wxPanel* m_panel1; wxStaticText* m_staticText2; wxChoice* m_choiceUnits; - wxStaticText* m_staticText3; wxChoice* m_choiceGridSize; wxStaticText* m_staticGridUnits; @@ -71,16 +73,16 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public wxDialog wxStaticText* m_staticRepeatYUnits; wxStaticText* m_staticText16; wxSpinCtrl* m_spinRepeatLabel; - wxStaticText* m_staticText221; wxSpinCtrl* m_spinAutoSaveInterval; wxStaticText* m_staticText23; wxCheckBox* m_checkShowGrid; wxCheckBox* m_checkShowHiddenPins; + wxCheckBox* m_checkEnableMiddleButtonPan; + wxCheckBox* m_checkMiddleButtonPanLimited; wxCheckBox* m_checkAutoPan; wxCheckBox* m_checkHVOrientation; wxCheckBox* m_checkPageLimits; - wxPanel* m_panel2; wxStaticText* m_staticText211; wxStaticText* m_staticText15; @@ -105,13 +107,14 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public wxDialog // Virtual event handlers, overide them in your derived class virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); } public: - DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_EESCHEMA_OPTIONS_BASE(); }; -#endif //__dialog_eeschema_options_base__ +#endif //__DIALOG_EESCHEMA_OPTIONS_BASE_H__ diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 3394abbc83..d27c50d3b4 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -215,6 +215,8 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 ); dlg.SetShowGrid( IsGridVisible() ); dlg.SetShowHiddenPins( m_showAllPins ); + dlg.SetEnableMiddleButtonPan( m_canvas->GetEnableMiddleButtonPan() ); + dlg.SetMiddleButtonPanLimited( m_canvas->GetMiddleButtonPanLimited() ); dlg.SetEnableAutoPan( m_canvas->GetEnableAutoPan() ); dlg.SetEnableHVBusOrientation( g_HVLines ); dlg.SetShowPageLimits( g_ShowPageLimits ); @@ -246,6 +248,8 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) SetAutoSaveInterval( dlg.GetAutoSaveInterval() * 60 ); SetGridVisibility( dlg.GetShowGrid() ); m_showAllPins = dlg.GetShowHiddenPins(); + m_canvas->SetEnableMiddleButtonPan( dlg.GetEnableMiddleButtonPan() ); + m_canvas->SetMiddleButtonPanLimited( dlg.GetMiddleButtonPanLimited() ); m_canvas->SetEnableAutoPan( dlg.GetEnableAutoPan() ); g_HVLines = dlg.GetEnableHVBusOrientation(); g_ShowPageLimits = dlg.GetShowPageLimits(); diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp b/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp index b13b80223c..64a2866b3e 100644 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp +++ b/gerbview/dialogs/gerbview_dialog_display_options_frame.cpp @@ -31,6 +31,10 @@ private: void OnOKBUttonClick( wxCommandEvent& event ); void OnCancelButtonClick( wxCommandEvent& event ); void initOptDialog( ); + void OnMiddleBtnPanEnbl( wxCommandEvent& event ) + { + m_OptMiddleButtonPanLimited->Enable( m_OptMiddleButtonPan->GetValue() ); + } }; @@ -93,6 +97,10 @@ void DIALOG_DISPLAY_OPTIONS::initOptDialog( ) } m_OptDisplayDCodes->SetValue( m_Parent->IsElementVisible( DCODES_VISIBLE ) ); + + m_OptMiddleButtonPan->SetValue( m_Parent->GetCanvas()->GetEnableMiddleButtonPan() ); + m_OptMiddleButtonPanLimited->SetValue( m_Parent->GetCanvas()->GetMiddleButtonPanLimited() ); + m_OptMiddleButtonPanLimited->Enable( m_OptMiddleButtonPan->GetValue() ); } @@ -138,6 +146,11 @@ void DIALOG_DISPLAY_OPTIONS::OnOKBUttonClick( wxCommandEvent& event ) m_Parent->SetPageSettings( pageInfo ); + m_Parent->GetCanvas()->SetEnableMiddleButtonPan( m_OptMiddleButtonPan->GetValue() ); + m_Parent->GetCanvas()->SetMiddleButtonPanLimited( m_OptMiddleButtonPanLimited->GetValue() ); + + m_Parent->GetCanvas()->Refresh(); + EndModal( 1 ); } diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp index 1804883163..3f5e2a3a14 100644 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp +++ b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -40,6 +40,11 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi m_CursorShape->SetSelection( 1 ); bLeftSizer->Add( m_CursorShape, 0, wxALL|wxEXPAND, 5 ); + m_OptDisplayDCodes = new wxCheckBox( this, wxID_ANY, _("Show D codes"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayDCodes->SetValue(true); + bLeftSizer->Add( m_OptDisplayDCodes, 0, wxALL, 5 ); + + bUpperSizer->Add( bLeftSizer, 0, wxEXPAND, 5 ); wxBoxSizer* bMiddleSizer; @@ -63,6 +68,7 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi m_OptDisplayPolygons->SetSelection( 1 ); bMiddleSizer->Add( m_OptDisplayPolygons, 0, wxALL|wxEXPAND, 5 ); + bUpperSizer->Add( bMiddleSizer, 0, wxEXPAND, 5 ); @@ -77,15 +83,22 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi m_ShowPageLimits->SetSelection( 0 ); bRightSizer->Add( m_ShowPageLimits, 0, wxALL|wxEXPAND, 5 ); + wxStaticBoxSizer* bLeftBottomSizer; + bLeftBottomSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pan:") ), wxVERTICAL ); - bRightSizer->Add( 20, 20, 0, 0, 5 ); + m_OptMiddleButtonPan = new wxCheckBox( this, wxID_ANY, _("Middle Button PAN Enabled"), wxDefaultPosition, wxDefaultSize, 0 ); + bLeftBottomSizer->Add( m_OptMiddleButtonPan, 0, wxALL, 5 ); + + m_OptMiddleButtonPanLimited = new wxCheckBox( this, wxID_ANY, _("Middle Button PAN Limited"), wxDefaultPosition, wxDefaultSize, 0 ); + bLeftBottomSizer->Add( m_OptMiddleButtonPanLimited, 0, wxALL, 5 ); + + + bRightSizer->Add( bLeftBottomSizer, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - m_OptDisplayDCodes = new wxCheckBox( this, wxID_ANY, _("Show D codes"), wxDefaultPosition, wxDefaultSize, 0 ); - m_OptDisplayDCodes->SetValue(true); - bRightSizer->Add( m_OptDisplayDCodes, 0, wxALL, 5 ); bUpperSizer->Add( bRightSizer, 1, wxEXPAND, 5 ); + bDialogSizer->Add( bUpperSizer, 1, wxEXPAND, 5 ); m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -97,12 +110,15 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); + bDialogSizer->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 ); + this->SetSizer( bDialogSizer ); this->Layout(); // Connect Events + m_OptMiddleButtonPan->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnMiddleBtnPanEnbl ), NULL, this ); m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnCancelButtonClick ), NULL, this ); m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnOKBUttonClick ), NULL, this ); } @@ -110,6 +126,7 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi DIALOG_DISPLAY_OPTIONS_BASE::~DIALOG_DISPLAY_OPTIONS_BASE() { // Disconnect Events + m_OptMiddleButtonPan->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnMiddleBtnPanEnbl ), NULL, this ); m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnCancelButtonClick ), NULL, this ); m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnOKBUttonClick ), NULL, this ); diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp index 55e609c672..f4560f63d1 100644 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp +++ b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.fbp @@ -1,12 +1,14 @@ - + C++ 1 source_name + 0 0 + res UTF-8 connect gerbview_dialog_display_options_frame_base @@ -18,29 +20,62 @@ . 1 + 1 1 0 0 + 1 + 1 + 1 + 1 + + 0 + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 impl_virtual + 1 + 0 0 wxID_ANY + + 0 + + 0 + 1 DIALOG_DISPLAY_OPTIONS_BASE + 1 + + + 1 - 446,299 + Resizable + 1 + 446,330 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER Gerbview Options + 0 wxFILTER_NONE @@ -51,6 +86,12 @@ + + + + + + @@ -107,26 +148,57 @@ wxALL|wxEXPAND 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 "No Display" "Display" + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Display Polar Coord 1 + + 0 + + 0 + 1 m_PolarDisplay + 1 + + protected + 1 + Resizable 0 + 1 wxRA_SPECIFY_COLS + 0 wxFILTER_NONE @@ -166,26 +238,57 @@ wxALL|wxEXPAND 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 "Inches" "millimeters" + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Units 1 + + 0 + + 0 + 1 m_BoxUnits + 1 + + protected + 1 + Resizable 0 + 1 wxRA_SPECIFY_COLS + 0 wxFILTER_NONE @@ -225,26 +328,57 @@ wxALL|wxEXPAND 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 "Small" "Large" + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Cursor 1 + + 0 + + 0 + 1 m_CursorShape + 1 + + protected + 1 + Resizable 1 + 1 wxRA_SPECIFY_COLS + 0 wxFILTER_NONE @@ -279,6 +413,94 @@ + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show D codes + + 0 + + + 0 + + 1 + m_OptDisplayDCodes + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -295,26 +517,57 @@ wxALL|wxEXPAND 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 "Sketch" "Filled" + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Lines: 1 + + 0 + + 0 + 1 m_OptDisplayLines + 1 + + protected + 1 + Resizable 1 + 1 wxRA_SPECIFY_COLS + 0 wxFILTER_NONE @@ -354,26 +607,57 @@ wxALL|wxEXPAND 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 "Sketch" "Filled" + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Spots: 1 + + 0 + + 0 + 1 m_OptDisplayFlashedItems + 1 + + protected + 1 + Resizable 1 + 1 wxRA_SPECIFY_COLS + 0 wxFILTER_NONE @@ -413,26 +697,57 @@ wxALL|wxEXPAND 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 "Sketch" "Filled" + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Polygons: 1 + + 0 + + 0 + 1 m_OptDisplayPolygons + 1 + + protected + 1 + Resizable 1 + 1 wxRA_SPECIFY_COLS + 0 wxFILTER_NONE @@ -493,26 +808,57 @@ wxALL|wxEXPAND 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 "Full size. Do not show page limits" "Full size" "Size A4" "Size A3" "Size A2" "Size A" "Size B" "Size C" + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY Show Page Limits: 1 + + 0 + + 0 + 1 m_ShowPageLimits + 1 + + protected + 1 + Resizable 0 + 1 wxRA_SPECIFY_COLS + 0 wxFILTER_NONE @@ -549,69 +895,192 @@ 5 - + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT 0 - - 20 - protected - 20 - - - - 5 - wxALL - 0 - - - 1 - - 1 - 1 - - - 0 + wxID_ANY - Show D codes - + Pan: - m_OptDisplayDCodes - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + bLeftBottomSizer + wxVERTICAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Middle Button PAN Enabled + + 0 + + + 0 + + 1 + m_OptMiddleButtonPan + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnMiddleBtnPanEnbl + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Middle Button PAN Limited + + 0 + + + 0 + + 1 + m_OptMiddleButtonPanLimited + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -623,22 +1092,53 @@ wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 + 1 + 1 + 1 + 1 + + + + + + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left 1 + 1 + 0 0 wxID_ANY + + 0 + + 0 + 1 m_staticline1 + 1 + + protected + 1 + Resizable + 1 wxLI_HORIZONTAL + 0 wxFILTER_NONE diff --git a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.h b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.h index 188efbd9fd..03610e8cfa 100644 --- a/gerbview/dialogs/gerbview_dialog_display_options_frame_base.h +++ b/gerbview/dialogs/gerbview_dialog_display_options_frame_base.h @@ -1,23 +1,25 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __gerbview_dialog_display_options_frame_base__ -#define __gerbview_dialog_display_options_frame_base__ +#ifndef __GERBVIEW_DIALOG_DISPLAY_OPTIONS_FRAME_BASE_H__ +#define __GERBVIEW_DIALOG_DISPLAY_OPTIONS_FRAME_BASE_H__ +#include +#include #include - #include #include #include #include #include #include -#include #include +#include +#include #include #include #include @@ -36,28 +38,29 @@ class DIALOG_DISPLAY_OPTIONS_BASE : public wxDialog wxRadioBox* m_PolarDisplay; wxRadioBox* m_BoxUnits; wxRadioBox* m_CursorShape; + wxCheckBox* m_OptDisplayDCodes; wxRadioBox* m_OptDisplayLines; wxRadioBox* m_OptDisplayFlashedItems; wxRadioBox* m_OptDisplayPolygons; - wxRadioBox* m_ShowPageLimits; - - wxCheckBox* m_OptDisplayDCodes; + wxCheckBox* m_OptMiddleButtonPan; + wxCheckBox* m_OptMiddleButtonPanLimited; wxStaticLine* m_staticline1; wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class + virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnOKBUttonClick( wxCommandEvent& event ) { event.Skip(); } public: - DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Gerbview Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 446,299 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Gerbview Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 446,330 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_DISPLAY_OPTIONS_BASE(); }; -#endif //__gerbview_dialog_display_options_frame_base__ +#endif //__GERBVIEW_DIALOG_DISPLAY_OPTIONS_FRAME_BASE_H__ diff --git a/include/class_drawpanel.h b/include/class_drawpanel.h index cf3ca24c89..4a45027d37 100644 --- a/include/class_drawpanel.h +++ b/include/class_drawpanel.h @@ -61,6 +61,8 @@ private: int m_scrollIncrementX; ///< X axis scroll increment in pixels per unit. int m_scrollIncrementY; ///< Y axis scroll increment in pixels per unit. wxPoint m_CursorStartPos; ///< Used for testing the cursor movement. + wxPoint m_PanStartCenter; ///< Initial scroll center position when pan started + wxPoint m_PanStartEventPosition; ///< Initial position of mouse event when pan started /// The drawing area used to redraw the screen which is usually the visible area /// of the drawing in internal units. @@ -68,6 +70,11 @@ private: bool m_abortRequest; ///< Flag used to abort long commands. + bool m_enableMiddleButtonPan; ///< True to enable middle mouse button panning. + bool m_panScrollbarLimits; ///< has meaning only if m_enableMiddleButtonPan = true + ///< true to limit panning to scrollbar current limits + ///< false to used unlimited pan + bool m_enableAutoPan; ///< True to enable automatic panning. /// true to request an auto pan. Valid only when m_enableAutoPan = true. @@ -110,6 +117,14 @@ public: void SetAbortRequest( bool aAbortRequest ) { m_abortRequest = aAbortRequest; } + bool GetEnableMiddleButtonPan() const { return m_enableMiddleButtonPan; } + + void SetEnableMiddleButtonPan( bool aEnable ) { m_enableMiddleButtonPan = aEnable; } + + bool GetMiddleButtonPanLimited() const { return m_panScrollbarLimits; } + + void SetMiddleButtonPanLimited( bool aEnable ) { m_panScrollbarLimits = aEnable; } + bool GetEnableAutoPan() const { return m_enableAutoPan; } void SetEnableAutoPan( bool aEnable ) { m_enableAutoPan = aEnable; } diff --git a/pcbnew/dialogs/dialog_general_options.cpp b/pcbnew/dialogs/dialog_general_options.cpp index 02e9aa532b..d11c0f35b6 100644 --- a/pcbnew/dialogs/dialog_general_options.cpp +++ b/pcbnew/dialogs/dialog_general_options.cpp @@ -44,20 +44,20 @@ #include -Dialog_GeneralOptions::Dialog_GeneralOptions( PCB_EDIT_FRAME* parent ) : - DialogGeneralOptionsBoardEditor_base( parent ) +DIALOG_GENERALOPTIONS::DIALOG_GENERALOPTIONS( PCB_EDIT_FRAME* parent ) : + DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE( parent ) { init(); - m_buttonOK->SetDefault(); GetSizer()->SetSizeHints( this ); Center(); } -void Dialog_GeneralOptions::init() +void DIALOG_GENERALOPTIONS::init() { SetFocus(); + m_sdbSizerOK->SetDefault(); m_Board = GetParent()->GetBoard(); @@ -88,6 +88,9 @@ void Dialog_GeneralOptions::init() m_TrackAutodel->SetValue( g_AutoDeleteOldTrack ); m_Track_45_Only_Ctrl->SetValue( g_Track_45_Only_Allowed ); m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only ); + m_MiddleButtonPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableMiddleButtonPan() ); + m_OptMiddleButtonPanLimited->SetValue( GetParent()->GetCanvas()->GetMiddleButtonPanLimited() ); + m_OptMiddleButtonPanLimited->Enable( m_MiddleButtonPANOpt->GetValue() ); m_AutoPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableAutoPan() ); m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only ); m_Track_DoubleSegm_Ctrl->SetValue( g_TwoSegmentTrackBuild ); @@ -97,13 +100,13 @@ void Dialog_GeneralOptions::init() } -void Dialog_GeneralOptions::OnCancelClick( wxCommandEvent& event ) +void DIALOG_GENERALOPTIONS::OnCancelClick( wxCommandEvent& event ) { event.Skip(); } -void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event ) +void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event ) { EDA_UNITS_T ii; @@ -133,6 +136,10 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event ) g_AutoDeleteOldTrack = m_TrackAutodel->GetValue(); Segments_45_Only = m_Segments_45_Only_Ctrl->GetValue(); g_Track_45_Only_Allowed = m_Track_45_Only_Ctrl->GetValue(); + + GetParent()->GetCanvas()->SetEnableMiddleButtonPan( m_MiddleButtonPANOpt->GetValue() ); + GetParent()->GetCanvas()->SetMiddleButtonPanLimited( m_OptMiddleButtonPanLimited->GetValue() ); + GetParent()->GetCanvas()->SetEnableAutoPan( m_AutoPANOpt->GetValue() ); g_TwoSegmentTrackBuild = m_Track_DoubleSegm_Ctrl->GetValue(); g_MagneticPadOption = m_MagneticPadOptCtrl->GetSelection(); diff --git a/pcbnew/dialogs/dialog_general_options.h b/pcbnew/dialogs/dialog_general_options.h index 04d6d939a3..7cdefdbe2e 100644 --- a/pcbnew/dialogs/dialog_general_options.h +++ b/pcbnew/dialogs/dialog_general_options.h @@ -3,7 +3,7 @@ #include -class Dialog_GeneralOptions : public DialogGeneralOptionsBoardEditor_base +class DIALOG_GENERALOPTIONS : public DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE { private: BOARD* m_Board; @@ -11,12 +11,18 @@ private: void init(); public: - Dialog_GeneralOptions( PCB_EDIT_FRAME* parent ); - ~Dialog_GeneralOptions() {}; + DIALOG_GENERALOPTIONS( PCB_EDIT_FRAME* parent ); + ~DIALOG_GENERALOPTIONS() {}; void OnOkClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event ); PCB_EDIT_FRAME* GetParent() { return (PCB_EDIT_FRAME*) wxDialog::GetParent(); } + +private: + void OnMiddleBtnPanEnbl( wxCommandEvent& event ) + { + m_OptMiddleButtonPanLimited->Enable( m_MiddleButtonPANOpt->GetValue() ); + } }; diff --git a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp index 58e10fae28..a338d0a973 100644 --- a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp +++ b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 30 2011) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -9,12 +9,15 @@ /////////////////////////////////////////////////////////////////////////// -DialogGeneralOptionsBoardEditor_base::DialogGeneralOptionsBoardEditor_base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); wxBoxSizer* bMainSizer; - bMainSizer = new wxBoxSizer( wxHORIZONTAL ); + bMainSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizerUpper; + bSizerUpper = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer* bLeftSizer; bLeftSizer = new wxBoxSizer( wxVERTICAL ); @@ -43,7 +46,8 @@ DialogGeneralOptionsBoardEditor_base::DialogGeneralOptionsBoardEditor_base( wxWi bLeftSizer->Add( m_CursorShape, 0, wxALL|wxEXPAND, 5 ); - bMainSizer->Add( bLeftSizer, 1, wxEXPAND, 5 ); + + bSizerUpper->Add( bLeftSizer, 1, wxEXPAND, 5 ); wxBoxSizer* bMiddleLeftSizer; bMiddleLeftSizer = new wxBoxSizer( wxVERTICAL ); @@ -78,7 +82,8 @@ DialogGeneralOptionsBoardEditor_base::DialogGeneralOptionsBoardEditor_base( wxWi bMiddleLeftSizer->Add( m_RotationAngle, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - bMainSizer->Add( bMiddleLeftSizer, 1, wxEXPAND, 5 ); + + bSizerUpper->Add( bMiddleLeftSizer, 1, wxEXPAND, 5 ); wxStaticBoxSizer* bMiddleRightBoxSizer; bMiddleRightBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL ); @@ -114,17 +119,13 @@ DialogGeneralOptionsBoardEditor_base::DialogGeneralOptionsBoardEditor_base( wxWi bMiddleRightBoxSizer->Add( m_Segments_45_Only_Ctrl, 0, wxALL, 5 ); - m_AutoPANOpt = new wxCheckBox( this, wxID_AUTOPAN, _("Auto PAN"), wxDefaultPosition, wxDefaultSize, 0 ); - m_AutoPANOpt->SetToolTip( _("Allows auto pan when creating a track, or moving an item.") ); - - bMiddleRightBoxSizer->Add( m_AutoPANOpt, 0, wxALL, 5 ); - m_Track_DoubleSegm_Ctrl = new wxCheckBox( this, wxID_ANY, _("Double Segm Track"), wxDefaultPosition, wxDefaultSize, 0 ); m_Track_DoubleSegm_Ctrl->SetToolTip( _("If enabled, uses two track segments, with 45 degrees angle between them when creating a new track ") ); bMiddleRightBoxSizer->Add( m_Track_DoubleSegm_Ctrl, 0, wxALL, 5 ); - bMainSizer->Add( bMiddleRightBoxSizer, 1, 0, 5 ); + + bSizerUpper->Add( bMiddleRightBoxSizer, 1, 0, 5 ); wxBoxSizer* bRightSizer; bRightSizer = new wxBoxSizer( wxVERTICAL ); @@ -145,27 +146,60 @@ DialogGeneralOptionsBoardEditor_base::DialogGeneralOptionsBoardEditor_base( wxWi bRightSizer->Add( m_MagneticTrackOptCtrl, 0, wxALL|wxEXPAND, 5 ); - m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonOK->SetDefault(); - bRightSizer->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + wxStaticBoxSizer* sbSizer2PAN; + sbSizer2PAN = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pan:") ), wxVERTICAL ); - m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonCANCEL, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + m_MiddleButtonPANOpt = new wxCheckBox( this, wxID_MIDDLEBUTTONPAN, _("Middle Button PAN Enabled"), wxDefaultPosition, wxDefaultSize, 0 ); + m_MiddleButtonPANOpt->SetToolTip( _("Allows auto pan when creating a track, or moving an item.") ); + + sbSizer2PAN->Add( m_MiddleButtonPANOpt, 0, wxALL, 5 ); + + m_OptMiddleButtonPanLimited = new wxCheckBox( this, wxID_MIDDLEBUTTONPAN, _("Middle Button PAN Limited"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptMiddleButtonPanLimited->SetToolTip( _("Allows auto pan when creating a track, or moving an item.") ); + + sbSizer2PAN->Add( m_OptMiddleButtonPanLimited, 0, wxALL, 5 ); + + m_AutoPANOpt = new wxCheckBox( this, wxID_AUTOPAN, _("Auto PAN"), wxDefaultPosition, wxDefaultSize, 0 ); + m_AutoPANOpt->SetToolTip( _("Allows auto pan when creating a track, or moving an item.") ); + + sbSizer2PAN->Add( m_AutoPANOpt, 0, wxALL, 5 ); + + + bRightSizer->Add( sbSizer2PAN, 1, wxEXPAND|wxBOTTOM|wxLEFT, 5 ); + + + bSizerUpper->Add( bRightSizer, 1, wxEXPAND, 5 ); + + + bMainSizer->Add( bSizerUpper, 1, wxEXPAND, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + + m_sdbSizer = new wxStdDialogButtonSizer(); + m_sdbSizerOK = new wxButton( this, wxID_OK ); + m_sdbSizer->AddButton( m_sdbSizerOK ); + m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer->AddButton( m_sdbSizerCancel ); + m_sdbSizer->Realize(); + + bMainSizer->Add( m_sdbSizer, 0, wxEXPAND, 5 ); - bMainSizer->Add( bRightSizer, 1, wxEXPAND, 5 ); this->SetSizer( bMainSizer ); this->Layout(); // Connect Events - m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogGeneralOptionsBoardEditor_base::OnOkClick ), NULL, this ); - m_buttonCANCEL->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogGeneralOptionsBoardEditor_base::OnCancelClick ), NULL, this ); + m_MiddleButtonPANOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnMiddleBtnPanEnbl ), NULL, this ); + m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnCancelClick ), NULL, this ); + m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnOkClick ), NULL, this ); } -DialogGeneralOptionsBoardEditor_base::~DialogGeneralOptionsBoardEditor_base() +DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::~DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE() { // Disconnect Events - m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogGeneralOptionsBoardEditor_base::OnOkClick ), NULL, this ); - m_buttonCANCEL->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogGeneralOptionsBoardEditor_base::OnCancelClick ), NULL, this ); + m_MiddleButtonPANOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnMiddleBtnPanEnbl ), NULL, this ); + m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnCancelClick ), NULL, this ); + m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::OnOkClick ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp index 8348f8c3b7..ed370978d2 100644 --- a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp +++ b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp @@ -1,11 +1,12 @@ - + C++ 1 source_name + 0 0 res UTF-8 @@ -19,6 +20,7 @@ . 1 + 1 1 1 0 @@ -27,8 +29,11 @@ 1 1 1 + 0 + + @@ -51,7 +56,6 @@ 0 0 wxID_ANY - 0 @@ -59,17 +63,15 @@ 0 1 - DialogGeneralOptionsBoardEditor_base + DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE 1 1 - Resizable - 1 - 585,280 + 611,346 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER General settings @@ -121,7 +123,7 @@ bMainSizer - wxHORIZONTAL + wxVERTICAL none 5 @@ -129,1905 +131,2042 @@ 1 - bLeftSizer - wxVERTICAL + bSizerUpper + wxHORIZONTAL none 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - "No Display" "Display" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_POLAR_CTRL - Display Polar Coord - - 1 - - 0 - - - 0 + wxEXPAND + 1 + - 1 - m_PolarDisplay - 1 - - - protected - 1 - - - Resizable - - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - Activates the display of relative coordinates from relative origin (set by the space key) to the cursor, in polar coordinates (angle and distance) - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + bLeftSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "No Display" "Display" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_POLAR_CTRL + Display Polar Coord + 1 + + 0 + + + 0 + + 1 + m_PolarDisplay + 1 + + + protected + 1 + + Resizable + 1 + 1 + + wxRA_SPECIFY_COLS + + 0 + Activates the display of relative coordinates from relative origin (set by the space key) to the cursor, in polar coordinates (angle and distance) + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Inches" "Millimeters" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_UNITS + Units + 1 + + 0 + + + 0 + + 1 + m_UnitsSelection + 1 + + + protected + 1 + + Resizable + 1 + 1 + + wxRA_SPECIFY_COLS + + 0 + Selection of units used to display dimensions and positions of items + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Small cross" "Full screen cursor" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_CURSOR_SHAPE + Cursor + 1 + + 0 + + + 0 + + 1 + m_CursorShape + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + Main cursor shape selection (small cross or large cursor) + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - "Inches" "Millimeters" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_UNITS - Units - - 1 - - 0 - - - 0 + wxEXPAND + 1 + - 1 - m_UnitsSelection - 1 - - - protected - 1 - - - Resizable - - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - Selection of units used to display dimensions and positions of items - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + bMiddleLeftSizer + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Max Links: + + 0 + + + 0 + + 1 + m_staticTextmaxlinks + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 1 + 5 + + 0 + + 1 + + 0 + + 1 + m_MaxShowLinks + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS + + 0 + Adjust the number of ratsnets shown from cursor to closest pads + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Auto Save (minutes): + + 0 + + + 0 + + 1 + m_staticTextautosave + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 60 + + 0 + + 0 + + 0 + + 1 + m_SaveTime + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS + + 0 + Delay after the first change to create a backup file of the board on disk. + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Rotation Angle + + 0 + + + 0 + + 1 + m_staticTextRotationAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "45" "90" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_RotationAngle + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + Footprints rotation increment, for rotate menu or hot key. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - "Small cross" "Full screen cursor" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CURSOR_SHAPE - Cursor - - 1 - - 0 - - - 0 + + 1 + + wxID_ANY + Options: - 1 - m_CursorShape - 1 - - - protected - 1 - - - Resizable - - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Main cursor shape selection (small cross or large cursor) - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + bMiddleRightBoxSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_DRC_ONOFF + Drc ON + + 0 + + + 0 + + 1 + m_DrcOn + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Enable/disable the DRC control. When DRC is disable, all connections are allowed. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_GENERAL_RATSNEST + Show Ratsnest + + 0 + + + 0 + + 1 + m_ShowGlobalRatsnest + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Show (or not) the full rastnest. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_RATSNEST_MODULE + Show Mod Ratsnest + + 0 + + + 0 + + 1 + m_ShowModuleRatsnest + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Shows (or not) the local ratsnest relative to a footprint, when moving it. This ratsnest is useful to place a footprint. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_TRACK_AUTODEL + Tracks Auto Del + + 0 + + + 0 + + 1 + m_TrackAutodel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Enable/disable the automatic track deletion when recreating a track. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_TRACKS45 + Track only 45 degrees + + 0 + + + 0 + + 1 + m_Track_45_Only_Ctrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + If enabled, force tracks directions to H, V or 45 degrees, when creating a track. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_SEGMENTS45 + Segments 45 Only + + 0 + + + 0 + + 1 + m_Segments_45_Only_Ctrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + If enabled, force segments directions to H, V or 45 degrees, when creating a segment on technical layers. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Double Segm Track + + 0 + + + 0 + + 1 + m_Track_DoubleSegm_Ctrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + If enabled, uses two track segments, with 45 degrees angle between them when creating a new track + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bRightSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Never" "When creating tracks" "Always" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Magnetic Pads + 1 + + 0 + + + 0 + + 1 + m_MagneticPadOptCtrl + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + control the capture of the pcb cursor when the mouse cursor enters a pad area + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Never" "When creating tracks" "Always" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_MAGNETIC_TRACKS + Magnetic Tracks + 1 + + 0 + + + 0 + + 1 + m_MagneticTrackOptCtrl + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + Control the capture of the pcb cursor when the mouse cursor enters a track + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxLEFT + 1 + + wxID_ANY + Pan: + + sbSizer2PAN + wxVERTICAL + none + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_MIDDLEBUTTONPAN + Middle Button PAN Enabled + + 0 + + + 0 + + 1 + m_MiddleButtonPANOpt + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Allows auto pan when creating a track, or moving an item. + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnMiddleBtnPanEnbl + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_MIDDLEBUTTONPAN + Middle Button PAN Limited + + 0 + + + 0 + + 1 + m_OptMiddleButtonPanLimited + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Allows auto pan when creating a track, or moving an item. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_AUTOPAN + Auto PAN + + 0 + + + 0 + + 1 + m_AutoPANOpt + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Allows auto pan when creating a track, or moving an item. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - wxEXPAND - 1 - - - bMiddleLeftSizer - wxVERTICAL - none - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Max Links: - - - 0 - - - 0 - - 1 - m_staticTextmaxlinks - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 1 - - 5 - - 0 - - 1 - - 0 - - 1 - m_MaxShowLinks - 1 - - - protected - 1 - - - Resizable - - 1 - - wxSP_ARROW_KEYS - - 0 - Adjust the number of ratsnets shown from cursor to closest pads - - wxFILTER_NONE - wxDefaultValidator - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Auto Save (minutes): - - - 0 - - - 0 - - 1 - m_staticTextautosave - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 0 - - 60 - - 0 - - 0 - - 0 - - 1 - m_SaveTime - 1 - - - protected - 1 - - - Resizable - - 1 - - wxSP_ARROW_KEYS - - 0 - Delay after the first change to create a backup file of the board on disk. - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Rotation Angle - - - 0 - - - 0 - - 1 - m_staticTextRotationAngle - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - "45" "90" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_RotationAngle - 1 - - - protected - 1 - - - Resizable - - 0 - 1 - - - 0 - Footprints rotation increment, for rotate menu or hot key. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 1 - + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 wxID_ANY - Options: + + 0 + + + 0 - bMiddleRightBoxSizer - wxVERTICAL - none + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_DRC_ONOFF - Drc ON - - - 0 - - - 0 - - 1 - m_DrcOn - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - Enable/disable the DRC control. When DRC is disable, all connections are allowed. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_GENERAL_RATSNEST - Show Ratsnest - - - 0 - - - 0 - - 1 - m_ShowGlobalRatsnest - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - Show (or not) the full rastnest. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_RATSNEST_MODULE - Show Mod Ratsnest - - - 0 - - - 0 - - 1 - m_ShowModuleRatsnest - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - Shows (or not) the local ratsnest relative to a footprint, when moving it. This ratsnest is useful to place a footprint. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_TRACK_AUTODEL - Tracks Auto Del - - - 0 - - - 0 - - 1 - m_TrackAutodel - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - Enable/disable the automatic track deletion when recreating a track. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_TRACKS45 - Track only 45 degrees - - - 0 - - - 0 - - 1 - m_Track_45_Only_Ctrl - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - If enabled, force tracks directions to H, V or 45 degrees, when creating a track. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_SEGMENTS45 - Segments 45 Only - - - 0 - - - 0 - - 1 - m_Segments_45_Only_Ctrl - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - If enabled, force segments directions to H, V or 45 degrees, when creating a segment on technical layers. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_AUTOPAN - Auto PAN - - - 0 - - - 0 - - 1 - m_AutoPANOpt - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - Allows auto pan when creating a track, or moving an item. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Double Segm Track - - - 0 - - - 0 - - 1 - m_Track_DoubleSegm_Ctrl - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - If enabled, uses two track segments, with 45 degrees angle between them when creating a new track - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 wxEXPAND - 1 - + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 - bRightSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - "Never" "When creating tracks" "Always" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Magnetic Pads - - 1 - - 0 - - - 0 - - 1 - m_MagneticPadOptCtrl - 1 - - - protected - 1 - - - Resizable - - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - control the capture of the pcb cursor when the mouse cursor enters a pad area - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - "Never" "When creating tracks" "Always" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_MAGNETIC_TRACKS - Magnetic Tracks - - 1 - - 0 - - - 0 - - 1 - m_MagneticTrackOptCtrl - 1 - - - protected - 1 - - - Resizable - - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - Control the capture of the pcb cursor when the mouse cursor enters a track - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_OK - OK - - - 0 - - - 0 - - 1 - m_buttonOK - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnOkClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_HORIZONTAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - Cancel - - - 0 - - - 0 - - 1 - m_buttonCANCEL - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - + m_sdbSizer + protected + + OnCancelClick + + + + OnOkClick + + diff --git a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h index baec1f0bf4..fce8addba9 100644 --- a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h +++ b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 30 2011) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -23,15 +23,16 @@ #include #include #include +#include #include #include /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -/// Class DialogGeneralOptionsBoardEditor_base +/// Class DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE /////////////////////////////////////////////////////////////////////////////// -class DialogGeneralOptionsBoardEditor_base : public wxDialog +class DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE : public wxDialog { private: @@ -47,8 +48,9 @@ class DialogGeneralOptionsBoardEditor_base : public wxDialog wxID_TRACK_AUTODEL, wxID_TRACKS45, wxID_SEGMENTS45, - wxID_AUTOPAN, wxID_MAGNETIC_TRACKS, + wxID_MIDDLEBUTTONPAN, + wxID_AUTOPAN }; wxRadioBox* m_PolarDisplay; @@ -66,22 +68,27 @@ class DialogGeneralOptionsBoardEditor_base : public wxDialog wxCheckBox* m_TrackAutodel; wxCheckBox* m_Track_45_Only_Ctrl; wxCheckBox* m_Segments_45_Only_Ctrl; - wxCheckBox* m_AutoPANOpt; wxCheckBox* m_Track_DoubleSegm_Ctrl; wxRadioBox* m_MagneticPadOptCtrl; wxRadioBox* m_MagneticTrackOptCtrl; - wxButton* m_buttonOK; - wxButton* m_buttonCANCEL; + wxCheckBox* m_MiddleButtonPANOpt; + wxCheckBox* m_OptMiddleButtonPanLimited; + wxCheckBox* m_AutoPANOpt; + wxStaticLine* m_staticline1; + wxStdDialogButtonSizer* m_sdbSizer; + wxButton* m_sdbSizerOK; + wxButton* m_sdbSizerCancel; // Virtual event handlers, overide them in your derived class - virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } public: - DialogGeneralOptionsBoardEditor_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("General settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 585,280 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DialogGeneralOptionsBoardEditor_base(); + DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("General settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 611,346 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE(); }; diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index 71cf632012..709d16e51b 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -89,7 +89,7 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) case wxID_PREFERENCES: { - Dialog_GeneralOptions dlg( this ); + DIALOG_GENERALOPTIONS dlg( this ); dlg.ShowModal(); } break;