kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #37260
[PATCH] Modify style of the action plugin panel to follow common style, fix Assert
-
To:
KiCad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Thomas Pointhuber <thomas.pointhuber@xxxxxx>
-
Date:
Mon, 27 Aug 2018 13:44:44 +0200
-
Autocrypt:
addr=thomas.pointhuber@xxxxxx; prefer-encrypt=mutual; keydata= xsFNBFKxhfoBEADDCVK/vsBRi6BnOVSNa+2+xDQt+rBZt7D7BiTm6vaH/NYh+MFyujViIwIt dducp1y09Bkheqfy1tZVBznAC9L/+scePboOeTRTOMtghp041RXC6K7B4J3RMO0++9XdgDlC KLkNhpyPhb2uKVtGBzZjAPyV9udScv5AnQGrPvE1fIs7CreUPj+sSnRYb0sp5qZRaSpXSmKU NyTFEQtuaR1RXl0Dekj4BfXOr+RBdy8oewvGL64uJYd1ddsJ+uKLURbAZCd4n76g/7y1M+T+ Z0fsO7JT8HPA/4O9FrYHEl6dQTgCos3HsWqqP0xHzW9eR/xTXtNGJ8NSMO11Fla6U27Fb6os XFutSczwkoF3bkhLufodg1y9z+MZ3G5hBidYKRJMxFBLcKqtmcgwfSFI9IP50XH0RY1aOLXJ YsSO/1U+h5LHIYWirLvy6UvWdPD/+cSZgG6JxrHnd/gz0YxzNy8RNo9eGZx34+UTVw6OlKfP CnHvT56Dd9ntRxZ+okKvxSE2/Lc97/xrQj/L1Lgqo6QeHRRmn0V7tAGQR5iYTTVzitjnwGxm St8W4rUJRGdOhpig4r5vy8tZvZ9sJlNkQ2ah1iVTCV1+YBivuKi9EtMCEIoks9AfAPs9iFgl ftmT+5GKq5AA6QuXH9wwlgzJZKQi1UeB4i8RxKnN0De1tINesQARAQABzSxUaG9tYXMgUG9p bnRodWJlciA8dGhvbWFzLnBvaW50aHViZXJAZ214LmF0PsLBfQQTAQgAJwUCVvw/jgIbIwUJ CWYBgAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRDHCd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th8zfD27gwRwCLcv7rCBV FdEOvji9IfCEHM6isRXc4NnOVj9rtQMtDYFnHktT9gpNceJiR/h4u1DmvAqInaGeoKg8JtuM i9OLlNh5Stam/2qqzXaXwt9HSgj3JOzhtegl4eYNKjKCfKMBpAyo+Ze9wlpr8+d424TuXD0j 3niSS+5Cnqxv3GThLRoMrgxoBB2cNrCyNPZmIa13uNYqIprES241Cc1ehvapoICAjyx8Ql1F LTxL9HrFf42+pBQaLr12jVJXILplbfejLIq5taSMZnm7i1gBLS7GpnJdChF9EfO8wj0C5d0A EQEAAcLBZQQYAQIADwUCUrGF+gIbDAUJCWYBgAAKCRDHCdh07a8lVp3ND/48bcYCVbSZPVhZ Ii/4SLmCNa3He0NP7kfPfpGGLWSuqknKJ4HlfrNDV7duJTewydZ9O/3dL/gO2QqcCRP41OYZ m/JySmtxiFxRRM3oGozRTi2XO4UB2mMBroPElBMhGKpag+QrtHh2AseNZII9a4pOmVwpFABc yfffGirag+TGlQttbSiCq+8ZFxv/ao+5QkjFgyxG1fnF2SpnIchB7y6bkk2HPeVM7ZesCZTn CU7i8bT3XMu40+dmFFcbxyK6hxE8YcsgPzN+vynu7jmHjrZenKFyR4QiTyimTPHA1395sBuA k/KD3A7HooIQTqHU2wUo2PwBuY51KbGF6CI4kvTIaRg3Ain6Qc/t9oD3I1dFzsIA6iarnZrD H0dTVSVpO8n0bWVxzLz87PFkPJqlqQOYSYpxIupqOPI/AriVX0mAtH2V6VR4i0WGi2pf+A7v UXwkD7OdZzrv9GPOdM/oh2MpAfOTxPJZrkzkwx4lflNMnNTTEttwQdJRDQDrth7JGWVbCiWw 62x3Y12OdDRWu3t0ishZfO171R2PoLopC6p/28QAeOH4+zwABRVaSz6lCdAhZqfl/tUwo0Zh 6iNx3gjpI8ioj36IxpPHw/h3sERwgCICl9lOQTviPT/H9xiJazIjmH92eYH/Les/3I07/jVA Pm/7xjyRQ7uil90nCFwzjw==
-
Openpgp:
preference=signencrypt
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0
Hi,
I modified panel_pcbnew_action_plugins_base to follow the default style
of the table with button up/down. Furthermore, I found out the code
raises an assert when no plugins are present, and fixed this issue as well.
Patch is available on GitHub as well:
https://github.com/pointhi/kicad-source-mirror/commits/action_plugin_panel
Regards, Thomas
From 6a94d1baa506272565fe1959cb1950ba62be66fe Mon Sep 17 00:00:00 2001
From: Thomas Pointhuber <thomas.pointhuber@xxxxxx>
Date: Mon, 27 Aug 2018 13:37:11 +0200
Subject: [PATCH] Modify style of the action plugin panel to follow common
style
and fix of an assert:
* m_grid->DeleteRows does not like to get a numRows of zero
---
.../dialogs/panel_pcbnew_action_plugins.cpp | 7 ++--
.../panel_pcbnew_action_plugins_base.cpp | 23 ++++++-----
.../panel_pcbnew_action_plugins_base.fbp | 38 ++++++++++++-------
.../panel_pcbnew_action_plugins_base.h | 2 +-
4 files changed, 42 insertions(+), 28 deletions(-)
diff --git a/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp b/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp
index 3887fe9b2..d9e1d93aa 100644
--- a/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp
+++ b/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp
@@ -35,8 +35,8 @@ PANEL_PCBNEW_ACTION_PLUGINS::PANEL_PCBNEW_ACTION_PLUGINS( PCB_EDIT_FRAME* aFrame
m_genericIcon = KiBitmap( hammer_xpm );
m_grid->PushEventHandler( new GRID_TRICKS( m_grid ) );
- m_moveUpButton->SetBitmap( KiBitmap( up_xpm ) );
- m_moveDownButton->SetBitmap( KiBitmap( down_xpm ) );
+ m_moveUpButton->SetBitmap( KiBitmap( small_up_xpm ) );
+ m_moveDownButton->SetBitmap( KiBitmap( small_down_xpm ) );
m_reloadButton->SetBitmap( KiBitmap( refresh_xpm ) );
}
@@ -155,7 +155,8 @@ bool PANEL_PCBNEW_ACTION_PLUGINS::TransferDataFromWindow()
bool PANEL_PCBNEW_ACTION_PLUGINS::TransferDataToWindow()
{
m_grid->Freeze();
- m_grid->DeleteRows( 0, m_grid->GetNumberRows() );
+ if( m_grid->GetNumberRows() != 0 )
+ m_grid->DeleteRows( 0, m_grid->GetNumberRows() );
const auto& orderedPlugins = m_frame->GetOrderedActionPlugins();
m_grid->AppendRows( orderedPlugins.size() );
diff --git a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.cpp b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.cpp
index d8f890904..98fae006b 100644
--- a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.cpp
+++ b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Jul 11 2018)
+// C++ code generated with wxFormBuilder (version Jul 14 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -14,7 +14,7 @@
PANEL_PCBNEW_ACTION_PLUGINS_BASE::PANEL_PCBNEW_ACTION_PLUGINS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
wxBoxSizer* bPanelSizer;
- bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
+ bPanelSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bGridSizer;
bGridSizer = new wxBoxSizer( wxVERTICAL );
@@ -56,25 +56,28 @@ PANEL_PCBNEW_ACTION_PLUGINS_BASE::PANEL_PCBNEW_ACTION_PLUGINS_BASE( wxWindow* pa
bPanelSizer->Add( bGridSizer, 1, wxALIGN_LEFT|wxEXPAND|wxLEFT, 0 );
wxBoxSizer* bButtonsSizer;
- bButtonsSizer = new wxBoxSizer( wxVERTICAL );
+ bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
m_moveUpButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
- m_moveUpButton->SetMinSize( wxSize( 32,32 ) );
+ m_moveUpButton->SetMinSize( wxSize( 30,30 ) );
- bButtonsSizer->Add( m_moveUpButton, 0, wxALIGN_TOP|wxALL, 5 );
+ bButtonsSizer->Add( m_moveUpButton, 0, wxLEFT|wxRIGHT, 5 );
m_moveDownButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
- m_moveDownButton->SetMinSize( wxSize( 32,32 ) );
+ m_moveDownButton->SetMinSize( wxSize( 30,30 ) );
- bButtonsSizer->Add( m_moveDownButton, 0, wxALL, 5 );
+ bButtonsSizer->Add( m_moveDownButton, 0, wxRIGHT, 5 );
+
+
+ bButtonsSizer->Add( 0, 0, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_reloadButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
- m_reloadButton->SetMinSize( wxSize( 32,32 ) );
+ m_reloadButton->SetMinSize( wxSize( 30,30 ) );
- bButtonsSizer->Add( m_reloadButton, 0, wxALL, 5 );
+ bButtonsSizer->Add( m_reloadButton, 0, wxLEFT|wxRIGHT, 5 );
- bPanelSizer->Add( bButtonsSizer, 0, wxALIGN_RIGHT|wxALIGN_TOP, 0 );
+ bPanelSizer->Add( bButtonsSizer, 0, wxEXPAND, 0 );
this->SetSizer( bPanelSizer );
diff --git a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.fbp b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.fbp
index 6c91f1fd1..2f67cd812 100644
--- a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.fbp
+++ b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.fbp
@@ -89,7 +89,7 @@
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bPanelSizer</property>
- <property name="orient">wxHORIZONTAL</property>
+ <property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">0</property>
@@ -100,11 +100,11 @@
<property name="name">bGridSizer</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">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
- <object class="wxGrid" expanded="1">
+ <object class="wxGrid" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -254,16 +254,16 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">0</property>
- <property name="flag">wxALIGN_RIGHT|wxALIGN_TOP</property>
+ <property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bButtonsSizer</property>
- <property name="orient">wxVERTICAL</property>
+ <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
- <property name="flag">wxALIGN_TOP|wxALL</property>
+ <property name="flag">wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="0">
<property name="BottomDockable">1</property>
@@ -306,7 +306,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
- <property name="minimum_size">32,32</property>
+ <property name="minimum_size">30,30</property>
<property name="moveable">1</property>
<property name="name">m_moveUpButton</property>
<property name="pane_border">1</property>
@@ -364,11 +364,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">wxALL</property>
+ <property name="flag">wxRIGHT</property>
<property name="proportion">0</property>
- <object class="wxBitmapButton" expanded="1">
+ <object class="wxBitmapButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -409,7 +409,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
- <property name="minimum_size">32,32</property>
+ <property name="minimum_size">30,30</property>
<property name="moveable">1</property>
<property name="name">m_moveDownButton</property>
<property name="pane_border">1</property>
@@ -469,9 +469,19 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag">wxALL</property>
+ <property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
- <object class="wxBitmapButton" expanded="1">
+ <object class="spacer" expanded="1">
+ <property name="height">0</property>
+ <property name="permission">protected</property>
+ <property name="width">0</property>
+ </object>
+ </object>
+ <object class="sizeritem" expanded="0">
+ <property name="border">5</property>
+ <property name="flag">wxLEFT|wxRIGHT</property>
+ <property name="proportion">0</property>
+ <object class="wxBitmapButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -512,7 +522,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
- <property name="minimum_size">32,32</property>
+ <property name="minimum_size">30,30</property>
<property name="moveable">1</property>
<property name="name">m_reloadButton</property>
<property name="pane_border">1</property>
diff --git a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.h b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.h
index 8766d0c95..f6ab93096 100644
--- a/pcbnew/dialogs/panel_pcbnew_action_plugins_base.h
+++ b/pcbnew/dialogs/panel_pcbnew_action_plugins_base.h
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Jul 11 2018)
+// C++ code generated with wxFormBuilder (version Jul 14 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
--
2.18.0
Attachment:
signature.asc
Description: OpenPGP digital signature
Follow ups