Skip to content

Commit

Permalink
Fixed crash with wxWidgets 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 committed Feb 22, 2025
1 parent 7ce46ef commit b3b92ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ GOOrganSettingsDialog::GOOrganSettingsDialog(
0,
wxHELP | wxCLOSE),
GOView(doc, this) {
m_PipesTab = new GOOrganSettingsPipesTab(organModel, this);
AddTab(m_PipesTab);

m_EnclosuresTab = new GOOrganSettingsEnclosuresTab(organModel, this);
AddTab(m_EnclosuresTab);

// add a custom button 'Reason into the space of the standard dialog button
wxSizer *const pButtonSizer = GetButtonSizer();

Expand All @@ -77,14 +71,23 @@ GOOrganSettingsDialog::GOOrganSettingsDialog(
pButtonSizer->InsertSpacer(9, 10);
}

// Don't move above because adding tabs raises events that require buttons
m_PipesTab = new GOOrganSettingsPipesTab(organModel, this);
AddTab(m_PipesTab);

m_EnclosuresTab = new GOOrganSettingsEnclosuresTab(organModel, this);
AddTab(m_EnclosuresTab);

LayoutDialog();
}

void GOOrganSettingsDialog::ButtonStatesChanged() {
auto pTab = dynamic_cast<GOOrganSettingsTab *>(GetBook()->GetCurrentPage());

if (pTab) {
m_AudioGroupAssistant->Enable(pTab->IsDistributeAudioEnabled());
bool isDistributeAnabled = pTab->IsDistributeAudioEnabled();

m_AudioGroupAssistant->Enable(isDistributeAnabled);
m_Default->Enable(pTab->IsDefaultEnabled());
m_Discard->Enable(pTab->IsRevertEnabled());
m_Apply->Enable(pTab->IsApplyEnabled());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class GOOrganSettingsPipesTab;

class GOOrganSettingsDialog : public GOOrganSettingsDialogBase, public GOView {
private:
GOOrganSettingsPipesTab *m_PipesTab;
GOOrganSettingsEnclosuresTab *m_EnclosuresTab;

wxButton *m_AudioGroupAssistant;
wxButton *m_Default;
wxButton *m_Discard;
wxButton *m_Apply;

GOOrganSettingsPipesTab *m_PipesTab;
GOOrganSettingsEnclosuresTab *m_EnclosuresTab;

public:
GOOrganSettingsDialog(
GOOrganModel &organModel, GODocumentBase *doc, wxWindow *parent);
Expand Down

0 comments on commit b3b92ff

Please sign in to comment.