X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/abda578832da0b40542907d9fefae5e9cf49bb24..5a9819026e56a43892e3f291215022a9df33a52f:/src/mac/window.cpp diff --git a/src/mac/window.cpp b/src/mac/window.cpp index fd36642550..fb00a1c4d1 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -35,6 +35,7 @@ #include "wx/tooltip.h" #include "wx/statusbr.h" #include "wx/menuitem.h" +#include "wx/spinctrl.h" #include "wx/log.h" #if wxUSE_CARET @@ -124,6 +125,8 @@ void wxWindowMac::Init() m_hScrollBar = NULL ; m_vScrollBar = NULL ; + + m_label = wxEmptyString; } // Destructor @@ -676,12 +679,12 @@ wxPoint wxWindowMac::GetClientAreaOrigin() const return wxPoint(MacGetLeftBorderSize( ) , MacGetTopBorderSize( ) ); } -void wxWindow::SetTitle(const wxString& title) +void wxWindowMac::SetTitle(const wxString& title) { m_label = title ; } -wxString wxWindow::GetTitle() const +wxString wxWindowMac::GetTitle() const { return m_label ; } @@ -691,11 +694,17 @@ bool wxWindowMac::Show(bool show) if ( !wxWindowBase::Show(show) ) return FALSE; +/* + WindowRef window = (WindowRef) MacGetRootWindow() ; + wxWindowMac* win = wxFindWinFromMacWindow( window ) ; + if ( win == NULL && win->m_isBeingDeleted ) + return FALSE ; +*/ MacSuperShown( show ) ; + Refresh() ; +/* if ( !show ) { - WindowRef window = (WindowRef) MacGetRootWindow() ; - wxWindowMac* win = wxFindWinFromMacWindow( window ) ; if ( win && !win->m_isBeingDeleted ) Refresh() ; } @@ -703,7 +712,7 @@ bool wxWindowMac::Show(bool show) { Refresh() ; } - +*/ return TRUE; } @@ -908,7 +917,7 @@ const wxBrush& wxWindowMac::MacGetBackgroundBrush() Rect extent = { 0 , 0 , 0 , 0 } ; int x , y ; x = y = 0 ; - wxSize size = GetSize() ; + wxSize size = parent->GetSize() ; parent->MacClientToRootWindow( &x , &y ) ; extent.left = x ; extent.top = y ; @@ -1386,6 +1395,7 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa } extern int wxBusyCursorCount ; +static wxWindow *gs_lastWhich = NULL; bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event) { @@ -1394,7 +1404,7 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event) return FALSE; - if ( IsKindOf( CLASSINFO ( wxStaticBox ) ) ) + if ( IsKindOf( CLASSINFO ( wxStaticBox ) ) || IsKindOf( CLASSINFO( wxSpinCtrl ) )) return FALSE ; WindowRef window = (WindowRef) MacGetRootWindow() ; @@ -1417,6 +1427,7 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event) event.m_x = x ; event.m_y = y ; + event.SetEventObject( this ) ; if ( wxBusyCursorCount == 0 ) { @@ -1437,6 +1448,23 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event) wxToolTip::RelayEvent( this , event); #endif // wxUSE_TOOLTIPS + if (gs_lastWhich != this) + { + gs_lastWhich = this; + + // Double clicks must always occur on the same window + if (event.GetEventType() == wxEVT_LEFT_DCLICK) + event.SetEventType( wxEVT_LEFT_DOWN ); + if (event.GetEventType() == wxEVT_RIGHT_DCLICK) + event.SetEventType( wxEVT_RIGHT_DOWN ); + + // Same for mouse up events + if (event.GetEventType() == wxEVT_LEFT_UP) + return TRUE; + if (event.GetEventType() == wxEVT_RIGHT_UP) + return TRUE; + } + GetEventHandler()->ProcessEvent( event ) ; return TRUE;