← Back to team overview

kicad-developers team mailing list archive

[PATCH] Reusable GAL options panel

 

Hi,

Here is a patch set for a reusable GAL options panel, which allows any
GAL-aware program to set the GAL options in a dialog easily.

This includes a new dialog for Modedit that uses the new panel,
closing the bug about not being able to change Modedit grid type.

Gerbview's new GAL mode should be able to use this too.

Third patch is a quick refactor for the Pcbnew display prefs panel,
which removes the old manual event handling and uses
TransferDataTo/FromWindow instead.

Cheers,

John
From 57a39c6ff6a4339d8ef07dd0ec505cd17a46efec Mon Sep 17 00:00:00 2001
From: John Beard <john.j.beard@xxxxxxxxx>
Date: Tue, 14 Mar 2017 00:13:04 +0800
Subject: [PATCH 3/3] Use TransferData* methods for DIALOG_DISPLAY_OPTIONS

Replaces the existing manual evdent handling, in line with UI
Guidelines.

Also remove the wxStaticLine, which is not a standard dialog element.
---
 pcbnew/dialogs/dialog_display_options.cpp      | 40 +++++-------
 pcbnew/dialogs/dialog_display_options.h        | 17 +++--
 pcbnew/dialogs/dialog_display_options_base.cpp | 13 +---
 pcbnew/dialogs/dialog_display_options_base.fbp | 89 ++------------------------
 pcbnew/dialogs/dialog_display_options_base.h   |  7 --
 5 files changed, 29 insertions(+), 137 deletions(-)

diff --git a/pcbnew/dialogs/dialog_display_options.cpp b/pcbnew/dialogs/dialog_display_options.cpp
index 4837f30b6..9a9186424 100644
--- a/pcbnew/dialogs/dialog_display_options.cpp
+++ b/pcbnew/dialogs/dialog_display_options.cpp
@@ -64,17 +64,15 @@ void PCB_EDIT_FRAME::InstallDisplayOptionsDialog( wxCommandEvent& aEvent )
 
 
 DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( PCB_EDIT_FRAME* parent ) :
-    DIALOG_DISPLAY_OPTIONS_BASE( parent )
+    DIALOG_DISPLAY_OPTIONS_BASE( parent ),
+    m_parent( parent )
 {
-    m_Parent = parent;
-
-    KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_Parent->GetGalDisplayOptions();
+    KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_parent->GetGalDisplayOptions();
     m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions );
 
     sLeftSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 );
 
-    // load settings into controls
-    init();
+    SetFocus();
 
     m_sdbSizerOK->SetDefault();
 
@@ -83,11 +81,9 @@ DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( PCB_EDIT_FRAME* parent ) :
 }
 
 
-void DIALOG_DISPLAY_OPTIONS::init()
+bool DIALOG_DISPLAY_OPTIONS::TransferDataToWindow()
 {
-    SetFocus();
-
-    const DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
+    const DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) m_parent->GetDisplayOptions();
 
     m_OptDisplayTracks->SetValue( displ_opts->m_DisplayPcbTrackFill == SKETCH );
 
@@ -97,34 +93,30 @@ void DIALOG_DISPLAY_OPTIONS::init()
     m_OptDisplayPads->SetValue( displ_opts->m_DisplayPadFill == SKETCH );
     m_OptDisplayVias->SetValue( displ_opts->m_DisplayViaFill == SKETCH );
 
-    m_Show_Page_Limits->SetValue( m_Parent->ShowPageLimits() );
+    m_Show_Page_Limits->SetValue( m_parent->ShowPageLimits() );
 
     m_OptDisplayModTexts->SetValue( displ_opts->m_DisplayModTextFill == SKETCH );
     m_OptDisplayModOutlines->SetValue( displ_opts->m_DisplayModEdgeFill == SKETCH );
     m_OptDisplayPadClearence->SetValue( displ_opts->m_DisplayPadIsol );
     m_OptDisplayPadNumber->SetValue( displ_opts->m_DisplayPadNum );
-    m_OptDisplayPadNoConn->SetValue( m_Parent->IsElementVisible( PCB_VISIBLE( NO_CONNECTS_VISIBLE ) ) );
+    m_OptDisplayPadNoConn->SetValue( m_parent->IsElementVisible( PCB_VISIBLE( NO_CONNECTS_VISIBLE ) ) );
     m_OptDisplayDrawings->SetValue( displ_opts->m_DisplayDrawItemsFill == SKETCH );
     m_ShowNetNamesOption->SetSelection( displ_opts->m_DisplayNetNamesMode );
 
     m_galOptsPanel->TransferDataToWindow();
-}
-
 
-void DIALOG_DISPLAY_OPTIONS::OnCancelClick( wxCommandEvent& event )
-{
-    EndModal( 0 );
+    return true;
 }
 
 
 /*
  * Update variables with new options
  */
-void DIALOG_DISPLAY_OPTIONS::OnOkClick( wxCommandEvent& event )
+bool DIALOG_DISPLAY_OPTIONS::TransferDataFromWindow()
 {
-    DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
+    DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) m_parent->GetDisplayOptions();
 
-    m_Parent->SetShowPageLimits( m_Show_Page_Limits->GetValue() );
+    m_parent->SetShowPageLimits( m_Show_Page_Limits->GetValue() );
 
     displ_opts->m_DisplayPcbTrackFill = not m_OptDisplayTracks->GetValue();
 
@@ -141,7 +133,7 @@ void DIALOG_DISPLAY_OPTIONS::OnOkClick( wxCommandEvent& event )
 
     displ_opts->m_DisplayPadNum = m_OptDisplayPadNumber->GetValue();
 
-    m_Parent->SetElementVisibility( PCB_VISIBLE( NO_CONNECTS_VISIBLE ),
+    m_parent->SetElementVisibility( PCB_VISIBLE( NO_CONNECTS_VISIBLE ),
                                     m_OptDisplayPadNoConn->GetValue() );
 
     displ_opts->m_DisplayDrawItemsFill = not m_OptDisplayDrawings->GetValue();
@@ -150,7 +142,7 @@ void DIALOG_DISPLAY_OPTIONS::OnOkClick( wxCommandEvent& event )
     m_galOptsPanel->TransferDataFromWindow();
 
     // Apply changes to the GAL
-    KIGFX::VIEW* view = m_Parent->GetGalCanvas()->GetView();
+    KIGFX::VIEW* view = m_parent->GetGalCanvas()->GetView();
     KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( view->GetPainter() );
     KIGFX::PCB_RENDER_SETTINGS* settings =
             static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
@@ -158,7 +150,7 @@ void DIALOG_DISPLAY_OPTIONS::OnOkClick( wxCommandEvent& event )
     view->RecacheAllItems();
     view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
 
-    m_Parent->GetCanvas()->Refresh();
+    m_parent->GetCanvas()->Refresh();
 
-    EndModal( 1 );
+    return true;
 }
diff --git a/pcbnew/dialogs/dialog_display_options.h b/pcbnew/dialogs/dialog_display_options.h
index ec67f345e..b31f2561b 100644
--- a/pcbnew/dialogs/dialog_display_options.h
+++ b/pcbnew/dialogs/dialog_display_options.h
@@ -31,17 +31,16 @@ class GAL_OPTIONS_PANEL;
 
 class DIALOG_DISPLAY_OPTIONS : public DIALOG_DISPLAY_OPTIONS_BASE
 {
-private:
-   PCB_EDIT_FRAME* m_Parent;
-
-   GAL_OPTIONS_PANEL* m_galOptsPanel;
-
-   void init();
-
 public:
    DIALOG_DISPLAY_OPTIONS( PCB_EDIT_FRAME* parent );
    ~DIALOG_DISPLAY_OPTIONS() {};
-   void OnOkClick( wxCommandEvent& event ) override;
-   void OnCancelClick( wxCommandEvent& event ) override;
+
+   bool TransferDataFromWindow() override;
+   bool TransferDataToWindow() override;
+
+private:
+   PCB_EDIT_FRAME* m_parent;
+
+   GAL_OPTIONS_PANEL* m_galOptsPanel;
 };
 
diff --git a/pcbnew/dialogs/dialog_display_options_base.cpp b/pcbnew/dialogs/dialog_display_options_base.cpp
index 969a3044d..3dfea2003 100644
--- a/pcbnew/dialogs/dialog_display_options_base.cpp
+++ b/pcbnew/dialogs/dialog_display_options_base.cpp
@@ -104,14 +104,11 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi
 	sRightSizer->Add( s_otherSizer, 1, wxEXPAND|wxALL, 5 );
 	
 	
-	bupperSizer->Add( sRightSizer, 0, 0, 5 );
+	bupperSizer->Add( sRightSizer, 0, wxEXPAND, 5 );
 	
 	
 	bMainSizer->Add( bupperSizer, 1, wxEXPAND, 5 );
 	
-	m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
-	bMainSizer->Add( m_staticline1, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
-	
 	m_sdbSizer = new wxStdDialogButtonSizer();
 	m_sdbSizerOK = new wxButton( this, wxID_OK );
 	m_sdbSizer->AddButton( m_sdbSizerOK );
@@ -125,16 +122,8 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi
 	this->SetSizer( bMainSizer );
 	this->Layout();
 	bMainSizer->Fit( this );
-	
-	// Connect Events
-	m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnCancelClick ), NULL, this );
-	m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnOkClick ), NULL, this );
 }
 
 DIALOG_DISPLAY_OPTIONS_BASE::~DIALOG_DISPLAY_OPTIONS_BASE()
 {
-	// Disconnect Events
-	m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnCancelClick ), NULL, this );
-	m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnOkClick ), NULL, this );
-	
 }
diff --git a/pcbnew/dialogs/dialog_display_options_base.fbp b/pcbnew/dialogs/dialog_display_options_base.fbp
index 26b322891..4e5dcf304 100644
--- a/pcbnew/dialogs/dialog_display_options_base.fbp
+++ b/pcbnew/dialogs/dialog_display_options_base.fbp
@@ -499,9 +499,9 @@
                                 </object>
                             </object>
                         </object>
-                        <object class="sizeritem" expanded="0">
+                        <object class="sizeritem" expanded="1">
                             <property name="border">5</property>
-                            <property name="flag"></property>
+                            <property name="flag">wxEXPAND</property>
                             <property name="proportion">0</property>
                             <object class="wxBoxSizer" expanded="0">
                                 <property name="minimum_size"></property>
@@ -1248,87 +1248,6 @@
                 </object>
                 <object class="sizeritem" expanded="0">
                     <property name="border">5</property>
-                    <property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
-                    <property name="proportion">0</property>
-                    <object class="wxStaticLine" expanded="0">
-                        <property name="BottomDockable">1</property>
-                        <property name="LeftDockable">1</property>
-                        <property name="RightDockable">1</property>
-                        <property name="TopDockable">1</property>
-                        <property name="aui_layer"></property>
-                        <property name="aui_name"></property>
-                        <property name="aui_position"></property>
-                        <property name="aui_row"></property>
-                        <property name="best_size"></property>
-                        <property name="bg"></property>
-                        <property name="caption"></property>
-                        <property name="caption_visible">1</property>
-                        <property name="center_pane">0</property>
-                        <property name="close_button">1</property>
-                        <property name="context_help"></property>
-                        <property name="context_menu">1</property>
-                        <property name="default_pane">0</property>
-                        <property name="dock">Dock</property>
-                        <property name="dock_fixed">0</property>
-                        <property name="docking">Left</property>
-                        <property name="enabled">1</property>
-                        <property name="fg"></property>
-                        <property name="floatable">1</property>
-                        <property name="font"></property>
-                        <property name="gripper">0</property>
-                        <property name="hidden">0</property>
-                        <property name="id">wxID_ANY</property>
-                        <property name="max_size"></property>
-                        <property name="maximize_button">0</property>
-                        <property name="maximum_size"></property>
-                        <property name="min_size"></property>
-                        <property name="minimize_button">0</property>
-                        <property name="minimum_size"></property>
-                        <property name="moveable">1</property>
-                        <property name="name">m_staticline1</property>
-                        <property name="pane_border">1</property>
-                        <property name="pane_position"></property>
-                        <property name="pane_size"></property>
-                        <property name="permission">protected</property>
-                        <property name="pin_button">1</property>
-                        <property name="pos"></property>
-                        <property name="resize">Resizable</property>
-                        <property name="show">1</property>
-                        <property name="size"></property>
-                        <property name="style">wxLI_HORIZONTAL</property>
-                        <property name="subclass"></property>
-                        <property name="toolbar_pane">0</property>
-                        <property name="tooltip"></property>
-                        <property name="window_extra_style"></property>
-                        <property name="window_name"></property>
-                        <property name="window_style"></property>
-                        <event name="OnChar"></event>
-                        <event name="OnEnterWindow"></event>
-                        <event name="OnEraseBackground"></event>
-                        <event name="OnKeyDown"></event>
-                        <event name="OnKeyUp"></event>
-                        <event name="OnKillFocus"></event>
-                        <event name="OnLeaveWindow"></event>
-                        <event name="OnLeftDClick"></event>
-                        <event name="OnLeftDown"></event>
-                        <event name="OnLeftUp"></event>
-                        <event name="OnMiddleDClick"></event>
-                        <event name="OnMiddleDown"></event>
-                        <event name="OnMiddleUp"></event>
-                        <event name="OnMotion"></event>
-                        <event name="OnMouseEvents"></event>
-                        <event name="OnMouseWheel"></event>
-                        <event name="OnPaint"></event>
-                        <event name="OnRightDClick"></event>
-                        <event name="OnRightDown"></event>
-                        <event name="OnRightUp"></event>
-                        <event name="OnSetFocus"></event>
-                        <event name="OnSize"></event>
-                        <event name="OnUpdateUI"></event>
-                    </object>
-                </object>
-                <object class="sizeritem" expanded="0">
-                    <property name="border">5</property>
                     <property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
                     <property name="proportion">0</property>
                     <object class="wxStdDialogButtonSizer" expanded="0">
@@ -1344,11 +1263,11 @@
                         <property name="name">m_sdbSizer</property>
                         <property name="permission">protected</property>
                         <event name="OnApplyButtonClick"></event>
-                        <event name="OnCancelButtonClick">OnCancelClick</event>
+                        <event name="OnCancelButtonClick"></event>
                         <event name="OnContextHelpButtonClick"></event>
                         <event name="OnHelpButtonClick"></event>
                         <event name="OnNoButtonClick"></event>
-                        <event name="OnOKButtonClick">OnOkClick</event>
+                        <event name="OnOKButtonClick"></event>
                         <event name="OnSaveButtonClick"></event>
                         <event name="OnYesButtonClick"></event>
                     </object>
diff --git a/pcbnew/dialogs/dialog_display_options_base.h b/pcbnew/dialogs/dialog_display_options_base.h
index 01b9921c1..7bc54919f 100644
--- a/pcbnew/dialogs/dialog_display_options_base.h
+++ b/pcbnew/dialogs/dialog_display_options_base.h
@@ -23,7 +23,6 @@ class DIALOG_SHIM;
 #include <wx/sizer.h>
 #include <wx/statbox.h>
 #include <wx/radiobox.h>
-#include <wx/statline.h>
 #include <wx/button.h>
 #include <wx/dialog.h>
 
@@ -56,15 +55,9 @@ class DIALOG_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM
 		wxCheckBox* m_OptDisplayPadNoConn;
 		wxCheckBox* m_OptDisplayDrawings;
 		wxCheckBox* m_Show_Page_Limits;
-		wxStaticLine* m_staticline1;
 		wxStdDialogButtonSizer* m_sdbSizer;
 		wxButton* m_sdbSizerOK;
 		wxButton* m_sdbSizerCancel;
-		
-		// Virtual event handlers, overide them in your derived class
-		virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
-		virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
-		
 	
 	public:
 		
-- 
2.12.0

From 1cc86a31e65d71bb5c0c635536c571cd488fd568 Mon Sep 17 00:00:00 2001
From: John Beard <john.j.beard@xxxxxxxxx>
Date: Mon, 13 Mar 2017 23:18:30 +0800
Subject: [PATCH 2/3] Add a display settings dialog to Modedit

For a start, this contains the GAL display settings (AA settings and
grid styling).

In future, other modedit-specific settings could go here too.

Fixes: lp:1672150
* https://bugs.launchpad.net/kicad/+bug/1672150
---
 pcbnew/CMakeLists.txt                             |  1 +
 pcbnew/dialogs/dialog_modedit_display_options.cpp | 89 +++++++++++++++++++++++
 pcbnew/dialogs/dialog_modedit_display_options.h   | 45 ++++++++++++
 pcbnew/menubar_modedit.cpp                        |  5 ++
 pcbnew/module_editor_frame.h                      |  2 +
 pcbnew/moduleframe.cpp                            |  7 ++
 6 files changed, 149 insertions(+)
 create mode 100644 pcbnew/dialogs/dialog_modedit_display_options.cpp
 create mode 100644 pcbnew/dialogs/dialog_modedit_display_options.h

diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt
index e9b08a10c..b68610ad9 100644
--- a/pcbnew/CMakeLists.txt
+++ b/pcbnew/CMakeLists.txt
@@ -113,6 +113,7 @@ set( PCBNEW_DIALOGS
     dialogs/dialog_layer_selection_base.cpp
     dialogs/dialog_layers_setup.cpp
     dialogs/dialog_layers_setup_base.cpp
+    dialogs/dialog_modedit_display_options.cpp
     dialogs/dialog_modedit_options.cpp
     dialogs/dialog_modedit_options_base.cpp
     dialogs/dialog_netlist.cpp
diff --git a/pcbnew/dialogs/dialog_modedit_display_options.cpp b/pcbnew/dialogs/dialog_modedit_display_options.cpp
new file mode 100644
index 000000000..808eab705
--- /dev/null
+++ b/pcbnew/dialogs/dialog_modedit_display_options.cpp
@@ -0,0 +1,89 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ */
+
+#include <dialog_modedit_display_options.h>
+
+#include <class_drawpanel.h>
+#include <module_editor_frame.h>
+
+#include <view/view.h>
+
+#include <widgets/gal_options_panel.h>
+
+
+bool DIALOG_MODEDIT_DISPLAY_OPTIONS::Invoke( FOOTPRINT_EDIT_FRAME& aCaller )
+{
+    DIALOG_MODEDIT_DISPLAY_OPTIONS dlg( aCaller );
+
+    int ret = dlg.ShowModal();
+
+    return ret == wxID_OK;
+}
+
+
+DIALOG_MODEDIT_DISPLAY_OPTIONS::DIALOG_MODEDIT_DISPLAY_OPTIONS( FOOTPRINT_EDIT_FRAME& aParent ) :
+    DIALOG_SHIM( &aParent, wxID_ANY, _( "Display Options" ) ),
+    m_parent( aParent )
+{
+    auto mainSizer = new wxBoxSizer( wxVERTICAL );
+    SetSizer( mainSizer );
+
+    // install GAL options pane
+    KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_parent.GetGalDisplayOptions();
+
+    m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions );
+    mainSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 );
+
+    auto btnSizer = new wxStdDialogButtonSizer();
+    mainSizer->Add( btnSizer, 0, wxEXPAND | wxBOTTOM | wxLEFT | wxRIGHT, 5 );
+
+    btnSizer->AddButton( new wxButton( this, wxID_OK ) );
+    btnSizer->AddButton( new wxButton( this, wxID_CANCEL ) );
+
+    btnSizer->Realize();
+
+    GetSizer()->SetSizeHints( this );
+    Centre();
+}
+
+
+bool DIALOG_MODEDIT_DISPLAY_OPTIONS::TransferDataToWindow()
+{
+    // update GAL options
+    return m_galOptsPanel->TransferDataToWindow();
+}
+
+
+bool DIALOG_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow()
+{
+    // update GAL options
+    m_galOptsPanel->TransferDataFromWindow();
+
+    // refresh view
+    KIGFX::VIEW* view = m_parent.GetGalCanvas()->GetView();
+    view->RecacheAllItems();
+    view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
+    m_parent.GetCanvas()->Refresh();
+
+    return true;
+}
diff --git a/pcbnew/dialogs/dialog_modedit_display_options.h b/pcbnew/dialogs/dialog_modedit_display_options.h
new file mode 100644
index 000000000..4bab8abac
--- /dev/null
+++ b/pcbnew/dialogs/dialog_modedit_display_options.h
@@ -0,0 +1,45 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ */
+
+#include <dialog_shim.h>
+
+class GAL_OPTIONS_PANEL;
+class FOOTPRINT_EDIT_FRAME;
+
+class DIALOG_MODEDIT_DISPLAY_OPTIONS : public DIALOG_SHIM
+{
+public:
+    DIALOG_MODEDIT_DISPLAY_OPTIONS( FOOTPRINT_EDIT_FRAME& aParent );
+
+    static bool Invoke( FOOTPRINT_EDIT_FRAME& aCaller );
+
+private:
+
+    bool TransferDataToWindow() override;
+    bool TransferDataFromWindow() override;
+
+    FOOTPRINT_EDIT_FRAME& m_parent;
+
+    // subpanel
+    GAL_OPTIONS_PANEL* m_galOptsPanel;
+};
diff --git a/pcbnew/menubar_modedit.cpp b/pcbnew/menubar_modedit.cpp
index 4eade3e9b..e04003eb5 100644
--- a/pcbnew/menubar_modedit.cpp
+++ b/pcbnew/menubar_modedit.cpp
@@ -327,6 +327,11 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
                  _( "&Settings" ), _( "Change the footprint editor settings." ),
                  KiBitmap( preference_xpm ) );
 
+    AddMenuItem( prefs_menu, ID_PCB_DISPLAY_OPTIONS_SETUP,
+                 _( "&Display" ),
+                 _( "Change footprint editor display settings" ),
+                 KiBitmap( display_options_xpm ) );
+
     // Language submenu
     Pgm().AddMenuLanguageList( prefs_menu );
 
diff --git a/pcbnew/module_editor_frame.h b/pcbnew/module_editor_frame.h
index d89a701b6..310e00122 100644
--- a/pcbnew/module_editor_frame.h
+++ b/pcbnew/module_editor_frame.h
@@ -32,9 +32,11 @@
 #include <wxBasePcbFrame.h>
 #include <pcb_base_edit_frame.h>
 #include <io_mgr.h>
+#include <config_params.h>
 
 class PCB_LAYER_WIDGET;
 class FP_LIB_TABLE;
+class EDGE_MODULE;
 
 namespace PCB { struct IFACE; }     // A KIFACE_I coded in pcbnew.c
 
diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp
index 2255d1f59..f9deadbd8 100644
--- a/pcbnew/moduleframe.cpp
+++ b/pcbnew/moduleframe.cpp
@@ -51,6 +51,7 @@
 #include <pcbnew.h>
 #include <pcbnew_id.h>
 #include <hotkeys.h>
+#include <dialogs/dialog_modedit_display_options.h>
 #include <dialog_hotkeys_editor.h>
 #include <module_editor_frame.h>
 #include <modview_frame.h>
@@ -139,6 +140,8 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
               FOOTPRINT_EDIT_FRAME::ProcessPreferences )
     EVT_MENU( wxID_PREFERENCES,
               FOOTPRINT_EDIT_FRAME::ProcessPreferences )
+    EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP,
+              FOOTPRINT_EDIT_FRAME::ProcessPreferences )
     EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, FOOTPRINT_EDIT_FRAME::OnConfigurePaths )
 
     // popup commands
@@ -929,6 +932,10 @@ void FOOTPRINT_EDIT_FRAME::ProcessPreferences( wxCommandEvent& event )
         InvokeFPEditorPrefsDlg( this );
         break;
 
+    case ID_PCB_DISPLAY_OPTIONS_SETUP:
+        DIALOG_MODEDIT_DISPLAY_OPTIONS::Invoke( *this );
+        break;
+
     default:
         DisplayError( this, "FOOTPRINT_EDIT_FRAME::ProcessPreferences error" );
     }
-- 
2.12.0

From 05068b5056e60062ce05d72886ac9c57aa8986dc Mon Sep 17 00:00:00 2001
From: John Beard <john.j.beard@xxxxxxxxx>
Date: Mon, 13 Mar 2017 17:42:12 +0800
Subject: [PATCH 1/3] Make GAL options panel a reusable panel

The primary motivation here is to allow other GAL canvas users (eg
Modedit, and soon Gerbview) to be able to easily modify GAL canvas
options.

For now, this doesn't change the display properties dialog in
appearance, but if more GAL options are added, it might need a bit of
tweak and maybe tabs or similar, like Eeschema preferences.
---
 common/CMakeLists.txt                          |   1 +
 common/widgets/gal_options_panel.cpp           | 213 ++++++
 include/widgets/gal_options_panel.h            |  73 ++
 pcbnew/dialogs/dialog_display_options.cpp      |  72 +-
 pcbnew/dialogs/dialog_display_options.h        |   5 +-
 pcbnew/dialogs/dialog_display_options_base.cpp |  64 +-
 pcbnew/dialogs/dialog_display_options_base.fbp | 934 +------------------------
 pcbnew/dialogs/dialog_display_options_base.h   |  17 +-
 8 files changed, 312 insertions(+), 1067 deletions(-)
 create mode 100644 common/widgets/gal_options_panel.cpp
 create mode 100644 include/widgets/gal_options_panel.h

diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index e456109a7..4f94bdcb9 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -166,6 +166,7 @@ set( COMMON_DLG_SRCS
 
 set( COMMON_WIDGET_SRCS
     widgets/color_swatch.cpp
+    widgets/gal_options_panel.cpp
     widgets/mathplot.cpp
     widgets/widget_hotkey_list.cpp
     widgets/two_column_tree_list.cpp
diff --git a/common/widgets/gal_options_panel.cpp b/common/widgets/gal_options_panel.cpp
new file mode 100644
index 000000000..fa62fe653
--- /dev/null
+++ b/common/widgets/gal_options_panel.cpp
@@ -0,0 +1,213 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2017 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 <widgets/gal_options_panel.h>
+
+#include <common.h>
+
+#include <incremental_text_ctrl.h>
+#include <config_map.h>
+
+/*
+ * Spin control parameters
+ */
+static const double gridThicknessMin = 0.5;
+static const double gridThicknessMax = 10.0;
+static const double gridThicknessStep = 0.5;
+
+static const double gridMinSpacingMin = 5;
+static const double gridMinSpacingMax = 200;
+static const double gridMinSpacingStep = 5;
+
+
+static const UTIL::CFG_MAP<KIGFX::GRID_STYLE> gridStyleSelectMap =
+{
+    { KIGFX::GRID_STYLE::DOTS,        0 },  // Default
+    { KIGFX::GRID_STYLE::LINES,       1 },
+    { KIGFX::GRID_STYLE::SMALL_CROSS, 2 },
+};
+
+
+static const UTIL::CFG_MAP<KIGFX::OPENGL_ANTIALIASING_MODE> aaModeSelectMap =
+{
+    { KIGFX::OPENGL_ANTIALIASING_MODE::NONE,              0 },    // Default
+    { KIGFX::OPENGL_ANTIALIASING_MODE::SUBSAMPLE_HIGH,    1 },
+    { KIGFX::OPENGL_ANTIALIASING_MODE::SUBSAMPLE_ULTRA,   2 },
+    { KIGFX::OPENGL_ANTIALIASING_MODE::SUPERSAMPLING_X2,  3 },
+    { KIGFX::OPENGL_ANTIALIASING_MODE::SUPERSAMPLING_X4,  4 },
+};
+
+
+GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTIONS& aGalOpts ):
+    wxPanel( aParent, wxID_ANY ),
+    m_galOptions( aGalOpts )
+{
+    // the main sizer that holds "columns" of settings
+    m_mainSizer = new wxBoxSizer( wxHORIZONTAL );
+    SetSizer( m_mainSizer );
+
+    // second-level sizers that are one "column" of settings each
+    wxBoxSizer* sLeftSizer = new wxBoxSizer( wxVERTICAL );
+    m_mainSizer->Add( sLeftSizer, 1, wxALL | wxEXPAND, 0 );
+
+    /*
+     * Anti-aliasing subpanel
+     */
+    {
+        wxStaticBoxSizer* sOpenGLRenderingSizer;
+        sOpenGLRenderingSizer = new wxStaticBoxSizer( new wxStaticBox( this,
+                wxID_ANY, _("OpenGL Rendering:") ), wxVERTICAL );
+
+        wxString m_choiceAntialiasingChoices[] = {
+            _("No Antialiasing"),
+            _("Subpixel Antialiasing (High Quality)"),
+            _("Subpixel Antialiasing (Ultra Quality)"),
+            _("Supersampling (2x)"),
+            _("Supersampling (4x)")
+        };
+        int m_choiceAntialiasingNChoices = sizeof( m_choiceAntialiasingChoices ) / sizeof( wxString );
+        m_choiceAntialiasing = new wxChoice( sOpenGLRenderingSizer->GetStaticBox(),
+                wxID_ANY, wxDefaultPosition, wxDefaultSize,
+                m_choiceAntialiasingNChoices, m_choiceAntialiasingChoices, 0 );
+        sOpenGLRenderingSizer->Add( m_choiceAntialiasing, 0, wxALL|wxEXPAND, 5 );
+
+        sLeftSizer->Add( sOpenGLRenderingSizer, 0, wxALL|wxEXPAND, 5 );
+    }
+
+    /*
+     * Grid setting subpanel
+     */
+    {
+        wxStaticBoxSizer* sGridSettings;
+        sGridSettings = new wxStaticBoxSizer( new wxStaticBox( this,
+                wxID_ANY, _("Grid Display (OpenGL && Cairo)") ), wxVERTICAL );
+
+        wxString m_gridStyleChoices[] = {
+            _("Dots"),
+            _("Lines"),
+            _("Small crosses")
+        };
+        int m_gridStyleNChoices = sizeof( m_gridStyleChoices ) / sizeof( wxString );
+        m_gridStyle = new wxRadioBox( sGridSettings->GetStaticBox(),
+                wxID_ANY, _("Grid Style"),
+                wxDefaultPosition, wxDefaultSize,
+                m_gridStyleNChoices, m_gridStyleChoices, 1, wxRA_SPECIFY_COLS );
+        sGridSettings->Add( m_gridStyle, 0, wxALL|wxEXPAND, 5 );
+
+        wxFlexGridSizer* sGridSettingsGrid;
+        sGridSettingsGrid = new wxFlexGridSizer( 0, 4, 0, 0 );
+        sGridSettingsGrid->AddGrowableCol( 1 );
+        sGridSettingsGrid->SetFlexibleDirection( wxBOTH );
+        sGridSettingsGrid->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+        l_gridLineWidth = new wxStaticText( sGridSettings->GetStaticBox(),
+                wxID_ANY, _("Grid thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
+        l_gridLineWidth->Wrap( -1 );
+        sGridSettingsGrid->Add( l_gridLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+        m_gridLineWidth = new wxTextCtrl( sGridSettings->GetStaticBox(),
+                wxID_ANY, _("0.5"), wxDefaultPosition, wxDefaultSize, 0 );
+        sGridSettingsGrid->Add( m_gridLineWidth, 0, wxEXPAND, 5 );
+
+        m_gridLineWidthSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(),
+                wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS );
+        sGridSettingsGrid->Add( m_gridLineWidthSpinBtn, 0, wxALL, 0 );
+
+        l_gridLineWidthUnits = new wxStaticText( sGridSettings->GetStaticBox(),
+                wxID_ANY, _("px"), wxDefaultPosition, wxDefaultSize, 0 );
+        l_gridLineWidthUnits->Wrap( -1 );
+        sGridSettingsGrid->Add( l_gridLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+        l_gridMinSpacing = new wxStaticText( sGridSettings->GetStaticBox(),
+                wxID_ANY, _("Min grid spacing:"), wxDefaultPosition, wxDefaultSize, 0 );
+        l_gridMinSpacing->Wrap( -1 );
+        sGridSettingsGrid->Add( l_gridMinSpacing, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+        m_gridMinSpacing = new wxTextCtrl( sGridSettings->GetStaticBox(),
+                wxID_ANY, _("10"), wxDefaultPosition, wxDefaultSize, 0 );
+        sGridSettingsGrid->Add( m_gridMinSpacing, 0, wxEXPAND, 5 );
+
+        m_gridMinSpacingSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(),
+                wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS );
+        sGridSettingsGrid->Add( m_gridMinSpacingSpinBtn, 0, wxALL, 0 );
+
+        l_gridMinSpacingUnits = new wxStaticText( sGridSettings->GetStaticBox(),
+                wxID_ANY, _("px"), wxDefaultPosition, wxDefaultSize, 0 );
+        l_gridMinSpacingUnits->Wrap( -1 );
+        sGridSettingsGrid->Add( l_gridMinSpacingUnits, 0, wxALL, 5 );
+
+        sGridSettings->Add( sGridSettingsGrid, 1, wxALL|wxEXPAND, 5 );
+
+        sLeftSizer->Add( sGridSettings, 1, wxALL | wxEXPAND, 5 );
+
+        // bind the spin buttons and text boxes
+        m_gridSizeIncrementer = std::make_unique<SPIN_INCREMENTAL_TEXT_CTRL>(
+                    *m_gridLineWidthSpinBtn, *m_gridLineWidth );
+
+        m_gridSizeIncrementer->SetStep( gridThicknessMin, gridThicknessMax,
+                                        gridThicknessStep );
+        m_gridSizeIncrementer->SetPrecision( 1 );
+
+        m_gridMinSpacingIncrementer = std::make_unique<SPIN_INCREMENTAL_TEXT_CTRL>(
+                    *m_gridMinSpacingSpinBtn, *m_gridMinSpacing );
+
+        m_gridMinSpacingIncrementer->SetStep( gridMinSpacingMin, gridMinSpacingMax,
+                                              gridMinSpacingStep );
+        m_gridMinSpacingIncrementer->SetPrecision( 0 ); // restrict to ints
+    }
+}
+
+
+bool GAL_OPTIONS_PANEL::TransferDataToWindow()
+{
+    m_choiceAntialiasing->SetSelection( UTIL::GetConfigForVal(
+            aaModeSelectMap, m_galOptions.gl_antialiasing_mode ) );
+
+    m_gridStyle->SetSelection( UTIL::GetConfigForVal(
+            gridStyleSelectMap, m_galOptions.m_gridStyle ) );
+
+    m_gridSizeIncrementer->SetValue( m_galOptions.m_gridLineWidth );
+
+    m_gridMinSpacingIncrementer->SetValue( m_galOptions.m_gridMinSpacing );
+
+    return true;
+}
+
+
+bool GAL_OPTIONS_PANEL::TransferDataFromWindow()
+{
+    m_galOptions.gl_antialiasing_mode = UTIL::GetValFromConfig(
+            aaModeSelectMap, m_choiceAntialiasing->GetSelection() );
+
+    m_galOptions.m_gridStyle = UTIL::GetValFromConfig(
+            gridStyleSelectMap, m_gridStyle->GetSelection() );
+
+    m_galOptions.m_gridLineWidth = m_gridSizeIncrementer->GetValue();
+
+    m_galOptions.m_gridMinSpacing = m_gridMinSpacingIncrementer->GetValue();
+
+    m_galOptions.NotifyChanged();
+
+    return true;
+}
diff --git a/include/widgets/gal_options_panel.h b/include/widgets/gal_options_panel.h
new file mode 100644
index 000000000..94d905f46
--- /dev/null
+++ b/include/widgets/gal_options_panel.h
@@ -0,0 +1,73 @@
+/*
+ * This program source code file is part of KiCad, a free EDA CAD application.
+ *
+ * Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you may find one here:
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * or you may search the http://www.gnu.org website for the version 2 license,
+ * or you may write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ */
+
+#ifndef WIDGETS_GAL_OPTIONS_PANEL__H_
+#define WIDGETS_GAL_OPTIONS_PANEL__H_
+
+#include <wx/wx.h>
+#include <wx/spinctrl.h>
+
+#include <gal/gal_display_options.h>
+
+class INCREMENTAL_TEXT_CTRL;
+
+class GAL_OPTIONS_PANEL: public wxPanel
+{
+public:
+
+    GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTIONS& aGalOpts );
+
+    /**
+     * Load the panel controls from the given opt
+     */
+    bool TransferDataToWindow() override;
+
+    /**
+     * Read the options set in the UI into the given options object
+     */
+    bool TransferDataFromWindow() override;
+
+private:
+
+    wxBoxSizer* m_mainSizer;
+
+    wxChoice* m_choiceAntialiasing;
+    wxRadioBox* m_gridStyle;
+    wxStaticText* l_gridLineWidth;
+    wxTextCtrl* m_gridLineWidth;
+    wxSpinButton* m_gridLineWidthSpinBtn;
+    wxStaticText* l_gridLineWidthUnits;
+    wxStaticText* l_gridMinSpacing;
+    wxTextCtrl* m_gridMinSpacing;
+    wxSpinButton* m_gridMinSpacingSpinBtn;
+    wxStaticText* l_gridMinSpacingUnits;
+
+    ///> The GAL options to read/write
+    KIGFX::GAL_DISPLAY_OPTIONS& m_galOptions;
+
+    std::unique_ptr<INCREMENTAL_TEXT_CTRL> m_gridSizeIncrementer;
+    std::unique_ptr<INCREMENTAL_TEXT_CTRL> m_gridMinSpacingIncrementer;
+};
+
+
+#endif // WIDGETS_GAL_OPTIONS_PANEL__H_
diff --git a/pcbnew/dialogs/dialog_display_options.cpp b/pcbnew/dialogs/dialog_display_options.cpp
index 4333c5697..4837f30b6 100644
--- a/pcbnew/dialogs/dialog_display_options.cpp
+++ b/pcbnew/dialogs/dialog_display_options.cpp
@@ -32,7 +32,6 @@
 #include <pcbnew.h>
 #include <wxPcbStruct.h>
 #include <pcbstruct.h>
-#include <incremental_text_ctrl.h>
 #include <config_map.h>
 
 #include <pcbnew_id.h>
@@ -43,26 +42,8 @@
 #include <class_draw_panel_gal.h>
 #include <view/view.h>
 #include <pcb_painter.h>
-#include <gal/gal_display_options.h>
 
-/*
- * Spin control parameters
- */
-static const double gridThicknessMin = 0.5;
-static const double gridThicknessMax = 10.0;
-static const double gridThicknessStep = 0.5;
-
-static const double gridMinSpacingMin = 5;
-static const double gridMinSpacingMax = 200;
-static const double gridMinSpacingStep = 5;
-
-
-static const UTIL::CFG_MAP<KIGFX::GRID_STYLE> gridStyleSelectMap =
-{
-    { KIGFX::GRID_STYLE::DOTS,        0 },  // Default
-    { KIGFX::GRID_STYLE::LINES,       1 },
-    { KIGFX::GRID_STYLE::SMALL_CROSS, 2 },
-};
+#include <widgets/gal_options_panel.h>
 
 
 static const UTIL::CFG_MAP<TRACE_CLEARANCE_DISPLAY_MODE_T> traceClearanceSelectMap =
@@ -75,16 +56,6 @@ static const UTIL::CFG_MAP<TRACE_CLEARANCE_DISPLAY_MODE_T> traceClearanceSelectM
 };
 
 
-static const UTIL::CFG_MAP<KIGFX::OPENGL_ANTIALIASING_MODE> aaModeSelectMap =
-{
-    { KIGFX::OPENGL_ANTIALIASING_MODE::NONE,              0 },    // Default
-    { KIGFX::OPENGL_ANTIALIASING_MODE::SUBSAMPLE_HIGH,    1 },
-    { KIGFX::OPENGL_ANTIALIASING_MODE::SUBSAMPLE_ULTRA,   2 },
-    { KIGFX::OPENGL_ANTIALIASING_MODE::SUPERSAMPLING_X2,  3 },
-    { KIGFX::OPENGL_ANTIALIASING_MODE::SUPERSAMPLING_X4,  4 },
-};
-
-
 void PCB_EDIT_FRAME::InstallDisplayOptionsDialog( wxCommandEvent& aEvent )
 {
     DIALOG_DISPLAY_OPTIONS dlg( this );
@@ -97,20 +68,10 @@ DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( PCB_EDIT_FRAME* parent ) :
 {
     m_Parent = parent;
 
-    // bind the spin button and text box
-    m_gridSizeIncrementer = std::make_unique<SPIN_INCREMENTAL_TEXT_CTRL>(
-                *m_gridLineWidthSpinBtn, *m_gridLineWidth );
+    KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_Parent->GetGalDisplayOptions();
+    m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions );
 
-    m_gridSizeIncrementer->SetStep( gridThicknessMin, gridThicknessMax,
-                                    gridThicknessStep );
-    m_gridSizeIncrementer->SetPrecision( 1 );
-
-    m_gridMinSpacingIncrementer = std::make_unique<SPIN_INCREMENTAL_TEXT_CTRL>(
-                *m_gridMinSpacingSpinBtn, *m_gridMinSpacing );
-
-    m_gridMinSpacingIncrementer->SetStep( gridMinSpacingMin, gridMinSpacingMax,
-                                          gridMinSpacingStep );
-    m_gridMinSpacingIncrementer->SetPrecision( 0 ); // restrict to ints
+    sLeftSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 );
 
     // load settings into controls
     init();
@@ -125,8 +86,8 @@ DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( PCB_EDIT_FRAME* parent ) :
 void DIALOG_DISPLAY_OPTIONS::init()
 {
     SetFocus();
+
     const DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
-    const KIGFX::GAL_DISPLAY_OPTIONS& gal_opts = m_Parent->GetGalDisplayOptions();
 
     m_OptDisplayTracks->SetValue( displ_opts->m_DisplayPcbTrackFill == SKETCH );
 
@@ -146,15 +107,7 @@ void DIALOG_DISPLAY_OPTIONS::init()
     m_OptDisplayDrawings->SetValue( displ_opts->m_DisplayDrawItemsFill == SKETCH );
     m_ShowNetNamesOption->SetSelection( displ_opts->m_DisplayNetNamesMode );
 
-    m_choiceAntialiasing->SetSelection( UTIL::GetConfigForVal(
-            aaModeSelectMap, gal_opts.gl_antialiasing_mode ) );
-
-    m_gridStyle->SetSelection( UTIL::GetConfigForVal(
-            gridStyleSelectMap, gal_opts.m_gridStyle ) );
-
-    m_gridSizeIncrementer->SetValue( gal_opts.m_gridLineWidth );
-
-    m_gridMinSpacingIncrementer->SetValue( gal_opts.m_gridMinSpacing );
+    m_galOptsPanel->TransferDataToWindow();
 }
 
 
@@ -170,7 +123,6 @@ void DIALOG_DISPLAY_OPTIONS::OnCancelClick( wxCommandEvent& event )
 void DIALOG_DISPLAY_OPTIONS::OnOkClick( wxCommandEvent& event )
 {
     DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
-    KIGFX::GAL_DISPLAY_OPTIONS& gal_opts = m_Parent->GetGalDisplayOptions();
 
     m_Parent->SetShowPageLimits( m_Show_Page_Limits->GetValue() );
 
@@ -195,17 +147,7 @@ void DIALOG_DISPLAY_OPTIONS::OnOkClick( wxCommandEvent& event )
     displ_opts->m_DisplayDrawItemsFill = not m_OptDisplayDrawings->GetValue();
     displ_opts->m_DisplayNetNamesMode = m_ShowNetNamesOption->GetSelection();
 
-    gal_opts.gl_antialiasing_mode = UTIL::GetValFromConfig(
-            aaModeSelectMap, m_choiceAntialiasing->GetSelection() );
-
-    gal_opts.m_gridStyle = UTIL::GetValFromConfig(
-            gridStyleSelectMap, m_gridStyle->GetSelection() );
-
-    gal_opts.m_gridLineWidth = m_gridSizeIncrementer->GetValue();
-
-    gal_opts.m_gridMinSpacing = m_gridMinSpacingIncrementer->GetValue();
-
-    gal_opts.NotifyChanged();
+    m_galOptsPanel->TransferDataFromWindow();
 
     // Apply changes to the GAL
     KIGFX::VIEW* view = m_Parent->GetGalCanvas()->GetView();
diff --git a/pcbnew/dialogs/dialog_display_options.h b/pcbnew/dialogs/dialog_display_options.h
index 6629c9e69..ec67f345e 100644
--- a/pcbnew/dialogs/dialog_display_options.h
+++ b/pcbnew/dialogs/dialog_display_options.h
@@ -27,15 +27,14 @@
  */
 #include <dialog_display_options_base.h>
 
-class INCREMENTAL_TEXT_CTRL;
+class GAL_OPTIONS_PANEL;
 
 class DIALOG_DISPLAY_OPTIONS : public DIALOG_DISPLAY_OPTIONS_BASE
 {
 private:
    PCB_EDIT_FRAME* m_Parent;
 
-   std::unique_ptr<INCREMENTAL_TEXT_CTRL> m_gridSizeIncrementer;
-   std::unique_ptr<INCREMENTAL_TEXT_CTRL> m_gridMinSpacingIncrementer;
+   GAL_OPTIONS_PANEL* m_galOptsPanel;
 
    void init();
 
diff --git a/pcbnew/dialogs/dialog_display_options_base.cpp b/pcbnew/dialogs/dialog_display_options_base.cpp
index 3d189c181..969a3044d 100644
--- a/pcbnew/dialogs/dialog_display_options_base.cpp
+++ b/pcbnew/dialogs/dialog_display_options_base.cpp
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version May  6 2016)
+// C++ code generated with wxFormBuilder (version Jan  9 2017)
 // http://www.wxformbuilder.org/
 //
 // PLEASE DO "NOT" EDIT THIS FILE!
@@ -19,7 +19,6 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi
 	wxBoxSizer* bupperSizer;
 	bupperSizer = new wxBoxSizer( wxHORIZONTAL );
 	
-	wxBoxSizer* sLeftSizer;
 	sLeftSizer = new wxBoxSizer( wxVERTICAL );
 	
 	wxStaticBoxSizer* sSketchModeSizer;
@@ -34,67 +33,6 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi
 	
 	sLeftSizer->Add( sSketchModeSizer, 0, wxALL|wxEXPAND, 5 );
 	
-	wxStaticBoxSizer* sOpenGLRenderingSizer;
-	sOpenGLRenderingSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("OpenGL Rendering:") ), wxVERTICAL );
-	
-	wxString m_choiceAntialiasingChoices[] = { _("No Antialiasing"), _("Subpixel Antialiasing (High Quality)"), _("Subpixel Antialiasing (Ultra Quality)"), _("Supersampling (2x)"), _("Supersampling (4x)") };
-	int m_choiceAntialiasingNChoices = sizeof( m_choiceAntialiasingChoices ) / sizeof( wxString );
-	m_choiceAntialiasing = new wxChoice( sOpenGLRenderingSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceAntialiasingNChoices, m_choiceAntialiasingChoices, 0 );
-	m_choiceAntialiasing->SetSelection( 0 );
-	sOpenGLRenderingSizer->Add( m_choiceAntialiasing, 0, wxALL|wxEXPAND, 5 );
-	
-	
-	sLeftSizer->Add( sOpenGLRenderingSizer, 0, wxALL|wxEXPAND, 5 );
-	
-	wxStaticBoxSizer* sGridSettings;
-	sGridSettings = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Grid Display (OpenGL && Cairo)") ), wxVERTICAL );
-	
-	wxString m_gridStyleChoices[] = { _("Dots"), _("Lines"), _("Small crosses") };
-	int m_gridStyleNChoices = sizeof( m_gridStyleChoices ) / sizeof( wxString );
-	m_gridStyle = new wxRadioBox( sGridSettings->GetStaticBox(), wxID_ANY, _("Grid Style"), wxDefaultPosition, wxDefaultSize, m_gridStyleNChoices, m_gridStyleChoices, 1, wxRA_SPECIFY_COLS );
-	m_gridStyle->SetSelection( 0 );
-	sGridSettings->Add( m_gridStyle, 0, wxALL|wxEXPAND, 5 );
-	
-	wxFlexGridSizer* sGridSettingsGrid;
-	sGridSettingsGrid = new wxFlexGridSizer( 0, 4, 0, 0 );
-	sGridSettingsGrid->AddGrowableCol( 1 );
-	sGridSettingsGrid->SetFlexibleDirection( wxBOTH );
-	sGridSettingsGrid->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-	
-	l_gridLineWidth = new wxStaticText( sGridSettings->GetStaticBox(), wxID_ANY, _("Grid thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
-	l_gridLineWidth->Wrap( -1 );
-	sGridSettingsGrid->Add( l_gridLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
-	
-	m_gridLineWidth = new wxTextCtrl( sGridSettings->GetStaticBox(), wxID_ANY, _("0.5"), wxDefaultPosition, wxDefaultSize, 0 );
-	sGridSettingsGrid->Add( m_gridLineWidth, 0, wxEXPAND, 5 );
-	
-	m_gridLineWidthSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS );
-	sGridSettingsGrid->Add( m_gridLineWidthSpinBtn, 0, wxALL, 0 );
-	
-	l_gridLineWidthUnits = new wxStaticText( sGridSettings->GetStaticBox(), wxID_ANY, _("px"), wxDefaultPosition, wxDefaultSize, 0 );
-	l_gridLineWidthUnits->Wrap( -1 );
-	sGridSettingsGrid->Add( l_gridLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
-	
-	l_gridMinSpacing = new wxStaticText( sGridSettings->GetStaticBox(), wxID_ANY, _("Min grid spacing:"), wxDefaultPosition, wxDefaultSize, 0 );
-	l_gridMinSpacing->Wrap( -1 );
-	sGridSettingsGrid->Add( l_gridMinSpacing, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
-	
-	m_gridMinSpacing = new wxTextCtrl( sGridSettings->GetStaticBox(), wxID_ANY, _("10"), wxDefaultPosition, wxDefaultSize, 0 );
-	sGridSettingsGrid->Add( m_gridMinSpacing, 0, wxEXPAND, 5 );
-	
-	m_gridMinSpacingSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS );
-	sGridSettingsGrid->Add( m_gridMinSpacingSpinBtn, 0, wxALL, 0 );
-	
-	l_gridMinSpacingUnits = new wxStaticText( sGridSettings->GetStaticBox(), wxID_ANY, _("px"), wxDefaultPosition, wxDefaultSize, 0 );
-	l_gridMinSpacingUnits->Wrap( -1 );
-	sGridSettingsGrid->Add( l_gridMinSpacingUnits, 0, wxALL, 5 );
-	
-	
-	sGridSettings->Add( sGridSettingsGrid, 1, wxALL|wxEXPAND, 5 );
-	
-	
-	sLeftSizer->Add( sGridSettings, 1, wxALL|wxEXPAND, 5 );
-	
 	
 	bupperSizer->Add( sLeftSizer, 1, wxEXPAND, 5 );
 	
diff --git a/pcbnew/dialogs/dialog_display_options_base.fbp b/pcbnew/dialogs/dialog_display_options_base.fbp
index 960b8087e..26b322891 100644
--- a/pcbnew/dialogs/dialog_display_options_base.fbp
+++ b/pcbnew/dialogs/dialog_display_options_base.fbp
@@ -110,12 +110,12 @@
                                 <property name="minimum_size"></property>
                                 <property name="name">sLeftSizer</property>
                                 <property name="orient">wxVERTICAL</property>
-                                <property name="permission">none</property>
-                                <object class="sizeritem" expanded="1">
+                                <property name="permission">protected</property>
+                                <object class="sizeritem" expanded="0">
                                     <property name="border">5</property>
                                     <property name="flag">wxALL|wxEXPAND</property>
                                     <property name="proportion">0</property>
-                                    <object class="wxStaticBoxSizer" expanded="1">
+                                    <object class="wxStaticBoxSizer" expanded="0">
                                         <property name="id">wxID_ANY</property>
                                         <property name="label">Tracks and Vias:</property>
                                         <property name="minimum_size"></property>
@@ -302,921 +302,13 @@
                                         </object>
                                     </object>
                                 </object>
-                                <object class="sizeritem" expanded="1">
-                                    <property name="border">5</property>
-                                    <property name="flag">wxALL|wxEXPAND</property>
-                                    <property name="proportion">0</property>
-                                    <object class="wxStaticBoxSizer" expanded="1">
-                                        <property name="id">wxID_ANY</property>
-                                        <property name="label">OpenGL Rendering:</property>
-                                        <property name="minimum_size"></property>
-                                        <property name="name">sOpenGLRenderingSizer</property>
-                                        <property name="orient">wxVERTICAL</property>
-                                        <property name="parent">1</property>
-                                        <property name="permission">none</property>
-                                        <event name="OnUpdateUI"></event>
-                                        <object class="sizeritem" expanded="0">
-                                            <property name="border">5</property>
-                                            <property name="flag">wxALL|wxEXPAND</property>
-                                            <property name="proportion">0</property>
-                                            <object class="wxChoice" expanded="0">
-                                                <property name="BottomDockable">1</property>
-                                                <property name="LeftDockable">1</property>
-                                                <property name="RightDockable">1</property>
-                                                <property name="TopDockable">1</property>
-                                                <property name="aui_layer"></property>
-                                                <property name="aui_name"></property>
-                                                <property name="aui_position"></property>
-                                                <property name="aui_row"></property>
-                                                <property name="best_size"></property>
-                                                <property name="bg"></property>
-                                                <property name="caption"></property>
-                                                <property name="caption_visible">1</property>
-                                                <property name="center_pane">0</property>
-                                                <property name="choices">&quot;No Antialiasing&quot; &quot;Subpixel Antialiasing (High Quality)&quot; &quot;Subpixel Antialiasing (Ultra Quality)&quot; &quot;Supersampling (2x)&quot; &quot;Supersampling (4x)&quot;</property>
-                                                <property name="close_button">1</property>
-                                                <property name="context_help"></property>
-                                                <property name="context_menu">1</property>
-                                                <property name="default_pane">0</property>
-                                                <property name="dock">Dock</property>
-                                                <property name="dock_fixed">0</property>
-                                                <property name="docking">Left</property>
-                                                <property name="enabled">1</property>
-                                                <property name="fg"></property>
-                                                <property name="floatable">1</property>
-                                                <property name="font"></property>
-                                                <property name="gripper">0</property>
-                                                <property name="hidden">0</property>
-                                                <property name="id">wxID_ANY</property>
-                                                <property name="max_size"></property>
-                                                <property name="maximize_button">0</property>
-                                                <property name="maximum_size"></property>
-                                                <property name="min_size"></property>
-                                                <property name="minimize_button">0</property>
-                                                <property name="minimum_size"></property>
-                                                <property name="moveable">1</property>
-                                                <property name="name">m_choiceAntialiasing</property>
-                                                <property name="pane_border">1</property>
-                                                <property name="pane_position"></property>
-                                                <property name="pane_size"></property>
-                                                <property name="permission">protected</property>
-                                                <property name="pin_button">1</property>
-                                                <property name="pos"></property>
-                                                <property name="resize">Resizable</property>
-                                                <property name="selection">0</property>
-                                                <property name="show">1</property>
-                                                <property name="size"></property>
-                                                <property name="style"></property>
-                                                <property name="subclass"></property>
-                                                <property name="toolbar_pane">0</property>
-                                                <property name="tooltip"></property>
-                                                <property name="validator_data_type"></property>
-                                                <property name="validator_style">wxFILTER_NONE</property>
-                                                <property name="validator_type">wxDefaultValidator</property>
-                                                <property name="validator_variable"></property>
-                                                <property name="window_extra_style"></property>
-                                                <property name="window_name"></property>
-                                                <property name="window_style"></property>
-                                                <event name="OnChar"></event>
-                                                <event name="OnChoice"></event>
-                                                <event name="OnEnterWindow"></event>
-                                                <event name="OnEraseBackground"></event>
-                                                <event name="OnKeyDown"></event>
-                                                <event name="OnKeyUp"></event>
-                                                <event name="OnKillFocus"></event>
-                                                <event name="OnLeaveWindow"></event>
-                                                <event name="OnLeftDClick"></event>
-                                                <event name="OnLeftDown"></event>
-                                                <event name="OnLeftUp"></event>
-                                                <event name="OnMiddleDClick"></event>
-                                                <event name="OnMiddleDown"></event>
-                                                <event name="OnMiddleUp"></event>
-                                                <event name="OnMotion"></event>
-                                                <event name="OnMouseEvents"></event>
-                                                <event name="OnMouseWheel"></event>
-                                                <event name="OnPaint"></event>
-                                                <event name="OnRightDClick"></event>
-                                                <event name="OnRightDown"></event>
-                                                <event name="OnRightUp"></event>
-                                                <event name="OnSetFocus"></event>
-                                                <event name="OnSize"></event>
-                                                <event name="OnUpdateUI"></event>
-                                            </object>
-                                        </object>
-                                    </object>
-                                </object>
-                                <object class="sizeritem" expanded="1">
-                                    <property name="border">5</property>
-                                    <property name="flag">wxALL|wxEXPAND</property>
-                                    <property name="proportion">1</property>
-                                    <object class="wxStaticBoxSizer" expanded="1">
-                                        <property name="id">wxID_ANY</property>
-                                        <property name="label">Grid Display (OpenGL &amp;&amp; Cairo)</property>
-                                        <property name="minimum_size"></property>
-                                        <property name="name">sGridSettings</property>
-                                        <property name="orient">wxVERTICAL</property>
-                                        <property name="parent">1</property>
-                                        <property name="permission">none</property>
-                                        <event name="OnUpdateUI"></event>
-                                        <object class="sizeritem" expanded="1">
-                                            <property name="border">5</property>
-                                            <property name="flag">wxALL|wxEXPAND</property>
-                                            <property name="proportion">0</property>
-                                            <object class="wxRadioBox" expanded="1">
-                                                <property name="BottomDockable">1</property>
-                                                <property name="LeftDockable">1</property>
-                                                <property name="RightDockable">1</property>
-                                                <property name="TopDockable">1</property>
-                                                <property name="aui_layer"></property>
-                                                <property name="aui_name"></property>
-                                                <property name="aui_position"></property>
-                                                <property name="aui_row"></property>
-                                                <property name="best_size"></property>
-                                                <property name="bg"></property>
-                                                <property name="caption"></property>
-                                                <property name="caption_visible">1</property>
-                                                <property name="center_pane">0</property>
-                                                <property name="choices">&quot;Dots&quot; &quot;Lines&quot; &quot;Small crosses&quot;</property>
-                                                <property name="close_button">1</property>
-                                                <property name="context_help"></property>
-                                                <property name="context_menu">1</property>
-                                                <property name="default_pane">0</property>
-                                                <property name="dock">Dock</property>
-                                                <property name="dock_fixed">0</property>
-                                                <property name="docking">Left</property>
-                                                <property name="enabled">1</property>
-                                                <property name="fg"></property>
-                                                <property name="floatable">1</property>
-                                                <property name="font"></property>
-                                                <property name="gripper">0</property>
-                                                <property name="hidden">0</property>
-                                                <property name="id">wxID_ANY</property>
-                                                <property name="label">Grid Style</property>
-                                                <property name="majorDimension">1</property>
-                                                <property name="max_size"></property>
-                                                <property name="maximize_button">0</property>
-                                                <property name="maximum_size"></property>
-                                                <property name="min_size"></property>
-                                                <property name="minimize_button">0</property>
-                                                <property name="minimum_size"></property>
-                                                <property name="moveable">1</property>
-                                                <property name="name">m_gridStyle</property>
-                                                <property name="pane_border">1</property>
-                                                <property name="pane_position"></property>
-                                                <property name="pane_size"></property>
-                                                <property name="permission">protected</property>
-                                                <property name="pin_button">1</property>
-                                                <property name="pos"></property>
-                                                <property name="resize">Resizable</property>
-                                                <property name="selection">0</property>
-                                                <property name="show">1</property>
-                                                <property name="size"></property>
-                                                <property name="style">wxRA_SPECIFY_COLS</property>
-                                                <property name="subclass"></property>
-                                                <property name="toolbar_pane">0</property>
-                                                <property name="tooltip"></property>
-                                                <property name="validator_data_type"></property>
-                                                <property name="validator_style">wxFILTER_NONE</property>
-                                                <property name="validator_type">wxDefaultValidator</property>
-                                                <property name="validator_variable"></property>
-                                                <property name="window_extra_style"></property>
-                                                <property name="window_name"></property>
-                                                <property name="window_style"></property>
-                                                <event name="OnChar"></event>
-                                                <event name="OnEnterWindow"></event>
-                                                <event name="OnEraseBackground"></event>
-                                                <event name="OnKeyDown"></event>
-                                                <event name="OnKeyUp"></event>
-                                                <event name="OnKillFocus"></event>
-                                                <event name="OnLeaveWindow"></event>
-                                                <event name="OnLeftDClick"></event>
-                                                <event name="OnLeftDown"></event>
-                                                <event name="OnLeftUp"></event>
-                                                <event name="OnMiddleDClick"></event>
-                                                <event name="OnMiddleDown"></event>
-                                                <event name="OnMiddleUp"></event>
-                                                <event name="OnMotion"></event>
-                                                <event name="OnMouseEvents"></event>
-                                                <event name="OnMouseWheel"></event>
-                                                <event name="OnPaint"></event>
-                                                <event name="OnRadioBox"></event>
-                                                <event name="OnRightDClick"></event>
-                                                <event name="OnRightDown"></event>
-                                                <event name="OnRightUp"></event>
-                                                <event name="OnSetFocus"></event>
-                                                <event name="OnSize"></event>
-                                                <event name="OnUpdateUI"></event>
-                                            </object>
-                                        </object>
-                                        <object class="sizeritem" expanded="1">
-                                            <property name="border">5</property>
-                                            <property name="flag">wxALL|wxEXPAND</property>
-                                            <property name="proportion">1</property>
-                                            <object class="wxFlexGridSizer" expanded="1">
-                                                <property name="cols">4</property>
-                                                <property name="flexible_direction">wxBOTH</property>
-                                                <property name="growablecols">1</property>
-                                                <property name="growablerows"></property>
-                                                <property name="hgap">0</property>
-                                                <property name="minimum_size"></property>
-                                                <property name="name">sGridSettingsGrid</property>
-                                                <property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
-                                                <property name="permission">none</property>
-                                                <property name="rows">0</property>
-                                                <property name="vgap">0</property>
-                                                <object class="sizeritem" expanded="1">
-                                                    <property name="border">5</property>
-                                                    <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
-                                                    <property name="proportion">0</property>
-                                                    <object class="wxStaticText" expanded="1">
-                                                        <property name="BottomDockable">1</property>
-                                                        <property name="LeftDockable">1</property>
-                                                        <property name="RightDockable">1</property>
-                                                        <property name="TopDockable">1</property>
-                                                        <property name="aui_layer"></property>
-                                                        <property name="aui_name"></property>
-                                                        <property name="aui_position"></property>
-                                                        <property name="aui_row"></property>
-                                                        <property name="best_size"></property>
-                                                        <property name="bg"></property>
-                                                        <property name="caption"></property>
-                                                        <property name="caption_visible">1</property>
-                                                        <property name="center_pane">0</property>
-                                                        <property name="close_button">1</property>
-                                                        <property name="context_help"></property>
-                                                        <property name="context_menu">1</property>
-                                                        <property name="default_pane">0</property>
-                                                        <property name="dock">Dock</property>
-                                                        <property name="dock_fixed">0</property>
-                                                        <property name="docking">Left</property>
-                                                        <property name="enabled">1</property>
-                                                        <property name="fg"></property>
-                                                        <property name="floatable">1</property>
-                                                        <property name="font"></property>
-                                                        <property name="gripper">0</property>
-                                                        <property name="hidden">0</property>
-                                                        <property name="id">wxID_ANY</property>
-                                                        <property name="label">Grid thickness:</property>
-                                                        <property name="max_size"></property>
-                                                        <property name="maximize_button">0</property>
-                                                        <property name="maximum_size"></property>
-                                                        <property name="min_size"></property>
-                                                        <property name="minimize_button">0</property>
-                                                        <property name="minimum_size"></property>
-                                                        <property name="moveable">1</property>
-                                                        <property name="name">l_gridLineWidth</property>
-                                                        <property name="pane_border">1</property>
-                                                        <property name="pane_position"></property>
-                                                        <property name="pane_size"></property>
-                                                        <property name="permission">protected</property>
-                                                        <property name="pin_button">1</property>
-                                                        <property name="pos"></property>
-                                                        <property name="resize">Resizable</property>
-                                                        <property name="show">1</property>
-                                                        <property name="size"></property>
-                                                        <property name="style"></property>
-                                                        <property name="subclass"></property>
-                                                        <property name="toolbar_pane">0</property>
-                                                        <property name="tooltip"></property>
-                                                        <property name="window_extra_style"></property>
-                                                        <property name="window_name"></property>
-                                                        <property name="window_style"></property>
-                                                        <property name="wrap">-1</property>
-                                                        <event name="OnChar"></event>
-                                                        <event name="OnEnterWindow"></event>
-                                                        <event name="OnEraseBackground"></event>
-                                                        <event name="OnKeyDown"></event>
-                                                        <event name="OnKeyUp"></event>
-                                                        <event name="OnKillFocus"></event>
-                                                        <event name="OnLeaveWindow"></event>
-                                                        <event name="OnLeftDClick"></event>
-                                                        <event name="OnLeftDown"></event>
-                                                        <event name="OnLeftUp"></event>
-                                                        <event name="OnMiddleDClick"></event>
-                                                        <event name="OnMiddleDown"></event>
-                                                        <event name="OnMiddleUp"></event>
-                                                        <event name="OnMotion"></event>
-                                                        <event name="OnMouseEvents"></event>
-                                                        <event name="OnMouseWheel"></event>
-                                                        <event name="OnPaint"></event>
-                                                        <event name="OnRightDClick"></event>
-                                                        <event name="OnRightDown"></event>
-                                                        <event name="OnRightUp"></event>
-                                                        <event name="OnSetFocus"></event>
-                                                        <event name="OnSize"></event>
-                                                        <event name="OnUpdateUI"></event>
-                                                    </object>
-                                                </object>
-                                                <object class="sizeritem" expanded="1">
-                                                    <property name="border">5</property>
-                                                    <property name="flag">wxEXPAND</property>
-                                                    <property name="proportion">0</property>
-                                                    <object class="wxTextCtrl" expanded="1">
-                                                        <property name="BottomDockable">1</property>
-                                                        <property name="LeftDockable">1</property>
-                                                        <property name="RightDockable">1</property>
-                                                        <property name="TopDockable">1</property>
-                                                        <property name="aui_layer"></property>
-                                                        <property name="aui_name"></property>
-                                                        <property name="aui_position"></property>
-                                                        <property name="aui_row"></property>
-                                                        <property name="best_size"></property>
-                                                        <property name="bg"></property>
-                                                        <property name="caption"></property>
-                                                        <property name="caption_visible">1</property>
-                                                        <property name="center_pane">0</property>
-                                                        <property name="close_button">1</property>
-                                                        <property name="context_help"></property>
-                                                        <property name="context_menu">1</property>
-                                                        <property name="default_pane">0</property>
-                                                        <property name="dock">Dock</property>
-                                                        <property name="dock_fixed">0</property>
-                                                        <property name="docking">Left</property>
-                                                        <property name="enabled">1</property>
-                                                        <property name="fg"></property>
-                                                        <property name="floatable">1</property>
-                                                        <property name="font"></property>
-                                                        <property name="gripper">0</property>
-                                                        <property name="hidden">0</property>
-                                                        <property name="id">wxID_ANY</property>
-                                                        <property name="max_size"></property>
-                                                        <property name="maximize_button">0</property>
-                                                        <property name="maximum_size"></property>
-                                                        <property name="maxlength">0</property>
-                                                        <property name="min_size"></property>
-                                                        <property name="minimize_button">0</property>
-                                                        <property name="minimum_size"></property>
-                                                        <property name="moveable">1</property>
-                                                        <property name="name">m_gridLineWidth</property>
-                                                        <property name="pane_border">1</property>
-                                                        <property name="pane_position"></property>
-                                                        <property name="pane_size"></property>
-                                                        <property name="permission">protected</property>
-                                                        <property name="pin_button">1</property>
-                                                        <property name="pos"></property>
-                                                        <property name="resize">Resizable</property>
-                                                        <property name="show">1</property>
-                                                        <property name="size"></property>
-                                                        <property name="style"></property>
-                                                        <property name="subclass"></property>
-                                                        <property name="toolbar_pane">0</property>
-                                                        <property name="tooltip"></property>
-                                                        <property name="validator_data_type"></property>
-                                                        <property name="validator_style">wxFILTER_NONE</property>
-                                                        <property name="validator_type">wxDefaultValidator</property>
-                                                        <property name="validator_variable"></property>
-                                                        <property name="value">0.5</property>
-                                                        <property name="window_extra_style"></property>
-                                                        <property name="window_name"></property>
-                                                        <property name="window_style"></property>
-                                                        <event name="OnChar"></event>
-                                                        <event name="OnEnterWindow"></event>
-                                                        <event name="OnEraseBackground"></event>
-                                                        <event name="OnKeyDown"></event>
-                                                        <event name="OnKeyUp"></event>
-                                                        <event name="OnKillFocus"></event>
-                                                        <event name="OnLeaveWindow"></event>
-                                                        <event name="OnLeftDClick"></event>
-                                                        <event name="OnLeftDown"></event>
-                                                        <event name="OnLeftUp"></event>
-                                                        <event name="OnMiddleDClick"></event>
-                                                        <event name="OnMiddleDown"></event>
-                                                        <event name="OnMiddleUp"></event>
-                                                        <event name="OnMotion"></event>
-                                                        <event name="OnMouseEvents"></event>
-                                                        <event name="OnMouseWheel"></event>
-                                                        <event name="OnPaint"></event>
-                                                        <event name="OnRightDClick"></event>
-                                                        <event name="OnRightDown"></event>
-                                                        <event name="OnRightUp"></event>
-                                                        <event name="OnSetFocus"></event>
-                                                        <event name="OnSize"></event>
-                                                        <event name="OnText"></event>
-                                                        <event name="OnTextEnter"></event>
-                                                        <event name="OnTextMaxLen"></event>
-                                                        <event name="OnTextURL"></event>
-                                                        <event name="OnUpdateUI"></event>
-                                                    </object>
-                                                </object>
-                                                <object class="sizeritem" expanded="1">
-                                                    <property name="border">0</property>
-                                                    <property name="flag">wxALL</property>
-                                                    <property name="proportion">0</property>
-                                                    <object class="wxSpinButton" expanded="1">
-                                                        <property name="BottomDockable">1</property>
-                                                        <property name="LeftDockable">1</property>
-                                                        <property name="RightDockable">1</property>
-                                                        <property name="TopDockable">1</property>
-                                                        <property name="aui_layer"></property>
-                                                        <property name="aui_name"></property>
-                                                        <property name="aui_position"></property>
-                                                        <property name="aui_row"></property>
-                                                        <property name="best_size"></property>
-                                                        <property name="bg"></property>
-                                                        <property name="caption"></property>
-                                                        <property name="caption_visible">1</property>
-                                                        <property name="center_pane">0</property>
-                                                        <property name="close_button">1</property>
-                                                        <property name="context_help"></property>
-                                                        <property name="context_menu">1</property>
-                                                        <property name="default_pane">0</property>
-                                                        <property name="dock">Dock</property>
-                                                        <property name="dock_fixed">0</property>
-                                                        <property name="docking">Left</property>
-                                                        <property name="enabled">1</property>
-                                                        <property name="fg"></property>
-                                                        <property name="floatable">1</property>
-                                                        <property name="font"></property>
-                                                        <property name="gripper">0</property>
-                                                        <property name="hidden">0</property>
-                                                        <property name="id">wxID_ANY</property>
-                                                        <property name="max_size"></property>
-                                                        <property name="maximize_button">0</property>
-                                                        <property name="maximum_size"></property>
-                                                        <property name="min_size"></property>
-                                                        <property name="minimize_button">0</property>
-                                                        <property name="minimum_size"></property>
-                                                        <property name="moveable">1</property>
-                                                        <property name="name">m_gridLineWidthSpinBtn</property>
-                                                        <property name="pane_border">1</property>
-                                                        <property name="pane_position"></property>
-                                                        <property name="pane_size"></property>
-                                                        <property name="permission">protected</property>
-                                                        <property name="pin_button">1</property>
-                                                        <property name="pos"></property>
-                                                        <property name="resize">Resizable</property>
-                                                        <property name="show">1</property>
-                                                        <property name="size"></property>
-                                                        <property name="style">wxSP_ARROW_KEYS</property>
-                                                        <property name="subclass"></property>
-                                                        <property name="toolbar_pane">0</property>
-                                                        <property name="tooltip"></property>
-                                                        <property name="window_extra_style"></property>
-                                                        <property name="window_name"></property>
-                                                        <property name="window_style"></property>
-                                                        <event name="OnChar"></event>
-                                                        <event name="OnEnterWindow"></event>
-                                                        <event name="OnEraseBackground"></event>
-                                                        <event name="OnKeyDown"></event>
-                                                        <event name="OnKeyUp"></event>
-                                                        <event name="OnKillFocus"></event>
-                                                        <event name="OnLeaveWindow"></event>
-                                                        <event name="OnLeftDClick"></event>
-                                                        <event name="OnLeftDown"></event>
-                                                        <event name="OnLeftUp"></event>
-                                                        <event name="OnMiddleDClick"></event>
-                                                        <event name="OnMiddleDown"></event>
-                                                        <event name="OnMiddleUp"></event>
-                                                        <event name="OnMotion"></event>
-                                                        <event name="OnMouseEvents"></event>
-                                                        <event name="OnMouseWheel"></event>
-                                                        <event name="OnPaint"></event>
-                                                        <event name="OnRightDClick"></event>
-                                                        <event name="OnRightDown"></event>
-                                                        <event name="OnRightUp"></event>
-                                                        <event name="OnSetFocus"></event>
-                                                        <event name="OnSize"></event>
-                                                        <event name="OnSpin"></event>
-                                                        <event name="OnSpinDown"></event>
-                                                        <event name="OnSpinUp"></event>
-                                                        <event name="OnUpdateUI"></event>
-                                                    </object>
-                                                </object>
-                                                <object class="sizeritem" expanded="1">
-                                                    <property name="border">5</property>
-                                                    <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
-                                                    <property name="proportion">0</property>
-                                                    <object class="wxStaticText" expanded="1">
-                                                        <property name="BottomDockable">1</property>
-                                                        <property name="LeftDockable">1</property>
-                                                        <property name="RightDockable">1</property>
-                                                        <property name="TopDockable">1</property>
-                                                        <property name="aui_layer"></property>
-                                                        <property name="aui_name"></property>
-                                                        <property name="aui_position"></property>
-                                                        <property name="aui_row"></property>
-                                                        <property name="best_size"></property>
-                                                        <property name="bg"></property>
-                                                        <property name="caption"></property>
-                                                        <property name="caption_visible">1</property>
-                                                        <property name="center_pane">0</property>
-                                                        <property name="close_button">1</property>
-                                                        <property name="context_help"></property>
-                                                        <property name="context_menu">1</property>
-                                                        <property name="default_pane">0</property>
-                                                        <property name="dock">Dock</property>
-                                                        <property name="dock_fixed">0</property>
-                                                        <property name="docking">Left</property>
-                                                        <property name="enabled">1</property>
-                                                        <property name="fg"></property>
-                                                        <property name="floatable">1</property>
-                                                        <property name="font"></property>
-                                                        <property name="gripper">0</property>
-                                                        <property name="hidden">0</property>
-                                                        <property name="id">wxID_ANY</property>
-                                                        <property name="label">px</property>
-                                                        <property name="max_size"></property>
-                                                        <property name="maximize_button">0</property>
-                                                        <property name="maximum_size"></property>
-                                                        <property name="min_size"></property>
-                                                        <property name="minimize_button">0</property>
-                                                        <property name="minimum_size"></property>
-                                                        <property name="moveable">1</property>
-                                                        <property name="name">l_gridLineWidthUnits</property>
-                                                        <property name="pane_border">1</property>
-                                                        <property name="pane_position"></property>
-                                                        <property name="pane_size"></property>
-                                                        <property name="permission">protected</property>
-                                                        <property name="pin_button">1</property>
-                                                        <property name="pos"></property>
-                                                        <property name="resize">Resizable</property>
-                                                        <property name="show">1</property>
-                                                        <property name="size"></property>
-                                                        <property name="style"></property>
-                                                        <property name="subclass"></property>
-                                                        <property name="toolbar_pane">0</property>
-                                                        <property name="tooltip"></property>
-                                                        <property name="window_extra_style"></property>
-                                                        <property name="window_name"></property>
-                                                        <property name="window_style"></property>
-                                                        <property name="wrap">-1</property>
-                                                        <event name="OnChar"></event>
-                                                        <event name="OnEnterWindow"></event>
-                                                        <event name="OnEraseBackground"></event>
-                                                        <event name="OnKeyDown"></event>
-                                                        <event name="OnKeyUp"></event>
-                                                        <event name="OnKillFocus"></event>
-                                                        <event name="OnLeaveWindow"></event>
-                                                        <event name="OnLeftDClick"></event>
-                                                        <event name="OnLeftDown"></event>
-                                                        <event name="OnLeftUp"></event>
-                                                        <event name="OnMiddleDClick"></event>
-                                                        <event name="OnMiddleDown"></event>
-                                                        <event name="OnMiddleUp"></event>
-                                                        <event name="OnMotion"></event>
-                                                        <event name="OnMouseEvents"></event>
-                                                        <event name="OnMouseWheel"></event>
-                                                        <event name="OnPaint"></event>
-                                                        <event name="OnRightDClick"></event>
-                                                        <event name="OnRightDown"></event>
-                                                        <event name="OnRightUp"></event>
-                                                        <event name="OnSetFocus"></event>
-                                                        <event name="OnSize"></event>
-                                                        <event name="OnUpdateUI"></event>
-                                                    </object>
-                                                </object>
-                                                <object class="sizeritem" expanded="1">
-                                                    <property name="border">5</property>
-                                                    <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
-                                                    <property name="proportion">0</property>
-                                                    <object class="wxStaticText" expanded="1">
-                                                        <property name="BottomDockable">1</property>
-                                                        <property name="LeftDockable">1</property>
-                                                        <property name="RightDockable">1</property>
-                                                        <property name="TopDockable">1</property>
-                                                        <property name="aui_layer"></property>
-                                                        <property name="aui_name"></property>
-                                                        <property name="aui_position"></property>
-                                                        <property name="aui_row"></property>
-                                                        <property name="best_size"></property>
-                                                        <property name="bg"></property>
-                                                        <property name="caption"></property>
-                                                        <property name="caption_visible">1</property>
-                                                        <property name="center_pane">0</property>
-                                                        <property name="close_button">1</property>
-                                                        <property name="context_help"></property>
-                                                        <property name="context_menu">1</property>
-                                                        <property name="default_pane">0</property>
-                                                        <property name="dock">Dock</property>
-                                                        <property name="dock_fixed">0</property>
-                                                        <property name="docking">Left</property>
-                                                        <property name="enabled">1</property>
-                                                        <property name="fg"></property>
-                                                        <property name="floatable">1</property>
-                                                        <property name="font"></property>
-                                                        <property name="gripper">0</property>
-                                                        <property name="hidden">0</property>
-                                                        <property name="id">wxID_ANY</property>
-                                                        <property name="label">Min grid spacing:</property>
-                                                        <property name="max_size"></property>
-                                                        <property name="maximize_button">0</property>
-                                                        <property name="maximum_size"></property>
-                                                        <property name="min_size"></property>
-                                                        <property name="minimize_button">0</property>
-                                                        <property name="minimum_size"></property>
-                                                        <property name="moveable">1</property>
-                                                        <property name="name">l_gridMinSpacing</property>
-                                                        <property name="pane_border">1</property>
-                                                        <property name="pane_position"></property>
-                                                        <property name="pane_size"></property>
-                                                        <property name="permission">protected</property>
-                                                        <property name="pin_button">1</property>
-                                                        <property name="pos"></property>
-                                                        <property name="resize">Resizable</property>
-                                                        <property name="show">1</property>
-                                                        <property name="size"></property>
-                                                        <property name="style"></property>
-                                                        <property name="subclass"></property>
-                                                        <property name="toolbar_pane">0</property>
-                                                        <property name="tooltip"></property>
-                                                        <property name="window_extra_style"></property>
-                                                        <property name="window_name"></property>
-                                                        <property name="window_style"></property>
-                                                        <property name="wrap">-1</property>
-                                                        <event name="OnChar"></event>
-                                                        <event name="OnEnterWindow"></event>
-                                                        <event name="OnEraseBackground"></event>
-                                                        <event name="OnKeyDown"></event>
-                                                        <event name="OnKeyUp"></event>
-                                                        <event name="OnKillFocus"></event>
-                                                        <event name="OnLeaveWindow"></event>
-                                                        <event name="OnLeftDClick"></event>
-                                                        <event name="OnLeftDown"></event>
-                                                        <event name="OnLeftUp"></event>
-                                                        <event name="OnMiddleDClick"></event>
-                                                        <event name="OnMiddleDown"></event>
-                                                        <event name="OnMiddleUp"></event>
-                                                        <event name="OnMotion"></event>
-                                                        <event name="OnMouseEvents"></event>
-                                                        <event name="OnMouseWheel"></event>
-                                                        <event name="OnPaint"></event>
-                                                        <event name="OnRightDClick"></event>
-                                                        <event name="OnRightDown"></event>
-                                                        <event name="OnRightUp"></event>
-                                                        <event name="OnSetFocus"></event>
-                                                        <event name="OnSize"></event>
-                                                        <event name="OnUpdateUI"></event>
-                                                    </object>
-                                                </object>
-                                                <object class="sizeritem" expanded="1">
-                                                    <property name="border">5</property>
-                                                    <property name="flag">wxEXPAND</property>
-                                                    <property name="proportion">0</property>
-                                                    <object class="wxTextCtrl" expanded="1">
-                                                        <property name="BottomDockable">1</property>
-                                                        <property name="LeftDockable">1</property>
-                                                        <property name="RightDockable">1</property>
-                                                        <property name="TopDockable">1</property>
-                                                        <property name="aui_layer"></property>
-                                                        <property name="aui_name"></property>
-                                                        <property name="aui_position"></property>
-                                                        <property name="aui_row"></property>
-                                                        <property name="best_size"></property>
-                                                        <property name="bg"></property>
-                                                        <property name="caption"></property>
-                                                        <property name="caption_visible">1</property>
-                                                        <property name="center_pane">0</property>
-                                                        <property name="close_button">1</property>
-                                                        <property name="context_help"></property>
-                                                        <property name="context_menu">1</property>
-                                                        <property name="default_pane">0</property>
-                                                        <property name="dock">Dock</property>
-                                                        <property name="dock_fixed">0</property>
-                                                        <property name="docking">Left</property>
-                                                        <property name="enabled">1</property>
-                                                        <property name="fg"></property>
-                                                        <property name="floatable">1</property>
-                                                        <property name="font"></property>
-                                                        <property name="gripper">0</property>
-                                                        <property name="hidden">0</property>
-                                                        <property name="id">wxID_ANY</property>
-                                                        <property name="max_size"></property>
-                                                        <property name="maximize_button">0</property>
-                                                        <property name="maximum_size"></property>
-                                                        <property name="maxlength">0</property>
-                                                        <property name="min_size"></property>
-                                                        <property name="minimize_button">0</property>
-                                                        <property name="minimum_size"></property>
-                                                        <property name="moveable">1</property>
-                                                        <property name="name">m_gridMinSpacing</property>
-                                                        <property name="pane_border">1</property>
-                                                        <property name="pane_position"></property>
-                                                        <property name="pane_size"></property>
-                                                        <property name="permission">protected</property>
-                                                        <property name="pin_button">1</property>
-                                                        <property name="pos"></property>
-                                                        <property name="resize">Resizable</property>
-                                                        <property name="show">1</property>
-                                                        <property name="size"></property>
-                                                        <property name="style"></property>
-                                                        <property name="subclass"></property>
-                                                        <property name="toolbar_pane">0</property>
-                                                        <property name="tooltip"></property>
-                                                        <property name="validator_data_type"></property>
-                                                        <property name="validator_style">wxFILTER_NONE</property>
-                                                        <property name="validator_type">wxDefaultValidator</property>
-                                                        <property name="validator_variable"></property>
-                                                        <property name="value">10</property>
-                                                        <property name="window_extra_style"></property>
-                                                        <property name="window_name"></property>
-                                                        <property name="window_style"></property>
-                                                        <event name="OnChar"></event>
-                                                        <event name="OnEnterWindow"></event>
-                                                        <event name="OnEraseBackground"></event>
-                                                        <event name="OnKeyDown"></event>
-                                                        <event name="OnKeyUp"></event>
-                                                        <event name="OnKillFocus"></event>
-                                                        <event name="OnLeaveWindow"></event>
-                                                        <event name="OnLeftDClick"></event>
-                                                        <event name="OnLeftDown"></event>
-                                                        <event name="OnLeftUp"></event>
-                                                        <event name="OnMiddleDClick"></event>
-                                                        <event name="OnMiddleDown"></event>
-                                                        <event name="OnMiddleUp"></event>
-                                                        <event name="OnMotion"></event>
-                                                        <event name="OnMouseEvents"></event>
-                                                        <event name="OnMouseWheel"></event>
-                                                        <event name="OnPaint"></event>
-                                                        <event name="OnRightDClick"></event>
-                                                        <event name="OnRightDown"></event>
-                                                        <event name="OnRightUp"></event>
-                                                        <event name="OnSetFocus"></event>
-                                                        <event name="OnSize"></event>
-                                                        <event name="OnText"></event>
-                                                        <event name="OnTextEnter"></event>
-                                                        <event name="OnTextMaxLen"></event>
-                                                        <event name="OnTextURL"></event>
-                                                        <event name="OnUpdateUI"></event>
-                                                    </object>
-                                                </object>
-                                                <object class="sizeritem" expanded="1">
-                                                    <property name="border">0</property>
-                                                    <property name="flag">wxALL</property>
-                                                    <property name="proportion">0</property>
-                                                    <object class="wxSpinButton" expanded="1">
-                                                        <property name="BottomDockable">1</property>
-                                                        <property name="LeftDockable">1</property>
-                                                        <property name="RightDockable">1</property>
-                                                        <property name="TopDockable">1</property>
-                                                        <property name="aui_layer"></property>
-                                                        <property name="aui_name"></property>
-                                                        <property name="aui_position"></property>
-                                                        <property name="aui_row"></property>
-                                                        <property name="best_size"></property>
-                                                        <property name="bg"></property>
-                                                        <property name="caption"></property>
-                                                        <property name="caption_visible">1</property>
-                                                        <property name="center_pane">0</property>
-                                                        <property name="close_button">1</property>
-                                                        <property name="context_help"></property>
-                                                        <property name="context_menu">1</property>
-                                                        <property name="default_pane">0</property>
-                                                        <property name="dock">Dock</property>
-                                                        <property name="dock_fixed">0</property>
-                                                        <property name="docking">Left</property>
-                                                        <property name="enabled">1</property>
-                                                        <property name="fg"></property>
-                                                        <property name="floatable">1</property>
-                                                        <property name="font"></property>
-                                                        <property name="gripper">0</property>
-                                                        <property name="hidden">0</property>
-                                                        <property name="id">wxID_ANY</property>
-                                                        <property name="max_size"></property>
-                                                        <property name="maximize_button">0</property>
-                                                        <property name="maximum_size"></property>
-                                                        <property name="min_size"></property>
-                                                        <property name="minimize_button">0</property>
-                                                        <property name="minimum_size"></property>
-                                                        <property name="moveable">1</property>
-                                                        <property name="name">m_gridMinSpacingSpinBtn</property>
-                                                        <property name="pane_border">1</property>
-                                                        <property name="pane_position"></property>
-                                                        <property name="pane_size"></property>
-                                                        <property name="permission">protected</property>
-                                                        <property name="pin_button">1</property>
-                                                        <property name="pos"></property>
-                                                        <property name="resize">Resizable</property>
-                                                        <property name="show">1</property>
-                                                        <property name="size"></property>
-                                                        <property name="style">wxSP_ARROW_KEYS</property>
-                                                        <property name="subclass"></property>
-                                                        <property name="toolbar_pane">0</property>
-                                                        <property name="tooltip"></property>
-                                                        <property name="window_extra_style"></property>
-                                                        <property name="window_name"></property>
-                                                        <property name="window_style"></property>
-                                                        <event name="OnChar"></event>
-                                                        <event name="OnEnterWindow"></event>
-                                                        <event name="OnEraseBackground"></event>
-                                                        <event name="OnKeyDown"></event>
-                                                        <event name="OnKeyUp"></event>
-                                                        <event name="OnKillFocus"></event>
-                                                        <event name="OnLeaveWindow"></event>
-                                                        <event name="OnLeftDClick"></event>
-                                                        <event name="OnLeftDown"></event>
-                                                        <event name="OnLeftUp"></event>
-                                                        <event name="OnMiddleDClick"></event>
-                                                        <event name="OnMiddleDown"></event>
-                                                        <event name="OnMiddleUp"></event>
-                                                        <event name="OnMotion"></event>
-                                                        <event name="OnMouseEvents"></event>
-                                                        <event name="OnMouseWheel"></event>
-                                                        <event name="OnPaint"></event>
-                                                        <event name="OnRightDClick"></event>
-                                                        <event name="OnRightDown"></event>
-                                                        <event name="OnRightUp"></event>
-                                                        <event name="OnSetFocus"></event>
-                                                        <event name="OnSize"></event>
-                                                        <event name="OnSpin"></event>
-                                                        <event name="OnSpinDown"></event>
-                                                        <event name="OnSpinUp"></event>
-                                                        <event name="OnUpdateUI"></event>
-                                                    </object>
-                                                </object>
-                                                <object class="sizeritem" expanded="1">
-                                                    <property name="border">5</property>
-                                                    <property name="flag">wxALL</property>
-                                                    <property name="proportion">0</property>
-                                                    <object class="wxStaticText" expanded="1">
-                                                        <property name="BottomDockable">1</property>
-                                                        <property name="LeftDockable">1</property>
-                                                        <property name="RightDockable">1</property>
-                                                        <property name="TopDockable">1</property>
-                                                        <property name="aui_layer"></property>
-                                                        <property name="aui_name"></property>
-                                                        <property name="aui_position"></property>
-                                                        <property name="aui_row"></property>
-                                                        <property name="best_size"></property>
-                                                        <property name="bg"></property>
-                                                        <property name="caption"></property>
-                                                        <property name="caption_visible">1</property>
-                                                        <property name="center_pane">0</property>
-                                                        <property name="close_button">1</property>
-                                                        <property name="context_help"></property>
-                                                        <property name="context_menu">1</property>
-                                                        <property name="default_pane">0</property>
-                                                        <property name="dock">Dock</property>
-                                                        <property name="dock_fixed">0</property>
-                                                        <property name="docking">Left</property>
-                                                        <property name="enabled">1</property>
-                                                        <property name="fg"></property>
-                                                        <property name="floatable">1</property>
-                                                        <property name="font"></property>
-                                                        <property name="gripper">0</property>
-                                                        <property name="hidden">0</property>
-                                                        <property name="id">wxID_ANY</property>
-                                                        <property name="label">px</property>
-                                                        <property name="max_size"></property>
-                                                        <property name="maximize_button">0</property>
-                                                        <property name="maximum_size"></property>
-                                                        <property name="min_size"></property>
-                                                        <property name="minimize_button">0</property>
-                                                        <property name="minimum_size"></property>
-                                                        <property name="moveable">1</property>
-                                                        <property name="name">l_gridMinSpacingUnits</property>
-                                                        <property name="pane_border">1</property>
-                                                        <property name="pane_position"></property>
-                                                        <property name="pane_size"></property>
-                                                        <property name="permission">protected</property>
-                                                        <property name="pin_button">1</property>
-                                                        <property name="pos"></property>
-                                                        <property name="resize">Resizable</property>
-                                                        <property name="show">1</property>
-                                                        <property name="size"></property>
-                                                        <property name="style"></property>
-                                                        <property name="subclass"></property>
-                                                        <property name="toolbar_pane">0</property>
-                                                        <property name="tooltip"></property>
-                                                        <property name="window_extra_style"></property>
-                                                        <property name="window_name"></property>
-                                                        <property name="window_style"></property>
-                                                        <property name="wrap">-1</property>
-                                                        <event name="OnChar"></event>
-                                                        <event name="OnEnterWindow"></event>
-                                                        <event name="OnEraseBackground"></event>
-                                                        <event name="OnKeyDown"></event>
-                                                        <event name="OnKeyUp"></event>
-                                                        <event name="OnKillFocus"></event>
-                                                        <event name="OnLeaveWindow"></event>
-                                                        <event name="OnLeftDClick"></event>
-                                                        <event name="OnLeftDown"></event>
-                                                        <event name="OnLeftUp"></event>
-                                                        <event name="OnMiddleDClick"></event>
-                                                        <event name="OnMiddleDown"></event>
-                                                        <event name="OnMiddleUp"></event>
-                                                        <event name="OnMotion"></event>
-                                                        <event name="OnMouseEvents"></event>
-                                                        <event name="OnMouseWheel"></event>
-                                                        <event name="OnPaint"></event>
-                                                        <event name="OnRightDClick"></event>
-                                                        <event name="OnRightDown"></event>
-                                                        <event name="OnRightUp"></event>
-                                                        <event name="OnSetFocus"></event>
-                                                        <event name="OnSize"></event>
-                                                        <event name="OnUpdateUI"></event>
-                                                    </object>
-                                                </object>
-                                            </object>
-                                        </object>
-                                    </object>
-                                </object>
                             </object>
                         </object>
-                        <object class="sizeritem" expanded="1">
+                        <object class="sizeritem" expanded="0">
                             <property name="border">5</property>
                             <property name="flag">wxALL|wxEXPAND</property>
                             <property name="proportion">0</property>
-                            <object class="wxStaticBoxSizer" expanded="1">
+                            <object class="wxStaticBoxSizer" expanded="0">
                                 <property name="id">wxID_ANY</property>
                                 <property name="label">Routing Help:</property>
                                 <property name="minimum_size"></property>
@@ -1407,20 +499,20 @@
                                 </object>
                             </object>
                         </object>
-                        <object class="sizeritem" expanded="1">
+                        <object class="sizeritem" expanded="0">
                             <property name="border">5</property>
                             <property name="flag"></property>
                             <property name="proportion">0</property>
-                            <object class="wxBoxSizer" expanded="1">
+                            <object class="wxBoxSizer" expanded="0">
                                 <property name="minimum_size"></property>
                                 <property name="name">sRightSizer</property>
                                 <property name="orient">wxVERTICAL</property>
                                 <property name="permission">none</property>
-                                <object class="sizeritem" expanded="1">
+                                <object class="sizeritem" expanded="0">
                                     <property name="border">5</property>
                                     <property name="flag">wxEXPAND|wxALL</property>
                                     <property name="proportion">0</property>
-                                    <object class="wxStaticBoxSizer" expanded="1">
+                                    <object class="wxStaticBoxSizer" expanded="0">
                                         <property name="id">wxID_ANY</property>
                                         <property name="label">Footprints:</property>
                                         <property name="minimum_size"></property>
@@ -1959,11 +1051,11 @@
                                         </object>
                                     </object>
                                 </object>
-                                <object class="sizeritem" expanded="1">
+                                <object class="sizeritem" expanded="0">
                                     <property name="border">5</property>
                                     <property name="flag">wxEXPAND|wxALL</property>
                                     <property name="proportion">1</property>
-                                    <object class="wxStaticBoxSizer" expanded="1">
+                                    <object class="wxStaticBoxSizer" expanded="0">
                                         <property name="id">wxID_ANY</property>
                                         <property name="label">Other:</property>
                                         <property name="minimum_size"></property>
@@ -2235,11 +1327,11 @@
                         <event name="OnUpdateUI"></event>
                     </object>
                 </object>
-                <object class="sizeritem" expanded="1">
+                <object class="sizeritem" expanded="0">
                     <property name="border">5</property>
                     <property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
                     <property name="proportion">0</property>
-                    <object class="wxStdDialogButtonSizer" expanded="1">
+                    <object class="wxStdDialogButtonSizer" expanded="0">
                         <property name="Apply">0</property>
                         <property name="Cancel">1</property>
                         <property name="ContextHelp">0</property>
diff --git a/pcbnew/dialogs/dialog_display_options_base.h b/pcbnew/dialogs/dialog_display_options_base.h
index 92ad296c7..01b9921c1 100644
--- a/pcbnew/dialogs/dialog_display_options_base.h
+++ b/pcbnew/dialogs/dialog_display_options_base.h
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version May  6 2016)
+// C++ code generated with wxFormBuilder (version Jan  9 2017)
 // http://www.wxformbuilder.org/
 //
 // PLEASE DO "NOT" EDIT THIS FILE!
@@ -22,11 +22,7 @@ class DIALOG_SHIM;
 #include <wx/settings.h>
 #include <wx/sizer.h>
 #include <wx/statbox.h>
-#include <wx/choice.h>
 #include <wx/radiobox.h>
-#include <wx/stattext.h>
-#include <wx/textctrl.h>
-#include <wx/spinbutt.h>
 #include <wx/statline.h>
 #include <wx/button.h>
 #include <wx/dialog.h>
@@ -46,18 +42,9 @@ class DIALOG_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM
 			ID_SHOW_CLEARANCE = 1000
 		};
 		
+		wxBoxSizer* sLeftSizer;
 		wxCheckBox* m_OptDisplayTracks;
 		wxCheckBox* m_OptDisplayVias;
-		wxChoice* m_choiceAntialiasing;
-		wxRadioBox* m_gridStyle;
-		wxStaticText* l_gridLineWidth;
-		wxTextCtrl* m_gridLineWidth;
-		wxSpinButton* m_gridLineWidthSpinBtn;
-		wxStaticText* l_gridLineWidthUnits;
-		wxStaticText* l_gridMinSpacing;
-		wxTextCtrl* m_gridMinSpacing;
-		wxSpinButton* m_gridMinSpacingSpinBtn;
-		wxStaticText* l_gridMinSpacingUnits;
 		wxRadioBox* m_ShowNetNamesOption;
 		wxRadioBox* m_OptDisplayTracksClearance;
 		wxCheckBox* m_OptDisplayModOutlines;
-- 
2.12.0


Follow ups