Unlike in the other ports, these methods currently don't generate any events
under OS X because these events are never generated at all there.
Closes #12642.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69948
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
for OS X 10.6.
- Added wxApp::MacOpenFiles and deprecated wxApp::MacOpenFile.
- Implement wxEVT_CHAR_HOOK event generation in wxOSX/Cocoa.
+- Implemented wxComboBox::Popup() and Dismiss() in wxOSX/Cocoa (joostn).
GTK:
virtual wxString GetStringAtIndex(int pos) const;
virtual int FindString(const wxString& text) const;
+ virtual void Popup();
+ virtual void Dismiss();
+
private:
NSComboBox* m_comboBox;
};
virtual wxTextWidgetImpl* GetTextPeer() const;
#endif // wxOSX_USE_CARBON
+ virtual void Popup();
+ virtual void Dismiss();
// osx specific event handling common for all osx-ports
virtual void RemoveItem(int WXUNUSED(pos)) {}
virtual void Clear() {}
+ virtual void Popup() {}
+ virtual void Dismiss() {}
virtual wxString GetStringAtIndex(int WXUNUSED(pos)) const { return wxEmptyString; }
/**
Shows the list box portion of the combo box.
- Currently only implemented in wxMSW and wxGTK.
+ Currently this method is implemented in wxMSW, wxGTK and wxOSX/Cocoa.
Notice that calling this function will generate a
- @c wxEVT_COMMAND_COMBOBOX_DROPDOWN event.
+ @c wxEVT_COMMAND_COMBOBOX_DROPDOWN event except under wxOSX where
+ generation of this event is not supported at all.
@since 2.9.1
*/
/**
Hides the list box portion of the combo box.
- Currently only implemented in wxMSW and wxGTK.
+ Currently this method is implemented in wxMSW, wxGTK and wxOSX/Cocoa.
Notice that calling this function will generate a
- @c wxEVT_COMMAND_COMBOBOX_CLOSEUP event.
+ @c wxEVT_COMMAND_COMBOBOX_CLOSEUP event except under wxOSX where
+ generation of this event is not supported at all.
@since 2.9.1
*/
virtual void Dismiss();
-
+
virtual int GetSelection() const;
virtual void GetSelection(long *from, long *to) const;
virtual void SetSelection(int n);
return result;
}
+void wxNSComboBoxControl::Popup()
+{
+ id ax = NSAccessibilityUnignoredDescendant(m_comboBox);
+ [ax accessibilitySetValue: [NSNumber numberWithBool: YES] forAttribute: NSAccessibilityExpandedAttribute];
+}
+
+void wxNSComboBoxControl::Dismiss()
+{
+ id ax = NSAccessibilityUnignoredDescendant(m_comboBox);
+ [ax accessibilitySetValue: [NSNumber numberWithBool: NO] forAttribute: NSAccessibilityExpandedAttribute];
+}
+
wxWidgetImplType* wxWidgetImpl::CreateComboBox( wxComboBox* wxpeer,
wxWindowMac* WXUNUSED(parent),
wxWindowID WXUNUSED(id),
return dynamic_cast<wxComboWidgetImpl*> (GetPeer());
}
+void wxComboBox::Popup()
+{
+ GetComboPeer()->Popup();
+}
+
+void wxComboBox::Dismiss()
+{
+ GetComboPeer()->Dismiss();
+}
+
#endif // wxUSE_COMBOBOX && wxOSX_USE_COCOA