Skip to content

Commit c59d1dc

Browse files
authored
Merge pull request #461 from NREL/SAM_457
Fixes SAM #457
2 parents 1701107 + 325ce4c commit c59d1dc

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

src/casewin.cpp

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,42 +151,42 @@ CaseWindow::CaseWindow( wxWindow *parent, Case *c )
151151

152152
wxColour lafore( *wxWHITE ), laback( 100,100,100 );
153153

154-
wxPanel *left_panel = new wxPanel( this );
155-
left_panel->SetBackgroundColour( laback );
154+
m_left_panel = new wxPanel(this);
155+
m_left_panel->SetBackgroundColour( laback );
156156

157-
m_inputPageList = new InputPageList( left_panel, ID_INPUTPAGELIST );
157+
m_inputPageList = new InputPageList( m_left_panel, ID_INPUTPAGELIST );
158158
m_inputPageList->SetCaseWindow( this );
159159
m_inputPageList->SetBackgroundColour( wxColour(243,243,243) );
160160

161161
wxFont lafont( *wxNORMAL_FONT );
162162
lafont.SetWeight( wxFONTWEIGHT_BOLD );
163-
m_configLabel = new wxStaticText( left_panel, wxID_ANY, "-technology-" );
163+
m_configLabel = new wxStaticText( m_left_panel, wxID_ANY, "-technology-" );
164164
m_configLabel->SetBackgroundColour( laback );
165165
m_configLabel->SetForegroundColour( lafore );
166166
m_configLabel->SetFont( lafont );
167167

168168

169169

170-
m_simButton = new wxMetroButton( left_panel, ID_SIMULATE, "Simulate", wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxMB_RIGHTARROW );
170+
m_simButton = new wxMetroButton( m_left_panel, ID_SIMULATE, "Simulate", wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxMB_RIGHTARROW );
171171
m_simButton->SetFont( wxMetroTheme::Font( wxMT_NORMAL, 14) );
172-
m_resultsButton = new wxMetroButton( left_panel, ID_RESULTSPAGE, wxEmptyString, wxBITMAP_PNG_FROM_DATA( graph ) );
172+
m_resultsButton = new wxMetroButton( m_left_panel, ID_RESULTSPAGE, wxEmptyString, wxBITMAP_PNG_FROM_DATA( graph ) );
173173

174174
wxBoxSizer *szhl = new wxBoxSizer( wxHORIZONTAL );
175175
szhl->Add( m_simButton, 1, wxALL|wxEXPAND, 0 );
176176
szhl->Add( m_resultsButton, 0, wxALL|wxEXPAND, 0 );
177177

178178
wxSizer *szsims = new wxGridSizer(2, 0, 0);
179-
szsims->Add( new wxMetroButton( left_panel, ID_PARAMETRICS, "Parametrics" ), 0, wxALL|wxEXPAND, 0 );
180-
szsims->Add( new wxMetroButton( left_panel, ID_STOCHASTIC, "Stochastic" ), 0, wxALL|wxEXPAND, 0 );
181-
szsims->Add( new wxMetroButton( left_panel, ID_P50P90, "P50 / P90" ), 0, wxALL|wxEXPAND, 0 );
182-
szsims->Add( new wxMetroButton( left_panel, ID_MACRO, "Macros" ), 0, wxALL|wxEXPAND, 0 );
179+
szsims->Add( new wxMetroButton(m_left_panel, ID_PARAMETRICS, "Parametrics" ), 0, wxALL|wxEXPAND, 0 );
180+
szsims->Add( new wxMetroButton(m_left_panel, ID_STOCHASTIC, "Stochastic" ), 0, wxALL|wxEXPAND, 0 );
181+
szsims->Add( new wxMetroButton(m_left_panel, ID_P50P90, "P50 / P90" ), 0, wxALL|wxEXPAND, 0 );
182+
szsims->Add( new wxMetroButton(m_left_panel, ID_MACRO, "Macros" ), 0, wxALL|wxEXPAND, 0 );
183183

184184
wxBoxSizer *szvl = new wxBoxSizer( wxVERTICAL );
185185
szvl->Add( m_configLabel, 0, wxALIGN_CENTER|wxTOP|wxBOTTOM, 3 );
186186
szvl->Add( m_inputPageList, 1, wxALL|wxEXPAND, 0 );
187187
szvl->Add( szhl, 0, wxALL|wxEXPAND, 0 );
188188
szvl->Add( szsims, 0, wxALL|wxEXPAND, 0 );
189-
left_panel->SetSizer( szvl );
189+
m_left_panel->SetSizer( szvl );
190190

191191
m_pageFlipper = new wxSimplebook( this, ID_PAGES, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE );
192192

@@ -227,7 +227,7 @@ CaseWindow::CaseWindow( wxWindow *parent, Case *c )
227227
wxDevicePPIToScale( wxClientDC(this).GetPPI(), &xScale, &yScale );
228228

229229
SetMinimumPaneSize( 50 );
230-
SplitVertically( left_panel, m_pageFlipper, (int)(210*xScale) );
230+
SplitVertically( m_left_panel, m_pageFlipper, (int)(210*xScale) );
231231

232232

233233
m_pageNote = new PageNote( this );
@@ -716,6 +716,7 @@ void CaseWindow::OnCaseEvent( Case *, CaseEvent &evt )
716716
{
717717
wxString sel = m_inputPageList->GetStringSelection();
718718
UpdateConfiguration();
719+
719720
if (!sel.empty())
720721
SwitchToInputPage( sel );
721722
else
@@ -733,6 +734,9 @@ void CaseWindow::OnCaseEvent( Case *, CaseEvent &evt )
733734
m_macros->ConfigurationChanged();
734735

735736
SamApp::Project().SetModified( true );
737+
738+
m_left_panel->Layout();
739+
736740
}
737741
else if ( evt.GetType() == CaseEvent::SAVE_NOTIFICATION )
738742
{

src/casewin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ class CaseWindow : public wxSplitterWindow, CaseEventListener
8989
private:
9090
Case *m_case;
9191

92+
wxPanel* m_left_panel;
93+
9294
InputPageList *m_inputPageList;
9395
std::vector<InputPageGroup*> m_pageGroups;
9496
UIFormDatabase m_forms;

0 commit comments

Comments
 (0)