Implement wxComboBox::Popup() and Dismiss() for wxOSX/Cocoa.
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
This commit is contained in:
@@ -509,6 +509,7 @@ OSX:
|
|||||||
for OS X 10.6.
|
for OS X 10.6.
|
||||||
- Added wxApp::MacOpenFiles and deprecated wxApp::MacOpenFile.
|
- Added wxApp::MacOpenFiles and deprecated wxApp::MacOpenFile.
|
||||||
- Implement wxEVT_CHAR_HOOK event generation in wxOSX/Cocoa.
|
- Implement wxEVT_CHAR_HOOK event generation in wxOSX/Cocoa.
|
||||||
|
- Implemented wxComboBox::Popup() and Dismiss() in wxOSX/Cocoa (joostn).
|
||||||
|
|
||||||
GTK:
|
GTK:
|
||||||
|
|
||||||
|
@@ -105,6 +105,9 @@ public :
|
|||||||
virtual wxString GetStringAtIndex(int pos) const;
|
virtual wxString GetStringAtIndex(int pos) const;
|
||||||
|
|
||||||
virtual int FindString(const wxString& text) const;
|
virtual int FindString(const wxString& text) const;
|
||||||
|
virtual void Popup();
|
||||||
|
virtual void Dismiss();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NSComboBox* m_comboBox;
|
NSComboBox* m_comboBox;
|
||||||
};
|
};
|
||||||
|
@@ -139,6 +139,8 @@ class WXDLLIMPEXP_CORE wxComboBox :
|
|||||||
virtual wxTextWidgetImpl* GetTextPeer() const;
|
virtual wxTextWidgetImpl* GetTextPeer() const;
|
||||||
#endif // wxOSX_USE_CARBON
|
#endif // wxOSX_USE_CARBON
|
||||||
|
|
||||||
|
virtual void Popup();
|
||||||
|
virtual void Dismiss();
|
||||||
|
|
||||||
|
|
||||||
// osx specific event handling common for all osx-ports
|
// osx specific event handling common for all osx-ports
|
||||||
|
@@ -690,6 +690,8 @@ public :
|
|||||||
virtual void RemoveItem(int WXUNUSED(pos)) {}
|
virtual void RemoveItem(int WXUNUSED(pos)) {}
|
||||||
|
|
||||||
virtual void Clear() {}
|
virtual void Clear() {}
|
||||||
|
virtual void Popup() {}
|
||||||
|
virtual void Dismiss() {}
|
||||||
|
|
||||||
virtual wxString GetStringAtIndex(int WXUNUSED(pos)) const { return wxEmptyString; }
|
virtual wxString GetStringAtIndex(int WXUNUSED(pos)) const { return wxEmptyString; }
|
||||||
|
|
||||||
|
@@ -285,10 +285,11 @@ public:
|
|||||||
/**
|
/**
|
||||||
Shows the list box portion of the combo box.
|
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
|
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
|
@since 2.9.1
|
||||||
*/
|
*/
|
||||||
@@ -297,10 +298,11 @@ public:
|
|||||||
/**
|
/**
|
||||||
Hides the list box portion of the combo box.
|
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
|
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
|
@since 2.9.1
|
||||||
*/
|
*/
|
||||||
|
@@ -165,6 +165,18 @@ int wxNSComboBoxControl::FindString(const wxString& text) const
|
|||||||
return result;
|
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,
|
wxWidgetImplType* wxWidgetImpl::CreateComboBox( wxComboBox* wxpeer,
|
||||||
wxWindowMac* WXUNUSED(parent),
|
wxWindowMac* WXUNUSED(parent),
|
||||||
wxWindowID WXUNUSED(id),
|
wxWindowID WXUNUSED(id),
|
||||||
|
@@ -215,4 +215,14 @@ wxComboWidgetImpl* wxComboBox::GetComboPeer() const
|
|||||||
return dynamic_cast<wxComboWidgetImpl*> (GetPeer());
|
return dynamic_cast<wxComboWidgetImpl*> (GetPeer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxComboBox::Popup()
|
||||||
|
{
|
||||||
|
GetComboPeer()->Popup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxComboBox::Dismiss()
|
||||||
|
{
|
||||||
|
GetComboPeer()->Dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
#endif // wxUSE_COMBOBOX && wxOSX_USE_COCOA
|
#endif // wxUSE_COMBOBOX && wxOSX_USE_COCOA
|
||||||
|
Reference in New Issue
Block a user