Beispiel #1
0
void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating )
{
    // wxLogDebug(wxT("TopLevel=%p::MacActivate"),this);

    if(s_macDeactivateWindow==this)
        s_macDeactivateWindow=NULL;
    MacDelayedDeactivation(timestamp);
    wxActivateEvent event(wxEVT_ACTIVATE, inIsActivating , m_windowId);
    event.SetTimestamp(timestamp);
    event.SetEventObject(this);

    GetEventHandler()->ProcessEvent(event);

    UMAHighlightAndActivateWindow( (WindowRef)m_macWindow , inIsActivating ) ;

    // Early versions of MacOS X don't refresh backgrounds properly,
    // so refresh the whole window on activation and deactivation.
    long osVersion = UMAGetSystemVersion();
    if (osVersion >= 0x1000 && osVersion < 0x1020 )
    {
        Refresh(TRUE);
    }
    else
    {
        // for the moment we have to resolve some redrawing issues like this
        // the OS is stealing some redrawing areas as soon as it draws a control
        Refresh(TRUE);
    }
}
Beispiel #2
0
void wxMDIChildFrame::MacActivate(long timestamp, bool activating)
{
    wxLogTrace(TRACE_MDI, wxT("MDI child=%p  MacActivate(0x%08lx,%s)"),this, timestamp, activating ? wxT("ACTIV") : wxT("deact"));

    wxMDIParentFrame *mdiparent = wxDynamicCast(m_parent, wxMDIParentFrame);
    wxASSERT(mdiparent);

    if (activating)
    {
        if (s_macDeactivateWindow == m_parent)
        {
            wxLogTrace(TRACE_MDI, wxT("parent had been scheduled for deactivation, rehighlighting"));

            UMAHighlightAndActivateWindow((WindowRef)s_macDeactivateWindow->GetWXWindow(), true);

            wxLogTrace(TRACE_MDI, wxT("finished highliting parent"));

            s_macDeactivateWindow = NULL;
        }
        else if ((mdiparent->m_currentChild == this) || !s_macDeactivateWindow)
            mdiparent->wxFrame::MacActivate(timestamp, activating);

        if (mdiparent->m_currentChild && mdiparent->m_currentChild != this)
            mdiparent->m_currentChild->wxFrame::MacActivate(timestamp, false);
        mdiparent->m_currentChild = this;

        if (s_macDeactivateWindow == this)
        {
            wxLogTrace(TRACE_MDI, wxT("Avoided deactivation/activation of this=%p"), this);

            s_macDeactivateWindow = NULL;
        }
        else
            wxFrame::MacActivate(timestamp, activating);
    }
    else
    {
        // We were scheduled for deactivation, and now we do it.
        if (s_macDeactivateWindow == this)
        {
            s_macDeactivateWindow = NULL;
            wxFrame::MacActivate(timestamp, activating);
            if (mdiparent->m_currentChild == this)
                mdiparent->wxFrame::MacActivate(timestamp, activating);
        }
        else // schedule ourselves for deactivation
        {
            if (s_macDeactivateWindow)
            {
                wxLogTrace(TRACE_MDI, wxT("window=%p SHOULD have been deactivated, oh well!"), s_macDeactivateWindow);
            }
            wxLogTrace(TRACE_MDI, wxT("Scheduling delayed deactivation"));

            s_macDeactivateWindow = this;
        }
    }
}
Beispiel #3
0
void wxMDIParentFrame::MacActivate(long timestamp, bool activating)
{
    wxLogTrace(TRACE_MDI, wxT("MDI PARENT=%p MacActivate(0x%08lx,%s)"), this, timestamp, activating ? wxT("ACTIV") : wxT("deact"));

    if (activating)
    {
        if (s_macDeactivateWindow && s_macDeactivateWindow->GetParent() == this)
        {
            wxLogTrace(TRACE_MDI, wxT("child had been scheduled for deactivation, rehighlighting"));

            UMAHighlightAndActivateWindow((WindowRef)s_macDeactivateWindow->GetWXWindow(), true);

            wxLogTrace(TRACE_MDI, wxT("finished highliting child"));

            s_macDeactivateWindow = NULL;
        }
        else if (s_macDeactivateWindow == this)
        {
            wxLogTrace(TRACE_MDI, wxT("Avoided deactivation/activation of this=%p"), this);

            s_macDeactivateWindow = NULL;
        }
        else // window to deactivate is NULL or is not us or one of our kids
        {
            // activate kid instead
            if (m_currentChild)
                m_currentChild->MacActivate(timestamp, activating);
            else
                wxFrame::MacActivate(timestamp, activating);
        }
    }
    else
    {
        // We were scheduled for deactivation, and now we do it.
        if (s_macDeactivateWindow == this)
        {
            s_macDeactivateWindow = NULL;
            if (m_currentChild)
                m_currentChild->MacActivate(timestamp, activating);
            wxFrame::MacActivate(timestamp, activating);
        }
        else // schedule ourselves for deactivation
        {
            if (s_macDeactivateWindow)
            {
                wxLogTrace(TRACE_MDI, wxT("window=%p SHOULD have been deactivated, oh well!"), s_macDeactivateWindow);
            }
            wxLogTrace(TRACE_MDI, wxT("Scheduling delayed MDI Parent deactivation"));

            s_macDeactivateWindow = this;
        }
    }
}