SIM_PLOT_FRAME_BASE: gives a minimal size for right panels.

On KDE, a too small size can hang wxWidgets.
This commit is contained in:
jean-pierre charras 2020-03-17 08:20:32 +01:00
parent 847de9143e
commit 0f0b9bdf87
3 changed files with 78 additions and 73 deletions

View File

@ -213,12 +213,14 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
m_splitterSignals->SetMinimumPaneSize( 20 );
m_panelSignals = new wxPanel( m_splitterSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panelSignals->SetMinSize( wxSize( -1,100 ) );
wxBoxSizer* bSizer10;
bSizer10 = new wxBoxSizer( wxVERTICAL );
m_staticText2 = new wxStaticText( m_panelSignals, wxID_ANY, _("Signals"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
bSizer10->Add( m_staticText2, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_staticTextSignals = new wxStaticText( m_panelSignals, wxID_ANY, _("Signals"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextSignals->Wrap( -1 );
bSizer10->Add( m_staticTextSignals, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_signals = new wxListView( m_panelSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
bSizer10->Add( m_signals, 1, wxEXPAND, 5 );
@ -239,12 +241,14 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
m_splitterTuneValues->SetMinimumPaneSize( 20 );
m_panelCursors = new wxPanel( m_splitterTuneValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panelCursors->SetMinSize( wxSize( -1,100 ) );
wxBoxSizer* bSizer12;
bSizer12 = new wxBoxSizer( wxVERTICAL );
m_staticText3 = new wxStaticText( m_panelCursors, wxID_ANY, _("Cursors"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
bSizer12->Add( m_staticText3, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_staticTextCursors = new wxStaticText( m_panelCursors, wxID_ANY, _("Cursors"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextCursors->Wrap( -1 );
bSizer12->Add( m_staticTextCursors, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_cursors = new wxListCtrl( m_panelCursors, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL );
bSizer12->Add( m_cursors, 1, wxEXPAND, 5 );
@ -254,12 +258,14 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
m_panelCursors->Layout();
bSizer12->Fit( m_panelCursors );
m_tunePanel = new wxPanel( m_splitterTuneValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_tunePanel->SetMinSize( wxSize( -1,100 ) );
wxBoxSizer* bSizer13;
bSizer13 = new wxBoxSizer( wxVERTICAL );
m_staticText4 = new wxStaticText( m_tunePanel, wxID_ANY, _("Tune"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText4->Wrap( -1 );
bSizer13->Add( m_staticText4, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_staticTextTune = new wxStaticText( m_tunePanel, wxID_ANY, _("Tune"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextTune->Wrap( -1 );
bSizer13->Add( m_staticTextTune, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_tuneSizer = new wxBoxSizer( wxHORIZONTAL );
@ -290,7 +296,6 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const
this->SetSizer( m_sizerMain );
this->Layout();
m_sizerMain->Fit( this );
this->Centre( wxBOTH );

View File

@ -47,7 +47,7 @@
<property name="minimum_size">-1,-1</property>
<property name="name">SIM_PLOT_FRAME_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="size">564,531</property>
<property name="style">wxDEFAULT_FRAME_STYLE</property>
<property name="subclass">KIWAY_PLAYER; kiway_player.h</property>
<property name="title">Spice Simulator</property>
@ -179,7 +179,7 @@
<event name="OnMenuSelection">menuExit</event>
</object>
</object>
<object class="wxMenu" expanded="1">
<object class="wxMenu" expanded="0">
<property name="label">Simulation</property>
<property name="name">m_simulationMenu</property>
<property name="permission">protected</property>
@ -274,7 +274,7 @@
<property name="unchecked_bitmap"></property>
</object>
</object>
<object class="wxMenu" expanded="1">
<object class="wxMenu" expanded="0">
<property name="label">View</property>
<property name="name">m_viewMenu</property>
<property name="permission">protected</property>
@ -354,11 +354,11 @@
<event name="OnMenuSelection">menuShowLegend</event>
<event name="OnUpdateUI">menuShowLegendUpdate</event>
</object>
<object class="separator" expanded="1">
<object class="separator" expanded="0">
<property name="name">m_separator21</property>
<property name="permission">none</property>
</object>
<object class="wxMenuItem" expanded="1">
<object class="wxMenuItem" expanded="0">
<property name="bitmap"></property>
<property name="checked">0</property>
<property name="enabled">1</property>
@ -373,7 +373,7 @@
<event name="OnMenuSelection">menuShowDotted</event>
<event name="OnUpdateUI">menuShowDottedUpdate</event>
</object>
<object class="wxMenuItem" expanded="1">
<object class="wxMenuItem" expanded="0">
<property name="bitmap"></property>
<property name="checked">0</property>
<property name="enabled">1</property>
@ -518,8 +518,8 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxBORDER_NONE</property>
<object class="splitteritem" expanded="1">
<object class="wxPanel" expanded="1">
<object class="splitteritem" expanded="0">
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -570,16 +570,16 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size">-1,-1</property>
<property name="name">m_sizer11</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxSplitterWindow" expanded="1">
<object class="wxSplitterWindow" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -636,8 +636,8 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<object class="splitteritem" expanded="1">
<object class="wxPanel" expanded="1">
<object class="splitteritem" expanded="0">
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -688,16 +688,16 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">m_sizerPlot</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxAuiNotebook" expanded="1">
<object class="wxAuiNotebook" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -753,11 +753,11 @@
<property name="window_style"></property>
<event name="OnAuiNotebookPageChanged">onPlotChanged</event>
<event name="OnAuiNotebookPageClose">onPlotClose</event>
<object class="auinotebookpage" expanded="1">
<object class="auinotebookpage" expanded="0">
<property name="bitmap"></property>
<property name="label">a page</property>
<property name="select">0</property>
<object class="wxPanel" expanded="1">
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -808,7 +808,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">m_sizer8</property>
<property name="orient">wxVERTICAL</property>
@ -823,11 +823,11 @@
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizer81</property>
<property name="orient">wxHORIZONTAL</property>
@ -933,8 +933,8 @@
</object>
</object>
</object>
<object class="splitteritem" expanded="1">
<object class="wxPanel" expanded="1">
<object class="splitteritem" expanded="0">
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -985,7 +985,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">m_sizerConsole</property>
<property name="orient">wxVERTICAL</property>
@ -1062,8 +1062,8 @@
</object>
</object>
</object>
<object class="splitteritem" expanded="1">
<object class="wxPanel" expanded="1">
<object class="splitteritem" expanded="0">
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1114,16 +1114,16 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">m_sideSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxSplitterWindow" expanded="1">
<object class="wxSplitterWindow" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1180,8 +1180,8 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<object class="splitteritem" expanded="1">
<object class="wxPanel" expanded="1">
<object class="splitteritem" expanded="0">
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1214,7 +1214,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,-1</property>
<property name="minimum_size">-1,100</property>
<property name="moveable">1</property>
<property name="name">m_panelSignals</property>
<property name="pane_border">1</property>
@ -1232,16 +1232,16 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizer10</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">wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1278,7 +1278,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText2</property>
<property name="name">m_staticTextSignals</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1335,7 +1335,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="minimum_size">-1,-1</property>
<property name="moveable">1</property>
<property name="name">m_signals</property>
<property name="pane_border">1</property>
@ -1365,8 +1365,8 @@
</object>
</object>
</object>
<object class="splitteritem" expanded="1">
<object class="wxPanel" expanded="1">
<object class="splitteritem" expanded="0">
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1417,16 +1417,16 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizer9</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</property>
<property name="proportion">1</property>
<object class="wxSplitterWindow" expanded="1">
<object class="wxSplitterWindow" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1483,8 +1483,8 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxBORDER_NONE</property>
<object class="splitteritem" expanded="1">
<object class="wxPanel" expanded="1">
<object class="splitteritem" expanded="0">
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1517,7 +1517,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,-1</property>
<property name="minimum_size">-1,100</property>
<property name="moveable">1</property>
<property name="name">m_panelCursors</property>
<property name="pane_border">1</property>
@ -1535,16 +1535,16 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizer12</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">wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1581,7 +1581,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText3</property>
<property name="name">m_staticTextCursors</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1638,7 +1638,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="minimum_size">-1,-1</property>
<property name="moveable">1</property>
<property name="name">m_cursors</property>
<property name="pane_border">1</property>
@ -1666,8 +1666,8 @@
</object>
</object>
</object>
<object class="splitteritem" expanded="1">
<object class="wxPanel" expanded="1">
<object class="splitteritem" expanded="0">
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1700,7 +1700,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,-1</property>
<property name="minimum_size">-1,100</property>
<property name="moveable">1</property>
<property name="name">m_tunePanel</property>
<property name="pane_border">1</property>
@ -1718,16 +1718,16 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizer13</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">wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1764,7 +1764,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText4</property>
<property name="name">m_staticTextTune</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1784,11 +1784,11 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">m_tuneSizer</property>
<property name="orient">wxHORIZONTAL</property>

View File

@ -84,15 +84,15 @@ class SIM_PLOT_FRAME_BASE : public KIWAY_PLAYER
wxBoxSizer* m_sideSizer;
wxSplitterWindow* m_splitterSignals;
wxPanel* m_panelSignals;
wxStaticText* m_staticText2;
wxStaticText* m_staticTextSignals;
wxListView* m_signals;
wxPanel* m_panelCursorsAndTune;
wxSplitterWindow* m_splitterTuneValues;
wxPanel* m_panelCursors;
wxStaticText* m_staticText3;
wxStaticText* m_staticTextCursors;
wxListCtrl* m_cursors;
wxPanel* m_tunePanel;
wxStaticText* m_staticText4;
wxStaticText* m_staticTextTune;
wxBoxSizer* m_tuneSizer;
// Virtual event handlers, overide them in your derived class
@ -121,7 +121,7 @@ class SIM_PLOT_FRAME_BASE : public KIWAY_PLAYER
public:
SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Spice Simulator"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString& name = wxT("SIM_PLOT_FRAME") );
SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Spice Simulator"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 564,531 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString& name = wxT("SIM_PLOT_FRAME") );
~SIM_PLOT_FRAME_BASE();