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
This commit is contained in:
Thomas Pointhuber 2018-08-27 13:37:11 +02:00 committed by Seth Hillbrand
parent d19b152655
commit a2bc4260ef
4 changed files with 42 additions and 28 deletions

View File

@ -35,8 +35,8 @@ PANEL_PCBNEW_ACTION_PLUGINS::PANEL_PCBNEW_ACTION_PLUGINS( PCB_EDIT_FRAME* aFrame
m_genericIcon = KiBitmap( hammer_xpm ); m_genericIcon = KiBitmap( hammer_xpm );
m_grid->PushEventHandler( new GRID_TRICKS( m_grid ) ); m_grid->PushEventHandler( new GRID_TRICKS( m_grid ) );
m_moveUpButton->SetBitmap( KiBitmap( up_xpm ) ); m_moveUpButton->SetBitmap( KiBitmap( small_up_xpm ) );
m_moveDownButton->SetBitmap( KiBitmap( down_xpm ) ); m_moveDownButton->SetBitmap( KiBitmap( small_down_xpm ) );
m_reloadButton->SetBitmap( KiBitmap( refresh_xpm ) ); m_reloadButton->SetBitmap( KiBitmap( refresh_xpm ) );
} }
@ -155,7 +155,8 @@ bool PANEL_PCBNEW_ACTION_PLUGINS::TransferDataFromWindow()
bool PANEL_PCBNEW_ACTION_PLUGINS::TransferDataToWindow() bool PANEL_PCBNEW_ACTION_PLUGINS::TransferDataToWindow()
{ {
m_grid->Freeze(); 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(); const auto& orderedPlugins = m_frame->GetOrderedActionPlugins();
m_grid->AppendRows( orderedPlugins.size() ); m_grid->AppendRows( orderedPlugins.size() );

View File

@ -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/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // 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 ) 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; wxBoxSizer* bPanelSizer;
bPanelSizer = new wxBoxSizer( wxHORIZONTAL ); bPanelSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bGridSizer; wxBoxSizer* bGridSizer;
bGridSizer = new wxBoxSizer( wxVERTICAL ); 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 ); bPanelSizer->Add( bGridSizer, 1, wxALIGN_LEFT|wxEXPAND|wxLEFT, 0 );
wxBoxSizer* bButtonsSizer; wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxVERTICAL ); bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
m_moveUpButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); 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 = 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 = 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 ); this->SetSizer( bPanelSizer );

View File

@ -89,7 +89,7 @@
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bPanelSizer</property> <property name="name">bPanelSizer</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">0</property> <property name="border">0</property>
@ -100,11 +100,11 @@
<property name="name">bGridSizer</property> <property name="name">bGridSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxGrid" expanded="1"> <object class="wxGrid" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -254,16 +254,16 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">0</property> <property name="border">0</property>
<property name="flag">wxALIGN_RIGHT|wxALIGN_TOP</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bButtonsSizer</property> <property name="name">bButtonsSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_TOP|wxALL</property> <property name="flag">wxLEFT|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBitmapButton" expanded="0"> <object class="wxBitmapButton" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -306,7 +306,7 @@
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</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="moveable">1</property>
<property name="name">m_moveUpButton</property> <property name="name">m_moveUpButton</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
@ -364,11 +364,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1"> <object class="wxBitmapButton" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -409,7 +409,7 @@
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</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="moveable">1</property>
<property name="name">m_moveDownButton</property> <property name="name">m_moveDownButton</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
@ -469,9 +469,19 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</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="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -512,7 +522,7 @@
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</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="moveable">1</property>
<property name="name">m_reloadButton</property> <property name="name">m_reloadButton</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>

View File

@ -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/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!