return NULL;
}
-//
-// TODO END move to window_osx.cpp
-//
-
// ---------------------------------------------------------------------------
// Utility Routines to move between different coordinate systems
// ---------------------------------------------------------------------------
return true ;
}
+static bool wxIsWindowOrParentDisabled(wxWindow* w)
+{
+ while (w && !w->IsTopLevel())
+ {
+ if (!w->IsEnabled())
+ return true;
+ w = w->GetParent();
+ }
+ return false;
+}
+
void wxWindowMac::SetFocus()
{
if ( !AcceptsFocus() )
return ;
+ if (wxIsWindowOrParentDisabled((wxWindow*) this))
+ return;
+
wxWindow* former = FindFocus() ;
if ( former == this )
return ;
int actualX = x;
int actualY = y;
+#if 0
+ // min and max sizes are only for sizers, not for explicit size setting
if ((m_minWidth != -1) && (actualWidth < m_minWidth))
actualWidth = m_minWidth;
if ((m_minHeight != -1) && (actualHeight < m_minHeight))
actualWidth = m_maxWidth;
if ((m_maxHeight != -1) && (actualHeight > m_maxHeight))
actualHeight = m_maxHeight;
+#endif
bool doMove = false, doResize = false ;
return width;
}
-void wxWindowMac::GetTextExtent(const wxString& str, int *x, int *y,
- int *descent, int *externalLeading, const wxFont *theFont ) const
+void wxWindowMac::DoGetTextExtent(const wxString& str,
+ int *x, int *y,
+ int *descent,
+ int *externalLeading,
+ const wxFont *theFont) const
{
const wxFont *fontToUse = theFont;
wxFont tempFont;
}
}
-// Get the window with the focus
wxWindow *wxWindowBase::DoFindFocus()
{
-#if wxOSX_USE_CARBON
- ControlRef control ;
- GetKeyboardFocus( GetUserFocusWindow() , &control ) ;
- return wxFindWindowFromWXWidget( (WXWidget) control ) ;
-#else
- return NULL;
-#endif
+ return wxFindWindowFromWXWidget(wxWidgetImpl::FindFocus());
}
void wxWindowMac::OnInternalIdle()
bool wxWindowMac::AcceptsFocus() const
{
- return m_peer->CanFocus() && wxWindowBase::AcceptsFocus();
+ if ( MacIsUserPane() )
+ return wxWindowBase::AcceptsFocus();
+ else
+ return m_peer->CanFocus();
}
void wxWindowMac::MacSuperChangedPosition()
return bounds ;
}
-bool wxWindowMac::OSXHandleClicked( double timestampsec )
+bool wxWindowMac::OSXHandleClicked( double WXUNUSED(timestampsec) )
{
return false;
}