git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63519
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual bool ButtonClickDidStateChange() = 0;
virtual void InstallEventHandler( WXWidget control = NULL ) = 0;
virtual bool ButtonClickDidStateChange() = 0;
virtual void InstallEventHandler( WXWidget control = NULL ) = 0;
+
+ // Mechanism used to keep track of whether a change should send an event
+ // Do SendEvents(false) when starting actions that would trigger programmatic events
+ // and SendEvents(true) at the end of the block.
+ virtual void SendEvents(bool shouldSendEvents) { m_shouldSendEvents = shouldSendEvents; }
+ virtual bool ShouldSendEvents() { return m_shouldSendEvents; }
// static methods for associating native controls and their implementations
// static methods for associating native controls and their implementations
wxWindowMac* m_wxPeer;
bool m_needsFocusRect;
bool m_needsFrame;
wxWindowMac* m_wxPeer;
bool m_needsFocusRect;
bool m_needsFrame;
+ bool m_shouldSendEvents;
DECLARE_ABSTRACT_CLASS(wxWidgetImpl)
};
DECLARE_ABSTRACT_CLASS(wxWidgetImpl)
};
{
wxUnusedVar(aNotification);
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
{
wxUnusedVar(aNotification);
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
+ if ( impl && impl->ShouldSendEvents() )
{
wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
if ( wxpeer ) {
{
wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
if ( wxpeer ) {
{
wxUnusedVar(notification);
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
{
wxUnusedVar(notification);
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
+ if ( impl && impl->ShouldSendEvents())
{
wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
if ( wxpeer ) {
{
wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
if ( wxpeer ) {
void wxNSComboBoxControl::SetSelectedItem(int item)
{
wxASSERT_MSG(item >= 0 && item < [m_comboBox numberOfItems], "Inavlid item index.");
void wxNSComboBoxControl::SetSelectedItem(int item)
{
wxASSERT_MSG(item >= 0 && item < [m_comboBox numberOfItems], "Inavlid item index.");
[m_comboBox selectItemAtIndex: item];
[m_comboBox selectItemAtIndex: item];
}
int wxNSComboBoxControl::GetNumberOfItems() const
}
int wxNSComboBoxControl::GetNumberOfItems() const
void wxNSComboBoxControl::RemoveItem(int pos)
{
void wxNSComboBoxControl::RemoveItem(int pos)
{
[m_comboBox removeItemAtIndex:pos];
[m_comboBox removeItemAtIndex:pos];
}
void wxNSComboBoxControl::Clear()
{
}
void wxNSComboBoxControl::Clear()
{
[m_comboBox removeAllItems];
[m_comboBox removeAllItems];
}
wxString wxNSComboBoxControl::GetStringAtIndex(int pos) const
}
wxString wxNSComboBoxControl::GetStringAtIndex(int pos) const
Init();
m_isRootControl = isRootControl;
m_wxPeer = peer;
Init();
m_isRootControl = isRootControl;
m_wxPeer = peer;
+ m_shouldSendEvents = true;
}
wxWidgetImpl::wxWidgetImpl()
}
wxWidgetImpl::wxWidgetImpl()