Merge pull request #4785 from AenBleidd/vko_4783_fix_crash

[Manager] Create proper sizing on SimpleView
This commit is contained in:
Vitalii Koshura 2022-06-15 01:59:32 +02:00 committed by GitHub
commit 82b3c45bff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -118,6 +118,9 @@ CSimpleFrame::CSimpleFrame(wxString title, wxIconBundle* icons, wxPoint position
CreateMenus();
dlgMsgsPtr = NULL;
m_pBackgroundPanel = new CSimpleGUIPanel(this);
mainSizer = new wxBoxSizer(wxVERTICAL);
mainSizer->Add(m_pBackgroundPanel, 1, wxLEFT | wxRIGHT | wxEXPAND, 0);
SetSizerAndFit(mainSizer);
RestoreState();
}
@ -1006,7 +1009,6 @@ CSimpleGUIPanel::CSimpleGUIPanel(wxWindow* parent) :
Layout();
SetSizerAndFit(mainSizer);
parent->SetSizerAndFit(mainSizer);
SetBackgroundBitmap();
@ -1034,8 +1036,6 @@ CSimpleGUIPanel::~CSimpleGUIPanel()
delete checkForNewNoticesTimer;
m_bmpBg = wxNullBitmap; // Deletes old bitmap via reference counting
GetParent()->SetSizer(NULL, false); // Avoid trying to delete mainSizer twice
wxLogTrace(wxT("Function Start/End"), wxT("CSimpleGUIPanel::CSimpleGUIPanel - Destructor Function End"));
}

View File

@ -153,6 +153,7 @@ protected:
private:
CDlgMessages* dlgMsgsPtr;
wxBoxSizer* mainSizer;
DECLARE_EVENT_TABLE()
};