superimpl(slf, (SEL)_cmd, event);
// super of built-ins keeps the mouse up, as wx expects this event, we have to synthesize it
-
- if ( [ event type] == NSLeftMouseDown )
+ // only trigger if at this moment the mouse is already up
+ if ( [ event type] == NSLeftMouseDown && !wxGetMouseState().LeftIsDown() )
{
wxMouseEvent wxevent(wxEVT_LEFT_DOWN);
SetupMouseEvent(wxevent , event) ;
{
wxWindow* wxpeer = (wxWindow*) GetWXPeer();
if ( wxpeer )
+ {
+ wxpeer->OSXSimulateFocusEvents();
wxpeer->OSXHandleClicked(0);
+ }
}
void wxWidgetCocoaImpl::controlDoubleAction( WXWidget WXUNUSED(slf), void *WXUNUSED(_cmd), void *WXUNUSED(sender))
NSView* container = parent->GetWXWidget() ;
wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ;
[container addSubview:m_osxView];
+
+ if( m_wxPeer->IsFrozen() )
+ [[m_osxView window] disableFlushWindow];
}
void wxWidgetCocoaImpl::SetBackgroundColour( const wxColour &col )
if ([cell respondsToSelector:@selector(setControlSize:)])
[cell setControlSize:size];
}
+
+ // we need to propagate this to inner views as well
+ if ( [m_osxView isKindOfClass:[NSScrollView class] ] )
+ {
+ NSView* targetView = [(NSScrollView*) m_osxView documentView];
+
+ if ( [targetView respondsToSelector:@selector(setControlSize:)] )
+ [targetView setControlSize:size];
+ else if ([targetView respondsToSelector:@selector(cell)])
+ {
+ id cell = [(id)targetView cell];
+ if ([cell respondsToSelector:@selector(setControlSize:)])
+ [cell setControlSize:size];
+ }
+ }
}
void wxWidgetCocoaImpl::SetFont(wxFont const& font, wxColour const&col, long, bool)
{
- if ([m_osxView respondsToSelector:@selector(setFont:)])
- [m_osxView setFont: font.OSXGetNSFont()];
- if ([m_osxView respondsToSelector:@selector(setTextColor:)])
- [m_osxView setTextColor:[NSColor colorWithCalibratedRed:(CGFloat) (col.Red() / 255.0)
+ NSView* targetView = m_osxView;
+ if ( [m_osxView isKindOfClass:[NSScrollView class] ] )
+ targetView = [(NSScrollView*) m_osxView documentView];
+
+ if ([targetView respondsToSelector:@selector(setFont:)])
+ [targetView setFont: font.OSXGetNSFont()];
+ if ([targetView respondsToSelector:@selector(setTextColor:)])
+ [targetView setTextColor:[NSColor colorWithCalibratedRed:(CGFloat) (col.Red() / 255.0)
green:(CGFloat) (col.Green() / 255.0)
blue:(CGFloat) (col.Blue() / 255.0)
alpha:(CGFloat) (col.Alpha() / 255.0)]];
event.SetWindow(otherWindow->GetWXPeer());
thisWindow->HandleWindowEvent(event) ;
}
- else // !receivedFocuss
+ else // !receivedFocus
{
#if wxUSE_CARET
if ( thisWindow->GetCaret() )
m_isFlipped = flipped;
}
+void wxWidgetCocoaImpl::SetDrawingEnabled(bool enabled)
+{
+ if ( enabled )
+ {
+ [[m_osxView window] enableFlushWindow];
+ [m_osxView setNeedsDisplay:YES];
+ }
+ else
+ {
+ [[m_osxView window] disableFlushWindow];
+ }
+}
//
// Factory methods
//