Demonstrate disabling radio buttons in the sample

Radio buttons are different from the other controls internally in
IFileDialogCustomize-based implementation, so check that disabling them
also works correctly.
This commit is contained in:
Vadim Zeitlin
2022-06-03 23:00:23 +01:00
parent 153a024492
commit 76ff441bf2

View File

@@ -1731,6 +1731,13 @@ public:
// Enable the button if and only if the checkbox is checked.
m_btn->Enable(m_cb->GetValue());
// Enable radio buttons only if a file is selected.
bool hasFile = wxFileName::FileExists(
m_dialog->GetCurrentlySelectedFilename()
);
m_radioA4->Enable(hasFile);
m_radioLetter->Enable(hasFile);
// Also show the current dialog state.
m_label->SetLabelText(GetFileDialogStateDescription(m_dialog));
}