Add wxMac wxFileDialog::GetCurrentlySelectedFilterIndex() support
Simply set the relevant variable while changing selection and give the extra control a chance to update. Note that updating the UI currently asserts with the dialog sample if wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES is 1 (toggable with Ctrl+Cmd+S in the sample), This will be fixed in the next commit.
This commit is contained in:
@@ -236,10 +236,11 @@ public:
|
|||||||
control to update its state depending on the currently selected file
|
control to update its state depending on the currently selected file
|
||||||
type filter.
|
type filter.
|
||||||
|
|
||||||
Currently this function is fully implemented only under MSW and
|
Currently this function is fully implemented under macOS and MSW and
|
||||||
always returns @c wxNOT_FOUND elsewhere.
|
always returns @c wxNOT_FOUND elsewhere.
|
||||||
|
|
||||||
@since 3.1.3
|
@since 3.1.3 - MSW
|
||||||
|
@since 3.1.5 - macOS
|
||||||
|
|
||||||
@return The 0-based index of the currently selected file type filter or
|
@return The 0-based index of the currently selected file type filter or
|
||||||
wxNOT_FOUND if nothing is selected.
|
wxNOT_FOUND if nothing is selected.
|
||||||
|
@@ -295,6 +295,10 @@ void wxFileDialog::DoOnFilterSelected(int index)
|
|||||||
NSArray* types = GetTypesFromExtension(m_filterExtensions[index],m_currentExtensions);
|
NSArray* types = GetTypesFromExtension(m_filterExtensions[index],m_currentExtensions);
|
||||||
NSSavePanel* panel = (NSSavePanel*) GetWXWindow();
|
NSSavePanel* panel = (NSSavePanel*) GetWXWindow();
|
||||||
[panel setAllowedFileTypes:types];
|
[panel setAllowedFileTypes:types];
|
||||||
|
|
||||||
|
m_currentlySelectedFilterIndex = index;
|
||||||
|
|
||||||
|
UpdateExtraControlUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
// An item has been selected in the file filter wxChoice:
|
// An item has been selected in the file filter wxChoice:
|
||||||
|
Reference in New Issue
Block a user